|
@@ -6,9 +6,6 @@ import com.fs.common.core.domain.R;
|
|
import com.fs.common.exception.CustomException;
|
|
import com.fs.common.exception.CustomException;
|
|
import com.fs.common.utils.DateUtils;
|
|
import com.fs.common.utils.DateUtils;
|
|
import com.fs.common.utils.StringUtils;
|
|
import com.fs.common.utils.StringUtils;
|
|
-import com.fs.erp.domain.ErpGoodsStock;
|
|
|
|
-import com.fs.erp.dto.ErpGoodsStockQueryRequert;
|
|
|
|
-import com.fs.erp.dto.ErpGoodsStockQueryResponse;
|
|
|
|
import com.fs.erp.service.IErpGoodsService;
|
|
import com.fs.erp.service.IErpGoodsService;
|
|
import com.fs.kingbos.domian.KbStockRequest;
|
|
import com.fs.kingbos.domian.KbStockRequest;
|
|
import com.fs.kingbos.domian.KbStockResponse;
|
|
import com.fs.kingbos.domian.KbStockResponse;
|
|
@@ -249,15 +246,11 @@ public class FsStoreCartServiceImpl implements IFsStoreCartService
|
|
if(productGroupDTOS!=null){
|
|
if(productGroupDTOS!=null){
|
|
for(StoreProductGroupDTO dto:productGroupDTOS){
|
|
for(StoreProductGroupDTO dto:productGroupDTOS){
|
|
FsStoreProductAttrValue attrValue=valueMapper.selectFsStoreProductAttrValueById(dto.getId());
|
|
FsStoreProductAttrValue attrValue=valueMapper.selectFsStoreProductAttrValueById(dto.getId());
|
|
- ErpGoodsStockQueryRequert request=new ErpGoodsStockQueryRequert();
|
|
|
|
- request.setBarcode(attrValue.getBarCode());
|
|
|
|
- ErpGoodsStockQueryResponse response=goodsService.getGoodsStock(request);
|
|
|
|
- if(response.getStocks()!=null){
|
|
|
|
- Integer stocks=0;
|
|
|
|
- for(ErpGoodsStock stock:response.getStocks()){
|
|
|
|
- Double goodsStock=Double.parseDouble(stock.getSalable_qty());
|
|
|
|
- stocks+=goodsStock.intValue();
|
|
|
|
- }
|
|
|
|
|
|
+ KbStockRequest request = KbStockRequest.builder().goodsCode(attrValue.getBarCode()).build();
|
|
|
|
+ KbStockResponse response = k9StockService.getStock(request);
|
|
|
|
+ if(response.getSuccess()){
|
|
|
|
+ Integer stocks = response.getStock();
|
|
|
|
+
|
|
if(stocks<=0){
|
|
if(stocks<=0){
|
|
attrValue.setStock(0);
|
|
attrValue.setStock(0);
|
|
valueMapper.updateFsStoreProductAttrValue(attrValue);
|
|
valueMapper.updateFsStoreProductAttrValue(attrValue);
|