admin
2021-07-24 e257a2834bf7b62af5c5c96f9b0b21fac92f2196
jumpdetail分system
52个文件已修改
4378 ■■■■ 已修改文件
fanli/pom.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/config/JumpDetailAdminController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/SpecialCardAdminController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/SwiperBannerAdminController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/lijin/GoodsControllerLijin.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/PushController.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserAccountController.java 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserCouponController.java 796 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserInfoController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserMsgController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsClassControllerV2.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/IntegralControllerV2.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java 85 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserMsgControllerV2.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserOrderControllerV2.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/UserMsgController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/common/JumpDetailV2Mapper.java 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/SystemEnum.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/common/JumpDetailV2.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/system/ConfigKeyEnum.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/DynamicInfoJob.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/order/vipshop/UpdateVipShopOrderJob.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/lijin/manager/GoodsLijinMnager.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/log/LogHelper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/common/JumpDetailV2ServiceImpl.java 159 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/DynamicInfoServiceImpl.java 1998 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/FloatADServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SwiperPictureServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/lable/TaoKeGoodsServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgConfigServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/push/PushServiceImpl.java 468 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinNewbiesServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/common/JumpDetailV2Service.java 102 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SpecialService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SwiperPictureService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/order/CommonOrderService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/manger/JobManager.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/Constant.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/vipshop/VipShopApiUtil.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-dev/constant.properties 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/kafka_log.properties 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/logback.xml 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/mapping/common/JumpDetailV2Mapper.xml 251 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/pom.xml
@@ -223,6 +223,12 @@
        <dependency>
            <groupId>com.ks</groupId>
            <artifactId>facade-push</artifactId>
            <version>0.0.1</version>
        </dependency>
        <dependency>
            <groupId>com.ks</groupId>
            <artifactId>lib-common</artifactId>
            <version>0.0.1</version>
        </dependency>
fanli/src/main/java/com/yeshi/fanli/controller/admin/config/JumpDetailAdminController.java
@@ -33,7 +33,7 @@
    @RequestMapping({ "getJumpOption" })
    public void getJumpOption(AdminAcceptData acceptData, String callback, PrintWriter out) {
        try {
            List<JumpDetailV2> listJump = JumpDetailV2Service.listJump();
            List<JumpDetailV2> listJump = JumpDetailV2Service.listJump(acceptData.getSystem());
            JSONObject data = new JSONObject();
            JumpDetailV2 jumpDetailV2 = new JumpDetailV2();
@@ -138,7 +138,7 @@
        try {
            List<JumpDetailV2> list = JumpDetailV2Service.listQuery((pageIndex - 1) * pageSize, 
                    pageSize, key);
                    pageSize, key,acceptData.getSystem());
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
@@ -146,7 +146,7 @@
            }
            
            long count = JumpDetailV2Service.countListQuery(key);
            long count = JumpDetailV2Service.countListQuery(key,acceptData.getSystem());
            
            int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
            PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/SpecialCardAdminController.java
@@ -210,9 +210,9 @@
            if (request instanceof MultipartHttpServletRequest) {
                MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
                specialService.saveObject(fileRequest.getFile("file"), fileRequest.getFile("file2"),
                        fileRequest.getFile("file3"), record, jumpType, extra);
                        fileRequest.getFile("file3"), record, jumpType, extra,acceptData.getSystem());
            } else {
                specialService.saveObject(null, null, null, record, jumpType, extra);
                specialService.saveObject(null, null, null, record, jumpType, extra,acceptData.getSystem());
            }
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/SwiperBannerAdminController.java
@@ -469,9 +469,9 @@
            // 1. 先判断httpRequest 是否含有文件类型
            if (request instanceof MultipartHttpServletRequest) {
                MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
                swiperPictureService.saveObject(fileRequest.getFile("file"), record, jumpType, extra);
                swiperPictureService.saveObject(fileRequest.getFile("file"), record, jumpType, extra,acceptData.getSystem());
            } else {
                swiperPictureService.saveObject(null, record, jumpType, extra);
                swiperPictureService.saveObject(null, record, jumpType, extra,acceptData.getSystem());
            }
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
fanli/src/main/java/com/yeshi/fanli/controller/client/lijin/GoodsControllerLijin.java
@@ -29,6 +29,7 @@
import com.yeshi.fanli.lijin.manager.GoodsLijinMnager;
import com.yeshi.fanli.lijin.manager.UserLijinMnager;
import com.yeshi.fanli.lijin.manager.UserLijinSendManager;
import com.yeshi.fanli.log.vo.UserGoodsScanLog;
import com.yeshi.fanli.service.inter.goods.CollectionGoodsV2Service;
import com.yeshi.fanli.service.inter.goods.ScanHistoryV2Service;
import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
@@ -54,6 +55,8 @@
import com.yeshi.fanli.lijin.vo.GoodsDetailVO;
import com.yeshi.goods.facade.entity.taobao.TaoBaoGoodsBrief;
import net.sf.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.yeshi.utils.JsonUtil;
@@ -69,6 +72,7 @@
@Controller
@RequestMapping("api/lijin/goods")
public class GoodsControllerLijin {
    Logger userGoodsScanLogger = LoggerFactory.getLogger("userGoodsScanLog");
    @Resource
    private TaoBaoGoodsCacheUtil taoBaoGoodsCacheUtil;
@@ -119,11 +123,12 @@
     * @param from
     * @return
     */
    @RequestMapping("getGoodsDetail")
    public void getGoodsDetail(AcceptData acceptData, int goodsType, String goodsId, Long uid, String from, PrintWriter out) {
        GoodsDetailVO goodsDetailVO = new GoodsDetailVO();
        GoodsDetailVO.GoodsExtraVO extraVO = new GoodsDetailVO.GoodsExtraVO();
        GoodsMoneyConfigParamsDTO paramsDTO =  orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
        GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
                acceptData.getVersion(), acceptData.getSystem());
        paramsDTO.setFanLiRate(goodsLijinMnager.getFanLiRate(uid));
@@ -149,7 +154,7 @@
                //加载资金信息
                com.yeshi.fanli.vo.goods.GoodsDetailVO goodsDetailVO1 = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO);
                goodsDetailVO1 = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goods, goodsDetailVO1);
                goodsDetailVO1 = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goods, goodsDetailVO1, true);
                goodsDetailVO.setGoods(GoodsDetailVOLijinFactory.convertTaoBao(goods, paramsDTO));
                //重置资金信息
@@ -266,6 +271,8 @@
                break;
        }
        userGoodsScanLogger.info("{}", new Gson().toJson(UserGoodsScanLog.UserGoodsScanLogFactory.create(goodsDetailVO.getGoods(), uid, acceptData.getUtdid(), acceptData.getDevice())));
        //是否收藏
        extraVO.setCollected(false);
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java
@@ -343,7 +343,7 @@
                        if (userInfo != null) {
                            JumpDetailV2 jumpDetail = jumpDetailV2Service.getByTypeCache("web",
                                    Constant.getPlatformCode(acceptData.getPlatform()),
                                    Integer.parseInt(acceptData.getVersion()));
                                    Integer.parseInt(acceptData.getVersion()),acceptData.getSystem());
                            JSONObject negativeParams = new JSONObject();
                            negativeParams.put("url", configService.getByVersion(ConfigKeyEnum.newerGonglue.getKey(),
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/PushController.java
@@ -7,7 +7,11 @@
import javax.annotation.Resource;
import com.ks.push.pojo.DO.BPushDeviceToken;
import com.ks.push.pojo.DO.PushPlatform;
import com.ks.push.service.BDeviceTokenService;
import org.apache.commons.beanutils.PropertyUtils;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.core.task.TaskExecutor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -109,7 +113,48 @@
    
    @Resource
    private GoodsEvaluateService goodsEvaluateService;
    @Reference(version = "1.0", check = false)
    private BDeviceTokenService bDeviceTokenService;
    /**
     * 店铺列表
     *
     * @param acceptData
     * @param out
     */
    @RequestMapping(value = "bindToken", method = RequestMethod.POST)
    public void bindToken(AcceptData acceptData, Long uid, String type, String token, PrintWriter out) {
        BPushDeviceToken deviceToken = new BPushDeviceToken();
        deviceToken.setAppCode(acceptData.getSystem().name());
        deviceToken.setDeviceId(StringUtil.isNullOrEmpty(acceptData.getUtdid()) ? acceptData.getDevice() : acceptData.getUtdid());
        deviceToken.setBuildModel(acceptData.getDeviceType());
        deviceToken.setBuildVersion(acceptData.getOsVersion());
        deviceToken.setToken(token);
        switch (type) {
            case "huawei":
                type = "hw";
                break;
            case "xiaomi":
                type = "xm";
                break;
            case "meizu":
                type = "mz";
                break;
        }
        deviceToken.setType(PushPlatform.valueOf(type));
        deviceToken.setUid(uid + "");
        deviceToken.setVersionCode(Integer.parseInt(acceptData.getVersion()));
        try {
            bDeviceTokenService.save(deviceToken);
            out.print(JsonUtil.loadTrueResult(""));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult("绑定出错:" + e.getMessage()));
            e.printStackTrace();
        }
    }
    @RequestMapping(value = "callback", method = RequestMethod.POST)
    public void callback(AcceptData acceptData, String pushId, PrintWriter out) {
@@ -286,7 +331,7 @@
                if (totalgoods == 1) {
                    params = JumpDetailParamsFactory.createGoodsParams(goods.getGoodsId(), goods.getGoodsType());
                    jumpDetail = jumpDetailV2Service.getByTypeCache("goodsdetail",Constant.getPlatformCode(acceptData.getPlatform()),
                            Integer.parseInt(acceptData.getVersion()));
                            Integer.parseInt(acceptData.getVersion()),acceptData.getSystem());
                } else {
                    String url = configService.getValue(ConfigKeyEnum.pushGoodsDetails.getKey(),acceptData.getSystem());
                    if (url == null) {
@@ -296,7 +341,7 @@
                    params = JumpDetailParamsFactory.createWEBParams(url);
                    jumpDetail = jumpDetailV2Service.getByTypeCache("web",Constant.getPlatformCode(acceptData.getPlatform()),
                            Integer.parseInt(acceptData.getVersion()));
                            Integer.parseInt(acceptData.getVersion()),acceptData.getSystem());
                }
                totalwords.add(new ClientTextStyleVO("本次推荐共", "#666666"));
@@ -328,7 +373,7 @@
                url = url + "?id=" + id;
                params = JumpDetailParamsFactory.createWEBParams(url);
                jumpDetail = jumpDetailV2Service.getByTypeCache("web",
                        Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion()));
                        Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion()),acceptData.getSystem());
            } else {
                continue;
            }
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java
@@ -1730,7 +1730,7 @@
                array = JSONArray.fromObject(cacheValue);
            }
        }
        JumpDetailV2 jumpDetail = jumpDetailV2Service.getByTypeCache("web");
        JumpDetailV2 jumpDetail = jumpDetailV2Service.getByTypeCache("web",acceptData.getSystem());
        if (array == null) {
            array = new JSONArray();
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserAccountController.java
@@ -2,6 +2,7 @@
import com.alipay.api.AlipayApiException;
import com.google.gson.Gson;
import com.ks.push.service.BDeviceTokenService;
import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.*;
@@ -31,6 +32,9 @@
import com.yeshi.fanli.util.wx.MyWXLoginUtil;
import com.yeshi.fanli.vo.user.QQUserInfoVO;
import net.sf.json.JSONObject;
import org.apache.dubbo.config.annotation.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@@ -54,6 +58,8 @@
@Controller
@RequestMapping("api/v1/user")
public class UserAccountController {
    private Logger logger = LoggerFactory.getLogger(UserAccountController.class);
    @Resource
    private UserInfoService userInfoService;
@@ -120,6 +126,10 @@
    @Resource
    private DeviceActiveService deviceActiveService;
    @Reference(version = "1.0", check = false)
    private BDeviceTokenService bDeviceTokenService;
    private BusinessSystem getSystem(AcceptData acceptData) {
        BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
@@ -1056,16 +1066,27 @@
            return;
        if ("android".equalsIgnoreCase(acceptData.getPlatform())) {
            DeviceActive deviceActive = deviceActiveService.getFirstActiveInfo(acceptData.getDevice());
            // 需要解绑HW推送的用户绑定
            deviceTokenHWService.unBindDeviceToken(acceptData.getDevice());
            if (deviceActive != null) {
                // 解绑OPPO推送的用户绑定
                deviceTokenOPPOService.unBindUid(uid, deviceActive.getId());
                // 解绑VIVO推送的用户绑定
                deviceTokenVIVOService.unBindUid(uid, deviceActive.getId());
                // 解绑XM推送的用户绑定
                deviceTokenXMService.unBindUid(deviceActive.getId());
            //新版推送解绑
            if (acceptData.getSystem().isNewPush()) {
                try {
                    bDeviceTokenService.unBindUid(acceptData.getSystem().name(), StringUtil.isNullOrEmpty(acceptData.getUtdid()) ? acceptData.getDevice() : acceptData.getUtdid());
                } catch (Exception e) {
                    logger.error("新版推送解绑出错:{}", uid, e);
                }
            } else {
                // 需要解绑HW推送的用户绑定
                deviceTokenHWService.unBindDeviceToken(acceptData.getDevice());
                if (deviceActive != null) {
                    // 解绑OPPO推送的用户绑定
                    deviceTokenOPPOService.unBindUid(uid, deviceActive.getId());
                    // 解绑VIVO推送的用户绑定
                    deviceTokenVIVOService.unBindUid(uid, deviceActive.getId());
                    // 解绑XM推送的用户绑定
                    deviceTokenXMService.unBindUid(deviceActive.getId());
                }
            }
        }
        out.print(JsonUtil.loadTrueResult(""));
    }
@@ -1093,7 +1114,7 @@
        if (!StringUtil.isNullOrEmpty(aliAccessToken)) {
            long now = System.currentTimeMillis();
            String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.oneKeyLoginCount,StringUtil.Md5(  StringUtil.isNullOrEmpty(acceptData.getUtdid()) ? acceptData.getDevice() : acceptData.getUtdid()));
            String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.oneKeyLoginCount, StringUtil.Md5(StringUtil.isNullOrEmpty(acceptData.getUtdid()) ? acceptData.getDevice() : acceptData.getUtdid()));
            redisManager.increase(key);
            int expire = (int) ((TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(now + 1000 * 60 * 60 * 24L, "yyyyMMdd"), "yyyyMMdd") - now) / 1000);
            redisManager.expire(key, expire);
@@ -1182,7 +1203,7 @@
        if (!StringUtil.isNullOrEmpty(aliAccessToken)) {
            long now = System.currentTimeMillis();
            String key =  RedisKeyEnum.getRedisKey(RedisKeyEnum.oneKeyLoginCount,StringUtil.Md5(  StringUtil.isNullOrEmpty(acceptData.getUtdid()) ? acceptData.getDevice() : acceptData.getUtdid()));
            String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.oneKeyLoginCount, StringUtil.Md5(StringUtil.isNullOrEmpty(acceptData.getUtdid()) ? acceptData.getDevice() : acceptData.getUtdid()));
            redisManager.increase(key);
            int expire = (int) ((TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(now + 1000 * 60 * 60 * 24L, "yyyyMMdd"), "yyyyMMdd") - now) / 1000);
            redisManager.expire(key, expire);
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserCouponController.java
@@ -8,6 +8,7 @@
import javax.annotation.Resource;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import org.springframework.core.task.TaskExecutor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -47,444 +48,441 @@
/**
 * 福利中心
 *
 * @author Administrator
 *
 * @author Administrator
 */
@Controller
@RequestMapping("api/v1/user/coupon")
public class UserCouponController {
    @Resource(name = "taskExecutor")
    private TaskExecutor executor;
    @Resource(name = "taskExecutor")
    private TaskExecutor executor;
    @Resource
    private ConfigService configService;
    @Resource
    private ConfigService configService;
    @Resource
    private SystemCouponService systemCouponService;
    @Resource
    private UserSystemCouponService UserSystemCouponService;
    @Resource
    private SystemCouponService systemCouponService;
    @Resource
    private SwiperPictureService swiperPictureService;
    @Resource
    private UserSystemCouponService UserSystemCouponService;
    @Resource
    private CommonOrderService commonOrderService;
    @Resource
    private SwiperPictureService swiperPictureService;
    @Resource
    private DeviceLotteryRecordService deviceLotteryRecordService;
    @Resource
    private CommonOrderService commonOrderService;
    @Resource
    private UserSystemCouponService userSystemCouponService;
    @Resource
    private DeviceLotteryRecordService deviceLotteryRecordService;
    @Resource
    private UserInfoExtraService userInfoExtraService;
    @Resource
    private UserSystemCouponService userSystemCouponService;
    @Resource
    private UserVIPInfoService userVIPInfoService;
    @Resource
    private UserInviteService userInviteService;
    @Resource
    private RedisManager redisManager;
    @Resource
    private JDGoodsCacheUtil jdGoodsCacheUtil;
    @Resource
    private PinDuoDuoCacheUtil pinDuoDuoCacheUtil;
    /**
     * 用户券列表查询
     *
     * @param acceptData
     * @param page
     * @param uid
     * @param out
     */
    @RequestMapping(value = "getCouponList", method = RequestMethod.POST)
    public void getCouponList(AcceptData acceptData, Integer page, Long uid, PrintWriter out) {
        if (uid == null) {
            out.print(JsonUtil.loadFalseResult("用户未登录"));
            return;
        }
    @Resource
    private UserInfoExtraService userInfoExtraService;
        try {
            if (page == null || page < 1) {
                page = 1;
            }
    @Resource
    private UserInfoService userInfoService;
            // 福利中心图片
            String topPicture = null;
            if (page == 1) {
                List<BannerVO> listswiper = swiperPictureService.getByBannerCardAndVersion("welfare_top",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()),acceptData.getSystem());
                if (listswiper != null && listswiper.size() > 0) {
                    topPicture = listswiper.get(0).getSrc();
                }
            }
            boolean changeJump = false;
            String version = acceptData.getVersion();
            int tversion = Integer.parseInt(version);
            String platform = acceptData.getPlatform();
            if ("android".equalsIgnoreCase(platform) && tversion > 34) {
                changeJump = true;
            } else if (tversion > 44){
                changeJump = true;
            }
            long count = UserSystemCouponService.countCouponOld(uid);
            List<UserSystemCouponVO> resultList = UserSystemCouponService
                    .getUserCouponVOList((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid, changeJump);
    @Resource
    private UserVIPInfoService userVIPInfoService;
             if (resultList == null) {
                resultList = new ArrayList<UserSystemCouponVO>();
            }
    @Resource
    private UserInviteService userInviteService;
            JSONObject data = new JSONObject();
            data.put("topPicture", topPicture);
            data.put("count", count);
            data.put("result_list", JsonUtil.getApiCommonGson().toJson(resultList));
            out.print(JsonUtil.loadTrueResult(data));
    @Resource
    private RedisManager redisManager;
            // 更新福利中心未读数量
            if (page == 1) {
                executor.execute(new Runnable() {
                    @Override
                    public void run() {
                        UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
                        // 未读券是否大于0
                        if (userInfoExtra != null && userInfoExtra.getCouponNews() > 0) {
                            UserInfoExtra extra = new UserInfoExtra();
                            extra.setId(userInfoExtra.getId());
                            extra.setCouponNews(0);
                            userInfoExtraService.updateByPrimaryKeySelective(extra);
                        }
                    }
                });
            }
    @Resource
    private JDGoodsCacheUtil jdGoodsCacheUtil;
        } catch (UserSystemCouponException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult(1, "查询失败"));
            e.printStackTrace();
        }
    }
    @Resource
    private PinDuoDuoCacheUtil pinDuoDuoCacheUtil;
    /**
     * 用户奖励券
     *
     * @param acceptData
     * @param page
     * @param uid
     * @param auctionId  商品id
     * @param out
     */
    @RequestMapping(value = "getGoodsCouponList", method = RequestMethod.POST)
    public void getGoodsCouponList(AcceptData acceptData, Long uid, Long auctionId, PrintWriter out) {
        if (uid == null) {
            out.print(JsonUtil.loadFalseResult("用户未登录"));
            return;
        }
        try {
            List<UserSystemCouponVO> resultList = UserSystemCouponService.getGoodsCouponList(uid, auctionId);
            if (resultList == null) {
                resultList = new ArrayList<UserSystemCouponVO>();
            }
    /**
     * 用户券列表查询
     *
     * @param acceptData
     * @param page
     * @param uid
     * @param out
     */
    @RequestMapping(value = "getCouponList", method = RequestMethod.POST)
    public void getCouponList(AcceptData acceptData, Integer page, Long uid, PrintWriter out) {
        if (uid == null) {
            out.print(JsonUtil.loadFalseResult("用户未登录"));
            return;
        }
            JSONObject dataTip = new JSONObject();
            dataTip.put("content", configService.getValue(ConfigKeyEnum.freeCouponTip.getKey(),acceptData.getSystem()));
            dataTip.put("fontColor", "#F14242");
        try {
            if (page == null || page < 1) {
                page = 1;
            }
            JSONObject data = new JSONObject();
            data.put("helpLink", configService.getValue(ConfigKeyEnum.freeCouponHelp.getKey(),acceptData.getSystem()));
            data.put("tip", dataTip);
            data.put("count", resultList.size());
            data.put("result_list", JsonUtil.getApiCommonGson().toJson(resultList));
            out.print(JsonUtil.loadTrueResult(data));
        } catch (UserSystemCouponException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult(1, "查询失败"));
            e.printStackTrace();
        }
    }
            // 福利中心图片
            String topPicture = null;
            if (page == 1) {
                List<BannerVO> listswiper = swiperPictureService.getByBannerCardAndVersion("welfare_top", acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()), acceptData.getSystem());
                if (listswiper != null && listswiper.size() > 0) {
                    topPicture = listswiper.get(0).getSrc();
                }
            }
    /**
     * 免单券使用记录 以及状态修改
     *
     * @param acceptData
     * @param uid
     * @param out
     */
    @RequestMapping(value = "useFreeCoupon", method = RequestMethod.POST)
    public void useFreeCoupon(AcceptData acceptData, Long uid, Long cid, Long goodId, Integer goodsType, PrintWriter out) {
        if (uid == null) {
            out.print(JsonUtil.loadFalseResult("用户未登录"));
            return;
        }
        if (goodsType == null || goodsType > 3 || goodsType < 1) {
            goodsType = Constant.SOURCE_TYPE_TAOBAO;
        }
            boolean changeJump = false;
            String version = acceptData.getVersion();
            int tversion = Integer.parseInt(version);
            String platform = acceptData.getPlatform();
            if ("android".equalsIgnoreCase(platform) && tversion > 34) {
                changeJump = true;
            } else if (tversion > 44) {
                changeJump = true;
            }
        try {
            UserSystemCouponService.useGoodsCoupon(uid, cid, goodId, goodsType);
            out.print(JsonUtil.loadTrueResult("使用成功"));
        } catch (UserSystemCouponException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult(1, "使用失败"));
            e.printStackTrace();
        }
    }
            long count = UserSystemCouponService.countCouponOld(uid);
            List<UserSystemCouponVO> resultList = UserSystemCouponService
                    .getUserCouponVOList((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid, changeJump);
    /**
     * 用户奖励券
     *
     * @param acceptData
     * @param page
     * @param uid
     * @param out
     */
    @RequestMapping(value = "getOrderCouponList", method = RequestMethod.POST)
    public void getOrderCouponList(AcceptData acceptData, Long uid, PrintWriter out) {
            if (resultList == null) {
                resultList = new ArrayList<UserSystemCouponVO>();
            }
        if (uid == null) {
            out.print(JsonUtil.loadFalseResult("用户未登录"));
            return;
        }
            JSONObject data = new JSONObject();
            data.put("topPicture", topPicture);
            data.put("count", count);
            data.put("result_list", JsonUtil.getApiCommonGson().toJson(resultList));
        try {
            List<UserSystemCouponVO> resultList = UserSystemCouponService.getOrderCouponList(uid);
            out.print(JsonUtil.loadTrueResult(data));
            if (resultList == null) {
                resultList = new ArrayList<UserSystemCouponVO>();
            }
            // 更新福利中心未读数量
            if (page == 1) {
                executor.execute(new Runnable() {
                    @Override
                    public void run() {
                        UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
                        // 未读券是否大于0
                        if (userInfoExtra != null && userInfoExtra.getCouponNews() > 0) {
                            UserInfoExtra extra = new UserInfoExtra();
                            extra.setId(userInfoExtra.getId());
                            extra.setCouponNews(0);
                            userInfoExtraService.updateByPrimaryKeySelective(extra);
                        }
                    }
                });
            }
            JSONObject data = new JSONObject();
            data.put("helpLink", configService.getValue(ConfigKeyEnum.rewardCouponHelp.getKey(),acceptData.getSystem()));
            data.put("count", resultList.size());
            data.put("result_list", JsonUtil.getApiCommonGson().toJson(resultList));
        } catch (UserSystemCouponException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult(1, "查询失败"));
            e.printStackTrace();
        }
    }
            out.print(JsonUtil.loadTrueResult(data));
    /**
     * 用户奖励券
     *
     * @param acceptData
     * @param page
     * @param uid
     * @param auctionId  商品id
     * @param out
     */
    @RequestMapping(value = "getGoodsCouponList", method = RequestMethod.POST)
    public void getGoodsCouponList(AcceptData acceptData, Long uid, Long auctionId, PrintWriter out) {
        if (uid == null) {
            out.print(JsonUtil.loadFalseResult("用户未登录"));
            return;
        }
        } catch (UserSystemCouponException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult(1, "查询失败"));
            e.printStackTrace();
        }
    }
        try {
            List<UserSystemCouponVO> resultList = UserSystemCouponService.getGoodsCouponList(uid, auctionId);
            if (resultList == null) {
                resultList = new ArrayList<UserSystemCouponVO>();
            }
    /**
     * 免单券使用记录 以及状态修改
     *
     * @param acceptData
     * @param page
     * @param uid
     * @param out
     */
    @RequestMapping(value = "useRewardCoupon")
    public void useRewardCoupon(String callback, AcceptData acceptData, Long uid, Long cid, String orderNo, Integer goodsType, PrintWriter out) {
        if (uid == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录"));
            return;
        }
        // 当前用户是否VIP
        boolean vip = userInviteService.verifyVIP(uid);
        if (vip) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("会员不可使用奖励券"));
            return;
        }
        if (goodsType == null || goodsType > 3 || goodsType < 1) {
            goodsType = Constant.SOURCE_TYPE_TAOBAO;
        }
        try {
            UserSystemCouponService.useOrderCoupon(uid, cid, orderNo, goodsType, acceptData);
            JSONObject data = commonOrderService.getRewardJumpInfo(orderNo, goodsType);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (UserSystemCouponException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "使用失败"));
            e.printStackTrace();
        }
    }
            JSONObject dataTip = new JSONObject();
            dataTip.put("content", configService.getValue(ConfigKeyEnum.freeCouponTip.getKey(), acceptData.getSystem()));
            dataTip.put("fontColor", "#F14242");
    /**
     * 订单-奖励进度详情
     *
     * @param acceptData
     * @param orderNo    订单号
     * @param out
     */
    @RequestMapping(value = "getRewardRecord", method = RequestMethod.POST)
    public void getRewardCounponRecord(AcceptData acceptData, String orderNo, Integer goodsType, PrintWriter out) {
        try {
            if (goodsType == null || goodsType > 3 || goodsType < 1) {
                goodsType = Constant.SOURCE_TYPE_TAOBAO;
            }
            UserSystemCouponRecordVO rewardRecord = UserSystemCouponService.getRewardCouponRecord(orderNo, goodsType);
            JSONObject data = new JSONObject();
            data.put("rewardRecord", rewardRecord);
            out.print(JsonUtil.loadTrueResult(data));
        } catch (UserSystemCouponException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult(1, "查询失败"));
            e.printStackTrace();
        }
    }
            JSONObject data = new JSONObject();
            data.put("helpLink", configService.getValue(ConfigKeyEnum.freeCouponHelp.getKey(), acceptData.getSystem()));
            data.put("tip", dataTip);
            data.put("count", resultList.size());
            data.put("result_list", JsonUtil.getApiCommonGson().toJson(resultList));
            out.print(JsonUtil.loadTrueResult(data));
        } catch (UserSystemCouponException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult(1, "查询失败"));
            e.printStackTrace();
        }
    }
    /**
     * 订单-奖励进度详情
     *
     * @param acceptData
     * @param orderNo    订单号
     * @param out
     */
    @RequestMapping(value = "getFreeCounponRecord", method = RequestMethod.POST)
    public void getFreeCounponRecord(AcceptData acceptData, String orderNo, Integer goodsType, PrintWriter out) {
        try {
            if (goodsType == null || goodsType > 3 || goodsType < 1) {
                goodsType = Constant.SOURCE_TYPE_TAOBAO;
            }
            UserSystemCouponRecordVO rewardRecord = UserSystemCouponService.getFreeCouponRecord(orderNo, goodsType);
            JSONObject data = new JSONObject();
            data.put("frreCouponRecord", rewardRecord);
            out.print(JsonUtil.loadTrueResult(data));
        } catch (UserSystemCouponException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult(1, "查询失败"));
            e.printStackTrace();
        }
    }
    /**
     * 查询免单券
     * @param acceptData
     * @param uid
     * @param auctionId
     * @param out
     */
    @RequestMapping(value = "getFreeCouponList", method = RequestMethod.POST)
    public void getFreeCouponList(AcceptData acceptData, Long uid, String goodsId, Integer goodsType, PrintWriter out) {
        if (uid == null) {
            out.print(JsonUtil.loadFalseResult("用户未登录"));
            return;
        }
    /**
     * 免单券使用记录 以及状态修改
     *
     * @param acceptData
     * @param uid
     * @param out
     */
    @RequestMapping(value = "useFreeCoupon", method = RequestMethod.POST)
    public void useFreeCoupon(AcceptData acceptData, Long uid, Long cid, Long goodId, Integer goodsType, PrintWriter out) {
        if (uid == null) {
            out.print(JsonUtil.loadFalseResult("用户未登录"));
            return;
        }
        if (goodsType == null || StringUtil.isNullOrEmpty(goodsId)) {
            out.print(JsonUtil.loadFalseResult("参数不完整"));
            return;
        }
        List<UserSystemCouponVO> list = UserSystemCouponService.getFreeCouponList(uid);
        if (list == null)
            list = new ArrayList<>();
        if (list.size() > 0) {
             boolean state = false;
             BigDecimal  priceLimit = BigDecimal.valueOf(9.9);
             switch(goodsType) {
                 case Constant.SOURCE_TYPE_TAOBAO:
                     state = checkCanUsedTB(Long.parseLong(goodsId), priceLimit);
                     break;
                 case Constant.SOURCE_TYPE_JD:
                     state = checkCanUsedTB(Long.parseLong(goodsId), priceLimit);
                     break;
                 case Constant.SOURCE_TYPE_PDD:
                     state = checkCanUsedTB(Long.parseLong(goodsId), priceLimit);
                     break;
                 default:
                     break;
             }
             // 不能使用
             if (!state) {
                 for (UserSystemCouponVO userCouponVO : list) {
                    userCouponVO.setState(0);
                    userCouponVO.setCouponPicture(userCouponVO.getCouponPictureInvalid());
                    Map<String, Object> map = userCouponVO.getRemainDays();
                    if (map != null) {
                        map.put("fontColor", "#CCCCCC");
                    }
                    userCouponVO.setRemainDays(map);
                }
             }
        }
        if (goodsType == null || goodsType > 3 || goodsType < 1) {
            goodsType = Constant.SOURCE_TYPE_TAOBAO;
        }
        JSONObject dataTip = new JSONObject();
        dataTip.put("content", configService.getValue(ConfigKeyEnum.freeCouponTip.getKey(),acceptData.getSystem()));
        dataTip.put("fontColor", "#F14242");
        JSONObject data = new JSONObject();
        data.put("helpLink", configService.getValue(ConfigKeyEnum.freeCouponHelp.getKey(),acceptData.getSystem()));
        data.put("tip", dataTip);
        data.put("count", list.size());
        data.put("list", JsonUtil.getApiCommonGson().toJson(list));
        out.print(JsonUtil.loadTrueResult(data));
    }
    private boolean checkCanUsedTB(Long goodsId, BigDecimal priceLimit) {
        try {
            TaoBaoGoodsBrief goods = redisManager.getTaoBaoGoodsBrief(goodsId);
            if (goods == null)
                return false;
            BigDecimal quanPrice = TaoBaoUtil.getCouponPrice(goods);
            if (quanPrice.compareTo(priceLimit) <= 0)
                return true;
        } catch (TaobaoGoodsDownException e) {
            e.printStackTrace();
        }
        return false;
    }
        try {
            UserSystemCouponService.useGoodsCoupon(uid, cid, goodId, goodsType);
            out.print(JsonUtil.loadTrueResult("使用成功"));
        } catch (UserSystemCouponException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult(1, "使用失败"));
            e.printStackTrace();
        }
    }
    private boolean checkCanUsedJD(Long goodsId, BigDecimal priceLimit) {
        JDGoods goods = jdGoodsCacheUtil.getGoodsInfo(goodsId);
        if (goods == null)
            return false;
        BigDecimal quanPrice = JDUtil.getCouponPrice(goods);
        if (quanPrice.compareTo(priceLimit) <= 0)
            return true;
        return false;
    }
    private boolean checkCanUsedPDD(Long goodsId, BigDecimal priceLimit) {
        PDDGoodsDetail goods = pinDuoDuoCacheUtil.getGoodsInfo(goodsId);
        if (goods == null)
            return false;
        BigDecimal quanPrice = PinDuoDuoUtil.getCouponPrice(goods);
        if (quanPrice.compareTo(priceLimit) <= 0)
            return true;
        return false;
    }
    /**
     * 用户奖励券
     *
     * @param acceptData
     * @param page
     * @param uid
     * @param out
     */
    @RequestMapping(value = "getOrderCouponList", method = RequestMethod.POST)
    public void getOrderCouponList(AcceptData acceptData, Long uid, PrintWriter out) {
        if (uid == null) {
            out.print(JsonUtil.loadFalseResult("用户未登录"));
            return;
        }
        try {
            List<UserSystemCouponVO> resultList = UserSystemCouponService.getOrderCouponList(uid);
            if (resultList == null) {
                resultList = new ArrayList<UserSystemCouponVO>();
            }
            JSONObject data = new JSONObject();
            data.put("helpLink", configService.getValue(ConfigKeyEnum.rewardCouponHelp.getKey(), acceptData.getSystem()));
            data.put("count", resultList.size());
            data.put("result_list", JsonUtil.getApiCommonGson().toJson(resultList));
            out.print(JsonUtil.loadTrueResult(data));
        } catch (UserSystemCouponException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult(1, "查询失败"));
            e.printStackTrace();
        }
    }
    /**
     * 免单券使用记录 以及状态修改
     *
     * @param acceptData
     * @param page
     * @param uid
     * @param out
     */
    @RequestMapping(value = "useRewardCoupon")
    public void useRewardCoupon(String callback, AcceptData acceptData, Long uid, Long cid, String orderNo, Integer goodsType, PrintWriter out) {
        if (uid == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录"));
            return;
        }
        // 当前用户是否VIP
        boolean vip = userInviteService.verifyVIP(uid);
        if (vip) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("会员不可使用奖励券"));
            return;
        }
        if (goodsType == null || goodsType > 3 || goodsType < 1) {
            goodsType = Constant.SOURCE_TYPE_TAOBAO;
        }
        try {
            UserSystemCouponService.useOrderCoupon(uid, cid, orderNo, goodsType, acceptData);
            JSONObject data = commonOrderService.getRewardJumpInfo(orderNo, goodsType, userInfoService.getUserSystem(uid));
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (UserSystemCouponException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "使用失败"));
            e.printStackTrace();
        }
    }
    /**
     * 订单-奖励进度详情
     *
     * @param acceptData
     * @param orderNo    订单号
     * @param out
     */
    @RequestMapping(value = "getRewardRecord", method = RequestMethod.POST)
    public void getRewardCounponRecord(AcceptData acceptData, String orderNo, Integer goodsType, PrintWriter out) {
        try {
            if (goodsType == null || goodsType > 3 || goodsType < 1) {
                goodsType = Constant.SOURCE_TYPE_TAOBAO;
            }
            UserSystemCouponRecordVO rewardRecord = UserSystemCouponService.getRewardCouponRecord(orderNo, goodsType);
            JSONObject data = new JSONObject();
            data.put("rewardRecord", rewardRecord);
            out.print(JsonUtil.loadTrueResult(data));
        } catch (UserSystemCouponException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult(1, "查询失败"));
            e.printStackTrace();
        }
    }
    /**
     * 订单-奖励进度详情
     *
     * @param acceptData
     * @param orderNo    订单号
     * @param out
     */
    @RequestMapping(value = "getFreeCounponRecord", method = RequestMethod.POST)
    public void getFreeCounponRecord(AcceptData acceptData, String orderNo, Integer goodsType, PrintWriter out) {
        try {
            if (goodsType == null || goodsType > 3 || goodsType < 1) {
                goodsType = Constant.SOURCE_TYPE_TAOBAO;
            }
            UserSystemCouponRecordVO rewardRecord = UserSystemCouponService.getFreeCouponRecord(orderNo, goodsType);
            JSONObject data = new JSONObject();
            data.put("frreCouponRecord", rewardRecord);
            out.print(JsonUtil.loadTrueResult(data));
        } catch (UserSystemCouponException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult(1, "查询失败"));
            e.printStackTrace();
        }
    }
    /**
     * 查询免单券
     *
     * @param acceptData
     * @param uid
     * @param auctionId
     * @param out
     */
    @RequestMapping(value = "getFreeCouponList", method = RequestMethod.POST)
    public void getFreeCouponList(AcceptData acceptData, Long uid, String goodsId, Integer goodsType, PrintWriter out) {
        if (uid == null) {
            out.print(JsonUtil.loadFalseResult("用户未登录"));
            return;
        }
        if (goodsType == null || StringUtil.isNullOrEmpty(goodsId)) {
            out.print(JsonUtil.loadFalseResult("参数不完整"));
            return;
        }
        List<UserSystemCouponVO> list = UserSystemCouponService.getFreeCouponList(uid);
        if (list == null)
            list = new ArrayList<>();
        if (list.size() > 0) {
            boolean state = false;
            BigDecimal priceLimit = BigDecimal.valueOf(9.9);
            switch (goodsType) {
                case Constant.SOURCE_TYPE_TAOBAO:
                    state = checkCanUsedTB(Long.parseLong(goodsId), priceLimit);
                    break;
                case Constant.SOURCE_TYPE_JD:
                    state = checkCanUsedTB(Long.parseLong(goodsId), priceLimit);
                    break;
                case Constant.SOURCE_TYPE_PDD:
                    state = checkCanUsedTB(Long.parseLong(goodsId), priceLimit);
                    break;
                default:
                    break;
            }
            // 不能使用
            if (!state) {
                for (UserSystemCouponVO userCouponVO : list) {
                    userCouponVO.setState(0);
                    userCouponVO.setCouponPicture(userCouponVO.getCouponPictureInvalid());
                    Map<String, Object> map = userCouponVO.getRemainDays();
                    if (map != null) {
                        map.put("fontColor", "#CCCCCC");
                    }
                    userCouponVO.setRemainDays(map);
                }
            }
        }
        JSONObject dataTip = new JSONObject();
        dataTip.put("content", configService.getValue(ConfigKeyEnum.freeCouponTip.getKey(), acceptData.getSystem()));
        dataTip.put("fontColor", "#F14242");
        JSONObject data = new JSONObject();
        data.put("helpLink", configService.getValue(ConfigKeyEnum.freeCouponHelp.getKey(), acceptData.getSystem()));
        data.put("tip", dataTip);
        data.put("count", list.size());
        data.put("list", JsonUtil.getApiCommonGson().toJson(list));
        out.print(JsonUtil.loadTrueResult(data));
    }
    private boolean checkCanUsedTB(Long goodsId, BigDecimal priceLimit) {
        try {
            TaoBaoGoodsBrief goods = redisManager.getTaoBaoGoodsBrief(goodsId);
            if (goods == null)
                return false;
            BigDecimal quanPrice = TaoBaoUtil.getCouponPrice(goods);
            if (quanPrice.compareTo(priceLimit) <= 0)
                return true;
        } catch (TaobaoGoodsDownException e) {
            e.printStackTrace();
        }
        return false;
    }
    private boolean checkCanUsedJD(Long goodsId, BigDecimal priceLimit) {
        JDGoods goods = jdGoodsCacheUtil.getGoodsInfo(goodsId);
        if (goods == null)
            return false;
        BigDecimal quanPrice = JDUtil.getCouponPrice(goods);
        if (quanPrice.compareTo(priceLimit) <= 0)
            return true;
        return false;
    }
    private boolean checkCanUsedPDD(Long goodsId, BigDecimal priceLimit) {
        PDDGoodsDetail goods = pinDuoDuoCacheUtil.getGoodsInfo(goodsId);
        if (goods == null)
            return false;
        BigDecimal quanPrice = PinDuoDuoUtil.getCouponPrice(goods);
        if (quanPrice.compareTo(priceLimit) <= 0)
            return true;
        return false;
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserInfoController.java
@@ -2247,7 +2247,7 @@
                    vipAction.put("jumpDetail",
                            jumpDetailV2Service.getByTypeCache("web",
                                    acceptData.getPlatform().equalsIgnoreCase("android") ? 1 : 2,
                                    Integer.parseInt(acceptData.getVersion())));
                                    Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()));
                    JSONObject params = new JSONObject();
                    params.put("url", userVipConfigService.getValueByKey("vip_manager_link"));
                    vipAction.put("params", params);
