记得上下班打卡 | git大法好,push需谨慎

Commit 94bf5d7f authored by 张国柄's avatar 张国柄

Merge remote-tracking branch 'origin/dev_goblin' into dev_goblin

parents 715c622d 373a1585
...@@ -119,8 +119,6 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -119,8 +119,6 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
// 判断库存 // 判断库存
String pre = GoblinStatusConst.MarketPreStatus.getPre(skuId); String pre = GoblinStatusConst.MarketPreStatus.getPre(skuId);
int limitCount = skuVo.getBuyLimit() == 0 ? Integer.MAX_VALUE : skuVo.getBuyLimit(); int limitCount = skuVo.getBuyLimit() == 0 ? Integer.MAX_VALUE : skuVo.getBuyLimit();
int surplusGeneral = redisUtils.decrSkuStock(pre, skuId, number);
skuAndPreListAndNumber.add(skuId + "," + pre + "," + number);
//判断限购 //判断限购
if (noZhengzaiOrder(uid)) { if (noZhengzaiOrder(uid)) {
String res1 = orderUtils.judgeOrderLimit(uid, skuId, number, limitCount); String res1 = orderUtils.judgeOrderLimit(uid, skuId, number, limitCount);
...@@ -128,6 +126,8 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -128,6 +126,8 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
throw new Exception("已超出限购数量"); throw new Exception("已超出限购数量");
} }
} }
int surplusGeneral = redisUtils.decrSkuStock(pre, skuId, number);
skuAndPreListAndNumber.add(skuId + "," + pre + "," + number);
//库存回滚 //库存回滚
if (surplusGeneral < 0) { if (surplusGeneral < 0) {
throw new Exception("已售罄"); throw new Exception("已售罄");
...@@ -306,14 +306,14 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -306,14 +306,14 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
GoblinOrderAttr orderAttr = GoblinOrderAttr.getNew(); GoblinOrderAttr orderAttr = GoblinOrderAttr.getNew();
orderAttr.setOrderAttrId(IDGenerator.nextTimeId2()); orderAttr.setOrderAttrId(IDGenerator.nextTimeId2());
orderAttr.setOrderId(orderId); orderAttr.setOrderId(orderId);
if (!writeOffCode.equals("EMPTY")) { // if (!writeOffCode.equals("EMPTY")) {
orderAttr.setExpressContacts(addressesVo.getName()); // orderAttr.setExpressContacts(addressesVo.getName());
orderAttr.setExpressAddress(addressesVo.getProvince() + "," + addressesVo.getCounty() + "," + addressesVo.getCity()); // orderAttr.setExpressAddress(addressesVo.getProvince() + "," + addressesVo.getCounty() + "," + addressesVo.getCity());
orderAttr.setExpressAddressDetail(addressesVo.getAddress()); // orderAttr.setExpressAddressDetail(addressesVo.getAddress());
orderAttr.setExpressPhone(addressesVo.getPhone()); // orderAttr.setExpressPhone(addressesVo.getPhone());
orderAttr.setExpressType(1); // orderAttr.setExpressType(1);
orderAttr.setCreatedAt(now); // orderAttr.setCreatedAt(now);
} // }
//返回值 //返回值
GoblinOrderPreParam preParam = GoblinOrderPreParam.getNew(); GoblinOrderPreParam preParam = GoblinOrderPreParam.getNew();
preParam.setPriceActual(storeOrder.getPriceActual()); preParam.setPriceActual(storeOrder.getPriceActual());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment