同步价改为订单价格
This commit is contained in:
parent
f7a6cecd31
commit
ddd20b825e
@ -1525,7 +1525,7 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
|
|||||||
// RMK 第三方数据同步相关:redis 新增返还思迅库存
|
// RMK 第三方数据同步相关:redis 新增返还思迅库存
|
||||||
Map<String, Integer> stockDeltaMap = new HashMap<>();
|
Map<String, Integer> stockDeltaMap = new HashMap<>();
|
||||||
String item_src_id = productItem.getItem_src_id();
|
String item_src_id = productItem.getItem_src_id();
|
||||||
stockDeltaMap.put(item_src_id + "-" + shopOrderItem.getOrder_id(), returnNum);
|
stockDeltaMap.put(item_src_id + "-" + shopOrderItem.getOrder_id()+"-"+shopOrderItem.getItem_unit_price(), returnNum);
|
||||||
syncThirdDataService.incrProductStockToRedis(stockDeltaMap);
|
syncThirdDataService.incrProductStockToRedis(stockDeltaMap);
|
||||||
logger.info("退货返回给思迅,存入redis成功,item_src_id:{},订单号:{},数量:{}", item_src_id, shopOrderReturn.getOrder_id(), returnNum);
|
logger.info("退货返回给思迅,存入redis成功,item_src_id:{},订单号:{},数量:{}", item_src_id, shopOrderReturn.getOrder_id(), returnNum);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -1178,7 +1178,7 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
|||||||
Map<String, Integer> stockDeltaMap = new HashMap<>();
|
Map<String, Integer> stockDeltaMap = new HashMap<>();
|
||||||
String item_src_id = shopOrderItem.getItem_src_id();
|
String item_src_id = shopOrderItem.getItem_src_id();
|
||||||
Integer order_item_quantity = shopOrderItem.getOrder_item_quantity();
|
Integer order_item_quantity = shopOrderItem.getOrder_item_quantity();
|
||||||
stockDeltaMap.put(item_src_id + "-" + shopStoreSfOrder.getShop_order_id(), -order_item_quantity);
|
stockDeltaMap.put(item_src_id + "-" + shopStoreSfOrder.getShop_order_id()+"-"+shopOrderItem.getItem_unit_price(), -order_item_quantity);
|
||||||
syncThirdDataService.incrProductStockToRedis(stockDeltaMap);
|
syncThirdDataService.incrProductStockToRedis(stockDeltaMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1347,7 +1347,7 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
|||||||
Map<String, Integer> stockDeltaMap = new HashMap<>();
|
Map<String, Integer> stockDeltaMap = new HashMap<>();
|
||||||
String item_src_id = shopOrderItem.getItem_src_id();
|
String item_src_id = shopOrderItem.getItem_src_id();
|
||||||
Integer order_item_quantity = shopOrderItem.getOrder_item_quantity();
|
Integer order_item_quantity = shopOrderItem.getOrder_item_quantity();
|
||||||
stockDeltaMap.put(item_src_id + "-" + shopOrderItem.getOrder_id(), -order_item_quantity);
|
stockDeltaMap.put(item_src_id + "-" + shopOrderItem.getOrder_id()+"-"+shopOrderItem.getItem_unit_price(), -order_item_quantity);
|
||||||
syncThirdDataService.incrProductStockToRedis(stockDeltaMap);
|
syncThirdDataService.incrProductStockToRedis(stockDeltaMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -938,12 +938,13 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
String[] productKeyArrys=productKey.split("-");
|
String[] productKeyArrys=productKey.split("-");
|
||||||
if(productKeyArrys.length!=2){
|
if(productKeyArrys.length!=3){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
String item_src_id=productKeyArrys[0];
|
String item_src_id=productKeyArrys[0];
|
||||||
String orderId=productKeyArrys[1];
|
String orderId=productKeyArrys[1];
|
||||||
|
String unitPrice=productKeyArrys[2];
|
||||||
QueryWrapper<ShopProductItem> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ShopProductItem> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("item_src_id", item_src_id);
|
queryWrapper.eq("item_src_id", item_src_id);
|
||||||
List<ShopProductItem> shopProductItems=shopProductItemService.list(queryWrapper);
|
List<ShopProductItem> shopProductItems=shopProductItemService.list(queryWrapper);
|
||||||
@ -973,7 +974,6 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
|
|||||||
cn.hutool.json.JSONArray array_item_spec= JSONUtil.parseArray(spuItem.getItem_spec());
|
cn.hutool.json.JSONArray array_item_spec= JSONUtil.parseArray(spuItem.getItem_spec());
|
||||||
logger.info("array_item_spec:{}",array_item_spec);
|
logger.info("array_item_spec:{}",array_item_spec);
|
||||||
logger.info("key:{},Product_number:{}",key,itemId);
|
logger.info("key:{},Product_number:{}",key,itemId);
|
||||||
String unitPrice= String.valueOf(spuItem.getItem_unit_price());
|
|
||||||
if(array_item_spec.isEmpty()){
|
if(array_item_spec.isEmpty()){
|
||||||
redisTemplate.opsForHash().increment(key, itemId+"-"+orderId+"-"+unitPrice, delta.doubleValue());
|
redisTemplate.opsForHash().increment(key, itemId+"-"+orderId+"-"+unitPrice, delta.doubleValue());
|
||||||
logger.info("存储无规格库存成功");
|
logger.info("存储无规格库存成功");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user