فهرست منبع

订单商品数量为零禁止提交

hu 2 سال پیش
والد
کامیت
150a5c013f

+ 1 - 1
src/custom/restcontroller/webmanage/sale/dispatch/SQL/发货商品列表查询.sql

@@ -28,6 +28,6 @@ WHERE t3.STATUS = '审核'
 	AND t1.siteid = $siteid$
 	and t3.sys_enterpriseid=$sys_enterpriseid$
 	AND ifnull( t1.isclose, 0 )= 0
-	and t1.sa_orderitemsid not in (select t1.sa_orderitemsid from sa_dispatch_items t1 inner join sa_orderitems t2 on t1.sa_orderitemsid=t2.sa_orderitemsid and t1.siteid=t2.siteid  where t1.sa_dispatchid=$sa_dispatchid$ and t1.qty=t2.undeliqty)
+	and t1.sa_orderitemsid not in (select t1.sa_orderitemsid from sa_dispatch_items t1 inner join sa_orderitems t2 on t1.sa_orderitemsid=t2.sa_orderitemsid and t1.siteid=t2.siteid  where t1.sa_dispatchid=$sa_dispatchid$ and t1.qty>=t2.undeliqty)
 	and  t1.sa_orderitemsid not in(select t1.sa_orderitemsid from (select t1.sa_orderitemsid,t1.siteid,SUM(t1.qty) qty from sa_dispatch_items t1 inner join sa_dispatch t2 on t1.sa_dispatchid=t2.sa_dispatchid and t1.siteid=t2.siteid where t2.status in('新建','提交') group by t1.sa_orderitemsid,t1.siteid) t1 inner join  sa_orderitems t3 on t1.sa_orderitemsid=t3.sa_orderitemsid and t1.siteid=t3.siteid where t3.undeliqty=t1.qty)
 	and $where$

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

@@ -1063,6 +1063,12 @@ public class Order extends Controller {
         if (dbConnect.runSqlQuery("select * from sa_orderitems where sa_orderid=" + sa_orderid + " and siteid='" + siteid + "'").isEmpty()) {
             return getErrReturnObject().setErrMsg("订单表体不存在商品无法提交").toString();
         }
+        Rows orderitems =dbConnect.runSqlQuery("select * from sa_orderitems where sa_orderid=" + sa_orderid + " and siteid='" + siteid + "'");
+        for (Row orderitem:orderitems) {
+            if(orderitem.getBigDecimal("qty").compareTo(BigDecimal.ZERO)<=0){
+                return getErrReturnObject().setErrMsg("存在商品数量为零,无法提交").toString();
+            }
+        }
 
 //        String type = row.getString("type");
         //提交