admin
2019-10-30 3f7c35dcb3bd703fcb952bb1a7d3ba5088d87b54
Merge remote-tracking branch 'origin/div' into div
55个文件已修改
3个文件已添加
1402 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/TestController.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/RedPackAdminController.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/apph5/AppH5ShareController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/h5/AppH5CouponController.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/h5/AppH5TaoLiJinController.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/BrandControllerV2.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/CommonContentControllerV2.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConsumerControllerV2.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsClassControllerV2.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/HotSellControllerV2.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/JingDongControllerV2.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/PinDuoDuoControllerV2.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RedPackControllerV2.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareStorageControllerV2.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/TaoLiJinControllerV2.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/redpack/RedPackExchangeMapper.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserSystemCouponActivateMapper.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserSystemCouponMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/ConfigParamsDTO.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/msg/MsgRedPackExchangeContentDTO.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/msg/MsgRedPackGiveContentDTO.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgMoneyDetail.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/money/UserMoneyDetail.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/redpack/RedPackDetail.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/msg/MsgMoneyDetailMapper.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/redpack/RedPackDetailMapper.xml 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/redpack/RedPackExchangeMapper.xml 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponActivateMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponMapper.xml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandClassShopServiceImpl.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandInfoServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/DynamicInfoServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/lable/QualityGoodsServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/lable/TaoKeGoodsServiceImpl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/money/msg/MsgMoneyDetailServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/money/msg/UserMoneyMsgNotificationServiceImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackExchangeServiceImpl.java 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackGiveRecordServiceImpl.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoShopServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java 107 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponActivateServiceImpl.java 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java 151 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/money/msg/UserMoneyMsgNotificationService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/redpack/RedPackExchangeService.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/redpack/RedPackGiveRecordService.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserSystemCouponActivateService.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserSystemCouponService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/RedPackDetailFactory.java 85 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/goods/GoodsDetailVOFactory.java 90 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgMoneyDetailFactory.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java 134 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/coupon/SystemCouponMessageListener.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/goods/MoneyInfoVO.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/msg/TokenVO.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/TestController.java
@@ -38,6 +38,7 @@
import com.google.gson.GsonBuilder;
import com.yeshi.fanli.dao.dynamic.DynamicInfoDao;
import com.yeshi.fanli.dao.mybatis.help.HelpCenterMapper;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.dto.jd.JDSearchResult;
import com.yeshi.fanli.entity.bus.activity.ActivityShareResult;
import com.yeshi.fanli.entity.bus.activity.RecommendActivity;
@@ -471,10 +472,12 @@
                if (goodsList != null && goodsList.size() > 0) {
                    BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
                    BigDecimal shareRate = hongBaoManageService.getShareRate();
                    ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
                    Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                            .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
                    for (JDGoods goods : goodsList) {
                        GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, fanLiRate, shareRate);
                        GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO);
                        array.add(gson.toJson(goodsDetailVO));
                    }
                }
fanli/src/main/java/com/yeshi/fanli/controller/admin/RedPackAdminController.java
@@ -120,21 +120,19 @@
        Long uid = exchange.getUid();
        BigDecimal balance = redPackBalanceService.getBalance(uid);
        UserInfo userInfo = userInfoService.selectByPKey(uid);
        List<Long> listCount = redPackExchangeService.countState(uid);
        List<BigDecimal> listMoney = redPackExchangeService.countMoneyState(uid);
        
        JSONObject data = new JSONObject();
        data.put("exchange", exchange);
        data.put("userInfo", userInfo);
        
        data.put("countInit", listCount.get(0));
        data.put("countSucceed", listCount.get(1));
        data.put("countReject",  listCount.get(2));
        data.put("countInit", redPackExchangeService.countByUidAndState(uid, RedPackExchange.STATE_INIT));
        data.put("countSucceed", redPackExchangeService.countByUidAndState(uid, RedPackExchange.STATE_SUCCESS));
        data.put("countReject", redPackExchangeService.countByUidAndState(uid, RedPackExchange.STATE_REJECT));
        
        data.put("balance", balance);
        data.put("moneyInit", listMoney.get(0));
        data.put("moneySucceed", listMoney.get(1));
        data.put("moneyReject",  listMoney.get(2));
        data.put("moneyInit", redPackExchangeService.countMoneyByUidAndState(uid,RedPackExchange.STATE_INIT));
        data.put("moneySucceed", redPackExchangeService.countMoneyByUidAndState(uid,RedPackExchange.STATE_SUCCESS));
        data.put("moneyReject",  redPackExchangeService.countMoneyByUidAndState(uid,RedPackExchange.STATE_REJECT));
        JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
    }
fanli/src/main/java/com/yeshi/fanli/controller/apph5/AppH5ShareController.java
@@ -13,6 +13,7 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.dto.jd.JDFilter;
import com.yeshi.fanli.dto.jd.JDSearchResult;
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
@@ -168,7 +169,7 @@
                        .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
                BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
                BigDecimal shareRate = hongBaoManageService.getShareRate();
                ConfigParamsDTO configParamsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
                for (UserShareGoodsGroup goodsGroup : list) {
                    CommonGoods commonGoods = goodsGroup.getCommonGoods();
                    if (commonGoods == null) {
@@ -216,8 +217,7 @@
                        }
                        commonGoods.setState(state);
                    }
                    GoodsDetailVO detailVO = GoodsDetailVOFactory.convertCommonGoods(commonGoods, null, fanLiRate, shareRate);
                    GoodsDetailVO detailVO = GoodsDetailVOFactory.convertCommonGoods(commonGoods, configParamsDTO);
                    if (!detailVO.isHasCoupon()) {
                        detailVO.setState(1);; // 已抢光
                    }
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/h5/AppH5CouponController.java
@@ -13,6 +13,7 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.lable.QualityFactory;
import com.yeshi.fanli.entity.bus.user.UserInfo;
@@ -25,6 +26,7 @@
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
@@ -87,6 +89,7 @@
        BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
        BigDecimal shareRate = hongBaoManageService.getShareRate();
        ConfigParamsDTO configParamsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
        /* 遍历列表数据 */
        for (QualityFactory selectionGoods : listQuery) {
@@ -116,7 +119,7 @@
            if (couplePrice.compareTo(new BigDecimal("9.9")) == 1) {
                continue; // 券后价大于10
            }
            GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
            GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, configParamsDTO);
            array.add(gson.toJson(detailVO));
        }
        JSONObject data = new JSONObject();
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/h5/AppH5TaoLiJinController.java
@@ -13,6 +13,7 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.taobao.ShareHotGoods;
import com.yeshi.fanli.entity.taobao.TLJBuyGoods;
@@ -21,6 +22,7 @@
import com.yeshi.fanli.service.inter.taobao.ShareHotGoodsService;
import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.TaoBaoConstant;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
@@ -60,6 +62,8 @@
        BigDecimal proportion = TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE;
        Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
        ConfigParamsDTO configParamsDTO = new ConfigParamsDTO(proportion, proportion, Constant.MAX_REWARD_RATE);
        for (TLJBuyGoods goods : goodsList) {
            TaoBaoGoodsBrief taoBaoGoodsBrief = goods.getGoods();
            if (taoBaoGoodsBrief == null) {
@@ -72,7 +76,7 @@
                continue;
            }
            GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, proportion, proportion);
            GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, configParamsDTO);
            // 大于1.6.5的才会显示福利价
            if (com.yeshi.fanli.util.VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion())) {
@@ -108,6 +112,8 @@
                .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
        BigDecimal fanLiRate = hongBaoManageService.getTLJShareRate(System.currentTimeMillis());
        BigDecimal shareRate = hongBaoManageService.getTLJShareRate(System.currentTimeMillis());
        ConfigParamsDTO configParamsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
        for (ShareHotGoods hotGoods : goodsList) {
            TaoBaoGoodsBrief taoBaoGoodsBrief = hotGoods.getGoods();
            if (taoBaoGoodsBrief == null) {
@@ -123,7 +129,7 @@
                continue;
            }
            GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
            GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, configParamsDTO);
            // 大于1.6.5的才会显示福利价
            if (com.yeshi.fanli.util.VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion())) {
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/BrandControllerV2.java
@@ -14,6 +14,7 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.brand.BrandGoodsCahe;
@@ -308,7 +309,7 @@
            BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
            BigDecimal shareRate = hongBaoManageService.getShareRate();
            ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
            // 商品信息过滤
            listGoodsBrief = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(listGoodsBrief);
@@ -327,8 +328,7 @@
                        continue;
                    }
                }
                GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate,
                        shareRate);
                GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO);
                array.add(gson.toJson(goodsDetailVO));
            }
        }
@@ -510,7 +510,7 @@
            BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
            BigDecimal shareRate = hongBaoManageService.getShareRate();
            ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
            // 商品信息过滤
            listGoodsBrief = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(listGoodsBrief);
@@ -529,8 +529,7 @@
                        continue;
                    }
                }
                GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate,
                        shareRate);
                GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO);
                array.add(gson.toJson(goodsDetailVO));
            }
        }
@@ -682,25 +681,25 @@
        BigDecimal shareRate = hongBaoManageService.getShareRate();
        Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
        ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
        JSONArray array = new JSONArray();
        List<BrandGoodsCahe> listGoods = brandGoodsCaheService.getByBrandId((page - 1) * 50, 50,id);
        for (BrandGoodsCahe brandGoods: listGoods) {
            JDGoods goodsJD = brandGoods.getGoodsJD();
            if (goodsJD != null) {
                array.add(gson.toJson(GoodsDetailVOFactory.convertJDGoods(goodsJD, fanLiRate, shareRate)));
                array.add(gson.toJson(GoodsDetailVOFactory.convertJDGoods(goodsJD, paramsDTO)));
                continue;
            }
            
            TaoBaoGoodsBrief goodsTB = brandGoods.getGoodsTB();
            if (goodsTB != null) {
                array.add(gson.toJson(GoodsDetailVOFactory.convertTaoBao(goodsTB, null, fanLiRate, shareRate)));
                array.add(gson.toJson(GoodsDetailVOFactory.convertTaoBao(goodsTB, paramsDTO)));
                continue;
            }
            
            PDDGoodsDetail goodsPDD = brandGoods.getGoodsPDD();
            if (goodsPDD != null) {
                array.add(gson.toJson(GoodsDetailVOFactory.convertPDDGoods(goodsPDD, fanLiRate, shareRate)));
                array.add(gson.toJson(GoodsDetailVOFactory.convertPDDGoods(goodsPDD, paramsDTO)));
                continue;
            }
        }
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/CommonContentControllerV2.java
@@ -15,6 +15,7 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.dto.common.CommonContentNav;
import com.yeshi.fanli.dto.common.CommonContentResult;
import com.yeshi.fanli.dto.common.CommonContentTypeEnum;
@@ -163,9 +164,9 @@
        List<TaoBaoGoodsBrief> goodsList = result.getGoodsList();
        BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
        BigDecimal shareRate = hongBaoManageService.getShareRate();
        ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
        for (TaoBaoGoodsBrief taoBaoGoodsBrief : goodsList) {
            GoodsDetailVO vo = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
            GoodsDetailVO vo = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO);
            if (type == CommonContentTypeEnum.mianDan)// 免单商品
            {
                vo.getMoneyInfo().setFanliMoney("¥" + TaoBaoUtil.getAfterUseCouplePrice(taoBaoGoodsBrief));
@@ -212,8 +213,9 @@
                BigDecimal shareRate = hongBaoManageService.getShareRate();
                Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                        .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
                ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
                for (JDGoods goods : goodsList) {
                    array.add(gson.toJson(GoodsDetailVOFactory.convertJDGoods(goods, fanLiRate, shareRate)));
                    array.add(gson.toJson(GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO)));
                }
            }
        }
@@ -261,8 +263,9 @@
                BigDecimal shareRate = hongBaoManageService.getShareRate();
                Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                        .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
                ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
                for (PDDGoodsDetail goods : goodsList) {
                    array.add(gson.toJson(GoodsDetailVOFactory.convertPDDGoods(goods, fanLiRate, shareRate)));
                    array.add(gson.toJson(GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO)));
                }
            }
        }
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConsumerControllerV2.java
@@ -21,6 +21,7 @@
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.goods.CollectionGoodsV2;
@@ -237,7 +238,7 @@
            BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
            BigDecimal shareRate = hongBaoManageService.getShareRate();
            ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
            for (CollectionGoodsV2 collectionGoodsV2 : collectionGoodsList) {
                CommonGoods commonGoods = collectionGoodsV2.getCommonGoods();
                if (commonGoods == null) {
@@ -258,8 +259,7 @@
                    commonGoods.setState(state);
                }
                GoodsDetailVO detailVO = GoodsDetailVOFactory.convertCommonGoods(commonGoods, null, fanLiRate,
                        shareRate);
                GoodsDetailVO detailVO = GoodsDetailVOFactory.convertCommonGoods(commonGoods, paramsDTO);
                detailVO.setId(commonGoods.getId());
                detailVO.setCreatetime(collectionGoodsV2.getCreateTime());
                list.add(detailVO);
@@ -353,14 +353,14 @@
            Gson gson = gsonBuilder.create();
            BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
            BigDecimal shareRate = hongBaoManageService.getShareRate();
            ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
            for (ScanHistoryV2 sh : list) {
                CommonGoods commonGoods = sh.getCommonGoods();
                if (commonGoods == null) {
                    continue;
                }
                GoodsDetailVO detailVO = GoodsDetailVOFactory.convertCommonGoods(commonGoods, null, fanLiRate,
                        shareRate);
                GoodsDetailVO detailVO = GoodsDetailVOFactory.convertCommonGoods(commonGoods, paramsDTO);
                detailVO.setId(commonGoods.getId());
                detailVO.setCreatetime(sh.getCreateTime());
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsClassControllerV2.java
@@ -15,6 +15,7 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
import com.yeshi.fanli.entity.bus.clazz.GoodsSubClass;
@@ -177,7 +178,8 @@
        BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
        BigDecimal shareRate = hongBaoManageService.getShareRate();
        ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
        // 精选库数据
        JSONArray array = new JSONArray();
        for (QualityFactory selectionGoods : listQuery) {
@@ -186,8 +188,7 @@
                continue;
            }
            updateGoodsList.add(taoBaoGoodsBrief);
            GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate,
                    shareRate);
            GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO);
            array.add(gson.toJson(goodsDetailVO));
        }
