Bläddra i källkod

商城库存校验自己的库存

xgb 2 veckor sedan
förälder
incheckning
4d3b8dd2a9

+ 11 - 11
fs-company/src/main/java/com/fs/company/controller/common/CommonController.java

@@ -197,17 +197,17 @@ public class CommonController
 //        return R.ok();
 //    }
 
-    @GetMapping("common/test")
-    public R test(String orderCode) throws Exception
-    {
-        ErpRefundOrderQueryRequest request = new ErpRefundOrderQueryRequest();
-        request.setOrderCode(orderCode);
-        ErpRefundOrderQueryResponse search = wdtTwoOrderService.search(request);
-
-
-        log.info("查询结果:{}",search);
-        return R.ok();
-    }
+//    @GetMapping("common/test")
+//    public R test(String orderCode) throws Exception
+//    {
+//        ErpRefundOrderQueryRequest request = new ErpRefundOrderQueryRequest();
+//        request.setOrderCode(orderCode);
+//        ErpRefundOrderQueryResponse search = wdtTwoOrderService.search(request);
+//
+//
+//        log.info("查询结果:{}",search);
+//        return R.ok();
+//    }
 
 
 

+ 1 - 1
fs-company/src/main/java/com/fs/hisStore/utils/CityTreeUtil.java

@@ -1,4 +1,4 @@
-package com.fs.store.utils;
+package com.fs.hisStore.utils;
 import com.fs.store.vo.CityVO;
 import org.springframework.util.CollectionUtils;
 

+ 17 - 17
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreCartScrmServiceImpl.java

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