feat: 企标立项变更办理接口 审批接口
This commit is contained in:
-93
@@ -1,93 +0,0 @@
|
||||
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.common.aspect.annotation.Translation;
|
||||
import com.jero.modules.activiti.process.common.entity.CenterQueryVO;
|
||||
import com.jero.modules.activiti.process.common.service.ActFlowCommonService;
|
||||
import com.jero.modules.activiti.process.common.service.ProcessDraftService;
|
||||
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 ProcessDraftService draftService;
|
||||
|
||||
@Resource
|
||||
private ActFlowCommonService actFlowCommonService;
|
||||
|
||||
/**
|
||||
* 待办流程
|
||||
* @param centerQueryVO
|
||||
*/
|
||||
@AutoLog(value = "流程中心-待办流程")
|
||||
@ApiOperation(value="流程中心-待办流程", notes="流程中心-待办流程")
|
||||
@GetMapping("/todoTaskList")
|
||||
public Result<?> todoTaskList(@Valid 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="流程中心-已办流程")
|
||||
@GetMapping("/doneTaskList")
|
||||
public Result<?> doneTaskList(@Valid CenterQueryVO centerQueryVO) {
|
||||
// TODO
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 已发流程
|
||||
* @param centerQueryVO
|
||||
*/
|
||||
@AutoLog(value = "流程中心-已发流程")
|
||||
@ApiOperation(value="流程中心-已发流程", notes="流程中心-已发流程")
|
||||
@GetMapping("/sendTaskList")
|
||||
public Result<?> sendTaskList(@Valid CenterQueryVO centerQueryVO) {
|
||||
// TODO
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 监控流程
|
||||
* @param centerQueryVO
|
||||
*/
|
||||
@AutoLog(value = "流程中心-监控流程")
|
||||
@ApiOperation(value="流程中心-监控流程", notes="流程中心-监控流程")
|
||||
@GetMapping("/monitorTaskList")
|
||||
public Result<?> monitorTaskList(@Valid CenterQueryVO centerQueryVO) {
|
||||
// TODO
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 草稿
|
||||
* @param centerQueryVO
|
||||
*/
|
||||
@AutoLog(value = "流程中心-草稿")
|
||||
@ApiOperation(value="流程中心-草稿", notes="流程中心-草稿")
|
||||
@GetMapping("/draftList")
|
||||
public Result<?> draftList(@Valid CenterQueryVO centerQueryVO) {
|
||||
return Result.OK(draftService.getDraftList(centerQueryVO));
|
||||
}
|
||||
}
|
||||
+17
@@ -1,5 +1,6 @@
|
||||
package com.jero.modules.activiti.process.common.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -11,35 +12,51 @@ import java.util.Date;
|
||||
@Data
|
||||
public class CommonVO {
|
||||
|
||||
/**
|
||||
* 任务ID
|
||||
*/
|
||||
@ApiModelProperty("任务ID")
|
||||
String taskId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty("备注")
|
||||
String commitText;
|
||||
|
||||
/**
|
||||
* 附件
|
||||
*/
|
||||
@ApiModelProperty("附件")
|
||||
String commitFile;
|
||||
|
||||
/**
|
||||
* 同意驳回标识
|
||||
*/
|
||||
@ApiModelProperty("同意驳回标识")
|
||||
Integer commitFlag;
|
||||
|
||||
/**
|
||||
* 同意驳回标识
|
||||
*/
|
||||
@ApiModelProperty("同意驳回标识")
|
||||
boolean pass;
|
||||
|
||||
/**
|
||||
* 流程名称
|
||||
*/
|
||||
@ApiModelProperty("流程名称")
|
||||
String prcName;
|
||||
|
||||
/**
|
||||
* 截止日期
|
||||
*/
|
||||
@ApiModelProperty("截止日期")
|
||||
Date dueTime;
|
||||
|
||||
/**
|
||||
* 流程描述
|
||||
*/
|
||||
@ApiModelProperty("流程描述")
|
||||
String prcMes;
|
||||
}
|
||||
|
||||
+16
-10
@@ -83,34 +83,40 @@ public class ProcessESInitChangeController {
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存到待办
|
||||
* @param taskId
|
||||
*/
|
||||
@AutoLog(value = "企标立项变更流程-办理")
|
||||
@ApiOperation(value="企标立项变更流程-办理", notes="企标立项变更流程-办理")
|
||||
@PostMapping("/save")
|
||||
public Result<?> handle(@RequestParam(value = "taskId") String taskId) {
|
||||
return Result.OK(initChangeService.getHandleData(taskId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 同意
|
||||
*
|
||||
* @param taskId
|
||||
* @param esInitChangeList
|
||||
* @param initChangeData
|
||||
*/
|
||||
@AutoLog(value = "企标立项变更流程-同意")
|
||||
@ApiOperation(value="企标立项变更流程-同意", notes="企标立项变更流程-同意")
|
||||
@PostMapping("/agree")
|
||||
public Result<?> agree(@RequestParam("taskId") String taskId, @RequestBody List<ProcessEsInitChange> esInitChangeList) {
|
||||
// TODO 重写
|
||||
initChangeService.approvalInitChange(taskId, esInitChangeList, true);
|
||||
public Result<?> agree(@RequestBody InitChangeDataVO initChangeData) {
|
||||
initChangeService.approvalInitChange(initChangeData, true);
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 驳回
|
||||
*
|
||||
* @param taskId
|
||||
* @param esInitChangeList
|
||||
* @param initChangeData
|
||||
*/
|
||||
@AutoLog(value = "企标立项变更流程-驳回")
|
||||
@ApiOperation(value="企标立项变更流程-驳回", notes="企标立项变更流程-驳回")
|
||||
@PostMapping("/reject")
|
||||
public Result<?> reject(@RequestParam("taskId") String taskId, @RequestBody List<ProcessEsInitChange> esInitChangeList) {
|
||||
// TODO 重写
|
||||
initChangeService.approvalInitChange(taskId, esInitChangeList, false);
|
||||
public Result<?> reject(@RequestBody InitChangeDataVO initChangeData) {
|
||||
initChangeService.approvalInitChange(initChangeData, false);
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
|
||||
+10
-3
@@ -29,10 +29,10 @@ public interface ProcessEsInitChangeService extends IService<ProcessEsInitChange
|
||||
|
||||
/**
|
||||
* 审批
|
||||
* @param taskId
|
||||
* @param esInitChange
|
||||
* @param pass
|
||||
* @param initChangeData
|
||||
*/
|
||||
void approvalInitChange(String taskId, List<ProcessEsInitChange> esInitChange, boolean pass);
|
||||
void approvalInitChange(InitChangeDataVO initChangeData, boolean pass);
|
||||
|
||||
/**
|
||||
* 保存到草稿
|
||||
@@ -47,4 +47,11 @@ public interface ProcessEsInitChangeService extends IService<ProcessEsInitChange
|
||||
* @param processInstanceId
|
||||
*/
|
||||
void removeByProcessInstanceId(String processInstanceId);
|
||||
|
||||
/**
|
||||
* 获取办理数据
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
InitChangeDataVO getHandleData(String taskId);
|
||||
}
|
||||
|
||||
+59
-27
@@ -6,20 +6,26 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.constant.enums.YesOrNoEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.modules.activiti.entity.ProcessAll;
|
||||
import com.jero.modules.activiti.entity.ProcessApprovalRecord;
|
||||
import com.jero.modules.activiti.enums.CommitFlagEnum;
|
||||
import com.jero.modules.activiti.enums.FinishFlagEnum;
|
||||
import com.jero.modules.activiti.process.common.entity.CommonVO;
|
||||
import com.jero.modules.activiti.process.common.enums.ProcessType;
|
||||
import com.jero.modules.activiti.process.common.service.ActFlowCommonService;
|
||||
import com.jero.modules.activiti.process.common.service.ProcessDraftService;
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.ProcessEsInitChange;
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.vo.FlowUserInfoVO;
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.vo.InitChangeDataVO;
|
||||
import com.jero.modules.activiti.process.esInitChange.service.ProcessEsInitChangeService;
|
||||
import com.jero.modules.activiti.process.esInitChange.mapper.ProcessEsInitChangeMapper;
|
||||
import com.jero.modules.activiti.service.ProcessAllService;
|
||||
import com.jero.modules.activiti.service.ProcessApprovalRecordService;
|
||||
import com.jero.modules.laws.enterprise.service.ESSequenceNumberProvider;
|
||||
import com.jero.modules.laws.enterprise.util.EnterpriseStandardUtil;
|
||||
import com.jero.modules.sys.utils.UserUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.activiti.engine.TaskService;
|
||||
import org.activiti.engine.runtime.ProcessInstance;
|
||||
import org.activiti.engine.task.Task;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@@ -43,10 +49,13 @@ public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitCha
|
||||
private ProcessAllService processAllService;
|
||||
|
||||
@Resource
|
||||
private ProcessDraftService processDraftService;
|
||||
private ActFlowCommonService actFlowCommonService;
|
||||
|
||||
@Resource
|
||||
private ActFlowCommonService actFlowCommonService;
|
||||
private ProcessApprovalRecordService processApprovalRecordService;
|
||||
|
||||
@Resource
|
||||
private TaskService taskService;
|
||||
|
||||
@Resource
|
||||
private EnterpriseStandardUtil esUtil;
|
||||
@@ -80,13 +89,27 @@ public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitCha
|
||||
}
|
||||
}
|
||||
|
||||
public InitChangeDataVO getHandleData(String processInstanceId) {
|
||||
// TODO 获取流程实例数据
|
||||
// LambdaQueryWrapper<ProcessEsInitChange> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
// lambdaQueryWrapper.eq(ProcessEsInitChange::getProcessInstanceId, processInstanceId);
|
||||
// lambdaQueryWrapper.eq(ProcessEsInitChange::getDelFlag, YesOrNoEnum.NO.getValue());
|
||||
// return list(lambdaQueryWrapper);
|
||||
return null;
|
||||
@Override
|
||||
public InitChangeDataVO getHandleData(String taskId) {
|
||||
InitChangeDataVO initChangeDataVO = new InitChangeDataVO();
|
||||
// 使用流程引擎根据taskId找到流程实例Id
|
||||
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
|
||||
String processInstanceId = task.getProcessInstanceId();
|
||||
// 获取流程通用数据
|
||||
ProcessAll process = processAllService.getByProcessInstanceId(processInstanceId);
|
||||
CommonVO commonVO = new CommonVO();
|
||||
commonVO.setPrcName(process.getPrcName());
|
||||
commonVO.setPrcMes(process.getPrcMes());
|
||||
commonVO.setDueTime(process.getDueTime());
|
||||
initChangeDataVO.setCommonVO(commonVO);
|
||||
// 获取流程实例数据
|
||||
LambdaQueryWrapper<ProcessEsInitChange> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(ProcessEsInitChange::getProcessInstanceId, processInstanceId);
|
||||
lambdaQueryWrapper.eq(ProcessEsInitChange::getDelFlag, YesOrNoEnum.NO.getValue());
|
||||
List<ProcessEsInitChange> dataList = list(lambdaQueryWrapper);
|
||||
initChangeDataVO.setDataList(dataList);
|
||||
// TODO 选人组件内容填充
|
||||
return initChangeDataVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -146,23 +169,32 @@ public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitCha
|
||||
}
|
||||
|
||||
@Override
|
||||
public void approvalInitChange(String taskId, List<ProcessEsInitChange> esInitChangeList, boolean pass) {
|
||||
// String userId = UserUtils.getUserId();
|
||||
// Map<String, Object> map = new HashMap<>();
|
||||
// if (pass) {
|
||||
// // 校验企标编号是否冲突
|
||||
// if (!esUtil.verifyEnStandardNumber(esInitChangeList.get(0).getOriginEnStandardNo())) {
|
||||
// throw new JeroBootException("企标编号冲突");
|
||||
// }
|
||||
// // 更新业务流程数据
|
||||
// saveOrUpdateBatch(esInitChangeList);
|
||||
// map = setVariables(esInitChangeList.get(0));
|
||||
// }
|
||||
// // 设置流程变量
|
||||
// map.put("pass", pass);
|
||||
// actFlowCommonService.completeTask(esInitChangeList.get(0).getRemarks(), taskId, userId, map);
|
||||
// // TODO 保存流程审批信息
|
||||
|
||||
public void approvalInitChange(InitChangeDataVO initChangeDataVO, boolean pass) {
|
||||
CommonVO commonVO = initChangeDataVO.getCommonVO();
|
||||
String taskId = commonVO.getTaskId();
|
||||
List<ProcessEsInitChange> esInitChangeList = initChangeDataVO.getDataList();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if (pass) {
|
||||
// 校验企标编号是否冲突
|
||||
if (!esUtil.verifyEnStandardNumber(esInitChangeList.get(0).getOriginEnStandardNo())) {
|
||||
throw new JeroBootException("企标编号冲突");
|
||||
}
|
||||
// 更新业务流程数据
|
||||
saveOrUpdateBatch(esInitChangeList);
|
||||
map = setVariables(initChangeDataVO);
|
||||
}
|
||||
// 设置流程变量
|
||||
map.put("pass", pass);
|
||||
//更新审批表为完成,填充数据
|
||||
ProcessApprovalRecord approvalRecord = processApprovalRecordService.getToDoByTaskId(taskId);
|
||||
approvalRecord.setCommitFlag(pass? CommitFlagEnum.PASS.getValue() : CommitFlagEnum.REJECT.getValue());
|
||||
approvalRecord.setCommitText(commonVO.getCommitText());
|
||||
approvalRecord.setCommitFile(commonVO.getCommitFile());
|
||||
approvalRecord.setFinishFlag(FinishFlagEnum.COMPLETE.getValue());
|
||||
approvalRecord.setEndTime(new Date());
|
||||
processApprovalRecordService.updateById(approvalRecord);
|
||||
//审批节点
|
||||
taskService.complete(taskId, map);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user