@@ -291,15 +292,15 @@
                        .excludeFieldsWithoutExposeAnnotation().create();
                JSONArray array = new JSONArray();
                BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
                BigDecimal shareRate = hongBaoManageService.getShareRate();
                if (resultGoodsList != null)
                if (resultGoodsList != null) {
                    BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
                    BigDecimal shareRate = hongBaoManageService.getShareRate();
                    ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
                    for (TaoBaoGoodsBrief goods : resultGoodsList) {
                        GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(goods, null, fanLiRate,
                                shareRate);
                        GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO);
                        array.add(gson2.toJson(goodsDetailVO));
                    }
                }
                JSONObject result = new JSONObject();
                result.put("result", array);
                result.put("count", result.optLong("count") + count);
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
@@ -16,6 +16,7 @@
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.taobao.TbImgUtil;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.dto.jd.JDCategoryInfo;
import com.yeshi.fanli.dto.jd.JDCouponInfo;
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
@@ -348,7 +349,8 @@
        BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
        BigDecimal shareRate = hongBaoManageService.getShareRate();
        GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertTaoBao(goods, null, fanLiRate, shareRate);
        ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
        GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO);
        if (TaoBaoUtil.isYUShou(goods)) {
            if (!StringUtil.isNullOrEmpty(goods.getPresaleDiscountFeeText())) {
@@ -639,7 +641,8 @@
        BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
        BigDecimal shareRate = hongBaoManageService.getShareRate();
        GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertJDGoods(jdGoods, fanLiRate, shareRate);
        ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
        GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertJDGoods(jdGoods, paramsDTO);
        // 附加信息
        OtherInfo otherInfo = new OtherInfo();
@@ -813,7 +816,8 @@
        BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
        BigDecimal shareRate = hongBaoManageService.getShareRate();
        GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertPDDGoods(pddGoods, fanLiRate, shareRate);
        ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
        GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertPDDGoods(pddGoods, paramsDTO);
        // 附加信息
        OtherInfo otherInfo = new OtherInfo();
@@ -971,10 +975,11 @@
                BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
                BigDecimal shareRate = hongBaoManageService.getShareRate();
                ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
                List<GoodsDetailVO> listDetailVO = new ArrayList<GoodsDetailVO>();
                for (JDGoods goods : list) {
                    listDetailVO.add(GoodsDetailVOFactory.convertJDGoods(goods, fanLiRate, shareRate));
                    listDetailVO.add(GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO));
                }
                // 取偶数个数据
@@ -1013,8 +1018,9 @@
                            BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
                            BigDecimal shareRate = hongBaoManageService.getShareRate();
                            ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
                            for (PDDGoodsDetail goods : goodsList) {
                                listDetailVO.add(GoodsDetailVOFactory.convertPDDGoods(goods, fanLiRate, shareRate));
                                listDetailVO.add(GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO));
                            }
                        }
                    }
@@ -1057,7 +1063,8 @@
                BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
                BigDecimal shareRate = hongBaoManageService.getShareRate();
                ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
                goodsList.parallelStream().forEach(goods -> {
                    if (goods != null) {
                        // 获取详情
@@ -1078,7 +1085,7 @@
                        if (taoBaoGoodsBrief != null) {
                            listExtra.add(
                                    GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate));
                                    GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO));
                        }
                    }
                });
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/HotSellControllerV2.java
@@ -12,6 +12,7 @@
import org.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.JsonUtil;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.dto.dataoke.DaTaoKeGoodsResult;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
@@ -21,6 +22,7 @@
import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.dataoke.DaTaoKeApiUtil;
import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
@@ -96,10 +98,11 @@
            if (detailList != null) {
                BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
                BigDecimal shareRate = hongBaoManageService.getShareRate();
                ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
                for (DaTaoKeDetailV2 detail : detailList) {
                    TaoBaoGoodsBrief taoBaoGoodsBrief = TaoBaoUtil.convert(detail);
                    GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
                    GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO);
                    if (cid == 2)
                        detailVO.setSalesType(2);
                    else if (cid == 3)
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/JingDongControllerV2.java
@@ -13,6 +13,7 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.homemodule.Special;
import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
@@ -117,10 +118,12 @@
            if (goodsList != null && goodsList.size() > 0) {
                BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
                BigDecimal shareRate = hongBaoManageService.getShareRate();
                ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
                Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                        .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
                for (JDGoods goods : goodsList) {
                    GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, fanLiRate, shareRate);
                    GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO);
                    array.add(gson.toJson(goodsDetailVO));
                }
            }
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/PinDuoDuoControllerV2.java
@@ -12,6 +12,7 @@
import org.yeshi.utils.JsonUtil;
import com.google.gson.Gson;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.homemodule.Special;
@@ -110,8 +111,10 @@
                Gson gson = JsonUtil.getApiCommonGson();
                BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
                BigDecimal shareRate = hongBaoManageService.getShareRate();
                ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
                for (PDDGoodsDetail goods : goodsList) {
                    GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, fanLiRate, shareRate);
                    GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO);
                    array.add(gson.toJson(goodsDetailVO));
                }
            }
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java
@@ -16,6 +16,7 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.dto.jd.JDSearchResult;
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
import com.yeshi.fanli.dto.pdd.PDDGoodsResult;
@@ -281,8 +282,7 @@
                if (taoBaoGoodsBrief == null) {
                    continue;
                }
                GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate,
                        shareRate);
                GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE));
                JSONObject params = new JSONObject();
                params.put("url", configService.get("spike_goods_link") + "?id=" + taoBaoGoodsBrief.getAuctionId());
@@ -422,8 +422,10 @@
        if (detailList != null) {
            BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
            BigDecimal shareRate = hongBaoManageService.getShareRate();
            ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
            for (DaTaoKeDetailV2 detail : detailList) {
                array.add(gson.toJson(GoodsDetailVOFactory.convertTaoBao(TaoBaoUtil.convert(detail), null, fanLiRate, shareRate)));
                array.add(gson.toJson(GoodsDetailVOFactory.convertTaoBao(TaoBaoUtil.convert(detail), paramsDTO)));
            }
        }
@@ -569,8 +571,10 @@
            BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
            BigDecimal shareRate = hongBaoManageService.getShareRate();
            ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
            for (TaoBaoGoodsBrief goods : goodsList) {
                GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goods, null, fanLiRate, shareRate);
                GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO);
                if (page < 3)
                    detailVO.setRecommend(true);
@@ -583,12 +587,12 @@
            if (page == 1) {
                List<TLJBuyGoods> list = homeRecommendGoodsService.getZiGouLiJianHotGoods(acceptData.getDevice());
                if (list != null && list.size() > 0)
                if (list != null && list.size() > 0) {
                    BigDecimal rateBuy = TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE;
                     ConfigParamsDTO paramsBuy = new ConfigParamsDTO(rateBuy, rateBuy, Constant.MAX_REWARD_RATE);
                    for (int i = list.size() - 1; i >= 0; i--) {
                        TLJBuyGoods goods = list.get(i);
                        BigDecimal rateBuy = TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE;
                        GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goods.getGoods(), null, rateBuy,
                                rateBuy);
                        GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goods.getGoods(), paramsBuy);
                        String hongBao = TaoBaoUtil.getGoodsHongBaoInfo(goods.getGoods(),
                                TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE);
@@ -608,6 +612,7 @@
                        detailVO.setRecommend(true);
                        array.add(0, gson.toJson(detailVO));
                    }
                }
            }
            JSONObject data = new JSONObject();
@@ -642,15 +647,14 @@
                    if (gList != null) {
                        BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
                        BigDecimal shareRate = hongBaoManageService.getShareRate();
                         ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
                        for (TaoBaoGoodsBrief goods : gList) {
                            if (!StringUtil.isNullOrEmpty(goods.getCouponInfo()) && goods.getCouponAmount() != null
                                    && goods.getCouponAmount().compareTo(new BigDecimal("5")) >= 0
                                    && goods.getBiz30day() > 1000
                                    && !StringUtil.isNullOrEmpty(goods.getPictUrlWhite())) {
                                GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goods, null, fanLiRate,
                                        shareRate);
                                GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO);
                                detailVO.setRecommend(true);
                                goodsList.add(detailVO);
                            }
@@ -716,10 +720,12 @@
            if (goodsList != null && goodsList.size() > 0) {
                BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
                BigDecimal shareRate = hongBaoManageService.getShareRate();
                ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
                Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                        .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
                for (JDGoods goods : goodsList) {
                    GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, fanLiRate, shareRate);
                    GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO);
                    array.add(gson.toJson(goodsDetailVO));
                }
            }
@@ -748,9 +754,10 @@
            if (goodsList != null && goodsList.size() > 0) {
                BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
                BigDecimal shareRate = hongBaoManageService.getShareRate();
                ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
                for (PDDGoodsDetail goods : goodsList) {
                    GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, fanLiRate, shareRate);
                    GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO);
                    array.add(gson.toJson(goodsDetailVO));
                }
            }
@@ -782,6 +789,7 @@
                count = arrayKeys.size();
                BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
                BigDecimal shareRate = hongBaoManageService.getShareRate();
                ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
                int j = 1;
                for (int i = (page - 1) * 3; i < arrayKeys.size(); i++) {
@@ -794,8 +802,7 @@
                    List<DaTaoKeDetailV2> listTaoKe = daTaoKeGoodsService.getSearchDiscoveryGoods(words);
                    if (listTaoKe != null && listTaoKe.size() > 0) {
                        for (DaTaoKeDetailV2 daTaoKeDetailV2 : listTaoKe) {
                            listGoods.add(GoodsDetailVOFactory.convertTaoBao(TaoBaoUtil.convert(daTaoKeDetailV2), null,
                                    fanLiRate, shareRate));
                            listGoods.add(GoodsDetailVOFactory.convertTaoBao(TaoBaoUtil.convert(daTaoKeDetailV2), paramsDTO));
                            if (listGoods.size() >= 3)
                                break;
                        }
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RedPackControllerV2.java
@@ -119,7 +119,7 @@
        String giveMax = redPackConfigService.getValueByKey("give_money_max");
        
        // 正在提现金额
        BigDecimal extractingMoney = redPackExchangeService.countMoneyByState(uid, RedPackExchange.STATE_INIT);
        BigDecimal extractingMoney = redPackExchangeService.countMoneyByUidAndState(uid, RedPackExchange.STATE_INIT);
        
        JSONObject data = new JSONObject();
        data.put("balance", balance.setScale(2).toString());
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java
@@ -23,6 +23,7 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.dto.douyin.DouYinGoods;
import com.yeshi.fanli.dto.jd.JDFilter;
import com.yeshi.fanli.dto.jd.JDSearchFilter;
@@ -350,7 +351,7 @@
                    .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
            data.put("type", type);
            data.put("goods",
                    gson.toJson(GoodsDetailVOFactory.convertCommonGoods(commonGoods, null, fanLiRate, shareRate)));
                    gson.toJson(GoodsDetailVOFactory.convertCommonGoods(commonGoods, new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE))));
            out.print(JsonUtil.loadTrueResult(data));
            return;
        }
@@ -463,7 +464,7 @@
                        JSONObject data = new JSONObject();
                        data.put("type", 3);
                        data.put("goods", gson
                                .toJson(GoodsDetailVOFactory.convertTaoBao(goodsBrief, null, fanLiRate, shareRate)));
                                .toJson(GoodsDetailVOFactory.convertTaoBao(goodsBrief, new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE))));
                        out.print(JsonUtil.loadTrueResult(data));
                        return true;
                    }
@@ -735,8 +736,10 @@
        List<GoodsDetailVO> list = new ArrayList<GoodsDetailVO>();
        BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
        BigDecimal shareRate = hongBaoManageService.getShareRate();
        ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
        for (TaoBaoGoodsBrief goods : taoBaoGoodsBriefs) {
            list.add(GoodsDetailVOFactory.convertTaoBao(goods, null, fanLiRate, shareRate));
            list.add(GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO));
        }
        Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
@@ -927,8 +930,10 @@
                BigDecimal shareRate = hongBaoManageService.getShareRate();
                Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                        .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
                ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
                for (JDGoods goods : goodsList) {
                    GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, fanLiRate, shareRate);
                    GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO);
                    if (hasCoupon) {
                        if (goodsDetailVO.isHasCoupon()) {
                            array.add(gson.toJson(goodsDetailVO));
@@ -1009,9 +1014,10 @@
            if (goodsList != null && goodsList.size() > 0) {
                BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
                BigDecimal shareRate = hongBaoManageService.getShareRate();
                ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
                for (PDDGoodsDetail goods : goodsList) {
                    GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, fanLiRate, shareRate);
                    GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO);
                    array.add(gson.toJson(goodsDetailVO));
                }
            }
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java
@@ -21,6 +21,7 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.dto.jd.JDCouponInfo;
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
import com.yeshi.fanli.dto.share.ShareGoodsRecordDTO;
@@ -1331,6 +1332,8 @@
        BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
        BigDecimal shareRate = hongBaoManageService.getShareRate();
        ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
        Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
