|
|
@@ -380,6 +380,10 @@ public class OrderItemsHelper extends BaseClass {
|
|
|
}
|
|
|
}
|
|
|
RowsMap pRowsMap = promotionitems.toRowsMap("sa_promotion_itemsid");
|
|
|
+ long sa_promotionid =0;
|
|
|
+ if(promotionitems.isNotEmpty()){
|
|
|
+ sa_promotionid = promotionitems.get(0).getLong("sa_promotionid");
|
|
|
+ }
|
|
|
if (type.equals("促销订单")) {
|
|
|
if (pRowsMap.containsKey(item.getString("sa_promotion_itemsid"))) {
|
|
|
String saPromotionItemsid = item.getString("sa_promotion_itemsid");
|
|
|
@@ -389,11 +393,17 @@ public class OrderItemsHelper extends BaseClass {
|
|
|
BigDecimal orderaddqty = pRowsMap.get(saPromotionItemsid).get(0).getBigDecimal("orderaddqty");
|
|
|
BigDecimal orderminqty = pRowsMap.get(saPromotionItemsid).get(0).getBigDecimal("orderminqty");
|
|
|
boolean islimit = pRowsMap.get(saPromotionItemsid).get(0).getBoolean("islimit");
|
|
|
- if (orderaddqty.compareTo(BigDecimal.ZERO) != 0) {
|
|
|
- if (((qty.subtract(orderminqty)).remainder(orderaddqty)).compareTo(BigDecimal.ZERO) != 0 || qty.compareTo(orderminqty) < 0) {
|
|
|
- throw new YosException(false, "品号为" + itemRowsMap.get(itemid).get(0).getString("itemno") + "的商品数量不符合该商品的起订量和增量");
|
|
|
+ Rows rows =dbConnect.runSqlQuery("select * from sa_promotion where sa_promotionid="+sa_promotionid);
|
|
|
+ if(rows.isNotEmpty()){
|
|
|
+ if(!rows.get(0).getString("type").equals("套餐活动")){
|
|
|
+ if (orderaddqty.compareTo(BigDecimal.ZERO) != 0) {
|
|
|
+ if (((qty.subtract(orderminqty)).remainder(orderaddqty)).compareTo(BigDecimal.ZERO) != 0 || qty.compareTo(orderminqty) < 0) {
|
|
|
+ throw new YosException(false, "品号为" + itemRowsMap.get(itemid).get(0).getString("itemno") + "的商品数量不符合该商品的起订量和增量");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
if (islimit) {
|
|
|
if (groupqty.compareTo(saledqty.add(qty)) < 0) {
|
|
|
throw new YosException(false, "品号:" + itemRow.getString("itemno") + "已超过限购数量:" + groupqty.subtract(saledqty));
|