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

View File

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

View File

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

View File

@@ -36,6 +36,13 @@ public class PvDistributedParam implements Serializable {
@NotBlank(message = "分布式光伏名称不可为空")
private String name;
/**
* 分布式光伏编号
*/
@ApiModelProperty(name = "code",value = "分布式光伏编号",required = true)
@NotBlank(message = "分布式光伏编号不可为空")
private String code;
/**
* 用户编号(与低压用户台账表低压用户编号字段一致)
*/
@@ -79,6 +86,15 @@ public class PvDistributedParam implements Serializable {
@ApiModelProperty(name = "energyCapacity",value = "储能配置容量KVA")
private Float energyCapacity;
@ApiModelProperty(name = "smartSwitch",value = "智能开关编号")
private String smartSwitch;
@ApiModelProperty(name = "installTime",value = "安装时间")
private String installTime;
@ApiModelProperty(name = "runTime",value = "投运时间")
private String runTime;
@Data

View File

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

View File

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

View File

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

View File

@@ -45,6 +45,13 @@ public class PvTenVoltageParam implements Serializable {
@NotBlank(message = "线路名称不能为空")
private String name;
/**
* 线路编号
*/
@ApiModelProperty(name = "code",value = "线路编号",required = true)
@NotBlank(message = "线路编号不能为空")
private String code;
/**
* 跨区域类型
*/
@@ -137,6 +144,27 @@ public class PvTenVoltageParam implements Serializable {
private String putIntoDate;
/**
* 是否有分布式光伏接入
*/
@ApiModelProperty(name = "pvStatus",value = "是否有分布式光伏接入 0.否 1.是")
private Integer pvStatus;
/**
* 分布式光伏接入容量
*/
@ApiModelProperty(name = "pvCapacity",value = "分布式光伏接入容量")
private Integer pvCapacity;
/**
* 分布式光伏接入数量
*/
@ApiModelProperty(name = "pvNum",value = "分布式光伏接入数量")
private Integer pvNum;
@Data
@EqualsAndHashCode(callSuper = true)

View File

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

View File

@@ -23,4 +23,7 @@ public class TenVoltageQueryParam extends BaseParam {
@ApiModelProperty(name = "designScale",value = "电压等级")
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 name;
/**
* 终端类型(电能质量监测终端、智能电表、智能融合终端),字典表
*/
@@ -71,6 +73,22 @@ public class PvDevice extends BaseEntity {
*/
private String devKey;
/**
* 投运时间
*/
private LocalDate loadTime;
/**
* 装置通讯状态
*/
private Integer devStatus;
/**
* 信号传输方式
*/
private String communicateType;
/**
* 本次定检时间,默认等于投运时间
*/
@@ -81,6 +99,10 @@ public class PvDevice extends BaseEntity {
*/
private LocalDate nextTimeCheck;
/**
* 终端级别
*/
private String devGrade;
/**
* 状态
*/

View File

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

View File

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

View File

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

View File

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

View File

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

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

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;
/**
* 所属单位名称
*/
@@ -31,6 +32,11 @@ public class PvSubstationVO {
*/
private String name;
/**
* 变电站编号
*/
private String subCode;
/**
* 电压等级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.PvDeviceParam;
import com.njcn.device.pojo.po.pv.PvDevice;
import com.njcn.device.pojo.vo.pv.PvDeviceVO;
import com.njcn.pvdevice.service.IPvDeviceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -91,9 +92,9 @@ public class PvDeviceController extends BaseController {
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("分页查询终端")
@ApiImplicitParam(name = "deviceQueryParam",value = "终端实体",required = true)
public HttpResult<Page<PvDevice>> getPvDeviceList(@RequestBody DeviceQueryParam deviceQueryParam){
public HttpResult<Page<PvDeviceVO>> getPvDeviceList(@RequestBody DeviceQueryParam deviceQueryParam){
String methodDescribe = getMethodDescribe("getPvDeviceList");
Page<PvDevice> page = iPvDeviceService.getPvDeviceList(deviceQueryParam);
Page<PvDeviceVO> page = iPvDeviceService.getPvDeviceList(deviceQueryParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
@@ -106,9 +107,9 @@ public class PvDeviceController extends BaseController {
@PostMapping("getAllPvDeviceList")
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("查询所有终端")
public HttpResult<List<PvDevice>> getAllPvDeviceList(){
public HttpResult<List<PvDeviceVO>> getAllPvDeviceList(){
String methodDescribe = getMethodDescribe("getAllPvDeviceList");
List<PvDevice> list = iPvDeviceService.getAllPvDeviceList();
List<PvDeviceVO> list = iPvDeviceService.getAllPvDeviceList();
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
}
@@ -137,18 +138,18 @@ public class PvDeviceController extends BaseController {
/**
* 删除终端
* @param id 终端id
* @param ids 终端id
* @author cdf
* @date 2022/7/5
* @return boolean
*/
@DeleteMapping("delPvDevice")
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@PostMapping("delPvDevice")
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.DELETE)
@ApiOperation("删除终端")
@ApiImplicitParam(name = "id",value = "终端id",required = true)
public HttpResult<PvDevice> delPvDevice(@RequestParam("id") String id){
@ApiImplicitParam(name = "ids",value = "终端id",required = true)
public HttpResult<PvDevice> delPvDevice(@RequestBody List<String> ids){
String methodDescribe = getMethodDescribe("delPvDevice");
boolean res = iPvDeviceService.delPvDevice(id);
boolean res = iPvDeviceService.delPvDevice(ids);
if(res){
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.DistributedQueryParam;
import com.njcn.device.pojo.po.pv.PvDistributed;
import com.njcn.device.pojo.vo.pv.PvDistributedVO;
import com.njcn.pvdevice.service.IPvDistributedService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -91,9 +92,9 @@ public class PvDistributedController extends BaseController {
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("分页查询分布式光伏台账")
@ApiImplicitParam(name = "distributedQueryParam",value = "分布式光伏台账实体",required = true)
public HttpResult<Page<PvDistributed>> getPvDistributedList(@RequestBody DistributedQueryParam distributedQueryParam){
public HttpResult<Page<PvDistributedVO>> getPvDistributedList(@RequestBody DistributedQueryParam distributedQueryParam){
String methodDescribe = getMethodDescribe("getPvDistributedList");
Page<PvDistributed> page = iPvDistributedService.getPvDistributedList(distributedQueryParam);
Page<PvDistributedVO> page = iPvDistributedService.getPvDistributedList(distributedQueryParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
@@ -137,18 +138,18 @@ public class PvDistributedController extends BaseController {
/**
* 删除分布式光伏台账
* @param id 分布式光伏台账id
* @param ids 分布式光伏台账id
* @author cdf
* @date 2022/7/5
* @return boolean
*/
@DeleteMapping("delPvDistributed")
@PostMapping("delPvDistributed")
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("删除分布式光伏台账")
@ApiImplicitParam(name = "id",value = "分布式光伏台账id",required = true)
public HttpResult<PvDistributed> delPvDistributed(@RequestParam("id") String id){
@ApiImplicitParam(name = "ids",value = "分布式光伏台账ids",required = true)
public HttpResult<PvDistributed> delPvDistributed(@RequestBody List<String> ids){
String methodDescribe = getMethodDescribe("delPvDistributed");
boolean res = iPvDistributedService.delPvDistributed(id);
boolean res = iPvDistributedService.delPvDistributed(ids);
if(res){
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
* @date 2022/7/5
* @return boolean
*/
@DeleteMapping("delPvLineDetail")
@PostMapping("delPvLineDetail")
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("删除监测点")
@ApiImplicitParam(name = "id",value = "监测点id",required = true)
public HttpResult<PvLineDetail> delPvLineDetail(@RequestParam("id") String id){
@ApiImplicitParam(name = "ids",value = "监测点id",required = true)
public HttpResult<PvLineDetail> delPvLineDetail(@RequestBody List<String> ids){
String methodDescribe = getMethodDescribe("delPvLineDetail");
boolean res = iPvLineDetailService.delPvLineDetail(id);
boolean res = iPvLineDetailService.delPvLineDetail(ids);
if(res){
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.PvLvUserParam;
import com.njcn.device.pojo.po.pv.PvLvUser;
import com.njcn.device.pojo.vo.pv.PvLvUserVO;
import com.njcn.pvdevice.service.IPvLvUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -91,9 +92,9 @@ public class PvLvUserController extends BaseController {
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("分页查询低压用户台账")
@ApiImplicitParam(name = "lvUserQueryParam",value = "低压用户台账实体",required = true)
public HttpResult<Page<PvLvUser>> getPvLvUserList(@RequestBody LvUserQueryParam lvUserQueryParam){
public HttpResult<Page<PvLvUserVO>> getPvLvUserList(@RequestBody LvUserQueryParam lvUserQueryParam){
String methodDescribe = getMethodDescribe("getPvLvUserList");
Page<PvLvUser> page = iPvLvUserService.getPvLvUserList(lvUserQueryParam);
Page<PvLvUserVO> page = iPvLvUserService.getPvLvUserList(lvUserQueryParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
@@ -137,18 +138,18 @@ public class PvLvUserController extends BaseController {
/**
* 删除低压用户台账
* @param id 低压用户台账id
* @param ids 低压用户台账id
* @author cdf
* @date 2022/7/5
* @return boolean
*/
@DeleteMapping("delPvLvUser")
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@PostMapping("delPvLvUser")
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.DELETE)
@ApiOperation("删除低压用户台账")
@ApiImplicitParam(name = "id",value = "低压用户台账id",required = true)
public HttpResult<PvLvUser> delPvLvUser(@RequestParam("id") String id){
@ApiImplicitParam(name = "ids",value = "低压用户台账id",required = true)
public HttpResult<PvLvUser> delPvLvUser(@RequestBody List<String> ids){
String methodDescribe = getMethodDescribe("delPvLvUser");
boolean res = iPvLvUserService.delPvLvUser(id);
boolean res = iPvLvUserService.delPvLvUser(ids);
if(res){
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.SubAreaQueryParam;
import com.njcn.device.pojo.po.pv.PvSubArea;
import com.njcn.device.pojo.vo.pv.PvSubAreaVO;
import com.njcn.pvdevice.service.IPvSubAreaService;
import com.sun.el.parser.BooleanNode;
import io.swagger.annotations.Api;
@@ -93,9 +94,9 @@ public class PvSubAreaController extends BaseController {
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("分页查询台区")
@ApiImplicitParam(name = "subAreaQueryParam",value = "台区实体",required = true)
public HttpResult<Page<PvSubArea>> getPvSubAreaList(@RequestBody SubAreaQueryParam subAreaQueryParam){
public HttpResult<Page<PvSubAreaVO>> getPvSubAreaList(@RequestBody SubAreaQueryParam subAreaQueryParam){
String methodDescribe = getMethodDescribe("getPvSubAreaList");
Page<PvSubArea> page = iPvSubAreaService.getPvSubAreaList(subAreaQueryParam);
Page<PvSubAreaVO> page = iPvSubAreaService.getPvSubAreaList(subAreaQueryParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
@@ -139,18 +140,18 @@ public class PvSubAreaController extends BaseController {
/**
* 删除台区
* @param id 台区id
* @param ids 台区ids
* @author cdf
* @date 2022/7/5
* @return boolean
*/
@DeleteMapping("delPvSubArea")
@PostMapping("delPvSubArea")
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("删除台区")
@ApiImplicitParam(name = "id",value = "台区id",required = true)
public HttpResult<PvSubArea> delPvSubArea(@RequestParam("id") String id){
@ApiImplicitParam(name = "ids",value = "台区ids",required = true)
public HttpResult<PvSubArea> delPvSubArea(@RequestBody List<String> ids){
String methodDescribe = getMethodDescribe("delPvSubArea");
boolean res = iPvSubAreaService.delPvSubArea(id);
boolean res = iPvSubAreaService.delPvSubArea(ids);
if(res){
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
* @date 2022/7/5
* @return boolean
*/
@DeleteMapping("delPvSubstation")
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@PostMapping("delPvSubstation")
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.DELETE)
@ApiOperation("删除变电站")
@ApiImplicitParam(name = "id",value = "变电站id",required = true)
public HttpResult<PvSubstation> delPvSubstation(@RequestParam("id") String id){
@ApiImplicitParam(name = "ids",value = "变电站ids",required = true)
public HttpResult<PvSubstation> delPvSubstation(@RequestBody List<String> ids){
String methodDescribe = getMethodDescribe("delPvSubstation");
iPvSubstationService.delPvSubstation(id);
iPvSubstationService.delPvSubstation(ids);
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.TenVoltageQueryParam;
import com.njcn.device.pojo.po.pv.PvTenVoltage;
import com.njcn.device.pojo.vo.pv.PvTenVoltageVO;
import com.njcn.pvdevice.service.IPvTenVoltageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -21,6 +22,8 @@ import org.springframework.web.bind.annotation.*;
import com.njcn.web.controller.BaseController;
import java.util.List;
/**
* <p>
* 前端控制器
@@ -90,11 +93,25 @@ public class PvTenVoltageController extends BaseController {
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("分页查询10kV线路")
@ApiImplicitParam(name = "tenVoltageQueryParam", value = "10kV线路实体", required = true)
public HttpResult<Page<PvTenVoltage>> getPvTenVoltageList(@RequestBody @Validated TenVoltageQueryParam tenVoltageQueryParam) {
public HttpResult<Page<PvTenVoltageVO>> getPvTenVoltageList(@RequestBody @Validated TenVoltageQueryParam tenVoltageQueryParam) {
String methodDescribe = getMethodDescribe("getPvTenVoltageList");
Page<PvTenVoltage> page = iPvTenVoltageService.getPvTenVoltageList(tenVoltageQueryParam);
Page<PvTenVoltageVO> page = iPvTenVoltageService.getPvTenVoltageList(tenVoltageQueryParam);
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线路
*
* @param id 10kV线路id
* @param ids 10kV线路id
* @return boolean
* @author cdf
* @date 2022/7/5
*/
@DeleteMapping("delPvTenVoltage")
@PostMapping("delPvTenVoltage")
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("删除10kV线路")
@ApiImplicitParam(name = "id", value = "10kV线路id", required = true)
public HttpResult<PvTenVoltage> delPvTenVoltage(@RequestParam("id") String id) {
@ApiImplicitParam(name = "ids", value = "10kV线路id", required = true)
public HttpResult<PvTenVoltage> delPvTenVoltage(@RequestBody List<String> ids) {
String methodDescribe = getMethodDescribe("delPvTenVoltage");
boolean flag = iPvTenVoltageService.delPvTenVoltage(id);
boolean flag = iPvTenVoltageService.delPvTenVoltage(ids);
if (flag) {
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.utils.HttpResultUtil;
import com.njcn.device.pojo.param.pv.PvTerminalBaseQuery;
import com.njcn.device.pojo.vo.pv.DisOrLvVO;
import com.njcn.device.pojo.vo.pv.PvLineAllDetailVO;
import com.njcn.pvdevice.service.PvTerminalBaseService;
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
@@ -68,5 +70,23 @@ public class PvTerminalBaseController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, all, methodDescribe);
}
/**
* 根据userCode 和 userCodeType
* @author cdf
* @date 2022/7/28
*/
@GetMapping("pvDisOrLv")
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@ApiOperation("根据用户编号获取低压分布式详情")
@ApiImplicitParams({
@ApiImplicitParam(name = "userCode", value = "用户编号"),
@ApiImplicitParam(name = "userCodeType", value = "用户编号类型 0.光伏 1.低压"),
})
public HttpResult<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.po.pv.PvDevice;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.device.pojo.vo.pv.PvDeviceVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* Mapper 接口
@@ -24,7 +27,10 @@ public interface PvDeviceMapper extends BaseMapper<PvDevice> {
* @author cdf
* @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.njcn.device.pojo.param.pv.DistributedQueryParam;
import com.njcn.device.pojo.po.pv.PvDistributed;
import com.njcn.device.pojo.vo.pv.PvDistributedVO;
import org.apache.ibatis.annotations.Param;
/**
@@ -22,6 +23,6 @@ public interface PvDistributedMapper extends BaseMapper<PvDistributed> {
* @author cdf
* @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
* @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.po.pv.PvLvUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.device.pojo.vo.pv.PvLvUserVO;
import org.apache.ibatis.annotations.Param;
/**
@@ -21,6 +22,6 @@ public interface PvLvUserMapper extends BaseMapper<PvLvUser> {
* @author cdf
* @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.po.pv.PvSubArea;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.device.pojo.vo.pv.DisOrLvVO;
import com.njcn.device.pojo.vo.pv.PvSubAreaVO;
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
import org.apache.ibatis.annotations.Param;
@@ -25,7 +27,7 @@ public interface PvSubAreaMapper extends BaseMapper<PvSubArea> {
* @author cdf
* @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
*/
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.po.pv.PvTenVoltage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.device.pojo.vo.pv.PvTenVoltageVO;
import org.apache.ibatis.annotations.Param;
/**
@@ -21,6 +22,6 @@ public interface PvTenVoltageMapper extends BaseMapper<PvTenVoltage> {
* @author cdf
* @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">
<mapper namespace="com.njcn.pvdevice.mapper.PvDeviceMapper">
<select id="getPvDeviceList" resultType="PvDevice">
<select id="getPvDeviceList" resultType="PvDeviceVO">
SELECT
dev.id,
dic.NAME manufacturer,
dic2.NAME devType,
dev.manufacturer,
dic.NAME manufacturerName,
dic2.NAME devTypeName,
dev.dev_Type,
dev.type,
dic3.name typeName,
dev.Dev_Code,
dev.name,
dev.ip,
dev.port,
dev.load_time,
dev.dev_status,
dev.communicate_Type,
dev.Series,
dev.Dev_Key,
dev.This_Time_Check,
dev.Next_Time_Check,
dic4.name devGradeName,
dev.dev_grade
FROM
pv_device dev
LEFT JOIN sys_dict_data dic ON dev.manufacturer = dic.id
LEFT JOIN sys_dict_data dic2 ON dev.Dev_Type = dic2.id
LEFT JOIN sys_dict_data dic3 ON dev.type = dic3.id
LEFT JOIN sys_dict_data dic4 ON dev.dev_grade = dic4.id
<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.Dev_Key,
dev.This_Time_Check,
@@ -19,26 +80,7 @@
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
<where>
<if test="deviceQueryParam.searchValue!=null and deviceQueryParam.searchValue!=''">
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
LEFT JOIN sys_dict_data dic3 ON dev.type = dic3.id
where dev.state = 1
</select>
</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">
<mapper namespace="com.njcn.pvdevice.mapper.PvDistributedMapper">
<select id="getPvDistributedList" resultType="PvDistributed">
<select id="getPvDistributedList" resultType="PvDistributedVO">
SELECT
dis.id,
dic.NAME scale,
dic.NAME scaleName,
dis.scale,
dis.NAME,
dis.User_Code,
dis.Dev_Code,
dis.Machine_Capacity,
dis.Inte_Type,
dis.Phase,
dis.Energy_Capacity
dis.Energy_Capacity,
dis.code,
dis.Smart_Switch,
dis.install_time,
dis.run_time
FROM
pv_distributed dis
LEFT JOIN sys_dict_data dic ON dis.scale = dic.id

View File

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

View File

@@ -2,10 +2,11 @@
<!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">
<select id="getPvLvUserList" resultType="PvLvUser">
<select id="getPvLvUserList" resultType="PvLvUserVO">
SELECT
lv.id,
dic.NAME scale,
dic.NAME scaleName,
lv.scale,
lv.NAME,
lv.User_Code,
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">
<mapper namespace="com.njcn.pvdevice.mapper.PvSubAreaMapper">
<select id="getPvSubAreaList" resultType="PvSubArea">
<select id="getPvSubAreaList" resultType="PvSubAreaVO">
SELECT
sub.id,
unit.name unitId,
ten.NAME tenVoltageId,
sub.unit_id,
dept.name unitName,
sub.ten_Voltage_Id,
ten.NAME tenVoltageName,
sub.NAME,
sub.Code,
sub.Cable_Length,
@@ -23,7 +25,7 @@
sub.Power_Power
FROM
pv_sub_area sub
INNER JOIN pv_unit unit ON sub.unit_id = unit.id
INNER JOIN sys_dept dept ON sub.unit_id = dept.id
INNER JOIN pv_ten_voltage ten ON ten.id = sub.Ten_Voltage_Id
<where>
<if test="subsAreaQueryParam.searchValue!=null and subsAreaQueryParam.searchValue!=''">
@@ -51,4 +53,9 @@
<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>
<select id="pvDisOrLv" resultType="DisOrLvVO">
</select>
</mapper>

View File

@@ -5,14 +5,16 @@
<select id="getPvSubstationList" resultType="PvSubstationVO">
SELECT
sub.id,
dept.NAME unitId,
dic.NAME scale,
sub.unit_id,
dept.NAME unitName,
dic.NAME scaleName,
sub.scale,
sub.sub_code,
sub.NAME,
sub.Total_Capacity,
sub.Team_Code
FROM
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_dept dept ON sub.unit_id = dept.id
<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">
<mapper namespace="com.njcn.pvdevice.mapper.PvTenVoltageMapper">
<select id="getPvTenVoltageList" resultType="PvTenVoltage">
<select id="getPvTenVoltageList" resultType="PvTenVoltageVO">
SELECT
ten.id,
dic.NAME scale,
dic2.NAME designScale,
dic.NAME scaleName,
ten.scale,
dic2.NAME designScaleName,
ten.design_scale,
ten.NAME,
ten.dispatch_Id,
ten.code,
ten.Cr_Type,
ten.Dev_Status,
ten.Earthing,
@@ -20,14 +24,21 @@
ten.Run_Load,
ten.Output_Power,
ten.Max_Current,
ten.Put_Into_Date
ten.Put_Into_Date,
ten.pv_Status,
ten.pv_Capacity,
ten.pv_Num
FROM
pv_ten_voltage ten
LEFT JOIN sys_dict_data dic ON ten.scale = dic.id
LEFT JOIN sys_dict_data dic2 ON ten.Design_Scale = dic2.id
<where>
<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},'%')
or ten.code like CONCAT('%',#{tenVoltageQueryParam.searchValue},'%')
</if>
<if test="tenVoltageQueryParam.scale!=null and tenVoltageQueryParam.scale.size > 0">
@@ -43,6 +54,7 @@
#{item}
</foreach>
</if>
</where>
order by ten.create_time asc
</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.baomidou.mybatisplus.extension.service.IService;
import com.njcn.device.pojo.po.pv.PvDevice;
import com.njcn.device.pojo.vo.pv.PvDeviceVO;
import java.util.List;
@@ -41,14 +42,14 @@ public interface IPvDeviceService extends IService<PvDevice> {
/**
* 分页查询分布式台账
* @param DeviceQueryParam 分布式台账实体
* @param deviceQueryParam 分布式台账实体
* @author cdf
* @date 2022/7/5
* @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
* @date 2022/7/5
* @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.po.pv.PvDistributed;
import com.njcn.device.pojo.po.pv.PvDistributed;
import com.njcn.device.pojo.vo.pv.PvDistributedVO;
import java.util.List;
@@ -47,7 +48,7 @@ public interface IPvDistributedService extends IService<PvDistributed> {
* @date 2022/7/5
* @return Page<PvDistributed>
*/
Page<PvDistributed> getPvDistributedList(DistributedQueryParam distributedQueryParam);
Page<PvDistributedVO> getPvDistributedList(DistributedQueryParam distributedQueryParam);
List<PvDistributed> getAllPvDistributedList();
@@ -63,12 +64,12 @@ public interface IPvDistributedService extends IService<PvDistributed> {
/**
* 删除分布式台账
* @param id 分布式台账id
* @param ids 分布式台账id
* @author cdf
* @date 2022/7/5
* @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
* @date 2022/7/5
* @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
* @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.baomidou.mybatisplus.extension.service.IService;
import com.njcn.device.pojo.vo.pv.PvLvUserVO;
import java.util.List;
@@ -46,7 +47,7 @@ public interface IPvLvUserService extends IService<PvLvUser> {
* @date 2022/7/5
* @return Page<PvLvUser>
*/
Page<PvLvUser> getPvLvUserList(LvUserQueryParam lvUserQueryParam);
Page<PvLvUserVO> getPvLvUserList(LvUserQueryParam lvUserQueryParam);
List<PvLvUser> getAllPvLvUserList();
@@ -62,10 +63,10 @@ public interface IPvLvUserService extends IService<PvLvUser> {
/**
* 删除分低压用户台账
* @param id 分低压用户台账id
* @param ids 分低压用户台账id
* @author cdf
* @date 2022/7/5
* @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.baomidou.mybatisplus.extension.service.IService;
import com.njcn.device.pojo.po.pv.PvSubArea;
import com.njcn.device.pojo.vo.pv.PvSubAreaVO;
import java.util.List;
@@ -45,7 +46,7 @@ public interface IPvSubAreaService extends IService<PvSubArea> {
* @date 2022/7/5
* @return Page<PvSubArea>
*/
Page<PvSubArea> getPvSubAreaList(SubAreaQueryParam subAreaQueryParam);
Page<PvSubAreaVO> getPvSubAreaList(SubAreaQueryParam subAreaQueryParam);
List<PvSubArea> getAllPvSubAreaList();
@@ -61,11 +62,11 @@ public interface IPvSubAreaService extends IService<PvSubArea> {
/**
* 删除台区
* @param id 台区id
* @param ids 台区id
* @author cdf
* @date 2022/7/5
* @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
* @date 2022/7/5
* @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.baomidou.mybatisplus.extension.service.IService;
import com.njcn.device.pojo.po.pv.PvTenVoltage;
import com.njcn.device.pojo.vo.pv.PvTenVoltageVO;
import java.util.List;
/**
* <p>
@@ -19,8 +22,8 @@ public interface IPvTenVoltageService extends IService<PvTenVoltage> {
/**
* 新增单位
* @param pvTenVoltageParam 单位实体
* 新增10kV线路
* @param pvTenVoltageParam 10kV线路实体
* @author cdf
* @date 2022/7/5
* @return boolean
@@ -28,8 +31,8 @@ public interface IPvTenVoltageService extends IService<PvTenVoltage> {
boolean addTenVoltage(PvTenVoltageParam pvTenVoltageParam);
/**
* 修改单位
* @param updatePvTenVoltageParam 单位实体
* 修改10kV线路
* @param updatePvTenVoltageParam 10kV线路实体
* @author cdf
* @date 2022/7/5
* @return boolean
@@ -38,18 +41,26 @@ public interface IPvTenVoltageService extends IService<PvTenVoltage> {
/**
* 分页查询单位
* @param tenVoltageQueryParam 单位实体
* 分页查询10kV线路
* @param tenVoltageQueryParam 10kV线路实体
* @author cdf
* @date 2022/7/5
* @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查询单位
* @param id 单位id
* 根据10kV线路id查询10kV线路
* @param id 10kV线路id
* @author cdf
* @date 2022/7/5
* @return PvTenVoltage
@@ -57,12 +68,12 @@ public interface IPvTenVoltageService extends IService<PvTenVoltage> {
PvTenVoltage getPvTenVoltageById(String id);
/**
* 删除单位
* @param id 单位id
* 删除10kV线路
* @param ids 10kV线路id
* @author cdf
* @date 2022/7/5
* @return boolean
*/
boolean delPvTenVoltage(String id);
boolean delPvTenVoltage(List<String> ids);
}

View File

@@ -2,6 +2,7 @@ package com.njcn.pvdevice.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.device.pojo.param.pv.PvTerminalBaseQuery;
import com.njcn.device.pojo.vo.pv.DisOrLvVO;
import com.njcn.device.pojo.vo.pv.PvLineAllDetailVO;
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
@@ -29,4 +30,12 @@ public interface PvTerminalBaseService {
* @date 2022/7/11
*/
Page<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.po.pv.PvDevice;
import com.njcn.device.pojo.po.pv.PvDevice;
import com.njcn.device.pojo.vo.pv.PvDeviceVO;
import com.njcn.pvdevice.mapper.PvDeviceMapper;
import com.njcn.pvdevice.service.IPvDeviceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -62,14 +63,14 @@ public class PvDeviceServiceImpl extends ServiceImpl<PvDeviceMapper, PvDevice> i
}
@Override
public Page<PvDevice> getPvDeviceList(DeviceQueryParam subsAreaQueryParam) {
Page<PvDevice> page = new Page<>(PageFactory.getPageNum(subsAreaQueryParam), PageFactory.getPageSize(subsAreaQueryParam));
public Page<PvDeviceVO> getPvDeviceList(DeviceQueryParam subsAreaQueryParam) {
Page<PvDeviceVO> page = new Page<>(PageFactory.getPageNum(subsAreaQueryParam), PageFactory.getPageSize(subsAreaQueryParam));
return this.baseMapper.getPvDeviceList(page,subsAreaQueryParam);
}
@Override
public List<PvDevice> getAllPvDeviceList() {
return this.list();
public List<PvDeviceVO> getAllPvDeviceList() {
return this.baseMapper.getAllPvDeviceList();
}
@Override
@@ -78,8 +79,8 @@ public class PvDeviceServiceImpl extends ServiceImpl<PvDeviceMapper, PvDevice> i
}
@Override
public boolean delPvDevice(String id) {
return this.removeById(id);
public boolean delPvDevice(List<String> ids) {
return this.removeByIds(ids);
}
@@ -87,7 +88,21 @@ public class PvDeviceServiceImpl extends ServiceImpl<PvDeviceMapper, PvDevice> i
* 校验单位名称是否重复
*/
private void checkNameAndParam(PvDeviceParam pvDeviceParam, boolean isUpdate) {
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());
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.po.pv.PvDistributed;
import com.njcn.device.pojo.po.pv.PvDistributed;
import com.njcn.device.pojo.vo.pv.PvDistributedVO;
import com.njcn.pvdevice.mapper.PvDistributedMapper;
import com.njcn.pvdevice.service.IPvDistributedService;
import com.njcn.pvdevice.service.IPvSubAreaService;
@@ -60,8 +61,8 @@ public class PvDistributedServiceImpl extends ServiceImpl<PvDistributedMapper, P
}
@Override
public Page<PvDistributed> getPvDistributedList(DistributedQueryParam distributedQueryParam) {
Page<PvDistributed> page = new Page<>(PageFactory.getPageNum(distributedQueryParam),PageFactory.getPageSize(distributedQueryParam));
public Page<PvDistributedVO> getPvDistributedList(DistributedQueryParam distributedQueryParam) {
Page<PvDistributedVO> page = new Page<>(PageFactory.getPageNum(distributedQueryParam),PageFactory.getPageSize(distributedQueryParam));
return this.baseMapper.getPvDistributedList(page,distributedQueryParam);
}
@@ -76,8 +77,8 @@ public class PvDistributedServiceImpl extends ServiceImpl<PvDistributedMapper, P
}
@Override
public boolean delPvDistributed(String id) {
return this.removeById(id);
public boolean delPvDistributed(List<String> ids) {
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.web.factory.PageFactory;
import lombok.RequiredArgsConstructor;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@@ -128,16 +129,16 @@ public class PvLineDetailServiceImpl extends ServiceImpl<PvLineDetailMapper, PvL
}
@Override
public boolean delPvLineDetail(String id) {
return this.removeById(id);
public boolean delPvLineDetail(List<String> ids) {
return this.removeByIds(ids);
}
@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);
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);
}*/
/*监测点类型*/
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);
}
/*校验台区*/
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())) {
//I类监测点
if (StrUtil.hasBlank(pvLineDetailParam.getSubstationId(), pvLineDetailParam.getVoltageId())) {
throw new BusinessException(PvDeviceResponseEnum.ONE_SUB_VOLTAGE_EMPTY);
@@ -206,8 +200,6 @@ public class PvLineDetailServiceImpl extends ServiceImpl<PvLineDetailMapper, PvL
}
} else if (DicDataEnum.TWO_LINE.getCode().equals(lineType.getCode())) {
//II类监测点
if (StrUtil.isNotBlank(pvLineDetailParam.getSubstationId()) || StrUtil.isNotBlank(pvLineDetailParam.getVoltageId())) {
@@ -225,7 +217,7 @@ public class PvLineDetailServiceImpl extends ServiceImpl<PvLineDetailMapper, PvL
}
/*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);
}
@@ -242,25 +234,38 @@ public class PvLineDetailServiceImpl extends ServiceImpl<PvLineDetailMapper, PvL
}
/*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);
}
}
/*校验台区*/
if (StrUtil.isNotBlank(pvLineDetailParam.getSubAreaId())) {
if (Objects.isNull(iPvSubAreaService.getPvSubAreaById(pvLineDetailParam.getSubAreaId()))) {
throw new BusinessException(PvDeviceResponseEnum.SUB_AREA_NULL);
}
}
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.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.service.IPvLvUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -60,8 +61,8 @@ public class PvLvUserServiceImpl extends ServiceImpl<PvLvUserMapper, PvLvUser> i
}
@Override
public Page<PvLvUser> getPvLvUserList(LvUserQueryParam lvUserQueryParam) {
Page<PvLvUser> page = new Page<>(PageFactory.getPageNum(lvUserQueryParam),PageFactory.getPageSize(lvUserQueryParam));
public Page<PvLvUserVO> getPvLvUserList(LvUserQueryParam lvUserQueryParam) {
Page<PvLvUserVO> page = new Page<>(PageFactory.getPageNum(lvUserQueryParam),PageFactory.getPageSize(lvUserQueryParam));
return this.baseMapper.getPvLvUserList(page,lvUserQueryParam);
}
@@ -76,8 +77,8 @@ public class PvLvUserServiceImpl extends ServiceImpl<PvLvUserMapper, PvLvUser> i
}
@Override
public boolean delPvLvUser(String id) {
return this.removeById(id);
public boolean delPvLvUser(List<String> ids) {
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.po.pv.PvSubArea;
import com.njcn.device.pojo.po.pv.PvSubArea;
import com.njcn.device.pojo.vo.pv.PvSubAreaVO;
import com.njcn.pvdevice.mapper.PvSubAreaMapper;
import com.njcn.pvdevice.service.IPvSubAreaService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -66,8 +67,8 @@ public class PvSubAreaServiceImpl extends ServiceImpl<PvSubAreaMapper, PvSubArea
}
@Override
public Page<PvSubArea> getPvSubAreaList(SubAreaQueryParam subsAreaQueryParam) {
Page<PvSubArea> page = new Page<>(PageFactory.getPageNum(subsAreaQueryParam),PageFactory.getPageSize(subsAreaQueryParam));
public Page<PvSubAreaVO> getPvSubAreaList(SubAreaQueryParam subsAreaQueryParam) {
Page<PvSubAreaVO> page = new Page<>(PageFactory.getPageNum(subsAreaQueryParam),PageFactory.getPageSize(subsAreaQueryParam));
return this.baseMapper.getPvSubAreaList(page,subsAreaQueryParam);
}
@@ -82,8 +83,8 @@ public class PvSubAreaServiceImpl extends ServiceImpl<PvSubAreaMapper, PvSubArea
}
@Override
public boolean delPvSubArea(String id) {
return this.removeById(id);
public boolean delPvSubArea(List<String> ids) {
return this.removeByIds(ids);
}

View File

@@ -1,5 +1,6 @@
package com.njcn.pvdevice.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -30,6 +31,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
@@ -71,6 +73,11 @@ public class PvSubstationServiceImpl extends ServiceImpl<PvSubstationMapper, PvS
@Override
public Page<PvSubstationVO> getPvSubstationList(SubstationQueryParam 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);
}
@@ -85,8 +92,8 @@ public class PvSubstationServiceImpl extends ServiceImpl<PvSubstationMapper, PvS
}
@Override
public boolean delPvSubstation(String id) {
return this.removeById(id);
public boolean delPvSubstation(List<String> ids) {
return this.removeByIds(ids);
}
@@ -111,6 +118,21 @@ public class PvSubstationServiceImpl extends ServiceImpl<PvSubstationMapper, PvS
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();
if(Objects.isNull(dictData)){
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.po.pv.PvTenVoltage;
import com.njcn.device.pojo.po.pv.PvTenVoltage;
import com.njcn.device.pojo.vo.pv.PvTenVoltageVO;
import com.njcn.pvdevice.mapper.PvTenVoltageMapper;
import com.njcn.pvdevice.service.IPvTenVoltageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -21,6 +22,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
/**
@@ -56,19 +58,24 @@ public class PvTenVoltageServiceImpl extends ServiceImpl<PvTenVoltageMapper, PvT
}
@Override
public Page<PvTenVoltage> getPvTenVoltageList(TenVoltageQueryParam tenVoltageQueryParam) {
Page<PvTenVoltage> page = new Page<>(PageFactory.getPageNum(tenVoltageQueryParam),PageFactory.getPageSize(tenVoltageQueryParam));
public Page<PvTenVoltageVO> getPvTenVoltageList(TenVoltageQueryParam tenVoltageQueryParam) {
Page<PvTenVoltageVO> page = new Page<>(PageFactory.getPageNum(tenVoltageQueryParam),PageFactory.getPageSize(tenVoltageQueryParam));
return this.baseMapper.getPvTenVoltageList(page,tenVoltageQueryParam);
}
@Override
public List<PvTenVoltage> getAllPvTenVoltageList(){
return this.list();
}
@Override
public PvTenVoltage getPvTenVoltageById(String id) {
return this.getById(id);
}
@Override
public boolean delPvTenVoltage(String id) {
return this.removeById(id);
public boolean delPvTenVoltage(List<String> ids) {
return this.removeByIds(ids);
}

View File

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

View File

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

View File

@@ -60,4 +60,11 @@ public interface DeptFeignClient {
@GetMapping("/getDeptById")
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());
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();
/**
* 根据部门id获取所有子部门id集合
* @author cdf
* @date 2022/7/26
*/
List<String> getDeptSonIds(@Param("deptId") String deptId);
}

View File

@@ -155,9 +155,14 @@
</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>
<select id="getDeptSonIds" resultType="String">
select id from sys_dept where find_in_set(#{deptId},pids) and state = 1
</select>
</mapper>

View File

@@ -147,4 +147,12 @@ public interface IDeptService extends IService<Dept> {
* @date 2022/7/13
*/
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));
}).collect(Collectors.toList());
}
/**
* 根据部门id获取部门详情
*/
@Override
public List<String> getDepSonIdtByDeptId(String id){
return this.baseMapper.getDeptSonIds(id);
}
}