@@ -1369,7 +1372,7 @@
            dataObject.put("totalOrder", goodsGroup.getTotalOrder());
            dataObject.put("totalMoney", "¥" + goodsGroup.getTotalMoney());
            GoodsDetailVO detailVO = GoodsDetailVOFactory.convertCommonGoods(commonGoods, null, fanLiRate, shareRate);
            GoodsDetailVO detailVO = GoodsDetailVOFactory.convertCommonGoods(commonGoods, paramsDTO);
            detailVO.setId(commonGoods.getId());
            dataObject.put("goods", gson.toJson(detailVO));
            array.add(dataObject);
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareStorageControllerV2.java
@@ -17,6 +17,7 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.UserGoodsStorage;
import com.yeshi.fanli.entity.goods.CommonGoods;
@@ -203,6 +204,7 @@
        BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
        BigDecimal shareRate = hongBaoManageService.getShareRate();
        ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
        for (UserGoodsStorage userGoodsStorage : listStorage) {
            CommonGoods commonGoods = userGoodsStorage.getCommonGoods();
@@ -235,7 +237,7 @@
                }
            }
            GoodsDetailVO detailVO = GoodsDetailVOFactory.convertCommonGoods(commonGoods, null, fanLiRate, shareRate);
            GoodsDetailVO detailVO = GoodsDetailVOFactory.convertCommonGoods(commonGoods, paramsDTO);
            detailVO.setId(commonGoods.getId());
            JSONObject dataObject = new JSONObject();
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/TaoLiJinControllerV2.java
@@ -26,6 +26,7 @@
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail.TaoLiJinDetailTypeEnum;
@@ -475,6 +476,8 @@
        BigDecimal fanLiRate = hongBaoManageService.getTLJShareRate(System.currentTimeMillis());
        BigDecimal shareRate = hongBaoManageService.getTLJShareRate(System.currentTimeMillis());
        ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
        for (ShareHotGoods hotGoods : listHot) {
            TaoBaoGoodsBrief taoBaoGoodsBrief = hotGoods.getGoods();
            if (taoBaoGoodsBrief == null) {
@@ -490,7 +493,7 @@
                continue;
            }
            GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
            GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO);
            
            // 大于1.6.5的才会显示福利价
            if (com.yeshi.fanli.util.VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion())) {
@@ -632,6 +635,7 @@
                .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
        BigDecimal proportion = TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE;
        ConfigParamsDTO paramsDTO = new ConfigParamsDTO(proportion, proportion, Constant.MAX_REWARD_RATE);
        for (TLJBuyGoods hotGoods : listHot) {
            TaoBaoGoodsBrief taoBaoGoodsBrief = hotGoods.getGoods();
            if (taoBaoGoodsBrief == null) {
@@ -646,7 +650,7 @@
                continue;
            }
            GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, proportion, proportion);
            GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO);
            // 大于1.6.5的才会显示福利价
            if (com.yeshi.fanli.util.VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion())) {
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/redpack/RedPackExchangeMapper.java
@@ -29,21 +29,14 @@
     * @param uid
     * @return
     */
    List<Long> countState(@Param("uid") long uid);
    Long countByUidAndState(@Param("uid") long uid, @Param("state") Integer state);
    
    /**
     * 统计各个状态金额
     * @param uid
     * @return
     */
    List<BigDecimal> countMoneyState(@Param("uid") long uid);
    
    /**
     * 统计状态金额
     * @param uid
     * @return
     */
    BigDecimal countMoneyByState(@Param("uid") Long uid, @Param("state") Integer state);
    BigDecimal countMoneyByUidAndState(@Param("uid") Long uid, @Param("state") Integer state);
        
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserSystemCouponActivateMapper.java
@@ -8,6 +8,14 @@
public interface UserSystemCouponActivateMapper extends BaseMapper<UserSystemCouponActivate> {
    
    /**
     * 查询更新
     * @param id
     * @return
     */
    UserSystemCouponActivate selectForUpdate(@Param("id")Long id);
    /**
     * 添加数量
     * @param id
     * @param count
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserSystemCouponMapper.java
@@ -129,6 +129,6 @@
     * @param source
     * @return
     */
    List<UserSystemCoupon> getNeedActivateFreeCouponByType(@Param("uid") Long uid, @Param("type") String type);
    UserSystemCoupon getNeedActivateCouponByType(@Param("uid") Long uid, @Param("type") String type);
    
}
fanli/src/main/java/com/yeshi/fanli/dto/ConfigParamsDTO.java
New file
@@ -0,0 +1,45 @@
package com.yeshi.fanli.dto;
import java.math.BigDecimal;
public class ConfigParamsDTO {
    // 返利比例
    private BigDecimal fanLiRate;
    // 分享比例
    private BigDecimal shareRate;
    // 奖励券最高返比例
    private BigDecimal maxRewardRate;
    public ConfigParamsDTO() {}
    public ConfigParamsDTO(BigDecimal fanLiRate, BigDecimal shareRate, BigDecimal maxRewardRate) {
        this.fanLiRate = fanLiRate;
        this.shareRate = shareRate;
        this.maxRewardRate = maxRewardRate;
    }
    public BigDecimal getFanLiRate() {
        return fanLiRate;
    }
    public void setFanLiRate(BigDecimal fanLiRate) {
        this.fanLiRate = fanLiRate;
    }
    public BigDecimal getShareRate() {
        return shareRate;
    }
    public void setShareRate(BigDecimal shareRate) {
        this.shareRate = shareRate;
    }
    public BigDecimal getMaxRewardRate() {
        return maxRewardRate;
    }
    public void setMaxRewardRate(BigDecimal maxRewardRate) {
        this.maxRewardRate = maxRewardRate;
    }
}
fanli/src/main/java/com/yeshi/fanli/dto/msg/MsgRedPackExchangeContentDTO.java
New file
@@ -0,0 +1,65 @@
package com.yeshi.fanli.dto.msg;
/**
 * 红包提现相关消息
 *
 * @author Administrator
 *
 */
public class MsgRedPackExchangeContentDTO {
    private String title; // 标题
    private String time; // 时间
    private String money; // 金额
    private String balance; // 余额
    private String reason; //原因
    private String handle; // 处理
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    public String getTime() {
        return time;
    }
    public void setTime(String time) {
        this.time = time;
    }
    public String getMoney() {
        return money;
    }
    public void setMoney(String money) {
        this.money = money;
    }
    public String getBalance() {
        return balance;
    }
    public void setBalance(String balance) {
        this.balance = balance;
    }
    public String getReason() {
        return reason;
    }
    public void setReason(String reason) {
        this.reason = reason;
    }
    public String getHandle() {
        return handle;
    }
    public void setHandle(String handle) {
        this.handle = handle;
    }
}
fanli/src/main/java/com/yeshi/fanli/dto/msg/MsgRedPackGiveContentDTO.java
New file
@@ -0,0 +1,47 @@
package com.yeshi.fanli.dto.msg;
/**
 * 红包赠送相关消息
 *
 * @author Administrator
 *
 */
public class MsgRedPackGiveContentDTO {
    private String title; // 标题
    private String userInfo; // 用户信息
    private String time; // 时间
    private String money; // 金额
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    public String getUserInfo() {
        return userInfo;
    }
    public void setUserInfo(String userInfo) {
        this.userInfo = userInfo;
    }
    public String getTime() {
        return time;
    }
    public void setTime(String time) {
        this.time = time;
    }
    public String getMoney() {
        return money;
    }
    public void setMoney(String money) {
        this.money = money;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgMoneyDetail.java
@@ -19,7 +19,6 @@
@Table("yeshi_ec_msg_money")
public class MsgMoneyDetail {
    public enum MsgTypeMoneyTypeEnum {
        share("分享奖金"),
        invite("邀请奖金"),
        fanli("返利到账"),
@@ -32,7 +31,12 @@
        orderReward("返利奖励"),
        systemEqualize("系统补齐"),
        fanliElme("返利到账"),
        subSidy("额外补贴");
        subSidy("额外补贴"),
        redPackGiveOff("赠送红包完成"),
        redPackReceiveOff("赠送红包领取"),
        redPackExchangePass("红包提现成功"),
        redPackExchangeReject("红包提现失败");
        private final String desc;
        private MsgTypeMoneyTypeEnum(String desc) {
@@ -77,6 +81,8 @@
    private Date updateTime;
    @Column(name = "mm_read")
    private Boolean read;
    @Column(name = "mm_content") // 消息内容
    private String content;
    public Long getId() {
        return id;
@@ -213,4 +219,12 @@
    public void setDesc(String desc) {
        this.desc = desc;
    }
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/money/UserMoneyDetail.java
@@ -53,7 +53,7 @@
        orderReward("返利奖励金", "http://img.flqapp.com/resource/money_detail/icon_order_reward.png", ""),
        repeatStatistic("重复统计返利/奖金扣除", "http://img.flqapp.com/resource/money_detail/icon_fanli.png", ""),
        elmeFanli("饿了么返利到账", "http://img.flqapp.com/resource/money_detail/icon_fanli.png", ""),
        redPackExchange("红包提现到余额", "http://img.flqapp.com/resource/money_detail/icon_score.png", ""),
        redPackExchange("红包提现到余额", "http://img.flqapp.com/resource/msg/icon_hongbao_tixian.png", ""),
        extractAutoWX("自动提现", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),
        extractAutoWXRefund("自动提现失败", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),
        subsidy("额外补贴", "http://img.flqapp.com/resource/msg/icon_msg_subsidy.png", "");
fanli/src/main/java/com/yeshi/fanli/entity/redpack/RedPackDetail.java
@@ -29,10 +29,11 @@
        giveOthers("红包赠送待领取中", "http://img.flqapp.com/img/tlj/icon_tlj.png"), 
        giveOthersSucceed("红包赠送领取成功", "http://img.flqapp.com/img/tlj/icon_tlj.png"), 
        giveOthersFail("红包赠送超时退回", "http://img.flqapp.com/img/tlj/icon_tlj.png"), 
        giveOthersReceive("好友赠送", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        
        redExchange("红包提现中", "http://img.flqapp.com/resource/money_detail/icon_score.png"),
        redExchangePass("红包提现成功", "http://img.flqapp.com/resource/money_detail/icon_score.png"),
        redExchangeReject("红包提现失败", "http://img.flqapp.com/resource/money_detail/icon_score.png");
        redExchange("红包提现中", "http://img.flqapp.com/resource/msg/icon_hongbao_tixian.png"),
        redExchangePass("红包提现成功", "http://img.flqapp.com/resource/msg/icon_hongbao_tixian.png"),
        redExchangeReject("红包提现失败", "http://img.flqapp.com/resource/msg/icon_hongbao_tixian.png");
        private final String desc;
        private final String picture;
fanli/src/main/java/com/yeshi/fanli/mapping/msg/MsgMoneyDetailMapper.xml
@@ -18,6 +18,7 @@
        <result column="mm_read" property="read" jdbcType="BOOLEAN" />
        <result column="mm_order_type" property="orderType" jdbcType="INTEGER" />
        <result column="mm_desc" property="desc" jdbcType="VARCHAR" />
        <result column="mm_content" property="content" jdbcType="VARCHAR" />
        <association property="user" column="mm_uid"
            javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
            <id column="mm_uid" property="id" jdbcType="BIGINT" />
@@ -27,7 +28,7 @@
        <association property="alipayAccountValid" column="mm_source_id_alipayvalid"
            select="com.yeshi.fanli.dao.mybatis.AlipayAccountValidNormalHistoryMapper.selectByPrimaryKey" />
    </resultMap>
    <sql id="Base_Column_List">mm_id,mm_uid,mm_type,mm_order_count,mm_goods_count,mm_order_id,mm_source_id,mm_money,mm_balance,mm_state_desc,mm_beizhu,mm_create_time,mm_update_time,mm_read,mm_order_type,mm_desc
    <sql id="Base_Column_List">mm_id,mm_uid,mm_type,mm_order_count,mm_goods_count,mm_order_id,mm_source_id,mm_money,mm_balance,mm_state_desc,mm_beizhu,mm_create_time,mm_update_time,mm_read,mm_order_type,mm_desc,mm_content
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
@@ -58,9 +59,9 @@
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail"
        useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_msg_money
        (mm_id,mm_uid,mm_type,mm_order_count,mm_goods_count,mm_order_id,mm_source_id,mm_money,mm_balance,mm_state_desc,mm_beizhu,mm_create_time,mm_update_time,mm_read,mm_order_type,mm_desc)
        (mm_id,mm_uid,mm_type,mm_order_count,mm_goods_count,mm_order_id,mm_source_id,mm_money,mm_balance,mm_state_desc,mm_beizhu,mm_create_time,mm_update_time,mm_read,mm_order_type,mm_desc,mm_content)
        values
        (#{id,jdbcType=BIGINT},#{user.id,jdbcType=BIGINT},#{msgType,jdbcType=VARCHAR},#{orderCount,jdbcType=INTEGER},#{goodsCount,jdbcType=INTEGER},#{orderId,jdbcType=VARCHAR},#{extract.id,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{balance,jdbcType=DECIMAL},#{stateDesc,jdbcType=VARCHAR},#{beiZhu,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{read,jdbcType=BOOLEAN},#{orderType,jdbcType=INTEGER},#{desc,jdbcType=VARCHAR})
        (#{id,jdbcType=BIGINT},#{user.id,jdbcType=BIGINT},#{msgType,jdbcType=VARCHAR},#{orderCount,jdbcType=INTEGER},#{goodsCount,jdbcType=INTEGER},#{orderId,jdbcType=VARCHAR},#{extract.id,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{balance,jdbcType=DECIMAL},#{stateDesc,jdbcType=VARCHAR},#{beiZhu,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{read,jdbcType=BOOLEAN},#{orderType,jdbcType=INTEGER},#{desc,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail"
        useGeneratedKeys="true" keyProperty="id">
@@ -83,6 +84,7 @@
            <if test="read != null">mm_read,</if>
            <if test="orderType != null">mm_order_type,</if>
            <if test="desc != null">mm_desc,</if>
            <if test="content != null">mm_content,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -103,6 +105,7 @@
            <if test="read != null">#{read,jdbcType=BOOLEAN},</if>
            <if test="orderType != null">#{orderType,jdbcType=INTEGER}</if>
            <if test="desc != null">#{desc,jdbcType=VARCHAR},</if>
            <if test="content != null">#{content,jdbcType=VARCHAR},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail">update
@@ -119,7 +122,8 @@
        #{createTime,jdbcType=TIMESTAMP},mm_update_time =
        #{updateTime,jdbcType=TIMESTAMP},mm_read = #{read,jdbcType=BOOLEAN}
        ,mm_order_type =#{orderType,jdbcType=INTEGER},
        mm_desc = #{desc,jdbcType=VARCHAR} where mm_id =
        mm_desc = #{desc,jdbcType=VARCHAR},
        mm_content = #{content,jdbcType=VARCHAR} where mm_id =
        #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail">
@@ -142,6 +146,7 @@
            <if test="read != null">mm_read=#{read,jdbcType=BOOLEAN},</if>
            <if test="orderType !=null">mm_order_type =#{orderType,jdbcType=INTEGER},</if>
            <if test="desc != null">mm_desc=#{desc,jdbcType=VARCHAR},</if>
            <if test="content != null">mm_content=#{content,jdbcType=VARCHAR},</if>
        </set>
        where mm_id = #{id,jdbcType=BIGINT}
    </update>
fanli/src/main/java/com/yeshi/fanli/mapping/redpack/RedPackDetailMapper.xml
@@ -68,10 +68,14 @@
    </set> where rpd_id = #{id,jdbcType=BIGINT}
  </update>
  
  <select id="getByIdentifyCode" resultMap="BaseResultMap">
      SELECT * FROM `yeshi_red_pack_detail` t
    WHERE t.`rpd_identify_code` = #{identifyCode}
  </select>
  
  <select id="countUseMoneyByDate" resultType="java.math.BigDecimal">
      SELECT IFNULL(SUM(t.`rpd_money`),0) FROM `yeshi_red_pack_detail` t
    WHERE t.`rpd_money` <![CDATA[<]]> 0 AND t.`rpd_uid` = #{uid} AND t.`rpd_type` <![CDATA[<>]]> 'violation'
    WHERE t.rpd_display = 1 AND t.`rpd_money` <![CDATA[<]]> 0 AND t.`rpd_uid` = #{uid} AND t.`rpd_type` <![CDATA[<>]]> 'violation'
        <if test="dateType == 1"> <!-- 今日  -->
            AND TO_DAYS(t.`rpd_create_time`) =  TO_DAYS(NOW());
        </if>
@@ -89,7 +93,7 @@
  
  <select id="countAddMoneyByDate" resultType="java.math.BigDecimal">
      SELECT IFNULL(SUM(t.`rpd_money`),0) FROM `yeshi_red_pack_detail` t
    WHERE t.`rpd_money` <![CDATA[>]]> 0  AND t.`rpd_uid` = #{uid} AND  t.`rpd_type`<![CDATA[<>]]>'refund'
    WHERE t.rpd_display = 1 AND t.`rpd_money` <![CDATA[>]]> 0  AND t.`rpd_uid` = #{uid} AND  t.`rpd_type`<![CDATA[<>]]>'refund'
        <if test="dateType == 1"> <!-- 今日  -->
            AND TO_DAYS(t.`rpd_create_time`) =  TO_DAYS(NOW());
        </if>
@@ -106,14 +110,14 @@
  
  <select id="selectByMaxCreateTime" resultMap="BaseResultMap">
    SELECT <include refid="Base_Column_List" /> FROM yeshi_red_pack_detail t
    WHERE t.`rpd_uid`=#{uid} AND t.`rpd_create_time`<![CDATA[<=]]> #{date}
    WHERE t.rpd_display = 1 AND t.`rpd_uid`=#{uid} AND t.`rpd_create_time`<![CDATA[<=]]> #{date}
    ORDER BY t.`rpd_create_time` DESC,t.rpd_id DESC
    LIMIT #{count}
  </select>
  
  <select id="selectByUidWithIndexId" resultMap="BaseResultMap">
    SELECT <include refid="Base_Column_List" />    FROM yeshi_red_pack_detail t 
    WHERE t.`rpd_uid`=#{uid}
    WHERE t.rpd_display = 1 AND t.`rpd_uid`=#{uid}
        AND t.`rpd_create_time`<![CDATA[<=]]>(SELECT rpd_create_time FROM yeshi_red_pack_detail WHERE rpd_id =#{id})
    ORDER BY t.`rpd_create_time` DESC,t.rpd_id DESC
    LIMIT #{count}
@@ -127,13 +131,13 @@
                FROM (SELECT  #{item} AS `time`) c 
                LEFT JOIN (SELECT DATE_FORMAT(d.`rpd_create_time`,'%Y-%m') AS `time`,SUM(d.`rpd_money`)AS money
                               FROM `yeshi_red_pack_detail` d
                               WHERE d.`rpd_uid`=#{uid} AND  d.`rpd_money`<![CDATA[>=]]>0 AND DATE_FORMAT(d.`rpd_create_time`,'%Y-%m')=#{item}
                               WHERE d.rpd_display = 1 AND d.`rpd_uid`=#{uid} AND  d.`rpd_money`<![CDATA[>=]]>0 AND DATE_FORMAT(d.`rpd_create_time`,'%Y-%m')=#{item}
                               GROUP BY DATE_FORMAT(d.`rpd_create_time`,'%Y-%m')
                               ) a ON a.time=c.time
                LEFT JOIN(SELECT DATE_FORMAT(d.`rpd_create_time`,'%Y-%m') AS `time`,SUM(d.`rpd_money`) AS money
                              FROM `yeshi_red_pack_detail` d
                            WHERE d.`rpd_uid`=#{uid} AND d.`rpd_money` <![CDATA[<]]>0 AND DATE_FORMAT(d.`rpd_create_time`,'%Y-%m')=#{item}
                            WHERE d.rpd_display = 1 AND d.`rpd_uid`=#{uid} AND d.`rpd_money` <![CDATA[<]]>0 AND DATE_FORMAT(d.`rpd_create_time`,'%Y-%m')=#{item}
                              GROUP BY DATE_FORMAT(d.`rpd_create_time`,'%Y-%m')
                              ) b ON c.time=b.time
           </trim>
@@ -142,19 +146,19 @@
  
  <select id="selectCountByUid" resultType="java.lang.Long"  parameterType="java.lang.Long">
    SELECT count(rpd_id) FROM yeshi_red_pack_detail
    WHERE rpd_uid=#{uid}
    WHERE rpd_display = 1 AND rpd_uid=#{uid}
  </select>
  
  <select id="selectMonthCountByUid" resultType="java.lang.Integer">
    SELECT COUNT(*) FROM 
            (SELECT * FROM yeshi_red_pack_detail d 
             WHERE d.`rpd_uid`=#{uid} AND d.`rpd_create_time` <![CDATA[<=]]> #{date}
             WHERE d.rpd_display = 1 AND d.`rpd_uid`=#{uid} AND d.`rpd_create_time` <![CDATA[<=]]> #{date}
             GROUP BY DATE_FORMAT(d.`rpd_create_time`,'%y-%m')
             ) a
  </select>
  
  <select id="selectCountByUidAndMaxCreateTime" resultType="java.lang.Long">
    SELECT count(rpd_id) FROM yeshi_red_pack_detail
    WHERE rpd_uid=#{uid} and `rpd_create_time`<![CDATA[<=]]>#{date}
    WHERE rpd_display = 1 AND rpd_uid=#{uid} and `rpd_create_time`<![CDATA[<=]]>#{date}
 </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/redpack/RedPackExchangeMapper.xml
@@ -62,7 +62,7 @@
         <if test="state != null ">
            AND d.rpe_state = #{state}
        </if>
    ORDER BY d.`rpe_state`,d.`rpe_create_time`
    ORDER BY  d.`rpe_state`,d.`rpe_create_time` DESC
    LIMIT #{start},#{count}
  </select>
  
@@ -77,21 +77,12 @@
        </if>
  </select>
  
  <select id="countState" resultType="Long">
      SELECT IFNULL(COUNT(d.rpe_id),0) FROM yeshi_red_pack_exchange d
    WHERE d.rpe_uid = #{uid}
    GROUP BY d.`rpe_state`
    ORDER BY d.`rpe_state`
  <select id="countByUidAndState" resultType="Long">
    SELECT IFNULL(COUNT(d.rpe_id),0) FROM yeshi_red_pack_exchange d
    WHERE d.rpe_uid = #{uid} AND d.`rpe_state` = #{state}
  </select>
  
  <select id="countMoneyState" resultType="BigDecimal">
      SELECT IFNULL(SUM(d.rpe_money),0) FROM yeshi_red_pack_exchange d
    WHERE d.rpe_uid = #{uid}
    GROUP BY d.`rpe_state`
    ORDER BY d.`rpe_state`
  </select>
  <select id="countMoneyByState" resultType="BigDecimal">
  <select id="countMoneyByUidAndState" resultType="BigDecimal">
      SELECT IFNULL(SUM(d.rpe_money),0) FROM yeshi_red_pack_exchange d
    WHERE d.rpe_uid = #{uid} AND d.`rpe_state` = #{state}
  </select>
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponActivateMapper.xml
@@ -41,6 +41,12 @@
    </set> where usca_id = #{id,jdbcType=BIGINT}
  </update>
  
  <select id="selectForUpdate" resultMap="BaseResultMap" >
   SELECT * FROM  yeshi_ec_user_system_coupon_activate
    WHERE usca_id = #{id}  FOR UPDATE
  </select>
  <select id="addCount">
      UPDATE yeshi_ec_user_system_coupon_activate 
      SET usca_count = usca_count + #{count},usca_update_time = NOW() 
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponMapper.xml
@@ -19,7 +19,24 @@
        javaType="com.yeshi.fanli.entity.system.SystemCoupon">
        <id column="usc_coupon_id" property="id" jdbcType="BIGINT" />    
    </association>
  </resultMap>
   <resultMap id="AllResultMap" type="com.yeshi.fanli.entity.bus.user.UserSystemCoupon">
    <id column="usc_id" property="id" jdbcType="BIGINT"/>
    <result column="usc_uid" property="uid" jdbcType="BIGINT"/>
    <result column="usc_source" property="source" jdbcType="VARCHAR"/>
    <result column="usc_give" property="give" jdbcType="VARCHAR"/>
    <result column="usc_state" property="state" jdbcType="INTEGER"/>
    <result column="usc_state_activate" property="stateActivated" jdbcType="INTEGER"/>
    <result column="usc_start_time" property="startTime" jdbcType="TIMESTAMP"/>
    <result column="usc_end_time" property="endTime" jdbcType="TIMESTAMP"/>
    <result column="usc_use_time" property="useTime" jdbcType="TIMESTAMP"/>
    <result column="usc_create_time" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="usc_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
    
    <association property="systemCoupon" column="usc_coupon_id"
            resultMap="com.yeshi.fanli.dao.mybatis.SystemCouponMapper.BaseResultMap"/>
  </resultMap>
  
   <resultMap id="ResultVOMap" type="com.yeshi.fanli.vo.user.UserSystemCouponVO">
@@ -222,11 +239,14 @@
    WHERE t.usc_uid = #{uid} AND c.`sc_type`= #{type} 
  </select>
  
  <select id="getNeedActivateFreeCouponByType" resultMap="BaseResultMap">
  <select id="getNeedActivateCouponByType" resultMap="AllResultMap">
     SELECT * FROM `yeshi_ec_user_system_coupon` t
    LEFT JOIN `yeshi_ec_system_coupon` c ON t.`usc_coupon_id` = c.`sc_id`
    WHERE t.usc_uid = #{uid} AND c.`sc_type`= #{type}  AND (t.usc_state_activate = 0 OR t.usc_state_activate is null)
    WHERE t.usc_uid = #{uid} AND c.`sc_type`= #{type} AND t.`usc_state` = 1
         AND (t.usc_state_activate = 0 OR t.usc_state_activate is null)
         AND t.`usc_end_time` <![CDATA[>]]> NOW()
    ORDER BY usc_id
    LIMIT 1
  </select>
  
</mapper>
fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandClassShopServiceImpl.java
@@ -16,6 +16,7 @@
import org.yeshi.utils.JsonUtil;
import com.yeshi.fanli.dao.mybatis.brand.BrandClassShopMapper;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.entity.brand.BrandClass;
import com.yeshi.fanli.entity.brand.BrandClassShop;
import com.yeshi.fanli.entity.goods.CommonGoods;
@@ -432,6 +433,7 @@
        BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
        BigDecimal shareRate = hongBaoManageService.getShareRate();
        ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
        // 淘宝商品信息过滤
        Map<Long, TaoBaoGoodsBrief> goodsMap = getFilterTaoBaoGoods(listInfo);
@@ -467,7 +469,7 @@
            taoBaoGoodsUpdateService.addUpdateQueueAsync(listGoodsBrief);
            for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) {
                GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory
                        .convertTaoBao(goodsMap.get(taoBaoGoodsBrief.getAuctionId()), null, fanLiRate, shareRate);
                        .convertTaoBao(goodsMap.get(taoBaoGoodsBrief.getAuctionId()),paramsDTO);
                listGoods.add(goodsDetailVO);
            }
            taoBaoShopVO.setListGoodsVO(listGoods);
@@ -538,7 +540,7 @@
        BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
        BigDecimal shareRate = hongBaoManageService.getShareRate();
        ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
        // 淘宝商品信息过滤
        Map<Long, TaoBaoGoodsBrief> goodsMap = getFilterTaoBaoGoods(listInfo);
@@ -559,7 +561,7 @@
            taoBaoGoodsUpdateService.addUpdateQueueAsync(listGoodsBrief);
            for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) {
                GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory
                        .convertTaoBao(goodsMap.get(taoBaoGoodsBrief.getAuctionId()), null, fanLiRate, shareRate);
                        .convertTaoBao(goodsMap.get(taoBaoGoodsBrief.getAuctionId()), paramsDTO);
                listGoods.add(goodsDetailVO);
            }
            taoBaoShopVO.setListGoodsVO(listGoods);
fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandInfoServiceImpl.java
@@ -17,6 +17,7 @@
import com.yeshi.fanli.dao.brand.BrandShopCaheDao;
import com.yeshi.fanli.dao.mybatis.brand.BrandInfoMapper;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
import com.yeshi.fanli.entity.brand.BrandGoodsCahe;
import com.yeshi.fanli.entity.brand.BrandInfo;
@@ -306,7 +307,7 @@
        BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
        BigDecimal shareRate = hongBaoManageService.getShareRate();
        ConfigParamsDTO configParamsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
        List<BrandInfoVO> listInfo = new ArrayList<BrandInfoVO>();
        for (int i = 0; i < list.size(); i++) {
            BrandInfoVO brand = list.get(i);
@@ -321,19 +322,19 @@
            for (BrandGoodsCahe brandGoods : listGoods) {
                JDGoods goodsJD = brandGoods.getGoodsJD();
                if (goodsJD != null) {
                    listGoodsVO.add(GoodsDetailVOFactory.convertJDGoods(goodsJD, fanLiRate, shareRate));
                    listGoodsVO.add(GoodsDetailVOFactory.convertJDGoods(goodsJD, configParamsDTO));
                    continue;
                }
                TaoBaoGoodsBrief goodsTB = brandGoods.getGoodsTB();
                if (goodsTB != null) {
                    listGoodsVO.add(GoodsDetailVOFactory.convertTaoBao(goodsTB, null, fanLiRate, shareRate));
                    listGoodsVO.add(GoodsDetailVOFactory.convertTaoBao(goodsTB, configParamsDTO));
                    continue;
                }
                PDDGoodsDetail goodsPDD = brandGoods.getGoodsPDD();
                if (goodsPDD != null) {
                    listGoodsVO.add(GoodsDetailVOFactory.convertPDDGoods(goodsPDD, fanLiRate, shareRate));
                    listGoodsVO.add(GoodsDetailVOFactory.convertPDDGoods(goodsPDD, configParamsDTO));
                    continue;
                }
            }
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/DynamicInfoServiceImpl.java
@@ -21,6 +21,7 @@
import org.yeshi.utils.taobao.TbImgUtil;
import com.yeshi.fanli.dao.dynamic.DynamicInfoDao;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.dto.taobao.TaoBaoShopDTO;
import com.yeshi.fanli.entity.bus.activity.ActivityRuleUser;
import com.yeshi.fanli.entity.bus.activity.ActivityUser;
@@ -966,6 +967,8 @@
            BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
            BigDecimal shareRate = hongBaoManageService.getShareRate();
            ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
            for (DynamicInfo dynamicInfo : list) {
                DynamicInfo dynamicNew = new DynamicInfo();
                try {
@@ -1020,8 +1023,7 @@
                        goods.setCouponStartFee(goodsMap.get(goods.getAuctionId()).getCouponStartFee());
                        goods.setTkRate(goodsMap.get(goods.getAuctionId()).getTkRate());
                        GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBaoGoodsBriefExtra(goods, fanLiRate,
                                shareRate);
                        GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBaoGoodsBriefExtra(goods, paramsDTO);
                        goodsNew.setGoodsVO(detailVO);
                        goodsNew.setGoods(null);
fanli/src/main/java/com/yeshi/fanli/service/impl/lable/QualityGoodsServiceImpl.java
@@ -17,6 +17,7 @@
import com.yeshi.fanli.dao.mybatis.lable.LabelGoodsMapper;
import com.yeshi.fanli.dao.mybatis.lable.QualityFactoryMapper;
import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoGoodsBriefMapper;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.entity.bus.lable.Label;
import com.yeshi.fanli.entity.bus.lable.LabelGoods;
import com.yeshi.fanli.entity.bus.lable.QualityFactory;
@@ -28,6 +29,7 @@
import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
@@ -377,8 +379,10 @@
        }
        BigDecimal shareRate = hongBaoManageService.getShareRate();
        ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
        for (TaoBaoGoodsBrief taoBaoGoodsBrief : goodsList) {
            GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
            GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief,paramsDTO);
            array.add(gson.toJson(detailVO));
        }
fanli/src/main/java/com/yeshi/fanli/service/impl/lable/TaoKeGoodsServiceImpl.java
@@ -16,6 +16,7 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.entity.bus.lable.QualityFactory;
import com.yeshi.fanli.entity.taobao.SearchFilter;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
@@ -27,6 +28,7 @@
import com.yeshi.fanli.service.inter.lable.TaoKeGoodsService;
import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
@@ -297,6 +299,7 @@
        BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
        BigDecimal shareRate = hongBaoManageService.getShareRate();
        ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
        if (fq == 0 && fh == 0 && !ft) {
            if (result != null && result.getTaoBaoGoodsBriefs() != null)
@@ -311,7 +314,7 @@
                        }
                    }
                    GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(bf, null, fanLiRate, shareRate);
                    GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(bf, paramsDTO);
                    re.add(goodsDetailVO);
                }
        } else {
@@ -326,7 +329,7 @@
                            break;
                        }
                    }
                    GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
                    GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO);
                    re.add(goodsDetailVO);
                }
        }
fanli/src/main/java/com/yeshi/fanli/service/impl/money/msg/MsgMoneyDetailServiceImpl.java
@@ -126,6 +126,15 @@
                update.setStateDesc(detail.getStateDesc());
                msgMoneyDetailMapper.updateByPrimaryKeySelective(update);
            }
        } else if (detail.getMsgType() == MsgTypeMoneyTypeEnum.redPackGiveOff
                || detail.getMsgType() == MsgTypeMoneyTypeEnum.redPackExchangePass
                || detail.getMsgType() == MsgTypeMoneyTypeEnum.redPackExchangeReject) {
            if (detail.getUser() == null)
                throw new MsgMoneyDetailException(2, "消息信息不全");
            detail.setCreateTime(new Date());
            detail.setUpdateTime(new Date());
            detail.setRead(false);
            msgMoneyDetailMapper.insertSelective(detail);
        } else if (detail.getMsgType() == MsgTypeMoneyTypeEnum.subSidy) {
            if (detail.getMoney() == null || detail.getUser() == null)
                throw new MsgMoneyDetailException(2, "消息信息不全");
fanli/src/main/java/com/yeshi/fanli/service/impl/money/msg/UserMoneyMsgNotificationServiceImpl.java
@@ -10,6 +10,7 @@
import com.yeshi.fanli.dto.push.PushContentDTO;
import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail;
import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
import com.yeshi.fanli.entity.bus.user.AlipayAccountValidNormalHistory;
import com.yeshi.fanli.entity.bus.user.Extract;
import com.yeshi.fanli.entity.bus.user.ExtractWeiXinRecord;
@@ -284,6 +285,17 @@
            e.printStackTrace();
        }
    }
    @Async
    @Override
    public void redPackMsg(Long uid, MsgTypeMoneyTypeEnum type, String content, String beiZhu) {
        MsgMoneyDetail detail = MsgMoneyDetailFactory.createRedPackMsg(uid, type, content, beiZhu);
        try {
            msgMoneyDetailService.addMsgMoneyDetail(detail);
        } catch (MsgMoneyDetailException e) {
            e.printStackTrace();
        }
    }
    @Override
    public void inviteOrderSubSidy(Long uid, Date date, String from, BigDecimal money, BigDecimal balance) {
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackExchangeServiceImpl.java
@@ -1,15 +1,20 @@
package com.yeshi.fanli.service.impl.redpack;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.omg.CORBA.LongHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.google.gson.Gson;
import com.yeshi.fanli.dao.mybatis.redpack.RedPackExchangeMapper;
import com.yeshi.fanli.dto.msg.MsgRedPackExchangeContentDTO;
import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.common.AdminUser;
import com.yeshi.fanli.entity.money.UserMoneyDetail;
@@ -18,7 +23,9 @@
import com.yeshi.fanli.entity.redpack.RedPackDetail.RedPackDetailTypeEnum;
import com.yeshi.fanli.entity.redpack.RedPackExchange;
import com.yeshi.fanli.exception.redpack.RedPackExchangeException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.money.UserMoneyService;
import com.yeshi.fanli.service.inter.money.msg.UserMoneyMsgNotificationService;
import com.yeshi.fanli.service.inter.redpack.RedPackBalanceService;
import com.yeshi.fanli.service.inter.redpack.RedPackConfigService;
import com.yeshi.fanli.service.inter.redpack.RedPackDetailService;
@@ -45,6 +52,9 @@
    @Resource
    private RedPackDetailService redPackDetailService;
    
    @Resource
    private UserMoneyMsgNotificationService userMoneyMsgNotificationService;
    
    @Override
    public List<RedPackExchange> query(Integer start, Integer count, String key, Integer state){
@@ -57,19 +67,13 @@
    }
    
    @Override
    public List<Long> countState(long uid){
        return redPackExchangeMapper.countState(uid);
    }
    @Override
    public List<BigDecimal> countMoneyState(long uid){
        return redPackExchangeMapper.countMoneyState(uid);
    public Long countByUidAndState(long uid, Integer state) {
        return redPackExchangeMapper.countByUidAndState(uid, state);
    }
    
    @Override
    public BigDecimal countMoneyByState(Long uid, Integer state){
        return redPackExchangeMapper.countMoneyByState(uid, state);
    public BigDecimal countMoneyByUidAndState(Long uid, Integer state){
        return redPackExchangeMapper.countMoneyByUidAndState(uid, state);
    }
    
    @Override
@@ -125,7 +129,7 @@
        if (record == null) 
            throw new RedPackExchangeException(1,"申请记录已不存在");
        if (RedPackExchange.STATE_INIT == record.getState())
        if (RedPackExchange.STATE_INIT != record.getState())
            throw new RedPackExchangeException(1,"该申请已被处理,请刷新");
        Date nowDate = new Date();
@@ -148,14 +152,28 @@
        // 添加资金
        userMoneyService.addUserMoney(record.getUid(), record.getMoney(), detail);
        
        // 更新红包提现明细
        try {
            String identifyCode = StringUtil.Md5(RedPackDetailTypeEnum.redExchangePass.name() + ":" + record.getId());
            String identifyCode = StringUtil.Md5(RedPackDetailTypeEnum.redExchange.name() + ":" + record.getId());
            RedPackDetail redPackDetail = redPackDetailService.getByIdentifyCode(identifyCode);
            // 创建明细更新
            RedPackDetail updateDetail = RedPackDetailFactory.updateExchangePass(redPackDetail.getId(), record);
            redPackDetailService.updateByPrimaryKeySelective(updateDetail);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
            throw new RedPackExchangeException(1,"更新提现明细出错");
        }
        //消息
        SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
        String beizu = "红包提现成功后请到“我的-账户余额”中查看";
        MsgRedPackExchangeContentDTO dto = new MsgRedPackExchangeContentDTO();
        dto.setTitle("红包提现");
        dto.setTime(sd.format(record.getCreateTime()));
        dto.setHandle("人工审核" + sd.format(new Date()));
        dto.setMoney("¥" + record.getMoney().setScale(2));
        dto.setBalance("¥" + redPackBalanceService.getBalance(record.getUid()));
        userMoneyMsgNotificationService.redPackMsg(record.getUid(), MsgTypeMoneyTypeEnum.redPackExchangePass, new Gson().toJson(dto), beizu);
    }
    
@@ -166,7 +184,7 @@
        if (record == null) 
            throw new RedPackExchangeException(1,"申请记录已不存在");
        if (RedPackExchange.STATE_INIT == record.getState())
        if (RedPackExchange.STATE_INIT != record.getState())
            throw new RedPackExchangeException(1,"该申请已被处理,请刷新");
        
        record.setReason(reason);
@@ -177,10 +195,20 @@
        
        // 退回红包
        try {
            redPackBalanceService.addRedPack(record.getUid(), record.getMoney(), RedPackDetailFactory.createExchange(record));
            redPackBalanceService.addRedPack(record.getUid(), record.getMoney(), RedPackDetailFactory.createExchangeReject(record));
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
            throw new RedPackExchangeException(1, "红包退回时出错");
        }
        //消息
        SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
        MsgRedPackExchangeContentDTO dto = new MsgRedPackExchangeContentDTO();
        dto.setTitle("红包提现");
        dto.setReason(reason);
        dto.setHandle(""); // TODO 处理方式待定
        dto.setTime(sd.format(record.getCreateTime()));
        userMoneyMsgNotificationService.redPackMsg(record.getUid(), MsgTypeMoneyTypeEnum.redPackExchangeReject, new Gson().toJson(dto), null);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackGiveRecordServiceImpl.java
@@ -12,14 +12,17 @@
import com.yeshi.fanli.dao.mybatis.redpack.RedPackGiveRecordMapper;
import com.yeshi.fanli.entity.bus.user.TokenRecord;
import com.yeshi.fanli.entity.bus.user.TokenRecord.TokenTypeEnum;
import com.yeshi.fanli.entity.redpack.RedPackDetail;
import com.yeshi.fanli.entity.redpack.RedPackDetail.RedPackDetailTypeEnum;
import com.yeshi.fanli.entity.redpack.RedPackGiveRecord;
import com.yeshi.fanli.exception.redpack.RedPackGiveRecordException;
import com.yeshi.fanli.service.inter.redpack.RedPackBalanceService;
import com.yeshi.fanli.service.inter.redpack.RedPackConfigService;
import com.yeshi.fanli.service.inter.redpack.RedPackDetailService;
import com.yeshi.fanli.service.inter.redpack.RedPackGiveRecordService;
import com.yeshi.fanli.service.inter.user.TokenRecordService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TokenUtil;
import com.yeshi.fanli.util.factory.RedPackDetailFactory;
@@ -38,6 +41,22 @@
    
    @Resource
    private TokenRecordService tokenRecordService;
    @Resource
    private RedPackDetailService redPackDetailService;
    @Override
    public RedPackGiveRecord selectByPrimaryKey(Long id) {
        return redPackGiveRecordMapper.selectByPrimaryKey(id);
    }
    @Override
    public void updateByPrimaryKeySelective(RedPackGiveRecord record) {
        redPackGiveRecordMapper.updateByPrimaryKeySelective(record);
    }
    
    @Override
    @Transactional(rollbackFor = Exception.class)
@@ -85,14 +104,54 @@
            tips = tips.replace("{APP名称}", projectChineseName);
        }
        tips = tips.replace("{口令}", token).replace("{下载链接}", redPackConfigService.getValueByKey("app_down_link")).replace("{面额}",
                amount.setScale(0).toString());
                amount.toString());
        
        // 减少红包
        try {
            redPackBalanceService.subRedPack(uid, amount, RedPackDetailFactory.createGiveOthers(giveRecord, null, RedPackDetailTypeEnum.giveOthers));
            redPackBalanceService.subRedPack(uid, amount, RedPackDetailFactory.createGiveOthers(giveRecord));
        } catch (Exception e) {
            throw new RedPackGiveRecordException(1, "红包创建失败");
        }
        return tips;
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public RedPackGiveRecord receiveFriendsGive(Long uid, Long id) throws RedPackGiveRecordException{
        RedPackGiveRecord giveRecord = redPackGiveRecordMapper.selectByPrimaryKey(id);
        if (giveRecord == null || giveRecord.getState() != RedPackGiveRecord.STATE_INIT)
            throw new RedPackGiveRecordException(1, "赠送记录失效或已被领取");
        Date now = new Date();
        Date endTime = giveRecord.getEndTime();
        if (endTime != null && endTime.getTime() < now.getTime())
            throw new RedPackGiveRecordException(1, "红包已失效了");
        giveRecord.setGiveUid(uid);
        giveRecord.setReceiveTime(now);
        giveRecord.setState(RedPackGiveRecord.STATE_RECEIVE);
        // 领取人增加红包
        try {
            redPackBalanceService.addRedPack(uid, giveRecord.getAmount(), RedPackDetailFactory.createGiveOthersReceive(giveRecord));
        } catch (Exception e) {
            throw new RedPackGiveRecordException(1, "红包领取失败");
        }
        // 更新赠送记录
        redPackGiveRecordMapper.updateByPrimaryKey(giveRecord);
        try {
            String identifyCode = StringUtil.Md5(RedPackDetailTypeEnum.giveOthers.name() + ":" + giveRecord.getId());
            RedPackDetail redPackDetail = redPackDetailService.getByIdentifyCode(identifyCode);
            RedPackDetail updateDetail = RedPackDetailFactory.createGiveOthersSucceed(redPackDetail.getId(), giveRecord);
            redPackDetailService.updateByPrimaryKeySelective(updateDetail);
        } catch (Exception e) {
            throw new RedPackGiveRecordException(1,"更新提现明细出错");
        }
        return giveRecord;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoShopServiceImpl.java
@@ -14,6 +14,7 @@
import org.yeshi.utils.tencentcloud.COSManager;
import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoShopMapper;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
import com.yeshi.fanli.entity.taobao.TaoBaoShop;
@@ -21,6 +22,7 @@
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.db.MongoDBManager;
import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
@@ -211,6 +213,8 @@
        BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
        BigDecimal shareRate = hongBaoManageService.getShareRate();
        ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
        for (TaoBaoShopVO taoBaoShopVO : list) {
            
            Integer userType = taoBaoShopVO.getUserType();
@@ -238,7 +242,7 @@
            List<GoodsDetailVO> listGoods = new ArrayList<GoodsDetailVO>();
            List<TaoBaoGoodsBrief> listGoodsBrief = taoBaoShopVO.getListGoodsBrief();
            for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) {
                GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
                GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO);
                listGoods.add(goodsDetailVO);
            }
            taoBaoShopVO.setListGoodsVO(listGoods);
fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java
@@ -11,9 +11,13 @@
import org.springframework.core.task.TaskExecutor;
import org.springframework.stereotype.Service;
import com.google.gson.Gson;
import com.yeshi.fanli.dao.mybatis.user.TokenRecordMapper;
import com.yeshi.fanli.dto.msg.MsgInviteContentDTO;
import com.yeshi.fanli.dto.msg.MsgOtherGiveContentDTO;
import com.yeshi.fanli.dto.msg.MsgRedPackGiveContentDTO;
import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinGiveRecord;
import com.yeshi.fanli.entity.bus.user.TokenRecord;
import com.yeshi.fanli.entity.bus.user.TokenRecord.TokenTypeEnum;
import com.yeshi.fanli.entity.bus.user.UserInfo;
@@ -21,13 +25,17 @@
import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
import com.yeshi.fanli.entity.bus.user.UserSystemCouponGiveRecord;
import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord;
import com.yeshi.fanli.entity.redpack.RedPackGiveRecord;
import com.yeshi.fanli.entity.system.SystemCoupon;
import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
import com.yeshi.fanli.exception.redpack.RedPackGiveRecordException;
import com.yeshi.fanli.exception.user.TokenRecordException;
import com.yeshi.fanli.exception.user.UserInfoExtraException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.config.SystemCouponService;
import com.yeshi.fanli.service.inter.money.msg.UserMoneyMsgNotificationService;
import com.yeshi.fanli.service.inter.msg.UserOtherMsgNotificationService;
import com.yeshi.fanli.service.inter.redpack.RedPackGiveRecordService;
import com.yeshi.fanli.service.inter.user.TokenRecordService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
@@ -83,6 +91,12 @@
    @Resource
    private UserInviteMsgNotificationService userInviteMsgNotificationService;
    
    @Resource
    private RedPackGiveRecordService redPackGiveRecordService;
    @Resource
    private UserMoneyMsgNotificationService userMoneyMsgNotificationService;
    @Override
    public void insertSelective(TokenRecord record) {
@@ -125,8 +139,9 @@
            throw new TokenRecordException(1, "口令已失效");
        
        Integer num = 1;
        Integer num = 0;
        Integer type = 0;
        String money = null;
        boolean state = false;
        List<String> tips = new ArrayList<String>();
        String identify = rokenRecord.getIdentify();
@@ -140,15 +155,12 @@
                throw new TokenRecordException(1, "赠送记录不存在");
            
            Date endTime = giveRecord.getEndTime();
            if (endTime != null && endTime.getTime() < now.getTime())
                throw new TokenRecordException(1, "赠送记录已过期");
            // 用户券信息
            UserSystemCoupon userCoupon = userSystemCouponService.selectByPrimaryKey(giveRecord.getCouponId());
            if (userCoupon == null || userCoupon.getGive() == null || !userCoupon.getGive())
                throw new TokenRecordException(1, "券不存在或非赠送状态");
            
            if (userCoupon.getState() == UserSystemCoupon.STATE_OVERDUE) {
            if (userCoupon.getState() == UserSystemCoupon.STATE_OVERDUE || (endTime != null && endTime.getTime() < now.getTime())) {
                tips.add("哎呀,这张免单券已失效了!");
            } else if (userCoupon.getState() == UserSystemCoupon.STATE_END_USE) {
                tips.add("哎呀,这张免单券已被领取了!");
@@ -179,15 +191,12 @@
                throw new TokenRecordException(1, "赠送记录不存在");
            
            Date endTime = giveRecord.getEndTime();
            if (endTime != null && endTime.getTime() < now.getTime())
                throw new TokenRecordException(1, "赠送记录已过期");
            UserSystemCoupon userCoupon = userSystemCouponService.selectByPrimaryKey(giveRecord.getCouponId());
            if (userCoupon == null || userCoupon.getGive() == null || !userCoupon.getGive())
                throw new TokenRecordException(1, "券不存在或非赠送状态");
            
            
            if (userCoupon.getState() == UserSystemCoupon.STATE_OVERDUE) {
            if (userCoupon.getState() == UserSystemCoupon.STATE_OVERDUE|| (endTime != null && endTime.getTime() < now.getTime())) {
                tips.add("哎呀,这张返利奖励券已失效了!");
            } else if (userCoupon.getState() == UserSystemCoupon.STATE_END_USE) {
                tips.add("哎呀,这张返利奖励券已被领取了!");
@@ -207,6 +216,35 @@
                }
            } else {
                throw new TokenRecordException(1, "口令已失效");
            }
        } else if (tokenType == TokenTypeEnum.redPack) {
            type = 13;
            RedPackGiveRecord giveRecord = redPackGiveRecordService.selectByPrimaryKey(Long.parseLong(identify));
            if (giveRecord == null)
                throw new TokenRecordException(1, "口令已失效");
            Date endTime = giveRecord.getEndTime();
            // 赠送面额
            money = giveRecord.getAmount().setScale(2).toString();
            if(giveRecord.getState() == UserTaoLiJinGiveRecord.STATE_OVERDUE
                    || (endTime != null && endTime.getTime() < now.getTime())) {
                tips.add("哎呀,这个红包已失效了!");
            } else if (giveRecord.getState() == UserTaoLiJinGiveRecord.STATE_RECEIVE) {
                tips.add("哎呀,这个红包已被领取了!");
            } else if (giveRecord.getState() == UserTaoLiJinGiveRecord.STATE_INIT) {
                if (uid == null || uid <= 0)
                    throw new TokenRecordException(1001, "温馨提示,[红包]需要登录后领取");
                state = true;
                UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
                if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
                    tips.add("确认领取后,你将成为增值的一级队员;");
                    tips.add("红包可提现,可购买折扣商品;");
                    tips.add("成功领取后,请到“我的-红包”中查看。");
                } else {
                    tips.add("红包可提现,可购买折扣商品;");
                    tips.add("成功领取后,请到“我的-红包”中查看。");
                }
            }
        } else if (tokenType == TokenTypeEnum.taoLiJin) {
            throw new TokenRecordException(1, "推广红包相关功能已下线!");
@@ -237,6 +275,7 @@
        
        TokenVO tokenVO = new TokenVO();
        tokenVO.setAmount(num);
        tokenVO.setMoney(money);
        tokenVO.setToken(parseToken);
        tokenVO.setNickName(nickName + "赠送");
        tokenVO.setPortrait(portrait);
@@ -285,7 +324,6 @@
        String msg = "领取成功";
        TokenTypeEnum tokenType = rokenRecord.getType();
        if (tokenType == TokenTypeEnum.freeCoupon) {
            // 赠送记录
            UserSystemCouponGiveRecord giveRecord = userSystemCouponGiveRecordService
                    .selectByPrimaryKey(Long.parseLong(identify));
@@ -465,6 +503,55 @@
                        addInviteMsg(uid, giveUid, "返利奖励券");
                }
            });
        } else if (tokenType == TokenTypeEnum.redPack) {
            try {
                msg = "领取红包成功,请到[我的-红包]中查看";
                // 领取红包、更新记录
                RedPackGiveRecord giveRecord = redPackGiveRecordService.receiveFriendsGive(uidToken, Long.parseLong(identify));
                // 消息 + 队员
                executor.execute(new Runnable() {
                    @Override
                    public void run() {
                        SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
                        boolean addTeam = addInviteTeam(uid, giveUid, userInfoExtra);
                        String beiZhu = "无";
                        String giveBeiZhu = "无";
                        if (addTeam) {
                            beiZhu = "你已成为赠送人的一级队员";
                            giveBeiZhu = "领取人已成为你的一级队员";
                            // 激活邀请信息
                            addInviteMsg(uid, giveUid, giveRecord.getAmount().setScale(2) + "元红包");
                        }
                        // 领取人消息
                        String giveUserName = "无";
                        UserInfo giveuser = userInfoService.selectByPKey(giveUid);
                        if (giveuser != null && !StringUtil.isNullOrEmpty(giveuser.getNickName()))
                            giveUserName = giveuser.getNickName();
                        MsgRedPackGiveContentDTO dto = new MsgRedPackGiveContentDTO();
                        dto.setTitle("红包领取");
                        dto.setUserInfo("昵称:" + giveUserName + " ID:" + giveUid);
                        dto.setTime(sd.format(giveRecord.getGiveTime()));
                        dto.setMoney("¥" + giveRecord.getAmount().setScale(2));
                        userMoneyMsgNotificationService.redPackMsg(giveUid, MsgTypeMoneyTypeEnum.redPackReceiveOff, new Gson().toJson(dto), beiZhu);
                        // 赠送人消息
                        String userName = "无";
                        UserInfo user = userInfoService.selectByPKey(uid);
                        if (user != null && !StringUtil.isNullOrEmpty(user.getNickName()))
                            userName = user.getNickName();
                        MsgRedPackGiveContentDTO givedto = new MsgRedPackGiveContentDTO();
                        givedto.setTitle("红包领取");
                        givedto.setUserInfo("昵称:" + userName + " ID:" + uid);
                        givedto.setTime(sd.format(new Date()));
                        givedto.setMoney("¥" + giveRecord.getAmount().setScale(2));
                        userMoneyMsgNotificationService.redPackMsg(giveUid, MsgTypeMoneyTypeEnum.redPackGiveOff, new Gson().toJson(givedto), giveBeiZhu);
                    }
                });
            } catch (RedPackGiveRecordException e) {
                throw new TokenRecordException(1, e.getMsg());
            }
        } else if (tokenType == TokenTypeEnum.taoLiJin) {
            throw new TokenRecordException(1, "推广红包相关功能已下线!");
        } else {
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponActivateServiceImpl.java
@@ -1,7 +1,5 @@
package com.yeshi.fanli.service.impl.user;
import java.util.Date;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
@@ -21,32 +19,15 @@
    private ConfigService configService;
    
    
    @Override
    public boolean addActivateCount(Long cpid, int limitNum) {
        UserSystemCouponActivate coupon = userSystemCouponActivateMapper.selectByPrimaryKey(cpid);
        if (coupon != null) {
            userSystemCouponActivateMapper.addCount(cpid, 1);
            coupon.setCount(coupon.getCount() + 1);
        } else {
            coupon = new UserSystemCouponActivate();
            coupon.setId(cpid);
            coupon.setCount(1);
            coupon.setState(UserSystemCouponActivate.STATE_INIT);
            coupon.setCreateTime(new Date());
            coupon.setUpdateTime(new Date());
            userSystemCouponActivateMapper.insertSelective(coupon);
        }
        // 是否满足激活条件
        Integer state = coupon.getState();
        if (state != UserSystemCouponActivate.STATE_END && coupon.getCount().intValue() >= limitNum) {
            UserSystemCouponActivate record = new UserSystemCouponActivate();
            record.setId(coupon.getId());
            record.setState(UserSystemCouponActivate.STATE_END);
            userSystemCouponActivateMapper.updateByPrimaryKeySelective(record);
            return true;
        }
        return false;
    public UserSystemCouponActivate selectForUpdate(Long id) {
        return userSystemCouponActivateMapper.selectForUpdate(id);
    }
    @Override
    public void updateByPrimaryKeySelective(UserSystemCouponActivate record) {
        userSystemCouponActivateMapper.updateByPrimaryKeySelective(record);
    }
    
    @Override 
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
@@ -39,6 +39,7 @@
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
import com.yeshi.fanli.entity.bus.user.UserSystemCouponActivate;
import com.yeshi.fanli.entity.bus.user.UserSystemCouponGiveRecord;
import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord;
import com.yeshi.fanli.entity.common.JumpDetailV2;
@@ -47,7 +48,6 @@
import com.yeshi.fanli.entity.system.SystemCoupon;
import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.exception.money.UserMoneyDetailException;
import com.yeshi.fanli.exception.user.UserInfoExtraException;
import com.yeshi.fanli.exception.user.UserSystemCouponException;
import com.yeshi.fanli.log.LogHelper;
@@ -79,6 +79,7 @@
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TokenUtil;
import com.yeshi.fanli.util.VersionUtil;
import com.yeshi.fanli.util.annotation.RequestSerializableByKeyService;
import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
import com.yeshi.fanli.util.factory.msg.MsgOtherSystemGiveDTOFactory;
import com.yeshi.fanli.util.rocketmq.MQTopicName;
@@ -2443,77 +2444,97 @@
    }
    
    @RequestSerializableByKeyService(key = "#uid")
    @Override
    @Transactional
    public void activateFreeCoupon(Long uid) {
        List<UserSystemCoupon> list = userSystemCouponMapper.getNeedActivateFreeCouponByType(uid, CouponTypeEnum.freeCoupon.name());
        if (list == null || list.size() == 0)
    @Transactional(rollbackFor = Exception.class)
    public void triggerFreeCouponActivate(Long uid) {
        UserSystemCoupon coupon = userSystemCouponMapper.getNeedActivateCouponByType(uid, CouponTypeEnum.freeCoupon.name());
        if (coupon == null)
            return;
        UserSystemCoupon coupon = list.get(0);
        Date nowDate = new Date();
        Date endTime2 = coupon.getEndTime();
        if (endTime2 != null && endTime2.getTime() <= nowDate.getTime())
            return; // 已失效
        SystemCoupon systemCoupon = coupon.getSystemCoupon();
        if (systemCoupon == null)
            return; // 券已不存在
        systemCoupon = systemCouponService.selectByPrimaryKey(systemCoupon.getId());
        if (systemCoupon == null || systemCoupon.getType() != CouponTypeEnum.freeCoupon)
            return; // 券类型不匹配
        Long id = coupon.getId();
        UserSystemCouponActivate couponActivate = userSystemCouponActivateService.selectForUpdate(id);
        
        // 添加激活数量
        String activateNum = configService.get("free_coupon_activate_num");
        boolean activate = userSystemCouponActivateService.addActivateCount(coupon.getId(), Integer.parseInt(activateNum));
        // 激活数量
        boolean result = false;
        int limitNum = Integer.parseInt(configService.get("free_coupon_activate_num"));
        
        // 激活券
        if (activate) {
        Integer state = couponActivate.getState();
        int count = couponActivate.getCount();
        count++;
        if(count >= limitNum) {
            result = true;
            state = UserSystemCouponActivate.STATE_END;
        }
            
            try {
                Integer expiryDay = systemCoupon.getExpiryDay();
                String endDay = DateUtil.plusDay(expiryDay - 1, nowDate);
                SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                if (endDay != null && endDay.trim().length() > 0) {
                    endDay += " 23:59:59";
                }
                Date endTime = format.parse(endDay);
                UserSystemCoupon userCoupon = new UserSystemCoupon();
                userCoupon.setId(coupon.getId());
                userCoupon.setStateActivated(1);
                userCoupon.setEndTime(endTime);
                userCoupon.setStartTime(nowDate);
                userCoupon.setUpdateTime(new Date());
                userSystemCouponMapper.updateByPrimaryKeySelective(userCoupon);
                // 赠送记录
                UserSystemCouponGiveRecord giveRecord = userSystemCouponGiveRecordService.getByReceiveId(coupon.getId());
                if (giveRecord == null)
                    return;
                Long giveUid = giveRecord.getGiveUid();
                UserInfo userInfo = userInfoService.selectByPKey(giveUid);
                if (userInfo == null)
                    return;
                String beiZhu = "请到我的-福利中心中查看";
                SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
                MsgOtherCouponActivateDTO msgOther = new MsgOtherCouponActivateDTO();
                msgOther.setTitle("免单券激活");
                msgOther.setType("免单券系统已自动激活");
                msgOther.setExplain("满足" + systemCoupon.getActivateDay() + "天内产生" + activateNum + "笔已到账返利订单");
                msgOther.setGiveUser("昵称:" + userInfo.getNickName() + " ID:" + giveUid);
                msgOther.setReceiveTime(sd.format(giveRecord.getReceiveTime()));
                msgOther.setValidityTime(expiryDay + "天");
                userOtherMsgNotificationService.giveCouponActivateMsg(uid, beiZhu, msgOther);
            } catch (Exception e) {
                e.printStackTrace();
                LogHelper.errorDetailInfo(e);
        UserSystemCouponActivate updateActivate = new UserSystemCouponActivate();
        updateActivate.setId(id);
        updateActivate.setState(state);
        updateActivate.setCount(count);
        updateActivate.setUpdateTime(new Date());
        userSystemCouponActivateService.updateByPrimaryKeySelective(updateActivate);
        // 激活奖励券
        if (result) {
            activateFreeCoupon(coupon, limitNum);
        }
    }
    /**
     * 激活券
     * @param coupon
     * @param activateNum
     */
    @Transactional
    private void activateFreeCoupon(UserSystemCoupon coupon, int limitNum) {
        try {
            Date nowDate = new Date();
            SystemCoupon systemCoupon = coupon.getSystemCoupon();
            Integer expiryDay = systemCoupon.getExpiryDay();
            String endDay = DateUtil.plusDay(expiryDay - 1, nowDate);
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            if (endDay != null && endDay.trim().length() > 0) {
                endDay += " 23:59:59";
            }
            Date endTime = format.parse(endDay);
            UserSystemCoupon userCoupon = new UserSystemCoupon();
            userCoupon.setId(coupon.getId());
            userCoupon.setStateActivated(1);
            userCoupon.setEndTime(endTime);
            userCoupon.setStartTime(nowDate);
            userCoupon.setUpdateTime(new Date());
            userSystemCouponMapper.updateByPrimaryKeySelective(userCoupon);
            // 消息
            executor.execute(new Runnable() {
                @Override
                public void run() {
                    UserSystemCouponGiveRecord giveRecord = userSystemCouponGiveRecordService.getByReceiveId(coupon.getId());
                    if (giveRecord == null)
                        return;
                    Long giveUid = giveRecord.getGiveUid();
                    UserInfo userInfo = userInfoService.selectByPKey(giveUid);
                    if (userInfo == null)
                        return;
                    String beiZhu = "请到我的-福利中心中查看";
                    SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
                    MsgOtherCouponActivateDTO msgOther = new MsgOtherCouponActivateDTO();
                    msgOther.setTitle("免单券激活");
                    msgOther.setType("免单券系统已自动激活");
                    msgOther.setExplain("满足" + systemCoupon.getActivateDay() + "天内产生" + limitNum + "笔已到账返利订单");
                    msgOther.setGiveUser("昵称:" + userInfo.getNickName() + " ID:" + giveUid);
                    msgOther.setReceiveTime(sd.format(giveRecord.getReceiveTime()));
                    msgOther.setValidityTime(expiryDay + "天");
                    userOtherMsgNotificationService.giveCouponActivateMsg(coupon.getUid(), beiZhu, msgOther);
                }
            });
        } catch (Exception e) {
            e.printStackTrace();
            LogHelper.errorDetailInfo(e);
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/inter/money/msg/UserMoneyMsgNotificationService.java
@@ -3,6 +3,7 @@
import java.math.BigDecimal;
import java.util.Date;
import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
import com.yeshi.fanli.entity.bus.user.AlipayAccountValidNormalHistory;
import com.yeshi.fanli.entity.bus.user.Extract;
import com.yeshi.fanli.entity.bus.user.ExtractWeiXinRecord;
@@ -155,6 +156,11 @@
    public void extractAuto(ExtractWeiXinRecord extractRecord, String stateDesc, String desc, String beiZhu);
    /**
     * 红包消息
     */
    public void redPackMsg(Long uid, MsgTypeMoneyTypeEnum type, String content, String beiZhu);
    /**
     * 补贴消息
     * 
     * @param uid
fanli/src/main/java/com/yeshi/fanli/service/inter/redpack/RedPackExchangeService.java
@@ -34,14 +34,8 @@
     * @param uid
     * @return
     */
    public List<Long> countState(long uid);
    public Long countByUidAndState(long uid,  Integer state);
    /**
     * 统计各个状态金额
     * @param uid
     * @return
     */
    public List<BigDecimal> countMoneyState(long uid);
    /**
     * 获取申请
@@ -73,7 +67,7 @@
     * @param state
     * @return
     */
    public BigDecimal countMoneyByState(Long uid, Integer state);
    public BigDecimal countMoneyByUidAndState(Long uid, Integer state);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/redpack/RedPackGiveRecordService.java
@@ -2,6 +2,7 @@
import java.math.BigDecimal;
import com.yeshi.fanli.entity.redpack.RedPackGiveRecord;
import com.yeshi.fanli.exception.redpack.RedPackGiveRecordException;
public interface RedPackGiveRecordService {
@@ -15,5 +16,26 @@
     */
    public String giving(Long uid, BigDecimal amount) throws RedPackGiveRecordException;
    /**
     * 查询记录
     * @param id
     * @return
     */
    public RedPackGiveRecord selectByPrimaryKey(Long id);
    /**
     * 更新记录
     * @param record
     */
    public void updateByPrimaryKeySelective(RedPackGiveRecord record);
    /**
     * 口令红包领取
     * @param uid
     * @param id
     * @throws RedPackGiveRecordException
     */
    public RedPackGiveRecord receiveFriendsGive(Long uid, Long id) throws RedPackGiveRecordException;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserSystemCouponActivateService.java
@@ -1,14 +1,8 @@
package com.yeshi.fanli.service.inter.user;
public interface UserSystemCouponActivateService {
import com.yeshi.fanli.entity.bus.user.UserSystemCouponActivate;
    /**
     * 更新待激活数量,并返回是否可以激活
     * @param cpid  用户券id
     * @param num   限制数量
     * @return
     */
    public boolean addActivateCount(Long cpid, int num);
public interface UserSystemCouponActivateService {
    /**
     * 查询满足条件的数量
@@ -17,4 +11,17 @@
     */
    public int getActivateCount(Long id);
    /**
     * 查询用于更新
     * @param id
     * @return
     */
    public UserSystemCouponActivate selectForUpdate(Long id);
    /**
     * 选择性更新
     * @param record
     */
    public void updateByPrimaryKeySelective(UserSystemCouponActivate record);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserSystemCouponService.java
@@ -327,9 +327,9 @@
    public List<UserSystemCoupon> getFreeCouponByType(Long uid, String type);
    /**
     * 激活免单券---订单已到账      TODO 待调用
     * 激活免单券---订单已到账   触发激活免单券
     * @param uid
     */
    public void activateFreeCoupon(Long uid);
    public void triggerFreeCouponActivate(Long uid);
}
fanli/src/main/java/com/yeshi/fanli/util/factory/RedPackDetailFactory.java
@@ -84,21 +84,88 @@
    
    
    
    public static RedPackDetail createGiveOthers(RedPackGiveRecord giveRecord, String desc, RedPackDetailTypeEnum type) throws RedPackDetailException {
        if (giveRecord == null || type == null)
            throw new RedPackDetailException(1, "提现记录、类型不能为空");
        // 红包明细- 退回红包
    /**
     * 赠送好友明细
     * @param giveRecord
     * @return
     * @throws RedPackDetailException
     */
    public static RedPackDetail createGiveOthers(RedPackGiveRecord giveRecord) throws RedPackDetailException {
        if (giveRecord == null)
            throw new RedPackDetailException(1, "赠送记录不能为空");
        RedPackDetail detail = new RedPackDetail();
        detail.setDisplay(true);
        detail.setUid(giveRecord.getGiveUid());
        detail.setMoney(new BigDecimal("-" + giveRecord.getAmount()));
        detail.setType(RedPackDetailTypeEnum.giveOthers);
        detail.setTitle(RedPackDetailTypeEnum.giveOthers.getDesc());
        detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.giveOthers.name() + ":" + giveRecord.getId()));
        detail.setCreateTime(new Date());
        return detail;
    }
    /**
     * 赠送成功
     * @param id
     * @param giveRecord
     * @return
     * @throws RedPackDetailException
     */
    public static RedPackDetail createGiveOthersSucceed(Long id, RedPackGiveRecord giveRecord) throws RedPackDetailException {
        if (giveRecord == null)
            throw new RedPackDetailException(1, "赠送记录不能为空");
        RedPackDetail detail = new RedPackDetail();
        detail.setId(id);
        detail.setDisplay(true);
        detail.setType(RedPackDetailTypeEnum.giveOthersSucceed);
        detail.setTitle(RedPackDetailTypeEnum.giveOthersSucceed.getDesc());
        detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.giveOthersSucceed.name() + ":" + giveRecord.getId()));
        detail.setCreateTime(new Date());
        return detail;
    }
    /**
     * 赠送失败
     * @param giveRecord
     * @return
     * @throws RedPackDetailException
     */
    public static RedPackDetail createGiveOthersFail(RedPackGiveRecord giveRecord) throws RedPackDetailException {
        if (giveRecord == null)
            throw new RedPackDetailException(1, "赠送记录不能为空");
        RedPackDetail detail = new RedPackDetail();
        detail.setDisplay(true);
        detail.setUid(giveRecord.getGiveUid());
        detail.setMoney(giveRecord.getAmount());
        detail.setDesc(desc);
        detail.setType(type);
        detail.setTitle(type.getDesc());
        detail.setIdentifyCode(StringUtil.Md5(type.name() + ":" + giveRecord.getId()));
        detail.setType(RedPackDetailTypeEnum.giveOthersFail);
        detail.setTitle(RedPackDetailTypeEnum.giveOthersFail.getDesc());
        detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.giveOthersFail.name() + ":" + giveRecord.getId()));
        detail.setCreateTime(new Date());
        return detail;
    }
    /**
     * 赠送失败
     * @param giveRecord
     * @return
     * @throws RedPackDetailException
     */
    public static RedPackDetail createGiveOthersReceive(RedPackGiveRecord giveRecord) throws RedPackDetailException {
        if (giveRecord == null)
            throw new RedPackDetailException(1, "赠送记录不能为空");
        RedPackDetail detail = new RedPackDetail();
        detail.setDisplay(true);
        detail.setUid(giveRecord.getReceiveUid());
        detail.setMoney(giveRecord.getAmount());
        detail.setType(RedPackDetailTypeEnum.giveOthersReceive);
        detail.setTitle(RedPackDetailTypeEnum.giveOthersReceive.getDesc());
        detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.giveOthersReceive.name() + ":" + giveRecord.getId()));
        detail.setCreateTime(new Date());
        return detail;
    }
}
fanli/src/main/java/com/yeshi/fanli/util/factory/goods/GoodsDetailVOFactory.java
@@ -9,6 +9,7 @@
import org.yeshi.utils.taobao.TbImgUtil;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.dto.common.GoodsOtherInfoDTO;
import com.yeshi.fanli.dto.jd.JDCouponInfo;
import com.yeshi.fanli.dto.jd.JDPingouInfo;
@@ -54,8 +55,7 @@
     *            返利比例
     * @return
     */
    public static GoodsDetailVO convertCommonGoods(CommonGoods goods, String pid, BigDecimal fanLiRate,
            BigDecimal shareRate) {
    public static GoodsDetailVO convertCommonGoods(CommonGoods goods, ConfigParamsDTO params) {
        GoodsDetailVO goodsInfo = new GoodsDetailVO();
        goodsInfo.setGoodsId(goods.getGoodsId());
        goodsInfo.setTitle(goods.getTitle());
@@ -157,8 +157,11 @@
        // 资金信息
        MoneyInfoVO moneyInfoVO = new MoneyInfoVO();
        moneyInfoVO.setMoneyType(1); // 默认显示:返 ¥6.6
        moneyInfoVO.setFanliMoney(CommonGoodsUtil.getCommissionInfo(goods, fanLiRate));
        moneyInfoVO.setShareMoney(CommonGoodsUtil.getCommissionInfo(goods, shareRate));
        BigDecimal commission = CommonGoodsUtil.getCommission(goods, params.getFanLiRate());
        moneyInfoVO.setFanliMoney("¥" + commission);
        moneyInfoVO.setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
        moneyInfoVO.setShareMoney(CommonGoodsUtil.getCommissionInfo(goods, params.getShareRate()));
        goodsInfo.setMoneyInfo(moneyInfoVO);
        // 券信息
@@ -189,8 +192,20 @@
                shop.setId(goods.getSellerId().toString());
                goodsInfo.setShopInfo(shop);
            }
        }
        if (Constant.IS_TEST) {
            // 添加标签
            List<ClientTextStyleVO> labels = goodsInfo.getLabels();
            if (labels == null)
                labels = new ArrayList<>();
            labels.add(new ClientTextStyleVO("预售", "#FF2B4E"));
            labels.add(new ClientTextStyleVO("爆款", "#FF2B4E"));
            labels.add(new ClientTextStyleVO("超级划算", "#FF2B4E"));
            goodsInfo.setLabels(labels);
        }
        return goodsInfo;
    }