@@ -2263,7 +2263,7 @@
                            vipAction.put("jumpDetail",
                                    jumpDetailV2Service.getByTypeCache("web",
                                            acceptData.getPlatform().equalsIgnoreCase("android") ? 1 : 2,
                                            Integer.parseInt(acceptData.getVersion())));
                                            Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()));
                            JSONObject params = new JSONObject();
                            params.put("url", link.replace("[ID]", list.get(0).getId()));
                            vipAction.put("params", params);
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserMsgController.java
@@ -208,7 +208,7 @@
                        if (detail.getType() == MsgTypeOrderTypeEnum.invite || detail.getType() == MsgTypeOrderTypeEnum.orderInvite)
                            params.put("orderHideNo", UserUtil.filterOrderId(detail.getOrderId()));
                        UserMsgVO msgVO = UserMsgVOFactory.create(detail, jumpDetailV2Service.getByTypeCache("order_search"), params);
                        UserMsgVO msgVO = UserMsgVOFactory.create(detail, jumpDetailV2Service.getByTypeCache("order_search",acceptData.getSystem()), params);
                        msgVO.setType(MSG_TYPE_ORDER);
                        list.add(msgVO);
                    }
@@ -752,7 +752,7 @@
                commonMsgList.add(new UserCommonMsgVO("http://img.flqapp.com/resource/msg/icon_recommend.png", "推荐记录",
                        list.get(0).getPushTime(), UserCommonMsgVO.TYPE_RECOMMEND, list.get(0).getContent(), read,
                        jumpDetailV2Service.getByTypeCache("recommend_list"), null, 0));
                        jumpDetailV2Service.getByTypeCache("recommend_list",acceptData.getSystem()), null, 0));
            }
        }
@@ -793,7 +793,7 @@
                    if (detail.getType() == MsgTypeOrderTypeEnum.invite || detail.getType() == MsgTypeOrderTypeEnum.orderInvite)
                        params.put("orderHideNo", UserUtil.filterOrderId(detail.getOrderId()));
                    UserMsgVO userMsgVO = UserMsgVOFactory.create(detail,
                            jumpDetailV2Service.getByTypeCache("order_search"), params);
                            jumpDetailV2Service.getByTypeCache("order_search",acceptData.getSystem()), params);
                    userMsgVO.setType(MSG_TYPE_ORDER);
                    list.add(userMsgVO);
                }
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java
@@ -682,6 +682,9 @@
                }
                for (GoodsEvaluate goodsEvaluate : list) {
                    if (goodsEvaluate.getGoods() != null) {
                        goodsEvaluate.getGoods().setCreatetime(null);
                    }
                    GoodsEvaluate evaluateNew = new GoodsEvaluate();
                    try {
                        PropertyUtils.copyProperties(evaluateNew, goodsEvaluate);
@@ -1427,7 +1430,7 @@
            int platformCode = Constant.getPlatformCode(acceptData.getPlatform());
            jumpDetail = jumpDetailV2Service.getByTypeCache("web", platformCode,
                    Integer.parseInt(acceptData.getVersion()));
                    Integer.parseInt(acceptData.getVersion()),acceptData.getSystem());
            JSONObject inner = new JSONObject();
            inner.put("url", jumpLink);
            params = inner.toString();
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsClassControllerV2.java
@@ -193,7 +193,7 @@
            goodsBriefs.add(taoBaoGoodsBrief);
        }
        List<GoodsDetailVO> voList = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goodsBriefs, paramsDTO);
        List<GoodsDetailVO> voList = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goodsBriefs, paramsDTO,false);
        for (GoodsDetailVO vo : voList) {
            vo.setCreatetime(null);
            array.add(gson.toJson(vo));
@@ -295,7 +295,7 @@
                if (resultGoodsList != null) {
                    GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
                            acceptData.getVersion(), acceptData.getSystem());
                    List<GoodsDetailVO> voList = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, resultGoodsList, paramsDTO);
                    List<GoodsDetailVO> voList = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, resultGoodsList, paramsDTO,false);
                    for (GoodsDetailVO vo : voList) {
                        array.add(gson2.toJson(vo));
                    }
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
@@ -633,7 +633,7 @@
        } else {// 普通购买
            OtherInfo otherInfo = new OtherInfo();
            RewardCouponVO rewardCoupon = new RewardCouponVO();
            rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
            rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web",acceptData.getSystem()));
            JSONObject params1 = new JSONObject();
            if (!VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion()))
                params1.put("url", configService.getValue(ConfigKeyEnum.specialGuideRewardCouponLink.getKey(), acceptData.getSystem()));
@@ -790,7 +790,7 @@
        // 奖励券返利
        RewardCouponVO rewardCoupon = new RewardCouponVO();
        rewardCoupon.setMaxMoneyPlus(maxMoneyPlus);
        rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
        rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web",acceptData.getSystem()));
        JSONObject params1 = new JSONObject();
        if (!VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion()))
            params1.put("url", configService.getValue(ConfigKeyEnum.specialGuideRewardCouponLink.getKey(), acceptData.getSystem()));
@@ -987,7 +987,7 @@
        // 附加信息
        OtherInfo otherInfo = new OtherInfo();
        RewardCouponVO rewardCoupon = new RewardCouponVO();
        rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
        rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web",acceptData.getSystem()));
        JSONObject params1 = new JSONObject();
        if (!VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion()))
            params1.put("url", configService.getValue(ConfigKeyEnum.specialGuideRewardCouponLink.getKey(), acceptData.getSystem()));
@@ -1194,7 +1194,7 @@
        // 附加信息
        OtherInfo otherInfo = new OtherInfo();
        RewardCouponVO rewardCoupon = new RewardCouponVO();
        rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
        rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web",acceptData.getSystem()));
        JSONObject params1 = new JSONObject();
        if (!VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion()))
            params1.put("url", configService.getValue(ConfigKeyEnum.specialGuideRewardCouponLink.getKey(), acceptData.getSystem()));
@@ -1334,7 +1334,7 @@
        // 附加信息
        OtherInfo otherInfo = new OtherInfo();
        RewardCouponVO rewardCoupon = new RewardCouponVO();
        rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
        rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web",acceptData.getSystem()));
        JSONObject params1 = new JSONObject();
        params1.put("url", userVipConfigService.getValueByKey("vip_link"));
@@ -1626,7 +1626,7 @@
            List<GoodsDetailVO> listExtra = new ArrayList<GoodsDetailVO>();
            GoodsMoneyConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), null, acceptData.getSystem());
            listExtra = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goodsList, paramsDTO);
            listExtra = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goodsList, paramsDTO,false);
            List<GoodsDetailVO> listQuality = new ArrayList<GoodsDetailVO>();
            // 取偶数个数据
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/IntegralControllerV2.java
@@ -196,7 +196,7 @@
                    if (extraVO == null || StringUtil.isNullOrEmpty(extraVO.getInviteCode())) {
                        JumpDetailV2 jumpDetailV2 = jumpDetailV2Service.getByTypeCache("invite_activate",
                                Constant.getPlatformCode(acceptData.getPlatform()),
                                Integer.parseInt(acceptData.getVersion()));
                                Integer.parseInt(acceptData.getVersion()),acceptData.getSystem());
                        taskClassVO.setJumpDetail(jumpDetailV2);
                    }
                }
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java
@@ -359,9 +359,9 @@
        JumpDetailV2 jumpDetail = null;
        if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) {
            jumpDetail = jumpDetailV2Service.getByTypeCache("spike_goods_list");
            jumpDetail = jumpDetailV2Service.getByTypeCache("spike_goods_list",acceptData.getSystem());
        } else {
            jumpDetail = jumpDetailV2Service.getByTypeCache("web");
            jumpDetail = jumpDetailV2Service.getByTypeCache("web",acceptData.getSystem());
        }
        if (array == null) {
@@ -538,7 +538,7 @@
        params.put("balanceMore", true);
        root.put("params", params);
        root.put("jumpDetail", jumpDetailV2Service.getByTypeCache("integralExchange",
                Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion())));
                Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()));
        root.put("name", "金币兑换");
        root.put("desc", "每日签到,惊喜不停");
@@ -576,10 +576,10 @@
        root.put("picture", "http://img.flqapp.com/resource/home_search_found.png");
        root.put("params", params);
        root.put("jumpDetail", jumpDetailV2Service.getByTypeCache("web",
                Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion())));
                Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()));
        root.put("jumpResult", jumpDetailV2Service.getByTypeCache("search_goods_result",
                Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion())));
                Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()));
        root.put("keyList", array);
        return root;
    }
@@ -655,7 +655,7 @@
                    acceptData.getVersion(), acceptData.getSystem());
            List<GoodsDetailVO> voList = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goodsList, paramsDTO);
            List<GoodsDetailVO> voList = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goodsList, paramsDTO,false);
            for (GoodsDetailVO vo : voList) {
                if (page < 3)
@@ -745,7 +745,7 @@
                                deviceGoodsList.add(goods);
                            }
                        }
                        List<GoodsDetailVO> voList = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, deviceGoodsList, paramsDTO);
                        List<GoodsDetailVO> voList = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, deviceGoodsList, paramsDTO,false);
                        for (GoodsDetailVO vo : voList) {
                            vo.setRecommend(true);
                        }
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java
@@ -1,37 +1,8 @@
package com.yeshi.fanli.controller.client.v2;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import com.yeshi.fanli.entity.SystemEnum;
import com.yeshi.fanli.entity.SystemPIDInfo;
import com.yeshi.fanli.entity.bus.search.HistorySearch;
import com.yeshi.fanli.exception.pdd.PDDApiException;
import com.yeshi.fanli.exception.taobao.TaoBaoTokenParseException;
import com.yeshi.fanli.lijin.manager.GoodsLijinMnager;
import com.yeshi.fanli.service.inter.pdd.PDDAuthService;
import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.service.manger.PIDManager;
import com.yeshi.fanli.util.suning.SuningUtil;
import com.yeshi.fanli.util.vipshop.VipShopUtil;
import com.yeshi.goods.facade.utils.taobao.DaTaoKeApiUtil;
import org.springframework.core.task.TaskExecutor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.HttpUtil;
import org.yeshi.utils.IPUtil;
import org.yeshi.utils.JsonUtil;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.yeshi.common.entity.PageEntity;
import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO;
import com.yeshi.fanli.dto.jd.JDFilter;
import com.yeshi.fanli.dto.jd.JDSearchFilter;
@@ -45,30 +16,35 @@
import com.yeshi.fanli.dto.vip.VIPSearchFilter;
import com.yeshi.fanli.dto.vip.VIPSearchResult;
import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo;
import com.yeshi.fanli.entity.SystemEnum;
import com.yeshi.fanli.entity.SystemPIDInfo;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.help.AppPageNotification;
import com.yeshi.fanli.entity.bus.search.HistorySearch;
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.entity.jd.JDGoods;
import com.yeshi.fanli.entity.system.ConfigKeyEnum;
import com.yeshi.fanli.entity.taobao.SearchFilter;
import com.yeshi.goods.facade.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
import com.yeshi.goods.facade.entity.taobao.dataoke.DaTaoKeDetailV2;
import com.yeshi.fanli.exception.pdd.PDDApiException;
import com.yeshi.fanli.exception.taobao.TaoBaoTokenParseException;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
import com.yeshi.fanli.exception.user.TokenRecordException;
import com.yeshi.fanli.lijin.manager.GoodsLijinMnager;
import com.yeshi.fanli.service.inter.brand.BrandInfoService;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.help.AppPageNotificationService;
import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
import com.yeshi.fanli.service.inter.pdd.PDDAuthService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
import com.yeshi.goods.facade.service.DaTaoKeGoodsDetailV2Service;
import com.yeshi.fanli.service.inter.user.HistorySearchService;
import com.yeshi.fanli.service.inter.user.TokenRecordService;
import com.yeshi.fanli.service.inter.user.integral.IntegralGetService;
import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.service.manger.ClipboardAnalysisManager;
import com.yeshi.fanli.service.manger.IClipboardAnalysisResult;
import com.yeshi.common.entity.PageEntity;
import com.yeshi.fanli.service.manger.PIDManager;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.ThreadUtil;
@@ -83,10 +59,12 @@
import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil;
import com.yeshi.fanli.util.pinduoduo.PinDuoDuoUtil;
import com.yeshi.fanli.util.suning.SuningApiUtil;
import com.yeshi.fanli.util.suning.SuningUtil;
import com.yeshi.fanli.util.taobao.SearchFilterUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import com.yeshi.fanli.util.vipshop.VipShopApiUtil;
import com.yeshi.fanli.util.vipshop.VipShopUtil;
import com.yeshi.fanli.vo.brand.BrandInfoVO;
import com.yeshi.fanli.vo.brand.TaoBaoShopVO;
import com.yeshi.fanli.vo.common.JumpDetailContentVO;
@@ -94,9 +72,28 @@
import com.yeshi.fanli.vo.msg.TokenVO;
import com.yeshi.fanli.vo.recommend.RecommendJumpInfoVO;
import com.yeshi.fanli.vo.search.GoodsDocParseResultVO;
import com.yeshi.goods.facade.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.goods.facade.entity.taobao.dataoke.DaTaoKeDetailV2;
import com.yeshi.goods.facade.service.DaTaoKeGoodsDetailV2Service;
import com.yeshi.goods.facade.utils.taobao.DaTaoKeApiUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.core.task.TaskExecutor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.HttpUtil;
import org.yeshi.utils.IPUtil;
import org.yeshi.utils.JsonUtil;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@Controller
@RequestMapping("api/v2/search")
@@ -204,7 +201,7 @@
                            int platformCode = Constant.getPlatformCode(acceptData.getPlatform());
                            int version = Integer.parseInt(acceptData.getVersion());
                            JumpDetailContentVO convert = new JumpDetailContentVO();
                            convert.setJumpDetail(jumpDetailV2Service.getByTypeCache("web", platformCode, version));
                            convert.setJumpDetail(jumpDetailV2Service.getByTypeCache("web", platformCode, version,acceptData.getSystem()));
                            JSONObject convertParams = new JSONObject();
                            convertParams.put("url", configService.getValue(ConfigKeyEnum.convertDocWebLink.getKey(), acceptData.getSystem()));
                            convertParams.put("clipboard", false);
@@ -226,17 +223,17 @@
                                if (result.getFirstGoods().getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) {
                                    view = new JumpDetailContentVO();
                                    view.setJumpDetail(
                                            jumpDetailV2Service.getByTypeCache("goodsdetail", platformCode, version));
                                            jumpDetailV2Service.getByTypeCache("goodsdetail", platformCode, version,acceptData.getSystem()));
                                    view.setParams(params);
                                } else if (result.getFirstGoods().getGoodsType() == Constant.SOURCE_TYPE_JD) {
                                    view = new JumpDetailContentVO();
                                    view.setJumpDetail(
                                            jumpDetailV2Service.getByTypeCache("goodsdetail_jd", platformCode, version));
                                            jumpDetailV2Service.getByTypeCache("goodsdetail_jd", platformCode, version,acceptData.getSystem()));
                                    view.setParams(params);
                                } else if (result.getFirstGoods().getGoodsType() == Constant.SOURCE_TYPE_PDD) {
                                    view = new JumpDetailContentVO();
                                    view.setJumpDetail(
                                            jumpDetailV2Service.getByTypeCache("goodsdetail_pdd", platformCode, version));
                                            jumpDetailV2Service.getByTypeCache("goodsdetail_pdd", platformCode, version,acceptData.getSystem()));
                                    view.setParams(params);
                                }
@@ -244,7 +241,7 @@
                                state = 2;
                                data.put("stateDesc", "选择搜券或转链");
                                view = new JumpDetailContentVO();
                                view.setJumpDetail(jumpDetailV2Service.getByTypeCache("web", platformCode, version));
                                view.setJumpDetail(jumpDetailV2Service.getByTypeCache("web", platformCode, version,acceptData.getSystem()));
                                JSONObject params = new JSONObject();
                                params.put("url", result.getFirstLink());
                                view.setParams(params);
@@ -304,7 +301,7 @@
                                                            acceptData.getPlatform(),
                                                            acceptData.getVersion(), acceptData.getSystem()));
                                            goodsDetailVO = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goodsBrief, goodsDetailVO);
                                            goodsDetailVO = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goodsBrief, goodsDetailVO,false);
                                            data.put("goods",
                                                    gson.toJson(goodsDetailVO));
