1.字典表 终端类型改为型号 2.分布式光伏台账
This commit is contained in:
@@ -7,9 +7,12 @@ import com.njcn.web.utils.HttpServletUtil;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.poi.hssf.usermodel.DVConstraint;
|
import org.apache.poi.hssf.usermodel.DVConstraint;
|
||||||
import org.apache.poi.hssf.usermodel.HSSFDataValidation;
|
import org.apache.poi.hssf.usermodel.HSSFDataValidation;
|
||||||
|
import org.apache.poi.ss.usermodel.DataValidationHelper;
|
||||||
import org.apache.poi.ss.usermodel.Sheet;
|
import org.apache.poi.ss.usermodel.Sheet;
|
||||||
import org.apache.poi.ss.usermodel.Workbook;
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
import org.apache.poi.ss.util.CellRangeAddressList;
|
import org.apache.poi.ss.util.CellRangeAddressList;
|
||||||
|
import org.apache.poi.xssf.usermodel.XSSFDataValidation;
|
||||||
|
import org.apache.poi.xssf.usermodel.XSSFDataValidationConstraint;
|
||||||
|
|
||||||
import javax.servlet.ServletOutputStream;
|
import javax.servlet.ServletOutputStream;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
@@ -96,13 +99,15 @@ public class ExcelUtil {
|
|||||||
Sheet sheet = workbook.getSheetAt(0);
|
Sheet sheet = workbook.getSheetAt(0);
|
||||||
// 生成下拉列表
|
// 生成下拉列表
|
||||||
// 只对(x,x)单元格有效
|
// 只对(x,x)单元格有效
|
||||||
CellRangeAddressList cellRangeAddressList = new CellRangeAddressList(3, 65535, firstCol, lastCol);
|
CellRangeAddressList cellRangeAddressList = new CellRangeAddressList(2, 65535, firstCol, lastCol);
|
||||||
// 生成下拉框内容
|
// 生成下拉框内容
|
||||||
DVConstraint dvConstraint = DVConstraint.createExplicitListConstraint(strings);
|
DataValidationHelper dvHelper = sheet.getDataValidationHelper();
|
||||||
HSSFDataValidation dataValidation = new HSSFDataValidation(cellRangeAddressList, dvConstraint);
|
XSSFDataValidationConstraint dvConstraint = (XSSFDataValidationConstraint)
|
||||||
|
dvHelper.createExplicitListConstraint(strings);
|
||||||
|
XSSFDataValidation validation =(XSSFDataValidation)dvHelper.createValidation(
|
||||||
|
dvConstraint, cellRangeAddressList);
|
||||||
// 对sheet页生效
|
// 对sheet页生效
|
||||||
sheet.addValidationData(dataValidation);
|
sheet.addValidationData(validation);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ public class Knife4jSwaggerConfig {
|
|||||||
List<String> controllerPath = Stream.of(
|
List<String> controllerPath = Stream.of(
|
||||||
"com.njcn.user.controller",
|
"com.njcn.user.controller",
|
||||||
"com.njcn.device.controller",
|
"com.njcn.device.controller",
|
||||||
|
"com.njcn.pvdevice.controller",
|
||||||
"com.njcn.auth.controller",
|
"com.njcn.auth.controller",
|
||||||
"com.njcn.system.controller",
|
"com.njcn.system.controller",
|
||||||
"com.njcn.harmonic.controller",
|
"com.njcn.harmonic.controller",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package com.njcn.web.pojo.annotation;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* pqs
|
* pqs
|
||||||
*
|
* 校验前台传的时间格式是否正确
|
||||||
* @author cdf
|
* @author cdf
|
||||||
* @date 2022/1/11
|
* @date 2022/1/11
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<module>common-web</module>
|
<module>common-web</module>
|
||||||
<module>common-autocode</module>
|
<module>common-autocode</module>
|
||||||
<module>common-influxdb</module>
|
<module>common-influxdb</module>
|
||||||
<!-- <module>common-echarts</module>-->
|
<module>common-poi</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public enum DeviceResponseEnum {
|
|||||||
NODE_INFO_FAIL("A0261","前置机服务器为空"),
|
NODE_INFO_FAIL("A0261","前置机服务器为空"),
|
||||||
|
|
||||||
|
|
||||||
SUBV_NAME_REPETITION("A0262","母线名称重复"),
|
SUBV_NAME_REPETITION("A0262","同一变电站下母线名称重复"),
|
||||||
SUBV_NAME_SAME("A0263","母线名称已存在"),
|
SUBV_NAME_SAME("A0263","母线名称已存在"),
|
||||||
SUBV_NO("A0264","母线不存在"),
|
SUBV_NO("A0264","母线不存在"),
|
||||||
|
|
||||||
@@ -52,9 +52,12 @@ public enum DeviceResponseEnum {
|
|||||||
|
|
||||||
DEVICE_LINE_BIG("A0268","每台装置下监测点数量最多6个"),
|
DEVICE_LINE_BIG("A0268","每台装置下监测点数量最多6个"),
|
||||||
|
|
||||||
|
|
||||||
DEVICE_UNKNOWN_ERROR("A0269","终端服务未知异常"),
|
DEVICE_UNKNOWN_ERROR("A0269","终端服务未知异常"),
|
||||||
|
|
||||||
PARENT_INDEX_LACK("A0270","索引和实体同时存在"),
|
PARENT_INDEX_LACK("A0270","索引和实体同时存在"),
|
||||||
|
DEVICE_VOLTAGE_BIG("A0271","每台装置下母线数量最多6个"),
|
||||||
|
VOLTAGE_NUM_USE("A0272","母线序号已存在"),
|
||||||
REQUEST_DATA_ERROR("A2071","请求体格式有误"),
|
REQUEST_DATA_ERROR("A2071","请求体格式有误"),
|
||||||
DEPT_LINE_EMPTY("A2072","当前用户部门未有监测点绑定"),
|
DEPT_LINE_EMPTY("A2072","当前用户部门未有监测点绑定"),
|
||||||
DIC_GET_EMPTY("A2073","字典获取为空"),
|
DIC_GET_EMPTY("A2073","字典获取为空"),
|
||||||
@@ -63,12 +66,13 @@ public enum DeviceResponseEnum {
|
|||||||
|
|
||||||
INVALID_LEVEL("A2074","非法拓扑等级"),
|
INVALID_LEVEL("A2074","非法拓扑等级"),
|
||||||
LINE_EMPTY("A2075","监测点为空"),
|
LINE_EMPTY("A2075","监测点为空"),
|
||||||
|
|
||||||
/*excel相关*/
|
/*excel相关*/
|
||||||
Excel_ERROR("A2080","excel解析异常"),
|
Excel_ERROR("A2080","excel解析异常"),
|
||||||
|
|
||||||
FLOW_SAME_NAME("A0350","当前名称已存在"),
|
FLOW_SAME_NAME("A0350","当前名称已存在"),
|
||||||
FLOW_FLAG("A0351","默认类型已存在"),
|
FLOW_FLAG("A0351","默认类型已存在"),
|
||||||
FLOW_ERROR("A0352","占比参数异常");
|
FLOW_ERROR("A0352","占比参数异常")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -76,6 +80,10 @@ public enum DeviceResponseEnum {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package com.njcn.device.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
* 终端枚举
|
||||||
|
* @author cdf
|
||||||
|
* @date 2021/6/21
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum PvDeviceResponseEnum {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A0350 ~ A0450 用于pv终端模块的枚举
|
||||||
|
*/
|
||||||
|
UNIT_REPEAT("A0350","单位名称重复"),
|
||||||
|
SUBSTATION_REPEAT("A0351","变电站名称重复"),
|
||||||
|
TEN_VOLTAGE_REPEAT("A0352","10kV线路名称重复"),
|
||||||
|
VOLTAGE_REPEAT("A0352","母线名称重复"),
|
||||||
|
SUB_AREA_REPEAT("A0353","台区名称重复"),
|
||||||
|
SUB_NUM_REPEAT("A0354","母线号重复"),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
TEN_VOLTAGE_NULL("A0360","未查询到指定10kV线路"),
|
||||||
|
UNIT_NULL("A0361","未查询到指定单位"),
|
||||||
|
SUB_AREA_NULL("A0362","未查询到指定台区"),
|
||||||
|
DEV_NULL("A0363","未查询到指定终端")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private final String code;
|
||||||
|
|
||||||
|
private final String message;
|
||||||
|
|
||||||
|
PvDeviceResponseEnum(String code, String message) {
|
||||||
|
this.code = code;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -81,7 +81,7 @@ public class OracleTerminalExcel implements Serializable {
|
|||||||
@NotNull(message = "定检状态不能为空")
|
@NotNull(message = "定检状态不能为空")
|
||||||
private Integer checkFlag;
|
private Integer checkFlag;
|
||||||
|
|
||||||
@Excel(name = "终端类型", width = 15)
|
@Excel(name = "终端型号", width = 15)
|
||||||
@NotBlank(message = "设备型号不能为空")
|
@NotBlank(message = "设备型号不能为空")
|
||||||
private String devType;
|
private String devType;
|
||||||
|
|
||||||
|
|||||||
@@ -74,12 +74,12 @@ public class TerminalBaseExcel implements Serializable {
|
|||||||
@NotBlank(message = "终端厂家不能为空")
|
@NotBlank(message = "终端厂家不能为空")
|
||||||
private String manufacturer;
|
private String manufacturer;
|
||||||
|
|
||||||
@Excel(name = "终端类型", width = 15)
|
@Excel(name = "设备型号", width = 15)
|
||||||
@NotBlank(message = "设备型号不能为空")
|
@NotBlank(message = "设备型号不能为空")
|
||||||
private String devType;
|
private String devType;
|
||||||
|
|
||||||
@Excel(name = "网络参数", width = 15)
|
@Excel(name = "网络参数", width = 15)
|
||||||
@NotBlank(message = "设备ip不能为空")
|
@NotBlank(message = "设备网络参数不能为空")
|
||||||
private String ip;
|
private String ip;
|
||||||
|
|
||||||
@Excel(name = "端口", width = 15)
|
@Excel(name = "端口", width = 15)
|
||||||
@@ -112,7 +112,7 @@ public class TerminalBaseExcel implements Serializable {
|
|||||||
private String sim;
|
private String sim;
|
||||||
|
|
||||||
@Excel(name = "母线", width = 15)
|
@Excel(name = "母线", width = 15)
|
||||||
@NotBlank(message = "母线不能为空")
|
@NotBlank(message = "母线名称不能为空")
|
||||||
private String subvName;
|
private String subvName;
|
||||||
|
|
||||||
@Excel(name = "母线号", width = 15)
|
@Excel(name = "母线号", width = 15)
|
||||||
@@ -127,9 +127,6 @@ public class TerminalBaseExcel implements Serializable {
|
|||||||
@NotNull(message = "母线模型不为空")
|
@NotNull(message = "母线模型不为空")
|
||||||
private Integer subvModel;
|
private Integer subvModel;
|
||||||
|
|
||||||
@Excel(name = "监测点索引", width = 15)
|
|
||||||
@NotNull(message = "监测点索引不能为空")
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
@Excel(name = "监测点名称", width = 15)
|
@Excel(name = "监测点名称", width = 15)
|
||||||
@NotBlank(message = "监测点名称不能为空")
|
@NotBlank(message = "监测点名称不能为空")
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class VersionParam {
|
|||||||
private LocalDate date;
|
private LocalDate date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 装置系列(终端类型),字典表
|
* 装置系列(终端型号),字典表
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty("装置系列(终端类型)")
|
@ApiModelProperty("装置系列(终端类型)")
|
||||||
private String devType;
|
private String devType;
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
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 java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/6
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class DeviceQueryParam extends BaseParam {
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "manufacturer",name = "制造厂商")
|
||||||
|
private List<String> manufacturer;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "devType",name = "设备类型")
|
||||||
|
private List<String> devType;
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
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 java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/6
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class DistributedQueryParam extends BaseParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "name",name = "分布式光伏台账名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "scale",name = "电压等级")
|
||||||
|
private List<String> scale;
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/6
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class LineDetailQueryParam extends BaseParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "scale",name = "分布式光伏台账名称",required = true)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "scale",name = "电压等级")
|
||||||
|
private String scale;
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
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 java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/6
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class LvUserQueryParam extends BaseParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "scale",name = "低压侧台账名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "userCode",name = "用户编号")
|
||||||
|
private String userCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "scale",name = "电压等级")
|
||||||
|
private List<String> scale;
|
||||||
|
}
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
package com.njcn.device.pojo.param.pv;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.common.pojo.constant.PatternRegex;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import com.njcn.web.constant.ValidMessage;
|
||||||
|
import com.njcn.web.pojo.annotation.DateTimeStrValid;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Pattern;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("pv_device")
|
||||||
|
public class PvDeviceParam implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终端类型(电能质量监测终端、智能电表、智能融合终端),字典表
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "type",value = "终端类型(电能质量监测终端、智能电表、智能融合终端),字典表",required = true)
|
||||||
|
@NotBlank(message = "终端类型不可为空")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于保存PMS中电能质量监测终端Id、智能融合终端Id,智能电表Id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "devCode",value = "用于保存PMS中电能质量监测终端Id、智能融合终端Id,智能电表Id",required = true)
|
||||||
|
@NotBlank(message = "终端Id不能为空")
|
||||||
|
private String devCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终端Ip
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "ip",value = "终端Ip",required = true)
|
||||||
|
@NotBlank(message = "终端Ip不能为空")
|
||||||
|
private String ip;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 端口
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "port",value = "端口",required = true)
|
||||||
|
@NotNull(message = "端口不能为空")
|
||||||
|
private Integer port;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终端型号(570、580……)字典表
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "devType",value = "终端型号(570、580……)字典表")
|
||||||
|
private String devType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备制造商,字典表
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "manufacturer",value = "设备制造商,字典表",required = true)
|
||||||
|
@NotBlank(message = "设备制造商不能为空")
|
||||||
|
private String manufacturer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装置识别码(3ds加密)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "series",value = "装置识别码(3ds加密)")
|
||||||
|
private String series;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装置秘钥(3ds加密)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "devKey",value = "装置秘钥(3ds加密)")
|
||||||
|
private String devKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本次定检时间,默认等于投运时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "thisTimeCheck",value = "本次定检时间,默认等于投运时间",required = true)
|
||||||
|
@NotBlank(message = "本次定检时间不能为空")
|
||||||
|
@DateTimeStrValid(message = "本次定检时间格式错误")
|
||||||
|
private String thisTimeCheck;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下次定检时间,默认为投运时间后推3年,假如时间小于3个月则为待检
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "nextTimeCheck",value = "下次定检时间,默认为投运时间后推3年,假如时间小于3个月则为待检",required = true)
|
||||||
|
@NotBlank(message = "下次定检时间不能为空")
|
||||||
|
@DateTimeStrValid(message = "下次定检时间格式错误")
|
||||||
|
private String nextTimeCheck;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class UpdatePvDeviceParam extends PvDeviceParam{
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||||
|
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||||
|
private String id;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.njcn.device.pojo.param.pv;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("pv_dispatch")
|
||||||
|
public class PvDispatchParam implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调度表Id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调度名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
package com.njcn.device.pojo.param.pv;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.common.pojo.constant.PatternRegex;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import com.njcn.web.constant.ValidMessage;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.Pattern;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-06
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PvDistributedParam implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分布式光伏名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "name",value = "分布式光伏名称",required = true)
|
||||||
|
@NotBlank(message = "分布式光伏名称不可为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户编号(与低压用户台账表低压用户编号字段一致)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "userCode",value = "用户编号",required = true)
|
||||||
|
@NotBlank(message = "用户编号不可为空")
|
||||||
|
private String userCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终端编号
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "devCode",value = "终端编号")
|
||||||
|
private String devCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 并网电压等级Id,字典表
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "scale",value = "并网电压等级Id,字典表")
|
||||||
|
private String scale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装机容量(KVA)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "machineCapacity",value = "装机容量(KVA)")
|
||||||
|
private Float machineCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上网方式
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "inteType",value = "上网方式")
|
||||||
|
private String inteType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接入相别
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "phase",value = "接入相别")
|
||||||
|
private String phase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 储能配置容量(KVA)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "energyCapacity",value = "储能配置容量(KVA)")
|
||||||
|
private Float energyCapacity;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class UpdatePvDistributedParam extends PvDistributedParam{
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||||
|
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||||
|
private String id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,239 @@
|
|||||||
|
package com.njcn.device.pojo.param.pv;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.common.pojo.constant.PatternRegex;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import com.njcn.web.constant.ValidMessage;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.Pattern;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PvLineDetailParam implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属终端
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "",required = true)
|
||||||
|
private String devId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点类型(I类监测点、II类监测点、III类监测点),字典表
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "",required = true)
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属变电站(I类监测点)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "",required = true)
|
||||||
|
private String substationId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属母线名称(I类监测点)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private String voltageId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属台区ID(II类监测点)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private String subAreaId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属分布式光伏台账(III类监测点)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private String distributedId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属低压用户台账(III类监测点)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private String lvUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 线路号(在同一台设备中的监测点号)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private Integer num;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PT一次变比
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private Float pt1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PT二次变比
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private Float pt2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CT一次变比
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private Float ct1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CT二次变比
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private Float ct2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备容量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private Float devCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 短路容量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private Float shortCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基准容量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private Float standardCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 协议容量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private Float dealCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接线类型(0:星型接法;1:三角型接法;2:开口三角型接法)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private Integer ptType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测量间隔(1-10分钟)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private Integer timeInterval;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 干扰源类型,字典表
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private String loadType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行业类型,字典表
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private String businessType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网公司谐波监测平台标志(0-否;1-是),默认否
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private Integer monitorFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电网标志(0-电网侧;1-非电网侧)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private Integer powerFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国网谐波监测平台监测点号
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private String monitorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点对象名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private String objName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人为干预是否参与统计(0:不参与,1:参与)默认参与统计
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private Integer statFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压互感器类型,字典表
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private String tfType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属变压器编号
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private String tfCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 中性点接地方式,字典表
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private String groundType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 投运日期
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private String putIn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接入日期
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private String access;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否专项供电(0:否,1:是)默认参与统计
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "",value = "")
|
||||||
|
private Integer powerSupply;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class UpdatePvLineDetailParam extends PvLineDetailParam{
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||||
|
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||||
|
private String id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
package com.njcn.device.pojo.param.pv;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.common.pojo.constant.PatternRegex;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import com.njcn.web.constant.ValidMessage;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.Pattern;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PvLvUserParam implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 低压用户编号(营销系统中查出)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "userCode",value = "低压用户编号")
|
||||||
|
@NotBlank(message = "低压用户编号不为空")
|
||||||
|
private String userCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 低压用户名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "name",value = "低压用户名称")
|
||||||
|
@NotBlank(message = "低压用户名称不为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户协议容量(kVA)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "userCapacity",value = "用户协议容量")
|
||||||
|
private Float userCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否发生过投诉
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "complain",value = "是否发生过投诉")
|
||||||
|
private Integer complain;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 投诉内容
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "complainPart",value = "投诉内容")
|
||||||
|
private String complainPart;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 整改措施
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "corrective",value = "整改措施")
|
||||||
|
private String corrective;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否有治理装置
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "devGovern",value = "是否有治理装置")
|
||||||
|
private Integer devGovern;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 治理装置类型
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "governType",value = "治理装置类型")
|
||||||
|
private String governType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 治理装置电压等级
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "scale",value = "治理装置电压等级")
|
||||||
|
private String scale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 治理装置容量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "governCapacity",value = "治理装置容量")
|
||||||
|
private Float governCapacity;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class UpdatePvLvUserParam extends PvLvUserParam{
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||||
|
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||||
|
private String id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,148 @@
|
|||||||
|
package com.njcn.device.pojo.param.pv;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.common.pojo.constant.PatternRegex;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import com.njcn.web.constant.ValidMessage;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Pattern;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PvSubAreaParam implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属10kV线路表Id(外键)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "tenVoltageId",value = "所属10kV线路表Id",required = true)
|
||||||
|
@NotBlank(message = "所属10kV线路表Id不可为空")
|
||||||
|
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = "所属10kV线路表Id格式有误")
|
||||||
|
private String tenVoltageId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属单位Id(台区所属的单位和变电站所属单位可能不是一个单位)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "unitId",value = "所属单位Id",required = true)
|
||||||
|
@NotBlank(message = "所属单位Id不可为空")
|
||||||
|
private String unitId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 台区名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "name",value = "台区名称",required = true)
|
||||||
|
@NotBlank(message = "台区名称不可为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 台区编号
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "code",value = "台区编号",required = true)
|
||||||
|
@NotBlank(message = "台区编号不可为空")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电缆长度字段
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "cableLength",value = "电缆长度字段")
|
||||||
|
private Double cableLength;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电阻
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "resistance",value = "电阻")
|
||||||
|
private Double resistance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电抗
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "reactance",value = "电抗")
|
||||||
|
private Double reactance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变压器型号
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "type",value = "变压器型号")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变压器容量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "capacity",value = "变压器容量")
|
||||||
|
private Float capacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变压器调压方式
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "regulationMode",value = "变压器调压方式")
|
||||||
|
private Integer regulationMode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 台区无功补偿容量(KVA)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "reactCapacity",value = "台区无功补偿容量(KVA)")
|
||||||
|
private Float reactCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否安装智能融合终端
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "devFusion",value = "是否安装智能融合终端")
|
||||||
|
private Boolean devFusion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否有分布式光伏接入
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "pv",value = "是否有分布式光伏接入")
|
||||||
|
private Boolean pv;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分布式光伏总装机容量(KVA)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "totalC",value = "分布式光伏总装机容量(KVA)")
|
||||||
|
private Float totalC;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分布式光伏用户数量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "pvUsers",value = "分布式光伏用户数量")
|
||||||
|
private Integer pvUsers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 其他分布式电源装置容量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "powerPower",value = "其他分布式电源装置容量")
|
||||||
|
private Float powerPower;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class UpdatePvSubAreaParam extends PvSubAreaParam{
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||||
|
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||||
|
private String id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
package com.njcn.device.pojo.param.pv;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.common.pojo.constant.PatternRegex;
|
||||||
|
import com.njcn.web.constant.ValidMessage;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Pattern;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PvSubstationParam implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属单位Id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "unitId",value = "所属单位Id",required = true)
|
||||||
|
@NotBlank(message = "所属单位Id不能为空")
|
||||||
|
private String unitId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变电站名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "name",value = "变电站名称",required = true)
|
||||||
|
@NotBlank(message = "变电站名称不能为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压等级Id,字典表
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "scale",value = "电压等级Id",required = true)
|
||||||
|
@NotBlank(message = "电压等级不能为空")
|
||||||
|
private String scale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变电站总容量(MVA)(手动填写)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "totalCapacity",value = "变电站总容量",required = true)
|
||||||
|
@NotNull(message = "变电站总容量不能为空")
|
||||||
|
private Double totalCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维班组Code
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "teamCode",value = "运维班组Code",required = true)
|
||||||
|
@NotBlank(message = "运维班组Code不能为空")
|
||||||
|
private String teamCode;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class UpdatePvSubstationParam extends PvSubstationParam{
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||||
|
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||||
|
private String id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,154 @@
|
|||||||
|
package com.njcn.device.pojo.param.pv;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.common.pojo.constant.PatternRegex;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import com.njcn.web.constant.ValidMessage;
|
||||||
|
import com.njcn.web.pojo.annotation.DateTimeStrValid;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.Pattern;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PvTenVoltageParam implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调度表Id(外键)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "dispatchId",value = "调度表Id",required = true)
|
||||||
|
@NotBlank(message = "调度表Id不能为空")
|
||||||
|
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = "id格式违规")
|
||||||
|
private String dispatchId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 线路名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "name",value = "线路名称",required = true)
|
||||||
|
@NotBlank(message = "线路名称不能为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 跨区域类型
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "crType",value = "跨区域类型")
|
||||||
|
private String crType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压等级Id,字典表
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "scale",value = "电压等级Id,字典表")
|
||||||
|
private String scale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设计电压等级Id,字典表
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "designScale",value = "设计电压等级Id,字典表")
|
||||||
|
private String designScale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备状态
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "devStatus",value = "设备状态")
|
||||||
|
private Integer devStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否接地极(0:false;1:true)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "earthing",value = "是否接地极(0:false;1:true)")
|
||||||
|
private Boolean earthing;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 线路性质
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "quality",value = "线路性质")
|
||||||
|
private String quality;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属主线
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "masterStroke",value = "所属主线")
|
||||||
|
private String masterStroke;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 专业分类
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "major",value = "专业分类")
|
||||||
|
private String major;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备主人
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "master",value = "设备主人")
|
||||||
|
private String master;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 起点电站
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "startStation",value = "起点电站")
|
||||||
|
private String startStation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终点电站
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "endStation",value = "终点电站")
|
||||||
|
private String endStation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运行负载限额
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "runLoad",value = "运行负载限额")
|
||||||
|
private Float runLoad;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 额定输出功率
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "outputPower",value = "额定输出功率")
|
||||||
|
private Float outputPower;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最大允许电流
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "maxCurrent",value = "最大允许电流")
|
||||||
|
private Float maxCurrent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 投运日期
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "putIntoDate",value = "投运日期")
|
||||||
|
@DateTimeStrValid(message = "投运时间格式错误",format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private String putIntoDate;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class UpdatePvTenVoltageParam extends PvTenVoltageParam{
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||||
|
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||||
|
private String id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package com.njcn.device.pojo.param.pv;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.common.pojo.constant.PatternRegex;
|
||||||
|
import com.njcn.web.constant.ValidMessage;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.Pattern;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PvUnitParam implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 父节点(0为根节点)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "pid",value = "父节点(0为根节点)")
|
||||||
|
@NotBlank(message = "父节点id不能为空")
|
||||||
|
private String pid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "name",value = "单位名称")
|
||||||
|
@NotBlank(message = "单位名称不能为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位编码
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "code",value = "单位编码")
|
||||||
|
@NotBlank(message = "单位编码不能为空")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class UpdatePvUnitParam extends PvUnitParam{
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||||
|
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||||
|
private String id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
package com.njcn.device.pojo.param.pv;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.common.pojo.constant.PatternRegex;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import com.njcn.web.constant.ValidMessage;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PvVoltageParam implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 母线名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "母线名称",required = true)
|
||||||
|
@NotBlank(message = "母线名称不可为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 母线号(在同一台设备中的电压通道号)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "母线号(在同一台设备中的电压通道号)",required = true)
|
||||||
|
@NotNull(message = "母线号不可为空")
|
||||||
|
@Range(min = 1,max = 6,message = "选择1-6路母线号线路")
|
||||||
|
private Integer num;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压等级Id,字典表
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "电压等级Id,字典表",required = true)
|
||||||
|
@NotBlank(message = "电压等级不可为空")
|
||||||
|
private String scale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 母线模型(0:虚拟母线;1:实际母线)默认是实际母线
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "母线模型(0:虚拟母线;1:实际母线)默认是实际母线",required = true)
|
||||||
|
@NotNull(message = "母线模型不可为空")
|
||||||
|
private Integer model;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class UpdatePvVoltageParam extends PvVoltageParam{
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||||
|
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||||
|
private String id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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 java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/6
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class SubAreaQueryParam extends BaseParam {
|
||||||
|
|
||||||
|
@ApiModelProperty("所属10kV线路id")
|
||||||
|
private List<String> tenVoltageId;
|
||||||
|
|
||||||
|
@ApiModelProperty("所属单位id")
|
||||||
|
private List<String> unitId;
|
||||||
|
|
||||||
|
@ApiModelProperty("台区名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否接入")
|
||||||
|
private Boolean isJoin;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
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 java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class SubstationQueryParam extends BaseParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "单位id",name = "unitId")
|
||||||
|
private List<String> unitId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "电压等级",name = "scale")
|
||||||
|
private List<String> scale;
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
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 java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class TenVoltageQueryParam extends BaseParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "scale",value = "电压等级")
|
||||||
|
private List<String> scale;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "designScale",value = "电压等级")
|
||||||
|
private List<String> designScale;
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/6
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class VoltageQueryParam extends BaseParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "scale",name = "母线名称",required = true)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "scale",name = "电压等级")
|
||||||
|
private String scale;
|
||||||
|
}
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
package com.njcn.device.pojo.po.pv;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("pv_device")
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class PvDevice extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终端台账表Id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终端类型(电能质量监测终端、智能电表、智能融合终端),字典表
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于保存PMS中电能质量监测终端Id、智能融合终端Id,智能电表Id
|
||||||
|
*/
|
||||||
|
private String devCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终端Ip
|
||||||
|
*/
|
||||||
|
private String ip;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 端口
|
||||||
|
*/
|
||||||
|
private Integer port;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终端型号(570、580……)字典表
|
||||||
|
*/
|
||||||
|
private String devType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备制造商,字典表
|
||||||
|
*/
|
||||||
|
private String manufacturer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装置识别码(3ds加密)
|
||||||
|
*/
|
||||||
|
private String series;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装置秘钥(3ds加密)
|
||||||
|
*/
|
||||||
|
private String devKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本次定检时间,默认等于投运时间
|
||||||
|
*/
|
||||||
|
private LocalDate thisTimeCheck;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下次定检时间,默认为投运时间后推3年,假如时间小于3个月则为待检
|
||||||
|
*/
|
||||||
|
private LocalDate nextTimeCheck;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private Integer state;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.njcn.device.pojo.po.pv;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("pv_dispatch")
|
||||||
|
public class PvDispatch extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调度表Id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调度名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
package com.njcn.device.pojo.po.pv;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-06
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("pv_distributed")
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class PvDistributed extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分布式光伏台账表Id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属台区表Id(外键)
|
||||||
|
*/
|
||||||
|
private String subAreaId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分布式光伏名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户编号(与低压用户台账表低压用户编号字段一致)
|
||||||
|
*/
|
||||||
|
private String userCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终端编号
|
||||||
|
*/
|
||||||
|
private String devCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 并网电压等级Id,字典表
|
||||||
|
*/
|
||||||
|
private String scale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装机容量(KVA)
|
||||||
|
*/
|
||||||
|
private Float machineCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上网方式
|
||||||
|
*/
|
||||||
|
private String inteType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接入相别
|
||||||
|
*/
|
||||||
|
private String phase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 储能配置容量(KVA)
|
||||||
|
*/
|
||||||
|
private Float energyCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private Integer state;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,201 @@
|
|||||||
|
package com.njcn.device.pojo.po.pv;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("pv_line_detail")
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class PvLineDetail extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点序号
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属终端
|
||||||
|
*/
|
||||||
|
private String devId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点类型(I类监测点、II类监测点、III类监测点),字典表
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属变电站(I类监测点)
|
||||||
|
*/
|
||||||
|
private String substationId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属母线名称(I类监测点)
|
||||||
|
*/
|
||||||
|
private String voltageId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属台区ID(II类监测点)
|
||||||
|
*/
|
||||||
|
private String subAreaId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属分布式光伏台账(III类监测点)
|
||||||
|
*/
|
||||||
|
private String distributedId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属低压用户台账(III类监测点)
|
||||||
|
*/
|
||||||
|
private String lvUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 线路号(在同一台设备中的监测点号)
|
||||||
|
*/
|
||||||
|
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 LocalDateTime putIn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接入日期
|
||||||
|
*/
|
||||||
|
private LocalDateTime access;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否专项供电(0:否,1:是)默认参与统计
|
||||||
|
*/
|
||||||
|
private Integer powerSupply;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private Integer state;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
package com.njcn.device.pojo.po.pv;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("pv_lv_user")
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class PvLvUser extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 低压用户台账表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 Float governCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private Integer state;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
package com.njcn.device.pojo.po.pv;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("pv_sub_area")
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class PvSubArea extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 台区表Id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属10kV线路表Id(外键)
|
||||||
|
*/
|
||||||
|
private String tenVoltageId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属单位Id(台区所属的单位和变电站所属单位可能不是一个单位)
|
||||||
|
*/
|
||||||
|
private String unitId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 台区名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 台区编号
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电缆长度字段
|
||||||
|
*/
|
||||||
|
private Double cableLength;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电阻
|
||||||
|
*/
|
||||||
|
private Double resistance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电抗
|
||||||
|
*/
|
||||||
|
private Double reactance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变压器型号
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变压器容量
|
||||||
|
*/
|
||||||
|
private Float capacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变压器调压方式
|
||||||
|
*/
|
||||||
|
private Integer regulationMode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 台区无功补偿容量(KVA)
|
||||||
|
*/
|
||||||
|
private Float reactCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否安装智能融合终端
|
||||||
|
*/
|
||||||
|
private Boolean devFusion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否有分布式光伏接入
|
||||||
|
*/
|
||||||
|
private Boolean pv;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分布式光伏总装机容量(KVA)
|
||||||
|
*/
|
||||||
|
private Float totalC;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分布式光伏用户数量
|
||||||
|
*/
|
||||||
|
private Integer pvUsers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 其他分布式电源装置容量
|
||||||
|
*/
|
||||||
|
private Float powerPower;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private Integer state;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package com.njcn.device.pojo.po.pv;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("pv_substation")
|
||||||
|
public class PvSubstation {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变电站表Id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属单位Id
|
||||||
|
*/
|
||||||
|
private String unitId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变电站名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压等级Id,字典表
|
||||||
|
*/
|
||||||
|
private String scale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变电站总容量(MVA)(手动填写)
|
||||||
|
*/
|
||||||
|
private Double totalCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维班组Code
|
||||||
|
*/
|
||||||
|
private String teamCode;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
package com.njcn.device.pojo.po.pv;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("pv_ten_voltage")
|
||||||
|
public class PvTenVoltage extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 线路表Id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调度表Id(外键)
|
||||||
|
*/
|
||||||
|
private String dispatchId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 线路名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 跨区域类型
|
||||||
|
*/
|
||||||
|
private String crType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压等级Id,字典表
|
||||||
|
*/
|
||||||
|
private String scale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设计电压等级Id,字典表
|
||||||
|
*/
|
||||||
|
private String designScale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备状态
|
||||||
|
*/
|
||||||
|
private Integer devStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否接地极(0:false;1:true)
|
||||||
|
*/
|
||||||
|
private Boolean earthing;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 线路性质
|
||||||
|
*/
|
||||||
|
private String quality;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属主线
|
||||||
|
*/
|
||||||
|
private String masterStroke;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 专业分类
|
||||||
|
*/
|
||||||
|
private String major;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备主人
|
||||||
|
*/
|
||||||
|
private String master;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 起点电站
|
||||||
|
*/
|
||||||
|
private String startStation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终点电站
|
||||||
|
*/
|
||||||
|
private String endStation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运行负载限额
|
||||||
|
*/
|
||||||
|
private Float runLoad;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 额定输出功率
|
||||||
|
*/
|
||||||
|
private Float outputPower;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最大允许电流
|
||||||
|
*/
|
||||||
|
private Float maxCurrent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 投运日期
|
||||||
|
*/
|
||||||
|
private LocalDateTime putIntoDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private Integer state;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.njcn.device.pojo.po.pv;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("pv_unit")
|
||||||
|
public class PvUnit implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位表Id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 父节点(0为根节点)
|
||||||
|
*/
|
||||||
|
private String pid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位编码
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package com.njcn.device.pojo.po.pv;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("pv_voltage")
|
||||||
|
public class PvVoltage {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 母线序号
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 母线名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 母线号(在同一台设备中的电压通道号)
|
||||||
|
*/
|
||||||
|
private Integer num;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压等级Id,字典表
|
||||||
|
*/
|
||||||
|
private String scale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 母线模型(0:虚拟母线;1:实际母线)默认是实际母线
|
||||||
|
*/
|
||||||
|
private Integer model;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -26,7 +26,7 @@ public class VersionVO implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 装置系列(终端类型),字典表
|
* 装置系列(终端类型),字典表
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty("装置系列(终端类型)")
|
@ApiModelProperty("装置系列(终端型号)")
|
||||||
private String devType;
|
private String devType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.njcn.device.pojo.vo.pv;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/7
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UnitTreeVO {
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
private String pid;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
private List<UnitTreeVO> children;
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ package com.njcn.device.controller;
|
|||||||
|
|
||||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
import com.njcn.common.pojo.constant.OperateType;
|
import com.njcn.common.pojo.constant.OperateType;
|
||||||
@@ -67,6 +68,7 @@ public class TerminalBaseController extends BaseController {
|
|||||||
public HttpResult<Object> addTerminal(@Valid @RequestBody AddTerminalParam addTerminalParam) {
|
public HttpResult<Object> addTerminal(@Valid @RequestBody AddTerminalParam addTerminalParam) {
|
||||||
String methodDescribe = getMethodDescribe("addTerminal");
|
String methodDescribe = getMethodDescribe("addTerminal");
|
||||||
//装置母线监测点相关检验
|
//装置母线监测点相关检验
|
||||||
|
List<String> voltageName = new ArrayList<>();
|
||||||
if (CollectionUtil.isNotEmpty(addTerminalParam.getDeviceParam())) {
|
if (CollectionUtil.isNotEmpty(addTerminalParam.getDeviceParam())) {
|
||||||
//校验装置是否存在重名
|
//校验装置是否存在重名
|
||||||
List<DeviceParam> listDev = addTerminalParam.getDeviceParam();
|
List<DeviceParam> listDev = addTerminalParam.getDeviceParam();
|
||||||
@@ -87,10 +89,7 @@ public class TerminalBaseController extends BaseController {
|
|||||||
if (CollectionUtil.isNotEmpty(deviceParam.getSubVoltageParam())) {
|
if (CollectionUtil.isNotEmpty(deviceParam.getSubVoltageParam())) {
|
||||||
List<SubVoltageParam> subvList = deviceParam.getSubVoltageParam();
|
List<SubVoltageParam> subvList = deviceParam.getSubVoltageParam();
|
||||||
List<String> subVName = subvList.stream().map(SubVoltageParam::getName).collect(Collectors.toList());
|
List<String> subVName = subvList.stream().map(SubVoltageParam::getName).collect(Collectors.toList());
|
||||||
long countSubV = subVName.stream().distinct().count();
|
voltageName.addAll(subVName);
|
||||||
if (countSubV != subVName.size()) {
|
|
||||||
throw new BusinessException(DeviceResponseEnum.SUBV_NAME_REPETITION);
|
|
||||||
}
|
|
||||||
//校验监测点名称
|
//校验监测点名称
|
||||||
for (SubVoltageParam subVoltageParam : subvList) {
|
for (SubVoltageParam subVoltageParam : subvList) {
|
||||||
if (CollectionUtil.isNotEmpty(subVoltageParam.getLineParam())) {
|
if (CollectionUtil.isNotEmpty(subVoltageParam.getLineParam())) {
|
||||||
@@ -109,6 +108,11 @@ public class TerminalBaseController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
long countSubV = voltageName.stream().distinct().count();
|
||||||
|
if (countSubV != voltageName.size()) {
|
||||||
|
throw new BusinessException(DeviceResponseEnum.SUBV_NAME_REPETITION);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
terminalBaseService.addTerminal(addTerminalParam);
|
terminalBaseService.addTerminal(addTerminalParam);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
@@ -124,7 +128,7 @@ public class TerminalBaseController extends BaseController {
|
|||||||
@ApiOperation("终端修改操作")
|
@ApiOperation("终端修改操作")
|
||||||
@OperateInfo(operateType = OperateType.UPDATE, info = LogEnum.BUSINESS_MEDIUM)
|
@OperateInfo(operateType = OperateType.UPDATE, info = LogEnum.BUSINESS_MEDIUM)
|
||||||
@PutMapping("updateTerminal")
|
@PutMapping("updateTerminal")
|
||||||
public HttpResult updateTerminal(@Valid @RequestBody UpdateTerminalParam updateTerminalParam) {
|
public HttpResult<Object> updateTerminal(@Valid @RequestBody UpdateTerminalParam updateTerminalParam) {
|
||||||
String methodDescribe = getMethodDescribe("updateTerminal");
|
String methodDescribe = getMethodDescribe("updateTerminal");
|
||||||
terminalBaseService.updateTerminal(updateTerminalParam);
|
terminalBaseService.updateTerminal(updateTerminalParam);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
@@ -155,7 +159,7 @@ public class TerminalBaseController extends BaseController {
|
|||||||
@ApiOperation("终端删除操作")
|
@ApiOperation("终端删除操作")
|
||||||
@OperateInfo(operateType = OperateType.DELETE, info = LogEnum.BUSINESS_SERIOUS)
|
@OperateInfo(operateType = OperateType.DELETE, info = LogEnum.BUSINESS_SERIOUS)
|
||||||
@DeleteMapping("delTerminal")
|
@DeleteMapping("delTerminal")
|
||||||
public HttpResult delTerminal(@RequestParam("id") String id) {
|
public HttpResult<Object> delTerminal(@RequestParam("id") String id) {
|
||||||
String methodDescribe = getMethodDescribe("delTerminal");
|
String methodDescribe = getMethodDescribe("delTerminal");
|
||||||
terminalBaseService.delTerminal(id);
|
terminalBaseService.delTerminal(id);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
@@ -246,12 +250,7 @@ public class TerminalBaseController extends BaseController {
|
|||||||
@ApiOperation("导出台账模板")
|
@ApiOperation("导出台账模板")
|
||||||
@GetMapping(value = "downTerminalTemplate")
|
@GetMapping(value = "downTerminalTemplate")
|
||||||
public void downTerminalTemplate(HttpServletResponse response) {
|
public void downTerminalTemplate(HttpServletResponse response) {
|
||||||
ExportParams exportExcel = new ExportParams("批量导入模板(请严格按照模板标准填入数据)","台账信息");
|
terminalBaseService.downTerminalTemplate(response);
|
||||||
Workbook workbook = ExcelExportUtil.exportExcel(exportExcel,TerminalBaseExcel.class,new ArrayList<TerminalBaseExcel>());
|
|
||||||
//这里是自己加的 带下拉框的代码
|
|
||||||
ExcelUtil.selectList(workbook, 4, 4, new String[]{"斤","两","个","袋","份"});
|
|
||||||
ExcelUtil.selectList(workbook, 0, 0, new String[]{"蔬菜","水果","主食","熟食","调料"});
|
|
||||||
PoiUtil.exportFileByWorkbook(workbook, "菜品管理", response);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -54,6 +54,13 @@ public interface LineMapper extends BaseMapper<Line> {
|
|||||||
*/
|
*/
|
||||||
List<LineDetail> getLineDetailByDeviceId(@Param("devId") String devId);
|
List<LineDetail> getLineDetailByDeviceId(@Param("devId") String devId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询装置下的母线信息
|
||||||
|
* @param devId 设备id
|
||||||
|
* @date 2022/7/1
|
||||||
|
*/
|
||||||
|
List<Voltage> getVoltageByDevId(@Param("devId") String devId);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过监测点id获取母线详情
|
* 通过监测点id获取母线详情
|
||||||
@@ -297,4 +304,15 @@ public interface LineMapper extends BaseMapper<Line> {
|
|||||||
*/
|
*/
|
||||||
String getDevIndex(@Param("lineId")String lineId);
|
String getDevIndex(@Param("lineId")String lineId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取变电站下母线
|
||||||
|
* @param subId 变电站id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/4
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
List<Line> getVoltageListBySubId(@Param("subId")String subId,@Param("voltageName")List<String> voltageName);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,14 @@
|
|||||||
and a.state = 1
|
and a.state = 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getVoltageByDevId" resultType="Voltage">
|
||||||
|
select a.id,a.name,b.num
|
||||||
|
from pq_line a
|
||||||
|
inner join pq_voltage b on a.id = b.id
|
||||||
|
where a.pid = #{devId}
|
||||||
|
and a.state = 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="getVoltageByLineId" resultType="Voltage">
|
<select id="getVoltageByLineId" resultType="Voltage">
|
||||||
select *
|
select *
|
||||||
@@ -849,8 +857,6 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<select id="getTerminalBaseExcel" resultType="TerminalBaseExcel">
|
<select id="getTerminalBaseExcel" resultType="TerminalBaseExcel">
|
||||||
SELECT
|
SELECT
|
||||||
pj.NAME projectName,
|
pj.NAME projectName,
|
||||||
@@ -928,4 +934,18 @@ FROM
|
|||||||
where vo.id = line.pid
|
where vo.id = line.pid
|
||||||
and line.id = #{lineId}
|
and line.id = #{lineId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getVoltageListBySubId" resultType="Line">
|
||||||
|
select * from pq_line voltage
|
||||||
|
inner join pq_line dev on voltage.pid = dev.id
|
||||||
|
inner join pq_line sub on dev.pid = sub.id
|
||||||
|
where sub.id = #{subId}
|
||||||
|
and voltage.state = 1
|
||||||
|
<if test="voltageName!=null">
|
||||||
|
and voltage.name in
|
||||||
|
<foreach collection="voltageName" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -173,6 +173,13 @@ public interface TerminalBaseService {
|
|||||||
*/
|
*/
|
||||||
List<TerminalBaseExcel> exportTerminalBase();
|
List<TerminalBaseExcel> exportTerminalBase();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出台账模板
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/5/17
|
||||||
|
*/
|
||||||
|
void downTerminalTemplate(HttpServletResponse response);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将台账数据导入终端相关表
|
* 将台账数据导入终端相关表
|
||||||
* @param file 原始数据信息
|
* @param file 原始数据信息
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.njcn.device.service.impl;
|
package com.njcn.device.service.impl;
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||||
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||||
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
|
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
@@ -32,6 +34,7 @@ import com.njcn.device.service.INodeService;
|
|||||||
import com.njcn.device.service.LineBakService;
|
import com.njcn.device.service.LineBakService;
|
||||||
import com.njcn.device.service.TerminalBaseService;
|
import com.njcn.device.service.TerminalBaseService;
|
||||||
import com.njcn.device.utils.DeviceUtil;
|
import com.njcn.device.utils.DeviceUtil;
|
||||||
|
import com.njcn.device.utils.ExcelStyleUtil;
|
||||||
import com.njcn.poi.excel.ExcelUtil;
|
import com.njcn.poi.excel.ExcelUtil;
|
||||||
import com.njcn.poi.util.PoiUtil;
|
import com.njcn.poi.util.PoiUtil;
|
||||||
import com.njcn.system.api.AreaFeignClient;
|
import com.njcn.system.api.AreaFeignClient;
|
||||||
@@ -42,6 +45,8 @@ import com.njcn.system.pojo.po.DictData;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
|
import org.checkerframework.checker.units.qual.C;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -188,7 +193,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
LambdaQueryWrapper<Line> lineLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Line> lineLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
if (CollectionUtil.isNotEmpty(addTerminalParam.getDeviceParam()) && StrUtil.isNotBlank(subIndex)) {
|
if (CollectionUtil.isNotEmpty(addTerminalParam.getDeviceParam()) && StrUtil.isNotBlank(subIndex)) {
|
||||||
//校验变电站下的装置名称ip是否重复
|
//校验变电站下的装置名称ip是否重复
|
||||||
checkDev(addTerminalParam, subIndex,lineLambdaQueryWrapper);
|
checkDevNameAndIp(addTerminalParam, subIndex, lineLambdaQueryWrapper);
|
||||||
|
|
||||||
|
|
||||||
for (DeviceParam deviceParam : addTerminalParam.getDeviceParam()) {
|
for (DeviceParam deviceParam : addTerminalParam.getDeviceParam()) {
|
||||||
@@ -200,21 +205,28 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
List<Integer> listVoltageNum = Stream.of(1, 2, 3, 4, 5, 6).collect(Collectors.toList());
|
List<Integer> listVoltageNum = Stream.of(1, 2, 3, 4, 5, 6).collect(Collectors.toList());
|
||||||
//标识当前装置下的监测点数量
|
//标识当前装置下的监测点数量
|
||||||
int lineNum = 0, voltageNum = 0;
|
int lineNum = 0, voltageNum = 0;
|
||||||
|
|
||||||
//校验监测点总数不超过6
|
//校验监测点总数不超过6
|
||||||
if (CollectionUtil.isNotEmpty(deviceParam.getSubVoltageParam())) {
|
if (CollectionUtil.isNotEmpty(deviceParam.getSubVoltageParam())) {
|
||||||
for (SubVoltageParam subVoltage : deviceParam.getSubVoltageParam()) {
|
for (SubVoltageParam subVoltage : deviceParam.getSubVoltageParam()) {
|
||||||
if (CollectionUtil.isNotEmpty(subVoltage.getLineParam())) {
|
if (CollectionUtil.isNotEmpty(subVoltage.getLineParam())) {
|
||||||
for (LineParam lineValid : subVoltage.getLineParam()) {
|
for (LineParam lineValid : subVoltage.getLineParam()) {
|
||||||
if (StrUtil.isNotBlank(lineValid.getName())) {
|
if (StrUtil.isBlank(lineValid.getLineIndex())) {
|
||||||
lineNum++;
|
lineNum++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
//一台装置母线最多6路
|
||||||
|
if (StrUtil.isBlank(subVoltage.getSubvIndex())) {
|
||||||
|
voltageNum++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (StrUtil.isBlank(deviceParam.getDevIndex())) {
|
if (StrUtil.isBlank(deviceParam.getDevIndex())) {
|
||||||
|
|
||||||
Line device = assembleLine(deviceParam.getName(), LineBaseEnum.DEVICE_LEVEL.getCode(), subIndex, projectIndex + StrUtil.COMMA + provinceIndex + StrUtil.COMMA + gdIndex + StrUtil.COMMA + subIndex, deviceParam.getSort());
|
Line device = assembleLine(deviceParam.getName(), LineBaseEnum.DEVICE_LEVEL.getCode(), subIndex, projectIndex + StrUtil.COMMA + provinceIndex + StrUtil.COMMA + gdIndex + StrUtil.COMMA + subIndex, deviceParam.getSort());
|
||||||
this.baseMapper.insert(device);
|
this.baseMapper.insert(device);
|
||||||
devIdIndex = device.getId();
|
devIdIndex = device.getId();
|
||||||
@@ -241,7 +253,6 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
List<DevFuction> insertFunList = new ArrayList<>();
|
List<DevFuction> insertFunList = new ArrayList<>();
|
||||||
for (DictData dicData : funList) {
|
for (DictData dicData : funList) {
|
||||||
DevFuction devFunction = new DevFuction();
|
DevFuction devFunction = new DevFuction();
|
||||||
|
|
||||||
devFunction.setLineId(device.getId());
|
devFunction.setLineId(device.getId());
|
||||||
devFunction.setFucName(dicData.getId());
|
devFunction.setFucName(dicData.getId());
|
||||||
devFunction.setId(IdUtil.simpleUUID());
|
devFunction.setId(IdUtil.simpleUUID());
|
||||||
@@ -260,16 +271,26 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
listLineNum.removeIf(integer -> sline.getNum().equals(integer));
|
listLineNum.removeIf(integer -> sline.getNum().equals(integer));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//母线
|
||||||
|
List<Voltage> voltageList = lineMapper.getVoltageByDevId(devIdIndex);
|
||||||
|
if (CollectionUtil.isNotEmpty(voltageList)) {
|
||||||
|
voltageNum = voltageNum + voltageList.size();
|
||||||
|
for (Voltage v : voltageList) {
|
||||||
|
listVoltageNum.removeIf(integer -> v.getNum().equals(integer));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lineNum > 6) {
|
if (lineNum > 6) {
|
||||||
throw new BusinessException(DeviceResponseEnum.DEVICE_LINE_BIG);
|
throw new BusinessException(DeviceResponseEnum.DEVICE_LINE_BIG);
|
||||||
}
|
}
|
||||||
|
if (voltageNum > 6) {
|
||||||
|
throw new BusinessException(DeviceResponseEnum.DEVICE_VOLTAGE_BIG);
|
||||||
|
}
|
||||||
|
|
||||||
//判断设备下是否存在母线
|
//判断设备下是否存在母线
|
||||||
if (CollectionUtil.isNotEmpty(deviceParam.getSubVoltageParam())) {
|
if (CollectionUtil.isNotEmpty(deviceParam.getSubVoltageParam())) {
|
||||||
//当通过设备节点新增时候需要校验是否存在同名母线名称
|
//当通过设备节点新增时候需要校验是否存在同名母线名称
|
||||||
if (StrUtil.isBlank(deviceParam.getDevIndex())) {
|
|
||||||
List<String> subvNameList = deviceParam.getSubVoltageParam().stream()
|
List<String> subvNameList = deviceParam.getSubVoltageParam().stream()
|
||||||
.filter((subv) -> subv.getSubvIndex() == null)
|
.filter((subv) -> subv.getSubvIndex() == null)
|
||||||
.map(SubVoltageParam::getName).collect(Collectors.toList());
|
.map(SubVoltageParam::getName).collect(Collectors.toList());
|
||||||
@@ -285,18 +306,49 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//母线
|
//母线
|
||||||
|
List<String> voltageName = deviceParam.getSubVoltageParam().stream().filter(item -> StrUtil.isBlank(item.getSubvIndex())).map(SubVoltageParam::getName).collect(Collectors.toList());
|
||||||
|
if (CollectionUtil.isNotEmpty(voltageName)) {
|
||||||
|
List<Line> voltageList = this.baseMapper.getVoltageListBySubId(subIndex, voltageName);
|
||||||
|
if(CollectionUtil.isNotEmpty(voltageList)){
|
||||||
|
throw new BusinessException(DeviceResponseEnum.SUBV_NAME_SAME, String.join(";", voltageList.stream().map(Line::getName).collect(Collectors.toList())));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//校验同一变电站下只能有唯一母线名称
|
||||||
|
List<String> addVoltage = deviceParam.getSubVoltageParam().stream().filter(item->item.getSubvIndex() == null).map(SubVoltageParam::getName).collect(Collectors.toList());
|
||||||
|
if(CollectionUtil.isNotEmpty(addVoltage)) {
|
||||||
|
List<Line> voltageListBySubId = this.baseMapper.getVoltageListBySubId(subIndex, addVoltage);
|
||||||
|
if(CollectionUtil.isNotEmpty(voltageListBySubId)){
|
||||||
|
throw new BusinessException(DeviceResponseEnum.SUBV_NAME_SAME, String.join(";",voltageListBySubId.stream().map(Line::getName).collect(Collectors.toList())));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (SubVoltageParam subVoltageParam : deviceParam.getSubVoltageParam()) {
|
for (SubVoltageParam subVoltageParam : deviceParam.getSubVoltageParam()) {
|
||||||
//母线id
|
//母线id
|
||||||
String subvIndex;
|
String subvIndex;
|
||||||
|
|
||||||
if (StrUtil.isBlank(subVoltageParam.getSubvIndex()) && StrUtil.isNotBlank(devIdIndex)) {
|
if (StrUtil.isBlank(subVoltageParam.getSubvIndex()) && StrUtil.isNotBlank(devIdIndex)) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DictData scaleRes = dicDataFeignClient.getDicDataById(subVoltageParam.getScale()).getData();
|
DictData scaleRes = dicDataFeignClient.getDicDataById(subVoltageParam.getScale()).getData();
|
||||||
if (Objects.isNull(scaleRes)) {
|
if (Objects.isNull(scaleRes)) {
|
||||||
throw new BusinessException(DeviceResponseEnum.DIC_GET_EMPTY);
|
throw new BusinessException(DeviceResponseEnum.DIC_GET_EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//校验母线
|
||||||
|
if (CollectionUtil.isNotEmpty(listVoltageNum)) {
|
||||||
|
if (!listVoltageNum.contains(subVoltageParam.getNum())) {
|
||||||
|
throw new BusinessException(DeviceResponseEnum.VOLTAGE_NUM_USE, "母线序号:" + subVoltageParam.getNum());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
throw new BusinessException(DeviceResponseEnum.DEVICE_VOLTAGE_BIG);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Line subVoltage = assembleLine(subVoltageParam.getName(), LineBaseEnum.SUB_V_LEVEL.getCode(), devIdIndex, projectIndex + StrUtil.COMMA + provinceIndex + StrUtil.COMMA + gdIndex + StrUtil.COMMA + subIndex + StrUtil.COMMA + devIdIndex, subVoltageParam.getSort());
|
Line subVoltage = assembleLine(subVoltageParam.getName(), LineBaseEnum.SUB_V_LEVEL.getCode(), devIdIndex, projectIndex + StrUtil.COMMA + provinceIndex + StrUtil.COMMA + gdIndex + StrUtil.COMMA + subIndex + StrUtil.COMMA + devIdIndex, subVoltageParam.getSort());
|
||||||
this.baseMapper.insert(subVoltage);
|
this.baseMapper.insert(subVoltage);
|
||||||
subvIndex = subVoltage.getId();
|
subvIndex = subVoltage.getId();
|
||||||
@@ -378,7 +430,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
/**
|
/**
|
||||||
* 校验装置
|
* 校验装置
|
||||||
*/
|
*/
|
||||||
private void checkDev(AddTerminalParam addTerminalParam, String subIndex,LambdaQueryWrapper<Line> lineLambdaQueryWrapper) {
|
private void checkDevNameAndIp(AddTerminalParam addTerminalParam, String subIndex, LambdaQueryWrapper<Line> lineLambdaQueryWrapper) {
|
||||||
|
|
||||||
|
|
||||||
List<String> devNameList = addTerminalParam.getDeviceParam().stream().filter((dev -> dev.getDevIndex() == null)).map(DeviceParam::getName).collect(Collectors.toList());
|
List<String> devNameList = addTerminalParam.getDeviceParam().stream().filter((dev -> dev.getDevIndex() == null)).map(DeviceParam::getName).collect(Collectors.toList());
|
||||||
@@ -648,6 +700,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
/**
|
/**
|
||||||
* 终端查询操作
|
* 终端查询操作
|
||||||
*
|
*
|
||||||
|
* @param id pq_line表 id
|
||||||
* @author cdf
|
* @author cdf
|
||||||
* @date 2021/7/19
|
* @date 2021/7/19
|
||||||
*/
|
*/
|
||||||
@@ -890,6 +943,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
SubVoltageVO subVoltageVO = new SubVoltageVO();
|
SubVoltageVO subVoltageVO = new SubVoltageVO();
|
||||||
BeanUtils.copyProperties(subVoltage, subVoltageVO);
|
BeanUtils.copyProperties(subVoltage, subVoltageVO);
|
||||||
Voltage voltage = voltageMapper.selectById(subVoltage.getId());
|
Voltage voltage = voltageMapper.selectById(subVoltage.getId());
|
||||||
|
subVoltageVO.setSubvIndex(subVoltage.getId());
|
||||||
BeanUtils.copyProperties(voltage, subVoltageVO);
|
BeanUtils.copyProperties(voltage, subVoltageVO);
|
||||||
subVoltageVO.setLineVO(lineVOS);
|
subVoltageVO.setLineVO(lineVOS);
|
||||||
subVoltageVOS.add(subVoltageVO);
|
subVoltageVOS.add(subVoltageVO);
|
||||||
@@ -1341,6 +1395,45 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
return this.baseMapper.getTerminalBaseExcel();
|
return this.baseMapper.getTerminalBaseExcel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void downTerminalTemplate(HttpServletResponse response) {
|
||||||
|
ExportParams exportParams = new ExportParams("批量导入模板(请严格按照模板标准填入数据)", "台账信息");
|
||||||
|
exportParams.setStyle(ExcelStyleUtil.class);
|
||||||
|
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, TerminalBaseExcel.class, new ArrayList<TerminalBaseExcel>());
|
||||||
|
List<DictData> businessList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.BUSINESS_TYPE.getName()).getData();
|
||||||
|
List<DictData> loadTypeList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.INTERFERENCE_SOURCE_TYPE.getName()).getData();
|
||||||
|
List<DictData> manufacturerList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.DEV_MANUFACTURER.getName()).getData();
|
||||||
|
List<DictData> devTypeList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.DEV_TYPE.getName()).getData();
|
||||||
|
List<DictData> frontList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.FRONT_TYPE.getName()).getData();
|
||||||
|
List<DictData> scaleList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.DEV_VOLTAGE.getName()).getData();
|
||||||
|
List<Node> nodeList = nodeService.nodeAllList();
|
||||||
|
|
||||||
|
|
||||||
|
//这里是自己加的 带下拉框的代码
|
||||||
|
ExcelUtil.selectList(workbook, 8, 8, new String[]{"虚拟设备", "实际设备", "离线设备"});
|
||||||
|
ExcelUtil.selectList(workbook, 9, 9, new String[]{"暂态系统", "稳态系统", "双系统"});
|
||||||
|
ExcelUtil.selectList(workbook, 10, 10, new String[]{"投运", "热备用", "停运"});
|
||||||
|
ExcelUtil.selectList(workbook, 11, 11, manufacturerList.stream().map(DictData::getName).collect(Collectors.toList()).toArray(new String[]{}));
|
||||||
|
ExcelUtil.selectList(workbook, 12, 12, devTypeList.stream().map(DictData::getName).collect(Collectors.toList()).toArray(new String[]{}));
|
||||||
|
ExcelUtil.selectList(workbook, 17, 17, new String[]{"周期触发", "变为触发"});
|
||||||
|
ExcelUtil.selectList(workbook, 18, 18, nodeList.stream().map(Node::getName).collect(Collectors.toList()).toArray(new String[]{}));
|
||||||
|
ExcelUtil.selectList(workbook, 19, 19, frontList.stream().map(DictData::getName).collect(Collectors.toList()).toArray(new String[]{}));
|
||||||
|
|
||||||
|
/*母线序号*/
|
||||||
|
ExcelUtil.selectList(workbook, 23, 23, new String[]{"1", "2", "3", "3", "4", "5", "6"});
|
||||||
|
ExcelUtil.selectList(workbook, 24, 24, scaleList.stream().map(DictData::getName).collect(Collectors.toList()).toArray(new String[]{}));
|
||||||
|
ExcelUtil.selectList(workbook, 25, 25, new String[]{"虚拟母线", "实际母线"});
|
||||||
|
ExcelUtil.selectList(workbook, 27, 27, new String[]{"1", "2", "3", "3", "4", "5", "6"});
|
||||||
|
ExcelUtil.selectList(workbook, 28, 28, new String[]{"极重要", "重要", "普通", "不重要"});
|
||||||
|
ExcelUtil.selectList(workbook, 35, 35, new String[]{"星型接法", "三角型接法", "开口三角型接法"});
|
||||||
|
ExcelUtil.selectList(workbook, 36, 36, new String[]{"3", "5", "10"});
|
||||||
|
ExcelUtil.selectList(workbook, 37, 37, loadTypeList.stream().map(DictData::getName).collect(Collectors.toList()).toArray(new String[]{}));
|
||||||
|
ExcelUtil.selectList(workbook, 38, 38, businessList.stream().map(DictData::getName).collect(Collectors.toList()).toArray(new String[]{}));
|
||||||
|
ExcelUtil.selectList(workbook, 41, 41, new String[]{"电网侧", "非电网侧"});
|
||||||
|
ExcelUtil.selectList(workbook, 42, 42, new String[]{"不参与统计", "参与统计"});
|
||||||
|
PoiUtil.exportFileByWorkbook(workbook, "台账导入模板.xlsx", response);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void importTerminalBase(MultipartFile file, HttpServletResponse response) {
|
public void importTerminalBase(MultipartFile file, HttpServletResponse response) {
|
||||||
|
|||||||
@@ -0,0 +1,159 @@
|
|||||||
|
package com.njcn.device.utils;
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.params.ExcelForEachParams;
|
||||||
|
import cn.afterturn.easypoi.excel.export.styler.IExcelExportStyler;
|
||||||
|
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
||||||
|
import org.apache.poi.hssf.util.HSSFColor;
|
||||||
|
import org.apache.poi.ss.usermodel.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/4
|
||||||
|
*/
|
||||||
|
public class ExcelStyleUtil implements IExcelExportStyler {
|
||||||
|
// 数据行类型
|
||||||
|
private static final String DATA_STYLES = "dataStyles";
|
||||||
|
// 标题类型
|
||||||
|
private static final String TITLE_STYLES = "titleStyles";
|
||||||
|
//头样式
|
||||||
|
private static final String HEADER_STYLES = "headerStyles";
|
||||||
|
|
||||||
|
//数据行样式
|
||||||
|
private CellStyle styles;
|
||||||
|
// 标题样式
|
||||||
|
private CellStyle titleStyle;
|
||||||
|
|
||||||
|
// 标题样式
|
||||||
|
private CellStyle headerStyle;
|
||||||
|
|
||||||
|
public ExcelStyleUtil(Workbook workbook) {
|
||||||
|
this.init(workbook);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void init(Workbook workbook) {
|
||||||
|
this.styles = initStyles(workbook);
|
||||||
|
this.titleStyle = initTitleStyle(workbook);
|
||||||
|
this.headerStyle = initTitleStyle(workbook);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CellStyle getHeaderStyle(short headerColor) {
|
||||||
|
return headerStyle;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标题样式
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public CellStyle getTitleStyle(short i) {
|
||||||
|
return titleStyle;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CellStyle getStyles(boolean parity, ExcelExportEntity entity) {
|
||||||
|
return styles;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取样式方法
|
||||||
|
*
|
||||||
|
* @param dataRow 数据行
|
||||||
|
* @param obj 对象
|
||||||
|
* @param data 数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public CellStyle getStyles(Cell cell, int dataRow, ExcelExportEntity entity, Object obj, Object data) {
|
||||||
|
return getStyles(true, entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CellStyle getTemplateStyles(boolean isSingle, ExcelForEachParams excelForEachParams) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化--标题行样式
|
||||||
|
* @param workbook
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private CellStyle initTitleStyle(Workbook workbook) {
|
||||||
|
return buildCellStyle(workbook,TITLE_STYLES);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 头样式
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/4
|
||||||
|
*/
|
||||||
|
private CellStyle initHeaderStyle(Workbook workbook) {
|
||||||
|
return buildCellStyle(workbook,HEADER_STYLES);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化--数据行样式
|
||||||
|
* @param workbook
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private CellStyle initStyles(Workbook workbook) {
|
||||||
|
return buildCellStyle(workbook,DATA_STYLES);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置单元格样式
|
||||||
|
* @param workbook
|
||||||
|
* @param type 类型 用来区分是数据行样式还是标题样式
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private CellStyle buildCellStyle(Workbook workbook,String type) {
|
||||||
|
CellStyle style = workbook.createCellStyle();
|
||||||
|
// 字体样式
|
||||||
|
Font font = workbook.createFont();
|
||||||
|
if(TITLE_STYLES.equals(type)){
|
||||||
|
font.setFontHeightInPoints((short)12);
|
||||||
|
font.setBold(true);
|
||||||
|
// 设置水平对齐的样式为居中对齐;
|
||||||
|
style.setAlignment(HorizontalAlignment.CENTER);
|
||||||
|
}
|
||||||
|
if(HEADER_STYLES.equals(type)){
|
||||||
|
font.setFontHeightInPoints((short)12);
|
||||||
|
font.setBold(true);
|
||||||
|
// 设置水平对齐的样式为居中对齐;
|
||||||
|
style.setAlignment(HorizontalAlignment.LEFT);
|
||||||
|
}
|
||||||
|
if(DATA_STYLES.equals(type)){
|
||||||
|
font.setFontHeightInPoints((short)10);
|
||||||
|
// 设置水平对齐的样式为居中对齐;
|
||||||
|
style.setAlignment(HorizontalAlignment.CENTER);
|
||||||
|
}
|
||||||
|
font.setFontName("Courier New");
|
||||||
|
style.setFont(font);
|
||||||
|
// 设置底边框
|
||||||
|
style.setBorderBottom(BorderStyle.THIN);
|
||||||
|
// 设置左边框
|
||||||
|
style.setBorderLeft(BorderStyle.THIN);
|
||||||
|
// 设置右边框;
|
||||||
|
style.setBorderRight(BorderStyle.THIN);
|
||||||
|
// 设置顶边框;
|
||||||
|
style.setBorderTop(BorderStyle.THIN);
|
||||||
|
// 设置底边颜色
|
||||||
|
style.setBottomBorderColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex());
|
||||||
|
// 设置左边框颜色;
|
||||||
|
style.setLeftBorderColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex());
|
||||||
|
// 设置右边框颜色;
|
||||||
|
style.setRightBorderColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex());
|
||||||
|
// 设置顶边框颜色;
|
||||||
|
style.setTopBorderColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex());
|
||||||
|
// 设置自动换行;
|
||||||
|
style.setWrapText(false);
|
||||||
|
|
||||||
|
|
||||||
|
// 设置垂直对齐的样式为居中对齐;
|
||||||
|
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||||
|
return style;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,160 @@
|
|||||||
|
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.constant.OperateType;
|
||||||
|
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.DeviceQueryParam;
|
||||||
|
import com.njcn.device.pojo.param.pv.PvDeviceParam;
|
||||||
|
import com.njcn.device.pojo.po.pv.PvDevice;
|
||||||
|
import com.njcn.pvdevice.service.IPvDeviceService;
|
||||||
|
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 com.njcn.web.controller.BaseController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 终端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pvDevice")
|
||||||
|
@Api(tags = "pv终端控制器")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PvDeviceController extends BaseController {
|
||||||
|
|
||||||
|
private final IPvDeviceService iPvDeviceService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增终端
|
||||||
|
* @param pvDeviceParam 终端实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
@PostMapping("addDevice")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.ADD)
|
||||||
|
@ApiOperation("新增终端")
|
||||||
|
@ApiImplicitParam(name = "pvDeviceParam",value = "终端实体",required = true)
|
||||||
|
public HttpResult<Object> addDevice(@RequestBody @Validated PvDeviceParam pvDeviceParam){
|
||||||
|
String methodDescribe = getMethodDescribe("addDevice");
|
||||||
|
boolean res = iPvDeviceService.addDevice(pvDeviceParam);
|
||||||
|
if(res){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改终端
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
@PostMapping("updateDevice")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.UPDATE)
|
||||||
|
@ApiOperation("修改终端")
|
||||||
|
@ApiImplicitParam(name = "updatePvDeviceParam",value = "终端实体",required = true)
|
||||||
|
public HttpResult<Object> updateDevice(@RequestBody @Validated PvDeviceParam.UpdatePvDeviceParam updatePvDeviceParam){
|
||||||
|
String methodDescribe = getMethodDescribe("updateDevice");
|
||||||
|
boolean res = iPvDeviceService.updateDevice(updatePvDeviceParam);
|
||||||
|
if(res){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询终端
|
||||||
|
* @param deviceQueryParam 查询实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return Page<PvDevice>
|
||||||
|
*/
|
||||||
|
@PostMapping("getPvDeviceList")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("分页查询终端")
|
||||||
|
@ApiImplicitParam(name = "deviceQueryParam",value = "终端实体",required = true)
|
||||||
|
public HttpResult<Page<PvDevice>> getPvDeviceList(@RequestBody DeviceQueryParam deviceQueryParam){
|
||||||
|
String methodDescribe = getMethodDescribe("getPvDeviceList");
|
||||||
|
Page<PvDevice> page = iPvDeviceService.getPvDeviceList(deviceQueryParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有终端
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return Page<PvDevice>
|
||||||
|
*/
|
||||||
|
@PostMapping("getAllPvDeviceList")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("查询所有终端")
|
||||||
|
public HttpResult<List<PvDevice>> getAllPvDeviceList(){
|
||||||
|
String methodDescribe = getMethodDescribe("getAllPvDeviceList");
|
||||||
|
List<PvDevice> list = iPvDeviceService.getAllPvDeviceList();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据终端id查询终端
|
||||||
|
* @param id 终端id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return PvDevice
|
||||||
|
*/
|
||||||
|
@GetMapping("getPvDeviceById")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("根据终端id查询终端")
|
||||||
|
@ApiImplicitParam(name = "id",value = "终端id",required = true)
|
||||||
|
public HttpResult<PvDevice> getPvDeviceById(@RequestParam("id") String id){
|
||||||
|
String methodDescribe = getMethodDescribe("getPvDeviceById");
|
||||||
|
PvDevice pvDevice = iPvDeviceService.getPvDeviceById(id);
|
||||||
|
if(Objects.nonNull(pvDevice)){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pvDevice, methodDescribe);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除终端
|
||||||
|
* @param id 终端id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
@DeleteMapping("delPvDevice")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("删除终端")
|
||||||
|
@ApiImplicitParam(name = "id",value = "终端id",required = true)
|
||||||
|
public HttpResult<PvDevice> delPvDevice(@RequestParam("id") String id){
|
||||||
|
String methodDescribe = getMethodDescribe("delPvDevice");
|
||||||
|
boolean res = iPvDeviceService.delPvDevice(id);
|
||||||
|
if(res){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.njcn.pvdevice.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pvDispatch")
|
||||||
|
@Api(tags = "设备控制器")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PvDispatchController extends BaseController {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,159 @@
|
|||||||
|
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.constant.OperateType;
|
||||||
|
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.PvDistributedParam;
|
||||||
|
import com.njcn.device.pojo.param.pv.DistributedQueryParam;
|
||||||
|
import com.njcn.device.pojo.po.pv.PvDistributed;
|
||||||
|
import com.njcn.pvdevice.service.IPvDistributedService;
|
||||||
|
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 com.njcn.web.controller.BaseController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 分布式光伏控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-06
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pvDistributed")
|
||||||
|
@Api(tags = "pv分布式光伏控制器")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PvDistributedController extends BaseController {
|
||||||
|
|
||||||
|
private final IPvDistributedService iPvDistributedService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增分布式光伏台账
|
||||||
|
* @param pvDistributedParam 分布式光伏台账实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
@PostMapping("addDistributed")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.ADD)
|
||||||
|
@ApiOperation("新增分布式光伏台账")
|
||||||
|
@ApiImplicitParam(name = "pvDistributedParam",value = "分布式光伏台账实体",required = true)
|
||||||
|
public HttpResult<Object> addDistributed(@RequestBody @Validated PvDistributedParam pvDistributedParam){
|
||||||
|
String methodDescribe = getMethodDescribe("addDistributed");
|
||||||
|
boolean res = iPvDistributedService.addDistributed(pvDistributedParam);
|
||||||
|
if(res){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改分布式光伏台账
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
@PostMapping("updateDistributed")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.UPDATE)
|
||||||
|
@ApiOperation("修改分布式光伏台账")
|
||||||
|
@ApiImplicitParam(name = "updatePvDistributedParam",value = "分布式光伏台账实体",required = true)
|
||||||
|
public HttpResult<Object> updateDistributed(@RequestBody @Validated PvDistributedParam.UpdatePvDistributedParam updatePvDistributedParam){
|
||||||
|
String methodDescribe = getMethodDescribe("updateDistributed");
|
||||||
|
boolean res = iPvDistributedService.updateDistributed(updatePvDistributedParam);
|
||||||
|
if(res){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询分布式光伏台账
|
||||||
|
* @param distributedQueryParam 查询实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return Page<PvDistributed>
|
||||||
|
*/
|
||||||
|
@PostMapping("getPvDistributedList")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("分页查询分布式光伏台账")
|
||||||
|
@ApiImplicitParam(name = "distributedQueryParam",value = "分布式光伏台账实体",required = true)
|
||||||
|
public HttpResult<Page<PvDistributed>> getPvDistributedList(@RequestBody DistributedQueryParam distributedQueryParam){
|
||||||
|
String methodDescribe = getMethodDescribe("getPvDistributedList");
|
||||||
|
Page<PvDistributed> page = iPvDistributedService.getPvDistributedList(distributedQueryParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有分布式光伏台账
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return Page<PvDistributed>
|
||||||
|
*/
|
||||||
|
@PostMapping("getAllPvDistributedList")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("查询所有分布式光伏台账")
|
||||||
|
public HttpResult<List<PvDistributed>> getAllPvDistributedList(){
|
||||||
|
String methodDescribe = getMethodDescribe("getAllPvDistributedList");
|
||||||
|
List<PvDistributed> list = iPvDistributedService.getAllPvDistributedList();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据分布式光伏台账id查询分布式光伏台账
|
||||||
|
* @param id 分布式光伏台账id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return PvDistributed
|
||||||
|
*/
|
||||||
|
@GetMapping("getPvDistributedById")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("根据分布式光伏台账id查询分布式光伏台账")
|
||||||
|
@ApiImplicitParam(name = "id",value = "分布式光伏台账id",required = true)
|
||||||
|
public HttpResult<PvDistributed> getPvDistributedById(@RequestParam("id") String id){
|
||||||
|
String methodDescribe = getMethodDescribe("getPvDistributedById");
|
||||||
|
PvDistributed pvDistributed = iPvDistributedService.getPvDistributedById(id);
|
||||||
|
if(Objects.nonNull(pvDistributed)){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pvDistributed, methodDescribe);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除分布式光伏台账
|
||||||
|
* @param id 分布式光伏台账id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
@DeleteMapping("delPvDistributed")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("删除分布式光伏台账")
|
||||||
|
@ApiImplicitParam(name = "id",value = "分布式光伏台账id",required = true)
|
||||||
|
public HttpResult<PvDistributed> delPvDistributed(@RequestParam("id") String id){
|
||||||
|
String methodDescribe = getMethodDescribe("delPvDistributed");
|
||||||
|
boolean res = iPvDistributedService.delPvDistributed(id);
|
||||||
|
if(res){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
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.constant.OperateType;
|
||||||
|
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.LineDetailQueryParam;
|
||||||
|
import com.njcn.device.pojo.param.pv.PvLineDetailParam;
|
||||||
|
import com.njcn.device.pojo.po.pv.PvLineDetail;
|
||||||
|
import com.njcn.pvdevice.service.IPvLineDetailService;
|
||||||
|
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 com.njcn.web.controller.BaseController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 监测点控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pvLineDetail")
|
||||||
|
@Api(tags = "pv监测点控制器")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PvLineDetailController extends BaseController {
|
||||||
|
|
||||||
|
private final IPvLineDetailService iPvLineDetailService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增监测点
|
||||||
|
* @param pvLineDetailParam 监测点实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
@PostMapping("addLineDetail")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.ADD)
|
||||||
|
@ApiOperation("新增监测点")
|
||||||
|
@ApiImplicitParam(name = "pvLineDetailParam",value = "监测点实体",required = true)
|
||||||
|
public HttpResult<Object> addLineDetail(@RequestBody @Validated PvLineDetailParam pvLineDetailParam){
|
||||||
|
String methodDescribe = getMethodDescribe("addLineDetail");
|
||||||
|
boolean res = iPvLineDetailService.addLineDetail(pvLineDetailParam);
|
||||||
|
if(res){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改监测点
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
@PostMapping("updateLineDetail")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.UPDATE)
|
||||||
|
@ApiOperation("修改监测点")
|
||||||
|
@ApiImplicitParam(name = "updatePvLineDetailParam",value = "监测点实体",required = true)
|
||||||
|
public HttpResult<Object> updateLineDetail(@RequestBody @Validated PvLineDetailParam.UpdatePvLineDetailParam updatePvLineDetailParam){
|
||||||
|
String methodDescribe = getMethodDescribe("updateLineDetail");
|
||||||
|
boolean res = iPvLineDetailService.updateLineDetail(updatePvLineDetailParam);
|
||||||
|
if(res){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询监测点
|
||||||
|
* @param lineDetailQueryParam 查询实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return Page<PvLineDetail>
|
||||||
|
*/
|
||||||
|
@PostMapping("getPvLineDetailList")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("分页查询监测点")
|
||||||
|
@ApiImplicitParam(name = "lineDetailQueryParam",value = "监测点实体",required = true)
|
||||||
|
public HttpResult<Page<PvLineDetail>> getPvLineDetailList(@RequestBody LineDetailQueryParam lineDetailQueryParam){
|
||||||
|
String methodDescribe = getMethodDescribe("getPvLineDetailList");
|
||||||
|
Page<PvLineDetail> page = iPvLineDetailService.getPvLineDetailList(lineDetailQueryParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有监测点
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return Page<PvLineDetail>
|
||||||
|
*/
|
||||||
|
@PostMapping("getAllPvLineDetailList")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("查询所有监测点")
|
||||||
|
public HttpResult<List<PvLineDetail>> getAllPvLineDetailList(){
|
||||||
|
String methodDescribe = getMethodDescribe("getAllPvLineDetailList");
|
||||||
|
List<PvLineDetail> list = iPvLineDetailService.getAllPvLineDetailList();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据监测点id查询监测点
|
||||||
|
* @param id 监测点id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return PvLineDetail
|
||||||
|
*/
|
||||||
|
@GetMapping("getPvLineDetailById")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("根据监测点id查询监测点")
|
||||||
|
@ApiImplicitParam(name = "id",value = "监测点id",required = true)
|
||||||
|
public HttpResult<PvLineDetail> getPvLineDetailById(@RequestParam("id") String id){
|
||||||
|
String methodDescribe = getMethodDescribe("getPvLineDetailById");
|
||||||
|
PvLineDetail pvLineDetail = iPvLineDetailService.getPvLineDetailById(id);
|
||||||
|
if(Objects.nonNull(pvLineDetail)){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pvLineDetail, methodDescribe);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除监测点
|
||||||
|
* @param id 监测点id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
@DeleteMapping("delPvLineDetail")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("删除监测点")
|
||||||
|
@ApiImplicitParam(name = "id",value = "监测点id",required = true)
|
||||||
|
public HttpResult<PvLineDetail> delPvLineDetail(@RequestParam("id") String id){
|
||||||
|
String methodDescribe = getMethodDescribe("delPvLineDetail");
|
||||||
|
boolean res = iPvLineDetailService.delPvLineDetail(id);
|
||||||
|
if(res){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,160 @@
|
|||||||
|
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.constant.OperateType;
|
||||||
|
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.LvUserQueryParam;
|
||||||
|
import com.njcn.device.pojo.param.pv.PvLvUserParam;
|
||||||
|
import com.njcn.device.pojo.po.pv.PvLvUser;
|
||||||
|
import com.njcn.pvdevice.service.IPvLvUserService;
|
||||||
|
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 com.njcn.web.controller.BaseController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 低压用户台账控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pvLvUser")
|
||||||
|
@Api(tags = "pv低压用户台账控制器")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PvLvUserController extends BaseController {
|
||||||
|
|
||||||
|
private final IPvLvUserService iPvLvUserService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增低压用户台账
|
||||||
|
* @param pvLvUserParam 低压用户台账实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
@PostMapping("addLvUser")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.ADD)
|
||||||
|
@ApiOperation("新增低压用户台账")
|
||||||
|
@ApiImplicitParam(name = "pvLvUserParam",value = "低压用户台账实体",required = true)
|
||||||
|
public HttpResult<Object> addLvUser(@RequestBody @Validated PvLvUserParam pvLvUserParam){
|
||||||
|
String methodDescribe = getMethodDescribe("addLvUser");
|
||||||
|
boolean res = iPvLvUserService.addLvUser(pvLvUserParam);
|
||||||
|
if(res){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改低压用户台账
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
@PostMapping("updateLvUser")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.UPDATE)
|
||||||
|
@ApiOperation("修改低压用户台账")
|
||||||
|
@ApiImplicitParam(name = "updatePvLvUserParam",value = "低压用户台账实体",required = true)
|
||||||
|
public HttpResult<Object> updateLvUser(@RequestBody @Validated PvLvUserParam.UpdatePvLvUserParam updatePvLvUserParam){
|
||||||
|
String methodDescribe = getMethodDescribe("updateLvUser");
|
||||||
|
boolean res = iPvLvUserService.updateLvUser(updatePvLvUserParam);
|
||||||
|
if(res){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询低压用户台账
|
||||||
|
* @param lvUserQueryParam 查询实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return Page<PvLvUser>
|
||||||
|
*/
|
||||||
|
@PostMapping("getPvLvUserList")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("分页查询低压用户台账")
|
||||||
|
@ApiImplicitParam(name = "lvUserQueryParam",value = "低压用户台账实体",required = true)
|
||||||
|
public HttpResult<Page<PvLvUser>> getPvLvUserList(@RequestBody LvUserQueryParam lvUserQueryParam){
|
||||||
|
String methodDescribe = getMethodDescribe("getPvLvUserList");
|
||||||
|
Page<PvLvUser> page = iPvLvUserService.getPvLvUserList(lvUserQueryParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有低压用户台账
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return Page<PvLvUser>
|
||||||
|
*/
|
||||||
|
@PostMapping("getAllPvLvUserList")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("查询所有低压用户台账")
|
||||||
|
public HttpResult<List<PvLvUser>> getAllPvLvUserList(){
|
||||||
|
String methodDescribe = getMethodDescribe("getAllPvLvUserList");
|
||||||
|
List<PvLvUser> list = iPvLvUserService.getAllPvLvUserList();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据低压用户台账id查询低压用户台账
|
||||||
|
* @param id 低压用户台账id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return PvLvUser
|
||||||
|
*/
|
||||||
|
@GetMapping("getPvLvUserById")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("根据低压用户台账id查询低压用户台账")
|
||||||
|
@ApiImplicitParam(name = "id",value = "低压用户台账id",required = true)
|
||||||
|
public HttpResult<PvLvUser> getPvLvUserById(@RequestParam("id") String id){
|
||||||
|
String methodDescribe = getMethodDescribe("getPvLvUserById");
|
||||||
|
PvLvUser pvLvUser = iPvLvUserService.getPvLvUserById(id);
|
||||||
|
if(Objects.nonNull(pvLvUser)){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pvLvUser, methodDescribe);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除低压用户台账
|
||||||
|
* @param id 低压用户台账id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
@DeleteMapping("delPvLvUser")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("删除低压用户台账")
|
||||||
|
@ApiImplicitParam(name = "id",value = "低压用户台账id",required = true)
|
||||||
|
public HttpResult<PvLvUser> delPvLvUser(@RequestParam("id") String id){
|
||||||
|
String methodDescribe = getMethodDescribe("delPvLvUser");
|
||||||
|
boolean res = iPvLvUserService.delPvLvUser(id);
|
||||||
|
if(res){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
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.constant.OperateType;
|
||||||
|
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.PvSubAreaParam;
|
||||||
|
import com.njcn.device.pojo.param.pv.SubAreaQueryParam;
|
||||||
|
import com.njcn.device.pojo.po.pv.PvSubArea;
|
||||||
|
import com.njcn.pvdevice.service.IPvSubAreaService;
|
||||||
|
import com.sun.el.parser.BooleanNode;
|
||||||
|
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 com.njcn.web.controller.BaseController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 台区控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pvSubArea")
|
||||||
|
@Api(tags = "pv台区控制器")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PvSubAreaController extends BaseController {
|
||||||
|
|
||||||
|
private final IPvSubAreaService iPvSubAreaService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增台区
|
||||||
|
* @param pvSubAreaParam 台区实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
@PostMapping("addSubArea")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.ADD)
|
||||||
|
@ApiOperation("新增台区")
|
||||||
|
@ApiImplicitParam(name = "pvSubAreaParam",value = "台区实体",required = true)
|
||||||
|
public HttpResult<Object> addSubArea(@RequestBody @Validated PvSubAreaParam pvSubAreaParam){
|
||||||
|
String methodDescribe = getMethodDescribe("addSubArea");
|
||||||
|
boolean res = iPvSubAreaService.addSubArea(pvSubAreaParam);
|
||||||
|
if(res){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改台区
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
@PostMapping("updateSubArea")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.UPDATE)
|
||||||
|
@ApiOperation("修改台区")
|
||||||
|
@ApiImplicitParam(name = "updatePvSubAreaParam",value = "台区实体",required = true)
|
||||||
|
public HttpResult<Object> updateSubArea(@RequestBody @Validated PvSubAreaParam.UpdatePvSubAreaParam updatePvSubAreaParam){
|
||||||
|
String methodDescribe = getMethodDescribe("updateSubArea");
|
||||||
|
boolean res = iPvSubAreaService.updateSubArea(updatePvSubAreaParam);
|
||||||
|
if(res){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询台区
|
||||||
|
* @param subAreaQueryParam 查询实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return Page<PvSubArea>
|
||||||
|
*/
|
||||||
|
@PostMapping("getPvSubAreaList")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("分页查询台区")
|
||||||
|
@ApiImplicitParam(name = "subAreaQueryParam",value = "台区实体",required = true)
|
||||||
|
public HttpResult<Page<PvSubArea>> getPvSubAreaList(@RequestBody SubAreaQueryParam subAreaQueryParam){
|
||||||
|
String methodDescribe = getMethodDescribe("getPvSubAreaList");
|
||||||
|
Page<PvSubArea> page = iPvSubAreaService.getPvSubAreaList(subAreaQueryParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有台区
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return Page<PvSubArea>
|
||||||
|
*/
|
||||||
|
@PostMapping("getAllPvSubAreaList")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("查询所有台区")
|
||||||
|
public HttpResult<List<PvSubArea>> getAllPvSubAreaList(){
|
||||||
|
String methodDescribe = getMethodDescribe("getAllPvSubAreaList");
|
||||||
|
List<PvSubArea> list = iPvSubAreaService.getAllPvSubAreaList();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据台区id查询台区
|
||||||
|
* @param id 台区id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return PvSubArea
|
||||||
|
*/
|
||||||
|
@GetMapping("getPvSubAreaById")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("根据台区id查询台区")
|
||||||
|
@ApiImplicitParam(name = "id",value = "台区id",required = true)
|
||||||
|
public HttpResult<PvSubArea> getPvSubAreaById(@RequestParam("id") String id){
|
||||||
|
String methodDescribe = getMethodDescribe("getPvSubAreaById");
|
||||||
|
PvSubArea pvSubArea = iPvSubAreaService.getPvSubAreaById(id);
|
||||||
|
if(Objects.nonNull(pvSubArea)){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pvSubArea, methodDescribe);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除台区
|
||||||
|
* @param id 台区id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
@DeleteMapping("delPvSubArea")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("删除台区")
|
||||||
|
@ApiImplicitParam(name = "id",value = "台区id",required = true)
|
||||||
|
public HttpResult<PvSubArea> delPvSubArea(@RequestParam("id") String id){
|
||||||
|
String methodDescribe = getMethodDescribe("delPvSubArea");
|
||||||
|
boolean res = iPvSubAreaService.delPvSubArea(id);
|
||||||
|
if(res){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,151 @@
|
|||||||
|
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.constant.OperateType;
|
||||||
|
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.PvSubstationParam;
|
||||||
|
import com.njcn.device.pojo.param.pv.SubstationQueryParam;
|
||||||
|
import com.njcn.device.pojo.po.pv.PvSubstation;
|
||||||
|
import com.njcn.pvdevice.service.IPvSubstationService;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
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 com.njcn.web.controller.BaseController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 变电站控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pvSubstation")
|
||||||
|
@Api(tags = "pv变电站控制器")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PvSubstationController extends BaseController {
|
||||||
|
|
||||||
|
private final IPvSubstationService iPvSubstationService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增变电站
|
||||||
|
* @param pvSubstationParam 变电站实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
@PostMapping("addSubstation")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.ADD)
|
||||||
|
@ApiOperation("新增变电站")
|
||||||
|
@ApiImplicitParam(name = "pvSubstationParam",value = "变电站实体",required = true)
|
||||||
|
public HttpResult<Object> addSubstation(@RequestBody @Validated PvSubstationParam pvSubstationParam){
|
||||||
|
String methodDescribe = getMethodDescribe("addSubstation");
|
||||||
|
iPvSubstationService.addSubstation(pvSubstationParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改变电站
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
@PostMapping("updateSubstation")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.UPDATE)
|
||||||
|
@ApiOperation("修改变电站")
|
||||||
|
@ApiImplicitParam(name = "updatePvSubstationParam",value = "变电站实体",required = true)
|
||||||
|
public HttpResult<Object> updateSubstation(@RequestBody @Validated PvSubstationParam.UpdatePvSubstationParam updatePvSubstationParam){
|
||||||
|
String methodDescribe = getMethodDescribe("updateSubstation");
|
||||||
|
iPvSubstationService.updateSubstation(updatePvSubstationParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询变电站
|
||||||
|
* @param substationQueryParam 查询实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return Page<PvSubstation>
|
||||||
|
*/
|
||||||
|
@PostMapping("getPvSubstationList")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("分页查询变电站")
|
||||||
|
@ApiImplicitParam(name = "substationQueryParam",value = "变电站实体",required = true)
|
||||||
|
public HttpResult<Page<PvSubstation>> getPvSubstationList(@RequestBody SubstationQueryParam substationQueryParam){
|
||||||
|
String methodDescribe = getMethodDescribe("getPvSubstationList");
|
||||||
|
Page<PvSubstation> page = iPvSubstationService.getPvSubstationList(substationQueryParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有变电站
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return Page<PvSubstation>
|
||||||
|
*/
|
||||||
|
@PostMapping("getAllPvSubstationList")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("查询所有变电站")
|
||||||
|
public HttpResult<List<PvSubstation>> getAllPvSubstationList(){
|
||||||
|
String methodDescribe = getMethodDescribe("getAllPvSubstationList");
|
||||||
|
List<PvSubstation> list = iPvSubstationService.getAllPvSubstationList();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据变电站id查询变电站
|
||||||
|
* @param id 变电站id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return PvSubstation
|
||||||
|
*/
|
||||||
|
@GetMapping("getPvSubstationById")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("根据变电站id查询变电站")
|
||||||
|
@ApiImplicitParam(name = "id",value = "变电站id",required = true)
|
||||||
|
public HttpResult<PvSubstation> getPvSubstationById(@RequestParam("id") String id){
|
||||||
|
String methodDescribe = getMethodDescribe("getPvSubstationById");
|
||||||
|
PvSubstation pvSubstation = iPvSubstationService.getPvSubstationById(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pvSubstation, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除变电站
|
||||||
|
* @param id 变电站id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
@DeleteMapping("delPvSubstation")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("删除变电站")
|
||||||
|
@ApiImplicitParam(name = "id",value = "变电站id",required = true)
|
||||||
|
public HttpResult<PvSubstation> delPvSubstation(@RequestParam("id") String id){
|
||||||
|
String methodDescribe = getMethodDescribe("delPvSubstation");
|
||||||
|
iPvSubstationService.delPvSubstation(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,141 @@
|
|||||||
|
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.constant.OperateType;
|
||||||
|
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.PvTenVoltageParam;
|
||||||
|
import com.njcn.device.pojo.param.pv.TenVoltageQueryParam;
|
||||||
|
import com.njcn.device.pojo.po.pv.PvTenVoltage;
|
||||||
|
import com.njcn.pvdevice.service.IPvTenVoltageService;
|
||||||
|
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 com.njcn.web.controller.BaseController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pvTenVoltage")
|
||||||
|
@Api(tags = "pv十千伏线路控制器")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PvTenVoltageController extends BaseController {
|
||||||
|
|
||||||
|
private final IPvTenVoltageService iPvTenVoltageService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增10kV线路
|
||||||
|
*
|
||||||
|
* @param pvTenVoltageParam 10kV线路实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
@PostMapping("addTenVoltage")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||||
|
@ApiOperation("新增10kV线路")
|
||||||
|
@ApiImplicitParam(name = "pvTenVoltageParam", value = "10kV线路实体", required = true)
|
||||||
|
public HttpResult<Object> addTenVoltage(@RequestBody @Validated PvTenVoltageParam pvTenVoltageParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("addTenVoltage");
|
||||||
|
boolean flag = iPvTenVoltageService.addTenVoltage(pvTenVoltageParam);
|
||||||
|
if (flag) {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改10kV线路
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
@PostMapping("updateTenVoltage")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
||||||
|
@ApiOperation("修改10kV线路")
|
||||||
|
@ApiImplicitParam(name = "updatePvTenVoltageParam", value = "10kV线路实体", required = true)
|
||||||
|
public HttpResult<Object> updateTenVoltage(@RequestBody @Validated PvTenVoltageParam.UpdatePvTenVoltageParam updatePvTenVoltageParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("updateTenVoltage");
|
||||||
|
boolean flag = iPvTenVoltageService.updateTenVoltage(updatePvTenVoltageParam);
|
||||||
|
if (flag) {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询10kV线路
|
||||||
|
*
|
||||||
|
* @param tenVoltageQueryParam 查询实体
|
||||||
|
* @return Page<PvTenVoltage>
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
@PostMapping("getPvTenVoltageList")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("分页查询10kV线路")
|
||||||
|
@ApiImplicitParam(name = "tenVoltageQueryParam", value = "10kV线路实体", required = true)
|
||||||
|
public HttpResult<Page<PvTenVoltage>> getPvTenVoltageList(@RequestBody @Validated TenVoltageQueryParam tenVoltageQueryParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("getPvTenVoltageList");
|
||||||
|
Page<PvTenVoltage> page = iPvTenVoltageService.getPvTenVoltageList(tenVoltageQueryParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据10kV线路id查询10kV线路
|
||||||
|
*
|
||||||
|
* @param id 10kV线路id
|
||||||
|
* @return PvTenVoltage
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
@GetMapping("getPvTenVoltageById")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("根据10kV线路id查询10kV线路")
|
||||||
|
@ApiImplicitParam(name = "id", value = "10kV线路id", required = true)
|
||||||
|
public HttpResult<PvTenVoltage> getPvTenVoltageById(@RequestParam("id") String id) {
|
||||||
|
String methodDescribe = getMethodDescribe("getPvTenVoltageById");
|
||||||
|
PvTenVoltage pvTenVoltage = iPvTenVoltageService.getPvTenVoltageById(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pvTenVoltage, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除10kV线路
|
||||||
|
*
|
||||||
|
* @param id 10kV线路id
|
||||||
|
* @return boolean
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
@DeleteMapping("delPvTenVoltage")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("删除10kV线路")
|
||||||
|
@ApiImplicitParam(name = "id", value = "10kV线路id", required = true)
|
||||||
|
public HttpResult<PvTenVoltage> delPvTenVoltage(@RequestParam("id") String id) {
|
||||||
|
String methodDescribe = getMethodDescribe("delPvTenVoltage");
|
||||||
|
boolean flag = iPvTenVoltageService.delPvTenVoltage(id);
|
||||||
|
if (flag) {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,134 @@
|
|||||||
|
package com.njcn.pvdevice.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.constant.OperateType;
|
||||||
|
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.PvUnitParam;
|
||||||
|
import com.njcn.device.pojo.po.pv.PvUnit;
|
||||||
|
import com.njcn.device.pojo.vo.pv.UnitTreeVO;
|
||||||
|
import com.njcn.pvdevice.service.IPvUnitService;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
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 com.njcn.web.controller.BaseController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pvUnit")
|
||||||
|
@Api(tags = "pv单位控制器")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PvUnitController extends BaseController {
|
||||||
|
|
||||||
|
private final IPvUnitService iPvUnitService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增单位
|
||||||
|
* @param pvUnitParam 单位实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
@PostMapping("addUnit")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.ADD)
|
||||||
|
@ApiOperation("新增单位")
|
||||||
|
@ApiImplicitParam(name = "pvUnitParam",value = "单位实体",required = true)
|
||||||
|
public HttpResult<Object> addUnit(@RequestBody @Validated PvUnitParam pvUnitParam){
|
||||||
|
String methodDescribe = getMethodDescribe("addUnit");
|
||||||
|
iPvUnitService.addUnit(pvUnitParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改单位
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
@PostMapping("updateUnit")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.UPDATE)
|
||||||
|
@ApiOperation("修改单位")
|
||||||
|
@ApiImplicitParam(name = "updatePvUnitParam",value = "单位实体",required = true)
|
||||||
|
public HttpResult<Object> updateUnit(@RequestBody @Validated PvUnitParam.UpdatePvUnitParam updatePvUnitParam){
|
||||||
|
String methodDescribe = getMethodDescribe("updateUnit");
|
||||||
|
iPvUnitService.updateUnit(updatePvUnitParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有单位
|
||||||
|
* @param baseParam 查询实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return Page<PvUnit>
|
||||||
|
*/
|
||||||
|
@PostMapping("getPvUnitList")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("查询所有单位")
|
||||||
|
@ApiImplicitParam(name = "baseParam",value = "单位实体",required = true)
|
||||||
|
public HttpResult<List<UnitTreeVO>> getPvUnitList(@RequestBody BaseParam baseParam){
|
||||||
|
String methodDescribe = getMethodDescribe("getPvUnitList");
|
||||||
|
List<UnitTreeVO> res = iPvUnitService.getPvUnitList(baseParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据单位id查询单位
|
||||||
|
* @param id 单位id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return PvUnit
|
||||||
|
*/
|
||||||
|
@GetMapping("getPvUnitById")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("根据单位id查询单位")
|
||||||
|
@ApiImplicitParam(name = "id",value = "单位id",required = true)
|
||||||
|
public HttpResult<PvUnit> getPvUnitById(@RequestParam("id") String id){
|
||||||
|
String methodDescribe = getMethodDescribe("getPvUnitById");
|
||||||
|
PvUnit pvUnit = iPvUnitService.getPvUnitById(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pvUnit, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除单位
|
||||||
|
* @param id 单位id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
@DeleteMapping("delPvUnit")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("删除单位")
|
||||||
|
@ApiImplicitParam(name = "id",value = "单位id",required = true)
|
||||||
|
public HttpResult<PvUnit> delPvUnit(@RequestParam("id") String id){
|
||||||
|
String methodDescribe = getMethodDescribe("delPvUnit");
|
||||||
|
iPvUnitService.delPvUnit(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,147 @@
|
|||||||
|
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.constant.OperateType;
|
||||||
|
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.PvVoltageParam;
|
||||||
|
import com.njcn.device.pojo.param.pv.VoltageQueryParam;
|
||||||
|
import com.njcn.device.pojo.po.pv.PvVoltage;
|
||||||
|
import com.njcn.pvdevice.service.IPvTenVoltageService;
|
||||||
|
import com.njcn.pvdevice.service.IPvVoltageService;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
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 com.njcn.web.controller.BaseController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pvVoltage")
|
||||||
|
@Api(tags = "pv母线控制器")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PvVoltageController extends BaseController {
|
||||||
|
|
||||||
|
private final IPvVoltageService iPvVoltageService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增母线
|
||||||
|
* @param pvVoltageParam 母线实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
@PostMapping("addVoltage")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.ADD)
|
||||||
|
@ApiOperation("新增母线")
|
||||||
|
@ApiImplicitParam(name = "pvVoltageParam",value = "母线实体",required = true)
|
||||||
|
public HttpResult<Object> addVoltage(@RequestBody @Validated PvVoltageParam pvVoltageParam){
|
||||||
|
String methodDescribe = getMethodDescribe("addVoltage");
|
||||||
|
iPvVoltageService.addVoltage(pvVoltageParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改母线
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
@PostMapping("updateVoltage")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.UPDATE)
|
||||||
|
@ApiOperation("修改母线")
|
||||||
|
@ApiImplicitParam(name = "updatePvVoltageParam",value = "母线实体",required = true)
|
||||||
|
public HttpResult<Object> updateVoltage(@RequestBody @Validated PvVoltageParam.UpdatePvVoltageParam updatePvVoltageParam){
|
||||||
|
String methodDescribe = getMethodDescribe("updateVoltage");
|
||||||
|
iPvVoltageService.updateVoltage(updatePvVoltageParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询母线
|
||||||
|
* @param voltageQueryParam 查询实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return Page<PvVoltage>
|
||||||
|
*/
|
||||||
|
@PostMapping("getPvVoltageList")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("分页查询母线")
|
||||||
|
@ApiImplicitParam(name = "voltageQueryParam",value = "母线实体",required = true)
|
||||||
|
public HttpResult<Page<PvVoltage>> getPvVoltageList(@RequestBody VoltageQueryParam voltageQueryParam){
|
||||||
|
String methodDescribe = getMethodDescribe("getPvVoltageList");
|
||||||
|
Page<PvVoltage> page = iPvVoltageService.getPvVoltageList(voltageQueryParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有母线
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return Page<PvVoltage>
|
||||||
|
*/
|
||||||
|
@PostMapping("getAllPvVoltageList")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("查询所有母线")
|
||||||
|
public HttpResult<List<PvVoltage>> getAllPvVoltageList(){
|
||||||
|
String methodDescribe = getMethodDescribe("getAllPvVoltageList");
|
||||||
|
List<PvVoltage> list = iPvVoltageService.getAllPvVoltageList();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据母线id查询母线
|
||||||
|
* @param id 母线id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return PvVoltage
|
||||||
|
*/
|
||||||
|
@GetMapping("getPvVoltageById")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("根据母线id查询母线")
|
||||||
|
@ApiImplicitParam(name = "id",value = "母线id",required = true)
|
||||||
|
public HttpResult<PvVoltage> getPvVoltageById(@RequestParam("id") String id){
|
||||||
|
String methodDescribe = getMethodDescribe("getPvVoltageById");
|
||||||
|
PvVoltage pvVoltage = iPvVoltageService.getPvVoltageById(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pvVoltage, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除母线
|
||||||
|
* @param id 母线id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
@DeleteMapping("delPvVoltage")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("删除母线")
|
||||||
|
@ApiImplicitParam(name = "id",value = "母线id",required = true)
|
||||||
|
public HttpResult<PvVoltage> delPvVoltage(@RequestParam("id") String id){
|
||||||
|
String methodDescribe = getMethodDescribe("delPvVoltage");
|
||||||
|
iPvVoltageService.delPvVoltage(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.njcn.pvdevice.mapper;
|
||||||
|
|
||||||
|
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 org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
public interface PvDeviceMapper extends BaseMapper<PvDevice> {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有终端台账
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/8
|
||||||
|
*/
|
||||||
|
Page<PvDevice> getPvDeviceList(Page<PvDevice> page,@Param("deviceQueryParam") DeviceQueryParam deviceQueryParam);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.pvdevice.mapper;
|
||||||
|
|
||||||
|
import com.njcn.device.pojo.po.pv.PvDispatch;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
public interface PvDispatchMapper extends BaseMapper<PvDispatch> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.njcn.pvdevice.mapper;
|
||||||
|
|
||||||
|
|
||||||
|
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 org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-06
|
||||||
|
*/
|
||||||
|
public interface PvDistributedMapper extends BaseMapper<PvDistributed> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询索引分布式光伏
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/7
|
||||||
|
*/
|
||||||
|
Page<PvDistributed> getPvDistributedList(Page<PvDistributed> page,@Param("distributedQueryParam") DistributedQueryParam distributedQueryParam);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.pvdevice.mapper;
|
||||||
|
|
||||||
|
import com.njcn.device.pojo.po.pv.PvLineDetail;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
public interface PvLineDetailMapper extends BaseMapper<PvLineDetail> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.njcn.pvdevice.mapper;
|
||||||
|
|
||||||
|
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 org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
public interface PvLvUserMapper extends BaseMapper<PvLvUser> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页获取低压用户台账
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/8
|
||||||
|
*/
|
||||||
|
Page<PvLvUser> getPvLvUserList(Page<PvLvUser> page,@Param("lvUserQueryParam") LvUserQueryParam lvUserQueryParam);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.njcn.pvdevice.mapper;
|
||||||
|
|
||||||
|
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 org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
public interface PvSubAreaMapper extends BaseMapper<PvSubArea> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有台区
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/7
|
||||||
|
*/
|
||||||
|
Page<PvSubArea> getPvSubAreaList(Page<PvSubArea> page,@Param("subsAreaQueryParam") SubAreaQueryParam subsAreaQueryParam);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.njcn.pvdevice.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.device.pojo.param.pv.SubstationQueryParam;
|
||||||
|
import com.njcn.device.pojo.po.pv.PvSubstation;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
public interface PvSubstationMapper extends BaseMapper<PvSubstation> {
|
||||||
|
|
||||||
|
Page<PvSubstation> getPvSubstationList(Page<PvSubstation> page,@Param("substationQueryParam") SubstationQueryParam substationQueryParam);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.njcn.pvdevice.mapper;
|
||||||
|
|
||||||
|
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 org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
public interface PvTenVoltageMapper extends BaseMapper<PvTenVoltage> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有10kV线路
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/7
|
||||||
|
*/
|
||||||
|
Page<PvTenVoltage> getPvTenVoltageList(Page<PvTenVoltage> page,@Param("tenVoltageQueryParam") TenVoltageQueryParam tenVoltageQueryParam);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.njcn.pvdevice.mapper;
|
||||||
|
|
||||||
|
import com.njcn.device.pojo.po.pv.PvUnit;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.device.pojo.vo.pv.UnitTreeVO;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
public interface PvUnitMapper extends BaseMapper<PvUnit> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取主列表单位树
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/7
|
||||||
|
*/
|
||||||
|
List<UnitTreeVO> getPvUnitList(@Param("orderBy")String orderBy,@Param("sortBy")String sortBy);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.pvdevice.mapper;
|
||||||
|
|
||||||
|
import com.njcn.device.pojo.po.pv.PvVoltage;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
public interface PvVoltageMapper extends BaseMapper<PvVoltage> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!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
|
||||||
|
dev.id,
|
||||||
|
dic.NAME manufacturer,
|
||||||
|
dic2.NAME devType,
|
||||||
|
dev.type,
|
||||||
|
dev.Dev_Code,
|
||||||
|
dev.ip,
|
||||||
|
dev.port,
|
||||||
|
dev.Series,
|
||||||
|
dev.Dev_Key,
|
||||||
|
dev.This_Time_Check,
|
||||||
|
dev.Next_Time_Check
|
||||||
|
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
|
||||||
|
<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
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.njcn.pvdevice.mapper.PvDispatchMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!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
|
||||||
|
dis.id,
|
||||||
|
dic.NAME scale,
|
||||||
|
dis.NAME,
|
||||||
|
dis.User_Code,
|
||||||
|
dis.Dev_Code,
|
||||||
|
dis.Machine_Capacity,
|
||||||
|
dis.Inte_Type,
|
||||||
|
dis.Phase,
|
||||||
|
dis.Energy_Capacity
|
||||||
|
FROM
|
||||||
|
pv_distributed dis
|
||||||
|
LEFT JOIN sys_dict_data dic ON dis.scale = dic.id
|
||||||
|
<where>
|
||||||
|
<if test="distributedQueryParam.searchValue!=null and distributedQueryParam.searchValue!=''">
|
||||||
|
and dis.name like CONCAT('%',#{distributedQueryParam.searchValue},'%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="distributedQueryParam.scale!=null and distributedQueryParam.scale.size > 0">
|
||||||
|
and dis.scale in
|
||||||
|
<foreach collection="distributedQueryParam.scale" item="item" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
and dis.state = 1
|
||||||
|
</where>
|
||||||
|
order by dis.create_time asc
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!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>
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!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
|
||||||
|
lv.id,
|
||||||
|
dic.NAME scale,
|
||||||
|
lv.NAME,
|
||||||
|
lv.User_Code,
|
||||||
|
lv.User_Capacity,
|
||||||
|
lv.Complain,
|
||||||
|
lv.Complain_Part,
|
||||||
|
lv.Corrective,
|
||||||
|
lv.Dev_Govern,
|
||||||
|
lv.Govern_Type,
|
||||||
|
lv.Govern_Capacity
|
||||||
|
FROM
|
||||||
|
pv_lv_user lv
|
||||||
|
LEFT JOIN sys_dict_data dic ON lv.scale = dic.id
|
||||||
|
<where>
|
||||||
|
<if test="lvUserQueryParam.searchValue!=null and lvUserQueryParam.searchValue!=''">
|
||||||
|
and lv.name like CONCAT('%',#{lvUserQueryParam.searchValue},'%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="lvUserQueryParam.scale!=null and lvUserQueryParam.scale.size > 0">
|
||||||
|
and lv.scale in
|
||||||
|
<foreach collection="lvUserQueryParam.scale" item="item" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
and lv.state = 1
|
||||||
|
</where>
|
||||||
|
order by lv.create_time asc
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!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
|
||||||
|
sub.id,
|
||||||
|
unit.name unitId,
|
||||||
|
ten.NAME tenVoltageId,
|
||||||
|
sub.NAME,
|
||||||
|
sub.Code,
|
||||||
|
sub.Cable_Length,
|
||||||
|
sub.Resistance,
|
||||||
|
sub.Reactance,
|
||||||
|
sub.Type,
|
||||||
|
sub.Capacity,
|
||||||
|
sub.Regulation_Mode,
|
||||||
|
sub.React_Capacity,
|
||||||
|
sub.Dev_Fusion,
|
||||||
|
sub.pv,
|
||||||
|
sub.Total_C,
|
||||||
|
sub.Pv_Users,
|
||||||
|
sub.Power_Power
|
||||||
|
FROM
|
||||||
|
pv_sub_area sub
|
||||||
|
INNER JOIN pv_unit unit ON sub.unit_id = unit.id
|
||||||
|
INNER JOIN pv_ten_voltage ten ON ten.id = sub.Ten_Voltage_Id
|
||||||
|
<where>
|
||||||
|
<if test="subsAreaQueryParam.searchValue!=null and subsAreaQueryParam.searchValue!=''">
|
||||||
|
and sub.name like CONCAT('%',#{subsAreaQueryParam.searchValue},'%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="subsAreaQueryParam.unitId!=null and subsAreaQueryParam.unitId.size > 0">
|
||||||
|
and sub.unit_id in
|
||||||
|
<foreach collection="subsAreaQueryParam.unitId" item="item" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="subsAreaQueryParam.tenVoltageId!=null and subsAreaQueryParam.tenVoltageId.size > 0">
|
||||||
|
and sub.Ten_Voltage_Id in
|
||||||
|
<foreach collection="subsAreaQueryParam.tenVoltageId" item="item" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by ten.create_time asc
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.njcn.pvdevice.mapper.PvSubstationMapper">
|
||||||
|
|
||||||
|
<select id="getPvSubstationList" resultType="PvSubstation">
|
||||||
|
SELECT
|
||||||
|
sub.id,
|
||||||
|
unit.NAME unitId,
|
||||||
|
dic.NAME scale,
|
||||||
|
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
|
||||||
|
<where>
|
||||||
|
<if test="substationQueryParam.searchValue!=null and substationQueryParam.searchValue!=''">
|
||||||
|
and sub.name like CONCAT('%',#{substationQueryParam.searchValue},'%')
|
||||||
|
</if>
|
||||||
|
<if test="substationQueryParam.unitId!=null and substationQueryParam.unitId.size > 0">
|
||||||
|
and sub.unit_id in
|
||||||
|
<foreach collection="substationQueryParam.unitId" item="item" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="substationQueryParam.scale!=null and substationQueryParam.scale.size > 0">
|
||||||
|
and sub.scale in
|
||||||
|
<foreach collection="substationQueryParam.scale" item="item" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="substationQueryParam.sortBy!=null and substationQueryParam.sortBy!='' and substationQueryParam.orderBy!=null and substationQueryParam.orderBy!=''">
|
||||||
|
order by concat(#{substationQueryParam.sortBy},' ',#{substationQueryParam.orderBy})
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!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
|
||||||
|
ten.id,
|
||||||
|
dic.NAME scale,
|
||||||
|
dic2.NAME designScale,
|
||||||
|
ten.NAME,
|
||||||
|
ten.Cr_Type,
|
||||||
|
ten.Dev_Status,
|
||||||
|
ten.Earthing,
|
||||||
|
ten.Quality,
|
||||||
|
ten.Master_Stroke,
|
||||||
|
ten.Major,
|
||||||
|
ten.Master,
|
||||||
|
ten.Start_Station,
|
||||||
|
ten.End_Station,
|
||||||
|
ten.Run_Load,
|
||||||
|
ten.Output_Power,
|
||||||
|
ten.Max_Current,
|
||||||
|
ten.Put_Into_Date
|
||||||
|
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.searchValue!=null and tenVoltageQueryParam.searchValue!=''">
|
||||||
|
and ten.name like CONCAT('%',#{tenVoltageQueryParam.searchValue},'%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="tenVoltageQueryParam.scale!=null and tenVoltageQueryParam.scale.size > 0">
|
||||||
|
and ten.scale in
|
||||||
|
<foreach collection="tenVoltageQueryParam.scale" item="item" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="tenVoltageQueryParam.designScale!=null and tenVoltageQueryParam.designScale.size > 0">
|
||||||
|
and ten.design_Scale in
|
||||||
|
<foreach collection="tenVoltageQueryParam.designScale" item="item" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by ten.create_time asc
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.njcn.pvdevice.mapper.PvUnitMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getPvUnitList" resultType="UnitTreeVO">
|
||||||
|
select * from pv_unit
|
||||||
|
<if test="orderBy!=null and orderBy!='' and sortBy!=null and sortBy!=''">
|
||||||
|
order by concat(#{sortBy},' ',#{orderBy})
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.njcn.pvdevice.mapper.PvVoltageMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
package com.njcn.pvdevice.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
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.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.device.pojo.po.pv.PvDevice;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
public interface IPvDeviceService extends IService<PvDevice> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增分布式台账
|
||||||
|
* @param pvDeviceParam 分布式台账实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean addDevice(PvDeviceParam pvDeviceParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改分布式台账
|
||||||
|
* @param updatePvDeviceParam 分布式台账实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean updateDevice(PvDeviceParam.UpdatePvDeviceParam updatePvDeviceParam);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询分布式台账
|
||||||
|
* @param DeviceQueryParam 分布式台账实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return Page<PvDevice>
|
||||||
|
*/
|
||||||
|
Page<PvDevice> getPvDeviceList(DeviceQueryParam deviceQueryParam);
|
||||||
|
|
||||||
|
List<PvDevice> getAllPvDeviceList();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据分布式台账id查询分布式台账
|
||||||
|
* @param id 分布式台账id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return PvDevice
|
||||||
|
*/
|
||||||
|
PvDevice getPvDeviceById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除分布式台账
|
||||||
|
* @param id 分布式台账id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean delPvDevice(String id);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.pvdevice.service;
|
||||||
|
|
||||||
|
import com.njcn.device.pojo.po.pv.PvDispatch;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
public interface IPvDispatchService extends IService<PvDispatch> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
package com.njcn.pvdevice.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
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 java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 分布式服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-06
|
||||||
|
*/
|
||||||
|
public interface IPvDistributedService extends IService<PvDistributed> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增分布式台账
|
||||||
|
* @param pvDistributedParam 分布式台账实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean addDistributed(PvDistributedParam pvDistributedParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改分布式台账
|
||||||
|
* @param updatePvDistributedParam 分布式台账实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean updateDistributed(PvDistributedParam.UpdatePvDistributedParam updatePvDistributedParam);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询分布式台账
|
||||||
|
* @param distributedQueryParam 分布式台账实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return Page<PvDistributed>
|
||||||
|
*/
|
||||||
|
Page<PvDistributed> getPvDistributedList(DistributedQueryParam distributedQueryParam);
|
||||||
|
|
||||||
|
List<PvDistributed> getAllPvDistributedList();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据分布式台账id查询分布式台账
|
||||||
|
* @param id 分布式台账id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return PvDistributed
|
||||||
|
*/
|
||||||
|
PvDistributed getPvDistributedById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除分布式台账
|
||||||
|
* @param id 分布式台账id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean delPvDistributed(String id);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
package com.njcn.pvdevice.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.device.pojo.param.pv.LineDetailQueryParam;
|
||||||
|
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.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
public interface IPvLineDetailService extends IService<PvLineDetail> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增监测点
|
||||||
|
* @param pvLineDetailParam 监测点实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean addLineDetail(PvLineDetailParam pvLineDetailParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改监测点
|
||||||
|
* @param updatePvLineDetailParam 监测点实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean updateLineDetail(PvLineDetailParam.UpdatePvLineDetailParam updatePvLineDetailParam);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询监测点
|
||||||
|
* @param lineDetailQueryParam 监测点实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return Page<PvLineDetail>
|
||||||
|
*/
|
||||||
|
Page<PvLineDetail> getPvLineDetailList(LineDetailQueryParam lineDetailQueryParam);
|
||||||
|
|
||||||
|
List<PvLineDetail> getAllPvLineDetailList();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据监测点id查询监测点
|
||||||
|
* @param id 监测点id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return PvLineDetail
|
||||||
|
*/
|
||||||
|
PvLineDetail getPvLineDetailById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除监测点
|
||||||
|
* @param id 监测点id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean delPvLineDetail(String id);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
package com.njcn.pvdevice.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
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.po.pv.PvLvUser;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
public interface IPvLvUserService extends IService<PvLvUser> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增分低压用户台账
|
||||||
|
* @param pvLvUserParam 分低压用户台账实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean addLvUser(PvLvUserParam pvLvUserParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改分低压用户台账
|
||||||
|
* @param updatePvLvUserParam 分低压用户台账实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean updateLvUser(PvLvUserParam.UpdatePvLvUserParam updatePvLvUserParam);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询分低压用户台账
|
||||||
|
* @param lvUserQueryParam 分低压用户台账实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return Page<PvLvUser>
|
||||||
|
*/
|
||||||
|
Page<PvLvUser> getPvLvUserList(LvUserQueryParam lvUserQueryParam);
|
||||||
|
|
||||||
|
List<PvLvUser> getAllPvLvUserList();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据分低压用户台账id查询分低压用户台账
|
||||||
|
* @param id 分低压用户台账id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return PvLvUser
|
||||||
|
*/
|
||||||
|
PvLvUser getPvLvUserById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除分低压用户台账
|
||||||
|
* @param id 分低压用户台账id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean delPvLvUser(String id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
package com.njcn.pvdevice.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
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.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.device.pojo.po.pv.PvSubArea;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
public interface IPvSubAreaService extends IService<PvSubArea> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增台区
|
||||||
|
* @param pvSubAreaParam 台区实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean addSubArea(PvSubAreaParam pvSubAreaParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改台区
|
||||||
|
* @param updatePvSubAreaParam 台区实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean updateSubArea(PvSubAreaParam.UpdatePvSubAreaParam updatePvSubAreaParam);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询台区
|
||||||
|
* @param subAreaQueryParam 台区实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return Page<PvSubArea>
|
||||||
|
*/
|
||||||
|
Page<PvSubArea> getPvSubAreaList(SubAreaQueryParam subAreaQueryParam);
|
||||||
|
|
||||||
|
List<PvSubArea> getAllPvSubAreaList();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据台区id查询台区
|
||||||
|
* @param id 台区id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return PvSubArea
|
||||||
|
*/
|
||||||
|
PvSubArea getPvSubAreaById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除台区
|
||||||
|
* @param id 台区id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean delPvSubArea(String id);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
package com.njcn.pvdevice.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.device.pojo.param.pv.PvSubstationParam;
|
||||||
|
import com.njcn.device.pojo.param.pv.SubstationQueryParam;
|
||||||
|
import com.njcn.device.pojo.po.pv.PvSubstation;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.device.pojo.po.pv.PvSubstation;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
public interface IPvSubstationService extends IService<PvSubstation> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增变电站
|
||||||
|
* @param pvSubstationParam 变电站实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean addSubstation(PvSubstationParam pvSubstationParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改变电站
|
||||||
|
* @param updatePvSubstationParam 变电站实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean updateSubstation(PvSubstationParam.UpdatePvSubstationParam updatePvSubstationParam);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询变电站
|
||||||
|
* @param substationQueryParam 变电站实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return Page<PvSubstation>
|
||||||
|
*/
|
||||||
|
Page<PvSubstation> getPvSubstationList(SubstationQueryParam substationQueryParam);
|
||||||
|
|
||||||
|
List<PvSubstation> getAllPvSubstationList();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据变电站id查询变电站
|
||||||
|
* @param id 变电站id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return PvSubstation
|
||||||
|
*/
|
||||||
|
PvSubstation getPvSubstationById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除变电站
|
||||||
|
* @param id 变电站id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean delPvSubstation(String id);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
package com.njcn.pvdevice.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
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.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.device.pojo.po.pv.PvTenVoltage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 十千伏线路服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
public interface IPvTenVoltageService extends IService<PvTenVoltage> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增单位
|
||||||
|
* @param pvTenVoltageParam 单位实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean addTenVoltage(PvTenVoltageParam pvTenVoltageParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改单位
|
||||||
|
* @param updatePvTenVoltageParam 单位实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean updateTenVoltage(PvTenVoltageParam.UpdatePvTenVoltageParam updatePvTenVoltageParam);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询单位
|
||||||
|
* @param tenVoltageQueryParam 单位实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return Page<PvTenVoltage>
|
||||||
|
*/
|
||||||
|
Page<PvTenVoltage> getPvTenVoltageList(TenVoltageQueryParam tenVoltageQueryParam);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据单位id查询单位
|
||||||
|
* @param id 单位id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return PvTenVoltage
|
||||||
|
*/
|
||||||
|
PvTenVoltage getPvTenVoltageById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除单位
|
||||||
|
* @param id 单位id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean delPvTenVoltage(String id);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
package com.njcn.pvdevice.service;
|
||||||
|
|
||||||
|
import com.njcn.device.pojo.param.pv.PvUnitParam;
|
||||||
|
import com.njcn.device.pojo.po.pv.PvUnit;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.device.pojo.vo.pv.UnitTreeVO;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 单位服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
public interface IPvUnitService extends IService<PvUnit> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增单位
|
||||||
|
* @param pvUnitParam 单位实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean addUnit(PvUnitParam pvUnitParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改单位
|
||||||
|
* @param updatePvUnitParam 单位实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean updateUnit(PvUnitParam.UpdatePvUnitParam updatePvUnitParam);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询单位
|
||||||
|
* @param baseParam 单位实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return Page<PvUnit>
|
||||||
|
*/
|
||||||
|
List<UnitTreeVO> getPvUnitList(BaseParam baseParam);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据单位id查询单位
|
||||||
|
* @param id 单位id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return PvUnit
|
||||||
|
*/
|
||||||
|
PvUnit getPvUnitById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除单位
|
||||||
|
* @param id 单位id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean delPvUnit(String id);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
package com.njcn.pvdevice.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.device.pojo.param.pv.PvVoltageParam;
|
||||||
|
import com.njcn.device.pojo.param.pv.VoltageQueryParam;
|
||||||
|
import com.njcn.device.pojo.po.pv.PvVoltage;
|
||||||
|
import com.njcn.device.pojo.po.pv.PvVoltage;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
public interface IPvVoltageService extends IService<PvVoltage> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增母线
|
||||||
|
* @param pvVoltageParam 母线实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean addVoltage(PvVoltageParam pvVoltageParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改母线
|
||||||
|
* @param updatePvVoltageParam 母线实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean updateVoltage(PvVoltageParam.UpdatePvVoltageParam updatePvVoltageParam);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询母线
|
||||||
|
* @param voltageQueryParam 母线实体
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return Page<PvVoltage>
|
||||||
|
*/
|
||||||
|
Page<PvVoltage> getPvVoltageList(VoltageQueryParam voltageQueryParam);
|
||||||
|
|
||||||
|
List<PvVoltage> getAllPvVoltageList();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据母线id查询母线
|
||||||
|
* @param id 母线id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return PvVoltage
|
||||||
|
*/
|
||||||
|
PvVoltage getPvVoltageById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除母线
|
||||||
|
* @param id 母线id
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
boolean delPvVoltage(String id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
package com.njcn.pvdevice.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
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.exception.BusinessException;
|
||||||
|
import com.njcn.common.utils.PubUtils;
|
||||||
|
import com.njcn.device.enums.PvDeviceResponseEnum;
|
||||||
|
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.pvdevice.mapper.PvDeviceMapper;
|
||||||
|
import com.njcn.pvdevice.service.IPvDeviceService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
|
import com.njcn.system.enums.SystemResponseEnum;
|
||||||
|
import com.njcn.web.factory.PageFactory;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 终端台账实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PvDeviceServiceImpl extends ServiceImpl<PvDeviceMapper, PvDevice> implements IPvDeviceService {
|
||||||
|
|
||||||
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean addDevice(PvDeviceParam pvDeviceParam) {
|
||||||
|
checkNameAndParam(pvDeviceParam, false);
|
||||||
|
|
||||||
|
PvDevice pvDevice = new PvDevice();
|
||||||
|
BeanUtils.copyProperties(pvDeviceParam, pvDevice);
|
||||||
|
pvDevice.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
pvDevice.setThisTimeCheck(PubUtils.localDateFormat(pvDeviceParam.getThisTimeCheck()));
|
||||||
|
pvDevice.setNextTimeCheck(PubUtils.localDateFormat(pvDeviceParam.getNextTimeCheck()));
|
||||||
|
return this.save(pvDevice);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean updateDevice(PvDeviceParam.UpdatePvDeviceParam updatePvDeviceParam) {
|
||||||
|
checkNameAndParam(updatePvDeviceParam, true);
|
||||||
|
|
||||||
|
PvDevice pvDevice = new PvDevice();
|
||||||
|
BeanUtils.copyProperties(updatePvDeviceParam, pvDevice);
|
||||||
|
pvDevice.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
pvDevice.setThisTimeCheck(PubUtils.localDateFormat(updatePvDeviceParam.getThisTimeCheck()));
|
||||||
|
pvDevice.setNextTimeCheck(PubUtils.localDateFormat(updatePvDeviceParam.getNextTimeCheck()));
|
||||||
|
return this.updateById(pvDevice);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<PvDevice> getPvDeviceList(DeviceQueryParam subsAreaQueryParam) {
|
||||||
|
Page<PvDevice> page = new Page<>(PageFactory.getPageNum(subsAreaQueryParam), PageFactory.getPageSize(subsAreaQueryParam));
|
||||||
|
return this.baseMapper.getPvDeviceList(page,subsAreaQueryParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PvDevice> getAllPvDeviceList() {
|
||||||
|
return this.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PvDevice getPvDeviceById(String id) {
|
||||||
|
return this.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean delPvDevice(String id) {
|
||||||
|
return this.removeById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验单位名称是否重复
|
||||||
|
*/
|
||||||
|
private void checkNameAndParam(PvDeviceParam pvDeviceParam, boolean isUpdate) {
|
||||||
|
LambdaQueryWrapper<PvDevice> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(PvDevice::getDevCode, pvDeviceParam.getDevCode());
|
||||||
|
if (isUpdate) {
|
||||||
|
//更新操作
|
||||||
|
if (pvDeviceParam instanceof PvDeviceParam.UpdatePvDeviceParam) {
|
||||||
|
lambdaQueryWrapper.eq(PvDevice::getId, ((PvDeviceParam.UpdatePvDeviceParam) pvDeviceParam).getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int count = this.count(lambdaQueryWrapper);
|
||||||
|
if (count > 0) {
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.SUB_AREA_REPEAT);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*校验设备型号*/
|
||||||
|
if (StrUtil.isNotBlank(pvDeviceParam.getDevType())) {
|
||||||
|
if (Objects.isNull(dicDataFeignClient.getDicDataById(pvDeviceParam.getDevType()))) {
|
||||||
|
throw new BusinessException(SystemResponseEnum.DEV_TYPE_EMPTY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*校验生产厂家*/
|
||||||
|
|
||||||
|
if (Objects.isNull(dicDataFeignClient.getDicDataById(pvDeviceParam.getManufacturer()))) {
|
||||||
|
throw new BusinessException(SystemResponseEnum.MANUFACTURER);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验参数是否违规
|
||||||
|
*/
|
||||||
|
private void checkParam(PvDeviceParam pvDeviceParam) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.njcn.pvdevice.service.impl;
|
||||||
|
|
||||||
|
import com.njcn.device.pojo.po.pv.PvDispatch;
|
||||||
|
import com.njcn.pvdevice.mapper.PvDispatchMapper;
|
||||||
|
import com.njcn.pvdevice.service.IPvDispatchService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class PvDispatchServiceImpl extends ServiceImpl<PvDispatchMapper, PvDispatch> implements IPvDispatchService {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
package com.njcn.pvdevice.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.device.enums.PvDeviceResponseEnum;
|
||||||
|
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.pvdevice.mapper.PvDistributedMapper;
|
||||||
|
import com.njcn.pvdevice.service.IPvDistributedService;
|
||||||
|
import com.njcn.pvdevice.service.IPvSubAreaService;
|
||||||
|
import com.njcn.pvdevice.service.IPvUnitService;
|
||||||
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
|
import com.njcn.system.enums.SystemResponseEnum;
|
||||||
|
import com.njcn.web.factory.PageFactory;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-06
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PvDistributedServiceImpl extends ServiceImpl<PvDistributedMapper, PvDistributed> implements IPvDistributedService {
|
||||||
|
|
||||||
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean addDistributed(PvDistributedParam pvDistributedParam) {
|
||||||
|
checkNameAndParam(pvDistributedParam,false);
|
||||||
|
PvDistributed pvDistributed = new PvDistributed();
|
||||||
|
BeanUtils.copyProperties(pvDistributedParam,pvDistributed);
|
||||||
|
pvDistributed.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
return this.save(pvDistributed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean updateDistributed(PvDistributedParam.UpdatePvDistributedParam updatePvDistributedParam) {
|
||||||
|
checkNameAndParam(updatePvDistributedParam,true);
|
||||||
|
PvDistributed pvDistributed = new PvDistributed();
|
||||||
|
BeanUtils.copyProperties(updatePvDistributedParam,pvDistributed);
|
||||||
|
pvDistributed.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
return this.updateById(pvDistributed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<PvDistributed> getPvDistributedList(DistributedQueryParam distributedQueryParam) {
|
||||||
|
Page<PvDistributed> page = new Page<>(PageFactory.getPageNum(distributedQueryParam),PageFactory.getPageSize(distributedQueryParam));
|
||||||
|
return this.baseMapper.getPvDistributedList(page,distributedQueryParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PvDistributed> getAllPvDistributedList() {
|
||||||
|
return this.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PvDistributed getPvDistributedById(String id) {
|
||||||
|
return this.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean delPvDistributed(String id) {
|
||||||
|
return this.removeById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验单位名称是否重复
|
||||||
|
*/
|
||||||
|
private void checkNameAndParam(PvDistributedParam pvDistributedParam, boolean isUpdate) {
|
||||||
|
|
||||||
|
if(StrUtil.isNotBlank(pvDistributedParam.getScale())) {
|
||||||
|
if (Objects.isNull(dicDataFeignClient.getDicDataById(pvDistributedParam.getScale()))) {
|
||||||
|
throw new BusinessException(SystemResponseEnum.VOLTAGE_EMPTY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LambdaQueryWrapper<PvDistributed> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(PvDistributed::getName, pvDistributedParam.getName());
|
||||||
|
if (isUpdate) {
|
||||||
|
//更新操作
|
||||||
|
if (pvDistributedParam instanceof PvDistributedParam.UpdatePvDistributedParam) {
|
||||||
|
lambdaQueryWrapper.eq(PvDistributed::getId, ((PvDistributedParam.UpdatePvDistributedParam) pvDistributedParam).getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int count = this.count(lambdaQueryWrapper);
|
||||||
|
if (count > 0) {
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.SUB_AREA_REPEAT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
package com.njcn.pvdevice.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.device.enums.PvDeviceResponseEnum;
|
||||||
|
import com.njcn.device.pojo.param.pv.LineDetailQueryParam;
|
||||||
|
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.pvdevice.mapper.PvLineDetailMapper;
|
||||||
|
import com.njcn.pvdevice.service.IPvDeviceService;
|
||||||
|
import com.njcn.pvdevice.service.IPvLineDetailService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
|
import com.njcn.system.enums.SystemResponseEnum;
|
||||||
|
import com.njcn.web.factory.PageFactory;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 监测点实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PvLineDetailServiceImpl extends ServiceImpl<PvLineDetailMapper, PvLineDetail> implements IPvLineDetailService {
|
||||||
|
|
||||||
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
|
||||||
|
private final IPvDeviceService iPvDeviceService;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean addLineDetail(PvLineDetailParam pvLineDetailParam) {
|
||||||
|
checkName(pvLineDetailParam,false);
|
||||||
|
checkParam(pvLineDetailParam);
|
||||||
|
PvLineDetail pvLineDetail = new PvLineDetail();
|
||||||
|
BeanUtils.copyProperties(pvLineDetailParam,pvLineDetail);
|
||||||
|
return this.save(pvLineDetail);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean updateLineDetail(PvLineDetailParam.UpdatePvLineDetailParam updatePvLineDetailParam) {
|
||||||
|
checkName(updatePvLineDetailParam,true);
|
||||||
|
checkParam(updatePvLineDetailParam);
|
||||||
|
PvLineDetail pvLineDetail = new PvLineDetail();
|
||||||
|
BeanUtils.copyProperties(updatePvLineDetailParam,pvLineDetail);
|
||||||
|
return this.updateById(pvLineDetail);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<PvLineDetail> getPvLineDetailList(LineDetailQueryParam subsAreaQueryParam) {
|
||||||
|
Page<PvLineDetail> page = new Page<>(PageFactory.getPageNum(subsAreaQueryParam),PageFactory.getPageSize(subsAreaQueryParam));
|
||||||
|
LambdaQueryWrapper<PvLineDetail> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
return this.page(page,lambdaQueryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PvLineDetail> getAllPvLineDetailList() {
|
||||||
|
return this.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PvLineDetail getPvLineDetailById(String id) {
|
||||||
|
return this.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean delPvLineDetail(String id) {
|
||||||
|
return this.removeById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验单位名称是否重复
|
||||||
|
*/
|
||||||
|
private void checkName(PvLineDetailParam pvLineDetailParam, boolean isUpdate) {
|
||||||
|
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()))){
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.DEV_NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
package com.njcn.pvdevice.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
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.exception.BusinessException;
|
||||||
|
import com.njcn.device.enums.PvDeviceResponseEnum;
|
||||||
|
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.po.pv.PvLvUser;
|
||||||
|
import com.njcn.pvdevice.mapper.PvLvUserMapper;
|
||||||
|
import com.njcn.pvdevice.service.IPvLvUserService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.pvdevice.service.IPvSubAreaService;
|
||||||
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
|
import com.njcn.system.enums.SystemResponseEnum;
|
||||||
|
import com.njcn.web.factory.PageFactory;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 分布式用户实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PvLvUserServiceImpl extends ServiceImpl<PvLvUserMapper, PvLvUser> implements IPvLvUserService {
|
||||||
|
|
||||||
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean addLvUser(PvLvUserParam pvLvUserParam) {
|
||||||
|
checkNameAndParam(pvLvUserParam,false);
|
||||||
|
PvLvUser pvLvUser = new PvLvUser();
|
||||||
|
BeanUtils.copyProperties(pvLvUserParam,pvLvUser);
|
||||||
|
pvLvUser.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
return this.save(pvLvUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean updateLvUser(PvLvUserParam.UpdatePvLvUserParam updatePvLvUserParam) {
|
||||||
|
checkNameAndParam(updatePvLvUserParam,true);
|
||||||
|
PvLvUser pvLvUser = new PvLvUser();
|
||||||
|
BeanUtils.copyProperties(updatePvLvUserParam,pvLvUser);
|
||||||
|
pvLvUser.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
return this.updateById(pvLvUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<PvLvUser> getPvLvUserList(LvUserQueryParam lvUserQueryParam) {
|
||||||
|
Page<PvLvUser> page = new Page<>(PageFactory.getPageNum(lvUserQueryParam),PageFactory.getPageSize(lvUserQueryParam));
|
||||||
|
return this.baseMapper.getPvLvUserList(page,lvUserQueryParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PvLvUser> getAllPvLvUserList() {
|
||||||
|
return this.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PvLvUser getPvLvUserById(String id) {
|
||||||
|
return this.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean delPvLvUser(String id) {
|
||||||
|
return this.removeById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验单位名称是否重复
|
||||||
|
*/
|
||||||
|
private void checkNameAndParam(PvLvUserParam pvLvUserParam, boolean isUpdate) {
|
||||||
|
|
||||||
|
if(StrUtil.isNotBlank(pvLvUserParam.getScale())) {
|
||||||
|
if (Objects.isNull(dicDataFeignClient.getDicDataById(pvLvUserParam.getScale()))) {
|
||||||
|
throw new BusinessException(SystemResponseEnum.VOLTAGE_EMPTY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LambdaQueryWrapper<PvLvUser> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(PvLvUser::getName, pvLvUserParam.getName());
|
||||||
|
if (isUpdate) {
|
||||||
|
//更新操作
|
||||||
|
if (pvLvUserParam instanceof PvLvUserParam.UpdatePvLvUserParam) {
|
||||||
|
lambdaQueryWrapper.eq(PvLvUser::getId, ((PvLvUserParam.UpdatePvLvUserParam) pvLvUserParam).getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int count = this.count(lambdaQueryWrapper);
|
||||||
|
if (count > 0) {
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.SUB_AREA_REPEAT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
package com.njcn.pvdevice.service.impl;
|
||||||
|
|
||||||
|
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.exception.BusinessException;
|
||||||
|
import com.njcn.device.enums.PvDeviceResponseEnum;
|
||||||
|
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.pvdevice.mapper.PvSubAreaMapper;
|
||||||
|
import com.njcn.pvdevice.service.IPvSubAreaService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.pvdevice.service.IPvTenVoltageService;
|
||||||
|
import com.njcn.pvdevice.service.IPvUnitService;
|
||||||
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
|
import com.njcn.system.enums.SystemResponseEnum;
|
||||||
|
import com.njcn.system.pojo.po.DictData;
|
||||||
|
import com.njcn.web.factory.PageFactory;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PvSubAreaServiceImpl extends ServiceImpl<PvSubAreaMapper, PvSubArea> implements IPvSubAreaService {
|
||||||
|
|
||||||
|
|
||||||
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
|
||||||
|
private final IPvTenVoltageService iPvTenVoltageService;
|
||||||
|
|
||||||
|
private final IPvUnitService iPvUnitService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean addSubArea(PvSubAreaParam pvSubAreaParam) {
|
||||||
|
checkNameAndParam(pvSubAreaParam,false);
|
||||||
|
PvSubArea pvSubArea = new PvSubArea();
|
||||||
|
BeanUtils.copyProperties(pvSubAreaParam,pvSubArea);
|
||||||
|
pvSubArea.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
return this.save(pvSubArea);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean updateSubArea(PvSubAreaParam.UpdatePvSubAreaParam updatePvSubAreaParam) {
|
||||||
|
checkNameAndParam(updatePvSubAreaParam,true);
|
||||||
|
PvSubArea pvSubArea = new PvSubArea();
|
||||||
|
BeanUtils.copyProperties(updatePvSubAreaParam,pvSubArea);
|
||||||
|
pvSubArea.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
return this.updateById(pvSubArea);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<PvSubArea> getPvSubAreaList(SubAreaQueryParam subsAreaQueryParam) {
|
||||||
|
Page<PvSubArea> page = new Page<>(PageFactory.getPageNum(subsAreaQueryParam),PageFactory.getPageSize(subsAreaQueryParam));
|
||||||
|
return this.baseMapper.getPvSubAreaList(page,subsAreaQueryParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PvSubArea> getAllPvSubAreaList() {
|
||||||
|
return this.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PvSubArea getPvSubAreaById(String id) {
|
||||||
|
return this.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean delPvSubArea(String id) {
|
||||||
|
return this.removeById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验单位名称是否重复
|
||||||
|
*/
|
||||||
|
private void checkNameAndParam(PvSubAreaParam pvSubAreaParam, boolean isUpdate) {
|
||||||
|
|
||||||
|
if(Objects.isNull(iPvTenVoltageService.getPvTenVoltageById(pvSubAreaParam.getTenVoltageId()))){
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.TEN_VOLTAGE_NULL);
|
||||||
|
}
|
||||||
|
if(Objects.isNull(iPvUnitService.getPvUnitById(pvSubAreaParam.getUnitId()))){
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.UNIT_NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
LambdaQueryWrapper<PvSubArea> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(PvSubArea::getName, pvSubAreaParam.getName());
|
||||||
|
if (isUpdate) {
|
||||||
|
//更新操作
|
||||||
|
if (pvSubAreaParam instanceof PvSubAreaParam.UpdatePvSubAreaParam) {
|
||||||
|
lambdaQueryWrapper.eq(PvSubArea::getId, ((PvSubAreaParam.UpdatePvSubAreaParam) pvSubAreaParam).getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int count = this.count(lambdaQueryWrapper);
|
||||||
|
if (count > 0) {
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.SUB_AREA_REPEAT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
package com.njcn.pvdevice.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.db.constant.DbConstant;
|
||||||
|
import com.njcn.device.enums.DeviceResponseEnum;
|
||||||
|
import com.njcn.device.enums.PvDeviceResponseEnum;
|
||||||
|
import com.njcn.device.pojo.param.pv.PvSubstationParam;
|
||||||
|
import com.njcn.device.pojo.param.pv.SubstationQueryParam;
|
||||||
|
import com.njcn.device.pojo.po.Node;
|
||||||
|
import com.njcn.device.pojo.po.pv.PvSubstation;
|
||||||
|
import com.njcn.device.pojo.po.pv.PvSubstation;
|
||||||
|
import com.njcn.pvdevice.mapper.PvSubstationMapper;
|
||||||
|
import com.njcn.pvdevice.service.IPvSubstationService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.pvdevice.service.IPvUnitService;
|
||||||
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
|
import com.njcn.system.enums.DicDataTypeEnum;
|
||||||
|
import com.njcn.system.enums.SystemResponseEnum;
|
||||||
|
import com.njcn.system.pojo.po.DictData;
|
||||||
|
import com.njcn.web.factory.PageFactory;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 变电站管理实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PvSubstationServiceImpl extends ServiceImpl<PvSubstationMapper, PvSubstation> implements IPvSubstationService {
|
||||||
|
|
||||||
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
|
||||||
|
private final IPvUnitService iPvUnitService;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean addSubstation(PvSubstationParam pvSubstationParam) {
|
||||||
|
checkNameAndParam(pvSubstationParam,false);
|
||||||
|
PvSubstation pvSubstation = new PvSubstation();
|
||||||
|
BeanUtils.copyProperties(pvSubstationParam,pvSubstation);
|
||||||
|
return this.save(pvSubstation);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean updateSubstation(PvSubstationParam.UpdatePvSubstationParam updatePvSubstationParam) {
|
||||||
|
checkNameAndParam(updatePvSubstationParam,true);
|
||||||
|
PvSubstation pvSubstation = new PvSubstation();
|
||||||
|
BeanUtils.copyProperties(updatePvSubstationParam,pvSubstation);
|
||||||
|
return this.updateById(pvSubstation);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<PvSubstation> getPvSubstationList(SubstationQueryParam substationQueryParam) {
|
||||||
|
Page<PvSubstation> page = new Page<>(PageFactory.getPageNum(substationQueryParam),PageFactory.getPageSize(substationQueryParam));
|
||||||
|
return this.baseMapper.getPvSubstationList(page,substationQueryParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PvSubstation> getAllPvSubstationList() {
|
||||||
|
return this.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PvSubstation getPvSubstationById(String id) {
|
||||||
|
return this.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean delPvSubstation(String id) {
|
||||||
|
return this.removeById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验单位名称是否重复
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
private void checkNameAndParam(PvSubstationParam pvSubstationParam, boolean isUpdate) {
|
||||||
|
LambdaQueryWrapper<PvSubstation> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(PvSubstation::getName, pvSubstationParam.getName());
|
||||||
|
|
||||||
|
if (isUpdate) {
|
||||||
|
//更新操作
|
||||||
|
if (pvSubstationParam instanceof PvSubstationParam.UpdatePvSubstationParam) {
|
||||||
|
lambdaQueryWrapper.eq(PvSubstation::getId, ((PvSubstationParam.UpdatePvSubstationParam) pvSubstationParam).getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int count = this.count(lambdaQueryWrapper);
|
||||||
|
if (count > 0) {
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.SUBSTATION_REPEAT);
|
||||||
|
}
|
||||||
|
|
||||||
|
DictData dictData = dicDataFeignClient.getDicDataById(pvSubstationParam.getScale()).getData();
|
||||||
|
if(Objects.isNull(dictData)){
|
||||||
|
throw new BusinessException(SystemResponseEnum.VOLTAGE_EMPTY);
|
||||||
|
}
|
||||||
|
if(Objects.isNull(iPvUnitService.getPvUnitById(pvSubstationParam.getUnitId()))){
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.UNIT_NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
package com.njcn.pvdevice.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
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.exception.BusinessException;
|
||||||
|
import com.njcn.device.enums.PvDeviceResponseEnum;
|
||||||
|
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.pvdevice.mapper.PvTenVoltageMapper;
|
||||||
|
import com.njcn.pvdevice.service.IPvTenVoltageService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
|
import com.njcn.system.enums.SystemResponseEnum;
|
||||||
|
import com.njcn.system.pojo.po.DictData;
|
||||||
|
import com.njcn.web.factory.PageFactory;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PvTenVoltageServiceImpl extends ServiceImpl<PvTenVoltageMapper, PvTenVoltage> implements IPvTenVoltageService {
|
||||||
|
|
||||||
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean addTenVoltage(PvTenVoltageParam pvTenVoltageParam) {
|
||||||
|
checkNameAndParam(pvTenVoltageParam,false);
|
||||||
|
PvTenVoltage pvTenVoltage = new PvTenVoltage();
|
||||||
|
BeanUtils.copyProperties(pvTenVoltageParam,pvTenVoltage);
|
||||||
|
pvTenVoltage.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
return this.save(pvTenVoltage);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean updateTenVoltage(PvTenVoltageParam.UpdatePvTenVoltageParam updatePvTenVoltageParam) {
|
||||||
|
checkNameAndParam(updatePvTenVoltageParam,true);
|
||||||
|
PvTenVoltage pvTenVoltage = new PvTenVoltage();
|
||||||
|
BeanUtils.copyProperties(updatePvTenVoltageParam,pvTenVoltage);
|
||||||
|
pvTenVoltage.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
return this.updateById(pvTenVoltage);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<PvTenVoltage> getPvTenVoltageList(TenVoltageQueryParam tenVoltageQueryParam) {
|
||||||
|
Page<PvTenVoltage> page = new Page<>(PageFactory.getPageNum(tenVoltageQueryParam),PageFactory.getPageSize(tenVoltageQueryParam));
|
||||||
|
return this.baseMapper.getPvTenVoltageList(page,tenVoltageQueryParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PvTenVoltage getPvTenVoltageById(String id) {
|
||||||
|
return this.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean delPvTenVoltage(String id) {
|
||||||
|
return this.removeById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验单位名称是否重复
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
private void checkNameAndParam(PvTenVoltageParam pvTenVoltageParam, boolean isUpdate) {
|
||||||
|
|
||||||
|
if(StrUtil.isNotBlank(pvTenVoltageParam.getScale())) {
|
||||||
|
DictData dictData = dicDataFeignClient.getDicDataById(pvTenVoltageParam.getScale()).getData();
|
||||||
|
if (Objects.isNull(dictData)) {
|
||||||
|
throw new BusinessException(SystemResponseEnum.VOLTAGE_EMPTY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(StrUtil.isNotBlank(pvTenVoltageParam.getDesignScale())) {
|
||||||
|
DictData dictDesignScale = dicDataFeignClient.getDicDataById(pvTenVoltageParam.getDesignScale()).getData();
|
||||||
|
if (Objects.isNull(dictDesignScale)) {
|
||||||
|
throw new BusinessException(SystemResponseEnum.VOLTAGE_EMPTY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
LambdaQueryWrapper<PvTenVoltage> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(PvTenVoltage::getName, pvTenVoltageParam.getName());
|
||||||
|
|
||||||
|
if (isUpdate) {
|
||||||
|
//更新操作
|
||||||
|
if (pvTenVoltageParam instanceof PvTenVoltageParam.UpdatePvTenVoltageParam) {
|
||||||
|
lambdaQueryWrapper.eq(PvTenVoltage::getId, ((PvTenVoltageParam.UpdatePvTenVoltageParam) pvTenVoltageParam).getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int count = this.count(lambdaQueryWrapper);
|
||||||
|
if (count > 0) {
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.TEN_VOLTAGE_REPEAT);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
package com.njcn.pvdevice.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.device.enums.PvDeviceResponseEnum;
|
||||||
|
import com.njcn.device.pojo.param.pv.PvUnitParam;
|
||||||
|
import com.njcn.device.pojo.po.pv.PvUnit;
|
||||||
|
import com.njcn.device.pojo.vo.pv.UnitTreeVO;
|
||||||
|
import com.njcn.pvdevice.mapper.PvUnitMapper;
|
||||||
|
import com.njcn.pvdevice.service.IPvUnitService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class PvUnitServiceImpl extends ServiceImpl<PvUnitMapper, PvUnit> implements IPvUnitService {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean addUnit(PvUnitParam pvUnitParam) {
|
||||||
|
checkName(pvUnitParam, false);
|
||||||
|
PvUnit pvUnit = new PvUnit();
|
||||||
|
BeanUtils.copyProperties(pvUnitParam, pvUnit);
|
||||||
|
return this.save(pvUnit);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean updateUnit(PvUnitParam.UpdatePvUnitParam updatePvUnitParam) {
|
||||||
|
checkName(updatePvUnitParam, true);
|
||||||
|
PvUnit pvUnit = new PvUnit();
|
||||||
|
BeanUtils.copyProperties(updatePvUnitParam, pvUnit);
|
||||||
|
return this.updateById(pvUnit);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UnitTreeVO> getPvUnitList(BaseParam baseParam) {
|
||||||
|
List<UnitTreeVO> list = this.baseMapper.getPvUnitList(baseParam.getOrderBy(), baseParam.getSortBy());
|
||||||
|
List<UnitTreeVO> parentList = list.stream().filter(item -> item.getPid().equals("0")).collect(Collectors.toList());
|
||||||
|
parentList.forEach(item -> item.setChildren(getChildren(item,list)));
|
||||||
|
return parentList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归查询子节点
|
||||||
|
* @param root 根节点
|
||||||
|
* @param all 所有节点
|
||||||
|
* @return 根节点信息
|
||||||
|
*/
|
||||||
|
private List<UnitTreeVO> getChildren(UnitTreeVO root, List<UnitTreeVO> all) {
|
||||||
|
return all.stream().filter(m -> Objects.equals(m.getPid(), root.getId()))
|
||||||
|
.peek(m -> m.setChildren(getChildren(m, all))).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PvUnit getPvUnitById(String id) {
|
||||||
|
return this.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean delPvUnit(String id) {
|
||||||
|
return this.removeById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验单位名称是否重复
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
private void checkName(PvUnitParam pvUnitParam, boolean isUpdate) {
|
||||||
|
LambdaQueryWrapper<PvUnit> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(PvUnit::getName, pvUnitParam.getName());
|
||||||
|
|
||||||
|
if (isUpdate) {
|
||||||
|
//更新操作
|
||||||
|
if (pvUnitParam instanceof PvUnitParam.UpdatePvUnitParam) {
|
||||||
|
lambdaQueryWrapper.eq(PvUnit::getId, ((PvUnitParam.UpdatePvUnitParam) pvUnitParam).getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int count = this.count(lambdaQueryWrapper);
|
||||||
|
if (count > 0) {
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.UNIT_REPEAT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
package com.njcn.pvdevice.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.device.enums.PvDeviceResponseEnum;
|
||||||
|
import com.njcn.device.pojo.param.pv.PvVoltageParam;
|
||||||
|
import com.njcn.device.pojo.param.pv.VoltageQueryParam;
|
||||||
|
import com.njcn.device.pojo.po.pv.PvTenVoltage;
|
||||||
|
import com.njcn.device.pojo.po.pv.PvVoltage;
|
||||||
|
import com.njcn.device.pojo.po.pv.PvVoltage;
|
||||||
|
import com.njcn.pvdevice.mapper.PvVoltageMapper;
|
||||||
|
import com.njcn.pvdevice.service.IPvVoltageService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
|
import com.njcn.system.enums.SystemResponseEnum;
|
||||||
|
import com.njcn.system.pojo.po.DictData;
|
||||||
|
import com.njcn.web.factory.PageFactory;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 母线实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-07-05
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PvVoltageServiceImpl extends ServiceImpl<PvVoltageMapper, PvVoltage> implements IPvVoltageService {
|
||||||
|
|
||||||
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean addVoltage(PvVoltageParam pvVoltageParam) {
|
||||||
|
DictData dictData = dicDataFeignClient.getDicDataById(pvVoltageParam.getScale()).getData();
|
||||||
|
if(Objects.isNull(dictData)){
|
||||||
|
throw new BusinessException(SystemResponseEnum.VOLTAGE_EMPTY);
|
||||||
|
}
|
||||||
|
checkName(pvVoltageParam,false);
|
||||||
|
PvVoltage pvVoltage = new PvVoltage();
|
||||||
|
BeanUtils.copyProperties(pvVoltageParam,pvVoltage);
|
||||||
|
return this.save(pvVoltage);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean updateVoltage(PvVoltageParam.UpdatePvVoltageParam updatePvVoltageParam) {
|
||||||
|
DictData dictData = dicDataFeignClient.getDicDataById(updatePvVoltageParam.getScale()).getData();
|
||||||
|
if(Objects.isNull(dictData)){
|
||||||
|
throw new BusinessException(SystemResponseEnum.VOLTAGE_EMPTY);
|
||||||
|
}
|
||||||
|
checkName(updatePvVoltageParam,true);
|
||||||
|
PvVoltage pvVoltage = new PvVoltage();
|
||||||
|
BeanUtils.copyProperties(updatePvVoltageParam,pvVoltage);
|
||||||
|
return this.updateById(pvVoltage);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<PvVoltage> getPvVoltageList(VoltageQueryParam voltageQueryParam) {
|
||||||
|
Page<PvVoltage> page = new Page<>(PageFactory.getPageNum(voltageQueryParam),PageFactory.getPageSize(voltageQueryParam));
|
||||||
|
LambdaQueryWrapper<PvVoltage> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(PvVoltage::getName,voltageQueryParam.getSearchValue())
|
||||||
|
.eq(PvVoltage::getScale,voltageQueryParam.getScale());
|
||||||
|
return this.page(page,lambdaQueryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PvVoltage> getAllPvVoltageList() {
|
||||||
|
return this.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PvVoltage getPvVoltageById(String id) {
|
||||||
|
return this.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean delPvVoltage(String id) {
|
||||||
|
return this.removeById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验单位名称是否重复
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/7/5
|
||||||
|
*/
|
||||||
|
private void checkName(PvVoltageParam pvVoltageParam, boolean isUpdate) {
|
||||||
|
LambdaQueryWrapper<PvVoltage> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(PvVoltage::getName, pvVoltageParam.getName());
|
||||||
|
if (isUpdate) {
|
||||||
|
//更新操作
|
||||||
|
if (pvVoltageParam instanceof PvVoltageParam.UpdatePvVoltageParam) {
|
||||||
|
lambdaQueryWrapper.eq(PvVoltage::getId, ((PvVoltageParam.UpdatePvVoltageParam) pvVoltageParam).getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int count = this.count(lambdaQueryWrapper);
|
||||||
|
if (count > 0) {
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.VOLTAGE_REPEAT);
|
||||||
|
}
|
||||||
|
|
||||||
|
//校验序号
|
||||||
|
lambdaQueryWrapper.clear();
|
||||||
|
lambdaQueryWrapper.eq(PvVoltage::getNum, pvVoltageParam.getNum());
|
||||||
|
if (isUpdate) {
|
||||||
|
//更新操作
|
||||||
|
if (pvVoltageParam instanceof PvVoltageParam.UpdatePvVoltageParam) {
|
||||||
|
lambdaQueryWrapper.eq(PvVoltage::getId, ((PvVoltageParam.UpdatePvVoltageParam) pvVoltageParam).getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int countNum = this.count(lambdaQueryWrapper);
|
||||||
|
if (countNum > 0) {
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.SUB_NUM_REPEAT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,7 +15,7 @@ public enum DicDataTypeEnum {
|
|||||||
* 字典类型名称
|
* 字典类型名称
|
||||||
*/
|
*/
|
||||||
FRONT_TYPE("前置类型"),
|
FRONT_TYPE("前置类型"),
|
||||||
DEV_TYPE("终端类型"),
|
DEV_TYPE("终端型号"),
|
||||||
DEV_FUN("终端功能"),
|
DEV_FUN("终端功能"),
|
||||||
DEV_STATUS("终端状态"),
|
DEV_STATUS("终端状态"),
|
||||||
DEV_LEVEL("终端等级"),
|
DEV_LEVEL("终端等级"),
|
||||||
|
|||||||
@@ -19,7 +19,15 @@ public enum SystemResponseEnum {
|
|||||||
DICT_DATA_NAME_REPEAT("A00352", "字典数据名称重复"),
|
DICT_DATA_NAME_REPEAT("A00352", "字典数据名称重复"),
|
||||||
AREA_CODE_REPEAT("A00353","行政区域编码重复"),
|
AREA_CODE_REPEAT("A00353","行政区域编码重复"),
|
||||||
LOAD_TYPE_EMPTY("A00354","用能负荷数据为空"),
|
LOAD_TYPE_EMPTY("A00354","用能负荷数据为空"),
|
||||||
LINE_MARK_EMPTY("A00355","字典监测点评分等级数据为空")
|
LINE_MARK_EMPTY("A00355","字典监测点评分等级数据为空"),
|
||||||
|
VOLTAGE_EMPTY("A00356","查询字典电压等级数据为空"),
|
||||||
|
|
||||||
|
INTERFERENCE_EMPTY("A00356","查询字典干扰源类型数据为空"),
|
||||||
|
BUSINESS_EMPTY("A00356","查询字典行业类型数据为空"),
|
||||||
|
DEV_TYPE_EMPTY("A00357","查询字典设备类型数据为空"),
|
||||||
|
MANUFACTURER("A00358","查询字典终端厂家数据为空"),
|
||||||
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|||||||
Reference in New Issue
Block a user