pv终端台帐 部门增加id查询所有子部门

This commit is contained in:
2022-07-28 20:36:19 +08:00
parent 9bcabf659c
commit d23053251f
69 changed files with 1032 additions and 258 deletions

View File

@@ -26,6 +26,7 @@ public enum PvDeviceResponseEnum {
VOLTAGE_PARAM_EMPTY("A0358","所属母线不可为空"), VOLTAGE_PARAM_EMPTY("A0358","所属母线不可为空"),
VOLTAGE_PARAM_EMPTY_MUST("A0359","所属母线必须为空"), VOLTAGE_PARAM_EMPTY_MUST("A0359","所属母线必须为空"),
LV_USER_REPEAT("A0360","低压用户名称重复"), LV_USER_REPEAT("A0360","低压用户名称重复"),
SUBSTATION_CODE_REPEAT("A0351","变电站编号重复"),
TEN_VOLTAGE_NULL("A0360","未查询到指定10kV线路"), TEN_VOLTAGE_NULL("A0360","未查询到指定10kV线路"),
@@ -33,11 +34,13 @@ public enum PvDeviceResponseEnum {
SUB_AREA_NULL("A0362","未查询到指定台区"), SUB_AREA_NULL("A0362","未查询到指定台区"),
DEV_NULL("A0363","未查询到指定终端"), DEV_NULL("A0363","未查询到指定终端"),
SUBSTATION_NULL("A0364","未查询到指定变电站"), SUBSTATION_NULL("A0364","未查询到指定变电站"),
SUBSTATION_EMPTY("A0364","变电站不可为空"),
VOLTAGE_NULL("A0365","未查询到指定母线"), VOLTAGE_NULL("A0365","未查询到指定母线"),
DEV_NUM_NULL("A0366","当前装置监测点序号已存在"), DEV_NUM_NULL("A0366","当前装置监测点序号已存在"),
ONE_SUB_VOLTAGE_EMPTY("A0367","I类监测点变电站母线不可为空"), ONE_SUB_VOLTAGE_EMPTY("A0367","I类监测点变电站母线不可为空"),
TWO_SUB_VOLTAGE_EMPTY_MUST("A0368","II类监测点变电站母线必须为空"), TWO_SUB_VOLTAGE_EMPTY_MUST("A0368","II类监测点变电站母线必须为空"),
LINE_DEVICE_NO_MATCH("A0369","监测点所属装置型号不匹配"), LINE_DEVICE_NO_MATCH("A0369","监测点所属装置型号不匹配"),
NO_SUB("A0370","当前单位下不存在台区或变电站"),
; ;

View File

@@ -21,6 +21,6 @@ public class DeviceQueryParam extends BaseParam {
@ApiModelProperty(value = "manufacturer",name = "制造厂商") @ApiModelProperty(value = "manufacturer",name = "制造厂商")
private List<String> manufacturer; private List<String> manufacturer;
@ApiModelProperty(value = "devType",name = "设备类型") @ApiModelProperty(value = "type",name = "设备类型")
private List<String> devType; private List<String> type;
} }

View File

@@ -8,11 +8,13 @@ import com.njcn.web.pojo.annotation.DateTimeStrValid;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Range;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern; import javax.validation.constraints.Pattern;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
/** /**
@@ -37,6 +39,10 @@ public class PvDeviceParam implements Serializable {
@NotBlank(message = "终端类型不可为空") @NotBlank(message = "终端类型不可为空")
private String type; private String type;
@ApiModelProperty(name = "name",value = "装置名称",required = true)
@NotBlank(message = "装置名称")
private String name;
/** /**
* 用于保存PMS中电能质量监测终端Id、智能融合终端Id智能电表Id * 用于保存PMS中电能质量监测终端Id、智能融合终端Id智能电表Id
*/ */
@@ -83,6 +89,29 @@ public class PvDeviceParam implements Serializable {
@ApiModelProperty(name = "devKey",value = "装置秘钥3ds加密") @ApiModelProperty(name = "devKey",value = "装置秘钥3ds加密")
private String devKey; 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;
/** /**
* 本次定检时间,默认等于投运时间 * 本次定检时间,默认等于投运时间
*/ */

View File

@@ -36,6 +36,13 @@ public class PvDistributedParam implements Serializable {
@NotBlank(message = "分布式光伏名称不可为空") @NotBlank(message = "分布式光伏名称不可为空")
private String name; 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") @ApiModelProperty(name = "energyCapacity",value = "储能配置容量KVA")
private Float energyCapacity; 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 @Data

View File

@@ -85,6 +85,10 @@ public class PvLineDetailParam implements Serializable {
@NotBlank(message = "用户编号不能为空") @NotBlank(message = "用户编号不能为空")
private String userCode; 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 = "线路号(在同一台设备中的监测点号)") @ApiModelProperty(name = "num",value = "线路号(在同一台设备中的监测点号)")
@NotNull(message = "线路号不可为空")
@Range(min = 1,max = 10,message = "线路号违规")
private Integer num; private Integer num;
/** /**
* PT一次变比 * PT一次变比
*/ */
@NotNull(message = "PT一次变比不可为空")
@ApiModelProperty(name = "pt1",value = "PT一次变比") @ApiModelProperty(name = "pt1",value = "PT一次变比")
private Float pt1; private Float pt1;
/** /**
* PT二次变比 * PT二次变比
*/ */
@NotNull(message = "PT二次变比不可为空")
@ApiModelProperty(name = "pt2",value = "PT二次变比") @ApiModelProperty(name = "pt2",value = "PT二次变比")
private Float pt2; private Float pt2;
/** /**
* CT一次变比 * CT一次变比
*/ */
@NotNull(message = "CT一次变比不可为空")
@ApiModelProperty(name = "ct1",value = "CT一次变比") @ApiModelProperty(name = "ct1",value = "CT一次变比")
private Float ct1; private Float ct1;
/** /**
* CT二次变比 * CT二次变比
*/ */
@NotNull(message = "CT二次变比不可为空")
@ApiModelProperty(name = "ct2",value = "CT二次变比") @ApiModelProperty(name = "ct2",value = "CT二次变比")
private Float ct2; private Float ct2;
/** /**
* 设备容量 * 设备容量
*/ */
@NotNull(message = "设备容量不可为空")
@ApiModelProperty(name = "devCapacity",value = "设备容量") @ApiModelProperty(name = "devCapacity",value = "设备容量")
private Float devCapacity; private Float devCapacity;
/** /**
* 短路容量 * 短路容量
*/ */
@NotNull(message = "短路容量不可为空")
@ApiModelProperty(name = "shortCapacity",value = "短路容量") @ApiModelProperty(name = "shortCapacity",value = "短路容量")
private Float shortCapacity; private Float shortCapacity;
/** /**
* 基准容量 * 基准容量
*/ */
@NotNull(message = "基准容量不可为空")
@ApiModelProperty(name = "standardCapacity",value = "基准容量") @ApiModelProperty(name = "standardCapacity",value = "基准容量")
private Float standardCapacity; private Float standardCapacity;
/** /**
* 协议容量 * 协议容量
*/ */
@NotNull(message = "协议容量不可为空")
@ApiModelProperty(name = "dealCapacity",value = "协议容量") @ApiModelProperty(name = "dealCapacity",value = "协议容量")
private Float dealCapacity; private Float dealCapacity;
/** /**
* 接线类型(0:星型接法;1:三角型接法;2:开口三角型接法) * 接线类型字典表
*/ */
@NotNull(message = "接线类型不可为空") @ApiModelProperty(name = "ptType",value = "接线类型字典表")
@ApiModelProperty(name = "ptType",value = "接线类型(0:星型接法;1:三角型接法;2:开口三角型接法)") private String ptType;
@Range(min = 0,max = 2,message = "接线类型违规")
private Integer ptType;
/** /**
* 测量间隔1-10分钟 * 测量间隔1-10分钟
*/ */
@NotNull(message = "测量间隔不可为空")
@ApiModelProperty(name = "timeInterval",value = "测量间隔1-10分钟") @ApiModelProperty(name = "timeInterval",value = "测量间隔1-10分钟")
@Range(min = 1,max = 10,message = "测量间隔1-10分钟")
private Integer timeInterval; private Integer timeInterval;
/** /**
* 干扰源类型,字典表 * 干扰源类型,字典表
*/ */
@NotNull(message = "干扰源类型不可为空")
@ApiModelProperty(name = "loadType",value = "干扰源类型,字典表") @ApiModelProperty(name = "loadType",value = "干扰源类型,字典表")
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = "干扰源类型id违规")
private String loadType; private String loadType;
/** /**
* 行业类型,字典表 * 行业类型,字典表
*/ */
@NotNull(message = "行业类型不可为空")
@ApiModelProperty(name = "businessType",value = "行业类型,字典表") @ApiModelProperty(name = "businessType",value = "行业类型,字典表")
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = "行业类型id违规")
private String businessType; private String businessType;
/** /**
* 网公司谐波监测平台标志(0-否;1-是),默认否 * 网公司谐波监测平台标志(0-否;1-是),默认否
*/ */
@NotNull(message = "网公司谐波监测平台标志不可为空")
@ApiModelProperty(name = "monitorFlag",value = "网公司谐波监测平台标志(0-否;1-是),默认否") @ApiModelProperty(name = "monitorFlag",value = "网公司谐波监测平台标志(0-否;1-是),默认否")
@Range(min = 0,max = 1,message = "网公司谐波监测平台标志违规")
private Integer monitorFlag; private Integer monitorFlag;
/** /**
* 电网标志0-电网侧1-非电网侧) * 电网标志0-电网侧1-非电网侧)
*/ */
@NotNull(message = "电网标志不可为空")
@ApiModelProperty(name = "powerFlag",value = "电网标志0-电网侧1-非电网侧)") @ApiModelProperty(name = "powerFlag",value = "电网标志0-电网侧1-非电网侧)")
@Range(min = 0,max = 1,message = "电网标志违规")
private Integer powerFlag; private Integer powerFlag;
/** /**
@@ -216,12 +199,22 @@ public class PvLineDetailParam implements Serializable {
@ApiModelProperty(name = "objName",value = "监测点对象名称") @ApiModelProperty(name = "objName",value = "监测点对象名称")
private String objName; private String objName;
/**
* 监测点对象大类
*/
@ApiModelProperty(name = "smallName",value = "监测点对象大类")
private String smallName;
/**
* 监测点对象小类
*/
@ApiModelProperty(name = "bigName",value = "监测点对象小类")
private String bigName;
/** /**
* 人为干预是否参与统计0不参与1参与默认参与统计 * 人为干预是否参与统计0不参与1参与默认参与统计
*/ */
@NotNull(message = "人为干预是否参与统计标志不可为空")
@ApiModelProperty(name = "statFlag",value = "人为干预是否参与统计0不参与1参与默认参与统计") @ApiModelProperty(name = "statFlag",value = "人为干预是否参与统计0不参与1参与默认参与统计")
@Range(min = 0,max = 1,message = "为干预是否参与统计违规")
private Integer statFlag = 1; private Integer statFlag = 1;
/** /**

View File

@@ -103,13 +103,13 @@ public class PvSubAreaParam implements Serializable {
* 是否安装智能融合终端 * 是否安装智能融合终端
*/ */
@ApiModelProperty(name = "devFusion",value = "是否安装智能融合终端") @ApiModelProperty(name = "devFusion",value = "是否安装智能融合终端")
private Boolean devFusion; private Integer devFusion;
/** /**
* 是否有分布式光伏接入 * 是否有分布式光伏接入
*/ */
@ApiModelProperty(name = "pv",value = "是否有分布式光伏接入") @ApiModelProperty(name = "pv",value = "是否有分布式光伏接入")
private Boolean pv; private Integer pv;
/** /**
* 分布式光伏总装机容量KVA * 分布式光伏总装机容量KVA

View File

@@ -41,6 +41,10 @@ public class PvSubstationParam implements Serializable {
@NotBlank(message = "变电站名称不能为空") @NotBlank(message = "变电站名称不能为空")
private String name; private String name;
@ApiModelProperty(name = "subCode",value = "变电站编号",required = true)
@NotBlank(message = "变电站编号不能为空")
private String subCode;
/** /**
* 电压等级Id字典表 * 电压等级Id字典表
*/ */

View File

@@ -45,6 +45,13 @@ public class PvTenVoltageParam implements Serializable {
@NotBlank(message = "线路名称不能为空") @NotBlank(message = "线路名称不能为空")
private String name; 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; 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 @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)

View File

@@ -22,12 +22,18 @@ public class PvTerminalBaseQuery extends BaseParam {
@ApiModelProperty(name = "id",value = "单位变电站台区索引",required = true) @ApiModelProperty(name = "id",value = "单位变电站台区索引",required = true)
@NotEmpty(message = "单位变电站台区索引不能为空") @NotEmpty(message = "单位变电站台区索引不能为空")
private List<String> id; private String id;
@ApiModelProperty(name = "level",value = "0.单位 1.变电站 2.台区",required = true) @ApiModelProperty(name = "level",value = "0.单位 1.变电站 2.台区",required = true)
@NotNull(message = "树层级不可为空") @NotNull(message = "树层级不可为空")
private Integer level; private Integer level;
@ApiModelProperty(name = "type",value = "字典类型 I II III类监测点类型id") @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;
} }

