|
@@ -339,27 +339,36 @@ public class OrderItemsHelper extends BaseClass {
|
|
|
BigDecimal qty = item.getBigDecimalValue("qty");
|
|
|
String itemid = item.getString("itemid");
|
|
|
if (!type.equals("促销订单")) {
|
|
|
- if (itemRowsMap.containsKey(itemid)) {
|
|
|
- if (itemRowsMap.get(itemid).isNotEmpty()) {
|
|
|
- BigDecimal orderaddqty = itemRowsMap.get(itemid).get(0).getBigDecimal("orderaddqty");
|
|
|
- BigDecimal orderminqty = itemRowsMap.get(itemid).get(0).getBigDecimal("orderminqty");
|
|
|
- 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 (!type.equals("促销订单")) {
|
|
|
+ if (itemRowsMap.containsKey(itemid)) {
|
|
|
+ Rows itemRows = itemRowsMap.getOrDefault(itemid, new Rows());
|
|
|
+ if (itemRows.isNotEmpty()) {
|
|
|
+ BigDecimal orderaddqty = itemRows.get(0).getBigDecimal("orderaddqty");
|
|
|
+ BigDecimal orderminqty = itemRows.get(0).getBigDecimal("orderminqty");
|
|
|
+ if (orderaddqty.compareTo(BigDecimal.ZERO) != 0) {
|
|
|
+ if (((qty.subtract(orderminqty)).remainder(orderaddqty)).compareTo(BigDecimal.ZERO) != 0 || qty.compareTo(orderminqty) < 0) {
|
|
|
+ throw new YosException(false, "品号为" + itemRows.get(0).getString("itemno") + "的商品数量不符合该商品的起订量和增量");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ } else {
|
|
|
+ Rows itemRows = itemRowsMap.getOrDefault(itemid, new Rows());
|
|
|
+ if (qty.compareTo(BigDecimal.ZERO) <= 0) {
|
|
|
+ throw new YosException(false, "品号为" + itemRows.get(0).getString("itemno") + "的商品数量必须大于0");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
RowsMap pRowsMap = promotionitems.toRowsMap("sa_promotion_itemsid");
|
|
|
if (type.equals("促销订单")) {
|
|
|
if (pRowsMap.containsKey(item.getString("sa_promotion_itemsid"))) {
|
|
|
- if (pRowsMap.get(item.getString("sa_promotion_itemsid")).isNotEmpty()) {
|
|
|
- BigDecimal saledqty = pRowsMap.get(item.getString("sa_promotion_itemsid")).get(0).getBigDecimal("saledqty");
|
|
|
- BigDecimal groupqty = pRowsMap.get(item.getString("sa_promotion_itemsid")).get(0).getBigDecimal("groupqty");
|
|
|
- BigDecimal orderaddqty = pRowsMap.get(item.getString("sa_promotion_itemsid")).get(0).getBigDecimal("orderaddqty");
|
|
|
- BigDecimal orderminqty = pRowsMap.get(item.getString("sa_promotion_itemsid")).get(0).getBigDecimal("orderminqty");
|
|
|
- boolean islimit = pRowsMap.get(item.getString("sa_promotion_itemsid")).get(0).getBoolean("islimit");
|
|
|
+ String saPromotionItemsid = item.getString("sa_promotion_itemsid");
|
|
|
+ if (pRowsMap.get(saPromotionItemsid).isNotEmpty()) {
|
|
|
+ BigDecimal saledqty = pRowsMap.get(saPromotionItemsid).get(0).getBigDecimal("saledqty");
|
|
|
+ BigDecimal groupqty = pRowsMap.get(saPromotionItemsid).get(0).getBigDecimal("groupqty");
|
|
|
+ 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") + "的商品数量不符合该商品的起订量和增量");
|
|
@@ -418,7 +427,7 @@ public class OrderItemsHelper extends BaseClass {
|
|
|
String colors = "颜色:" + item.getStringValue("customcolors");
|
|
|
String cheek = "工艺:" + item.getStringValue("customcheek");
|
|
|
String size = "尺寸:" + item.getStringValue("length") + "*" + item.getStringValue("width");
|
|
|
- customproperties.add(material +";"+ colors+";"+ cheek +";"+ size);
|
|
|
+ customproperties.add(material + ";" + colors + ";" + cheek + ";" + size);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -427,7 +436,7 @@ public class OrderItemsHelper extends BaseClass {
|
|
|
String colors = "颜色:" + item.getStringValue("customcolors");
|
|
|
String cheek = "工艺:" + item.getStringValue("customcheek");
|
|
|
String size = "尺寸:" + item.getStringValue("length") + "*" + item.getStringValue("width");
|
|
|
- customproperties.add(material +";"+ colors+";"+ cheek +";"+ size);
|
|
|
+ customproperties.add(material + ";" + colors + ";" + cheek + ";" + size);
|
|
|
}
|
|
|
}
|
|
|
|