鞍钢鲅鱼圈能源管控系统后端代码
liriming
2 天以前 2debc39d13bdce031221294b19750eea8ed53d49
Merge remote-tracking branch 'origin/master'
已修改9个文件
已添加1个文件
149 ■■■■■ 文件已修改
ansteel-biz/src/main/java/com/iailab/module/ansteel/api/controller/admin/GasController.java 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ansteel-biz/src/main/java/com/iailab/module/ansteel/api/dto/GasLdgCulRespDTO.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ansteel-biz/src/main/java/com/iailab/module/ansteel/coking/dto/CokingOverviewDTO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ansteel-biz/src/main/java/com/iailab/module/ansteel/coking/entity/CokingOverviewEntity.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ansteel-biz/src/main/java/com/iailab/module/ansteel/coking/service/impl/CokingOverviewServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ansteel-biz/src/main/java/com/iailab/module/ansteel/common/enums/SubProcessTypeEnum.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ansteel-biz/src/main/java/com/iailab/module/ansteel/job/task/RunDayScheduleModuleTask.java 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
doc/设计文档/鲅鱼圈钢铁分公司能源管控智能化提升项目-详细设计说明书(模版).doc 补丁 | 查看 | 原始文档 | blame | 历史
doc/设计文档/鲅鱼圈钢铁分公司能源管控智能化提升项目-需求分析说明书(模版).docx 补丁 | 查看 | 原始文档 | blame | 历史
doc/鞍钢数据接口文档_master.doc 补丁 | 查看 | 原始文档 | blame | 历史
ansteel-biz/src/main/java/com/iailab/module/ansteel/api/controller/admin/GasController.java
@@ -1,19 +1,25 @@
package com.iailab.module.ansteel.api.controller.admin;
import com.iailab.framework.common.pojo.CommonResult;
import com.iailab.module.ansteel.api.dto.PowerNetFactorDTO;
import com.iailab.framework.common.util.date.DateUtils;
import com.iailab.module.ansteel.api.dto.GasLdgCulRespDTO;
import com.iailab.module.ansteel.api.dto.PreDataViewSimpleDTO;
import com.iailab.module.ansteel.gas.entity.GasPredConfEntity;
import com.iailab.module.ansteel.gas.service.GasPredConfService;
import com.iailab.module.ansteel.power.entity.PowerNetFactorEntity;
import com.iailab.module.ansteel.page.service.PageParamService;
import com.iailab.module.model.api.mcs.McsApi;
import com.iailab.module.model.api.mcs.dto.PreDataJsonReqVO;
import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -32,9 +38,66 @@
    @Autowired
    private GasPredConfService gasPredConfService;
    @Autowired
    private PageParamService pageParamService;
    @Autowired
    private McsApi mcsApi;
    @GetMapping("/pred-conf/list")
    @Operation(summary = "煤气预测配置")
    public CommonResult<List<PreDataViewSimpleDTO>> getGasPredConfList(@RequestParam Map<String, Object> params) {
        return CommonResult.success(gasPredConfService.list(params));
    }
    @GetMapping("/ldg/cul")
    @Operation(summary = "获取转炉煤气回收消耗总量")
    public CommonResult<GasLdgCulRespDTO> getGasLdgCul(@RequestParam Map<String, Object> params) {
        GasLdgCulRespDTO result = new GasLdgCulRespDTO();
        String type = (String) params.get("type");
        String predictTime = (String) params.get("predictTime");
        if (StringUtils.isBlank(type) || StringUtils.isBlank(predictTime)) {
            return CommonResult.success(result);
        }
        PreDataJsonReqVO reqVO = new PreDataJsonReqVO();
        reqVO.setPredictTime(DateUtils.parse(predictTime, DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND));
        List<String> outputIdList = new ArrayList<>();
        String xhOut = pageParamService.getValue("iLDG_XH_" + type);
        if (StringUtils.isNotBlank(xhOut)) {
            outputIdList.add(xhOut);
        }
        String hsOut = pageParamService.getValue("iLDG_HS_" + type);
        if (StringUtils.isNotBlank(hsOut)) {
            outputIdList.add(hsOut);
        }
        reqVO.setOutputIdList(outputIdList);
        if (CollectionUtils.isEmpty(outputIdList)) {
            return CommonResult.success(result);
        }
        log.info("getPreDataCur,reqVO={}", reqVO);
        Map<String, List<Object[]>> preData = mcsApi.getPreDataCur(reqVO);
        if (CollectionUtils.isEmpty(preData)) {
            return CommonResult.success(result);
        }
        if (preData.containsKey(xhOut)) {
            List<Object[]> data = preData.get(xhOut);
            double total = 0.0;
            for (int i = 0; i < data.size(); i++) {
                Object[] obj = data.get(i);
                total = total + new BigDecimal(obj[1].toString()).doubleValue();
            }
            result.setXh(new BigDecimal(total).divide(new BigDecimal(60), 2, BigDecimal.ROUND_HALF_UP));
        }
        if (preData.containsKey(hsOut)) {
            List<Object[]> data = preData.get(hsOut);
            double total = 0.0;
            for (int i = 0; i < data.size(); i++) {
                Object[] obj = data.get(i);
                total = total + new BigDecimal(obj[1].toString()).doubleValue();
            }
            result.setHs(new BigDecimal(total).divide(new BigDecimal(60), 2, BigDecimal.ROUND_HALF_UP));
        }
        return CommonResult.success(result);
    }
}
ansteel-biz/src/main/java/com/iailab/module/ansteel/api/dto/GasLdgCulRespDTO.java
对比新文件
@@ -0,0 +1,24 @@
package com.iailab.module.ansteel.api.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
 * @author PanZhibao
 * @Description
 * @createTime 2025年06月26日
 */
