| | |
| | |
|
| | | @Resource
|
| | | private TLJBuyGoodsService tljBuyGoodsService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private IntegralGetService integralGetService;
|
| | | |
| | | |
| | |
|
| | | private void doTaoLiJinBuy(AcceptData acceptData, Long uid, Long auctionId, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | |
| | | // 根据日期与商品ID查询
|
| | | TLJBuyGoods tljBuyGoods = tljBuyGoodsService.selectByAuctionIdAndDay(auctionId,
|
| | | TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd"));
|
| | | if (tljBuyGoods == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "商品不存在"));
|
| | | return;
|
| | | }
|
| | | String appKey = tljBuyGoods.getAppKey();
|
| | | TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppKeyCache(appKey);
|
| | | if (config == null) {
|
| | |
| | | data.put("type", 1);
|
| | | data.put("link", link);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | |
| | |
|
| | | integralGetService.addTaoLiJinBuy(uid, auctionId);
|
| | | }
|
| | |
|
| | |
| | |
|
| | | // 获得金币
|
| | | integralGetService.addCouponRebate(uid);
|
| | | |
| | |
|
| | | } catch (Exception e) {
|
| | |
|
| | | LogHelper.errorDetailInfo(e);
|
| | |
| | | history.setGoodsId(goodsId);
|
| | | recommendGoodsDeleteHistoryService.addRecommendGoodsDeleteHistory(history);
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | |
| | |
|
| | | // 获得金币
|
| | | integralGetService.addCloseRecommendGoods(uid);
|
| | | }
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoUnionConfigService taoBaoUnionConfigService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserTaoLiJinGiveRecordService userTaoLiJinGiveRecordService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserTaoLiJinOriginService userTaoLiJinOriginService;
|
| | | |
| | |
|
| | | /**
|
| | | * 更新报告
|
| | |
| | | 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++;
|
| | |
| | | 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);
|
| | | // 更新记录
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.cache.annotation.CacheEvict;
|
| | | import org.springframework.cache.annotation.Cacheable;
|
| | | import org.springframework.cache.ehcache.EhCacheCacheManager;
|
| | | import org.springframework.stereotype.Service;
|
| | |
| | | @Override
|
| | | public void removeGoods(Long auctionId) {
|
| | | tljBuyGoodsDao.deleteByAuctionId(auctionId);
|
| | | // 清除列表缓存
|
| | | ehCacheCacheManager.getCache("commonContentCache")
|
| | | .evict("tljBuy-listByDay" + TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd"));
|
| | | }
|
| | |
|
| | | } |
| | |
| | | // 淘礼金创建
|
| | | public static TaoLiJinDTO createTaoLiJin(Long auctionId, String name, BigDecimal perface, int totalNum,
|
| | | Date sendStartTime, Date sendEndTime, Date useStartTime, Date useEndTime, TaoKeAppInfo app)
|
| | | throws TaoKeApiException, TaoLiJinCreateException {
|
| | | throws TaoLiJinCreateException,TaoKeApiException {
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("method", "taobao.tbk.dg.vegas.tlj.create");
|
| | | map.put("adzone_id", app.getPid().split("_")[3]);
|
| | |
| | | }
|
| | | } catch (TaoKeApiException e) {
|
| | | throw e;
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | |
|
| | | return null;
|