思迅同步,改为出库时才扣减库存
This commit is contained in:
parent
99af352328
commit
76b378d205
@ -3302,9 +3302,9 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
|
||||
logger.debug("成功执行订单商品item_src_id:{} 锁定库存:{}", item_src_id, order_item_inventory_lock);
|
||||
|
||||
// RMK 第三方数据同步相关:redis 给这个商品减去对应的库存
|
||||
Map<String, Integer> stockDeltaMap = new HashMap<>();
|
||||
stockDeltaMap.put(item_src_id + "-" + order_item_row.getOrder_id(), -order_item_quantity);
|
||||
syncThirdDataService.incrProductStockToRedis(stockDeltaMap);
|
||||
// Map<String, Integer> stockDeltaMap = new HashMap<>();
|
||||
// stockDeltaMap.put(item_src_id + "-" + order_item_row.getOrder_id(), -order_item_quantity);
|
||||
// syncThirdDataService.incrProductStockToRedis(stockDeltaMap);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4225,9 +4225,9 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
|
||||
}
|
||||
log.debug("释放库存Item_src_id:{},数量:{}", shopProductItem.getItem_src_id(), order_item_quantity);
|
||||
// RMK 第三方数据同步相关:redis 给这个商品加上对应的库存
|
||||
Map<String, Integer> stockDeltaMap = new HashMap<>();
|
||||
stockDeltaMap.put(shopProductItem.getItem_src_id() + "-" + order_item_row.getOrder_id(), order_item_quantity);
|
||||
syncThirdDataService.incrProductStockToRedis(stockDeltaMap);
|
||||
// Map<String, Integer> stockDeltaMap = new HashMap<>();
|
||||
// stockDeltaMap.put(shopProductItem.getItem_src_id() + "-" + order_item_row.getOrder_id(), order_item_quantity);
|
||||
// syncThirdDataService.incrProductStockToRedis(stockDeltaMap);
|
||||
}
|
||||
}
|
||||
|
||||
@ -7252,10 +7252,10 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
|
||||
}
|
||||
|
||||
// RMK 第三方数据同步相关:redis 给这个商品减去上对应的库存
|
||||
log.debug("减库存Item_src_id:{},数量:{}", item_src_id, cart_quantity);
|
||||
Map<String, Integer> stockDeltaMap = new HashMap<>();
|
||||
stockDeltaMap.put(item_src_id + "-" + order_id, -cart_quantity);
|
||||
syncThirdDataService.incrProductStockToRedis(stockDeltaMap);
|
||||
// log.debug("减库存Item_src_id:{},数量:{}", item_src_id, cart_quantity);
|
||||
// Map<String, Integer> stockDeltaMap = new HashMap<>();
|
||||
// stockDeltaMap.put(item_src_id + "-" + order_id, -cart_quantity);
|
||||
// syncThirdDataService.incrProductStockToRedis(stockDeltaMap);
|
||||
|
||||
}
|
||||
// end
|
||||
|
||||
@ -1511,7 +1511,7 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
|
||||
}
|
||||
logger.debug("成功增加商品库存,商品项ID: {}, 增加数量: {}", itemId, returnNum);
|
||||
|
||||
//todo 退货新增返还思迅库存
|
||||
// RMK 第三方数据同步相关:redis 新增返还思迅库存
|
||||
Map<String, Integer> stockDeltaMap = new HashMap<>();
|
||||
String item_src_id= productItem.getItem_src_id();
|
||||
stockDeltaMap.put(item_src_id + "-" + shopOrderItem.getOrder_id(), returnNum);
|
||||
|
||||
@ -15,10 +15,12 @@ import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.suisung.mall.common.api.StateCode;
|
||||
import com.suisung.mall.common.constant.CommonConstant;
|
||||
import com.suisung.mall.common.constant.SFExpressConstant;
|
||||
import com.suisung.mall.common.exception.ApiException;
|
||||
import com.suisung.mall.common.modules.order.ShopOrderItem;
|
||||
import com.suisung.mall.common.modules.store.ShopMchEntry;
|
||||
import com.suisung.mall.common.modules.store.ShopStoreSameCityTransportBase;
|
||||
import com.suisung.mall.common.modules.store.ShopStoreSfOrder;
|
||||
@ -31,11 +33,13 @@ import com.suisung.mall.common.utils.JsonUtil;
|
||||
import com.suisung.mall.shop.message.service.PushMessageService;
|
||||
import com.suisung.mall.shop.order.service.ShopOrderBaseService;
|
||||
import com.suisung.mall.shop.order.service.ShopOrderInfoService;
|
||||
import com.suisung.mall.shop.order.service.ShopOrderItemService;
|
||||
import com.suisung.mall.shop.order.service.ShopOrderReturnService;
|
||||
import com.suisung.mall.shop.sfexpress.service.SFExpressApiService;
|
||||
import com.suisung.mall.shop.store.service.ShopMchEntryService;
|
||||
import com.suisung.mall.shop.store.service.ShopStoreSameCityTransportBaseService;
|
||||
import com.suisung.mall.shop.store.service.ShopStoreSfOrderService;
|
||||
import com.suisung.mall.shop.sync.service.SyncThirdDataService;
|
||||
import com.suisung.mall.shop.wechat.service.WxOrderShippingService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
@ -100,6 +104,12 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
||||
@Autowired
|
||||
private PushMessageService pushMessageService;
|
||||
|
||||
@Autowired
|
||||
private SyncThirdDataService syncThirdDataService;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ShopOrderItemService shopOrderItemService;
|
||||
|
||||
/**
|
||||
* 创建顺丰同店铺-连锁店铺
|
||||
@ -996,9 +1006,24 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
||||
orderIsOutStatus = StateCode.ORDER_PICKING_STATE_YES; // 已出库
|
||||
orderIsShippedStatus = 0;
|
||||
pushRemark = "配送员已到店。";
|
||||
|
||||
// 上传发货信息到微信
|
||||
wxOrderShippingService.uploadShippingInfoToWx(2, shopOrderId);
|
||||
//出库扣减思迅库存star
|
||||
// RMK 第三方数据同步相关:redis 给这个商品减去对应的库存
|
||||
QueryWrapper<ShopOrderItem> itemQueryWrapper = new QueryWrapper<>();
|
||||
String order_id=shopStoreSfOrder.getShop_order_id();
|
||||
itemQueryWrapper.eq("order_id", order_id);
|
||||
List<ShopOrderItem> order_item_rows = shopOrderItemService.find(itemQueryWrapper);
|
||||
if(!order_item_rows.isEmpty()){
|
||||
for (ShopOrderItem shopOrderItem : order_item_rows) {
|
||||
Map<String, Integer> stockDeltaMap = new HashMap<>();
|
||||
String item_src_id= shopOrderItem.getItem_src_id();
|
||||
Integer order_item_quantity=shopOrderItem.getOrder_item_quantity();
|
||||
stockDeltaMap.put(item_src_id + "-" + shopStoreSfOrder.getShop_order_id(), -order_item_quantity);
|
||||
syncThirdDataService.incrProductStockToRedis(stockDeltaMap);
|
||||
}
|
||||
}
|
||||
//出库扣减思迅库存end
|
||||
} else if (shopStoreSfOrder.getOrder_status().equals(StateCode.SF_ORDER_STATUS_RECEIVED)) {
|
||||
// 顺丰同城状态:15-配送员配送中(已取货)
|
||||
// 商城订单状态:从 2030-待发货 到 2040-已发货/待收货确认
|
||||
|
||||
Loading…
Reference in New Issue
Block a user