|
|
@@ -80,6 +80,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
|
80
|
80
|
import cn.hutool.core.lang.UUID;
|
|
81
|
81
|
import lombok.RequiredArgsConstructor;
|
|
82
|
82
|
import lombok.extern.slf4j.Slf4j;
|
|
|
83
|
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
83
|
84
|
|
|
84
|
85
|
import static com.srm.bpm.logic.constant.BillStatus.CANCEL;
|
|
85
|
86
|
import static com.srm.bpm.logic.constant.NodeLinkType.create;
|
|
|
@@ -652,6 +653,9 @@ public class BillBpmnLogicImpl implements BillBpmnLogic {
|
|
652
|
653
|
} catch (Exception e) {
|
|
653
|
654
|
log.error("检查归档条件并触发回调时发生异常。billId: {}, taskId: {}, 错误: {}",
|
|
654
|
655
|
bill != null ? bill.getId() : null, taskId, e.getMessage(), e);
|
|
|
656
|
+ // 设置事务回滚,确保异常不会导致事务提交
|
|
|
657
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
658
|
+ throw new RuntimeException("检查归档条件并触发回调时发生异常: " + e.getMessage(), e);
|
|
655
|
659
|
}
|
|
656
|
660
|
}
|
|
657
|
661
|
|
|
|
@@ -678,6 +682,9 @@ public class BillBpmnLogicImpl implements BillBpmnLogic {
|
|
678
|
682
|
}
|
|
679
|
683
|
} catch (Exception e) {
|
|
680
|
684
|
log.error("触发审批单完成逻辑和回调时发生异常。billId: {}, 错误: {}", bill.getId(), e.getMessage(), e);
|
|
|
685
|
+ // 设置事务回滚,确保异常不会导致事务提交
|
|
|
686
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
687
|
+ throw new RuntimeException("触发审批单完成逻辑和回调时发生异常: " + e.getMessage(), e);
|
|
681
|
688
|
}
|
|
682
|
689
|
}
|
|
683
|
690
|
|
|
|
@@ -745,6 +752,9 @@ public class BillBpmnLogicImpl implements BillBpmnLogic {
|
|
745
|
752
|
}
|
|
746
|
753
|
} catch (Exception e) {
|
|
747
|
754
|
log.error("检查审批单完成状态时发生异常。billId: {}, 错误: {}", bill.getId(), e.getMessage(), e);
|
|
|
755
|
+ // 设置事务回滚,确保异常不会导致事务提交
|
|
|
756
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
757
|
+ throw new RuntimeException("检查审批单完成状态时发生异常: " + e.getMessage(), e);
|
|
748
|
758
|
}
|
|
749
|
759
|
}
|
|
750
|
760
|
|