1.分布式光伏台账相关
This commit is contained in:
@@ -73,9 +73,9 @@ public interface PatternRegex {
|
|||||||
String DEPT_NAME_REGEX = "^[\\u4e00-\\u9fa5]{1,20}$";
|
String DEPT_NAME_REGEX = "^[\\u4e00-\\u9fa5]{1,20}$";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典名称包括中文、数字、字母、括号以及点号
|
* 字典名称包括中文、数字、字母、罗马数字、括号以及点号
|
||||||
*/
|
*/
|
||||||
String DIC_REGEX = "^[\\w\\u4E00-\\u9FA5()()_/、\\- ]+\\.?[\\w\\u4E00-\\u9FA5()()/]{0,125}$";
|
String DIC_REGEX = "^[\\w\\u4E00-\\u9FA5()()_/、\\- ]+\\.?[\\w\\u4E00-\\u9FA5()()I II III IV V /]{0,125}$";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 密码有效期(月)1-3月
|
* 密码有效期(月)1-3月
|
||||||
|
|||||||
@@ -24,7 +24,20 @@ public enum LineBaseEnum {
|
|||||||
DEVICE_LEVEL(4, "设备"),
|
DEVICE_LEVEL(4, "设备"),
|
||||||
SUB_V_LEVEL(5, "母线"),
|
SUB_V_LEVEL(5, "母线"),
|
||||||
LINE_LEVEL(6, "监测点"),
|
LINE_LEVEL(6, "监测点"),
|
||||||
INVALID_LEVEL(-1, "非法拓扑等级");
|
INVALID_LEVEL(-1, "非法拓扑等级"),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分布式光伏树层级
|
||||||
|
*/
|
||||||
|
PV_UNIT_LEVEL(0,"单位"),
|
||||||
|
PV_SUB_LEVEL(1,"变电站"),
|
||||||
|
PV_SUB_AREA_LEVEL(2,"台区")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
private final Integer code;
|
private final Integer code;
|
||||||
private final String message;
|
private final String message;
|
||||||
|
|||||||
@@ -20,16 +20,20 @@ public enum PvDeviceResponseEnum {
|
|||||||
VOLTAGE_REPEAT("A0352","母线名称重复"),
|
VOLTAGE_REPEAT("A0352","母线名称重复"),
|
||||||
SUB_AREA_REPEAT("A0353","台区名称重复"),
|
SUB_AREA_REPEAT("A0353","台区名称重复"),
|
||||||
SUB_NUM_REPEAT("A0354","母线号重复"),
|
SUB_NUM_REPEAT("A0354","母线号重复"),
|
||||||
|
DVE_CODE_REPEAT("A0355","终端编号重复"),
|
||||||
|
USER_CODE_REPEAT("A0356","用户编号重复"),
|
||||||
|
SUB_AREA_EMPTY("A0357","台区不能为空"),
|
||||||
|
|
||||||
|
|
||||||
TEN_VOLTAGE_NULL("A0360","未查询到指定10kV线路"),
|
TEN_VOLTAGE_NULL("A0360","未查询到指定10kV线路"),
|
||||||
UNIT_NULL("A0361","未查询到指定单位"),
|
UNIT_NULL("A0361","未查询到指定单位"),
|
||||||
SUB_AREA_NULL("A0362","未查询到指定台区"),
|
SUB_AREA_NULL("A0362","未查询到指定台区"),
|
||||||
DEV_NULL("A0363","未查询到指定终端")
|
DEV_NULL("A0363","未查询到指定终端"),
|
||||||
|
SUBSTATION_NULL("A0364","未查询到指定变电站"),
|
||||||
|
VOLTAGE_NULL("A0365","未查询到指定母线"),
|
||||||
|
DEV_NUM_NULL("A0366","当前装置监测点序号已存在"),
|
||||||
|
ONE_SUB_VOLTAGE_EMPTY("A0367","I类监测点变电站母线不可为空"),
|
||||||
|
TWO_SUB_VOLTAGE_EMPTY_MUST("A0368","II类监测点变电站母线必须为空"),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,14 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
|||||||
import com.njcn.common.pojo.constant.PatternRegex;
|
import com.njcn.common.pojo.constant.PatternRegex;
|
||||||
import com.njcn.db.bo.BaseEntity;
|
import com.njcn.db.bo.BaseEntity;
|
||||||
import com.njcn.web.constant.ValidMessage;
|
import com.njcn.web.constant.ValidMessage;
|
||||||
|
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.Pattern;
|
import javax.validation.constraints.Pattern;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@@ -27,197 +30,242 @@ public class PvLineDetailParam implements Serializable {
|
|||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "name",value = "监测点名称",required = true)
|
||||||
|
@NotBlank(message = "监测点名称不能为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点编号
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "code",value = "监测点编号",required = true)
|
||||||
|
@NotBlank(message = "监测点编号不能为空")
|
||||||
|
private String code;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所属终端
|
* 所属终端
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "",required = true)
|
@ApiModelProperty(name = "devId",value = "所属终端",required = true)
|
||||||
|
@NotBlank(message = "所属终端id不能为空")
|
||||||
|
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = "所属终端id违规")
|
||||||
private String devId;
|
private String devId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监测点类型(I类监测点、II类监测点、III类监测点),字典表
|
* 监测点类型(I类监测点、II类监测点、III类监测点),字典表
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "",required = true)
|
@ApiModelProperty(name = "type",value = "监测点类型(I类监测点、II类监测点、III类监测点),字典表",required = true)
|
||||||
|
@NotBlank(message = "监测点类型不能为空")
|
||||||
|
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = "监测点类型违规")
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所属变电站(I类监测点)
|
* 所属变电站(I类监测点)
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "",required = true)
|
@ApiModelProperty(name = "substationId",value = "所属变电站(I类监测点)")
|
||||||
private String substationId;
|
private String substationId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所属母线名称(I类监测点)
|
* 所属母线名称(I类监测点)
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@ApiModelProperty(name = "voltageId",value = "所属母线名称(I类监测点)")
|
||||||
private String voltageId;
|
private String voltageId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所属台区ID(II类监测点)
|
* 所属台区ID(II类监测点)
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@ApiModelProperty(name = "subAreaId",value = "所属台区ID(II类监测点)")
|
||||||
private String subAreaId;
|
private String subAreaId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所属分布式光伏台账(III类监测点)
|
* 用户编号
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@ApiModelProperty(name = "userCode",value = "用户编号")
|
||||||
private String distributedId;
|
@NotBlank(message = "用户编号不能为空")
|
||||||
|
private String userCode;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所属低压用户台账(III类监测点)
|
* 电压等级
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@ApiModelProperty(name = "scale",value = "电压等级")
|
||||||
private String lvUserId;
|
private String scale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 线路号(在同一台设备中的监测点号)
|
* 线路号(在同一台设备中的监测点号)
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@ApiModelProperty(name = "num",value = "线路号(在同一台设备中的监测点号)")
|
||||||
|
@NotNull(message = "线路号不可为空")
|
||||||
|
@Range(min = 1,max = 10,message = "线路号违规")
|
||||||
private Integer num;
|
private Integer num;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PT一次变比
|
* PT一次变比
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@NotNull(message = "PT一次变比不可为空")
|
||||||
|
@ApiModelProperty(name = "pt1",value = "PT一次变比")
|
||||||
private Float pt1;
|
private Float pt1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PT二次变比
|
* PT二次变比
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@NotNull(message = "PT二次变比不可为空")
|
||||||
|
@ApiModelProperty(name = "pt2",value = "PT二次变比")
|
||||||
private Float pt2;
|
private Float pt2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CT一次变比
|
* CT一次变比
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@NotNull(message = "CT一次变比不可为空")
|
||||||
|
@ApiModelProperty(name = "ct1",value = "CT一次变比")
|
||||||
private Float ct1;
|
private Float ct1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CT二次变比
|
* CT二次变比
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@NotNull(message = "CT二次变比不可为空")
|
||||||
|
@ApiModelProperty(name = "ct2",value = "CT二次变比")
|
||||||
private Float ct2;
|
private Float ct2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备容量
|
* 设备容量
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@NotNull(message = "设备容量不可为空")
|
||||||
|
@ApiModelProperty(name = "devCapacity",value = "设备容量")
|
||||||
private Float devCapacity;
|
private Float devCapacity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 短路容量
|
* 短路容量
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@NotNull(message = "短路容量不可为空")
|
||||||
|
@ApiModelProperty(name = "shortCapacity",value = "短路容量")
|
||||||
private Float shortCapacity;
|
private Float shortCapacity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 基准容量
|
* 基准容量
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@NotNull(message = "基准容量不可为空")
|
||||||
|
@ApiModelProperty(name = "standardCapacity",value = "基准容量")
|
||||||
private Float standardCapacity;
|
private Float standardCapacity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 协议容量
|
* 协议容量
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@NotNull(message = "协议容量不可为空")
|
||||||
|
@ApiModelProperty(name = "dealCapacity",value = "协议容量")
|
||||||
private Float dealCapacity;
|
private Float dealCapacity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 接线类型(0:星型接法;1:三角型接法;2:开口三角型接法)
|
* 接线类型(0:星型接法;1:三角型接法;2:开口三角型接法)
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@NotNull(message = "接线类型不可为空")
|
||||||
|
@ApiModelProperty(name = "ptType",value = "接线类型(0:星型接法;1:三角型接法;2:开口三角型接法)")
|
||||||
|
@Range(min = 0,max = 2,message = "接线类型违规")
|
||||||
private Integer ptType;
|
private Integer ptType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 测量间隔(1-10分钟)
|
* 测量间隔(1-10分钟)
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@NotNull(message = "测量间隔不可为空")
|
||||||
|
@ApiModelProperty(name = "timeInterval",value = "测量间隔(1-10分钟)")
|
||||||
|
@Range(min = 1,max = 10,message = "测量间隔(1-10分钟)")
|
||||||
private Integer timeInterval;
|
private Integer timeInterval;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 干扰源类型,字典表
|
* 干扰源类型,字典表
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@NotNull(message = "干扰源类型不可为空")
|
||||||
|
@ApiModelProperty(name = "loadType",value = "干扰源类型,字典表")
|
||||||
|
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = "干扰源类型id违规")
|
||||||
private String loadType;
|
private String loadType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 行业类型,字典表
|
* 行业类型,字典表
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@NotNull(message = "行业类型不可为空")
|
||||||
|
@ApiModelProperty(name = "businessType",value = "行业类型,字典表")
|
||||||
|
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = "行业类型id违规")
|
||||||
private String businessType;
|
private String businessType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 网公司谐波监测平台标志(0-否;1-是),默认否
|
* 网公司谐波监测平台标志(0-否;1-是),默认否
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@NotNull(message = "网公司谐波监测平台标志不可为空")
|
||||||
|
@ApiModelProperty(name = "monitorFlag",value = "网公司谐波监测平台标志(0-否;1-是),默认否")
|
||||||
|
@Range(min = 0,max = 1,message = "网公司谐波监测平台标志违规")
|
||||||
private Integer monitorFlag;
|
private Integer monitorFlag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电网标志(0-电网侧;1-非电网侧)
|
* 电网标志(0-电网侧;1-非电网侧)
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@NotNull(message = "电网标志不可为空")
|
||||||
|
@ApiModelProperty(name = "powerFlag",value = "电网标志(0-电网侧;1-非电网侧)")
|
||||||
|
@Range(min = 0,max = 1,message = "电网标志违规")
|
||||||
private Integer powerFlag;
|
private Integer powerFlag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国网谐波监测平台监测点号
|
* 国网谐波监测平台监测点号
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@ApiModelProperty(name = "monitorId",value = "国网谐波监测平台监测点号")
|
||||||
private String monitorId;
|
private String monitorId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监测点对象名称
|
* 监测点对象名称
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@ApiModelProperty(name = "objName",value = "监测点对象名称")
|
||||||
private String objName;
|
private String objName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 人为干预是否参与统计(0:不参与,1:参与)默认参与统计
|
* 人为干预是否参与统计(0:不参与,1:参与)默认参与统计
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@NotNull(message = "人为干预是否参与统计标志不可为空")
|
||||||
private Integer statFlag;
|
@ApiModelProperty(name = "statFlag",value = "人为干预是否参与统计(0:不参与,1:参与)默认参与统计")
|
||||||
|
@Range(min = 0,max = 1,message = "为干预是否参与统计违规")
|
||||||
|
private Integer statFlag = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@ApiModelProperty(name = "remark",value = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电压互感器类型,字典表
|
* 电压互感器类型,字典表
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@ApiModelProperty(name = "tfType",value = "电压互感器类型,字典表")
|
||||||
private String tfType;
|
private String tfType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所属变压器编号
|
* 所属变压器编号
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@ApiModelProperty(name = "tfCode",value = "所属变压器编号")
|
||||||
private String tfCode;
|
private String tfCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 中性点接地方式,字典表
|
* 中性点接地方式,字典表
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@ApiModelProperty(name = "groundType",value = "中性点接地方式,字典表")
|
||||||
private String groundType;
|
private String groundType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 投运日期
|
* 投运日期
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@ApiModelProperty(name = "putIn",value = "投运日期")
|
||||||
|
@DateTimeStrValid(message = "投运日期格式有误")
|
||||||
private String putIn;
|
private String putIn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 接入日期
|
* 接入日期
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@ApiModelProperty(name = "access",value = "接入日期")
|
||||||
|
@DateTimeStrValid(message = "接入日期格式有误")
|
||||||
private String access;
|
private String access;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否专项供电(0:否,1:是)默认参与统计
|
* 是否专项供电(0:否,1:是)默认参与统计
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "",value = "")
|
@ApiModelProperty(name = "powerSupply",value = "是否专项供电(0:否,1:是)默认参与统计")
|
||||||
private Integer powerSupply;
|
private Integer powerSupply;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.njcn.device.pojo.param.pv;
|
||||||
|
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/12
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class PvTerminalBaseQuery extends BaseParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "id",value = "单位变电站台区索引",required = true)
|
||||||
|
@NotEmpty(message = "单位变电站台区索引不能为空")
|
||||||
|
private List<String> id;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "level",value = "0.单位 1.变电站 2.台区",required = true)
|
||||||
|
@NotNull(message = "树层级不可为空")
|
||||||
|
private Integer level;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "type",value = "字典类型 I II III类监测点类型id")
|
||||||
|
private Integer type;
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ package com.njcn.device.pojo.po.pv;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
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 lombok.Data;
|
import lombok.Data;
|
||||||
@@ -30,6 +31,10 @@ public class PvLineDetail extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private String code;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所属终端
|
* 所属终端
|
||||||
*/
|
*/
|
||||||
@@ -55,15 +60,12 @@ public class PvLineDetail extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String subAreaId;
|
private String subAreaId;
|
||||||
|
|
||||||
/**
|
private String userCode;
|
||||||
* 所属分布式光伏台账(III类监测点)
|
|
||||||
*/
|
|
||||||
private String distributedId;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所属低压用户台账(III类监测点)
|
* 电压等级
|
||||||
*/
|
*/
|
||||||
private String lvUserId;
|
private String scale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 线路号(在同一台设备中的监测点号)
|
* 线路号(在同一台设备中的监测点号)
|
||||||
@@ -178,12 +180,12 @@ public class PvLineDetail extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 投运日期
|
* 投运日期
|
||||||
*/
|
*/
|
||||||
private LocalDateTime putIn;
|
private LocalDate putIn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 接入日期
|
* 接入日期
|
||||||
*/
|
*/
|
||||||
private LocalDateTime access;
|
private LocalDate access;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否专项供电(0:否,1:是)默认参与统计
|
* 是否专项供电(0:否,1:是)默认参与统计
|
||||||
|
|||||||
@@ -0,0 +1,203 @@
|
|||||||
|
package com.njcn.device.pojo.vo.pv;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/12
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PvLineAllDetailVO {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点序号
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属终端
|
||||||
|
*/
|
||||||
|
private String devName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点类型(I类监测点、II类监测点、III类监测点),字典表
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属变电站(I类监测点)
|
||||||
|
*/
|
||||||
|
private String substationName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属母线名称(I类监测点)
|
||||||
|
*/
|
||||||
|
private String voltageName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属台区ID(II类监测点)
|
||||||
|
*/
|
||||||
|
private String subAreaName;
|
||||||
|
|
||||||
|
private String userCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分布式光伏名称
|
||||||
|
*/
|
||||||
|
private String distributeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 低压用户名称
|
||||||
|
*/
|
||||||
|
private String lvUserName;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压等级
|
||||||
|
*/
|
||||||
|
private String scale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 线路号(在同一台设备中的监测点号)
|
||||||
|
*/
|
||||||
|
private Integer num;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PT一次变比
|
||||||
|
*/
|
||||||
|
private Float pt1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PT二次变比
|
||||||
|
*/
|
||||||
|
private Float pt2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CT一次变比
|
||||||
|
*/
|
||||||
|
private Float ct1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CT二次变比
|
||||||
|
*/
|
||||||
|
private Float ct2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备容量
|
||||||
|
*/
|
||||||
|
private Float devCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 短路容量
|
||||||
|
*/
|
||||||
|
private Float shortCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基准容量
|
||||||
|
*/
|
||||||
|
private Float standardCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 协议容量
|
||||||
|
*/
|
||||||
|
private Float dealCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接线类型(0:星型接法;1:三角型接法;2:开口三角型接法)
|
||||||
|
*/
|
||||||
|
private Integer ptType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测量间隔(1-10分钟)
|
||||||
|
*/
|
||||||
|
private Integer timeInterval;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 干扰源类型,字典表
|
||||||
|
*/
|
||||||
|
private String loadType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行业类型,字典表
|
||||||
|
*/
|
||||||
|
private String businessType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网公司谐波监测平台标志(0-否;1-是),默认否
|
||||||
|
*/
|
||||||
|
private Integer monitorFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电网标志(0-电网侧;1-非电网侧)
|
||||||
|
*/
|
||||||
|
private Integer powerFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国网谐波监测平台监测点号
|
||||||
|
*/
|
||||||
|
private String monitorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点对象名称
|
||||||
|
*/
|
||||||
|
private String objName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人为干预是否参与统计(0:不参与,1:参与)默认参与统计
|
||||||
|
*/
|
||||||
|
private Integer statFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压互感器类型,字典表
|
||||||
|
*/
|
||||||
|
private String tfType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属变压器编号
|
||||||
|
*/
|
||||||
|
private String tfCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 中性点接地方式,字典表
|
||||||
|
*/
|
||||||
|
private String groundType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 投运日期
|
||||||
|
*/
|
||||||
|
private LocalDate putIn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接入日期
|
||||||
|
*/
|
||||||
|
private LocalDate access;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否专项供电(0:否,1:是)默认参与统计
|
||||||
|
*/
|
||||||
|
private Integer powerSupply;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private Integer state;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
package com.njcn.pvdevice.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.device.pojo.param.pv.PvTerminalBaseQuery;
|
||||||
|
import com.njcn.device.pojo.vo.pv.PvLineAllDetailVO;
|
||||||
|
import com.njcn.pvdevice.service.PvTerminalBaseService;
|
||||||
|
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
* 台账相关控制
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/11
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pvTerminalBase")
|
||||||
|
@Api(tags = "pv终端相关基础管理")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PvTerminalBaseController extends BaseController {
|
||||||
|
|
||||||
|
private final PvTerminalBaseService pvTerminalBaseService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取终端台账树
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/11
|
||||||
|
*/
|
||||||
|
@GetMapping("pvTree")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("获取终端台账树")
|
||||||
|
public HttpResult<List<PvTerminalTreeVO>> pvTerminalTree() {
|
||||||
|
String methodDescribe = getMethodDescribe("pvTerminalTree");
|
||||||
|
List<PvTerminalTreeVO> tree = pvTerminalBaseService.pvTerminalTree();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, tree, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点击变电站台区展示监测点详情
|
||||||
|
* @param pvTerminalBaseQuery 传参
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/11
|
||||||
|
*/
|
||||||
|
@PostMapping("pvLineDetail")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("点击树节点获取监测点详情")
|
||||||
|
@ApiImplicitParam(name = "pvTerminalBaseQuery",value = "参数",required = true)
|
||||||
|
public HttpResult<Page<PvLineAllDetailVO>> lineDetailBySubId(@RequestBody @Validated PvTerminalBaseQuery pvTerminalBaseQuery) {
|
||||||
|
String methodDescribe = getMethodDescribe("lineDetailBySubId");
|
||||||
|
Page<PvLineAllDetailVO> all = pvTerminalBaseService.lineDetailBySubId(pvTerminalBaseQuery);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, all, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,7 +1,12 @@
|
|||||||
package com.njcn.pvdevice.mapper;
|
package com.njcn.pvdevice.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.device.pojo.po.pv.PvLineDetail;
|
import com.njcn.device.pojo.po.pv.PvLineDetail;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.device.pojo.vo.pv.PvLineAllDetailVO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -13,4 +18,16 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||||||
*/
|
*/
|
||||||
public interface PvLineDetailMapper extends BaseMapper<PvLineDetail> {
|
public interface PvLineDetailMapper extends BaseMapper<PvLineDetail> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询监测点
|
||||||
|
* @param subIds 变电站ids
|
||||||
|
* @param subAreaIds 台区ids
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return Page<PvLineDetail>
|
||||||
|
*/
|
||||||
|
Page<PvLineAllDetailVO> getPvLineAllDetailMain(Page<PvLineAllDetailVO> page,@Param("subIds") List<String> subIds, @Param("subAreaIds")List<String> subAreaIds);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,11 @@ 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.user.pojo.vo.PvTerminalTreeVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* Mapper 接口
|
* Mapper 接口
|
||||||
@@ -24,4 +27,10 @@ public interface PvSubAreaMapper extends BaseMapper<PvSubArea> {
|
|||||||
*/
|
*/
|
||||||
Page<PvSubArea> getPvSubAreaList(Page<PvSubArea> page,@Param("subsAreaQueryParam") SubAreaQueryParam subsAreaQueryParam);
|
Page<PvSubArea> getPvSubAreaList(Page<PvSubArea> page,@Param("subsAreaQueryParam") SubAreaQueryParam subsAreaQueryParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有台区
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/11
|
||||||
|
*/
|
||||||
|
List<PvTerminalTreeVO> getSubAreaTreeList();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.njcn.device.pojo.param.pv.SubstationQueryParam;
|
import com.njcn.device.pojo.param.pv.SubstationQueryParam;
|
||||||
import com.njcn.device.pojo.po.pv.PvSubstation;
|
import com.njcn.device.pojo.po.pv.PvSubstation;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* Mapper 接口
|
* Mapper 接口
|
||||||
@@ -18,4 +21,10 @@ public interface PvSubstationMapper extends BaseMapper<PvSubstation> {
|
|||||||
|
|
||||||
Page<PvSubstation> getPvSubstationList(Page<PvSubstation> page,@Param("substationQueryParam") SubstationQueryParam substationQueryParam);
|
Page<PvSubstation> getPvSubstationList(Page<PvSubstation> page,@Param("substationQueryParam") SubstationQueryParam substationQueryParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终端树结构的变电站
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/11
|
||||||
|
*/
|
||||||
|
List<PvTerminalTreeVO> getSubstationTreeList();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package com.njcn.pvdevice.mapper;
|
|||||||
import com.njcn.device.pojo.po.pv.PvUnit;
|
import com.njcn.device.pojo.po.pv.PvUnit;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.njcn.device.pojo.vo.pv.UnitTreeVO;
|
import com.njcn.device.pojo.vo.pv.UnitTreeVO;
|
||||||
import com.njcn.web.pojo.param.BaseParam;
|
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -25,4 +25,8 @@ public interface PvUnitMapper extends BaseMapper<PvUnit> {
|
|||||||
*/
|
*/
|
||||||
List<UnitTreeVO> getPvUnitList(@Param("orderBy")String orderBy,@Param("sortBy")String sortBy);
|
List<UnitTreeVO> getPvUnitList(@Param("orderBy")String orderBy,@Param("sortBy")String sortBy);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,132 @@
|
|||||||
<!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.PvLineDetailMapper">
|
<mapper namespace="com.njcn.pvdevice.mapper.PvLineDetailMapper">
|
||||||
|
|
||||||
|
<select id="getPvLineAllDetailMain" resultType="PvLineAllDetailVO">
|
||||||
|
|
||||||
|
<if test="subIds!=null and subIds.size!=0">
|
||||||
|
SELECT
|
||||||
|
line.id,
|
||||||
|
line.NAME,
|
||||||
|
line.CODE,
|
||||||
|
dev.Dev_Code devName,
|
||||||
|
dic.NAME type,
|
||||||
|
dic1.NAME scale,
|
||||||
|
sub.NAME substationName,
|
||||||
|
v.NAME voltageName,
|
||||||
|
subArea.NAME subAreaName,
|
||||||
|
dis.NAME distributeName,
|
||||||
|
lv.NAME lvUserName,
|
||||||
|
line.num,
|
||||||
|
line.pt1,
|
||||||
|
line.pt2,
|
||||||
|
line.ct1,
|
||||||
|
line.ct2,
|
||||||
|
line.dev_capacity,
|
||||||
|
line.short_capacity,
|
||||||
|
line.standard_capacity,
|
||||||
|
line.deal_capacity,
|
||||||
|
line.pt_Type,
|
||||||
|
line.time_Interval,
|
||||||
|
dic2.NAME loadType,
|
||||||
|
dic3.NAME businessType,
|
||||||
|
line.Monitor_Flag,
|
||||||
|
line.Power_Flag,
|
||||||
|
line.Monitor_Id,
|
||||||
|
line.Obj_Name,
|
||||||
|
line.Stat_flag,
|
||||||
|
line.Remark,
|
||||||
|
line.Tf_Type,
|
||||||
|
line.Tf_Code,
|
||||||
|
line.Ground_Type,
|
||||||
|
line.Put_In,
|
||||||
|
line.Access,
|
||||||
|
line.Power_Supply
|
||||||
|
FROM
|
||||||
|
pv_line_detail line
|
||||||
|
LEFT JOIN pv_device dev ON line.dev_id = dev.id
|
||||||
|
LEFT JOIN sys_dict_data dic ON line.type = dic.id
|
||||||
|
LEFT JOIN sys_dict_data dic1 ON line.scale = dic1.id
|
||||||
|
LEFT JOIN pv_substation sub ON line.Substation_Id = sub.id
|
||||||
|
LEFT JOIN pv_voltage v ON line.voltage_id = v.id
|
||||||
|
LEFT JOIN pv_sub_area subArea ON line.sub_area_id = subArea.id
|
||||||
|
LEFT JOIN Pv_Distributed dis ON line.user_code = dis.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 dic3 ON line.Business_Type = dic3.id
|
||||||
|
where line.state = 1
|
||||||
|
<if test="subIds!=null and subIds.size!=0">
|
||||||
|
and line.Substation_Id in
|
||||||
|
<foreach collection="subIds" item="item" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="subIds!=null and subIds.size!=0 and subAreaIds!=null and subAreaIds.size!=0">
|
||||||
|
UNION ALL
|
||||||
|
</if>
|
||||||
|
|
||||||
|
|
||||||
|
<if test="subAreaIds!=null and subAreaIds.size!=0">
|
||||||
|
SELECT
|
||||||
|
line.id,
|
||||||
|
line.NAME,
|
||||||
|
line.CODE,
|
||||||
|
dev.Dev_Code devName,
|
||||||
|
dic.NAME type,
|
||||||
|
dic1.NAME scale,
|
||||||
|
sub.NAME substationName,
|
||||||
|
v.NAME voltageName,
|
||||||
|
subArea.NAME subAreaName,
|
||||||
|
dis.NAME distributeName,
|
||||||
|
lv.NAME lvUserName,
|
||||||
|
line.num,
|
||||||
|
line.pt1,
|
||||||
|
line.pt2,
|
||||||
|
line.ct1,
|
||||||
|
line.ct2,
|
||||||
|
line.dev_capacity,
|
||||||
|
line.short_capacity,
|
||||||
|
line.standard_capacity,
|
||||||
|
line.deal_capacity,
|
||||||
|
line.pt_Type,
|
||||||
|
line.time_Interval,
|
||||||
|
dic2.NAME loadType,
|
||||||
|
dic3.NAME businessType,
|
||||||
|
line.Monitor_Flag,
|
||||||
|
line.Power_Flag,
|
||||||
|
line.Monitor_Id,
|
||||||
|
line.Obj_Name,
|
||||||
|
line.Stat_flag,
|
||||||
|
line.Remark,
|
||||||
|
line.Tf_Type,
|
||||||
|
line.Tf_Code,
|
||||||
|
line.Ground_Type,
|
||||||
|
line.Put_In,
|
||||||
|
line.Access,
|
||||||
|
line.Power_Supply
|
||||||
|
FROM
|
||||||
|
pv_line_detail line
|
||||||
|
LEFT JOIN pv_device dev ON line.dev_id = dev.id
|
||||||
|
LEFT JOIN sys_dict_data dic ON line.type = dic.id
|
||||||
|
LEFT JOIN sys_dict_data dic1 ON line.scale = dic1.id
|
||||||
|
LEFT JOIN pv_substation sub ON line.Substation_Id = sub.id
|
||||||
|
LEFT JOIN pv_voltage v ON line.voltage_id = v.id
|
||||||
|
LEFT JOIN pv_sub_area subArea ON line.sub_area_id = subArea.id
|
||||||
|
LEFT JOIN Pv_Distributed dis ON line.user_code = dis.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 dic3 ON line.Business_Type = dic3.id
|
||||||
|
where line.state = 1
|
||||||
|
<if test="subAreaIds!=null and subAreaIds.size!=0">
|
||||||
|
and line.Sub_Area_Id in
|
||||||
|
<foreach collection="subAreaIds" item="item" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -46,4 +46,9 @@
|
|||||||
</where>
|
</where>
|
||||||
order by ten.create_time asc
|
order by ten.create_time asc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<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>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -36,4 +36,9 @@
|
|||||||
</where>
|
</where>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getSubstationTreeList" resultType="com.njcn.user.pojo.vo.PvTerminalTreeVO">
|
||||||
|
select id,unit_id pid,name,1 as level from pv_substation
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -9,4 +9,7 @@
|
|||||||
order by concat(#{sortBy},' ',#{orderBy})
|
order by concat(#{sortBy},' ',#{orderBy})
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.njcn.device.pojo.param.pv.PvLineDetailParam;
|
|||||||
import com.njcn.device.pojo.po.pv.PvLineDetail;
|
import com.njcn.device.pojo.po.pv.PvLineDetail;
|
||||||
import com.njcn.device.pojo.po.pv.PvLineDetail;
|
import com.njcn.device.pojo.po.pv.PvLineDetail;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.device.pojo.vo.pv.PvLineAllDetailVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -69,4 +70,17 @@ public interface IPvLineDetailService extends IService<PvLineDetail> {
|
|||||||
*/
|
*/
|
||||||
boolean delPvLineDetail(String id);
|
boolean delPvLineDetail(String id);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询监测点
|
||||||
|
* @param subIds 变电站ids
|
||||||
|
* @param subAreaIds 台区ids
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return Page<PvLineDetail>
|
||||||
|
*/
|
||||||
|
Page<PvLineAllDetailVO> getPvLineAllDetailMain(Integer pageNum,Integer pageSize,List<String> subIds, List<String> subAreaIds);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.njcn.device.pojo.param.pv.PvUnitParam;
|
|||||||
import com.njcn.device.pojo.po.pv.PvUnit;
|
import com.njcn.device.pojo.po.pv.PvUnit;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.njcn.device.pojo.vo.pv.UnitTreeVO;
|
import com.njcn.device.pojo.vo.pv.UnitTreeVO;
|
||||||
|
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||||
import com.njcn.web.pojo.param.BaseParam;
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -38,7 +39,7 @@ public interface IPvUnitService extends IService<PvUnit> {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询单位
|
* 查询树形结构单位
|
||||||
* @param baseParam 单位实体
|
* @param baseParam 单位实体
|
||||||
* @author cdf
|
* @author cdf
|
||||||
* @date 2022/7/5
|
* @date 2022/7/5
|
||||||
@@ -47,6 +48,8 @@ public interface IPvUnitService extends IService<PvUnit> {
|
|||||||
List<UnitTreeVO> getPvUnitList(BaseParam baseParam);
|
List<UnitTreeVO> getPvUnitList(BaseParam baseParam);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据单位id查询单位
|
* 根据单位id查询单位
|
||||||
* @param id 单位id
|
* @param id 单位id
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.njcn.pvdevice.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.device.pojo.param.pv.PvTerminalBaseQuery;
|
||||||
|
import com.njcn.device.pojo.vo.pv.PvLineAllDetailVO;
|
||||||
|
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/11
|
||||||
|
*/
|
||||||
|
public interface PvTerminalBaseService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取设备树
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/11
|
||||||
|
*/
|
||||||
|
List<PvTerminalTreeVO> pvTerminalTree();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点击变电站台区展示监测点详情
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/11
|
||||||
|
*/
|
||||||
|
Page<PvLineAllDetailVO> lineDetailBySubId(PvTerminalBaseQuery pvTerminalBaseQuery);
|
||||||
|
}
|
||||||
@@ -42,7 +42,6 @@ public class PvDeviceServiceImpl extends ServiceImpl<PvDeviceMapper, PvDevice> i
|
|||||||
@Override
|
@Override
|
||||||
public boolean addDevice(PvDeviceParam pvDeviceParam) {
|
public boolean addDevice(PvDeviceParam pvDeviceParam) {
|
||||||
checkNameAndParam(pvDeviceParam, false);
|
checkNameAndParam(pvDeviceParam, false);
|
||||||
|
|
||||||
PvDevice pvDevice = new PvDevice();
|
PvDevice pvDevice = new PvDevice();
|
||||||
BeanUtils.copyProperties(pvDeviceParam, pvDevice);
|
BeanUtils.copyProperties(pvDeviceParam, pvDevice);
|
||||||
pvDevice.setState(DataStateEnum.ENABLE.getCode());
|
pvDevice.setState(DataStateEnum.ENABLE.getCode());
|
||||||
@@ -54,7 +53,6 @@ public class PvDeviceServiceImpl extends ServiceImpl<PvDeviceMapper, PvDevice> i
|
|||||||
@Override
|
@Override
|
||||||
public boolean updateDevice(PvDeviceParam.UpdatePvDeviceParam updatePvDeviceParam) {
|
public boolean updateDevice(PvDeviceParam.UpdatePvDeviceParam updatePvDeviceParam) {
|
||||||
checkNameAndParam(updatePvDeviceParam, true);
|
checkNameAndParam(updatePvDeviceParam, true);
|
||||||
|
|
||||||
PvDevice pvDevice = new PvDevice();
|
PvDevice pvDevice = new PvDevice();
|
||||||
BeanUtils.copyProperties(updatePvDeviceParam, pvDevice);
|
BeanUtils.copyProperties(updatePvDeviceParam, pvDevice);
|
||||||
pvDevice.setState(DataStateEnum.ENABLE.getCode());
|
pvDevice.setState(DataStateEnum.ENABLE.getCode());
|
||||||
@@ -99,20 +97,24 @@ public class PvDeviceServiceImpl extends ServiceImpl<PvDeviceMapper, PvDevice> i
|
|||||||
}
|
}
|
||||||
int count = this.count(lambdaQueryWrapper);
|
int count = this.count(lambdaQueryWrapper);
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
throw new BusinessException(PvDeviceResponseEnum.SUB_AREA_REPEAT);
|
throw new BusinessException(PvDeviceResponseEnum.DVE_CODE_REPEAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*校验终端类型*/
|
||||||
|
if (Objects.isNull(dicDataFeignClient.getDicDataById(pvDeviceParam.getType()).getData())) {
|
||||||
|
throw new BusinessException(SystemResponseEnum.DEV_VARIETY);
|
||||||
|
}
|
||||||
|
|
||||||
/*校验设备型号*/
|
/*校验设备型号*/
|
||||||
if (StrUtil.isNotBlank(pvDeviceParam.getDevType())) {
|
if (StrUtil.isNotBlank(pvDeviceParam.getDevType())) {
|
||||||
if (Objects.isNull(dicDataFeignClient.getDicDataById(pvDeviceParam.getDevType()))) {
|
if (Objects.isNull(dicDataFeignClient.getDicDataById(pvDeviceParam.getDevType()).getData())) {
|
||||||
throw new BusinessException(SystemResponseEnum.DEV_TYPE_EMPTY);
|
throw new BusinessException(SystemResponseEnum.DEV_TYPE_EMPTY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*校验生产厂家*/
|
/*校验生产厂家*/
|
||||||
|
|
||||||
if (Objects.isNull(dicDataFeignClient.getDicDataById(pvDeviceParam.getManufacturer()))) {
|
if (Objects.isNull(dicDataFeignClient.getDicDataById(pvDeviceParam.getManufacturer()).getData())) {
|
||||||
throw new BusinessException(SystemResponseEnum.MANUFACTURER);
|
throw new BusinessException(SystemResponseEnum.MANUFACTURER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ public class PvDistributedServiceImpl extends ServiceImpl<PvDistributedMapper, P
|
|||||||
private void checkNameAndParam(PvDistributedParam pvDistributedParam, boolean isUpdate) {
|
private void checkNameAndParam(PvDistributedParam pvDistributedParam, boolean isUpdate) {
|
||||||
|
|
||||||
if(StrUtil.isNotBlank(pvDistributedParam.getScale())) {
|
if(StrUtil.isNotBlank(pvDistributedParam.getScale())) {
|
||||||
if (Objects.isNull(dicDataFeignClient.getDicDataById(pvDistributedParam.getScale()))) {
|
if (Objects.isNull(dicDataFeignClient.getDicDataById(pvDistributedParam.getScale()).getData())) {
|
||||||
throw new BusinessException(SystemResponseEnum.VOLTAGE_EMPTY);
|
throw new BusinessException(SystemResponseEnum.VOLTAGE_EMPTY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -104,6 +104,19 @@ public class PvDistributedServiceImpl extends ServiceImpl<PvDistributedMapper, P
|
|||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
throw new BusinessException(PvDeviceResponseEnum.SUB_AREA_REPEAT);
|
throw new BusinessException(PvDeviceResponseEnum.SUB_AREA_REPEAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lambdaQueryWrapper.clear();
|
||||||
|
lambdaQueryWrapper.eq(PvDistributed::getUserCode, pvDistributedParam.getUserCode());
|
||||||
|
if (isUpdate) {
|
||||||
|
//更新操作
|
||||||
|
if (pvDistributedParam instanceof PvDistributedParam.UpdatePvDistributedParam) {
|
||||||
|
lambdaQueryWrapper.eq(PvDistributed::getId, ((PvDistributedParam.UpdatePvDistributedParam) pvDistributedParam).getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int countUserCode = this.count(lambdaQueryWrapper);
|
||||||
|
if (countUserCode > 0) {
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.USER_CODE_REPEAT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,25 @@
|
|||||||
package com.njcn.pvdevice.service.impl;
|
package com.njcn.pvdevice.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
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.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.common.utils.PubUtils;
|
||||||
import com.njcn.device.enums.PvDeviceResponseEnum;
|
import com.njcn.device.enums.PvDeviceResponseEnum;
|
||||||
import com.njcn.device.pojo.param.pv.LineDetailQueryParam;
|
import com.njcn.device.pojo.param.pv.LineDetailQueryParam;
|
||||||
import com.njcn.device.pojo.param.pv.PvLineDetailParam;
|
import com.njcn.device.pojo.param.pv.PvLineDetailParam;
|
||||||
import com.njcn.device.pojo.po.pv.PvLineDetail;
|
import com.njcn.device.pojo.po.pv.PvLineDetail;
|
||||||
import com.njcn.device.pojo.po.pv.PvLineDetail;
|
import com.njcn.device.pojo.po.pv.PvLineDetail;
|
||||||
|
import com.njcn.device.pojo.vo.pv.PvLineAllDetailVO;
|
||||||
import com.njcn.pvdevice.mapper.PvLineDetailMapper;
|
import com.njcn.pvdevice.mapper.PvLineDetailMapper;
|
||||||
import com.njcn.pvdevice.service.IPvDeviceService;
|
import com.njcn.pvdevice.service.*;
|
||||||
import com.njcn.pvdevice.service.IPvLineDetailService;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
|
import com.njcn.system.enums.DicDataEnum;
|
||||||
import com.njcn.system.enums.SystemResponseEnum;
|
import com.njcn.system.enums.SystemResponseEnum;
|
||||||
|
import com.njcn.system.pojo.po.DictData;
|
||||||
|
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.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
@@ -38,30 +44,74 @@ public class PvLineDetailServiceImpl extends ServiceImpl<PvLineDetailMapper, PvL
|
|||||||
|
|
||||||
private final IPvDeviceService iPvDeviceService;
|
private final IPvDeviceService iPvDeviceService;
|
||||||
|
|
||||||
|
private final IPvSubstationService iPvSubstationService;
|
||||||
|
|
||||||
|
private final IPvVoltageService iPvVoltageService;
|
||||||
|
|
||||||
|
private final IPvSubAreaService iPvSubAreaService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean addLineDetail(PvLineDetailParam pvLineDetailParam) {
|
public boolean addLineDetail(PvLineDetailParam pvLineDetailParam) {
|
||||||
checkName(pvLineDetailParam,false);
|
checkNameAndParam(pvLineDetailParam);
|
||||||
checkParam(pvLineDetailParam);
|
//判断同一台装置是否出现监测点序号重复或超过x路序号
|
||||||
PvLineDetail pvLineDetail = new PvLineDetail();
|
lineNumIsExit(pvLineDetailParam,false);
|
||||||
BeanUtils.copyProperties(pvLineDetailParam,pvLineDetail);
|
PvLineDetail pvLineDetail = commMonit(pvLineDetailParam);
|
||||||
return this.save(pvLineDetail);
|
return this.save(pvLineDetail);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean updateLineDetail(PvLineDetailParam.UpdatePvLineDetailParam updatePvLineDetailParam) {
|
public boolean updateLineDetail(PvLineDetailParam.UpdatePvLineDetailParam updatePvLineDetailParam) {
|
||||||
checkName(updatePvLineDetailParam,true);
|
checkNameAndParam(updatePvLineDetailParam);
|
||||||
checkParam(updatePvLineDetailParam);
|
lineNumIsExit(updatePvLineDetailParam,true);
|
||||||
PvLineDetail pvLineDetail = new PvLineDetail();
|
PvLineDetail pvLineDetail = commMonit(updatePvLineDetailParam);
|
||||||
BeanUtils.copyProperties(updatePvLineDetailParam,pvLineDetail);
|
|
||||||
return this.updateById(pvLineDetail);
|
return this.updateById(pvLineDetail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公共代码提取
|
||||||
|
*/
|
||||||
|
private PvLineDetail commMonit(PvLineDetailParam pvLineDetailParam){
|
||||||
|
PvLineDetail pvLineDetail = new PvLineDetail();
|
||||||
|
BeanUtils.copyProperties(pvLineDetailParam,pvLineDetail);
|
||||||
|
pvLineDetail.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
if(StrUtil.isNotBlank(pvLineDetailParam.getAccess())){
|
||||||
|
pvLineDetail.setAccess(PubUtils.localDateFormat(pvLineDetailParam.getAccess()));
|
||||||
|
}
|
||||||
|
if(StrUtil.isNotBlank(pvLineDetailParam.getPutIn())){
|
||||||
|
pvLineDetail.setAccess(PubUtils.localDateFormat(pvLineDetailParam.getPutIn()));
|
||||||
|
}
|
||||||
|
return pvLineDetail;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点序号是否重复判断
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/11
|
||||||
|
*/
|
||||||
|
private void lineNumIsExit(PvLineDetailParam pvLineDetailParam,Boolean isUpdate){
|
||||||
|
LambdaQueryWrapper<PvLineDetail> query = new LambdaQueryWrapper<>();
|
||||||
|
query.eq(PvLineDetail::getDevId,pvLineDetailParam.getDevId())
|
||||||
|
.eq(PvLineDetail::getNum,pvLineDetailParam.getNum())
|
||||||
|
.eq(PvLineDetail::getState,DataStateEnum.ENABLE.getCode());
|
||||||
|
if(isUpdate){
|
||||||
|
if(pvLineDetailParam instanceof PvLineDetailParam.UpdatePvLineDetailParam){
|
||||||
|
query.ne(PvLineDetail::getId,((PvLineDetailParam.UpdatePvLineDetailParam) pvLineDetailParam).getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int count = this.count(query);
|
||||||
|
if (count > 0) {
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.DEV_NUM_NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<PvLineDetail> getPvLineDetailList(LineDetailQueryParam subsAreaQueryParam) {
|
public Page<PvLineDetail> getPvLineDetailList(LineDetailQueryParam subsAreaQueryParam) {
|
||||||
Page<PvLineDetail> page = new Page<>(PageFactory.getPageNum(subsAreaQueryParam),PageFactory.getPageSize(subsAreaQueryParam));
|
Page<PvLineDetail> page = new Page<>(PageFactory.getPageNum(subsAreaQueryParam),PageFactory.getPageSize(subsAreaQueryParam));
|
||||||
LambdaQueryWrapper<PvLineDetail> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<PvLineDetail> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
return this.page(page,lambdaQueryWrapper);
|
return this.page(page,lambdaQueryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,34 +130,99 @@ public class PvLineDetailServiceImpl extends ServiceImpl<PvLineDetailMapper, PvL
|
|||||||
return this.removeById(id);
|
return this.removeById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<PvLineAllDetailVO> getPvLineAllDetailMain(Integer pageNum,Integer pageSize,List<String> subIds, List<String> subAreaIds) {
|
||||||
|
|
||||||
|
Page<PvLineAllDetailVO> page = new Page<>(pageNum,pageSize);
|
||||||
|
|
||||||
|
return this.baseMapper.getPvLineAllDetailMain(page,subIds,subAreaIds);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验单位名称是否重复
|
* 校验单位名称是否重复
|
||||||
*/
|
*/
|
||||||
private void checkName(PvLineDetailParam pvLineDetailParam, boolean isUpdate) {
|
private void checkNameAndParam(PvLineDetailParam pvLineDetailParam) {
|
||||||
LambdaQueryWrapper<PvLineDetail> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
lambdaQueryWrapper.eq(PvLineDetail::getNum, pvLineDetailParam.getNum());
|
|
||||||
if (isUpdate) {
|
|
||||||
//更新操作
|
|
||||||
if (pvLineDetailParam instanceof PvLineDetailParam.UpdatePvLineDetailParam) {
|
|
||||||
lambdaQueryWrapper.eq(PvLineDetail::getId, ((PvLineDetailParam.UpdatePvLineDetailParam) pvLineDetailParam).getId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
int count = this.count(lambdaQueryWrapper);
|
|
||||||
if (count > 0) {
|
|
||||||
throw new BusinessException(PvDeviceResponseEnum.SUB_AREA_REPEAT);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 校验参数是否违规
|
|
||||||
*/
|
|
||||||
private void checkParam(PvLineDetailParam pvLineDetailParam){
|
|
||||||
if(Objects.isNull(dicDataFeignClient.getDicDataById(pvLineDetailParam.getLoadType()))){
|
|
||||||
throw new BusinessException(SystemResponseEnum.INTERFERENCE_EMPTY);
|
|
||||||
}
|
|
||||||
if(Objects.isNull(iPvDeviceService.getPvDeviceById(pvLineDetailParam.getDevId()))){
|
if(Objects.isNull(iPvDeviceService.getPvDeviceById(pvLineDetailParam.getDevId()))){
|
||||||
throw new BusinessException(PvDeviceResponseEnum.DEV_NULL);
|
throw new BusinessException(PvDeviceResponseEnum.DEV_NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*校验监测类型*/
|
||||||
|
DictData lineType = dicDataFeignClient.getDicDataById(pvLineDetailParam.getType()).getData();
|
||||||
|
if(Objects.isNull(lineType)){
|
||||||
|
throw new BusinessException(SystemResponseEnum.LINE_TYPE_VARIETY_EMPTY);
|
||||||
}
|
}
|
||||||
|
if(DicDataEnum.ONE_LINE.getCode().equals(lineType.getCode())){
|
||||||
|
if(StrUtil.hasBlank(pvLineDetailParam.getSubstationId(),pvLineDetailParam.getVoltageId())){
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.ONE_SUB_VOLTAGE_EMPTY);
|
||||||
|
}
|
||||||
|
if(StrUtil.isNotBlank(pvLineDetailParam.getSubAreaId())){
|
||||||
|
pvLineDetailParam.setSubAreaId("");
|
||||||
|
}
|
||||||
|
}else if(DicDataEnum.TWO_LINE.getCode().equals(lineType.getCode())){
|
||||||
|
if(StrUtil.isNotBlank(pvLineDetailParam.getSubstationId()) ||StrUtil.isNotBlank(pvLineDetailParam.getVoltageId())){
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.TWO_SUB_VOLTAGE_EMPTY_MUST);
|
||||||
|
}
|
||||||
|
|
||||||
|
//2类3类监测点必须存在台区
|
||||||
|
if(StrUtil.isBlank(pvLineDetailParam.getSubAreaId())){
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.SUB_AREA_EMPTY);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}else if(DicDataEnum.THREE_LINE.getCode().equals(lineType.getCode())){
|
||||||
|
if(StrUtil.isNotBlank(pvLineDetailParam.getSubstationId()) ||StrUtil.isNotBlank(pvLineDetailParam.getVoltageId())){
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.TWO_SUB_VOLTAGE_EMPTY_MUST);
|
||||||
|
}
|
||||||
|
|
||||||
|
//2类3类监测点必须存在台区
|
||||||
|
if(StrUtil.isBlank(pvLineDetailParam.getSubAreaId())){
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.SUB_AREA_EMPTY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(Objects.isNull(dicDataFeignClient.getDicDataById(pvLineDetailParam.getBusinessType()).getData())){
|
||||||
|
throw new BusinessException(SystemResponseEnum.BUSINESS_EMPTY);
|
||||||
|
}
|
||||||
|
|
||||||
|
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.getSubstationId())) {
|
||||||
|
if (Objects.isNull(iPvSubstationService.getPvSubstationById(pvLineDetailParam.getSubstationId()))) {
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.SUBSTATION_NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*校验母线*/
|
||||||
|
if(StrUtil.isNotBlank(pvLineDetailParam.getVoltageId())) {
|
||||||
|
if (Objects.isNull(iPvVoltageService.getPvVoltageById(pvLineDetailParam.getVoltageId()))) {
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.VOLTAGE_NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*校验台区*/
|
||||||
|
if(StrUtil.isNotBlank(pvLineDetailParam.getSubAreaId())) {
|
||||||
|
if (Objects.isNull(iPvSubAreaService.getPvSubAreaById(pvLineDetailParam.getSubAreaId()))) {
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.SUB_AREA_NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,9 @@ import com.njcn.common.pojo.enums.common.DataStateEnum;
|
|||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.device.enums.PvDeviceResponseEnum;
|
import com.njcn.device.enums.PvDeviceResponseEnum;
|
||||||
import com.njcn.device.pojo.param.pv.LvUserQueryParam;
|
import com.njcn.device.pojo.param.pv.LvUserQueryParam;
|
||||||
|
import com.njcn.device.pojo.param.pv.PvDistributedParam;
|
||||||
import com.njcn.device.pojo.param.pv.PvLvUserParam;
|
import com.njcn.device.pojo.param.pv.PvLvUserParam;
|
||||||
|
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.pvdevice.mapper.PvLvUserMapper;
|
import com.njcn.pvdevice.mapper.PvLvUserMapper;
|
||||||
@@ -85,7 +87,7 @@ public class PvLvUserServiceImpl extends ServiceImpl<PvLvUserMapper, PvLvUser> i
|
|||||||
private void checkNameAndParam(PvLvUserParam pvLvUserParam, boolean isUpdate) {
|
private void checkNameAndParam(PvLvUserParam pvLvUserParam, boolean isUpdate) {
|
||||||
|
|
||||||
if(StrUtil.isNotBlank(pvLvUserParam.getScale())) {
|
if(StrUtil.isNotBlank(pvLvUserParam.getScale())) {
|
||||||
if (Objects.isNull(dicDataFeignClient.getDicDataById(pvLvUserParam.getScale()))) {
|
if (Objects.isNull(dicDataFeignClient.getDicDataById(pvLvUserParam.getScale()).getData())) {
|
||||||
throw new BusinessException(SystemResponseEnum.VOLTAGE_EMPTY);
|
throw new BusinessException(SystemResponseEnum.VOLTAGE_EMPTY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -102,6 +104,20 @@ public class PvLvUserServiceImpl extends ServiceImpl<PvLvUserMapper, PvLvUser> i
|
|||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
throw new BusinessException(PvDeviceResponseEnum.SUB_AREA_REPEAT);
|
throw new BusinessException(PvDeviceResponseEnum.SUB_AREA_REPEAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
lambdaQueryWrapper.clear();
|
||||||
|
lambdaQueryWrapper.eq(PvLvUser::getUserCode, pvLvUserParam.getUserCode());
|
||||||
|
if (isUpdate) {
|
||||||
|
//更新操作
|
||||||
|
if (pvLvUserParam instanceof PvLvUserParam.UpdatePvLvUserParam) {
|
||||||
|
lambdaQueryWrapper.eq(PvLvUser::getId, ((PvLvUserParam.UpdatePvLvUserParam) pvLvUserParam).getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int countUserCode = this.count(lambdaQueryWrapper);
|
||||||
|
if (countUserCode > 0) {
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.USER_CODE_REPEAT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,111 @@
|
|||||||
|
package com.njcn.pvdevice.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.device.enums.LineBaseEnum;
|
||||||
|
import com.njcn.device.pojo.param.pv.PvTerminalBaseQuery;
|
||||||
|
import com.njcn.device.pojo.po.pv.PvSubArea;
|
||||||
|
import com.njcn.device.pojo.po.pv.PvSubstation;
|
||||||
|
import com.njcn.device.pojo.vo.pv.PvLineAllDetailVO;
|
||||||
|
import com.njcn.pvdevice.mapper.PvLineDetailMapper;
|
||||||
|
import com.njcn.pvdevice.mapper.PvSubAreaMapper;
|
||||||
|
import com.njcn.pvdevice.mapper.PvSubstationMapper;
|
||||||
|
import com.njcn.pvdevice.service.*;
|
||||||
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
|
import com.njcn.user.api.DeptFeignClient;
|
||||||
|
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/11
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PvTerminalBaseServiceImpl implements PvTerminalBaseService {
|
||||||
|
|
||||||
|
private final IPvUnitService iPvUnitService;
|
||||||
|
|
||||||
|
private final IPvSubstationService iPvSubstationService;
|
||||||
|
|
||||||
|
private final IPvSubAreaService iPvSubAreaService;
|
||||||
|
|
||||||
|
private final IPvLineDetailService iPvLineDetailService;
|
||||||
|
|
||||||
|
private final PvSubstationMapper pvSubstationMapper;
|
||||||
|
|
||||||
|
private final PvSubAreaMapper pvSubAreaMapper;
|
||||||
|
|
||||||
|
private final PvLineDetailMapper pvLineDetailMapper;
|
||||||
|
|
||||||
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
|
||||||
|
private final DeptFeignClient deptFeignClient;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PvTerminalTreeVO> pvTerminalTree() {
|
||||||
|
List<PvTerminalTreeVO> unitTreeList = deptFeignClient.allDeptList().getData();
|
||||||
|
List<PvTerminalTreeVO> subTreeList = pvSubstationMapper.getSubstationTreeList();
|
||||||
|
List<PvTerminalTreeVO> subAreaTreeList = pvSubAreaMapper.getSubAreaTreeList();
|
||||||
|
unitTreeList.addAll(subTreeList);
|
||||||
|
unitTreeList.addAll(subAreaTreeList);
|
||||||
|
List<PvTerminalTreeVO> newUnit = unitTreeList.stream().filter(item->item.getPid().equals("0")).peek(tem->tem.setChildren(getChildren(tem,unitTreeList))).collect(Collectors.toList());
|
||||||
|
|
||||||
|
return newUnit;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<PvLineAllDetailVO> lineDetailBySubId(PvTerminalBaseQuery pvTerminalBaseQuery) {
|
||||||
|
List<String> ids = pvTerminalBaseQuery.getId();
|
||||||
|
Integer level = pvTerminalBaseQuery.getLevel();
|
||||||
|
|
||||||
|
if(level.equals(LineBaseEnum.PV_UNIT_LEVEL.getCode())){
|
||||||
|
//点击的是单位节点
|
||||||
|
LambdaQueryWrapper<PvSubstation> subQuery= new LambdaQueryWrapper<>();
|
||||||
|
subQuery.in(PvSubstation::getUnitId,ids);
|
||||||
|
List<PvSubstation> substationList = iPvSubstationService.list(subQuery);
|
||||||
|
List<String> subIds = substationList.stream().map(PvSubstation::getId).collect(Collectors.toList());
|
||||||
|
|
||||||
|
LambdaQueryWrapper<PvSubArea> areaQuery= new LambdaQueryWrapper<>();
|
||||||
|
areaQuery.in(PvSubArea::getUnitId,ids);
|
||||||
|
List<PvSubArea> subAreaList = iPvSubAreaService.list(areaQuery);
|
||||||
|
List<String> subAreaIds = subAreaList.stream().map(PvSubArea::getId).collect(Collectors.toList());
|
||||||
|
return iPvLineDetailService.getPvLineAllDetailMain(1,10,subIds,subAreaIds);
|
||||||
|
}else if(level.equals(LineBaseEnum.PV_SUB_LEVEL.getCode())){
|
||||||
|
|
||||||
|
return iPvLineDetailService.getPvLineAllDetailMain(1,10, ids,null);
|
||||||
|
}else if(level.equals(LineBaseEnum.PV_SUB_AREA_LEVEL.getCode())){
|
||||||
|
|
||||||
|
return iPvLineDetailService.getPvLineAllDetailMain(1,10,null,ids);
|
||||||
|
|
||||||
|
}
|
||||||
|
throw new BusinessException(CommonResponseEnum.FAIL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void diGui(List<PvTerminalTreeVO> unitTreeList,List<PvTerminalTreeVO> subTreeList,List<PvTerminalTreeVO> subAreaTreeList) {
|
||||||
|
for (PvTerminalTreeVO unit : unitTreeList) {
|
||||||
|
if (CollUtil.isNotEmpty(unit.getChildren())) {
|
||||||
|
diGui(unit.getChildren(),subTreeList,subAreaTreeList);
|
||||||
|
} else {
|
||||||
|
unit.setChildren(getChildren(unit, subTreeList));
|
||||||
|
unit.setChildren(getChildren(unit, subAreaTreeList));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private List<PvTerminalTreeVO> getChildren(PvTerminalTreeVO tem, List<PvTerminalTreeVO> children) {
|
||||||
|
return children.stream().filter(item -> item.getPid().equals(tem.getId())).peek(t->t.setChildren(getChildren(t,children))).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,6 +10,7 @@ import com.njcn.device.pojo.vo.pv.UnitTreeVO;
|
|||||||
import com.njcn.pvdevice.mapper.PvUnitMapper;
|
import com.njcn.pvdevice.mapper.PvUnitMapper;
|
||||||
import com.njcn.pvdevice.service.IPvUnitService;
|
import com.njcn.pvdevice.service.IPvUnitService;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||||
import com.njcn.web.pojo.param.BaseParam;
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -54,6 +55,8 @@ public class PvUnitServiceImpl extends ServiceImpl<PvUnitMapper, PvUnit> impleme
|
|||||||
return parentList;
|
return parentList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 递归查询子节点
|
* 递归查询子节点
|
||||||
* @param root 根节点
|
* @param root 根节点
|
||||||
@@ -65,6 +68,11 @@ public class PvUnitServiceImpl extends ServiceImpl<PvUnitMapper, PvUnit> impleme
|
|||||||
.peek(m -> m.setChildren(getChildren(m, all))).collect(Collectors.toList());
|
.peek(m -> m.setChildren(getChildren(m, all))).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<PvTerminalTreeVO> getChildrens(PvTerminalTreeVO root, List<PvTerminalTreeVO> all) {
|
||||||
|
return all.stream().filter(m -> Objects.equals(m.getPid(), root.getId()))
|
||||||
|
.peek(m -> m.setChildren(getChildrens(m, all))).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PvUnit getPvUnitById(String id) {
|
public PvUnit getPvUnitById(String id) {
|
||||||
return this.getById(id);
|
return this.getById(id);
|
||||||
|
|||||||
@@ -22,7 +22,18 @@ public enum DicDataEnum {
|
|||||||
CSSB_ENUM("长时闪变", "CSSB"),
|
CSSB_ENUM("长时闪变", "CSSB"),
|
||||||
XBDL_ENUM("谐波电流", "XBDL"),
|
XBDL_ENUM("谐波电流", "XBDL"),
|
||||||
FXDL_ENUM("负序电流", "FXDL"),
|
FXDL_ENUM("负序电流", "FXDL"),
|
||||||
JXBDY_ENUM("间谐波电压", "JXBDY");
|
JXBDY_ENUM("间谐波电压", "JXBDY"),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点类型
|
||||||
|
*/
|
||||||
|
ONE_LINE("I类监测点","One_Line"),
|
||||||
|
TWO_LINE("II类监测点","Two_Line"),
|
||||||
|
THREE_LINE("III类监测点","Three_Line")
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ public enum DicDataTypeEnum {
|
|||||||
*/
|
*/
|
||||||
FRONT_TYPE("前置类型"),
|
FRONT_TYPE("前置类型"),
|
||||||
DEV_TYPE("终端型号"),
|
DEV_TYPE("终端型号"),
|
||||||
|
DEV_VARIETY("终端类型"),
|
||||||
DEV_FUN("终端功能"),
|
DEV_FUN("终端功能"),
|
||||||
DEV_STATUS("终端状态"),
|
DEV_STATUS("终端状态"),
|
||||||
DEV_LEVEL("终端等级"),
|
DEV_LEVEL("终端等级"),
|
||||||
@@ -33,8 +34,8 @@ public enum DicDataTypeEnum {
|
|||||||
RATE_TYPE("费率类型"),
|
RATE_TYPE("费率类型"),
|
||||||
ELE_LOAD_TYPE("用能负荷类型"),
|
ELE_LOAD_TYPE("用能负荷类型"),
|
||||||
ELE_STATISTICAL_TYPE("用能统计类型"),
|
ELE_STATISTICAL_TYPE("用能统计类型"),
|
||||||
LINE_MARK("监测点评分等级")
|
LINE_MARK("监测点评分等级"),
|
||||||
|
LINE_TYPE("监测点类型")
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ public enum SystemResponseEnum {
|
|||||||
BUSINESS_EMPTY("A00356","查询字典行业类型数据为空"),
|
BUSINESS_EMPTY("A00356","查询字典行业类型数据为空"),
|
||||||
DEV_TYPE_EMPTY("A00357","查询字典设备类型数据为空"),
|
DEV_TYPE_EMPTY("A00357","查询字典设备类型数据为空"),
|
||||||
MANUFACTURER("A00358","查询字典终端厂家数据为空"),
|
MANUFACTURER("A00358","查询字典终端厂家数据为空"),
|
||||||
|
DEV_VARIETY("A00359","查询字典终端类型数据为空"),
|
||||||
|
LINE_TYPE_VARIETY_EMPTY("A00360","查询字典监测点类型数据为空"),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.njcn.common.pojo.constant.ServerInfo;
|
|||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.user.api.fallback.DeptFeignClientFallbackFactory;
|
import com.njcn.user.api.fallback.DeptFeignClientFallbackFactory;
|
||||||
import com.njcn.user.pojo.dto.DeptDTO;
|
import com.njcn.user.pojo.dto.DeptDTO;
|
||||||
|
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -45,4 +46,11 @@ public interface DeptFeignClient {
|
|||||||
*/
|
*/
|
||||||
@GetMapping("/getAreaIdByDeptId")
|
@GetMapping("/getAreaIdByDeptId")
|
||||||
HttpResult<String> getAreaIdByDeptId(@RequestParam("deptId") String deptId);
|
HttpResult<String> getAreaIdByDeptId(@RequestParam("deptId") String deptId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有部门
|
||||||
|
*/
|
||||||
|
@GetMapping("/allDeptList")
|
||||||
|
HttpResult<List<PvTerminalTreeVO>> allDeptList();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.njcn.common.pojo.exception.BusinessException;
|
|||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.user.api.DeptFeignClient;
|
import com.njcn.user.api.DeptFeignClient;
|
||||||
import com.njcn.user.pojo.dto.DeptDTO;
|
import com.njcn.user.pojo.dto.DeptDTO;
|
||||||
|
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||||
import com.njcn.user.utils.UserEnumUtil;
|
import com.njcn.user.utils.UserEnumUtil;
|
||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -55,6 +56,12 @@ 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<PvTerminalTreeVO>> allDeptList() {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","查询所有部门异常",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.njcn.user.pojo.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/11
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PvTerminalTreeVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "id",value = "id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "pid",value = "父级id")
|
||||||
|
private String pid;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "name",value = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "code",value = "code")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0.单位 1.变电站 2.台区
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "level",value = "0.单位 1.变电站 2.台区")
|
||||||
|
private Integer level;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "children",value = "子级")
|
||||||
|
private List<PvTerminalTreeVO> children = new ArrayList<>();
|
||||||
|
}
|
||||||
@@ -16,9 +16,8 @@ import com.njcn.user.pojo.param.DeptParam;
|
|||||||
import com.njcn.user.pojo.vo.DeptAllTreeVO;
|
import com.njcn.user.pojo.vo.DeptAllTreeVO;
|
||||||
import com.njcn.user.pojo.vo.DeptTreeVO;
|
import com.njcn.user.pojo.vo.DeptTreeVO;
|
||||||
import com.njcn.user.pojo.vo.DeptVO;
|
import com.njcn.user.pojo.vo.DeptVO;
|
||||||
|
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||||
import com.njcn.user.service.IDeptService;
|
import com.njcn.user.service.IDeptService;
|
||||||
import com.njcn.web.pojo.param.DeptLineParam;
|
|
||||||
import com.njcn.web.utils.ControllerUtil;
|
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -256,5 +255,19 @@ public class DeptController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有的部门
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/12
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@GetMapping("/allDeptList")
|
||||||
|
@ApiOperation("获取所有单位")
|
||||||
|
public HttpResult<List<PvTerminalTreeVO>> allDeptList() {
|
||||||
|
String methodDescribe = getMethodDescribe("allDeptList");
|
||||||
|
List<PvTerminalTreeVO> result = deptService.allDeptList();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.njcn.user.pojo.po.Dept;
|
|||||||
import com.njcn.user.pojo.vo.DeptAllTreeVO;
|
import com.njcn.user.pojo.vo.DeptAllTreeVO;
|
||||||
import com.njcn.user.pojo.vo.DeptTreeVO;
|
import com.njcn.user.pojo.vo.DeptTreeVO;
|
||||||
import com.njcn.user.pojo.vo.DeptVO;
|
import com.njcn.user.pojo.vo.DeptVO;
|
||||||
|
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -91,4 +92,7 @@ public interface DeptMapper extends BaseMapper<Dept> {
|
|||||||
* @return 后代部门索引
|
* @return 后代部门索引
|
||||||
*/
|
*/
|
||||||
List<DeptDTO> getDeptDescendantIndexes(@Param("id")String id, @Param("type")List<Integer> type);
|
List<DeptDTO> getDeptDescendantIndexes(@Param("id")String id, @Param("type")List<Integer> type);
|
||||||
|
|
||||||
|
|
||||||
|
List<PvTerminalTreeVO> allDeptList();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -155,4 +155,9 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="allDeptList" resultType="DeptAllTreeVO">
|
||||||
|
select id,name,pid, 0 as level from sys_dept where type = 0 and state = 1 order by sort
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import com.njcn.user.pojo.po.Dept;
|
|||||||
import com.njcn.user.pojo.vo.DeptAllTreeVO;
|
import com.njcn.user.pojo.vo.DeptAllTreeVO;
|
||||||
import com.njcn.user.pojo.vo.DeptTreeVO;
|
import com.njcn.user.pojo.vo.DeptTreeVO;
|
||||||
import com.njcn.user.pojo.vo.DeptVO;
|
import com.njcn.user.pojo.vo.DeptVO;
|
||||||
import com.njcn.web.pojo.param.DeptLineParam;
|
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -131,4 +131,11 @@ public interface IDeptService extends IService<Dept> {
|
|||||||
* @date 2022/3/28 9:32
|
* @date 2022/3/28 9:32
|
||||||
*/
|
*/
|
||||||
String getTopDeptId();
|
String getTopDeptId();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有的部门
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/12
|
||||||
|
*/
|
||||||
|
List<PvTerminalTreeVO> allDeptList();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,10 +24,10 @@ import com.njcn.user.pojo.po.User;
|
|||||||
import com.njcn.user.pojo.vo.DeptAllTreeVO;
|
import com.njcn.user.pojo.vo.DeptAllTreeVO;
|
||||||
import com.njcn.user.pojo.vo.DeptTreeVO;
|
import com.njcn.user.pojo.vo.DeptTreeVO;
|
||||||
import com.njcn.user.pojo.vo.DeptVO;
|
import com.njcn.user.pojo.vo.DeptVO;
|
||||||
|
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||||
import com.njcn.user.service.IDeptService;
|
import com.njcn.user.service.IDeptService;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.web.factory.PageFactory;
|
import com.njcn.web.factory.PageFactory;
|
||||||
import com.njcn.web.pojo.param.DeptLineParam;
|
|
||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
import com.njcn.web.utils.WebUtil;
|
import com.njcn.web.utils.WebUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -251,6 +251,11 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
|||||||
return this.lambdaQuery().eq(Dept::getPid,"0").one().getId();
|
return this.lambdaQuery().eq(Dept::getPid,"0").one().getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PvTerminalTreeVO> allDeptList(){
|
||||||
|
return this.baseMapper.allDeptList();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验参数,检查是否存在相同编码的部门
|
* 校验参数,检查是否存在相同编码的部门
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user