feat: 流程中心-办理
This commit is contained in:
+12
@@ -89,4 +89,16 @@ public class ProcessCenterController {
|
||||
public Result<?> draftList(@Valid CenterQueryVO centerQueryVO) {
|
||||
return Result.OK(draftService.getDraftList(centerQueryVO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 办理
|
||||
* @param processInstanceId
|
||||
*/
|
||||
@AutoLog(value = "流程中心-办理")
|
||||
@ApiOperation(value="流程中心-办理", notes="流程中心-办理")
|
||||
@GetMapping("/handle")
|
||||
public Result<?> handle(@RequestParam("processInstanceId") String processInstanceId) {
|
||||
return Result.OK(actFlowCommonService.handleTask(processInstanceId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+40
-6
@@ -4,6 +4,7 @@ import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.activiti.process.common.entity.CenterQueryVO;
|
||||
import com.jero.modules.activiti.process.common.enums.ProcessType;
|
||||
import com.jero.modules.activiti.util.SpringContextUtil;
|
||||
import com.jero.modules.sys.utils.UserUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -19,10 +20,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@@ -59,7 +57,7 @@ public class ActFlowCommonService {
|
||||
variables.put("pass", true);
|
||||
// 启动流程
|
||||
ProcessInstance processInstance = runtimeService.startProcessInstanceById(latestProcessDefinition.getId(), variables);
|
||||
// 流程实例ID
|
||||
// 流程定义ID
|
||||
String processDefinitionId = processInstance.getProcessDefinitionId();
|
||||
log.info("【启动流程】- 成功,processDefinitionId:{}", processDefinitionId);
|
||||
return processInstance;
|
||||
@@ -148,7 +146,7 @@ public class ActFlowCommonService {
|
||||
.createProcessInstanceQuery()
|
||||
.processInstanceId(task.getProcessInstanceId())
|
||||
.singleResult();
|
||||
String prcId = processInstance.getId();
|
||||
|
||||
//TODO 根据流程Id找到对应业务流程实体
|
||||
|
||||
listMap.add(map);
|
||||
@@ -184,4 +182,40 @@ public class ActFlowCommonService {
|
||||
public boolean taskExists(String taskId) {
|
||||
return taskService.createTaskQuery().taskId(taskId).singleResult() != null;
|
||||
}
|
||||
|
||||
public String getProcessKeyByInstanceId(String processInstanceId) {
|
||||
// 1. 根据流程实例ID获取流程实例
|
||||
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery()
|
||||
.processInstanceId(processInstanceId)
|
||||
.singleResult();
|
||||
|
||||
// 2. 从流程实例中获取流程定义ID
|
||||
String processDefinitionId = processInstance.getProcessDefinitionId();
|
||||
|
||||
// 3. 查询流程定义
|
||||
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
|
||||
.processDefinitionId(processDefinitionId)
|
||||
.singleResult();
|
||||
|
||||
// 4. 从流程定义中获取key
|
||||
return processDefinition.getKey();
|
||||
}
|
||||
|
||||
/**
|
||||
* 办理任务
|
||||
* @param processInstanceId
|
||||
* @return
|
||||
*/
|
||||
public Object handleTask(String processInstanceId) {
|
||||
String processKey = getProcessKeyByInstanceId(processInstanceId);
|
||||
Object result = null;
|
||||
switch (processKey) {
|
||||
case "es-init-change":
|
||||
IActFlowCustomService service = (IActFlowCustomService) SpringContextUtil.getBean(ProcessType.ES_INIT_CHANGE.getServiceClassName());
|
||||
result = service.getHandleData(processInstanceId);
|
||||
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
+6
@@ -28,4 +28,10 @@ public interface IActFlowCustomService {
|
||||
* @param id
|
||||
*/
|
||||
void endRunTask(String id);
|
||||
|
||||
/**
|
||||
* 获取办理数据
|
||||
* @param id
|
||||
*/
|
||||
Object getHandleData(String id);
|
||||
}
|
||||
+1
-1
@@ -158,7 +158,7 @@ public class ProcessEsInitChange implements Serializable {
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
private Date orginDraftPlannedCompleteDate;
|
||||
private Date originDraftPlannedCompleteDate;
|
||||
|
||||
/**
|
||||
* 原征求意见稿计划完成日期
|
||||
|
||||
+8
@@ -82,6 +82,14 @@ public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitCha
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getHandleData(String processInstanceId) {
|
||||
LambdaQueryWrapper<ProcessEsInitChange> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(ProcessEsInitChange::getProcessInstanceId, processInstanceId);
|
||||
lambdaQueryWrapper.eq(ProcessEsInitChange::getDelFlag, YesOrNoEnum.NO.getValue());
|
||||
return list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startInitChange(List<ProcessEsInitChange> esInitChangeList) {
|
||||
// 校验企标编号是否冲突
|
||||
|
||||
Reference in New Issue
Block a user