思迅同步库存问题修改,新增取消订单和商家同意退货时触发库存回退到思迅
This commit is contained in:
parent
c6736d120d
commit
99af352328
@ -58,6 +58,7 @@ import com.suisung.mall.shop.sfexpress.service.SFExpressApiService;
|
||||
import com.suisung.mall.shop.store.service.ShopStoreBaseService;
|
||||
import com.suisung.mall.shop.store.service.ShopStoreConfigService;
|
||||
import com.suisung.mall.shop.store.service.ShopStoreShippingAddressService;
|
||||
import com.suisung.mall.shop.sync.service.SyncThirdDataService;
|
||||
import io.seata.spring.annotation.GlobalTransactional;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
@ -203,6 +204,9 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
|
||||
@Autowired
|
||||
private MessageService messageService;
|
||||
|
||||
@Autowired
|
||||
private SyncThirdDataService syncThirdDataService;
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> statisticState() {
|
||||
UserDto user = getCurrentUser();
|
||||
@ -1506,6 +1510,13 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
|
||||
throw new ApiException(I18nUtil._("增加库存失败!"));
|
||||
}
|
||||
logger.debug("成功增加商品库存,商品项ID: {}, 增加数量: {}", itemId, returnNum);
|
||||
|
||||
//todo 退货新增返还思迅库存
|
||||
Map<String, Integer> stockDeltaMap = new HashMap<>();
|
||||
String item_src_id= productItem.getItem_src_id();
|
||||
stockDeltaMap.put(item_src_id + "-" + shopOrderItem.getOrder_id(), returnNum);
|
||||
syncThirdDataService.incrProductStockToRedis(stockDeltaMap);
|
||||
logger.info("退货返回给思迅,存入redis成功,item_src_id:{},订单号:{},数量:{}",item_src_id,shopOrderReturn.getOrder_id(),returnNum);
|
||||
} else {
|
||||
logger.warn("退货数量为空,无法增加库存,订单项ID: {}", orderItemId);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user