Merge remote-tracking branch 'origin/master'
| | |
| | | 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; |
| | | |
| | |
| | | @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); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | 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; |
| | | } |
| | |
| | | */ |
| | | private BigDecimal powerC; |
| | | /** |
| | | * 电力产生 |
| | | */ |
| | | private BigDecimal powerP; |
| | | /** |
| | | * 电力单耗 |
| | | */ |
| | | private BigDecimal powerOnlyC; |
| | |
| | | */ |
| | | private BigDecimal powerC; |
| | | /** |
| | | * 电力产生 |
| | | */ |
| | | private BigDecimal powerP; |
| | | /** |
| | | * 电力单耗 |
| | | */ |
| | | private BigDecimal powerOnlyC; |
| | |
| | | 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); |
| | |
| | | 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", "干熄焦"), |
| | |
| | | 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; |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * 执行天粒度调度方案定时任务 |
| | |
| | | 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 |
| | |
| | | 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("干熄焦产蒸汽建议"); |
| | |
| | | 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("干熄焦产蒸汽异常溯源"); |
| | |
| | | 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("化产蒸汽消耗建议"); |
| | |
| | | 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("化产蒸汽消耗异常溯源"); |
| | |
| | | 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); |
| | | } |