From 3a6e476b2f498e876ff10f1328455f58e63ee85a Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期四, 04 四月 2019 09:30:53 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- fanli/src/main/java/com/yeshi/fanli/job/UpdateOrderJob.java | 37 +++++++++++-------------------------- 1 files changed, 11 insertions(+), 26 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/job/UpdateOrderJob.java b/fanli/src/main/java/com/yeshi/fanli/job/UpdateOrderJob.java index cfe149d..5fc179b 100644 --- a/fanli/src/main/java/com/yeshi/fanli/job/UpdateOrderJob.java +++ b/fanli/src/main/java/com/yeshi/fanli/job/UpdateOrderJob.java @@ -16,16 +16,11 @@ import com.yeshi.fanli.entity.taobao.TaoBaoOrder; import com.yeshi.fanli.entity.taobao.TaoBaoUnionConfig; import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder; -import com.yeshi.fanli.exception.TaoBaoOrderException; import com.yeshi.fanli.log.LogHelper; import com.yeshi.fanli.service.inter.common.DataMonitorService; -import com.yeshi.fanli.service.inter.hongbao.HongBaoService; -import com.yeshi.fanli.service.inter.hongbao.ThreeSaleGiftService; import com.yeshi.fanli.service.inter.order.LostOrderService; -import com.yeshi.fanli.service.inter.order.OrderItemServcie; import com.yeshi.fanli.service.inter.order.OrderProcessService; import com.yeshi.fanli.service.inter.order.OrderService; -import com.yeshi.fanli.service.inter.order.PidOrderService; import com.yeshi.fanli.service.inter.taobao.TaoBaoOrderService; import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService; import com.yeshi.fanli.service.inter.taobao.TaoBaoWeiQuanOrderService; @@ -33,6 +28,7 @@ import com.yeshi.fanli.util.Constant; import com.yeshi.fanli.util.RedisManager; import com.yeshi.fanli.util.StringUtil; +import com.yeshi.fanli.util.TaoBaoConstant; import com.yeshi.fanli.util.TimeUtil; import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil; import com.yeshi.fanli.util.taobao.TaoKeOrderApiUtil; @@ -44,18 +40,6 @@ public UpdateOrderJob() { System.out.println("鍒濆鍖�:UpdateOrderJob"); } - - @Resource - private OrderItemServcie orderItemServcie; - - @Resource - private ThreeSaleGiftService threeSaleGiftService; - - @Resource - private HongBaoService hongBaoService; - - @Resource - private PidOrderService pidOrderService; @Resource private OrderProcessService orderProcessService; @@ -95,11 +79,11 @@ int page = 1; String startTimeStr = TimeUtil.getGernalTime(startTime, "yyyy-MM-dd HH:mm:ss"); List<TaoBaoOrder> orderList = TaoKeOrderApiUtil.getTaoBaoAllOrder(startTimeStr, span, page, - Constant.TAOBAO_AUTH_APPKEY, Constant.TAOBAO_AUTH_APPSECRET); + TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET); while (orderList.size() == 100 * page) { page++; List<TaoBaoOrder> tempOrderList = TaoKeOrderApiUtil.getTaoBaoAllOrder(startTimeStr, span, page, - Constant.TAOBAO_AUTH_APPKEY, Constant.TAOBAO_AUTH_APPSECRET); + TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET); if (tempOrderList != null && tempOrderList.size() > 0) orderList.addAll(tempOrderList); } @@ -117,11 +101,11 @@ int page = 1; String startTimeStr = TimeUtil.getGernalTime(startTime, "yyyy-MM-dd HH:mm:ss"); List<TaoBaoOrder> orderList = TaoKeOrderApiUtil.getTaoBaoThirdAllOrder(startTimeStr, span, page, - Constant.TAOBAO_AUTH_APPKEY, Constant.TAOBAO_AUTH_APPSECRET); + TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET); while (orderList.size() == 100 * page) { page++; List<TaoBaoOrder> tempOrderList = TaoKeOrderApiUtil.getTaoBaoThirdAllOrder(startTimeStr, span, page, - Constant.TAOBAO_AUTH_APPKEY, Constant.TAOBAO_AUTH_APPSECRET); + TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET); if (tempOrderList != null && tempOrderList.size() > 0) orderList.addAll(tempOrderList); } @@ -352,11 +336,11 @@ } // 姣�15鍒嗛挓鐖彇涓�娆� - // @Scheduled(cron = "0 0/15 * * * ? ") + @Scheduled(cron = "0 0/15 * * * ? ") public void doJob1() { - // if (!Constant.IS_TASK) - // return; - long currentTime = System.currentTimeMillis(); + if (!Constant.IS_TASK) + return; + long currentTime = System.currentTimeMillis() - 1000 * 60; String h = TimeUtil.getGernalTime(currentTime, "HH"); String m = TimeUtil.getGernalTime(currentTime, "mm"); int mm = Integer.parseInt(h) * 60 + Integer.parseInt(m); @@ -375,7 +359,8 @@ public void doJob6() { if (!Constant.IS_TASK) return; - long endTime = System.currentTimeMillis(); + long endTime = System.currentTimeMillis() - 1000 * 60; + ; updateOrder(endTime - 1000 * 60 * 20L, endTime); } -- Gitblit v1.8.0