feat: 审批接口拆分
This commit is contained in:
+2
-3
@@ -4,7 +4,6 @@ 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.service.ProcessEsInitChangeService;
|
||||
import com.jero.modules.activiti.util.SpringContextUtil;
|
||||
import com.jero.modules.sys.utils.UserUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -69,7 +68,7 @@ public class ActFlowCommonService {
|
||||
/**
|
||||
* 完成提交任务
|
||||
*/
|
||||
public void completeTask(String remark, String taskId, String userId) {
|
||||
public void completeTask(String remark, String taskId, String userId, Map<String, Object> map) {
|
||||
//任务Id 查询任务对象
|
||||
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
|
||||
|
||||
@@ -91,7 +90,7 @@ public class ActFlowCommonService {
|
||||
log.info("负责人id=" + userId);
|
||||
log.info("流程实例id=" + processInstanceId);
|
||||
//完成办理
|
||||
taskService.complete(taskId);
|
||||
taskService.complete(taskId, map);
|
||||
log.info("-----------完成任务操作 结束----------");
|
||||
}
|
||||
|
||||
|
||||
+20
-6
@@ -90,16 +90,30 @@ public class ProcessESInitChangeController {
|
||||
|
||||
|
||||
/**
|
||||
* 审批(同意/驳回)
|
||||
* 同意
|
||||
*
|
||||
* @param taskId
|
||||
* @param esInitChangeList
|
||||
*/
|
||||
@AutoLog(value = "企标立项变更流程-审批(同意/驳回)")
|
||||
@ApiOperation(value="企标立项变更流程-审批(同意/驳回)", notes="企标立项变更流程-审批(同意/驳回)")
|
||||
@PostMapping("/approval")
|
||||
public Result<?> approval(@RequestParam("taskId") String taskId, @RequestBody List<ProcessEsInitChange> esInitChangeList) {
|
||||
initChangeService.approvalInitChange(taskId, esInitChangeList);
|
||||
@AutoLog(value = "企标立项变更流程-同意")
|
||||
@ApiOperation(value="企标立项变更流程-同意", notes="企标立项变更流程-同意")
|
||||
@PostMapping("/agree")
|
||||
public Result<?> agree(@RequestParam("taskId") String taskId, @RequestBody List<ProcessEsInitChange> esInitChangeList) {
|
||||
initChangeService.approvalInitChange(taskId, esInitChangeList, true);
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 驳回
|
||||
*
|
||||
* @param taskId
|
||||
* @param esInitChangeList
|
||||
*/
|
||||
@AutoLog(value = "企标立项变更流程-驳回")
|
||||
@ApiOperation(value="企标立项变更流程-驳回", notes="企标立项变更流程-驳回")
|
||||
@PostMapping("/reject")
|
||||
public Result<?> reject(@RequestParam("taskId") String taskId, @RequestBody List<ProcessEsInitChange> esInitChangeList) {
|
||||
initChangeService.approvalInitChange(taskId, esInitChangeList, false);
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ public interface ProcessEsInitChangeService extends IService<ProcessEsInitChange
|
||||
* @param taskId
|
||||
* @param esInitChange
|
||||
*/
|
||||
void approvalInitChange(String taskId, List<ProcessEsInitChange> esInitChange);
|
||||
void approvalInitChange(String taskId, List<ProcessEsInitChange> esInitChange, boolean pass);
|
||||
|
||||
/**
|
||||
* 保存到待办
|
||||
|
||||
+15
-11
@@ -5,7 +5,6 @@ import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.modules.activiti.process.common.service.ActFlowCommonService;
|
||||
import com.jero.modules.activiti.process.common.service.IActFlowCustomService;
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.ProcessEsInitChange;
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.enums.ESProjectType;
|
||||
import com.jero.modules.activiti.process.esInitChange.service.ProcessEsInitChangeService;
|
||||
import com.jero.modules.activiti.process.esInitChange.mapper.ProcessEsInitChangeMapper;
|
||||
import com.jero.modules.laws.enterprise.util.EnterpriseStandardUtil;
|
||||
@@ -103,7 +102,7 @@ public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitCha
|
||||
log.info("当前用户ID:{},相关联的流程定义ID:{}", userId, map.get("processDefinitionId").toString());
|
||||
log.info("匹配到的任务ID:{}", map.get("taskId").toString());
|
||||
|
||||
actFlowCommonService.completeTask("同意", map.get("taskId").toString(), userId);
|
||||
actFlowCommonService.completeTask("同意", map.get("taskId").toString(), userId, map);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -121,23 +120,28 @@ public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitCha
|
||||
}
|
||||
|
||||
@Override
|
||||
public void approvalInitChange(String taskId, List<ProcessEsInitChange> esInitChangeList) {
|
||||
// 校验企标编号是否冲突
|
||||
if (!esUtil.verifyEnStandardNumber(esInitChangeList.get(0).getOriginEnStandardNo())) {
|
||||
throw new JeroBootException("企标编号冲突");
|
||||
}
|
||||
public void approvalInitChange(String taskId, List<ProcessEsInitChange> esInitChangeList, boolean pass) {
|
||||
String userId = UserUtils.getUserId();
|
||||
// 更新业务流程数据
|
||||
saveOrUpdateBatch(esInitChangeList);
|
||||
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));
|
||||
}
|
||||
// 设置流程变量
|
||||
setVariables(esInitChangeList.get(0));
|
||||
map.put("pass", pass);
|
||||
// TODO 保存流程审批信息
|
||||
actFlowCommonService.completeTask(esInitChangeList.get(0).getRemarks(), taskId, userId);
|
||||
actFlowCommonService.completeTask(esInitChangeList.get(0).getRemarks(), taskId, userId, map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveToWait(String taskId, ProcessEsInitChange esInitChange) {
|
||||
// TODO 检查任务是否存在
|
||||
// 检查任务是否存在
|
||||
saveOrUpdate(esInitChange);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user