add 标准法规入库/变更流程-查询流程

This commit is contained in:
liao
2023-11-08 11:48:28 +08:00
parent 54a8317b2e
commit b2ee8964fb
6 changed files with 93 additions and 29 deletions
@@ -68,6 +68,9 @@ public class ProcessDraft implements Serializable {
*/
private String projectId;
/**任务id*/
@ApiModelProperty(value = "任务id")
private java.lang.String taskId;
/**流程审批信息-备注*/
@ApiModelProperty(value = "流程审批信息-备注")
private java.lang.String handleText;
@@ -2,11 +2,13 @@ package com.jero.modules.activiti.process.fb.controller;
import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.aspect.annotation.DictPoint;
import com.jero.modules.activiti.process.common.entity.TransferVO;
import com.jero.modules.activiti.process.fb.entity.ProcessFbEntryChange;
import com.jero.modules.activiti.process.fb.service.IProcessFbEntryChangeService;
import com.jero.modules.activiti.process.fb.vo.ProcessInfoVO;
import com.jero.modules.laws.common.constant.ResultCommon;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import com.jero.common.system.base.controller.JeroController;
@@ -31,12 +33,17 @@ public class ProcessFbEntryChangeController extends JeroController<ProcessFbEntr
@Autowired
private IProcessFbEntryChangeService processFbEntryChangeService;
@AutoLog(value = "标准法规入库_变更流程-通过id查询")
@ApiOperation(value = "标准法规入库_变更流程-通过id查询", notes = "标准法规入库_变更流程-通过id查询")
@GetMapping(value = "/queryBusinessInfo")
public Result<ProcessFbEntryChange> queryBusinessInfo(@RequestParam(name = "id") String id) {
ProcessFbEntryChange processFbEntryChange = processFbEntryChangeService.queryBusinessInfo(id);
return Result.OK(processFbEntryChange);
@DictPoint
@GetMapping("/queryProcessInfoVO")
@AutoLog(value = "标准法规入库_变更流程-查询流程信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "draftId", value = "草稿id"),
@ApiImplicitParam(name = "processInstanceId", value = "流程实例id")
})
@ApiOperation("标准法规入库_变更流程-查询流程信息")
public Result<ProcessInfoVO<ProcessFbEntryChange>> queryProcessInfoVO(String draftId, String processInstanceId){
ProcessInfoVO<ProcessFbEntryChange> processInfoVO = processFbEntryChangeService.queryProcessInfoVO(draftId, processInstanceId);
return Result.OK(processInfoVO);
}
@AutoLog(value = "标准法规入库_变更流程-发起流程")
@@ -3,7 +3,6 @@ package com.jero.modules.activiti.process.fb.service;
import com.jero.modules.activiti.process.fb.entity.ProcessFbEntryChange;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.modules.activiti.process.fb.vo.ProcessInfoVO;
import com.jero.modules.laws.dataCenter.entity.LawsDataCenterFile;
/**
* @Description: 标准法规入库/变更流程
@@ -26,13 +25,6 @@ public interface IProcessFbEntryChangeService extends IService<ProcessFbEntryCha
**/
void editBusinessInfo(ProcessFbEntryChange processFbEntryChange);
/**
* @Author: liao
* @Date: 2023/11/2 16:34
* @Description: 通过id查询
**/
ProcessFbEntryChange queryBusinessInfo(String id);
/**
* @Author: liao
* @Date: 2023/11/3 10:57
@@ -60,4 +52,11 @@ public interface IProcessFbEntryChangeService extends IService<ProcessFbEntryCha
* @Description: 保存为草稿
**/
void saveToDraft(ProcessInfoVO<ProcessFbEntryChange> processInfoVO);
/**
* @Author: liao
* @Date: 2023/11/8 11:12
* @Description: 查询流程信息
**/
ProcessInfoVO<ProcessFbEntryChange> queryProcessInfoVO(String draftId, String processInstanceId);
}
@@ -71,4 +71,11 @@ public interface IProcessHandleService {
* @Description: 根据流程定义key获取最新版本的流程定义id
**/
String getDefinitionIdByKey(String definitionKey);
/**
* @Author: liao
* @Date: 2023/11/8 11:16
* @Description: 查询流程信息
**/
ProcessInfoVO queryProcessInfoVO(String draftId, String processInstanceId);
}
@@ -81,16 +81,6 @@ public class ProcessFbEntryChangeServiceImpl extends ServiceImpl<ProcessFbEntryC
processFbEntryChange.setStandardNumber((String) parameterMap.get(FieldCommon.STANDARD_NUMBER));
}
/**
* @Author: liao
* @Date: 2023/11/2 16:34
* @Description: 通过id查询
**/
@Override
public ProcessFbEntryChange queryBusinessInfo(String id) {
return getById(id);
}
/**
* @Author: liao
* @Date: 2023/11/3 10:58
@@ -99,8 +89,9 @@ public class ProcessFbEntryChangeServiceImpl extends ServiceImpl<ProcessFbEntryC
@Override
public void startProcess(ProcessInfoVO<ProcessFbEntryChange> processInfoVO) {
ProcessFbEntryChange businessInfoDTO = processInfoVO.getBusinessInfoDTO();
String businessId = UUIDUtils.randomUUID20();
businessInfoDTO.setId(businessId);
if (StringUtils.isBlank(businessInfoDTO.getId())) {
businessInfoDTO.setId(UUIDUtils.randomUUID20());
}
addBusinessInfo(businessInfoDTO); // 保存业务信息
Map<String, Object> userInfoMap = processInfoVO.getUserInfoMap(); // 用户变量map
@@ -167,8 +158,8 @@ public class ProcessFbEntryChangeServiceImpl extends ServiceImpl<ProcessFbEntryC
// 业务信息
ProcessFbEntryChange businessInfoDTO = processInfoVO.getBusinessInfoDTO();
if (StringUtils.isBlank(businessInfoDTO.getId())) { // 如果是发起时保存
String businessId = UUIDUtils.randomUUID20();
businessInfoDTO.setId(businessId);
businessInfoDTO.setId(UUIDUtils.randomUUID20());
processInfoVO.setBusinessId(businessInfoDTO.getId());
addBusinessInfo(businessInfoDTO);
} else { // 如果是审批时保存
processInfoVO.setBusinessId(businessInfoDTO.getId());
@@ -180,4 +171,17 @@ public class ProcessFbEntryChangeServiceImpl extends ServiceImpl<ProcessFbEntryC
processHandleService.saveToDraft(processInfoVO);
}
/**
* @Author: liao
* @Date: 2023/11/8 11:12
* @Description: 查询流程信息
**/
@Override
public ProcessInfoVO<ProcessFbEntryChange> queryProcessInfoVO(String draftId, String processInstanceId) {
ProcessInfoVO processInfoVO = processHandleService.queryProcessInfoVO(draftId, processInstanceId);
ProcessFbEntryChange processFbEntryChange = getById(processInfoVO.getBusinessId());
processInfoVO.setBusinessInfoDTO(processFbEntryChange);
return processInfoVO;
}
}
@@ -241,9 +241,11 @@ public class ProcessHandleServiceImpl implements IProcessHandleService {
processDraft.setProcessInstanceId(basicProcessInfoDTO.getProcessInstanceId()); // 流程实例id
processDraft.setPrcName(basicProcessInfoDTO.getProcessName()); // 流程名称
processDraft.setPrcType(basicProcessInfoDTO.getProcessType()); // 流程类型
processDraft.setTaskId(basicTaskInfoDTO.getTaskId()); // 任务id
processDraft.setHandleText(basicTaskInfoDTO.getHandleText()); // 流程审批信息-备注
processDraft.setHandleFile(basicTaskInfoDTO.getHandleFile()); // 流程审批信息-附件
processDraft.setUserId(CurrentUserUtil.getId()); // 用户id
processDraftService.save(processDraft);
}
@@ -260,4 +262,46 @@ public class ProcessHandleServiceImpl implements IProcessHandleService {
.singleResult().getId();
}
/**
* @Author: liao
* @Date: 2023/11/8 11:16
* @Description: 查询流程信息
**/
@Override
public ProcessInfoVO queryProcessInfoVO(String draftId, String processInstanceId) {
ProcessInfoVO processInfoVO = new ProcessInfoVO();
// 流程信息
BasicProcessInfoDTO basicProcessInfoDTO = new BasicProcessInfoDTO();
processInfoVO.setBasicProcessInfoDTO(basicProcessInfoDTO);
// 审批信息
BasicTaskInfoDTO basicTaskInfoDTO = new BasicTaskInfoDTO();
processInfoVO.setBasicTaskInfoDTO(basicTaskInfoDTO);
// 流程信息
if (StringUtils.isNotBlank(processInstanceId)) {
ProcessAll processAll = processAllService.getByProcessInstanceId(processInstanceId);
if (!Objects.isNull(processAll)) {
basicProcessInfoDTO.setProcessInstanceId(processAll.getProcessInstanceId());
basicProcessInfoDTO.setProcessType(processAll.getPrcType());
basicProcessInfoDTO.setProcessName(processAll.getPrcName());
basicProcessInfoDTO.setProcessDescription(processAll.getMes());
basicProcessInfoDTO.setProcessDueDate(processAll.getDueTime());
processInfoVO.setBusinessId(processAll.getProjectId());
}
}
// 审批信息
if (StringUtils.isNotBlank(draftId)) {
ProcessDraft processDraft = processDraftService.getById(draftId);
if (!Objects.isNull(processDraft)) {
basicTaskInfoDTO.setTaskId(processDraft.getTaskId());
basicTaskInfoDTO.setHandleText(processDraft.getHandleText());
basicTaskInfoDTO.setHandleFile(processDraft.getHandleFile());
processInfoVO.setBusinessId(processDraft.getProjectId());
}
}
return processInfoVO;
}
}