@@ -442,7 +439,7 @@
        }
        RecommendJumpInfoVO left = new RecommendJumpInfoVO("去看看", jumpDetailV2Service.getByTypeCache(type,
                Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion())), params);
                Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()), params);
        data.put("left", gson.toJson(left));
        // 去网页
@@ -456,7 +453,7 @@
            params.put("url", rightValue);
            RecommendJumpInfoVO right = new RecommendJumpInfoVO("有更高返利?", jumpDetailV2Service.getByTypeCache("web",
                    Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion())),
                    Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()),
                    params);
            data.put("right", gson.toJson(right));
        }
@@ -881,7 +878,7 @@
        GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
                acceptData.getVersion(), acceptData.getSystem());
        List<GoodsDetailVO> list = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goodsBriefList, paramsDTO);
        List<GoodsDetailVO> list = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goodsBriefList, paramsDTO,false);
        Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                .excludeFieldsWithoutExposeAnnotation().create();
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java
@@ -13,6 +13,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import com.ks.push.service.BDeviceTokenService;
import com.yeshi.fanli.entity.SystemEnum;
import com.yeshi.fanli.entity.SystemFunction;
import com.yeshi.fanli.exception.user.UserExtraTaoBaoInfoException;
@@ -20,6 +21,7 @@
import com.yeshi.fanli.util.*;
import com.yeshi.fanli.vo.taobao.TaoBaoUser;
import com.yeshi.fanli.vo.user.QQUserInfoVO;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@@ -178,6 +180,9 @@
    @Resource
    private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
    @Reference(version = "1.0", check = false)
    private BDeviceTokenService bDeviceTokenService;
    /**
     * 新版登录 V1.5.3
@@ -259,13 +264,19 @@
                            LogHelper.errorDetailInfo(e);
                        }
                        // 绑定oppo,VIVO推送
                        DeviceActive active = deviceActiveService.getFirstActiveInfo(acceptData.getDevice());
                        if (active != null) {
                            deviceTokenOPPOService.bindUid(uuser.getId(), active.getId());
                            deviceTokenVIVOService.bindUid(uuser.getId(), active.getId());
                            deviceTokenXMService.bindUid(active.getId(), uuser.getId());
                        if (acceptData.getSystem().isNewPush()) {
                            bDeviceTokenService.bindUid(acceptData.getSystem().name(), StringUtil.isNullOrEmpty(acceptData.getUtdid()) ? acceptData.getDevice() : acceptData.getUtdid(), uuser.getId() + "");
                        } else {
                            // 绑定oppo,VIVO推送
                            DeviceActive active = deviceActiveService.getFirstActiveInfo(acceptData.getDevice());
                            if (active != null) {
                                deviceTokenOPPOService.bindUid(uuser.getId(), active.getId());
                                deviceTokenVIVOService.bindUid(uuser.getId(), active.getId());
                                deviceTokenXMService.bindUid(active.getId(), uuser.getId());
                            }
                        }
                    }
                });
            }
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserMsgControllerV2.java
@@ -110,7 +110,7 @@
                params.put("orderNo", detail.getOrderId());
                if (detail.getType() == MsgTypeOrderTypeEnum.invite || detail.getType() == MsgTypeOrderTypeEnum.orderInvite)
                    params.put("orderHideNo", UserUtil.filterOrderId(detail.getOrderId()));
                UserMsgVO msgVO = UserMsgVOFactory.create(detail, jumpDetailV2Service.getByTypeCache("order_search"), params);
                UserMsgVO msgVO = UserMsgVOFactory.create(detail, jumpDetailV2Service.getByTypeCache("order_search",acceptData.getSystem()), params);
                msgVO.setType(MsgExtra.MSG_TYPE_ORDER);
                list.add(msgVO);
            } else if (obj instanceof MsgMoneyDetail) {
@@ -145,7 +145,7 @@
                MsgLijinVIPDetail detail = (MsgLijinVIPDetail) obj;
                JSONObject params = new JSONObject();
                params.put("url", configService.getValue(ConfigKeyEnum.lijinVIPLink, acceptData.getSystem()));
                UserMsgVO vo = UserMsgVOFactory.create(detail, jumpDetailV2Service.getByTypeCache("web"), params);
                UserMsgVO vo = UserMsgVOFactory.create(detail, jumpDetailV2Service.getByTypeCache("web",acceptData.getSystem()), params);
                vo.setType(MsgExtra.MSG_TYPE_LIJIN_VIP);
                list.add(vo);
            } else if (obj instanceof UserSystemMsg) {
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserOrderControllerV2.java
@@ -771,7 +771,7 @@
            orderRebateVO.setCouponText("奖励成功");
            orderRebateVO.setCouponDesc("已再返¥" + couponMoney.setScale(2, BigDecimal.ROUND_DOWN));
            orderRebateVO.setCouponParams(params.toString());
            orderRebateVO.setCouponJumpDetail(jumpDetailV2Service.getByTypeCache("rewardCouponDetail"));
            orderRebateVO.setCouponJumpDetail(jumpDetailV2Service.getByTypeCache("rewardCouponDetail",acceptData.getSystem()));
        } else if (freeState > 0) { // 已使用免单券
            JSONObject params = new JSONObject();
            params.put("orderNo", orderNo);
@@ -779,7 +779,7 @@
            orderRebateVO.setCouponType(2);
            orderRebateVO.setCouponUse(true);
            orderRebateVO.setCouponParams(params.toString());
            orderRebateVO.setCouponJumpDetail(jumpDetailV2Service.getByTypeCache("freeCouponDetail"));
            orderRebateVO.setCouponJumpDetail(jumpDetailV2Service.getByTypeCache("freeCouponDetail",acceptData.getSystem()));
            if (UserSystemCouponRecord.STATE_FREE_ON == freeState) {
                orderRebateVO.setCouponText("免单中");
            } else if (UserSystemCouponRecord.STATE_SUCCESS == freeState) {
fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/UserMsgController.java
@@ -168,7 +168,7 @@
                        params.put("orderHideNo", UserUtil.filterOrderId(detail.getOrderId()));
                    JumpDetailV2 wxmpJumDetail = JumpDetailUtil
                            .getWXMPJumDetail(jumpDetailV2Service.getByTypeCache("order_search"));
                            .getWXMPJumDetail(jumpDetailV2Service.getByTypeCache("order_search",acceptData.getSystem()));
                    UserMsgVO userMsgVO = UserMsgVOFactory.create(detail, wxmpJumDetail, params);
                    userMsgVO.setType(MSG_TYPE_ORDER);
@@ -249,7 +249,7 @@
                // TODO 跳转地址
                JSONObject params = new JSONObject();
                params.put("url", "http://apph5.banliapp.com/special/1.0.9/jingXuanN_9.html?type=9_9");
                JumpDetailV2 wxmpJumDetail = JumpDetailUtil.getWXMPJumDetail(jumpDetailV2Service.getByTypeCache("web"));
                JumpDetailV2 wxmpJumDetail = JumpDetailUtil.getWXMPJumDetail(jumpDetailV2Service.getByTypeCache("web",acceptData.getSystem()));
                userSystemMsgVO.setJumpDetail(wxmpJumDetail);
                root.put("systemMsg", userSystemMsgVO);
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/common/JumpDetailV2Mapper.java
@@ -2,73 +2,60 @@
import java.util.List;
import com.ks.lijin.query.BaseDaoQuery;
import com.yeshi.fanli.entity.SystemEnum;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.entity.common.JumpDetailV2;
public interface JumpDetailV2Mapper {
    int deleteByPrimaryKey(Long id);
    int deleteByPrimaryKey(Long id);
    int insert(JumpDetailV2 record);
    int insert(JumpDetailV2 record);
    int insertSelective(JumpDetailV2 record);
    int insertSelective(JumpDetailV2 record);
    JumpDetailV2 selectByPrimaryKey(Long id);
    JumpDetailV2 selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(JumpDetailV2 record);
    int updateByPrimaryKeySelective(JumpDetailV2 record);
    int updateByPrimaryKey(JumpDetailV2 record);
    int updateByPrimaryKey(JumpDetailV2 record);
    /**
     * 根据类型取值
     *
     * @param type
     * @return
     */
    List<JumpDetailV2> listByType(String type);
    /**
     * 根据类型取值
     *
     * @param type
     * @return
     */
    List<JumpDetailV2> listByType(String type);
    /**
     * 所有方式
     *
     * @return
     */
    List<JumpDetailV2> listJump();
    /**
     * 所有方式
     *
     * @return
     */
    List<JumpDetailV2> listJump();
    /**
     * 根据主键批量删除
     *
     * @param list
     * @return
     */
    int deleteBatchByPrimaryKey(List<Long> list);
    /**
     * 根据主键批量删除
     *
     * @param list
     * @return
     */
    int deleteBatchByPrimaryKey(List<Long> list);
    /**
     * 后端列表查询
     *
     * @param start
     * @param count
     * @param key
     * @return
     */
    List<JumpDetailV2> listQuery(@Param("start") long start, @Param("count") int count, @Param("key") String key);
    long countListQuery(@Param("key") String key);
    List<JumpDetailV2> list(@Param("query") DaoQuery daoQuery);
    /**
     * 根据Android版本获取最近的跳转值
     * @param type
     * @param version
     * @return
     */
    JumpDetailV2 selectAndroidByTypeAndVersion(@Param("type")String type, @Param("version")int version);
    /**
     * 根据IOS版本获取最近的跳转值
     * @param type
     * @param version
     * @return
     */
    JumpDetailV2 selectIOSByTypeAndVersion(@Param("type")String type, @Param("version")int version);
    long count(@Param("query") DaoQuery daoQuery);
    public class DaoQuery extends BaseDaoQuery {
        public String type;
        public Integer maxAndroidVersion;
        public Integer maxIOSVersion;
        public SystemEnum system;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/SystemEnum.java
@@ -8,10 +8,10 @@
 */
public enum SystemEnum {
    blks("com.yeshi.ec.rebate", "com.xyj.ec.fanli-ios", new String[]{}, new SystemFunction[]{SystemFunction.share,
            SystemFunction.bindPhone, SystemFunction.threeSale, SystemFunction.cloudOrder, SystemFunction.godenCorn, SystemFunction.redPack,SystemFunction.faQuan,SystemFunction.fanli,SystemFunction.vip,SystemFunction.inviteCode
    }, 1, "板栗快省","板栗快省"),
    flq("com.fanliunion.android", "com.xyj.ec.flq-ios", new String[]{}, new SystemFunction[]{SystemFunction.share,SystemFunction.faQuan,SystemFunction.fanli}, 11, "返利联盟","淘拼团"),
    yhqjx("com.youhuiquan.android","com.youhuiquanjx.ios",new String[]{}, new SystemFunction[]{SystemFunction.fanli,SystemFunction.lijinSub,SystemFunction.bindPhone}, 12, "特价","特价App");
            SystemFunction.bindPhone, SystemFunction.threeSale, SystemFunction.cloudOrder, SystemFunction.godenCorn, SystemFunction.redPack, SystemFunction.faQuan, SystemFunction.fanli, SystemFunction.vip, SystemFunction.inviteCode
    }, 1, "板栗快省", "板栗快省", false),
    flq("com.fanliunion.android", "com.xyj.ec.flq-ios", new String[]{}, new SystemFunction[]{SystemFunction.share, SystemFunction.faQuan, SystemFunction.fanli}, 11, "返利联盟", "淘拼团", false),
    yhqjx("com.youhuiquan.android", "com.youhuiquanjx.ios", new String[]{}, new SystemFunction[]{SystemFunction.fanli, SystemFunction.lijinSub, SystemFunction.bindPhone}, 12, "特价", "特价App", true);
    private String packageName;
    private String bundleId;
    private int systemId;
@@ -19,23 +19,26 @@
    private String[] wxxcxAppIds;
    private Set<SystemFunction> functionSet;
    private String smsAlias;
    //新版推送
    private boolean newPush;
    public String getSmsAlias() {
        return smsAlias;
    }
    private SystemEnum(String packageName, String bundleId, String[] wxxcxAppIds, SystemFunction[] functions, int systemId, String name, String smsAlias) {
    private SystemEnum(String packageName, String bundleId, String[] wxxcxAppIds, SystemFunction[] functions, int systemId, String name, String smsAlias, boolean newPush) {
        this.bundleId = bundleId;
        this.name = name;
        this.packageName = packageName;
        this.systemId = systemId;
        this.wxxcxAppIds = wxxcxAppIds;
        this.newPush = newPush;
        Set<SystemFunction> set = new HashSet<>();
        if (functions != null)
            for (SystemFunction f : functions)
                set.add(f);
        this.functionSet = set;
        this.smsAlias=smsAlias;
        this.smsAlias = smsAlias;
    }
    public Set<SystemFunction> getFunctionSet() {
@@ -61,4 +64,8 @@
    public String[] getWxxcxAppIds() {
        return wxxcxAppIds;
    }
    public boolean isNewPush() {
        return newPush;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/common/JumpDetailV2.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.entity.common;
import com.google.gson.annotations.Expose;
import com.yeshi.fanli.entity.SystemEnum;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
@@ -36,6 +37,10 @@
    @org.yeshi.utils.mybatis.Column(name = "jp_controller")
    private String controller;
    @Expose
    @org.yeshi.utils.mybatis.Column(name = "jp_path")
    private String path;//小程序路径
    // 跳转类型
    @Expose
    @org.yeshi.utils.mybatis.Column(name = "jp_type")
@@ -49,9 +54,9 @@
    @org.yeshi.utils.mybatis.Column(name = "jp_min_ios_version")
    private Integer minIOSAppVersion;// 最小ios版本
    @Expose
    @org.yeshi.utils.mybatis.Column(name = "jp_path")
    private String path;//小程序路径
    @org.yeshi.utils.mybatis.Column(name = "jp_system")
    private SystemEnum system;
    public String getPath() {
        return path;
@@ -133,4 +138,11 @@
        this.type = type;
    }
    public SystemEnum getSystem() {
        return system;
    }
    public void setSystem(SystemEnum system) {
        this.system = system;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/system/ConfigKeyEnum.java
@@ -240,7 +240,11 @@
    clipboardRecommendGoodsMakeMore("clipboard_recommend_goods_make_more_link", "根据粘贴板推荐商品赚更多链接"),
    welcomeMsg("welcome_message", "消息页面的欢迎消息"),
    gdtAdInfo("gdt_ad_info", "广点通广告信息"),
    demoLoginUser("demo_login_user", "模拟用户登录");
    demoLoginUser("demo_login_user", "模拟用户登录"),
    //推送
    pushAndroidActivityScheme("push_android_activity_scheme", "android推送Activity协议名称"),
    pushAndroidActivity("push_android_activity", "android接受推送的落地Activity"),
    pushAndroidHostPath("push_android_host_path", "android推送落地页唤起路径");
    private final String key;
fanli/src/main/java/com/yeshi/fanli/job/DynamicInfoJob.java
@@ -338,7 +338,7 @@
                                        hongBaoManageService.getShareRate(SystemEnum.blks), null,
                                        hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP, SystemEnum.blks))));
                picture.setGoodState(0);
                picture.setJumpDetail(jumpDetailV2Service.getByTypeCache("goodsdetail"));
                picture.setJumpDetail(jumpDetailV2Service.getByTypeCache("goodsdetail",SystemEnum.blks));
                picture.setParams(null);
                picture.setUrl(jdGoods.getPicUrl());
                imgs.add(picture);
