Преглед изворни кода

订单手动关闭bug修复

eganwu пре 1 година
родитељ
комит
616be52dc7
1 измењених фајлова са 6 додато и 5 уклоњено
  1. 6 5
      src/custom/restcontroller/webmanage/sale/order/Order.java

+ 6 - 5
src/custom/restcontroller/webmanage/sale/order/Order.java

@@ -3393,7 +3393,8 @@ public class Order extends Controller {
             if (promotion_auth.isNotEmpty()) {
                 sa_promotion_authid = promotion_auth.get(0).getLong("sa_promotion_authid");
             }
-            if (orderaccountclassinfo.getBigDecimal("amount").compareTo(totalprice) >= 0) {
+            BigDecimal amount_orderaccount = orderaccountclassinfo.getBigDecimalValue("amount",0);
+            if (amount_orderaccount.compareTo(totalprice) >= 0) {
                 System.out.println("1111");
                 CashbillEntity entity = new CashbillEntity();
                 entity.setAmount(totalprice.negate());
@@ -3408,10 +3409,10 @@ public class Order extends Controller {
                 sqlList.addAll(cashbillPay.getJSONArray("sqlList").toJavaList(String.class));
                 sa_cashbillidList.add(cashbillPay.getLong("sa_cashbillid"));
                 sqlList.add("update sa_promotion_auth set saledamount=saledamount-" + totalprice + " where sa_promotion_authid=" + sa_promotion_authid);
-            } else if (orderaccountclassinfo.getBigDecimal("amount").compareTo(totalprice) < 0) {
+            } else if (amount_orderaccount.compareTo(totalprice) < 0) {
                 System.out.println("222");
                 CashbillEntity entity = new CashbillEntity();
-                entity.setAmount(orderaccountclassinfo.getBigDecimal("amount").negate());
+                entity.setAmount(amount_orderaccount.negate());
                 entity.setSource("订单手工关闭");
                 entity.setSourcenote(orderRow.get(0).getString("sonum"));
                 entity.setOwnerid(sa_orderid);
@@ -3423,10 +3424,10 @@ public class Order extends Controller {
                 sqlList.addAll(cashbillPay.getJSONArray("sqlList").toJavaList(String.class));
                 sa_cashbillidList.add(cashbillPay.getLong("sa_cashbillid"));
 
-                sqlList.add("update sa_promotion_auth set saledamount=saledamount-" + orderaccountclassinfo.getBigDecimal("amount") + " where sa_promotion_authid=" + sa_promotion_authid);
+                sqlList.add("update sa_promotion_auth set saledamount=saledamount-" + amount_orderaccount + " where sa_promotion_authid=" + sa_promotion_authid);
 
                 CashbillEntity promotionentity = new CashbillEntity();
-                promotionentity.setAmount((totalprice.subtract(orderaccountclassinfo.getBigDecimal("amount"))).negate());
+                promotionentity.setAmount((totalprice.subtract(amount_orderaccount)).negate());
                 promotionentity.setSource("订单手工关闭");
                 promotionentity.setSourcenote(orderRow.get(0).getString("sonum"));
                 promotionentity.setOwnerid(sa_orderid);