|
@@ -101,7 +101,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ConfigUtil configUtil;
|
|
private ConfigUtil configUtil;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private com.fs.system.service.ISysConfigService configService;
|
|
private com.fs.system.service.ISysConfigService configService;
|
|
|
|
|
|
|
@@ -1036,22 +1036,6 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
|
|
|
public List<FsStoreProductListQueryVO> selectFsStoreProductListQuery(FsStoreProductQueryParam param) {
|
|
public List<FsStoreProductListQueryVO> selectFsStoreProductListQuery(FsStoreProductQueryParam param) {
|
|
|
boolean stores = medicalMallConfig.isStores();
|
|
boolean stores = medicalMallConfig.isStores();
|
|
|
param.setIsStores(stores?1:0);
|
|
param.setIsStores(stores?1:0);
|
|
|
- // 蒙一堂特殊产品展示
|
|
|
|
|
- List<Long> cateIds;
|
|
|
|
|
- if("1".equals(param.getProductFlag())){// 家庭应急
|
|
|
|
|
- // fs_store_product_category_scrm
|
|
|
|
|
- FsStoreProductCategoryScrm fsStoreProductCategoryScrm = new FsStoreProductCategoryScrm();
|
|
|
|
|
- fsStoreProductCategoryScrm.setPid(0L);
|
|
|
|
|
- fsStoreProductCategoryScrm.setCateName("家庭应急");
|
|
|
|
|
- cateIds =fsStoreProductCategoryScrmMapper.selectCateIdsByName(fsStoreProductCategoryScrm);
|
|
|
|
|
- if(cateIds!= null && !cateIds.isEmpty()){
|
|
|
|
|
- param.setCateIds(cateIds);
|
|
|
|
|
- }else {
|
|
|
|
|
- // 不让查询出来
|
|
|
|
|
- return new ArrayList<>();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
return fsStoreProductMapper.selectFsStoreProductListQuery(param);
|
|
return fsStoreProductMapper.selectFsStoreProductListQuery(param);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1071,7 +1055,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
|
|
|
String productName = product != null ? product.getProductName() : "商品";
|
|
String productName = product != null ? product.getProductName() : "商品";
|
|
|
throw new CustomException(productName + "库存不足,当前库存:" + (productStock != null ? productStock : 0) + ",需要数量:" + cartNum);
|
|
throw new CustomException(productName + "库存不足,当前库存:" + (productStock != null ? productStock : 0) + ",需要数量:" + cartNum);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 如果有规格,检查规格库存
|
|
// 如果有规格,检查规格库存
|
|
|
if (productAttrValueId != null) {
|
|
if (productAttrValueId != null) {
|
|
|
Integer attrStock = fsStoreProductAttrValueMapper.selectProductAttrStockForUpdate(productAttrValueId);
|
|
Integer attrStock = fsStoreProductAttrValueMapper.selectProductAttrStockForUpdate(productAttrValueId);
|
|
@@ -1082,7 +1066,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public void decProductStock(Long productId, Long productAttrValueId, Integer cartNum) {
|
|
public void decProductStock(Long productId, Long productAttrValueId, Integer cartNum) {
|
|
|
// 检查配置是否开启库存检查
|
|
// 检查配置是否开启库存检查
|
|
@@ -1098,7 +1082,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("检查库存配置失败", e);
|
|
log.error("检查库存配置失败", e);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//处理属性sku
|
|
//处理属性sku
|
|
|
fsStoreProductAttrValueMapper.decProductAttrStock(productAttrValueId,cartNum);
|
|
fsStoreProductAttrValueMapper.decProductAttrStock(productAttrValueId,cartNum);
|
|
|
fsStoreProductMapper.decProductAttrStock(productId,cartNum);
|
|
fsStoreProductMapper.decProductAttrStock(productId,cartNum);
|