瀏覽代碼

修改判断条件

y 2 年之前
父節點
當前提交
953c5cd9b0
共有 1 個文件被更改,包括 4 次插入8 次删除
  1. 4 8
      src/main/java/com/ydtech/modules/inv/utils/TransferUtils.java

+ 4 - 8
src/main/java/com/ydtech/modules/inv/utils/TransferUtils.java

@@ -231,12 +231,8 @@ public class TransferUtils {
         }
         }
         String string = (new BigDecimal(String.valueOf(entAmount)).add(new BigDecimal(String.valueOf(outAmount)))).toString();
         String string = (new BigDecimal(String.valueOf(entAmount)).add(new BigDecimal(String.valueOf(outAmount)))).toString();
 
 
-        if (!string.equals("0")) {
-            if (!string.equals("0.00")){
-                if (!string.equals("0.0")){
-                    throw new SystemException("金额未完全分配");
-                }
-            }
+        if (new BigDecimal(string).compareTo(BigDecimal.ZERO) != 0) {
+            throw new SystemException("金额未完全分配");
         }
         }
         return true;
         return true;
     }
     }
@@ -368,10 +364,10 @@ public class TransferUtils {
         if (entInvAccount.getOuterFlag().equals("0")) {
         if (entInvAccount.getOuterFlag().equals("0")) {
             if (enterAccountCard != null) {
             if (enterAccountCard != null) {
                 if (outAccountCard != null) {
                 if (outAccountCard != null) {
-                    if (enterAccountCard.getBalance().equals("0") || enterAccountCard.getBalance().equals("0.00")) {
+                    if (new BigDecimal(enterAccountCard.getBalance()).compareTo(BigDecimal.ZERO) == 0) {
                         throw new SystemException("账户余额不足");
                         throw new SystemException("账户余额不足");
                     }
                     }
-                    if (new BigDecimal(enterAccountCard.getBalance()).compareTo(invAccountExcelApplyAmount) < 0 ){
+                    if (new BigDecimal(enterAccountCard.getBalance()).compareTo(invAccountExcelApplyAmount) < 0) {
                         throw new SystemException("账户余额不足");
                         throw new SystemException("账户余额不足");
                     }
                     }
                 }
                 }