Merge remote-tracking branch 'origin/master'
正在显示
9 个修改的文件
包含
136 行增加
和
7 行删除
... | @@ -90,10 +90,21 @@ public class FactoryCenterController { | ... | @@ -90,10 +90,21 @@ public class FactoryCenterController { |
90 | 90 | ||
91 | //厂区削减量统计 | 91 | //厂区削减量统计 |
92 | @ApiOperation(value="厂区削减量统计", notes="厂区削减量统计") | 92 | @ApiOperation(value="厂区削减量统计", notes="厂区削减量统计") |
93 | @GetMapping(value = "/getSzXjltj") | 93 | @GetMapping(value = "/getXjltj") |
94 | public Result<List<Map<String, Object>>> getSzXjltj(StatisticsParam statisticsParam) { | 94 | public Result<List<Map<String, Object>>> getSzXjltj(StatisticsParam statisticsParam) { |
95 | Result<List<Map<String, Object>>> result = new Result<List<Map<String, Object>>>(); | 95 | Result<List<Map<String, Object>>> result = new Result<List<Map<String, Object>>>(); |
96 | List<Map<String, Object>> list = factoryCenterService.getYhtj(statisticsParam); | 96 | List<Map<String, Object>> list = factoryCenterService.getSzXjltj(statisticsParam); |
97 | result.setSuccess(true); | ||
98 | result.setResult(list); | ||
99 | return result; | ||
100 | } | ||
101 | |||
102 | //厂区削减量统计 | ||
103 | @ApiOperation(value="厂区设备统计", notes="厂区设备统计") | ||
104 | @GetMapping(value = "/getEquiptj") | ||
105 | public Result<List<Map<String, Object>>> getEquiptj(StatisticsParam statisticsParam) { | ||
106 | Result<List<Map<String, Object>>> result = new Result<List<Map<String, Object>>>(); | ||
107 | List<Map<String, Object>> list = factoryCenterService.getEquiptj(statisticsParam); | ||
97 | result.setSuccess(true); | 108 | result.setSuccess(true); |
98 | result.setResult(list); | 109 | result.setResult(list); |
99 | return result; | 110 | return result; | ... | ... |
... | @@ -31,4 +31,9 @@ public interface FactoryCenterMapper { | ... | @@ -31,4 +31,9 @@ public interface FactoryCenterMapper { |
31 | @Param("startDateTb") String startDateTb, @Param("endDateTb") String endDateTb, | 31 | @Param("startDateTb") String startDateTb, @Param("endDateTb") String endDateTb, |
32 | @Param("departId") String departId, | 32 | @Param("departId") String departId, |
33 | @Param("view3a24") String view3a24, @Param("view3a24tb") String view3a24tb); | 33 | @Param("view3a24") String view3a24, @Param("view3a24tb") String view3a24tb); |
34 | |||
35 | List<Map<String, Object>> getSzXjltj(@Param("startDate") String startDate, @Param("endDate") String endDate, | ||
36 | @Param("departId") String departId, @Param("view2119") String view2119); | ||
37 | |||
38 | List<Map<String, Object>> getEquiptj(@Param("departId") String departId); | ||
34 | } | 39 | } | ... | ... |
... | @@ -252,5 +252,45 @@ | ... | @@ -252,5 +252,45 @@ |
252 | GROUP BY | 252 | GROUP BY |
253 | LEFT ( v.time, 7 ) | 253 | LEFT ( v.time, 7 ) |
254 | </select> | 254 | </select> |
255 | 255 | <select id="getSzXjltj" resultType="java.util.HashMap"> | |
256 | SELECT | ||
257 | LEFT(v2.time,7) time, | ||
258 | ROUND(SUM(IFNULL(JSCOD,0)) - SUM(IFNULL(CSCOD,0)),2) AS COD, | ||
259 | ROUND(SUM(IFNULL(JSAD,0)) - SUM(IFNULL(CSAD,0)),2) AS NH3N, | ||
260 | ROUND(SUM(IFNULL(JSZD,0)) - SUM(IFNULL(CSTN,0)),2) AS TN, | ||
261 | ROUND(SUM(IFNULL(JSZL,0)) - SUM(IFNULL(CSZL,0)),2) AS TP | ||
262 | FROM | ||
263 | ${view2119tb} v2 | ||
264 | WHERE | ||
265 | v2.time >= #{startDate} | ||
266 | AND v2.time <= #{endDate} | ||
267 | <if test="departId!=null and departId!=''"> | ||
268 | AND v2.depart_id in | ||
269 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
270 | '${item}' | ||
271 | </foreach> | ||
272 | </if> | ||
273 | GROUP BY LEFT(v2.time,7) | ||
274 | </select> | ||
275 | <select id="getEquiptj" resultType="java.util.HashMap"> | ||
276 | SELECT | ||
277 | d.id departId, | ||
278 | d.depart_name departName, | ||
279 | IFNULL( t.num, 0 ) total, | ||
280 | IFNULL( y.num, 0 ) one, | ||
281 | IFNULL( r.num, 0 ) two | ||
282 | FROM | ||
283 | sys_depart d | ||
284 | LEFT JOIN ( SELECT depart_id, count( id ) num FROM equipment_info GROUP BY depart_id ) t ON d.id = t.depart_id | ||
285 | LEFT JOIN ( SELECT depart_id, count( id ) num FROM equipment_info WHERE energy_level = 1 GROUP BY depart_id ) y ON d.id = y.depart_id | ||
286 | LEFT JOIN ( SELECT depart_id, count( id ) num FROM equipment_info WHERE energy_level = 2 GROUP BY depart_id ) r ON d.id = r.depart_id | ||
287 | WHERE | ||
288 | d.depart_type = 1 | ||
289 | <if test="departId!=null and departId!=''"> | ||
290 | AND d.id IN | ||
291 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
292 | '${item}' | ||
293 | </foreach> | ||
294 | </if> | ||
295 | </select> | ||
256 | </mapper> | 296 | </mapper> | ... | ... |
... | @@ -28,5 +28,9 @@ public interface IFactoryCenterService { | ... | @@ -28,5 +28,9 @@ public interface IFactoryCenterService { |
28 | Map<String, Object> getMonitorThreshold(String departId); | 28 | Map<String, Object> getMonitorThreshold(String departId); |
29 | 29 | ||
30 | Map<String, Object> getHourWaterData(StatisticsParam statisticsParam); | 30 | Map<String, Object> getHourWaterData(StatisticsParam statisticsParam); |
31 | |||
32 | List<Map<String, Object>> getSzXjltj(StatisticsParam statisticsParam); | ||
33 | |||
34 | List<Map<String, Object>> getEquiptj(StatisticsParam statisticsParam); | ||
31 | } | 35 | } |
32 | 36 | ... | ... |
... | @@ -531,6 +531,23 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { | ... | @@ -531,6 +531,23 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { |
531 | return map; | 531 | return map; |
532 | } | 532 | } |
533 | 533 | ||
534 | @Override | ||
535 | public List<Map<String, Object>> getSzXjltj(StatisticsParam statisticsParam) { | ||
536 | List<Map<String, Object>> list = new ArrayList<>(); | ||
537 | String startDate = statisticsParam.getStartDate(); | ||
538 | String endDate = statisticsParam.getEndDate(); | ||
539 | String dataView2119 = ReportViewUtil.buildView(view2119, "CSL", statisticsParam.getDepartId(), startDate, endDate); | ||
540 | list = factoryCenterMapper.getSzXjltj(startDate,endDate,statisticsParam.getDepartId(),dataView2119); | ||
541 | return list; | ||
542 | } | ||
543 | |||
544 | @Override | ||
545 | public List<Map<String, Object>> getEquiptj(StatisticsParam statisticsParam) { | ||
546 | List<Map<String, Object>> list = new ArrayList<>(); | ||
547 | list = factoryCenterMapper.getEquiptj(statisticsParam.getDepartId()); | ||
548 | return list; | ||
549 | } | ||
550 | |||
534 | /** | 551 | /** |
535 | * 获取时间之间的月份 | 552 | * 获取时间之间的月份 |
536 | * @param start | 553 | * @param start | ... | ... |
1 | package com.skua.modules.job; | ||
2 | |||
3 | import com.skua.modules.report.service.IReportDataService; | ||
4 | import lombok.extern.slf4j.Slf4j; | ||
5 | import org.quartz.Job; | ||
6 | import org.quartz.JobExecutionContext; | ||
7 | import org.springframework.beans.factory.annotation.Autowired; | ||
8 | |||
9 | /** | ||
10 | * 发送消息任务 | ||
11 | */ | ||
12 | |||
13 | @Slf4j | ||
14 | public class NFDataSyncJob implements Job { | ||
15 | |||
16 | @Autowired | ||
17 | private IReportDataService reportDataService; | ||
18 | //水质水量报表 | ||
19 | private static final String SZSL = "2119ecbf53a1d2d0708258ff67cfd9e1"; | ||
20 | //化验日报 | ||
21 | private static final String HYRB = "9bffaf9187093d6e6a4390e8c56acca8"; | ||
22 | |||
23 | @Override | ||
24 | public void execute(JobExecutionContext jobExecutionContext) { | ||
25 | log.info("开始同步昨日恩菲的数据入报表"); | ||
26 | // String yesterday = DateUtils.getYesterday(); | ||
27 | // Map<String, String> data = new HashMap<>(); | ||
28 | // String departId = ""; | ||
29 | // data.put("JSZL", ""); | ||
30 | // data.put("departId", "departId"); | ||
31 | // data.put("reportId", SZSL); | ||
32 | // data.put("time",yesterday); | ||
33 | // reportDataService.insertOrUpdateReportData(departId, yesterday, data, SZSL); | ||
34 | log.info("同步昨日恩菲的数据入报表完成"); | ||
35 | } | ||
36 | |||
37 | } |
... | @@ -797,7 +797,7 @@ public class SysFactoryInfoController { | ... | @@ -797,7 +797,7 @@ public class SysFactoryInfoController { |
797 | if (sysFactoryInfo == null) { | 797 | if (sysFactoryInfo == null) { |
798 | result.error500("未找到对应实体"); | 798 | result.error500("未找到对应实体"); |
799 | } else { | 799 | } else { |
800 | map = sysFactoryInfoService.queryLevel(sysFactoryInfo.getInLevel(),sysFactoryInfo.getOutLevel()); | 800 | map = sysFactoryInfoService.queryLevel(sysFactoryInfo.getInLevel(),sysFactoryInfo.getOutLevel(),departId); |
801 | result.setResult(map); | 801 | result.setResult(map); |
802 | result.setSuccess(true); | 802 | result.setSuccess(true); |
803 | } | 803 | } | ... | ... |
... | @@ -114,5 +114,5 @@ public interface ISysFactoryInfoService extends IService<SysFactoryInfo> { | ... | @@ -114,5 +114,5 @@ public interface ISysFactoryInfoService extends IService<SysFactoryInfo> { |
114 | * @param outLevel | 114 | * @param outLevel |
115 | * @return | 115 | * @return |
116 | */ | 116 | */ |
117 | Map<String, Object> queryLevel(String inLevel, String outLevel); | 117 | Map<String, Object> queryLevel(String inLevel, String outLevel, String departId); |
118 | } | 118 | } | ... | ... |
... | @@ -678,15 +678,30 @@ public class SysFactoryInfoServiceImpl extends ServiceImpl<SysFactoryInfoMapper, | ... | @@ -678,15 +678,30 @@ public class SysFactoryInfoServiceImpl extends ServiceImpl<SysFactoryInfoMapper, |
678 | } | 678 | } |
679 | 679 | ||
680 | @Override | 680 | @Override |
681 | public Map<String, Object> queryLevel(String inLevel, String outLevel) { | 681 | public Map<String, Object> queryLevel(String inLevel, String outLevel, String departId) { |
682 | List<AlarmParamStandardConfig> inNewList = new ArrayList<>(); | ||
682 | Map<String, Object> map = new HashMap<>(); | 683 | Map<String, Object> map = new HashMap<>(); |
683 | QueryWrapper<AlarmParamStandardConfig> inQueryWrapper = new QueryWrapper<>(); | 684 | QueryWrapper<AlarmParamStandardConfig> inQueryWrapper = new QueryWrapper<>(); |
684 | inQueryWrapper.eq("del_flag", 1).eq("alarm_level_standard_id", inLevel); | 685 | inQueryWrapper.eq("del_flag", 1).eq("alarm_level_standard_id", inLevel); |
685 | List<AlarmParamStandardConfig> inList = alarmParamStandardConfigService.list(inQueryWrapper); | 686 | List<AlarmParamStandardConfig> inList = alarmParamStandardConfigService.list(inQueryWrapper); |
687 | Map<String,Object> inLevelMap = new HashMap<>(); | ||
688 | List<WaterQualityInLevel> inLevelList = sysFactoryInfoMapper.getWaterQualityInLevel(departId); | ||
689 | for (WaterQualityInLevel level : inLevelList) { | ||
690 | inLevelMap.put(level.getIndexCode(),level); | ||
691 | } | ||
692 | for (AlarmParamStandardConfig config : inList) { | ||
693 | String code = config.getAlarmParamCode(); | ||
694 | if(inLevelMap.get(code) != null){ | ||
695 | WaterQualityInLevel inLevelBean = (WaterQualityInLevel)inLevelMap.get(code); | ||
696 | config.setAlarmParamLowerLimit(inLevelBean.getLower()); | ||
697 | config.setAlarmParamUpperLimit(inLevelBean.getUpper()); | ||
698 | } | ||
699 | inNewList.add(config); | ||
700 | } | ||
686 | QueryWrapper<AlarmParamStandardConfig> outQueryWrapper = new QueryWrapper<>(); | 701 | QueryWrapper<AlarmParamStandardConfig> outQueryWrapper = new QueryWrapper<>(); |
687 | outQueryWrapper.eq("del_flag", 1).eq("alarm_level_standard_id", outLevel); | 702 | outQueryWrapper.eq("del_flag", 1).eq("alarm_level_standard_id", outLevel); |
688 | List<AlarmParamStandardConfig> outList = alarmParamStandardConfigService.list(outQueryWrapper); | 703 | List<AlarmParamStandardConfig> outList = alarmParamStandardConfigService.list(outQueryWrapper); |
689 | map.put("in",inList); | 704 | map.put("in",inNewList); |
690 | map.put("out",outList); | 705 | map.put("out",outList); |
691 | return map; | 706 | return map; |
692 | } | 707 | } | ... | ... |
-
请 注册 或 登录 后发表评论