pmsbug修改
This commit is contained in:
@@ -88,17 +88,17 @@
|
||||
AND monitor.`Name` LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!--sql直接报错修改不爆错-->
|
||||
<select id="getPwPhotovoltaicMonitorList" resultType="com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO">
|
||||
SELECT DISTINCT
|
||||
monitor.Org_Id AS orgId,
|
||||
monitor.Org_Name AS orgName,
|
||||
monitor.Powerr_Id AS powerId,
|
||||
monitor.Powerr_Name AS powerName,
|
||||
monitor.id AS monitorId,
|
||||
monitor.Name AS monitorName,
|
||||
monitor.Line_Id,
|
||||
monitor.Line_Name,
|
||||
pm.Org_Id AS orgId,
|
||||
pm.Org_Name AS orgName,
|
||||
pm.Powerr_Id AS powerId,
|
||||
pm.Powerr_Name AS powerName,
|
||||
pm.id AS monitorId,
|
||||
pm.Name AS monitorName,
|
||||
pm.Line_Id,
|
||||
pm.Line_Name,
|
||||
pdm.Monitor_Sort AS monitorSort,
|
||||
pdm.Voltage_Level AS voltageLevel,
|
||||
pdm.If_Power_User AS if_powerUser,
|
||||
@@ -110,28 +110,7 @@
|
||||
pdm.Update_By AS updateBy,
|
||||
pdm.Update_Time AS updateTime
|
||||
FROM
|
||||
((
|
||||
SELECT
|
||||
pm.id,
|
||||
pm.Name,
|
||||
pm.Status,
|
||||
pm.Org_Id,
|
||||
pm.Org_Name,
|
||||
pm.Powerr_Id,
|
||||
pm.Powerr_Name,
|
||||
pm.Line_Id,
|
||||
pm.Line_Name
|
||||
FROM
|
||||
pms_monitor AS pm
|
||||
<where>
|
||||
<if test="pwPmsMonitorParam.monitorTag!=null and pwPmsMonitorParam.monitorTag.size()!=0">
|
||||
AND pm.Monitor_Tag IN
|
||||
<foreach collection="pwPmsMonitorParam.monitorTag" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
)
|
||||
INNER JOIN pms_distribution_monitor AS pdm ON pm.id = pdm.Monitor_Id
|
||||
WHERE
|
||||
pm.Status = 1
|
||||
@@ -140,6 +119,12 @@
|
||||
<foreach collection="deptIdList" item="orgId" open="(" close=")" separator=",">
|
||||
#{orgId}
|
||||
</foreach>
|
||||
<if test="pwPmsMonitorParam.monitorTag!=null and pwPmsMonitorParam.monitorTag.size()!=0">
|
||||
AND pm.Monitor_Tag IN
|
||||
<foreach collection="pwPmsMonitorParam.monitorTag" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="pwPmsMonitorParam.voltageLevels!=null and pwPmsMonitorParam.voltageLevels.size()!=0">
|
||||
AND pdm.Voltage_Level IN
|
||||
<foreach collection="pwPmsMonitorParam.voltageLevels" item="item" open="(" close=")" separator=",">
|
||||
|
||||
@@ -387,6 +387,7 @@
|
||||
<select id="pwMonitorAreaDetailInfo" resultType="com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO">
|
||||
SELECT
|
||||
t.org_id orgId,
|
||||
t.orgName orgName,
|
||||
t.id monitorId,
|
||||
t.NAME monitorName,
|
||||
b.Terminal_Id terminalId,
|
||||
@@ -401,6 +402,7 @@
|
||||
a.id,
|
||||
a.NAME,
|
||||
a.org_id,
|
||||
dept.name orgName,
|
||||
3 AS lineType,
|
||||
a.Power_Station_Id AS powerrId,
|
||||
a.Line_Id,
|
||||
@@ -408,7 +410,7 @@
|
||||
b.Power_Name powerName
|
||||
FROM
|
||||
pms_power_client a
|
||||
LEFT JOIN pms_statation_stat b ON a.Power_Station_Id = b.Power_Id
|
||||
LEFT JOIN pms_statation_stat b ON a.Power_Station_Id = b.Power_Id LEFT JOIN sys_dept dept on a.org_id =dept.code
|
||||
WHERE
|
||||
a.STATUS = 1
|
||||
) UNION ALL
|
||||
@@ -417,6 +419,7 @@
|
||||
a.id,
|
||||
a.NAME,
|
||||
a.org_id,
|
||||
dept.name orgName,
|
||||
3 AS lineType,
|
||||
a.Power_Station_Id AS powerrId,
|
||||
a.Line_Id,
|
||||
@@ -424,37 +427,39 @@
|
||||
b.Power_Name powerName
|
||||
FROM
|
||||
pms_power_generation_user a
|
||||
LEFT JOIN pms_statation_stat b ON a.Power_Station_Id = b.Power_Id
|
||||
LEFT JOIN pms_statation_stat b ON a.Power_Station_Id = b.Power_Id LEFT JOIN sys_dept dept on a.org_id =dept.code
|
||||
WHERE
|
||||
a.STATUS = 1
|
||||
) UNION ALL
|
||||
(
|
||||
SELECT
|
||||
id,
|
||||
NAME,
|
||||
org_id,
|
||||
a.id,
|
||||
a.NAME,
|
||||
a.org_id,
|
||||
dept.name orgName,
|
||||
2 AS lineType,
|
||||
Power_Station_Id AS powerrId,
|
||||
Line_Id,
|
||||
Voltage_Level,
|
||||
Powerr_Name powerName
|
||||
a.Power_Station_Id AS powerrId,
|
||||
a.Line_Id,
|
||||
a.Voltage_Level,
|
||||
a.Powerr_Name powerName
|
||||
FROM
|
||||
pms_power_distributionarea
|
||||
pms_power_distributionarea a LEFT JOIN sys_dept dept on a.org_id =dept.code
|
||||
WHERE
|
||||
STATUS = 1
|
||||
) UNION ALL
|
||||
(
|
||||
SELECT
|
||||
id,
|
||||
NAME,
|
||||
org_id,
|
||||
a.id,
|
||||
a.NAME,
|
||||
a.org_id,
|
||||
dept.name orgName,
|
||||
1 AS lineType,
|
||||
Powerr_Id AS powerrId,
|
||||
Line_Id,
|
||||
Voltage_Level,
|
||||
Powerr_Name powerName
|
||||
a.Powerr_Id AS powerrId,
|
||||
a.Line_Id,
|
||||
a.Voltage_Level,
|
||||
a.Powerr_Name powerName
|
||||
FROM
|
||||
pms_monitor
|
||||
pms_monitor a LEFT JOIN sys_dept dept on a.org_id =dept.code
|
||||
WHERE
|
||||
STATUS = 1
|
||||
)
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
@@ -183,7 +184,7 @@ public class DeviceController extends BaseController {
|
||||
@ApiOperation("修改装置通讯状态")
|
||||
public HttpResult<Boolean> updateDevComFlag(@RequestBody DevComFlagDTO devComFlagDTO) {
|
||||
String methodDescribe = getMethodDescribe("updateDevComFlag");
|
||||
boolean update = iDeviceService.lambdaUpdate().set(Device::getComFlag, devComFlagDTO.getStatus()).set(Device::getUpdateTime, devComFlagDTO.getDate()).eq(Device::getId, devComFlagDTO.getId()).update();
|
||||
boolean update = iDeviceService.lambdaUpdate().set(Objects.nonNull(devComFlagDTO.getStatus()), Device::getComFlag,devComFlagDTO.getStatus()).set(Device::getUpdateTime, devComFlagDTO.getDate()).eq(Device::getId, devComFlagDTO.getId()).update();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, update, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -121,13 +121,13 @@ public class TerminalBaseController extends BaseController {
|
||||
}
|
||||
terminalBaseService.addTerminal(addTerminalParam);
|
||||
//新增终端后发送消息给前置重启设备
|
||||
if (Objects.nonNull(addTerminalParam.getDeviceParam())) {
|
||||
addTerminalParam.getDeviceParam().forEach(temp->{
|
||||
Line line = terminalBaseService.queryTerminalByName(temp.getName());
|
||||
terminalBaseService.askRestartDevice(line.getId(), DeviceRebootType.ADD_TERMINAL);
|
||||
});
|
||||
|
||||
}
|
||||
// if (Objects.nonNull(addTerminalParam.getDeviceParam())) {
|
||||
// addTerminalParam.getDeviceParam().forEach(temp->{
|
||||
// Line line = terminalBaseService.queryTerminalByName(temp.getName());
|
||||
// terminalBaseService.askRestartDevice(line.getId(), DeviceRebootType.ADD_TERMINAL);
|
||||
// });
|
||||
//
|
||||
// }
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
@@ -163,7 +163,7 @@ public class TerminalBaseController extends BaseController {
|
||||
|
||||
Boolean b = terminalBaseService.terminalSyncDeleteFly(lineId);
|
||||
//删除监测点即修改终端通知前置重启
|
||||
terminalBaseService.askRestartDevice(devId,DeviceRebootType.LEDGER_MODIFY);
|
||||
// terminalBaseService.askRestartDevice(devId,DeviceRebootType.LEDGER_MODIFY);
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -1513,7 +1513,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
lineLambdaQueryWrapper.in(DeptLine::getLineId, lineIndexList);
|
||||
deptLineMapper.delete(lineLambdaQueryWrapper);
|
||||
// 删除终端通知前置重启
|
||||
this.askRestartDevice(id,DeviceRebootType.DELETE_TERMINAL);
|
||||
// this.askRestartDevice(id,DeviceRebootType.DELETE_TERMINAL);
|
||||
|
||||
}
|
||||
|
||||
@@ -1535,8 +1535,8 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
lineLambdaQueryWrapper.in(DeptLine::getLineId, lineIndexList);
|
||||
deptLineMapper.delete(lineLambdaQueryWrapper);
|
||||
//通知前置删除监测点
|
||||
String[] split = obj.getPids().split(",");
|
||||
this.askRestartDevice(split[4],DeviceRebootType.LEDGER_MODIFY);
|
||||
// String[] split = obj.getPids().split(",");
|
||||
// this.askRestartDevice(split[4],DeviceRebootType.LEDGER_MODIFY);
|
||||
|
||||
}
|
||||
|
||||
@@ -1547,8 +1547,8 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
overlimitMapper.deleteById(obj.getId());
|
||||
deptLineMapper.deleteById(obj.getId());
|
||||
//通知前置删除监测点
|
||||
String[] split = obj.getPids().split(",");
|
||||
this.askRestartDevice(split[4],DeviceRebootType.LEDGER_MODIFY);
|
||||
// String[] split = obj.getPids().split(",");
|
||||
// this.askRestartDevice(split[4],DeviceRebootType.LEDGER_MODIFY);
|
||||
|
||||
} else {
|
||||
throw new BusinessException(CommonResponseEnum.FAIL);
|
||||
|
||||
Reference in New Issue
Block a user