@@ -204,8 +219,7 @@
     *            返利比例
     * @return
     */
    public static GoodsDetailVO convertTaoBaoGoodsBriefExtra(TaoBaoGoodsBriefExtra goods, BigDecimal fanLiRate,
            BigDecimal shareRate) {
    public static GoodsDetailVO convertTaoBaoGoodsBriefExtra(TaoBaoGoodsBriefExtra goods, ConfigParamsDTO params) {
        GoodsDetailVO goodsInfo = new GoodsDetailVO();
        goodsInfo.setBaoyou(true);
        goodsInfo.setGoodsType(Constant.SOURCE_TYPE_TAOBAO);
@@ -235,9 +249,12 @@
            TaoBaoHongBaoInfo taoBaoHongBaoInfo = goods.getTaoBaoHongBaoInfo();
            moneyInfoVO.setFanliMoney("¥" + taoBaoHongBaoInfo.getHongbao());
            moneyInfoVO.setShareMoney("¥" + taoBaoHongBaoInfo.getHongbao());
            moneyInfoVO.setMaxMoney("¥" + taoBaoHongBaoInfo.getHongbao().add(MoneyBigDecimalUtil.mul(taoBaoHongBaoInfo.getHongbao(), params.getMaxRewardRate())));
        } else {
            moneyInfoVO.setFanliMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, fanLiRate));
            moneyInfoVO.setShareMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, shareRate));
            BigDecimal commission = TaoBaoUtil.getGoodsHongBaoMoney(goods, params.getFanLiRate());
            moneyInfoVO.setFanliMoney("¥" + commission);
            moneyInfoVO.setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
            moneyInfoVO.setShareMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, params.getShareRate()));
        }
        goodsInfo.setMoneyInfo(moneyInfoVO);
