feat: 流程中心-待办流程
只完成基础功能
This commit is contained in:
+3
-3
@@ -166,7 +166,7 @@ public class ActivitiController {
|
||||
taskQuery.processDefinitionKey(processKey); //流程Key
|
||||
}
|
||||
List<Task> list = taskQuery.list();
|
||||
List<Map<String, String>> resut = new ArrayList<>();
|
||||
List<Map<String, String>> result = new ArrayList<>();
|
||||
for (Task task : list) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("流程实例id:", task.getProcessInstanceId());
|
||||
@@ -174,9 +174,9 @@ public class ActivitiController {
|
||||
map.put("任务负责人:", task.getAssignee());
|
||||
map.put("任务名称:", task.getName());
|
||||
//map.put("任务名称:", task.get);
|
||||
resut.add(map);
|
||||
result.add(map);
|
||||
}
|
||||
return Result.OK(resut);
|
||||
return Result.OK(result);
|
||||
}
|
||||
|
||||
@ApiOperation(value="完成任务")
|
||||
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
package com.jero.modules.activiti.process.common.controller;
|
||||
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.modules.activiti.process.common.entity.CenterQueryVO;
|
||||
import com.jero.modules.activiti.process.common.service.ActFlowCommonService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* @author: Mzaxd
|
||||
* @Date: 2023/10/11 9:33
|
||||
*/
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@Api(tags = "流程中心")
|
||||
@RequestMapping("/process/center")
|
||||
public class ProcessCenterController {
|
||||
|
||||
@Resource
|
||||
private ActFlowCommonService actFlowCommonService;
|
||||
|
||||
/**
|
||||
* 待办流程
|
||||
* @param centerQueryVO
|
||||
*/
|
||||
@AutoLog(value = "流程中心-待办流程")
|
||||
@ApiOperation(value="流程中心-待办流程", notes="流程中心-待办流程")
|
||||
@PostMapping("/todoTaskList")
|
||||
public Result<?> todoTaskList(@Valid @RequestBody CenterQueryVO centerQueryVO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
|
||||
return Result.OK(actFlowCommonService.todoTaskList(centerQueryVO, pageNo, pageSize));
|
||||
}
|
||||
|
||||
/**
|
||||
* 已办流程
|
||||
* @param centerQueryVO
|
||||
*/
|
||||
@AutoLog(value = "流程中心-已办流程")
|
||||
@ApiOperation(value="流程中心-已办流程", notes="流程中心-已办流程")
|
||||
@PostMapping("/doneTaskList")
|
||||
public Result<?> doneTaskList(@Valid @RequestBody CenterQueryVO centerQueryVO) {
|
||||
// TODO
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 已发流程
|
||||
* @param centerQueryVO
|
||||
*/
|
||||
@AutoLog(value = "流程中心-已发流程")
|
||||
@ApiOperation(value="流程中心-已发流程", notes="流程中心-已发流程")
|
||||
@PostMapping("/sendTaskList")
|
||||
public Result<?> sendTaskList(@Valid @RequestBody CenterQueryVO centerQueryVO) {
|
||||
// TODO
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 监控流程
|
||||
* @param centerQueryVO
|
||||
*/
|
||||
@AutoLog(value = "流程中心-监控流程")
|
||||
@ApiOperation(value="流程中心-监控流程", notes="流程中心-监控流程")
|
||||
@PostMapping("/monitorTaskList")
|
||||
public Result<?> monitorTaskList(@Valid @RequestBody CenterQueryVO centerQueryVO) {
|
||||
// TODO
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 草稿
|
||||
* @param centerQueryVO
|
||||
*/
|
||||
@AutoLog(value = "流程中心-草稿")
|
||||
@ApiOperation(value="流程中心-草稿", notes="流程中心-草稿")
|
||||
@PostMapping("/draftList")
|
||||
public Result<?> draftList(@Valid @RequestBody CenterQueryVO centerQueryVO) {
|
||||
// TODO
|
||||
return Result.OK();
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.jero.modules.activiti.process.common.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: Mzaxd
|
||||
* @Date: 2023/10/11 9:37
|
||||
*/
|
||||
@Data
|
||||
public class CenterQueryVO {
|
||||
|
||||
@ApiModelProperty(value = "流程名称")
|
||||
private String prcName;
|
||||
|
||||
@ApiModelProperty(value = "流程编号")
|
||||
private String prcNum;
|
||||
|
||||
@ApiModelProperty(value = "流程类型")
|
||||
private String prcType;
|
||||
|
||||
@ApiModelProperty(value = "流程状态")
|
||||
private String prcState;
|
||||
|
||||
}
|
||||
+62
-4
@@ -2,9 +2,13 @@ package com.jero.modules.activiti.process.common.service;
|
||||
|
||||
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.esInitChange.entity.ProcessEsInitChange;
|
||||
import com.jero.modules.activiti.process.esInitChange.service.ProcessEsInitChangeService;
|
||||
import com.jero.modules.activiti.util.SpringContextUtil;
|
||||
import com.jero.modules.sys.utils.UserUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.activiti.engine.HistoryService;
|
||||
import org.activiti.engine.RepositoryService;
|
||||
import org.activiti.engine.RuntimeService;
|
||||
import org.activiti.engine.TaskService;
|
||||
@@ -12,6 +16,7 @@ import org.activiti.engine.impl.identity.Authentication;
|
||||
import org.activiti.engine.runtime.ProcessInstance;
|
||||
import org.activiti.engine.task.Task;
|
||||
import org.activiti.engine.task.TaskQuery;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -36,11 +41,10 @@ public class ActFlowCommonService {
|
||||
private TaskService taskService;
|
||||
|
||||
@Resource
|
||||
private HistoryService historyService;
|
||||
private ProcessEsInitChangeService processEsInitChangeService;
|
||||
|
||||
@Resource
|
||||
private ISysBaseAPI sysBaseApi;
|
||||
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
|
||||
/**
|
||||
* 启动流程实例
|
||||
@@ -121,6 +125,48 @@ public class ActFlowCommonService {
|
||||
return listMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看个人任务信息
|
||||
*/
|
||||
public List<Map<String, Object>> taskInfoList(String userid, CenterQueryVO centerQueryVO, Integer pageNo, Integer pageSize) {
|
||||
//TODO 分页
|
||||
TaskQuery taskQuery = taskService.createTaskQuery().taskAssignee(userid);
|
||||
|
||||
List<Task> list = taskQuery.orderByTaskCreateTime().desc().list();
|
||||
|
||||
List<Map<String, Object>> listMap = new ArrayList<>();
|
||||
for (Task task : list) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("taskId", task.getId());
|
||||
map.put("prcId", task.getProcessInstanceId());
|
||||
map.put("prcName", task.getProcessDefinitionId());
|
||||
LoginUser assigneeUser = sysBaseAPI.getUserById(task.getAssignee());
|
||||
map.put("assignee", assigneeUser.getId());
|
||||
map.put("assigneeText", assigneeUser.getUsername());
|
||||
map.put("claimTaskTime", task.getCreateTime());
|
||||
ProcessInstance processInstance = runtimeService
|
||||
.createProcessInstanceQuery()
|
||||
.processInstanceId(task.getProcessInstanceId())
|
||||
.singleResult();
|
||||
if (processInstance != null) {
|
||||
String businessKey = processInstance.getBusinessKey();
|
||||
if (!StringUtils.isBlank(businessKey)) {
|
||||
String type = businessKey.split(":")[0];
|
||||
String id = businessKey.split(":")[1];
|
||||
if (type.equals("intiChange")) {
|
||||
ProcessEsInitChange initChange = processEsInitChangeService.getById(id);
|
||||
LoginUser createUser = sysBaseAPI.getUserById(initChange.getCreateBy());
|
||||
map.put("createUser", createUser.getId());
|
||||
map.put("createUserText", createUser.getUsername());
|
||||
map.put("prcType", "企标立项/变更");
|
||||
}
|
||||
}
|
||||
}
|
||||
listMap.add(map);
|
||||
}
|
||||
return listMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 转办
|
||||
*/
|
||||
@@ -128,4 +174,16 @@ public class ActFlowCommonService {
|
||||
taskService.setAssignee(taskId, userId);
|
||||
log.info("转办 任务Id:{} 转办用户Id{}", taskId, userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 待办任务列表
|
||||
* @param centerQueryVO
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> todoTaskList(CenterQueryVO centerQueryVO, Integer pageNo, Integer pageSize) {
|
||||
String userId = UserUtils.getUserId();
|
||||
return this.taskInfoList(userId, centerQueryVO, pageNo, pageSize);
|
||||
}
|
||||
}
|
||||
-1
@@ -6,7 +6,6 @@ import com.jero.modules.activiti.process.esInitChange.entity.ProcessEsInitChange
|
||||
import com.jero.modules.activiti.process.esInitChange.service.ProcessEsInitChangeService;
|
||||
import com.jero.modules.laws.common.constant.FieldCommon;
|
||||
import com.jero.modules.laws.enterprise.util.EnterpriseStandardUtil;
|
||||
import com.jero.modules.tag.enums.TableNameEnum;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
Reference in New Issue
Block a user