鞍钢鲅鱼圈能源管控系统后端代码
潘志宝
昨天 bd0f24fb70621ea26dc6fd4c41b391620ab583dd
ansteel-biz/src/main/java/com/iailab/module/ansteel/job/task/RunCokingTraceModelGXJTask.java
@@ -18,7 +18,6 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.*;
@@ -106,25 +105,42 @@
        logger.info("RunCokingTraceModelGXJTask,参数为:{}", params);
        try {
            Calendar calendar = Calendar.getInstance();
            calendar.set(Calendar.MILLISECOND, 0);
            calendar.set(Calendar.SECOND, 0);
            calendar.set(Calendar.MINUTE, 0);
            int hour = calendar.get(Calendar.HOUR_OF_DAY);
            String yesterday = DateUtils.format(DateUtils.addDateDays(new Date(), -1), DateUtils.FORMAT_YEAR_MONTH_DAY);
            Date startDate = calendar.getTime();
            Date endDate = calendar.getTime();
            String clock = "";
            String analyClass = "";
            if (hour == 0) {
                clock = yesterday.concat("-").concat("A");
            if (hour >= 8 && hour < 16) {
                calendar.set(Calendar.HOUR_OF_DAY, 0);
                startDate = calendar.getTime();
                calendar.add(Calendar.HOUR_OF_DAY, 8);
                endDate = calendar.getTime();
                clock = DateUtils.format(startDate).concat("-").concat("A");
                analyClass = "甲班";
            } else if (hour == 8) {
                clock = yesterday.concat("-").concat("B");
            } else if (hour >= 16 && hour < 24) {
                calendar.set(Calendar.HOUR_OF_DAY, 8);
                startDate = calendar.getTime();
                calendar.add(Calendar.HOUR_OF_DAY, 8);
                endDate = calendar.getTime();
                clock = DateUtils.format(startDate).concat("-").concat("B");
                analyClass = "乙班";
            } else if (hour == 16) {
                clock = yesterday.concat("-").concat("C");
            } else if (hour >= 0 && hour < 8) {
                calendar.add(Calendar.DAY_OF_YEAR, -1);
                calendar.set(Calendar.HOUR_OF_DAY, 16);
                startDate = calendar.getTime();
                calendar.add(Calendar.HOUR_OF_DAY, 8);
                endDate = calendar.getTime();
                clock = DateUtils.format(startDate).concat("-").concat("B");
                analyClass = "丙班";
            }
            Map<String, Object> tMap = new HashMap<>();
            tMap.put("relId", UUID.randomUUID().toString());
            tMap.put("process", "干熄焦工序");
            tMap.put("reportName", "锅炉蒸汽产量");
            tMap.put("analyDate", yesterday);
            tMap.put("analyDate", DateUtils.format(startDate));
            tMap.put("analyClass", analyClass);
            tMap.put("clock", clock);
            tMap.put("analyContent", "干熄焦产蒸汽量异常");
@@ -167,7 +183,7 @@
                CokingTraceSuggestEntity suggestEntity = new CokingTraceSuggestEntity();
                suggestEntity.setRelId(tMap.get("relId").toString());
                suggestEntity.setProcess(tMap.get("process").toString());
                suggestEntity.setSugObj("GXJ");
                suggestEntity.setSugObj(i+"#");
                suggestEntity.setClock(tMap.get("clock").toString());
                suggestEntity.setContent(steamTotal);
                suggestEntity.setCreateDate(new Date());
@@ -191,7 +207,7 @@
                    deviationEntity.setRelId(tMap.get("relId").toString());
                    deviationEntity.setProcess(tMap.get("process").toString());
                    deviationEntity.setClock(tMap.get("clock").toString());
                    deviationEntity.setSugObj("GXJ");
                    deviationEntity.setSugObj("1#");
                    deviationEntity.setGroupName(steamFirstColoumMap.get("steamFirstColoum"+i).toString());
                    deviationEntity.setIndName(steamIndexMaps.get(element.get(0).toString()));
                    deviationEntity.setIndValue(element.get(1).toString());
@@ -212,7 +228,7 @@
                    deviationEntity.setRelId(tMap.get("relId").toString());
                    deviationEntity.setProcess(tMap.get("process").toString());
                    deviationEntity.setClock(tMap.get("clock").toString());
                    deviationEntity.setSugObj("GXJ");
                    deviationEntity.setSugObj("2#");
                    deviationEntity.setGroupName(steamSecondColoumMap.get("steamSecondColoum" + i).toString());
                    deviationEntity.setIndName(steamIndexMaps.get(element.get(0).toString()));
                    deviationEntity.setIndValue(element.get(1).toString());