瀏覽代碼

促销活动返利逻辑优化

hu 1 年之前
父節點
當前提交
b7c0a822f9

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

@@ -1493,6 +1493,12 @@ public class Order extends Controller {
         }
         //促销订单:提交时商品必须是上架状态,并且活动方案中的商品必须也是上架状态,否则不允许提交
         if (type.equals("促销订单")) {
+            Rows promotionauthRows = dbConnect.runSqlQuery("select * from  sa_promotion_auth where  sa_promotionid=" + sa_promotionid + " and sys_enterpriseid ='" + sys_enterpriseid + "' and siteid='" + siteid + "'");
+            if(promotionauthRows.isNotEmpty()){
+                if(promotionauthRows.get(0).getBoolean("settlestatus")){
+                    return getErrReturnObject().setErrMsg("该促销活动已返利完结,无法提交,请删除或联系总部。").toString();
+                }
+            }
 //            orderItemsHelper.checkOffOrderItems(sa_orderid, "plm_item");
             orderItemsHelper.checkOffOrderItems(sa_orderid, "sa_promotion_items", sa_promotionid);
         }

+ 1 - 1
src/custom/restcontroller/webmanage/sale/promotion/promotion.java

@@ -616,7 +616,7 @@ public class promotion extends Controller {
             agentnum = enterpriserows.get(0).getString("agentnum");
         }
         //查询经销商未关闭的促销订单
-        Rows rows = dbConnect.runSqlQuery("select * from  sa_order where type ='促销订单' and deleted!=1 and  sa_promotionid=" + sa_promotionid + " and sys_enterpriseid ='" + sys_enterpriseid + "'  and status not in('关闭','手工关闭') and siteid='" + siteid + "'");
+        Rows rows = dbConnect.runSqlQuery("select * from  sa_order where type ='促销订单' and deleted!=1 and  sa_promotionid=" + sa_promotionid + " and sys_enterpriseid ='" + sys_enterpriseid + "'  and status!='新建' and  status not in('关闭','手工关闭') and siteid='" + siteid + "'");
         Boolean sendRemind = false;
         Long sa_cashbillid = 0L;
         if (rows.isNotEmpty()) {