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

Commit e0a2bcda authored by 胡佳晨's avatar 胡佳晨

正在下单bug

parent bbcde286
...@@ -156,6 +156,18 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService { ...@@ -156,6 +156,18 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService {
if (!spuVo.getSkuIdList().contains(item.getSkuId())) { if (!spuVo.getSkuIdList().contains(item.getSkuId())) {
return ResponseDto.failure("参数异常"); return ResponseDto.failure("参数异常");
} }
//mongo
GoblinGoodsSkuInfoVo skuVo = redisUtils.getGoodsSkuInfoVo(item.getSkuId());
//判断库存相关
if (item.getStockMarketing() > 0) {
int restStock = redisUtils.decrSkuStock(null, item.getSkuId(), item.getStockMarketing());
if (restStock < 0) {
errorNameList.add(skuVo.getName()+"库存不足");
redisUtils.incrSkuStock(null, item.getSkuId(), item.getStockMarketing());
item.setStockMarketing(0);
// continue;
}
}
String zhengzaiId = IDGenerator.nextMilliId2(); String zhengzaiId = IDGenerator.nextMilliId2();
GoblinMarketingZhengzai bean = GoblinMarketingZhengzai.getNew(); GoblinMarketingZhengzai bean = GoblinMarketingZhengzai.getNew();
bean.setStoreId(params.getStoreId()); bean.setStoreId(params.getStoreId());
...@@ -170,17 +182,8 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService { ...@@ -170,17 +182,8 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService {
bean.setBuyRoster(item.getBuyRoster()); bean.setBuyRoster(item.getBuyRoster());
bean.setDelFlag(0); bean.setDelFlag(0);
bean.setCreatedAt(now); bean.setCreatedAt(now);
//mongo
GoblinGoodsSkuInfoVo skuVo = redisUtils.getGoodsSkuInfoVo(item.getSkuId());
//判断库存相关
if (item.getStockMarketing() > 0) {
int restStock = redisUtils.decrSkuStock(null, item.getSkuId(), item.getStockMarketing());
if (restStock < 0) {
errorNameList.add(skuVo.getName()+"库存不足");
redisUtils.incrSkuStock(null, item.getSkuId(), item.getStockMarketing());
// continue;
}
}
String marketSkuId = item.getSkuId().concat(GoblinStatusConst.MarketPreStatus.MARKET_PRE_ZHENGZAI.getValue()).concat(IDGenerator.marketGoodId(params.getSelfMarketId())); String marketSkuId = item.getSkuId().concat(GoblinStatusConst.MarketPreStatus.MARKET_PRE_ZHENGZAI.getValue()).concat(IDGenerator.marketGoodId(params.getSelfMarketId()));
skuVo.setSpuId(marketSpuId); skuVo.setSpuId(marketSpuId);
skuVo.setSkuId(marketSkuId); skuVo.setSkuId(marketSkuId);
......
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