|
@@ -72,15 +72,16 @@ public class WlnOrderServiceImpl implements WlnOrderService {
|
|
|
}
|
|
|
|
|
|
for (DictCommonData dictCommonData : warehouseCodeList) {
|
|
|
- OrderContext context = new OrderContext(dictCommonData.getDictValue());
|
|
|
- setWlnOrderList(context);
|
|
|
+ String warehouseCode = dictCommonData.getDictValue();
|
|
|
+ List<JSONObject> wlnOrderList = getWlnOrderList(warehouseCode);
|
|
|
|
|
|
// 万里牛订单若为0,结束同步任务
|
|
|
- List<JSONObject> wlnOrderList = context.getWlnOrderList();
|
|
|
if (ObjectUtil.isEmpty(wlnOrderList)) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
+ OrderContext context = new OrderContext(warehouseCode, wlnOrderList);
|
|
|
+
|
|
|
Map<String, OrderInfo> existOrderMap = context.getExistOrderMap();
|
|
|
|
|
|
// 循环万里牛订单
|
|
@@ -538,9 +539,8 @@ public class WlnOrderServiceImpl implements WlnOrderService {
|
|
|
/**
|
|
|
* 查询万里牛订单列表
|
|
|
*/
|
|
|
- private void setWlnOrderList(OrderContext context) {
|
|
|
- String warehouseCode = context.getWarehouseCode();
|
|
|
- long endTime = context.getEndDate().getTime();
|
|
|
+ private List<JSONObject> getWlnOrderList(String warehouseCode) {
|
|
|
+ Long endTime = new Date().getTime();
|
|
|
long startTime;
|
|
|
|
|
|
OrderInfo orderInfo = orderService.getOne(q -> q
|
|
@@ -568,12 +568,11 @@ public class WlnOrderServiceImpl implements WlnOrderService {
|
|
|
list.addAll(itemList);
|
|
|
} catch (Exception e) {
|
|
|
log.error("订单同步失败", e);
|
|
|
- context.setWlnOrderList(Collections.emptyList());
|
|
|
throw new ServiceException("订单同步失败");
|
|
|
}
|
|
|
} while (size >= 200);
|
|
|
|
|
|
- context.setWlnOrderList(list);
|
|
|
+ return list;
|
|
|
}
|
|
|
|
|
|
}
|