Просмотр исходного кода

[审批流][修改][判断任务不存在给前端提示]

release_toaliyun_real
luozukai 7 лет назад
Родитель
Сommit
a6c7384cda
2 измененных файлов: 13 добавлений и 4 удалений
  1. +6
    -1
      mallinkService/src/main/java/com/iformall/common/ErrorCode.java
  2. +7
    -3
      mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java

+ 6
- 1
mallinkService/src/main/java/com/iformall/common/ErrorCode.java Просмотреть файл

@@ -28,11 +28,16 @@ public enum ErrorCode{
SYS_REPEAT_SUBMIT_EXCEPTION(1013, "请勿重复操作"), SYS_REPEAT_SUBMIT_EXCEPTION(1013, "请勿重复操作"),


/** /**
* 数据库
* 审批流
*/ */
FLOW_FAIL(24000, "审批流操作出错"), FLOW_FAIL(24000, "审批流操作出错"),




/**
* 审批流不存在
*/
FLOW_INST_NOT_EXIST(24001, "任务不存在"),

/** /**
* 数据库 * 数据库
*/ */


+ 7
- 3
mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java Просмотреть файл

@@ -2,6 +2,7 @@ package com.iformall.service.impl;


import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.iformall.common.ErrorCode;
import com.iformall.common.Result; import com.iformall.common.Result;
import com.iformall.common.ResultData; import com.iformall.common.ResultData;
import com.iformall.domain.po.*; import com.iformall.domain.po.*;
@@ -92,7 +93,7 @@ public class WxFlowServiceImpl implements WxFlowService {
rent.setApplyStatus(applyStatus); rent.setApplyStatus(applyStatus);
wxRentContractService.updateApplyStatus(rent); wxRentContractService.updateApplyStatus(rent);


// 如果审批完成,而且是补录,修改状态
// 如果审批完成,而且是补录直接改为已签约状态(普通需要绑定商户才是已签约)
if(supplement!=null && supplement && EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { if(supplement!=null && supplement && EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) {
wxRentContractService.updateRentContractStatus(businessId); wxRentContractService.updateRentContractStatus(businessId);
} }
@@ -252,6 +253,9 @@ public class WxFlowServiceImpl implements WxFlowService {
} }
String processInstanceId = resultList.get(0).getProcessInstanceId(); String processInstanceId = resultList.get(0).getProcessInstanceId();
ProcessInstance pi = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); ProcessInstance pi = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
if(pi == null){
return new ResultData(ErrorCode.FLOW_INST_NOT_EXIST.getCode(), "任务不存在");
}
Task task = taskService.createTaskQuery().processInstanceId(pi.getId()).singleResult(); Task task = taskService.createTaskQuery().processInstanceId(pi.getId()).singleResult();
Map<String,Object> mapInfo = taskService.getVariables(task.getId()); Map<String,Object> mapInfo = taskService.getVariables(task.getId());
List<Map<String,String>> taskAssigneeList = (List)mapInfo.get("taskAssignee"); List<Map<String,String>> taskAssigneeList = (List)mapInfo.get("taskAssignee");
@@ -318,7 +322,7 @@ public class WxFlowServiceImpl implements WxFlowService {


Task task = taskService.createTaskQuery().taskId(taskId).singleResult(); Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
if (task == null) { if (task == null) {
throw new MallinkException(Result.ERROR, "流程不存在");
return new ResultData(ErrorCode.FLOW_INST_NOT_EXIST.getCode(), "任务不存在");
} }
taskName = task.getName(); taskName = task.getName();
taskKey = task.getTaskDefinitionKey(); taskKey = task.getTaskDefinitionKey();
@@ -464,7 +468,7 @@ public class WxFlowServiceImpl implements WxFlowService {
String taskKey; String taskKey;
Task task = taskService.createTaskQuery().taskId(taskId).singleResult(); Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
if (task == null) { if (task == null) {
throw new MallinkException(Result.ERROR, "流程不存在");
return new ResultData(ErrorCode.FLOW_INST_NOT_EXIST.getCode(), "任务不存在");
} }
taskName = task.getName(); taskName = task.getName();
taskKey = task.getTaskDefinitionKey(); taskKey = task.getTaskDefinitionKey();


Загрузка…
Отмена
Сохранить