|
|
|
@ -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); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|