From d23053251f140ad1d2bd7f9073e770acf99f6708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=A8=E6=9C=A8c?= <857448963@qq.com> Date: Thu, 28 Jul 2022 20:36:19 +0800 Subject: [PATCH] =?UTF-8?q?pv=E7=BB=88=E7=AB=AF=E5=8F=B0=E5=B8=90=20=20=20?= =?UTF-8?q?=E9=83=A8=E9=97=A8=E5=A2=9E=E5=8A=A0id=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=89=80=E6=9C=89=E5=AD=90=E9=83=A8=E9=97=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/enums/PvDeviceResponseEnum.java | 3 + .../pojo/param/pv/DeviceQueryParam.java | 4 +- .../device/pojo/param/pv/PvDeviceParam.java | 29 ++++ .../pojo/param/pv/PvDistributedParam.java | 16 +++ .../pojo/param/pv/PvLineDetailParam.java | 47 +++---- .../device/pojo/param/pv/PvSubAreaParam.java | 4 +- .../pojo/param/pv/PvSubstationParam.java | 4 + .../pojo/param/pv/PvTenVoltageParam.java | 28 ++++ .../pojo/param/pv/PvTerminalBaseQuery.java | 10 +- .../pojo/param/pv/TenVoltageQueryParam.java | 3 + .../com/njcn/device/pojo/po/pv/PvDevice.java | 22 ++++ .../njcn/device/pojo/po/pv/PvDistributed.java | 19 ++- .../njcn/device/pojo/po/pv/PvLineDetail.java | 13 +- .../com/njcn/device/pojo/po/pv/PvSubArea.java | 4 +- .../njcn/device/pojo/po/pv/PvSubstation.java | 5 + .../njcn/device/pojo/po/pv/PvTenVoltage.java | 21 +++ .../com/njcn/device/pojo/vo/pv/DisOrLvVO.java | 124 ++++++++++++++++++ .../njcn/device/pojo/vo/pv/PvDeviceVO.java | 29 ++++ .../device/pojo/vo/pv/PvDistributedVO.java | 17 +++ .../device/pojo/vo/pv/PvLineAllDetailVO.java | 46 ++++++- .../njcn/device/pojo/vo/pv/PvLvUserVO.java | 17 +++ .../njcn/device/pojo/vo/pv/PvSubAreaVO.java | 26 ++++ .../device/pojo/vo/pv/PvSubstationVO.java | 6 + .../device/pojo/vo/pv/PvTenVoltageVO.java | 27 ++++ .../controller/PvDeviceController.java | 21 +-- .../controller/PvDistributedController.java | 15 ++- .../controller/PvLineDetailController.java | 10 +- .../controller/PvLvUserController.java | 17 +-- .../controller/PvSubAreaController.java | 15 ++- .../controller/PvSubstationController.java | 12 +- .../controller/PvTenVoltageController.java | 31 ++++- .../controller/PvTerminalBaseController.java | 20 +++ .../njcn/pvdevice/mapper/PvDeviceMapper.java | 8 +- .../pvdevice/mapper/PvDistributedMapper.java | 3 +- .../pvdevice/mapper/PvLineDetailMapper.java | 2 +- .../njcn/pvdevice/mapper/PvLvUserMapper.java | 3 +- .../njcn/pvdevice/mapper/PvSubAreaMapper.java | 7 +- .../pvdevice/mapper/PvTenVoltageMapper.java | 3 +- .../mapper/mapping/PvDeviceMapper.xml | 90 +++++++++---- .../mapper/mapping/PvDistributedMapper.xml | 11 +- .../mapper/mapping/PvLineDetailMapper.xml | 54 +++++++- .../mapper/mapping/PvLvUserMapper.xml | 5 +- .../mapper/mapping/PvSubAreaMapper.xml | 15 ++- .../mapper/mapping/PvSubstationMapper.xml | 8 +- .../mapper/mapping/PvTenVoltageMapper.xml | 22 +++- .../pvdevice/service/IPvDeviceService.java | 11 +- .../service/IPvDistributedService.java | 7 +- .../service/IPvLineDetailService.java | 6 +- .../pvdevice/service/IPvLvUserService.java | 7 +- .../pvdevice/service/IPvSubAreaService.java | 7 +- .../service/IPvSubstationService.java | 4 +- .../service/IPvTenVoltageService.java | 35 +++-- .../service/PvTerminalBaseService.java | 9 ++ .../service/impl/PvDeviceServiceImpl.java | 27 +++- .../impl/PvDistributedServiceImpl.java | 9 +- .../service/impl/PvLineDetailServiceImpl.java | 77 ++++++----- .../service/impl/PvLvUserServiceImpl.java | 9 +- .../service/impl/PvSubAreaServiceImpl.java | 9 +- .../service/impl/PvSubstationServiceImpl.java | 26 +++- .../service/impl/PvTenVoltageServiceImpl.java | 15 ++- .../impl/PvTerminalBaseServiceImpl.java | 72 +++++++--- .../{DeviceTest.java => PvDeviceTest.java} | 2 +- .../com/njcn/user/api/DeptFeignClient.java | 7 + .../DeptFeignClientFallbackFactory.java | 7 + .../njcn/user/controller/DeptController.java | 17 +++ .../java/com/njcn/user/mapper/DeptMapper.java | 7 + .../njcn/user/mapper/mapping/DeptMapper.xml | 7 +- .../com/njcn/user/service/IDeptService.java | 8 ++ .../user/service/impl/DeptServiceImpl.java | 9 ++ 69 files changed, 1032 insertions(+), 258 deletions(-) create mode 100644 pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/DisOrLvVO.java create mode 100644 pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvDeviceVO.java create mode 100644 pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvDistributedVO.java create mode 100644 pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvLvUserVO.java create mode 100644 pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvSubAreaVO.java create mode 100644 pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvTenVoltageVO.java rename pqs-device/device-boot/src/test/java/com/njcn/{DeviceTest.java => PvDeviceTest.java} (96%) diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/enums/PvDeviceResponseEnum.java b/pqs-device/device-api/src/main/java/com/njcn/device/enums/PvDeviceResponseEnum.java index 00d313ac0..7f7c22cb6 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/enums/PvDeviceResponseEnum.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/enums/PvDeviceResponseEnum.java @@ -26,6 +26,7 @@ public enum PvDeviceResponseEnum { VOLTAGE_PARAM_EMPTY("A0358","所属母线不可为空"), VOLTAGE_PARAM_EMPTY_MUST("A0359","所属母线必须为空"), LV_USER_REPEAT("A0360","低压用户名称重复"), + SUBSTATION_CODE_REPEAT("A0351","变电站编号重复"), TEN_VOLTAGE_NULL("A0360","未查询到指定10kV线路"), @@ -33,11 +34,13 @@ public enum PvDeviceResponseEnum { SUB_AREA_NULL("A0362","未查询到指定台区"), DEV_NULL("A0363","未查询到指定终端"), SUBSTATION_NULL("A0364","未查询到指定变电站"), + SUBSTATION_EMPTY("A0364","变电站不可为空"), VOLTAGE_NULL("A0365","未查询到指定母线"), DEV_NUM_NULL("A0366","当前装置监测点序号已存在"), ONE_SUB_VOLTAGE_EMPTY("A0367","I类监测点变电站母线不可为空"), TWO_SUB_VOLTAGE_EMPTY_MUST("A0368","II类监测点变电站母线必须为空"), LINE_DEVICE_NO_MATCH("A0369","监测点所属装置型号不匹配"), + NO_SUB("A0370","当前单位下不存在台区或变电站"), ; diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/DeviceQueryParam.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/DeviceQueryParam.java index 57c0822d0..ba70a23eb 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/DeviceQueryParam.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/DeviceQueryParam.java @@ -21,6 +21,6 @@ public class DeviceQueryParam extends BaseParam { @ApiModelProperty(value = "manufacturer",name = "制造厂商") private List manufacturer; - @ApiModelProperty(value = "devType",name = "设备类型") - private List devType; + @ApiModelProperty(value = "type",name = "设备类型") + private List type; } diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvDeviceParam.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvDeviceParam.java index 0d22728c3..4cb366612 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvDeviceParam.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvDeviceParam.java @@ -8,11 +8,13 @@ import com.njcn.web.pojo.annotation.DateTimeStrValid; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +import org.hibernate.validator.constraints.Range; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import javax.validation.constraints.Pattern; import java.io.Serializable; +import java.time.LocalDate; import java.time.LocalDateTime; /** @@ -37,6 +39,10 @@ public class PvDeviceParam implements Serializable { @NotBlank(message = "终端类型不可为空") private String type; + @ApiModelProperty(name = "name",value = "装置名称",required = true) + @NotBlank(message = "装置名称") + private String name; + /** * 用于保存PMS中电能质量监测终端Id、智能融合终端Id,智能电表Id */ @@ -83,6 +89,29 @@ public class PvDeviceParam implements Serializable { @ApiModelProperty(name = "devKey",value = "装置秘钥(3ds加密)") private String devKey; + + /** + * 投运时间 + */ + @ApiModelProperty(name = "loadTime",value = "投运时间") + @DateTimeStrValid(message = "投运时间格式错误") + private LocalDate loadTime; + + /** + * 装置通讯状态 + */ + @ApiModelProperty(name = "devStatus",value = "装置通讯状态") + @NotNull(message = "装置通讯状态不能为空") + @Range(min = 0,max = 1) + private Integer devStatus; + + + /** + * 信号传输方式 + */ + @ApiModelProperty(name = "communicateType",value = "信号传输方式") + private String communicateType; + /** * 本次定检时间,默认等于投运时间 */ diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvDistributedParam.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvDistributedParam.java index e4eb74361..0e0202f81 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvDistributedParam.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvDistributedParam.java @@ -36,6 +36,13 @@ public class PvDistributedParam implements Serializable { @NotBlank(message = "分布式光伏名称不可为空") private String name; + /** + * 分布式光伏编号 + */ + @ApiModelProperty(name = "code",value = "分布式光伏编号",required = true) + @NotBlank(message = "分布式光伏编号不可为空") + private String code; + /** * 用户编号(与低压用户台账表低压用户编号字段一致) */ @@ -79,6 +86,15 @@ public class PvDistributedParam implements Serializable { @ApiModelProperty(name = "energyCapacity",value = "储能配置容量(KVA)") private Float energyCapacity; + @ApiModelProperty(name = "smartSwitch",value = "智能开关编号") + private String smartSwitch; + + @ApiModelProperty(name = "installTime",value = "安装时间") + private String installTime; + + @ApiModelProperty(name = "runTime",value = "投运时间") + private String runTime; + @Data diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvLineDetailParam.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvLineDetailParam.java index c62dd5e25..4f2a8be8b 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvLineDetailParam.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvLineDetailParam.java @@ -85,6 +85,10 @@ public class PvLineDetailParam implements Serializable { @NotBlank(message = "用户编号不能为空") private String userCode; + @ApiModelProperty(name = "userCodeType",value = "用户编号区分 0.分布式 1.低压用户") + @NotNull(message = "用户编号标识") + private Integer userCodeType; + /** * 电压等级 @@ -96,112 +100,91 @@ public class PvLineDetailParam implements Serializable { * 线路号(在同一台设备中的监测点号) */ @ApiModelProperty(name = "num",value = "线路号(在同一台设备中的监测点号)") - @NotNull(message = "线路号不可为空") - @Range(min = 1,max = 10,message = "线路号违规") private Integer num; /** * PT一次变比 */ - @NotNull(message = "PT一次变比不可为空") @ApiModelProperty(name = "pt1",value = "PT一次变比") private Float pt1; /** * PT二次变比 */ - @NotNull(message = "PT二次变比不可为空") @ApiModelProperty(name = "pt2",value = "PT二次变比") private Float pt2; /** * CT一次变比 */ - @NotNull(message = "CT一次变比不可为空") @ApiModelProperty(name = "ct1",value = "CT一次变比") private Float ct1; /** * CT二次变比 */ - @NotNull(message = "CT二次变比不可为空") @ApiModelProperty(name = "ct2",value = "CT二次变比") private Float ct2; /** * 设备容量 */ - @NotNull(message = "设备容量不可为空") @ApiModelProperty(name = "devCapacity",value = "设备容量") private Float devCapacity; /** * 短路容量 */ - @NotNull(message = "短路容量不可为空") @ApiModelProperty(name = "shortCapacity",value = "短路容量") private Float shortCapacity; /** * 基准容量 */ - @NotNull(message = "基准容量不可为空") @ApiModelProperty(name = "standardCapacity",value = "基准容量") private Float standardCapacity; /** * 协议容量 */ - @NotNull(message = "协议容量不可为空") @ApiModelProperty(name = "dealCapacity",value = "协议容量") private Float dealCapacity; /** - * 接线类型(0:星型接法;1:三角型接法;2:开口三角型接法) + * 接线类型字典表 */ - @NotNull(message = "接线类型不可为空") - @ApiModelProperty(name = "ptType",value = "接线类型(0:星型接法;1:三角型接法;2:开口三角型接法)") - @Range(min = 0,max = 2,message = "接线类型违规") - private Integer ptType; + @ApiModelProperty(name = "ptType",value = "接线类型字典表") + private String ptType; /** * 测量间隔(1-10分钟) */ - @NotNull(message = "测量间隔不可为空") @ApiModelProperty(name = "timeInterval",value = "测量间隔(1-10分钟)") - @Range(min = 1,max = 10,message = "测量间隔(1-10分钟)") private Integer timeInterval; /** * 干扰源类型,字典表 */ - @NotNull(message = "干扰源类型不可为空") @ApiModelProperty(name = "loadType",value = "干扰源类型,字典表") - @Pattern(regexp = PatternRegex.SYSTEM_ID, message = "干扰源类型id违规") private String loadType; /** * 行业类型,字典表 */ - @NotNull(message = "行业类型不可为空") + @ApiModelProperty(name = "businessType",value = "行业类型,字典表") - @Pattern(regexp = PatternRegex.SYSTEM_ID, message = "行业类型id违规") private String businessType; /** * 网公司谐波监测平台标志(0-否;1-是),默认否 */ - @NotNull(message = "网公司谐波监测平台标志不可为空") @ApiModelProperty(name = "monitorFlag",value = "网公司谐波监测平台标志(0-否;1-是),默认否") - @Range(min = 0,max = 1,message = "网公司谐波监测平台标志违规") private Integer monitorFlag; /** * 电网标志(0-电网侧;1-非电网侧) */ - @NotNull(message = "电网标志不可为空") @ApiModelProperty(name = "powerFlag",value = "电网标志(0-电网侧;1-非电网侧)") - @Range(min = 0,max = 1,message = "电网标志违规") private Integer powerFlag; /** @@ -216,12 +199,22 @@ public class PvLineDetailParam implements Serializable { @ApiModelProperty(name = "objName",value = "监测点对象名称") private String objName; + /** + * 监测点对象大类 + */ + @ApiModelProperty(name = "smallName",value = "监测点对象大类") + private String smallName; + + /** + * 监测点对象小类 + */ + @ApiModelProperty(name = "bigName",value = "监测点对象小类") + private String bigName; + /** * 人为干预是否参与统计(0:不参与,1:参与)默认参与统计 */ - @NotNull(message = "人为干预是否参与统计标志不可为空") @ApiModelProperty(name = "statFlag",value = "人为干预是否参与统计(0:不参与,1:参与)默认参与统计") - @Range(min = 0,max = 1,message = "为干预是否参与统计违规") private Integer statFlag = 1; /** diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvSubAreaParam.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvSubAreaParam.java index 1d5b207ba..c10d807e0 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvSubAreaParam.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvSubAreaParam.java @@ -103,13 +103,13 @@ public class PvSubAreaParam implements Serializable { * 是否安装智能融合终端 */ @ApiModelProperty(name = "devFusion",value = "是否安装智能融合终端") - private Boolean devFusion; + private Integer devFusion; /** * 是否有分布式光伏接入 */ @ApiModelProperty(name = "pv",value = "是否有分布式光伏接入") - private Boolean pv; + private Integer pv; /** * 分布式光伏总装机容量(KVA) diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvSubstationParam.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvSubstationParam.java index 45e0bf6a5..413b43228 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvSubstationParam.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvSubstationParam.java @@ -41,6 +41,10 @@ public class PvSubstationParam implements Serializable { @NotBlank(message = "变电站名称不能为空") private String name; + @ApiModelProperty(name = "subCode",value = "变电站编号",required = true) + @NotBlank(message = "变电站编号不能为空") + private String subCode; + /** * 电压等级Id,字典表 */ diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvTenVoltageParam.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvTenVoltageParam.java index 2a4bdebc4..a8f481838 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvTenVoltageParam.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvTenVoltageParam.java @@ -45,6 +45,13 @@ public class PvTenVoltageParam implements Serializable { @NotBlank(message = "线路名称不能为空") private String name; + /** + * 线路编号 + */ + @ApiModelProperty(name = "code",value = "线路编号",required = true) + @NotBlank(message = "线路编号不能为空") + private String code; + /** * 跨区域类型 */ @@ -137,6 +144,27 @@ public class PvTenVoltageParam implements Serializable { private String putIntoDate; + /** + * 是否有分布式光伏接入 + */ + @ApiModelProperty(name = "pvStatus",value = "是否有分布式光伏接入 0.否 1.是") + private Integer pvStatus; + + + /** + * 分布式光伏接入容量 + */ + @ApiModelProperty(name = "pvCapacity",value = "分布式光伏接入容量") + private Integer pvCapacity; + + + /** + * 分布式光伏接入数量 + */ + @ApiModelProperty(name = "pvNum",value = "分布式光伏接入数量") + private Integer pvNum; + + @Data @EqualsAndHashCode(callSuper = true) diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvTerminalBaseQuery.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvTerminalBaseQuery.java index 14a2a5e6b..9d70dad5b 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvTerminalBaseQuery.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/PvTerminalBaseQuery.java @@ -22,12 +22,18 @@ public class PvTerminalBaseQuery extends BaseParam { @ApiModelProperty(name = "id",value = "单位变电站台区索引",required = true) @NotEmpty(message = "单位变电站台区索引不能为空") - private List id; + private String id; @ApiModelProperty(name = "level",value = "0.单位 1.变电站 2.台区",required = true) @NotNull(message = "树层级不可为空") private Integer level; @ApiModelProperty(name = "type",value = "字典类型 I II III类监测点类型id") - private Integer type; + private String type; + + @ApiModelProperty(name = "lineStatus",value = "监测点状态") + private Integer lineStatus; + + @ApiModelProperty(name = "runTime",value = "投运时间") + private Integer runTime; } diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/TenVoltageQueryParam.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/TenVoltageQueryParam.java index ba54187e9..4b8b9fbcb 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/TenVoltageQueryParam.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/param/pv/TenVoltageQueryParam.java @@ -23,4 +23,7 @@ public class TenVoltageQueryParam extends BaseParam { @ApiModelProperty(name = "designScale",value = "电压等级") private List designScale; + + @ApiModelProperty(name = "pvStatus",value = "是否有光伏接入") + private Integer pvStatus; } diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/po/pv/PvDevice.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/po/pv/PvDevice.java index b6531766f..ec106564c 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/po/pv/PvDevice.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/po/pv/PvDevice.java @@ -31,6 +31,8 @@ public class PvDevice extends BaseEntity { */ private String id; + private String name; + /** * 终端类型(电能质量监测终端、智能电表、智能融合终端),字典表 */ @@ -71,6 +73,22 @@ public class PvDevice extends BaseEntity { */ private String devKey; + /** + * 投运时间 + */ + private LocalDate loadTime; + + /** + * 装置通讯状态 + */ + private Integer devStatus; + + + /** + * 信号传输方式 + */ + private String communicateType; + /** * 本次定检时间,默认等于投运时间 */ @@ -81,6 +99,10 @@ public class PvDevice extends BaseEntity { */ private LocalDate nextTimeCheck; + /** + * 终端级别 + */ + private String devGrade; /** * 状态 */ diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/po/pv/PvDistributed.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/po/pv/PvDistributed.java index f623e9813..d28592e31 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/po/pv/PvDistributed.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/po/pv/PvDistributed.java @@ -1,10 +1,13 @@ package com.njcn.device.pojo.po.pv; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; import com.njcn.db.bo.BaseEntity; import java.io.Serializable; +import java.time.LocalDate; import java.time.LocalDateTime; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -30,16 +33,15 @@ public class PvDistributed extends BaseEntity { */ private String id; - /** - * 所属台区表Id(外键) - */ - private String subAreaId; /** * 分布式光伏名称 */ private String name; + + private String code; + /** * 用户编号(与低压用户台账表低压用户编号字段一致) */ @@ -75,6 +77,15 @@ public class PvDistributed extends BaseEntity { */ private Float energyCapacity; + + private String smartSwitch; + + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDate installTime; + + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDate runTime; + /** * 状态 */ diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/po/pv/PvLineDetail.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/po/pv/PvLineDetail.java index 17f74aa92..2255fd90f 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/po/pv/PvLineDetail.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/po/pv/PvLineDetail.java @@ -6,6 +6,7 @@ import java.io.Serializable; import java.time.LocalDate; import java.time.LocalDateTime; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -62,6 +63,8 @@ public class PvLineDetail extends BaseEntity { private String userCode; + private Integer userCodeType; + /** * 电压等级 */ @@ -115,7 +118,7 @@ public class PvLineDetail extends BaseEntity { /** * 接线类型(0:星型接法;1:三角型接法;2:开口三角型接法) */ - private Integer ptType; + private String ptType; /** * 测量间隔(1-10分钟) @@ -152,6 +155,14 @@ public class PvLineDetail extends BaseEntity { */ private String objName; + + private String smallName; + + /** + * 监测点对象小类 + */ + private String bigName; + /** * 人为干预是否参与统计(0:不参与,1:参与)默认参与统计 */ diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/po/pv/PvSubArea.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/po/pv/PvSubArea.java index 0018d51db..2f2d25c64 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/po/pv/PvSubArea.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/po/pv/PvSubArea.java @@ -88,12 +88,12 @@ public class PvSubArea extends BaseEntity { /** * 是否安装智能融合终端 */ - private Boolean devFusion; + private Integer devFusion; /** * 是否有分布式光伏接入 */ - private Boolean pv; + private Integer pv; /** * 分布式光伏总装机容量(KVA) diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/po/pv/PvSubstation.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/po/pv/PvSubstation.java index 5b7e7ae28..3cf50e464 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/po/pv/PvSubstation.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/po/pv/PvSubstation.java @@ -37,6 +37,11 @@ public class PvSubstation { */ private String name; + /** + * 变电站编号 + */ + private String subCode; + /** * 电压等级Id,字典表 */ diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/po/pv/PvTenVoltage.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/po/pv/PvTenVoltage.java index fdd7f0b42..3694003e1 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/po/pv/PvTenVoltage.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/po/pv/PvTenVoltage.java @@ -39,6 +39,11 @@ public class PvTenVoltage extends BaseEntity { */ private String name; + /** + * 线路编号 + */ + private String code; + /** * 跨区域类型 */ @@ -119,6 +124,22 @@ public class PvTenVoltage extends BaseEntity { */ private Integer state; + /** + * 是否有分布式光伏接入 + */ + private Integer pvStatus; + + + /** + * 分布式光伏接入容量 + */ + private Integer pvCapacity; + + + /** + * 分布式光伏接入数量 + */ + private Integer pvNum; } diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/DisOrLvVO.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/DisOrLvVO.java new file mode 100644 index 000000000..aa36c82f1 --- /dev/null +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/DisOrLvVO.java @@ -0,0 +1,124 @@ +package com.njcn.device.pojo.vo.pv; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.time.LocalDate; + +/** + * pqs + * + * @author cdf + * @date 2022/7/28 + */ +@Data +public class DisOrLvVO { + /** + * 低压用户台账表Id + */ + private String id; + + + /** + * 低压用户编号(营销系统中查出) + */ + private String userCode; + + /** + * 低压用户名称 + */ + private String name; + + /** + * 用户协议容量(kVA) + */ + private Float userCapacity; + + /** + * 是否发生过投诉 + */ + private Integer complain; + + /** + * 投诉内容 + */ + private String complainPart; + + /** + * 整改措施 + */ + private String corrective; + + /** + * 是否有治理装置 + */ + private Integer devGovern; + + /** + * 治理装置类型 + */ + private String governType; + + /** + * 治理装置电压等级 + */ + private String scale; + + private String scaleName; + + /** + * 治理装置容量 + */ + private Float governCapacity; + + /** + * 状态 + */ + private Integer state; + + + + + + + + + private String code; + + /** + * 终端编号 + */ + private String devCode; + + + /** + * 装机容量(KVA) + */ + private Float machineCapacity; + + /** + * 上网方式 + */ + private String inteType; + + /** + * 接入相别 + */ + private String phase; + + /** + * 储能配置容量(KVA) + */ + private Float energyCapacity; + + + private String smartSwitch; + + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDate installTime; + + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDate runTime; + + +} diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvDeviceVO.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvDeviceVO.java new file mode 100644 index 000000000..b540eb56f --- /dev/null +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvDeviceVO.java @@ -0,0 +1,29 @@ +package com.njcn.device.pojo.vo.pv; + +import com.njcn.device.pojo.po.pv.PvDevice; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * pqs + * + * @author cdf + * @date 2022/7/26 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class PvDeviceVO extends PvDevice { + + private String devTypeName; + + private String typeName; + + private String typeCode; + + private String manufacturerName; + + /** + * 终端级别中文名称 + */ + private String devGradeName; +} diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvDistributedVO.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvDistributedVO.java new file mode 100644 index 000000000..b7efc34d0 --- /dev/null +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvDistributedVO.java @@ -0,0 +1,17 @@ +package com.njcn.device.pojo.vo.pv; + +import com.njcn.device.pojo.po.pv.PvDistributed; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * pqs + * + * @author cdf + * @date 2022/7/26 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class PvDistributedVO extends PvDistributed { + private String scaleName; +} diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvLineAllDetailVO.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvLineAllDetailVO.java index 35ac9b452..ecfbe6ae7 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvLineAllDetailVO.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvLineAllDetailVO.java @@ -29,11 +29,19 @@ public class PvLineAllDetailVO { */ private String devName; + private String devId; + /** * 监测点类型(I类监测点、II类监测点、III类监测点),字典表 */ private String type; + /** + * 监测点类型(I类监测点、II类监测点、III类监测点),字典表 + */ + private String typeName; + + private String substationId; /** * 所属变电站(I类监测点) */ @@ -44,29 +52,37 @@ public class PvLineAllDetailVO { */ private String voltageName; + private String voltageId; + /** * 所属台区ID(II类监测点) */ private String subAreaName; + private String subAreaId; private String userCode; + private String userCodeType; + /** * 分布式光伏名称 */ private String distributeName; + private String distributeId; /** * 低压用户名称 */ private String lvUserName; - + private String lvUserId; /** * 电压等级 */ private String scale; + private String scaleName; + /** * 线路号(在同一台设备中的监测点号) */ @@ -113,9 +129,11 @@ public class PvLineAllDetailVO { private Float dealCapacity; /** - * 接线类型(0:星型接法;1:三角型接法;2:开口三角型接法) + * 接线类型 */ - private Integer ptType; + private String ptType; + + private String ptTypeName; /** * 测量间隔(1-10分钟) @@ -126,6 +144,7 @@ public class PvLineAllDetailVO { * 干扰源类型,字典表 */ private String loadType; + private String loadTypeName; /** * 行业类型,字典表 @@ -152,6 +171,16 @@ public class PvLineAllDetailVO { */ private String objName; + /** + * 监测点对象小类 + */ + private String smallName; + + /** + * 监测点对象大类 + */ + private String bigName; + /** * 人为干预是否参与统计(0:不参与,1:参与)默认参与统计 */ @@ -167,6 +196,8 @@ public class PvLineAllDetailVO { */ private String tfType; + private String tfTypeName; + /** * 所属变压器编号 */ @@ -177,6 +208,8 @@ public class PvLineAllDetailVO { */ private String groundType; + private String groundTypeName; + /** * 投运日期 */ @@ -198,6 +231,13 @@ public class PvLineAllDetailVO { private Integer state; + /** + * 监测点状态 + * @author cdf + * @date 2022/7/27 + */ + private Integer lineStatus; + } diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvLvUserVO.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvLvUserVO.java new file mode 100644 index 000000000..dcade8cec --- /dev/null +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvLvUserVO.java @@ -0,0 +1,17 @@ +package com.njcn.device.pojo.vo.pv; + +import com.njcn.device.pojo.po.pv.PvLvUser; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * pqs + * + * @author cdf + * @date 2022/7/26 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class PvLvUserVO extends PvLvUser { + private String scaleName; +} diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvSubAreaVO.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvSubAreaVO.java new file mode 100644 index 000000000..350860654 --- /dev/null +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvSubAreaVO.java @@ -0,0 +1,26 @@ +package com.njcn.device.pojo.vo.pv; + +import com.njcn.device.pojo.po.pv.PvSubArea; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * pqs + * + * @author cdf + * @date 2022/7/26 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class PvSubAreaVO extends PvSubArea { + + @ApiModelProperty(name = "scaleName",value = "电压等级") + private String scaleName; + + @ApiModelProperty(name = "unitName",value = "单位名称") + private String unitName; + + @ApiModelProperty(name = "tenVoltageName",value = "10kv线路表") + private String tenVoltageName; +} diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvSubstationVO.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvSubstationVO.java index f6cbd2efe..f5c89feb2 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvSubstationVO.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvSubstationVO.java @@ -21,6 +21,7 @@ public class PvSubstationVO { */ private String unitId; + /** * 所属单位名称 */ @@ -31,6 +32,11 @@ public class PvSubstationVO { */ private String name; + /** + * 变电站编号 + */ + private String subCode; + /** * 电压等级Id,字典表 */ diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvTenVoltageVO.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvTenVoltageVO.java new file mode 100644 index 000000000..6ba0a84a6 --- /dev/null +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvTenVoltageVO.java @@ -0,0 +1,27 @@ +package com.njcn.device.pojo.vo.pv; + +import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A; +import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.C; +import com.njcn.device.pojo.po.pv.PvTenVoltage; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * pqs + * + * @author cdf + * @date 2022/7/26 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class PvTenVoltageVO extends PvTenVoltage { + + + private String scaleName; + + @ApiModelProperty(name = "designScaleName",value = "设计电压",required = true) + private String designScaleName; + +} diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvDeviceController.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvDeviceController.java index 9394bc57f..f7d72d625 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvDeviceController.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvDeviceController.java @@ -11,6 +11,7 @@ import com.njcn.common.utils.HttpResultUtil; import com.njcn.device.pojo.param.pv.DeviceQueryParam; import com.njcn.device.pojo.param.pv.PvDeviceParam; import com.njcn.device.pojo.po.pv.PvDevice; +import com.njcn.device.pojo.vo.pv.PvDeviceVO; import com.njcn.pvdevice.service.IPvDeviceService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -91,9 +92,9 @@ public class PvDeviceController extends BaseController { @OperateInfo(info = LogEnum.SYSTEM_COMMON) @ApiOperation("分页查询终端") @ApiImplicitParam(name = "deviceQueryParam",value = "终端实体",required = true) - public HttpResult> getPvDeviceList(@RequestBody DeviceQueryParam deviceQueryParam){ + public HttpResult> getPvDeviceList(@RequestBody DeviceQueryParam deviceQueryParam){ String methodDescribe = getMethodDescribe("getPvDeviceList"); - Page page = iPvDeviceService.getPvDeviceList(deviceQueryParam); + Page page = iPvDeviceService.getPvDeviceList(deviceQueryParam); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe); } @@ -106,9 +107,9 @@ public class PvDeviceController extends BaseController { @PostMapping("getAllPvDeviceList") @OperateInfo(info = LogEnum.SYSTEM_COMMON) @ApiOperation("查询所有终端") - public HttpResult> getAllPvDeviceList(){ + public HttpResult> getAllPvDeviceList(){ String methodDescribe = getMethodDescribe("getAllPvDeviceList"); - List list = iPvDeviceService.getAllPvDeviceList(); + List list = iPvDeviceService.getAllPvDeviceList(); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe); } @@ -137,18 +138,18 @@ public class PvDeviceController extends BaseController { /** * 删除终端 - * @param id 终端id + * @param ids 终端id * @author cdf * @date 2022/7/5 * @return boolean */ - @DeleteMapping("delPvDevice") - @OperateInfo(info = LogEnum.SYSTEM_COMMON) + @PostMapping("delPvDevice") + @OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.DELETE) @ApiOperation("删除终端") - @ApiImplicitParam(name = "id",value = "终端id",required = true) - public HttpResult delPvDevice(@RequestParam("id") String id){ + @ApiImplicitParam(name = "ids",value = "终端id",required = true) + public HttpResult delPvDevice(@RequestBody List ids){ String methodDescribe = getMethodDescribe("delPvDevice"); - boolean res = iPvDeviceService.delPvDevice(id); + boolean res = iPvDeviceService.delPvDevice(ids); if(res){ return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvDistributedController.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvDistributedController.java index 6bc0a2e74..f93fbbefa 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvDistributedController.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvDistributedController.java @@ -11,6 +11,7 @@ import com.njcn.common.utils.HttpResultUtil; import com.njcn.device.pojo.param.pv.PvDistributedParam; import com.njcn.device.pojo.param.pv.DistributedQueryParam; import com.njcn.device.pojo.po.pv.PvDistributed; +import com.njcn.device.pojo.vo.pv.PvDistributedVO; import com.njcn.pvdevice.service.IPvDistributedService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -91,9 +92,9 @@ public class PvDistributedController extends BaseController { @OperateInfo(info = LogEnum.SYSTEM_COMMON) @ApiOperation("分页查询分布式光伏台账") @ApiImplicitParam(name = "distributedQueryParam",value = "分布式光伏台账实体",required = true) - public HttpResult> getPvDistributedList(@RequestBody DistributedQueryParam distributedQueryParam){ + public HttpResult> getPvDistributedList(@RequestBody DistributedQueryParam distributedQueryParam){ String methodDescribe = getMethodDescribe("getPvDistributedList"); - Page page = iPvDistributedService.getPvDistributedList(distributedQueryParam); + Page page = iPvDistributedService.getPvDistributedList(distributedQueryParam); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe); } @@ -137,18 +138,18 @@ public class PvDistributedController extends BaseController { /** * 删除分布式光伏台账 - * @param id 分布式光伏台账id + * @param ids 分布式光伏台账id * @author cdf * @date 2022/7/5 * @return boolean */ - @DeleteMapping("delPvDistributed") + @PostMapping("delPvDistributed") @OperateInfo(info = LogEnum.SYSTEM_COMMON) @ApiOperation("删除分布式光伏台账") - @ApiImplicitParam(name = "id",value = "分布式光伏台账id",required = true) - public HttpResult delPvDistributed(@RequestParam("id") String id){ + @ApiImplicitParam(name = "ids",value = "分布式光伏台账ids",required = true) + public HttpResult delPvDistributed(@RequestBody List ids){ String methodDescribe = getMethodDescribe("delPvDistributed"); - boolean res = iPvDistributedService.delPvDistributed(id); + boolean res = iPvDistributedService.delPvDistributed(ids); if(res){ return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvLineDetailController.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvLineDetailController.java index dc55bcbc8..1fc69e349 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvLineDetailController.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvLineDetailController.java @@ -138,18 +138,18 @@ public class PvLineDetailController extends BaseController { /** * 删除监测点 - * @param id 监测点id + * @param ids 监测点id * @author cdf * @date 2022/7/5 * @return boolean */ - @DeleteMapping("delPvLineDetail") + @PostMapping("delPvLineDetail") @OperateInfo(info = LogEnum.SYSTEM_COMMON) @ApiOperation("删除监测点") - @ApiImplicitParam(name = "id",value = "监测点id",required = true) - public HttpResult delPvLineDetail(@RequestParam("id") String id){ + @ApiImplicitParam(name = "ids",value = "监测点id",required = true) + public HttpResult delPvLineDetail(@RequestBody List ids){ String methodDescribe = getMethodDescribe("delPvLineDetail"); - boolean res = iPvLineDetailService.delPvLineDetail(id); + boolean res = iPvLineDetailService.delPvLineDetail(ids); if(res){ return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvLvUserController.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvLvUserController.java index 30fcdcb50..6635183c1 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvLvUserController.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvLvUserController.java @@ -11,6 +11,7 @@ import com.njcn.common.utils.HttpResultUtil; import com.njcn.device.pojo.param.pv.LvUserQueryParam; import com.njcn.device.pojo.param.pv.PvLvUserParam; import com.njcn.device.pojo.po.pv.PvLvUser; +import com.njcn.device.pojo.vo.pv.PvLvUserVO; import com.njcn.pvdevice.service.IPvLvUserService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -91,9 +92,9 @@ public class PvLvUserController extends BaseController { @OperateInfo(info = LogEnum.SYSTEM_COMMON) @ApiOperation("分页查询低压用户台账") @ApiImplicitParam(name = "lvUserQueryParam",value = "低压用户台账实体",required = true) - public HttpResult> getPvLvUserList(@RequestBody LvUserQueryParam lvUserQueryParam){ + public HttpResult> getPvLvUserList(@RequestBody LvUserQueryParam lvUserQueryParam){ String methodDescribe = getMethodDescribe("getPvLvUserList"); - Page page = iPvLvUserService.getPvLvUserList(lvUserQueryParam); + Page page = iPvLvUserService.getPvLvUserList(lvUserQueryParam); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe); } @@ -137,18 +138,18 @@ public class PvLvUserController extends BaseController { /** * 删除低压用户台账 - * @param id 低压用户台账id + * @param ids 低压用户台账id * @author cdf * @date 2022/7/5 * @return boolean */ - @DeleteMapping("delPvLvUser") - @OperateInfo(info = LogEnum.SYSTEM_COMMON) + @PostMapping("delPvLvUser") + @OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.DELETE) @ApiOperation("删除低压用户台账") - @ApiImplicitParam(name = "id",value = "低压用户台账id",required = true) - public HttpResult delPvLvUser(@RequestParam("id") String id){ + @ApiImplicitParam(name = "ids",value = "低压用户台账id",required = true) + public HttpResult delPvLvUser(@RequestBody List ids){ String methodDescribe = getMethodDescribe("delPvLvUser"); - boolean res = iPvLvUserService.delPvLvUser(id); + boolean res = iPvLvUserService.delPvLvUser(ids); if(res){ return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvSubAreaController.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvSubAreaController.java index d84da962a..0c75afde0 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvSubAreaController.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvSubAreaController.java @@ -11,6 +11,7 @@ import com.njcn.common.utils.HttpResultUtil; import com.njcn.device.pojo.param.pv.PvSubAreaParam; import com.njcn.device.pojo.param.pv.SubAreaQueryParam; import com.njcn.device.pojo.po.pv.PvSubArea; +import com.njcn.device.pojo.vo.pv.PvSubAreaVO; import com.njcn.pvdevice.service.IPvSubAreaService; import com.sun.el.parser.BooleanNode; import io.swagger.annotations.Api; @@ -93,9 +94,9 @@ public class PvSubAreaController extends BaseController { @OperateInfo(info = LogEnum.SYSTEM_COMMON) @ApiOperation("分页查询台区") @ApiImplicitParam(name = "subAreaQueryParam",value = "台区实体",required = true) - public HttpResult> getPvSubAreaList(@RequestBody SubAreaQueryParam subAreaQueryParam){ + public HttpResult> getPvSubAreaList(@RequestBody SubAreaQueryParam subAreaQueryParam){ String methodDescribe = getMethodDescribe("getPvSubAreaList"); - Page page = iPvSubAreaService.getPvSubAreaList(subAreaQueryParam); + Page page = iPvSubAreaService.getPvSubAreaList(subAreaQueryParam); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe); } @@ -139,18 +140,18 @@ public class PvSubAreaController extends BaseController { /** * 删除台区 - * @param id 台区id + * @param ids 台区ids * @author cdf * @date 2022/7/5 * @return boolean */ - @DeleteMapping("delPvSubArea") + @PostMapping("delPvSubArea") @OperateInfo(info = LogEnum.SYSTEM_COMMON) @ApiOperation("删除台区") - @ApiImplicitParam(name = "id",value = "台区id",required = true) - public HttpResult delPvSubArea(@RequestParam("id") String id){ + @ApiImplicitParam(name = "ids",value = "台区ids",required = true) + public HttpResult delPvSubArea(@RequestBody List ids){ String methodDescribe = getMethodDescribe("delPvSubArea"); - boolean res = iPvSubAreaService.delPvSubArea(id); + boolean res = iPvSubAreaService.delPvSubArea(ids); if(res){ return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvSubstationController.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvSubstationController.java index 4eab88f0e..17ed37c86 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvSubstationController.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvSubstationController.java @@ -132,18 +132,18 @@ public class PvSubstationController extends BaseController { /** * 删除变电站 - * @param id 变电站id + * @param ids 变电站ids * @author cdf * @date 2022/7/5 * @return boolean */ - @DeleteMapping("delPvSubstation") - @OperateInfo(info = LogEnum.SYSTEM_COMMON) + @PostMapping("delPvSubstation") + @OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.DELETE) @ApiOperation("删除变电站") - @ApiImplicitParam(name = "id",value = "变电站id",required = true) - public HttpResult delPvSubstation(@RequestParam("id") String id){ + @ApiImplicitParam(name = "ids",value = "变电站ids",required = true) + public HttpResult delPvSubstation(@RequestBody List ids){ String methodDescribe = getMethodDescribe("delPvSubstation"); - iPvSubstationService.delPvSubstation(id); + iPvSubstationService.delPvSubstation(ids); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvTenVoltageController.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvTenVoltageController.java index eec46eece..58494c29f 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvTenVoltageController.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvTenVoltageController.java @@ -11,6 +11,7 @@ import com.njcn.common.utils.HttpResultUtil; import com.njcn.device.pojo.param.pv.PvTenVoltageParam; import com.njcn.device.pojo.param.pv.TenVoltageQueryParam; import com.njcn.device.pojo.po.pv.PvTenVoltage; +import com.njcn.device.pojo.vo.pv.PvTenVoltageVO; import com.njcn.pvdevice.service.IPvTenVoltageService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -21,6 +22,8 @@ import org.springframework.web.bind.annotation.*; import com.njcn.web.controller.BaseController; +import java.util.List; + /** *

* 前端控制器 @@ -90,11 +93,25 @@ public class PvTenVoltageController extends BaseController { @OperateInfo(info = LogEnum.SYSTEM_COMMON) @ApiOperation("分页查询10kV线路") @ApiImplicitParam(name = "tenVoltageQueryParam", value = "10kV线路实体", required = true) - public HttpResult> getPvTenVoltageList(@RequestBody @Validated TenVoltageQueryParam tenVoltageQueryParam) { + public HttpResult> getPvTenVoltageList(@RequestBody @Validated TenVoltageQueryParam tenVoltageQueryParam) { String methodDescribe = getMethodDescribe("getPvTenVoltageList"); - Page page = iPvTenVoltageService.getPvTenVoltageList(tenVoltageQueryParam); + Page page = iPvTenVoltageService.getPvTenVoltageList(tenVoltageQueryParam); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe); + } + /** + * 查询所有10kV线路 + * @author cdf + * @date 2022/7/5 + * @return List + */ + @GetMapping("getAllPvTenVoltageList") + @OperateInfo(info = LogEnum.SYSTEM_COMMON) + @ApiOperation("查询所有10kV线路") + public HttpResult> getAllPvTenVoltageList(){ + String methodDescribe = getMethodDescribe("getAllPvTenVoltageList"); + List res = iPvTenVoltageService.getAllPvTenVoltageList(); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe); } @@ -120,18 +137,18 @@ public class PvTenVoltageController extends BaseController { /** * 删除10kV线路 * - * @param id 10kV线路id + * @param ids 10kV线路id * @return boolean * @author cdf * @date 2022/7/5 */ - @DeleteMapping("delPvTenVoltage") + @PostMapping("delPvTenVoltage") @OperateInfo(info = LogEnum.SYSTEM_COMMON) @ApiOperation("删除10kV线路") - @ApiImplicitParam(name = "id", value = "10kV线路id", required = true) - public HttpResult delPvTenVoltage(@RequestParam("id") String id) { + @ApiImplicitParam(name = "ids", value = "10kV线路id", required = true) + public HttpResult delPvTenVoltage(@RequestBody List ids) { String methodDescribe = getMethodDescribe("delPvTenVoltage"); - boolean flag = iPvTenVoltageService.delPvTenVoltage(id); + boolean flag = iPvTenVoltageService.delPvTenVoltage(ids); if (flag) { return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvTerminalBaseController.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvTerminalBaseController.java index 7fbdf0292..ff084b01a 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvTerminalBaseController.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvTerminalBaseController.java @@ -7,12 +7,14 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum; import com.njcn.common.pojo.response.HttpResult; import com.njcn.common.utils.HttpResultUtil; import com.njcn.device.pojo.param.pv.PvTerminalBaseQuery; +import com.njcn.device.pojo.vo.pv.DisOrLvVO; import com.njcn.device.pojo.vo.pv.PvLineAllDetailVO; import com.njcn.pvdevice.service.PvTerminalBaseService; import com.njcn.user.pojo.vo.PvTerminalTreeVO; import com.njcn.web.controller.BaseController; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springframework.validation.annotation.Validated; @@ -68,5 +70,23 @@ public class PvTerminalBaseController extends BaseController { return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, all, methodDescribe); } + /** + * 根据userCode 和 userCodeType + * @author cdf + * @date 2022/7/28 + */ + @GetMapping("pvDisOrLv") + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @ApiOperation("根据用户编号获取低压分布式详情") + @ApiImplicitParams({ + @ApiImplicitParam(name = "userCode", value = "用户编号"), + @ApiImplicitParam(name = "userCodeType", value = "用户编号类型 0.光伏 1.低压"), + }) + public HttpResult pvDisOrLv(@RequestParam("userCode")String userCode,@RequestParam("userCodeType")Integer userCodeType) { + String methodDescribe = getMethodDescribe("pvDisOrLv"); + DisOrLvVO all = pvTerminalBaseService.pvDisOrLv(userCode,userCodeType); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, all, methodDescribe); + } + } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvDeviceMapper.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvDeviceMapper.java index e0db5690f..f8d7844af 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvDeviceMapper.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvDeviceMapper.java @@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.njcn.device.pojo.param.pv.DeviceQueryParam; import com.njcn.device.pojo.po.pv.PvDevice; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.njcn.device.pojo.vo.pv.PvDeviceVO; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** *

* Mapper 接口 @@ -24,7 +27,10 @@ public interface PvDeviceMapper extends BaseMapper { * @author cdf * @date 2022/7/8 */ - Page getPvDeviceList(Page page,@Param("deviceQueryParam") DeviceQueryParam deviceQueryParam); + Page getPvDeviceList(Page page, @Param("deviceQueryParam") DeviceQueryParam deviceQueryParam); + + + List getAllPvDeviceList(); } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvDistributedMapper.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvDistributedMapper.java index 4bed6e715..b8ddf1c32 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvDistributedMapper.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvDistributedMapper.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.njcn.device.pojo.param.pv.DistributedQueryParam; import com.njcn.device.pojo.po.pv.PvDistributed; +import com.njcn.device.pojo.vo.pv.PvDistributedVO; import org.apache.ibatis.annotations.Param; /** @@ -22,6 +23,6 @@ public interface PvDistributedMapper extends BaseMapper { * @author cdf * @date 2022/7/7 */ - Page getPvDistributedList(Page page,@Param("distributedQueryParam") DistributedQueryParam distributedQueryParam); + Page getPvDistributedList(Page page, @Param("distributedQueryParam") DistributedQueryParam distributedQueryParam); } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvLineDetailMapper.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvLineDetailMapper.java index 5125986b2..d0ec8ae26 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvLineDetailMapper.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvLineDetailMapper.java @@ -27,7 +27,7 @@ public interface PvLineDetailMapper extends BaseMapper { * @date 2022/7/5 * @return Page */ - Page getPvLineAllDetailMain(Page page,@Param("subIds") List subIds, @Param("subAreaIds")List subAreaIds); + Page getPvLineAllDetailMain(Page page,@Param("subIds") List subIds, @Param("subAreaIds")List subAreaIds,@Param("type")String type,@Param("lineStatus")Integer lineStatus); } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvLvUserMapper.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvLvUserMapper.java index 74dc5c90a..9931e0134 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvLvUserMapper.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvLvUserMapper.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.njcn.device.pojo.param.pv.LvUserQueryParam; import com.njcn.device.pojo.po.pv.PvLvUser; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.njcn.device.pojo.vo.pv.PvLvUserVO; import org.apache.ibatis.annotations.Param; /** @@ -21,6 +22,6 @@ public interface PvLvUserMapper extends BaseMapper { * @author cdf * @date 2022/7/8 */ - Page getPvLvUserList(Page page,@Param("lvUserQueryParam") LvUserQueryParam lvUserQueryParam); + Page getPvLvUserList(Page page, @Param("lvUserQueryParam") LvUserQueryParam lvUserQueryParam); } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvSubAreaMapper.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvSubAreaMapper.java index 3a2d50f00..c0e1eb814 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvSubAreaMapper.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvSubAreaMapper.java @@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.njcn.device.pojo.param.pv.SubAreaQueryParam; import com.njcn.device.pojo.po.pv.PvSubArea; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.njcn.device.pojo.vo.pv.DisOrLvVO; +import com.njcn.device.pojo.vo.pv.PvSubAreaVO; import com.njcn.user.pojo.vo.PvTerminalTreeVO; import org.apache.ibatis.annotations.Param; @@ -25,7 +27,7 @@ public interface PvSubAreaMapper extends BaseMapper { * @author cdf * @date 2022/7/7 */ - Page getPvSubAreaList(Page page,@Param("subsAreaQueryParam") SubAreaQueryParam subsAreaQueryParam); + Page getPvSubAreaList(Page page, @Param("subsAreaQueryParam") SubAreaQueryParam subsAreaQueryParam); /** * 查询所有台区 @@ -33,4 +35,7 @@ public interface PvSubAreaMapper extends BaseMapper { * @date 2022/7/11 */ List getSubAreaTreeList(); + + + DisOrLvVO pvDisOrLv(String userCode, String userCodeType); } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvTenVoltageMapper.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvTenVoltageMapper.java index f731c3b95..decdb5703 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvTenVoltageMapper.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvTenVoltageMapper.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.njcn.device.pojo.param.pv.TenVoltageQueryParam; import com.njcn.device.pojo.po.pv.PvTenVoltage; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.njcn.device.pojo.vo.pv.PvTenVoltageVO; import org.apache.ibatis.annotations.Param; /** @@ -21,6 +22,6 @@ public interface PvTenVoltageMapper extends BaseMapper { * @author cdf * @date 2022/7/7 */ - Page getPvTenVoltageList(Page page,@Param("tenVoltageQueryParam") TenVoltageQueryParam tenVoltageQueryParam); + Page getPvTenVoltageList(Page page, @Param("tenVoltageQueryParam") TenVoltageQueryParam tenVoltageQueryParam); } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvDeviceMapper.xml b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvDeviceMapper.xml index 0deb78937..6c80d592c 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvDeviceMapper.xml +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvDeviceMapper.xml @@ -2,15 +2,76 @@ - SELECT dev.id, - dic.NAME manufacturer, - dic2.NAME devType, + dev.manufacturer, + dic.NAME manufacturerName, + dic2.NAME devTypeName, + dev.dev_Type, dev.type, + dic3.name typeName, dev.Dev_Code, + dev.name, dev.ip, dev.port, + dev.load_time, + dev.dev_status, + dev.communicate_Type, + dev.Series, + dev.Dev_Key, + dev.This_Time_Check, + dev.Next_Time_Check, + dic4.name devGradeName, + dev.dev_grade + FROM + pv_device dev + LEFT JOIN sys_dict_data dic ON dev.manufacturer = dic.id + LEFT JOIN sys_dict_data dic2 ON dev.Dev_Type = dic2.id + LEFT JOIN sys_dict_data dic3 ON dev.type = dic3.id + LEFT JOIN sys_dict_data dic4 ON dev.dev_grade = dic4.id + + + and dev.dev_code like CONCAT('%',#{deviceQueryParam.searchValue},'%') + or dev.name like CONCAT('%',#{deviceQueryParam.searchValue},'%') + + + + and dev.manufacturer in + + #{item} + + + + + and dev.type in + + #{item} + + + and dev.state = 1 + + order by dev.create_time asc + + + + diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvDistributedMapper.xml b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvDistributedMapper.xml index 10336029e..8c19502ce 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvDistributedMapper.xml +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvDistributedMapper.xml @@ -2,17 +2,22 @@ - SELECT dis.id, - dic.NAME scale, + dic.NAME scaleName, + dis.scale, dis.NAME, dis.User_Code, dis.Dev_Code, dis.Machine_Capacity, dis.Inte_Type, dis.Phase, - dis.Energy_Capacity + dis.Energy_Capacity, + dis.code, + dis.Smart_Switch, + dis.install_time, + dis.run_time FROM pv_distributed dis LEFT JOIN sys_dict_data dic ON dis.scale = dic.id diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvLineDetailMapper.xml b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvLineDetailMapper.xml index e9fbd397c..5b53d4c4f 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvLineDetailMapper.xml +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvLineDetailMapper.xml @@ -9,12 +9,21 @@ line.id, line.NAME, line.CODE, + line.user_Code, + line.user_Code_type, + line.dev_id, dev.Dev_Code devName, - dic.NAME type, - dic1.NAME scale, + dev.dev_status lineStatus, + dic.NAME typeName, + line.type, + dic1.NAME scaleName, + line.scale, + line.Substation_Id, sub.NAME substationName, v.NAME voltageName, + line.voltage_id, subArea.NAME subAreaName, + line.sub_area_id, dis.NAME distributeName, lv.NAME lvUserName, line.num, @@ -27,6 +36,7 @@ line.standard_capacity, line.deal_capacity, line.pt_Type, + dic6.name ptTypeName, line.time_Interval, dic2.NAME loadType, dic3.NAME businessType, @@ -34,11 +44,15 @@ line.Power_Flag, line.Monitor_Id, line.Obj_Name, + line.small_name, + line.big_name, line.Stat_flag, line.Remark, line.Tf_Type, + dic4.name tfTypeName, line.Tf_Code, line.Ground_Type, + dic5.name groundTypeName, line.Put_In, line.Access, line.Power_Supply @@ -54,6 +68,9 @@ LEFT JOIN Pv_Lv_User lv ON line.user_code = lv.user_code LEFT JOIN sys_dict_data dic2 ON line.load_type = dic2.id LEFT JOIN sys_dict_data dic3 ON line.Business_Type = dic3.id + LEFT JOIN sys_dict_data dic4 ON line.Tf_Type = dic4.id + LEFT JOIN sys_dict_data dic5 ON line.Ground_Type = dic5.id + LEFT JOIN sys_dict_data dic6 ON line.pt_type = dic6.id where line.state = 1 and line.Substation_Id in @@ -61,6 +78,12 @@ #{item} + + and line.type = #{type} + + + and dev.dev_status = #{lineStatus} + @@ -72,13 +95,22 @@ SELECT line.id, line.NAME, + line.user_Code, + line.user_Code_type, line.CODE, + line.dev_id, dev.Dev_Code devName, - dic.NAME type, - dic1.NAME scale, + dev.dev_status lineStatus, + dic.NAME typeName, + line.type, + dic1.NAME scaleName, + line.scale, + line.Substation_Id, sub.NAME substationName, v.NAME voltageName, + line.voltage_id, subArea.NAME subAreaName, + line.sub_area_id, dis.NAME distributeName, lv.NAME lvUserName, line.num, @@ -91,6 +123,7 @@ line.standard_capacity, line.deal_capacity, line.pt_Type, + dic6.name ptTypeName, line.time_Interval, dic2.NAME loadType, dic3.NAME businessType, @@ -98,11 +131,15 @@ line.Power_Flag, line.Monitor_Id, line.Obj_Name, + line.small_name, + line.big_name, line.Stat_flag, line.Remark, line.Tf_Type, + dic4.name tfTypeName, line.Tf_Code, line.Ground_Type, + dic5.name groundTypeName, line.Put_In, line.Access, line.Power_Supply @@ -118,6 +155,9 @@ LEFT JOIN Pv_Lv_User lv ON line.user_code = lv.user_code LEFT JOIN sys_dict_data dic2 ON line.load_type = dic2.id LEFT JOIN sys_dict_data dic3 ON line.Business_Type = dic3.id + LEFT JOIN sys_dict_data dic4 ON line.Tf_Type = dic4.id + LEFT JOIN sys_dict_data dic5 ON line.Ground_Type = dic5.id + LEFT JOIN sys_dict_data dic6 ON line.pt_type = dic6.id where line.state = 1 and line.Sub_Area_Id in @@ -125,6 +165,12 @@ #{item} + + and line.type = #{type} + + + and dev.dev_status = #{lineStatus} + diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvLvUserMapper.xml b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvLvUserMapper.xml index 682e26b6a..ad794c4af 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvLvUserMapper.xml +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvLvUserMapper.xml @@ -2,10 +2,11 @@ - SELECT lv.id, - dic.NAME scale, + dic.NAME scaleName, + lv.scale, lv.NAME, lv.User_Code, lv.User_Capacity, diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvSubAreaMapper.xml b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvSubAreaMapper.xml index 3016c5863..280f6517d 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvSubAreaMapper.xml +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvSubAreaMapper.xml @@ -2,11 +2,13 @@ - SELECT sub.id, - unit.name unitId, - ten.NAME tenVoltageId, + sub.unit_id, + dept.name unitName, + sub.ten_Voltage_Id, + ten.NAME tenVoltageName, sub.NAME, sub.Code, sub.Cable_Length, @@ -23,7 +25,7 @@ sub.Power_Power FROM pv_sub_area sub - INNER JOIN pv_unit unit ON sub.unit_id = unit.id + INNER JOIN sys_dept dept ON sub.unit_id = dept.id INNER JOIN pv_ten_voltage ten ON ten.id = sub.Ten_Voltage_Id @@ -51,4 +53,9 @@ + + + diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvSubstationMapper.xml b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvSubstationMapper.xml index ccc27ee57..8d29a37a6 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvSubstationMapper.xml +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvSubstationMapper.xml @@ -5,14 +5,16 @@ + diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvDeviceService.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvDeviceService.java index 63c587633..e80782307 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvDeviceService.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvDeviceService.java @@ -6,6 +6,7 @@ import com.njcn.device.pojo.param.pv.PvDeviceParam; import com.njcn.device.pojo.po.pv.PvDevice; import com.baomidou.mybatisplus.extension.service.IService; import com.njcn.device.pojo.po.pv.PvDevice; +import com.njcn.device.pojo.vo.pv.PvDeviceVO; import java.util.List; @@ -41,14 +42,14 @@ public interface IPvDeviceService extends IService { /** * 分页查询分布式台账 - * @param DeviceQueryParam 分布式台账实体 + * @param deviceQueryParam 分布式台账实体 * @author cdf * @date 2022/7/5 * @return Page */ - Page getPvDeviceList(DeviceQueryParam deviceQueryParam); + Page getPvDeviceList(DeviceQueryParam deviceQueryParam); - List getAllPvDeviceList(); + List getAllPvDeviceList(); /** @@ -62,11 +63,11 @@ public interface IPvDeviceService extends IService { /** * 删除分布式台账 - * @param id 分布式台账id + * @param ids 分布式台账id * @author cdf * @date 2022/7/5 * @return boolean */ - boolean delPvDevice(String id); + boolean delPvDevice(List ids); } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvDistributedService.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvDistributedService.java index ec9f3339f..89a8457b9 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvDistributedService.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvDistributedService.java @@ -7,6 +7,7 @@ import com.njcn.device.pojo.param.pv.PvDistributedParam; import com.njcn.device.pojo.param.pv.DistributedQueryParam; import com.njcn.device.pojo.po.pv.PvDistributed; import com.njcn.device.pojo.po.pv.PvDistributed; +import com.njcn.device.pojo.vo.pv.PvDistributedVO; import java.util.List; @@ -47,7 +48,7 @@ public interface IPvDistributedService extends IService { * @date 2022/7/5 * @return Page */ - Page getPvDistributedList(DistributedQueryParam distributedQueryParam); + Page getPvDistributedList(DistributedQueryParam distributedQueryParam); List getAllPvDistributedList(); @@ -63,12 +64,12 @@ public interface IPvDistributedService extends IService { /** * 删除分布式台账 - * @param id 分布式台账id + * @param ids 分布式台账id * @author cdf * @date 2022/7/5 * @return boolean */ - boolean delPvDistributed(String id); + boolean delPvDistributed(List ids); } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvLineDetailService.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvLineDetailService.java index 042f0d0e4..305c000cd 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvLineDetailService.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvLineDetailService.java @@ -63,12 +63,12 @@ public interface IPvLineDetailService extends IService { /** * 删除监测点 - * @param id 监测点id + * @param ids 监测点id * @author cdf * @date 2022/7/5 * @return boolean */ - boolean delPvLineDetail(String id); + boolean delPvLineDetail(List ids); /** @@ -79,7 +79,7 @@ public interface IPvLineDetailService extends IService { * @date 2022/7/5 * @return Page */ - Page getPvLineAllDetailMain(Integer pageNum,Integer pageSize,List subIds, List subAreaIds); + Page getPvLineAllDetailMain(Integer pageNum,Integer pageSize,List subIds, List subAreaIds,String type,Integer lineStatus); diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvLvUserService.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvLvUserService.java index b56bda57b..6a6844ad3 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvLvUserService.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvLvUserService.java @@ -6,6 +6,7 @@ import com.njcn.device.pojo.param.pv.PvLvUserParam; import com.njcn.device.pojo.po.pv.PvLvUser; import com.njcn.device.pojo.po.pv.PvLvUser; import com.baomidou.mybatisplus.extension.service.IService; +import com.njcn.device.pojo.vo.pv.PvLvUserVO; import java.util.List; @@ -46,7 +47,7 @@ public interface IPvLvUserService extends IService { * @date 2022/7/5 * @return Page */ - Page getPvLvUserList(LvUserQueryParam lvUserQueryParam); + Page getPvLvUserList(LvUserQueryParam lvUserQueryParam); List getAllPvLvUserList(); @@ -62,10 +63,10 @@ public interface IPvLvUserService extends IService { /** * 删除分低压用户台账 - * @param id 分低压用户台账id + * @param ids 分低压用户台账id * @author cdf * @date 2022/7/5 * @return boolean */ - boolean delPvLvUser(String id); + boolean delPvLvUser(List ids); } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvSubAreaService.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvSubAreaService.java index 1a9375489..1a5eb8c08 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvSubAreaService.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvSubAreaService.java @@ -6,6 +6,7 @@ import com.njcn.device.pojo.param.pv.SubAreaQueryParam; import com.njcn.device.pojo.po.pv.PvSubArea; import com.baomidou.mybatisplus.extension.service.IService; import com.njcn.device.pojo.po.pv.PvSubArea; +import com.njcn.device.pojo.vo.pv.PvSubAreaVO; import java.util.List; @@ -45,7 +46,7 @@ public interface IPvSubAreaService extends IService { * @date 2022/7/5 * @return Page */ - Page getPvSubAreaList(SubAreaQueryParam subAreaQueryParam); + Page getPvSubAreaList(SubAreaQueryParam subAreaQueryParam); List getAllPvSubAreaList(); @@ -61,11 +62,11 @@ public interface IPvSubAreaService extends IService { /** * 删除台区 - * @param id 台区id + * @param ids 台区id * @author cdf * @date 2022/7/5 * @return boolean */ - boolean delPvSubArea(String id); + boolean delPvSubArea(List ids); } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvSubstationService.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvSubstationService.java index 030147a45..329fa84e4 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvSubstationService.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvSubstationService.java @@ -63,11 +63,11 @@ public interface IPvSubstationService extends IService { /** * 删除变电站 - * @param id 变电站id + * @param ids 变电站id * @author cdf * @date 2022/7/5 * @return boolean */ - boolean delPvSubstation(String id); + boolean delPvSubstation(List ids); } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvTenVoltageService.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvTenVoltageService.java index f913508a7..5866e7ab9 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvTenVoltageService.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvTenVoltageService.java @@ -6,6 +6,9 @@ import com.njcn.device.pojo.param.pv.TenVoltageQueryParam; import com.njcn.device.pojo.po.pv.PvTenVoltage; import com.baomidou.mybatisplus.extension.service.IService; import com.njcn.device.pojo.po.pv.PvTenVoltage; +import com.njcn.device.pojo.vo.pv.PvTenVoltageVO; + +import java.util.List; /** *

@@ -19,8 +22,8 @@ public interface IPvTenVoltageService extends IService { /** - * 新增单位 - * @param pvTenVoltageParam 单位实体 + * 新增10kV线路 + * @param pvTenVoltageParam 10kV线路实体 * @author cdf * @date 2022/7/5 * @return boolean @@ -28,8 +31,8 @@ public interface IPvTenVoltageService extends IService { boolean addTenVoltage(PvTenVoltageParam pvTenVoltageParam); /** - * 修改单位 - * @param updatePvTenVoltageParam 单位实体 + * 修改10kV线路 + * @param updatePvTenVoltageParam 10kV线路实体 * @author cdf * @date 2022/7/5 * @return boolean @@ -38,18 +41,26 @@ public interface IPvTenVoltageService extends IService { /** - * 分页查询单位 - * @param tenVoltageQueryParam 单位实体 + * 分页查询10kV线路 + * @param tenVoltageQueryParam 10kV线路实体 * @author cdf * @date 2022/7/5 * @return Page */ - Page getPvTenVoltageList(TenVoltageQueryParam tenVoltageQueryParam); + Page getPvTenVoltageList(TenVoltageQueryParam tenVoltageQueryParam); + + /** + * 分页查询10kV线路 + * @author cdf + * @date 2022/7/5 + * @return List + */ + List getAllPvTenVoltageList(); /** - * 根据单位id查询单位 - * @param id 单位id + * 根据10kV线路id查询10kV线路 + * @param id 10kV线路id * @author cdf * @date 2022/7/5 * @return PvTenVoltage @@ -57,12 +68,12 @@ public interface IPvTenVoltageService extends IService { PvTenVoltage getPvTenVoltageById(String id); /** - * 删除单位 - * @param id 单位id + * 删除10kV线路 + * @param ids 10kV线路id * @author cdf * @date 2022/7/5 * @return boolean */ - boolean delPvTenVoltage(String id); + boolean delPvTenVoltage(List ids); } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/PvTerminalBaseService.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/PvTerminalBaseService.java index 90fb1d3d0..f59ecbaa0 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/PvTerminalBaseService.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/PvTerminalBaseService.java @@ -2,6 +2,7 @@ package com.njcn.pvdevice.service; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.njcn.device.pojo.param.pv.PvTerminalBaseQuery; +import com.njcn.device.pojo.vo.pv.DisOrLvVO; import com.njcn.device.pojo.vo.pv.PvLineAllDetailVO; import com.njcn.user.pojo.vo.PvTerminalTreeVO; @@ -29,4 +30,12 @@ public interface PvTerminalBaseService { * @date 2022/7/11 */ Page lineDetailBySubId(PvTerminalBaseQuery pvTerminalBaseQuery); + + /** + * + * @author cdf + * @date 2022/7/28 + */ + DisOrLvVO pvDisOrLv(String userCode,Integer userCodeType); + } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvDeviceServiceImpl.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvDeviceServiceImpl.java index 6c2e4cb0e..eb75cb99e 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvDeviceServiceImpl.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvDeviceServiceImpl.java @@ -11,6 +11,7 @@ import com.njcn.device.pojo.param.pv.DeviceQueryParam; import com.njcn.device.pojo.param.pv.PvDeviceParam; import com.njcn.device.pojo.po.pv.PvDevice; import com.njcn.device.pojo.po.pv.PvDevice; +import com.njcn.device.pojo.vo.pv.PvDeviceVO; import com.njcn.pvdevice.mapper.PvDeviceMapper; import com.njcn.pvdevice.service.IPvDeviceService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -62,14 +63,14 @@ public class PvDeviceServiceImpl extends ServiceImpl i } @Override - public Page getPvDeviceList(DeviceQueryParam subsAreaQueryParam) { - Page page = new Page<>(PageFactory.getPageNum(subsAreaQueryParam), PageFactory.getPageSize(subsAreaQueryParam)); + public Page getPvDeviceList(DeviceQueryParam subsAreaQueryParam) { + Page page = new Page<>(PageFactory.getPageNum(subsAreaQueryParam), PageFactory.getPageSize(subsAreaQueryParam)); return this.baseMapper.getPvDeviceList(page,subsAreaQueryParam); } @Override - public List getAllPvDeviceList() { - return this.list(); + public List getAllPvDeviceList() { + return this.baseMapper.getAllPvDeviceList(); } @Override @@ -78,8 +79,8 @@ public class PvDeviceServiceImpl extends ServiceImpl i } @Override - public boolean delPvDevice(String id) { - return this.removeById(id); + public boolean delPvDevice(List ids) { + return this.removeByIds(ids); } @@ -87,7 +88,21 @@ public class PvDeviceServiceImpl extends ServiceImpl i * 校验单位名称是否重复 */ private void checkNameAndParam(PvDeviceParam pvDeviceParam, boolean isUpdate) { + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(PvDevice::getName, pvDeviceParam.getName()); + if (isUpdate) { + //更新操作 + if (pvDeviceParam instanceof PvDeviceParam.UpdatePvDeviceParam) { + lambdaQueryWrapper.ne(PvDevice::getId, ((PvDeviceParam.UpdatePvDeviceParam) pvDeviceParam).getId()); + } + } + int countName = this.count(lambdaQueryWrapper); + if (countName > 0) { + throw new BusinessException(PvDeviceResponseEnum.DVE_CODE_REPEAT); + } + + lambdaQueryWrapper.clear(); lambdaQueryWrapper.eq(PvDevice::getDevCode, pvDeviceParam.getDevCode()); if (isUpdate) { //更新操作 diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvDistributedServiceImpl.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvDistributedServiceImpl.java index 1601f0733..ad708dcf4 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvDistributedServiceImpl.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvDistributedServiceImpl.java @@ -12,6 +12,7 @@ import com.njcn.device.pojo.param.pv.PvDistributedParam; import com.njcn.device.pojo.param.pv.DistributedQueryParam; import com.njcn.device.pojo.po.pv.PvDistributed; import com.njcn.device.pojo.po.pv.PvDistributed; +import com.njcn.device.pojo.vo.pv.PvDistributedVO; import com.njcn.pvdevice.mapper.PvDistributedMapper; import com.njcn.pvdevice.service.IPvDistributedService; import com.njcn.pvdevice.service.IPvSubAreaService; @@ -60,8 +61,8 @@ public class PvDistributedServiceImpl extends ServiceImpl getPvDistributedList(DistributedQueryParam distributedQueryParam) { - Page page = new Page<>(PageFactory.getPageNum(distributedQueryParam),PageFactory.getPageSize(distributedQueryParam)); + public Page getPvDistributedList(DistributedQueryParam distributedQueryParam) { + Page page = new Page<>(PageFactory.getPageNum(distributedQueryParam),PageFactory.getPageSize(distributedQueryParam)); return this.baseMapper.getPvDistributedList(page,distributedQueryParam); } @@ -76,8 +77,8 @@ public class PvDistributedServiceImpl extends ServiceImpl ids) { + return this.removeByIds(ids); } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvLineDetailServiceImpl.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvLineDetailServiceImpl.java index 2a5fea2d2..83aec8c94 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvLineDetailServiceImpl.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvLineDetailServiceImpl.java @@ -23,6 +23,7 @@ import com.njcn.system.pojo.po.DictData; import com.njcn.system.utils.SystemEnumUtil; import com.njcn.web.factory.PageFactory; import lombok.RequiredArgsConstructor; +import org.apache.ibatis.annotations.Param; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; @@ -128,16 +129,16 @@ public class PvLineDetailServiceImpl extends ServiceImpl ids) { + return this.removeByIds(ids); } @Override - public Page getPvLineAllDetailMain(Integer pageNum, Integer pageSize, List subIds, List subAreaIds) { + public Page getPvLineAllDetailMain(Integer pageNum, Integer pageSize, List subIds, List subAreaIds,String type,Integer lineStatus) { Page page = new Page<>(pageNum, pageSize); - return this.baseMapper.getPvLineAllDetailMain(page, subIds, subAreaIds); + return this.baseMapper.getPvLineAllDetailMain(page, subIds, subAreaIds,type,lineStatus); } @@ -164,25 +165,18 @@ public class PvLineDetailServiceImpl extends ServiceImpl i } @Override - public Page getPvLvUserList(LvUserQueryParam lvUserQueryParam) { - Page page = new Page<>(PageFactory.getPageNum(lvUserQueryParam),PageFactory.getPageSize(lvUserQueryParam)); + public Page getPvLvUserList(LvUserQueryParam lvUserQueryParam) { + Page page = new Page<>(PageFactory.getPageNum(lvUserQueryParam),PageFactory.getPageSize(lvUserQueryParam)); return this.baseMapper.getPvLvUserList(page,lvUserQueryParam); } @@ -76,8 +77,8 @@ public class PvLvUserServiceImpl extends ServiceImpl i } @Override - public boolean delPvLvUser(String id) { - return this.removeById(id); + public boolean delPvLvUser(List ids) { + return this.removeByIds(ids); } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvSubAreaServiceImpl.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvSubAreaServiceImpl.java index c9f91263e..6e30e3299 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvSubAreaServiceImpl.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvSubAreaServiceImpl.java @@ -9,6 +9,7 @@ import com.njcn.device.pojo.param.pv.PvSubAreaParam; import com.njcn.device.pojo.param.pv.SubAreaQueryParam; import com.njcn.device.pojo.po.pv.PvSubArea; import com.njcn.device.pojo.po.pv.PvSubArea; +import com.njcn.device.pojo.vo.pv.PvSubAreaVO; import com.njcn.pvdevice.mapper.PvSubAreaMapper; import com.njcn.pvdevice.service.IPvSubAreaService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -66,8 +67,8 @@ public class PvSubAreaServiceImpl extends ServiceImpl getPvSubAreaList(SubAreaQueryParam subsAreaQueryParam) { - Page page = new Page<>(PageFactory.getPageNum(subsAreaQueryParam),PageFactory.getPageSize(subsAreaQueryParam)); + public Page getPvSubAreaList(SubAreaQueryParam subsAreaQueryParam) { + Page page = new Page<>(PageFactory.getPageNum(subsAreaQueryParam),PageFactory.getPageSize(subsAreaQueryParam)); return this.baseMapper.getPvSubAreaList(page,subsAreaQueryParam); } @@ -82,8 +83,8 @@ public class PvSubAreaServiceImpl extends ServiceImpl ids) { + return this.removeByIds(ids); } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvSubstationServiceImpl.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvSubstationServiceImpl.java index 1c199519a..b002ee2be 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvSubstationServiceImpl.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvSubstationServiceImpl.java @@ -1,5 +1,6 @@ package com.njcn.pvdevice.service.impl; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -30,6 +31,7 @@ import lombok.RequiredArgsConstructor; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; +import java.util.Collection; import java.util.List; import java.util.Objects; @@ -71,6 +73,11 @@ public class PvSubstationServiceImpl extends ServiceImpl getPvSubstationList(SubstationQueryParam substationQueryParam) { Page page = new Page<>(PageFactory.getPageNum(substationQueryParam),PageFactory.getPageSize(substationQueryParam)); + if(CollUtil.isNotEmpty(substationQueryParam.getUnitId())){ + List tem = deptFeignClient.getDepSonIdtByDeptId(substationQueryParam.getUnitId().get(0)).getData(); + tem.add(substationQueryParam.getUnitId().get(0)); + substationQueryParam.setUnitId(tem); + } return this.baseMapper.getPvSubstationList(page,substationQueryParam); } @@ -85,8 +92,8 @@ public class PvSubstationServiceImpl extends ServiceImpl ids) { + return this.removeByIds(ids); } @@ -111,6 +118,21 @@ public class PvSubstationServiceImpl extends ServiceImpl 0) { + throw new BusinessException(PvDeviceResponseEnum.SUBSTATION_CODE_REPEAT); + } + DictData dictData = dicDataFeignClient.getDicDataById(pvSubstationParam.getScale()).getData(); if(Objects.isNull(dictData)){ throw new BusinessException(SystemResponseEnum.VOLTAGE_EMPTY); diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvTenVoltageServiceImpl.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvTenVoltageServiceImpl.java index 162dea6af..28f2a9b04 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvTenVoltageServiceImpl.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvTenVoltageServiceImpl.java @@ -10,6 +10,7 @@ import com.njcn.device.pojo.param.pv.PvTenVoltageParam; import com.njcn.device.pojo.param.pv.TenVoltageQueryParam; import com.njcn.device.pojo.po.pv.PvTenVoltage; import com.njcn.device.pojo.po.pv.PvTenVoltage; +import com.njcn.device.pojo.vo.pv.PvTenVoltageVO; import com.njcn.pvdevice.mapper.PvTenVoltageMapper; import com.njcn.pvdevice.service.IPvTenVoltageService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -21,6 +22,7 @@ import lombok.RequiredArgsConstructor; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; +import java.util.List; import java.util.Objects; /** @@ -56,19 +58,24 @@ public class PvTenVoltageServiceImpl extends ServiceImpl getPvTenVoltageList(TenVoltageQueryParam tenVoltageQueryParam) { - Page page = new Page<>(PageFactory.getPageNum(tenVoltageQueryParam),PageFactory.getPageSize(tenVoltageQueryParam)); + public Page getPvTenVoltageList(TenVoltageQueryParam tenVoltageQueryParam) { + Page page = new Page<>(PageFactory.getPageNum(tenVoltageQueryParam),PageFactory.getPageSize(tenVoltageQueryParam)); return this.baseMapper.getPvTenVoltageList(page,tenVoltageQueryParam); } + @Override + public List getAllPvTenVoltageList(){ + return this.list(); + } + @Override public PvTenVoltage getPvTenVoltageById(String id) { return this.getById(id); } @Override - public boolean delPvTenVoltage(String id) { - return this.removeById(id); + public boolean delPvTenVoltage(List ids) { + return this.removeByIds(ids); } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvTerminalBaseServiceImpl.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvTerminalBaseServiceImpl.java index 76e759a35..d2362df75 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvTerminalBaseServiceImpl.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvTerminalBaseServiceImpl.java @@ -3,27 +3,34 @@ package com.njcn.pvdevice.service.impl; import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.njcn.common.pojo.enums.common.DataStateEnum; import com.njcn.common.pojo.enums.response.CommonResponseEnum; import com.njcn.common.pojo.exception.BusinessException; import com.njcn.device.enums.LineBaseEnum; +import com.njcn.device.enums.PvDeviceResponseEnum; import com.njcn.device.pojo.param.pv.PvTerminalBaseQuery; +import com.njcn.device.pojo.po.pv.PvDistributed; +import com.njcn.device.pojo.po.pv.PvLvUser; import com.njcn.device.pojo.po.pv.PvSubArea; import com.njcn.device.pojo.po.pv.PvSubstation; +import com.njcn.device.pojo.vo.pv.DisOrLvVO; import com.njcn.device.pojo.vo.pv.PvLineAllDetailVO; -import com.njcn.pvdevice.mapper.PvLineDetailMapper; -import com.njcn.pvdevice.mapper.PvSubAreaMapper; -import com.njcn.pvdevice.mapper.PvSubstationMapper; +import com.njcn.pvdevice.mapper.*; import com.njcn.pvdevice.service.*; import com.njcn.system.api.DicDataFeignClient; import com.njcn.user.api.DeptFeignClient; import com.njcn.user.pojo.vo.PvTerminalTreeVO; import com.njcn.web.factory.PageFactory; import com.njcn.web.pojo.param.BaseParam; +import io.swagger.models.auth.In; import lombok.RequiredArgsConstructor; +import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import java.util.List; +import java.util.Objects; import java.util.stream.Collectors; +import java.util.stream.Stream; /** * pqs @@ -35,8 +42,6 @@ import java.util.stream.Collectors; @RequiredArgsConstructor public class PvTerminalBaseServiceImpl implements PvTerminalBaseService { - private final IPvUnitService iPvUnitService; - private final IPvSubstationService iPvSubstationService; private final IPvSubAreaService iPvSubAreaService; @@ -47,9 +52,9 @@ public class PvTerminalBaseServiceImpl implements PvTerminalBaseService { private final PvSubAreaMapper pvSubAreaMapper; - private final PvLineDetailMapper pvLineDetailMapper; + private final PvLvUserMapper pvLvUserMapper; - private final DicDataFeignClient dicDataFeignClient; + private final PvDistributedMapper pvDistributedMapper; private final DeptFeignClient deptFeignClient; @@ -65,39 +70,64 @@ public class PvTerminalBaseServiceImpl implements PvTerminalBaseService { @Override public Page lineDetailBySubId(PvTerminalBaseQuery pvTerminalBaseQuery) { - List ids = pvTerminalBaseQuery.getId(); + String id = pvTerminalBaseQuery.getId(); Integer level = pvTerminalBaseQuery.getLevel(); if(level.equals(LineBaseEnum.PV_UNIT_LEVEL.getCode())){ //点击的是单位节点 + + List deptIds = deptFeignClient.getDepSonIdtByDeptId(id).getData(); + if(CollUtil.isEmpty(deptIds)){ + deptIds.add(id); + } LambdaQueryWrapper subQuery= new LambdaQueryWrapper<>(); - subQuery.in(PvSubstation::getUnitId,ids); + subQuery.in(PvSubstation::getUnitId,deptIds); List substationList = iPvSubstationService.list(subQuery); List subIds = substationList.stream().map(PvSubstation::getId).collect(Collectors.toList()); LambdaQueryWrapper areaQuery= new LambdaQueryWrapper<>(); - areaQuery.in(PvSubArea::getUnitId,ids); + areaQuery.in(PvSubArea::getUnitId,deptIds); List subAreaList = iPvSubAreaService.list(areaQuery); List subAreaIds = subAreaList.stream().map(PvSubArea::getId).collect(Collectors.toList()); - return iPvLineDetailService.getPvLineAllDetailMain(PageFactory.getPageNum(pvTerminalBaseQuery),PageFactory.getPageSize(pvTerminalBaseQuery),subIds,subAreaIds); + + if(CollUtil.isEmpty(subAreaIds) && CollUtil.isEmpty(subIds)){ + throw new BusinessException(PvDeviceResponseEnum.NO_SUB); + } + + return iPvLineDetailService.getPvLineAllDetailMain(PageFactory.getPageNum(pvTerminalBaseQuery),PageFactory.getPageSize(pvTerminalBaseQuery),subIds,subAreaIds,pvTerminalBaseQuery.getType(),pvTerminalBaseQuery.getLineStatus()); }else if(level.equals(LineBaseEnum.PV_SUB_LEVEL.getCode())){ - return iPvLineDetailService.getPvLineAllDetailMain(PageFactory.getPageNum(pvTerminalBaseQuery),PageFactory.getPageSize(pvTerminalBaseQuery), ids,null); + return iPvLineDetailService.getPvLineAllDetailMain(PageFactory.getPageNum(pvTerminalBaseQuery),PageFactory.getPageSize(pvTerminalBaseQuery), Stream.of(pvTerminalBaseQuery.getId()).collect(Collectors.toList()), null,pvTerminalBaseQuery.getType(),pvTerminalBaseQuery.getLineStatus()); }else if(level.equals(LineBaseEnum.PV_SUB_AREA_LEVEL.getCode())){ - return iPvLineDetailService.getPvLineAllDetailMain(PageFactory.getPageNum(pvTerminalBaseQuery),PageFactory.getPageSize(pvTerminalBaseQuery),null,ids); + return iPvLineDetailService.getPvLineAllDetailMain(PageFactory.getPageNum(pvTerminalBaseQuery),PageFactory.getPageSize(pvTerminalBaseQuery),null,Stream.of(pvTerminalBaseQuery.getId()).collect(Collectors.toList()),pvTerminalBaseQuery.getType(),pvTerminalBaseQuery.getLineStatus()); } throw new BusinessException(CommonResponseEnum.FAIL); } + @Override + public DisOrLvVO pvDisOrLv(String userCode, Integer userCodeType){ + DisOrLvVO disOrLvVO = new DisOrLvVO(); + if(userCodeType == 1){ + //低压 + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(PvLvUser::getUserCode,userCode).eq(PvLvUser::getState, DataStateEnum.ENABLE.getCode()); + PvLvUser pvLvUser = pvLvUserMapper.selectOne(lambdaQueryWrapper); + if(Objects.nonNull(pvLvUser)){ + BeanUtils.copyProperties(pvLvUser,disOrLvVO); + } - /* private void diGui(List unitTreeList,List subTreeList,List subAreaTreeList) { - for (PvTerminalTreeVO unit : unitTreeList) { - if (CollUtil.isNotEmpty(unit.getChildren())) { - diGui(unit.getChildren(),subTreeList,subAreaTreeList); - } else { - unit.setChildren(getChildren(unit, subTreeList)); - unit.setChildren(getChildren(unit, subAreaTreeList)); + }else { + //分布式 + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(PvDistributed::getUserCode,userCode).eq(PvDistributed::getState, DataStateEnum.ENABLE.getCode()); + PvDistributed pvDistributed = pvDistributedMapper.selectOne(lambdaQueryWrapper); + if(Objects.nonNull(pvDistributed)){ + BeanUtils.copyProperties(pvDistributed,disOrLvVO); } } - }*/ + return disOrLvVO; + } + + + private List getChildren(PvTerminalTreeVO tem, List children) { diff --git a/pqs-device/device-boot/src/test/java/com/njcn/DeviceTest.java b/pqs-device/device-boot/src/test/java/com/njcn/PvDeviceTest.java similarity index 96% rename from pqs-device/device-boot/src/test/java/com/njcn/DeviceTest.java rename to pqs-device/device-boot/src/test/java/com/njcn/PvDeviceTest.java index d3a2f2e35..7c05e243c 100644 --- a/pqs-device/device-boot/src/test/java/com/njcn/DeviceTest.java +++ b/pqs-device/device-boot/src/test/java/com/njcn/PvDeviceTest.java @@ -17,7 +17,7 @@ import java.util.stream.Stream; * @version 1.0.0 * @date 2021年12月14日 12:55 */ -public class DeviceTest extends BaseJunitTest { +public class PvDeviceTest extends BaseJunitTest { @Autowired private DeptLineService deptLineService; diff --git a/pqs-user/user-api/src/main/java/com/njcn/user/api/DeptFeignClient.java b/pqs-user/user-api/src/main/java/com/njcn/user/api/DeptFeignClient.java index fef5b4a1b..dd18cf685 100644 --- a/pqs-user/user-api/src/main/java/com/njcn/user/api/DeptFeignClient.java +++ b/pqs-user/user-api/src/main/java/com/njcn/user/api/DeptFeignClient.java @@ -60,4 +60,11 @@ public interface DeptFeignClient { @GetMapping("/getDeptById") HttpResult getDeptById(@RequestParam("deptId") String deptId); + + /** + * 获取所有部门 + */ + @GetMapping("/getDepSonIdtByDeptId") + HttpResult> getDepSonIdtByDeptId(@RequestParam("deptId") String deptId); + } diff --git a/pqs-user/user-api/src/main/java/com/njcn/user/api/fallback/DeptFeignClientFallbackFactory.java b/pqs-user/user-api/src/main/java/com/njcn/user/api/fallback/DeptFeignClientFallbackFactory.java index d769f265e..64ab3fc15 100644 --- a/pqs-user/user-api/src/main/java/com/njcn/user/api/fallback/DeptFeignClientFallbackFactory.java +++ b/pqs-user/user-api/src/main/java/com/njcn/user/api/fallback/DeptFeignClientFallbackFactory.java @@ -69,6 +69,13 @@ public class DeptFeignClientFallbackFactory implements FallbackFactory> getDepSonIdtByDeptId(String deptId) { + log.error("{}异常,降级处理,异常为:{}","查询所部门索引异常",cause.toString()); + throw new BusinessException(finalExceptionEnum); + } + }; } } diff --git a/pqs-user/user-boot/src/main/java/com/njcn/user/controller/DeptController.java b/pqs-user/user-boot/src/main/java/com/njcn/user/controller/DeptController.java index 21586430a..30d88f52f 100644 --- a/pqs-user/user-boot/src/main/java/com/njcn/user/controller/DeptController.java +++ b/pqs-user/user-boot/src/main/java/com/njcn/user/controller/DeptController.java @@ -285,5 +285,22 @@ public class DeptController extends BaseController { } + /** + * 根据部门id获取所有子部门ids + * @author cdf + * @date 2022/7/26 + */ + @OperateInfo(info = LogEnum.SYSTEM_COMMON) + @GetMapping("/getDepSonIdtByDeptId") + @ApiOperation("根据部门id获取所有子部门ids") + public HttpResult> getDepSonIdtByDeptId(@RequestParam("deptId")String deptId) { + String methodDescribe = getMethodDescribe("getDepSonIdtByDeptId"); + List deptList = deptService.getDepSonIdtByDeptId(deptId); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deptList, methodDescribe); + } + + + + } diff --git a/pqs-user/user-boot/src/main/java/com/njcn/user/mapper/DeptMapper.java b/pqs-user/user-boot/src/main/java/com/njcn/user/mapper/DeptMapper.java index 33242772f..cd381eea1 100644 --- a/pqs-user/user-boot/src/main/java/com/njcn/user/mapper/DeptMapper.java +++ b/pqs-user/user-boot/src/main/java/com/njcn/user/mapper/DeptMapper.java @@ -95,4 +95,11 @@ public interface DeptMapper extends BaseMapper { List allDeptList(); + + /** + * 根据部门id获取所有子部门id集合 + * @author cdf + * @date 2022/7/26 + */ + List getDeptSonIds(@Param("deptId") String deptId); } diff --git a/pqs-user/user-boot/src/main/java/com/njcn/user/mapper/mapping/DeptMapper.xml b/pqs-user/user-boot/src/main/java/com/njcn/user/mapper/mapping/DeptMapper.xml index e50514254..ac860d4f0 100644 --- a/pqs-user/user-boot/src/main/java/com/njcn/user/mapper/mapping/DeptMapper.xml +++ b/pqs-user/user-boot/src/main/java/com/njcn/user/mapper/mapping/DeptMapper.xml @@ -155,9 +155,14 @@ - select id,name,pid, 0 as level from sys_dept where type = 0 and state = 1 order by sort + + + diff --git a/pqs-user/user-boot/src/main/java/com/njcn/user/service/IDeptService.java b/pqs-user/user-boot/src/main/java/com/njcn/user/service/IDeptService.java index d7a3cc5b9..b8a15d23e 100644 --- a/pqs-user/user-boot/src/main/java/com/njcn/user/service/IDeptService.java +++ b/pqs-user/user-boot/src/main/java/com/njcn/user/service/IDeptService.java @@ -147,4 +147,12 @@ public interface IDeptService extends IService { * @date 2022/7/13 */ Dept getDeptById(String id); + + + /** + * 根据部门id获取部门详情 + * @author cdf + * @date 2022/7/13 + */ + List getDepSonIdtByDeptId(String id); } diff --git a/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/DeptServiceImpl.java b/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/DeptServiceImpl.java index 7528d89e8..ef0be7cbd 100644 --- a/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/DeptServiceImpl.java +++ b/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/DeptServiceImpl.java @@ -306,4 +306,13 @@ public class DeptServiceImpl extends ServiceImpl implements ID deptVo.setChildren(getChildrens(deptVo, allDept)); }).collect(Collectors.toList()); } + + + /** + * 根据部门id获取部门详情 + */ + @Override + public List getDepSonIdtByDeptId(String id){ + return this.baseMapper.getDeptSonIds(id); + } }