admin
2019-09-02 f3bf8ec5da40f49505b561abe53e8972dcce18ba
自购立减商品验证修改
4个文件已修改
38 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/GoodsController.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/TaoLiJinJob.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TLJBuyGoodsServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/GoodsController.java
@@ -86,11 +86,9 @@
    @Resource
    private TLJBuyGoodsService tljBuyGoodsService;
    @Resource
    private IntegralGetService integralGetService;
    private void doTaoLiJinBuy(AcceptData acceptData, Long uid, Long auctionId, PrintWriter out) {
        JSONObject data = new JSONObject();
@@ -99,6 +97,10 @@
            // 根据日期与商品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) {
@@ -121,7 +123,7 @@
        data.put("type", 1);
        data.put("link", link);
        out.print(JsonUtil.loadTrueResult(data));
        integralGetService.addTaoLiJinBuy(uid, auctionId);
    }
@@ -289,7 +291,7 @@
            // 获得金币
            integralGetService.addCouponRebate(uid);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
@@ -421,7 +423,7 @@
        history.setGoodsId(goodsId);
        recommendGoodsDeleteHistoryService.addRecommendGoodsDeleteHistory(history);
        out.print(JsonUtil.loadTrueResult(""));
        // 获得金币
        integralGetService.addCloseRecommendGoods(uid);
    }
fanli/src/main/java/com/yeshi/fanli/job/TaoLiJinJob.java
@@ -48,13 +48,12 @@
    @Resource
    private TaoBaoUnionConfigService taoBaoUnionConfigService;
    @Resource
    private UserTaoLiJinGiveRecordService userTaoLiJinGiveRecordService;
    @Resource
    private UserTaoLiJinOriginService userTaoLiJinOriginService;
    /**
     * 更新报告
@@ -130,7 +129,7 @@
            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++;
@@ -179,22 +178,21 @@
        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);
                    // 更新记录
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TLJBuyGoodsServiceImpl.java
@@ -11,6 +11,7 @@
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;
@@ -270,6 +271,9 @@
    @Override
    public void removeGoods(Long auctionId) {
        tljBuyGoodsDao.deleteByAuctionId(auctionId);
        // 清除列表缓存
        ehCacheCacheManager.getCache("commonContentCache")
                .evict("tljBuy-listByDay" + TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd"));
    }
}
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java
@@ -1905,7 +1905,7 @@
    // 淘礼金创建
    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]);
@@ -1961,8 +1961,6 @@
            }
        } catch (TaoKeApiException e) {
            throw e;
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
        return null;