|
|
@ -213,27 +213,16 @@ public class BsOrderGoodsServiceImpl implements BsOrderGoodsService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Object getLogisticsMsg(Long orderGoodsId) { |
|
|
|
public Object getLogisticsMsg(String logisticsNo) { |
|
|
|
Object data = redisUtil.get(CACHE_KEY + orderGoodsId); |
|
|
|
Object data = redisUtil.get(CACHE_KEY + logisticsNo); |
|
|
|
if (data == null) { |
|
|
|
if (data == null) { |
|
|
|
BsOrderGoods orderGoods = queryDetail(orderGoodsId); |
|
|
|
JSONObject jsonObjects = OrderUtil.getLogisticsMsg(logisticsNo); |
|
|
|
if (orderGoods == null || orderGoods.getLogisticsNo() == null) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂未发货!"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject jsonObjects = OrderUtil.getLogisticsMsg(orderGoods.getLogisticsNo()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (jsonObjects == null) { |
|
|
|
if (jsonObjects == null) { |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂未发货!"); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂未发货!"); |
|
|
|
} |
|
|
|
} |
|
|
|
redisUtil.set(CACHE_KEY + orderGoods.getLogisticsNo(), jsonObjects, CACHE_TIME); |
|
|
|
|
|
|
|
if (jsonObjects.getInteger("code") == 200 && jsonObjects.getBoolean("success")) { |
|
|
|
if (jsonObjects.getInteger("code") == 200 && jsonObjects.getBoolean("success")) { |
|
|
|
jsonObjects.getJSONObject("data").put("orderId" , orderGoodsId); |
|
|
|
|
|
|
|
GoodsLogistics logistics = editLogistics((JSONObject) jsonObjects.get("data")); |
|
|
|
GoodsLogistics logistics = editLogistics((JSONObject) jsonObjects.get("data")); |
|
|
|
orderGoods.setLogisticsStatus(logistics.getLogisticsStatus()); |
|
|
|
return cache(logisticsNo , logistics); |
|
|
|
orderGoods.setLogisticsStatusDesc(logistics.getLogisticsStatusDesc()); |
|
|
|
|
|
|
|
update(orderGoods); |
|
|
|
|
|
|
|
return cache(orderGoodsId , logistics); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return jsonObjects; |
|
|
|
return jsonObjects; |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -242,16 +231,16 @@ public class BsOrderGoodsServiceImpl implements BsOrderGoodsService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public GoodsLogistics cache(Long orderGoodsId , GoodsLogistics logistics) { |
|
|
|
public GoodsLogistics cache(String getLogisticsNo , GoodsLogistics logistics) { |
|
|
|
// 缓存
|
|
|
|
// 缓存
|
|
|
|
redisUtil.set(CACHE_KEY + orderGoodsId, logistics, CACHE_TIME); |
|
|
|
redisUtil.set(CACHE_KEY + getLogisticsNo, logistics, CACHE_TIME); |
|
|
|
return logistics; |
|
|
|
return logistics; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void cacheDelete(Long orderGoodsId) { |
|
|
|
public void cacheDelete(String getLogisticsNo) { |
|
|
|
// 缓存
|
|
|
|
// 缓存
|
|
|
|
redisUtil.del(CACHE_KEY + orderGoodsId); |
|
|
|
redisUtil.del(CACHE_KEY + getLogisticsNo); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|