Przeglądaj źródła

审批流添加事务

release_toaliyun_real
luozukai 7 lat temu
rodzic
commit
24e09e649e
2 zmienionych plików z 8 dodań i 2 usunięć
  1. +1
    -1
      mallinkService/src/main/java/com/iformall/service/WxFlowService.java
  2. +7
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java

+ 1
- 1
mallinkService/src/main/java/com/iformall/service/WxFlowService.java Wyświetl plik

@@ -51,7 +51,7 @@ public interface WxFlowService {
/**
* 生成流程图
* @param httpServletResponse
* @param processInstanceId
* @param businessId
* @throws Exception
*/
void genProcessDiagram(HttpServletResponse httpServletResponse, String businessId) throws Exception;


+ 7
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java Wyświetl plik

@@ -26,8 +26,9 @@ import org.flowable.task.api.Task;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.io.OutputStream;
@@ -72,6 +73,7 @@ public class WxFlowServiceImpl implements WxFlowService {
}

@Override
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class})
public ResultData start(Map<String, Object> params,Long userId,String userName,String tenantId) {
String remark = (String)params.get("remark");
Long businessId = Long.parseLong((String)params.get("businessId"));
@@ -110,6 +112,8 @@ public class WxFlowServiceImpl implements WxFlowService {
wxFlowRecord.setStatus(EnumFlowRecordStatus.NEW.getCode());
wxFlowRecordService.saveOrUpdate(wxFlowRecord);

System.out.println(1/0);

// 给审批人发送代办通知短信
List<MallUserInfo> mallUserInfoList = getUserByProcessInstanceId(processInstance.getId());
for (MallUserInfo mallUserInfo:mallUserInfoList) {
@@ -174,6 +178,7 @@ public class WxFlowServiceImpl implements WxFlowService {
}

@Override
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class})
public ResultData apply(Map<String, String> params,Long userId,String userName,String tenantId) {
String taskId = params.get("taskId");
String processInstanceId = params.get("processInstanceId");
@@ -248,6 +253,7 @@ public class WxFlowServiceImpl implements WxFlowService {
}

@Override
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class})
public ResultData reject(Map<String, String> params,Long userId,String userName,String tenantId) {
String taskId = params.get("taskId");
String processInstanceId = params.get("processInstanceId");


Ładowanie…
Anuluj
Zapisz