Commit d86a5271 authored by hezhuozhi's avatar hezhuozhi

26854 【智信户用(管理端)】迁移工作台相关代码

parent c05bc689
package com.yeejoin.amos.boot.module.hygf.api.Enum;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 此处是为了待办提供的流程状态 提供流程Key对应此时流程的状态名称
*/
@Getter
@AllArgsConstructor
public enum FlowKeyTodoEnum {
TSRZ(1001, "待推送", "AbarbeitungWaitPush", "推送融资"),
JXSZG(1002, "待整改", "WaitAbarbeitung", "经销商整改"),
RZSH(1003, "待审核", "FinancingAudit", "融资审核"),
XXFK(1004, "待放款", "AuditPass", "线下放款"),
JXSGLYSH(1005, "待经销商管理员审核", "jxs_03", "经销商管理员审核"),
;
private final int code;
private final String dealName;
private final String flowNodeKey;
private final String flowNodeName;
public static FlowKeyTodoEnum getEumByFlowNodeKey(String flowNodeKey) {
for (FlowKeyTodoEnum statusEnum : FlowKeyTodoEnum.values()) {
if (statusEnum.getFlowNodeKey().equals(flowNodeKey)) {
return statusEnum;
}
}
return null;
}
}
\ No newline at end of file
...@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.hygf.api.dto; ...@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.hygf.api.dto;
import lombok.Data; import lombok.Data;
import java.util.Date;
@Data @Data
public class WorkflowResultDto { public class WorkflowResultDto {
...@@ -11,11 +13,6 @@ public class WorkflowResultDto { ...@@ -11,11 +13,6 @@ public class WorkflowResultDto {
*/ */
String instanceId; String instanceId;
// /**
// * 执行人角色
// */
// String nextExecutorIds;
String executorId; String executorId;
...@@ -49,4 +46,22 @@ public class WorkflowResultDto { ...@@ -49,4 +46,22 @@ public class WorkflowResultDto {
String nextNodeKey; String nextNodeKey;
/**
* 任务发起人id 不变 第一次提交的人
* 从业务表中 created_uesr_id
*/
private String startUserId;
/**
* 任务发起人名称 不变
* 名字
*/
private String startUser;
/**
* 任务发起人所在单位 不变
*/
private String startUserCompanyName;
/**
* 任务发起人发起时间 不变
*/
private Date startDate;
} }
...@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.hygf.biz.service.impl; ...@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; 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.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
...@@ -24,6 +23,10 @@ import com.yeejoin.amos.component.robot.AmosRequestContext; ...@@ -24,6 +23,10 @@ import com.yeejoin.amos.component.robot.AmosRequestContext;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel; import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO;
import com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO;
import com.yeejoin.amos.feign.workflow.model.TaskResultDTO;
import io.seata.spring.annotation.GlobalTransactional; import io.seata.spring.annotation.GlobalTransactional;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
...@@ -32,15 +35,12 @@ import org.springframework.beans.BeanUtils; ...@@ -32,15 +35,12 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.exception.BaseException; import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/** /**
* 勘察信息服务实现类 * 勘察信息服务实现类
...@@ -54,30 +54,28 @@ public class SurveyInformationServiceImpl ...@@ -54,30 +54,28 @@ public class SurveyInformationServiceImpl
extends BaseService<SurveyInformationDto, SurveyInformation, SurveyInformationMapper> extends BaseService<SurveyInformationDto, SurveyInformation, SurveyInformationMapper>
implements ISurveyInformationService { implements ISurveyInformationService {
private static final String regionRedis = "app_region_redis";
private static final String OPERATION_TYPE_SUBMIT = "submit";
private static final String OPERATION_TYPE_APPLY = "apply";
private static final String IDX_REQUEST_STATE = "200";
@Autowired
protected EmqKeeper emqKeeper;
@Autowired @Autowired
SurveyDetailsServiceImpl surveyDetailsService; SurveyDetailsServiceImpl surveyDetailsService;
@Autowired @Autowired
InformationServiceImpl informationService; InformationServiceImpl informationService;
@Autowired @Autowired
ExtendedInformationServiceImpl extendedInformationService; ExtendedInformationServiceImpl extendedInformationService;
@Autowired @Autowired
CommercialServiceImpl commercialService; CommercialServiceImpl commercialService;
@Autowired @Autowired
PeasantHouseholdServiceImpl peasantHouseholdServiceImpl; PeasantHouseholdServiceImpl peasantHouseholdServiceImpl;
@Autowired @Autowired
DesignInformationServiceImpl designInformationService; DesignInformationServiceImpl designInformationService;
@Autowired @Autowired
WorkflowFeignClient workflowFeignClient; WorkflowFeignClient workflowFeignClient;
@Autowired @Autowired
RedisUtils redisUtils; RedisUtils redisUtils;
@Autowired @Autowired
IdxFeginService idxFeginService; IdxFeginService idxFeginService;
@Autowired @Autowired
...@@ -88,22 +86,10 @@ public class SurveyInformationServiceImpl ...@@ -88,22 +86,10 @@ public class SurveyInformationServiceImpl
ToDoTasksMapper toDoTasksMapper; ToDoTasksMapper toDoTasksMapper;
@Autowired @Autowired
UserMessageMapper userMessageMapper; UserMessageMapper userMessageMapper;
@Value("${power.station.examine.pageId}")
private long pageId;
@Autowired
protected EmqKeeper emqKeeper;
@Value("${power.station.examine.planId}")
private String planId;
private static final String regionRedis = "app_region_redis";
private static final String OPERATION_TYPE_SUBMIT = "submit";
private static final String OPERATION_TYPE_APPLY = "apply";
private static final String IDX_REQUEST_STATE = "200";
@Autowired @Autowired
PersonnelBusinessMapper personnelBusinessMapper; PersonnelBusinessMapper personnelBusinessMapper;
@Autowired @Autowired
PeasantHouseholdMapper peasantHouseholdMapper; PeasantHouseholdMapper peasantHouseholdMapper;
@Autowired @Autowired
WorkOrderMapper workOrderMapper; WorkOrderMapper workOrderMapper;
@Autowired @Autowired
...@@ -114,7 +100,6 @@ public class SurveyInformationServiceImpl ...@@ -114,7 +100,6 @@ public class SurveyInformationServiceImpl
ConstructionRecordsMapper constructionRecordsMapper; ConstructionRecordsMapper constructionRecordsMapper;
@Autowired @Autowired
BasicGridAcceptanceMapper basicGridAcceptanceMapper; BasicGridAcceptanceMapper basicGridAcceptanceMapper;
@Autowired @Autowired
SurveyInformationMapper surveyInformationMapper; SurveyInformationMapper surveyInformationMapper;
@Autowired @Autowired
...@@ -125,9 +110,16 @@ public class SurveyInformationServiceImpl ...@@ -125,9 +110,16 @@ public class SurveyInformationServiceImpl
WorkOrderPowerStationMapper workOrderPowerStationMapper; WorkOrderPowerStationMapper workOrderPowerStationMapper;
@Autowired @Autowired
AmosRequestContext requestContext; AmosRequestContext requestContext;
// @Autowired
// WorkflowImpl workflow;
@Autowired @Autowired
WorkflowImpl workflow; CommonServiceImpl commonService;
@Autowired
WorkFlowService workFlowService;
@Value("${power.station.examine.pageId}")
private long pageId;
@Value("${power.station.examine.planId}")
private String planId;
/** /**
* 分页查询 * 分页查询
...@@ -313,28 +305,50 @@ public class SurveyInformationServiceImpl ...@@ -313,28 +305,50 @@ public class SurveyInformationServiceImpl
try { try {
BasicGridAcceptance basicGridAcceptance = new BasicGridAcceptance(); BasicGridAcceptance basicGridAcceptance = new BasicGridAcceptance();
List<ProcessTaskDTO> processTaskDTOS = new ArrayList();
if (ObjectUtils.isNotEmpty(powerStation)) { if (ObjectUtils.isNotEmpty(powerStation)) {
// 工作流执行一步 // 工作流执行一步
// taskId = powerStation.getTaskId(); // taskId = powerStation.getTaskId();
StandardDto standardDto = new StandardDto(); // StandardDto standardDto = new StandardDto();
standardDto.setResult("0"); // standardDto.setResult("0");
standardDto.setTaskId(powerStation.getFlowTaskId()); // standardDto.setTaskId(powerStation.getFlowTaskId());
VariableDto variable = new VariableDto(); // VariableDto variable = new VariableDto();
variable.setApprovalStatus("0"); // variable.setApprovalStatus("0");
standardDto.setVariable(variable); // standardDto.setVariable(variable);
workflow.standard(basicGridAcceptance, standardDto, requestContext.getUserId()); // workflow.standard(basicGridAcceptance, standardDto, requestContext.getUserId());
//执行流程
TaskResultDTO taskResultDTO = new TaskResultDTO();
taskResultDTO.setResult("0");
taskResultDTO.setTaskId(powerStation.getFlowTaskId());
HashMap<String, Object> variableMap = new HashMap<>();
variableMap.put("approvalStatus", "0");
taskResultDTO.setVariable(variableMap);
ProcessTaskDTO processTaskDTO = workFlowService.standard(basicGridAcceptance, taskResultDTO, requestContext.getUserId());
processTaskDTOS.add(processTaskDTO);
} else { } else {
// 第一步启动工作流 // 第一步启动工作流
// 发起工作流 // 发起工作流
// 调用工作流执行第一个节点 // 调用工作流执行第一个节点
ProcessDto processDto = new ProcessDto(); // ProcessDto processDto = new ProcessDto();
processDto.setBusinessKey(String.valueOf(peasantHousehold.getSequenceNbr())); // processDto.setBusinessKey(String.valueOf(peasantHousehold.getSequenceNbr()));
processDto.setProcessDefinitionKey("hygf_10001"); // processDto.setProcessDefinitionKey("hygf_10001");
StartProcessDto startProcessDto = new StartProcessDto(); // StartProcessDto startProcessDto = new StartProcessDto();
List<ProcessDto> process = new ArrayList<>(); // List<ProcessDto> process = new ArrayList<>();
process.add(processDto); // process.add(processDto);
startProcessDto.setProcess(process); // startProcessDto.setProcess(process);
workflow.startProcess(basicGridAcceptance, startProcessDto, requestContext.getUserId()); // workflow.startProcess(basicGridAcceptance, startProcessDto, requestContext.getUserId());
//开启工作流 并执行一步
ActWorkflowBatchDTO actWorkflowBatchDTO = new ActWorkflowBatchDTO();
List<ActWorkflowStartDTO> list = new ArrayList<>();
ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
dto.setProcessDefinitionKey(BusinessTypeEnum.HYGF_DZ_SH.getCode());
dto.setBusinessKey(String.valueOf(peasantHousehold.getSequenceNbr()));
dto.setCompleteFirstTask(true);
list.add(dto);
actWorkflowBatchDTO.setProcess(list);
processTaskDTOS = workFlowService.startBatch(actWorkflowBatchDTO);
basicGridAcceptance = workFlowService.getBasicGridAcceptance(basicGridAcceptance, processTaskDTOS, requestContext.getUserId());
powerStation = new PowerStation(); powerStation = new PowerStation();
} }
peasantHousehold.setSurveyOrNot(2); peasantHousehold.setSurveyOrNot(2);
...@@ -366,6 +380,8 @@ public class SurveyInformationServiceImpl ...@@ -366,6 +380,8 @@ public class SurveyInformationServiceImpl
long idsk = peasantHousehold.getSequenceNbr(); long idsk = peasantHousehold.getSequenceNbr();
up.eq(PeasantHousehold::getSequenceNbr, idsk); up.eq(PeasantHousehold::getSequenceNbr, idsk);
peasantHouseholdMapper.update(null, up); peasantHouseholdMapper.update(null, up);
List<WorkflowResultDto> workflowResultDtos = workFlowService.buildWorkFlowInfo(processTaskDTOS);
commonService.buildTaskModel(commonService.buildTaskModelDto(powerStation, workflowResultDtos.get(0), BusinessTypeEnum.HYGF_DZ_SH));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
...@@ -420,6 +436,7 @@ public class SurveyInformationServiceImpl ...@@ -420,6 +436,7 @@ public class SurveyInformationServiceImpl
// } // }
} }
public SurveyInfoAllDto querySurveyInfo(String surveyInformationId, String peasantHouseholdId, public SurveyInfoAllDto querySurveyInfo(String surveyInformationId, String peasantHouseholdId,
String processInstanceId, AgencyUserModel userInfo) { String processInstanceId, AgencyUserModel userInfo) {
......
[
{
"type": "AbarbeitungWaitPush",
"pageType": "",
"name": "推送融资",
"url": "/mixuap?appId=1678340647909617665&id=1774627124162859009"
},
{
"type": "WaitAbarbeitung",
"pageType": "",
"name": "经销商整改",
"url": "/mixuap?appId=1678340647909617665&id=1806150815363108865"
},
{
"type": "FinancingAudit",
"pageType": "",
"name": "融资审核",
"url": "/mixuap?appId=1678340647909617665&id=1775075407041662977"
},
{
"type": "AuditPass",
"pageType": "",
"name": "线下放款",
"url": "/mixuap?appId=1678340647909617665&id=1805852764345995265"
},
{
"type": "jxs_03",
"pageType": "",
"name": "经销商管理员审核",
"url": "/mixuap?appId=1678340647909617665&id=1686219644483956738"
}
]
\ No newline at end of file
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