设备退运工作流程完成
This commit is contained in:
@@ -127,7 +127,7 @@ public class BpmModelController extends BaseController {
|
||||
@PostMapping("/update")
|
||||
@ApiOperation("修改模型")
|
||||
@ApiImplicitParam(name = "updateParam", value = "流程分类数据", required = true)
|
||||
public HttpResult<Object> update( @Validated @RequestBody BpmModelParam.BpmModelUpdateParam updateParam) {
|
||||
public HttpResult<Object> update(@Validated @RequestBody BpmModelParam.BpmModelUpdateParam updateParam) {
|
||||
String methodDescribe = getMethodDescribe("update");
|
||||
modelService.updateModel(updateParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
@@ -153,7 +153,8 @@ public class BpmModelController extends BaseController {
|
||||
modelService.deployModel(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
//
|
||||
|
||||
//
|
||||
// @PutMapping("/update-state")
|
||||
// @Operation(summary = "修改模型的状态", description = "实际更新的部署的流程定义的状态")
|
||||
// @PreAuthorize("@ss.hasPermission('bpm:model:update')")
|
||||
@@ -162,13 +163,13 @@ public class BpmModelController extends BaseController {
|
||||
// return success(true);
|
||||
// }
|
||||
//
|
||||
// @DeleteMapping("/delete")
|
||||
// @Operation(summary = "删除模型")
|
||||
// @Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
// @PreAuthorize("@ss.hasPermission('bpm:model:delete')")
|
||||
// public CommonResult<Boolean> deleteModel(@RequestParam("id") String id) {
|
||||
// modelService.deleteModel(id);
|
||||
// return success(true);
|
||||
// }
|
||||
@GetMapping("/delete")
|
||||
@Operation(summary = "删除模型")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
public HttpResult<Boolean> deleteModel(String id) {
|
||||
String methodDescribe = getMethodDescribe("deleteModel");
|
||||
modelService.deleteModel(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.njcn.bpm.listener.business;
|
||||
|
||||
import com.njcn.bpm.listener.BpmProcessInstanceStatusEvent;
|
||||
import com.njcn.bpm.listener.BpmProcessInstanceStatusEventListener;
|
||||
import com.njcn.supervision.api.QuitRunningDeviceFeignClient;
|
||||
import com.njcn.supervision.api.UserReportFeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
||||
@Component
|
||||
public class BpmQuitRunningDeviceStatusListener extends BpmProcessInstanceStatusEventListener {
|
||||
|
||||
@Resource
|
||||
private QuitRunningDeviceFeignClient quitRunningDeviceFeignClient;
|
||||
|
||||
@Override
|
||||
protected String getProcessDefinitionKey() {
|
||||
return "quit_running_device";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onEvent(BpmProcessInstanceStatusEvent event) {
|
||||
quitRunningDeviceFeignClient.updateDeviceStatus(event.getBusinessKey(), event.getStatus());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -108,10 +108,9 @@ public interface BpmModelConvert {
|
||||
// model.setMetaInfo(buildMetaInfoStr(null,
|
||||
// null, bean.getDescription(),
|
||||
// null, null, null, null));
|
||||
//类型暂时写死为表单 todo...
|
||||
model.setMetaInfo(buildMetaInfoStr(buildMetaInfo(model),
|
||||
bean.getIcon(), bean.getDescription(),
|
||||
BpmModelFormTypeEnum.NORMAL.getType(), bean.getFormId(), bean.getFormCustomCreatePath(), bean.getFormCustomViewPath()));
|
||||
bean.getFormType(), bean.getFormId(), bean.getFormCustomCreatePath(), bean.getFormCustomViewPath()));
|
||||
}
|
||||
|
||||
default void copyToUpdateModel(Model model, BpmModelParam.BpmModelUpdateParam bean) {
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.njcn.device.biz.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum RunFlagEnum {
|
||||
|
||||
RUNNING(0, "投运"),
|
||||
CHECK(1, "检修"),
|
||||
STOP(2, "停运"),
|
||||
TEST(3, "调试"),
|
||||
QUIT(4, "退运");
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private final Integer status;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private final String desc;
|
||||
|
||||
}
|
||||
@@ -21,16 +21,16 @@
|
||||
<dependencies>
|
||||
|
||||
<!--pq-device-boot和pms-device-boot只能选择一个-->
|
||||
<!-- <dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>pq-device-boot</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>-->
|
||||
<dependency>
|
||||
</dependency>
|
||||
<!--<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>pms-device-boot</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.pq.pojo.po.line.LineInfoVO;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -71,6 +72,15 @@ public interface LineFeignClient {
|
||||
@PostMapping("getLineDetailData")
|
||||
HttpResult<LineDetailDataVO> getLineDetailData(@RequestParam("id") String id);
|
||||
|
||||
/**
|
||||
* 根据监测点id获取装置详情
|
||||
*
|
||||
* @param id 装置id
|
||||
* @return 装置详情
|
||||
*/
|
||||
@PostMapping("getDeviceDetailData")
|
||||
HttpResult<DeviceVO> getDeviceDetailData(@RequestParam("id") String id);
|
||||
|
||||
/**
|
||||
* 根据监测点id获取监测点越限
|
||||
*
|
||||
@@ -141,14 +151,13 @@ public interface LineFeignClient {
|
||||
@PostMapping("getLineInfo")
|
||||
HttpResult<List<PollutionLineDTO>> getLineInfo(@RequestBody PollutionParamDTO pollutionParamDTO);
|
||||
|
||||
/**
|
||||
* 获取所有监测点
|
||||
* @param id 监测点集合
|
||||
* @return 结果
|
||||
*/
|
||||
|
||||
@PostMapping("getLineSubGdDetail")
|
||||
HttpResult<LineDetailVO> getLineSubGdDetail(@RequestParam("id") String id);
|
||||
|
||||
@PostMapping("getLineInfoVO")
|
||||
HttpResult<LineInfoVO> getLineInfoVO(@RequestParam("id") String id);
|
||||
|
||||
/**
|
||||
* 获取告警变电站信息
|
||||
* @param list 变电站集合
|
||||
@@ -325,5 +334,9 @@ public interface LineFeignClient {
|
||||
HttpResult<List<LineDetailVO.Detail>> getLineDetailByIds(@RequestBody List<String> ids);
|
||||
|
||||
|
||||
@PostMapping("/updateDeviceRunFlag")
|
||||
void updateDeviceRunFlag(@RequestParam("deviceId")String deviceId, @RequestParam("status")Integer status);
|
||||
|
||||
@PostMapping("/updateLineRunFlag")
|
||||
void updateLineRunFlag(@RequestParam("lineId")String lineId, @RequestParam("status")Integer status);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.pq.pojo.po.line.LineInfoVO;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
@@ -63,6 +64,12 @@ public class LineFeignClientFallbackFactory implements FallbackFactory<LineFeign
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<DeviceVO> getDeviceDetailData(String id) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据装置Id获取装置详情 ", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<LineOverLimitVO> getLineOverLimitData(String id) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据监测点Id获取监测点越限 ", throwable.toString());
|
||||
@@ -117,6 +124,12 @@ public class LineFeignClientFallbackFactory implements FallbackFactory<LineFeign
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<LineInfoVO> getLineInfoVO(String id) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "监测点详细信息 ", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<WarningSubstationDTO>> getWarningSub(List<String> list) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "变电站集合为 ", throwable.toString());
|
||||
@@ -237,6 +250,18 @@ public class LineFeignClientFallbackFactory implements FallbackFactory<LineFeign
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据监测点id获取监测点集合: ", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDeviceRunFlag(String deviceId, Integer status) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "更新监测点运行状态: ", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateLineRunFlag(String lineId, Integer status) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "更新监测点运行状态: ", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,4 +175,9 @@ public class LineDetail{
|
||||
*/
|
||||
private String actualArea;
|
||||
|
||||
/**
|
||||
* 监测点运行状态(0:运行;1:检修;2:停运;3:调试;4:退运)
|
||||
*/
|
||||
private Integer runFlag;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.njcn.device.pq.pojo.po.line;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class LineInfoVO implements Serializable {
|
||||
|
||||
@ApiModelProperty("供电公司名称")
|
||||
private String gdName;
|
||||
|
||||
@ApiModelProperty("变电站名称")
|
||||
private String subName;
|
||||
|
||||
@ApiModelProperty("终端名称")
|
||||
private String devName;
|
||||
|
||||
@ApiModelProperty("网络参数")
|
||||
private String ip;
|
||||
|
||||
@ApiModelProperty("监测点名称")
|
||||
private String lineName;
|
||||
|
||||
@ApiModelProperty("母线名称")
|
||||
private String volName;
|
||||
/**
|
||||
* (0:运行;1:检修;2:停运;3:调试;4:退运)
|
||||
*/
|
||||
@ApiModelProperty("监测点运行状态")
|
||||
private Integer runFlag;
|
||||
}
|
||||
@@ -26,6 +26,13 @@ public class DeviceVO implements Serializable {
|
||||
*/
|
||||
private String nodeId;
|
||||
|
||||
|
||||
@ApiModelProperty("供电公司名称")
|
||||
private String gdName;
|
||||
|
||||
@ApiModelProperty("变电站名称")
|
||||
private String subName;
|
||||
|
||||
private String name;
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,6 +14,7 @@ import java.time.LocalDateTime;
|
||||
*/
|
||||
@Data
|
||||
public class LineDetailVO implements Serializable {
|
||||
|
||||
@ApiModelProperty("供电公司名称")
|
||||
private String gdName;
|
||||
|
||||
@@ -28,6 +29,15 @@ public class LineDetailVO implements Serializable {
|
||||
|
||||
@ApiModelProperty("监测点名称")
|
||||
private String lineName;
|
||||
|
||||
@ApiModelProperty("母线名称")
|
||||
private String volName;
|
||||
|
||||
/**
|
||||
* (0:运行;1:检修;2:停运;3:调试;4:退运)
|
||||
*/
|
||||
@ApiModelProperty("监测点运行状态")
|
||||
private Integer runFlag;
|
||||
@Data
|
||||
public static class Detail extends LineDetailVO implements Serializable{
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.njcn.device.pq.mapper.*;
|
||||
import com.njcn.device.pq.pojo.dto.*;
|
||||
import com.njcn.device.pq.pojo.param.*;
|
||||
import com.njcn.device.pq.pojo.po.*;
|
||||
import com.njcn.device.pq.pojo.po.line.LineInfoVO;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import com.njcn.device.pq.service.LineService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
@@ -51,7 +52,6 @@ public class LineController extends BaseController {
|
||||
|
||||
private final RStatIntegrityDMapper integrityDMapper;
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getLineDetailData")
|
||||
@ApiOperation("根据监测点id获取监测点详情")
|
||||
@@ -62,6 +62,17 @@ public class LineController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("根据装置id获取装置详情")
|
||||
@ApiImplicitParam(name = "id", value = "装置id", required = true)
|
||||
@PostMapping("/getDeviceDetailData")
|
||||
HttpResult<DeviceVO> getDeviceDetailData(@RequestParam("id") String id){
|
||||
String methodDescribe = getMethodDescribe("getDeviceDetailData");
|
||||
DeviceVO result = lineService.getDeviceDetailData(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getLineOverLimitData")
|
||||
@ApiOperation("根据监测点id获取越限详情")
|
||||
@@ -194,6 +205,39 @@ public class LineController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getLineInfoVO")
|
||||
@ApiOperation("根据监测点id集合获取详细信息")
|
||||
@ApiIgnore
|
||||
public HttpResult<LineDetailVO> getLineInfoVO(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getLineInfoVO");
|
||||
LineDetailVO result = lineMapper.getLineInfoVO(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/updateDeviceRunFlag")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("更新终端运行状态")
|
||||
@ApiIgnore
|
||||
public HttpResult<Boolean> updateDeviceRunFlag(@RequestParam("deviceId")String deviceId, @RequestParam("status")Integer status){
|
||||
String methodDescribe = getMethodDescribe("updateDeviceRunFlag");
|
||||
deviceMapper.updateDeviceRunFlag(deviceId,status);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/updateLineRunFlag")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("更新监测点运行状态")
|
||||
@ApiIgnore
|
||||
public HttpResult<Boolean> updateLineRunFlag(@RequestParam("lineId")String lineId, @RequestParam("status")Integer status){
|
||||
String methodDescribe = getMethodDescribe("updateLineRunFlag");
|
||||
lineDetailMapper.updateLineRunFlag(lineId,status);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getWarningSub")
|
||||
@ApiOperation("获取告警变电站信息")
|
||||
|
||||
@@ -73,4 +73,6 @@ public interface DeviceMapper extends BaseMapper<Device> {
|
||||
* @Date: 2023/11/7 15:40
|
||||
*/
|
||||
List<DevDetail> selectDevByIds(@Param("ids") List<String> ids);
|
||||
|
||||
void updateDeviceRunFlag(@Param("id")String deviceId, @Param("runFlag")Integer status);
|
||||
}
|
||||
|
||||
@@ -51,4 +51,6 @@ public interface LineDetailMapper extends BaseMapper<LineDetail> {
|
||||
|
||||
|
||||
LineDevGetDTO getMonitorDetail(@Param("monitorId")String monitorId);
|
||||
|
||||
void updateLineRunFlag(@Param("id")String lineId, @Param("runFlag")Integer status);
|
||||
}
|
||||
|
||||
@@ -543,4 +543,8 @@ public interface LineMapper extends BaseMapper<Line> {
|
||||
|
||||
|
||||
List<String> getDeviceIdByPowerFlag(@Param("lineIds")List<String> lineIds, @Param("powerFlag")Integer manufacturer);
|
||||
|
||||
DeviceVO getDeviceDetailData(@Param("id")String id);
|
||||
|
||||
LineDetailVO getLineInfoVO(@Param("id")String id);
|
||||
}
|
||||
|
||||
@@ -247,4 +247,10 @@
|
||||
AND line.id = lineDetail.id
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="updateDeviceRunFlag" >
|
||||
update pq_device
|
||||
set run_flag = #{runFlag}
|
||||
where id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
|
||||
@@ -60,4 +60,10 @@
|
||||
inner join pq_line_detail b on a.id=b.id
|
||||
where a.id = #{monitorId}
|
||||
</select>
|
||||
|
||||
<update id="updateLineRunFlag" >
|
||||
update pq_line_detail
|
||||
set run_flag = #{runFlag}
|
||||
where id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
|
||||
@@ -1548,4 +1548,50 @@
|
||||
t2.Power_Flag = #{powerFlag}
|
||||
</select>
|
||||
|
||||
<select id="getLineInfoVO" resultType="LineDetailVO">
|
||||
SELECT DISTINCT gd.NAME gdName,
|
||||
substation.NAME subName,
|
||||
device.NAME devName,
|
||||
deviceDetail.ip ip,
|
||||
line.NAME lineName,
|
||||
voltage.name volName,
|
||||
pq_line_detail.run_flag
|
||||
FROM pq_line line,
|
||||
pq_line_detail pq_line_detail,
|
||||
pq_line voltage,
|
||||
pq_line device,
|
||||
pq_device deviceDetail,
|
||||
pq_line substation,
|
||||
pq_line gd
|
||||
WHERE line.pid = voltage.id
|
||||
AND line.id = pq_line_detail.id
|
||||
AND voltage.pid = device.id
|
||||
AND device.pid = substation.id
|
||||
AND substation.pid = gd.id
|
||||
AND device.id = deviceDetail.id
|
||||
AND line.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getDeviceDetailData" resultType="DeviceVO">
|
||||
SELECT
|
||||
DISTINCT gd.NAME gdName,
|
||||
substation.NAME subName,
|
||||
pq_line.id devIndex,
|
||||
pq_line.NAME NAME,
|
||||
pq_device.Com_Flag,
|
||||
pq_device.Dev_Type,
|
||||
pq_device.IP,
|
||||
pq_device.Run_Flag
|
||||
FROM
|
||||
pq_line pq_line,
|
||||
pq_device pq_device,
|
||||
pq_line substation,
|
||||
pq_line gd
|
||||
WHERE
|
||||
pq_line.id = pq_device.id
|
||||
AND pq_line.pid = substation.id
|
||||
AND substation.pid = gd.id
|
||||
AND pq_line.id = #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -209,4 +209,6 @@ public interface LineService extends IService<Line> {
|
||||
List<LineDetailVO.Detail> getLineDetailByIds(List<String> ids);
|
||||
|
||||
LineALLInfoDTO getLineAllDetail(String id);
|
||||
|
||||
DeviceVO getDeviceDetailData(String id);
|
||||
}
|
||||
|
||||
@@ -642,6 +642,11 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
||||
return lineALLInfoDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceVO getDeviceDetailData(String id) {
|
||||
return this.baseMapper.getDeviceDetailData(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Overlimit> getOverLimitByList(PollutionParamDTO pollutionParamDTO) {
|
||||
return overlimitMapper.selectBatchIds(pollutionParamDTO.getLineList());
|
||||
|
||||
@@ -229,7 +229,6 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
||||
@Override
|
||||
public List<TerminalSelectTreeVO> getTerminalSelectTree(Integer level) {
|
||||
List<TerminalSelectTreeVO> resultList = new ArrayList<>();
|
||||
|
||||
DeviceInfoParam deviceInfoParam = new DeviceInfoParam();
|
||||
deviceInfoParam.setDeptIndex(RequestUtil.getDeptIndex());
|
||||
deviceInfoParam.setServerName(ServerEnum.HARMONIC.getName());
|
||||
@@ -251,13 +250,23 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
||||
terminalSelectTreeVO.setLabel(map.get(line.getPid()).getName() + "_" + line.getName());
|
||||
children.add(terminalSelectTreeVO);
|
||||
}
|
||||
|
||||
} else {
|
||||
List<Line> substationList = lineMapper.selectList(new LambdaQueryWrapper<Line>().in(Line::getId, generalDeviceDTO.getSubIndexes()));
|
||||
List<Line> devList = lineMapper.selectList(new LambdaQueryWrapper<Line>().in(Line::getId, generalDeviceDTO.getDeviceIndexes()));
|
||||
for (Line line : devList) {
|
||||
for (Line sub : substationList) {
|
||||
TerminalSelectTreeVO terminalSelectTreeVO = new TerminalSelectTreeVO();
|
||||
terminalSelectTreeVO.setValue(line.getId());
|
||||
terminalSelectTreeVO.setLabel(line.getName());
|
||||
terminalSelectTreeVO.setValue(sub.getId());
|
||||
terminalSelectTreeVO.setLabel(sub.getName());
|
||||
//根据变电站获取其下面所有的装置
|
||||
List<TerminalSelectTreeVO> devChildren = new ArrayList<>();
|
||||
List<Line> subDev = devList.stream().filter(dev -> dev.getPids().contains(sub.getId())).collect(Collectors.toList());
|
||||
for (Line line : subDev) {
|
||||
TerminalSelectTreeVO terminalSelectTreeLineVO = new TerminalSelectTreeVO();
|
||||
terminalSelectTreeLineVO.setValue(line.getId());
|
||||
terminalSelectTreeLineVO.setLabel(line.getName());
|
||||
devChildren.add(terminalSelectTreeLineVO);
|
||||
}
|
||||
terminalSelectTreeVO.setChildren(devChildren);
|
||||
children.add(terminalSelectTreeVO);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ whitelist:
|
||||
- /system-boot/file/**
|
||||
- /system-boot/area/**
|
||||
- /advance-boot/**
|
||||
#- /device-boot/**
|
||||
- /device-boot/**
|
||||
#- /system-boot/**
|
||||
#- /harmonic-boot/**
|
||||
#- /energy-boot/**
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.supervision.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.supervision.api.fallback.QuitRunningDeviceFeignClientFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
|
||||
/**
|
||||
* 流程实例 Api 接口
|
||||
*
|
||||
* @author hongawen
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.SUPERVISION, path = "/quitRunningDevice", fallbackFactory = QuitRunningDeviceFeignClientFallbackFactory.class)
|
||||
public interface QuitRunningDeviceFeignClient {
|
||||
|
||||
@GetMapping("/updateDeviceStatus")
|
||||
HttpResult<Object> updateDeviceStatus(@RequestParam("businessKey") String businessKey, @RequestParam("status")Integer status);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.njcn.supervision.api.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.supervision.api.QuitRunningDeviceFeignClient;
|
||||
import com.njcn.supervision.utils.SupervisionEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @version 1.0.0
|
||||
* @date 2022/3/16
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class QuitRunningDeviceFeignClientFallbackFactory implements FallbackFactory<QuitRunningDeviceFeignClient> {
|
||||
@Override
|
||||
public QuitRunningDeviceFeignClient create(Throwable throwable) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (throwable.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) throwable.getCause();
|
||||
exceptionEnum = SupervisionEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new QuitRunningDeviceFeignClient() {
|
||||
@Override
|
||||
public HttpResult<Object> updateDeviceStatus(String businessKey, Integer status) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "更新退运装置数据流程状态", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -30,6 +30,15 @@ public class QuitRunningDeviceVO extends BaseEntity implements Serializable{
|
||||
@ApiModelProperty(value = "设备编号")
|
||||
private String deviceId;
|
||||
|
||||
@ApiModelProperty("供电公司名称")
|
||||
private String gdName;
|
||||
|
||||
@ApiModelProperty("变电站名称")
|
||||
private String subName;
|
||||
|
||||
@ApiModelProperty("母线名称")
|
||||
private String volName;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@@ -42,6 +51,12 @@ public class QuitRunningDeviceVO extends BaseEntity implements Serializable{
|
||||
@ApiModelProperty(value = "设备类型")
|
||||
private Integer deviceType;
|
||||
|
||||
/**
|
||||
* 设备状态
|
||||
*/
|
||||
@ApiModelProperty(value = "设备状态")
|
||||
private Integer deviceStatus;
|
||||
|
||||
/**
|
||||
* 资产编号
|
||||
*/
|
||||
|
||||
@@ -36,6 +36,12 @@
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>pq-device-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-web</artifactId>
|
||||
|
||||
@@ -16,14 +16,12 @@ import com.njcn.supervision.service.device.IQuitRunningDeviceService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
|
||||
/**
|
||||
@@ -63,6 +61,25 @@ public class QuitRunningDeviceController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, runningDeviceId, methodDescribe);
|
||||
}
|
||||
|
||||
@GetMapping("/updateDeviceStatus")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@Operation(summary = "更新退运装置流程状态")
|
||||
public HttpResult<Object> updateDeviceStatus(String businessKey,Integer status) {
|
||||
String methodDescribe = getMethodDescribe("updateDeviceStatus");
|
||||
quitRunningDeviceService.updateDeviceStatus(businessKey,status);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@GetMapping("/getById")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@Operation(summary = "根据id获取设备的详细数据")
|
||||
public HttpResult<QuitRunningDeviceVO> getById(String id) {
|
||||
String methodDescribe = getMethodDescribe("getById");
|
||||
QuitRunningDeviceVO quitRunningDeviceVO = quitRunningDeviceService.getVOById(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, quitRunningDeviceVO, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class UserReportManageController extends BaseController {
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/removeUserReport")
|
||||
@ApiOperation("查询干扰源用户")
|
||||
@ApiOperation("删除干扰源用户记录")
|
||||
public HttpResult<Boolean> removeUserReport(@RequestParam("ids") List<String> ids){
|
||||
String methodDescribe = getMethodDescribe("removeUserReport");
|
||||
Boolean flag = userReportPOService.removeUserReport(ids);
|
||||
@@ -88,13 +88,16 @@ public class UserReportManageController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, userReportVO, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/updateUserReportStatus")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@Operation(summary = "根据id获取用户档案录入的详细数据")
|
||||
@Operation(summary = "更新用户数据流程状态")
|
||||
public HttpResult<Object> updateUserReportStatus(String businessKey,Integer status) {
|
||||
String methodDescribe = getMethodDescribe("updateUserReportStatus");
|
||||
userReportPOService.updateUserReportStatus(businessKey,status);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
<!--获取流程表单分页列表-->
|
||||
<select id="page" resultType="QuitRunningDeviceVO">
|
||||
SELECT
|
||||
supervision_user_report.id,
|
||||
supervision_user_report.device_id,
|
||||
supervision_user_report.device_type,
|
||||
supervision_user_report.property_no,
|
||||
supervision_user_report.report_path,
|
||||
supervision_user_report.process_instance_id,
|
||||
supervision_user_report.create_time,
|
||||
supervision_user_report.status
|
||||
supervision_quit_running_device.id,
|
||||
supervision_quit_running_device.device_id,
|
||||
supervision_quit_running_device.device_type,
|
||||
supervision_quit_running_device.property_no,
|
||||
supervision_quit_running_device.report_path,
|
||||
supervision_quit_running_device.process_instance_id,
|
||||
supervision_quit_running_device.create_time,
|
||||
supervision_quit_running_device.status
|
||||
FROM supervision_quit_running_device supervision_quit_running_device
|
||||
WHERE ${ew.sqlSegment}
|
||||
</select>
|
||||
|
||||
@@ -19,4 +19,8 @@ public interface IQuitRunningDeviceService extends IService<QuitRunningDevice> {
|
||||
String addRunningDevice(QuitRunningDeviceParam quitRunningDeviceParam);
|
||||
|
||||
Page<QuitRunningDeviceVO> getQuitRunningDevice(QuitRunningDeviceParam.QuitRunningDeviceQueryParam quitRunningDeviceQueryParam);
|
||||
|
||||
void updateDeviceStatus(String businessKey, Integer status);
|
||||
|
||||
QuitRunningDeviceVO getVOById(String id);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,21 @@
|
||||
package com.njcn.supervision.service.device.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.bpm.api.BpmProcessFeignClient;
|
||||
import com.njcn.bpm.enums.BpmProcessInstanceStatusEnum;
|
||||
import com.njcn.bpm.enums.BpmTaskStatusEnum;
|
||||
import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.device.biz.enums.RunFlagEnum;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.pojo.po.line.LineInfoVO;
|
||||
import com.njcn.device.pq.pojo.vo.DeviceVO;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailVO;
|
||||
import com.njcn.supervision.mapper.device.QuitRunningDeviceMapper;
|
||||
import com.njcn.supervision.pojo.param.device.QuitRunningDeviceParam;
|
||||
import com.njcn.supervision.pojo.po.device.QuitRunningDevice;
|
||||
@@ -19,6 +27,7 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -34,8 +43,12 @@ import java.util.Objects;
|
||||
@RequiredArgsConstructor
|
||||
public class QuitRunningDeviceServiceImpl extends ServiceImpl<QuitRunningDeviceMapper, QuitRunningDevice> implements IQuitRunningDeviceService {
|
||||
|
||||
|
||||
|
||||
private final BpmProcessFeignClient bpmProcessFeignClient;
|
||||
|
||||
private final LineFeignClient lineFeignClient;
|
||||
|
||||
/**
|
||||
* 设备退运对应的流程定义 KEY
|
||||
*/
|
||||
@@ -80,7 +93,76 @@ public class QuitRunningDeviceServiceImpl extends ServiceImpl<QuitRunningDeviceM
|
||||
}
|
||||
quitRunningDeviceVOQueryWrapper.orderByDesc("supervision_quit_running_device.create_time");
|
||||
//todo...根据设备id获取详细数据用于回显,待会做
|
||||
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(quitRunningDeviceQueryParam), PageFactory.getPageSize(quitRunningDeviceQueryParam)), quitRunningDeviceVOQueryWrapper);
|
||||
Page<QuitRunningDeviceVO> page = this.baseMapper.page(new Page<>(PageFactory.getPageNum(quitRunningDeviceQueryParam), PageFactory.getPageSize(quitRunningDeviceQueryParam)), quitRunningDeviceVOQueryWrapper);
|
||||
List<QuitRunningDeviceVO> records = page.getRecords();
|
||||
if(CollectionUtil.isNotEmpty(records)){
|
||||
for (QuitRunningDeviceVO record : records) {
|
||||
if(record.getDeviceType() == 1){
|
||||
DeviceVO deviceVO = lineFeignClient.getDeviceDetailData(record.getDeviceId()).getData();
|
||||
record.setDeviceName(deviceVO.getName());
|
||||
record.setDeviceStatus(deviceVO.getRunFlag());
|
||||
record.setGdName(deviceVO.getGdName());
|
||||
record.setSubName(deviceVO.getSubName());
|
||||
//获取装置详细信息
|
||||
}else if(record.getDeviceType() == 2){
|
||||
//获取监测点详细信息
|
||||
LineInfoVO lineInfoVO = lineFeignClient.getLineInfoVO(record.getDeviceId()).getData();
|
||||
record.setDeviceStatus(lineInfoVO.getRunFlag());
|
||||
record.setDeviceName(lineInfoVO.getVolName().concat("_").concat(lineInfoVO.getLineName()));
|
||||
record.setGdName(lineInfoVO.getGdName());
|
||||
record.setSubName(lineInfoVO.getSubName());
|
||||
}
|
||||
}
|
||||
}
|
||||
page.setRecords(records);
|
||||
return page;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 监听该流程的状态
|
||||
*/
|
||||
@Override
|
||||
public void updateDeviceStatus(String businessKey, Integer status) {
|
||||
QuitRunningDevice quitRunningDevice = this.baseMapper.selectById(businessKey);
|
||||
//如果状态为审批通过
|
||||
if(status.equals(BpmProcessInstanceStatusEnum.APPROVE.getStatus())){
|
||||
//通过,则需要远程将该装置调整为退运
|
||||
if(quitRunningDevice.getDeviceType() == 1){
|
||||
//修改装置
|
||||
lineFeignClient.updateDeviceRunFlag(quitRunningDevice.getDeviceId(), RunFlagEnum.QUIT.getStatus());
|
||||
}else if(quitRunningDevice.getDeviceType() == 2){
|
||||
//修改监测点
|
||||
lineFeignClient.updateLineRunFlag(quitRunningDevice.getDeviceId(),RunFlagEnum.QUIT.getStatus());
|
||||
}
|
||||
}
|
||||
quitRunningDevice.setStatus(status);
|
||||
this.updateById(quitRunningDevice);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QuitRunningDeviceVO getVOById(String id) {
|
||||
QuitRunningDevice quitRunningDevice = this.baseMapper.selectById(id);
|
||||
QuitRunningDeviceVO quitRunningDeviceVO = new QuitRunningDeviceVO();
|
||||
BeanUtils.copyProperties(quitRunningDevice, quitRunningDeviceVO);
|
||||
//通过,则需要远程将该装置调整为退运
|
||||
if(quitRunningDeviceVO.getDeviceType() == 1){
|
||||
DeviceVO deviceVO = lineFeignClient.getDeviceDetailData(quitRunningDeviceVO.getDeviceId()).getData();
|
||||
quitRunningDeviceVO.setDeviceName(deviceVO.getName());
|
||||
quitRunningDeviceVO.setDeviceStatus(deviceVO.getRunFlag());
|
||||
quitRunningDeviceVO.setGdName(deviceVO.getGdName());
|
||||
quitRunningDeviceVO.setSubName(deviceVO.getSubName());
|
||||
//获取装置详细信息
|
||||
}else if(quitRunningDeviceVO.getDeviceType() == 2){
|
||||
//获取监测点详细信息
|
||||
LineInfoVO lineInfoVO = lineFeignClient.getLineInfoVO(quitRunningDeviceVO.getDeviceId()).getData();
|
||||
quitRunningDeviceVO.setDeviceStatus(lineInfoVO.getRunFlag());
|
||||
quitRunningDeviceVO.setDeviceName(lineInfoVO.getVolName().concat("_").concat(lineInfoVO.getLineName()));
|
||||
quitRunningDeviceVO.setGdName(lineInfoVO.getGdName());
|
||||
quitRunningDeviceVO.setSubName(lineInfoVO.getSubName());
|
||||
quitRunningDeviceVO.setVolName(lineInfoVO.getVolName());
|
||||
}
|
||||
return quitRunningDeviceVO;
|
||||
}
|
||||
|
||||
private void checkDeviceStatus(QuitRunningDeviceParam quitRunningDeviceParam) {
|
||||
|
||||
@@ -569,7 +569,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
||||
@Override
|
||||
public List<User> simpleList() {
|
||||
LambdaQueryWrapper<User> userLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
userLambdaQueryWrapper.select(User::getId, User::getName).eq(User::getState, DataStateEnum.ENABLE.getCode());
|
||||
userLambdaQueryWrapper.select(User::getId, User::getName).eq(User::getState, DataStateEnum.ENABLE.getCode()).eq(User::getType,2);
|
||||
return this.baseMapper.selectList(userLambdaQueryWrapper);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user