文件名从 ansteel-biz/src/main/java/com/iailab/module/ansteel/job/task/RunCokingTraceModel3Task.java 修改 |
| | |
| | | * @Description |
| | | * @createTime 2025年04月21日 |
| | | */ |
| | | @Component("runCokingTraceModel3Task") |
| | | public class RunCokingTraceModel3Task implements ITask { |
| | | @Component("runCokingTraceModelLJTask") |
| | | public class RunCokingTraceModelLJTask implements ITask { |
| | | private Logger logger = LoggerFactory.getLogger(getClass()); |
| | | |
| | | @Autowired |
| | |
| | | "}"; |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void run(String params) { |
| | | logger.info("RunCokingTraceModel3Task,参数为:{}", params); |
| | | logger.info("RunCokingTraceModelLJTask,参数为:{}", params); |
| | | try { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | |
| | | calendar.set(Calendar.MINUTE,0); |
| | | calendar.add(Calendar.DAY_OF_YEAR, -1); |
| | | String yesterday = DateUtils.format(calendar.getTime(), DateUtils.FORMAT_YEAR_MONTH_DAY); |
| | | // int hour = calendar.get(Calendar.HOUR_OF_DAY); |
| | | int hour = calendar.get(Calendar.HOUR_OF_DAY); |
| | | Date startDate = calendar.getTime(); |
| | | calendar.add(Calendar.HOUR, 8); |
| | | Date endDate = calendar.getTime(); |
| | | int hour = 8; |
| | | String clock = ""; |
| | | String analyClass = ""; |
| | | if (hour == 0) { |
| | |
| | | saveTraceChart(tMap,result,startDate,endDate); |
| | | } |
| | | } catch (Exception ex) { |
| | | logger.error("RunCokingTraceModel3Task运行异常"); |
| | | logger.error("RunCokingTraceModelLJTask运行异常"); |
| | | ex.printStackTrace(); |
| | | } |
| | | logger.info("RunCokingTraceModel3Task运行完成"); |
| | | logger.info("RunCokingTraceModelLJTask运行完成"); |
| | | } |
| | | |
| | | private void saveTraceReport(Map<String, Object> tMap,JSONObject result) { |
| | | public void saveTraceReport(Map<String, Object> tMap,JSONObject result) { |
| | | CokingTraceReportEntity reportEntity = new CokingTraceReportEntity(); |
| | | reportEntity.setId(tMap.get("relId").toString()); |
| | | reportEntity.setProcess(tMap.get("process").toString()); |
| | |
| | | cokingTraceReportService.save(reportEntity); |
| | | } |
| | | |
| | | private void saveTraceSuggest(Map<String, Object> tMap,JSONObject result) { |
| | | public void saveTraceSuggest(Map<String, Object> tMap,JSONObject result) { |
| | | String cokeTotal = result.get("cokeTotal").toString(); |
| | | if(StringUtils.isNotBlank(cokeTotal)){ |
| | | CokingTraceSuggestEntity suggestEntity = new CokingTraceSuggestEntity(); |
| | |
| | | } |
| | | } |
| | | |
| | | private void saveTraceDeviation(Map<String, Object> tMap,JSONObject result) { |
| | | public void saveTraceDeviation(Map<String, Object> tMap,JSONObject result) { |
| | | List<ChartParamDTO> list = mcsApi.getChartParamList(CommonConstant.COKE_INDEX_CHARTCODE); |
| | | Map<String, String> steamIndexMaps = list.stream().collect(Collectors.toMap(ChartParamDTO::getParamCode, e -> e.getParamValue())); |
| | | Map<String, String> steamIndexMaps = list.stream().collect(Collectors.toMap(ChartParamDTO::getParamCode, e -> e.getParamName())); |
| | | for(int i=0;i<=5;i++){ |
| | | String cokeColoum = result.get("cokeColoum"+i).toString(); |
| | | if(StringUtils.isNotBlank(cokeColoum)){ |
| | |
| | | deviationEntity.setSugObj("LJ"); |
| | | deviationEntity.setGroupName(cokeColoumMap.get("cokeColoum"+i).toString()); |
| | | deviationEntity.setIndName(steamIndexMaps.get(element.get(0).toString())); |
| | | // deviationEntity.setIndName(element.get(0).toString()); |
| | | deviationEntity.setIndValue(element.get(1).toString()); |
| | | deviationEntity.setCreateDate(new Date()); |
| | | cokingTraceDeviationService.save(deviationEntity); |
| | |
| | | } |
| | | } |
| | | |
| | | private void saveAnalyInd(Map<String, Object> tMap,JSONObject result) { |
| | | public void saveAnalyInd(Map<String, Object> tMap,JSONObject result) { |
| | | String[] analyContent = tMap.get("analyContent").toString().split(";"); |
| | | for(int i=0;i<analyContent.length;i++){ |
| | | CokingAnalyIndEntity analyIndEntity = new CokingAnalyIndEntity(); |
| | |
| | | } |
| | | } |
| | | |
| | | private void saveTraceInd(Map<String, Object> tMap,JSONObject result) { |
| | | public void saveTraceInd(Map<String, Object> tMap,JSONObject result) { |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("indType","炼焦工序异常溯源"); |
| | | List<CokingTraceConfEntity> list = cokingTraceConfService.list(map); |
| | |
| | | cokingTraceIndEntity.setRelId(tMap.get("relId").toString()); |
| | | cokingTraceIndEntity.setTitle(conf.getIndType()); |
| | | cokingTraceIndEntity.setClock(tMap.get("clock").toString()); |
| | | cokingTraceIndEntity.setIndCode(conf.getIndCode()); |
| | | cokingTraceIndEntity.setIndName(conf.getIndName()); |
| | | cokingTraceIndEntity.setIndValue(value); |
| | | cokingTraceIndEntity.setIndUnit(conf.getIndUnit()); |
| | |
| | | } |
| | | } |
| | | |
| | | private void saveTraceChart(Map<String, Object> tMap, JSONObject result,Date startDate,Date endDate) { |
| | | public void saveTraceChart(Map<String, Object> tMap, JSONObject result,Date startDate,Date endDate) { |
| | | historyPointMap.forEach((key,value) ->{ |
| | | CokingTraceChartEntity cokingTraceChartEntity = new CokingTraceChartEntity(); |
| | | cokingTraceChartEntity.setRelId(tMap.get("relId").toString()); |