部分bug修改

This commit is contained in:
hzj
2024-05-15 13:34:51 +08:00
parent 4ed7b399b3
commit a99c915235
8 changed files with 85 additions and 11 deletions

View File

@@ -21,11 +21,7 @@ import java.util.Map;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class SupervisionDevMainReportParam { public class SupervisionDevMainReportParam {
/**
* id
*/
@ApiModelProperty(value = "id")
private String id;
/** /**
* 填报人 * 填报人
@@ -78,6 +74,18 @@ public class SupervisionDevMainReportParam {
@ApiModelProperty(value = "用户名称") @ApiModelProperty(value = "用户名称")
private String userName; private String userName;
/**
*监测点台账信息
*/
@ApiModelProperty(value = "监测点台账信息")
private String lineFilePath;
/**
* 台终端账信息文件
*/
@ApiModelProperty(value = "监测点台账信息")
private String deviceFilePath;
/** /**
* 验收检验报告 * 验收检验报告
*/ */

View File

@@ -75,6 +75,16 @@ public class SupervisionDevMainReportPO extends BaseEntity {
*/ */
@TableField(value = "user_name") @TableField(value = "user_name")
private String userName; private String userName;
/**
*监测点台账信息
*/
@TableField(value = "line_file_path")
private String lineFilePath;
/**
* 台终端账信息文件
*/
@TableField(value = "device_file_path")
private String deviceFilePath;
/** /**
* 验收检验报告 * 验收检验报告

View File

@@ -24,6 +24,7 @@ import java.util.Map;
@NoArgsConstructor @NoArgsConstructor
public class SupervisionGeneralSurveyPlanVO extends BaseEntity { public class SupervisionGeneralSurveyPlanVO extends BaseEntity {
private String planNo;
/** /**
* 单位ID * 单位ID

View File

@@ -33,7 +33,7 @@ import org.springframework.web.bind.annotation.*;
@Slf4j @Slf4j
@RestController @RestController
@RequestMapping("/quitRunningDevice") @RequestMapping("/quitRunningDevice")
@Api(tags = "干扰源用户管理") @Api(tags = "设备退运管理")
@AllArgsConstructor @AllArgsConstructor
public class QuitRunningDeviceController extends BaseController { public class QuitRunningDeviceController extends BaseController {

View File

@@ -1,6 +1,7 @@
package com.njcn.supervision.controller.survey; package com.njcn.supervision.controller.survey;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
import com.njcn.common.pojo.annotation.OperateInfo; import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.constant.OperateType; import com.njcn.common.pojo.constant.OperateType;
import com.njcn.common.pojo.enums.common.LogEnum; import com.njcn.common.pojo.enums.common.LogEnum;
@@ -111,5 +112,15 @@ public class GeneralSurveyController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
} }
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
@PostMapping("/cancel")
@ApiOperation("取消普测计划")
@ApiImplicitParam(name = "cancelReqVO", value = "取消原因", required = true)
public HttpResult<String> cancelGeneralSurvey(@Validated @RequestBody BpmProcessInstanceCancelParam cancelReqVO) {
String methodDescribe = getMethodDescribe("cancelGeneralSurvey");
String id = supervisionGeneralSurveyPlanPOService.cancelGeneralSurvey(cancelReqVO);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, id, methodDescribe);
}
} }

View File

@@ -50,6 +50,8 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
private final BpmProcessFeignClient bpmProcessFeignClient; private final BpmProcessFeignClient bpmProcessFeignClient;
private final SupervisionTempDeviceReportService supervisionTempDeviceReportService; private final SupervisionTempDeviceReportService supervisionTempDeviceReportService;
private final SupervisionTempLineReportService supervisionTempLineReportService; private final SupervisionTempLineReportService supervisionTempLineReportService;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public String addDevReport(SupervisionDevMainReportParam supervisionDevMainReportParam) { public String addDevReport(SupervisionDevMainReportParam supervisionDevMainReportParam) {
@@ -113,8 +115,10 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
.eq(SupervisionDevMainReportPO::getState, DataStateEnum.ENABLE.getCode()); .eq(SupervisionDevMainReportPO::getState, DataStateEnum.ENABLE.getCode());
//更新的时候,需排除当前记录 //更新的时候,需排除当前记录
if (isExcludeSelf) { if (isExcludeSelf) {
if(supervisionDevMainReportParam instanceof SupervisionDevMainReportParam.SupervisionDevMainReportParamUpdate){
lambdaQueryWrapper.ne(SupervisionDevMainReportPO::getId, ((SupervisionDevMainReportParam.SupervisionDevMainReportParamUpdate) supervisionDevMainReportParam).getId());
}
lambdaQueryWrapper.ne(SupervisionDevMainReportPO::getId, supervisionDevMainReportParam.getId());
} }
List<SupervisionDevMainReportPO> list = this.baseMapper.selectList(lambdaQueryWrapper); List<SupervisionDevMainReportPO> list = this.baseMapper.selectList(lambdaQueryWrapper);

View File

@@ -2,6 +2,7 @@ package com.njcn.supervision.service.survey;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
import com.njcn.supervision.pojo.param.survey.SupervisionGeneralSurveyPlanParm; import com.njcn.supervision.pojo.param.survey.SupervisionGeneralSurveyPlanParm;
import com.njcn.supervision.pojo.po.survey.SupervisionGeneralSurveyPlanPO; import com.njcn.supervision.pojo.po.survey.SupervisionGeneralSurveyPlanPO;
import com.njcn.supervision.pojo.vo.survey.DeptSubstationVO; import com.njcn.supervision.pojo.vo.survey.DeptSubstationVO;
@@ -32,5 +33,7 @@ public interface SupervisionGeneralSurveyPlanPOService extends IService<Supervis
List<DeptSubstationVO> initDetpStataionTree(String orgId); List<DeptSubstationVO> initDetpStataionTree(String orgId);
void updateStatus(String businessKey, Integer status); void updateStatus(String businessKey, Integer status);
String cancelGeneralSurvey(BpmProcessInstanceCancelParam cancelReqVO);
} }

View File

@@ -7,13 +7,17 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.bpm.api.BpmProcessFeignClient; import com.njcn.bpm.api.BpmProcessFeignClient;
import com.njcn.bpm.enums.BpmProcessInstanceStatusEnum;
import com.njcn.bpm.enums.BpmTaskStatusEnum; import com.njcn.bpm.enums.BpmTaskStatusEnum;
import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO; import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
import com.njcn.common.pojo.enums.common.DataStateEnum; import com.njcn.common.pojo.enums.common.DataStateEnum;
import com.njcn.common.pojo.exception.BusinessException; import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.device.biz.commApi.CommTerminalGeneralClient; import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
import com.njcn.device.biz.pojo.dto.SubGetBase; import com.njcn.device.biz.pojo.dto.SubGetBase;
import com.njcn.device.biz.pojo.param.SubstationParam; import com.njcn.device.biz.pojo.param.SubstationParam;
import com.njcn.device.pq.api.LineFeignClient;
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
import com.njcn.supervision.enums.FlowStatusEnum; import com.njcn.supervision.enums.FlowStatusEnum;
import com.njcn.supervision.mapper.survey.SupervisionGeneralSurveyPlanPOMapper; import com.njcn.supervision.mapper.survey.SupervisionGeneralSurveyPlanPOMapper;
import com.njcn.supervision.pojo.param.survey.SupervisionGeneralSurveyPlanParm; import com.njcn.supervision.pojo.param.survey.SupervisionGeneralSurveyPlanParm;
@@ -56,6 +60,7 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl<Super
private final SupervisionGeneralSurveyPlanDetailPOService supervisionGeneralSurveyPlanDetailPOService; private final SupervisionGeneralSurveyPlanDetailPOService supervisionGeneralSurveyPlanDetailPOService;
private final BpmProcessFeignClient bpmProcessFeignClient; private final BpmProcessFeignClient bpmProcessFeignClient;
private final DeptFeignClient deptFeignClient; private final DeptFeignClient deptFeignClient;
private final LineFeignClient lineFeignClient;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@@ -89,7 +94,8 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl<Super
supervisionGeneralSurveyPlanDetailPO.setMeasurementPointId(""); supervisionGeneralSurveyPlanDetailPO.setMeasurementPointId("");
supervisionGeneralSurveyPlanDetailPO.setIsSurvey(0); supervisionGeneralSurveyPlanDetailPO.setIsSurvey(0);
}else { }else {
String subList = unitChildrenList.stream().map(String::valueOf).collect(Collectors.joining(",")); List<LineDetailDataVO> data = lineFeignClient.getLineDetailList(unitChildrenList).getData();
String subList = data.stream().map(LineDetailDataVO::getLineName).collect(Collectors.joining(","));
supervisionGeneralSurveyPlanDetailPO.setMeasurementPointId(subList); supervisionGeneralSurveyPlanDetailPO.setMeasurementPointId(subList);
supervisionGeneralSurveyPlanDetailPO.setIsSurvey(0); supervisionGeneralSurveyPlanDetailPO.setIsSurvey(0);
} }
@@ -127,7 +133,8 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl<Super
String planNo = supervisionGeneralSurveyPlanUpdate.getPlanNo(); String planNo = supervisionGeneralSurveyPlanUpdate.getPlanNo();
SupervisionGeneralSurveyPlanPO byId = this.getById(planNo); SupervisionGeneralSurveyPlanPO byId = this.getById(planNo);
BeanUtils.copyProperties(supervisionGeneralSurveyPlanUpdate, byId); BeanUtils.copyProperties(supervisionGeneralSurveyPlanUpdate, byId);
byId.setState(DataStateEnum.ENABLE.getCode());
byId.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
SubstationParam param = new SubstationParam(); SubstationParam param = new SubstationParam();
param.setPowerIds(supervisionGeneralSurveyPlanUpdate.getSubIds()); param.setPowerIds(supervisionGeneralSurveyPlanUpdate.getSubIds());
List<SubGetBase> stationList = commTerminalGeneralClient.tagOrIdGetSub(param).getData(); List<SubGetBase> stationList = commTerminalGeneralClient.tagOrIdGetSub(param).getData();
@@ -145,7 +152,9 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl<Super
supervisionGeneralSurveyPlanDetailPO.setMeasurementPointId(""); supervisionGeneralSurveyPlanDetailPO.setMeasurementPointId("");
supervisionGeneralSurveyPlanDetailPO.setIsSurvey(0); supervisionGeneralSurveyPlanDetailPO.setIsSurvey(0);
}else { }else {
String subList = unitChildrenList.stream().map(String::valueOf).collect(Collectors.joining(",")); List<LineDetailDataVO> data = lineFeignClient.getLineDetailList(unitChildrenList).getData();
String subList = data.stream().map(LineDetailDataVO::getLineName).collect(Collectors.joining(","));
supervisionGeneralSurveyPlanDetailPO.setMeasurementPointId(subList); supervisionGeneralSurveyPlanDetailPO.setMeasurementPointId(subList);
supervisionGeneralSurveyPlanDetailPO.setIsSurvey(1); supervisionGeneralSurveyPlanDetailPO.setIsSurvey(1);
} }
@@ -155,6 +164,18 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl<Super
//清除原有的 //清除原有的
supervisionGeneralSurveyPlanDetailPOService.remove(new QueryWrapper<SupervisionGeneralSurveyPlanDetailPO>().lambda().eq(SupervisionGeneralSurveyPlanDetailPO::getPlanNo,planNo)); supervisionGeneralSurveyPlanDetailPOService.remove(new QueryWrapper<SupervisionGeneralSurveyPlanDetailPO>().lambda().eq(SupervisionGeneralSurveyPlanDetailPO::getPlanNo,planNo));
supervisionGeneralSurveyPlanDetailPOService.saveOrUpdateBatchByMultiId(supervisionGeneralSurveyPlanDetailPOS, 500); supervisionGeneralSurveyPlanDetailPOService.saveOrUpdateBatchByMultiId(supervisionGeneralSurveyPlanDetailPOS, 500);
// 发起 BPM 流程
Map<String, Object> processInstanceVariables = new HashMap<>();
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(PROCESS_KEY);
bpmProcessInstanceCreateReqDTO.setBusinessKey(planNo);
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(supervisionGeneralSurveyPlanUpdate.getStartUserSelectAssignees());
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
String processInstanceId = bpmProcessFeignClient.createProcessInstance(RequestUtil.getUserIndex(),bpmProcessInstanceCreateReqDTO).getData();
// 将工作流的编号,更新到流程单中
byId.setProcessInstanceId(processInstanceId);
this.baseMapper.updateById(byId);
return true; return true;
} }
@@ -188,6 +209,10 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl<Super
page.getRecords().stream().forEach(temp->{ page.getRecords().stream().forEach(temp->{
temp.setOrgName((deptFeignClient.getDeptById(temp.getOrgNo()).getData().getName())); temp.setOrgName((deptFeignClient.getDeptById(temp.getOrgNo()).getData().getName()));
//获取普测下电站详情
List<SupervisionGeneralSurveyPlanDetailPO> list = supervisionGeneralSurveyPlanDetailPOService.lambdaQuery().eq(SupervisionGeneralSurveyPlanDetailPO::getPlanNo, temp.getPlanNo()).list();
temp.setSupervisionGeneralSurveyPlanDetailPOS(list);
temp.setSubIds(list.stream().map(SupervisionGeneralSurveyPlanDetailPO::getSubId).collect(Collectors.toList()));
}); });
return page; return page;
@@ -255,6 +280,18 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl<Super
this.lambdaUpdate().set(SupervisionGeneralSurveyPlanPO::getStatus,status).eq(SupervisionGeneralSurveyPlanPO::getPlanNo,businessKey).update(); this.lambdaUpdate().set(SupervisionGeneralSurveyPlanPO::getStatus,status).eq(SupervisionGeneralSurveyPlanPO::getPlanNo,businessKey).update();
} }
@Override
public String cancelGeneralSurvey(BpmProcessInstanceCancelParam cancelReqVO) {
//准备取消该流程,需要远程调用接口
SupervisionGeneralSurveyPlanPO supervisionGeneralSurveyPlanPO = this.baseMapper.selectById(cancelReqVO.getId());
//取消流程
bpmProcessFeignClient.cancelProcessInstanceByStartUser(cancelReqVO);
//更新状态
supervisionGeneralSurveyPlanPO.setStatus(BpmProcessInstanceStatusEnum.CANCEL.getStatus());
this.updateById(supervisionGeneralSurveyPlanPO);
return supervisionGeneralSurveyPlanPO.getPlanNo();
}
public List<DeptSubstationVO> recursion(DeptSubstationVO result, String orgdid) { public List<DeptSubstationVO> recursion(DeptSubstationVO result, String orgdid) {
List<DeptSubstationVO> deptSubstationVOList = new ArrayList<>(); List<DeptSubstationVO> deptSubstationVOList = new ArrayList<>();