@Schema(description = "转炉煤气回收消耗总量")
@Data
public class GasLdgCulRespDTO implements Serializable {
    private static final long serialVersionUID = 1L;
    @Schema(description = "消耗总量")
    private BigDecimal xh;
    @Schema(description = "回收总量")
    private BigDecimal hs;
}
ansteel-biz/src/main/java/com/iailab/module/ansteel/coking/dto/CokingOverviewDTO.java
@@ -73,6 +73,10 @@
     */
    private BigDecimal powerC;
    /**
     * 电力产生
     */
    private BigDecimal powerP;
    /**
     * 电力单耗
     */
    private BigDecimal powerOnlyC;
ansteel-biz/src/main/java/com/iailab/module/ansteel/coking/entity/CokingOverviewEntity.java
@@ -67,6 +67,10 @@
     */
    private BigDecimal powerC;
    /**
     * 电力产生
     */
    private BigDecimal powerP;
    /**
     * 电力单耗
     */
    private BigDecimal powerOnlyC;
ansteel-biz/src/main/java/com/iailab/module/ansteel/coking/service/impl/CokingOverviewServiceImpl.java
@@ -72,7 +72,7 @@
        QueryWrapper<CokingOverviewEntity> queryWrapperMonth = new QueryWrapper<>();
        queryWrapperMonth.eq("process_type", processType);
        queryWrapperMonth.between("clock", monthStartClock,clock);
        queryWrapperMonth.select("sub_process_type","ROUND(AVG(steam_p)*30, 2) as steam_p","ROUND(AVG(dj_steam_p)*30, 2) as dj_steam_p","ROUND(AVG(steam_c)*30, 2) as steam_c","ROUND(AVG(steam_only_c)*30, 2) as steam_only_c","ROUND(AVG(steam_v)*30, 2) as steam_v","ROUND(AVG(gas_p)*30, 2) as gas_p","ROUND(AVG(gas_c)*30, 2) as gas_c","ROUND(AVG(power_c)*30, 2) as power_c","ROUND(AVG(power_only_c)*30, 2) as power_only_c","ROUND(AVG(power_c_standard)*30, 2) as power_c_standard","ROUND(AVG(idle_time)*30, 0) as idle_time","ROUND(AVG(bfg_c)*30, 2) as bfg_c","ROUND(AVG(cog_p)*30, 2) as cog_p","ROUND(AVG(cog_c)*30, 2) as cog_c","ROUND(AVG(bfg_only_c)*30, 2) as bfg_only_c","ROUND(AVG(cog_only_c)*30, 2) as cog_only_c","ROUND(AVG(gxls)*30, 0) as gxls","ROUND(AVG(run_time)*30, 0) as run_time","ROUND(AVG(work_ratio), 2) as work_ratio")
        queryWrapperMonth.select("sub_process_type","ROUND(AVG(steam_p)*30, 2) as steam_p","ROUND(AVG(dj_steam_p)*30, 2) as dj_steam_p","ROUND(AVG(steam_c)*30, 2) as steam_c","ROUND(AVG(steam_only_c)*30, 2) as steam_only_c","ROUND(AVG(steam_v)*30, 2) as steam_v","ROUND(AVG(gas_p)*30, 2) as gas_p","ROUND(AVG(gas_c)*30, 2) as gas_c","ROUND(AVG(power_c)*30, 2) as power_c","ROUND(AVG(power_p)*30, 2) as power_p","ROUND(AVG(power_only_c)*30, 2) as power_only_c","ROUND(AVG(power_c_standard)*30, 2) as power_c_standard","ROUND(AVG(idle_time)*30, 0) as idle_time","ROUND(AVG(bfg_c)*30, 2) as bfg_c","ROUND(AVG(cog_p)*30, 2) as cog_p","ROUND(AVG(cog_c)*30, 2) as cog_c","ROUND(AVG(bfg_only_c)*30, 2) as bfg_only_c","ROUND(AVG(cog_only_c)*30, 2) as cog_only_c","ROUND(AVG(gxls)*30, 0) as gxls","ROUND(AVG(run_time)*30, 0) as run_time","ROUND(AVG(work_ratio), 2) as work_ratio")
                .groupBy("sub_process_type");
        List<CokingOverviewEntity> monthList = cokingOverviewDao.selectList(queryWrapperMonth);
