5a52ed62 张雷

标准接口BUG修改

1 个父辈 636fed5a
package com.skua.modules.job;
import com.skua.modules.report.service.IReportDataService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.springframework.beans.factory.annotation.Autowired;
/**
* 发送消息任务
*/
@Slf4j
public class NFDataSyncJob implements Job {
@Autowired
private IReportDataService reportDataService;
//水质水量报表
private static final String SZSL = "2119ecbf53a1d2d0708258ff67cfd9e1";
//化验日报
private static final String HYRB = "9bffaf9187093d6e6a4390e8c56acca8";
@Override
public void execute(JobExecutionContext jobExecutionContext) {
log.info("开始同步昨日恩菲的数据入报表");
// String yesterday = DateUtils.getYesterday();
// Map<String, String> data = new HashMap<>();
// String departId = "";
// data.put("JSZL", "");
// data.put("departId", "departId");
// data.put("reportId", SZSL);
// data.put("time",yesterday);
// reportDataService.insertOrUpdateReportData(departId, yesterday, data, SZSL);
log.info("同步昨日恩菲的数据入报表完成");
}
}
......@@ -797,7 +797,7 @@ public class SysFactoryInfoController {
if (sysFactoryInfo == null) {
result.error500("未找到对应实体");
} else {
map = sysFactoryInfoService.queryLevel(sysFactoryInfo.getInLevel(),sysFactoryInfo.getOutLevel());
map = sysFactoryInfoService.queryLevel(sysFactoryInfo.getInLevel(),sysFactoryInfo.getOutLevel(),departId);
result.setResult(map);
result.setSuccess(true);
}
......
......@@ -114,5 +114,5 @@ public interface ISysFactoryInfoService extends IService<SysFactoryInfo> {
* @param outLevel
* @return
*/
Map<String, Object> queryLevel(String inLevel, String outLevel);
Map<String, Object> queryLevel(String inLevel, String outLevel, String departId);
}
......
......@@ -678,15 +678,30 @@ public class SysFactoryInfoServiceImpl extends ServiceImpl<SysFactoryInfoMapper,
}
@Override
public Map<String, Object> queryLevel(String inLevel, String outLevel) {
public Map<String, Object> queryLevel(String inLevel, String outLevel, String departId) {
List<AlarmParamStandardConfig> inNewList = new ArrayList<>();
Map<String, Object> map = new HashMap<>();
QueryWrapper<AlarmParamStandardConfig> inQueryWrapper = new QueryWrapper<>();
inQueryWrapper.eq("del_flag", 1).eq("alarm_level_standard_id", inLevel);
List<AlarmParamStandardConfig> inList = alarmParamStandardConfigService.list(inQueryWrapper);
Map<String,Object> inLevelMap = new HashMap<>();
List<WaterQualityInLevel> inLevelList = sysFactoryInfoMapper.getWaterQualityInLevel(departId);
for (WaterQualityInLevel level : inLevelList) {
inLevelMap.put(level.getIndexCode(),level);
}
for (AlarmParamStandardConfig config : inList) {
String code = config.getAlarmParamCode();
if(inLevelMap.get(code) != null){
WaterQualityInLevel inLevelBean = (WaterQualityInLevel)inLevelMap.get(code);
config.setAlarmParamLowerLimit(inLevelBean.getLower());
config.setAlarmParamUpperLimit(inLevelBean.getUpper());
}
inNewList.add(config);
}
QueryWrapper<AlarmParamStandardConfig> outQueryWrapper = new QueryWrapper<>();
outQueryWrapper.eq("del_flag", 1).eq("alarm_level_standard_id", outLevel);
List<AlarmParamStandardConfig> outList = alarmParamStandardConfigService.list(outQueryWrapper);
map.put("in",inList);
map.put("in",inNewList);
map.put("out",outList);
return map;
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!