Merge remote-tracking branch 'origin/master'
| | |
| | | @Autowired |
| | | private PowerMaxdemandDetService powerMaxdemandDetService; |
| | | |
| | | public static final String VALUE = "value"; |
| | | |
| | | public static final String TIME = "time"; |
| | | |
| | | @GetMapping("/net-factor/list") |
| | | @Operation(summary = "功率因数-电网拓扑") |
| | | public CommonResult<List<PowerNetFactorDTO>> getPowerNetFactorList(@RequestParam Map<String, Object> params) { |
| | |
| | | @GetMapping("/demand/list") |
| | | @Operation(summary = "负荷移植-月最大需量,实测需量,有功功率") |
| | | public CommonResult<List<PowerDemandDTO>> getPowerDemandList(@RequestParam Map<String, Object> params) { |
| | | log.info("负荷移植-月最大需量,实测需量,有功功率"); |
| | | List<PowerDemandDTO> result = new ArrayList<>(); |
| | | List<PowerDemandEntity> list = powerDemandService.list(params); |
| | | List<PowerDemandDTO> result = ConvertUtils.sourceToTarget(list, PowerDemandDTO.class); |
| | | if (CollectionUtils.isEmpty(result)) { |
| | | if (CollectionUtils.isEmpty(list)) { |
| | | log.info("list.size=" + list.size()); |
| | | return success(result); |
| | | } |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.set(Calendar.DAY_OF_MONTH, 1); |
| | | calendar.set(Calendar.HOUR_OF_DAY, 0); |
| | | calendar.set(Calendar.MINUTE, 0); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | calendar.set(Calendar.DAY_OF_MONTH, 1); |
| | | Date start = calendar.getTime(); |
| | | Date end = new Date(); |
| | | |
| | | for (PowerDemandDTO dto : result) { |
| | | for (PowerDemandEntity entity : list) { |
| | | PowerDemandDTO demandDTO = new PowerDemandDTO(); |
| | | demandDTO.setId(entity.getId()); |
| | | demandDTO.setCode(entity.getCode()); |
| | | demandDTO.setName(entity.getName()); |
| | | |
| | | List<String> points = new ArrayList<>(); |
| | | if (StringUtils.isNotBlank(dto.getCurDemand())) { |
| | | points.add(dto.getCurDemand()); |
| | | if (StringUtils.isNotBlank(entity.getCurDemand())) { |
| | | points.add(entity.getCurDemand()); |
| | | } |
| | | if (StringUtils.isNotBlank(dto.getActivePower())) { |
| | | points.add(dto.getActivePower()); |
| | | if (StringUtils.isNotBlank(entity.getActivePower())) { |
| | | points.add(entity.getActivePower()); |
| | | } |
| | | if (!CollectionUtils.isEmpty(points)) { |
| | | Map<String, Object> pointsRealValue = dataPointApi.queryPointsRealValue(points); |
| | | if (pointsRealValue.get(dto.getCurDemand()) != null) { |
| | | dto.setCurDemand(pointsRealValue.get(dto.getCurDemand()).toString()); |
| | | if (pointsRealValue.get(entity.getCurDemand()) != null) { |
| | | demandDTO.setCurDemand(new BigDecimal(pointsRealValue.get(entity.getCurDemand()).toString())); |
| | | } |
| | | if (pointsRealValue.get(dto.getActivePower()) != null) { |
| | | dto.setActivePower(pointsRealValue.get(dto.getActivePower()).toString()); |
| | | if (pointsRealValue.get(entity.getActivePower()) != null) { |
| | | demandDTO.setActivePower(new BigDecimal(pointsRealValue.get(entity.getActivePower()).toString())); |
| | | } |
| | | } |
| | | |
| | | if (!StringUtils.isEmpty(dto.getMaxDemand())) { |
| | | Date start = calendar.getTime(); |
| | | if (!StringUtils.isEmpty(entity.getMaxDemand())) { |
| | | ApiPointValueQueryDTO apiPointValueQueryDTO = new ApiPointValueQueryDTO(); |
| | | apiPointValueQueryDTO.setStart(start); |
| | | apiPointValueQueryDTO.setPointNo(dto.getMaxDemand()); |
| | | Map<String, Object> maxValue = dataPointApi.queryPointMaxValue(apiPointValueQueryDTO); |
| | | apiPointValueQueryDTO.setEnd(end); |
| | | apiPointValueQueryDTO.setPointNo(entity.getMaxDemand()); |
| | | Map<String, Object> maxValue = dataPointApi.queryPointMaxTimeValue(apiPointValueQueryDTO); |
| | | if (maxValue != null) { |
| | | dto.setMaxDemand(maxValue.get(dto.getMaxDemand()) == null ? "" : maxValue.get(dto.getMaxDemand()).toString()); |
| | | demandDTO.setMaxDemand(new BigDecimal(maxValue.get(VALUE).toString())); |
| | | demandDTO.setOccurTime(DateUtils.parse( maxValue.get(TIME).toString(), DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)); |
| | | } |
| | | |
| | | } |
| | | result.add(demandDTO); |
| | | } |
| | | return success(result); |
| | | } |
| | |
| | | ApiPointValueQueryDTO queryCodeValue = new ApiPointValueQueryDTO(); |
| | | queryCodeValue.setStart(startTime); |
| | | queryCodeValue.setEnd(endTime); |
| | | queryCodeValue.setPointNo(entity.getCurDemand()); |
| | | List<ApiPointValueDTO> codeValueList = dataPointApi.queryPointHistoryValue(queryCodeValue); |
| | | if (CollectionUtils.isEmpty(codeValueList)) { |
| | | return success(result); |
| | |
| | | package com.iailab.module.ansteel.api.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author dyk |
| | |
| | | private String code; |
| | | |
| | | @Schema(description = "月最大需量") |
| | | private String maxDemand; |
| | | private BigDecimal maxDemand; |
| | | |
| | | @Schema(description = "实测需量") |
| | | private String curDemand; |
| | | private BigDecimal curDemand; |
| | | |
| | | @Schema(description = "有功功率") |
| | | private String activePower; |
| | | private BigDecimal activePower; |
| | | |
| | | @Schema(description = "排序") |
| | | private Integer sort; |
| | | |
| | | @Schema(description = "发生时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date occurTime; |
| | | } |
| | |
| | | package com.iailab.module.ansteel.api.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | |
| | | private String id; |
| | | |
| | | @Schema(description = "发生时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date occurTime; |
| | | |
| | | @Schema(description = "编号") |
| | |
| | | package com.iailab.module.ansteel.api.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | |
| | | private String id; |
| | | |
| | | @Schema(description = "发生时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date occurTime; |
| | | |
| | | @Schema(description = "编号") |
| | |
| | | if (!CollectionUtils.isEmpty(value)) { |
| | | value.forEach(item -> { |
| | | String[] ri = new String[3]; |
| | | if(DateUtils.parse(item.getStartTime(), DateUtils.DATE_TIME_PATTERN_STRING).getTime() < startTime.getTime()){ |
| | | ri[0] = DateUtils.format(startTime, "yyyy-MM-dd HH:mm:00"); |
| | | }else { |
| | | ri[0] = DateUtils.format(DateUtils.parse(item.getStartTime(), DateUtils.DATE_TIME_PATTERN_STRING), "yyyy-MM-dd HH:mm:00"); |
| | | } |
| | | ri[1] = DateUtils.format(DateUtils.parse(item.getEndTime(), DateUtils.DATE_TIME_PATTERN_STRING), "yyyy-MM-dd HH:mm:00"); |
| | | ri[2] = "2"; |
| | | if (DateUtils.parse(item.getStartTime(), "yyyyMMddHHmmss").getTime() < predictTime.getTime()) { |
| | |
| | | */ |
| | | private BigDecimal powerCStandard; |
| | | /** |
| | | * 空转时间 |
| | | * 停机时间 |
| | | */ |
| | | private BigDecimal idleTime; |
| | | /** |
| | |
| | | QueryWrapper<CokingOverviewEntity> queryWrapperMonth = new QueryWrapper<>(); |
| | | queryWrapperMonth.eq("process_type", processType); |
| | | queryWrapperMonth.between("clock", monthStartClock,clock); |
| | | queryWrapperMonth.select("sub_process_type","SUM(steam_p)*30/count(*) as steam_p","SUM(dj_steam_p)*30/count(*) as dj_steam_p","SUM(steam_c)*30/count(*) as steam_c","SUM(steam_only_c)*30/count(*) as steam_only_c","SUM(steam_v)*30/count(*) as steam_v","SUM(gas_p)*30/count(*) as gas_p","SUM(gas_c)*30/count(*) as gas_c","SUM(power_c)*30/count(*) as power_c","SUM(power_only_c)*30/count(*) as power_only_c","SUM(power_c_standard)*30/count(*) as power_c_standard","SUM(idle_time)*30/count(*) as idle_time","SUM(bfg_c)*30/count(*) as bfg_c","SUM(cog_p)*30/count(*) as cog_p","SUM(cog_c)*30/count(*) as cog_c","SUM(bfg_only_c)*30/count(*) as bfg_only_c","SUM(cog_only_c)*30/count(*) as cog_only_c","SUM(gxls)*30/count(*) as gxls") |
| | | 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") |
| | | .groupBy("sub_process_type"); |
| | | |
| | | List<CokingOverviewEntity> monthList = cokingOverviewDao.selectList(queryWrapperMonth); |
| | |
| | | if (StringUtils.isBlank(conf.getPointNo())) { |
| | | continue; |
| | | } |
| | | String value = "0"; |
| | | String value = "-2"; |
| | | switch (ProcessConfDataTypeEnum.getEumByCode(conf.getDataType())) { |
| | | case DATAPOINT: |
| | | List<String> points = new ArrayList<>(); |
| | |
| | | BigDecimal mainGxjzqcs = resultCodeMap.get("main_gxjzqcs").getRealValue(); |
| | | e.setRealValue(mainGxjzqcs.divide(jtcl,2,BigDecimal.ROUND_HALF_UP)); |
| | | } |
| | | // 吨焦耗煤气 |
| | | if (e.getIndCode().equals("main_djhmq") && resultCodeMap.containsKey("main_glmqxh") && resultCodeMap.containsKey("main_jlmqxh")) { |
| | | // 高炉煤气消耗 |
| | | BigDecimal mainGlmqxh = resultCodeMap.get("main_glmqxh").getRealValue(); |
| | | // 焦炉煤气消耗 |
| | | BigDecimal mainJlmqxh = resultCodeMap.get("main_jlmqxh").getRealValue(); |
| | | e.setRealValue(mainGlmqxh.add(mainJlmqxh).divide(jtcl,2,BigDecimal.ROUND_HALF_UP)); |
| | | // 吨焦耗热量 |
| | | if (e.getIndCode().equals("main_djhmq")) { |
| | | // 焦化耗热量 |
| | | BigDecimal mainHrl = e.getRealValue(); |
| | | e.setRealValue(mainHrl.divide(jtcl,2,BigDecimal.ROUND_HALF_UP)); |
| | | } |
| | | // 吨焦耗蒸汽 |
| | | if (e.getIndCode().equals("main_djhzq") && resultCodeMap.containsKey("main_zqxh")) { |
| | |
| | | import com.iailab.module.ansteel.common.enums.TraceProcessTypeEnum; |
| | | import com.iailab.module.model.api.mcs.McsApi; |
| | | import com.iailab.module.model.api.mdk.MdkApi; |
| | | import com.iailab.module.model.api.mdk.dto.MdkScheduleReqDTO; |
| | | import com.iailab.module.model.api.mdk.dto.MdkScheduleRespDTO; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | |
| | | String clock = DateUtils.format(startDate); |
| | | |
| | | // 调用模型 |
| | | /* MdkScheduleReqDTO dto = new MdkScheduleReqDTO(); |
| | | dto.setScheduleTime(calendar.getTime()); |
| | | dto.setScheduleCode(params); |
| | | MdkScheduleRespDTO mdkScheduleRespDTO = mdkApi.doSchedule(dto); |
| | | logger.info(params + "调度方案执行完成," + mdkScheduleRespDTO); |
| | | Map<String, Object> result = mdkScheduleRespDTO.getResult(); |
| | | |
| | | JSONObject jsonObject = new JSONObject(result); |
| | | JSONObject result2 = (JSONObject) JSON.toJSON(jsonObject.get("result"));*/ |
| | | // MdkScheduleReqDTO dto = new MdkScheduleReqDTO(); |
| | | // dto.setScheduleTime(calendar.getTime()); |
| | | // dto.setScheduleCode(params); |
| | | // MdkScheduleRespDTO mdkScheduleRespDTO = mdkApi.doSchedule(dto); |
| | | // logger.info(params + "调度方案执行完成," + mdkScheduleRespDTO); |
| | | // |
| | | // Map<String, Object> tResult = mdkScheduleRespDTO.getResult(); |
| | | // JSONObject result = new JSONObject(tResult); |
| | | // logger.info("result===" + JSONObject.toJSONString(result)); |
| | | |
| | | JSONObject jsonObject = JSONObject.parseObject(jsonStr); |
| | | JSONObject result = (JSONObject) JSON.toJSON(jsonObject.get("result")); |
| | |
| | | String clock = DateUtils.format(startDate); |
| | | |
| | | // 调用模型 |
| | | /* MdkScheduleReqDTO dto = new MdkScheduleReqDTO(); |
| | | dto.setScheduleTime(calendar.getTime()); |
| | | dto.setScheduleCode(params); |
| | | MdkScheduleRespDTO mdkScheduleRespDTO = mdkApi.doSchedule(dto); |
| | | logger.info(params + "调度方案执行完成," + mdkScheduleRespDTO); |
| | | Map<String, Object> result = mdkScheduleRespDTO.getResult(); |
| | | |
| | | JSONObject jsonObject = new JSONObject(result); |
| | | JSONObject result2 = (JSONObject) JSON.toJSON(jsonObject.get("result"));*/ |
| | | // MdkScheduleReqDTO dto = new MdkScheduleReqDTO(); |
| | | // dto.setScheduleTime(calendar.getTime()); |
| | | // dto.setScheduleCode(params); |
| | | // MdkScheduleRespDTO mdkScheduleRespDTO = mdkApi.doSchedule(dto); |
| | | // logger.info(params + "调度方案执行完成," + mdkScheduleRespDTO); |
| | | // |
| | | // Map<String, Object> tResult = mdkScheduleRespDTO.getResult(); |
| | | // JSONObject result = new JSONObject(tResult); |
| | | // logger.info("result===" + JSONObject.toJSONString(result)); |
| | | |
| | | JSONObject jsonObject = JSONObject.parseObject(jsonStr); |
| | | JSONObject result = (JSONObject) JSON.toJSON(jsonObject.get("result")); |
| | |
| | | String clock = DateUtils.format(startDate); |
| | | |
| | | // 调用模型 |
| | | // MdkScheduleReqDTO dto = new MdkScheduleReqDTO(); |
| | | // dto.setScheduleTime(calendar.getTime()); |
| | | // dto.setScheduleCode(params); |
| | | // MdkScheduleRespDTO mdkScheduleRespDTO = mdkApi.doSchedule(dto); |
| | | // logger.info(params + "调度方案执行完成," + mdkScheduleRespDTO); |
| | | // |
| | | // Map<String, Object> tResult = mdkScheduleRespDTO.getResult(); |
| | | // JSONObject result = new JSONObject(tResult); |
| | | // logger.info("result===" + JSONObject.toJSONString(result)); |
| | | |
| | | JSONObject jsonObject = JSONObject.parseObject(jsonStr); |
| | | JSONObject result = (JSONObject) JSON.toJSON(jsonObject.get("result")); |
| | | |
| | |
| | | String clock = DateUtils.format(startDate); |
| | | |
| | | // 调用模型 |
| | | // MdkScheduleReqDTO dto = new MdkScheduleReqDTO(); |
| | | // dto.setScheduleTime(calendar.getTime()); |
| | | // dto.setScheduleCode(params); |
| | | // MdkScheduleRespDTO mdkScheduleRespDTO = mdkApi.doSchedule(dto); |
| | | // logger.info(params + "调度方案执行完成," + mdkScheduleRespDTO); |
| | | // |
| | | // Map<String, Object> tResult = mdkScheduleRespDTO.getResult(); |
| | | // JSONObject result = new JSONObject(tResult); |
| | | // logger.info("result===" + JSONObject.toJSONString(result)); |
| | | |
| | | JSONObject jsonObject = JSONObject.parseObject(jsonStr); |
| | | JSONObject result = (JSONObject) JSON.toJSON(jsonObject.get("result")); |
| | | |
| | |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | calendar.set(Calendar.MINUTE, 0); |
| | | calendar.set(Calendar.HOUR_OF_DAY, 0); |
| | | MdkScheduleReqDTO dto = new MdkScheduleReqDTO(); |
| | | dto.setScheduleTime(calendar.getTime()); |
| | | dto.setScheduleCode(params); |