View File

@@ -23,4 +23,7 @@ public class TenVoltageQueryParam extends BaseParam {
@ApiModelProperty(name = "designScale",value = "电压等级") @ApiModelProperty(name = "designScale",value = "电压等级")
private List<String> designScale; private List<String> designScale;
@ApiModelProperty(name = "pvStatus",value = "是否有光伏接入")
private Integer pvStatus;
} }

View File

@@ -31,6 +31,8 @@ public class PvDevice extends BaseEntity {
*/ */
private String id; private String id;
private String name;
/** /**
* 终端类型(电能质量监测终端、智能电表、智能融合终端),字典表 * 终端类型(电能质量监测终端、智能电表、智能融合终端),字典表
*/ */
@@ -71,6 +73,22 @@ public class PvDevice extends BaseEntity {
*/ */
private String devKey; 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 LocalDate nextTimeCheck;
/**
* 终端级别
*/
private String devGrade;
/** /**
* 状态 * 状态
*/ */

View File

@@ -1,10 +1,13 @@
package com.njcn.device.pojo.po.pv; package com.njcn.device.pojo.po.pv;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.njcn.db.bo.BaseEntity; import com.njcn.db.bo.BaseEntity;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.Getter; import lombok.Getter;
@@ -30,16 +33,15 @@ public class PvDistributed extends BaseEntity {
*/ */
private String id; private String id;
/**
* 所属台区表Id外键
*/
private String subAreaId;
/** /**
* 分布式光伏名称 * 分布式光伏名称
*/ */
private String name; private String name;
private String code;
/** /**
* 用户编号(与低压用户台账表低压用户编号字段一致) * 用户编号(与低压用户台账表低压用户编号字段一致)
*/ */
@@ -75,6 +77,15 @@ public class PvDistributed extends BaseEntity {
*/ */
private Float energyCapacity; private Float energyCapacity;
private String smartSwitch;
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate installTime;
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate runTime;
/** /**
* 状态 * 状态
*/ */

View File

@@ -6,6 +6,7 @@ import java.io.Serializable;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.Getter; import lombok.Getter;
@@ -62,6 +63,8 @@ public class PvLineDetail extends BaseEntity {
private String userCode; private String userCode;
private Integer userCodeType;
/** /**
* 电压等级 * 电压等级
*/ */
@@ -115,7 +118,7 @@ public class PvLineDetail extends BaseEntity {
/** /**
* 接线类型(0:星型接法;1:三角型接法;2:开口三角型接法) * 接线类型(0:星型接法;1:三角型接法;2:开口三角型接法)
*/ */
private Integer ptType; private String ptType;
/** /**
* 测量间隔1-10分钟 * 测量间隔1-10分钟
@@ -152,6 +155,14 @@ public class PvLineDetail extends BaseEntity {
*/ */
private String objName; private String objName;
private String smallName;
/**
* 监测点对象小类
*/
private String bigName;
/** /**
* 人为干预是否参与统计0不参与1参与默认参与统计 * 人为干预是否参与统计0不参与1参与默认参与统计
*/ */

View File

@@ -88,12 +88,12 @@ public class PvSubArea extends BaseEntity {
/** /**
* 是否安装智能融合终端 * 是否安装智能融合终端
*/ */
private Boolean devFusion; private Integer devFusion;
/** /**
* 是否有分布式光伏接入 * 是否有分布式光伏接入
*/ */
private Boolean pv; private Integer pv;
/** /**
* 分布式光伏总装机容量KVA * 分布式光伏总装机容量KVA

View File

@@ -37,6 +37,11 @@ public class PvSubstation {
*/ */
private String name; private String name;
/**
* 变电站编号
*/
private String subCode;
/** /**
* 电压等级Id字典表 * 电压等级Id字典表
*/ */

View File

@@ -39,6 +39,11 @@ public class PvTenVoltage extends BaseEntity {
*/ */
private String name; private String name;
/**
* 线路编号
*/
private String code;
/** /**
* 跨区域类型 * 跨区域类型
*/ */
@@ -119,6 +124,22 @@ public class PvTenVoltage extends BaseEntity {
*/ */
private Integer state; private Integer state;
/**
* 是否有分布式光伏接入
*/
private Integer pvStatus;
/**
* 分布式光伏接入容量
*/
private Integer pvCapacity;
/**
* 分布式光伏接入数量
*/
private Integer pvNum;
} }

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -29,11 +29,19 @@ public class PvLineAllDetailVO {
*/ */
private String devName; private String devName;
private String devId;
/** /**
* 监测点类型I类监测点、II类监测点、III类监测点字典表 * 监测点类型I类监测点、II类监测点、III类监测点字典表
*/ */
private String type; private String type;
/**
* 监测点类型I类监测点、II类监测点、III类监测点字典表
*/
private String typeName;
private String substationId;
/** /**
* 所属变电站I类监测点 * 所属变电站I类监测点
*/ */
@@ -44,29 +52,37 @@ public class PvLineAllDetailVO {
*/ */
private String voltageName; private String voltageName;
private String voltageId;
/** /**
* 所属台区IDII类监测点 * 所属台区IDII类监测点
*/ */
private String subAreaName; private String subAreaName;
private String subAreaId;
private String userCode; private String userCode;
private String userCodeType;
/** /**
* 分布式光伏名称 * 分布式光伏名称
*/ */
private String distributeName; private String distributeName;
private String distributeId;
/** /**
* 低压用户名称 * 低压用户名称
*/ */
private String lvUserName; private String lvUserName;
private String lvUserId;
/** /**
* 电压等级 * 电压等级
*/ */
private String scale; private String scale;
private String scaleName;
/** /**
* 线路号(在同一台设备中的监测点号) * 线路号(在同一台设备中的监测点号)
*/ */
@@ -113,9 +129,11 @@ public class PvLineAllDetailVO {
private Float dealCapacity; private Float dealCapacity;
/** /**
* 接线类型(0:星型接法;1:三角型接法;2:开口三角型接法) * 接线类型
*/ */
private Integer ptType; private String ptType;
private String ptTypeName;
/** /**
* 测量间隔1-10分钟 * 测量间隔1-10分钟
@@ -126,6 +144,7 @@ public class PvLineAllDetailVO {
* 干扰源类型,字典表 * 干扰源类型,字典表
*/ */
private String loadType; private String loadType;
private String loadTypeName;
/** /**
* 行业类型,字典表 * 行业类型,字典表
@@ -152,6 +171,16 @@ public class PvLineAllDetailVO {
*/ */
private String objName; private String objName;
/**
* 监测点对象小类
*/
private String smallName;
/**
* 监测点对象大类
*/
private String bigName;
/** /**
* 人为干预是否参与统计0不参与1参与默认参与统计 * 人为干预是否参与统计0不参与1参与默认参与统计
*/ */
@@ -167,6 +196,8 @@ public class PvLineAllDetailVO {
*/ */
private String tfType; private String tfType;
private String tfTypeName;
/** /**
* 所属变压器编号 * 所属变压器编号
*/ */
@@ -177,6 +208,8 @@ public class PvLineAllDetailVO {
*/ */
private String groundType; private String groundType;
private String groundTypeName;
/** /**
* 投运日期 * 投运日期
*/ */
@@ -198,6 +231,13 @@ public class PvLineAllDetailVO {
private Integer state; private Integer state;
/**
* 监测点状态
* @author cdf
* @date 2022/7/27
*/
private Integer lineStatus;
} }

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -21,6 +21,7 @@ public class PvSubstationVO {
*/ */
private String unitId; private String unitId;
/** /**
* 所属单位名称 * 所属单位名称
*/ */
@@ -31,6 +32,11 @@ public class PvSubstationVO {
*/ */
private String name; private String name;
/**
* 变电站编号
*/
private String subCode;
/** /**
* 电压等级Id字典表 * 电压等级Id字典表
*/ */

View File

@@ -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;
}

View File

@@ -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.DeviceQueryParam;
import com.njcn.device.pojo.param.pv.PvDeviceParam; 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.service.IPvDeviceService; import com.njcn.pvdevice.service.IPvDeviceService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
@@ -91,9 +92,9 @@ public class PvDeviceController extends BaseController {
@OperateInfo(info = LogEnum.SYSTEM_COMMON) @OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("分页查询终端") @ApiOperation("分页查询终端")
@ApiImplicitParam(name = "deviceQueryParam",value = "终端实体",required = true) @ApiImplicitParam(name = "deviceQueryParam",value = "终端实体",required = true)
public HttpResult<Page<PvDevice>> getPvDeviceList(@RequestBody DeviceQueryParam deviceQueryParam){ public HttpResult<Page<PvDeviceVO>> getPvDeviceList(@RequestBody DeviceQueryParam deviceQueryParam){
String methodDescribe = getMethodDescribe("getPvDeviceList"); String methodDescribe = getMethodDescribe("getPvDeviceList");
Page<PvDevice> page = iPvDeviceService.getPvDeviceList(deviceQueryParam); Page<PvDeviceVO> page = iPvDeviceService.getPvDeviceList(deviceQueryParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
} }
@@ -106,9 +107,9 @@ public class PvDeviceController extends BaseController {
@PostMapping("getAllPvDeviceList") @PostMapping("getAllPvDeviceList")
@OperateInfo(info = LogEnum.SYSTEM_COMMON) @OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("查询所有终端") @ApiOperation("查询所有终端")
public HttpResult<List<PvDevice>> getAllPvDeviceList(){ public HttpResult<List<PvDeviceVO>> getAllPvDeviceList(){
String methodDescribe = getMethodDescribe("getAllPvDeviceList"); String methodDescribe = getMethodDescribe("getAllPvDeviceList");
List<PvDevice> list = iPvDeviceService.getAllPvDeviceList(); List<PvDeviceVO> list = iPvDeviceService.getAllPvDeviceList();
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
} }
@@ -137,18 +138,18 @@ public class PvDeviceController extends BaseController {
/** /**
* 删除终端 * 删除终端
* @param id 终端id * @param ids 终端id
* @author cdf * @author cdf
* @date 2022/7/5 * @date 2022/7/5
* @return boolean * @return boolean
*/ */
@DeleteMapping("delPvDevice") @PostMapping("delPvDevice")
@OperateInfo(info = LogEnum.SYSTEM_COMMON) @OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.DELETE)
@ApiOperation("删除终端") @ApiOperation("删除终端")
@ApiImplicitParam(name = "id",value = "终端id",required = true) @ApiImplicitParam(name = "ids",value = "终端id",required = true)
public HttpResult<PvDevice> delPvDevice(@RequestParam("id") String id){ public HttpResult<PvDevice> delPvDevice(@RequestBody List<String> ids){
String methodDescribe = getMethodDescribe("delPvDevice"); String methodDescribe = getMethodDescribe("delPvDevice");
boolean res = iPvDeviceService.delPvDevice(id); boolean res = iPvDeviceService.delPvDevice(ids);
if(res){ if(res){
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
} }

View File

@@ -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.PvDistributedParam;
import com.njcn.device.pojo.param.pv.DistributedQueryParam; 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.service.IPvDistributedService; import com.njcn.pvdevice.service.IPvDistributedService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
@@ -91,9 +92,9 @@ public class PvDistributedController extends BaseController {
@OperateInfo(info = LogEnum.SYSTEM_COMMON) @OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("分页查询分布式光伏台账") @ApiOperation("分页查询分布式光伏台账")
@ApiImplicitParam(name = "distributedQueryParam",value = "分布式光伏台账实体",required = true) @ApiImplicitParam(name = "distributedQueryParam",value = "分布式光伏台账实体",required = true)
public HttpResult<Page<PvDistributed>> getPvDistributedList(@RequestBody DistributedQueryParam distributedQueryParam){ public HttpResult<Page<PvDistributedVO>> getPvDistributedList(@RequestBody DistributedQueryParam distributedQueryParam){
String methodDescribe = getMethodDescribe("getPvDistributedList"); String methodDescribe = getMethodDescribe("getPvDistributedList");
Page<PvDistributed> page = iPvDistributedService.getPvDistributedList(distributedQueryParam); Page<PvDistributedVO> page = iPvDistributedService.getPvDistributedList(distributedQueryParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
} }
@@ -137,18 +138,18 @@ public class PvDistributedController extends BaseController {
/** /**
* 删除分布式光伏台账 * 删除分布式光伏台账
* @param id 分布式光伏台账id * @param ids 分布式光伏台账id
* @author cdf * @author cdf
* @date 2022/7/5 * @date 2022/7/5
* @return boolean * @return boolean
*/ */
@DeleteMapping("delPvDistributed") @PostMapping("delPvDistributed")
@OperateInfo(info = LogEnum.SYSTEM_COMMON) @OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("删除分布式光伏台账") @ApiOperation("删除分布式光伏台账")
@ApiImplicitParam(name = "id",value = "分布式光伏台账id",required = true) @ApiImplicitParam(name = "ids",value = "分布式光伏台账ids",required = true)
public HttpResult<PvDistributed> delPvDistributed(@RequestParam("id") String id){ public HttpResult<PvDistributed> delPvDistributed(@RequestBody List<String> ids){
String methodDescribe = getMethodDescribe("delPvDistributed"); String methodDescribe = getMethodDescribe("delPvDistributed");
boolean res = iPvDistributedService.delPvDistributed(id); boolean res = iPvDistributedService.delPvDistributed(ids);
if(res){ if(res){
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
} }

View File

@@ -138,18 +138,18 @@ public class PvLineDetailController extends BaseController {
/** /**
* 删除监测点 * 删除监测点
* @param id 监测点id * @param ids 监测点id
* @author cdf * @author cdf
* @date 2022/7/5 * @date 2022/7/5
* @return boolean * @return boolean
*/ */
@DeleteMapping("delPvLineDetail") @PostMapping("delPvLineDetail")
@OperateInfo(info = LogEnum.SYSTEM_COMMON) @OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("删除监测点") @ApiOperation("删除监测点")
@ApiImplicitParam(name = "id",value = "监测点id",required = true) @ApiImplicitParam(name = "ids",value = "监测点id",required = true)
public HttpResult<PvLineDetail> delPvLineDetail(@RequestParam("id") String id){ public HttpResult<PvLineDetail> delPvLineDetail(@RequestBody List<String> ids){
String methodDescribe = getMethodDescribe("delPvLineDetail"); String methodDescribe = getMethodDescribe("delPvLineDetail");
boolean res = iPvLineDetailService.delPvLineDetail(id); boolean res = iPvLineDetailService.delPvLineDetail(ids);
if(res){ if(res){
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
} }

View File

@@ -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.LvUserQueryParam;
import com.njcn.device.pojo.param.pv.PvLvUserParam; 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.njcn.device.pojo.vo.pv.PvLvUserVO;
import com.njcn.pvdevice.service.IPvLvUserService; import com.njcn.pvdevice.service.IPvLvUserService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
@@ -91,9 +92,9 @@ public class PvLvUserController extends BaseController {
@OperateInfo(info = LogEnum.SYSTEM_COMMON) @OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("分页查询低压用户台账") @ApiOperation("分页查询低压用户台账")
@ApiImplicitParam(name = "lvUserQueryParam",value = "低压用户台账实体",required = true) @ApiImplicitParam(name = "lvUserQueryParam",value = "低压用户台账实体",required = true)
public HttpResult<Page<PvLvUser>> getPvLvUserList(@RequestBody LvUserQueryParam lvUserQueryParam){ public HttpResult<Page<PvLvUserVO>> getPvLvUserList(@RequestBody LvUserQueryParam lvUserQueryParam){
String methodDescribe = getMethodDescribe("getPvLvUserList"); String methodDescribe = getMethodDescribe("getPvLvUserList");
Page<PvLvUser> page = iPvLvUserService.getPvLvUserList(lvUserQueryParam); Page<PvLvUserVO> page = iPvLvUserService.getPvLvUserList(lvUserQueryParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
} }
@@ -137,18 +138,18 @@ public class PvLvUserController extends BaseController {
/** /**
* 删除低压用户台账 * 删除低压用户台账
* @param id 低压用户台账id * @param ids 低压用户台账id
* @author cdf * @author cdf
* @date 2022/7/5 * @date 2022/7/5
* @return boolean * @return boolean
*/ */
@DeleteMapping("delPvLvUser") @PostMapping("delPvLvUser")
@OperateInfo(info = LogEnum.SYSTEM_COMMON) @OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.DELETE)
@ApiOperation("删除低压用户台账") @ApiOperation("删除低压用户台账")
@ApiImplicitParam(name = "id",value = "低压用户台账id",required = true) @ApiImplicitParam(name = "ids",value = "低压用户台账id",required = true)
public HttpResult<PvLvUser> delPvLvUser(@RequestParam("id") String id){ public HttpResult<PvLvUser> delPvLvUser(@RequestBody List<String> ids){
String methodDescribe = getMethodDescribe("delPvLvUser"); String methodDescribe = getMethodDescribe("delPvLvUser");
boolean res = iPvLvUserService.delPvLvUser(id); boolean res = iPvLvUserService.delPvLvUser(ids);
if(res){ if(res){
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
} }

View File

@@ -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.PvSubAreaParam;
import com.njcn.device.pojo.param.pv.SubAreaQueryParam; 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.service.IPvSubAreaService; import com.njcn.pvdevice.service.IPvSubAreaService;
import com.sun.el.parser.BooleanNode; import com.sun.el.parser.BooleanNode;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@@ -93,9 +94,9 @@ public class PvSubAreaController extends BaseController {
@OperateInfo(info = LogEnum.SYSTEM_COMMON) @OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("分页查询台区") @ApiOperation("分页查询台区")
@ApiImplicitParam(name = "subAreaQueryParam",value = "台区实体",required = true) @ApiImplicitParam(name = "subAreaQueryParam",value = "台区实体",required = true)
public HttpResult<Page<PvSubArea>> getPvSubAreaList(@RequestBody SubAreaQueryParam subAreaQueryParam){ public HttpResult<Page<PvSubAreaVO>> getPvSubAreaList(@RequestBody SubAreaQueryParam subAreaQueryParam){
String methodDescribe = getMethodDescribe("getPvSubAreaList"); String methodDescribe = getMethodDescribe("getPvSubAreaList");
Page<PvSubArea> page = iPvSubAreaService.getPvSubAreaList(subAreaQueryParam); Page<PvSubAreaVO> page = iPvSubAreaService.getPvSubAreaList(subAreaQueryParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
} }
@@ -139,18 +140,18 @@ public class PvSubAreaController extends BaseController {
/** /**
* 删除台区 * 删除台区
* @param id 台区id * @param ids 台区ids
* @author cdf * @author cdf
* @date 2022/7/5 * @date 2022/7/5
* @return boolean * @return boolean
*/ */
@DeleteMapping("delPvSubArea") @PostMapping("delPvSubArea")
@OperateInfo(info = LogEnum.SYSTEM_COMMON) @OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("删除台区") @ApiOperation("删除台区")
@ApiImplicitParam(name = "id",value = "台区id",required = true) @ApiImplicitParam(name = "ids",value = "台区ids",required = true)
public HttpResult<PvSubArea> delPvSubArea(@RequestParam("id") String id){ public HttpResult<PvSubArea> delPvSubArea(@RequestBody List<String> ids){
String methodDescribe = getMethodDescribe("delPvSubArea"); String methodDescribe = getMethodDescribe("delPvSubArea");
boolean res = iPvSubAreaService.delPvSubArea(id); boolean res = iPvSubAreaService.delPvSubArea(ids);
if(res){ if(res){
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
} }

View File

@@ -132,18 +132,18 @@ public class PvSubstationController extends BaseController {
/** /**
* 删除变电站 * 删除变电站
* @param id 变电站id * @param ids 变电站ids
* @author cdf * @author cdf
* @date 2022/7/5 * @date 2022/7/5
* @return boolean * @return boolean
*/ */
@DeleteMapping("delPvSubstation") @PostMapping("delPvSubstation")
@OperateInfo(info = LogEnum.SYSTEM_COMMON) @OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.DELETE)
@ApiOperation("删除变电站") @ApiOperation("删除变电站")
@ApiImplicitParam(name = "id",value = "变电站id",required = true) @ApiImplicitParam(name = "ids",value = "变电站ids",required = true)
public HttpResult<PvSubstation> delPvSubstation(@RequestParam("id") String id){ public HttpResult<PvSubstation> delPvSubstation(@RequestBody List<String> ids){
String methodDescribe = getMethodDescribe("delPvSubstation"); String methodDescribe = getMethodDescribe("delPvSubstation");
iPvSubstationService.delPvSubstation(id); iPvSubstationService.delPvSubstation(ids);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
} }

View File

@@ -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.PvTenVoltageParam;
import com.njcn.device.pojo.param.pv.TenVoltageQueryParam; 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.service.IPvTenVoltageService; import com.njcn.pvdevice.service.IPvTenVoltageService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
@@ -21,6 +22,8 @@ import org.springframework.web.bind.annotation.*;
import com.njcn.web.controller.BaseController; import com.njcn.web.controller.BaseController;
import java.util.List;
/** /**
* <p> * <p>
* 前端控制器 * 前端控制器
@@ -90,11 +93,25 @@ public class PvTenVoltageController extends BaseController {
@OperateInfo(info = LogEnum.SYSTEM_COMMON) @OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("分页查询10kV线路") @ApiOperation("分页查询10kV线路")
@ApiImplicitParam(name = "tenVoltageQueryParam", value = "10kV线路实体", required = true) @ApiImplicitParam(name = "tenVoltageQueryParam", value = "10kV线路实体", required = true)
public HttpResult<Page<PvTenVoltage>> getPvTenVoltageList(@RequestBody @Validated TenVoltageQueryParam tenVoltageQueryParam) { public HttpResult<Page<PvTenVoltageVO>> getPvTenVoltageList(@RequestBody @Validated TenVoltageQueryParam tenVoltageQueryParam) {
String methodDescribe = getMethodDescribe("getPvTenVoltageList"); String methodDescribe = getMethodDescribe("getPvTenVoltageList");
Page<PvTenVoltage> page = iPvTenVoltageService.getPvTenVoltageList(tenVoltageQueryParam); Page<PvTenVoltageVO> page = iPvTenVoltageService.getPvTenVoltageList(tenVoltageQueryParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
/**
* 查询所有10kV线路
* @author cdf
* @date 2022/7/5
* @return List<PvTenVoltage>
*/
@GetMapping("getAllPvTenVoltageList")
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("查询所有10kV线路")
public HttpResult<List<PvTenVoltage>> getAllPvTenVoltageList(){
String methodDescribe = getMethodDescribe("getAllPvTenVoltageList");
List<PvTenVoltage> res = iPvTenVoltageService.getAllPvTenVoltageList();
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
} }
@@ -120,18 +137,18 @@ public class PvTenVoltageController extends BaseController {
/** /**
* 删除10kV线路 * 删除10kV线路
* *
* @param id 10kV线路id * @param ids 10kV线路id
* @return boolean * @return boolean
* @author cdf * @author cdf
* @date 2022/7/5 * @date 2022/7/5
*/ */
@DeleteMapping("delPvTenVoltage") @PostMapping("delPvTenVoltage")
@OperateInfo(info = LogEnum.SYSTEM_COMMON) @OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("删除10kV线路") @ApiOperation("删除10kV线路")
@ApiImplicitParam(name = "id", value = "10kV线路id", required = true) @ApiImplicitParam(name = "ids", value = "10kV线路id", required = true)
public HttpResult<PvTenVoltage> delPvTenVoltage(@RequestParam("id") String id) { public HttpResult<PvTenVoltage> delPvTenVoltage(@RequestBody List<String> ids) {
String methodDescribe = getMethodDescribe("delPvTenVoltage"); String methodDescribe = getMethodDescribe("delPvTenVoltage");
boolean flag = iPvTenVoltageService.delPvTenVoltage(id); boolean flag = iPvTenVoltageService.delPvTenVoltage(ids);
if (flag) { if (flag) {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
} }

View File

@@ -7,12 +7,14 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult; import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil; import com.njcn.common.utils.HttpResultUtil;
import com.njcn.device.pojo.param.pv.PvTerminalBaseQuery; 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.device.pojo.vo.pv.PvLineAllDetailVO;
import com.njcn.pvdevice.service.PvTerminalBaseService; import com.njcn.pvdevice.service.PvTerminalBaseService;
import com.njcn.user.pojo.vo.PvTerminalTreeVO; import com.njcn.user.pojo.vo.PvTerminalTreeVO;
import com.njcn.web.controller.BaseController; import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
@@ -68,5 +70,23 @@ public class PvTerminalBaseController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, all, methodDescribe); 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<DisOrLvVO> 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);
}
} }

View File

@@ -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.param.pv.DeviceQueryParam;
import com.njcn.device.pojo.po.pv.PvDevice; import com.njcn.device.pojo.po.pv.PvDevice;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.device.pojo.vo.pv.PvDeviceVO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* <p> * <p>
* Mapper 接口 * Mapper 接口
@@ -24,7 +27,10 @@ public interface PvDeviceMapper extends BaseMapper<PvDevice> {
* @author cdf * @author cdf
* @date 2022/7/8 * @date 2022/7/8
*/ */
Page<PvDevice> getPvDeviceList(Page<PvDevice> page,@Param("deviceQueryParam") DeviceQueryParam deviceQueryParam); Page<PvDeviceVO> getPvDeviceList(Page<PvDeviceVO> page, @Param("deviceQueryParam") DeviceQueryParam deviceQueryParam);
List<PvDeviceVO> getAllPvDeviceList();
} }

View File

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.device.pojo.param.pv.DistributedQueryParam; 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 org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
/** /**
@@ -22,6 +23,6 @@ public interface PvDistributedMapper extends BaseMapper<PvDistributed> {
* @author cdf * @author cdf
* @date 2022/7/7 * @date 2022/7/7
*/ */
Page<PvDistributed> getPvDistributedList(Page<PvDistributed> page,@Param("distributedQueryParam") DistributedQueryParam distributedQueryParam); Page<PvDistributedVO> getPvDistributedList(Page<PvDistributedVO> page, @Param("distributedQueryParam") DistributedQueryParam distributedQueryParam);
} }

View File

@@ -27,7 +27,7 @@ public interface PvLineDetailMapper extends BaseMapper<PvLineDetail> {
* @date 2022/7/5 * @date 2022/7/5
* @return Page<PvLineDetail> * @return Page<PvLineDetail>
*/ */
Page<PvLineAllDetailVO> getPvLineAllDetailMain(Page<PvLineAllDetailVO> page,@Param("subIds") List<String> subIds, @Param("subAreaIds")List<String> subAreaIds); Page<PvLineAllDetailVO> getPvLineAllDetailMain(Page<PvLineAllDetailVO> page,@Param("subIds") List<String> subIds, @Param("subAreaIds")List<String> subAreaIds,@Param("type")String type,@Param("lineStatus")Integer lineStatus);
} }

View File

@@ -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.param.pv.LvUserQueryParam;
import com.njcn.device.pojo.po.pv.PvLvUser; import com.njcn.device.pojo.po.pv.PvLvUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.device.pojo.vo.pv.PvLvUserVO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
/** /**
@@ -21,6 +22,6 @@ public interface PvLvUserMapper extends BaseMapper<PvLvUser> {
* @author cdf * @author cdf
* @date 2022/7/8 * @date 2022/7/8
*/ */
Page<PvLvUser> getPvLvUserList(Page<PvLvUser> page,@Param("lvUserQueryParam") LvUserQueryParam lvUserQueryParam); Page<PvLvUserVO> getPvLvUserList(Page<PvLvUserVO> page, @Param("lvUserQueryParam") LvUserQueryParam lvUserQueryParam);
} }

View File

@@ -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.param.pv.SubAreaQueryParam;
import com.njcn.device.pojo.po.pv.PvSubArea; import com.njcn.device.pojo.po.pv.PvSubArea;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; 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 com.njcn.user.pojo.vo.PvTerminalTreeVO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@@ -25,7 +27,7 @@ public interface PvSubAreaMapper extends BaseMapper<PvSubArea> {
* @author cdf * @author cdf
* @date 2022/7/7 * @date 2022/7/7
*/ */
Page<PvSubArea> getPvSubAreaList(Page<PvSubArea> page,@Param("subsAreaQueryParam") SubAreaQueryParam subsAreaQueryParam); Page<PvSubAreaVO> getPvSubAreaList(Page<PvSubAreaVO> page, @Param("subsAreaQueryParam") SubAreaQueryParam subsAreaQueryParam);
/** /**
* 查询所有台区 * 查询所有台区
@@ -33,4 +35,7 @@ public interface PvSubAreaMapper extends BaseMapper<PvSubArea> {
* @date 2022/7/11 * @date 2022/7/11
*/ */
List<PvTerminalTreeVO> getSubAreaTreeList(); List<PvTerminalTreeVO> getSubAreaTreeList();
DisOrLvVO pvDisOrLv(String userCode, String userCodeType);
} }

View File

@@ -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.param.pv.TenVoltageQueryParam;
import com.njcn.device.pojo.po.pv.PvTenVoltage; import com.njcn.device.pojo.po.pv.PvTenVoltage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.device.pojo.vo.pv.PvTenVoltageVO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
/** /**
@@ -21,6 +22,6 @@ public interface PvTenVoltageMapper extends BaseMapper<PvTenVoltage> {
* @author cdf * @author cdf
* @date 2022/7/7 * @date 2022/7/7
*/ */
Page<PvTenVoltage> getPvTenVoltageList(Page<PvTenVoltage> page,@Param("tenVoltageQueryParam") TenVoltageQueryParam tenVoltageQueryParam); Page<PvTenVoltageVO> getPvTenVoltageList(Page<PvTenVoltageVO> page, @Param("tenVoltageQueryParam") TenVoltageQueryParam tenVoltageQueryParam);
} }

View File

@@ -2,15 +2,76 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.pvdevice.mapper.PvDeviceMapper"> <mapper namespace="com.njcn.pvdevice.mapper.PvDeviceMapper">
<select id="getPvDeviceList" resultType="PvDevice"> <select id="getPvDeviceList" resultType="PvDeviceVO">
SELECT SELECT
dev.id, dev.id,
dic.NAME manufacturer, dev.manufacturer,
dic2.NAME devType, dic.NAME manufacturerName,
dic2.NAME devTypeName,
dev.dev_Type,
dev.type, dev.type,
dic3.name typeName,
dev.Dev_Code, dev.Dev_Code,
dev.name,
dev.ip, dev.ip,
dev.port, 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
<where>
<if test="deviceQueryParam.searchValue!=null and deviceQueryParam.searchValue!=''">
and dev.dev_code like CONCAT('%',#{deviceQueryParam.searchValue},'%')
or dev.name like CONCAT('%',#{deviceQueryParam.searchValue},'%')
</if>
<if test="deviceQueryParam.manufacturer!=null and deviceQueryParam.manufacturer.size > 0">
and dev.manufacturer in
<foreach collection="deviceQueryParam.manufacturer" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="deviceQueryParam.type!=null and deviceQueryParam.type.size > 0">
and dev.type in
<foreach collection="deviceQueryParam.type" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
and dev.state = 1
</where>
order by dev.create_time asc
</select>
<select id="getAllPvDeviceList" resultType="PvDeviceVO">
SELECT
dev.id,
dev.manufacturer,
dic.NAME manufacturerName,
dic2.NAME devTypeName,
dev.dev_Type,
dev.type,
dic3.name typeName,
dic3.code typeCode,
dev.Dev_Code,
dev.name,
dev.ip,
dev.port,
dev.load_time,
dev.dev_status,
dev.communicate_Type,
dev.Series, dev.Series,
dev.Dev_Key, dev.Dev_Key,
dev.This_Time_Check, dev.This_Time_Check,
@@ -19,26 +80,7 @@
pv_device dev pv_device dev
LEFT JOIN sys_dict_data dic ON dev.manufacturer = dic.id 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 dic2 ON dev.Dev_Type = dic2.id
<where> LEFT JOIN sys_dict_data dic3 ON dev.type = dic3.id
<if test="deviceQueryParam.searchValue!=null and deviceQueryParam.searchValue!=''"> where dev.state = 1
and dev.dev_code like CONCAT('%',#{deviceQueryParam.searchValue},'%')
</if>
<if test="deviceQueryParam.manufacturer!=null and deviceQueryParam.manufacturer.size > 0">
and dev.manufacturer in
<foreach collection="lvUserQueryParam.manufacturer" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="deviceQueryParam.devType!=null and deviceQueryParam.devType.size > 0">
and dev.dev_Type in
<foreach collection="lvUserQueryParam.devType" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
and dev.state = 1
</where>
order by dev.create_time asc
</select> </select>
</mapper> </mapper>

View File

@@ -2,17 +2,22 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.pvdevice.mapper.PvDistributedMapper"> <mapper namespace="com.njcn.pvdevice.mapper.PvDistributedMapper">
<select id="getPvDistributedList" resultType="PvDistributed"> <select id="getPvDistributedList" resultType="PvDistributedVO">
SELECT SELECT
dis.id, dis.id,
dic.NAME scale, dic.NAME scaleName,
dis.scale,
dis.NAME, dis.NAME,
dis.User_Code, dis.User_Code,
dis.Dev_Code, dis.Dev_Code,
dis.Machine_Capacity, dis.Machine_Capacity,
dis.Inte_Type, dis.Inte_Type,
dis.Phase, dis.Phase,
dis.Energy_Capacity dis.Energy_Capacity,
dis.code,
dis.Smart_Switch,
dis.install_time,
dis.run_time
FROM FROM
pv_distributed dis pv_distributed dis
LEFT JOIN sys_dict_data dic ON dis.scale = dic.id LEFT JOIN sys_dict_data dic ON dis.scale = dic.id

View File

@@ -9,12 +9,21 @@
line.id, line.id,
line.NAME, line.NAME,
line.CODE, line.CODE,
line.user_Code,
line.user_Code_type,
line.dev_id,
dev.Dev_Code devName, dev.Dev_Code devName,
dic.NAME type, dev.dev_status lineStatus,
dic1.NAME scale, dic.NAME typeName,
line.type,
dic1.NAME scaleName,
line.scale,
line.Substation_Id,
sub.NAME substationName, sub.NAME substationName,
v.NAME voltageName, v.NAME voltageName,
line.voltage_id,
subArea.NAME subAreaName, subArea.NAME subAreaName,
line.sub_area_id,
dis.NAME distributeName, dis.NAME distributeName,
lv.NAME lvUserName, lv.NAME lvUserName,
line.num, line.num,
@@ -27,6 +36,7 @@
line.standard_capacity, line.standard_capacity,
line.deal_capacity, line.deal_capacity,
line.pt_Type, line.pt_Type,
dic6.name ptTypeName,
line.time_Interval, line.time_Interval,
dic2.NAME loadType, dic2.NAME loadType,
dic3.NAME businessType, dic3.NAME businessType,
@@ -34,11 +44,15 @@
line.Power_Flag, line.Power_Flag,
line.Monitor_Id, line.Monitor_Id,
line.Obj_Name, line.Obj_Name,
line.small_name,
line.big_name,
line.Stat_flag, line.Stat_flag,
line.Remark, line.Remark,
line.Tf_Type, line.Tf_Type,
dic4.name tfTypeName,
line.Tf_Code, line.Tf_Code,
line.Ground_Type, line.Ground_Type,
dic5.name groundTypeName,
line.Put_In, line.Put_In,
line.Access, line.Access,
line.Power_Supply line.Power_Supply
@@ -54,6 +68,9 @@
LEFT JOIN Pv_Lv_User lv ON line.user_code = lv.user_code 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 dic2 ON line.load_type = dic2.id
LEFT JOIN sys_dict_data dic3 ON line.Business_Type = dic3.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 where line.state = 1
<if test="subIds!=null and subIds.size!=0"> <if test="subIds!=null and subIds.size!=0">
and line.Substation_Id in and line.Substation_Id in
@@ -61,6 +78,12 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="type!=null and type!=''">
and line.type = #{type}
</if>
<if test="lineStatus!=null and type!=''">
and dev.dev_status = #{lineStatus}
</if>
</if> </if>
<if test="subIds!=null and subIds.size!=0 and subAreaIds!=null and subAreaIds.size!=0"> <if test="subIds!=null and subIds.size!=0 and subAreaIds!=null and subAreaIds.size!=0">
@@ -72,13 +95,22 @@
SELECT SELECT
line.id, line.id,
line.NAME, line.NAME,
line.user_Code,
line.user_Code_type,
line.CODE, line.CODE,
line.dev_id,
dev.Dev_Code devName, dev.Dev_Code devName,
dic.NAME type, dev.dev_status lineStatus,
dic1.NAME scale, dic.NAME typeName,
line.type,
dic1.NAME scaleName,
line.scale,
line.Substation_Id,
sub.NAME substationName, sub.NAME substationName,
v.NAME voltageName, v.NAME voltageName,
line.voltage_id,
subArea.NAME subAreaName, subArea.NAME subAreaName,
line.sub_area_id,
dis.NAME distributeName, dis.NAME distributeName,
lv.NAME lvUserName, lv.NAME lvUserName,
line.num, line.num,
@@ -91,6 +123,7 @@
line.standard_capacity, line.standard_capacity,
line.deal_capacity, line.deal_capacity,
line.pt_Type, line.pt_Type,
dic6.name ptTypeName,
line.time_Interval, line.time_Interval,
dic2.NAME loadType, dic2.NAME loadType,
dic3.NAME businessType, dic3.NAME businessType,
@@ -98,11 +131,15 @@
line.Power_Flag, line.Power_Flag,
line.Monitor_Id, line.Monitor_Id,
line.Obj_Name, line.Obj_Name,
line.small_name,
line.big_name,
line.Stat_flag, line.Stat_flag,
line.Remark, line.Remark,
line.Tf_Type, line.Tf_Type,
dic4.name tfTypeName,
line.Tf_Code, line.Tf_Code,
line.Ground_Type, line.Ground_Type,
dic5.name groundTypeName,
line.Put_In, line.Put_In,
line.Access, line.Access,
line.Power_Supply line.Power_Supply
@@ -118,6 +155,9 @@
LEFT JOIN Pv_Lv_User lv ON line.user_code = lv.user_code 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 dic2 ON line.load_type = dic2.id
LEFT JOIN sys_dict_data dic3 ON line.Business_Type = dic3.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 where line.state = 1
<if test="subAreaIds!=null and subAreaIds.size!=0"> <if test="subAreaIds!=null and subAreaIds.size!=0">
and line.Sub_Area_Id in and line.Sub_Area_Id in
@@ -125,6 +165,12 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="type!=null and type!=''">
and line.type = #{type}
</if>
<if test="lineStatus!=null and type!=''">
and dev.dev_status = #{lineStatus}
</if>
</if> </if>

View File

@@ -2,10 +2,11 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.pvdevice.mapper.PvLvUserMapper"> <mapper namespace="com.njcn.pvdevice.mapper.PvLvUserMapper">
<select id="getPvLvUserList" resultType="PvLvUser"> <select id="getPvLvUserList" resultType="PvLvUserVO">
SELECT SELECT
lv.id, lv.id,
dic.NAME scale, dic.NAME scaleName,
lv.scale,
lv.NAME, lv.NAME,
lv.User_Code, lv.User_Code,
lv.User_Capacity, lv.User_Capacity,

View File

@@ -2,11 +2,13 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.pvdevice.mapper.PvSubAreaMapper"> <mapper namespace="com.njcn.pvdevice.mapper.PvSubAreaMapper">
<select id="getPvSubAreaList" resultType="PvSubArea"> <select id="getPvSubAreaList" resultType="PvSubAreaVO">
SELECT SELECT
sub.id, sub.id,
unit.name unitId, sub.unit_id,
ten.NAME tenVoltageId, dept.name unitName,
sub.ten_Voltage_Id,
ten.NAME tenVoltageName,
sub.NAME, sub.NAME,
sub.Code, sub.Code,
sub.Cable_Length, sub.Cable_Length,
@@ -23,7 +25,7 @@
sub.Power_Power sub.Power_Power
FROM FROM
pv_sub_area sub 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 INNER JOIN pv_ten_voltage ten ON ten.id = sub.Ten_Voltage_Id
<where> <where>
<if test="subsAreaQueryParam.searchValue!=null and subsAreaQueryParam.searchValue!=''"> <if test="subsAreaQueryParam.searchValue!=null and subsAreaQueryParam.searchValue!=''">
@@ -51,4 +53,9 @@
<select id="getSubAreaTreeList" resultType="com.njcn.user.pojo.vo.PvTerminalTreeVO"> <select id="getSubAreaTreeList" resultType="com.njcn.user.pojo.vo.PvTerminalTreeVO">
select id,name,unit_id pid,2 as level from pv_sub_area where state = 1 select id,name,unit_id pid,2 as level from pv_sub_area where state = 1
</select> </select>
<select id="pvDisOrLv" resultType="DisOrLvVO">
</select>
</mapper> </mapper>

View File

@@ -5,14 +5,16 @@
<select id="getPvSubstationList" resultType="PvSubstationVO"> <select id="getPvSubstationList" resultType="PvSubstationVO">
SELECT SELECT
sub.id, sub.id,
dept.NAME unitId, sub.unit_id,
dic.NAME scale, dept.NAME unitName,
dic.NAME scaleName,
sub.scale,
sub.sub_code,
sub.NAME, sub.NAME,
sub.Total_Capacity, sub.Total_Capacity,
sub.Team_Code sub.Team_Code
FROM FROM
pv_substation sub pv_substation sub
LEFT JOIN pv_unit unit ON sub.unit_id = unit.id
LEFT JOIN sys_dict_data dic ON sub.scale = dic.id LEFT JOIN sys_dict_data dic ON sub.scale = dic.id
LEFT JOIN sys_dept dept ON sub.unit_id = dept.id LEFT JOIN sys_dept dept ON sub.unit_id = dept.id
<where> <where>

View File

@@ -2,12 +2,16 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.pvdevice.mapper.PvTenVoltageMapper"> <mapper namespace="com.njcn.pvdevice.mapper.PvTenVoltageMapper">
<select id="getPvTenVoltageList" resultType="PvTenVoltage"> <select id="getPvTenVoltageList" resultType="PvTenVoltageVO">
SELECT SELECT
ten.id, ten.id,
dic.NAME scale, dic.NAME scaleName,
dic2.NAME designScale, ten.scale,
dic2.NAME designScaleName,
ten.design_scale,
ten.NAME, ten.NAME,
ten.dispatch_Id,
ten.code,
ten.Cr_Type, ten.Cr_Type,
ten.Dev_Status, ten.Dev_Status,
ten.Earthing, ten.Earthing,
@@ -20,14 +24,21 @@
ten.Run_Load, ten.Run_Load,
ten.Output_Power, ten.Output_Power,
ten.Max_Current, ten.Max_Current,
ten.Put_Into_Date ten.Put_Into_Date,
ten.pv_Status,
ten.pv_Capacity,
ten.pv_Num
FROM FROM
pv_ten_voltage ten pv_ten_voltage ten
LEFT JOIN sys_dict_data dic ON ten.scale = dic.id LEFT JOIN sys_dict_data dic ON ten.scale = dic.id
LEFT JOIN sys_dict_data dic2 ON ten.Design_Scale = dic2.id LEFT JOIN sys_dict_data dic2 ON ten.Design_Scale = dic2.id
<where> <where>
<if test="tenVoltageQueryParam.searchValue!=null and tenVoltageQueryParam.searchValue!=''"> <if test="tenVoltageQueryParam.pvStatus != null">
and ten.pv_status = #{tenVoltageQueryParam.pvStatus}
</if>
<if test="tenVoltageQueryParam.searchValue !=null and tenVoltageQueryParam.searchValue!=''">
and ten.name like CONCAT('%',#{tenVoltageQueryParam.searchValue},'%') and ten.name like CONCAT('%',#{tenVoltageQueryParam.searchValue},'%')
or ten.code like CONCAT('%',#{tenVoltageQueryParam.searchValue},'%')
</if> </if>
<if test="tenVoltageQueryParam.scale!=null and tenVoltageQueryParam.scale.size > 0"> <if test="tenVoltageQueryParam.scale!=null and tenVoltageQueryParam.scale.size > 0">
@@ -43,6 +54,7 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
</where> </where>
order by ten.create_time asc order by ten.create_time asc
</select> </select>

View File

@@ -6,6 +6,7 @@ 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.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
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 java.util.List; import java.util.List;
@@ -41,14 +42,14 @@ public interface IPvDeviceService extends IService<PvDevice> {
/** /**
* 分页查询分布式台账 * 分页查询分布式台账
* @param DeviceQueryParam 分布式台账实体 * @param deviceQueryParam 分布式台账实体
* @author cdf * @author cdf
* @date 2022/7/5 * @date 2022/7/5
* @return Page<PvDevice> * @return Page<PvDevice>
*/ */
Page<PvDevice> getPvDeviceList(DeviceQueryParam deviceQueryParam); Page<PvDeviceVO> getPvDeviceList(DeviceQueryParam deviceQueryParam);
List<PvDevice> getAllPvDeviceList(); List<PvDeviceVO> getAllPvDeviceList();
/** /**
@@ -62,11 +63,11 @@ public interface IPvDeviceService extends IService<PvDevice> {
/** /**
* 删除分布式台账 * 删除分布式台账
* @param id 分布式台账id * @param ids 分布式台账id
* @author cdf * @author cdf
* @date 2022/7/5 * @date 2022/7/5
* @return boolean * @return boolean
*/ */
boolean delPvDevice(String id); boolean delPvDevice(List<String> ids);
} }

View File

@@ -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.param.pv.DistributedQueryParam;
import com.njcn.device.pojo.po.pv.PvDistributed; import com.njcn.device.pojo.po.pv.PvDistributed;
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; import java.util.List;
@@ -47,7 +48,7 @@ public interface IPvDistributedService extends IService<PvDistributed> {
* @date 2022/7/5 * @date 2022/7/5
* @return Page<PvDistributed> * @return Page<PvDistributed>
*/ */
Page<PvDistributed> getPvDistributedList(DistributedQueryParam distributedQueryParam); Page<PvDistributedVO> getPvDistributedList(DistributedQueryParam distributedQueryParam);
List<PvDistributed> getAllPvDistributedList(); List<PvDistributed> getAllPvDistributedList();
@@ -63,12 +64,12 @@ public interface IPvDistributedService extends IService<PvDistributed> {
/** /**
* 删除分布式台账 * 删除分布式台账
* @param id 分布式台账id * @param ids 分布式台账id
* @author cdf * @author cdf
* @date 2022/7/5 * @date 2022/7/5
* @return boolean * @return boolean
*/ */
boolean delPvDistributed(String id); boolean delPvDistributed(List<String> ids);
} }

View File

@@ -63,12 +63,12 @@ public interface IPvLineDetailService extends IService<PvLineDetail> {
/** /**
* 删除监测点 * 删除监测点
* @param id 监测点id * @param ids 监测点id
* @author cdf * @author cdf
* @date 2022/7/5 * @date 2022/7/5
* @return boolean * @return boolean
*/ */
boolean delPvLineDetail(String id); boolean delPvLineDetail(List<String> ids);
/** /**
@@ -79,7 +79,7 @@ public interface IPvLineDetailService extends IService<PvLineDetail> {
* @date 2022/7/5 * @date 2022/7/5
* @return Page<PvLineDetail> * @return Page<PvLineDetail>
*/ */
Page<PvLineAllDetailVO> getPvLineAllDetailMain(Integer pageNum,Integer pageSize,List<String> subIds, List<String> subAreaIds); Page<PvLineAllDetailVO> getPvLineAllDetailMain(Integer pageNum,Integer pageSize,List<String> subIds, List<String> subAreaIds,String type,Integer lineStatus);

View File

@@ -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.njcn.device.pojo.po.pv.PvLvUser; import com.njcn.device.pojo.po.pv.PvLvUser;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.device.pojo.vo.pv.PvLvUserVO;
import java.util.List; import java.util.List;
@@ -46,7 +47,7 @@ public interface IPvLvUserService extends IService<PvLvUser> {
* @date 2022/7/5 * @date 2022/7/5
* @return Page<PvLvUser> * @return Page<PvLvUser>
*/ */
Page<PvLvUser> getPvLvUserList(LvUserQueryParam lvUserQueryParam); Page<PvLvUserVO> getPvLvUserList(LvUserQueryParam lvUserQueryParam);
List<PvLvUser> getAllPvLvUserList(); List<PvLvUser> getAllPvLvUserList();
@@ -62,10 +63,10 @@ public interface IPvLvUserService extends IService<PvLvUser> {
/** /**
* 删除分低压用户台账 * 删除分低压用户台账
* @param id 分低压用户台账id * @param ids 分低压用户台账id
* @author cdf * @author cdf
* @date 2022/7/5 * @date 2022/7/5
* @return boolean * @return boolean
*/ */
boolean delPvLvUser(String id); boolean delPvLvUser(List<String> ids);
} }

View File

@@ -6,6 +6,7 @@ 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.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
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 java.util.List; import java.util.List;
@@ -45,7 +46,7 @@ public interface IPvSubAreaService extends IService<PvSubArea> {
* @date 2022/7/5 * @date 2022/7/5
* @return Page<PvSubArea> * @return Page<PvSubArea>
*/ */
Page<PvSubArea> getPvSubAreaList(SubAreaQueryParam subAreaQueryParam); Page<PvSubAreaVO> getPvSubAreaList(SubAreaQueryParam subAreaQueryParam);
List<PvSubArea> getAllPvSubAreaList(); List<PvSubArea> getAllPvSubAreaList();
@@ -61,11 +62,11 @@ public interface IPvSubAreaService extends IService<PvSubArea> {
/** /**
* 删除台区 * 删除台区
* @param id 台区id * @param ids 台区id
* @author cdf * @author cdf
* @date 2022/7/5 * @date 2022/7/5
* @return boolean * @return boolean
*/ */
boolean delPvSubArea(String id); boolean delPvSubArea(List<String> ids);
} }

View File

@@ -63,11 +63,11 @@ public interface IPvSubstationService extends IService<PvSubstation> {
/** /**
* 删除变电站 * 删除变电站
* @param id 变电站id * @param ids 变电站id
* @author cdf * @author cdf
* @date 2022/7/5 * @date 2022/7/5
* @return boolean * @return boolean
*/ */
boolean delPvSubstation(String id); boolean delPvSubstation(List<String> ids);
} }

View File

@@ -6,6 +6,9 @@ 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.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
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 java.util.List;
/** /**
* <p> * <p>
@@ -19,8 +22,8 @@ public interface IPvTenVoltageService extends IService<PvTenVoltage> {
/** /**
* 新增单位 * 新增10kV线路
* @param pvTenVoltageParam 单位实体 * @param pvTenVoltageParam 10kV线路实体
* @author cdf * @author cdf
* @date 2022/7/5 * @date 2022/7/5
* @return boolean * @return boolean
@@ -28,8 +31,8 @@ public interface IPvTenVoltageService extends IService<PvTenVoltage> {
boolean addTenVoltage(PvTenVoltageParam pvTenVoltageParam); boolean addTenVoltage(PvTenVoltageParam pvTenVoltageParam);
/** /**
* 修改单位 * 修改10kV线路
* @param updatePvTenVoltageParam 单位实体 * @param updatePvTenVoltageParam 10kV线路实体
* @author cdf * @author cdf
* @date 2022/7/5 * @date 2022/7/5
* @return boolean * @return boolean
@@ -38,18 +41,26 @@ public interface IPvTenVoltageService extends IService<PvTenVoltage> {
/** /**
* 分页查询单位 * 分页查询10kV线路
* @param tenVoltageQueryParam 单位实体 * @param tenVoltageQueryParam 10kV线路实体
* @author cdf * @author cdf
* @date 2022/7/5 * @date 2022/7/5
* @return Page<PvTenVoltage> * @return Page<PvTenVoltage>
*/ */
Page<PvTenVoltage> getPvTenVoltageList(TenVoltageQueryParam tenVoltageQueryParam); Page<PvTenVoltageVO> getPvTenVoltageList(TenVoltageQueryParam tenVoltageQueryParam);
/**
* 分页查询10kV线路
* @author cdf
* @date 2022/7/5
* @return List<PvTenVoltage>
*/
List<PvTenVoltage> getAllPvTenVoltageList();
/** /**
* 根据单位id查询单位 * 根据10kV线路id查询10kV线路
* @param id 单位id * @param id 10kV线路id
* @author cdf * @author cdf
* @date 2022/7/5 * @date 2022/7/5
* @return PvTenVoltage * @return PvTenVoltage
@@ -57,12 +68,12 @@ public interface IPvTenVoltageService extends IService<PvTenVoltage> {
PvTenVoltage getPvTenVoltageById(String id); PvTenVoltage getPvTenVoltageById(String id);
/** /**
* 删除单位 * 删除10kV线路
* @param id 单位id * @param ids 10kV线路id
* @author cdf * @author cdf
* @date 2022/7/5 * @date 2022/7/5
* @return boolean * @return boolean
*/ */
boolean delPvTenVoltage(String id); boolean delPvTenVoltage(List<String> ids);
} }

View File

@@ -2,6 +2,7 @@ package com.njcn.pvdevice.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.device.pojo.param.pv.PvTerminalBaseQuery; 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.device.pojo.vo.pv.PvLineAllDetailVO;
import com.njcn.user.pojo.vo.PvTerminalTreeVO; import com.njcn.user.pojo.vo.PvTerminalTreeVO;
@@ -29,4 +30,12 @@ public interface PvTerminalBaseService {
* @date 2022/7/11 * @date 2022/7/11
*/ */
Page<PvLineAllDetailVO> lineDetailBySubId(PvTerminalBaseQuery pvTerminalBaseQuery); Page<PvLineAllDetailVO> lineDetailBySubId(PvTerminalBaseQuery pvTerminalBaseQuery);
/**
*
* @author cdf
* @date 2022/7/28
*/
DisOrLvVO pvDisOrLv(String userCode,Integer userCodeType);
} }

View File

@@ -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.param.pv.PvDeviceParam;
import com.njcn.device.pojo.po.pv.PvDevice; import com.njcn.device.pojo.po.pv.PvDevice;
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.mapper.PvDeviceMapper;
import com.njcn.pvdevice.service.IPvDeviceService; import com.njcn.pvdevice.service.IPvDeviceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -62,14 +63,14 @@ public class PvDeviceServiceImpl extends ServiceImpl<PvDeviceMapper, PvDevice> i
} }
@Override @Override
public Page<PvDevice> getPvDeviceList(DeviceQueryParam subsAreaQueryParam) { public Page<PvDeviceVO> getPvDeviceList(DeviceQueryParam subsAreaQueryParam) {
Page<PvDevice> page = new Page<>(PageFactory.getPageNum(subsAreaQueryParam), PageFactory.getPageSize(subsAreaQueryParam)); Page<PvDeviceVO> page = new Page<>(PageFactory.getPageNum(subsAreaQueryParam), PageFactory.getPageSize(subsAreaQueryParam));
return this.baseMapper.getPvDeviceList(page,subsAreaQueryParam); return this.baseMapper.getPvDeviceList(page,subsAreaQueryParam);
} }
@Override @Override
public List<PvDevice> getAllPvDeviceList() { public List<PvDeviceVO> getAllPvDeviceList() {
return this.list(); return this.baseMapper.getAllPvDeviceList();
} }
@Override @Override
@@ -78,8 +79,8 @@ public class PvDeviceServiceImpl extends ServiceImpl<PvDeviceMapper, PvDevice> i
} }
@Override @Override
public boolean delPvDevice(String id) { public boolean delPvDevice(List<String> ids) {
return this.removeById(id); return this.removeByIds(ids);
} }
@@ -87,7 +88,21 @@ public class PvDeviceServiceImpl extends ServiceImpl<PvDeviceMapper, PvDevice> i
* 校验单位名称是否重复 * 校验单位名称是否重复
*/ */
private void checkNameAndParam(PvDeviceParam pvDeviceParam, boolean isUpdate) { private void checkNameAndParam(PvDeviceParam pvDeviceParam, boolean isUpdate) {
LambdaQueryWrapper<PvDevice> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PvDevice> 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()); lambdaQueryWrapper.eq(PvDevice::getDevCode, pvDeviceParam.getDevCode());
if (isUpdate) { if (isUpdate) {
//更新操作 //更新操作

View File

@@ -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.param.pv.DistributedQueryParam;
import com.njcn.device.pojo.po.pv.PvDistributed; import com.njcn.device.pojo.po.pv.PvDistributed;
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.mapper.PvDistributedMapper;
import com.njcn.pvdevice.service.IPvDistributedService; import com.njcn.pvdevice.service.IPvDistributedService;
import com.njcn.pvdevice.service.IPvSubAreaService; import com.njcn.pvdevice.service.IPvSubAreaService;
@@ -60,8 +61,8 @@ public class PvDistributedServiceImpl extends ServiceImpl<PvDistributedMapper, P
} }
@Override @Override
public Page<PvDistributed> getPvDistributedList(DistributedQueryParam distributedQueryParam) { public Page<PvDistributedVO> getPvDistributedList(DistributedQueryParam distributedQueryParam) {
Page<PvDistributed> page = new Page<>(PageFactory.getPageNum(distributedQueryParam),PageFactory.getPageSize(distributedQueryParam)); Page<PvDistributedVO> page = new Page<>(PageFactory.getPageNum(distributedQueryParam),PageFactory.getPageSize(distributedQueryParam));
return this.baseMapper.getPvDistributedList(page,distributedQueryParam); return this.baseMapper.getPvDistributedList(page,distributedQueryParam);
} }
@@ -76,8 +77,8 @@ public class PvDistributedServiceImpl extends ServiceImpl<PvDistributedMapper, P
} }
@Override @Override
public boolean delPvDistributed(String id) { public boolean delPvDistributed(List<String> ids) {
return this.removeById(id); return this.removeByIds(ids);
} }

View File

@@ -23,6 +23,7 @@ import com.njcn.system.pojo.po.DictData;
import com.njcn.system.utils.SystemEnumUtil; import com.njcn.system.utils.SystemEnumUtil;
import com.njcn.web.factory.PageFactory; import com.njcn.web.factory.PageFactory;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -128,16 +129,16 @@ public class PvLineDetailServiceImpl extends ServiceImpl<PvLineDetailMapper, PvL
} }
@Override @Override
public boolean delPvLineDetail(String id) { public boolean delPvLineDetail(List<String> ids) {
return this.removeById(id); return this.removeByIds(ids);
} }
@Override @Override
public Page<PvLineAllDetailVO> getPvLineAllDetailMain(Integer pageNum, Integer pageSize, List<String> subIds, List<String> subAreaIds) { public Page<PvLineAllDetailVO> getPvLineAllDetailMain(Integer pageNum, Integer pageSize, List<String> subIds, List<String> subAreaIds,String type,Integer lineStatus) {
Page<PvLineAllDetailVO> page = new Page<>(pageNum, pageSize); Page<PvLineAllDetailVO> 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<PvLineDetailMapper, PvL
throw new BusinessException(PvDeviceResponseEnum.LINE_DEVICE_NO_MATCH); throw new BusinessException(PvDeviceResponseEnum.LINE_DEVICE_NO_MATCH);
}*/ }*/
/*校验变电站*/
if (StrUtil.isNotBlank(pvLineDetailParam.getSubstationId())) {
if (Objects.isNull(iPvSubstationService.getPvSubstationById(pvLineDetailParam.getSubstationId()))) {
throw new BusinessException(PvDeviceResponseEnum.SUBSTATION_NULL);
}
}
/*校验台区*/
if (StrUtil.isNotBlank(pvLineDetailParam.getSubAreaId())) {
if (Objects.isNull(iPvSubAreaService.getPvSubAreaById(pvLineDetailParam.getSubAreaId()))) {
throw new BusinessException(PvDeviceResponseEnum.SUB_AREA_NULL);
}
}
/*监测点类型*/ /*监测点类型*/
if (DicDataEnum.ONE_LINE.getCode().equals(lineType.getCode())) { if (DicDataEnum.ONE_LINE.getCode().equals(lineType.getCode())) {
/*校验变电站*/
if (StrUtil.isNotBlank(pvLineDetailParam.getSubstationId())) {
if (Objects.isNull(iPvSubstationService.getPvSubstationById(pvLineDetailParam.getSubstationId()))) {
throw new BusinessException(PvDeviceResponseEnum.SUBSTATION_NULL);
}
}else{
throw new BusinessException(PvDeviceResponseEnum.SUBSTATION_EMPTY);
}
//I类监测点 //I类监测点
if (StrUtil.hasBlank(pvLineDetailParam.getSubstationId(), pvLineDetailParam.getVoltageId())) { if (StrUtil.hasBlank(pvLineDetailParam.getSubstationId(), pvLineDetailParam.getVoltageId())) {
throw new BusinessException(PvDeviceResponseEnum.ONE_SUB_VOLTAGE_EMPTY); throw new BusinessException(PvDeviceResponseEnum.ONE_SUB_VOLTAGE_EMPTY);
@@ -192,7 +186,7 @@ public class PvLineDetailServiceImpl extends ServiceImpl<PvLineDetailMapper, PvL
} }
/*校验母线*/ /*校验母线*/
if(StrUtil.isBlank(pvLineDetailParam.getVoltageId())){ if (StrUtil.isBlank(pvLineDetailParam.getVoltageId())) {
throw new BusinessException(PvDeviceResponseEnum.VOLTAGE_PARAM_EMPTY); throw new BusinessException(PvDeviceResponseEnum.VOLTAGE_PARAM_EMPTY);
} }
@@ -201,13 +195,11 @@ public class PvLineDetailServiceImpl extends ServiceImpl<PvLineDetailMapper, PvL
} }
/*I类监测点终端只能选电能质量监测终端*/ /*I类监测点终端只能选电能质量监测终端*/
if(!DicDataEnum.DEV_QUALITY.getCode().equals(devType.getCode())){ if (!DicDataEnum.DEV_QUALITY.getCode().equals(devType.getCode())) {
throw new BusinessException(PvDeviceResponseEnum.LINE_DEVICE_NO_MATCH); throw new BusinessException(PvDeviceResponseEnum.LINE_DEVICE_NO_MATCH);
} }
} else if (DicDataEnum.TWO_LINE.getCode().equals(lineType.getCode())) { } else if (DicDataEnum.TWO_LINE.getCode().equals(lineType.getCode())) {
//II类监测点 //II类监测点
if (StrUtil.isNotBlank(pvLineDetailParam.getSubstationId()) || StrUtil.isNotBlank(pvLineDetailParam.getVoltageId())) { if (StrUtil.isNotBlank(pvLineDetailParam.getSubstationId()) || StrUtil.isNotBlank(pvLineDetailParam.getVoltageId())) {
@@ -220,12 +212,12 @@ public class PvLineDetailServiceImpl extends ServiceImpl<PvLineDetailMapper, PvL
} }
//II III 类监测点所属母线id必须为空 //II III 类监测点所属母线id必须为空
if(StrUtil.isNotBlank(pvLineDetailParam.getVoltageId())){ if (StrUtil.isNotBlank(pvLineDetailParam.getVoltageId())) {
throw new BusinessException(PvDeviceResponseEnum.VOLTAGE_PARAM_EMPTY_MUST); throw new BusinessException(PvDeviceResponseEnum.VOLTAGE_PARAM_EMPTY_MUST);
} }
/*II类监测点终端只能选融合终端*/ /*II类监测点终端只能选融合终端*/
if(!DicDataEnum.DEV_MIX.getCode().equals(devType.getCode())){ if (DicDataEnum.DEV_QUALITY.getCode().equals(devType.getCode())) {
throw new BusinessException(PvDeviceResponseEnum.LINE_DEVICE_NO_MATCH); throw new BusinessException(PvDeviceResponseEnum.LINE_DEVICE_NO_MATCH);
} }
@@ -242,24 +234,37 @@ public class PvLineDetailServiceImpl extends ServiceImpl<PvLineDetailMapper, PvL
} }
/*III类监测点终端只能选智能电表终端*/ /*III类监测点终端只能选智能电表终端*/
if(!DicDataEnum.DEV_SMART.getCode().equals(devType.getCode())){ if (!DicDataEnum.DEV_QUALITY.getCode().equals(devType.getCode())) {
throw new BusinessException(PvDeviceResponseEnum.LINE_DEVICE_NO_MATCH); throw new BusinessException(PvDeviceResponseEnum.LINE_DEVICE_NO_MATCH);
} }
} }
/*校验台区*/
if (Objects.isNull(dicDataFeignClient.getDicDataById(pvLineDetailParam.getBusinessType()).getData())) { if (StrUtil.isNotBlank(pvLineDetailParam.getSubAreaId())) {
throw new BusinessException(SystemResponseEnum.BUSINESS_EMPTY); if (Objects.isNull(iPvSubAreaService.getPvSubAreaById(pvLineDetailParam.getSubAreaId()))) {
} throw new BusinessException(PvDeviceResponseEnum.SUB_AREA_NULL);
if (StrUtil.isNotBlank(pvLineDetailParam.getScale())) {
if (Objects.isNull(dicDataFeignClient.getDicDataById(pvLineDetailParam.getScale()).getData())) {
throw new BusinessException(SystemResponseEnum.LINE_TYPE_VARIETY_EMPTY);
} }
} }
if (Objects.isNull(dicDataFeignClient.getDicDataById(pvLineDetailParam.getLoadType()).getData())) {
throw new BusinessException(SystemResponseEnum.INTERFERENCE_EMPTY); if (StrUtil.isNotBlank(pvLineDetailParam.getBusinessType())) {
if (Objects.isNull(dicDataFeignClient.getDicDataById(pvLineDetailParam.getBusinessType()).getData())) {
throw new BusinessException(SystemResponseEnum.BUSINESS_EMPTY);
}
}
if (StrUtil.isNotBlank(pvLineDetailParam.getScale())) {
if (StrUtil.isNotBlank(pvLineDetailParam.getScale())) {
if (Objects.isNull(dicDataFeignClient.getDicDataById(pvLineDetailParam.getScale()).getData())) {
throw new BusinessException(SystemResponseEnum.LINE_TYPE_VARIETY_EMPTY);
}
}
}
if (StrUtil.isNotBlank(pvLineDetailParam.getLoadType())) {
if (Objects.isNull(dicDataFeignClient.getDicDataById(pvLineDetailParam.getLoadType()).getData())) {
throw new BusinessException(SystemResponseEnum.INTERFERENCE_EMPTY);
}
} }

View File

@@ -12,6 +12,7 @@ import com.njcn.device.pojo.param.pv.PvLvUserParam;
import com.njcn.device.pojo.po.pv.PvDistributed; import com.njcn.device.pojo.po.pv.PvDistributed;
import com.njcn.device.pojo.po.pv.PvLvUser; import com.njcn.device.pojo.po.pv.PvLvUser;
import com.njcn.device.pojo.po.pv.PvLvUser; import com.njcn.device.pojo.po.pv.PvLvUser;
import com.njcn.device.pojo.vo.pv.PvLvUserVO;
import com.njcn.pvdevice.mapper.PvLvUserMapper; import com.njcn.pvdevice.mapper.PvLvUserMapper;
import com.njcn.pvdevice.service.IPvLvUserService; import com.njcn.pvdevice.service.IPvLvUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -60,8 +61,8 @@ public class PvLvUserServiceImpl extends ServiceImpl<PvLvUserMapper, PvLvUser> i
} }
@Override @Override
public Page<PvLvUser> getPvLvUserList(LvUserQueryParam lvUserQueryParam) { public Page<PvLvUserVO> getPvLvUserList(LvUserQueryParam lvUserQueryParam) {
Page<PvLvUser> page = new Page<>(PageFactory.getPageNum(lvUserQueryParam),PageFactory.getPageSize(lvUserQueryParam)); Page<PvLvUserVO> page = new Page<>(PageFactory.getPageNum(lvUserQueryParam),PageFactory.getPageSize(lvUserQueryParam));
return this.baseMapper.getPvLvUserList(page,lvUserQueryParam); return this.baseMapper.getPvLvUserList(page,lvUserQueryParam);
} }
@@ -76,8 +77,8 @@ public class PvLvUserServiceImpl extends ServiceImpl<PvLvUserMapper, PvLvUser> i
} }
@Override @Override
public boolean delPvLvUser(String id) { public boolean delPvLvUser(List<String> ids) {
return this.removeById(id); return this.removeByIds(ids);
} }

View File

@@ -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.param.pv.SubAreaQueryParam;
import com.njcn.device.pojo.po.pv.PvSubArea; import com.njcn.device.pojo.po.pv.PvSubArea;
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.mapper.PvSubAreaMapper;
import com.njcn.pvdevice.service.IPvSubAreaService; import com.njcn.pvdevice.service.IPvSubAreaService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -66,8 +67,8 @@ public class PvSubAreaServiceImpl extends ServiceImpl<PvSubAreaMapper, PvSubArea
} }
@Override @Override
public Page<PvSubArea> getPvSubAreaList(SubAreaQueryParam subsAreaQueryParam) { public Page<PvSubAreaVO> getPvSubAreaList(SubAreaQueryParam subsAreaQueryParam) {
Page<PvSubArea> page = new Page<>(PageFactory.getPageNum(subsAreaQueryParam),PageFactory.getPageSize(subsAreaQueryParam)); Page<PvSubAreaVO> page = new Page<>(PageFactory.getPageNum(subsAreaQueryParam),PageFactory.getPageSize(subsAreaQueryParam));
return this.baseMapper.getPvSubAreaList(page,subsAreaQueryParam); return this.baseMapper.getPvSubAreaList(page,subsAreaQueryParam);
} }
@@ -82,8 +83,8 @@ public class PvSubAreaServiceImpl extends ServiceImpl<PvSubAreaMapper, PvSubArea
} }
@Override @Override
public boolean delPvSubArea(String id) { public boolean delPvSubArea(List<String> ids) {
return this.removeById(id); return this.removeByIds(ids);
} }

View File

@@ -1,5 +1,6 @@
package com.njcn.pvdevice.service.impl; package com.njcn.pvdevice.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -30,6 +31,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
@@ -71,6 +73,11 @@ public class PvSubstationServiceImpl extends ServiceImpl<PvSubstationMapper, PvS
@Override @Override
public Page<PvSubstationVO> getPvSubstationList(SubstationQueryParam substationQueryParam) { public Page<PvSubstationVO> getPvSubstationList(SubstationQueryParam substationQueryParam) {
Page<PvSubstation> page = new Page<>(PageFactory.getPageNum(substationQueryParam),PageFactory.getPageSize(substationQueryParam)); Page<PvSubstation> page = new Page<>(PageFactory.getPageNum(substationQueryParam),PageFactory.getPageSize(substationQueryParam));
if(CollUtil.isNotEmpty(substationQueryParam.getUnitId())){
List<String> tem = deptFeignClient.getDepSonIdtByDeptId(substationQueryParam.getUnitId().get(0)).getData();
tem.add(substationQueryParam.getUnitId().get(0));
substationQueryParam.setUnitId(tem);
}
return this.baseMapper.getPvSubstationList(page,substationQueryParam); return this.baseMapper.getPvSubstationList(page,substationQueryParam);
} }
@@ -85,8 +92,8 @@ public class PvSubstationServiceImpl extends ServiceImpl<PvSubstationMapper, PvS
} }
@Override @Override
public boolean delPvSubstation(String id) { public boolean delPvSubstation(List<String> ids) {
return this.removeById(id); return this.removeByIds(ids);
} }
@@ -111,6 +118,21 @@ public class PvSubstationServiceImpl extends ServiceImpl<PvSubstationMapper, PvS
throw new BusinessException(PvDeviceResponseEnum.SUBSTATION_REPEAT); throw new BusinessException(PvDeviceResponseEnum.SUBSTATION_REPEAT);
} }
lambdaQueryWrapper.clear();
lambdaQueryWrapper.eq(PvSubstation::getSubCode, pvSubstationParam.getSubCode());
if (isUpdate) {
//更新操作
if (pvSubstationParam instanceof PvSubstationParam.UpdatePvSubstationParam) {
lambdaQueryWrapper.ne(PvSubstation::getId, ((PvSubstationParam.UpdatePvSubstationParam) pvSubstationParam).getId());
}
}
int countCode = this.count(lambdaQueryWrapper);
if (countCode > 0) {
throw new BusinessException(PvDeviceResponseEnum.SUBSTATION_CODE_REPEAT);
}
DictData dictData = dicDataFeignClient.getDicDataById(pvSubstationParam.getScale()).getData(); DictData dictData = dicDataFeignClient.getDicDataById(pvSubstationParam.getScale()).getData();
if(Objects.isNull(dictData)){ if(Objects.isNull(dictData)){
throw new BusinessException(SystemResponseEnum.VOLTAGE_EMPTY); throw new BusinessException(SystemResponseEnum.VOLTAGE_EMPTY);

View File

@@ -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.param.pv.TenVoltageQueryParam;
import com.njcn.device.pojo.po.pv.PvTenVoltage; import com.njcn.device.pojo.po.pv.PvTenVoltage;
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.mapper.PvTenVoltageMapper;
import com.njcn.pvdevice.service.IPvTenVoltageService; import com.njcn.pvdevice.service.IPvTenVoltageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -21,6 +22,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects; import java.util.Objects;
/** /**
@@ -56,19 +58,24 @@ public class PvTenVoltageServiceImpl extends ServiceImpl<PvTenVoltageMapper, PvT
} }
@Override @Override
public Page<PvTenVoltage> getPvTenVoltageList(TenVoltageQueryParam tenVoltageQueryParam) { public Page<PvTenVoltageVO> getPvTenVoltageList(TenVoltageQueryParam tenVoltageQueryParam) {
Page<PvTenVoltage> page = new Page<>(PageFactory.getPageNum(tenVoltageQueryParam),PageFactory.getPageSize(tenVoltageQueryParam)); Page<PvTenVoltageVO> page = new Page<>(PageFactory.getPageNum(tenVoltageQueryParam),PageFactory.getPageSize(tenVoltageQueryParam));
return this.baseMapper.getPvTenVoltageList(page,tenVoltageQueryParam); return this.baseMapper.getPvTenVoltageList(page,tenVoltageQueryParam);
} }
@Override
public List<PvTenVoltage> getAllPvTenVoltageList(){
return this.list();
}
@Override @Override
public PvTenVoltage getPvTenVoltageById(String id) { public PvTenVoltage getPvTenVoltageById(String id) {
return this.getById(id); return this.getById(id);
} }
@Override @Override
public boolean delPvTenVoltage(String id) { public boolean delPvTenVoltage(List<String> ids) {
return this.removeById(id); return this.removeByIds(ids);
} }

View File

@@ -3,27 +3,34 @@ package com.njcn.pvdevice.service.impl;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.exception.BusinessException; import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.device.enums.LineBaseEnum; 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.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.PvSubArea;
import com.njcn.device.pojo.po.pv.PvSubstation; 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.device.pojo.vo.pv.PvLineAllDetailVO;
import com.njcn.pvdevice.mapper.PvLineDetailMapper; import com.njcn.pvdevice.mapper.*;
import com.njcn.pvdevice.mapper.PvSubAreaMapper;
import com.njcn.pvdevice.mapper.PvSubstationMapper;
import com.njcn.pvdevice.service.*; import com.njcn.pvdevice.service.*;
import com.njcn.system.api.DicDataFeignClient; import com.njcn.system.api.DicDataFeignClient;
import com.njcn.user.api.DeptFeignClient; import com.njcn.user.api.DeptFeignClient;
import com.njcn.user.pojo.vo.PvTerminalTreeVO; import com.njcn.user.pojo.vo.PvTerminalTreeVO;
import com.njcn.web.factory.PageFactory; import com.njcn.web.factory.PageFactory;
import com.njcn.web.pojo.param.BaseParam; import com.njcn.web.pojo.param.BaseParam;
import io.swagger.models.auth.In;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream;
/** /**
* pqs * pqs
@@ -35,8 +42,6 @@ import java.util.stream.Collectors;
@RequiredArgsConstructor @RequiredArgsConstructor
public class PvTerminalBaseServiceImpl implements PvTerminalBaseService { public class PvTerminalBaseServiceImpl implements PvTerminalBaseService {
private final IPvUnitService iPvUnitService;
private final IPvSubstationService iPvSubstationService; private final IPvSubstationService iPvSubstationService;
private final IPvSubAreaService iPvSubAreaService; private final IPvSubAreaService iPvSubAreaService;
@@ -47,9 +52,9 @@ public class PvTerminalBaseServiceImpl implements PvTerminalBaseService {
private final PvSubAreaMapper pvSubAreaMapper; private final PvSubAreaMapper pvSubAreaMapper;
private final PvLineDetailMapper pvLineDetailMapper; private final PvLvUserMapper pvLvUserMapper;
private final DicDataFeignClient dicDataFeignClient; private final PvDistributedMapper pvDistributedMapper;
private final DeptFeignClient deptFeignClient; private final DeptFeignClient deptFeignClient;
@@ -65,39 +70,64 @@ public class PvTerminalBaseServiceImpl implements PvTerminalBaseService {
@Override @Override
public Page<PvLineAllDetailVO> lineDetailBySubId(PvTerminalBaseQuery pvTerminalBaseQuery) { public Page<PvLineAllDetailVO> lineDetailBySubId(PvTerminalBaseQuery pvTerminalBaseQuery) {
List<String> ids = pvTerminalBaseQuery.getId(); String id = pvTerminalBaseQuery.getId();
Integer level = pvTerminalBaseQuery.getLevel(); Integer level = pvTerminalBaseQuery.getLevel();
if(level.equals(LineBaseEnum.PV_UNIT_LEVEL.getCode())){ if(level.equals(LineBaseEnum.PV_UNIT_LEVEL.getCode())){
//点击的是单位节点 //点击的是单位节点
List<String> deptIds = deptFeignClient.getDepSonIdtByDeptId(id).getData();
if(CollUtil.isEmpty(deptIds)){
deptIds.add(id);
}
LambdaQueryWrapper<PvSubstation> subQuery= new LambdaQueryWrapper<>(); LambdaQueryWrapper<PvSubstation> subQuery= new LambdaQueryWrapper<>();
subQuery.in(PvSubstation::getUnitId,ids); subQuery.in(PvSubstation::getUnitId,deptIds);
List<PvSubstation> substationList = iPvSubstationService.list(subQuery); List<PvSubstation> substationList = iPvSubstationService.list(subQuery);
List<String> subIds = substationList.stream().map(PvSubstation::getId).collect(Collectors.toList()); List<String> subIds = substationList.stream().map(PvSubstation::getId).collect(Collectors.toList());
LambdaQueryWrapper<PvSubArea> areaQuery= new LambdaQueryWrapper<>(); LambdaQueryWrapper<PvSubArea> areaQuery= new LambdaQueryWrapper<>();
areaQuery.in(PvSubArea::getUnitId,ids); areaQuery.in(PvSubArea::getUnitId,deptIds);
List<PvSubArea> subAreaList = iPvSubAreaService.list(areaQuery); List<PvSubArea> subAreaList = iPvSubAreaService.list(areaQuery);
List<String> subAreaIds = subAreaList.stream().map(PvSubArea::getId).collect(Collectors.toList()); List<String> 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())){ }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())){ }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); throw new BusinessException(CommonResponseEnum.FAIL);
} }
@Override
public DisOrLvVO pvDisOrLv(String userCode, Integer userCodeType){
DisOrLvVO disOrLvVO = new DisOrLvVO();
if(userCodeType == 1){
//低压
LambdaQueryWrapper<PvLvUser> 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<PvTerminalTreeVO> unitTreeList,List<PvTerminalTreeVO> subTreeList,List<PvTerminalTreeVO> subAreaTreeList) { }else {
for (PvTerminalTreeVO unit : unitTreeList) { //分布式
if (CollUtil.isNotEmpty(unit.getChildren())) { LambdaQueryWrapper<PvDistributed> lambdaQueryWrapper = new LambdaQueryWrapper<>();
diGui(unit.getChildren(),subTreeList,subAreaTreeList); lambdaQueryWrapper.eq(PvDistributed::getUserCode,userCode).eq(PvDistributed::getState, DataStateEnum.ENABLE.getCode());
} else { PvDistributed pvDistributed = pvDistributedMapper.selectOne(lambdaQueryWrapper);
unit.setChildren(getChildren(unit, subTreeList)); if(Objects.nonNull(pvDistributed)){
unit.setChildren(getChildren(unit, subAreaTreeList)); BeanUtils.copyProperties(pvDistributed,disOrLvVO);
} }
} }
}*/ return disOrLvVO;
}
private List<PvTerminalTreeVO> getChildren(PvTerminalTreeVO tem, List<PvTerminalTreeVO> children) { private List<PvTerminalTreeVO> getChildren(PvTerminalTreeVO tem, List<PvTerminalTreeVO> children) {

View File

@@ -17,7 +17,7 @@ import java.util.stream.Stream;
* @version 1.0.0 * @version 1.0.0
* @date 2021年12月14日 12:55 * @date 2021年12月14日 12:55
*/ */
public class DeviceTest extends BaseJunitTest { public class PvDeviceTest extends BaseJunitTest {
@Autowired @Autowired
private DeptLineService deptLineService; private DeptLineService deptLineService;

View File

@@ -60,4 +60,11 @@ public interface DeptFeignClient {
@GetMapping("/getDeptById") @GetMapping("/getDeptById")
HttpResult<Dept> getDeptById(@RequestParam("deptId") String deptId); HttpResult<Dept> getDeptById(@RequestParam("deptId") String deptId);
/**
* 获取所有部门
*/
@GetMapping("/getDepSonIdtByDeptId")
HttpResult<List<String>> getDepSonIdtByDeptId(@RequestParam("deptId") String deptId);
} }

View File

@@ -69,6 +69,13 @@ public class DeptFeignClientFallbackFactory implements FallbackFactory<DeptFeign
log.error("{}异常,降级处理,异常为:{}","查询所部门异常",cause.toString()); log.error("{}异常,降级处理,异常为:{}","查询所部门异常",cause.toString());
throw new BusinessException(finalExceptionEnum); throw new BusinessException(finalExceptionEnum);
} }
@Override
public HttpResult<List<String>> getDepSonIdtByDeptId(String deptId) {
log.error("{}异常,降级处理,异常为:{}","查询所部门索引异常",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
}; };
} }
} }

