1.解决mysql语句关键字问题
2.mysql台账同步oracle
This commit is contained in:
@@ -61,3 +61,7 @@ isJb: false
|
|||||||
mqtt:
|
mqtt:
|
||||||
client-id: @artifactId@${random.value}
|
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","监测点所属装置型号不匹配"),
|
LINE_DEVICE_NO_MATCH("A0369","监测点所属装置型号不匹配"),
|
||||||
NO_SUB("A0370","当前单位下不存在台区或变电站"),
|
NO_SUB("A0370","当前单位下不存在台区或变电站"),
|
||||||
NEWSTATION_REPEAT("A0371","新能源场站名称已存在"),
|
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 = "监测点名称违规")
|
@Pattern(regexp = PatternRegex.DEV_NAME_REGEX,message = "监测点名称违规")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "name",value = "原监测点名称",required = true)
|
||||||
|
private String oldName;
|
||||||
/**
|
/**
|
||||||
* PT一次变比
|
* PT一次变比
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ public class SubVoltageParam {
|
|||||||
@Pattern(regexp = PatternRegex.DEV_NAME_REGEX,message = "设备名称违规")
|
@Pattern(regexp = PatternRegex.DEV_NAME_REGEX,message = "设备名称违规")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "name",value = "原母线名称",required = true)
|
||||||
|
private String oldName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 母线号(在同一台设备中的电压通道号)
|
* 母线号(在同一台设备中的电压通道号)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
package com.njcn.supervision.pojo.param.oracle;
|
package com.njcn.device.pq.pojo.param.oracle;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -11,6 +12,8 @@ import java.io.Serializable;
|
|||||||
@Data
|
@Data
|
||||||
public class PqDevice implements Serializable {
|
public class PqDevice implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
private Integer devIndex;
|
||||||
/**
|
/**
|
||||||
* 装置名称(唯一性判断)
|
* 装置名称(唯一性判断)
|
||||||
*/
|
*/
|
||||||
@@ -83,4 +86,9 @@ public class PqDevice implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Integer datatype;
|
private Integer datatype;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 母线信息表
|
||||||
|
*/
|
||||||
|
private List<PqSubvoltage> pqSubvoltage;
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.njcn.supervision.pojo.param.oracle;
|
package com.njcn.device.pq.pojo.param.oracle;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -11,6 +11,7 @@ import java.io.Serializable;
|
|||||||
@Data
|
@Data
|
||||||
public class PqDevicedetail implements Serializable {
|
public class PqDevicedetail implements Serializable {
|
||||||
|
|
||||||
|
private Integer devIndex;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (关联PQS_Dicdata)设备制造商Guid
|
* (关联PQS_Dicdata)设备制造商Guid
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.njcn.supervision.pojo.param.oracle;
|
package com.njcn.device.pq.pojo.param.oracle;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.njcn.supervision.pojo.param.oracle;
|
package com.njcn.device.pq.pojo.param.oracle;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.njcn.supervision.pojo.param.oracle;
|
package com.njcn.device.pq.pojo.param.oracle;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ import java.io.Serializable;
|
|||||||
@Data
|
@Data
|
||||||
public class PqLine implements Serializable {
|
public class PqLine implements Serializable {
|
||||||
|
|
||||||
|
private Integer lineIndex;
|
||||||
/**
|
/**
|
||||||
* 线路名称
|
* 线路名称
|
||||||
*/
|
*/
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.njcn.supervision.pojo.param.oracle;
|
package com.njcn.device.pq.pojo.param.oracle;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ import java.io.Serializable;
|
|||||||
@Data
|
@Data
|
||||||
public class PqLinedetail implements Serializable {
|
public class PqLinedetail implements Serializable {
|
||||||
|
|
||||||
|
private Integer lineIndex;
|
||||||
/**
|
/**
|
||||||
* 线路名称
|
* 线路名称
|
||||||
*/
|
*/
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.njcn.supervision.pojo.param.oracle;
|
package com.njcn.device.pq.pojo.param.oracle;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.njcn.supervision.pojo.param.oracle;
|
package com.njcn.device.pq.pojo.param.oracle;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.njcn.supervision.pojo.param.oracle;
|
package com.njcn.device.pq.pojo.param.oracle;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -21,4 +21,13 @@ public class PqSubstation implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String scale;
|
private String scale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旧变电站id
|
||||||
|
*/
|
||||||
|
private String oldName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供电公司
|
||||||
|
*/
|
||||||
|
private String gdName;
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
package com.njcn.supervision.pojo.param.oracle;
|
package com.njcn.device.pq.pojo.param.oracle;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -17,6 +18,11 @@ public class PqSubvoltage implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 原母线名称
|
||||||
|
*/
|
||||||
|
private String oldName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 母线号(在同一台设备中的电压通道号)
|
* 母线号(在同一台设备中的电压通道号)
|
||||||
*/
|
*/
|
||||||
@@ -33,5 +39,8 @@ public class PqSubvoltage implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Integer subvmodel;
|
private Integer subvmodel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 线路信息表
|
||||||
|
*/
|
||||||
|
private List<PqLine> pqLine;
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.njcn.supervision.pojo.param.oracle;
|
package com.njcn.device.pq.pojo.param.oracle;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.njcn.supervision.pojo.param.oracle;
|
package com.njcn.device.pq.pojo.param.oracle;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -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")
|
@DeleteMapping("delTerminal")
|
||||||
public HttpResult<Object> delTerminal(@RequestParam("id") String id) {
|
public HttpResult<Object> delTerminal(@RequestParam("id") String id) {
|
||||||
String methodDescribe = getMethodDescribe("delTerminal");
|
String methodDescribe = getMethodDescribe("delTerminal");
|
||||||
System.out.println(id);
|
terminalBaseService.delTerminal(id);
|
||||||
// terminalBaseService.delTerminal(id);
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
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);
|
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
|
* 查询监测点id
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1779,4 +1779,20 @@
|
|||||||
|
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
|
|||||||
@@ -148,6 +148,16 @@ public interface TerminalBaseService {
|
|||||||
*/
|
*/
|
||||||
List<String> getVoltageIdByScale(List<String> voltageIds, String scale);
|
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
|
* 根据干扰源获取对应的监测点id
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -473,9 +473,9 @@ public class GeneralDeviceService {
|
|||||||
|
|
||||||
private List<GeneralDeviceDTO> filterDataByScale(List<GeneralDeviceDTO> deviceInfos, List<SimpleDTO> scales) {
|
private List<GeneralDeviceDTO> filterDataByScale(List<GeneralDeviceDTO> deviceInfos, List<SimpleDTO> scales) {
|
||||||
List<GeneralDeviceDTO> generalDeviceDTOS = new ArrayList<>();
|
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) {
|
for (GeneralDeviceDTO generalDeviceDTO : deviceInfos) {
|
||||||
voltageIds.addAll(generalDeviceDTO.getVoltageIndexes());
|
subIds.addAll(generalDeviceDTO.getSubIndexes());
|
||||||
lineIds.addAll(generalDeviceDTO.getLineIndexes());
|
lineIds.addAll(generalDeviceDTO.getLineIndexes());
|
||||||
}
|
}
|
||||||
//如果电压等级集合为空,则查询所有的电压等级
|
//如果电压等级集合为空,则查询所有的电压等级
|
||||||
@@ -493,8 +493,8 @@ public class GeneralDeviceService {
|
|||||||
}
|
}
|
||||||
List<Line> lines = terminalBaseService.getLineById(lineIds);
|
List<Line> lines = terminalBaseService.getLineById(lineIds);
|
||||||
for (SimpleDTO simpleDTO : scales) {
|
for (SimpleDTO simpleDTO : scales) {
|
||||||
List<String> voltageScaleIds = terminalBaseService.getVoltageIdByScale(voltageIds, simpleDTO.getId());
|
List<String> voltageScaleIds = terminalBaseService.getSubIdByScale(subIds, simpleDTO.getId());
|
||||||
generalDeviceDTOS.add(assembleDataByLine(simpleDTO, lines, voltageScaleIds, LineBaseEnum.SUB_V_LEVEL.getCode()));
|
generalDeviceDTOS.add(assembleDataByLine(simpleDTO, lines, voltageScaleIds, LineBaseEnum.SUB_LEVEL.getCode()));
|
||||||
}
|
}
|
||||||
return generalDeviceDTOS;
|
return generalDeviceDTOS;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import cn.hutool.core.text.StrBuilder;
|
|||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
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.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
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.dto.SimpleDTO;
|
||||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
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.pojo.po.Overlimit;
|
||||||
import com.njcn.device.biz.utils.COverlimitUtil;
|
import com.njcn.device.biz.utils.COverlimitUtil;
|
||||||
import com.njcn.device.pq.enums.LineBaseEnum;
|
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.mapper.*;
|
||||||
import com.njcn.device.pq.pojo.bo.BaseLineInfo;
|
import com.njcn.device.pq.pojo.bo.BaseLineInfo;
|
||||||
import com.njcn.device.pq.pojo.bo.DeviceType;
|
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.OracleTerminalExcel;
|
||||||
import com.njcn.device.pq.pojo.bo.excel.OverLimitExcel;
|
import com.njcn.device.pq.pojo.bo.excel.OverLimitExcel;
|
||||||
import com.njcn.device.pq.pojo.bo.excel.TerminalBaseExcel;
|
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.*;
|
||||||
|
import com.njcn.device.pq.pojo.param.oracle.*;
|
||||||
import com.njcn.device.pq.pojo.po.*;
|
import com.njcn.device.pq.pojo.po.*;
|
||||||
import com.njcn.device.pq.pojo.vo.*;
|
import com.njcn.device.pq.pojo.vo.*;
|
||||||
import com.njcn.device.pq.service.*;
|
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.enums.DicDataTypeEnum;
|
||||||
import com.njcn.system.pojo.po.Area;
|
import com.njcn.system.pojo.po.Area;
|
||||||
import com.njcn.system.pojo.po.DictData;
|
import com.njcn.system.pojo.po.DictData;
|
||||||
|
import com.njcn.web.utils.HttpServletUtil;
|
||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
|
import com.njcn.web.utils.RestTemplateUtil;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.poi.ss.usermodel.Workbook;
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
import org.springframework.beans.BeanUtils;
|
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.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@@ -82,37 +91,33 @@ import java.util.stream.Stream;
|
|||||||
public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> implements TerminalBaseService {
|
public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> implements TerminalBaseService {
|
||||||
|
|
||||||
private final DeviceMapper deviceMapper;
|
private final DeviceMapper deviceMapper;
|
||||||
|
|
||||||
private final SuperDataMapper superDataMapper;
|
private final SuperDataMapper superDataMapper;
|
||||||
|
|
||||||
private final IPqsTerminalLogsService iPqsTerminalLogsService;
|
private final IPqsTerminalLogsService iPqsTerminalLogsService;
|
||||||
|
|
||||||
private final LineMapper lineMapper;
|
private final LineMapper lineMapper;
|
||||||
|
|
||||||
private final DevFuctionMapper devFuctionMapper;
|
private final DevFuctionMapper devFuctionMapper;
|
||||||
|
|
||||||
private final AreaFeignClient areaFeignClient;
|
private final AreaFeignClient areaFeignClient;
|
||||||
|
|
||||||
private final DicDataFeignClient dicDataFeignClient;
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
|
||||||
private final SubstationMapper substationMapper;
|
private final SubstationMapper substationMapper;
|
||||||
|
|
||||||
private final VoltageMapper voltageMapper;
|
private final VoltageMapper voltageMapper;
|
||||||
|
|
||||||
private final LineDetailMapper lineDetailMapper;
|
private final LineDetailMapper lineDetailMapper;
|
||||||
|
|
||||||
private final OverlimitMapper overlimitMapper;
|
private final OverlimitMapper overlimitMapper;
|
||||||
|
|
||||||
private final DeptLineMapper deptLineMapper;
|
private final DeptLineMapper deptLineMapper;
|
||||||
|
|
||||||
private final INodeService nodeService;
|
private final INodeService nodeService;
|
||||||
|
|
||||||
private final LineBakService lineBakService;
|
private final LineBakService lineBakService;
|
||||||
|
|
||||||
private final DeviceBakService deviceBakService;
|
private final DeviceBakService deviceBakService;
|
||||||
|
|
||||||
private final FileStorageUtil fileStorageUtil;
|
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
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean updateTerminal(UpdateTerminalParam updateTerminalParam) {
|
public Boolean updateTerminal(UpdateTerminalParam updateTerminalParam) {
|
||||||
|
String oldSubName="";
|
||||||
|
String gbName="";
|
||||||
LambdaQueryWrapper<Line> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Line> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
//项目
|
//项目
|
||||||
if (Objects.nonNull(updateTerminalParam.getProjectUpdateParam())) {
|
if (Objects.nonNull(updateTerminalParam.getProjectUpdateParam())) {
|
||||||
@@ -528,6 +535,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
//供电公司
|
//供电公司
|
||||||
if (Objects.nonNull(updateTerminalParam.getGdInformationUpdateParam())) {
|
if (Objects.nonNull(updateTerminalParam.getGdInformationUpdateParam())) {
|
||||||
Line gdRes = this.getById(updateTerminalParam.getGdInformationUpdateParam().getGdIndex());
|
Line gdRes = this.getById(updateTerminalParam.getGdInformationUpdateParam().getGdIndex());
|
||||||
|
gbName=gdRes.getName();
|
||||||
if (Objects.isNull(gdRes)) {
|
if (Objects.isNull(gdRes)) {
|
||||||
throw new BusinessException(DeviceResponseEnum.GD_NO);
|
throw new BusinessException(DeviceResponseEnum.GD_NO);
|
||||||
}
|
}
|
||||||
@@ -545,6 +553,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
if (Objects.isNull(subStationRes)) {
|
if (Objects.isNull(subStationRes)) {
|
||||||
throw new BusinessException(DeviceResponseEnum.SUB_NO);
|
throw new BusinessException(DeviceResponseEnum.SUB_NO);
|
||||||
}
|
}
|
||||||
|
oldSubName=subStationRes.getName();
|
||||||
Line subStation = new Line();
|
Line subStation = new Line();
|
||||||
subStation.setId(updateTerminalParam.getSubStationUpdateParam().getSubIndex());
|
subStation.setId(updateTerminalParam.getSubStationUpdateParam().getSubIndex());
|
||||||
subStation.setName(updateTerminalParam.getSubStationUpdateParam().getName());
|
subStation.setName(updateTerminalParam.getSubStationUpdateParam().getName());
|
||||||
@@ -659,6 +668,8 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
for (SubVoltageParam updateSubVoltageParam : subVoltageBOList) {
|
for (SubVoltageParam updateSubVoltageParam : subVoltageBOList) {
|
||||||
if (updateSubVoltageParam.getUpdateFlag() == 1) {
|
if (updateSubVoltageParam.getUpdateFlag() == 1) {
|
||||||
Voltage voltageTem = voltageMapper.selectById(updateSubVoltageParam.getSubvIndex());
|
Voltage voltageTem = voltageMapper.selectById(updateSubVoltageParam.getSubvIndex());
|
||||||
|
Line byId = this.getById(updateSubVoltageParam.getSubvIndex());
|
||||||
|
updateSubVoltageParam.setOldName(byId.getName());
|
||||||
Line subVoltage = new Line();
|
Line subVoltage = new Line();
|
||||||
subVoltage.setId(updateSubVoltageParam.getSubvIndex());
|
subVoltage.setId(updateSubVoltageParam.getSubvIndex());
|
||||||
subVoltage.setName(updateSubVoltageParam.getName());
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1501,6 +1519,11 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
return this.baseMapper.getVoltageIdByScale(voltageIds, scale);
|
return this.baseMapper.getVoltageIdByScale(voltageIds, scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getSubIdByScale(List<String> subIds, String scale) {
|
||||||
|
return this.baseMapper.getSubIdByScale(subIds, scale);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getLineIdByLoadType(List<String> lineIds, String loadType) {
|
public List<String> getLineIdByLoadType(List<String> lineIds, String loadType) {
|
||||||
return this.baseMapper.getLineIdByLoadType(lineIds, 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);
|
throw new BusinessException(DeviceResponseEnum.LINE_NO);
|
||||||
}
|
}
|
||||||
String[] urls = new String[0];
|
String[] urls = new String[0];
|
||||||
if(StrUtil.isNotBlank(lineDetailValid.getWiringDiagram())){
|
if (StrUtil.isNotBlank(lineDetailValid.getWiringDiagram())) {
|
||||||
urls = lineDetailValid.getWiringDiagram().split(StrUtil.COMMA);
|
urls = lineDetailValid.getWiringDiagram().split(StrUtil.COMMA);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1850,12 +1873,11 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//变电站 todo 可能新建电站
|
//变电站 todo 可能新建电站
|
||||||
if (Objects.nonNull(syncTerminalParam.getSubStationParam())) {
|
if (Objects.nonNull(syncTerminalParam.getSubStationParam())) {
|
||||||
if (StrUtil.isBlank(subIndex) && StrUtil.isNotBlank(gdIndex)) {
|
if (StrUtil.isBlank(subIndex) && StrUtil.isNotBlank(gdIndex)) {
|
||||||
Line substation = this.lambdaQuery().eq(Line::getName, syncTerminalParam.getSubStationParam().getName()).one();
|
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());
|
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);
|
this.baseMapper.insert(subStation);
|
||||||
subIndex = subStation.getId();
|
subIndex = subStation.getId();
|
||||||
@@ -1867,7 +1889,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
sub.setLng(syncTerminalParam.getSubStationParam().getLng());
|
sub.setLng(syncTerminalParam.getSubStationParam().getLng());
|
||||||
sub.setLat(syncTerminalParam.getSubStationParam().getLat());
|
sub.setLat(syncTerminalParam.getSubStationParam().getLat());
|
||||||
substationMapper.insert(sub);
|
substationMapper.insert(sub);
|
||||||
}else {
|
} else {
|
||||||
subIndex = substation.getId();
|
subIndex = substation.getId();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1880,7 +1902,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
//查询该设备是否已经同步到表如何存在则之前同步监测点时同步过了,不用同步设备了,反之同步
|
//查询该设备是否已经同步到表如何存在则之前同步监测点时同步过了,不用同步设备了,反之同步
|
||||||
DeviceParam deviceParam = syncTerminalParam.getDeviceParam();
|
DeviceParam deviceParam = syncTerminalParam.getDeviceParam();
|
||||||
Line deviceLine = this.baseMapper.selectById(syncTerminalParam.getDeviceParam().getDevIndex());
|
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());
|
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());
|
device.setId(deviceParam.getDevIndex());
|
||||||
this.baseMapper.insert(device);
|
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();
|
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());
|
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);
|
this.baseMapper.insert(subVoltage);
|
||||||
@@ -1947,8 +1969,8 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
voltage.setScale(scaleRes.getId());
|
voltage.setScale(scaleRes.getId());
|
||||||
voltage.setModel(subVoltageParam.getModel());
|
voltage.setModel(subVoltageParam.getModel());
|
||||||
voltageMapper.insert(voltage);
|
voltageMapper.insert(voltage);
|
||||||
}else {
|
} else {
|
||||||
subvIndex=SubVoltage.getId();
|
subvIndex = SubVoltage.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
//处理监测点
|
//处理监测点
|
||||||
@@ -2002,7 +2024,21 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
deptLine.setId(syncTerminalParam.getDeptId());
|
deptLine.setId(syncTerminalParam.getDeptId());
|
||||||
deptLine.setLineId(line.getId());
|
deptLine.setLineId(line.getId());
|
||||||
deptLineMapper.insert(deptLine);
|
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;
|
return subIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2010,13 +2046,13 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean terminalSyncRunFly(String lineId) {
|
public Boolean terminalSyncRunFly(String lineId) {
|
||||||
LineDTO lineDTO = this.baseMapper.selectLineDetail(lineId);
|
LineDTO lineDTO = this.baseMapper.selectLineDetail(lineId);
|
||||||
if(ObjectUtil.isNotNull(lineDTO)){
|
if (ObjectUtil.isNotNull(lineDTO)) {
|
||||||
lineDetailMapper.update(null,new LambdaUpdateWrapper<LineDetail>()
|
lineDetailMapper.update(null, new LambdaUpdateWrapper<LineDetail>()
|
||||||
.set(LineDetail::getRunFlag, 0)
|
.set(LineDetail::getRunFlag, 0)
|
||||||
.eq(LineDetail::getId, lineDTO.getLineId())
|
.eq(LineDetail::getId, lineDTO.getLineId())
|
||||||
);
|
);
|
||||||
|
|
||||||
deviceMapper.update(null,new LambdaUpdateWrapper<Device>()
|
deviceMapper.update(null, new LambdaUpdateWrapper<Device>()
|
||||||
.set(Device::getRunFlag, 0)
|
.set(Device::getRunFlag, 0)
|
||||||
.eq(Device::getId, lineDTO.getDevId())
|
.eq(Device::getId, lineDTO.getDevId())
|
||||||
);
|
);
|
||||||
@@ -2028,7 +2064,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean terminalSyncDeleteFly(String lineId) {
|
public Boolean terminalSyncDeleteFly(String lineId) {
|
||||||
LineDTO lineDTO = this.baseMapper.selectLineDetail(lineId);
|
LineDTO lineDTO = this.baseMapper.selectLineDetail(lineId);
|
||||||
if(ObjectUtil.isNotNull(lineDTO)){
|
if (ObjectUtil.isNotNull(lineDTO)) {
|
||||||
//删除监测点详细信息
|
//删除监测点详细信息
|
||||||
lineDetailMapper.updateLineRunFlag(lineDTO.getLineId(), RunFlagEnum.QUIT.getStatus());
|
lineDetailMapper.updateLineRunFlag(lineDTO.getLineId(), RunFlagEnum.QUIT.getStatus());
|
||||||
//todo 删除监测点信息
|
//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);
|
temp = assembleLine(substationName, LineBaseEnum.SUB_LEVEL.getCode(), pids.get(LineBaseEnum.GD_LEVEL.getCode()), pids);
|
||||||
this.baseMapper.insert(temp);
|
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)) {
|
if (Objects.isNull(substationScale)) {
|
||||||
//在电压等级内新增一条记录
|
//在电压等级内新增一条记录
|
||||||
substationScale = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_VOLTAGE.getName(), oracleTerminalExcel.getSubStationScale()).getData();
|
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<String> devIds = deviceBaks.stream().map(DeviceBak::getId).collect(Collectors.toList());
|
||||||
List<Line> devList = new ArrayList<>();
|
List<Line> devList = new ArrayList<>();
|
||||||
if(!CollectionUtil.isEmpty(devIds)){
|
if (!CollectionUtil.isEmpty(devIds)) {
|
||||||
LambdaQueryWrapper<Line> devLambda = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Line> devLambda = new LambdaQueryWrapper<>();
|
||||||
devLambda.in(Line::getId, devIds)
|
devLambda.in(Line::getId, devIds)
|
||||||
.orderByAsc(Line::getCreateTime)
|
.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)) {
|
if (Objects.isNull(manufacturer)) {
|
||||||
//在终端厂家字典内新增一条记录
|
//在终端厂家字典内新增一条记录
|
||||||
manufacturer = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_MANUFACTURER.getName(), oracleTerminalExcel.getManufacturer()).getData();
|
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());
|
device.setFrontType(frontTypeDicData.getId());
|
||||||
String devType = oracleDevType.replace("_" + frontType, "");
|
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)) {
|
if (Objects.isNull(devTypeDicData)) {
|
||||||
//在终端类型字典内新增一条记录
|
//在终端类型字典内新增一条记录
|
||||||
devTypeDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_TYPE.getName(), devType).getData();
|
devTypeDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_TYPE.getName(), devType).getData();
|
||||||
@@ -2223,12 +2259,12 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
LambdaQueryWrapper<DeviceBak> deviceBakLambdaQueryWrapper1 = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<DeviceBak> deviceBakLambdaQueryWrapper1 = new LambdaQueryWrapper<>();
|
||||||
deviceBakLambdaQueryWrapper1.in(DeviceBak::getId, ids);
|
deviceBakLambdaQueryWrapper1.in(DeviceBak::getId, ids);
|
||||||
deviceBakService.remove(deviceBakLambdaQueryWrapper1);
|
deviceBakService.remove(deviceBakLambdaQueryWrapper1);
|
||||||
}else if(devList.size()==1){
|
} else if (devList.size() == 1) {
|
||||||
temp = lineMapper.selectById(devList.get(0).getId());
|
temp = lineMapper.selectById(devList.get(0).getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
//先查询终端id是否存在,存在则修改,不存在这添加
|
//先查询终端id是否存在,存在则修改,不存在这添加
|
||||||
//判断是否因为改了终端名称导致没有查到数据
|
//判断是否因为改了终端名称导致没有查到数据
|
||||||
// LambdaQueryWrapper<DeviceBak> deviceBakLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
// LambdaQueryWrapper<DeviceBak> deviceBakLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
@@ -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)) {
|
if (Objects.isNull(manufacturer)) {
|
||||||
//在终端厂家字典内新增一条记录
|
//在终端厂家字典内新增一条记录
|
||||||
manufacturer = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_MANUFACTURER.getName(), oracleTerminalExcel.getManufacturer()).getData();
|
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());
|
device.setFrontType(frontTypeDicData.getId());
|
||||||
String devType = oracleDevType.replace("_" + frontType, "");
|
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)) {
|
if (Objects.isNull(devTypeDicData)) {
|
||||||
//在终端类型字典内新增一条记录
|
//在终端类型字典内新增一条记录
|
||||||
devTypeDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_TYPE.getName(), devType).getData();
|
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.setId(temp.getId());
|
||||||
voltage.setModel(oracleTerminalExcel.getSubvModel());
|
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)) {
|
if (Objects.isNull(subvScale)) {
|
||||||
//在电压等级内新增一条记录
|
//在电压等级内新增一条记录
|
||||||
subvScale = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_VOLTAGE.getName(), oracleTerminalExcel.getSubvScale()).getData();
|
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());
|
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)) {
|
if (Objects.isNull(loadTypeDicData)) {
|
||||||
//在电压等级内新增一条记录
|
//在电压等级内新增一条记录
|
||||||
loadTypeDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.INTERFERENCE_SOURCE_TYPE.getName(), oracleTerminalExcel.getLoadType()).getData();
|
loadTypeDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.INTERFERENCE_SOURCE_TYPE.getName(), oracleTerminalExcel.getLoadType()).getData();
|
||||||
}
|
}
|
||||||
lineDetail.setLoadType(loadTypeDicData.getId());
|
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)) {
|
if (Objects.isNull(businessDicData)) {
|
||||||
//在电压等级内新增一条记录
|
//在电压等级内新增一条记录
|
||||||
businessDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.BUSINESS_TYPE.getName(), oracleTerminalExcel.getBusinessType()).getData();
|
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())) {
|
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)) {
|
if (Objects.isNull(lineGradeDicData)) {
|
||||||
//在电压等级内新增一条记录
|
//在电压等级内新增一条记录
|
||||||
lineGradeDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_LEVEL.getName(), oracleTerminalExcel.getLineGrade()).getData();
|
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<LineBak> lineBaks = lineBakService.list(lineBakLambdaQueryWrapper);
|
||||||
List<String> lineIds = lineBaks.stream().map(LineBak::getId).collect(Collectors.toList());
|
List<String> lineIds = lineBaks.stream().map(LineBak::getId).collect(Collectors.toList());
|
||||||
List<Line> lineList = new ArrayList<>();
|
List<Line> lineList = new ArrayList<>();
|
||||||
if(CollectionUtil.isNotEmpty(lineIds)){
|
if (CollectionUtil.isNotEmpty(lineIds)) {
|
||||||
LambdaQueryWrapper<Line> devLambda = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Line> devLambda = new LambdaQueryWrapper<>();
|
||||||
devLambda.in(Line::getId, lineIds)
|
devLambda.in(Line::getId, lineIds)
|
||||||
.orderByAsc(Line::getCreateTime)
|
.orderByAsc(Line::getCreateTime)
|
||||||
@@ -2458,14 +2494,14 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
// }
|
// }
|
||||||
lineDetail.setNum(oracleTerminalExcel.getLineNum());
|
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)) {
|
if (Objects.isNull(loadTypeDicData)) {
|
||||||
//在电压等级内新增一条记录
|
//在电压等级内新增一条记录
|
||||||
loadTypeDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.INTERFERENCE_SOURCE_TYPE.getName(), oracleTerminalExcel.getLoadType()).getData();
|
loadTypeDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.INTERFERENCE_SOURCE_TYPE.getName(), oracleTerminalExcel.getLoadType()).getData();
|
||||||
}
|
}
|
||||||
lineDetail.setLoadType(loadTypeDicData.getId());
|
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)) {
|
if (Objects.isNull(businessDicData)) {
|
||||||
//在电压等级内新增一条记录
|
//在电压等级内新增一条记录
|
||||||
businessDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.BUSINESS_TYPE.getName(), oracleTerminalExcel.getBusinessType()).getData();
|
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())) {
|
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)) {
|
if (Objects.isNull(lineGradeDicData)) {
|
||||||
//在电压等级内新增一条记录
|
//在电压等级内新增一条记录
|
||||||
lineGradeDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_LEVEL.getName(), oracleTerminalExcel.getLineGrade()).getData();
|
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);
|
BeanUtils.copyProperties(substation, subStationVO);
|
||||||
terminalVO.setSubStationVO(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("字典转换异常");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,9 +27,6 @@ public enum SupervisionResponseEnum {
|
|||||||
DELETE_TO_BE_SUBMITTED("A00550","流程删除失败,只有待提交信息可删除!"),
|
DELETE_TO_BE_SUBMITTED("A00550","流程删除失败,只有待提交信息可删除!"),
|
||||||
EXISTENCE_OR_NOT("A00550","信息查询为空,请检查信息是否存在!"),
|
EXISTENCE_OR_NOT("A00550","信息查询为空,请检查信息是否存在!"),
|
||||||
NAME_EXISTS("A00550","名称重复"),
|
NAME_EXISTS("A00550","名称重复"),
|
||||||
PROJECT_OR_NOT("A00550","项目名称为空,请检查信息是否存在!"),
|
|
||||||
PROVINCE_OR_NOT("A00550","省级名称为空,请检查信息是否存在!"),
|
|
||||||
GD_OR_NOT("A00550","供电名称为空,请检查信息是否存在!"),
|
|
||||||
;
|
;
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.njcn.supervision.service.databank.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@@ -78,7 +79,9 @@ public class LibCaseServiceImpl extends ServiceImpl<LibCaseMapper, LibCase> impl
|
|||||||
QueryWrapper<LibCase> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<LibCase> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("lib_case.status",1);
|
queryWrapper.eq("lib_case.status",1);
|
||||||
//添加上时间范围
|
//添加上时间范围
|
||||||
queryWrapper.between("lib_case.Create_Time",
|
queryWrapper.like(StrUtil.isNotBlank(param.getSearchValue()),"lib_case.name",param.getSearchValue());
|
||||||
|
queryWrapper.between(StrUtil.isNotBlank(param.getSearchBeginTime())&&StrUtil.isNotBlank(param.getSearchEndTime()),
|
||||||
|
"lib_case.Create_Time",
|
||||||
DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime())),
|
DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime())),
|
||||||
DateUtil.endOfDay(DateUtil.parse(param.getSearchEndTime())));
|
DateUtil.endOfDay(DateUtil.parse(param.getSearchEndTime())));
|
||||||
queryWrapper.orderByDesc("lib_case.Update_Time");
|
queryWrapper.orderByDesc("lib_case.Update_Time");
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.njcn.supervision.service.databank.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@@ -74,10 +75,11 @@ public class LibTemplateServiceImpl extends ServiceImpl<LibTemplateMapper, LibTe
|
|||||||
@Override
|
@Override
|
||||||
public Page<LibTemplate> pageQuery(LibTemplateParam.LibTemplateParamQuery param) {
|
public Page<LibTemplate> pageQuery(LibTemplateParam.LibTemplateParamQuery param) {
|
||||||
QueryWrapper<LibTemplate> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<LibTemplate> queryWrapper = new QueryWrapper<>();
|
||||||
|
|
||||||
queryWrapper.eq("lib_template.status",1);
|
queryWrapper.eq("lib_template.status",1);
|
||||||
//添加上时间范围
|
//添加上时间范围
|
||||||
queryWrapper.between("lib_template.Create_Time",
|
queryWrapper.like(StrUtil.isNotBlank(param.getSearchValue()),"lib_template.name",param.getSearchValue());
|
||||||
|
queryWrapper.between(StrUtil.isNotBlank(param.getSearchBeginTime())&&StrUtil.isNotBlank(param.getSearchEndTime()),
|
||||||
|
"lib_template.Create_Time",
|
||||||
DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime())),
|
DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime())),
|
||||||
DateUtil.endOfDay(DateUtil.parse(param.getSearchEndTime())));
|
DateUtil.endOfDay(DateUtil.parse(param.getSearchEndTime())));
|
||||||
queryWrapper.orderByDesc("lib_template.Update_Time");
|
queryWrapper.orderByDesc("lib_template.Update_Time");
|
||||||
|
|||||||
@@ -21,22 +21,17 @@ import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
|
|||||||
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
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.DeptLineFeignClient;
|
||||||
import com.njcn.device.pq.api.LineFeignClient;
|
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.api.TerminalBaseClient;
|
||||||
import com.njcn.device.pq.pojo.dto.PollutionSubstationDTO;
|
|
||||||
import com.njcn.device.pq.pojo.param.*;
|
import com.njcn.device.pq.pojo.param.*;
|
||||||
import com.njcn.device.pq.pojo.po.Line;
|
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.SupervisionKeyEnum;
|
||||||
import com.njcn.supervision.enums.SupervisionResponseEnum;
|
import com.njcn.supervision.enums.SupervisionResponseEnum;
|
||||||
import com.njcn.supervision.enums.UserNatureEnum;
|
import com.njcn.supervision.enums.UserNatureEnum;
|
||||||
import com.njcn.supervision.mapper.device.SupervisionTempLineDebugPOMapper;
|
import com.njcn.supervision.mapper.device.SupervisionTempLineDebugPOMapper;
|
||||||
import com.njcn.supervision.mapper.user.UserReportNormalMapper;
|
import com.njcn.supervision.mapper.user.UserReportNormalMapper;
|
||||||
import com.njcn.supervision.pojo.param.device.SupervisionTempLineDebugParam;
|
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.SupervisionTempDeviceReport;
|
||||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineDebugPO;
|
import com.njcn.supervision.pojo.po.device.SupervisionTempLineDebugPO;
|
||||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
|
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
|
||||||
@@ -52,22 +47,17 @@ import com.njcn.supervision.service.user.UserReportProjectPOService;
|
|||||||
import com.njcn.supervision.service.user.UserReportSensitivePOService;
|
import com.njcn.supervision.service.user.UserReportSensitivePOService;
|
||||||
import com.njcn.supervision.service.user.UserReportSubstationPOService;
|
import com.njcn.supervision.service.user.UserReportSubstationPOService;
|
||||||
import com.njcn.supervision.utils.InstanceUtil;
|
import com.njcn.supervision.utils.InstanceUtil;
|
||||||
import com.njcn.system.api.AreaFeignClient;
|
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
import com.njcn.system.api.DictTreeFeignClient;
|
import com.njcn.system.api.DictTreeFeignClient;
|
||||||
import com.njcn.system.enums.DicDataTypeEnum;
|
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.DictData;
|
||||||
import com.njcn.system.pojo.po.SysDicTreePO;
|
import com.njcn.system.pojo.po.SysDicTreePO;
|
||||||
import com.njcn.user.api.DeptFeignClient;
|
import com.njcn.user.api.DeptFeignClient;
|
||||||
import com.njcn.user.api.UserFeignClient;
|
import com.njcn.user.api.UserFeignClient;
|
||||||
import com.njcn.web.factory.PageFactory;
|
import com.njcn.web.factory.PageFactory;
|
||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
import com.njcn.web.utils.RestTemplateUtil;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
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.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@@ -101,14 +91,6 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
private final UserReportSensitivePOService userReportSensitivePOService;
|
private final UserReportSensitivePOService userReportSensitivePOService;
|
||||||
private final UserReportNormalMapper userReportNormalMapper;
|
private final UserReportNormalMapper userReportNormalMapper;
|
||||||
private final TerminalBaseClient terminalBaseClient;
|
private final TerminalBaseClient terminalBaseClient;
|
||||||
private final AreaFeignClient areaFeignClient;
|
|
||||||
private final NodeClient nodeClient;
|
|
||||||
|
|
||||||
@Value("${oracle.isSync}")
|
|
||||||
private Boolean isSync;
|
|
||||||
|
|
||||||
@Value("${oracle.syncLedgerLineUrl}")
|
|
||||||
private String url;
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -422,13 +404,6 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
syncTerminalParam.setSubVoltageParam(subVoltageParam);
|
syncTerminalParam.setSubVoltageParam(subVoltageParam);
|
||||||
syncTerminalParam.setLineParam(lineParam);
|
syncTerminalParam.setLineParam(lineParam);
|
||||||
|
|
||||||
if(isSync){
|
|
||||||
/***
|
|
||||||
* oracle http远程调用接口
|
|
||||||
*/
|
|
||||||
SyncLedger syncLedger = oracleSyncLedger(syncTerminalParam);
|
|
||||||
ResponseEntity<String> userEntity = RestTemplateUtil.post(url, syncLedger, String.class);
|
|
||||||
}
|
|
||||||
String substation = terminalBaseClient.terminalSync(syncTerminalParam).getData();
|
String substation = terminalBaseClient.terminalSync(syncTerminalParam).getData();
|
||||||
|
|
||||||
this.updateProcessStatus(id, 5);
|
this.updateProcessStatus(id, 5);
|
||||||
@@ -464,165 +439,6 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
return this.update(new LambdaUpdateWrapper<SupervisionTempLineDebugPO>().set(SupervisionTempLineDebugPO::getState, DataStateEnum.DELETED.getCode())
|
return this.update(new LambdaUpdateWrapper<SupervisionTempLineDebugPO>().set(SupervisionTempLineDebugPO::getState, DataStateEnum.DELETED.getCode())
|
||||||
.in(SupervisionTempLineDebugPO::getId, supervisionId));
|
.in(SupervisionTempLineDebugPO::getId, supervisionId));
|
||||||
|
|
||||||
}
|
|
||||||
private SyncLedger oracleSyncLedger(SyncTerminalParam param) {
|
|
||||||
SyncLedger ledger = new SyncLedger();
|
|
||||||
List<Line> data = lineFeignClient.getBaseLineList(Arrays.asList(param.getProjectIndex(),
|
|
||||||
param.getProvinceIndex(),
|
|
||||||
param.getGdIndex()
|
|
||||||
)).getData();
|
|
||||||
|
|
||||||
//项目信息表
|
|
||||||
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(SupervisionResponseEnum.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(SupervisionResponseEnum.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(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) {
|
private void assembleSyncTerminalParam(DeviceParam deviceParam, SupervisionTempDeviceReport tempDevice, SubVoltageParam subVoltageParam, LineParam lineParam, SupervisionTempLineReport tempLine) {
|
||||||
//包装device
|
//包装device
|
||||||
|
|||||||
Reference in New Issue
Block a user