瀏覽代碼

订单手工关闭报错修复

hu 1 年之前
父節點
當前提交
f5adc1912c
共有 1 個文件被更改,包括 26 次插入0 次删除
  1. 26 0
      src/custom/restcontroller/webmanage/sale/order/Order.java

+ 26 - 0
src/custom/restcontroller/webmanage/sale/order/Order.java

@@ -2207,6 +2207,15 @@ public class Order extends Controller {
             dbConnect.runSqlUpdate(updateAccountclassinfos(sa_orderid, sa_accountclassid, sys_enterpriseid));
             rows = getOrderRows(this, sa_orderid);
             row = rows.get(0);
+        }else{
+            if(isJSONArray(row.getString("sa_accountclassinfos"))){
+                JSONArray jsonArrayResult = JSONArray.parseArray(row.getString("sa_accountclassinfos"));
+                if(jsonArrayResult.isEmpty()){
+                    dbConnect.runSqlUpdate(updateAccountclassinfos(sa_orderid, sa_accountclassid, sys_enterpriseid));
+                    rows = getOrderRows(this, sa_orderid);
+                    row = rows.get(0);
+                }
+            }
         }
 
         //System.out.println(rows.get(0).getString("sa_accountclassinfos"));
@@ -2313,6 +2322,15 @@ public class Order extends Controller {
             dbConnect.runSqlUpdate(updateAccountclassinfos(sa_orderid, sa_accountclassid, sys_enterpriseid));
             rows = getOrderRows(this, sa_orderid);
             row = rows.get(0);
+        }else{
+            if(isJSONArray(row.getString("sa_accountclassinfos"))){
+                JSONArray jsonArrayResult = JSONArray.parseArray(row.getString("sa_accountclassinfos"));
+                if(jsonArrayResult.isEmpty()){
+                    dbConnect.runSqlUpdate(updateAccountclassinfos(sa_orderid, sa_accountclassid, sys_enterpriseid));
+                    rows = getOrderRows(this, sa_orderid);
+                    row = rows.get(0);
+                }
+            }
         }
         BigDecimal amount = beans.order.Order.getAmount(this, sa_orderid);
         ArrayList<String> sqlList = new ArrayList<>();
@@ -3434,6 +3452,14 @@ public class Order extends Controller {
         if (StringUtils.isBlank(orderRow.get(0).getString("sa_accountclassinfos"))) {
             dbConnect.runSqlUpdate(updateAccountclassinfos(sa_orderid, sa_accountclassid, sys_enterpriseid));
             orderRow = getOrderRows(this, sa_orderid);
+        }else{
+            if(isJSONArray(orderRow.get(0).getString("sa_accountclassinfos"))){
+                JSONArray jsonArrayResult = JSONArray.parseArray(orderRow.get(0).getString("sa_accountclassinfos"));
+                if(jsonArrayResult.isEmpty()){
+                    dbConnect.runSqlUpdate(updateAccountclassinfos(sa_orderid, sa_accountclassid, sys_enterpriseid));
+                    orderRow = getOrderRows(this, sa_orderid);
+                }
+            }
         }
         if (dbConnect.runSqlQuery("SELECT 1 from sa_dispatch t1 left join sa_dispatch_items t2 on t1.sa_dispatchid=t2.sa_dispatchid and t1.siteid=t2.siteid left join sa_orderitems t3 on t2.sa_orderitemsid=t3.sa_orderitemsid and t2.siteid=t3.siteid WHERE t1.status not in ('关闭','手工关闭') and t1.siteid='" + siteid + "' and t3.sa_orderid=" + sa_orderid).isNotEmpty()) {
             return getErrReturnObject().setErrMsg("存在未关闭的发货单,无法关闭").toString();