fanli/src/main/java/com/yeshi/fanli/job/order/vipshop/UpdateVipShopOrderJob.java
@@ -6,6 +6,7 @@
import javax.annotation.Resource;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.vipshop.DingDanXiaApiUtil;
import org.springframework.stereotype.Component;
import com.xxl.job.core.biz.model.ReturnT;
@@ -89,7 +90,6 @@
    }
    //根据订单号更新
    @XxlJob("order-vip-updateByOrderSn")
    public ReturnT<String> updateByOrderSn(String param) throws Exception {
@@ -127,6 +127,20 @@
        }
        saveVipShopOrders(vipShopOrderList);
        //订单侠的接口
        page = 1;
        result = DingDanXiaApiUtil
                .getOrderList(VipShopOrderQueryModel.createOrderTime(startTime, endTime, null, page));
        while (result != null && result.getOrderList().size() > 0) {
            page++;
            vipShopOrderList.addAll(result.getOrderList());
            result = DingDanXiaApiUtil
                    .getOrderList(VipShopOrderQueryModel.createOrderTime(startTime, endTime, null, page));
        }
        saveVipShopOrders(vipShopOrderList);
    }
    /**
fanli/src/main/java/com/yeshi/fanli/lijin/manager/GoodsLijinMnager.java
@@ -114,7 +114,7 @@
    }
    private void loadTBMoneyInfo(SystemEnum system, Map<String, MoneyInfo> lijinMap, TaoBaoGoodsBrief goods, GoodsDetailVO detailVO) {
    private void loadTBMoneyInfo(SystemEnum system, Map<String, MoneyInfo> lijinMap, TaoBaoGoodsBrief goods, GoodsDetailVO detailVO, boolean detail) {
        if (SystemInfoUtil.hasFunctions(system, SystemFunction.lijinSub)) {
            //设置礼金
            MoneyInfo moneyInfo = lijinMap.get(goods.getAuctionId() + "");
@@ -123,7 +123,8 @@
            BigDecimal finalPrice = null;
            if (moneyInfo != null && moneyInfo.getLijinAmount() != null) {//有礼金
                detailVO.getMoneyInfo().setHongBaoMoney("¥" + moneyInfo.getLijinAmount());
                detailVO.getMoneyInfo().setFanliMoney(null);
                if (!detail)
                    detailVO.getMoneyInfo().setFanliMoney(null);
                finalPrice = couponPrice.subtract(moneyInfo.getLijinAmount());
            } else {//无礼金
                finalPrice = couponPrice.subtract(moneyInfo.getFanliAmount() == null ? new BigDecimal(0) : moneyInfo.getFanliAmount());
@@ -135,7 +136,7 @@
    }
    public GoodsDetailVO loadTBMoneyInfo(SystemEnum system, Long uid, TaoBaoGoodsBrief goodsBrief, GoodsDetailVO detailVO) {
    public GoodsDetailVO loadTBMoneyInfo(SystemEnum system, Long uid, TaoBaoGoodsBrief goodsBrief, GoodsDetailVO detailVO,boolean detail) {
        List<TaoBaoGoodsBrief> goodsBriefs = new ArrayList<>();
        goodsBriefs.add(goodsBrief);
        Map<String, MoneyInfo> lijinMap = null;
@@ -145,7 +146,7 @@
        }
        for (TaoBaoGoodsBrief goods : goodsBriefs) {
            try {
                loadTBMoneyInfo(system, lijinMap, goods, detailVO);
                loadTBMoneyInfo(system, lijinMap, goods, detailVO,detail);
            } catch (Exception e) {
                e.printStackTrace();
            }
@@ -154,7 +155,7 @@
    }
    public List<GoodsDetailVO> loadTBMoneyInfo(SystemEnum system, Long uid, List<TaoBaoGoodsBrief> goodsBriefList, GoodsMoneyConfigParamsDTO paramsDTO) {
    public List<GoodsDetailVO> loadTBMoneyInfo(SystemEnum system, Long uid, List<TaoBaoGoodsBrief> goodsBriefList, GoodsMoneyConfigParamsDTO paramsDTO,boolean detail) {
        Map<String, MoneyInfo> lijinMap = null;
        if (SystemInfoUtil.hasFunctions(system, SystemFunction.lijinSub)) {
            loadMaterialLibsType(goodsBriefList);
@@ -164,7 +165,7 @@
        for (TaoBaoGoodsBrief goods : goodsBriefList) {
            try {
                GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO);
                loadTBMoneyInfo(system, lijinMap, goods, detailVO);
                loadTBMoneyInfo(system, lijinMap, goods, detailVO,detail);
                voList.add(detailVO);
            } catch (Exception e) {
                e.printStackTrace();
@@ -180,7 +181,7 @@
    }
    private List<GoodsDetailVOWithKey> loadTBMoneyInfo(SystemEnum system, Long uid, List<TaoBaoGoodsBrief> goodsBriefList, List<String> goodsKeyList, GoodsMoneyConfigParamsDTO paramsDTO) {
    private List<GoodsDetailVOWithKey> loadTBMoneyInfo(SystemEnum system, Long uid, List<TaoBaoGoodsBrief> goodsBriefList, List<String> goodsKeyList, GoodsMoneyConfigParamsDTO paramsDTO,boolean detail) {
        Map<String, MoneyInfo> lijinMap = null;
        boolean hasCreateTime = false;
        if (SystemInfoUtil.hasFunctions(system, SystemFunction.lijinSub) && goodsBriefList.size() > 0) {
@@ -192,7 +193,7 @@
        for (int i = 0; i < goodsBriefList.size(); i++) {
            try {
                GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goodsBriefList.get(i), paramsDTO);
                loadTBMoneyInfo(system, lijinMap, goodsBriefList.get(i), detailVO);
                loadTBMoneyInfo(system, lijinMap, goodsBriefList.get(i), detailVO,detail);
                voList.add(new GoodsDetailVOWithKey(detailVO, goodsKeyList.get(i)));
            } catch (Exception e) {
                e.printStackTrace();
@@ -311,7 +312,7 @@
            }
        }
        GoodsDetailVO[] vos = new GoodsDetailVO[positionMap.size()];
        List<GoodsDetailVOWithKey> tbVOList = loadTBMoneyInfo(system, uid, taoBaoGoodsBriefList, tbKeyList, paramsDTO);
        List<GoodsDetailVOWithKey> tbVOList = loadTBMoneyInfo(system, uid, taoBaoGoodsBriefList, tbKeyList, paramsDTO,false);
        List<GoodsDetailVO> otherVOList = loadOtherMoneyInfo(system, uid, otherGoodsList, paramsDTO);
        for (GoodsDetailVOWithKey vo : tbVOList) {
fanli/src/main/java/com/yeshi/fanli/log/LogHelper.java
@@ -124,7 +124,7 @@
    }
    public static void errorDetailInfo(Throwable e) {
        logger.error("", e);
        logger.error("出错:", e);
    }
    public static void errorDetailInfo(Throwable e, String params, String url) {
fanli/src/main/java/com/yeshi/fanli/service/impl/common/JumpDetailV2ServiceImpl.java
@@ -4,6 +4,7 @@
import javax.annotation.Resource;
import com.yeshi.fanli.entity.SystemEnum;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
@@ -15,89 +16,113 @@
@Service
public class JumpDetailV2ServiceImpl implements JumpDetailV2Service {
    @Resource
    private JumpDetailV2Mapper jumpDetailV2Mapper;
    @Resource
    private JumpDetailV2Mapper jumpDetailV2Mapper;
    @Override
    public int deleteByPrimaryKey(Long id) {
        return jumpDetailV2Mapper.deleteByPrimaryKey(id);
    }
    @Override
    public int deleteByPrimaryKey(Long id) {
        return jumpDetailV2Mapper.deleteByPrimaryKey(id);
    }
    @Override
    public int insert(JumpDetailV2 record) {
        return jumpDetailV2Mapper.insert(record);
    }
    @Override
    public int insert(JumpDetailV2 record) {
        return jumpDetailV2Mapper.insert(record);
    }
    @Override
    public int insertSelective(JumpDetailV2 record) {
        return jumpDetailV2Mapper.insertSelective(record);
    }
    @Override
    public int insertSelective(JumpDetailV2 record) {
        return jumpDetailV2Mapper.insertSelective(record);
    }
    @Override
    public JumpDetailV2 selectByPrimaryKey(Long id) {
        return jumpDetailV2Mapper.selectByPrimaryKey(id);
    }
    @Override
    public JumpDetailV2 selectByPrimaryKey(Long id) {
        return jumpDetailV2Mapper.selectByPrimaryKey(id);
    }
    @Override
    public int updateByPrimaryKeySelective(JumpDetailV2 record) {
        return jumpDetailV2Mapper.updateByPrimaryKeySelective(record);
    }
    @Override
    public int updateByPrimaryKeySelective(JumpDetailV2 record) {
        return jumpDetailV2Mapper.updateByPrimaryKeySelective(record);
    }
    @Override
    public int updateByPrimaryKey(JumpDetailV2 record) {
        return jumpDetailV2Mapper.updateByPrimaryKey(record);
    }
    @Override
    public int updateByPrimaryKey(JumpDetailV2 record) {
        return jumpDetailV2Mapper.updateByPrimaryKey(record);
    }
    @Override
    public List<JumpDetailV2> listByType(String type) {
        return jumpDetailV2Mapper.listByType(type);
    }
    @Override
    public List<JumpDetailV2> listByType(String type, SystemEnum system) {
        JumpDetailV2Mapper.DaoQuery daoQuery = new JumpDetailV2Mapper.DaoQuery();
        daoQuery.type = type;
        daoQuery.system = system;
        daoQuery.count = Integer.MAX_VALUE;
        return jumpDetailV2Mapper.list(daoQuery);
    }
    @Cacheable(value = "configCache", key = "'getByTypeCache-'+#type")
    @Override
    public JumpDetailV2 getByTypeCache(String type) {
    @Cacheable(value = "configCache", key = "'getByTypeCache-'+#type")
    @Override
    public JumpDetailV2 getByTypeCache(String type, SystemEnum system) {
        JumpDetailV2 jumpDetailV2 = null;
        JumpDetailV2 jumpDetailV2 = null;
        List<JumpDetailV2> listByType = listByType(type);
        List<JumpDetailV2> listByType = listByType(type, system);
        if (listByType != null && listByType.size() > 0) {
            jumpDetailV2 = listByType.get(0);
        } else {
            jumpDetailV2 = new JumpDetailV2();
        }
        if (listByType != null && listByType.size() > 0) {
            jumpDetailV2 = listByType.get(0);
        } else {
            jumpDetailV2 = new JumpDetailV2();
        }
        return jumpDetailV2;
    }
        return jumpDetailV2;
    }
    @Cacheable(value = "configCache", key = "'getByTypeCache-'+#type+'-'+#platform+'-'+#version")
    @Override
    public JumpDetailV2 getByTypeCache(String type, int platform, int version) {
        if (platform == 1) {
            return jumpDetailV2Mapper.selectAndroidByTypeAndVersion(type, version);
        } else {
            return jumpDetailV2Mapper.selectIOSByTypeAndVersion(type, version);
        }
    }
    @Cacheable(value = "configCache", key = "'getByTypeCache-'+#type+'-'+#platform+'-'+#version")
    @Override
    public JumpDetailV2 getByTypeCache(String type, int platform, int version, SystemEnum system) {
        JumpDetailV2Mapper.DaoQuery daoQuery = new JumpDetailV2Mapper.DaoQuery();
        daoQuery.type = type;
        daoQuery.system = system;
        if (platform == 1) {
            daoQuery.maxAndroidVersion = version;
        } else {
            daoQuery.maxIOSVersion = version;
        }
        daoQuery.count = 1;
        List<JumpDetailV2> list = jumpDetailV2Mapper.list(daoQuery);
        if (list == null || list.size() == 0)
            return list.get(0);
        else
            return list.get(0);
    }
    @Override
    public List<JumpDetailV2> listJump() {
        return jumpDetailV2Mapper.listJump();
    }
    @Override
    public List<JumpDetailV2> listJump(SystemEnum system) {
        JumpDetailV2Mapper.DaoQuery daoQuery = new JumpDetailV2Mapper.DaoQuery();
        daoQuery.count = Integer.MAX_VALUE;
        daoQuery.system = system;
        return jumpDetailV2Mapper.list(daoQuery);
    }
    @Override
    public int deleteBatchByPrimaryKey(List<Long> list) {
        return jumpDetailV2Mapper.deleteBatchByPrimaryKey(list);
    }
    @Override
    public int deleteBatchByPrimaryKey(List<Long> list) {
        return jumpDetailV2Mapper.deleteBatchByPrimaryKey(list);
    }
    @Override
    public List<JumpDetailV2> listQuery(long start, int count, String key) {
        return jumpDetailV2Mapper.listQuery(start, count, key);
    }
    @Override
    public List<JumpDetailV2> listQuery(long start, int count, String key, SystemEnum system) {
        JumpDetailV2Mapper.DaoQuery daoQuery = new JumpDetailV2Mapper.DaoQuery();
        daoQuery.key = key;
        daoQuery.start = start;
        daoQuery.count = count;
        daoQuery.system = system;
        return jumpDetailV2Mapper.list(daoQuery);
    }
    @Override
    public long countListQuery(String key) {
        return jumpDetailV2Mapper.countListQuery(key);
    }
    @Override
    public long countListQuery(String key, SystemEnum system) {
        JumpDetailV2Mapper.DaoQuery daoQuery = new JumpDetailV2Mapper.DaoQuery();
        daoQuery.key = key;
        daoQuery.system = system;
        return jumpDetailV2Mapper.count(daoQuery);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/DynamicInfoServiceImpl.java
@@ -70,1170 +70,1170 @@
@Service
public class DynamicInfoServiceImpl implements DynamicInfoService {
    @Resource(name = "taskExecutor")
    private TaskExecutor executor;
    @Resource(name = "taskExecutor")
    private TaskExecutor executor;
    @Resource
    private DynamicInfoDao dynamicInfoDao;
    @Resource
    private DynamicInfoDao dynamicInfoDao;
    @Resource
    private RedisManager redisManager;
    @Resource
    private RedisManager redisManager;
    @Resource
    private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
    @Resource
    private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
    @Resource
    private JumpDetailV2Service jumpDetailV2Service;
    @Resource
    private JumpDetailV2Service jumpDetailV2Service;
    @Resource
    private ActivityUserService activityUserService;
    @Resource
    private ActivityUserService activityUserService;
    @Resource
    private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
    @Resource
    private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
    @Resource
    private HongBaoManageService hongBaoManageService;
    @Resource
    private HongBaoManageService hongBaoManageService;
    @Resource
    private TaoBaoShopService taoBaoShopService;
    @Resource
    private TaoBaoShopService taoBaoShopService;
    @Resource
    private InviteMaterialService inviteMaterialService;
    @Resource
    private InviteMaterialService inviteMaterialService;
    @Resource
    private QrCodeService qrCodeService;
    @Resource
    private QrCodeService qrCodeService;
    @Resource
    private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
    @Resource
    private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
    @Override
    public void insert(DynamicInfo record) {
        dynamicInfoDao.insert(record);
    }
    @Override
    public void insert(DynamicInfo record) {
        dynamicInfoDao.insert(record);
    }
    @Override
    public DynamicInfo getById(String id) {
        return dynamicInfoDao.getById(id);
    }
    @Override
    public DynamicInfo getById(String id) {
        return dynamicInfoDao.getById(id);
    }
    @Override
    public void insertTimeInvite() {
        InviteMaterial inviteMaterial = inviteMaterialService.getInviteMaterial();
        if (inviteMaterial == null) {
            return;
        }
    @Override
    public void insertTimeInvite() {
        InviteMaterial inviteMaterial = inviteMaterialService.getInviteMaterial();
        if (inviteMaterial == null) {
            return;
        }
        Date date = new Date();
        String materialId = inviteMaterial.getId();
        String content = inviteMaterial.getText();
        Date date = new Date();
        String materialId = inviteMaterial.getId();
        String content = inviteMaterial.getText();
        ActivityUser user = activityUserService.selectByPrimaryKey(2L);
        ActivityUser user = activityUserService.selectByPrimaryKey(2L);
        if (!StringUtil.isNullOrEmpty(content)) {
            DynamicInfo dynamicTxt = new DynamicInfo();
            dynamicTxt.setId(UUID.randomUUID().toString().replace("-", ""));
            dynamicTxt.setInviteMaterialId(materialId);
            dynamicTxt.setClassId(4L);
            dynamicTxt.setSubclassId(0L);
            dynamicTxt.setShowType(DynamicInfo.SHOW_TYPE_ZERO);
            dynamicTxt.setShareType(DynamicInfo.SHARE_TYPE_INVITE);
            dynamicTxt.setUser(user);
            dynamicTxt.setShareCount(1000 + (int) (Math.random() * 8000));
            dynamicTxt.setCreateTime(date);
            dynamicTxt.setUpdateTime(date);
        if (!StringUtil.isNullOrEmpty(content)) {
            DynamicInfo dynamicTxt = new DynamicInfo();
            dynamicTxt.setId(UUID.randomUUID().toString().replace("-", ""));
            dynamicTxt.setInviteMaterialId(materialId);
            dynamicTxt.setClassId(4L);
            dynamicTxt.setSubclassId(0L);
            dynamicTxt.setShowType(DynamicInfo.SHOW_TYPE_ZERO);
            dynamicTxt.setShareType(DynamicInfo.SHARE_TYPE_INVITE);
            dynamicTxt.setUser(user);
            dynamicTxt.setShareCount(1000 + (int) (Math.random() * 8000));
            dynamicTxt.setCreateTime(date);
            dynamicTxt.setUpdateTime(date);
            SimpleDateFormat format = new SimpleDateFormat("MM月dd日");
            SimpleDateFormat format = new SimpleDateFormat("MM月dd日");
            StringBuffer buffer = new StringBuffer();
            buffer.append("-------------------\n");
            buffer.append("今天 : " + format.format(date));
            buffer.append("     ");
            buffer.append(DateLunarUtil.getWeekd(date) + "\n");
            buffer.append("各位亲爱的你");
            buffer.append("         ");
            buffer.append("早安~\n");
            buffer.append("我的邀请码:【邀请码】\n");
            buffer.append("购物省钱板栗快省App:【邀请链接】");
            StringBuffer buffer = new StringBuffer();
            buffer.append("-------------------\n");
            buffer.append("今天 : " + format.format(date));
            buffer.append("     ");
            buffer.append(DateLunarUtil.getWeekd(date) + "\n");
            buffer.append("各位亲爱的你");
            buffer.append("         ");
            buffer.append("早安~\n");
            buffer.append("我的邀请码:【邀请码】\n");
            buffer.append("购物省钱板栗快省App:【邀请链接】");
            content = content.replaceAll("\\,", "\\,").replaceAll("\\.", "\\。").replaceAll("\\;", "\\;")
                    .replaceAll("\\!", "\\!").replaceAll("\\?", "\\?").replaceAll("\\:", "\\:");
            content = content.replaceAll("\\,", "\\,").replaceAll("\\.", "\\。").replaceAll("\\;", "\\;")
                    .replaceAll("\\!", "\\!").replaceAll("\\?", "\\?").replaceAll("\\:", "\\:");
            ClientTextStyleVO row1 = new ClientTextStyleVO();
            row1.setColor("#333333");
            row1.setContent(content + "\n" + buffer.toString());
            List<ClientTextStyleVO> listtitle = new ArrayList<ClientTextStyleVO>();
            listtitle.add(row1);
            dynamicTxt.setTitle(listtitle);
            ClientTextStyleVO row1 = new ClientTextStyleVO();
            row1.setColor("#333333");
            row1.setContent(content + "\n" + buffer.toString());
            List<ClientTextStyleVO> listtitle = new ArrayList<ClientTextStyleVO>();
            listtitle.add(row1);
            dynamicTxt.setTitle(listtitle);
            // 空数据
            List<GoodsPicture> listImg = new ArrayList<GoodsPicture>();
            dynamicTxt.setImgs(listImg);
            // 空数据
            List<GoodsPicture> listImg = new ArrayList<GoodsPicture>();
            dynamicTxt.setImgs(listImg);
            dynamicInfoDao.insert(dynamicTxt);
        }
            dynamicInfoDao.insert(dynamicTxt);
        }
        String picture = inviteMaterial.getPicture();
        if (!StringUtil.isNullOrEmpty(picture)) {
            DynamicInfo dynamicPic = new DynamicInfo();
            dynamicPic.setId(UUID.randomUUID().toString().replace("-", ""));
            dynamicPic.setInviteMaterialId(materialId);
            dynamicPic.setClassId(4L);
            dynamicPic.setSubclassId(0L);
            dynamicPic.setShowType(DynamicInfo.SHOW_TYPE_ONE);
            dynamicPic.setShareType(DynamicInfo.SHARE_TYPE_INVITE);
            dynamicPic.setUser(user);
            dynamicPic.setShareCount(1000 + (int) (Math.random() * 8000));
            dynamicPic.setCreateTime(date);
            dynamicPic.setUpdateTime(date);
        String picture = inviteMaterial.getPicture();
        if (!StringUtil.isNullOrEmpty(picture)) {
            DynamicInfo dynamicPic = new DynamicInfo();
            dynamicPic.setId(UUID.randomUUID().toString().replace("-", ""));
            dynamicPic.setInviteMaterialId(materialId);
            dynamicPic.setClassId(4L);
            dynamicPic.setSubclassId(0L);
            dynamicPic.setShowType(DynamicInfo.SHOW_TYPE_ONE);
            dynamicPic.setShareType(DynamicInfo.SHARE_TYPE_INVITE);
            dynamicPic.setUser(user);
            dynamicPic.setShareCount(1000 + (int) (Math.random() * 8000));
            dynamicPic.setCreateTime(date);
            dynamicPic.setUpdateTime(date);
            try {
                // 画图
                String url = qrCodeService.drawInviteToGreet(picture, null, null, null, content, new Date());
            try {
                // 画图
                String url = qrCodeService.drawInviteToGreet(picture, null, null, null, content, new Date());
                List<ClientTextStyleVO> listtitle = new ArrayList<ClientTextStyleVO>();
                dynamicPic.setTitle(listtitle);
                List<ClientTextStyleVO> listtitle = new ArrayList<ClientTextStyleVO>();
                dynamicPic.setTitle(listtitle);
                GoodsPicture p2 = new GoodsPicture();
                p2.setW(100);
                p2.setH(100);
                p2.setUrl(url);
                p2.setUrlOriginal(picture);
                p2.setTitleOriginal(content);
                List<GoodsPicture> listImg = new ArrayList<GoodsPicture>();
                listImg.add(p2);
                dynamicPic.setImgs(listImg);
                GoodsPicture p2 = new GoodsPicture();
                p2.setW(100);
                p2.setH(100);
                p2.setUrl(url);
                p2.setUrlOriginal(picture);
                p2.setTitleOriginal(content);
                List<GoodsPicture> listImg = new ArrayList<GoodsPicture>();
                listImg.add(p2);
                dynamicPic.setImgs(listImg);
                dynamicInfoDao.insert(dynamicPic);
            } catch (Exception e) {
                try {
                    LogHelper.errorDetailInfo(e);
                } catch (Exception e1) {
                    e1.printStackTrace();
                }
            }
        }
        // 更新素材状态
        inviteMaterialService.updateState(1, materialId);
    }
                dynamicInfoDao.insert(dynamicPic);
            } catch (Exception e) {
                try {
                    LogHelper.errorDetailInfo(e);
                } catch (Exception e1) {
                    e1.printStackTrace();
                }
            }
        }
        // 更新素材状态
        inviteMaterialService.updateState(1, materialId);
    }
    @Override
    public void insertShopInfo() {
        List<String> brandIdList = DaTaoKeApiUtil.getBrandIdList();
        if (brandIdList == null || brandIdList.size() == 0) {
            LogHelper.test("大淘客品牌id获取失败(DynamicInfoService-insertShopInfo)");
            return;
        }
    @Override
    public void insertShopInfo() {
        List<String> brandIdList = DaTaoKeApiUtil.getBrandIdList();
        if (brandIdList == null || brandIdList.size() == 0) {
            LogHelper.test("大淘客品牌id获取失败(DynamicInfoService-insertShopInfo)");
            return;
        }
        Long classId = 3L;
        Long subclassId = 0L;
        List<DynamicInfo> listInfo = dynamicInfoDao.query(classId, subclassId);
        Long classId = 3L;
        Long subclassId = 0L;
        List<DynamicInfo> listInfo = dynamicInfoDao.query(classId, subclassId);
        // 清理已存在品牌
        if (listInfo != null && listInfo.size() > 0) {
            for (int i = 0; i < brandIdList.size(); i++) {
                String brandId = brandIdList.get(i);
        // 清理已存在品牌
        if (listInfo != null && listInfo.size() > 0) {
            for (int i = 0; i < brandIdList.size(); i++) {
                String brandId = brandIdList.get(i);
                for (int j = 0; j < listInfo.size(); j++) {
                    String id = listInfo.get(j).getId();
                    if (brandId.equals(id)) {
                        brandIdList.remove(brandId);
                        i--;
                for (int j = 0; j < listInfo.size(); j++) {
                    String id = listInfo.get(j).getId();
                    if (brandId.equals(id)) {
                        brandIdList.remove(brandId);
                        i--;
                        listInfo.remove(listInfo.get(j));
                        j--;
                    }
                }
            }
        }
                        listInfo.remove(listInfo.get(j));
                        j--;
                    }
                }
            }
        }
        if (brandIdList == null || brandIdList.size() == 0) {
            LogHelper.test("大淘客品牌已全部爬取(DynamicInfoService-insertShopInfo)");
            return;
        }
        if (brandIdList == null || brandIdList.size() == 0) {
            LogHelper.test("大淘客品牌已全部爬取(DynamicInfoService-insertShopInfo)");
            return;
        }
        int index = (int) (Math.random() * brandIdList.size());
        String brandId = brandIdList.get(index);
        int index = (int) (Math.random() * brandIdList.size());
        String brandId = brandIdList.get(index);
        TaoBaoShopDTO dynamicShopInfo = DaTaoKeApiUtil.getDynamicShopInfo(brandId);
        if (dynamicShopInfo == null) {
            LogHelper.test("大淘客品牌信息爬取失败(DynamicInfoService-insertShopInfo)");
            return;
        }
        TaoBaoShopDTO dynamicShopInfo = DaTaoKeApiUtil.getDynamicShopInfo(brandId);
        if (dynamicShopInfo == null) {
            LogHelper.test("大淘客品牌信息爬取失败(DynamicInfoService-insertShopInfo)");
            return;
        }
        List<TaoBaoGoodsBrief> listGoods = dynamicShopInfo.getListGoods();
        if (listGoods == null || listGoods.size() == 0) {
            LogHelper.test("大淘客品牌商品信息爬取失败(DynamicInfoService-insertShopInfo)");
            return;
        }
        List<TaoBaoGoodsBrief> listGoods = dynamicShopInfo.getListGoods();
        if (listGoods == null || listGoods.size() == 0) {
            LogHelper.test("大淘客品牌商品信息爬取失败(DynamicInfoService-insertShopInfo)");
            return;
        }
        Long sellerId = dynamicShopInfo.getSellerId();
        TaoBaoGoodsBrief taoBaoGoodsBrief = listGoods.get(0);
        TaoBaoShop taoBaoShop = taoBaoShopService.getTaoBaoShop(taoBaoGoodsBrief.getAuctionId(), sellerId);
        if (taoBaoShop == null) {
            LogHelper.test("店铺详情信息获取失败(DynamicInfoService-insertShopInfo)");
            return;
        }
        String shopLink = taoBaoShop.getShopLink();
        if (StringUtil.isNullOrEmpty(shopLink)) {
            taoBaoShop.setShopLink(TaoBaoUtil.getShopLink(taoBaoShop.getId()));
        }
        if(StringUtil.isNullOrEmpty(taoBaoShop.getShopIcon()))
            taoBaoShop.setShopIcon(dynamicShopInfo.getShopIcon());
        Long sellerId = dynamicShopInfo.getSellerId();
        TaoBaoGoodsBrief taoBaoGoodsBrief = listGoods.get(0);
        TaoBaoShop taoBaoShop = taoBaoShopService.getTaoBaoShop(taoBaoGoodsBrief.getAuctionId(), sellerId);
        if (taoBaoShop == null) {
            LogHelper.test("店铺详情信息获取失败(DynamicInfoService-insertShopInfo)");
            return;
        }
        String shopLink = taoBaoShop.getShopLink();
        if (StringUtil.isNullOrEmpty(shopLink)) {
            taoBaoShop.setShopLink(TaoBaoUtil.getShopLink(taoBaoShop.getId()));
        }
        DynamicInfo dynamicVO = new DynamicInfo();
        dynamicVO.setId(brandId);
        dynamicVO.setClassId(classId);
        dynamicVO.setSubclassId(subclassId);
        dynamicVO.setShowType(DynamicInfo.SHOW_TYPE_TWO);
        dynamicVO.setShop(taoBaoShop);
        List<ActivityRuleUser> userList = activityUserService.listByRuleCode(ActivityRuleUser.RULE_HAODIAN, 1, 50);
        dynamicVO.setUser(userList.get((int) (userList.size() * Math.random())).getActivityUser());
        dynamicVO.setCreateTime(DateUtil.reduceRandomMinute(new Date(), 8));
        dynamicVO.setUpdateTime(new Date());
        if (StringUtil.isNullOrEmpty(taoBaoShop.getShopIcon()))
            taoBaoShop.setShopIcon(dynamicShopInfo.getShopIcon());
        // 介绍内容
        ClientTextStyleVO row1 = new ClientTextStyleVO();
        row1.setColor("#333333");
        row1.setContent(dynamicShopInfo.getBrandDes());
        List<ClientTextStyleVO> listTitle = new ArrayList<ClientTextStyleVO>();
        listTitle.add(row1);
        dynamicVO.setTitle(listTitle);
        DynamicInfo dynamicVO = new DynamicInfo();
        dynamicVO.setId(brandId);
        dynamicVO.setClassId(classId);
        dynamicVO.setSubclassId(subclassId);
        dynamicVO.setShowType(DynamicInfo.SHOW_TYPE_TWO);
        dynamicVO.setShop(taoBaoShop);
        List<ActivityRuleUser> userList = activityUserService.listByRuleCode(ActivityRuleUser.RULE_HAODIAN, 1, 50);
        dynamicVO.setUser(userList.get((int) (userList.size() * Math.random())).getActivityUser());
        dynamicVO.setCreateTime(DateUtil.reduceRandomMinute(new Date(), 8));
        dynamicVO.setUpdateTime(new Date());
        // 商品信息
        List<GoodsPicture> listPicture = new ArrayList<GoodsPicture>();
        for (TaoBaoGoodsBrief goodsBrief : listGoods) {
            BigDecimal proportion = hongBaoManageService.getFanLiRate(SystemEnum.blks);
            TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(goodsBrief,
                    proportion.toString(), null);
            taoBaoGoodsBriefExtra.setCouponInfo(null);
            taoBaoGoodsBriefExtra.setUpdatetime(new Date());
        // 介绍内容
        ClientTextStyleVO row1 = new ClientTextStyleVO();
        row1.setColor("#333333");
        row1.setContent(dynamicShopInfo.getBrandDes());
        List<ClientTextStyleVO> listTitle = new ArrayList<ClientTextStyleVO>();
        listTitle.add(row1);
        dynamicVO.setTitle(listTitle);
            if (!taoBaoGoodsBriefExtra.isCoupon()) {
                taoBaoGoodsBriefExtra.setState(1);
            }
        // 商品信息
        List<GoodsPicture> listPicture = new ArrayList<GoodsPicture>();
        for (TaoBaoGoodsBrief goodsBrief : listGoods) {
            BigDecimal proportion = hongBaoManageService.getFanLiRate(SystemEnum.blks);
            TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(goodsBrief,
                    proportion.toString(), null);
            taoBaoGoodsBriefExtra.setCouponInfo(null);
            taoBaoGoodsBriefExtra.setUpdatetime(new Date());
            String goodsId = goodsBrief.getAuctionId().toString();
            JSONObject item = new JSONObject();
            item.put("id", goodsId);
            item.put("from", "dynamics");
            if (!taoBaoGoodsBriefExtra.isCoupon()) {
                taoBaoGoodsBriefExtra.setState(1);
            }
            GoodsPicture goodsPicture = new GoodsPicture();
            goodsPicture.setH(100);
            goodsPicture.setW(100);
            goodsPicture.setUrl(TbImgUtil.getTBSize320Img(goodsBrief.getPictUrl()));
            goodsPicture.setJumpDetail(jumpDetailV2Service.getByTypeCache("goodsdetail"));
            goodsPicture.setParams(item.toString());
            goodsPicture.setGoods(taoBaoGoodsBriefExtra);
            String goodsId = goodsBrief.getAuctionId().toString();
            JSONObject item = new JSONObject();
            item.put("id", goodsId);
            item.put("from", "dynamics");
            listPicture.add(goodsPicture);
        }
        dynamicVO.setImgs(listPicture);
            GoodsPicture goodsPicture = new GoodsPicture();
            goodsPicture.setH(100);
            goodsPicture.setW(100);
            goodsPicture.setUrl(TbImgUtil.getTBSize320Img(goodsBrief.getPictUrl()));
            goodsPicture.setJumpDetail(jumpDetailV2Service.getByTypeCache("goodsdetail", SystemEnum.blks));
            goodsPicture.setParams(item.toString());
            goodsPicture.setGoods(taoBaoGoodsBriefExtra);
        dynamicInfoDao.insert(dynamicVO);
    }
            listPicture.add(goodsPicture);
        }
        dynamicVO.setImgs(listPicture);
    @Override
    public void insertTimeRecommend() {
        try {
            Long classId = 2L;
            List<GoodsClass> list = DaTaoKeUtil.goodsClasses;
            int index = (int) (Math.random() * list.size());
            Long subclassId = list.get(index).getId();
            int cid = Integer.parseInt(subclassId + "");
            int count = 0;
            double random = Math.random();
            if (random > 0.4) {
                count = 9;
            } else {
                count = 4;
            }
        dynamicInfoDao.insert(dynamicVO);
    }
            List<DaTaoKeDetailV2> listDaTaoKe = daTaoKeGoodsDetailV2Service.getGoodsNotInList(subclassId, null, count);
    @Override
    public void insertTimeRecommend() {
        try {
            Long classId = 2L;
            List<GoodsClass> list = DaTaoKeUtil.goodsClasses;
            int index = (int) (Math.random() * list.size());
            Long subclassId = list.get(index).getId();
            int cid = Integer.parseInt(subclassId + "");
            int count = 0;
            double random = Math.random();
            if (random > 0.4) {
                count = 9;
            } else {
                count = 4;
            }
            DaTaoKeDetailV2 daTaoKeDetail = null;
            // 商品列表
            List<GoodsPicture> listPicture = new ArrayList<GoodsPicture>();
            // 商品列表
            List<TaoBaoGoodsBrief> listGoods = new ArrayList<TaoBaoGoodsBrief>();
            // 分享奖金
            BigDecimal shareMoney = new BigDecimal(0);
            List<DaTaoKeDetailV2> listDaTaoKe = daTaoKeGoodsDetailV2Service.getGoodsNotInList(subclassId, null, count);
            BigDecimal proportion = hongBaoManageService.getFanLiRate(SystemEnum.blks);
            for (DaTaoKeDetailV2 daTaoKe : listDaTaoKe) {
                if (daTaoKeDetail == null) {
                    daTaoKeDetail = daTaoKe;
                }
                // 分享奖金
                TaoBaoGoodsBrief taoBaoGoodsBrief = TaoBaoUtil.convert(daTaoKe);
                listGoods.add(taoBaoGoodsBrief);
            DaTaoKeDetailV2 daTaoKeDetail = null;
            // 商品列表
            List<GoodsPicture> listPicture = new ArrayList<GoodsPicture>();
            // 商品列表
            List<TaoBaoGoodsBrief> listGoods = new ArrayList<TaoBaoGoodsBrief>();
            // 分享奖金
            BigDecimal shareMoney = new BigDecimal(0);
                TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief,
                        proportion.toString(), null);
                if (!taoBaoGoodsBriefExtra.isCoupon()) {
                    taoBaoGoodsBriefExtra.setState(1);
                }
            BigDecimal proportion = hongBaoManageService.getFanLiRate(SystemEnum.blks);
            for (DaTaoKeDetailV2 daTaoKe : listDaTaoKe) {
                if (daTaoKeDetail == null) {
                    daTaoKeDetail = daTaoKe;
                }
                // 分享奖金
                TaoBaoGoodsBrief taoBaoGoodsBrief = TaoBaoUtil.convert(daTaoKe);
                listGoods.add(taoBaoGoodsBrief);
                BigDecimal money = taoBaoGoodsBriefService.getShareGoodsUserHongBao(taoBaoGoodsBrief,SystemEnum.blks);
                shareMoney = MoneyBigDecimalUtil.add(shareMoney, money);
                // 商品图片
                taoBaoGoodsBriefExtra.setUpdatetime(new Date());
                taoBaoGoodsBriefExtra.setCouponInfo(null);
                GoodsPicture goodsPicture = getGoodsPicture(daTaoKe);
                goodsPicture.setGoods(taoBaoGoodsBriefExtra);
                TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief,
                        proportion.toString(), null);
                if (!taoBaoGoodsBriefExtra.isCoupon()) {
                    taoBaoGoodsBriefExtra.setState(1);
                }
                listPicture.add(goodsPicture);
            }
                BigDecimal money = taoBaoGoodsBriefService.getShareGoodsUserHongBao(taoBaoGoodsBrief, SystemEnum.blks);
                shareMoney = MoneyBigDecimalUtil.add(shareMoney, money);
                // 商品图片
                taoBaoGoodsBriefExtra.setUpdatetime(new Date());
                taoBaoGoodsBriefExtra.setCouponInfo(null);
                GoodsPicture goodsPicture = getGoodsPicture(daTaoKe, SystemEnum.blks);
                goodsPicture.setGoods(taoBaoGoodsBriefExtra);
            // 组织动态信息
            DynamicInfo dynamicInfo = getDynamicInfo(daTaoKeDetail, classId, subclassId);
            // 无内容
            dynamicInfo.setTitle(new ArrayList<ClientTextStyleVO>());
            // 发布用户
            dynamicInfo.setUser(activityUserService.getRandomByDaTaoKeCid(cid));
            dynamicInfo.setImgs(listPicture);
            dynamicInfo.setListGoodsBrief(listGoods);
                listPicture.add(goodsPicture);
            }
            ClientTextStyleVO shareMoneyDesc = new ClientTextStyleVO();
            shareMoneyDesc.setColor("#FFFFFF");
            shareMoneyDesc.setBottomColor("#E8AE48");
            shareMoneyDesc.setContent("预估分享奖金:¥" + shareMoney);
            dynamicInfo.setDesc(shareMoneyDesc);
            dynamicInfo.setShowType(2);
            // 组织动态信息
            DynamicInfo dynamicInfo = getDynamicInfo(daTaoKeDetail, classId, subclassId);
            // 无内容
            dynamicInfo.setTitle(new ArrayList<ClientTextStyleVO>());
            // 发布用户
            dynamicInfo.setUser(activityUserService.getRandomByDaTaoKeCid(cid));
            dynamicInfo.setImgs(listPicture);
            dynamicInfo.setListGoodsBrief(listGoods);
            if (count == 4) {
                dynamicInfo.setShowType(DynamicInfo.SHOW_TYPE_TWO);
                dynamicInfo.setShareType(DynamicInfo.SHARE_TYPE_FOUR); // 分享类型4图
            } else {
                dynamicInfo.setShowType(DynamicInfo.SHOW_TYPE_THREE);
                dynamicInfo.setShareType(DynamicInfo.SHARE_TYPE_NINE); // 分享类型9图
            }
            // 保存信息
            dynamicInfoDao.insert(dynamicInfo);
            ClientTextStyleVO shareMoneyDesc = new ClientTextStyleVO();
            shareMoneyDesc.setColor("#FFFFFF");
            shareMoneyDesc.setBottomColor("#E8AE48");
            shareMoneyDesc.setContent("预估分享奖金:¥" + shareMoney);
            dynamicInfo.setDesc(shareMoneyDesc);
            dynamicInfo.setShowType(2);
        } catch (Exception e) {
            try {
                LogHelper.errorDetailInfo(e);
            } catch (Exception e1) {
                e1.printStackTrace();
            }
        }
    }
            if (count == 4) {
                dynamicInfo.setShowType(DynamicInfo.SHOW_TYPE_TWO);
                dynamicInfo.setShareType(DynamicInfo.SHARE_TYPE_FOUR); // 分享类型4图
            } else {
                dynamicInfo.setShowType(DynamicInfo.SHOW_TYPE_THREE);
                dynamicInfo.setShareType(DynamicInfo.SHARE_TYPE_NINE); // 分享类型9图
            }
            // 保存信息
            dynamicInfoDao.insert(dynamicInfo);
    // 定时插入
    @Override
    public void insertTimeHotSale() {
        Long classId = 1L;
        try {
            for (int i = 0; i < 3; i++) {
                boolean addSuccess = saveHotSale(classId, 0L);
                if (addSuccess) {
                    break;
                }
            }
        } catch (Exception e) {
            try {
                LogHelper.errorDetailInfo(e);
            } catch (Exception e1) {
                e1.printStackTrace();
            }
        }
        } catch (Exception e) {
            try {
                LogHelper.errorDetailInfo(e);
            } catch (Exception e1) {
                e1.printStackTrace();
            }
        }
    }
        // 热销单品的分类
        List<GoodsClass> list = DaTaoKeUtil.goodsClasses;
        for (GoodsClass goodsClass : list) {
            try {
                for (int i = 0; i < 3; i++) {
                    boolean addSuccess = saveHotSale(classId, goodsClass.getId());
                    if (addSuccess) {
                        break;
                    }
                }
            } catch (Exception e) {
                try {
                    LogHelper.errorDetailInfo(e);
                } catch (Exception e1) {
                    e1.printStackTrace();
                }
            }
        }
    }
    // 定时插入
    @Override
    public void insertTimeHotSale() {
        Long classId = 1L;
        try {
            for (int i = 0; i < 3; i++) {
                boolean addSuccess = saveHotSale(classId, 0L);
                if (addSuccess) {
                    break;
                }
            }
        } catch (Exception e) {
            try {
                LogHelper.errorDetailInfo(e);
            } catch (Exception e1) {
                e1.printStackTrace();
            }
        }
    /**
     * 保存热销单品
     *
     * @param classId
     * @param subclassId
     * @throws TaobaoGoodsDownException
     */
    public boolean saveHotSale(Long classId, Long subclassId) throws TaobaoGoodsDownException {
        boolean addSuccess = false;
        List<Long> listId = null;
        List<DynamicInfo> listInfo = dynamicInfoDao.query(classId, subclassId);
        if (listInfo != null && listInfo.size() > 0) {
            listId = new ArrayList<Long>();
            for (DynamicInfo dynamicInfo : listInfo) {
                Long daTaoKeId = dynamicInfo.getDaTaoKeId();
                if (daTaoKeId != null) {
                    listId.add(dynamicInfo.getDaTaoKeId());
                }
            }
        }
        // 大淘客数据
        DaTaoKeDetailV2 daTaoKe = daTaoKeGoodsDetailV2Service.getGoodsNotInList(subclassId, listId, 1).get(0);
        if (daTaoKe == null) {
            return addSuccess;
        }
        // 热销单品的分类
        List<GoodsClass> list = DaTaoKeUtil.goodsClasses;
        for (GoodsClass goodsClass : list) {
            try {
                for (int i = 0; i < 3; i++) {
                    boolean addSuccess = saveHotSale(classId, goodsClass.getId());
                    if (addSuccess) {
                        break;
                    }
                }
            } catch (Exception e) {
                try {
                    LogHelper.errorDetailInfo(e);
                } catch (Exception e1) {
                    e1.printStackTrace();
                }
            }
        }
    }
        try {
            daTaoKe = DaTaoKeUtil.filterDaTaoKe(TaoKeApiUtil.searchGoodsDetail(daTaoKe.getGoodsId()), daTaoKe);
        } catch (Exception e) {
    /**
     * 保存热销单品
     *
     * @param classId
     * @param subclassId
     * @throws TaobaoGoodsDownException
     */
    public boolean saveHotSale(Long classId, Long subclassId) throws TaobaoGoodsDownException {
        boolean addSuccess = false;
        List<Long> listId = null;
        List<DynamicInfo> listInfo = dynamicInfoDao.query(classId, subclassId);
        if (listInfo != null && listInfo.size() > 0) {
            listId = new ArrayList<Long>();
            for (DynamicInfo dynamicInfo : listInfo) {
                Long daTaoKeId = dynamicInfo.getDaTaoKeId();
                if (daTaoKeId != null) {
                    listId.add(dynamicInfo.getDaTaoKeId());
                }
            }
        }
        // 大淘客数据
        DaTaoKeDetailV2 daTaoKe = daTaoKeGoodsDetailV2Service.getGoodsNotInList(subclassId, listId, 1).get(0);
        if (daTaoKe == null) {
            return addSuccess;
        }
        }
        try {
            daTaoKe = DaTaoKeUtil.filterDaTaoKe(TaoKeApiUtil.searchGoodsDetail(daTaoKe.getGoodsId()), daTaoKe);
        } catch (Exception e) {
        TaoBaoGoodsBrief taoBaoGoodsBrief = TaoBaoUtil.convert(daTaoKe);
        BigDecimal proportion = hongBaoManageService.getFanLiRate(SystemEnum.blks);
        TaoBaoGoodsBriefExtra goodsExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(),
                null);
        }
        if (!goodsExtra.isCoupon() || (goodsExtra.getState() != null && goodsExtra.getState() == 1)) {
            return addSuccess; // 已下架 、无券 不加入
        }
        TaoBaoGoodsBrief taoBaoGoodsBrief = TaoBaoUtil.convert(daTaoKe);
        BigDecimal proportion = hongBaoManageService.getFanLiRate(SystemEnum.blks);
        TaoBaoGoodsBriefExtra goodsExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(),
                null);
        List<TaoBaoGoodsBrief> listGoods = new ArrayList<TaoBaoGoodsBrief>();
        listGoods.add(taoBaoGoodsBrief);
        if (!goodsExtra.isCoupon() || (goodsExtra.getState() != null && goodsExtra.getState() == 1)) {
            return addSuccess; // 已下架 、无券 不加入
        }
        goodsExtra.setTkRate(taoBaoGoodsBrief.getTkRate());
        goodsExtra.setUpdatetime(new Date());
        goodsExtra.setCouponInfo(null);
        List<TaoBaoGoodsBrief> listGoods = new ArrayList<TaoBaoGoodsBrief>();
        listGoods.add(taoBaoGoodsBrief);
        GoodsPicture goodsPicture = getGoodsPicture(daTaoKe);
        goodsPicture.setGoods(goodsExtra);
        // 商品列表
        List<GoodsPicture> listPicture = new ArrayList<GoodsPicture>();
        listPicture.add(goodsPicture);
        goodsExtra.setTkRate(taoBaoGoodsBrief.getTkRate());
        goodsExtra.setUpdatetime(new Date());
        goodsExtra.setCouponInfo(null);
        // 获取商品列表图片
        TaoBaoGoodsBrief taoBaoGoodsBrief2 = TaoKeApiUtil.getSimpleGoodsInfo(daTaoKe.getGoodsId());
        List<String> imgList = taoBaoGoodsBrief2.getImgList();
        List<String> listimgs = new ArrayList<String>();
        String pic = daTaoKe.getMainPic();
        listimgs.add(TbImgUtil.getTBSize320Img(pic));
        if (imgList != null && imgList.size() > 0) {
            for (String img : imgList) {
        GoodsPicture goodsPicture = getGoodsPicture(daTaoKe, SystemEnum.blks);
        goodsPicture.setGoods(goodsExtra);
        // 商品列表
        List<GoodsPicture> listPicture = new ArrayList<GoodsPicture>();
        listPicture.add(goodsPicture);
                if (listPicture.size() >= 4) {
                    break;
                }
                if (pic.equals(img)) {
                    continue;
                }
        // 获取商品列表图片
        TaoBaoGoodsBrief taoBaoGoodsBrief2 = TaoKeApiUtil.getSimpleGoodsInfo(daTaoKe.getGoodsId());
        List<String> imgList = taoBaoGoodsBrief2.getImgList();
        List<String> listimgs = new ArrayList<String>();
        String pic = daTaoKe.getMainPic();
        listimgs.add(TbImgUtil.getTBSize320Img(pic));
        if (imgList != null && imgList.size() > 0) {
            for (String img : imgList) {
                listimgs.add(img);
                GoodsPicture picture = new GoodsPicture();
                picture.setH(100);
                picture.setW(100);
                picture.setUrl(TbImgUtil.getTBSize320Img(img));
                listPicture.add(picture);
            }
        }
        goodsExtra.setImgList(imgList);
                if (listPicture.size() >= 4) {
                    break;
                }
                if (pic.equals(img)) {
                    continue;
                }
        // 分享奖金
        BigDecimal shareMoney = taoBaoGoodsBriefService.getShareGoodsUserHongBao(taoBaoGoodsBrief,SystemEnum.blks);
        ClientTextStyleVO shareMoneyDesc = new ClientTextStyleVO();
        shareMoneyDesc.setColor("#FFFFFF");
        shareMoneyDesc.setBottomColor("#E8AE48");
        shareMoneyDesc.setContent("预估分享奖金:¥" + shareMoney);
                listimgs.add(img);
                GoodsPicture picture = new GoodsPicture();
                picture.setH(100);
                picture.setW(100);
                picture.setUrl(TbImgUtil.getTBSize320Img(img));
                listPicture.add(picture);
            }
        }
        goodsExtra.setImgList(imgList);
        // 组织动态信息
        DynamicInfo dynamicInfo = getDynamicInfo(daTaoKe, classId, subclassId);
        dynamicInfo.setUser(activityUserService.getRandomByDaTaoKeCid(daTaoKe.getCid()));
        dynamicInfo.setImgs(listPicture);
        dynamicInfo.setDesc(shareMoneyDesc);
        dynamicInfo.setShareType(DynamicInfo.SHARE_TYPE_ONE);
        dynamicInfo.setShowType(DynamicInfo.SHOW_TYPE_TWO);
        dynamicInfo.setListGoodsBrief(listGoods);
        // 分享奖金
        BigDecimal shareMoney = taoBaoGoodsBriefService.getShareGoodsUserHongBao(taoBaoGoodsBrief, SystemEnum.blks);
        ClientTextStyleVO shareMoneyDesc = new ClientTextStyleVO();
        shareMoneyDesc.setColor("#FFFFFF");
        shareMoneyDesc.setBottomColor("#E8AE48");
        shareMoneyDesc.setContent("预估分享奖金:¥" + shareMoney);
        String desc = DaTaoKeUtil.getDesc(daTaoKe);
        if (!StringUtil.isNullOrEmpty(desc)) {
            int index = desc.lastIndexOf("\n");
            String newDesc = desc.substring(index + 1);
            if (StringUtil.isNullOrEmpty(newDesc)) {
                desc = desc.substring(0, index);
            }
        }
        dynamicInfo.setTitle(convertIntroduce(desc));
        // 组织动态信息
        DynamicInfo dynamicInfo = getDynamicInfo(daTaoKe, classId, subclassId);
        dynamicInfo.setUser(activityUserService.getRandomByDaTaoKeCid(daTaoKe.getCid()));
        dynamicInfo.setImgs(listPicture);
        dynamicInfo.setDesc(shareMoneyDesc);
        dynamicInfo.setShareType(DynamicInfo.SHARE_TYPE_ONE);
        dynamicInfo.setShowType(DynamicInfo.SHOW_TYPE_TWO);
        dynamicInfo.setListGoodsBrief(listGoods);
        // 保存信息
        dynamicInfoDao.insert(dynamicInfo);
        addSuccess = true;
        return addSuccess;
    }
        String desc = DaTaoKeUtil.getDesc(daTaoKe);
        if (!StringUtil.isNullOrEmpty(desc)) {
            int index = desc.lastIndexOf("\n");
            String newDesc = desc.substring(index + 1);
            if (StringUtil.isNullOrEmpty(newDesc)) {
                desc = desc.substring(0, index);
            }
        }
        dynamicInfo.setTitle(convertIntroduce(desc));
    /**
     * 数据组织存入MongoDB中
     *
     * @param daTaoKe
     * @param classId
     * @param subclassId
     * @throws TaobaoGoodsDownException
     */
    public DynamicInfo getDynamicInfo(DaTaoKeDetailV2 daTaoKe, Long classId, Long subclassId) {
        DynamicInfo dynamicInfo = new DynamicInfo();
        dynamicInfo.setId(UUID.randomUUID().toString().replace("-", ""));
        dynamicInfo.setClassId(classId);
        dynamicInfo.setSubclassId(subclassId);
        dynamicInfo.setDaTaoKeId(daTaoKe.getId());
        dynamicInfo.setCreateTime(DateUtil.reduceRandomMinute(new Date(), 8));
        dynamicInfo.setUpdateTime(new Date());
        // 随机分享次数
        dynamicInfo.setShareCount(1000 + (int) (Math.random() * 8000));
        // 保存信息
        dynamicInfoDao.insert(dynamicInfo);
        return dynamicInfo;
    }
        addSuccess = true;
        return addSuccess;
    }
    /**
     * 文字内容
     *
     * @param introduce
     * @return
     */
    public List<ClientTextStyleVO> convertIntroduce(String introduce) {
        List<ClientTextStyleVO> title = new ArrayList<ClientTextStyleVO>();
        ClientTextStyleVO desc = new ClientTextStyleVO();
        desc.setColor("#333333");
        desc.setContent(introduce);
        title.add(desc);
        return title;
    }
    /**
     * 数据组织存入MongoDB中
     *
     * @param daTaoKe
     * @param classId
     * @param subclassId
     * @throws TaobaoGoodsDownException
     */
    public DynamicInfo getDynamicInfo(DaTaoKeDetailV2 daTaoKe, Long classId, Long subclassId) {
        DynamicInfo dynamicInfo = new DynamicInfo();
        dynamicInfo.setId(UUID.randomUUID().toString().replace("-", ""));
        dynamicInfo.setClassId(classId);
        dynamicInfo.setSubclassId(subclassId);
        dynamicInfo.setDaTaoKeId(daTaoKe.getId());
        dynamicInfo.setCreateTime(DateUtil.reduceRandomMinute(new Date(), 8));
        dynamicInfo.setUpdateTime(new Date());
        // 随机分享次数
        dynamicInfo.setShareCount(1000 + (int) (Math.random() * 8000));
    /**
     * 图片列表
     *
     * @param daTaoKe
     * @return
     */
    public GoodsPicture getGoodsPicture(DaTaoKeDetailV2 daTaoKe) {
        GoodsPicture goodsPicture = new GoodsPicture();
        goodsPicture.setH(100);
        goodsPicture.setW(100);
        goodsPicture.setUrl(TbImgUtil.getTBSize320Img(daTaoKe.getMainPic()));
        goodsPicture.setJumpDetail(jumpDetailV2Service.getByTypeCache("goodsdetail"));
        return dynamicInfo;
    }
        String goodsId = daTaoKe.getGoodsId().toString();
        JSONObject item = new JSONObject();
        item.put("id", goodsId);
        item.put("from", "dynamics");
        goodsPicture.setParams(item.toString());
        return goodsPicture;
    }
    /**
     * 文字内容
     *
     * @param introduce
     * @return
     */
    public List<ClientTextStyleVO> convertIntroduce(String introduce) {
        List<ClientTextStyleVO> title = new ArrayList<ClientTextStyleVO>();
        ClientTextStyleVO desc = new ClientTextStyleVO();
        desc.setColor("#333333");
        desc.setContent(introduce);
        title.add(desc);
        return title;
    }
    @Override
    public void insertInviteActivity(RecommendActivity activity) throws Exception {
    /**
     * 图片列表
     *
     * @param daTaoKe
     * @return
     */
    public GoodsPicture getGoodsPicture(DaTaoKeDetailV2 daTaoKe, SystemEnum system) {
        GoodsPicture goodsPicture = new GoodsPicture();
        goodsPicture.setH(100);
        goodsPicture.setW(100);
        goodsPicture.setUrl(TbImgUtil.getTBSize320Img(daTaoKe.getMainPic()));
        goodsPicture.setJumpDetail(jumpDetailV2Service.getByTypeCache("goodsdetail", system));
        String title = activity.getTitle();
        String goodsId = daTaoKe.getGoodsId().toString();
        JSONObject item = new JSONObject();
        item.put("id", goodsId);
        item.put("from", "dynamics");
        goodsPicture.setParams(item.toString());
        return goodsPicture;
    }
        String picUrl = null;
        List<String> imageList = activity.getImageList();
        if (imageList != null && imageList.size() > 0) {
            picUrl = imageList.get(0);
        }
    @Override
    public void insertInviteActivity(RecommendActivity activity) throws Exception {
        if (StringUtil.isNullOrEmpty(title) || StringUtil.isNullOrEmpty(picUrl)) {
            return;
        }
        String title = activity.getTitle();
        // 判断是否已存在
        String dynamicInfoId = null;
        String picUrl = null;
        List<String> imageList = activity.getImageList();
        if (imageList != null && imageList.size() > 0) {
            picUrl = imageList.get(0);
        }
        Long activityId = activity.getId();
        DynamicInfo dynamicVO = dynamicInfoDao.getByActivityId(activityId);
        if (dynamicVO == null) {
            dynamicVO = new DynamicInfo();
            dynamicVO.setId(UUID.randomUUID().toString().replace("-", ""));
            dynamicVO.setCreateTime(DateUtil.reduceRandomMinute(new Date(), 8));
        } else {
            dynamicInfoId = dynamicVO.getId();
        }
        if (StringUtil.isNullOrEmpty(title) || StringUtil.isNullOrEmpty(picUrl)) {
            return;
        }
        // 判断是否已存在
        String dynamicInfoId = null;
        Long activityId = activity.getId();
        DynamicInfo dynamicVO = dynamicInfoDao.getByActivityId(activityId);
        if (dynamicVO == null) {
            dynamicVO = new DynamicInfo();
            dynamicVO.setId(UUID.randomUUID().toString().replace("-", ""));
            dynamicVO.setCreateTime(DateUtil.reduceRandomMinute(new Date(), 8));
        } else {
            dynamicInfoId = dynamicVO.getId();
        }
        if (!StringUtil.isNullOrEmpty(title)) {
            title = title.replaceAll("<p>", "").replaceAll("</p>", "").replaceAll("<br>", "\n");
            int index = title.lastIndexOf("\n");
            String newDesc = title.substring(index + 1);
            if (StringUtil.isNullOrEmpty(newDesc)) {
                title = title.substring(0, index);
            }
        if (!StringUtil.isNullOrEmpty(title)) {
            title = title.replaceAll("<p>", "").replaceAll("</p>", "").replaceAll("<br>", "\n");
            title = title.replaceAll("\\,", "\\,").replaceAll("\\.", "\\。").replaceAll("\\;", "\\;")
                    .replaceAll("\\!", "\\!").replaceAll("\\?", "\\?").replaceAll("\\:", "\\:");
        }
            int index = title.lastIndexOf("\n");
            String newDesc = title.substring(index + 1);
            if (StringUtil.isNullOrEmpty(newDesc)) {
                title = title.substring(0, index);
            }
        dynamicVO.setId(UUID.randomUUID().toString().replace("-", ""));
        dynamicVO.setActivityId(activityId);
        dynamicVO.setClassId(4L);
        dynamicVO.setSubclassId(0L);
        dynamicVO.setShareType(DynamicInfo.SHARE_TYPE_INVITE);
        dynamicVO.setUpdateTime(new Date());
            title = title.replaceAll("\\,", "\\,").replaceAll("\\.", "\\。").replaceAll("\\;", "\\;")
                    .replaceAll("\\!", "\\!").replaceAll("\\?", "\\?").replaceAll("\\:", "\\:");
        }
        Integer shareCount = activity.getShareCount();
        if (shareCount == null || shareCount <= 0) {
            dynamicVO.setShareCount(1000 + (int) (Math.random() * 8000));
        } else {
            dynamicVO.setShareCount(shareCount);
        }
        dynamicVO.setId(UUID.randomUUID().toString().replace("-", ""));
        dynamicVO.setActivityId(activityId);
        dynamicVO.setClassId(4L);
        dynamicVO.setSubclassId(0L);
        dynamicVO.setShareType(DynamicInfo.SHARE_TYPE_INVITE);
        dynamicVO.setUpdateTime(new Date());
        // 发布用户
        ActivityUser activityUser = activity.getActivityUser();
        if (activityUser == null) {
            dynamicVO.setUser(activityUserService.selectByPrimaryKey(2L));
        } else {
            dynamicVO.setUser(activityUser);
        }
        Integer shareCount = activity.getShareCount();
        if (shareCount == null || shareCount <= 0) {
            dynamicVO.setShareCount(1000 + (int) (Math.random() * 8000));
        } else {
            dynamicVO.setShareCount(shareCount);
        }
        // 介绍内容
        List<ClientTextStyleVO> listtitle = new ArrayList<ClientTextStyleVO>();
        if (!StringUtil.isNullOrEmpty(title)) {
            ClientTextStyleVO row1 = new ClientTextStyleVO();
            row1.setColor("#333333");
            row1.setContent(title);
            listtitle.add(row1);
        }
        // 发布用户
        ActivityUser activityUser = activity.getActivityUser();
        if (activityUser == null) {
            dynamicVO.setUser(activityUserService.selectByPrimaryKey(2L));
        } else {
            dynamicVO.setUser(activityUser);
        }
        // 图片
        List<GoodsPicture> listImg = new ArrayList<GoodsPicture>();
        if (StringUtil.isNullOrEmpty(picUrl)) {
            dynamicVO.setShowType(DynamicInfo.SHOW_TYPE_ZERO);
        } else {
            dynamicVO.setShowType(DynamicInfo.SHOW_TYPE_ONE);
            RecommendActivityInviteInfo inviteInfo = activity.getInviteInfo();
        // 介绍内容
        List<ClientTextStyleVO> listtitle = new ArrayList<ClientTextStyleVO>();
        if (!StringUtil.isNullOrEmpty(title)) {
            ClientTextStyleVO row1 = new ClientTextStyleVO();
            row1.setColor("#333333");
            row1.setContent(title);
            listtitle.add(row1);
        }
            Integer pX = null;
            Integer pY = null;
            Integer size = null;
            if (inviteInfo != null) {
                pX = inviteInfo.getPx();
                pY = inviteInfo.getPy();
                size = inviteInfo.getSize();
            }
        // 图片
        List<GoodsPicture> listImg = new ArrayList<GoodsPicture>();
        if (StringUtil.isNullOrEmpty(picUrl)) {
            dynamicVO.setShowType(DynamicInfo.SHOW_TYPE_ZERO);
        } else {
            dynamicVO.setShowType(DynamicInfo.SHOW_TYPE_ONE);
            RecommendActivityInviteInfo inviteInfo = activity.getInviteInfo();
            InputStream asInputStream = HttpUtil.getAsInputStream(picUrl);
            Integer pX = null;
            Integer pY = null;
            Integer size = null;
            if (inviteInfo != null) {
                pX = inviteInfo.getPx();
                pY = inviteInfo.getPy();
                size = inviteInfo.getSize();
            }
            int index = picUrl.lastIndexOf("/");
            String newUrl = picUrl.substring(index + 1);
            String urlMd5 = newUrl.substring(0, newUrl.lastIndexOf("."));
            InputStream asInputStream = HttpUtil.getAsInputStream(picUrl);
            int index = picUrl.lastIndexOf("/");
            String newUrl = picUrl.substring(index + 1);
            String urlMd5 = newUrl.substring(0, newUrl.lastIndexOf("."));
            // 图片
            String imgLink = qrCodeService.drawInviteQrCodeNew(asInputStream, urlMd5, null, null, pX, pY, size, null);
            GoodsPicture p2 = new GoodsPicture();
            p2.setW(100);
            p2.setH(100);
            p2.setUrl(imgLink);
            p2.setUrlOriginal(picUrl);
            p2.setPx(pX);
            p2.setPy(pY);
            p2.setSize(size);
            // 图片
            String imgLink = qrCodeService.drawInviteQrCodeNew(asInputStream, urlMd5, null, null, pX, pY, size, null);
            GoodsPicture p2 = new GoodsPicture();
            p2.setW(100);
            p2.setH(100);
            p2.setUrl(imgLink);
            p2.setUrlOriginal(picUrl);
            p2.setPx(pX);
            p2.setPy(pY);
            p2.setSize(size);
            listImg.add(p2);
        }
            listImg.add(p2);
        }
        dynamicVO.setImgs(listImg);
        dynamicVO.setTitle(listtitle);
        dynamicVO.setImgs(listImg);
        dynamicVO.setTitle(listtitle);
        if (!StringUtil.isNullOrEmpty(dynamicInfoId)) {
            dynamicInfoDao.deleteById(dynamicInfoId);
        }
        if (!StringUtil.isNullOrEmpty(dynamicInfoId)) {
            dynamicInfoDao.deleteById(dynamicInfoId);
        }
        dynamicInfoDao.insert(dynamicVO);
    }
        dynamicInfoDao.insert(dynamicVO);
    }
    @Override
    public void insertActivityRecommend(RecommendActivity activity) {
        if (activity == null || activity.getGoodsList() == null) {
            return;
        }
    @Override
    public void insertActivityRecommend(RecommendActivity activity) {
        if (activity == null || activity.getGoodsList() == null) {
            return;
        }
        try {
            String dynamicInfoId = null;
            DynamicInfo dynamicInfo = dynamicInfoDao.getByActivityId(activity.getId());
            if (dynamicInfo == null) {
                dynamicInfo = new DynamicInfo();
                dynamicInfo.setId(UUID.randomUUID().toString().replace("-", ""));
                dynamicInfo.setCreateTime(new Date());
            } else {
                dynamicInfoId = dynamicInfo.getId();
            }
        try {
            String dynamicInfoId = null;
            DynamicInfo dynamicInfo = dynamicInfoDao.getByActivityId(activity.getId());
            if (dynamicInfo == null) {
                dynamicInfo = new DynamicInfo();
                dynamicInfo.setId(UUID.randomUUID().toString().replace("-", ""));
                dynamicInfo.setCreateTime(new Date());
            } else {
                dynamicInfoId = dynamicInfo.getId();
            }
            dynamicInfo.setClassId(2L);
            dynamicInfo.setSubclassId(0L);
            dynamicInfo.setUser(activity.getActivityUser());
            dynamicInfo.setActivityId(activity.getId());
            dynamicInfo.setUpdateTime(new Date());
            dynamicInfo.setClassId(2L);
            dynamicInfo.setSubclassId(0L);
            dynamicInfo.setUser(activity.getActivityUser());
            dynamicInfo.setActivityId(activity.getId());
            dynamicInfo.setUpdateTime(new Date());
            List<ClientTextStyleVO> listtitle = new ArrayList<ClientTextStyleVO>();
            String title = activity.getTitle();
            if (!StringUtil.isNullOrEmpty(title)) {
                title = title.replaceAll("<p>", "");
                title = title.replaceAll("</p>", "");
                title = title.replaceAll("<br>", "\n");
            List<ClientTextStyleVO> listtitle = new ArrayList<ClientTextStyleVO>();
            String title = activity.getTitle();
            if (!StringUtil.isNullOrEmpty(title)) {
                title = title.replaceAll("<p>", "");
                title = title.replaceAll("</p>", "");
                title = title.replaceAll("<br>", "\n");
                int index = title.lastIndexOf("\n");
                String newDesc = title.substring(index + 1);
                if (StringUtil.isNullOrEmpty(newDesc)) {
                    title = title.substring(0, index);
                }
                int index = title.lastIndexOf("\n");
                String newDesc = title.substring(index + 1);
                if (StringUtil.isNullOrEmpty(newDesc)) {
                    title = title.substring(0, index);
                }
                ClientTextStyleVO row1 = new ClientTextStyleVO();
                row1.setColor("#333333");
                row1.setContent(title);
                listtitle.add(row1);
            }
            dynamicInfo.setTitle(listtitle);
                ClientTextStyleVO row1 = new ClientTextStyleVO();
                row1.setColor("#333333");
                row1.setContent(title);
                listtitle.add(row1);
            }
            dynamicInfo.setTitle(listtitle);
            Integer shareCount = activity.getShareCount();
            if (shareCount == null || shareCount <= 0) {
                dynamicInfo.setShareCount(1000 + (int) (Math.random() * 8000));
            } else {
                dynamicInfo.setShareCount(shareCount);
            }
            Integer shareCount = activity.getShareCount();
            if (shareCount == null || shareCount <= 0) {
                dynamicInfo.setShareCount(1000 + (int) (Math.random() * 8000));
            } else {
                dynamicInfo.setShareCount(shareCount);
            }
            // 发布用户
            ActivityUser activityUser = activity.getActivityUser();
            if (activityUser == null) {
                dynamicInfo.setUser(activityUserService.selectByPrimaryKey(2L));
            } else {
                dynamicInfo.setUser(activityUser);
            }
            // 发布用户
            ActivityUser activityUser = activity.getActivityUser();
            if (activityUser == null) {
                dynamicInfo.setUser(activityUserService.selectByPrimaryKey(2L));
            } else {
                dynamicInfo.setUser(activityUser);
            }
            List<TaoBaoGoodsBrief> listGoods = new ArrayList<TaoBaoGoodsBrief>();
            // 商品列表
            List<GoodsPicture> listPicture = new ArrayList<GoodsPicture>();
            BigDecimal proportion = hongBaoManageService.getFanLiRate(SystemEnum.blks);
            // 分享奖金
            BigDecimal shareMoney = new BigDecimal(0);
            List<TaoBaoGoodsBrief> listGoods = new ArrayList<TaoBaoGoodsBrief>();
            // 商品列表
            List<GoodsPicture> listPicture = new ArrayList<GoodsPicture>();
            BigDecimal proportion = hongBaoManageService.getFanLiRate(SystemEnum.blks);
            // 分享奖金
            BigDecimal shareMoney = new BigDecimal(0);
            if (activity.getGoodsList() != null) {
                for (RecommendActivityTaoBaoGoods activityGoods : activity.getGoodsList()) {
            if (activity.getGoodsList() != null) {
                for (RecommendActivityTaoBaoGoods activityGoods : activity.getGoodsList()) {
                    TaoBaoGoodsBrief taoBaoGoodsBrief = null;
                    TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = null;
                    String auctionId = activityGoods.getAuctionId();
                    try {
                        taoBaoGoodsBrief = redisManager.getTaoBaoGoodsBrief(Long.parseLong(auctionId));
                    TaoBaoGoodsBrief taoBaoGoodsBrief = null;
                    TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = null;
                    String auctionId = activityGoods.getAuctionId();
                    try {
                        taoBaoGoodsBrief = redisManager.getTaoBaoGoodsBrief(Long.parseLong(auctionId));
                        taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief,
                                proportion.toString(), null);
                        if (!taoBaoGoodsBriefExtra.isCoupon()) {
                            taoBaoGoodsBriefExtra.setState(1);
                        }
                        taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief,
                                proportion.toString(), null);
                        if (!taoBaoGoodsBriefExtra.isCoupon()) {
                            taoBaoGoodsBriefExtra.setState(1);
                        }
                        BigDecimal money = taoBaoGoodsBriefService.getShareGoodsUserHongBao(taoBaoGoodsBrief,SystemEnum.blks);
                        shareMoney = MoneyBigDecimalUtil.add(shareMoney, money);
                    } catch (TaobaoGoodsDownException e) {
                        taoBaoGoodsBrief = activityGoods.getTaoBaoGoodsBrief();
                        taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief,
                                proportion.toString(), null);
                        taoBaoGoodsBriefExtra.setState(1);
                        taoBaoGoodsBriefExtra.setCoupon(false);
                    }
                    listGoods.add(taoBaoGoodsBrief);
                        BigDecimal money = taoBaoGoodsBriefService.getShareGoodsUserHongBao(taoBaoGoodsBrief, SystemEnum.blks);
                        shareMoney = MoneyBigDecimalUtil.add(shareMoney, money);
                    } catch (TaobaoGoodsDownException e) {
                        taoBaoGoodsBrief = activityGoods.getTaoBaoGoodsBrief();
                        taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief,
                                proportion.toString(), null);
                        taoBaoGoodsBriefExtra.setState(1);
                        taoBaoGoodsBriefExtra.setCoupon(false);
                    }
                    listGoods.add(taoBaoGoodsBrief);
                    // 商品图片
                    taoBaoGoodsBriefExtra.setCouponInfo(null);
                    taoBaoGoodsBriefExtra.setUpdatetime(new Date());
                    // 商品图片
                    taoBaoGoodsBriefExtra.setCouponInfo(null);
                    taoBaoGoodsBriefExtra.setUpdatetime(new Date());
                    JSONObject item = new JSONObject();
                    item.put("id", auctionId);
                    item.put("from", "dynamics");
                    JSONObject item = new JSONObject();
                    item.put("id", auctionId);
                    item.put("from", "dynamics");
                    GoodsPicture goodsPicture = new GoodsPicture();
                    goodsPicture.setH(100);
                    goodsPicture.setW(100);
                    goodsPicture.setUrl(TbImgUtil.getTBSize320Img(taoBaoGoodsBrief.getPictUrl()));
                    goodsPicture.setJumpDetail(jumpDetailV2Service.getByTypeCache("goodsdetail"));
                    goodsPicture.setParams(item.toString());
                    goodsPicture.setGoods(taoBaoGoodsBriefExtra);
                    GoodsPicture goodsPicture = new GoodsPicture();
                    goodsPicture.setH(100);
                    goodsPicture.setW(100);
                    goodsPicture.setUrl(TbImgUtil.getTBSize320Img(taoBaoGoodsBrief.getPictUrl()));
                    goodsPicture.setJumpDetail(jumpDetailV2Service.getByTypeCache("goodsdetail", SystemEnum.blks));
                    goodsPicture.setParams(item.toString());
                    goodsPicture.setGoods(taoBaoGoodsBriefExtra);
                    listPicture.add(goodsPicture);
                }
            }
            dynamicInfo.setImgs(listPicture);
            dynamicInfo.setListGoodsBrief(listGoods);
                    listPicture.add(goodsPicture);
                }
            }
            dynamicInfo.setImgs(listPicture);
            dynamicInfo.setListGoodsBrief(listGoods);
            ClientTextStyleVO shareMoneyDesc = new ClientTextStyleVO();
            shareMoneyDesc.setColor("#FFFFFF");
            shareMoneyDesc.setBottomColor("#E8AE48");
            shareMoneyDesc.setContent("预估分享奖金:¥" + shareMoney);
            dynamicInfo.setDesc(shareMoneyDesc);
            dynamicInfo.setShowType(2);
            ClientTextStyleVO shareMoneyDesc = new ClientTextStyleVO();
            shareMoneyDesc.setColor("#FFFFFF");
            shareMoneyDesc.setBottomColor("#E8AE48");
            shareMoneyDesc.setContent("预估分享奖金:¥" + shareMoney);
            dynamicInfo.setDesc(shareMoneyDesc);
            dynamicInfo.setShowType(2);
            if (listPicture.size() < 7) {
                dynamicInfo.setShowType(DynamicInfo.SHOW_TYPE_TWO);
                dynamicInfo.setShareType(DynamicInfo.SHARE_TYPE_FOUR); // 分享类型4图
            } else {
                dynamicInfo.setShowType(DynamicInfo.SHOW_TYPE_THREE);
                dynamicInfo.setShareType(DynamicInfo.SHARE_TYPE_NINE); // 分享类型9图
            }
            if (listPicture.size() < 7) {
                dynamicInfo.setShowType(DynamicInfo.SHOW_TYPE_TWO);
                dynamicInfo.setShareType(DynamicInfo.SHARE_TYPE_FOUR); // 分享类型4图
            } else {
                dynamicInfo.setShowType(DynamicInfo.SHOW_TYPE_THREE);
                dynamicInfo.setShareType(DynamicInfo.SHARE_TYPE_NINE); // 分享类型9图
            }
            if (!StringUtil.isNullOrEmpty(dynamicInfoId)) {
                dynamicInfoDao.deleteById(dynamicInfoId);
            }
            // 保存信息
            dynamicInfoDao.insert(dynamicInfo);
            if (!StringUtil.isNullOrEmpty(dynamicInfoId)) {
                dynamicInfoDao.deleteById(dynamicInfoId);
            }
            // 保存信息
            dynamicInfoDao.insert(dynamicInfo);
        } catch (Exception e) {
            try {
                LogHelper.errorDetailInfo(e);
            } catch (Exception e1) {
                e1.printStackTrace();
            }
        }
    }
        } catch (Exception e) {
            try {
                LogHelper.errorDetailInfo(e);
            } catch (Exception e1) {
                e1.printStackTrace();
            }
        }
    }
    @Override
    public void deleteActivity(Long activityId) {
        DynamicInfo dynamicInfo = dynamicInfoDao.getByActivityId(activityId);
        if (dynamicInfo != null) {
            // 删除之前的
            dynamicInfoDao.deleteById(dynamicInfo.getId());
        }
    }
    @Override
    public void deleteActivity(Long activityId) {
        DynamicInfo dynamicInfo = dynamicInfoDao.getByActivityId(activityId);
        if (dynamicInfo != null) {
            // 删除之前的
            dynamicInfoDao.deleteById(dynamicInfo.getId());
        }
    }
    @Override
    public void removeByDate(Date createTime) {
        dynamicInfoDao.removeByDate(createTime);
    }
    @Override
    public void removeByDate(Date createTime) {
        dynamicInfoDao.removeByDate(createTime);
    }
    @Override
    public void updateShareCount(DynamicInfo record) {
        dynamicInfoDao.updateShareCount(record);
    }
    @Override
    public void updateShareCount(DynamicInfo record) {
        dynamicInfoDao.updateShareCount(record);
    }
    @Override
    @Cacheable(value = "dynamicCache", key = "'count-'+#cid+'-'+#subId")
    public long count(Long cid, Long subId) {
        return dynamicInfoDao.count(cid, subId);
    }
    @Override
    @Cacheable(value = "dynamicCache", key = "'count-'+#cid+'-'+#subId")
    public long count(Long cid, Long subId) {
        return dynamicInfoDao.count(cid, subId);
    }
    @Override
    @Cacheable(value = "dynamicCache", key = "'query-'+#start+'-'+#count+'-'+#cid+'-'+#subId")
    public List<DynamicInfo> query(int start, int count, Long cid, Long subId) {
        List<DynamicInfo> list = dynamicInfoDao.query(start, count, cid, subId);
    @Override
    @Cacheable(value = "dynamicCache", key = "'query-'+#start+'-'+#count+'-'+#cid+'-'+#subId")
    public List<DynamicInfo> query(int start, int count, Long cid, Long subId) {
        List<DynamicInfo> list = dynamicInfoDao.query(start, count, cid, subId);
        // 更新商品信息
        executor.execute(new Runnable() {
            @Override
            public void run() {
                updateGoodInfo(list);
            }
        });
        // 更新商品信息
        executor.execute(new Runnable() {
            @Override
            public void run() {
                updateGoodInfo(list);
            }
        });
        return list;
    }
        return list;
    }
    private Map<Long, TaoBaoGoodsBrief> getFilterGoodsMap(List<DynamicInfo> list) {
        // 提取过滤商品
        List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
        for (DynamicInfo dynamicInfo : list) {
            List<GoodsPicture> gpList = dynamicInfo.getImgs();
            if (gpList != null)
                for (GoodsPicture gp : gpList) {
                    if (gp != null && gp.getGoods() != null) {
                        TaoBaoGoodsBriefExtra newGoods = new TaoBaoGoodsBriefExtra();
                        try {
                            PropertyUtils.copyProperties(newGoods, gp.getGoods());
                            goodsList.add(newGoods);
                        } catch (IllegalAccessException e) {
                            e.printStackTrace();
                        } catch (InvocationTargetException e) {
                            e.printStackTrace();
                        } catch (NoSuchMethodException e) {
                            e.printStackTrace();
                        }
    private Map<Long, TaoBaoGoodsBrief> getFilterGoodsMap(List<DynamicInfo> list) {
        // 提取过滤商品
        List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
        for (DynamicInfo dynamicInfo : list) {
            List<GoodsPicture> gpList = dynamicInfo.getImgs();
            if (gpList != null)
                for (GoodsPicture gp : gpList) {
                    if (gp != null && gp.getGoods() != null) {
                        TaoBaoGoodsBriefExtra newGoods = new TaoBaoGoodsBriefExtra();
                        try {
                            PropertyUtils.copyProperties(newGoods, gp.getGoods());
                            goodsList.add(newGoods);
                        } catch (IllegalAccessException e) {
                            e.printStackTrace();
                        } catch (InvocationTargetException e) {
                            e.printStackTrace();
                        } catch (NoSuchMethodException e) {
                            e.printStackTrace();
                        }
                    }
                }
        }
        goodsList = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(goodsList);
        Map<Long, TaoBaoGoodsBrief> map = new HashMap<>();
        if (goodsList != null)
            for (TaoBaoGoodsBrief goods : goodsList)
                map.put(goods.getAuctionId(), goods);
        return map;
    }
                    }
                }
        }
        goodsList = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(goodsList);
        Map<Long, TaoBaoGoodsBrief> map = new HashMap<>();
        if (goodsList != null)
            for (TaoBaoGoodsBrief goods : goodsList)
                map.put(goods.getAuctionId(), goods);
        return map;
    }
    @Override
    @Cacheable(value = "dynamicCache", key = "'queryV2-'+#platform+'-'+#version+'-'+#start+'-'+#count+'-'+#cid+'-'+#subId")
    public List<DynamicInfo> queryV2(int platform, int version, int start, int count, Long cid, Long subId) {
        List<DynamicInfo> listNew = new ArrayList<DynamicInfo>();
        List<DynamicInfo> list = dynamicInfoDao.query(start, count, cid, subId);
        // 需要更新的商品
        List<TaoBaoGoodsBrief> taoBaoGoodsUpdateList = new ArrayList<>();
        if (list != null && list.size() > 0) {
            // 提取商品
            Map<Long, TaoBaoGoodsBrief> goodsMap = getFilterGoodsMap(list);
    @Override
    @Cacheable(value = "dynamicCache", key = "'queryV2-'+#platform+'-'+#version+'-'+#start+'-'+#count+'-'+#cid+'-'+#subId")
    public List<DynamicInfo> queryV2(int platform, int version, int start, int count, Long cid, Long subId) {
        List<DynamicInfo> listNew = new ArrayList<DynamicInfo>();
        List<DynamicInfo> list = dynamicInfoDao.query(start, count, cid, subId);
        // 需要更新的商品
        List<TaoBaoGoodsBrief> taoBaoGoodsUpdateList = new ArrayList<>();
        if (list != null && list.size() > 0) {
            // 提取商品
            Map<Long, TaoBaoGoodsBrief> goodsMap = getFilterGoodsMap(list);
            BigDecimal fanLiRate = hongBaoManageService.getFanLiRate(SystemEnum.blks);
            BigDecimal shareRate = hongBaoManageService.getShareRate(SystemEnum.blks);
            GoodsMoneyConfigParamsDTO paramsDTO = new GoodsMoneyConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP,SystemEnum.blks));
            BigDecimal fanLiRate = hongBaoManageService.getFanLiRate(SystemEnum.blks);
            BigDecimal shareRate = hongBaoManageService.getShareRate(SystemEnum.blks);
            GoodsMoneyConfigParamsDTO paramsDTO = new GoodsMoneyConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP, SystemEnum.blks));
            for (DynamicInfo dynamicInfo : list) {
                DynamicInfo dynamicNew = new DynamicInfo();
                try {
                    PropertyUtils.copyProperties(dynamicNew, dynamicInfo);
                } catch (Exception e) {
                    e.printStackTrace();
                    continue;
                }
            for (DynamicInfo dynamicInfo : list) {
                DynamicInfo dynamicNew = new DynamicInfo();
                try {
                    PropertyUtils.copyProperties(dynamicNew, dynamicInfo);
                } catch (Exception e) {
                    e.printStackTrace();
                    continue;
                }
                // 店铺信息
                TaoBaoShop shop = dynamicNew.getShop();
                if (shop != null) {
                    TaoBaoShop shopNew = new TaoBaoShop();
                    try {
                        PropertyUtils.copyProperties(shopNew, shop);
                    } catch (Exception e) {
                        e.printStackTrace();
                        continue;
                    }
                    Integer userType = shopNew.getUserType();
                    if (userType == null || userType == 0) {
                        shopNew.setUserType(10);
                    } else {
                        shopNew.setUserType(11);
                    }
                    dynamicNew.setShop(shopNew);
                }
                // 店铺信息
                TaoBaoShop shop = dynamicNew.getShop();
                if (shop != null) {
                    TaoBaoShop shopNew = new TaoBaoShop();
                    try {
                        PropertyUtils.copyProperties(shopNew, shop);
                    } catch (Exception e) {
                        e.printStackTrace();
                        continue;
                    }
                    Integer userType = shopNew.getUserType();
                    if (userType == null || userType == 0) {
                        shopNew.setUserType(10);
                    } else {
                        shopNew.setUserType(11);
                    }
                    dynamicNew.setShop(shopNew);
                }
                List<GoodsPicture> imgsNew = new ArrayList<GoodsPicture>();
                List<GoodsPicture> imgs = dynamicNew.getImgs();
                if (imgs != null && imgs.size() > 0) {
                    for (GoodsPicture goodsPicture : imgs) {
                        TaoBaoGoodsBriefExtra goods = goodsPicture.getGoods();
                        if (goods == null) {
                            imgsNew.add(goodsPicture);
                            continue;
                        }
                List<GoodsPicture> imgsNew = new ArrayList<GoodsPicture>();
                List<GoodsPicture> imgs = dynamicNew.getImgs();
                if (imgs != null && imgs.size() > 0) {
                    for (GoodsPicture goodsPicture : imgs) {
                        TaoBaoGoodsBriefExtra goods = goodsPicture.getGoods();
                        if (goods == null) {
                            imgsNew.add(goodsPicture);
                            continue;
                        }
                        taoBaoGoodsUpdateList.add(goods);
                        taoBaoGoodsUpdateList.add(goods);
                        GoodsPicture goodsNew = new GoodsPicture();
                        try {
                            PropertyUtils.copyProperties(goodsNew, goodsPicture);
                        } catch (Exception e) {
                            e.printStackTrace();
                            continue;
                        }
                        GoodsPicture goodsNew = new GoodsPicture();
                        try {
                            PropertyUtils.copyProperties(goodsNew, goodsPicture);
                        } catch (Exception e) {
                            e.printStackTrace();
                            continue;
                        }
                        // 过滤券信息与资金信息
                        goods.setCouponAmount(goodsMap.get(goods.getAuctionId()).getCouponAmount());
                        goods.setZkPrice(goodsMap.get(goods.getAuctionId()).getZkPrice());
                        goods.setCouponStartFee(goodsMap.get(goods.getAuctionId()).getCouponStartFee());
                        goods.setTkRate(goodsMap.get(goods.getAuctionId()).getTkRate());
                        // 过滤券信息与资金信息
                        goods.setCouponAmount(goodsMap.get(goods.getAuctionId()).getCouponAmount());
                        goods.setZkPrice(goodsMap.get(goods.getAuctionId()).getZkPrice());
                        goods.setCouponStartFee(goodsMap.get(goods.getAuctionId()).getCouponStartFee());
                        goods.setTkRate(goodsMap.get(goods.getAuctionId()).getTkRate());
                        GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBaoGoodsBriefExtra(goods, paramsDTO);
                        GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBaoGoodsBriefExtra(goods, paramsDTO);
                        goodsNew.setGoodsVO(detailVO);
                        goodsNew.setGoods(null);
                        goodsNew.setGoodsVO(detailVO);
                        goodsNew.setGoods(null);
                        JumpDetailV2 jumpDetail = goodsNew.getJumpDetail();
                        if (jumpDetail != null) {
                            JumpDetailV2 jumpDetailV2 = jumpDetailV2Service.getByTypeCache(jumpDetail.getType(),
                                    platform, version);
                            if (jumpDetailV2 != null) {
                                goodsNew.setJumpDetail(jumpDetailV2);
                            }
                        }
                        JumpDetailV2 jumpDetail = goodsNew.getJumpDetail();
                        if (jumpDetail != null) {
                            JumpDetailV2 jumpDetailV2 = jumpDetailV2Service.getByTypeCache(jumpDetail.getType(),
                                    platform, version, SystemEnum.blks);
                            if (jumpDetailV2 != null) {
                                goodsNew.setJumpDetail(jumpDetailV2);
                            }
                        }
                        imgsNew.add(goodsNew);
                    }
                    dynamicNew.setImgs(imgsNew);
                }
                listNew.add(dynamicNew);
            }
        }
                        imgsNew.add(goodsNew);
                    }
                    dynamicNew.setImgs(imgsNew);
                }
                listNew.add(dynamicNew);
            }
        }
        // 更新商品信息
        executor.execute(new Runnable() {
            @Override
            public void run() {
                updateGoodInfo(list);
            }
        });
        // 更新商品信息
        executor.execute(new Runnable() {
            @Override
            public void run() {
                updateGoodInfo(list);
            }
        });
        taoBaoGoodsUpdateService.addUpdateQueueAsync(taoBaoGoodsUpdateList);
        return listNew;
    }
        taoBaoGoodsUpdateService.addUpdateQueueAsync(taoBaoGoodsUpdateList);
        return listNew;
    }
    /**
     * 更新商品信息
     */
    public void updateGoodInfo(List<DynamicInfo> list) {
        if (!Constant.IS_OUTNET) {
            return; // 外网进行更新
        }
    /**
     * 更新商品信息
     */
    public void updateGoodInfo(List<DynamicInfo> list) {
        if (!Constant.IS_OUTNET) {
            return; // 外网进行更新
        }
        if (list == null || list.size() == 0) {
            return;
        }
        if (list == null || list.size() == 0) {
            return;
        }
        try {
            BigDecimal proportion = hongBaoManageService.getFanLiRate(SystemEnum.blks);
            for (DynamicInfo dynamicInfo : list) {
                // 邀请数据不做更新
                long classId = dynamicInfo.getClassId();
                if (classId == 4) {
                    break;
                }
        try {
            BigDecimal proportion = hongBaoManageService.getFanLiRate(SystemEnum.blks);
            for (DynamicInfo dynamicInfo : list) {
                // 邀请数据不做更新
                long classId = dynamicInfo.getClassId();
                if (classId == 4) {
                    break;
                }
                // 更新商品信息
                List<GoodsPicture> listPicture = dynamicInfo.getImgs();
                if (listPicture == null || listPicture.size() == 0) {
                    continue;
                }
                // 更新商品信息
                List<GoodsPicture> listPicture = dynamicInfo.getImgs();
                if (listPicture == null || listPicture.size() == 0) {
                    continue;
                }
                // 是否一个小时之内已更新
                Date updateTime = dynamicInfo.getUpdateTime();
                if (updateTime != null) {
                    long nd = 1000 * 24 * 60 * 60;// 一天的毫秒数
                    long nh = 1000 * 60 * 60;// 一小时的毫秒数
                    long diff = System.currentTimeMillis() - updateTime.getTime();
                    long day = diff / nd;// 计算差多少天
                    long hour = diff % nd / nh + day * 24;// 计算差多少小时
                    if (hour < 1) {
                        continue;
                    }
                }
                // 是否一个小时之内已更新
                Date updateTime = dynamicInfo.getUpdateTime();
                if (updateTime != null) {
                    long nd = 1000 * 24 * 60 * 60;// 一天的毫秒数
                    long nh = 1000 * 60 * 60;// 一小时的毫秒数
                    long diff = System.currentTimeMillis() - updateTime.getTime();
                    long day = diff / nd;// 计算差多少天
                    long hour = diff % nd / nh + day * 24;// 计算差多少小时
                    if (hour < 1) {
                        continue;
                    }
                }
                boolean needUpdate = false;
                // 已下架ID
                List<Long> listDown = new ArrayList<Long>();
                // 商品列表
                List<TaoBaoGoodsBrief> listGoods = new ArrayList<TaoBaoGoodsBrief>();
                boolean needUpdate = false;
                // 已下架ID
                List<Long> listDown = new ArrayList<Long>();
                // 商品列表
                List<TaoBaoGoodsBrief> listGoods = new ArrayList<TaoBaoGoodsBrief>();
                for (GoodsPicture goodsPicture : listPicture) {
                    TaoBaoGoodsBriefExtra oldExtra = goodsPicture.getGoods();
                    if (oldExtra == null) {
                        continue;
                    }
                for (GoodsPicture goodsPicture : listPicture) {
                    TaoBaoGoodsBriefExtra oldExtra = goodsPicture.getGoods();
                    if (oldExtra == null) {
                        continue;
                    }
                    /*
                     * Integer state = oldExtra.getState(); if (state != null && state == 1) {
                     * continue; }
                     */
                    /*
                     * Integer state = oldExtra.getState(); if (state != null && state == 1) {
                     * continue; }
                     */
                    TaoBaoGoodsBrief goodsBrief = null;
                    try {
                        goodsBrief = redisManager.getTaoBaoGoodsBrief(oldExtra.getAuctionId());
                    } catch (TaobaoGoodsDownException e) {
                    }
                    TaoBaoGoodsBrief goodsBrief = null;
                    try {
                        goodsBrief = redisManager.getTaoBaoGoodsBrief(oldExtra.getAuctionId());
                    } catch (TaobaoGoodsDownException e) {
                    }
                    // 是否下架 : 1、商品本身下架 2、无券信息则认为下架
                    boolean isDown = true;
                    // 是否下架 : 1、商品本身下架 2、无券信息则认为下架
                    boolean isDown = true;
                    if (goodsBrief == null) {
                        listDown.add(oldExtra.getAuctionId()); // 下架商品
                    } else if (goodsBrief.getCouponAmount() != null
                            && goodsBrief.getCouponAmount().compareTo(BigDecimal.valueOf(0)) > 0) {
                        isDown = false;
                    }
                    if (goodsBrief == null) {
                        listDown.add(oldExtra.getAuctionId()); // 下架商品
                    } else if (goodsBrief.getCouponAmount() != null
                            && goodsBrief.getCouponAmount().compareTo(BigDecimal.valueOf(0)) > 0) {
                        isDown = false;
                    }
                    if (isDown) {
                        oldExtra.setState(1);
                        oldExtra.setCoupon(false);
                        oldExtra.setUpdatetime(new Date());
                        goodsPicture.setGoods(oldExtra);
                    if (isDown) {
                        oldExtra.setState(1);
                        oldExtra.setCoupon(false);
                        oldExtra.setUpdatetime(new Date());
                        goodsPicture.setGoods(oldExtra);
                        // 商品已抢光
                        goodsPicture.setGoodState(1);
                        // 商品已抢光
                        goodsPicture.setGoodState(1);
                        // 更新热销单品的分享奖金
                        if (classId == 1) {
                            ClientTextStyleVO shareMoneyDesc = new ClientTextStyleVO();
                            shareMoneyDesc.setColor("#FFFFFF");
                            shareMoneyDesc.setBottomColor("#E8AE48");
                            shareMoneyDesc.setContent("预估分享奖金:¥" + new BigDecimal(0));
                            dynamicInfo.setDesc(shareMoneyDesc);
                        }
                    } else {
                        listGoods.add(goodsBrief);
                        // 更新热销单品的分享奖金
                        if (classId == 1) {
                            ClientTextStyleVO shareMoneyDesc = new ClientTextStyleVO();
                            shareMoneyDesc.setColor("#FFFFFF");
                            shareMoneyDesc.setBottomColor("#E8AE48");
                            shareMoneyDesc.setContent("预估分享奖金:¥" + new BigDecimal(0));
                            dynamicInfo.setDesc(shareMoneyDesc);
                        }
                    } else {
                        listGoods.add(goodsBrief);
                        TaoBaoGoodsBriefExtra newExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(goodsBrief,
                                proportion.toString(), null);
                        newExtra.setUpdatetime(new Date());
                        goodsPicture.setGoods(newExtra);
                        TaoBaoGoodsBriefExtra newExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(goodsBrief,
                                proportion.toString(), null);
                        newExtra.setUpdatetime(new Date());
                        goodsPicture.setGoods(newExtra);
                        // 更新热销单品的分享奖金
                        if (classId == 1) {
                            BigDecimal shareMoney = taoBaoGoodsBriefService.getShareGoodsUserHongBao(goodsBrief,SystemEnum.blks);
                            ClientTextStyleVO shareMoneyDesc = new ClientTextStyleVO();
                            shareMoneyDesc.setColor("#FFFFFF");
                            shareMoneyDesc.setBottomColor("#E8AE48");
                            shareMoneyDesc.setContent("预估分享奖金:¥" + shareMoney);
                            dynamicInfo.setDesc(shareMoneyDesc);
                        }
                    }
                        // 更新热销单品的分享奖金
                        if (classId == 1) {
                            BigDecimal shareMoney = taoBaoGoodsBriefService.getShareGoodsUserHongBao(goodsBrief, SystemEnum.blks);
                            ClientTextStyleVO shareMoneyDesc = new ClientTextStyleVO();
                            shareMoneyDesc.setColor("#FFFFFF");
                            shareMoneyDesc.setBottomColor("#E8AE48");
                            shareMoneyDesc.setContent("预估分享奖金:¥" + shareMoney);
                            dynamicInfo.setDesc(shareMoneyDesc);
                        }
                    }
                    // 需要更新信息;
                    needUpdate = true;
                }
                    // 需要更新信息;
                    needUpdate = true;
                }
                // 无效更新信息
                if (!needUpdate) {
                    continue;
                }
                // 无效更新信息
                if (!needUpdate) {
                    continue;
                }
                // 更新商品信息
                dynamicInfo.setImgs(listPicture);
                // 更新商品信息
                dynamicInfo.setImgs(listPicture);
                // 商品已下架
                List<TaoBaoGoodsBrief> listGoodsBrief = dynamicInfo.getListGoodsBrief();
                if (listGoodsBrief != null && listGoodsBrief.size() > 0) {
                    // 淘宝已下架商品
                    if (listDown.size() > 0) {
                        for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) {
                            if (listDown.contains(taoBaoGoodsBrief.getAuctionId())) {
                                taoBaoGoodsBrief.setState(1);
                            }
                        }
                    }
                // 商品已下架
                List<TaoBaoGoodsBrief> listGoodsBrief = dynamicInfo.getListGoodsBrief();
                if (listGoodsBrief != null && listGoodsBrief.size() > 0) {
                    // 淘宝已下架商品
                    if (listDown.size() > 0) {
                        for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) {
                            if (listDown.contains(taoBaoGoodsBrief.getAuctionId())) {
                                taoBaoGoodsBrief.setState(1);
                            }
                        }
                    }
                    if (listGoods.size() == 0) {
                        dynamicInfo.setListGoodsBrief(listGoodsBrief);
                    } else {
                        List<TaoBaoGoodsBrief> listNew = new ArrayList<TaoBaoGoodsBrief>();
                        for (int i = 0; i < listGoodsBrief.size(); i++) {
                            TaoBaoGoodsBrief taoBaoGoodsBrief = listGoodsBrief.get(i);
                            if (taoBaoGoodsBrief.getState() != null && taoBaoGoodsBrief.getState() == 1) {
                                listNew.add(taoBaoGoodsBrief);
                            } else {
                                boolean isUpdate = false;
                                Long auctionId = taoBaoGoodsBrief.getAuctionId();
                                for (TaoBaoGoodsBrief goods : listGoods) {
                                    if (goods.getAuctionId().equals(auctionId) || goods.getAuctionId() == auctionId) {
                                        listNew.add(goods);
                                        isUpdate = true;
                                        break;
                                    }
                                }
                    if (listGoods.size() == 0) {
                        dynamicInfo.setListGoodsBrief(listGoodsBrief);
                    } else {
                        List<TaoBaoGoodsBrief> listNew = new ArrayList<TaoBaoGoodsBrief>();
                        for (int i = 0; i < listGoodsBrief.size(); i++) {
                            TaoBaoGoodsBrief taoBaoGoodsBrief = listGoodsBrief.get(i);
                            if (taoBaoGoodsBrief.getState() != null && taoBaoGoodsBrief.getState() == 1) {
                                listNew.add(taoBaoGoodsBrief);
                            } else {
                                boolean isUpdate = false;
                                Long auctionId = taoBaoGoodsBrief.getAuctionId();
                                for (TaoBaoGoodsBrief goods : listGoods) {
                                    if (goods.getAuctionId().equals(auctionId) || goods.getAuctionId() == auctionId) {
                                        listNew.add(goods);
                                        isUpdate = true;
                                        break;
                                    }
                                }
                                if (!isUpdate) {
                                    listNew.add(taoBaoGoodsBrief);
                                }
                            }
                        }
                        dynamicInfo.setListGoodsBrief(listNew);
                    }
                }
                dynamicInfo.setUpdateTime(new Date());
                dynamicInfoDao.updateGoodInfo(dynamicInfo);
            }
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
                                if (!isUpdate) {
                                    listNew.add(taoBaoGoodsBrief);
                                }
                            }
                        }
                        dynamicInfo.setListGoodsBrief(listNew);
                    }
                }
                dynamicInfo.setUpdateTime(new Date());
                dynamicInfoDao.updateGoodInfo(dynamicInfo);
            }
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java
@@ -2327,7 +2327,7 @@
                        if (goodsBrief != null && goodsBrief.getImgList() != null) {
                            GoodsMoneyConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system);
                            goods = GoodsDetailVOFactory.convertTaoBao(goodsBrief, params);
                            goods = goodsLijinMnager.loadTBMoneyInfo(system, null, goodsBrief, goods);
                            goods = goodsLijinMnager.loadTBMoneyInfo(system, null, goodsBrief, goods,false);
                            for (String img : goodsBrief.getImgList()) {
                                if (!imgSet.contains(img) && imgs.size() < 9) {
                                    imgSet.add(img);
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/FloatADServiceImpl.java
@@ -78,7 +78,7 @@
            throw new FloatADException(1, "类型不能为空");
            
        if (!StringUtil.isNullOrEmpty(jumpType)) {
            List<JumpDetailV2> listByType = jumpDetailV2Service.listByType(jumpType);
            List<JumpDetailV2> listByType = jumpDetailV2Service.listByType(jumpType,record.getSystem());
            if (listByType !=null && listByType.size() > 0) {
                record.setJumpDetail(listByType.get(0));
            } 
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java
@@ -80,7 +80,7 @@
    @Override
    public void saveObject(MultipartFile file, MultipartFile file2, MultipartFile file3, Special record,
            String jumpType, CommonShareInfo shareInfo) throws SpecialException, Exception {
            String jumpType, CommonShareInfo shareInfo,SystemEnum system) throws SpecialException, Exception {
        Long cardId = record.getCardId();
        if (cardId == null) {
@@ -107,7 +107,7 @@
        }
        if (!StringUtil.isNullOrEmpty(jumpType)) {
            List<JumpDetailV2> listByType = jumpDetailV2Service.listByType(jumpType);
            List<JumpDetailV2> listByType = jumpDetailV2Service.listByType(jumpType,system);
            if (listByType != null && listByType.size() > 0) {
                record.setJumpDetail(listByType.get(0));
            }
@@ -553,14 +553,14 @@
        if (listArc != null && VersionUtil.greaterThan_1_5_50(acceptData.getPlatform(), acceptData.getVersion()))
            for (Special s : listArc) {
                if (s.getName().contains("9.9")) {// 9块9
                    s.setJumpDetail(jumpDetailV2Service.getByTypeCache("common_template"));
                    s.setJumpDetail(jumpDetailV2Service.getByTypeCache("common_template",system));
                    JSONObject params = new JSONObject();
                    params.put("key", CommonContentTypeEnum._9k9.name());
                    params.put("title", CommonContentTypeEnum._9k9.getDesc());
                    s.setParams(params.toString());
                } else if (s.getName().contains("自购立减")) {
                    if (hour < 6) {// 0-6点之间不进入自购立减的页面
                        s.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
                        s.setJumpDetail(jumpDetailV2Service.getByTypeCache("web",system));
                        JSONObject params = new JSONObject();
                        params.put("url", configService.getValue(ConfigKeyEnum.tljOwnBuyNogoods.getKey(), SystemInfoUtil.getSystem(acceptData)));
                        s.setParams(params.toString());
@@ -634,7 +634,7 @@
            if (listBlock != null)
                for (int i = 0; i < listBlock.size(); i++) {
                    if ("品牌券".equalsIgnoreCase(listBlock.get(i).getName())) {
                        listBlock.get(i).setJumpDetail(jumpDetailV2Service.getByTypeCache("hot_cakes"));
                        listBlock.get(i).setJumpDetail(jumpDetailV2Service.getByTypeCache("hot_cakes",system));
                    }
                }
@@ -711,7 +711,7 @@
                    specialVO.setComment(comment);
                    specialVO.setParams(params.toString());
                    specialVO.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
                    specialVO.setJumpDetail(jumpDetailV2Service.getByTypeCache("web",system));
                }
                listVo.add(specialVO);
            }
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SwiperPictureServiceImpl.java
@@ -95,7 +95,7 @@
    }
    @Override
    public void saveObject(MultipartFile file, SwiperPicture record, String jumpType, CommonShareInfo shareInfo)
    public void saveObject(MultipartFile file, SwiperPicture record, String jumpType, CommonShareInfo shareInfo,SystemEnum system)
            throws SwiperPictureException, Exception {
        if (record == null) {
            throw new SwiperPictureException(1, "参数不能为空");
@@ -127,7 +127,7 @@
        
        
        if (!StringUtil.isNullOrEmpty(jumpType)) {
            List<JumpDetailV2> listByType = jumpDetailV2Service.listByType(jumpType);
            List<JumpDetailV2> listByType = jumpDetailV2Service.listByType(jumpType,system);
            if (listByType != null && listByType.size() > 0) {
                record.setJumpDetail(listByType.get(0));
            }
@@ -480,7 +480,7 @@
                    
                    bannerVO.setComment(info.getComment());
                    bannerVO.setParams(params.toString());
                    bannerVO.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
                    bannerVO.setJumpDetail(jumpDetailV2Service.getByTypeCache("web",system));
                }
                listVo.add(bannerVO);
            }
fanli/src/main/java/com/yeshi/fanli/service/impl/lable/TaoKeGoodsServiceImpl.java
@@ -341,7 +341,7 @@
        Gson gson2 = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                .excludeFieldsWithoutExposeAnnotation().create();
        List<GoodsDetailVO> voList = goodsLijinMnager.loadTBMoneyInfo(system, null, goodsBriefList, paramsDTO);
        List<GoodsDetailVO> voList = goodsLijinMnager.loadTBMoneyInfo(system, null, goodsBriefList, paramsDTO,false);
        for (GoodsDetailVO vo : voList) {
            re.add(vo);
        }
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgConfigServiceImpl.java
@@ -51,7 +51,7 @@
            dto.setIcon("http://img.flqapp.com/resource/msg/icon_zhushou.png");
            dto.setTitle(Constant.systemCommonConfig.getProjectChineseName() + "小助手");
            dto.setUpdateTime(new Date());
            dto.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
            dto.setJumpDetail(jumpDetailV2Service.getByTypeCache("web",systemEnum));
            Config config = new Config();
            config.setCreatetime(System.currentTimeMillis() + "");
            config.setKey(KEY_ZHUSHOU);
@@ -86,7 +86,7 @@
            dto.setIcon("http://img.flqapp.com/resource/msg/icon_guanxuan.png");
            dto.setTitle("官宣任务");
            dto.setUpdateTime(new Date());
            dto.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
            dto.setJumpDetail(jumpDetailV2Service.getByTypeCache("web",systemEnum));
            Config config = new Config();
            config.setCreatetime(System.currentTimeMillis() + "");
            config.setKey(KEY_GUANXUAN);
fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java
@@ -728,7 +728,7 @@
            Map<String, Object> jump = new HashMap<String, Object>();
            jump.put("type", 1); // 页面跳转
            jump.put("params", jumpLink);
            jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("freeCouponDetail"));
            jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("freeCouponDetail",acceptData.getSystem()));
            Map<String, Object> rewardMap = new HashMap<String, Object>();
            rewardMap.put("text", rewardStyleVO);
@@ -757,7 +757,7 @@
            Map<String, Object> jump = new HashMap<String, Object>();
            jump.put("type", 1); // 1 常规跳转页面
            jump.put("params", jumpLink);
            jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("rewardCouponDetail"));
            jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("rewardCouponDetail",acceptData.getSystem()));
            rewardMap.put("jump", jump);
            order.setRewardDetail(rewardMap);
        }
@@ -782,7 +782,7 @@
            long limitDate = TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME);
            if (downOrderTime > limitDate) {
                // 2.1 开始新版
                rewardCounponLimitTime(order, accountTime);
                rewardCounponLimitTime(order, accountTime,acceptData.getSystem());
            } else if (hasRewardCoupon) {
                // 在2.1新版上线之前订单-存在则显示奖励券可使用
                ClientTextStyleVO rewardStyleVO = new ClientTextStyleVO();
@@ -797,7 +797,7 @@
                Map<String, Object> jump = new HashMap<String, Object>();
                jump.put("type", 2); // 弹框
                jump.put("params", jumpLink);
                jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("rewardCouponDetail"));
                jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("rewardCouponDetail",acceptData.getSystem()));
                Map<String, Object> rewardMap = new HashMap<String, Object>();
                rewardMap.put("text", rewardStyleVO);
@@ -807,7 +807,7 @@
        }
    }
    private void rewardCounponLimitTime(CommonOrderVO order, Date accountTime) throws Exception {
    private void rewardCounponLimitTime(CommonOrderVO order, Date accountTime,SystemEnum system) throws Exception {
        // 倒计时验证
        Date endDay = DateUtil.plusDayDate(Constant.COUPON_REWARD_LIMIT_DAY, accountTime);
        long currentTime = java.lang.System.currentTimeMillis();
@@ -882,7 +882,7 @@
        Map<String, Object> jump = new HashMap<String, Object>();
        jump.put("type", 2); // 弹出框使用券
        jump.put("params", jumpLink);
        jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("rewardCouponDetail"));
        jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("rewardCouponDetail",system));
        rewardMap.put("jump", jump);
        order.setRewardDetail(rewardMap);
    }
