Commit be352b8b authored by 刘林's avatar 刘林

fix:(jg) :启停业务单与流程不一致问题接口开发

parent aac04a0a
...@@ -100,4 +100,17 @@ public class JgEnableDisableController extends BaseController { ...@@ -100,4 +100,17 @@ public class JgEnableDisableController extends BaseController {
public ResponseModel<Object> detail(@RequestParam("sequenceNbr") Long sequenceNbr) { public ResponseModel<Object> detail(@RequestParam("sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(jgEnableDisableServiceImpl.getDetail(sequenceNbr, getSelectedOrgInfo().getCompany())); return ResponseHelper.buildResponse(jgEnableDisableServiceImpl.getDetail(sequenceNbr, getSelectedOrgInfo().getCompany()));
} }
/**
* 处理设备启用停用流程结束,业务未结束单子问题
* @param applyNo 申请单号
* @return s
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/handleEnableDisableWrongData")
@ApiOperation(httpMethod = "POST", value = "处理设备启用停用流程结束,业务未结束单子问题", notes = "处理设备启用停用流程结束,业务未结束单子问题")
public ResponseModel<Object> handleEnableDisableWrongData(@RequestParam("applyNo") String applyNo) {
jgEnableDisableServiceImpl.handleEnableDisableWrongData(applyNo);
return ResponseHelper.buildResponse("ok");
}
} }
...@@ -13,10 +13,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisKey; ...@@ -13,10 +13,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.biz.refresh.DataRefreshEvent; import com.yeejoin.amos.boot.module.common.biz.refresh.DataRefreshEvent;
import com.yeejoin.amos.boot.module.jg.api.dto.*; import com.yeejoin.amos.boot.module.jg.api.dto.*;
import com.yeejoin.amos.boot.module.jg.api.entity.JgEnableDisable; import com.yeejoin.amos.boot.module.jg.api.entity.*;
import com.yeejoin.amos.boot.module.jg.api.entity.JgEnableDisableEq;
import com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationManage;
import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.CertificateStatusEnum; import com.yeejoin.amos.boot.module.jg.api.enums.CertificateStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
...@@ -858,4 +855,41 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -858,4 +855,41 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
commonService.saveExecuteFlowData2Redis(jgEnableDisable.getInstanceId(), this.buildInstanceRuntimeData(jgEnableDisable)); commonService.saveExecuteFlowData2Redis(jgEnableDisable.getInstanceId(), this.buildInstanceRuntimeData(jgEnableDisable));
} }
public void handleEnableDisableWrongData(String applyNo) {
JgEnableDisable jgEnableDisable = this.baseMapper.selectOne(new LambdaQueryWrapper<JgEnableDisable>()
.eq(JgEnableDisable::getApplyNo, applyNo)
.eq(JgEnableDisable::getIsDelete, 0));
WorkflowResultDto workflowResultDto = new WorkflowResultDto();
workflowResultDto.setNextTaskCode("已完成");
workflowResultDto.setNextTaskId(jgEnableDisable.getNextTaskId());
workflowResultDto.setNextExecutorUserIds(jgEnableDisable.getNextExecuteUserIds());
if (StringUtils.isEmpty(workflowResultDto.getNextExecutorRoleIds())) {
jgEnableDisable.setPromoter("");
jgEnableDisable.setAuditPassDate(new Date());
jgEnableDisable.setAuditStatus(String.valueOf(FlowStatusEnum.TO_BE_FINISHED.getName()));
// 上个代办改为已办
HashMap<String, Object> taskMap = new HashMap<>();
taskMap.put("taskStatus", FlowStatusEnum.TO_BE_FINISHED.getCode());
taskMap.put("taskStatusLabel", FlowStatusEnum.TO_BE_FINISHED.getName());
taskMap.put("relationId", jgEnableDisable.getInstanceId());
taskMap.put("flowStatus", FlowStatusEnum.TO_BE_FINISHED.getCode());
taskMap.put("flowStatusLabel", FlowStatusEnum.TO_BE_FINISHED.getName());
TaskMessageDto taskMessageDto = new TaskMessageDto();
BeanUtils.copyProperties(jgEnableDisable, taskMessageDto);
taskMap.put("model", jgEnableDisable);
// 更新业务数据
updateInfoOther(jgEnableDisable);
TaskV2Model taskV2Model1 = commonService.updateTaskModel(taskMap);
// 完成后发送数据刷新消息
this.sendDataRefreshMsg(jgEnableDisable);
// 创建设备履历
this.createResume(jgEnableDisable, taskV2Model1.getRoutePath());
}
jgEnableDisable.setNextExecuteUserIds(workflowResultDto.getNextExecutorUserIds());
jgEnableDisable.setNextTaskId(workflowResultDto.getNextTaskId());
this.baseMapper.updateById(jgEnableDisable);
// redis流程实时数据更新
commonService.saveExecuteFlowData2Redis(jgEnableDisable.getInstanceId(), this.buildInstanceRuntimeData(jgEnableDisable));
this.delRepeatUseEquipData(jgEnableDisable);
}
} }
\ No newline at end of file
...@@ -38,7 +38,6 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum; ...@@ -38,7 +38,6 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgUseInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgUseInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.SuperviseInfoMapper;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.systemctl.model.TaskV2Model; import com.yeejoin.amos.feign.systemctl.model.TaskV2Model;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO; import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
...@@ -1156,5 +1155,6 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc ...@@ -1156,5 +1155,6 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
this.sendDataRefreshMsg(jgScrapCancel); this.sendDataRefreshMsg(jgScrapCancel);
// 创建设备履历 // 创建设备履历
this.createResume(jgScrapCancel, taskV2Model.getRoutePath()); this.createResume(jgScrapCancel, taskV2Model.getRoutePath());
this.getBaseMapper().updateById(jgScrapCancel);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment