鞍钢鲅鱼圈能源管控系统后端代码
潘志宝
6 天以前 7eeb94c954e214b84a9d67517942b981976471b5
ansteel-biz/src/main/java/com/iailab/module/ansteel/api/controller/admin/PowerController.java
@@ -673,7 +673,7 @@
            ApiPointValueQueryDTO pointValueQueryDTO = new ApiPointValueQueryDTO();
            pointValueQueryDTO.setStart(startTime);
            pointValueQueryDTO.setEnd(endTime);
            pointValueQueryDTO.setPointNo(powerNetDropdownEntity.getCurCos());
            pointValueQueryDTO.setPointNo(powerNetDropdownEntity.getExt1());
            List<ApiPointValueDTO> hisValue = dataPointApi.queryPointHistoryValue(pointValueQueryDTO);
            if (CollectionUtils.isEmpty(hisValue)) {
                log.info("hisValue is null");
@@ -681,8 +681,9 @@
            ApiPointValueDTO curValue = null;
            Collections.reverse(hisValue);
            for (ApiPointValueDTO valueDTO : hisValue) {
                curValue = valueDTO;
                if ((queryDto.getCurDemand().doubleValue() - valueDTO.getV()) <= 0.0001) {
                    curValue = valueDTO;
                    log.info("curValue is find");
                    break;
                }
            }
@@ -700,17 +701,15 @@
            log.info("curValue=" + curValue);
            for (PowerNetDropdownEntity netDropdown : dropdownList) {
                PowerDemandQueryRespDTO dto = ConvertUtils.sourceToTarget(netDropdown, PowerDemandQueryRespDTO.class);
                if (!CollectionUtils.isEmpty(pointsHisValues.get(netDropdown.getExt1()))) {
                    Map<String, BigDecimal> pointValueMap = new HashMap<>();
                    pointsHisValues.get(netDropdown.getExt1()).forEach(item -> {
                        pointValueMap.put(item.get("time").toString(), DecimalUtil.toBigDecimal(item.get("value")));
                if (CollectionUtils.isEmpty(pointsHisValues.get(netDropdown.getCurCos()))) {
                    continue;
                    });
                    dto.setCurDemand(pointValueMap.get(DateUtils.format(curValue.getT(),DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)));
                    dto.setDataTime(curValue.getT());
                }
                Map<String, BigDecimal> pointValueMap = new HashMap<>();
                pointsHisValues.get(netDropdown.getCurCos()).forEach(item -> {
                    pointValueMap.put(item.get("time").toString(), DecimalUtil.toBigDecimal(item.get("value")));
                });
                dto.setCurDemand(pointValueMap.get(DateUtils.format(curValue.getT(),DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)));
                dto.setDataTime(curValue.getT());
                result.add(dto);
            }
        }
@@ -1013,7 +1012,7 @@
        }
        for (String code : dto.getCodeList()) {
            PowerNetFactorQuery powerNetFactorQuery = null;
            PowerNetFactorQuery powerNetFactorQuery = new PowerNetFactorQuery();
            PowerDemandEntity powerDemandEntity = powerDemandService.getByCode(code);
            PowerNetDropdownEntity powerNetDropdownEntity = powerNetDropdownService.getByNodeCode(code);
            if (powerDemandEntity != null) {