1.变压器策略代码提交
2.数据中心bug修改
This commit is contained in:
@@ -27,6 +27,9 @@ public enum PvDeviceResponseEnum {
|
|||||||
VOLTAGE_PARAM_EMPTY_MUST("A0359","所属母线必须为空"),
|
VOLTAGE_PARAM_EMPTY_MUST("A0359","所属母线必须为空"),
|
||||||
LV_USER_REPEAT("A0360","低压用户名称重复"),
|
LV_USER_REPEAT("A0360","低压用户名称重复"),
|
||||||
SUBSTATION_CODE_REPEAT("A0351","变电站编号重复"),
|
SUBSTATION_CODE_REPEAT("A0351","变电站编号重复"),
|
||||||
|
TRANSFORMER_NAME_REPEAT("A0401","变压器名称重复"),
|
||||||
|
TFLGPLOY_NAME_REPEAT("A0402","变压器策略名称重复"),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TEN_VOLTAGE_NULL("A0360","未查询到指定10kV线路"),
|
TEN_VOLTAGE_NULL("A0360","未查询到指定10kV线路"),
|
||||||
|
|||||||
@@ -0,0 +1,88 @@
|
|||||||
|
package com.njcn.device.pq.pojo.param;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wr
|
||||||
|
* @description
|
||||||
|
* @date 2023/7/19 11:29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PqsTransformerParam implements Serializable {
|
||||||
|
|
||||||
|
@ApiModelProperty(name ="tfIndex",value = "变压器台账编号",required = true)
|
||||||
|
@NotBlank(message = "变压器台账编号不能为空")
|
||||||
|
private String tfIndex;
|
||||||
|
|
||||||
|
@ApiModelProperty(name ="upNode",value = "上节点",required = true)
|
||||||
|
private String upNode;
|
||||||
|
|
||||||
|
@ApiModelProperty(name ="downNode",value = "下节点",required = true)
|
||||||
|
private String downNode;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class TransformerAddParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变压器名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "变压器名称")
|
||||||
|
@NotBlank(message = "变压器名称不能为空")
|
||||||
|
private String tfName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属变电站主键
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "所属变电站主键")
|
||||||
|
@NotBlank(message = "所属变电站信息为空")
|
||||||
|
private String subIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接线方式(跟数据字典绑定,星星,星三角)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "接线方式(跟数据字典绑定,星星,星三角)")
|
||||||
|
@NotBlank(message = "接线方式不能为空")
|
||||||
|
private String wiring;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "描述")
|
||||||
|
private String tfDescribe;
|
||||||
|
|
||||||
|
}
|
||||||
|
@Data
|
||||||
|
public static class TransformerUpdateParam {
|
||||||
|
/**
|
||||||
|
* 变压器主键
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "变压器主键")
|
||||||
|
@NotBlank(message = "变压器编号不能为空")
|
||||||
|
private String tfIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变压器名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "变压器名称")
|
||||||
|
@NotBlank(message = "变压器名称不能为空")
|
||||||
|
private String tfName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接线方式(跟数据字典绑定,星星,星三角)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "接线方式(跟数据字典绑定,星星,星三角)")
|
||||||
|
@NotBlank(message = "接线方式不能为空")
|
||||||
|
private String wiring;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "描述")
|
||||||
|
private String tfDescribe;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.njcn.device.pq.pojo.param;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wr
|
||||||
|
* @description
|
||||||
|
* @date 2023/7/19 15:59
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TflgployParam implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变压器策略名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "变压器策略名称")
|
||||||
|
@NotBlank(message = "变压器策略名称不能为空")
|
||||||
|
private String tpName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变压器策略描述
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "变压器策略描述")
|
||||||
|
private String tfDescribe;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "变压器台账id集合")
|
||||||
|
private List<String> tfIndexs;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class TflgployUpdateParam extends TflgployParam{
|
||||||
|
/**
|
||||||
|
* 变压器策略Guid
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "变压器策略Guid")
|
||||||
|
@NotBlank(message = "变压器策略编号不能为空")
|
||||||
|
private String tpIndex;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package com.njcn.device.pq.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 变压器逻辑节点关系表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-07-19
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("pqs_tflgass")
|
||||||
|
public class PqsTflgass extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "变压器跟逻辑节点关系Guid")
|
||||||
|
@TableId(value = "Ass_Index")
|
||||||
|
private String assIndex;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "变压器台账Guid")
|
||||||
|
private String tfIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上级逻辑节点
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "上级逻辑节点")
|
||||||
|
private String logicBefore;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下级逻辑节点
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "下级逻辑节点")
|
||||||
|
private String logicNext;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package com.njcn.device.pq.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.omg.PortableInterceptor.INACTIVE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* PQS_TfLgPloy变压器策略表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-07-19
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("pqs_tflgploy")
|
||||||
|
public class PqsTflgploy extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变压器策略Guid
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "变压器策略Guid")
|
||||||
|
@TableId(value = "tp_Index")
|
||||||
|
private String tpIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变压器策略名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "变压器策略名称")
|
||||||
|
private String tpName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变压器策略描述
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "变压器策略描述")
|
||||||
|
private String tfDescribe;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0删除 1.正常
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "0删除 1.正常")
|
||||||
|
@TableLogic(value="1",delval="0")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.njcn.device.pq.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* PQS_TfLgPloyAss策略、变压器关系表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-07-19
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("pqs_tflgployass")
|
||||||
|
public class PqsTflgployass extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 策略Guid(外键PQS_TfLgPloy中TP_Index)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "策略Guid(外键PQS_TfLgPloy中TP_Index)")
|
||||||
|
private String tpIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报告基础项Guid(外键PQS_Transformer中Tf_Index)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "报告基础项Guid(外键PQS_Transformer中Tf_Index)")
|
||||||
|
private String tfIndex;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
package com.njcn.device.pq.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 变压器台账表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-07-19
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("pqs_transformer")
|
||||||
|
public class PqsTransformer extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变压器主键
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "变压器主键")
|
||||||
|
@TableId(value = "Tf_Index")
|
||||||
|
private String tfIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变压器名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "变压器名称")
|
||||||
|
private String tfName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属变电站主键
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "所属变电站主键")
|
||||||
|
private String subIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接线方式(跟数据字典绑定,星星,星三角)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "接线方式(跟数据字典绑定,星星,星三角)")
|
||||||
|
private String wiring;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "描述")
|
||||||
|
private String tfDescribe;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "排序")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0删除 1.正常
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "0删除 1.正常")
|
||||||
|
@TableLogic(value="1",delval="0")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -18,6 +18,9 @@ public class LineDeviceStateVO implements Serializable {
|
|||||||
@ApiModelProperty(name = "name",value = "监测点名称")
|
@ApiModelProperty(name = "name",value = "监测点名称")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "subName",value = "变电站名称")
|
||||||
|
private String subName;
|
||||||
|
|
||||||
@ApiModelProperty(name = "pids",value = "节点")
|
@ApiModelProperty(name = "pids",value = "节点")
|
||||||
private String pids;
|
private String pids;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.njcn.device.pq.pojo.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wr
|
||||||
|
* @description
|
||||||
|
* @date 2023/7/20 13:55
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PqsTflgassVO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "变压器台账Guid")
|
||||||
|
private String tfIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上级逻辑节点
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "上级逻辑节点")
|
||||||
|
private String logicBefore;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "上级逻辑节点名称")
|
||||||
|
private String logicBeforeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下级逻辑节点
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "下级逻辑节点")
|
||||||
|
private String logicNext;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "下级逻辑节店名称")
|
||||||
|
private String logicNextName;
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package com.njcn.device.pq.pojo.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wr
|
||||||
|
* @description
|
||||||
|
* @date 2023/8/2 10:06
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PqsTransformerVO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变压器主键
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "变压器主键")
|
||||||
|
private String tfIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变压器名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "变压器名称")
|
||||||
|
private String tfName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属变电站主键
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "所属变电站主键")
|
||||||
|
private String subIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属变电站主键
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "所属变电站主键")
|
||||||
|
private String subIndexName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接线方式(跟数据字典绑定,星星,星三角)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "接线方式(跟数据字典绑定,星星,星三角)")
|
||||||
|
private String wiring;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "描述")
|
||||||
|
private String tfDescribe;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新用户
|
||||||
|
*/
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
}
|
||||||
@@ -17,6 +17,11 @@ public class SubstationDetailVO implements Serializable {
|
|||||||
|
|
||||||
private String srbName;
|
private String srbName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变电站名称
|
||||||
|
*/
|
||||||
|
private String subName;
|
||||||
|
|
||||||
private Double coordY;
|
private Double coordY;
|
||||||
|
|
||||||
private Double coordX;
|
private Double coordX;
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.njcn.device.pq.pojo.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wr
|
||||||
|
* @description
|
||||||
|
* @date 2023/7/19 14:47
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel
|
||||||
|
public class TransformerVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "id",value = "id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "name",value = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "sort",value = "排序")
|
||||||
|
private String sort;
|
||||||
|
}
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
package com.njcn.device.pq.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.pq.pojo.param.TflgployParam;
|
||||||
|
import com.njcn.device.pq.pojo.po.PqsTflgploy;
|
||||||
|
import com.njcn.device.pq.service.IPqsTflgployService;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
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 wr
|
||||||
|
* @since 2023-07-19
|
||||||
|
*/
|
||||||
|
@Api(tags = "变压器策略")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pqsTflgploy")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PqsTflgployController extends BaseController {
|
||||||
|
|
||||||
|
private final IPqsTflgployService iPqsTflgployService;
|
||||||
|
|
||||||
|
@PostMapping("/flgployPage")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("分页查询变压器策略")
|
||||||
|
public HttpResult<Page<PqsTflgploy>> flgployPage(@RequestBody BaseParam param) {
|
||||||
|
String methodDescribe = getMethodDescribe("flgployPage");
|
||||||
|
Page<PqsTflgploy> page = iPqsTflgployService.flgployPage(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/insertFlgPloy")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
|
@ApiOperation("新增变压器策略")
|
||||||
|
public HttpResult<Boolean> insertFlgPloy(@RequestBody @Validated TflgployParam param) {
|
||||||
|
String methodDescribe = getMethodDescribe("insertFlgPloy");
|
||||||
|
Boolean flag = iPqsTflgployService.insertFlgPloy(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getFlgPloyInfo")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPDATE)
|
||||||
|
@ApiOperation("变压器策略详情")
|
||||||
|
public HttpResult<TflgployParam.TflgployUpdateParam> getFlgPloyInfo( String id) {
|
||||||
|
String methodDescribe = getMethodDescribe("getFlgPloyInfo");
|
||||||
|
TflgployParam.TflgployUpdateParam flag = iPqsTflgployService.flgPloyInfo(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/updateFlgPloy")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPDATE)
|
||||||
|
@ApiOperation("修改变压器策略")
|
||||||
|
public HttpResult<Boolean> updateFlgPloy(@RequestBody @Validated TflgployParam.TflgployUpdateParam param) {
|
||||||
|
String methodDescribe = getMethodDescribe("updateFlgPloy");
|
||||||
|
Boolean flag = iPqsTflgployService.updateFlgPloy(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/delFlgPloy")
|
||||||
|
@ApiOperation(value = "删除变压器策略")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.DELETE)
|
||||||
|
public HttpResult<Boolean> delFlgPloy(String ids) {
|
||||||
|
String methodDescribe = getMethodDescribe("delFlgPloy");
|
||||||
|
Boolean flag = iPqsTflgployService.delFlgPloy(ids);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
package com.njcn.device.pq.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.pq.pojo.param.PqsTransformerParam;
|
||||||
|
import com.njcn.device.pq.pojo.vo.PqsTflgassVO;
|
||||||
|
import com.njcn.device.pq.pojo.vo.PqsTransformerVO;
|
||||||
|
import com.njcn.device.pq.pojo.vo.TerminalTree;
|
||||||
|
import com.njcn.device.pq.pojo.vo.TransformerVO;
|
||||||
|
import com.njcn.device.pq.service.IPqsTransformerService;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
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.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 变压器查询
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-07-19
|
||||||
|
*/
|
||||||
|
@Api(tags = "变压器详细")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pqsTransformer")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PqsTransformerController extends BaseController {
|
||||||
|
|
||||||
|
private final IPqsTransformerService iPqsTransformerService;
|
||||||
|
|
||||||
|
@PostMapping("/transformerPage")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("变压器台账分页查询")
|
||||||
|
public HttpResult<Page<PqsTransformerVO>> transformerPage(@RequestBody BaseParam param) {
|
||||||
|
String methodDescribe = getMethodDescribe("transformerPage");
|
||||||
|
Page<PqsTransformerVO> page = iPqsTransformerService.transformerPage(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/insertTransformer")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||||
|
@ApiOperation("变压器台账新增")
|
||||||
|
public HttpResult<Boolean> insertTransformer(@RequestBody @Validated PqsTransformerParam.TransformerAddParam param) {
|
||||||
|
String methodDescribe = getMethodDescribe("insertTransformer");
|
||||||
|
Boolean flag = iPqsTransformerService.insertTransformer(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/updateTransformer")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPDATE)
|
||||||
|
@ApiOperation("变压器台账修改")
|
||||||
|
public HttpResult<Boolean> updateTransformer(@RequestBody @Validated PqsTransformerParam.TransformerUpdateParam param) {
|
||||||
|
String methodDescribe = getMethodDescribe("updateTransformer");
|
||||||
|
Boolean flag = iPqsTransformerService.updateTransformer(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/delTransformer")
|
||||||
|
@ApiOperation(value = "变压器台账删除")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.DELETE)
|
||||||
|
public HttpResult<Boolean> delTransformer(@RequestBody List<String> ids) {
|
||||||
|
String methodDescribe = getMethodDescribe("delTransformer");
|
||||||
|
Boolean flag = iPqsTransformerService.delTransformer(ids);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/selectFlgAss")
|
||||||
|
@ApiOperation(value = "查询变电站节点信息")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
public HttpResult<PqsTflgassVO> selectFlgAss(@RequestBody String id) {
|
||||||
|
String methodDescribe = getMethodDescribe("selectFlgAss");
|
||||||
|
PqsTflgassVO pqsTflgassVO = iPqsTransformerService.selectFlgAss(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pqsTflgassVO, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/nodeMaintenance")
|
||||||
|
@ApiOperation(value = "变电站节点维护")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
public HttpResult<Boolean> nodeMaintenance(@RequestBody PqsTransformerParam param) {
|
||||||
|
String methodDescribe = getMethodDescribe("nodeMaintenance");
|
||||||
|
Boolean flag = iPqsTransformerService.nodeMaintenance(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getGeneratrix")
|
||||||
|
@ApiOperation(value = "获取上下节点信息")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
public HttpResult<Map<String, List<TerminalTree>>> getGeneratrix(String id) {
|
||||||
|
String methodDescribe = getMethodDescribe("getGeneratrix");
|
||||||
|
Map<String, List<TerminalTree>> generatrix = iPqsTransformerService.getGeneratrix(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, generatrix, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getTransformerTree")
|
||||||
|
@ApiOperation(value = "获取变压器台账")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
public HttpResult<List<TerminalTree>> getTerminalTree() {
|
||||||
|
String methodDescribe = getMethodDescribe("getTransformerTree");
|
||||||
|
List<TerminalTree> terminalTree = iPqsTransformerService.getTransformerTree();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, terminalTree, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -443,4 +443,13 @@ public interface LineMapper extends BaseMapper<Line> {
|
|||||||
* @date 2023/5/10
|
* @date 2023/5/10
|
||||||
*/
|
*/
|
||||||
List<Line> getSubStations(@Param("subId")List<String> subId, @Param("scale") List<String> scale);
|
List<Line> getSubStations(@Param("subId")List<String> subId, @Param("scale") List<String> scale);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取变电站下母线(变电站策略专用)
|
||||||
|
* @param subId
|
||||||
|
* @param type (0是跨 1是本)
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<TerminalTree> getvoltage(@Param("subId") String subId,@Param("type") Integer type);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.njcn.device.pq.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.device.pq.pojo.po.PqsTflgass;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-07-19
|
||||||
|
*/
|
||||||
|
public interface PqsTflgassMapper extends BaseMapper<PqsTflgass> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取变电站下的节点信息
|
||||||
|
* @param id
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<PqsTflgass> selectFlgass(@Param("id") String id,@Param("ids") List<String> ids);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.device.pq.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.device.pq.pojo.po.PqsTflgploy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-07-19
|
||||||
|
*/
|
||||||
|
public interface PqsTflgployMapper extends BaseMapper<PqsTflgploy> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.device.pq.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.device.pq.pojo.po.PqsTflgployass;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-07-19
|
||||||
|
*/
|
||||||
|
public interface PqsTflgployassMapper extends BaseMapper<PqsTflgployass> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.njcn.device.pq.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.device.pq.pojo.po.PqsTransformer;
|
||||||
|
import com.njcn.device.pq.pojo.vo.TerminalTree;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-07-19
|
||||||
|
*/
|
||||||
|
public interface PqsTransformerMapper extends BaseMapper<PqsTransformer> {
|
||||||
|
|
||||||
|
|
||||||
|
List<TerminalTree> listTransformer();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取变压器台账的最新排序sort
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer sortTransformer();
|
||||||
|
}
|
||||||
@@ -555,17 +555,22 @@
|
|||||||
|
|
||||||
<select id="getLineDeviceStateVO" resultType="com.njcn.device.pq.pojo.vo.LineDeviceStateVO">
|
<select id="getLineDeviceStateVO" resultType="com.njcn.device.pq.pojo.vo.LineDeviceStateVO">
|
||||||
SELECT
|
SELECT
|
||||||
t.id id,
|
t.id id,
|
||||||
t.pids pids,
|
t.pids pids,
|
||||||
t.NAME name,
|
t.NAME name,
|
||||||
device.Com_Flag state
|
sub.Name subName,
|
||||||
|
device.Com_Flag state
|
||||||
FROM
|
FROM
|
||||||
pq_line t,
|
pq_line t,
|
||||||
pq_line subv,
|
pq_line subv,
|
||||||
pq_device device
|
pq_line device1,
|
||||||
|
pq_device device,
|
||||||
|
pq_line sub
|
||||||
WHERE
|
WHERE
|
||||||
subv.id = t.pid
|
subv.id = t.pid
|
||||||
AND device.id = subv.pid
|
AND device.id = subv.pid
|
||||||
|
AND device1.id = device.id
|
||||||
|
AND sub.id = device1.pid
|
||||||
AND t.id in
|
AND t.id in
|
||||||
<foreach item="item" collection="list" separator="," open="(" close=")">
|
<foreach item="item" collection="list" separator="," open="(" close=")">
|
||||||
#{item}
|
#{item}
|
||||||
@@ -1147,5 +1152,26 @@
|
|||||||
|
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getvoltage" resultType="com.njcn.device.pq.pojo.vo.TerminalTree">
|
||||||
|
SELECT
|
||||||
|
voltage.id as id,
|
||||||
|
sub.id as pid,
|
||||||
|
concat( sub.NAME, " ", voltage.NAME ) as name,
|
||||||
|
voltage.Sort as sort
|
||||||
|
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>
|
||||||
|
voltage.state = 1
|
||||||
|
<if test="subId != null and subId !='' and type == 1">
|
||||||
|
and sub.id = #{subId}
|
||||||
|
</if>
|
||||||
|
<if test="subId != null and subId !='' and type == 0">
|
||||||
|
and sub.id != #{subId}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<?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.device.pq.mapper.PqsTflgassMapper">
|
||||||
|
|
||||||
|
<select id="selectFlgass" resultType="com.njcn.device.pq.pojo.po.PqsTflgass">
|
||||||
|
select
|
||||||
|
*
|
||||||
|
from pqs_tflgass pt
|
||||||
|
INNER JOIN pqs_transformer pf on pf.Tf_Index=pt.Tf_Index
|
||||||
|
<where>
|
||||||
|
pf.Sub_Index = #{id}
|
||||||
|
and Logic_Before IN
|
||||||
|
<foreach item="item" collection="ids" separator="," open="(" close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
and Logic_Next IN
|
||||||
|
<foreach item="item" collection="ids" separator="," open="(" close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
|
||||||
|
</where>
|
||||||
|
|
||||||
|
</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.device.pq.mapper.PqsTflgployMapper">
|
||||||
|
|
||||||
|
</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.device.pq.mapper.PqsTflgployassMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<?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.device.pq.mapper.PqsTransformerMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="listTransformer" resultType="com.njcn.device.pq.pojo.vo.TerminalTree">
|
||||||
|
SELECT
|
||||||
|
Tf_Index as id,
|
||||||
|
Tf_Name as name,
|
||||||
|
Sub_Index as pid,
|
||||||
|
Sort as sort
|
||||||
|
FROM
|
||||||
|
pqs_transformer
|
||||||
|
WHERE
|
||||||
|
STATUS = 1
|
||||||
|
</select>
|
||||||
|
<select id="sortTransformer" resultType="java.lang.Integer">
|
||||||
|
select IFNULL(max(pqs_transformer.sort),0) from pqs_transformer order by update_time desc
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.device.pq.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.device.pq.pojo.po.PqsTflgass;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-07-19
|
||||||
|
*/
|
||||||
|
public interface IPqsTflgassService extends IService<PqsTflgass> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package com.njcn.device.pq.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.device.pq.pojo.param.TflgployParam;
|
||||||
|
import com.njcn.device.pq.pojo.po.PqsTflgploy;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-07-19
|
||||||
|
*/
|
||||||
|
public interface IPqsTflgployService extends IService<PqsTflgploy> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询变压器策略
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Page<PqsTflgploy> flgployPage(BaseParam param);
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 新增变压器策略
|
||||||
|
* @author wr
|
||||||
|
* @param param
|
||||||
|
* @return Boolean
|
||||||
|
*/
|
||||||
|
Boolean insertFlgPloy(TflgployParam param) ;
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 查询变压器详情变压器策略
|
||||||
|
* @author wr
|
||||||
|
* @param id 变压器策略编号
|
||||||
|
* @return Boolean
|
||||||
|
*/
|
||||||
|
TflgployParam.TflgployUpdateParam flgPloyInfo(String id);
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 修改变压器策略
|
||||||
|
* @author wr
|
||||||
|
* @param param
|
||||||
|
* @return Boolean
|
||||||
|
*/
|
||||||
|
Boolean updateFlgPloy(TflgployParam.TflgployUpdateParam param);
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 删除变压器策略
|
||||||
|
* @author wr
|
||||||
|
* @return Boolean
|
||||||
|
*/
|
||||||
|
Boolean delFlgPloy(String ids);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.device.pq.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.device.pq.pojo.po.PqsTflgployass;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-07-19
|
||||||
|
*/
|
||||||
|
public interface IPqsTflgployassService extends IService<PqsTflgployass> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
package com.njcn.device.pq.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.device.pq.pojo.param.PqsTransformerParam;
|
||||||
|
import com.njcn.device.pq.pojo.po.PqsTransformer;
|
||||||
|
import com.njcn.device.pq.pojo.vo.PqsTflgassVO;
|
||||||
|
import com.njcn.device.pq.pojo.vo.PqsTransformerVO;
|
||||||
|
import com.njcn.device.pq.pojo.vo.TerminalTree;
|
||||||
|
import com.njcn.device.pq.pojo.vo.TransformerVO;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-07-19
|
||||||
|
*/
|
||||||
|
public interface IPqsTransformerService extends IService<PqsTransformer> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变压器台账分页查询
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Page<PqsTransformerVO> transformerPage(BaseParam param);
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 变压器台账新增
|
||||||
|
* @author wr
|
||||||
|
* @param param
|
||||||
|
* @return Boolean
|
||||||
|
*/
|
||||||
|
Boolean insertTransformer(PqsTransformerParam.TransformerAddParam param) ;
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 变压器台账修改
|
||||||
|
* @author wr
|
||||||
|
* @param param
|
||||||
|
* @return Boolean
|
||||||
|
*/
|
||||||
|
Boolean updateTransformer(PqsTransformerParam.TransformerUpdateParam param);
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 变压器台账删除
|
||||||
|
* @author wr
|
||||||
|
* @param ids
|
||||||
|
* @return Boolean
|
||||||
|
*/
|
||||||
|
Boolean delTransformer(List<String> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询变电站节点信息
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PqsTflgassVO selectFlgAss(String ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变电站节点维护
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Boolean nodeMaintenance(PqsTransformerParam param);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取上下节点信息
|
||||||
|
* @param id
|
||||||
|
* @param type
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Map<String,List<TerminalTree>> getGeneratrix(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取母线设备树层级/变压器/市/
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2023/7/26
|
||||||
|
*/
|
||||||
|
List<TerminalTree> getTransformerTree();
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.njcn.device.pq.service.impl;
|
||||||
|
|
||||||
|
import com.njcn.device.pq.mapper.PqsTflgassMapper;
|
||||||
|
import com.njcn.device.pq.pojo.po.PqsTflgass;
|
||||||
|
import com.njcn.device.pq.service.IPqsTflgassService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-07-19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class PqsTflgassServiceImpl extends ServiceImpl<PqsTflgassMapper, PqsTflgass> implements IPqsTflgassService {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,132 @@
|
|||||||
|
package com.njcn.device.pq.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.lang.Assert;
|
||||||
|
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.exception.BusinessException;
|
||||||
|
import com.njcn.device.pq.enums.PvDeviceResponseEnum;
|
||||||
|
import com.njcn.device.pq.mapper.PqsTflgployMapper;
|
||||||
|
import com.njcn.device.pq.pojo.param.TflgployParam;
|
||||||
|
import com.njcn.device.pq.pojo.po.PqsTflgploy;
|
||||||
|
import com.njcn.device.pq.pojo.po.PqsTflgployass;
|
||||||
|
import com.njcn.device.pq.pojo.po.PqsTransformer;
|
||||||
|
import com.njcn.device.pq.service.IPqsTflgployService;
|
||||||
|
import com.njcn.device.pq.service.IPqsTflgployassService;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-07-19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PqsTflgployServiceImpl extends ServiceImpl<PqsTflgployMapper, PqsTflgploy> implements IPqsTflgployService {
|
||||||
|
|
||||||
|
private final IPqsTflgployassService iPqsTflgployassService;
|
||||||
|
@Override
|
||||||
|
public Page<PqsTflgploy> flgployPage(BaseParam param) {
|
||||||
|
return this.page(new Page<>(param.getPageNum(), param.getPageSize()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean insertFlgPloy(TflgployParam param) {
|
||||||
|
List<PqsTflgploy> list = this.list(new LambdaQueryWrapper<PqsTflgploy>()
|
||||||
|
.eq(PqsTflgploy::getTpName, param.getTpName())
|
||||||
|
|
||||||
|
);
|
||||||
|
if (CollectionUtil.isNotEmpty(list)) {
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.TFLGPLOY_NAME_REPEAT);
|
||||||
|
}
|
||||||
|
|
||||||
|
//创建新
|
||||||
|
PqsTflgploy tflgploy= BeanUtil.copyProperties(param,PqsTflgploy.class);
|
||||||
|
tflgploy.setStatus(1);
|
||||||
|
boolean save = this.save(tflgploy);
|
||||||
|
List<PqsTflgployass> info=new ArrayList();
|
||||||
|
addList(param, tflgploy, save, info);
|
||||||
|
return iPqsTflgployassService.saveBatch(info);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TflgployParam.TflgployUpdateParam flgPloyInfo(String id) {
|
||||||
|
PqsTflgploy tflgploy = this.baseMapper.selectById(id);
|
||||||
|
TflgployParam.TflgployUpdateParam param=BeanUtil.copyProperties(tflgploy,TflgployParam.TflgployUpdateParam.class);
|
||||||
|
List<PqsTflgployass> list = iPqsTflgployassService.list(new LambdaQueryWrapper<PqsTflgployass>().eq(
|
||||||
|
PqsTflgployass::getTpIndex, id
|
||||||
|
));
|
||||||
|
List<String> tfIndexList = list.stream().map(PqsTflgployass::getTfIndex).collect(Collectors.toList());
|
||||||
|
param.setTfIndexs(tfIndexList);
|
||||||
|
return param;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean updateFlgPloy(TflgployParam.TflgployUpdateParam param) {
|
||||||
|
//根据信息查询当前策略是否存在
|
||||||
|
int count = this.count(new LambdaQueryWrapper<PqsTflgploy>()
|
||||||
|
.eq(PqsTflgploy::getTpIndex, param.getTpIndex()));
|
||||||
|
|
||||||
|
Assert.isTrue(count>0 , "当前变压器策略不存在,请检查信息");
|
||||||
|
List<PqsTflgploy> list = this.list(new LambdaQueryWrapper<PqsTflgploy>()
|
||||||
|
.ne(PqsTflgploy::getTpIndex, param.getTpIndex())
|
||||||
|
.and(wrapper ->
|
||||||
|
wrapper.eq(PqsTflgploy::getTpName, param.getTpName())
|
||||||
|
)
|
||||||
|
|
||||||
|
);
|
||||||
|
if (CollectionUtil.isNotEmpty(list)) {
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.TFLGPLOY_NAME_REPEAT);
|
||||||
|
}
|
||||||
|
PqsTflgploy tflgploy= BeanUtil.copyProperties(param,PqsTflgploy.class);
|
||||||
|
boolean update = this.updateById(tflgploy);
|
||||||
|
List<PqsTflgployass> info=new ArrayList();
|
||||||
|
if(update){
|
||||||
|
boolean remove = iPqsTflgployassService.remove(new LambdaQueryWrapper<PqsTflgployass>()
|
||||||
|
.eq(PqsTflgployass::getTpIndex, param.getTpIndex()));
|
||||||
|
addList(param, tflgploy, remove, info);
|
||||||
|
}
|
||||||
|
return iPqsTflgployassService.saveBatch(info);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean delFlgPloy(String ids) {
|
||||||
|
int count = this.count(new LambdaQueryWrapper<PqsTflgploy>()
|
||||||
|
.eq(PqsTflgploy::getTpIndex, ids));
|
||||||
|
|
||||||
|
Assert.isTrue(count>0 , "当前变压器策略不存在,请检查信息");
|
||||||
|
this.removeById(ids);
|
||||||
|
boolean remove = iPqsTflgployassService.remove(new LambdaQueryWrapper<PqsTflgployass>()
|
||||||
|
.eq(PqsTflgployass::getTpIndex, ids));
|
||||||
|
return remove;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addList(TflgployParam param, PqsTflgploy tflgploy, boolean save, List<PqsTflgployass> info) {
|
||||||
|
if(save){
|
||||||
|
List<String> tfIndexs = param.getTfIndexs();
|
||||||
|
if(CollUtil.isNotEmpty(tfIndexs)){
|
||||||
|
PqsTflgployass ass;
|
||||||
|
for (String tfIndex : tfIndexs) {
|
||||||
|
ass=new PqsTflgployass();
|
||||||
|
ass.setTpIndex(tflgploy.getTpIndex());
|
||||||
|
ass.setTfIndex(tfIndex);
|
||||||
|
info.add(ass);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.njcn.device.pq.service.impl;
|
||||||
|
|
||||||
|
import com.njcn.device.pq.mapper.PqsTflgployassMapper;
|
||||||
|
import com.njcn.device.pq.pojo.po.PqsTflgployass;
|
||||||
|
import com.njcn.device.pq.service.IPqsTflgployassService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-07-19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class PqsTflgployassServiceImpl extends ServiceImpl<PqsTflgployassMapper, PqsTflgployass> implements IPqsTflgployassService {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,313 @@
|
|||||||
|
package com.njcn.device.pq.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
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.exception.BusinessException;
|
||||||
|
import com.njcn.device.pq.enums.LineBaseEnum;
|
||||||
|
import com.njcn.device.pq.enums.PvDeviceResponseEnum;
|
||||||
|
import com.njcn.device.pq.mapper.LineMapper;
|
||||||
|
import com.njcn.device.pq.mapper.PqsTflgassMapper;
|
||||||
|
import com.njcn.device.pq.mapper.PqsTransformerMapper;
|
||||||
|
import com.njcn.device.pq.pojo.param.PqsTransformerParam;
|
||||||
|
import com.njcn.device.pq.pojo.po.Line;
|
||||||
|
import com.njcn.device.pq.pojo.po.PqsTflgass;
|
||||||
|
import com.njcn.device.pq.pojo.po.PqsTransformer;
|
||||||
|
import com.njcn.device.pq.pojo.vo.PqsTflgassVO;
|
||||||
|
import com.njcn.device.pq.pojo.vo.PqsTransformerVO;
|
||||||
|
import com.njcn.device.pq.pojo.vo.TerminalTree;
|
||||||
|
import com.njcn.device.pq.pojo.vo.TransformerVO;
|
||||||
|
import com.njcn.device.pq.service.IPqsTflgassService;
|
||||||
|
import com.njcn.device.pq.service.IPqsTransformerService;
|
||||||
|
import com.njcn.user.api.UserFeignClient;
|
||||||
|
import com.njcn.user.pojo.po.User;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
import com.njcn.web.pojo.vo.LineDataVO;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-07-19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PqsTransformerServiceImpl extends ServiceImpl<PqsTransformerMapper, PqsTransformer> implements IPqsTransformerService {
|
||||||
|
|
||||||
|
private final IPqsTflgassService iPqsTflgassService;
|
||||||
|
|
||||||
|
private final PqsTflgassMapper pqsTflgassMapper;
|
||||||
|
private final LineMapper lineMapper;
|
||||||
|
|
||||||
|
private final UserFeignClient userFeignClient;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<PqsTransformerVO> transformerPage(BaseParam param) {
|
||||||
|
Page<PqsTransformer> page = this.page(new Page<>(param.getPageNum(), param.getPageSize()), new LambdaQueryWrapper<PqsTransformer>()
|
||||||
|
.eq(StrUtil.isNotBlank(param.getSearchValue()), PqsTransformer::getSubIndex, param.getSearchValue())
|
||||||
|
.or()
|
||||||
|
.eq(StrUtil.isNotBlank(param.getSearchValue()), PqsTransformer::getTfIndex, param.getSearchValue())
|
||||||
|
.orderByDesc(PqsTransformer::getUpdateTime)
|
||||||
|
);
|
||||||
|
|
||||||
|
Page<PqsTransformerVO> voPage = BeanUtil.copyProperties(page, Page.class);
|
||||||
|
List<PqsTransformer> records = page.getRecords();
|
||||||
|
|
||||||
|
if (CollUtil.isNotEmpty(records)) {
|
||||||
|
//初始化属性
|
||||||
|
List<PqsTransformerVO> transformerVOList = new ArrayList<>();
|
||||||
|
PqsTransformerVO vo;
|
||||||
|
//查询变电站信息
|
||||||
|
List<String> subIds = records.stream().map(PqsTransformer::getSubIndex).collect(Collectors.toList());
|
||||||
|
List<LineDataVO> lineDetail = lineMapper.getLineDetail(subIds);
|
||||||
|
Map<String, String> lineMap = lineDetail.stream().collect(Collectors.toMap(LineDataVO::getId, LineDataVO::getName));
|
||||||
|
|
||||||
|
//查询用户信息
|
||||||
|
List<String> userIds = records.stream().map(PqsTransformer::getUpdateBy).collect(Collectors.toList());
|
||||||
|
List<User> userList = userFeignClient.getUserByIdList(userIds).getData();
|
||||||
|
Map<String, String> userMap = userList.stream().collect(Collectors.toMap(User::getId, User::getName));
|
||||||
|
|
||||||
|
|
||||||
|
for (PqsTransformer record : records) {
|
||||||
|
vo = BeanUtil.copyProperties(record, PqsTransformerVO.class);
|
||||||
|
if (lineMap.containsKey(record.getSubIndex())) {
|
||||||
|
vo.setSubIndexName(lineMap.get(record.getSubIndex()));
|
||||||
|
}
|
||||||
|
if (userMap.containsKey(record.getUpdateBy())) {
|
||||||
|
vo.setUpdateBy(userMap.get(record.getUpdateBy()));
|
||||||
|
}
|
||||||
|
transformerVOList.add(vo);
|
||||||
|
}
|
||||||
|
voPage.setRecords(transformerVOList);
|
||||||
|
}
|
||||||
|
return voPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean insertTransformer(PqsTransformerParam.TransformerAddParam param) {
|
||||||
|
List<PqsTransformer> list = this.list(new LambdaQueryWrapper<PqsTransformer>()
|
||||||
|
.eq(PqsTransformer::getTfName, param.getTfName())
|
||||||
|
|
||||||
|
);
|
||||||
|
if (CollectionUtil.isNotEmpty(list)) {
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.TRANSFORMER_NAME_REPEAT);
|
||||||
|
}
|
||||||
|
PqsTransformer pqsTransformer = BeanUtil.copyProperties(param, PqsTransformer.class);
|
||||||
|
pqsTransformer.setSort(this.baseMapper.sortTransformer() + 1);
|
||||||
|
pqsTransformer.setStatus(1);
|
||||||
|
boolean save = this.save(pqsTransformer);
|
||||||
|
return save;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean updateTransformer(PqsTransformerParam.TransformerUpdateParam param) {
|
||||||
|
List<PqsTransformer> list = this.list(new LambdaQueryWrapper<PqsTransformer>()
|
||||||
|
.ne(PqsTransformer::getTfIndex, param.getTfIndex())
|
||||||
|
.and(wrapper ->
|
||||||
|
wrapper.eq(PqsTransformer::getTfName, param.getTfName())
|
||||||
|
)
|
||||||
|
);
|
||||||
|
if (CollectionUtil.isNotEmpty(list)) {
|
||||||
|
throw new BusinessException(PvDeviceResponseEnum.TRANSFORMER_NAME_REPEAT);
|
||||||
|
}
|
||||||
|
PqsTransformer pqsTransformer = BeanUtil.copyProperties(param, PqsTransformer.class);
|
||||||
|
boolean update = this.updateById(pqsTransformer);
|
||||||
|
return update;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean delTransformer(List<String> ids) {
|
||||||
|
boolean b = this.removeByIds(ids);
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PqsTflgassVO selectFlgAss(String ids) {
|
||||||
|
PqsTflgassVO pqsTflgassVO = new PqsTflgassVO();
|
||||||
|
PqsTflgass one = iPqsTflgassService.getOne(new LambdaQueryWrapper<PqsTflgass>()
|
||||||
|
.eq(PqsTflgass::getTfIndex, ids));
|
||||||
|
if (ObjectUtil.isNotNull(one)) {
|
||||||
|
BeanUtil.copyProperties(one, pqsTflgassVO);
|
||||||
|
Line logicBefore = lineMapper.selectById(one.getLogicBefore());
|
||||||
|
Line logicNext = lineMapper.selectById(one.getLogicNext());
|
||||||
|
pqsTflgassVO.setLogicBeforeName(logicBefore.getName());
|
||||||
|
pqsTflgassVO.setLogicNextName(logicNext.getName());
|
||||||
|
|
||||||
|
}
|
||||||
|
return pqsTflgassVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean nodeMaintenance(PqsTransformerParam param) {
|
||||||
|
boolean fly;
|
||||||
|
//根据变压器台账id查询是否存在节点信息,存在则修改,不存则新增
|
||||||
|
PqsTflgass one = iPqsTflgassService.getOne(new LambdaQueryWrapper<PqsTflgass>()
|
||||||
|
.eq(PqsTflgass::getTfIndex, param.getTfIndex()));
|
||||||
|
if (ObjectUtil.isNull(one)) {
|
||||||
|
PqsTflgass ass = new PqsTflgass();
|
||||||
|
ass.setTfIndex(param.getTfIndex());
|
||||||
|
ass.setLogicBefore(param.getUpNode());
|
||||||
|
ass.setLogicNext(param.getDownNode());
|
||||||
|
fly = iPqsTflgassService.save(ass);
|
||||||
|
} else {
|
||||||
|
one.setLogicBefore(param.getUpNode());
|
||||||
|
one.setLogicNext(param.getDownNode());
|
||||||
|
fly = iPqsTflgassService.updateById(one);
|
||||||
|
}
|
||||||
|
return fly;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, List<TerminalTree>> getGeneratrix(String id) {
|
||||||
|
Map<String, List<TerminalTree>> voltage = new HashMap<>();
|
||||||
|
|
||||||
|
|
||||||
|
//1.获取当前变电站下,所拥有的母线条数
|
||||||
|
List<TerminalTree> downVoltage = lineMapper.getvoltage(id, 1);
|
||||||
|
//获取母线id
|
||||||
|
List<String> ids = downVoltage.stream().map(TerminalTree::getId).collect(Collectors.toList());
|
||||||
|
//查询节点是否绑定
|
||||||
|
List<PqsTflgass> pqsTflgasses = pqsTflgassMapper.selectFlgass(id, ids);
|
||||||
|
Stream<String> beforeStream = pqsTflgasses.stream().map(PqsTflgass::getLogicBefore);
|
||||||
|
Stream<String> nextStream = pqsTflgasses.stream().map(PqsTflgass::getLogicNext);
|
||||||
|
//合并节点,要是母线都存在,说明是跨变电站,反之是本变电站
|
||||||
|
List<String> merge = Stream.concat(beforeStream, nextStream)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
//跨变电站
|
||||||
|
if (downVoltage.size() < 2 || merge.size() == ids.size()) {
|
||||||
|
List<TerminalTree> upVoltage;
|
||||||
|
if (downVoltage.size() < 2) {
|
||||||
|
upVoltage = lineMapper.getvoltage(id, 0);
|
||||||
|
} else {
|
||||||
|
List<PqsTflgass> ad = iPqsTflgassService.list();
|
||||||
|
String s = recursionSelectList(ad);
|
||||||
|
upVoltage = downVoltage.stream().filter(x -> x.getId().equals(s)).collect(Collectors.toList());
|
||||||
|
|
||||||
|
}
|
||||||
|
List<TerminalTree> upList = TreedChildren(upVoltage, "变压器上节点设备树", null);
|
||||||
|
voltage.put("upNode", upList);
|
||||||
|
List<TerminalTree> downList = TreedChildren(downVoltage, "变压器下节点设备树", id);
|
||||||
|
voltage.put("downNode", downList);
|
||||||
|
} else {
|
||||||
|
//上节点id
|
||||||
|
List<String> upIDs = pqsTflgasses.stream().map(PqsTflgass::getLogicBefore).collect(Collectors.toList());
|
||||||
|
List<TerminalTree> upVOList = downVoltage.stream().filter(x -> !upIDs.contains(x.getId())).collect(Collectors.toList());
|
||||||
|
|
||||||
|
//下节点id
|
||||||
|
List<String> downIDs = pqsTflgasses.stream().map(PqsTflgass::getLogicBefore).collect(Collectors.toList());
|
||||||
|
List<TerminalTree> downVOList = downVoltage.stream().filter(x -> !downIDs.contains(x.getId())).collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<TerminalTree> upList = TreedChildren(upVOList, "变压器上节点设备树", id);
|
||||||
|
voltage.put("upNode", upList);
|
||||||
|
List<TerminalTree> downList = TreedChildren(downVOList, "变压器下节点设备树", id);
|
||||||
|
voltage.put("downNode", downList);
|
||||||
|
}
|
||||||
|
|
||||||
|
return voltage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TerminalTree> getTransformerTree() {
|
||||||
|
List<TerminalTree> terminalTrees = this.baseMapper.listTransformer();
|
||||||
|
return TreedChildren(terminalTrees, "变压器设备树", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取全部子节点
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2021/7/19
|
||||||
|
*/
|
||||||
|
public List<TerminalTree> getChildren(TerminalTree item, List<TerminalTree> all) {
|
||||||
|
return all.stream().filter(allItem -> allItem.getPid().equals(item.getId())).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化设备树
|
||||||
|
*
|
||||||
|
* @param children
|
||||||
|
* @param name
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<TerminalTree> TreedChildren(List<TerminalTree> children, String name, String subId) {
|
||||||
|
List<TerminalTree> taiZhang = new ArrayList<>();
|
||||||
|
List<TerminalTree> allList = lineMapper.getAllList();
|
||||||
|
|
||||||
|
List<TerminalTree> gdList;
|
||||||
|
List<TerminalTree> subList;
|
||||||
|
List<TerminalTree> provinceList;
|
||||||
|
if (StrUtil.isBlank(subId)) {
|
||||||
|
subList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.SUB_LEVEL.getCode())).sorted(Comparator.comparing(TerminalTree::getSort)).collect(Collectors.toList());
|
||||||
|
gdList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.GD_LEVEL.getCode())).sorted(Comparator.comparing(TerminalTree::getSort)).collect(Collectors.toList());
|
||||||
|
provinceList = lineMapper.getProvinceList(null, 0);
|
||||||
|
} else {
|
||||||
|
subList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.SUB_LEVEL.getCode())
|
||||||
|
&& item.getId().equals(subId)
|
||||||
|
).sorted(Comparator.comparing(TerminalTree::getSort)).collect(Collectors.toList());
|
||||||
|
gdList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.GD_LEVEL.getCode())
|
||||||
|
&& item.getId().equals(subList.get(0).getPid())
|
||||||
|
).sorted(Comparator.comparing(TerminalTree::getSort)).collect(Collectors.toList());
|
||||||
|
provinceList = lineMapper.getProvinceList(Arrays.asList(gdList.get(0).getPid()), 1);
|
||||||
|
}
|
||||||
|
List<TerminalTree> terminal = children.stream().sorted(Comparator.comparing(TerminalTree::getSort)).collect(Collectors.toList());
|
||||||
|
|
||||||
|
subList.forEach(sub -> sub.setChildren(getChildren(sub, terminal)));
|
||||||
|
gdList.forEach(gd -> gd.setChildren(getChildren(gd, subList)));
|
||||||
|
provinceList.forEach(province -> province.setChildren(getChildren(province, gdList)));
|
||||||
|
|
||||||
|
if (CollectionUtil.isNotEmpty(allList)) {
|
||||||
|
TerminalTree terminalTree = new TerminalTree();
|
||||||
|
terminalTree.setId("9999999");
|
||||||
|
terminalTree.setLevel(0);
|
||||||
|
terminalTree.setName(name);
|
||||||
|
if (CollectionUtil.isNotEmpty(provinceList)) {
|
||||||
|
terminalTree.setChildren(provinceList);
|
||||||
|
}
|
||||||
|
taiZhang.add(terminalTree);
|
||||||
|
}
|
||||||
|
return taiZhang;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查找节点信息
|
||||||
|
*
|
||||||
|
* @param pqsTflgasses
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private static String recursionSelectList(List<PqsTflgass> pqsTflgasses) {
|
||||||
|
String logicBefore = null;
|
||||||
|
for (PqsTflgass pqsTflgass : pqsTflgasses) {
|
||||||
|
//根据获取的的上节点判断是否存在,这上节点是否是尾节点
|
||||||
|
if (ObjectUtil.isNull(logicBefore)) {
|
||||||
|
logicBefore = pqsTflgass.getLogicBefore();
|
||||||
|
} else {
|
||||||
|
String logicNext = pqsTflgass.getLogicNext();
|
||||||
|
if (logicBefore.equals(logicNext)) {
|
||||||
|
logicBefore = pqsTflgass.getLogicBefore();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return logicBefore;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -141,6 +141,7 @@ public class AreaLineServiceImpl implements AreaLineService {
|
|||||||
SubstationDetailVO substationDetail = new SubstationDetailVO();
|
SubstationDetailVO substationDetail = new SubstationDetailVO();
|
||||||
substationDetail.setId(lineDataVO.getId());
|
substationDetail.setId(lineDataVO.getId());
|
||||||
substationDetail.setSrbName(lineDataVO.getName());
|
substationDetail.setSrbName(lineDataVO.getName());
|
||||||
|
substationDetail.setSubName(lineDataVO.getSubName());
|
||||||
substationDetail.setCoordY(substationDetailVOS.get(i).getCoordY().floatValue() + r * Math.cos(2 * Math.PI * j / lineTail));
|
substationDetail.setCoordY(substationDetailVOS.get(i).getCoordY().floatValue() + r * Math.cos(2 * Math.PI * j / lineTail));
|
||||||
substationDetail.setCoordX(substationDetailVOS.get(i).getCoordX().floatValue() + r * Math.sin(2 * Math.PI * j / lineTail));
|
substationDetail.setCoordX(substationDetailVOS.get(i).getCoordX().floatValue() + r * Math.sin(2 * Math.PI * j / lineTail));
|
||||||
substationDetail.setColor(color);
|
substationDetail.setColor(color);
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
|||||||
//相别统计为T时,业务数据处理
|
//相别统计为T时,业务数据处理
|
||||||
if (StrUtil.isBlank(harmonicHistoryDataList.get(0).getPhasicType()) || harmonicHistoryDataList.get(0).getPhasicType().equalsIgnoreCase("t")) {
|
if (StrUtil.isBlank(harmonicHistoryDataList.get(0).getPhasicType()) || harmonicHistoryDataList.get(0).getPhasicType().equalsIgnoreCase("t")) {
|
||||||
for (HarmonicHistoryData harmonicHistoryData : harmonicHistoryDataList) {
|
for (HarmonicHistoryData harmonicHistoryData : harmonicHistoryDataList) {
|
||||||
time.add(new Date(harmonicHistoryData.getTime().toEpochMilli()));
|
time.add(PubUtils.instantToDate(harmonicHistoryData.getTime()));
|
||||||
fValue.add(BigDecimal.valueOf(harmonicHistoryData.getAValue()).setScale(4, RoundingMode.HALF_UP).floatValue());
|
fValue.add(BigDecimal.valueOf(harmonicHistoryData.getAValue()).setScale(4, RoundingMode.HALF_UP).floatValue());
|
||||||
//返回结果有多个值,需要额外处理下
|
//返回结果有多个值,需要额外处理下
|
||||||
if (Integer.parseInt(contion) == 14) {
|
if (Integer.parseInt(contion) == 14) {
|
||||||
@@ -196,7 +196,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
|||||||
.filter(temp -> temp.getPhasicType().equalsIgnoreCase(InfluxDBTableConstant.PHASE_TYPE_C))
|
.filter(temp -> temp.getPhasicType().equalsIgnoreCase(InfluxDBTableConstant.PHASE_TYPE_C))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
time = aList.stream()
|
time = aList.stream()
|
||||||
.map(temp -> new Date(temp.getTime().toEpochMilli()))
|
.map(temp -> PubUtils.instantToDate(temp.getTime()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
aValue = aList.stream()
|
aValue = aList.stream()
|
||||||
.map(temp -> BigDecimal.valueOf(temp.getAValue()).setScale(4, RoundingMode.HALF_UP).floatValue())
|
.map(temp -> BigDecimal.valueOf(temp.getAValue()).setScale(4, RoundingMode.HALF_UP).floatValue())
|
||||||
@@ -324,7 +324,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
|||||||
break;
|
break;
|
||||||
case 14:
|
case 14:
|
||||||
//电压不平衡
|
//电压不平衡
|
||||||
sql = "SELECT time as time, v_zero as aValue, v_pos as bValue, v_neg as cValue ," + InfluxDBTableConstant.PHASIC_TYPE + "FROM data_v WHERE " + stringBuilder +
|
sql = "SELECT time as time, v_zero as aValue, v_pos as bValue, v_neg as cValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_v WHERE " + stringBuilder +
|
||||||
" and (phasic_type ='T') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
" and (phasic_type ='T') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||||
phasicType.add("零序电压");
|
phasicType.add("零序电压");
|
||||||
phasicType.add("正序电压");
|
phasicType.add("正序电压");
|
||||||
|
|||||||
Reference in New Issue
Block a user