| | |
| | | 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.PidOrderService;
|
| | |
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoWeiQuanOrderService;
|
| | | import com.yeshi.fanli.util.CMQManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBao110Util;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private DataMonitorService dataMonitorService;
|
| | |
|
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | |
|
| | | @Resource
|
| | | private LostOrderService lostOrderService;
|
| | |
|
| | | private void updateOrder(long startTime, long endTime) {
|
| | | List<TaoBaoUnionConfig> configList = taoBaoUnionConfigService.getConfigByTypeCache(PidUser.TYPE_FANLI_ANDROID);
|
| | |
| | | while (its.hasNext()) {
|
| | | String key = its.next();
|
| | | List<TaoBaoOrder> orders = map.get(key);
|
| | | String redisKey = "addorderqueue-" + key;
|
| | | // redis做频率限制
|
| | | try {
|
| | | if (!StringUtil.isNullOrEmpty(redisManager.getCommonString(redisKey))) {
|
| | | continue;
|
| | | }
|
| | |
|
| | | } catch (Exception e) {
|
| | |
|
| | | }
|
| | |
|
| | | CMQManager.getInstance().addTaoBaoOrderMsg(key, orders);
|
| | |
|
| | | try {
|
| | | // 6小时内不再处理
|
| | | redisManager.cacheCommonString(redisKey, "1", 60 * 60 * 6);
|
| | | } catch (Exception e) {
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | |
| | | }
|
| | |
|
| | | // 淘宝推广订单 每隔3分13秒执行一次
|
| | | @Scheduled(cron = "13 0/3 0 24,25 * ? ")
|
| | | @Scheduled(cron = "13 0/3 * * * ? ")
|
| | | public void doJob6() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | |
| | | public void doJob2() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | doJob4();
|
| | | doTaoBaoWeiQuan();
|
| | |
|
| | | orderProcessService.fanli();
|
| | | }
|
| | |
| | | // 维权订单处理-处理最近60天的
|
| | | // 30分钟一次
|
| | | @Scheduled(cron = "0 0/30 * * * ? ")
|
| | | public void doJob4() {
|
| | | public void doTaoBaoWeiQuan() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | List<TaoBaoUnionConfig> configList = taoBaoUnionConfigService.getConfigByTypeCache(PidUser.TYPE_FANLI_ANDROID);
|
| | |
| | | orderProcessService.weiQuanOrder(orderList);
|
| | | }
|
| | |
|
| | | // 处理分享商品所产生的订单
|
| | | @Scheduled(cron = "0 0/2 * * * ? ")
|
| | | public void doJob7() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | pidOrderService.doPidOrder();
|
| | | // 处理分享商品所产生的订单(后续版本废除)
|
| | | // @Scheduled(cron = "0 0/2 * * * ? ")
|
| | | // public void doPidOrder() {
|
| | | // if (!Constant.IS_TASK)
|
| | | // return;
|
| | | // pidOrderService.doPidOrder();
|
| | | // }
|
| | |
|
| | | // 每6个小时执行一次
|
| | | @Scheduled(cron = "0 0 0/6 * * ? ")
|
| | | public void doLostOrder() {
|
| | | lostOrderService.processFail();
|
| | | }
|
| | |
|
| | | }
|