@@ -1806,7 +1806,7 @@
    }
    @Override
    public JSONObject getRewardJumpInfo(String orderNo, Integer goodsType) {
    public JSONObject getRewardJumpInfo(String orderNo, Integer goodsType,SystemEnum system) {
        JSONObject map = new JSONObject();
        // 订单标识
@@ -1828,7 +1828,7 @@
        Map<String, Object> jump = new HashMap<String, Object>();
        jump.put("type", 1);
        jump.put("params", jumpLink);
        jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("rewardCouponDetail"));
        jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("rewardCouponDetail",system));
        Map<String, Object> rewardMap = new HashMap<String, Object>();
        rewardMap.put("text", rewardStyleVO);
fanli/src/main/java/com/yeshi/fanli/service/impl/push/PushServiceImpl.java
@@ -1,5 +1,10 @@
package com.yeshi.fanli.service.impl.push;
import com.ks.push.exception.BPushTaskException;
import com.ks.push.pojo.DO.BPushFilter;
import com.ks.push.pojo.DO.BPushMessage;
import com.ks.push.pojo.DO.BPushTask;
import com.ks.push.service.BPushTaskService;
import com.yeshi.fanli.dao.mybatis.AccountMessageMapper;
import com.yeshi.fanli.dao.mybatis.push.PushRecordMapper;
import com.yeshi.fanli.dto.push.PushBaseContent;
@@ -8,28 +13,39 @@
import com.yeshi.fanli.entity.SystemEnum;
import com.yeshi.fanli.entity.bus.user.AccountMessage;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.common.JumpDetailV2;
import com.yeshi.fanli.entity.system.ConfigKeyEnum;
import com.yeshi.fanli.entity.system.SystemZnx;
import com.yeshi.fanli.entity.xinge.PushRecord;
import com.yeshi.fanli.exception.push.PushException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
import com.yeshi.fanli.service.inter.config.AppVersionService;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.config.SystemConfigService;
import com.yeshi.fanli.service.inter.push.*;
import com.yeshi.fanli.service.inter.user.SystemZnxService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import net.sf.json.JSONObject;
import org.apache.dubbo.config.annotation.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.*;
@Service
public class PushServiceImpl implements PushService {
    Logger logger = LoggerFactory.getLogger(PushService.class);
    static String PROJECT_NAME = "";
    static {
        PROJECT_NAME = Constant.systemCommonConfig.getProjectChineseName();
    }
    @Resource
    private SystemZnxService systemZnxService;
@@ -57,9 +73,14 @@
    @Resource
    private AppVersionService appVersionService;
    @Reference(version = "1.0", check = false)
    private BPushTaskService bPushTaskService;
    @Resource
    private SystemConfigService systemConfigService;
    private ConfigService configService;
    @Resource
    private JumpDetailV2Service jumpDetailV2Service;
    @Override
    public void pushGoods(Long uid, String title, String content, String url, List<String> listIOS,
@@ -73,45 +94,62 @@
        if (StringUtil.isNullOrEmpty(content))
            throw new PushException(1, "请填写推送内容");
        /* IOS端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */
        if (listIOS == null || listIOS.size() > 0) {
            // 限制推送版本号:0
            String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS, system);
            if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) {
                iosPushService.pushGoods(uid, Long.parseLong(gid), title, content, codes,  system);
        if (system.isNewPush()) {
            List<Long> uidList = null;
            if (uid != null) {
                uidList = new ArrayList<>();
                uidList.add(uid);
            }
        }
        /* Android端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */
        if (listAndroid == null || listAndroid.size() > 0) {
            // 限制推送版本号:0
            String versions = getEffectiveVersions(0, AppVersionInfo.PLATFORM_ANDROID, listAndroid, system);
            if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) {
                xmPushService.pushGoods(uid, Long.parseLong(gid), title, content, versions,  system);
            }
            // 华为推送
            List<Integer> versionCodeList = null;
            if (listAndroid == null || listAndroid.size() > 0) {
                List<Integer> versionCodeList = null;
                if (listAndroid != null)
                    versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system);
                hwPushService.pushGoods(uid, Long.parseLong(gid), new PushBaseContent(title, content, versionCodeList, system));
            }
            try {
                newPush(system, uidList, versionCodeList, null, title, content, NewPushExtraParamsFactory.createGoods(jumpDetailV2Service.getByTypeCache("goodsdetail", system), gid, Constant.SOURCE_TYPE_TAOBAO));
            } catch (BPushTaskException e) {
                logger.error("推送-商品:{}", gid, e);
            }
        } else {
            /* IOS端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */
            if (listIOS == null || listIOS.size() > 0) {
                // 限制推送版本号:0
                String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS, system);
                if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) {
                    iosPushService.pushGoods(uid, Long.parseLong(gid), title, content, codes, system);
                }
            }
            // OPPO推送
            /* Android端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */
            if (listAndroid == null || listAndroid.size() > 0) {
                List<Integer> versionCodeList = null;
                if (listAndroid != null)
                    versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system);
                oPPOPushService.pushGoods(uid, Long.parseLong(gid), new PushBaseContent(title, content, versionCodeList, system));
            }
            // VIVO推送
            if (listAndroid == null || listAndroid.size() > 0) {
                List<Integer> versionCodeList = null;
                if (listAndroid != null)
                    versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system);
                vIVOPushService.pushGoods(uid, Long.parseLong(gid), new PushBaseContent(title, content, versionCodeList, system));
            }
                // 限制推送版本号:0
                String versions = getEffectiveVersions(0, AppVersionInfo.PLATFORM_ANDROID, listAndroid, system);
                if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) {
                    xmPushService.pushGoods(uid, Long.parseLong(gid), title, content, versions, system);
                }
                // 华为推送
                if (listAndroid == null || listAndroid.size() > 0) {
                    List<Integer> versionCodeList = null;
                    if (listAndroid != null)
                        versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system);
                    hwPushService.pushGoods(uid, Long.parseLong(gid), new PushBaseContent(title, content, versionCodeList, system));
                }
                // OPPO推送
                if (listAndroid == null || listAndroid.size() > 0) {
                    List<Integer> versionCodeList = null;
                    if (listAndroid != null)
                        versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system);
                    oPPOPushService.pushGoods(uid, Long.parseLong(gid), new PushBaseContent(title, content, versionCodeList, system));
                }
                // VIVO推送
                if (listAndroid == null || listAndroid.size() > 0) {
                    List<Integer> versionCodeList = null;
                    if (listAndroid != null)
                        versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system);
                    vIVOPushService.pushGoods(uid, Long.parseLong(gid), new PushBaseContent(title, content, versionCodeList, system));
                }
            }
        }
        PushRecord pushRecord = new PushRecord();
