|
|
@@ -93,11 +93,11 @@ public class OrderItems extends Controller {
|
|
|
Rows promotionitems =dbConnect.runSqlQuery("select * from sa_promotion_items where siteid='"+siteid+"' and sa_promotionid="+sa_promotionid);
|
|
|
RowsMap promotionitemsRowsMap = promotionitems.toRowsMap("itemid");
|
|
|
if(type.equals("促销订单")){
|
|
|
- if(promotionitemsRowsMap.containsKey(itemid)){
|
|
|
- if(promotionitemsRowsMap.get(itemid).isNotEmpty()){
|
|
|
- BigDecimal saledqty =promotionitemsRowsMap.get(itemid).get(0).getBigDecimal("saledqty");
|
|
|
- BigDecimal groupqty =promotionitemsRowsMap.get(itemid).get(0).getBigDecimal("groupqty");
|
|
|
- boolean islimit =promotionitemsRowsMap.get(itemid).get(0).getBoolean("islimit");
|
|
|
+ if(promotionitemsRowsMap.containsKey(item.getString("itemid"))){
|
|
|
+ if(promotionitemsRowsMap.get(item.getString("itemid")).isNotEmpty()){
|
|
|
+ BigDecimal saledqty =promotionitemsRowsMap.get(item.getString("itemid")).get(0).getBigDecimal("saledqty");
|
|
|
+ BigDecimal groupqty =promotionitemsRowsMap.get(item.getString("itemid")).get(0).getBigDecimal("groupqty");
|
|
|
+ boolean islimit =promotionitemsRowsMap.get(item.getString("itemid")).get(0).getBoolean("islimit");
|
|
|
if(islimit){
|
|
|
if(groupqty.compareTo(saledqty.add(qty))<0){
|
|
|
return getErrReturnObject().setErrMsg(itemRow.getString("itemno")+"商品数量已超过促销活动的限定数量【"+groupqty.subtract(saledqty)+"】,无法新建").toString();
|