From 51a4ff5d777028d52a19c314a99f796334cb7b51 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期六, 23 十一月 2019 18:30:01 +0800 Subject: [PATCH] 配置文件修改 --- fanli/src/main/java/com/yeshi/fanli/job/TaoLiJinJob.java | 105 ++++++++++++++++------------------------------------ 1 files changed, 33 insertions(+), 72 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/job/TaoLiJinJob.java b/fanli/src/main/java/com/yeshi/fanli/job/TaoLiJinJob.java index d28a392..cf3a74e 100644 --- a/fanli/src/main/java/com/yeshi/fanli/job/TaoLiJinJob.java +++ b/fanli/src/main/java/com/yeshi/fanli/job/TaoLiJinJob.java @@ -10,7 +10,6 @@ import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; -import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinGiveRecord; import com.yeshi.fanli.entity.taobao.ShareHotGoods; import com.yeshi.fanli.entity.taobao.TLJBuyGoods; import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief; @@ -48,47 +47,12 @@ @Resource private TaoBaoUnionConfigService taoBaoUnionConfigService; - + @Resource private UserTaoLiJinGiveRecordService userTaoLiJinGiveRecordService; - + @Resource private UserTaoLiJinOriginService userTaoLiJinOriginService; - - - /** - * 鏇存柊鎶ュ憡 - */ - @Scheduled(cron = "0 0 1,10 * * ?") - public void insetDynamicInfo() { - - if (!Constant.IS_TASK) { - return; - } - - try { - userTaoLiJinReportService.needUpdateReport(); - } catch (Exception e) { - LogHelper.errorDetailInfo(e); - } - } - - /** - * 閫�鍥炶秴杩�3澶╂棤棰嗗彇鐨勬窐绀奸噾 - */ - @Scheduled(cron = "0 0 1 * * ?") - public void refundNotWin() { - - if (!Constant.IS_TASK) { - return; - } - - try { - userTaoLiJinReportService.refundNotWin(); - } catch (Exception e) { - LogHelper.errorDetailInfo(e); - } - } /** * 姣忓ぉ鍑屾櫒杩�5鍒嗛挓楠岃瘉 @@ -124,19 +88,22 @@ 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) { @@ -149,8 +116,13 @@ } if (goods != null && goods.getCouponAmount() != null && goods.getCouponAmount().compareTo(new BigDecimal(0)) > 0) { + + // 娣樼ぜ閲戠殑閲戦浣嶄簬1-10鍧椾箣闂� 蹇呴』鏄ぉ鐚� if (TaoBaoUtil.getAfterUseCouplePrice(goods).multiply(goods.getTkRate()) - .compareTo(new BigDecimal("143")) >= 0) { + .compareTo(new BigDecimal("143")) >= 0 + && TaoBaoUtil.getAfterUseCouplePrice(goods).multiply(goods.getTkRate()) + .compareTo(new BigDecimal("1430")) <= 0 + && goods.getUserType() == 1) { goods = daTaoKeGoodsDetailService.filterTaoBaoGoods(goods); int totalHongBaoCount = 2000 + (int) (Math.random() * 8000); int leftHongBaoCount = 200 + (int) (Math.random() * 2000); @@ -166,10 +138,28 @@ */ @Scheduled(cron = "0 1 5 * * ? ") public void autoAddTLJBuyGoods2() { - if (!Constant.IS_TASK) - return; + // 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); @@ -179,33 +169,4 @@ addTLJBuyGoods(list, day); } - - /** - * 姣忓ぉ00:10 璧犻�侀��鍥炲凡杩囨湡娣樼ぜ閲� - */ - @Scheduled(cron = "0 10 0 * * ? ") - 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) { - try { - userTaoLiJinOriginService.giveSendBack(record.getGiveUid(), record); - // 鏇存柊璁板綍 - UserTaoLiJinGiveRecord updateRecord = new UserTaoLiJinGiveRecord(); - updateRecord.setId(record.getId()); - updateRecord.setState(UserTaoLiJinGiveRecord.STATE_OVERDUE); - userTaoLiJinGiveRecordService.updateByPrimaryKeySelective(updateRecord); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - } } -- Gitblit v1.8.0