Browse Source

修改日志统计

zhongwei
段飞宇 2 years ago
parent
commit
36d1c69a1d
  1. 6
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/StatisticsServiceImpl.java
  2. 9
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/vo/SysLogStatisticsVo.java

6
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/StatisticsServiceImpl.java

@ -21,6 +21,7 @@ import org.apache.xmlbeans.StringEnumAbstractBase;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
@ -64,16 +65,21 @@ public class StatisticsServiceImpl extends ServiceImpl<StatisticsMapper, Statist
Statistics statistics = this.getStatisticsBydateCalculated(sysLogStatisticsVo);
//如果为空保存数据,如果不为空更新数据
if (statistics == null) {
log.info("执行功能应用统计保存操作....");
statistics = new Statistics();
statistics.setSort(this.getModuleName(sysLogStatisticsVo.getModuleName()));
statistics.setDateCalculated(sysLogStatisticsVo.getOperationTime());
statistics.setModuleNameNum(sysLogStatisticsVo.getModuleNameCount());
statistics.setModuleName(sysLogStatisticsVo.getModuleName());
statistics.setCreateTime(LocalDateTime.now());
statistics.setUpdateTime(LocalDateTime.now());
this.save(statistics);
} else {
log.info("执行功能应用统计更新操作....");
statistics.setSort(this.getModuleName(sysLogStatisticsVo.getModuleName()));
statistics.setModuleName(sysLogStatisticsVo.getModuleName());
statistics.setModuleNameNum(sysLogStatisticsVo.getModuleNameCount());
statistics.setUpdateTime(LocalDateTime.now());
this.updateById(statistics);
}
}

9
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/vo/SysLogStatisticsVo.java

@ -40,13 +40,4 @@ public class SysLogStatisticsVo {
private Integer moduleNameCount;
/**
* 根据路径统计
*/
private String path;
/**
* 根据路径统计
*/
private Integer pathCount;
}

Loading…
Cancel
Save