diff --git a/pqs-device/common-device-biz/src/main/java/com/njcn/device/biz/pojo/po/DeviceBak.java b/pqs-device/common-device-biz/src/main/java/com/njcn/device/biz/pojo/po/DeviceBak.java index e90c141a7..e8c7de7c0 100644 --- a/pqs-device/common-device-biz/src/main/java/com/njcn/device/biz/pojo/po/DeviceBak.java +++ b/pqs-device/common-device-biz/src/main/java/com/njcn/device/biz/pojo/po/DeviceBak.java @@ -1,5 +1,6 @@ package com.njcn.device.biz.pojo.po; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; @@ -14,6 +15,7 @@ public class DeviceBak { /** * 终端Id */ + @TableId("Id") private String id; diff --git a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/api/NodeClient.java b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/api/NodeClient.java index 052b99035..a897db664 100644 --- a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/api/NodeClient.java +++ b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/api/NodeClient.java @@ -4,10 +4,12 @@ import com.njcn.common.pojo.constant.ServerInfo; import com.njcn.common.pojo.response.HttpResult; import com.njcn.device.pq.api.fallback.PqsTerminalLogsClientFallbackFactory; import com.njcn.device.pq.pojo.po.Node; -import io.swagger.annotations.ApiOperation; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import javax.validation.constraints.NotNull; import java.util.List; /** @@ -19,8 +21,18 @@ import java.util.List; public interface NodeClient { - @ApiOperation("获取全部前置机") + /** + * 获取全部前置机 + * @return + */ @GetMapping("/nodeAllList") HttpResult> nodeAllList(); + /** + * 根据id获取前置机 + * @param id + * @return + */ + @GetMapping("/getNodeById") + HttpResult getNodeById(@Validated @NotNull(message = "id不可为空") @RequestParam("id")String id); } diff --git a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/api/fallback/NodeClientFallbackFactory.java b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/api/fallback/NodeClientFallbackFactory.java index a8ec10467..a64068d68 100644 --- a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/api/fallback/NodeClientFallbackFactory.java +++ b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/api/fallback/NodeClientFallbackFactory.java @@ -39,6 +39,12 @@ public class NodeClientFallbackFactory implements FallbackFactory { log.error("{}异常,降级处理,异常为:{}", "获取全部前置机", throwable.toString()); throw new BusinessException(finalExceptionEnum); } + + @Override + public HttpResult getNodeById(String id) { + log.error("{}异常,降级处理,异常为:{}", "根据id获取前置机", throwable.toString()); + throw new BusinessException(finalExceptionEnum); + } }; diff --git a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/dto/PollutionSubstationDTO.java b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/dto/PollutionSubstationDTO.java index 71a16a3df..ca4d75bf8 100644 --- a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/dto/PollutionSubstationDTO.java +++ b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/dto/PollutionSubstationDTO.java @@ -3,6 +3,8 @@ package com.njcn.device.pq.pojo.dto; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.math.BigDecimal; + /** * 类的介绍: * @@ -24,6 +26,12 @@ public class PollutionSubstationDTO { @ApiModelProperty("电压等级") private String voltageLevel; + @ApiModelProperty(name ="lng",value = "变电站经度") + private BigDecimal lng; + + @ApiModelProperty(name ="lat",value = "变电站纬度") + private BigDecimal lat; + @ApiModelProperty("数据") private Double data = 3.14159; diff --git a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/param/SyncTerminalParam.java b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/param/SyncTerminalParam.java index 39b6e9899..773f6c534 100644 --- a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/param/SyncTerminalParam.java +++ b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/param/SyncTerminalParam.java @@ -56,4 +56,9 @@ public class SyncTerminalParam { @ApiModelProperty(name = "lineParam",value = "监测点信息") private LineParam lineParam; + @ApiModelProperty(name = "oracleLineId",value = "oracle监测点id") + private Integer oracleLineId; + + @ApiModelProperty(name = "oracleDevId",value = "oracle终端id") + private Integer oracleDevId; } diff --git a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/po/LineDataIntegrity.java b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/po/LineDataIntegrity.java index 0ea1fe51f..7a4ad709c 100644 --- a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/po/LineDataIntegrity.java +++ b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/po/LineDataIntegrity.java @@ -41,4 +41,11 @@ public class LineDataIntegrity implements Serializable { */ private Double integrityData; + + private Double mysqlReal; + + public void setMysqlReal(Double mysqlReal) { + this.real = mysqlReal; + this.mysqlReal = mysqlReal; + } } diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/NodeController.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/NodeController.java index 220ef561e..f8fca696d 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/NodeController.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/NodeController.java @@ -140,7 +140,7 @@ public class NodeController extends BaseController { */ @ApiOperation("获取全部前置机") @OperateInfo(info = LogEnum.BUSINESS_MEDIUM) - @GetMapping("nodeAllList") + @GetMapping("/nodeAllList") public HttpResult> nodeAllList(){ String methodDescribe = getMethodDescribe("nodeAllList"); List resList = iNodeService.nodeAllList(); @@ -155,15 +155,11 @@ public class NodeController extends BaseController { @ApiOperation("根据id获取前置机") @ApiImplicitParam(value = "前置机id",name = "id",required = true) @OperateInfo(info = LogEnum.BUSINESS_MEDIUM) - @GetMapping("getNodeById") + @GetMapping("/getNodeById") public HttpResult getNodeById(@Validated @NotNull(message = "id不可为空") @RequestParam("id")String id){ String methodDescribe = getMethodDescribe("getNodeById"); Node node = iNodeService.getNodeById(id); - if(Objects.isNull(node)){ - throw new BusinessException(CommonResponseEnum.FAIL); - }else { - return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, node, methodDescribe); - } + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, node, methodDescribe); } diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineIntegrityDataMapper.xml b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineIntegrityDataMapper.xml index 5b5f8f970..948bf3872 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineIntegrityDataMapper.xml +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineIntegrityDataMapper.xml @@ -71,7 +71,7 @@ line.pid as 'pid', line.Pids as 'pids', line.Name AS 'name', - line.Levelas 'Level', + line.Level as 'Level', pd.Update_Time AS 'updateTime', line.Sort as 'sort', pd.Com_Flag as 'ComFlag', diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineMapper.xml b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineMapper.xml index 037251a46..51c3a7ff4 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineMapper.xml +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineMapper.xml @@ -650,7 +650,9 @@ select line_index lineId, avg(real_time/due_time)*100 integrityData, - sum(real_time) real, + sum(real_time) mysqlReal, sum(due_time) due from r_stat_integrity_d where line_index in diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/TerminalBaseServiceImpl.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/TerminalBaseServiceImpl.java index 62061186d..93f3429c2 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/TerminalBaseServiceImpl.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/TerminalBaseServiceImpl.java @@ -1898,8 +1898,14 @@ public class TerminalBaseServiceImpl extends ServiceImpl imple deviceDetail.setLoginTime(PubUtils.localDateFormat(deviceParam.getLoginTime())); deviceDetail.setUpdateTime(LocalDateTime.now()); + //处理终端oracle关系 + if (ObjectUtil.isNotNull(syncTerminalParam.getOracleDevId())) { + DeviceBak back = new DeviceBak(); + back.setId(deviceDetail.getId()); + back.setDevId(syncTerminalParam.getOracleDevId()); + deviceBakService.saveOrUpdate(back); + } //处理装置识别码秘钥 - deviceMapper.insert(deviceDetail); //装置功能 todo确定devFuction // List funList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.DEV_FUN.getName()).getData(); @@ -1963,7 +1969,13 @@ public class TerminalBaseServiceImpl extends ServiceImpl imple } lineDetailMapper.insert(lineDetail); - + //处理终端oracle关系 + if (ObjectUtil.isNotNull(syncTerminalParam.getOracleLineId())) { + LineBak back = new LineBak(); + back.setId(lineDetail.getId()); + back.setLineId(syncTerminalParam.getOracleLineId()); + lineBakService.saveOrUpdate(back); + } //通过监测点id获取母线电压等级 Voltage voltage = lineMapper.getVoltageByLineId(line.getId()); //监测点限值 diff --git a/pqs-prepare/prepare-api/src/main/java/com/njcn/prepare/harmonic/pojo/mysql/po/line/AlarmPO.java b/pqs-prepare/prepare-api/src/main/java/com/njcn/prepare/harmonic/pojo/mysql/po/line/AlarmPO.java index 3121f5d7d..9d40dc5b9 100644 --- a/pqs-prepare/prepare-api/src/main/java/com/njcn/prepare/harmonic/pojo/mysql/po/line/AlarmPO.java +++ b/pqs-prepare/prepare-api/src/main/java/com/njcn/prepare/harmonic/pojo/mysql/po/line/AlarmPO.java @@ -90,5 +90,10 @@ public class AlarmPO implements Serializable { private float onlineRate; + private Integer mysqlReal; + public void setMysqlReal(Integer mysqlReal) { + this.real = mysqlReal; + this.mysqlReal = mysqlReal; + } } diff --git a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/mapper/mysql/device/mapping/DeviceAbnormaStatisticsMapper.xml b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/mapper/mysql/device/mapping/DeviceAbnormaStatisticsMapper.xml index 5b443d9a9..2ba018537 100644 --- a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/mapper/mysql/device/mapping/DeviceAbnormaStatisticsMapper.xml +++ b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/mapper/mysql/device/mapping/DeviceAbnormaStatisticsMapper.xml @@ -82,7 +82,7 @@ SELECT device.id AS deviceId, IFNULL(SUM(integrity.due_time),3.14159) AS due, - IFNULL(SUM(integrity.real_time),0) AS real, + IFNULL(SUM(integrity.real_time),0) AS mysqlReal, CONVERT(SUM(integrity.real_time)*100/SUM(integrity.due_time),DECIMAL(15,2)) AS integrity FROM r_stat_integrity_d integrity INNER JOIN pq_line line ON integrity.line_index = line.id diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/enums/SupervisionResponseEnum.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/enums/SupervisionResponseEnum.java index e584a1e29..13a36a908 100644 --- a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/enums/SupervisionResponseEnum.java +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/enums/SupervisionResponseEnum.java @@ -27,6 +27,9 @@ public enum SupervisionResponseEnum { DELETE_TO_BE_SUBMITTED("A00550","流程删除失败,只有待提交信息可删除!"), EXISTENCE_OR_NOT("A00550","信息查询为空,请检查信息是否存在!"), NAME_EXISTS("A00550","名称重复"), + PROJECT_OR_NOT("A00550","项目名称为空,请检查信息是否存在!"), + PROVINCE_OR_NOT("A00550","省级名称为空,请检查信息是否存在!"), + GD_OR_NOT("A00550","供电名称为空,请检查信息是否存在!"), ; private final String code; diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqDevice.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqDevice.java new file mode 100644 index 000000000..d3860d718 --- /dev/null +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqDevice.java @@ -0,0 +1,86 @@ +package com.njcn.supervision.pojo.param.oracle; + +import lombok.Data; + +import java.io.Serializable; + +/** + * + * @TableName PQ_DEVICE + */ +@Data +public class PqDevice implements Serializable { + + /** + * 装置名称(唯一性判断) + */ + 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; + +} \ No newline at end of file diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqDevicedetail.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqDevicedetail.java new file mode 100644 index 000000000..390b6f42c --- /dev/null +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqDevicedetail.java @@ -0,0 +1,90 @@ +package com.njcn.supervision.pojo.param.oracle; + +import lombok.Data; + +import java.io.Serializable; + +/** + * + * @TableName PQ_DEVICEDETAIL + */ +@Data +public class PqDevicedetail implements Serializable { + + + /** + * (关联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; + +} \ No newline at end of file diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqDevtypeicd.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqDevtypeicd.java new file mode 100644 index 000000000..397242991 --- /dev/null +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqDevtypeicd.java @@ -0,0 +1,36 @@ +package com.njcn.supervision.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; +} \ No newline at end of file diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqGdinformation.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqGdinformation.java new file mode 100644 index 000000000..7cd3b961a --- /dev/null +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqGdinformation.java @@ -0,0 +1,20 @@ +package com.njcn.supervision.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; + +} \ No newline at end of file diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqLine.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqLine.java new file mode 100644 index 000000000..129c69b7e --- /dev/null +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqLine.java @@ -0,0 +1,72 @@ +package com.njcn.supervision.pojo.param.oracle; + +import lombok.Data; + +import java.io.Serializable; + +/** + * + * @TableName PQ_LINE + */ +@Data +public class PqLine implements Serializable { + + + /** + * 线路名称 + */ + 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; + + +} \ No newline at end of file diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqLinedetail.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqLinedetail.java new file mode 100644 index 000000000..a1a8ebc81 --- /dev/null +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqLinedetail.java @@ -0,0 +1,121 @@ +package com.njcn.supervision.pojo.param.oracle; + +import lombok.Data; + +import java.io.Serializable; + +/** + * + * @TableName PQ_LINEDETAIL + */ +@Data +public class PqLinedetail implements Serializable { + + + /** + * 线路名称 + */ + 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; + + +} \ No newline at end of file diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqProject.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqProject.java new file mode 100644 index 000000000..32ed0c5e9 --- /dev/null +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqProject.java @@ -0,0 +1,22 @@ +package com.njcn.supervision.pojo.param.oracle; + +import lombok.Data; + +import java.io.Serializable; + +/** + * + * @author web2023 + * @TableName PQ_PROJECT 项目信息表 + */ +@Data +public class PqProject implements Serializable { + + + /** + * 项目名称(唯一性判断) + */ + private String name; + + +} \ No newline at end of file diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqProvince.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqProvince.java new file mode 100644 index 000000000..9cf863a43 --- /dev/null +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqProvince.java @@ -0,0 +1,22 @@ +package com.njcn.supervision.pojo.param.oracle; + +import lombok.Data; + +import java.io.Serializable; + +/** + * + * @author web2023 + * @TableName PQ_PROVINCE 省级信息表 + */ +@Data +public class PqProvince implements Serializable { + + + /** + * 省级名称(唯一性判断) + */ + private String name; + + +} \ No newline at end of file diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqSubstation.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqSubstation.java new file mode 100644 index 000000000..b67cc7ed8 --- /dev/null +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqSubstation.java @@ -0,0 +1,24 @@ +package com.njcn.supervision.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; + +} \ No newline at end of file diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqSubvoltage.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqSubvoltage.java new file mode 100644 index 000000000..9ac925216 --- /dev/null +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqSubvoltage.java @@ -0,0 +1,37 @@ +package com.njcn.supervision.pojo.param.oracle; + +import lombok.Data; + +import java.io.Serializable; + +/** + * + * @TableName PQ_SUBVOLTAGE + */ +@Data +public class PqSubvoltage implements Serializable { + + + /** + * 母线名称 + */ + private String name; + + /** + * 母线号(在同一台设备中的电压通道号) + */ + private Integer subvNum; + + /** + * (关联表PQS_Dicdata)电压等级Guid + */ + private String scale; + + /** + * 母线模型(0:虚拟母线;1:实际母线) + * 默认是实际母线 + */ + private Integer subvmodel; + + +} \ No newline at end of file diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqsMap.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqsMap.java new file mode 100644 index 000000000..496b02927 --- /dev/null +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/PqsMap.java @@ -0,0 +1,31 @@ +package com.njcn.supervision.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; + + +} \ No newline at end of file diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/SyncLedger.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/SyncLedger.java new file mode 100644 index 000000000..231121f45 --- /dev/null +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/param/oracle/SyncLedger.java @@ -0,0 +1,69 @@ +package com.njcn.supervision.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; + +} diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/SupervisionTempLineDebugPOServiceImpl.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/SupervisionTempLineDebugPOServiceImpl.java index cca266058..3f623222f 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/SupervisionTempLineDebugPOServiceImpl.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/SupervisionTempLineDebugPOServiceImpl.java @@ -21,17 +21,22 @@ import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO; import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam; import com.njcn.common.pojo.enums.common.DataStateEnum; import com.njcn.common.pojo.exception.BusinessException; +import com.njcn.device.biz.enums.DeviceResponseEnum; import com.njcn.device.pq.api.DeptLineFeignClient; import com.njcn.device.pq.api.LineFeignClient; +import com.njcn.device.pq.api.NodeClient; import com.njcn.device.pq.api.TerminalBaseClient; +import com.njcn.device.pq.pojo.dto.PollutionSubstationDTO; import com.njcn.device.pq.pojo.param.*; import com.njcn.device.pq.pojo.po.Line; +import com.njcn.device.pq.pojo.po.Node; import com.njcn.supervision.enums.SupervisionKeyEnum; import com.njcn.supervision.enums.SupervisionResponseEnum; import com.njcn.supervision.enums.UserNatureEnum; import com.njcn.supervision.mapper.device.SupervisionTempLineDebugPOMapper; import com.njcn.supervision.mapper.user.UserReportNormalMapper; import com.njcn.supervision.pojo.param.device.SupervisionTempLineDebugParam; +import com.njcn.supervision.pojo.param.oracle.*; import com.njcn.supervision.pojo.po.device.SupervisionTempDeviceReport; import com.njcn.supervision.pojo.po.device.SupervisionTempLineDebugPO; import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport; @@ -47,17 +52,22 @@ import com.njcn.supervision.service.user.UserReportProjectPOService; import com.njcn.supervision.service.user.UserReportSensitivePOService; import com.njcn.supervision.service.user.UserReportSubstationPOService; import com.njcn.supervision.utils.InstanceUtil; +import com.njcn.system.api.AreaFeignClient; import com.njcn.system.api.DicDataFeignClient; import com.njcn.system.api.DictTreeFeignClient; import com.njcn.system.enums.DicDataTypeEnum; +import com.njcn.system.pojo.po.Area; import com.njcn.system.pojo.po.DictData; import com.njcn.system.pojo.po.SysDicTreePO; import com.njcn.user.api.DeptFeignClient; import com.njcn.user.api.UserFeignClient; import com.njcn.web.factory.PageFactory; import com.njcn.web.utils.RequestUtil; +import com.njcn.web.utils.RestTemplateUtil; import lombok.RequiredArgsConstructor; import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -91,6 +101,15 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl userEntity = RestTemplateUtil.post(url, syncLedger, String.class); + } String substation = terminalBaseClient.terminalSync(syncTerminalParam).getData(); + this.updateProcessStatus(id, 5); tempDevice.setSubstation(substation); supervisionTempDeviceReportService.updateById(tempDevice); @@ -438,8 +465,165 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl data = lineFeignClient.getBaseLineList(Arrays.asList(param.getProjectIndex(), + param.getProvinceIndex(), + param.getGdIndex() + )).getData(); + //项目信息表 + PqProject pqProject=new PqProject(); + List 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(SupervisionResponseEnum.PROJECT_OR_NOT); + } + ledger.setPqProject(pqProject); + + //省级项目表 + PqProvince pqProvince=new PqProvince(); + List 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(SupervisionResponseEnum.PROVINCE_OR_NOT); + } + ledger.setPqProvince(pqProvince); + + //供电公司表 + PqGdinformation pqGdinformation=new PqGdinformation(); + List 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(SupervisionResponseEnum.GD_OR_NOT); + } + ledger.setPqGdinformation(pqGdinformation); + + //变电站 + PqSubstation pqSubstation=new PqSubstation(); + SubStationParam subStation = param.getSubStationParam(); + if(ObjectUtil.isNull(subStation)){ + PollutionSubstationDTO sub = lineFeignClient.getSubstationInfo(param.getSubIndex()).getData(); + 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 = nodeClient.getNodeById(device.getNodeId()).getData(); + 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("字典转换异常"); + } + + } private void assembleSyncTerminalParam(DeviceParam deviceParam, SupervisionTempDeviceReport tempDevice, SubVoltageParam subVoltageParam, LineParam lineParam, SupervisionTempLineReport tempLine) { //包装device deviceParam.setDevIndex(tempDevice.getId());