View File

@@ -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<List<String>> getDepSonIdtByDeptId(@RequestParam("deptId")String deptId) {
String methodDescribe = getMethodDescribe("getDepSonIdtByDeptId");
List<String> deptList = deptService.getDepSonIdtByDeptId(deptId);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deptList, methodDescribe);
}
} }

View File

@@ -95,4 +95,11 @@ public interface DeptMapper extends BaseMapper<Dept> {
List<PvTerminalTreeVO> allDeptList(); List<PvTerminalTreeVO> allDeptList();
/**
* 根据部门id获取所有子部门id集合
* @author cdf
* @date 2022/7/26
*/
List<String> getDeptSonIds(@Param("deptId") String deptId);
} }

View File

@@ -155,9 +155,14 @@
</select> </select>
<select id="allDeptList" resultType="DeptAllTreeVO"> <select id="allDeptList" resultType="PvTerminalTreeVO">
select id,name,pid, 0 as level from sys_dept where type = 0 and state = 1 order by sort select id,name,pid, 0 as level from sys_dept where type = 0 and state = 1 order by sort
</select> </select>
<select id="getDeptSonIds" resultType="String">
select id from sys_dept where find_in_set(#{deptId},pids) and state = 1
</select>
</mapper> </mapper>

View File

@@ -147,4 +147,12 @@ public interface IDeptService extends IService<Dept> {
* @date 2022/7/13 * @date 2022/7/13
*/ */
Dept getDeptById(String id); Dept getDeptById(String id);
/**
* 根据部门id获取部门详情
* @author cdf
* @date 2022/7/13
*/
List<String> getDepSonIdtByDeptId(String id);
} }

View File

@@ -306,4 +306,13 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
deptVo.setChildren(getChildrens(deptVo, allDept)); deptVo.setChildren(getChildrens(deptVo, allDept));
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
/**
* 根据部门id获取部门详情
*/
@Override
public List<String> getDepSonIdtByDeptId(String id){
return this.baseMapper.getDeptSonIds(id);
}
} }