|
@@ -1237,6 +1237,20 @@ public class Order extends Controller {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //促销订单经销商限购金额判断
|
|
|
+ Rows promotion_auth = dbConnect.runSqlQuery(" select * from sa_promotion_auth where sys_enterpriseid="+sys_enterpriseid+" and sa_promotionid="+sa_promotionid);
|
|
|
+ if(promotion_auth.isNotEmpty()){
|
|
|
+ boolean islimit = promotion_auth.get(0).getBoolean("islimit");
|
|
|
+ BigDecimal limitamount = promotion_auth.get(0).getBigDecimal("limitamount");
|
|
|
+ BigDecimal saledamount = promotion_auth.get(0).getBigDecimal("saledamount");
|
|
|
+ if(islimit){
|
|
|
+ if(amount.compareTo(limitamount.subtract(saledamount))>0){
|
|
|
+ return getErrReturnObject().setErrMsg("已超过促销方案限定金额,无法提交").toString();
|
|
|
+ }
|
|
|
+ sqlList.add("update sa_promotion_auth set saledamount=saledamount+" + amount + " where sa_promotion_authid=" + promotion_auth.get(0).getLong("sa_promotion_authid"));
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1703,6 +1717,18 @@ public class Order extends Controller {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //促销订单经销商限购金额判断
|
|
|
+ Rows promotion_auth = dbConnect.runSqlQuery("select * from sa_promotion_auth where sys_enterpriseid="+sys_enterpriseid+" and sa_promotionid="+row.getLong("sa_promotionid"));
|
|
|
+ if(promotion_auth.isNotEmpty()){
|
|
|
+ boolean islimit = promotion_auth.get(0).getBoolean("islimit");
|
|
|
+ BigDecimal limitamount = promotion_auth.get(0).getBigDecimal("limitamount");
|
|
|
+ BigDecimal saledamount = promotion_auth.get(0).getBigDecimal("saledamount");
|
|
|
+ if(islimit){
|
|
|
+ sqlList.add("update sa_promotion_auth set saledamount=saledamount-" + amount + " where sa_promotion_authid=" + promotion_auth.get(0).getLong("sa_promotion_authid"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
SQLFactory sqlFactory = new SQLFactory(this, "订单_退回");
|