@@ -137,47 +175,66 @@
        if (StringUtil.isNullOrEmpty(content))
            throw new PushException(1, "无推送内容");
        /* IOS端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */
        if (listIOS == null || listIOS.size() > 0) {
            // 限制推送版本号:0
            String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS, system);
            if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) {
                iosPushService.pushUrl(uid, url, title, content, codes,system);
            }
        }
        /* Android端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */
        if (listAndroid == null || listAndroid.size() > 0) {
            // 限制推送版本号:0
            String versions = getEffectiveVersions(0, AppVersionInfo.PLATFORM_ANDROID, listAndroid, system);
            if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) {
                xmPushService.pushUrl(uid, url, title, content, versions,system);
        if (system.isNewPush()) {
            List<Long> uidList = null;
            if (uid != null) {
                uidList = new ArrayList<>();
                uidList.add(uid);
            }
            // 华为推送
            List<Integer> versionCodeList = null;
            if (listAndroid == null || listAndroid.size() > 0) {
                List<Integer> versionCodeList = null;
                if (listAndroid != null)
                    versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system);
                hwPushService.pushUrl(uid, url, new PushBaseContent(title, content, versionCodeList, system));
            }
            try {
                newPush(system, uidList, versionCodeList, null, title, content, NewPushExtraParamsFactory.createUrl(jumpDetailV2Service.getByTypeCache("web", system), url));
            } catch (BPushTaskException e) {
                logger.error("推送-链接:{}", url, e);
            }
        } else {
            /* IOS端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */
            if (listIOS == null || listIOS.size() > 0) {
                // 限制推送版本号:0
                String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS, system);
                if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) {
                    iosPushService.pushUrl(uid, url, title, content, codes, system);
                }
            }
            // OPPO推送
            /* Android端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */
            if (listAndroid == null || listAndroid.size() > 0) {
                List<Integer> versionCodeList = null;
                if (listAndroid != null)
                    versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system);
                oPPOPushService.pushUrl(uid, url, new PushBaseContent(title, content, versionCodeList, system));
            }
                // 限制推送版本号:0
                String versions = getEffectiveVersions(0, AppVersionInfo.PLATFORM_ANDROID, listAndroid, system);
                if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) {
                    xmPushService.pushUrl(uid, url, title, content, versions, system);
                }
            // VIVO推送
            if (listAndroid == null || listAndroid.size() > 0) {
                List<Integer> versionCodeList = null;
                if (listAndroid != null)
                    versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system);
                vIVOPushService.pushUrl(uid, url, new PushBaseContent(title, content, versionCodeList, system));
            }
                // 华为推送
                if (listAndroid == null || listAndroid.size() > 0) {
                    List<Integer> versionCodeList = null;
                    if (listAndroid != null)
                        versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system);
                    hwPushService.pushUrl(uid, url, new PushBaseContent(title, content, versionCodeList, system));
                }
                // OPPO推送
                if (listAndroid == null || listAndroid.size() > 0) {
                    List<Integer> versionCodeList = null;
                    if (listAndroid != null)
                        versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system);
                    oPPOPushService.pushUrl(uid, url, new PushBaseContent(title, content, versionCodeList, system));
                }
                // VIVO推送
                if (listAndroid == null || listAndroid.size() > 0) {
                    List<Integer> versionCodeList = null;
                    if (listAndroid != null)
                        versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system);
                    vIVOPushService.pushUrl(uid, url, new PushBaseContent(title, content, versionCodeList, system));
                }
            }
        }
        PushRecord pushRecord = new PushRecord();
