| | |
| | | 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;
|
| | |
| | |
|
| | | @Resource
|
| | | private LostOrderService lostOrderService;
|
| | |
|
| | | |
| | | private void updateOrder(long startTime, long endTime) {
|
| | | List<TaoBaoUnionConfig> configList = taoBaoUnionConfigService.getConfigByTypeCache(PidUser.TYPE_FANLI_ANDROID);
|
| | | List<TaoBaoOrder> orderList = new ArrayList<>();
|
| | |
| | |
|
| | | }
|
| | |
|
| | | private void addRelationAndSpecialOrder(List<TaoBaoOrder> orderList) {
|
| | | try {
|
| | | taoBaoOrderService.addTaoBaoOrderList(orderList);
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | try {
|
| | | Map<String, List<TaoBaoOrder>> map = TaoBaoOrderUtil.classifyTaoBaoOrderByOrderId(orderList);
|
| | | if (map != null) {
|
| | | Iterator<String> its = map.keySet().iterator();
|
| | | 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) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void addOrder(List<TaoBaoOrder> orderList) {
|
| | |
|
| | | if (orderList != null)
|
| | | for (int i = 0; i < orderList.size(); i++) {
|
| | | // 移除会员运营ID与渠道专属订单
|
| | | if (orderList.get(i).getAdPositionName().contains("会员运营")
|
| | | || orderList.get(i).getAdPositionName().contains("渠道专属")) {
|
| | | orderList.remove(i);
|
| | | i--;
|
| | | }
|
| | | }
|
| | |
|
| | | try {
|
| | | taoBaoOrderService.addTaoBaoOrderList(orderList);
|
| | | } 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 * * ? ")
|