|
@@ -23,6 +23,7 @@ import com.fs.store.param.FsStoreCartNumParam;
|
|
|
import com.fs.store.param.FsStoreCartParam;
|
|
|
import com.fs.store.vo.FsStoreCartVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.fs.store.domain.FsStoreCart;
|
|
|
import com.fs.store.service.IFsStoreCartService;
|
|
@@ -45,7 +46,10 @@ public class FsStoreCartServiceImpl implements IFsStoreCartService
|
|
|
@Autowired
|
|
|
private FsStoreProductGroupMapper productGroupMapper;
|
|
|
@Autowired
|
|
|
- IErpGoodsService goodsService;
|
|
|
+ private IErpGoodsService goodsService;
|
|
|
+
|
|
|
+ @Value("${fsConfig.limitPurchaseNum}")
|
|
|
+ private Long limitPurchaseNum;
|
|
|
/**
|
|
|
* 查询购物车
|
|
|
*
|
|
@@ -139,8 +143,8 @@ public class FsStoreCartServiceImpl implements IFsStoreCartService
|
|
|
FsStoreProductAttrValue productAttrValue = valueMapper.selectFsStoreProductAttrValueById(storeCart.getProductAttrValueId());
|
|
|
|
|
|
if (StringUtils.isEmpty(productAttrValue.getGroupBarCode())) {
|
|
|
- if (cartParam.getCartNum() > 10) {
|
|
|
- return R.error("限购10个");
|
|
|
+ if (cartParam.getCartNum() > limitPurchaseNum) {
|
|
|
+ return R.error(String.format("限购%d个",limitPurchaseNum));
|
|
|
}
|
|
|
} else {
|
|
|
FsStoreProductGroup group=productGroupMapper.selectFsStoreProductGroupByBarCode(productAttrValue.getGroupBarCode());
|
|
@@ -151,8 +155,8 @@ public class FsStoreCartServiceImpl implements IFsStoreCartService
|
|
|
for (StoreProductGroupDTO productGroupDTO : productGroupDTOS) {
|
|
|
num += productGroupDTO.getCount() * cartParam.getCartNum();
|
|
|
}
|
|
|
- if (num > 10) {
|
|
|
- return R.error("限购10个");
|
|
|
+ if (num > limitPurchaseNum) {
|
|
|
+ return R.error(String.format("限购%d个",limitPurchaseNum));
|
|
|
}
|
|
|
} else {
|
|
|
return R.error("组合码错误");
|