@@ -271,6 +288,18 @@
            goodsInfo.setShopInfo(shop);
        }
        if (Constant.IS_TEST) {
            // 添加标签
            List<ClientTextStyleVO> labels = goodsInfo.getLabels();
            if (labels == null)
                labels = new ArrayList<>();
            labels.add(new ClientTextStyleVO("预售", "#FF2B4E"));
            labels.add(new ClientTextStyleVO("爆款", "#FF2B4E"));
            labels.add(new ClientTextStyleVO("超级划算", "#FF2B4E"));
            goodsInfo.setLabels(labels);
        }
        return goodsInfo;
    }
@@ -284,8 +313,7 @@
     *            返利比例
     * @return
     */
    public static GoodsDetailVO convertTaoBao(TaoBaoGoodsBrief goods, String pid, BigDecimal fanLiRate,
            BigDecimal shareRate) {
    public static GoodsDetailVO convertTaoBao(TaoBaoGoodsBrief goods, ConfigParamsDTO params) {
        GoodsDetailVO goodsInfo = new GoodsDetailVO();
        goodsInfo.setBaoyou(true);
        goodsInfo.setGoodsType(Constant.SOURCE_TYPE_TAOBAO);
@@ -338,8 +366,10 @@
        // 资金信息
        MoneyInfoVO moneyInfoVO = new MoneyInfoVO();
        moneyInfoVO.setMoneyType(1); // 默认显示:返 ¥6.6
        moneyInfoVO.setFanliMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, fanLiRate));
        moneyInfoVO.setShareMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, shareRate));
        BigDecimal commission = TaoBaoUtil.getGoodsHongBaoMoney(goods, params.getFanLiRate());
        moneyInfoVO.setFanliMoney("¥" + commission);
        moneyInfoVO.setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
        moneyInfoVO.setShareMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, params.getShareRate()));
        goodsInfo.setMoneyInfo(moneyInfoVO);
        // 券信息
