From 3fc84b5d4b36ce9ab5cea84ee1b54942c8e04ef9 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期四, 08 八月 2019 16:55:52 +0800 Subject: [PATCH] 拼多多短链修改 --- fanli/src/main/java/com/yeshi/fanli/job/order/jd/UpdateJDOrderJob.java | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/job/order/jd/UpdateJDOrderJob.java b/fanli/src/main/java/com/yeshi/fanli/job/order/jd/UpdateJDOrderJob.java index e4d2b68..f766be4 100644 --- a/fanli/src/main/java/com/yeshi/fanli/job/order/jd/UpdateJDOrderJob.java +++ b/fanli/src/main/java/com/yeshi/fanli/job/order/jd/UpdateJDOrderJob.java @@ -15,7 +15,6 @@ import com.yeshi.fanli.service.inter.jd.JDOrderService; import com.yeshi.fanli.util.Constant; import com.yeshi.fanli.util.RedisManager; -import com.yeshi.fanli.util.StringUtil; import com.yeshi.fanli.util.cmq.JDOrderCMQManager; import com.yeshi.fanli.util.jd.JDApiUtil; @@ -35,7 +34,9 @@ * @param jdOrderList */ public void saveJDOrders(List<JDOrder> jdOrderList) { - for (JDOrder order : jdOrderList) + for (JDOrder order : jdOrderList) { + if (order.getValidCode() == 15)// 杩囨护鎺変唬浠樻鐘舵�� + continue; try { jdOrderService.addJDOrder(order); /** @@ -49,6 +50,7 @@ } catch (JDOrderException e) { e.printStackTrace(); } + } } /** @@ -58,8 +60,13 @@ public void updateSoonOrder() { if (!Constant.IS_TASK) return; + long now = System.currentTimeMillis(); - JDOrderResult result = JDApiUtil.getOrderList(1, 200, new Date(), JDApiUtil.ORDER_TYPE_CREATETIME); + JDOrderResult result = JDApiUtil.getOrderList(1, 200, new Date(now), JDApiUtil.ORDER_TYPE_CREATETIME); + if (result != null && result.getOrderList() != null) + saveJDOrders(result.getOrderList()); + // 鏌ヨ涓婁釜灏忔椂鐨� + result = JDApiUtil.getOrderList(1, 200, new Date(now - 1000 * 60 * 60 * 24L), JDApiUtil.ORDER_TYPE_CREATETIME); if (result != null && result.getOrderList() != null) saveJDOrders(result.getOrderList()); } -- Gitblit v1.8.0