5a52ed62 张雷

标准接口BUG修改

1 个父辈 636fed5a
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 }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!