|
@@ -1,7 +1,6 @@
|
|
|
package org.jeecg.modules.homePageData.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
-import org.jeecg.common.util.DateUtils;
|
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
|
import org.jeecg.modules.common.ModelCodeContant;
|
|
|
import org.jeecg.modules.deviceLesm.entity.DeviceInformation;
|
|
@@ -16,6 +15,7 @@ import org.jeecg.modules.fpgLeanModel.entity.FpgLeanModel;
|
|
|
import org.jeecg.modules.fpgLeanModel.service.IFpgLeanModelService;
|
|
|
import org.jeecg.modules.gatherData.mapper.FpgGatherDataMapper;
|
|
|
import org.jeecg.modules.homePageData.entity.LeanEventWarnInfoResult;
|
|
|
+import org.jeecg.modules.homePageData.entity.ViolationStatisticsResult;
|
|
|
import org.jeecg.modules.homePageData.mapper.LeanEventWarnInfoMapper;
|
|
|
import org.jeecg.modules.homePageData.service.IHomePageDataService;
|
|
|
import org.jeecg.modules.systemConfig.peaksAndValleysTimeConfig.entity.PeaksAndValleysTimeConfig;
|
|
@@ -164,16 +164,16 @@ public class HomePageDataServiceImpl implements IHomePageDataService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<Map<String, String>> illegalMetering(String modelId) {
|
|
|
+ public List<Map<String, String>> illegalMetering() {
|
|
|
List<Map<String, String>> res = new ArrayList<>();
|
|
|
- String leanModelCode = queryLeanModelCodeById(modelId);
|
|
|
-
|
|
|
List<DeviceRegion> list = deviceRegionService.list();
|
|
|
list.forEach(deviceRegion -> {
|
|
|
Map<String,String> map = new HashMap<>();
|
|
|
- map.put("name",deviceRegion.getRegionTitle());
|
|
|
- map.put("month",((int)(Math.random()*50+50))+"");
|
|
|
- map.put("day",((int)(Math.random()*20))+"");
|
|
|
+ ViolationStatisticsResult dayViolationStatisticsResult = leanEventWarnInfoMapper.queryViolationDayStatistics(deviceRegion.getId());
|
|
|
+ ViolationStatisticsResult monthViolationStatisticsResult = leanEventWarnInfoMapper.queryViolationMonthStatistics(deviceRegion.getId(), new Date());
|
|
|
+ map.put("name", deviceRegion.getRegionTitle());
|
|
|
+ map.put("month", String.valueOf(oConvertUtils.isEmpty(monthViolationStatisticsResult) ? 0 : monthViolationStatisticsResult.getCounts()));
|
|
|
+ map.put("day", String.valueOf(oConvertUtils.isEmpty(dayViolationStatisticsResult) ? 0 : dayViolationStatisticsResult.getCounts()));
|
|
|
res.add(map);
|
|
|
});
|
|
|
return res;
|