| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.lable.QualityFactoryService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.taobao.DaTaoKeUtil;
|
| | |
|
| | |
| | | @Component
|
| | | public class UpdateDaTaoKeJob {
|
| | |
|
| | | |
| | | @Resource
|
| | | private QualityFactoryService qualityFactoryService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsService daTaoKeGoodsService;
|
| | |
|
| | | // 两小时执行一次 对商品信息进行更新
|
| | | @Scheduled(cron = "0 0 0/2 * * ?")
|
| | | public void doUpdateJob() {
|
| | | |
| | |
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | |
| | |
|
| | | List<TaoBaoGoodsBrief> listgoods = DaTaoKeUtil.getDingDongQiang();
|
| | | if (listgoods == null || listgoods.size() == 0) {
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | try {
|
| | | /* 操作人: 开发账号 */
|
| | | AdminUser admin = new AdminUser(2L);
|
| | |
| | | autoRule.setEndWeight(3000);
|
| | | autoRule.setGoodsSource(QualityFactory.SOURCE_TAOBAO_DATAOKE);
|
| | | qualityFactoryService.autoInsertOrUpadateStorage(listgoods, null, autoRule);
|
| | | |
| | |
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | |
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | @Scheduled(cron = "0 0/20 * * * ? ")
|
| | | public void doSyncJob() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | try {
|
| | | daTaoKeGoodsService.startSyncGoods();
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|