|
@@ -236,8 +236,8 @@ public class FsStoreCartScrmServiceImpl implements IFsStoreCartScrmService
|
|
|
// log.info("检查库存 {} {}",productId,productAttrValueId);
|
|
// log.info("检查库存 {} {}",productId,productAttrValueId);
|
|
|
// FsStoreProductAttrValueScrm productAttrValue=valueMapper.selectFsStoreProductAttrValueById(productAttrValueId);
|
|
// FsStoreProductAttrValueScrm productAttrValue=valueMapper.selectFsStoreProductAttrValueById(productAttrValueId);
|
|
|
// if(StringUtils.isEmpty(productAttrValue.getGroupBarCode())){
|
|
// if(StringUtils.isEmpty(productAttrValue.getGroupBarCode())){
|
|
|
-
|
|
|
|
|
- // todo 库存暂时不获取
|
|
|
|
|
|
|
+//
|
|
|
|
|
+//// todo 库存暂时不获取
|
|
|
// //单品
|
|
// //单品
|
|
|
// ErpGoodsStockQueryRequert queryRequert = new ErpGoodsStockQueryRequert();
|
|
// ErpGoodsStockQueryRequert queryRequert = new ErpGoodsStockQueryRequert();
|
|
|
// queryRequert.setBarcode(productAttrValue.getBarCode());
|
|
// queryRequert.setBarcode(productAttrValue.getBarCode());
|
|
@@ -248,15 +248,15 @@ public class FsStoreCartScrmServiceImpl implements IFsStoreCartScrmService
|
|
|
//
|
|
//
|
|
|
// if(stocks<=0){
|
|
// if(stocks<=0){
|
|
|
// productAttrValue.setStock(0);
|
|
// productAttrValue.setStock(0);
|
|
|
-// valueMapper.updateFsStoreProductAttrValue(productAttrValue);
|
|
|
|
|
-// fsStoreProductMapper.updateStock(productId);
|
|
|
|
|
|
|
+//// valueMapper.updateFsStoreProductAttrValue(productAttrValue);
|
|
|
|
|
+//// fsStoreProductMapper.updateStock(productId);
|
|
|
// throw new CustomException("库存不足");
|
|
// throw new CustomException("库存不足");
|
|
|
// }
|
|
// }
|
|
|
// else{
|
|
// else{
|
|
|
// //更新库存
|
|
// //更新库存
|
|
|
// productAttrValue.setStock(stocks);
|
|
// productAttrValue.setStock(stocks);
|
|
|
-// valueMapper.updateFsStoreProductAttrValue(productAttrValue);
|
|
|
|
|
-// fsStoreProductMapper.updateStock(productId);
|
|
|
|
|
|
|
+//// valueMapper.updateFsStoreProductAttrValue(productAttrValue);
|
|
|
|
|
+//// fsStoreProductMapper.updateStock(productId);
|
|
|
// return;
|
|
// return;
|
|
|
// }
|
|
// }
|
|
|
//
|
|
//
|
|
@@ -275,7 +275,7 @@ public class FsStoreCartScrmServiceImpl implements IFsStoreCartScrmService
|
|
|
// List<StoreProductGroupDTO> productGroupDTOS=JSONUtil.toList(jsonArray, StoreProductGroupDTO.class);
|
|
// List<StoreProductGroupDTO> productGroupDTOS=JSONUtil.toList(jsonArray, StoreProductGroupDTO.class);
|
|
|
// if(productGroupDTOS!=null){
|
|
// if(productGroupDTOS!=null){
|
|
|
// for(StoreProductGroupDTO dto:productGroupDTOS){
|
|
// for(StoreProductGroupDTO dto:productGroupDTOS){
|
|
|
- // todo
|
|
|
|
|
|
|
+//// todo
|
|
|
// FsStoreProductAttrValueScrm attrValue=valueMapper.selectFsStoreProductAttrValueById(dto.getId());
|
|
// FsStoreProductAttrValueScrm attrValue=valueMapper.selectFsStoreProductAttrValueById(dto.getId());
|
|
|
// ErpGoodsStockQueryRequert queryRequert = new ErpGoodsStockQueryRequert();
|
|
// ErpGoodsStockQueryRequert queryRequert = new ErpGoodsStockQueryRequert();
|
|
|
// queryRequert.setBarcode(attrValue.getGroupBarCode());
|
|
// queryRequert.setBarcode(attrValue.getGroupBarCode());
|
|
@@ -286,31 +286,31 @@ public class FsStoreCartScrmServiceImpl implements IFsStoreCartScrmService
|
|
|
//
|
|
//
|
|
|
// if(stocks<=0){
|
|
// if(stocks<=0){
|
|
|
// attrValue.setStock(0);
|
|
// attrValue.setStock(0);
|
|
|
-// valueMapper.updateFsStoreProductAttrValue(attrValue);
|
|
|
|
|
-// fsStoreProductMapper.updateStock(productId);
|
|
|
|
|
|
|
+//// valueMapper.updateFsStoreProductAttrValue(attrValue);
|
|
|
|
|
+//// fsStoreProductMapper.updateStock(productId);
|
|
|
// throw new CustomException("库存不足");
|
|
// throw new CustomException("库存不足");
|
|
|
// }
|
|
// }
|
|
|
// else{
|
|
// else{
|
|
|
// //更新库存
|
|
// //更新库存
|
|
|
// attrValue.setStock(stocks);
|
|
// attrValue.setStock(stocks);
|
|
|
-// valueMapper.updateFsStoreProductAttrValue(attrValue);
|
|
|
|
|
-// fsStoreProductMapper.updateStock(productId);
|
|
|
|
|
|
|
+//// valueMapper.updateFsStoreProductAttrValue(attrValue);
|
|
|
|
|
+//// fsStoreProductMapper.updateStock(productId);
|
|
|
// }
|
|
// }
|
|
|
// totalStock+=stocks;
|
|
// totalStock+=stocks;
|
|
|
// }
|
|
// }
|
|
|
// }
|
|
// }
|
|
|
// }
|
|
// }
|
|
|
// productAttrValue.setStock(totalStock);
|
|
// productAttrValue.setStock(totalStock);
|
|
|
-// valueMapper.updateFsStoreProductAttrValue(productAttrValue);
|
|
|
|
|
-// fsStoreProductMapper.updateStock(productId);
|
|
|
|
|
|
|
+//// valueMapper.updateFsStoreProductAttrValue(productAttrValue);
|
|
|
|
|
+//// fsStoreProductMapper.updateStock(productId);
|
|
|
// }
|
|
// }
|
|
|
//
|
|
//
|
|
|
// }
|
|
// }
|
|
|
// }
|
|
// }
|
|
|
-// int stock=valueMapper.selectFsStoreProductStockById(productAttrValueId);
|
|
|
|
|
-// if (stock < 1) {
|
|
|
|
|
-// throw new CustomException("库存不足");
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+ int stock=valueMapper.selectFsStoreProductStockById(productAttrValueId);
|
|
|
|
|
+ if (stock < 1) {
|
|
|
|
|
+ throw new CustomException("商城系统库存不足");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|