ansteel-biz/src/main/java/com/iailab/module/ansteel/common/enums/SubProcessTypeEnum.java
@@ -29,6 +29,8 @@
    GXJ_1("GXJ_1", "1#干熄焦"),
    GXJ_2("GXJ_2", "2#干熄焦"),
    GXJ_3("GXJ_3", "3#干熄焦"),
    MW_15_1("MW_15_1", "1#15MW机组"),
    MW_15_2("MW_15_2", "2#15MW机组"),
    BMGX("BMGX", "备煤工序"),
    JLLQ("JLLQ", "焦炉炉区"),
    GXJ("GXJ", "干熄焦"),
ansteel-biz/src/main/java/com/iailab/module/ansteel/job/task/RunDayScheduleModuleTask.java
@@ -1,7 +1,5 @@
package com.iailab.module.ansteel.job.task;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.iailab.module.model.api.mcs.McsApi;
import com.iailab.module.model.api.mcs.dto.ScheduleSuggestRespDTO;
import com.iailab.module.model.api.mdk.MdkApi;
@@ -13,10 +11,8 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
/**
 * 执行天粒度调度方案定时任务
@@ -28,11 +24,15 @@
    private String AnStellCOAL = "AnStellCOAL"; //焦化备煤管控
    private String AnSteelCDQTrackImplv3 = "AnSteelCDQTrackImplv3"; //焦化干熄焦产蒸汽模型
    private String AnSteelChemProSteamTrack = "AnSteelChemProSteamTrack"; //焦化化产蒸汽消耗模型
    private String lianjiaoguankong = "lianjiaoguankong"; //焦化炼焦管控模型
    @Autowired
    private MdkApi mdkApi;
    @Autowired
    private McsApi mcsApi;
    private final String finalResultStrKey = "finalResultStr";
    private final String resultListKey = "resultList";
    @Override
@@ -82,9 +82,9 @@
                    mcsApi.createScheduleSuggest(suggestDto);
                }
            }
            //干熄焦产蒸汽 建议保存
            //焦化干熄焦产蒸汽模型 建议保存
            if (AnSteelCDQTrackImplv3.equals(code)) {
                Object finalResultStr =  mdkScheduleRespDTO.getResult().get("finalResultStr");
                Object finalResultStr =  mdkScheduleRespDTO.getResult().get(finalResultStrKey);
                if(finalResultStr != null && StringUtils.isNotBlank(finalResultStr.toString())) {
                    ScheduleSuggestRespDTO suggestDto = new ScheduleSuggestRespDTO();
                    suggestDto.setTitle("干熄焦产蒸汽建议");
@@ -95,7 +95,7 @@
                    mcsApi.createScheduleSuggest(suggestDto);
                }
                Object resultList =  mdkScheduleRespDTO.getResult().get("resultList");
                Object resultList =  mdkScheduleRespDTO.getResult().get(resultListKey);
                if(resultList != null && StringUtils.isNotBlank(resultList.toString())) {
                    ScheduleSuggestRespDTO suggestDto = new ScheduleSuggestRespDTO();
                    suggestDto.setTitle("干熄焦产蒸汽异常溯源");
@@ -106,9 +106,9 @@
                    mcsApi.createScheduleSuggest(suggestDto);
                }
            }
            //化产蒸汽消耗 建议保存
            //焦化化产蒸汽消耗模型 建议保存
            if (AnSteelChemProSteamTrack.equals(code)) {
                Object finalResultStr =  mdkScheduleRespDTO.getResult().get("finalResultStr");
                Object finalResultStr =  mdkScheduleRespDTO.getResult().get(finalResultStrKey);
                if(finalResultStr != null && StringUtils.isNotBlank(finalResultStr.toString())) {
                    ScheduleSuggestRespDTO suggestDto = new ScheduleSuggestRespDTO();
                    suggestDto.setTitle("化产蒸汽消耗建议");
@@ -119,7 +119,7 @@
                    mcsApi.createScheduleSuggest(suggestDto);
                }
                Object resultList =  mdkScheduleRespDTO.getResult().get("resultList");
                Object resultList =  mdkScheduleRespDTO.getResult().get(resultListKey);
                if(resultList != null && StringUtils.isNotBlank(resultList.toString())) {
                    ScheduleSuggestRespDTO suggestDto = new ScheduleSuggestRespDTO();
                    suggestDto.setTitle("化产蒸汽消耗异常溯源");
@@ -130,6 +130,30 @@
                    mcsApi.createScheduleSuggest(suggestDto);
                }
            }
            //焦化炼焦管控模型 建议保存
            if (lianjiaoguankong.equals(code)) {
                Object finalResultStr =  mdkScheduleRespDTO.getResult().get(finalResultStrKey);
                if(finalResultStr != null && StringUtils.isNotBlank(finalResultStr.toString())) {
                    ScheduleSuggestRespDTO suggestDto = new ScheduleSuggestRespDTO();
                    suggestDto.setTitle("炼焦管控建议");
                    suggestDto.setContent(finalResultStr.toString());
                    suggestDto.setScheduleObj("LJGK");
                    suggestDto.setScheduleTime(dto.getScheduleTime());
                    suggestDto.setCreateTime(new Date());
                    mcsApi.createScheduleSuggest(suggestDto);
                }
                Object resultList =  mdkScheduleRespDTO.getResult().get(resultListKey);
                if(resultList != null && StringUtils.isNotBlank(resultList.toString())) {
                    ScheduleSuggestRespDTO suggestDto = new ScheduleSuggestRespDTO();
                    suggestDto.setTitle("炼焦管控异常溯源");
                    suggestDto.setContent(resultList.toString());
                    suggestDto.setScheduleObj("LJGK_YCSY");
                    suggestDto.setScheduleTime(dto.getScheduleTime());
                    suggestDto.setCreateTime(new Date());
                    mcsApi.createScheduleSuggest(suggestDto);
                }
            }
        } catch (Exception ex) {
            logger.error("runDayScheduleModuleTask运行异常",ex);
        }
doc/设计文档/鲅鱼圈钢铁分公司能源管控智能化提升项目-详细设计说明书(模版).doc
Binary files differ
doc/设计文档/鲅鱼圈钢铁分公司能源管控智能化提升项目-需求分析说明书(模版).docx
Binary files differ
doc/鞍钢数据接口文档_master.doc
Binary files differ