| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoUnionConfigService taoBaoUnionConfigService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserTaoLiJinGiveRecordService userTaoLiJinGiveRecordService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserTaoLiJinOriginService userTaoLiJinOriginService;
|
| | | |
| | |
|
| | | /**
|
| | | * 更新报告
|
| | |
| | | String day = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd");
|
| | | List<TaoBaoUnionConfig> configList = taoBaoUnionConfigService
|
| | | .getConfigByTypeCache(TaoBaoUnionConfig.TYPE_TLJ_BUY);
|
| | | int totalCount = 0;
|
| | | for (TaoBaoUnionConfig app : configList) {
|
| | | List<TLJBuyGoods> list = tljBuyGoodsService.listByDay(app.getAppKey(), day, 15);// 获取最多15个商品
|
| | | int count = 0;
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | if (count >= 10)
|
| | | break;
|
| | | boolean success = shareHotGoodsService.verifyCanCreateTLJ(list.get(i).getGoods().getAuctionId(),
|
| | | boolean success = tljBuyGoodsService.verifyCanCreateTLJ(list.get(i).getGoods().getAuctionId(),
|
| | | new TaoKeAppInfo(app.getAppKey(), app.getAppSecret(), app.getDefaultPid()));
|
| | | if (success) {
|
| | | count++;
|
| | | }
|
| | | }
|
| | | totalCount += count;
|
| | | }
|
| | | LogHelper.test("自购立减商品验证通过的数量:" + totalCount);
|
| | | }
|
| | |
|
| | | private void addTLJBuyGoods(List<TaoBaoGoodsBrief> list, String day) {
|
| | |
| | | public void autoAddTLJBuyGoods2() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | LogHelper.test("自购立减开始选品");
|
| | | String day = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd");
|
| | | List<TaoBaoGoodsBrief> list = tljBuyGoodsService.listPreGoods(1);
|
| | | // 重试3次
|
| | | List<TaoBaoGoodsBrief> list = null;
|
| | | try {
|
| | | list = tljBuyGoodsService.listPreGoods(1);
|
| | | } catch (Exception e) {
|
| | | }
|
| | | if (list == null || list.size() == 0)
|
| | | try {
|
| | | list = tljBuyGoodsService.listPreGoods(1);
|
| | | } catch (Exception e) {
|
| | | }
|
| | | if (list == null || list.size() == 0)
|
| | | try {
|
| | | list = tljBuyGoodsService.listPreGoods(1);
|
| | | } catch (Exception e) {
|
| | | }
|
| | |
|
| | | LogHelper.test("自购立减备选商品数量:" + list.size());
|
| | | Collections.shuffle(list);
|
| | | List<TaoBaoUnionConfig> configList = taoBaoUnionConfigService
|
| | | .getConfigByTypeCache(TaoBaoUnionConfig.TYPE_TLJ_BUY);
|
| | |
| | | addTLJBuyGoods(list, day);
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 每2个小时 赠送退回已过期淘礼金
|
| | | * 每2个小时 赠送退回已过期淘礼金
|
| | | */
|
| | | @Scheduled(cron = "0 0 0/2 * * ? ")
|
| | | public void giveSendBack() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | |
| | |
|
| | | for (int i = 0; i < 100; i++) {
|
| | | List<UserTaoLiJinGiveRecord> overdueList = userTaoLiJinGiveRecordService.overdueList(500);
|
| | | if (overdueList == null || overdueList.size() == 0) {
|
| | | break;
|
| | | }
|
| | | |
| | | for (UserTaoLiJinGiveRecord record: overdueList) {
|
| | |
|
| | | for (UserTaoLiJinGiveRecord record : overdueList) {
|
| | | try {
|
| | | userTaoLiJinOriginService.giveSendBack(record.getGiveUid(), record);
|
| | | // 更新记录
|