Commit ca9dbe7a authored by 刘凡's avatar 刘凡

优化:移装变更登记 撤回报错

parent ff3987ef
package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -11,13 +10,9 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jg.api.dto.TaskModelDto;
import com.yeejoin.amos.boot.module.jg.api.dto.WorkflowResultDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationReform;
import com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationTransfer;
import com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationTransferEq;
import com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory;
import com.yeejoin.amos.boot.module.jg.api.entity.*;
import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.EquipTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.UseStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgChangeRegistrationNameEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgChangeRegistrationReformEqMapper;
......@@ -42,13 +37,8 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgOtherInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgRegisterInfoMapper;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.model.TaskV2Model;
import com.yeejoin.amos.feign.workflow.Workflow;
import com.yeejoin.amos.feign.workflow.model.*;
import fr.opensagres.xdocreport.core.io.IOUtils;
import org.apache.commons.collections.CollectionUtils;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse;
......@@ -62,7 +52,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
......@@ -74,14 +63,10 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.time.LocalDate;
import java.util.*;
import java.util.stream.Collectors;
import static com.alibaba.fastjson.JSON.parseArray;
import static com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum.JG_CHANGE_REGISTRATION;
/**
* 移装变更登记登记服务实现类
*
......@@ -393,22 +378,27 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
ProcessTaskDTO processTask = icmWorkflowService.rollBack(instanceId);
WorkflowResultDto workflowResult = commonService.buildWorkFlowInfo(Collections.singletonList(processTask)).get(0);
String taskCode = Optional.ofNullable(workflowResult.getNextTaskCode()).orElse("");
String role = Optional.ofNullable(workflowResult.getNextExecutorRoleIds()).orElse("");
String taskCode = "";
String role = "";
if(!ValidationUtil.isEmpty(workflowResult)){
taskCode = Optional.ofNullable(workflowResult.getNextTaskCode()).orElse("");
role = Optional.ofNullable(workflowResult.getNextExecutorRoleIds()).orElse("");
jgTransfer.setNextTaskId(workflowResult.getNextTaskId());
// 更新下一步可执行人
jgTransfer.setNextExecuteUserIds(workflowResult.getNextExecutorUserIds());
}
if (!ObjectUtils.isEmpty(taskCode)) {
jgTransfer.setAuditStatus(WorkFlowStatusEnum.getMessage(taskCode).getRollBack());
jgTransfer.setStatus(WorkFlowStatusEnum.getMessage(taskCode).getRollBack());
}
jgTransfer.setPromoter(reginParams.getUserModel().getUserId());
jgTransfer.setNextExecutorIds(role);
// 更新下一步可执行人
jgTransfer.setNextExecuteUserIds(workflowResult.getNextExecutorUserIds());
this.update(jgTransfer, lambda);
//待办 撤回
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(jgTransfer));
jsonObject.put("nextTaskId", jgTransfer.getNextTaskId());
jsonObject.put("nextExecuteUser", jgTransfer.getNextExecutorIds());
JgChangeRegistrationTransfer data = this.baseMapper.selectOne(lambda);
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(data));
jsonObject.put("nextTaskId", data.getNextTaskId());
jsonObject.put("nextExecuteUser", data.getNextExecutorIds());
jsonObject.put("taskType",BusinessTypeEnum.JG_CHANGE_REGISTRATION.getCode());
commonService.rollbackTask(instanceId, JSON.parseObject(JSON.toJSONString(jgTransfer)));
}
......
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