@@ -220,45 +277,64 @@
            accountMessageMapper.insertSelective(accountMessage);
        }
        /* IOS端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */
        if (listIOS == null || listIOS.size() > 0) {
            // 限制推送版本号:0
            String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS, system);
            if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) {
                iosPushService.pushZNX(uId, accountMessage, systemZnx, codes,system);
        if (system.isNewPush()) {
            logger.debug("新版站内信推送开始:uid-{} title-{} content-{}", new Object[]{uId, title, content});
            List<Long> uidList = null;
            if (uId != null) {
                uidList = new ArrayList<>();
                uidList.add(uId);
            }
        }
        /* Android端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */
        if (listAndroid == null || listAndroid.size() > 0) {
            // 限制推送版本号:0
            String versions = getEffectiveVersions(0, AppVersionInfo.PLATFORM_ANDROID, listAndroid, system);
            if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) {
                xmPushService.pushZNX(uId, accountMessage, systemZnx, versions,system);
            }
            // 华为推送
            List<Integer> versionCodeList = null;
            if (listAndroid == null || listAndroid.size() > 0) {
                List<Integer> versionCodeList = null;
                if (listAndroid != null)
                    versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system);
                hwPushService.pushZNX(uId, new PushBaseContent(title, content, versionCodeList, system));
            }
            try {
                newPush(system, uidList, versionCodeList, null, title, content, NewPushExtraParamsFactory.createZNX(jumpDetailV2Service.getByTypeCache("system_msg", system)));
            } catch (BPushTaskException e) {
                logger.error("推送-站内信:{}", uId + "", e);
            }
        } else {
            /* IOS端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */
            if (listIOS == null || listIOS.size() > 0) {
                // 限制推送版本号:0
                String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS, system);
                if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) {
                    iosPushService.pushZNX(uId, accountMessage, systemZnx, codes, system);
                }
            }
            // OPPO推送
            /* Android端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */
            if (listAndroid == null || listAndroid.size() > 0) {
                List<Integer> versionCodeList = null;
                if (listAndroid != null)
                    versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system);
                oPPOPushService.pushZNX(uId, new PushBaseContent(title, content, versionCodeList, system));
            }
                // 限制推送版本号:0
                String versions = getEffectiveVersions(0, AppVersionInfo.PLATFORM_ANDROID, listAndroid, system);
                if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) {
                    xmPushService.pushZNX(uId, accountMessage, systemZnx, versions, system);
                }
            // VIVO推送
            if (listAndroid == null || listAndroid.size() > 0) {
                List<Integer> versionCodeList = null;
                if (listAndroid != null)
                    versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system);
                vIVOPushService.pushZNX(uId, new PushBaseContent(title, content, versionCodeList, system));
                // 华为推送
                if (listAndroid == null || listAndroid.size() > 0) {
                    List<Integer> versionCodeList = null;
                    if (listAndroid != null)
                        versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system);
                    hwPushService.pushZNX(uId, new PushBaseContent(title, content, versionCodeList, system));
                }
                // OPPO推送
                if (listAndroid == null || listAndroid.size() > 0) {
                    List<Integer> versionCodeList = null;
                    if (listAndroid != null)
                        versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system);
                    oPPOPushService.pushZNX(uId, new PushBaseContent(title, content, versionCodeList, system));
                }
                // VIVO推送
                if (listAndroid == null || listAndroid.size() > 0) {
                    List<Integer> versionCodeList = null;
                    if (listAndroid != null)
                        versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system);
                    vIVOPushService.pushZNX(uId, new PushBaseContent(title, content, versionCodeList, system));
                }
            }
        }
@@ -288,7 +364,7 @@
            // 限制推送版本号:0
            String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS, system);
            if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) {
                iosPushService.pushWEEX(uid, title, content, weexUrl, codes,system);
                iosPushService.pushWEEX(uid, title, content, weexUrl, codes, system);
            }
        }
@@ -297,7 +373,7 @@
            // 限制推送版本号:31
            String versions = getEffectiveVersions(0, AppVersionInfo.PLATFORM_ANDROID, listAndroid, system);
            if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) {
                xmPushService.pushWEEX(uid, title, content, weexUrl, versions,system);
                xmPushService.pushWEEX(uid, title, content, weexUrl, versions, system);
            }
        }
@@ -345,48 +421,67 @@
        if (StringUtil.isNullOrEmpty(content))
            throw new PushException(1, "无推送内容");
        // 适用版本 1.4.8及以后 推送百川网页
        /* IOS端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */
        if (listIOS == null || listIOS.size() > 0) {
            // 限制推送版本号:0
            String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS, system);
            if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) {
                iosPushService.pushBaiChuanUrl(uid, title, content, url, codes,system);
        if (system.isNewPush()) {
            List<Long> uidList = null;
            if (uid != null) {
                uidList = new ArrayList<>();
                uidList.add(uid);
            }
        }
        /* Android端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */
        if (listAndroid == null || listAndroid.size() > 0) {
            // 限制推送版本号:31
            String versions = getEffectiveVersions(31, AppVersionInfo.PLATFORM_ANDROID, listAndroid, system);
            if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) {
                xmPushService.pushBaiChuanUrl(uid, title, content, url, versions,system);
            List<Integer> versionCodeList = null;
            if (listAndroid == null || listAndroid.size() > 0) {
                if (listAndroid != null)
                    versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system);
            }
        }
            try {
                newPush(system, uidList, versionCodeList, null, title, content, NewPushExtraParamsFactory.createBaichuan(jumpDetailV2Service.getByTypeCache("system_msg", system), url));
            } catch (BPushTaskException e) {
                logger.error("推送-百川:{}", url, e);
            }
        } else {
        // 华为推送
        if (listAndroid == null || listAndroid.size() > 0) {
            List<Integer> versionCodeList = null;
            if (listAndroid != null)
                versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system);
            hwPushService.pushBaiChuanUrl(uid, url, new PushBaseContent(title, content, versionCodeList, system));
        }
            // 适用版本 1.4.8及以后 推送百川网页
        // OPPO推送
        if (listAndroid == null || listAndroid.size() > 0) {
            List<Integer> versionCodeList = null;
            if (listAndroid != null)
                versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system);
            oPPOPushService.pushBaiChuanUrl(uid, url, new PushBaseContent(title, content, versionCodeList, system));
        }
            /* IOS端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */
            if (listIOS == null || listIOS.size() > 0) {
                // 限制推送版本号:0
                String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS, system);
                if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) {
                    iosPushService.pushBaiChuanUrl(uid, title, content, url, codes, system);
                }
            }
        // VIVO推送
        if (listAndroid == null || listAndroid.size() > 0) {
            List<Integer> versionCodeList = null;
            if (listAndroid != null)
                versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system);
            vIVOPushService.pushBaiChuanUrl(uid, url, new PushBaseContent(title, content, versionCodeList, system));
            /* Android端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */
            if (listAndroid == null || listAndroid.size() > 0) {
                // 限制推送版本号:31
                String versions = getEffectiveVersions(31, AppVersionInfo.PLATFORM_ANDROID, listAndroid, system);
                if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) {
                    xmPushService.pushBaiChuanUrl(uid, title, content, url, versions, system);
                }
            }
            // 华为推送
            if (listAndroid == null || listAndroid.size() > 0) {
                List<Integer> versionCodeList = null;
                if (listAndroid != null)
                    versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system);
                hwPushService.pushBaiChuanUrl(uid, url, new PushBaseContent(title, content, versionCodeList, system));
            }
            // OPPO推送
            if (listAndroid == null || listAndroid.size() > 0) {
                List<Integer> versionCodeList = null;
                if (listAndroid != null)
                    versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system);
                oPPOPushService.pushBaiChuanUrl(uid, url, new PushBaseContent(title, content, versionCodeList, system));
            }
            // VIVO推送
            if (listAndroid == null || listAndroid.size() > 0) {
                List<Integer> versionCodeList = null;
                if (listAndroid != null)
                    versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid, system);
                vIVOPushService.pushBaiChuanUrl(uid, url, new PushBaseContent(title, content, versionCodeList, system));
            }
        }
        // 插入推送记录
@@ -415,7 +510,7 @@
            // 限制推送版本号:0
            String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS, system);
            if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) {
                iosPushService.pushWelfareCenter(uid, title, content, codes,system);
                iosPushService.pushWelfareCenter(uid, title, content, codes, system);
            }
        }
@@ -424,7 +519,7 @@
            // 限制推送版本号:36
            String versions = getEffectiveVersions(36, AppVersionInfo.PLATFORM_ANDROID, listAndroid, system);
            if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) {
                xmPushService.pushWelfareCenter(uid, title, content, versions,system);
                xmPushService.pushWelfareCenter(uid, title, content, versions, system);
            }
        }
