diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsGroupServiceImpl.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsGroupServiceImpl.java index 91d0cc7..cd434c9 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsGroupServiceImpl.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsGroupServiceImpl.java @@ -336,8 +336,14 @@ public class CsGroupServiceImpl extends ServiceImpl impl double re = 0; if (Objects.equals("Primary",commonStatisticalQueryParam.getDataLevel())) { if (Objects.equals("Primary",csDataSet.getDataLevel())) { - vo.setStatisticalData(Double.valueOf(df.format(temp.getValue()))); - unit = epdPqd.getUnit(); + if (HarmonicConstant.POWER_LIST.contains(epdPqd.getShowName())) { + re = Objects.isNull(temp.getValue()) ? 3.14159 : temp.getValue() / 1000; + vo.setStatisticalData(Double.valueOf(df.format(re))); + unit = "k" + epdPqd.getUnit(); + } else { + vo.setStatisticalData(Objects.isNull(temp.getValue()) ? 3.14159 : Double.parseDouble(df.format(temp.getValue()))); + unit = epdPqd.getUnit(); + } } else { if(Objects.nonNull(epdPqd.getPrimaryFormula())){ switch (epdPqd.getPrimaryFormula()) { diff --git a/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/DataServiceImpl.java b/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/DataServiceImpl.java index 7645b1e..2577cf3 100644 --- a/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/DataServiceImpl.java +++ b/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/DataServiceImpl.java @@ -219,8 +219,14 @@ public class DataServiceImpl implements IDataService { vo.setSort(item2.getSort()); if (Objects.equals("Primary",dataLevel)) { if (Objects.equals("Primary",csDataSetLevel)) { - vo.setAvgValue(Objects.isNull(statisticalDataDTO) ? 3.14159 : Double.parseDouble(df.format(statisticalDataDTO.getValue()))); - unit = item2.getUnit(); + if (HarmonicConstant.POWER_LIST.contains(item2.getShowName())) { + re = Objects.isNull(statisticalDataDTO) ? 3.14159 : statisticalDataDTO.getValue() / 1000; + vo.setAvgValue(Double.valueOf(df.format(re))); + unit = "k" + item2.getUnit(); + } else { + vo.setAvgValue(Objects.isNull(statisticalDataDTO) ? 3.14159 : Double.parseDouble(df.format(statisticalDataDTO.getValue()))); + unit = item2.getUnit(); + } } else { if(Objects.nonNull(item2.getPrimaryFormula())){ switch (item2.getPrimaryFormula()) {