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;
|
package com.jero.modules.activiti.process.common.entity;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -11,35 +12,51 @@ import java.util.Date;
|
|||||||
@Data
|
@Data
|
||||||
public class CommonVO {
|
public class CommonVO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务ID
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("任务ID")
|
||||||
String taskId;
|
String taskId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty("备注")
|
||||||
String commitText;
|
String commitText;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 附件
|
* 附件
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty("附件")
|
||||||
String commitFile;
|
String commitFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 同意驳回标识
|
* 同意驳回标识
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty("同意驳回标识")
|
||||||
Integer commitFlag;
|
Integer commitFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同意驳回标识
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("同意驳回标识")
|
||||||
|
boolean pass;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程名称
|
* 流程名称
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty("流程名称")
|
||||||
String prcName;
|
String prcName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 截止日期
|
* 截止日期
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty("截止日期")
|
||||||
Date dueTime;
|
Date dueTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程描述
|
* 流程描述
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty("流程描述")
|
||||||
String prcMes;
|
String prcMes;
|
||||||
}
|
}
|
||||||
|
|||||||
+16
-10
@@ -83,34 +83,40 @@ public class ProcessESInitChangeController {
|
|||||||
return Result.OK();
|
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 initChangeData
|
||||||
* @param esInitChangeList
|
|
||||||
*/
|
*/
|
||||||
@AutoLog(value = "企标立项变更流程-同意")
|
@AutoLog(value = "企标立项变更流程-同意")
|
||||||
@ApiOperation(value="企标立项变更流程-同意", notes="企标立项变更流程-同意")
|
@ApiOperation(value="企标立项变更流程-同意", notes="企标立项变更流程-同意")
|
||||||
@PostMapping("/agree")
|
@PostMapping("/agree")
|
||||||
public Result<?> agree(@RequestParam("taskId") String taskId, @RequestBody List<ProcessEsInitChange> esInitChangeList) {
|
public Result<?> agree(@RequestBody InitChangeDataVO initChangeData) {
|
||||||
// TODO 重写
|
initChangeService.approvalInitChange(initChangeData, true);
|
||||||
initChangeService.approvalInitChange(taskId, esInitChangeList, true);
|
|
||||||
return Result.OK();
|
return Result.OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 驳回
|
* 驳回
|
||||||
*
|
*
|
||||||
* @param taskId
|
* @param initChangeData
|
||||||
* @param esInitChangeList
|
|
||||||
*/
|
*/
|
||||||
@AutoLog(value = "企标立项变更流程-驳回")
|
@AutoLog(value = "企标立项变更流程-驳回")
|
||||||
@ApiOperation(value="企标立项变更流程-驳回", notes="企标立项变更流程-驳回")
|
@ApiOperation(value="企标立项变更流程-驳回", notes="企标立项变更流程-驳回")
|
||||||
@PostMapping("/reject")
|
@PostMapping("/reject")
|
||||||
public Result<?> reject(@RequestParam("taskId") String taskId, @RequestBody List<ProcessEsInitChange> esInitChangeList) {
|
public Result<?> reject(@RequestBody InitChangeDataVO initChangeData) {
|
||||||
// TODO 重写
|
initChangeService.approvalInitChange(initChangeData, false);
|
||||||
initChangeService.approvalInitChange(taskId, esInitChangeList, false);
|
|
||||||
return Result.OK();
|
return Result.OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
-3
@@ -29,10 +29,10 @@ public interface ProcessEsInitChangeService extends IService<ProcessEsInitChange
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 审批
|
* 审批
|
||||||
* @param taskId
|
* @param pass
|
||||||
* @param esInitChange
|
* @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
|
* @param processInstanceId
|
||||||
*/
|
*/
|
||||||
void removeByProcessInstanceId(String 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.constant.enums.YesOrNoEnum;
|
||||||
import com.jero.common.exception.JeroBootException;
|
import com.jero.common.exception.JeroBootException;
|
||||||
import com.jero.modules.activiti.entity.ProcessAll;
|
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.enums.ProcessType;
|
||||||
import com.jero.modules.activiti.process.common.service.ActFlowCommonService;
|
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.ProcessEsInitChange;
|
||||||
import com.jero.modules.activiti.process.esInitChange.entity.vo.FlowUserInfoVO;
|
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.entity.vo.InitChangeDataVO;
|
||||||
import com.jero.modules.activiti.process.esInitChange.service.ProcessEsInitChangeService;
|
import com.jero.modules.activiti.process.esInitChange.service.ProcessEsInitChangeService;
|
||||||
import com.jero.modules.activiti.process.esInitChange.mapper.ProcessEsInitChangeMapper;
|
import com.jero.modules.activiti.process.esInitChange.mapper.ProcessEsInitChangeMapper;
|
||||||
import com.jero.modules.activiti.service.ProcessAllService;
|
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.service.ESSequenceNumberProvider;
|
||||||
import com.jero.modules.laws.enterprise.util.EnterpriseStandardUtil;
|
import com.jero.modules.laws.enterprise.util.EnterpriseStandardUtil;
|
||||||
import com.jero.modules.sys.utils.UserUtils;
|
import com.jero.modules.sys.utils.UserUtils;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.activiti.engine.TaskService;
|
||||||
import org.activiti.engine.runtime.ProcessInstance;
|
import org.activiti.engine.runtime.ProcessInstance;
|
||||||
|
import org.activiti.engine.task.Task;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
@@ -43,10 +49,13 @@ public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitCha
|
|||||||
private ProcessAllService processAllService;
|
private ProcessAllService processAllService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ProcessDraftService processDraftService;
|
private ActFlowCommonService actFlowCommonService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ActFlowCommonService actFlowCommonService;
|
private ProcessApprovalRecordService processApprovalRecordService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TaskService taskService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private EnterpriseStandardUtil esUtil;
|
private EnterpriseStandardUtil esUtil;
|
||||||
@@ -80,13 +89,27 @@ public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitCha
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public InitChangeDataVO getHandleData(String processInstanceId) {
|
@Override
|
||||||
// TODO 获取流程实例数据
|
public InitChangeDataVO getHandleData(String taskId) {
|
||||||
// LambdaQueryWrapper<ProcessEsInitChange> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
InitChangeDataVO initChangeDataVO = new InitChangeDataVO();
|
||||||
// lambdaQueryWrapper.eq(ProcessEsInitChange::getProcessInstanceId, processInstanceId);
|
// 使用流程引擎根据taskId找到流程实例Id
|
||||||
// lambdaQueryWrapper.eq(ProcessEsInitChange::getDelFlag, YesOrNoEnum.NO.getValue());
|
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
|
||||||
// return list(lambdaQueryWrapper);
|
String processInstanceId = task.getProcessInstanceId();
|
||||||
return null;
|
// 获取流程通用数据
|
||||||
|
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
|
@Override
|
||||||
@@ -146,23 +169,32 @@ public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitCha
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void approvalInitChange(String taskId, List<ProcessEsInitChange> esInitChangeList, boolean pass) {
|
public void approvalInitChange(InitChangeDataVO initChangeDataVO, boolean pass) {
|
||||||
// String userId = UserUtils.getUserId();
|
CommonVO commonVO = initChangeDataVO.getCommonVO();
|
||||||
// Map<String, Object> map = new HashMap<>();
|
String taskId = commonVO.getTaskId();
|
||||||
// if (pass) {
|
List<ProcessEsInitChange> esInitChangeList = initChangeDataVO.getDataList();
|
||||||
// // 校验企标编号是否冲突
|
Map<String, Object> map = new HashMap<>();
|
||||||
// if (!esUtil.verifyEnStandardNumber(esInitChangeList.get(0).getOriginEnStandardNo())) {
|
if (pass) {
|
||||||
// throw new JeroBootException("企标编号冲突");
|
// 校验企标编号是否冲突
|
||||||
// }
|
if (!esUtil.verifyEnStandardNumber(esInitChangeList.get(0).getOriginEnStandardNo())) {
|
||||||
// // 更新业务流程数据
|
throw new JeroBootException("企标编号冲突");
|
||||||
// saveOrUpdateBatch(esInitChangeList);
|
}
|
||||||
// map = setVariables(esInitChangeList.get(0));
|
// 更新业务流程数据
|
||||||
// }
|
saveOrUpdateBatch(esInitChangeList);
|
||||||
// // 设置流程变量
|
map = setVariables(initChangeDataVO);
|
||||||
// map.put("pass", pass);
|
}
|
||||||
// actFlowCommonService.completeTask(esInitChangeList.get(0).getRemarks(), taskId, userId, map);
|
// 设置流程变量
|
||||||
// // TODO 保存流程审批信息
|
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
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user