| | |
| | | package com.yeshi.fanli.util;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Iterator;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
| | | import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.lable.BoutiqueAutoRuleService;
|
| | | import com.yeshi.fanli.service.inter.lable.LabelService;
|
| | | import com.yeshi.fanli.service.inter.lable.QualityFactoryService;
|
| | | import com.yeshi.fanli.service.inter.money.UserMoneyDebtService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderProcessService;
|
| | | import com.yeshi.fanli.service.inter.push.IOSPushService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.ExtractService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | |
| | | private OrderProcessService orderProcessService;
|
| | |
|
| | | @Resource
|
| | | private QualityFactoryService qualityFactoryService;
|
| | | private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
|
| | |
|
| | | @Resource
|
| | | private UserSystemCouponService userSystemCouponService;
|
| | |
| | | doWeiQuanOrder();// 处理维权订单
|
| | | doPushIOS();// 处理发送IOS消息
|
| | | doThreeSaleUserCouponJob();// 处理邀请队列
|
| | | doUpdateGoodsJob();
|
| | | doUserMoneyDebtJob();// 债务偿还
|
| | | } else if (!Constant.IS_TEST) {
|
| | | initScheduler();// 启动定时任务
|
| | | //
|
| | | initScheduler();// 启动商品更新定时任务
|
| | | doUpdateGoodsJob(); // 更新商品队列
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | |
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | boutiqueAutoRuleService.startScheduler();
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 更新精选库商品
|
| | | */
|
| | | public void doUpdateGoodsJob() {
|
| | |
|
| | | // 采用4个线程做更新
|
| | | for (int i = 0; i < 1; i++)
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | |
|
| | | while (true) {
|
| | | try {
|
| | |
|
| | | Map<String, Long> map = CMQManager.getInstance().consumeNeedUpdateTaoBaoGoodsIdMsg(16);
|
| | |
|
| | | if (map != null) {
|
| | |
|
| | | Iterator<String> its = map.keySet().iterator();
|
| | | while (its.hasNext()) {
|
| | |
|
| | | String key = its.next();
|
| | | try {
|
| | | Long goodsId = map.get(key);
|
| | | List<Long> list = new ArrayList<>();
|
| | | list.add(goodsId);
|
| | | qualityFactoryService.updateGoodsFactory(list);
|
| | | CMQManager.getInstance().deleteNeedUpdateTaoBaoGoodsIdMsg(key);
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | taoBaoGoodsUpdateService.updateByTaoKeGoodsDetail(Long.parseLong(key));
|
| | | CMQManager.getInstance().deleteNeedUpdateTaoBaoGoodsIdMsg(key);
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | LogHelper.error("更新商品出错:" + e.getMessage());
|
| | |
|
| | | }
|
| | | }
|
| | | }
|