diff --git a/pqs-advance/advance-boot/src/main/java/com/njcn/advance/service/govern/voltage/impl/SgMachineServiceImpl.java b/pqs-advance/advance-boot/src/main/java/com/njcn/advance/service/govern/voltage/impl/SgMachineServiceImpl.java index 7bad94484..40e6dd4cf 100644 --- a/pqs-advance/advance-boot/src/main/java/com/njcn/advance/service/govern/voltage/impl/SgMachineServiceImpl.java +++ b/pqs-advance/advance-boot/src/main/java/com/njcn/advance/service/govern/voltage/impl/SgMachineServiceImpl.java @@ -9,8 +9,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.njcn.advance.enums.AdvanceResponseEnum; import com.njcn.advance.mapper.govern.voltage.SgMachineMapper; import com.njcn.advance.pojo.param.govern.voltage.SgMachineParam; +import com.njcn.advance.pojo.param.govern.voltage.SgUserParam; import com.njcn.advance.pojo.po.govern.voltage.SgMachine; import com.njcn.advance.pojo.po.govern.voltage.SgSensitiveUnit; +import com.njcn.advance.pojo.po.govern.voltage.SgUser; import com.njcn.advance.pojo.vo.govern.voltage.SgMachineVO; import com.njcn.advance.service.govern.voltage.ISgMachineService; import com.njcn.advance.service.govern.voltage.ISgSensitiveUnitService; @@ -56,12 +58,34 @@ public class SgMachineServiceImpl extends ServiceImpl sgUserLambdaQueryWrapper = new LambdaQueryWrapper<>(); + sgUserLambdaQueryWrapper + .eq(SgMachine::getName, sgMachineParam.getName()) + .eq(SgMachine::getState, DataStateEnum.ENABLE.getCode()); + //更新的时候,需排除当前记录 + if (isExcludeSelf) { + if (sgMachineParam instanceof SgMachineParam.SgMachineUpdateParam) { + sgUserLambdaQueryWrapper.ne(SgMachine::getId, ((SgMachineParam.SgMachineUpdateParam) sgMachineParam).getId()); + } + } + int countByAccount = this.count(sgUserLambdaQueryWrapper); + //大于等于1个则表示重复 + if (countByAccount >= 1) { + throw new BusinessException(AdvanceResponseEnum.SG_USER_NAME_REPEAT); + } + } /** * 更新设备 @@ -70,6 +94,8 @@ public class SgMachineServiceImpl extends ServiceImpl sgUserLambdaQueryWrapper = new LambdaQueryWrapper<>(); + sgUserLambdaQueryWrapper + .eq(SgSensitiveUnit::getName, sgSensitiveUnitParam.getName()) + .eq(SgSensitiveUnit::getState, DataStateEnum.ENABLE.getCode()); + //更新的时候,需排除当前记录 + if (isExcludeSelf) { + if (sgSensitiveUnitParam instanceof SgSensitiveUnitParam.SgSensitiveUnitUpdateParam) { + sgUserLambdaQueryWrapper.ne(SgSensitiveUnit::getId, ((SgSensitiveUnitParam.SgSensitiveUnitUpdateParam) sgSensitiveUnitParam).getId()); + } + } + int countByAccount = this.count(sgUserLambdaQueryWrapper); + //大于等于1个则表示重复 + if (countByAccount >= 1) { + throw new BusinessException(AdvanceResponseEnum.SG_USER_NAME_REPEAT); + } + } /** * 更新元器件 @@ -69,6 +94,8 @@ public class SgSensitiveUnitServiceImpl extends ServiceImpl(PageFactory.getPageNum(baseParam), PageFactory.getPageSize(baseParam)), lambdaQueryWrapper); } diff --git a/pqs-advance/advance-boot/src/main/java/com/njcn/advance/service/impl/EventWaveAnalysisServiceImpl.java b/pqs-advance/advance-boot/src/main/java/com/njcn/advance/service/impl/EventWaveAnalysisServiceImpl.java index 640f75e66..6b7dc7069 100644 --- a/pqs-advance/advance-boot/src/main/java/com/njcn/advance/service/impl/EventWaveAnalysisServiceImpl.java +++ b/pqs-advance/advance-boot/src/main/java/com/njcn/advance/service/impl/EventWaveAnalysisServiceImpl.java @@ -81,7 +81,13 @@ public class EventWaveAnalysisServiceImpl implements EventWaveAnalysisService { inputStreamCfg = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + lineDetailDataVO.getIp() + StrUtil.SLASH + rmpEventDetailPO.getWavePath() + GeneralConstant.CFG); inputStreamDat = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + lineDetailDataVO.getIp() + StrUtil.SLASH + rmpEventDetailPO.getWavePath() + GeneralConstant.DAT); } catch (Exception e) { - throw new BusinessException("暂降cfg,dat文件缺失,请联系管理员"); + try { + inputStreamCfg = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + lineDetailDataVO.getIp() + StrUtil.SLASH + rmpEventDetailPO.getWavePath() + GeneralConstant.CFG.toLowerCase()); + inputStreamDat = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + lineDetailDataVO.getIp() + StrUtil.SLASH + rmpEventDetailPO.getWavePath() + GeneralConstant.DAT.toLowerCase()); + } catch (Exception e1) { + + throw new BusinessException("暂降cfg,dat文件缺失,请联系管理员"); + } } //读取 diff --git a/pqs-bpm/bpm-api/src/main/java/com/njcn/bpm/pojo/param/BpmSignParam.java b/pqs-bpm/bpm-api/src/main/java/com/njcn/bpm/pojo/param/BpmSignParam.java index 114cd96e1..5574c0de5 100644 --- a/pqs-bpm/bpm-api/src/main/java/com/njcn/bpm/pojo/param/BpmSignParam.java +++ b/pqs-bpm/bpm-api/src/main/java/com/njcn/bpm/pojo/param/BpmSignParam.java @@ -88,7 +88,7 @@ public class BpmSignParam extends BaseEntity implements Serializable { private String name; @ApiModelProperty("标识key") - private String key; + private String signKey; } diff --git a/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/service/impl/BpmCategoryServiceImpl.java b/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/service/impl/BpmCategoryServiceImpl.java index 94865f979..c43d8d2a6 100644 --- a/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/service/impl/BpmCategoryServiceImpl.java +++ b/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/service/impl/BpmCategoryServiceImpl.java @@ -67,8 +67,8 @@ public class BpmCategoryServiceImpl extends ServiceImpl getCategoryPage(BpmCategoryParam.BpmCategoryQueryParam bpmCategoryQueryParam) { QueryWrapper categoryVOQueryWrapper = new QueryWrapper<>(); - if (StrUtil.isNotBlank(bpmCategoryQueryParam.getName())) { - categoryVOQueryWrapper.like("bpm_category.name", bpmCategoryQueryParam.getName()); + if (StrUtil.isNotBlank(bpmCategoryQueryParam.getSearchValue())) { + categoryVOQueryWrapper.like("bpm_category.name", bpmCategoryQueryParam.getSearchValue()); } if (StrUtil.isNotBlank(bpmCategoryQueryParam.getCode())) { diff --git a/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/service/impl/BpmSignServiceImpl.java b/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/service/impl/BpmSignServiceImpl.java index b5213e051..20e7b3f24 100644 --- a/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/service/impl/BpmSignServiceImpl.java +++ b/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/service/impl/BpmSignServiceImpl.java @@ -106,8 +106,8 @@ public class BpmSignServiceImpl extends ServiceImpl impl bpmSignVOQueryWrapper.like("bpm_sign.name", bpmSignQueryParam.getName()); } - if (StrUtil.isNotBlank(bpmSignQueryParam.getKey())) { - bpmSignVOQueryWrapper.like("bpm_sign.signKey", bpmSignQueryParam.getKey()); + if (StrUtil.isNotBlank(bpmSignQueryParam.getSignKey())) { + bpmSignVOQueryWrapper.like("bpm_sign.sign_key", bpmSignQueryParam.getSignKey()); } bpmSignVOQueryWrapper.eq("bpm_sign.state", DataStateEnum.ENABLE.getCode()); bpmSignVOQueryWrapper.orderByAsc("bpm_sign.sort"); diff --git a/pqs-common/common-core/src/main/java/com/njcn/common/pojo/constant/PatternRegex.java b/pqs-common/common-core/src/main/java/com/njcn/common/pojo/constant/PatternRegex.java index c4b6a6224..3fa22b1e4 100644 --- a/pqs-common/common-core/src/main/java/com/njcn/common/pojo/constant/PatternRegex.java +++ b/pqs-common/common-core/src/main/java/com/njcn/common/pojo/constant/PatternRegex.java @@ -258,7 +258,7 @@ public interface PatternRegex { /** * 任意字符,长度在1-20位,常用于名称、编码等常规录入 */ - String ALL_CHAR_1_20 = "^[-_A-Za-z0-9\\u4e00-\\u9fa5]{1,20}$"; + String ALL_CHAR_1_20 = "^[-_A-Za-z0-9\\u4e00-\\u9fa5]{1,32}$"; String SPECIALCHARACTER ="[<>%'%;()&+/\\\\-\\\\\\\\_|@*?#$!,.]|html"; diff --git a/pqs-common/common-echarts/src/main/java/com/njcn/echarts/json/PieGenerator.java b/pqs-common/common-echarts/src/main/java/com/njcn/echarts/json/PieGenerator.java index f75579115..98392b9ee 100644 --- a/pqs-common/common-echarts/src/main/java/com/njcn/echarts/json/PieGenerator.java +++ b/pqs-common/common-echarts/src/main/java/com/njcn/echarts/json/PieGenerator.java @@ -33,6 +33,8 @@ public class PieGenerator { Option reasonOption = new Option(); //取消渲染动画 reasonOption.setAnimation(false); + String[] colorArr = {"#526ADE", "#00BFF5","#FFBF00","#77DA63","#D5FF6B"}; + reasonOption.setColor(colorArr); //背景色 reasonOption.setBackgroundColor(PicCommonData.PIC_BACK_COLOR); //标题 diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/PqsTransformerMapper.xml b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/PqsTransformerMapper.xml index 064b0c61d..74d016264 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/PqsTransformerMapper.xml +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/PqsTransformerMapper.xml @@ -15,6 +15,7 @@ STATUS = 1 diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/PqsTflgployServiceImpl.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/PqsTflgployServiceImpl.java index 997d5d7d8..f20a776b5 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/PqsTflgployServiceImpl.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/PqsTflgployServiceImpl.java @@ -119,7 +119,7 @@ public class PqsTflgployServiceImpl extends ServiceImpl info) { - if(save){ +// if(save){ List tfIndexs = param.getTfIndexs(); if(CollUtil.isNotEmpty(tfIndexs)){ PqsTflgployass ass; @@ -129,7 +129,7 @@ public class PqsTflgployServiceImpl extends ServiceImpl updateDevComFlag(@RequestBody DevComFlagDTO devComFlagDTO) { String methodDescribe = getMethodDescribe("updateDevComFlag"); - boolean update = iDeviceService.lambdaUpdate().set(Objects.nonNull(devComFlagDTO.getStatus()),Device::getComFlag,devComFlagDTO.getStatus() ).set(Device::getUpdateTime, devComFlagDTO.getDate()).eq(Device::getId, devComFlagDTO.getId()).update(); + boolean update = iDeviceService.lambdaUpdate().set(Objects.nonNull(devComFlagDTO.getStatus()),Device::getComFlag,devComFlagDTO.getStatus() ).set(Objects.nonNull(devComFlagDTO.getDate()),Device::getUpdateTime, devComFlagDTO.getDate()).eq(Device::getId, devComFlagDTO.getId()).update(); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, update, methodDescribe); } diff --git a/pqs-device/pq-device/pq-device-com/src/main/java/com/njcn/device/device/service/impl/TerminalVersionServiceImpl.java b/pqs-device/pq-device/pq-device-com/src/main/java/com/njcn/device/device/service/impl/TerminalVersionServiceImpl.java index 46fc0b327..6d4f8bd4f 100644 --- a/pqs-device/pq-device/pq-device-com/src/main/java/com/njcn/device/device/service/impl/TerminalVersionServiceImpl.java +++ b/pqs-device/pq-device/pq-device-com/src/main/java/com/njcn/device/device/service/impl/TerminalVersionServiceImpl.java @@ -38,7 +38,7 @@ public class TerminalVersionServiceImpl implements TerminalVersionService { List devList = terminalVersionMapper.getTerminalVersionInfo(terminalMainQueryParam); if(CollectionUtil.isEmpty(devList)){ - throw new BusinessException(DeviceResponseEnum.DEVICE_EMPTY); + return devList; } List subIndexes = devList.stream().map(TerminalVersionVO::getPid).collect(Collectors.toList()); List subList =terminalVersionMapper.getPqLineGdAndSubList(subIndexes); diff --git a/pqs-device/pq-device/pq-device-com/src/main/java/com/njcn/device/line/mapper/mapping/LineDetailMapper.xml b/pqs-device/pq-device/pq-device-com/src/main/java/com/njcn/device/line/mapper/mapping/LineDetailMapper.xml index 610c44294..b3f4aab7b 100644 --- a/pqs-device/pq-device/pq-device-com/src/main/java/com/njcn/device/line/mapper/mapping/LineDetailMapper.xml +++ b/pqs-device/pq-device/pq-device-com/src/main/java/com/njcn/device/line/mapper/mapping/LineDetailMapper.xml @@ -43,7 +43,7 @@ a.name lineName, c.Time_Interval, d.Scale AS scale, - c.Obj_Id obyId, + c.Obj_Id objId, c.Big_Obj_Type bigObjType from pq_line a inner join pq_line b on a.pid = b.id diff --git a/pqs-device/pq-device/pq-device-com/src/main/java/com/njcn/device/line/mapper/mapping/LineMapper.xml b/pqs-device/pq-device/pq-device-com/src/main/java/com/njcn/device/line/mapper/mapping/LineMapper.xml index edf504cd6..d586af670 100644 --- a/pqs-device/pq-device/pq-device-com/src/main/java/com/njcn/device/line/mapper/mapping/LineMapper.xml +++ b/pqs-device/pq-device/pq-device-com/src/main/java/com/njcn/device/line/mapper/mapping/LineMapper.xml @@ -1269,7 +1269,8 @@ SELECT voltage.id as id, sub.id as pid, - concat( sub.NAME, " ", voltage.NAME ) as name, + + concat( sub.NAME, ' ', voltage.NAME ) as name, voltage.Sort as sort FROM pq_line voltage @@ -1513,14 +1514,14 @@ line.id AS lineId, CONCAT(sub.NAME, '_', vo.NAME, '_', line.NAME) AS lineName, CONCAT( - IFNULL(CAST(detail.pt1 AS CHAR), 'N/A'), + IFNULL(CAST(detail.pt1 AS VARCHAR), 'N/A'), ':', - IFNULL(CAST(detail.pt2 AS CHAR), 'N/A') + IFNULL(CAST(detail.pt2 AS VARCHAR), 'N/A') ) AS pt, CONCAT( - IFNULL(CAST(detail.ct1 AS CHAR), 'N/A'), + IFNULL(CAST(detail.ct1 AS VARCHAR), 'N/A'), ':', - IFNULL(CAST(detail.ct2 AS CHAR), 'N/A') + IFNULL(CAST(detail.ct2 AS VARCHAR), 'N/A') ) AS ct, detail.Dev_Capacity AS Dev_Capacity, detail.Short_Capacity AS Short_Capacity, diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/ReportServiceImpl.java b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/ReportServiceImpl.java index a7bb89340..07105a673 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/ReportServiceImpl.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/ReportServiceImpl.java @@ -747,8 +747,8 @@ public class ReportServiceImpl implements ReportService { bodyFont.setFontHeightInPoints((short) 9); bodyStyle.setFont(bodyFont); - sheet2(sheets, cellStyle, bodyStyle, businessParam); sheet3(sheets, cellStyle, bodyStyle, businessParam); + sheet2(sheets, cellStyle, bodyStyle, businessParam); sheet4(sheets, cellStyle, bodyStyle, businessParam); sheet5(sheets, cellStyle, bodyStyle, businessParam); sheet6(sheets, cellStyle, bodyStyle, businessParam); @@ -909,7 +909,7 @@ public class ReportServiceImpl implements ReportService { public void sheet2(HSSFWorkbook sheets, HSSFCellStyle cellStyle, HSSFCellStyle bodyStyle, DeviceInfoParam.BusinessParam businessParam) { sheets.createSheet("暂态严重度统计"); - HSSFSheet sheetAt = sheets.getSheetAt(1); + HSSFSheet sheetAt = sheets.getSheetAt(2); sheetAt.setColumnWidth(0, 24 * 256); sheetAt.setColumnWidth(1, 24 * 256); sheetAt.setColumnWidth(2, 24 * 256); @@ -1001,7 +1001,7 @@ public class ReportServiceImpl implements ReportService { public void sheet3(HSSFWorkbook sheets, HSSFCellStyle cellStyle, HSSFCellStyle bodyStyle, DeviceInfoParam.BusinessParam businessParam) throws TemplateException, IOException { sheets.createSheet("暂态原因统计"); - HSSFSheet sheetAt = sheets.getSheetAt(2); + HSSFSheet sheetAt = sheets.getSheetAt(1); sheetAt.setColumnWidth(0, 40 * 256); sheetAt.setColumnWidth(1, 40 * 256); sheetAt.setColumnWidth(2, 40 * 256); diff --git a/pqs-event/event-common/src/main/java/com/njcn/event/common/service/impl/CommMonitorEventReportServiceImpl.java b/pqs-event/event-common/src/main/java/com/njcn/event/common/service/impl/CommMonitorEventReportServiceImpl.java index d71044d44..dbb68f628 100644 --- a/pqs-event/event-common/src/main/java/com/njcn/event/common/service/impl/CommMonitorEventReportServiceImpl.java +++ b/pqs-event/event-common/src/main/java/com/njcn/event/common/service/impl/CommMonitorEventReportServiceImpl.java @@ -12,9 +12,9 @@ import com.njcn.echarts.pojo.constant.PicCommonData; import com.njcn.echarts.util.DrawPicUtil; import com.njcn.event.common.mapper.RmpEventDetailMapper; import com.njcn.event.common.pojo.dto.LineDetailDataCommDTO; +import com.njcn.event.common.service.CommMonitorEventReportService; import com.njcn.event.common.service.EventAnalysisService; import com.njcn.event.common.service.EventReportService; -import com.njcn.event.common.service.CommMonitorEventReportService; import com.njcn.event.common.utils.WordUtils; import com.njcn.event.pojo.param.ExportParam; import com.njcn.event.pojo.param.StatisticsParam; @@ -218,7 +218,7 @@ public class CommMonitorEventReportServiceImpl implements CommMonitorEventReport EventDetail eventDetail = plot.get(j); String s = eventDetail.getStartTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS")); - insertRow(doc, table, centerParagraph, false, j + 1 + "", s, BigDecimal.valueOf(eventDetail.getFeatureAmplitude() * 100).setScale(2, RoundingMode.HALF_UP).toString(), eventDetail.getDuration() + "", eventDetail.getAdvanceType(), eventDetail.getAdvanceReason(), eventDetail.getSeverity() + ""); + insertRow(doc, table, centerParagraph, false, j + 1 + "", s, BigDecimal.valueOf(eventDetail.getFeatureAmplitude() * 100).setScale(2, RoundingMode.HALF_UP).toString(), eventDetail.getDuration() + "", Objects.isNull(eventDetail.getAdvanceType())?"/":eventDetail.getAdvanceType(), Objects.isNull(eventDetail.getAdvanceReason())?"/":eventDetail.getAdvanceReason(), Objects.isNull(eventDetail.getSeverity())?"/":eventDetail.getSeverity() + ""); } i++; } @@ -585,6 +585,7 @@ public class CommMonitorEventReportServiceImpl implements CommMonitorEventReport // .in(RmpEventDetailPO::getEventType, typeIds) .ge(StrUtil.isNotBlank(statisticsParam.getStartTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(statisticsParam.getStartTime()))) .le(StrUtil.isNotBlank(statisticsParam.getEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(statisticsParam.getEndTime()))) + .orderByDesc(RmpEventDetailPO::getStartTime) ); return BeanUtil.copyToList(info, EventDetail.class); diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/controller/report/ExportModelController.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/controller/report/ExportModelController.java index 23e4e6f52..09ee2160f 100644 --- a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/controller/report/ExportModelController.java +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/controller/report/ExportModelController.java @@ -125,6 +125,6 @@ public class ExportModelController extends BaseController { - monitorHarmonicReportService.exportWorld(response,startTime,endTime,type,lineIndex,name,reportNumber,crmName,isUrl,file, harmLineDetailDataCommDTO,overLimitInfoCommDTO,deviceUnitCommDTO); + monitorHarmonicReportService.exportWorld(response,startTime,endTime,type,lineIndex,name,reportNumber,crmName,isUrl,file, harmLineDetailDataCommDTO,overLimitInfoCommDTO,deviceUnitCommDTO,null); } } diff --git a/pqs-harmonic/harmonic-common/src/main/java/com/njcn/harmonic/common/service/MonitorHarmonicReportService.java b/pqs-harmonic/harmonic-common/src/main/java/com/njcn/harmonic/common/service/MonitorHarmonicReportService.java index 64853e817..b102eaa8f 100644 --- a/pqs-harmonic/harmonic-common/src/main/java/com/njcn/harmonic/common/service/MonitorHarmonicReportService.java +++ b/pqs-harmonic/harmonic-common/src/main/java/com/njcn/harmonic/common/service/MonitorHarmonicReportService.java @@ -25,5 +25,5 @@ public interface MonitorHarmonicReportService { String crmName, Boolean isUrl, MultipartFile file, - HarmLineDetailDataCommDTO lineDto, OverLimitInfoCommDTO overLimitData, DeviceUnitCommDTO deviceUnit); + HarmLineDetailDataCommDTO lineDto, OverLimitInfoCommDTO overLimitData, DeviceUnitCommDTO deviceUnit, String dataLevel); } diff --git a/pqs-harmonic/harmonic-common/src/main/java/com/njcn/harmonic/common/service/impl/CustomReportTableServiceImpl.java b/pqs-harmonic/harmonic-common/src/main/java/com/njcn/harmonic/common/service/impl/CustomReportTableServiceImpl.java index 40e35fdab..78c1f7223 100644 --- a/pqs-harmonic/harmonic-common/src/main/java/com/njcn/harmonic/common/service/impl/CustomReportTableServiceImpl.java +++ b/pqs-harmonic/harmonic-common/src/main/java/com/njcn/harmonic/common/service/impl/CustomReportTableServiceImpl.java @@ -14,6 +14,7 @@ import cn.hutool.json.JSONObject; import cn.hutool.json.JSONTokener; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.extension.toolkit.SqlRunner; import com.njcn.common.pojo.enums.response.CommonResponseEnum; import com.njcn.common.pojo.exception.BusinessException; @@ -157,7 +158,13 @@ public class CustomReportTableServiceImpl implements CustomReportTableService { } else { phase = PHASE_MAPPING.get(item.getPhase()); } - tMap.put((item.getOtherName() + phase + item.getResourcesId()).toUpperCase(), item.getPrimaryFormula()); + if (ObjectUtils.isNotNull(item.getHarmStart()) && ObjectUtils.isNotNull(item.getHarmEnd())) { + for (int i = item.getHarmStart(); i <= item.getHarmEnd() + 1; i++) { + tMap.put((item.getOtherName() + "_" + i + phase + item.getResourcesId()).toUpperCase(), item.getPrimaryFormula()); + } + } else { + tMap.put((item.getOtherName() + phase + item.getResourcesId()).toUpperCase(), item.getPrimaryFormula()); + } }); eleEpdPqdList = eleEpdPqdList.stream().filter(it->"T".equals(it.getPhase())||"M".equals(it.getPhase())).collect(Collectors.toList()); diff --git a/pqs-harmonic/harmonic-common/src/main/java/com/njcn/harmonic/common/service/impl/MonitorHarmonicReportServiceImpl.java b/pqs-harmonic/harmonic-common/src/main/java/com/njcn/harmonic/common/service/impl/MonitorHarmonicReportServiceImpl.java index 74d99249a..0a57f5a6d 100644 --- a/pqs-harmonic/harmonic-common/src/main/java/com/njcn/harmonic/common/service/impl/MonitorHarmonicReportServiceImpl.java +++ b/pqs-harmonic/harmonic-common/src/main/java/com/njcn/harmonic/common/service/impl/MonitorHarmonicReportServiceImpl.java @@ -14,15 +14,15 @@ import com.njcn.device.pms.api.MonitorClient; import com.njcn.device.pms.pojo.po.Monitor; import com.njcn.device.pq.api.DeviceUnitClient; import com.njcn.harmonic.common.pojo.dto.DeviceUnitCommDTO; +import com.njcn.harmonic.common.pojo.dto.HarmLineDetailDataCommDTO; +import com.njcn.harmonic.common.pojo.dto.OverLimitInfoCommDTO; +import com.njcn.harmonic.common.service.MonitorCommReportService; +import com.njcn.harmonic.common.service.MonitorHarmonicReportService; import com.njcn.harmonic.pojo.param.ReportQueryParam; import com.njcn.harmonic.pojo.po.report.EnumPass; import com.njcn.harmonic.pojo.po.report.Pass; import com.njcn.harmonic.pojo.po.report.ReportTarget; import com.njcn.harmonic.pojo.vo.ReportValue; -import com.njcn.harmonic.common.pojo.dto.HarmLineDetailDataCommDTO; -import com.njcn.harmonic.common.pojo.dto.OverLimitInfoCommDTO; -import com.njcn.harmonic.common.service.MonitorCommReportService; -import com.njcn.harmonic.common.service.MonitorHarmonicReportService; import com.njcn.harmonic.utils.WordUtil2; import com.njcn.system.api.DicDataFeignClient; import com.njcn.system.api.ThemeFeignClient; @@ -114,7 +114,7 @@ public class MonitorHarmonicReportServiceImpl implements MonitorHarmonicReportSe String crmName, Boolean isUrl, MultipartFile file, - HarmLineDetailDataCommDTO lineDto, OverLimitInfoCommDTO overLimit, DeviceUnitCommDTO deviceUnit) { + HarmLineDetailDataCommDTO lineDto, OverLimitInfoCommDTO overLimit, DeviceUnitCommDTO deviceUnit, String dataLevel) { //获取监测点信息 String bdname; Integer pttype; @@ -122,6 +122,12 @@ public class MonitorHarmonicReportServiceImpl implements MonitorHarmonicReportSe String atype = ""; String btype = ""; String ctype = ""; + //pt + Double pt = getData(lineDto.getPt()); + //ct + Double ct = getData(lineDto.getCt()); + + if (type == 0) { if (ObjectUtil.isNull(lineDto)) { throw new BusinessException(CommonResponseEnum.NO_DATA); @@ -263,14 +269,13 @@ public class MonitorHarmonicReportServiceImpl implements MonitorHarmonicReportSe // 基波电压最大值 reportmap.put("$B" + "V0" + "X" + "_A$", judgeNull(voltage1.getFmaxValue())); - reportmap.put("$B" + "V0" + "X" + "_B$", judgeNull(voltage2.getFmaxValue())); reportmap.put("$B" + "V0" + "X" + "_C$", judgeNull(voltage3.getFmaxValue())); // 基波电流最大值 - reportmap.put("$B" + "I0" + "X" + "_A$", judgeNull(current1.getFmaxValue())); - reportmap.put("$B" + "I0" + "X" + "_B$", judgeNull(current2.getFmaxValue())); - reportmap.put("$B" + "I0" + "X" + "_C$", judgeNull(current3.getFmaxValue())); + reportmap.put("$B" + "I0" + "X" + "_A$", dataConversion(current1.getFmaxValue(),dataLevel,ct,true)); + reportmap.put("$B" + "I0" + "X" + "_B$", dataConversion(current2.getFmaxValue(),dataLevel,ct,true)); + reportmap.put("$B" + "I0" + "X" + "_C$", dataConversion(current3.getFmaxValue(),dataLevel,ct,true)); /************************************************************** **** 三张大表基础数据幅值 @@ -291,9 +296,9 @@ public class MonitorHarmonicReportServiceImpl implements MonitorHarmonicReportSe reportmap.put("$B" + "V0" + "N" + "_C$", judgeNull(voltage3.getMinValue())); // 基波电流最小值 - reportmap.put("$B" + "I0" + "N" + "_A$", judgeNull(current1.getMinValue())); - reportmap.put("$B" + "I0" + "N" + "_B$", judgeNull(current2.getMinValue())); - reportmap.put("$B" + "I0" + "N" + "_C$", judgeNull(current3.getMinValue())); + reportmap.put("$B" + "I0" + "N" + "_A$", dataConversion(current1.getMinValue(),dataLevel,ct,true)); + reportmap.put("$B" + "I0" + "N" + "_B$", dataConversion(current2.getMinValue(),dataLevel,ct,true)); + reportmap.put("$B" + "I0" + "N" + "_C$", dataConversion(current3.getMinValue(),dataLevel,ct,true)); /************************************************************** **** 三张大表基础数据幅值 @@ -314,9 +319,9 @@ public class MonitorHarmonicReportServiceImpl implements MonitorHarmonicReportSe reportmap.put("$B" + "V0" + "E" + "_C$", judgeNull(voltage3.getMeanValue())); // 基波电流平均值 - reportmap.put("$B" + "I0" + "E" + "_A$", judgeNull(current1.getMeanValue())); - reportmap.put("$B" + "I0" + "E" + "_B$", judgeNull(current2.getMeanValue())); - reportmap.put("$B" + "I0" + "E" + "_C$", judgeNull(current3.getMeanValue())); + reportmap.put("$B" + "I0" + "E" + "_A$", dataConversion(current1.getMeanValue(),dataLevel,ct,true)); + reportmap.put("$B" + "I0" + "E" + "_B$", dataConversion(current2.getMeanValue(),dataLevel,ct,true)); + reportmap.put("$B" + "I0" + "E" + "_C$", dataConversion(current3.getMeanValue(),dataLevel,ct,true)); /************************************************************** **** 三张大表基础数据幅值 @@ -337,9 +342,9 @@ public class MonitorHarmonicReportServiceImpl implements MonitorHarmonicReportSe reportmap.put("$B" + "V0" + "%" + "_C$", judgeNull(voltage3.getCp95Value())); // 基波电流cp95值 - reportmap.put("$B" + "I0" + "%" + "_A$", judgeNull(current1.getCp95Value())); - reportmap.put("$B" + "I0" + "%" + "_B$", judgeNull(current2.getCp95Value())); - reportmap.put("$B" + "I0" + "%" + "_C$", judgeNull(current3.getCp95Value())); + reportmap.put("$B" + "I0" + "%" + "_A$", dataConversion(current1.getCp95Value(),dataLevel,ct,true)); + reportmap.put("$B" + "I0" + "%" + "_B$", dataConversion(current2.getCp95Value(),dataLevel,ct,true)); + reportmap.put("$B" + "I0" + "%" + "_C$", dataConversion(current3.getCp95Value(),dataLevel,ct,true)); /************************************************************** **** 三张大表基础数据幅值 @@ -387,10 +392,10 @@ public class MonitorHarmonicReportServiceImpl implements MonitorHarmonicReportSe Double vaveValue = Double.parseDouble(reportmap.get("$BV0E_" + tmpstrMap + "$").toString()); Double vcp95Value = Double.parseDouble(reportmap.get("$BV0%_" + tmpstrMap + "$").toString()); // 基波电流 - Double imaxValue = Double.parseDouble(reportmap.get("$BI0X_" + tmpstrMap + "$").toString()); - Double iminValue = Double.parseDouble(reportmap.get("$BI0N_" + tmpstrMap + "$").toString()); - Double iaveValue = Double.parseDouble(reportmap.get("$BI0E_" + tmpstrMap + "$").toString()); - Double icp95Value = Double.parseDouble(reportmap.get("$BI0%_" + tmpstrMap + "$").toString()); + Double imaxValue = !Objects.equals("Secondary",dataLevel) ? Double.parseDouble(reportmap.get("$BI0X_" + tmpstrMap + "$").toString()):Double.parseDouble(reportmap.get("$BI0X_" + tmpstrMap + "$").toString())*ct; + Double iminValue = !Objects.equals("Secondary",dataLevel) ? Double.parseDouble(reportmap.get("$BI0N_" + tmpstrMap + "$").toString()):Double.parseDouble(reportmap.get("$BI0N_" + tmpstrMap + "$").toString())*ct; + Double iaveValue = !Objects.equals("Secondary",dataLevel) ? Double.parseDouble(reportmap.get("$BI0E_" + tmpstrMap + "$").toString()):Double.parseDouble(reportmap.get("$BI0E_" + tmpstrMap + "$").toString())*ct; + Double icp95Value = !Objects.equals("Secondary",dataLevel) ? Double.parseDouble(reportmap.get("$BI0%_" + tmpstrMap + "$").toString()):Double.parseDouble(reportmap.get("$BI0%_" + tmpstrMap + "$").toString())*ct; if (!(vmaxValue >= vminValue && vmaxValue >= vaveValue && vmaxValue >= vcp95Value)) { strBaseVIResult += "注意:从上表中可以看出" + strLineBaseName @@ -1222,9 +1227,12 @@ public class MonitorHarmonicReportServiceImpl implements MonitorHarmonicReportSe String strCurrent = strMap + (i + 1) + "%"; // 谐波电流幅值 - strCurrentA = judgeNull(this.listICurrent.get(i).getList().get(0).getCp95Value()); - strCurrentB = judgeNull(this.listICurrent.get(i).getList().get(1).getCp95Value()); - strCurrentC = judgeNull(this.listICurrent.get(i).getList().get(2).getCp95Value()); +// strCurrentA = judgeNull(this.listICurrent.get(i).getList().get(0).getCp95Value()); +// strCurrentB = judgeNull(this.listICurrent.get(i).getList().get(1).getCp95Value()); +// strCurrentC = judgeNull(this.listICurrent.get(i).getList().get(2).getCp95Value()); + strCurrentA = dataConversion(this.listICurrent.get(i).getList().get(0).getCp95Value(),dataLevel,ct,true); + strCurrentB = dataConversion(this.listICurrent.get(i).getList().get(1).getCp95Value(),dataLevel,ct,true); + strCurrentC = dataConversion(this.listICurrent.get(i).getList().get(2).getCp95Value(),dataLevel,ct,true); strLimit = judgeNull(this.listICurrent.get(i).getOverLimit()); reportmap.put(strCurrent + "_A$", strCurrentA); @@ -1253,9 +1261,9 @@ public class MonitorHarmonicReportServiceImpl implements MonitorHarmonicReportSe reportmap.put("$CI" + (i + 1) + "L$", strLimit); try { - maxValue = Double.parseDouble(strCurrentA); - minValue = Double.parseDouble(strCurrentB); - aveValue = Double.parseDouble(strCurrentC); + maxValue = Objects.equals("Secondary",dataLevel) ? Double.parseDouble(strCurrentA)*ct : Double.parseDouble(strCurrentA); + minValue = Objects.equals("Secondary",dataLevel) ? Double.parseDouble(strCurrentB)*ct : Double.parseDouble(strCurrentB); + aveValue = Objects.equals("Secondary",dataLevel) ? Double.parseDouble(strCurrentC)*ct : Double.parseDouble(strCurrentC);; limit = Double.parseDouble(strLimit); } catch (Exception e) { strResultCurrentValue += "注意:从上表中可以看出" + strLineBaseName +(i + 1)+ "次谐波电流幅值95%概率值数据存在异常(不是数值类型)。\r\n"; @@ -1380,6 +1388,26 @@ public class MonitorHarmonicReportServiceImpl implements MonitorHarmonicReportSe } } + public Double getData(String data) { + double ratio = 1.0; + if (Objects.isNull(data) || data.isEmpty()) { + return ratio; + } + String[] parts = data.split("/"); + if (parts.length == 2) { + try { + Double num1 = Double.parseDouble(parts[0]); + Double num2 = Double.parseDouble(parts[1]); + ratio = num1 / num2; + } catch (NumberFormatException var7) { + System.out.println("字符串格式错误"); + } + } else { + ratio = Double.parseDouble(parts[0]); + } + return ratio; + } + /** * 数据单位信息 重组 * @@ -1722,6 +1750,22 @@ public class MonitorHarmonicReportServiceImpl implements MonitorHarmonicReportSe return (result == null) ? "/" : result.toString(); } + public String dataConversion(Float result, String dataLevel, Double ratio, Boolean isI) { + if (result == null) { + return "/"; + } + if (!"Secondary".equals(dataLevel)) { + return String.valueOf(result); + } + double conversionRatio = (ratio != null) ? ratio : 1.0; + double convertedValue = result * conversionRatio; + if (isI != null && Boolean.TRUE.equals(isI)) { + return String.format("%.2f", convertedValue); + } else { + return String.format("%.2f", convertedValue / 1000.0); + } + } + /** * 谐波电流限值 *