@@ -365,7 +395,7 @@
                coupon.setStartTime(goods.getCouponEffectiveStartTime().replace("-", "."));
            }
            coupon.setLink(TaoBaoCouponUtil.getCoupleUrl(goods.getCouponActivityId(), pid, goods.getAuctionId() + ""));
            coupon.setLink(TaoBaoCouponUtil.getCoupleUrl(goods.getCouponActivityId(), null, goods.getAuctionId() + ""));
            coupon.setStartFee(goods.getCouponStartFee());
            goodsInfo.setHasCoupon(true);
@@ -381,7 +411,7 @@
        }
        if (TaoBaoUtil.isYUShou(goods)) {// 预售商品
            goodsInfo = loadYuShouInfo(goodsInfo, goods, pid, fanLiRate, shareRate);
            goodsInfo = loadYuShouInfo(goodsInfo, goods, null, params.getFanLiRate(), params.getShareRate());
        }
        if (Constant.IS_TEST) {
@@ -407,7 +437,6 @@
            if (goodsInfo.getLabels() == null)
                goodsInfo.setLabels(new ArrayList<>());
            goodsInfo.getLabels().add(new ClientTextStyleVO("预售", "#FF2B4E"));
        }
        return goodsInfo;
    }
@@ -422,7 +451,7 @@
     *            返利比例
     * @return
     */
    public static GoodsDetailVO convertJDGoods(JDGoods goods, BigDecimal fanLiRate, BigDecimal shareRate) {
    public static GoodsDetailVO convertJDGoods(JDGoods goods, ConfigParamsDTO params) {
        GoodsDetailVO goodsInfo = new GoodsDetailVO();
        goodsInfo.setGoodsType(Constant.SOURCE_TYPE_JD);
        goodsInfo.setGoodsId(goods.getSkuId());
@@ -446,8 +475,10 @@
        // 资金信息
        MoneyInfoVO moneyInfoVO = new MoneyInfoVO();
        moneyInfoVO.setMoneyType(1); // 默认显示:返 ¥6.6
        moneyInfoVO.setFanliMoney("¥" + JDUtil.getGoodsFanLiMoney(goods, fanLiRate));
        moneyInfoVO.setShareMoney("¥" + JDUtil.getGoodsFanLiMoney(goods, shareRate));
        BigDecimal commission = JDUtil.getGoodsFanLiMoney(goods, params.getFanLiRate());
        moneyInfoVO.setFanliMoney("¥" + commission);
        moneyInfoVO.setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
        moneyInfoVO.setShareMoney("¥" + JDUtil.getGoodsFanLiMoney(goods, params.getShareRate()));
        goodsInfo.setMoneyInfo(moneyInfoVO);
        JDCouponInfo couponInfo = goods.getCouponInfo();
@@ -527,6 +558,7 @@
        if (isFreeShipping != null && isFreeShipping == 1) {
            goodsInfo.setBaoyou(true);
        }
        return goodsInfo;
    }
@@ -540,7 +572,7 @@
     *            返利比例
     * @return
     */
    public static GoodsDetailVO convertPDDGoods(PDDGoodsDetail goods, BigDecimal fanLiRate, BigDecimal shareRate) {
    public static GoodsDetailVO convertPDDGoods(PDDGoodsDetail goods, ConfigParamsDTO params) {
        GoodsDetailVO goodsInfo = new GoodsDetailVO();
        goodsInfo.setBaoyou(true);
        goodsInfo.setGoodsType(Constant.SOURCE_TYPE_PDD);
@@ -575,8 +607,10 @@
        // 资金信息
        MoneyInfoVO moneyInfoVO = new MoneyInfoVO();
        moneyInfoVO.setMoneyType(1); // 默认显示:返 ¥6.6
        moneyInfoVO.setFanliMoney("¥" + PinDuoDuoUtil.getGoodsFanLiMoney(goods, fanLiRate));
        moneyInfoVO.setShareMoney("¥" + PinDuoDuoUtil.getGoodsFanLiMoney(goods, shareRate));
        BigDecimal commission = PinDuoDuoUtil.getGoodsFanLiMoney(goods, params.getFanLiRate());
        moneyInfoVO.setFanliMoney("¥" + commission);
        moneyInfoVO.setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
        moneyInfoVO.setShareMoney("¥" + PinDuoDuoUtil.getGoodsFanLiMoney(goods, params.getShareRate()));
        goodsInfo.setMoneyInfo(moneyInfoVO);
        Boolean hasCoupon = goods.getHasCoupon();
@@ -629,6 +663,18 @@
            goodsInfo.setShopInfo(shop);
        }
        if (Constant.IS_TEST) {
            // 添加标签
            List<ClientTextStyleVO> labels = goodsInfo.getLabels();
            if (labels == null)
                labels = new ArrayList<>();
            labels.add(new ClientTextStyleVO("预售", "#FF2B4E"));
            labels.add(new ClientTextStyleVO("爆款", "#FF2B4E"));
            labels.add(new ClientTextStyleVO("超级划算", "#FF2B4E"));
            goodsInfo.setLabels(labels);
        }
        return goodsInfo;
    }
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgMoneyDetailFactory.java
@@ -11,6 +11,7 @@
import com.yeshi.fanli.entity.bus.user.ExtractWeiXinRecord;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.StringUtil;
public class MsgMoneyDetailFactory {
@@ -362,6 +363,28 @@
        detail.setUser(new UserInfo(uid));
        return detail;
    }
    /**
     * 红包相关信息
     * @param uid
     * @param type
     * @param content
     * @param beiZhu
     * @return
     */
    public static MsgMoneyDetail createRedPackMsg(Long uid, MsgTypeMoneyTypeEnum type, String content, String beiZhu) {
        if (uid == null || type == null || StringUtil.isNullOrEmpty(content))
            return null;
        MsgMoneyDetail detail = new MsgMoneyDetail();
        detail.setUser(new UserInfo(uid));
        detail.setRead(false);
        detail.setContent(content);
        detail.setMsgType(type);
        detail.setBeiZhu(beiZhu);
        detail.setCreateTime(new Date());
        return detail;
    }
    /**
     * 邀请订单补贴
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java
@@ -14,6 +14,8 @@
import com.yeshi.fanli.dto.msg.MsgOtherRewardIntegralDTO;
import com.yeshi.fanli.dto.msg.MsgOtherSystemGiveDTO;
import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
import com.yeshi.fanli.dto.msg.MsgRedPackExchangeContentDTO;
import com.yeshi.fanli.dto.msg.MsgRedPackGiveContentDTO;
import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail;
import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail.MsgTypeAccountTypeEnum;
import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail;
@@ -574,18 +576,144 @@
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO("¥" + filterMoney(msg.getBalance()), COLOR_HIGHLIGHT_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("账户余额", COLOR_TITLE), contentList));
            
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
                    COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
            return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_subsidy.png",
                    msg.getMsgType().getDesc(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
                    items);
        }
        } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackReceiveOff) { // 红包成功领取
            if (StringUtil.isNullOrEmpty(msg.getContent()))
                return null;
            MsgRedPackGiveContentDTO dto = new Gson().fromJson(msg.getContent(), MsgRedPackGiveContentDTO.class);
            if (dto == null)
                return null;
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getUserInfo() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("赠送人", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getTime() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("赠送时间", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getMoney() + "", COLOR_HIGHLIGHT_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("领取金额", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
                    COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
            return new UserMsgVO("http://img.flqapp.com/resource/money_detail/icon_system.png",
                    dto.getTitle(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
                    items);
        } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackGiveOff) { // 红包被成功领取
            if (StringUtil.isNullOrEmpty(msg.getContent()))
                return null;
            MsgRedPackGiveContentDTO dto = new Gson().fromJson(msg.getContent(), MsgRedPackGiveContentDTO.class);
            if (dto == null)
                return null;
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getUserInfo() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("领取人", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getTime() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("领取时间", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getMoney() + "", COLOR_HIGHLIGHT_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("赠送金额", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
                    COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
            return new UserMsgVO("http://img.flqapp.com/resource/money_detail/icon_system.png",
                    dto.getTitle(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
                    items);
        } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackExchangePass) { // 红包提现成功
            if (StringUtil.isNullOrEmpty(msg.getContent()))
                return null;
            MsgRedPackExchangeContentDTO dto = new Gson().fromJson(msg.getContent(), MsgRedPackExchangeContentDTO.class);
            if (dto == null)
                return null;
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(MsgTypeMoneyTypeEnum.redPackExchangePass.getDesc() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("类别", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getTime() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("提现时间", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getHandle() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("审核方式", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getMoney() + "", COLOR_HIGHLIGHT_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("提现金额", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getBalance() + "", COLOR_HIGHLIGHT_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("账户余额", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
                    COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
            return new UserMsgVO("http://img.flqapp.com/resource/money_detail/icon_system.png",
                    dto.getTitle(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
                    items);
        } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackExchangeReject) { // 红包提现拒绝
            if (StringUtil.isNullOrEmpty(msg.getContent()))
                return null;
            MsgRedPackExchangeContentDTO dto = new Gson().fromJson(msg.getContent(), MsgRedPackExchangeContentDTO.class);
            if (dto == null)
                return null;
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(MsgTypeMoneyTypeEnum.redPackExchangePass.getDesc() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("类别", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getTime() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("提现时间", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getReason() + "", COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("失败原因", COLOR_TITLE), contentList));
            String handle = dto.getHandle();
            if (StringUtil.isNullOrEmpty(handle))
                handle = "无";
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(handle, COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("处理", COLOR_TITLE), contentList));
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
                    COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
            return new UserMsgVO("http://img.flqapp.com/resource/money_detail/icon_system.png",
                    dto.getTitle(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
                    items);
        }
        return null;
    }
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/coupon/SystemCouponMessageListener.java
@@ -1,5 +1,7 @@
package com.yeshi.fanli.util.rocketmq.consumer.coupon;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import com.aliyun.openservices.ons.api.Action;
@@ -9,10 +11,15 @@
import com.google.gson.Gson;
import com.yeshi.fanli.dto.order.OrderMoneyRecievedMQMsgDTO;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
import com.yeshi.fanli.util.rocketmq.MQTopicName;
@Component
public class SystemCouponMessageListener implements MessageListener {
    @Resource
    private UserSystemCouponService userSystemCouponService;
    @Override
    public Action consume(Message message, ConsumeContext context) {
        LogHelper.mqInfo("consumer-SystemCouponMessageListener", message.getTopic(), message.getTag(),
@@ -25,7 +32,10 @@
                        && orderMoneyRecievedMQMsgDTO.getOrderFirst() == true) {
                    // 首次到账返利
                    // TODO 业务代码添加
                    // 激活免单券
                    userSystemCouponService.triggerFreeCouponActivate(orderMoneyRecievedMQMsgDTO.getUid());
                    // 业务代码执行成功后返回
                    return Action.CommitMessage;
                }
fanli/src/main/java/com/yeshi/fanli/vo/goods/MoneyInfoVO.java
@@ -15,6 +15,8 @@
    private int moneyType;// 资金类型
    @Expose
    private String shareMoney;// 分享奖金
    @Expose
    private String maxMoney;// 最高返回
    public String getFanliMoney() {
        return fanliMoney;
@@ -39,4 +41,13 @@
    public void setShareMoney(String shareMoney) {
        this.shareMoney = shareMoney;
    }
    public String getMaxMoney() {
        return maxMoney;
    }
    public void setMaxMoney(String maxMoney) {
        this.maxMoney = maxMoney;
    }
}
fanli/src/main/java/com/yeshi/fanli/vo/msg/TokenVO.java
@@ -20,6 +20,9 @@
    
    @Expose // 数量、面额
    private Integer amount;
    @Expose // 数量、面额--- V2
    private String money;
    
    @Expose // 提示语
    private List<String> tips;
@@ -84,4 +87,12 @@
    public void setState(Boolean state) {
        this.state = state;
    }
    public String getMoney() {
        return money;
    }
    public void setMoney(String money) {
        this.money = money;
    }
}