Browse Source

1.处理原单被删除的情况

heqinwei 7 years ago
parent
commit
905d56c08e

+ 1 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java

@@ -77,6 +77,7 @@ public enum BizExceptionCode implements BaseExceptionCode {
     RECALANCE_OUTNOWBALANCE(74003,"本次核销金额不能大于未核销金额"),
     BEFORE_UNAUDIT(74006, "单据:<u>%s</u>未审核,无法反审核"),
     BANK_AMOUNT_NOTENOUGH(74004, "资金账号不足"),
+    SUBLEDGER_NOT_EXIS(74005,"来源单据不存在"),
 
 
 

+ 3 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java

@@ -137,6 +137,9 @@ public class PaybalanceServiceImpl extends CommonBaseServiceImpl<PaybalanceMappe
             Double namount = new Double(0);
             if(sourceId!=0){
                 Subledger subledger = subledgerMapper.selectByPrimaryKey(sourceId);
+                if (subledger == null){
+                    throw new BizException(500, BizExceptionCode.SUBLEDGER_NOT_EXIS.getMessage());
+                }
                 namount = subledger.getSl_namount();
             }
             //本次核销金额不能大于未核销金额

+ 3 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java

@@ -135,6 +135,9 @@ public class RecbalanceServiceImpl extends CommonBaseServiceImpl<RecbalanceMappe
             Double namount = new Double(0);
             if(sourceId!=0){
                 Subledger subledger = subledgerMapper.selectByPrimaryKey(sourceId);
+                if (subledger == null){
+                    throw new BizException(500, BizExceptionCode.SUBLEDGER_NOT_EXIS.getMessage());
+                }
                 namount = subledger.getSl_namount()==null?new Double(0):subledger.getSl_namount();
             }
             //本次核销金额不能大于未核销金额