1.解决mysql语句关键字问题
2.mysql台账同步oracle
This commit is contained in:
@@ -61,3 +61,7 @@ isJb: false
|
||||
mqtt:
|
||||
client-id: @artifactId@${random.value}
|
||||
|
||||
oracle:
|
||||
isSync: false
|
||||
syncLedgerLineUrl: http://localhost:8082/export/syncLedgerLine
|
||||
syncLedgerUpdateLine: http://localhost:8082/export/syncLedgerLine
|
||||
|
||||
@@ -46,6 +46,10 @@ public enum PvDeviceResponseEnum {
|
||||
LINE_DEVICE_NO_MATCH("A0369","监测点所属装置型号不匹配"),
|
||||
NO_SUB("A0370","当前单位下不存在台区或变电站"),
|
||||
NEWSTATION_REPEAT("A0371","新能源场站名称已存在"),
|
||||
PROJECT_OR_NOT("A00550","项目名称为空,请检查信息是否存在!"),
|
||||
PROVINCE_OR_NOT("A00550","省级名称为空,请检查信息是否存在!"),
|
||||
GD_OR_NOT("A00550","供电名称为空,请检查信息是否存在!"),
|
||||
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@ public class LineParam {
|
||||
@Pattern(regexp = PatternRegex.DEV_NAME_REGEX,message = "监测点名称违规")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(name = "name",value = "原监测点名称",required = true)
|
||||
private String oldName;
|
||||
/**
|
||||
* PT一次变比
|
||||
*/
|
||||
|
||||
@@ -31,6 +31,9 @@ public class SubVoltageParam {
|
||||
@Pattern(regexp = PatternRegex.DEV_NAME_REGEX,message = "设备名称违规")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(name = "name",value = "原母线名称",required = true)
|
||||
private String oldName;
|
||||
|
||||
/**
|
||||
* 母线号(在同一台设备中的电压通道号)
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName PQ_DEVICE
|
||||
*/
|
||||
@Data
|
||||
public class PqDevice implements Serializable {
|
||||
|
||||
|
||||
private Integer devIndex;
|
||||
/**
|
||||
* 装置名称(唯一性判断)
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 装置通讯状态(0:中断;1:正常)
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* (关联表PQS_Dicdata)装置型号Guid
|
||||
*/
|
||||
private String devtype;
|
||||
|
||||
/**
|
||||
* 登录时间
|
||||
*/
|
||||
private String logontime;
|
||||
|
||||
/**
|
||||
* 数据更新时间
|
||||
*/
|
||||
private String updatetime;
|
||||
|
||||
|
||||
/**
|
||||
* (关联表NodeInformation)服务器表序号,表明这台设备运行在哪台服务器上
|
||||
*/
|
||||
private String nodeName;
|
||||
|
||||
|
||||
/**
|
||||
* 端口ID,用于端口映射
|
||||
*/
|
||||
private Integer portid;
|
||||
|
||||
/**
|
||||
* 装置状态(0:投运;1:热备用;2:停运)
|
||||
*/
|
||||
private Integer devflag;
|
||||
|
||||
/**
|
||||
* 装置识别码,采用3ds加密
|
||||
*/
|
||||
private String devSeries;
|
||||
|
||||
/**
|
||||
* 装置秘钥,采用3ds加密
|
||||
*/
|
||||
private String devKey;
|
||||
|
||||
/**
|
||||
* IP地址
|
||||
*/
|
||||
private String ip;
|
||||
|
||||
/**
|
||||
* 装置模型(0:虚拟设备;1:实际设备;2:离线设备;)默认是实际设备
|
||||
*/
|
||||
private Integer devmodel;
|
||||
|
||||
/**
|
||||
* 已召唤标志
|
||||
*/
|
||||
private Integer callflag;
|
||||
|
||||
/**
|
||||
* 数据类型(0:暂态系统;1:稳态系统;2:两个系统)
|
||||
*/
|
||||
private Integer datatype;
|
||||
|
||||
|
||||
/**
|
||||
* 母线信息表
|
||||
*/
|
||||
private List<PqSubvoltage> pqSubvoltage;
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName PQ_DEVICEDETAIL
|
||||
*/
|
||||
@Data
|
||||
public class PqDevicedetail implements Serializable {
|
||||
|
||||
private Integer devIndex;
|
||||
|
||||
/**
|
||||
* (关联PQS_Dicdata)设备制造商Guid
|
||||
*/
|
||||
private String manufacturer;
|
||||
|
||||
/**
|
||||
* 定检状态(0:已检 1:未检)
|
||||
*/
|
||||
private Integer checkflag;
|
||||
|
||||
/**
|
||||
* 本次定检时间
|
||||
*/
|
||||
private String thistimecheck;
|
||||
|
||||
/**
|
||||
* 下次定检时间(假如跟当前时间比少于3个月则定检状态界面显示为待检)
|
||||
*/
|
||||
private String nexttimecheck;
|
||||
|
||||
/**
|
||||
* 统计在线率总数
|
||||
*/
|
||||
private Integer onlineratetj;
|
||||
|
||||
/**
|
||||
* 总套餐流量
|
||||
*/
|
||||
private Integer dataplan;
|
||||
|
||||
/**
|
||||
* 新增流量套餐
|
||||
*/
|
||||
private Integer newtraffic;
|
||||
|
||||
/**
|
||||
* 电度功能
|
||||
*/
|
||||
private Integer electroplate;
|
||||
|
||||
/**
|
||||
* 对时功能
|
||||
*/
|
||||
private Integer ontime;
|
||||
|
||||
/**
|
||||
* 合同号
|
||||
*/
|
||||
private String contract;
|
||||
|
||||
/**
|
||||
* SIM卡号
|
||||
*/
|
||||
private String sim;
|
||||
|
||||
/**
|
||||
* 装置系列
|
||||
*/
|
||||
private String devCatena;
|
||||
|
||||
/**
|
||||
* 监测装置安装位置
|
||||
*/
|
||||
private String devLocation;
|
||||
|
||||
/**
|
||||
* 监测厂家设备编号
|
||||
*/
|
||||
private String devNo;
|
||||
|
||||
/**
|
||||
* 告警功能
|
||||
*/
|
||||
private Integer isAlarm;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName PQ_DEVTYPEICD
|
||||
*/
|
||||
@TableName(value ="PQ_DEVTYPEICD")
|
||||
@Data
|
||||
public class PqDevtypeicd implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField(value = "DEVTYPE")
|
||||
private String devtype;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField(value = "ICDTEMPLATEBLOB")
|
||||
private byte[] icdtemplateblob;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField(value = "ICDTEMPLATECLOB")
|
||||
private String icdtemplateclob;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName PQ_GDINFORMATION 供电公司信息表
|
||||
*/
|
||||
@Data
|
||||
public class PqGdinformation implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* (关联表PQS_DICDATA外键)省份Guid
|
||||
*/
|
||||
private String name;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName PQ_LINE
|
||||
*/
|
||||
@Data
|
||||
public class PqLine implements Serializable {
|
||||
|
||||
private Integer lineIndex;
|
||||
/**
|
||||
* 线路名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* PT一次变比
|
||||
*/
|
||||
private Double pt1;
|
||||
|
||||
/**
|
||||
* PT二次变比
|
||||
*/
|
||||
private Double pt2;
|
||||
|
||||
/**
|
||||
* CT一次变比
|
||||
*/
|
||||
private Double ct1;
|
||||
|
||||
/**
|
||||
* CT二次变比
|
||||
*/
|
||||
private Double ct2;
|
||||
|
||||
/**
|
||||
* 设备容量
|
||||
*/
|
||||
private Double devcmp;
|
||||
|
||||
/**
|
||||
* 短路容量
|
||||
*/
|
||||
private Double dlcmp;
|
||||
|
||||
/**
|
||||
* 基准容量
|
||||
*/
|
||||
private Double jzcmp;
|
||||
|
||||
/**
|
||||
* 协议容量
|
||||
*/
|
||||
private Double xycmp;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String scale;
|
||||
|
||||
/**
|
||||
* 0投运 1.热备用 2.停运
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName PQ_LINEDETAIL
|
||||
*/
|
||||
@Data
|
||||
public class PqLinedetail implements Serializable {
|
||||
|
||||
private Integer lineIndex;
|
||||
/**
|
||||
* 线路名称
|
||||
*/
|
||||
private String lineName;
|
||||
|
||||
/**
|
||||
* 接线类型(0:星型接法;1:三角型接法;2:开口三角型接法)
|
||||
*/
|
||||
private Integer pttype;
|
||||
|
||||
/**
|
||||
* 上次数据更新时间
|
||||
*/
|
||||
private String lastTime;
|
||||
|
||||
/**
|
||||
* 测量间隔(1~10)
|
||||
*/
|
||||
private Integer tinterval;
|
||||
|
||||
/**
|
||||
* (关联PQS_Dicdata表)负荷类型Guid
|
||||
*/
|
||||
private String loadtype;
|
||||
|
||||
/**
|
||||
* (关联PQS_Dicdata表)行业类型Guid
|
||||
*/
|
||||
private String businesstype;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 国网谐波监测平台监测点号
|
||||
*/
|
||||
private String monitorId;
|
||||
|
||||
/**
|
||||
* 0-电网侧,1-非电网侧
|
||||
*/
|
||||
private Integer powerid;
|
||||
|
||||
/**
|
||||
* 监测点对象名称
|
||||
*/
|
||||
private String objname;
|
||||
|
||||
/**
|
||||
* 统计类型
|
||||
*/
|
||||
private Integer statflag;
|
||||
|
||||
/**
|
||||
* 监测点等级
|
||||
*/
|
||||
private String lineGrade;
|
||||
|
||||
/**
|
||||
* 电网侧变电站名称
|
||||
*/
|
||||
private String powerSubstationName;
|
||||
|
||||
/**
|
||||
* 挂接线路
|
||||
*/
|
||||
private String hangLine;
|
||||
|
||||
/**
|
||||
* 监测点拥有者
|
||||
*/
|
||||
private String owner;
|
||||
|
||||
/**
|
||||
* 拥有者职务
|
||||
*/
|
||||
private String ownerDuty;
|
||||
|
||||
/**
|
||||
* 拥有者联系方式
|
||||
*/
|
||||
private String ownerTel;
|
||||
|
||||
/**
|
||||
* 接线图
|
||||
*/
|
||||
private String wiringDiagram;
|
||||
|
||||
/**
|
||||
* 上级电站
|
||||
*/
|
||||
private String superiorsSubstation;
|
||||
|
||||
/**
|
||||
* 分类等级 内容为Ⅰ、Ⅱ、Ⅲ、Ⅳ
|
||||
*/
|
||||
private String classificationGrade;
|
||||
|
||||
/**
|
||||
* 是否并网点
|
||||
*/
|
||||
private Integer isGridPoint;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author web2023
|
||||
* @TableName PQ_PROJECT 项目信息表
|
||||
*/
|
||||
@Data
|
||||
public class PqProject implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 项目名称(唯一性判断)
|
||||
*/
|
||||
private String name;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author web2023
|
||||
* @TableName PQ_PROVINCE 省级信息表
|
||||
*/
|
||||
@Data
|
||||
public class PqProvince implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 省级名称(唯一性判断)
|
||||
*/
|
||||
private String name;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName PQ_SUBSTATION
|
||||
*/
|
||||
@Data
|
||||
public class PqSubstation implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* (关联PQS_Dictionary表)电压等级Guid
|
||||
*/
|
||||
private String scale;
|
||||
|
||||
/**
|
||||
* 旧变电站id
|
||||
*/
|
||||
private String oldName;
|
||||
|
||||
/**
|
||||
* 供电公司
|
||||
*/
|
||||
private String gdName;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName PQ_SUBVOLTAGE
|
||||
*/
|
||||
@Data
|
||||
public class PqSubvoltage implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 母线名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 原母线名称
|
||||
*/
|
||||
private String oldName;
|
||||
|
||||
/**
|
||||
* 母线号(在同一台设备中的电压通道号)
|
||||
*/
|
||||
private Integer subvNum;
|
||||
|
||||
/**
|
||||
* (关联表PQS_Dicdata)电压等级Guid
|
||||
*/
|
||||
private String scale;
|
||||
|
||||
/**
|
||||
* 母线模型(0:虚拟母线;1:实际母线)
|
||||
* 默认是实际母线
|
||||
*/
|
||||
private Integer subvmodel;
|
||||
|
||||
/**
|
||||
* 线路信息表
|
||||
*/
|
||||
private List<PqLine> pqLine;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName PQS_MAP 变电站经纬度
|
||||
*/
|
||||
@Data
|
||||
public class PqsMap implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private Double longitude;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private Double latitude;
|
||||
|
||||
/**
|
||||
* 数据状态(0:删除;1:正常)
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author wr
|
||||
* @description
|
||||
* @date 2024/10/9 16:37
|
||||
*/
|
||||
@Data
|
||||
public class SyncLedger implements Serializable {
|
||||
|
||||
/**
|
||||
* 线路信息表
|
||||
*/
|
||||
private PqLine pqLine;
|
||||
|
||||
/**
|
||||
* 线路参数附加定义表
|
||||
*/
|
||||
private PqLinedetail pqLinedetail;
|
||||
|
||||
/**
|
||||
* 母线信息表
|
||||
*/
|
||||
private PqSubvoltage pqSubvoltage;
|
||||
|
||||
/**
|
||||
* 装置信息表
|
||||
*/
|
||||
private PqDevice pqDevice;
|
||||
|
||||
/**
|
||||
* 装置详细信息表
|
||||
*/
|
||||
private PqDevicedetail pqDevicedetail;
|
||||
|
||||
/**
|
||||
* 变电站信息表
|
||||
*/
|
||||
private PqSubstation pqSubstation;
|
||||
|
||||
/**
|
||||
* 变电站经纬度
|
||||
*/
|
||||
private PqsMap pqsMap;
|
||||
|
||||
/**
|
||||
* 供电公司信息表
|
||||
*/
|
||||
private PqGdinformation pqGdinformation;
|
||||
|
||||
/**
|
||||
* 省级信息表,层次高于供电公司
|
||||
*/
|
||||
private PqProvince pqProvince;
|
||||
/**
|
||||
* 项目信息表,层次高于省级
|
||||
*/
|
||||
private PqProject pqProject;
|
||||
|
||||
/**
|
||||
* 线路号(在同一台设备中的监测点号)
|
||||
*/
|
||||
private Integer lineNum;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wr
|
||||
* @description
|
||||
* @date 2024/10/9 16:37
|
||||
*/
|
||||
@Data
|
||||
public class SyncLedgerDelete implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 线路信息表
|
||||
*/
|
||||
private List<String> line;
|
||||
/**
|
||||
* 母线信息表
|
||||
*/
|
||||
private List<String> subVoltage;
|
||||
/**
|
||||
* 装置信息表
|
||||
*/
|
||||
private List<String> device;
|
||||
|
||||
/**
|
||||
* 变电站信息表
|
||||
*/
|
||||
private List<String> substation;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wr
|
||||
* @description
|
||||
* @date 2024/10/9 16:37
|
||||
*/
|
||||
@Data
|
||||
public class SyncLedgerUpdate implements Serializable {
|
||||
|
||||
/**
|
||||
* 变电站信息表
|
||||
*/
|
||||
private PqSubstation pqSubstation;
|
||||
|
||||
/**
|
||||
* 变电站经纬度
|
||||
*/
|
||||
private PqsMap pqsMap;
|
||||
|
||||
/**
|
||||
* 装置信息表
|
||||
*/
|
||||
private List<PqDevice> pqDevice;
|
||||
|
||||
/**
|
||||
* 装置详细信息表
|
||||
*/
|
||||
private List<PqDevicedetail> pqDevicedetail;
|
||||
|
||||
/**
|
||||
* 线路参数附加定义表
|
||||
*/
|
||||
private List<PqLinedetail> pqLinedetail;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -191,8 +191,7 @@ public class TerminalBaseController extends BaseController {
|
||||
@DeleteMapping("delTerminal")
|
||||
public HttpResult<Object> delTerminal(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("delTerminal");
|
||||
System.out.println(id);
|
||||
// terminalBaseService.delTerminal(id);
|
||||
terminalBaseService.delTerminal(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -173,6 +173,14 @@ public interface LineMapper extends BaseMapper<Line> {
|
||||
*/
|
||||
List<String> getVoltageIdByScale(@Param("voltageIds") List<String> voltageIds, @Param("scale") String scale);
|
||||
|
||||
/**
|
||||
* 查询变电站id
|
||||
*
|
||||
* @param subIds 变电站索引集合
|
||||
* @param scale 电压等级
|
||||
*/
|
||||
List<String> getSubIdByScale(@Param("subIds") List<String> subIds, @Param("scale") String scale);
|
||||
|
||||
/**
|
||||
* 查询监测点id
|
||||
*
|
||||
|
||||
@@ -1779,4 +1779,20 @@
|
||||
|
||||
</where>
|
||||
</select>
|
||||
<select id="getSubIdByScale" resultType="java.lang.String">
|
||||
select
|
||||
t1.id
|
||||
from
|
||||
pq_line t1 ,
|
||||
pq_substation t2
|
||||
where
|
||||
t1.id = t2.id
|
||||
and
|
||||
t1.id in
|
||||
<foreach collection="subIds" separator="," open="(" close=")" item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND
|
||||
t2.scale = #{scale}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -148,6 +148,16 @@ public interface TerminalBaseService {
|
||||
*/
|
||||
List<String> getVoltageIdByScale(List<String> voltageIds, String scale);
|
||||
|
||||
/**
|
||||
* 根据指定电压等级查询母线id
|
||||
* @param subIds
|
||||
* @param scale
|
||||
* @return: java.util.List<java.lang.String>
|
||||
* @Author: wr
|
||||
* @Date: 2024/10/12 15:58
|
||||
*/
|
||||
List<String> getSubIdByScale(List<String> subIds, String scale);
|
||||
|
||||
/**
|
||||
* 根据干扰源获取对应的监测点id
|
||||
*
|
||||
|
||||
@@ -473,9 +473,9 @@ public class GeneralDeviceService {
|
||||
|
||||
private List<GeneralDeviceDTO> filterDataByScale(List<GeneralDeviceDTO> deviceInfos, List<SimpleDTO> scales) {
|
||||
List<GeneralDeviceDTO> generalDeviceDTOS = new ArrayList<>();
|
||||
List<String> voltageIds = new ArrayList<>(), lineIds = new ArrayList<>();
|
||||
List<String> subIds = new ArrayList<>(), lineIds = new ArrayList<>();
|
||||
for (GeneralDeviceDTO generalDeviceDTO : deviceInfos) {
|
||||
voltageIds.addAll(generalDeviceDTO.getVoltageIndexes());
|
||||
subIds.addAll(generalDeviceDTO.getSubIndexes());
|
||||
lineIds.addAll(generalDeviceDTO.getLineIndexes());
|
||||
}
|
||||
//如果电压等级集合为空,则查询所有的电压等级
|
||||
@@ -493,8 +493,8 @@ public class GeneralDeviceService {
|
||||
}
|
||||
List<Line> lines = terminalBaseService.getLineById(lineIds);
|
||||
for (SimpleDTO simpleDTO : scales) {
|
||||
List<String> voltageScaleIds = terminalBaseService.getVoltageIdByScale(voltageIds, simpleDTO.getId());
|
||||
generalDeviceDTOS.add(assembleDataByLine(simpleDTO, lines, voltageScaleIds, LineBaseEnum.SUB_V_LEVEL.getCode()));
|
||||
List<String> voltageScaleIds = terminalBaseService.getSubIdByScale(subIds, simpleDTO.getId());
|
||||
generalDeviceDTOS.add(assembleDataByLine(simpleDTO, lines, voltageScaleIds, LineBaseEnum.SUB_LEVEL.getCode()));
|
||||
}
|
||||
return generalDeviceDTOS;
|
||||
}
|
||||
|
||||
@@ -11,11 +11,11 @@ import cn.hutool.core.text.StrBuilder;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.config.GeneralInfo;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
@@ -30,6 +30,7 @@ import com.njcn.device.biz.pojo.po.DeviceBak;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.biz.utils.COverlimitUtil;
|
||||
import com.njcn.device.pq.enums.LineBaseEnum;
|
||||
import com.njcn.device.pq.enums.PvDeviceResponseEnum;
|
||||
import com.njcn.device.pq.mapper.*;
|
||||
import com.njcn.device.pq.pojo.bo.BaseLineInfo;
|
||||
import com.njcn.device.pq.pojo.bo.DeviceType;
|
||||
@@ -37,7 +38,9 @@ import com.njcn.device.pq.pojo.bo.excel.NodeExcel;
|
||||
import com.njcn.device.pq.pojo.bo.excel.OracleTerminalExcel;
|
||||
import com.njcn.device.pq.pojo.bo.excel.OverLimitExcel;
|
||||
import com.njcn.device.pq.pojo.bo.excel.TerminalBaseExcel;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionSubstationDTO;
|
||||
import com.njcn.device.pq.pojo.param.*;
|
||||
import com.njcn.device.pq.pojo.param.oracle.*;
|
||||
import com.njcn.device.pq.pojo.po.*;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import com.njcn.device.pq.service.*;
|
||||
@@ -52,18 +55,24 @@ import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.Area;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.web.utils.HttpServletUtil;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import com.njcn.web.utils.RestTemplateUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
@@ -82,37 +91,33 @@ import java.util.stream.Stream;
|
||||
public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> implements TerminalBaseService {
|
||||
|
||||
private final DeviceMapper deviceMapper;
|
||||
|
||||
private final SuperDataMapper superDataMapper;
|
||||
|
||||
private final IPqsTerminalLogsService iPqsTerminalLogsService;
|
||||
|
||||
private final LineMapper lineMapper;
|
||||
|
||||
private final DevFuctionMapper devFuctionMapper;
|
||||
|
||||
private final AreaFeignClient areaFeignClient;
|
||||
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
|
||||
private final SubstationMapper substationMapper;
|
||||
|
||||
private final VoltageMapper voltageMapper;
|
||||
|
||||
private final LineDetailMapper lineDetailMapper;
|
||||
|
||||
private final OverlimitMapper overlimitMapper;
|
||||
|
||||
private final DeptLineMapper deptLineMapper;
|
||||
|
||||
private final INodeService nodeService;
|
||||
|
||||
private final LineBakService lineBakService;
|
||||
|
||||
private final DeviceBakService deviceBakService;
|
||||
|
||||
private final FileStorageUtil fileStorageUtil;
|
||||
|
||||
|
||||
@Value("${oracle.isSync}")
|
||||
private Boolean isSync;
|
||||
|
||||
@Value("${oracle.syncLedgerLineUrl}")
|
||||
private String url;
|
||||
|
||||
|
||||
@Value("${oracle.syncLedgerUpdateLine}")
|
||||
private String updateUrl;
|
||||
|
||||
/**
|
||||
* 终端新增操作
|
||||
*
|
||||
@@ -498,6 +503,8 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean updateTerminal(UpdateTerminalParam updateTerminalParam) {
|
||||
String oldSubName="";
|
||||
String gbName="";
|
||||
LambdaQueryWrapper<Line> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
//项目
|
||||
if (Objects.nonNull(updateTerminalParam.getProjectUpdateParam())) {
|
||||
@@ -528,6 +535,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
//供电公司
|
||||
if (Objects.nonNull(updateTerminalParam.getGdInformationUpdateParam())) {
|
||||
Line gdRes = this.getById(updateTerminalParam.getGdInformationUpdateParam().getGdIndex());
|
||||
gbName=gdRes.getName();
|
||||
if (Objects.isNull(gdRes)) {
|
||||
throw new BusinessException(DeviceResponseEnum.GD_NO);
|
||||
}
|
||||
@@ -545,6 +553,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
if (Objects.isNull(subStationRes)) {
|
||||
throw new BusinessException(DeviceResponseEnum.SUB_NO);
|
||||
}
|
||||
oldSubName=subStationRes.getName();
|
||||
Line subStation = new Line();
|
||||
subStation.setId(updateTerminalParam.getSubStationUpdateParam().getSubIndex());
|
||||
subStation.setName(updateTerminalParam.getSubStationUpdateParam().getName());
|
||||
@@ -659,6 +668,8 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
for (SubVoltageParam updateSubVoltageParam : subVoltageBOList) {
|
||||
if (updateSubVoltageParam.getUpdateFlag() == 1) {
|
||||
Voltage voltageTem = voltageMapper.selectById(updateSubVoltageParam.getSubvIndex());
|
||||
Line byId = this.getById(updateSubVoltageParam.getSubvIndex());
|
||||
updateSubVoltageParam.setOldName(byId.getName());
|
||||
Line subVoltage = new Line();
|
||||
subVoltage.setId(updateSubVoltageParam.getSubvIndex());
|
||||
subVoltage.setName(updateSubVoltageParam.getName());
|
||||
@@ -783,6 +794,13 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isSync) {
|
||||
/***
|
||||
* oracle http远程调用接口
|
||||
*/
|
||||
SyncLedgerUpdate syncLedger = oracleSyncLedgerUpdate(updateTerminalParam,oldSubName,gbName);
|
||||
ResponseEntity<Map> userEntity = RestTemplateUtil.post(updateUrl, syncLedger, Map.class);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1501,6 +1519,11 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
return this.baseMapper.getVoltageIdByScale(voltageIds, scale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getSubIdByScale(List<String> subIds, String scale) {
|
||||
return this.baseMapper.getSubIdByScale(subIds, scale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getLineIdByLoadType(List<String> lineIds, String loadType) {
|
||||
return this.baseMapper.getLineIdByLoadType(lineIds, loadType);
|
||||
@@ -1696,7 +1719,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
throw new BusinessException(DeviceResponseEnum.LINE_NO);
|
||||
}
|
||||
String[] urls = new String[0];
|
||||
if(StrUtil.isNotBlank(lineDetailValid.getWiringDiagram())){
|
||||
if (StrUtil.isNotBlank(lineDetailValid.getWiringDiagram())) {
|
||||
urls = lineDetailValid.getWiringDiagram().split(StrUtil.COMMA);
|
||||
}
|
||||
|
||||
@@ -1850,12 +1873,11 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
}
|
||||
|
||||
|
||||
|
||||
//变电站 todo 可能新建电站
|
||||
if (Objects.nonNull(syncTerminalParam.getSubStationParam())) {
|
||||
if (StrUtil.isBlank(subIndex) && StrUtil.isNotBlank(gdIndex)) {
|
||||
Line substation = this.lambdaQuery().eq(Line::getName, syncTerminalParam.getSubStationParam().getName()).one();
|
||||
if(Objects.isNull(substation)){
|
||||
if (Objects.isNull(substation)) {
|
||||
Line subStation = assembleLine(syncTerminalParam.getSubStationParam().getName(), LineBaseEnum.SUB_LEVEL.getCode(), gdIndex, projectIndex + StrUtil.COMMA + provinceIndex + StrUtil.COMMA + gdIndex, syncTerminalParam.getSubStationParam().getSort());
|
||||
this.baseMapper.insert(subStation);
|
||||
subIndex = subStation.getId();
|
||||
@@ -1867,7 +1889,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
sub.setLng(syncTerminalParam.getSubStationParam().getLng());
|
||||
sub.setLat(syncTerminalParam.getSubStationParam().getLat());
|
||||
substationMapper.insert(sub);
|
||||
}else {
|
||||
} else {
|
||||
subIndex = substation.getId();
|
||||
|
||||
}
|
||||
@@ -1880,7 +1902,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
//查询该设备是否已经同步到表如何存在则之前同步监测点时同步过了,不用同步设备了,反之同步
|
||||
DeviceParam deviceParam = syncTerminalParam.getDeviceParam();
|
||||
Line deviceLine = this.baseMapper.selectById(syncTerminalParam.getDeviceParam().getDevIndex());
|
||||
if(Objects.isNull(deviceLine)){
|
||||
if (Objects.isNull(deviceLine)) {
|
||||
Line device = assembleLine(deviceParam.getName(), LineBaseEnum.DEVICE_LEVEL.getCode(), subIndex, projectIndex + StrUtil.COMMA + provinceIndex + StrUtil.COMMA + gdIndex + StrUtil.COMMA + subIndex, deviceParam.getSort());
|
||||
device.setId(deviceParam.getDevIndex());
|
||||
this.baseMapper.insert(device);
|
||||
@@ -1934,7 +1956,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
//同一变电站下只能有唯一母线名称
|
||||
Line SubVoltage = this.lambdaQuery().eq(Line::getName, subVoltageParam.getName()).like(Line::getPids, syncTerminalParam.getSubIndex()).one();
|
||||
|
||||
if(Objects.isNull(SubVoltage)){
|
||||
if (Objects.isNull(SubVoltage)) {
|
||||
//新建母线
|
||||
Line subVoltage = assembleLine(subVoltageParam.getName(), LineBaseEnum.SUB_V_LEVEL.getCode(), deviceParam.getDevIndex(), projectIndex + StrUtil.COMMA + provinceIndex + StrUtil.COMMA + gdIndex + StrUtil.COMMA + subIndex + StrUtil.COMMA + deviceParam.getDevIndex(), subVoltageParam.getSort());
|
||||
this.baseMapper.insert(subVoltage);
|
||||
@@ -1947,8 +1969,8 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
voltage.setScale(scaleRes.getId());
|
||||
voltage.setModel(subVoltageParam.getModel());
|
||||
voltageMapper.insert(voltage);
|
||||
}else {
|
||||
subvIndex=SubVoltage.getId();
|
||||
} else {
|
||||
subvIndex = SubVoltage.getId();
|
||||
}
|
||||
|
||||
//处理监测点
|
||||
@@ -2002,7 +2024,21 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
deptLine.setId(syncTerminalParam.getDeptId());
|
||||
deptLine.setLineId(line.getId());
|
||||
deptLineMapper.insert(deptLine);
|
||||
|
||||
if (isSync) {
|
||||
/***
|
||||
* oracle http远程调用接口
|
||||
*/
|
||||
SyncLedger syncLedger = oracleSyncLedger(syncTerminalParam);
|
||||
ResponseEntity<Map> userEntity = RestTemplateUtil.post(url, syncLedger, Map.class);
|
||||
if (HttpURLConnection.HTTP_OK == userEntity.getStatusCodeValue()) {
|
||||
//获取返回体
|
||||
Map body = userEntity.getBody();
|
||||
Integer oracleLineId = Integer.valueOf(body.get("oracleLineId").toString());
|
||||
Integer oracleDevId = Integer.valueOf(body.get("oracleDevId").toString());
|
||||
syncTerminalParam.setOracleLineId(oracleLineId);
|
||||
syncTerminalParam.setOracleDevId(oracleDevId);
|
||||
}
|
||||
}
|
||||
return subIndex;
|
||||
}
|
||||
|
||||
@@ -2010,16 +2046,16 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean terminalSyncRunFly(String lineId) {
|
||||
LineDTO lineDTO = this.baseMapper.selectLineDetail(lineId);
|
||||
if(ObjectUtil.isNotNull(lineDTO)){
|
||||
lineDetailMapper.update(null,new LambdaUpdateWrapper<LineDetail>()
|
||||
if (ObjectUtil.isNotNull(lineDTO)) {
|
||||
lineDetailMapper.update(null, new LambdaUpdateWrapper<LineDetail>()
|
||||
.set(LineDetail::getRunFlag, 0)
|
||||
.eq(LineDetail::getId, lineDTO.getLineId())
|
||||
);
|
||||
|
||||
deviceMapper.update(null,new LambdaUpdateWrapper<Device>()
|
||||
deviceMapper.update(null, new LambdaUpdateWrapper<Device>()
|
||||
.set(Device::getRunFlag, 0)
|
||||
.eq(Device::getId, lineDTO.getDevId())
|
||||
);
|
||||
);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -2028,7 +2064,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean terminalSyncDeleteFly(String lineId) {
|
||||
LineDTO lineDTO = this.baseMapper.selectLineDetail(lineId);
|
||||
if(ObjectUtil.isNotNull(lineDTO)){
|
||||
if (ObjectUtil.isNotNull(lineDTO)) {
|
||||
//删除监测点详细信息
|
||||
lineDetailMapper.updateLineRunFlag(lineDTO.getLineId(), RunFlagEnum.QUIT.getStatus());
|
||||
//todo 删除监测点信息
|
||||
@@ -2102,7 +2138,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
temp = assembleLine(substationName, LineBaseEnum.SUB_LEVEL.getCode(), pids.get(LineBaseEnum.GD_LEVEL.getCode()), pids);
|
||||
this.baseMapper.insert(temp);
|
||||
//处理电压等级字典表
|
||||
DictData substationScale = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_VOLTAGE_STAND.getName(),oracleTerminalExcel.getSubStationScale()).getData();
|
||||
DictData substationScale = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_VOLTAGE_STAND.getName(), oracleTerminalExcel.getSubStationScale()).getData();
|
||||
if (Objects.isNull(substationScale)) {
|
||||
//在电压等级内新增一条记录
|
||||
substationScale = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_VOLTAGE.getName(), oracleTerminalExcel.getSubStationScale()).getData();
|
||||
@@ -2140,7 +2176,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
|
||||
List<String> devIds = deviceBaks.stream().map(DeviceBak::getId).collect(Collectors.toList());
|
||||
List<Line> devList = new ArrayList<>();
|
||||
if(!CollectionUtil.isEmpty(devIds)){
|
||||
if (!CollectionUtil.isEmpty(devIds)) {
|
||||
LambdaQueryWrapper<Line> devLambda = new LambdaQueryWrapper<>();
|
||||
devLambda.in(Line::getId, devIds)
|
||||
.orderByAsc(Line::getCreateTime)
|
||||
@@ -2161,7 +2197,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
}
|
||||
}
|
||||
//处理终端厂家
|
||||
DictData manufacturer = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_MANUFACTURER.getName(),oracleTerminalExcel.getManufacturer()).getData();
|
||||
DictData manufacturer = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_MANUFACTURER.getName(), oracleTerminalExcel.getManufacturer()).getData();
|
||||
if (Objects.isNull(manufacturer)) {
|
||||
//在终端厂家字典内新增一条记录
|
||||
manufacturer = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_MANUFACTURER.getName(), oracleTerminalExcel.getManufacturer()).getData();
|
||||
@@ -2197,7 +2233,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
device.setFrontType(frontTypeDicData.getId());
|
||||
String devType = oracleDevType.replace("_" + frontType, "");
|
||||
//处理终端类型
|
||||
DictData devTypeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_TYPE.getName(),devType).getData();
|
||||
DictData devTypeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_TYPE.getName(), devType).getData();
|
||||
if (Objects.isNull(devTypeDicData)) {
|
||||
//在终端类型字典内新增一条记录
|
||||
devTypeDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_TYPE.getName(), devType).getData();
|
||||
@@ -2223,23 +2259,23 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
LambdaQueryWrapper<DeviceBak> deviceBakLambdaQueryWrapper1 = new LambdaQueryWrapper<>();
|
||||
deviceBakLambdaQueryWrapper1.in(DeviceBak::getId, ids);
|
||||
deviceBakService.remove(deviceBakLambdaQueryWrapper1);
|
||||
}else if(devList.size()==1){
|
||||
} else if (devList.size() == 1) {
|
||||
temp = lineMapper.selectById(devList.get(0).getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
//先查询终端id是否存在,存在则修改,不存在这添加
|
||||
//判断是否因为改了终端名称导致没有查到数据
|
||||
// LambdaQueryWrapper<DeviceBak> deviceBakLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
// deviceBakLambdaQueryWrapper.eq(DeviceBak::getDevId, temp.getId());
|
||||
// DeviceBak byId = deviceBakService.getById(deviceBakLambdaQueryWrapper);
|
||||
// if(Objects.isNull(byId)){
|
||||
//插入新旧终端ID中间表
|
||||
DeviceBak deviceBak = new DeviceBak();
|
||||
deviceBak.setId(temp.getId());
|
||||
deviceBak.setDevId(oracleTerminalExcel.getDeviceId());
|
||||
deviceBakService.saveOrUpdate(deviceBak);
|
||||
//插入新旧终端ID中间表
|
||||
DeviceBak deviceBak = new DeviceBak();
|
||||
deviceBak.setId(temp.getId());
|
||||
deviceBak.setDevId(oracleTerminalExcel.getDeviceId());
|
||||
deviceBakService.saveOrUpdate(deviceBak);
|
||||
// }else{
|
||||
// if(!byId.getDevId().equals(oracleTerminalExcel.getDeviceId())){
|
||||
// oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "终端关系,数据存入Oracle和excl不一样:" + oracleTerminalExcel.getLineNum() + "需要排查"));
|
||||
@@ -2258,7 +2294,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
}
|
||||
}
|
||||
//处理终端厂家
|
||||
DictData manufacturer = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_MANUFACTURER.getName(),oracleTerminalExcel.getManufacturer()).getData();
|
||||
DictData manufacturer = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_MANUFACTURER.getName(), oracleTerminalExcel.getManufacturer()).getData();
|
||||
if (Objects.isNull(manufacturer)) {
|
||||
//在终端厂家字典内新增一条记录
|
||||
manufacturer = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_MANUFACTURER.getName(), oracleTerminalExcel.getManufacturer()).getData();
|
||||
@@ -2294,7 +2330,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
device.setFrontType(frontTypeDicData.getId());
|
||||
String devType = oracleDevType.replace("_" + frontType, "");
|
||||
//处理终端类型
|
||||
DictData devTypeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_TYPE.getName(),devType).getData();
|
||||
DictData devTypeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_TYPE.getName(), devType).getData();
|
||||
if (Objects.isNull(devTypeDicData)) {
|
||||
//在终端类型字典内新增一条记录
|
||||
devTypeDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_TYPE.getName(), devType).getData();
|
||||
@@ -2332,7 +2368,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
voltage.setId(temp.getId());
|
||||
voltage.setModel(oracleTerminalExcel.getSubvModel());
|
||||
//处理电压等级字典表
|
||||
DictData subvScale = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_VOLTAGE_STAND.getName(),oracleTerminalExcel.getSubvScale()).getData();
|
||||
DictData subvScale = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_VOLTAGE_STAND.getName(), oracleTerminalExcel.getSubvScale()).getData();
|
||||
if (Objects.isNull(subvScale)) {
|
||||
//在电压等级内新增一条记录
|
||||
subvScale = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_VOLTAGE.getName(), oracleTerminalExcel.getSubvScale()).getData();
|
||||
@@ -2387,14 +2423,14 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
// }
|
||||
lineDetail.setNum(oracleTerminalExcel.getLineNum());
|
||||
//干扰源类型
|
||||
DictData loadTypeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.INTERFERENCE_SOURCE_TYPE.getName(),oracleTerminalExcel.getLoadType()).getData();
|
||||
DictData loadTypeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.INTERFERENCE_SOURCE_TYPE.getName(), oracleTerminalExcel.getLoadType()).getData();
|
||||
if (Objects.isNull(loadTypeDicData)) {
|
||||
//在电压等级内新增一条记录
|
||||
loadTypeDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.INTERFERENCE_SOURCE_TYPE.getName(), oracleTerminalExcel.getLoadType()).getData();
|
||||
}
|
||||
lineDetail.setLoadType(loadTypeDicData.getId());
|
||||
//行业类型
|
||||
DictData businessDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.BUSINESS_TYPE.getName(),oracleTerminalExcel.getBusinessType()).getData();
|
||||
DictData businessDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.BUSINESS_TYPE.getName(), oracleTerminalExcel.getBusinessType()).getData();
|
||||
if (Objects.isNull(businessDicData)) {
|
||||
//在电压等级内新增一条记录
|
||||
businessDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.BUSINESS_TYPE.getName(), oracleTerminalExcel.getBusinessType()).getData();
|
||||
@@ -2407,7 +2443,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
}
|
||||
//终端等级,为空不处理,可以为空
|
||||
if (StringUtils.isNotBlank(oracleTerminalExcel.getLineGrade())) {
|
||||
DictData lineGradeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_LEVEL.getName(),oracleTerminalExcel.getLineGrade()).getData();
|
||||
DictData lineGradeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_LEVEL.getName(), oracleTerminalExcel.getLineGrade()).getData();
|
||||
if (Objects.isNull(lineGradeDicData)) {
|
||||
//在电压等级内新增一条记录
|
||||
lineGradeDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_LEVEL.getName(), oracleTerminalExcel.getLineGrade()).getData();
|
||||
@@ -2422,7 +2458,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
List<LineBak> lineBaks = lineBakService.list(lineBakLambdaQueryWrapper);
|
||||
List<String> lineIds = lineBaks.stream().map(LineBak::getId).collect(Collectors.toList());
|
||||
List<Line> lineList = new ArrayList<>();
|
||||
if(CollectionUtil.isNotEmpty(lineIds)){
|
||||
if (CollectionUtil.isNotEmpty(lineIds)) {
|
||||
LambdaQueryWrapper<Line> devLambda = new LambdaQueryWrapper<>();
|
||||
devLambda.in(Line::getId, lineIds)
|
||||
.orderByAsc(Line::getCreateTime)
|
||||
@@ -2458,14 +2494,14 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
// }
|
||||
lineDetail.setNum(oracleTerminalExcel.getLineNum());
|
||||
//干扰源类型
|
||||
DictData loadTypeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.INTERFERENCE_SOURCE_TYPE.getName(),oracleTerminalExcel.getLoadType()).getData();
|
||||
DictData loadTypeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.INTERFERENCE_SOURCE_TYPE.getName(), oracleTerminalExcel.getLoadType()).getData();
|
||||
if (Objects.isNull(loadTypeDicData)) {
|
||||
//在电压等级内新增一条记录
|
||||
loadTypeDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.INTERFERENCE_SOURCE_TYPE.getName(), oracleTerminalExcel.getLoadType()).getData();
|
||||
}
|
||||
lineDetail.setLoadType(loadTypeDicData.getId());
|
||||
//行业类型
|
||||
DictData businessDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.BUSINESS_TYPE.getName(),oracleTerminalExcel.getBusinessType()).getData();
|
||||
DictData businessDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.BUSINESS_TYPE.getName(), oracleTerminalExcel.getBusinessType()).getData();
|
||||
if (Objects.isNull(businessDicData)) {
|
||||
//在电压等级内新增一条记录
|
||||
businessDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.BUSINESS_TYPE.getName(), oracleTerminalExcel.getBusinessType()).getData();
|
||||
@@ -2478,7 +2514,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
}
|
||||
//终端等级,为空不处理,可以为空
|
||||
if (StringUtils.isNotBlank(oracleTerminalExcel.getLineGrade())) {
|
||||
DictData lineGradeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_LEVEL.getName(),oracleTerminalExcel.getLineGrade()).getData();
|
||||
DictData lineGradeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_LEVEL.getName(), oracleTerminalExcel.getLineGrade()).getData();
|
||||
if (Objects.isNull(lineGradeDicData)) {
|
||||
//在电压等级内新增一条记录
|
||||
lineGradeDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_LEVEL.getName(), oracleTerminalExcel.getLineGrade()).getData();
|
||||
@@ -3048,4 +3084,323 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
BeanUtils.copyProperties(substation, subStationVO);
|
||||
terminalVO.setSubStationVO(subStationVO);
|
||||
}
|
||||
|
||||
private SyncLedgerUpdate oracleSyncLedgerUpdate(UpdateTerminalParam param,String oldSubName,String gdName) {
|
||||
SyncLedgerUpdate update=new SyncLedgerUpdate();
|
||||
/**
|
||||
* 先更新变电站信息,然后根据变电站信息查询终端信息
|
||||
*/
|
||||
//变电站信息
|
||||
SubStationParam.SubStationUpdateParam sub = param.getSubStationUpdateParam();
|
||||
List<DeviceParam> deviceUpdateParamList = param.getDeviceUpdateParamList();
|
||||
PqSubstation substation=new PqSubstation();
|
||||
if (ObjectUtil.isNull(sub)) {
|
||||
//因为查出来的数据电压等级是转换过的所有不需要替换
|
||||
Line byId = this.getById(deviceUpdateParamList.get(0).getDevIndex());
|
||||
PollutionSubstationDTO substationInfo = lineMapper.getSubstationInfo(byId.getPid());
|
||||
sub=new SubStationParam.SubStationUpdateParam();
|
||||
sub.setName(substationInfo.getName());
|
||||
oldSubName=substationInfo.getName();
|
||||
sub.setLng(substationInfo.getLng());
|
||||
sub.setLat(substationInfo.getLat());
|
||||
substation.setScale(sub.getScale());
|
||||
}else{
|
||||
substation.setScale(dictName(sub.getScale()));
|
||||
}
|
||||
substation.setName(sub.getName());
|
||||
substation.setOldName(oldSubName);
|
||||
substation.setGdName(gdName);
|
||||
update.setPqSubstation(substation);
|
||||
PqsMap pqsMap=new PqsMap();
|
||||
pqsMap.setLongitude(sub.getLng().doubleValue());
|
||||
pqsMap.setLatitude(sub.getLat().doubleValue());
|
||||
update.setPqsMap(pqsMap);
|
||||
|
||||
//修改终端信息
|
||||
List<PqDevice> deviceList=new ArrayList<>();
|
||||
List<PqDevicedetail> deviceDetailList=new ArrayList<>();
|
||||
List<PqLinedetail> lineDeatailList=new ArrayList<>();
|
||||
|
||||
List<String> devMysqlIds = deviceUpdateParamList.stream().map(DeviceParam::getDevIndex).collect(Collectors.toList());
|
||||
List<DeviceBak> deviceBaks = deviceBakService.listByIds(devMysqlIds);
|
||||
Map<String, Integer> deviceBakMap = deviceBaks.stream().collect(Collectors.toMap(DeviceBak::getId, DeviceBak::getDevId));
|
||||
|
||||
|
||||
for (DeviceParam device : deviceUpdateParamList) {
|
||||
String devIndex = device.getDevIndex();
|
||||
if(deviceBakMap.containsKey(devIndex)){
|
||||
Integer devOracleId = deviceBakMap.get(devIndex);
|
||||
//终端
|
||||
PqDevice pqDevice=new PqDevice();
|
||||
pqDevice.setDevIndex(devOracleId);
|
||||
pqDevice.setName(device.getName());
|
||||
pqDevice.setStatus(1);
|
||||
pqDevice.setDevtype(dictName(device.getDevType()));
|
||||
pqDevice.setLogontime(device.getLoginTime());
|
||||
pqDevice.setUpdatetime(device.getLoginTime());
|
||||
Node node = nodeService.getNodeById(device.getNodeId());
|
||||
if (ObjectUtil.isNotNull(node)) {
|
||||
pqDevice.setNodeName(node.getName());
|
||||
}
|
||||
pqDevice.setPortid(device.getPort());
|
||||
pqDevice.setDevflag(0);
|
||||
pqDevice.setDevSeries(device.getSeries());
|
||||
pqDevice.setDevKey(device.getDevKey());
|
||||
pqDevice.setIp(device.getIp());
|
||||
pqDevice.setDevmodel(device.getDevModel());
|
||||
pqDevice.setCallflag(device.getCallFlag());
|
||||
pqDevice.setDatatype(device.getDevDataType());
|
||||
|
||||
//终端详细信息
|
||||
PqDevicedetail pqDevicedetail = new PqDevicedetail();
|
||||
pqDevicedetail.setDevIndex(devOracleId);
|
||||
pqDevicedetail.setManufacturer(dictName(device.getManufacturer()));
|
||||
pqDevicedetail.setThistimecheck(device.getThisTimeCheck());
|
||||
pqDevicedetail.setNexttimecheck(device.getNextTimeCheck());
|
||||
pqDevicedetail.setElectroplate(device.getElectroplate());
|
||||
pqDevicedetail.setContract(device.getContract());
|
||||
pqDevicedetail.setSim(device.getSim());
|
||||
pqDevicedetail.setDevCatena(device.getDevSeries());
|
||||
pqDevicedetail.setDevLocation(device.getDevLocation());
|
||||
pqDevicedetail.setDevNo(device.getDevNo());
|
||||
pqDevicedetail.setIsAlarm(device.getIsAlarm());
|
||||
deviceDetailList.add(pqDevicedetail);
|
||||
|
||||
//处理母线信息
|
||||
List<PqSubvoltage> pqSubVoltages=new ArrayList<>();
|
||||
for (SubVoltageParam subVoltage : device.getSubVoltageParam()) {
|
||||
//母线
|
||||
PqSubvoltage pqSubvoltage = new PqSubvoltage();
|
||||
pqSubvoltage.setName(subVoltage.getName());
|
||||
pqSubvoltage.setOldName(subVoltage.getOldName());
|
||||
pqSubvoltage.setSubvNum(subVoltage.getNum());
|
||||
pqSubvoltage.setScale(dictName(subVoltage.getScale()));
|
||||
pqSubvoltage.setSubvmodel(subVoltage.getModel());
|
||||
pqSubVoltages.add(pqSubvoltage);
|
||||
//监测点
|
||||
List<PqLine> pqLines=new ArrayList<>();
|
||||
for (LineParam line : subVoltage.getLineParam()) {
|
||||
LineBak byId = lineBakService.getById(line.getLineIndex());
|
||||
if(ObjectUtil.isNotNull(byId)){
|
||||
//监测点
|
||||
PqLine pqLine = new PqLine();
|
||||
pqLine.setLineIndex(byId.getLineId());
|
||||
pqLine.setName(line.getName());
|
||||
pqLine.setPt1(line.getPt1().doubleValue());
|
||||
pqLine.setPt2(line.getPt2().doubleValue());
|
||||
pqLine.setCt1(line.getCt1().doubleValue());
|
||||
pqLine.setCt2(line.getCt2().doubleValue());
|
||||
pqLine.setDevcmp(line.getDevCapacity().doubleValue());
|
||||
pqLine.setDlcmp(line.getShortCapacity().doubleValue());
|
||||
pqLine.setJzcmp(line.getStandardCapacity().doubleValue());
|
||||
pqLine.setXycmp(line.getDealCapacity().doubleValue());
|
||||
pqLine.setScale(dictName(subVoltage.getScale()));
|
||||
pqLine.setStatus(1);
|
||||
pqLines.add(pqLine);
|
||||
|
||||
PqLinedetail pqLinedetail = new PqLinedetail();
|
||||
pqLinedetail.setLineIndex(byId.getLineId());
|
||||
pqLinedetail.setLineName(line.getName());
|
||||
pqLinedetail.setPttype(line.getPtType());
|
||||
pqLinedetail.setLastTime(device.getLoginTime());
|
||||
pqLinedetail.setTinterval(line.getTimeInterval());
|
||||
pqLinedetail.setLoadtype(dictName(line.getLoadType()));
|
||||
pqLinedetail.setBusinesstype(dictName(line.getBusinessType()));
|
||||
pqLinedetail.setRemark(line.getRemark());
|
||||
pqLinedetail.setMonitorId(line.getMonitorId());
|
||||
pqLinedetail.setPowerid(line.getPowerFlag());
|
||||
pqLinedetail.setObjname(line.getObjName());
|
||||
pqLinedetail.setStatflag(line.getStatFlag());
|
||||
pqLinedetail.setPowerSubstationName(line.getPowerSubstationName());
|
||||
pqLinedetail.setHangLine(line.getHangLine());
|
||||
pqLinedetail.setOwner(line.getOwner());
|
||||
pqLinedetail.setOwnerDuty(line.getOwnerDuty());
|
||||
pqLinedetail.setOwnerTel(line.getOwnerTel());
|
||||
pqLinedetail.setSuperiorsSubstation(line.getSuperiorsSubstation());
|
||||
pqLinedetail.setClassificationGrade(line.getCalssificationGrade());
|
||||
pqLinedetail.setIsGridPoint(1);
|
||||
lineDeatailList.add(pqLinedetail);
|
||||
}
|
||||
}
|
||||
pqSubvoltage.setPqLine(pqLines);
|
||||
|
||||
}
|
||||
pqDevice.setPqSubvoltage(pqSubVoltages);
|
||||
deviceList.add(pqDevice);
|
||||
}
|
||||
|
||||
}
|
||||
update.setPqDevice(deviceList);
|
||||
update.setPqDevicedetail(deviceDetailList);
|
||||
update.setPqLinedetail(lineDeatailList);
|
||||
return update;
|
||||
}
|
||||
/**
|
||||
* oracle远程台账同步
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
private SyncLedger oracleSyncLedger(SyncTerminalParam param) {
|
||||
SyncLedger ledger = new SyncLedger();
|
||||
List<Line> data = lineMapper.selectList(new LambdaQueryWrapper<Line>()
|
||||
.eq(Line::getState, DataStateEnum.ENABLE.getCode())
|
||||
.in(Line::getId, Arrays.asList(param.getProjectIndex(),
|
||||
param.getProvinceIndex(),
|
||||
param.getGdIndex()))
|
||||
);
|
||||
|
||||
//项目信息表
|
||||
PqProject pqProject = new PqProject();
|
||||
List<Line> project = data.stream().filter(x -> x.getId().equals(param.getProjectIndex())).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(project)) {
|
||||
pqProject.setName(project.get(0).getName());
|
||||
} else {
|
||||
throw new BusinessException(PvDeviceResponseEnum.PROJECT_OR_NOT);
|
||||
}
|
||||
ledger.setPqProject(pqProject);
|
||||
|
||||
|
||||
//省级项目表
|
||||
PqProvince pqProvince = new PqProvince();
|
||||
List<Line> province = data.stream().filter(x -> x.getId().equals(param.getProvinceIndex())).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(province)) {
|
||||
Area area = areaFeignClient.selectIdArea(province.get(0).getName()).getData();
|
||||
pqProvince.setName(area.getName());
|
||||
} else {
|
||||
throw new BusinessException(PvDeviceResponseEnum.PROVINCE_OR_NOT);
|
||||
}
|
||||
ledger.setPqProvince(pqProvince);
|
||||
|
||||
//供电公司表
|
||||
PqGdinformation pqGdinformation = new PqGdinformation();
|
||||
List<Line> gd = data.stream().filter(x -> x.getId().equals(param.getGdIndex())).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(gd)) {
|
||||
pqGdinformation.setName(gd.get(0).getName());
|
||||
} else {
|
||||
throw new BusinessException(PvDeviceResponseEnum.GD_OR_NOT);
|
||||
}
|
||||
ledger.setPqGdinformation(pqGdinformation);
|
||||
|
||||
//变电站
|
||||
PqSubstation pqSubstation = new PqSubstation();
|
||||
SubStationParam subStation = param.getSubStationParam();
|
||||
if (ObjectUtil.isNull(subStation)) {
|
||||
//因为查出来的数据电压等级是转换过的所有不需要替换
|
||||
PollutionSubstationDTO sub = lineMapper.getSubstationInfo(param.getSubIndex());
|
||||
subStation = new SubStationParam();
|
||||
subStation.setName(sub.getName());
|
||||
subStation.setScale(sub.getVoltageLevel());
|
||||
subStation.setLng(sub.getLng());
|
||||
subStation.setLat(sub.getLat());
|
||||
}
|
||||
pqSubstation.setName(subStation.getName());
|
||||
pqSubstation.setScale(subStation.getScale());
|
||||
ledger.setPqSubstation(pqSubstation);
|
||||
PqsMap pqsMap = new PqsMap();
|
||||
pqsMap.setLongitude(subStation.getLng().doubleValue());
|
||||
pqsMap.setLatitude(subStation.getLat().doubleValue());
|
||||
pqsMap.setState(1);
|
||||
ledger.setPqsMap(pqsMap);
|
||||
|
||||
//终端
|
||||
PqDevice pqDevice = new PqDevice();
|
||||
DeviceParam device = param.getDeviceParam();
|
||||
pqDevice.setName(device.getName());
|
||||
pqDevice.setStatus(1);
|
||||
pqDevice.setDevtype(dictName(device.getDevType()));
|
||||
pqDevice.setLogontime(device.getLoginTime());
|
||||
pqDevice.setUpdatetime(device.getLoginTime());
|
||||
Node node = nodeService.getNodeById(device.getNodeId());
|
||||
if (ObjectUtil.isNotNull(node)) {
|
||||
pqDevice.setNodeName(node.getName());
|
||||
}
|
||||
pqDevice.setPortid(device.getPort());
|
||||
pqDevice.setDevflag(0);
|
||||
pqDevice.setDevSeries(device.getSeries());
|
||||
pqDevice.setDevKey(device.getDevKey());
|
||||
pqDevice.setIp(device.getIp());
|
||||
pqDevice.setDevmodel(device.getDevModel());
|
||||
pqDevice.setCallflag(device.getCallFlag());
|
||||
pqDevice.setDatatype(device.getDevDataType());
|
||||
ledger.setPqDevice(pqDevice);
|
||||
|
||||
PqDevicedetail pqDevicedetail = new PqDevicedetail();
|
||||
pqDevicedetail.setManufacturer(dictName(device.getManufacturer()));
|
||||
pqDevicedetail.setThistimecheck(device.getThisTimeCheck());
|
||||
pqDevicedetail.setNexttimecheck(device.getNextTimeCheck());
|
||||
pqDevicedetail.setElectroplate(device.getElectroplate());
|
||||
pqDevicedetail.setContract(device.getContract());
|
||||
pqDevicedetail.setSim(device.getSim());
|
||||
pqDevicedetail.setDevCatena(device.getDevSeries());
|
||||
pqDevicedetail.setDevLocation(device.getDevLocation());
|
||||
pqDevicedetail.setDevNo(device.getDevNo());
|
||||
pqDevicedetail.setIsAlarm(device.getIsAlarm());
|
||||
// pqDevicedetail.setOnlineratetj();
|
||||
// pqDevicedetail.setDataplan();
|
||||
// pqDevicedetail.setNewtraffic();
|
||||
// pqDevicedetail.setOntime();
|
||||
// pqDevicedetail.setCheckflag();
|
||||
ledger.setPqDevicedetail(pqDevicedetail);
|
||||
|
||||
//母线
|
||||
PqSubvoltage pqSubvoltage = new PqSubvoltage();
|
||||
SubVoltageParam subVoltage = param.getSubVoltageParam();
|
||||
pqSubvoltage.setName(subVoltage.getName());
|
||||
pqSubvoltage.setSubvNum(subVoltage.getNum());
|
||||
pqSubvoltage.setScale(dictName(subVoltage.getScale()));
|
||||
pqSubvoltage.setSubvmodel(subVoltage.getModel());
|
||||
ledger.setPqSubvoltage(pqSubvoltage);
|
||||
|
||||
//监测点
|
||||
PqLine pqLine = new PqLine();
|
||||
LineParam line = param.getLineParam();
|
||||
pqLine.setName(line.getName());
|
||||
pqLine.setPt1(line.getPt1().doubleValue());
|
||||
pqLine.setPt2(line.getPt2().doubleValue());
|
||||
pqLine.setCt1(line.getCt1().doubleValue());
|
||||
pqLine.setCt2(line.getCt2().doubleValue());
|
||||
pqLine.setDevcmp(line.getDevCapacity().doubleValue());
|
||||
pqLine.setDlcmp(line.getShortCapacity().doubleValue());
|
||||
pqLine.setJzcmp(line.getStandardCapacity().doubleValue());
|
||||
pqLine.setXycmp(line.getDealCapacity().doubleValue());
|
||||
pqLine.setScale(dictName(subVoltage.getScale()));
|
||||
pqLine.setStatus(1);
|
||||
ledger.setPqLine(pqLine);
|
||||
PqLinedetail pqLinedetail = new PqLinedetail();
|
||||
pqLinedetail.setLineName(line.getName());
|
||||
pqLinedetail.setPttype(line.getPtType());
|
||||
pqLinedetail.setLastTime(device.getLoginTime());
|
||||
pqLinedetail.setTinterval(line.getTimeInterval());
|
||||
pqLinedetail.setLoadtype(dictName(line.getLoadType()));
|
||||
pqLinedetail.setBusinesstype(dictName(line.getBusinessType()));
|
||||
pqLinedetail.setRemark(line.getRemark());
|
||||
pqLinedetail.setMonitorId(line.getMonitorId());
|
||||
pqLinedetail.setPowerid(line.getPowerFlag());
|
||||
pqLinedetail.setObjname(line.getObjName());
|
||||
pqLinedetail.setStatflag(line.getStatFlag());
|
||||
pqLinedetail.setPowerSubstationName(line.getPowerSubstationName());
|
||||
pqLinedetail.setHangLine(line.getHangLine());
|
||||
pqLinedetail.setOwner(line.getOwner());
|
||||
pqLinedetail.setOwnerDuty(line.getOwnerDuty());
|
||||
pqLinedetail.setOwnerTel(line.getOwnerTel());
|
||||
pqLinedetail.setSuperiorsSubstation(line.getSuperiorsSubstation());
|
||||
pqLinedetail.setClassificationGrade(line.getCalssificationGrade());
|
||||
pqLinedetail.setIsGridPoint(1);
|
||||
// pqLinedetail.setLineGrade();
|
||||
// pqLinedetail.setWiringDiagram();
|
||||
ledger.setPqLinedetail(pqLinedetail);
|
||||
ledger.setLineNum(line.getNum());
|
||||
return ledger;
|
||||
}
|
||||
|
||||
private String dictName(String dicId) {
|
||||
try {
|
||||
DictData data = dicDataFeignClient.getDicDataById(dicId).getData();
|
||||
return data.getName();
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException("字典转换异常");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user