From a1d34a0f1c2a7c2c8703153a6d4a837c4ecb636a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=9B=A8=E6=9C=A8c?= <857448963@qq.com>
Date: Wed, 22 Feb 2023 14:58:11 +0800
Subject: [PATCH] =?UTF-8?q?pms=E5=8F=B0=E8=B4=A6bug=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../device/pms/pojo/vo/PowerClientVO.java | 163 ++++++++++++++++++
.../PmsDistributionMonitorController.java | 7 +-
.../PmsPowerClientController.java | 5 +-
.../majornetwork/PowerClientMapper.java | 7 +
.../mapping/PowerClientMapper.xml | 21 +++
.../majornetwork/IPowerClientService.java | 3 +-
.../impl/PowerClientServiceImpl.java | 13 +-
7 files changed, 208 insertions(+), 11 deletions(-)
create mode 100644 pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/vo/PowerClientVO.java
diff --git a/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/vo/PowerClientVO.java b/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/vo/PowerClientVO.java
new file mode 100644
index 000000000..71152aacc
--- /dev/null
+++ b/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/vo/PowerClientVO.java
@@ -0,0 +1,163 @@
+package com.njcn.device.pms.pojo.vo;
+
+import com.njcn.db.bo.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.time.LocalDate;
+
+/**
+ * pqs
+ *
+ * @author cdf
+ * @date 2023/2/22
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class PowerClientVO extends BaseEntity {
+
+ /**
+ * 用户编号
+ */
+ private String id;
+
+ /**
+ * 用户名称
+ */
+ private String name;
+
+ /**
+ * 组织机构名称
+ */
+ private String orgName;
+
+ /**
+ * 组织机构ID(外键)
+ */
+ private String orgId;
+
+ /**
+ * 运维单位名称
+ */
+ private String operationName;
+
+ /**
+ * 运维单位ID(外键)
+ */
+ private String operationId;
+
+ /**
+ * 用户分类(字典)
+ */
+ private String userType;
+
+ /**
+ * 行业分类(字典)
+ */
+ private String industryType;
+
+ /**
+ * 用电类别(字典)
+ */
+ private String electricityType;
+
+ /**
+ * 合同容量
+ */
+ private Float contractCapacity;
+
+ /**
+ * 运行容量
+ */
+ private Float operatingCapacity;
+
+ /**
+ * 生产班次(字典)
+ */
+ private String productionShift;
+
+ /**
+ * 负荷性质(字典)
+ */
+ private String loadNature;
+
+ /**
+ * 供电电压(字典)
+ */
+ private String voltageLevel;
+
+ /**
+ * 高耗能行业类别(字典)
+ */
+ private String highIndustryType;
+
+ /**
+ * 送电日期
+ */
+ private LocalDate powerTransmissionDate;
+
+ /**
+ * 重要性等级(字典)
+ */
+ private String importanceLevel;
+
+ /**
+ * 用电客户状态(字典)
+ */
+ private String eccStat;
+
+ /**
+ * 是否敏感用户:0-否;1:是;
+ */
+ private Integer ifSensitiveUser;
+
+ /**
+ * 是否影响电能质量:0-否;1:是;
+ */
+ private Integer ifPowerQuality;
+
+ /**
+ * 是否重要客户:0-否;1:是;
+ */
+ private Integer ifKeyCustomers;
+
+ /**
+ * 敏感用户类别(字典)
+ */
+ private String sensitiveType;
+
+ /**
+ * 供电变电站(外键)
+ */
+ private String powerStationId;
+
+ /**
+ * 供电线路(外键)
+ */
+ private String lineId;
+
+ /**
+ * 供电台区(外键)
+ */
+ private String platformId;
+
+ /**
+ * 供电台区名称
+ */
+ private String platformName;
+
+ /**
+ * 用户标签
+ */
+ private String userTag;
+
+ /**
+ * 是否是上送国网监测点,0-否 1-是
+ */
+ private Integer isUpToGrid;
+
+ /**
+ * 数据状态:0-删除;1-正常;
+ */
+ private Integer status;
+}
diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/ledgerManger/PmsDistributionMonitorController.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/ledgerManger/PmsDistributionMonitorController.java
index cfc0fc7a8..36ee02918 100644
--- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/ledgerManger/PmsDistributionMonitorController.java
+++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/ledgerManger/PmsDistributionMonitorController.java
@@ -26,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
import com.njcn.web.controller.BaseController;
import java.util.List;
+import java.util.Objects;
/**
*
@@ -98,7 +99,11 @@ public class PmsDistributionMonitorController extends BaseController {
public HttpResult getDistributionMonitorById(@RequestParam("monitorSort") String monitorSort,@RequestParam("id") String id){
String methodDescribe = getMethodDescribe("getDistributionMonitorById");
DistributionMonitor res = iDistributionMonitorService.getDistributionMonitorById(monitorSort,id);
- return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
+ if(Objects.isNull(res)){
+ return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
+ }else {
+ return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
+ }
}
diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/ledgerManger/PmsPowerClientController.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/ledgerManger/PmsPowerClientController.java
index 7f94cc1cb..e6e445ccf 100644
--- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/ledgerManger/PmsPowerClientController.java
+++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/ledgerManger/PmsPowerClientController.java
@@ -11,6 +11,7 @@ import com.njcn.common.utils.HttpResultUtil;
import com.njcn.device.pms.pojo.param.PowerClientParam;
import com.njcn.device.pms.pojo.param.PowerUserParam;
import com.njcn.device.pms.pojo.po.PowerClient;
+import com.njcn.device.pms.pojo.vo.PowerClientVO;
import com.njcn.device.pms.service.majornetwork.IPowerClientService;
import com.njcn.web.pojo.param.BaseParam;
import io.swagger.annotations.Api;
@@ -100,9 +101,9 @@ public class PmsPowerClientController extends BaseController {
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getPowerClientList")
@ApiOperation("获取用电用户列表")
- public HttpResult> getPowerClientList(@RequestBody PowerClientParam powerClientParam) {
+ public HttpResult> getPowerClientList(@RequestBody PowerClientParam powerClientParam) {
String methodDescribe = getMethodDescribe("getPowerClientList");
- List result = iPowerClientService.getPowerClientList(powerClientParam);
+ List result = iPowerClientService.getPowerClientList(powerClientParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
}
diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/PowerClientMapper.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/PowerClientMapper.java
index f13158e21..aa300d4b4 100644
--- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/PowerClientMapper.java
+++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/PowerClientMapper.java
@@ -2,6 +2,10 @@ package com.njcn.device.pms.mapper.majornetwork;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.device.pms.pojo.po.PowerClient;
+import com.njcn.device.pms.pojo.vo.PowerClientVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
/**
*
@@ -13,4 +17,7 @@ import com.njcn.device.pms.pojo.po.PowerClient;
*/
public interface PowerClientMapper extends BaseMapper {
+
+ List getPowerClientSelect(@Param("orgIds") List orgIds);
+
}
diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/mapping/PowerClientMapper.xml b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/mapping/PowerClientMapper.xml
index 9522b734a..cd53506a2 100644
--- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/mapping/PowerClientMapper.xml
+++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/mapping/PowerClientMapper.xml
@@ -3,4 +3,25 @@
+
diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IPowerClientService.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IPowerClientService.java
index e297bac7a..e83f1f6b6 100644
--- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IPowerClientService.java
+++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IPowerClientService.java
@@ -6,6 +6,7 @@ import com.njcn.device.pms.pojo.param.PowerClientParam;
import com.njcn.device.pms.pojo.param.PowerUserParam;
import com.njcn.device.pms.pojo.po.PowerClient;
import com.njcn.device.pms.pojo.po.PowerClient;
+import com.njcn.device.pms.pojo.vo.PowerClientVO;
import com.njcn.web.pojo.param.BaseParam;
import java.util.List;
@@ -62,7 +63,7 @@ public interface IPowerClientService extends IService {
* @date 2022/10/25
* @return boolean
*/
- List getPowerClientList(PowerClientParam powerClientParam);
+ List getPowerClientList(PowerClientParam powerClientParam);
/**
* 查询用电用户列表
diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/PowerClientServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/PowerClientServiceImpl.java
index b88ce9d23..e756a5d46 100644
--- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/PowerClientServiceImpl.java
+++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/PowerClientServiceImpl.java
@@ -13,6 +13,7 @@ import com.njcn.device.pms.pojo.param.PowerGenerationUserParam;
import com.njcn.device.pms.pojo.param.PowerUserParam;
import com.njcn.device.pms.pojo.po.PowerClient;
import com.njcn.device.pms.pojo.po.PowerGenerationUser;
+import com.njcn.device.pms.pojo.vo.PowerClientVO;
import com.njcn.device.pms.service.majornetwork.IPowerClientService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.user.api.DeptFeignClient;
@@ -22,6 +23,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
+import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@@ -77,15 +79,12 @@ public class PowerClientServiceImpl extends ServiceImpl getPowerClientList(PowerClientParam powerClientParam) {
- LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>();
+ public List getPowerClientList(PowerClientParam powerClientParam) {
+ List deptCodes = new ArrayList<>();
if(StrUtil.isNotBlank(powerClientParam.getOrgId())){
- List deptIds = deptFeignClient.getDepSonSelfCodetByDeptId(powerClientParam.getOrgId()).getData();
- lambdaQueryWrapper.eq(PowerClient::getOrgId,deptIds).eq(PowerClient::getStatus,DataStateEnum.ENABLE.getCode());
+ deptCodes = deptFeignClient.getDepSonSelfCodetByDeptId(powerClientParam.getOrgId()).getData();
}
- lambdaQueryWrapper.select(PowerClient::getId,PowerClient::getName,PowerClient::getOrgId,PowerClient::getOrgName);
- lambdaQueryWrapper.orderByDesc(PowerClient::getCreateTime).eq(PowerClient::getStatus, DataStateEnum.ENABLE.getCode());
- return this.list(lambdaQueryWrapper);
+ return this.baseMapper.getPowerClientSelect(deptCodes);
}