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

Commit 1cfc884f authored by 张国柄's avatar 张国柄

~API:商品编辑(SKU、SPU);

parent 3ab04b87
...@@ -66,6 +66,8 @@ public class GoblinStoreMgtGoodsEditSkuParam implements Serializable { ...@@ -66,6 +66,8 @@ public class GoblinStoreMgtGoodsEditSkuParam implements Serializable {
vo.setPrice(this.getPrice()); vo.setPrice(this.getPrice());
vo.setPriceMember(this.getPriceMember()); vo.setPriceMember(this.getPriceMember());
vo.setWeight(this.getWeight()); vo.setWeight(this.getWeight());
vo.setStock(this.getStock());
vo.setSkuStock(this.getSkuStock());
vo.setWarningStock(this.getWarningStock()); vo.setWarningStock(this.getWarningStock());
vo.setSkuAppear(this.getSkuAppear()); vo.setSkuAppear(this.getSkuAppear());
vo.setSkuIsbn(this.getSkuIsbn()); vo.setSkuIsbn(this.getSkuIsbn());
......
...@@ -145,10 +145,13 @@ public class GoblinStoreMgtGoodsController { ...@@ -145,10 +145,13 @@ public class GoblinStoreMgtGoodsController {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("商品管理:商品编辑:编辑SKU:[GoblinStoreMgtGoodsEditSkuParam={}]", JsonUtils.toJson(storeMgtGoodsEditSkuParam)); log.debug("商品管理:商品编辑:编辑SKU:[GoblinStoreMgtGoodsEditSkuParam={}]", JsonUtils.toJson(storeMgtGoodsEditSkuParam));
} }
storeMgtGoodsEditSkuParam.setStock(goodsSkuInfoVo.getStock());
storeMgtGoodsEditSkuParam.setSkuStock(goodsSkuInfoVo.getSkuStock());
String skuId = storeMgtGoodsEditSkuParam.getSkuId(); String skuId = storeMgtGoodsEditSkuParam.getSkuId();
Integer operStock = storeMgtGoodsEditSkuParam.getOperStock(); Integer operStock = storeMgtGoodsEditSkuParam.getOperStock();
if (null != operStock && operStock != 0) {// 处理库存 if (null != operStock && operStock != 0) {// 处理库存
int operStockVal = Math.abs(operStock); int operStockVal = Math.abs(operStock);
Integer stock = goodsSkuInfoVo.getSkuStock();// 总库存
Integer skuStock = goodsSkuInfoVo.getSkuStock();// SKU总库存 Integer skuStock = goodsSkuInfoVo.getSkuStock();// SKU总库存
int rtSkuStock = goblinRedisUtils.getSkuStock(null, skuId);// 当前剩余库存 int rtSkuStock = goblinRedisUtils.getSkuStock(null, skuId);// 当前剩余库存
...@@ -158,10 +161,12 @@ public class GoblinStoreMgtGoodsController { ...@@ -158,10 +161,12 @@ public class GoblinStoreMgtGoodsController {
return ResponseDto.failure(ErrorMapping.get("149012")); return ResponseDto.failure(ErrorMapping.get("149012"));
} else { } else {
storeMgtGoodsEditSkuParam.setSkuStock(skuStock - operStockVal); storeMgtGoodsEditSkuParam.setSkuStock(skuStock - operStockVal);
storeMgtGoodsEditSkuParam.setStock(stock - operStockVal);
} }
} else if (operStock > 0) {// 增加 } else if (operStock > 0) {// 增加
goblinRedisUtils.incrSkuStock(null, skuId, operStockVal); goblinRedisUtils.incrSkuStock(null, skuId, operStockVal);
storeMgtGoodsEditSkuParam.setSkuStock(skuStock + operStockVal); storeMgtGoodsEditSkuParam.setSkuStock(skuStock + operStockVal);
storeMgtGoodsEditSkuParam.setStock(stock + operStockVal);
} }
} }
if (goblinstoreMgtGoodsService.goodsEditSku(storeMgtGoodsEditSkuParam)) { if (goblinstoreMgtGoodsService.goodsEditSku(storeMgtGoodsEditSkuParam)) {
......
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