@@ -554,7 +649,7 @@
            // 限制推送版本号:1.6.5以后
            String codes = getEffectiveVersionCodes(60, AppVersionInfo.PLATFORM_IOS, listIOS, system);
            if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) {
                iosPushService.pushUserSignInNotification(uid, title, content, codes,system);
                iosPushService.pushUserSignInNotification(uid, title, content, codes, system);
            }
        }
@@ -563,7 +658,7 @@
            // 限制推送版本号:1.6.5以后
            String versions = getEffectiveVersions(47, AppVersionInfo.PLATFORM_ANDROID, listAndroid, system);
            if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) {
                xmPushService.pushUserSignInNotification(uid, title, content, versions,system);
                xmPushService.pushUserSignInNotification(uid, title, content, versions, system);
            }
        }
@@ -602,4 +697,101 @@
        pushRecordMapper.insertSelective(pushRecord);
    }
    private void newPush(SystemEnum system, List<Long> uidList, List<Integer> versionCodeList, Date startPushTime, String title, String content, Map<String, String> params) throws BPushTaskException {
        logger.debug("新版推送开始:title-{} content-{}", new Object[]{title, content});
        //灰度测试
        if (uidList == null || uidList.size() == 0 || uidList.size() > 1)
            return;
        Set<Long> uidSet = new HashSet<>();
        uidSet.add(6857703L);
        uidSet.add(6845887L);
        if (!uidSet.contains(uidList.get(0))) {
            return;
        }
        logger.debug("新版推送灰度测试开始:title-{} content-{}", new Object[]{title, content});
        BPushFilter filter = new BPushFilter();
        //设置用户信息
        List<String> uidStrList = null;
        if (uidList != null && uidList.size() > 0) {
            uidStrList = new ArrayList<>();
            for (Long uid : uidList) {
                uidStrList.add(uid + "");
            }
        }
        filter.setUidList(uidStrList);
        filter.setVersionCodeList(versionCodeList);
        //默认推送最近两个月的活跃用户
        filter.setMinActiveTime(new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24L * 60));
        filter.setStartPushTime(startPushTime);
        BPushMessage message = new BPushMessage();
        message.setAndroidActivityScheme(configService.getValue(ConfigKeyEnum.pushAndroidActivityScheme, system));
        message.setAndroidActivity(configService.getValue(ConfigKeyEnum.pushAndroidActivity, system));
        message.setAndroidHostPath(configService.getValue(ConfigKeyEnum.pushAndroidHostPath, system));
        message.setTitle(title);
        message.setContent(content);
        message.setExtras(params);
        BPushTask pushTask = new BPushTask();
        pushTask.setFilter(filter);
        pushTask.setAppCode(system.name());
        pushTask.setMessage(message);
        String taskId = bPushTaskService.createTask(pushTask);
        if (startPushTime == null) {
            bPushTaskService.startPush(taskId);
        }
        logger.debug("新版推送灰度测试结束:title-{} content-{}", new Object[]{title, content});
    }
    private static class NewPushExtraParamsFactory {
        public static Map<String, String> createCommon(JumpDetailV2 jumpDetail, JSONObject cps) {
            Map<String, String> params = new HashMap<>();
            params.put("activity", jumpDetail.getActivity());
            params.put("type", jumpDetail.getType());
            params.put("controller", jumpDetail.getController());
            if (cps != null)
                params.put("params", cps.toString());
            return params;
        }
        //单品推送
        public static Map<String, String> createGoods(JumpDetailV2 jumpDetail, String goodsId, Integer goodsType) {
            JSONObject cps = new JSONObject();
            cps.put("goodsId", goodsId);
            cps.put("goodsType", goodsType);
            cps.put("from", "push");
            return createCommon(jumpDetail, cps);
        }
        //站内信
        public static Map<String, String> createZNX(JumpDetailV2 jumpDetail) {
            return createCommon(jumpDetail, null);
        }
        //推送链接
        public static Map<String, String> createUrl(JumpDetailV2 jumpDetail, String url) {
            JSONObject cps = new JSONObject();
            cps.put("url", url);
            cps.put("from", "push");
            return createCommon(jumpDetail, cps);
        }
        //推送百川链接
        public static Map<String, String> createBaichuan(JumpDetailV2 jumpDetail, String url) {
            JSONObject cps = new JSONObject();
            cps.put("url", url);
            cps.put("from", "push");
            return createCommon(jumpDetail, cps);
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinNewbiesServiceImpl.java
@@ -244,7 +244,7 @@
        winDetailVO.setDesc("已领取:" + balance + "元");
        winDetailVO.setTips(configTaoLiJinService.getValueByKey("new_user_win_tips"));
        winDetailVO.setParams(json.toString());
        winDetailVO.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
        winDetailVO.setJumpDetail(jumpDetailV2Service.getByTypeCache("web",userInfo.getSystem()));
        winDetailVO.setLogo(userInfoService.getDefaultPortrait(userInfo.getSystem()));
        winDetailVO.setLogoLight(userInfo.getPortrait());
        return winDetailVO;
fanli/src/main/java/com/yeshi/fanli/service/inter/common/JumpDetailV2Service.java
@@ -2,78 +2,74 @@
import java.util.List;
import com.yeshi.fanli.entity.SystemEnum;
import com.yeshi.fanli.entity.common.JumpDetailV2;
/**
 * 跳转详情
 *
 * @author Administrator
 *
 * @author Administrator
 */
public interface JumpDetailV2Service {
    public int deleteByPrimaryKey(Long id);
    public int deleteByPrimaryKey(Long id);
    public int insert(JumpDetailV2 record);
    public int insert(JumpDetailV2 record);
    public int insertSelective(JumpDetailV2 record);
    public int insertSelective(JumpDetailV2 record);
    public JumpDetailV2 selectByPrimaryKey(Long id);
    public JumpDetailV2 selectByPrimaryKey(Long id);
    public int updateByPrimaryKeySelective(JumpDetailV2 record);
    public int updateByPrimaryKeySelective(JumpDetailV2 record);
    public int updateByPrimaryKey(JumpDetailV2 record);
    public int updateByPrimaryKey(JumpDetailV2 record);
    /**
     * 根据类型查询
     *
     * @param type
     * @return
     */
    public List<JumpDetailV2> listByType(String type);
    /**
     * 根据类型查询
     *
     * @param type
     * @return
     */
    public List<JumpDetailV2> listByType(String type, SystemEnum system);
    /**
     * 根据类型取值
     *
     * @param type
     *            类型
     * @return
     */
    public JumpDetailV2 getByTypeCache(String type);
    /**
     * 根据类型取值
     *
     * @param type 类型
     * @return
     */
    public JumpDetailV2 getByTypeCache(String type, SystemEnum system);
    /**
     * 根据类型取值
     *
     * @param type
     *            类型
     * @param platform
     *            -平台 1:android 2:ios
     * @param version
     *            ios-build android-versionCode
     * @return
     */
    public JumpDetailV2 getByTypeCache(String type, int platform, int version);
    /**
     * 根据类型取值
     *
     * @param type     类型
     * @param platform -平台 1:android 2:ios
     * @param version  ios-build android-versionCode
     * @return
     */
    public JumpDetailV2 getByTypeCache(String type, int platform, int version, SystemEnum system);
    public List<JumpDetailV2> listJump();
    public List<JumpDetailV2> listJump(SystemEnum system);
    /**
     * 根据主键批量删除
     *
     * @param list
     * @return
     */
    int deleteBatchByPrimaryKey(List<Long> list);
    /**
     * 根据主键批量删除
     *
     * @param list
     * @return
     */
    int deleteBatchByPrimaryKey(List<Long> list);
    /**
     * 后端列表查询
     *
     * @param start
     * @param count
     * @param key
     * @return
     */
    List<JumpDetailV2> listQuery(long start, int count, String key);
    /**
     * 后端列表查询
     *
     * @param start
     * @param count
     * @param key
     * @return
     */
    List<JumpDetailV2> listQuery(long start, int count, String key, SystemEnum system);
    long countListQuery(String key);
    long countListQuery(String key, SystemEnum system);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SpecialService.java
@@ -55,7 +55,7 @@
     * @throws Exception
     */
    public void saveObject(MultipartFile file, MultipartFile file2, MultipartFile file3, Special record
            , String jumpType, CommonShareInfo shareInfo) throws SpecialException, Exception;
            , String jumpType, CommonShareInfo shareInfo,SystemEnum system) throws SpecialException, Exception;
    /**
     * 更换顺序
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SwiperPictureService.java
@@ -106,7 +106,7 @@
     * @param record
     * @throws SwiperPictureException
     */
    public void saveObject(MultipartFile file, SwiperPicture record, String jumpType, CommonShareInfo shareInfo)
    public void saveObject(MultipartFile file, SwiperPicture record, String jumpType, CommonShareInfo shareInfo,SystemEnum system)
            throws SwiperPictureException, Exception;
    /**
fanli/src/main/java/com/yeshi/fanli/service/inter/order/CommonOrderService.java
@@ -278,7 +278,7 @@
     * @param orderNo
     * @return
     */
    public JSONObject getRewardJumpInfo(String orderNo, Integer goodsType);
    public JSONObject getRewardJumpInfo(String orderNo, Integer goodsType,SystemEnum system);
    /**
     * 根据交易号获取订单详情
fanli/src/main/java/com/yeshi/fanli/service/manger/JobManager.java
@@ -67,6 +67,7 @@
@Component
public class JobManager {
    @Resource
    private BoutiqueAutoRuleService boutiqueAutoRuleService;
@@ -682,6 +683,7 @@
                        Iterator<String> its = map.keySet().iterator();
                        while (its.hasNext()) {
                            String key = its.next();
                            LogHelper.test("拼多多订单处理开始:" + key);
                            try {
                                String orderId = map.get(key);
                                if (!StringUtil.isNullOrEmpty(orderId)) {
@@ -691,7 +693,9 @@
                                            orderProcessService.processPDDOrder(order);
                                }
                                PDDOrderCMQManager.getInstance().deletePDDOrder(key);
                                LogHelper.test("拼多多订单处理成功:" + key);
                            } catch (Exception e) {
                                LogHelper.test("拼多多订单处理失败:" + key);
                                LogHelper.errorDetailInfo(e);
                            }
                        }
fanli/src/main/java/com/yeshi/fanli/util/Constant.java
@@ -20,7 +20,7 @@
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
public class Constant {
    public static boolean IS_TASK = false;
    public static boolean IS_TASK = true;
    // 外网环境
    public static boolean IS_OUTNET = false;
fanli/src/main/java/com/yeshi/fanli/util/vipshop/VipShopApiUtil.java
@@ -40,6 +40,9 @@
    private final static String appKey = "f9e7f22f";
    private final static String appSecret = "9B2291352497FAF42B2DF44BFCF62316";
    //是否采用订单侠转链
    private final static boolean CONVERT_DINGDANXIA = true;
    /**
     * 获取签名
     *
@@ -209,6 +212,11 @@
     * @param goodsId
     */
    public static VIPConvertResultDTO convertLink(String goodsId, String tag) {
        if (CONVERT_DINGDANXIA) {
            return DingDanXiaApiUtil.convertLink(goodsId, tag);
        }
        JSONObject taskParams = new JSONObject();
        JSONArray goodsIdArray = new JSONArray();
        goodsIdArray.add(goodsId);
@@ -228,6 +236,10 @@
    public static VIPConvertResultDTO convertLinkByUrl(String url, String tag) {
        if (CONVERT_DINGDANXIA) {
            return DingDanXiaApiUtil.convertLinkByUrl(url, tag);
        }
        JSONObject taskParams = new JSONObject();
        JSONArray urlArray = new JSONArray();
        urlArray.add(url);
fanli/src/main/resource/env-dev/constant.properties
@@ -1,3 +1,3 @@
task =false
outnetwork =false
test=false
test=true
fanli/src/main/resource/kafka_log.properties
@@ -1,6 +1,6 @@
log.config.kafka.isSend=true
log.config.kafka.bootstrapServers= 134.175.68.214:9092
log.config.kafka.topic=    log_fanli_error
log.config.kafka.bootstrapServers= 134.175.68.214:9092,134.175.68.214:9093,134.175.68.214:9094
log.config.kafka.topic=    log_fanli_errors
log.config.kafka.batchSize=5
log.config.kafka.lingerMs=1000
log.config.kafka.compressionType=gzip
fanli/src/main/resource/logback.xml
@@ -15,7 +15,7 @@
    <property name="log.maxSize" value="20MB"/>
    <!--日志存储的根路径 ${catalina.base}指向每个Tomcat目录私有信息的位置,
             就是conf、logs、temp、webapps和work的父目录-->
    <property name="log.filePath" value="/tmp/logs"/>
    <property name="log.filePath" value="D:/logs"/>
    <!--日志展示的格式-->
    <property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n"/>
@@ -49,6 +49,28 @@
        <filter class="ch.qos.logback.classic.filter.LevelFilter">
            <level>ERROR</level>
            <onMatch>ACCEPT</onMatch>
            <onMismatch>DENY</onMismatch>
        </filter>
    </appender>
    <!-- ERROR -->
    <appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${log.filePath}/debug/debug.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
            <fileNamePattern>${log.filePath}/debug/debug.%d{yyyy-MM-dd}.%i.log.zip</fileNamePattern>
            <maxHistory>${log.maxHistory}</maxHistory>
            <maxFileSize>${log.maxSize}</maxFileSize>
        </rollingPolicy>
        <layout class="ch.qos.logback.classic.PatternLayout">
            <pattern>
                ${log.pattern}
            </pattern>
        </layout>
        <filter class="ch.qos.logback.classic.filter.LevelFilter">
            <level>DEBUG</level>
            <onMatch>ACCEPT</onMatch>
            <onMismatch>DENY</onMismatch>
        </filter>
@@ -351,6 +373,29 @@
    </appender>
    <!-- 用户商品浏览 -->
    <appender name="KAFKA_USER_GOODS_SCAN" class="com.yeshi.fanli.log.KafkaAppender">
        <!-- encoder必须配置, 日志格式 -->
        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
            <!--<pattern>-->
            <!--%red(%d{yyyy-MM-dd HH:mm:ss.SSS}) %highlight(%-5level) %green([%thread]) %boldMagenta(%logger{10}) - %cyan(%msg%n)-->
            <!--</pattern>-->
            <!--为了便于分析将日志数据转为json格式-->
            <pattern>${log.pattern}</pattern>
            <!-- 控制台也要使用UTF-8,不要使用GBK,否则会中文乱码 -->
            <charset>UTF-8</charset>
        </encoder>
        <bootstrapServers>${bootstrapServers}</bootstrapServers>
        <topic>log_fanli_user_goods_scan</topic>
        <batchSize>${batchSize}</batchSize>
        <lingerMs>${lingerMs}</lingerMs>
        <compressionType>${compressionType}</compressionType>
        <retries>${retries}</retries>
        <maxRequestSize>${maxRequestSize}</maxRequestSize>
        <isSend>${isSend}</isSend>
    </appender>
    <!--name表示为哪一个logger指定层级和输出的方式
       additivity表示叠加祖先的输出方式(默认为true,会叠加),所以com.lxc.o2o以及其子类都会输出在控制台中,因为这个logger继承了root中的appender
       level表示级别大于等于${log.level}的信息才会输出,输出方式为配置的appender,
@@ -417,6 +462,18 @@
        <appender-ref ref="PUSH"></appender-ref>
    </logger>
    <logger name="userGoodsScanLog" level="INFO" additivity="false">
        <appender-ref ref="KAFKA_USER_GOODS_SCAN"></appender-ref>
    </logger>
    <logger name="com.yeshi.fanli" level="DEBUG" additivity="true">
        <appender-ref ref="DEBUG_FILE"></appender-ref>
    </logger>
    <!-- 一切logger都会继承自root,root默认的层级level为debug -->
    <root>
        <level value="INFO"/>
fanli/src/main/resource/mapping/common/JumpDetailV2Mapper.xml
@@ -2,138 +2,125 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeshi.fanli.dao.mybatis.common.JumpDetailV2Mapper">
    <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.common.JumpDetailV2">
        <id column="jp_id" property="id" jdbcType="BIGINT" />
        <result column="jp_name" property="name" jdbcType="VARCHAR" />
        <result column="jp_activity" property="activity" jdbcType="VARCHAR" />
        <result column="jp_controller" property="controller" jdbcType="VARCHAR" />
        <result column="jp_type" property="type" jdbcType="VARCHAR" />
        <result column="jp_need_login" property="needLogin" jdbcType="BOOLEAN" />
        <result column="jp_path" property="path" jdbcType="VARCHAR" />
        <result column="jp_min_android_version" property="minAndroidAppVersion"
            jdbcType="INTEGER" />
        <result column="jp_min_ios_version" property="minIOSAppVersion"
            jdbcType="INTEGER" />
    </resultMap>
    <sql id="Base_Column_List">jp_id,jp_name,jp_activity,jp_controller,jp_type,jp_need_login,jp_min_android_version,jp_min_ios_version,jp_path
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_action_jumpdetail_v2 where jp_id = #{id,jdbcType=BIGINT}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_action_jumpdetail_v2 where jp_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.common.JumpDetailV2"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_action_jumpdetail_v2
        (jp_id,jp_name,jp_activity,jp_controller,jp_type,jp_need_login,jp_min_android_version,jp_min_ios_version,jp_path)
        values
        (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{activity,jdbcType=VARCHAR},#{controller,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{needLogin,jdbcType=BOOLEAN},#{minAndroidAppVersion,jdbcType=INTEGER},#{minIOSAppVersion,jdbcType=INTEGER},#{path,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.common.JumpDetailV2"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_action_jumpdetail_v2
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">jp_id,</if>
            <if test="name != null">jp_name,</if>
            <if test="activity != null">jp_activity,</if>
            <if test="controller != null">jp_controller,</if>
            <if test="type != null">jp_type,</if>
            <if test="needLogin != null">jp_need_login,</if>
            <if test="minAndroidAppVersion != null">jp_min_android_version,</if>
            <if test="minIOSAppVersion != null">jp_min_ios_version,</if>
            <if test="path != null">jp_path,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="name != null">#{name,jdbcType=VARCHAR},</if>
            <if test="activity != null">#{activity,jdbcType=VARCHAR},</if>
            <if test="controller != null">#{controller,jdbcType=VARCHAR},</if>
            <if test="type != null">#{type,jdbcType=VARCHAR},</if>
            <if test="needLogin != null">#{jp_need_login,jdbcType=BOOLEAN},</if>
            <if test="minAndroidAppVersion != null">#{minAndroidAppVersion,jdbcType=INTEGER}</if>
            <if test="minIOSAppVersion != null">#{minIOSAppVersion,jdbcType=INTEGER}</if>
            <if test="path != null">#{path,jdbcType=VARCHAR}</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.common.JumpDetailV2">update
        yeshi_ec_action_jumpdetail_v2 set jp_name =
        #{name,jdbcType=VARCHAR},jp_activity =
        #{activity,jdbcType=VARCHAR},jp_controller =
        #{controller,jdbcType=VARCHAR},jp_type =
        #{type,jdbcType=VARCHAR},jp_need_login = #{needLogin,jdbcType=BOOLEAN}
        ,jp_min_android_version =#{minAndroidAppVersion,jdbcType=INTEGER}
        ,jp_min_ios_version =#{minIOSAppVersion,jdbcType=INTEGER}
        ,jp_path =#{path,jdbcType=VARCHAR}
        where jp_id
        = #{id,jdbcType=BIGINT}</update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.common.JumpDetailV2">
        update yeshi_ec_action_jumpdetail_v2
        <set>
            <if test="name != null">jp_name=#{name,jdbcType=VARCHAR},</if>
            <if test="activity != null">jp_activity=#{activity,jdbcType=VARCHAR},</if>
            <if test="controller != null">jp_controller=#{controller,jdbcType=VARCHAR},</if>
            <if test="type != null">jp_type=#{type,jdbcType=VARCHAR},</if>
            <if test="needLogin != null">jp_need_login=#{needLogin,jdbcType=BOOLEAN},</if>
            <if test="minAndroidAppVersion !=null">jp_min_android_version
                =#{minAndroidAppVersion,jdbcType=INTEGER},</if>
            <if test="minIOSAppVersion !=null">jp_min_ios_version =#{minIOSAppVersion,jdbcType=INTEGER},
            </if>
            <if test="path !=null">jp_path =#{path,jdbcType=VARCHAR},
            </if>
        </set>
        where jp_id = #{id,jdbcType=BIGINT}
    </update>
    <select id="listByType" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_action_jumpdetail_v2 where jp_type =
        #{type,jdbcType=VARCHAR}
    </select>
    <select id="listJump" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_action_jumpdetail_v2
    </select>
    <select id="listQuery" resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List" />
        FROM yeshi_ec_action_jumpdetail_v2 WHERE 1=1
        <if test="key != null and key != &quot;&quot;">AND (jp_name like '%${key}%')</if>
        ORDER BY jp_id LIMIT ${start},${count}
    </select>
    <select id="countListQuery" resultType="java.lang.Long">
        SELECT IFNULL(count(jp_id),0) FROM yeshi_ec_action_jumpdetail_v2 WHERE
        1=1
        <if test="key != null and key != &quot;&quot;">AND (jp_name like '%${key}%')</if>
    </select>
    <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.common.JumpDetailV2">
        <id column="jp_id" property="id" jdbcType="BIGINT"/>
        <result column="jp_name" property="name" jdbcType="VARCHAR"/>
        <result column="jp_activity" property="activity" jdbcType="VARCHAR"/>
        <result column="jp_controller" property="controller" jdbcType="VARCHAR"/>
        <result column="jp_type" property="type" jdbcType="VARCHAR"/>
        <result column="jp_need_login" property="needLogin" jdbcType="BOOLEAN"/>
        <result column="jp_path" property="path" jdbcType="VARCHAR"/>
        <result column="jp_min_android_version" property="minAndroidAppVersion" jdbcType="INTEGER"/>
        <result column="jp_min_ios_version" property="minIOSAppVersion" jdbcType="INTEGER"/>
        <result column="jp_system" property="system" jdbcType="VARCHAR"/>
    </resultMap>
    <sql id="Base_Column_List">jp_id,jp_name,jp_activity,jp_controller,jp_type,jp_need_login,jp_min_android_version,jp_min_ios_version,jp_path,jp_system</sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
        <include refid="Base_Column_List"/>
        from yeshi_ec_action_jumpdetail_v2 where jp_id = #{id,jdbcType=BIGINT}
    </select>
    <delete id="deleteByPrimaryKey"
            parameterType="java.lang.Long">delete from yeshi_ec_action_jumpdetail_v2 where jp_id = #{id,jdbcType=BIGINT}</delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.common.JumpDetailV2" useGeneratedKeys="true"
            keyProperty="id">insert into yeshi_ec_action_jumpdetail_v2 (jp_id,jp_name,jp_activity,jp_controller,jp_type,jp_need_login,jp_min_android_version,jp_min_ios_version,jp_path,jp_system) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{activity,jdbcType=VARCHAR},#{controller,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{needLogin,jdbcType=BOOLEAN},#{minAndroidAppVersion,jdbcType=INTEGER},#{minIOSAppVersion,jdbcType=INTEGER},#{path,jdbcType=VARCHAR},#{system,jdbcType=VARCHAR})</insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.common.JumpDetailV2" useGeneratedKeys="true"
            keyProperty="id">insert into yeshi_ec_action_jumpdetail_v2
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">jp_id,</if>
            <if test="name != null">jp_name,</if>
            <if test="activity != null">jp_activity,</if>
            <if test="controller != null">jp_controller,</if>
            <if test="type != null">jp_type,</if>
            <if test="needLogin != null">jp_need_login,</if>
            <if test="minAndroidAppVersion != null">jp_min_android_version,</if>
            <if test="minIOSAppVersion != null">jp_min_ios_version,</if>
            <if test="path != null">jp_path,</if>
            <if test="system != null">jp_system,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="name != null">#{name,jdbcType=VARCHAR},</if>
            <if test="activity != null">#{activity,jdbcType=VARCHAR},</if>
            <if test="controller != null">#{controller,jdbcType=VARCHAR},</if>
            <if test="type != null">#{type,jdbcType=VARCHAR},</if>
            <if test="needLogin != null">#{jp_need_login,jdbcType=BOOLEAN},</if>
            <if test="minAndroidAppVersion != null">#{minAndroidAppVersion,jdbcType=INTEGER}</if>
            <if test="minIOSAppVersion != null">#{minIOSAppVersion,jdbcType=INTEGER}</if>
            <if test="path != null">#{path,jdbcType=VARCHAR}</if>
            <if test="system != null">#{system,jdbcType=VARCHAR}</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey"
            parameterType="com.yeshi.fanli.entity.common.JumpDetailV2">update yeshi_ec_action_jumpdetail_v2 set jp_name = #{name,jdbcType=VARCHAR},jp_activity = #{activity,jdbcType=VARCHAR},jp_controller = #{controller,jdbcType=VARCHAR},jp_type = #{type,jdbcType=VARCHAR},jp_need_login = #{needLogin,jdbcType=BOOLEAN} ,jp_min_android_version =#{minAndroidAppVersion,jdbcType=INTEGER} ,jp_min_ios_version =#{minIOSAppVersion,jdbcType=INTEGER} ,jp_path =#{path,jdbcType=VARCHAR} ,jp_system =#{system,jdbcType=VARCHAR} where jp_id = #{id,jdbcType=BIGINT}</update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.common.JumpDetailV2">update
        yeshi_ec_action_jumpdetail_v2
        <set>
            <if test="name != null">jp_name=#{name,jdbcType=VARCHAR},</if>
            <if test="activity != null">jp_activity=#{activity,jdbcType=VARCHAR},</if>
            <if test="controller != null">jp_controller=#{controller,jdbcType=VARCHAR},</if>
            <if test="type != null">jp_type=#{type,jdbcType=VARCHAR},</if>
            <if test="needLogin != null">jp_need_login=#{needLogin,jdbcType=BOOLEAN},</if>
            <if test="minAndroidAppVersion !=null">jp_min_android_version =#{minAndroidAppVersion,jdbcType=INTEGER},
            </if>
            <if test="minIOSAppVersion !=null">jp_min_ios_version =#{minIOSAppVersion,jdbcType=INTEGER},</if>
            <if test="path !=null">jp_path =#{path,jdbcType=VARCHAR},</if>
            <if test="system !=null">jp_system =#{system,jdbcType=VARCHAR},</if>
        </set>
        where jp_id = #{id,jdbcType=BIGINT}
    </update>
    <select id="listByType" resultMap="BaseResultMap">select
        <include refid="Base_Column_List"/>
        from yeshi_ec_action_jumpdetail_v2 where jp_type = #{type,jdbcType=VARCHAR}
    </select>
    <select id="listJump" resultMap="BaseResultMap">select
        <include refid="Base_Column_List"/>
        from yeshi_ec_action_jumpdetail_v2
    </select>
    <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List">delete from yeshi_ec_action_jumpdetail_v2 WHERE
        jp_id in
        <foreach collection="list" item="item" open="(" close=")" separator=",">#{item}</foreach>
    </delete>
    <sql id="listWheres">
        <if test="query.key!=null">
            AND jp_name like '%${query.key}%'
        </if>
        <if test="query.maxAndroidVersion!=null">
            AND #{query.maxAndroidVersion}>=jp_min_android_version
        </if>
        <if test="query.maxIOSVersion!=null">
            AND #{query.maxIOSVersion}>=jp_min_ios_version
        </if>
        <if test="query.type!=null">
            AND jp_type= #{query.type}
        </if>
        <if test="query.system!=null">
            AND jp_system= #{query.system}
        </if>
    </sql>
    <select id="list" resultMap="BaseResultMap">
        select <include refid="Base_Column_List"></include> from yeshi_ec_action_jumpdetail_v2 where 1=1
        <include refid="listWheres"></include>
        <if test="query.sortList!=null">
            <foreach collection="query.sortList" item="item" open=" order by " close=" " separator=",">
                #{item}
            </foreach>
        </if>
        limit #{query.start},#{query.count}
    </select>
    <select id="count" resultType="java.lang.Long">
        select count(*) from yeshi_ec_action_jumpdetail_v2 where 1=1
        <include refid="listWheres"></include>
    </select>
    <select id="selectAndroidByTypeAndVersion" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_action_jumpdetail_v2 jv
        WHERE jv.`jp_type`=#{type} AND #{version}>=jv.`jp_min_android_version`
        ORDER BY jv.`jp_min_android_version` DESC LIMIT 1
    </select>
    <select id="selectIOSByTypeAndVersion" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_action_jumpdetail_v2 jv
        WHERE jv.`jp_type`=#{type} AND #{version}>=jv.`jp_min_ios_version` ORDER BY
        jv.`jp_min_ios_version` DESC LIMIT 1
    </select>
    <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List">
        delete from yeshi_ec_action_jumpdetail_v2 WHERE jp_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
    </delete>
</mapper>