yujian
2020-04-15 53672fd62a2084c8b3f8e7ce69e617ff9be58276
Merge remote-tracking branch 'origin/div' into div
35个文件已修改
1个文件已删除
1104 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsEvaluateAdminController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/apph5/AppH5ShareController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/BrandController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/HelpController.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserMoneyController.java 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/h5/AppH5CouponController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/TaoLiJinControllerV2.java 55 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/GoodsController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/order/OrderHongBaoRateParams.java 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/money/UserMoneyDetail.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/DynamicInfoJob.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/DynamicInfoServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/elme/ElmeOrderProcessServiceImpl.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/money/UserMoneyDetailServiceImpl.java 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/money/extract/ExtractServiceImpl.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoV2ServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderHongBaoMoneyComputeServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderMoneySettleServiceImpl.java 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderRepairServiceImpl.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/config/HongBaoManageServiceImpl.java 159 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/pdd/PDDGoodsServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoShopServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinRecordServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserGoodsStorageServiceImpl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserShareGoodsRecordServiceImpl.java 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java 196 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/order/config/HongBaoManageService.java 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/manger/money/TeamEincomeManager.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/manger/order/TeamDividentsManager.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/Constant.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/account/UserUtil.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/UserMoneyDetailFactory.java 148 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsEvaluateAdminController.java
@@ -19,6 +19,7 @@
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.dynamic.CommentInfo;
import com.yeshi.fanli.entity.dynamic.CommentInfo.CommentInfoEnum;
import com.yeshi.fanli.entity.dynamic.GoodsEvaluate;
@@ -714,7 +715,7 @@
            GoodsDetailVO goodsDetail = null;
            BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
            BigDecimal shareRate = hongBaoManageService.getShareRate();
            BigDecimal vipFanLiRate = hongBaoManageService.getVIPFanLiRate();
            BigDecimal vipFanLiRate = hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP);
            ConfigParamsDTO params = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, vipFanLiRate);
            if (commonGoods.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) {
fanli/src/main/java/com/yeshi/fanli/controller/apph5/AppH5ShareController.java
@@ -21,6 +21,7 @@
import com.yeshi.fanli.dto.pdd.PDDSearchFilter;
import com.yeshi.fanli.entity.bus.share.UserShareGoodsGroup;
import com.yeshi.fanli.entity.bus.share.UserShareGoodsRecord;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.entity.jd.JDGoods;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
@@ -172,7 +173,7 @@
                BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
                BigDecimal shareRate = hongBaoManageService.getShareRate();
                ConfigParamsDTO configParamsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
                        hongBaoManageService.getVIPFanLiRate());
                        hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP));
                
                
                for (UserShareGoodsGroup goodsGroup : list) {
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/BrandController.java
@@ -18,6 +18,7 @@
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.brand.BrandClass;
import com.yeshi.fanli.entity.brand.TaoBaoShopHistory;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.system.ConfigKeyEnum;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.TaoBaoShop;
@@ -341,7 +342,7 @@
                Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                        .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
                BigDecimal proportion = manageService.getFanLiRate();
                BigDecimal proportion = manageService.getFanLiRate(UserLevelEnum.daRen);
                for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) {
                    if (listTaoKeGoods != null && listTaoKeGoods.size() > 0) {
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/HelpController.java
@@ -74,6 +74,8 @@
    @RequestMapping(value = "updateApp")
    public void updateApp(AcceptData acceptData, PrintWriter out) {
        if (Constant.IS_TEST)
            acceptData.setVersion("20");
        String result = appUpdateManager.getUpdateInfoCache(acceptData);
        try {
            out.print(new String(result.getBytes("ISO-8859-1"), "UTF-8"));
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserMoneyController.java
@@ -201,7 +201,7 @@
                .convertToTimeTemp(calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1), "yyyy-M"));
        vo.setLastMonthExtractMoney(
                userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate, 1).abs());
        // 本月提现
        maxDate = new Date(timeStamp);
        calendar = Calendar.getInstance();
@@ -214,8 +214,7 @@
        typeList.add(UserMoneyDetailTypeEnum.extractReject);
        vo.setMonthExtractMoney(
                userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate, 1).abs());
        if (!VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
            // 上月收入
            typeList.clear();
@@ -238,7 +237,7 @@
            vo.setLatestThreeMonthRecievedMoney(
                    userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate).abs());
            // 本月到账
            typeList.clear();
            typeList.add(UserMoneyDetailTypeEnum.fanli);
@@ -253,8 +252,7 @@
            typeList.add(UserMoneyDetailTypeEnum.hongbaoDeduct);
            vo.setMonthRecievedMoney(
                    userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate).abs());
            minDate = new Date(TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(timeStamp, "yyyy-MM"), "yyyy-MM"));
            Calendar ca = Calendar.getInstance();
            ca.setTime(new Date(timeStamp));
@@ -264,12 +262,12 @@
            // 本月未到账
            BigDecimal monthUnRecievedMoney = hongBaoV2Service.getUnRecievedMoneyWithPreGetTime(uid, minDate, maxDate);
            vo.setMonthUnRecievedMoney(monthUnRecievedMoney);
            // 全部未到账
            minDate = new Date(0);
            maxDate = new Date(timeStamp);
            vo.setTotalUnRecievedMoney(hongBaoV2Service.getUnRecievedMoneyWithCreateTime(uid, minDate, maxDate));
            // 总的到账
            typeList.clear();
            typeList.add(UserMoneyDetailTypeEnum.fanli);
@@ -284,14 +282,14 @@
            typeList.add(UserMoneyDetailTypeEnum.hongbao);
            typeList.add(UserMoneyDetailTypeEnum.hongbaoDeduct);
            typeList.add(UserMoneyDetailTypeEnum.subsidy);
            typeList.add(UserMoneyDetailTypeEnum.orderTeamDividents);
            typeList.add(UserMoneyDetailTypeEnum.teamReward);
            vo.setTotalRecievedMoney(
                    userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate).abs());
        }
        minDate = new Date(0L);
        maxDate = new Date(timeStamp);
        if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
            // 总的自购返利
            typeList.clear();
@@ -300,7 +298,7 @@
            typeList.add(UserMoneyDetailTypeEnum.orderReward);
            vo.setTotalFanLiMoney(
                    userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate).abs());
            // 累计成功提现
            typeList.clear();
            typeList.add(UserMoneyDetailTypeEnum.extract);
@@ -310,14 +308,14 @@
            vo.setTotalExtractMoney(
                    userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate, 1).abs());
        }
        // 总的分享赚
        typeList.clear();
        typeList.add(UserMoneyDetailTypeEnum.share);
        typeList.add(UserMoneyDetailTypeEnum.shareWeiQuan);
        vo.setTotalShareMoney(
                userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate).abs());
        // 总的邀请赚
        typeList.clear();
        typeList.add(UserMoneyDetailTypeEnum.invite);
@@ -325,12 +323,12 @@
        typeList.add(UserMoneyDetailTypeEnum.inviteAndShare);
        if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
            typeList.add(UserMoneyDetailTypeEnum.subsidy);
            typeList.add(UserMoneyDetailTypeEnum.orderTeamDividents);
            typeList.add(UserMoneyDetailTypeEnum.teamReward);
        }
        vo.setTotalInviteMoney(
                userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate).abs());
        GsonBuilder builder = new GsonBuilder();
        builder.registerTypeAdapter(BigDecimal.class, new JsonSerializer<BigDecimal>() {
            @Override
@@ -344,13 +342,14 @@
                }
            }
        });
        // 获取提现中的信息
        BigDecimal extractingMoney = extractService.sumVerifyingMoney(uid);
        if (extractingMoney.compareTo(new BigDecimal(0)) > 0)
            vo.setExtractingMoneyInfo("提现中:¥" + extractingMoney.setScale(2, RoundingMode.HALF_UP));
        if (VersionUtil.greaterThan_2_0(acceptData.getPlatform(), acceptData.getVersion()) && !VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
        if (VersionUtil.greaterThan_2_0(acceptData.getPlatform(), acceptData.getVersion())
                && !VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
            // 获取是否绑定了微信
            if (!StringUtil.isNullOrEmpty(user.getWxUnionId())) {
                vo.setBindingWX(true);
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/h5/AppH5CouponController.java
@@ -18,6 +18,7 @@
import com.yeshi.fanli.entity.bus.lable.QualityFactory;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.exception.taobao.TaoKeApiException;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
@@ -91,7 +92,7 @@
                .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
        ConfigParamsDTO configParamsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
                acceptData.getVersion());
                acceptData.getVersion(),UserLevelEnum.daRen);
        /* 遍历列表数据 */
        for (QualityFactory selectionGoods : listQuery) {
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
@@ -30,6 +30,7 @@
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.ShamUser;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.goods.CollectionGoodsV2;
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.entity.jd.JDGoods;
@@ -75,7 +76,7 @@
import com.yeshi.fanli.service.inter.user.integral.IntegralGetService;
import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
import com.yeshi.fanli.service.inter.user.vip.UserVipConfigService;
import com.yeshi.fanli.util.BeanUtil;
import com.yeshi.fanli.service.manger.user.UserLevelManager;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.RedisManager;
@@ -95,6 +96,7 @@
import com.yeshi.fanli.util.pinduoduo.PinDuoDuoUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import com.yeshi.fanli.util.user.UserLevelUtil;
import com.yeshi.fanli.vo.goods.CouponInfoVO;
import com.yeshi.fanli.vo.goods.GoodsDetailExtraVO;
import com.yeshi.fanli.vo.goods.GoodsDetailVO;
@@ -205,6 +207,23 @@
    @Resource
    private GoodsEvaluateService goodsEvaluateService;
    @Resource
    private UserLevelManager userLevelManager;
    private ConfigParamsDTO getParamsDTO(String platform, String version, Long uid) {
        UserLevelEnum level = UserLevelEnum.daRen;
        if (uid != null && uid > 0) {
            level = userLevelManager.getUserLevel(uid);
            if (level != null) {
                if (System.currentTimeMillis() < Constant.NEW_ORDER_FANLI_RULE_TIME)
                    level = UserLevelUtil.getOldLevel(level);
            }
        }
        if (level == null)
            level = UserLevelEnum.daRen;
        return hongBaoManageService.getShowComputeRate(platform, version, level);
    }
    /**
     * 淘宝商品详情
@@ -385,15 +404,14 @@
            LogHelper.errorDetailInfo(e);
        }
        ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
                acceptData.getVersion());
        ConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), uid);
        paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate());
        GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO);
        if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
            goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
            goodsDetail.getMoneyInfo().setShareMoney(
                    "¥" + TaoBaoUtil.getGoodsHongBaoMoney(goods, hongBaoManageService.getVIPShareRate()));
            goodsDetail.getMoneyInfo().setShareMoney("¥" + TaoBaoUtil.getGoodsHongBaoMoney(goods,
                    hongBaoManageService.getShareRate(UserLevelEnum.superVIP)));
            goodsDetail.getMoneyInfo().setRateInfo(goodsDetail.getMoneyInfo().getMaxRateInfo());
            goodsDetail.getMoneyInfo().setCompositionInfo(goodsDetail.getMoneyInfo().getMaxCompositionInfo());
        }
@@ -609,7 +627,8 @@
                    e.printStackTrace();
                }
                coupon.setShopCoupon(true);
                coupon.setLink("https://uland.taobao.com/quan/detail?sellerId=725677994&activityId=d03aa6d23a5a4040afb3942e7ea9a007");
                coupon.setLink(
                        "https://uland.taobao.com/quan/detail?sellerId=725677994&activityId=d03aa6d23a5a4040afb3942e7ea9a007");
                couponInfoList.add(coupon);
            }
            goodsDetail.setCouponInfoList(couponInfoList);
@@ -672,14 +691,13 @@
        // 保存缓存
        jdGoodsCacheUtil.saveGoodsInfo(jdGoods);
        ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
                acceptData.getVersion());
        ConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), uid);
        paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate());
        GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertJDGoods(jdGoods, paramsDTO);
        if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
            goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
            goodsDetail.getMoneyInfo()
                    .setShareMoney("¥" + JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getVIPShareRate()));
            goodsDetail.getMoneyInfo().setShareMoney("¥"
                    + JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getShareRate(UserLevelEnum.superVIP)));
            goodsDetail.getMoneyInfo().setRateInfo(goodsDetail.getMoneyInfo().getMaxRateInfo());
            goodsDetail.getMoneyInfo().setCompositionInfo(goodsDetail.getMoneyInfo().getMaxCompositionInfo());
        }
@@ -707,8 +725,8 @@
                    otherInfo.setFanliMoneyPlus("京东plus返¥" + fanliMoneyPlus);
                    // 使用奖励券最高返
                    if (VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion())) {
                        maxMoneyPlus = "(京东plus返¥"
                                + JDUtil.getGoodsFanLiMoneyPlus(jdGoods, hongBaoManageService.getVIPFanLiRate()) + ")";
                        maxMoneyPlus = "(京东plus返¥" + JDUtil.getGoodsFanLiMoneyPlus(jdGoods,
                                hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP)) + ")";
                    } else
                        maxMoneyPlus = "(京东plus最高返¥"
                                + fanliMoneyPlus.add(MoneyBigDecimalUtil.mul(fanliMoneyPlus, Constant.MAX_REWARD_RATE))
@@ -883,15 +901,14 @@
            return;
        }
        ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
                acceptData.getVersion());
        ConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), uid);
        paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate());
        GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertPDDGoods(pddGoods, paramsDTO);
        if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
            goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
            goodsDetail.getMoneyInfo().setShareMoney(
                    "¥" + PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods, hongBaoManageService.getVIPShareRate()));
            goodsDetail.getMoneyInfo().setShareMoney("¥" + PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods,
                    hongBaoManageService.getShareRate(UserLevelEnum.superVIP)));
            goodsDetail.getMoneyInfo().setRateInfo(goodsDetail.getMoneyInfo().getMaxRateInfo());
            goodsDetail.getMoneyInfo().setCompositionInfo(goodsDetail.getMoneyInfo().getMaxCompositionInfo());
        }
@@ -1069,8 +1086,7 @@
                    list = list.subList(0, 10);
                }
                ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
                        acceptData.getVersion());
                ConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), null);
                List<GoodsDetailVO> listDetailVO = new ArrayList<GoodsDetailVO>();
                for (JDGoods goods : list) {
@@ -1111,8 +1127,8 @@
                                goodsList = goodsList.subList(0, 10);
                            }
                            ConfigParamsDTO paramsDTO = hongBaoManageService
                                    .getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion());
                            ConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(),
                                    null);
                            for (PDDGoodsDetail goods : goodsList) {
                                listDetailVO.add(GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO));
                            }
@@ -1155,8 +1171,7 @@
            if (goodsList != null && goodsList.size() > 0) {
                ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
                        acceptData.getVersion());
                ConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), null);
                goodsList.parallelStream().forEach(goods -> {
                    if (goods != null) {
@@ -1437,8 +1452,8 @@
        Map<String, GoodsDetailVO> tempGoodsList = new HashMap<>();
        ConfigParamsDTO params = new ConfigParamsDTO(hongBaoManageService.getFanLiRate(),
                hongBaoManageService.getShareRate(), new BigDecimal(80), hongBaoManageService.getVIPFanLiRate());
        hongBaoManageService.getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion());
                hongBaoManageService.getShareRate(), new BigDecimal(80),
                hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP));
        if (tbGoodsList.size() > 0) {
            List<TaoBaoGoodsBrief> goodsList = null;
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java
@@ -24,6 +24,7 @@
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.homemodule.Special;
import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.common.JumpDetailV2;
import com.yeshi.fanli.entity.jd.JDGoods;
import com.yeshi.fanli.entity.system.ConfigKeyEnum;
@@ -576,7 +577,7 @@
                if (list != null && list.size() > 0) {
                    BigDecimal rateBuy = TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE;
                    ConfigParamsDTO paramsBuy = new ConfigParamsDTO(rateBuy, rateBuy, Constant.MAX_REWARD_RATE,
                            hongBaoManageService.getVIPFanLiRate());
                            hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP));
                    for (int i = list.size() - 1; i >= 0; i--) {
                        TLJBuyGoods goods = list.get(i);
                        GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goods.getGoods(), paramsBuy);
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java
@@ -35,6 +35,7 @@
import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.entity.jd.JDGoods;
import com.yeshi.fanli.entity.system.ConfigKeyEnum;
@@ -650,7 +651,7 @@
            // 设置评论文本选项
            shareInfo.setCommentTextChoiceList(getCommentChoiceList(shareInfo.getCommentText(), null, inviteCode,
                    TaoBaoUtil.getGoodsHongBaoMoney(taoBaoLink.getGoods(), hongBaoManageService.getVIPFanLiRate())));
                    TaoBaoUtil.getGoodsHongBaoMoney(taoBaoLink.getGoods(), hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP))));
            out.print(JsonUtil.loadTrueResult(
                    JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
@@ -819,7 +820,7 @@
        // 设置评论文本选项
        shareInfo.setCommentTextChoiceList(getCommentChoiceList(null, shareInfo.getCommentText(), inviteCode,
                JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getVIPFanLiRate())));
                JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP))));
        out.print(JsonUtil.loadTrueResult(
                JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
@@ -892,7 +893,7 @@
                    .setGoodsInfo(GoodsDetailVOFactory.convertPDDGoods(goods,
                            new ConfigParamsDTO(hongBaoManageService.getFanLiRate(),
                                    hongBaoManageService.getShareRate(), Constant.MAX_REWARD_RATE,
                                    hongBaoManageService.getVIPFanLiRate())));
                                    hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP))));
        }
        // 创建口令
@@ -989,7 +990,7 @@
        // 设置评论文本选项
        shareInfo.setCommentTextChoiceList(getCommentChoiceList(null, shareInfo.getCommentText(), inviteCode,
                PinDuoDuoUtil.getGoodsFanLiMoney(goods, hongBaoManageService.getVIPFanLiRate())));
                PinDuoDuoUtil.getGoodsFanLiMoney(goods, hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP))));
        out.print(JsonUtil.loadTrueResult(
                JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/TaoLiJinControllerV2.java
@@ -33,6 +33,7 @@
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail.TaoLiJinDetailTypeEnum;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinNewbies;
import com.yeshi.fanli.entity.bus.user.UserMoneyExtra;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.system.ConfigKeyEnum;
import com.yeshi.fanli.entity.taobao.ShareHotGoods;
import com.yeshi.fanli.entity.taobao.TLJBuyGoods;
@@ -148,13 +149,12 @@
    @Resource
    private SwiperPictureService swiperPictureService;
    @Resource
    private UserTaoLiJinNewbiesService userTaoLiJinNewbiesService;
    @Resource
    private TLJFreeBuyGoodsService tljFreeBuyGoodsService;
    /**
     * 获取淘礼金分享记录
@@ -380,8 +380,6 @@
        out.print(JsonUtil.loadTrueResult(data));
    }
    /**
     * 分享爆款商品-限于淘礼金
     * 
@@ -488,8 +486,8 @@
                isNewUser = false;
            }
        }
        ConfigParamsDTO paramsDTO =  hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
        ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
                acceptData.getVersion());
        for (ShareHotGoods hotGoods : listHot) {
@@ -508,7 +506,7 @@
            }
            GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO);
            // 大于1.6.5的才会显示福利价
            if (com.yeshi.fanli.util.VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion())) {
                if (detailVO.getCouponPrice() != null && detailVO.getCouponPrice().compareTo(new BigDecimal(0)) > 0)
@@ -516,7 +514,7 @@
                else
                    detailVO.setZkPrice(detailVO.getZkPrice().subtract(spreadMoney));
            }
            // 去掉标签
            detailVO.setLabels(null);
@@ -616,7 +614,8 @@
        data.put("count", array.size());
        data.put("list", array);
        if (page == 1) {
            List<SwiperPicture> bannerList = swiperPictureService.getByBannerCardAndVersion("zigoulijian_banner",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
            List<SwiperPicture> bannerList = swiperPictureService.getByBannerCardAndVersion("zigoulijian_banner",
                    acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
            if (bannerList != null && bannerList.size() > 0)
                data.put("topPicture", bannerList.get(0).getSrc());
@@ -649,7 +648,8 @@
                .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
        BigDecimal proportion = TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE;
        ConfigParamsDTO paramsDTO = new ConfigParamsDTO(proportion, proportion, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
        ConfigParamsDTO paramsDTO = new ConfigParamsDTO(proportion, proportion, Constant.MAX_REWARD_RATE,
                hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP));
        for (TLJBuyGoods hotGoods : listHot) {
            TaoBaoGoodsBrief taoBaoGoodsBrief = hotGoods.getGoods();
            if (taoBaoGoodsBrief == null) {
@@ -703,7 +703,8 @@
        data.put("count", array.size());
        data.put("list", array);
        if (page == 1) {
            List<SwiperPicture> bannerList = swiperPictureService.getByBannerCardAndVersion("zigoulijian_banner",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
            List<SwiperPicture> bannerList = swiperPictureService.getByBannerCardAndVersion("zigoulijian_banner",
                    acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
            if (bannerList != null && bannerList.size() > 0)
                data.put("topPicture", bannerList.get(0).getSrc());
@@ -728,8 +729,6 @@
        out.print(JsonUtil.loadFalseResult(1, "抱歉,推广红包相关功能已下线!"));
    }
    /**
     * 新人红包详情
     * 
@@ -752,7 +751,8 @@
            }
            // 2、顶部轮播图
            List<SwiperPicture> oldtopPicList = swiperPictureService.getByBannerCardAndVersion("redpack_win_detail_banner",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
            List<SwiperPicture> oldtopPicList = swiperPictureService.getByBannerCardAndVersion(
                    "redpack_win_detail_banner", acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
            List<SwiperPicture> topPicList = new ArrayList<>();
            if (oldtopPicList != null && oldtopPicList.size() > 0)
                topPicList.addAll(oldtopPicList);
@@ -765,8 +765,7 @@
            out.print(JsonUtil.loadFalseResult(1, "红包已被抢光啦"));
        }
    }
    /**
     * 新人免单列表
     * @param acceptData
@@ -779,13 +778,13 @@
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
        }
        String day = TimeUtil.getGernalTime(java.lang.System.currentTimeMillis());
        List<TLJFreeBuyGoods> listFree = tljFreeBuyGoodsService.listByDay(day);
        if (listFree == null) {
            listFree = new ArrayList<TLJFreeBuyGoods>();
        }
        JSONArray array = new JSONArray();
        Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
@@ -797,14 +796,14 @@
            TaoBaoGoodsBrief goods = freeGoods.getGoods();
            if (goods == null)
                continue;
            // 计算券后价  1<= n <= 2
            // 计算券后价 1<= n <= 2
            BigDecimal couplePrice = TaoBaoUtil.getAfterUseCouplePrice(goods);
            if (couplePrice.compareTo(new BigDecimal(1.0)) < 0 && couplePrice.compareTo(new BigDecimal(2.0)) > 0)
                continue;
            GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO);
            // 专属标签
            List<ClientTextStyleVO> labels = new ArrayList<ClientTextStyleVO>();
            labels.add(new ClientTextStyleVO("新人专属", "#FE0014"));
@@ -826,12 +825,12 @@
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, e.getMsg()));
                return;
            }
            String state = "已过期";
            BigDecimal balance = new BigDecimal(0);
            UserTaoLiJinNewbies winDetail = userTaoLiJinNewbiesService.selectByPrimaryKey(uid);
            if (winDetail != null) {
                balance = winDetail.getMoney() ;
                balance = winDetail.getMoney();
                if (winDetail.getEndTime().getTime() > java.lang.System.currentTimeMillis()) {
                    try {
                        String remaining = DateUtil.dateDiff2(new Date(), winDetail.getEndTime());
@@ -842,12 +841,12 @@
                    }
                }
            }
            String rule = configTaoLiJinService.getValueByKey("new_user_free_buy_list_rule");
            rule = rule.replace("{链接}", configService.get(ConfigKeyEnum.customerServiceLink.getKey()));
            data.put("state", state);
            data.put("balance","新人红包:" + balance.setScale(2) + "元");
            data.put("balance", "新人红包:" + balance.setScale(2) + "元");
            data.put("rule", rule);
        }
        JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/GoodsController.java
@@ -36,6 +36,7 @@
import com.yeshi.fanli.entity.bus.share.UserShareGoodsHistory;
import com.yeshi.fanli.entity.bus.user.ShamUser;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.goods.CollectionGoodsV2;
import com.yeshi.fanli.entity.jd.JDGoods;
import com.yeshi.fanli.entity.jd.JDGoodsClass;
@@ -321,7 +322,7 @@
        if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
            goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
            goodsDetail.getMoneyInfo()
                    .setShareMoney("¥" + JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getVIPShareRate()));
                    .setShareMoney("¥" + JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getShareRate(UserLevelEnum.superVIP)));
            goodsDetail.getMoneyInfo().setRateInfo(goodsDetail.getMoneyInfo().getMaxRateInfo());
            goodsDetail.getMoneyInfo().setCompositionInfo(goodsDetail.getMoneyInfo().getMaxCompositionInfo());
        }
@@ -351,7 +352,7 @@
                    // 使用奖励券最高返
                    maxMoneyPlus = "(京东plus返¥"
                            + JDUtil.getGoodsFanLiMoneyPlus(jdGoods, hongBaoManageService.getVIPFanLiRate()) + ")";
                            + JDUtil.getGoodsFanLiMoneyPlus(jdGoods, hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP)) + ")";
                }
            }
@@ -491,7 +492,7 @@
        if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
            goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
            goodsDetail.getMoneyInfo().setShareMoney(
                    "¥" + PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods, hongBaoManageService.getVIPShareRate()));
                    "¥" + PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods, hongBaoManageService.getShareRate(UserLevelEnum.superVIP)));
        }
        if (goodsDetail.getCouponInfo() != null) {
fanli/src/main/java/com/yeshi/fanli/dto/order/OrderHongBaoRateParams.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/entity/money/UserMoneyDetail.java
@@ -28,6 +28,7 @@
    public enum UserMoneyDetailTypeEnum {
        share("分享奖金", "http://img.flqapp.com/resource/money_detail/icon_share.png", ""),
        invite("团队奖金", "http://img.flqapp.com/resource/money_detail/icon_invite.png", ""),
        inviteAndShare("奖金收入", "http://img.flqapp.com/resource/money_detail/icon_share.png", ""),
        fanli("返利到账", "http://img.flqapp.com/resource/money_detail/icon_fanli.png", ""),
        fanliWeiQuan("返利扣除",
@@ -57,7 +58,22 @@
        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", ""),
        orderTeamDividents("团队分红", "http://img.flqapp.com/resource/msg/icon_msg_team_reward.png", "");
        teamReward("团队收益", "http://img.flqapp.com/resource/money_detail/icon_invite.png", ""),
        teamDividents("团队分红", "http://img.flqapp.com/resource/money_detail/icon_invite.png", ""),
        fanliNew("自购返利", "http://img.flqapp.com/resource/money_detail/icon_fanli.png", ""),
        orderRewardNew("返利再返", "http://img.flqapp.com/resource/money_detail/icon_order_reward.png", ""),
        shareNew("分享奖金", "http://img.flqapp.com/resource/money_detail/icon_share.png", ""),
        systemEqualizeNew("系统补齐", "http://img.flqapp.com/resource/money_detail/icon_system.png", ""),
        fanliWeiQuanNew("返利退回",
                "http://img.flqapp.com/resource/money_detail/icon_fanli.png",
                "http://apph5.banliapp.com/AppPage/1.8.0/all_help_content.html?id=214"),
        extractNew("提现", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),
        extractVerifyNew("提现验证", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),
        systemTakeOff("系统扣除", "http://img.flqapp.com/resource/money_detail/icon_extract.png", "");
        private final String desc;
        private final String picture;
fanli/src/main/java/com/yeshi/fanli/job/DynamicInfoJob.java
@@ -16,6 +16,7 @@
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.entity.bus.activity.RecommendActivity;
import com.yeshi.fanli.entity.bus.activity.RecommendActivityInviteInfo;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.dynamic.GoodsPicture;
import com.yeshi.fanli.entity.dynamic.WXMPDynamicInfo;
import com.yeshi.fanli.entity.goods.jd.NYouHuiGoods;
@@ -317,7 +318,7 @@
                        GoodsDetailVOFactory.convertJDGoods(jdGoods,
                                new ConfigParamsDTO(hongBaoManageService.getFanLiRate(),
                                        hongBaoManageService.getShareRate(), null,
                                        hongBaoManageService.getVIPFanLiRate())));
                                        hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP))));
                picture.setGoodState(0);
                picture.setJumpDetail(jumpDetailV2Service.getByTypeCache("goodsdetail"));
                picture.setParams(null);
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/DynamicInfoServiceImpl.java
@@ -31,6 +31,7 @@
import com.yeshi.fanli.entity.bus.activity.RecommendActivityInviteInfo;
import com.yeshi.fanli.entity.bus.activity.RecommendActivityTaoBaoGoods;
import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.common.JumpDetailV2;
import com.yeshi.fanli.entity.dynamic.DynamicInfo;
import com.yeshi.fanli.entity.dynamic.GoodsPicture;
@@ -979,7 +980,7 @@
            BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
            BigDecimal shareRate = hongBaoManageService.getShareRate();
            ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
            ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP));
            for (DynamicInfo dynamicInfo : list) {
                DynamicInfo dynamicNew = new DynamicInfo();
fanli/src/main/java/com/yeshi/fanli/service/impl/elme/ElmeOrderProcessServiceImpl.java
@@ -11,6 +11,7 @@
import com.yeshi.fanli.entity.bus.user.HongBaoV2;
import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.elme.ElmeHongBaoOrderMap;
import com.yeshi.fanli.entity.elme.ElmeOrder;
import com.yeshi.fanli.exception.elme.ElmeHongBaoOrderMapException;
@@ -52,7 +53,7 @@
    @Resource
    private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
    @Transactional(rollbackFor=Exception.class)
    @Transactional(rollbackFor = Exception.class)
    @Override
    public void processOrder(ElmeOrder elmeOrder) throws ElmeOrderException {
        try {
@@ -68,11 +69,11 @@
        if (map == null)// 订单不存在
        {
            Long uid = null;
            if (StringUtil.isNullOrEmpty(elmeOrder.getChannelId())) {//新版本
            if (StringUtil.isNullOrEmpty(elmeOrder.getChannelId())) {// 新版本
                UserExtraTaoBaoInfo extra = userExtraTaoBaoInfoService.getByRelationId(elmeOrder.getRid());
                if (extra != null)
                    uid = extra.getUser().getId();
            } else {//老版本
            } else {// 老版本
                uid = Long.parseLong(elmeOrder.getRid());
            }
@@ -97,7 +98,7 @@
            } catch (ElmeHongBaoOrderMapException e) {
                throw new ElmeOrderException(e.getCode(), e.getMsg());
            }
        } else {// 订单存在
            HongBaoV2 oldHongBao = hongBaoV2Service.selectByPrimaryKey(map.getHongBao().getId());
            if (oldHongBao == null)
@@ -113,14 +114,15 @@
                update.setPreGetTime(hongBao.getPreGetTime());
                update.setUpdateTime(new Date());
                hongBaoV2Service.updateByPrimaryKeySelective(update);
            }
        }
    }
    private HongBaoV2 createHongBao(ElmeOrder elmeOrder, UserInfo userInfo) {
        BigDecimal fanliRate = hongBaoManageService.getFanLiRate(elmeOrder.getOrderDate().getTime());
        BigDecimal fanliRate = hongBaoManageService.getFanLiRate(UserLevelEnum.daRen,
                elmeOrder.getOrderDate().getTime());
        HongBaoV2 hongBao = new HongBaoV2();
        hongBao.setCreateTime(new Date());
        hongBao.setGetTime(null);
@@ -129,7 +131,8 @@
                new BigDecimal(100)));
        if (elmeOrder.getIsSettle() == true)
            hongBao.setPreGetTime(new Date(elmeOrder.getOrderDate().getTime() + 1000 * 60 * 60 * 24 * 15L));
        if (elmeOrder.getPayMoney().compareTo(new BigDecimal(0)) <= 0||(elmeOrder.getState()!=null&&elmeOrder.getState()==0))
        if (elmeOrder.getPayMoney().compareTo(new BigDecimal(0)) <= 0
                || (elmeOrder.getState() != null && elmeOrder.getState() == 0))
            hongBao.setState(HongBaoV2.STATE_SHIXIAO);
        else {
            if (elmeOrder.getIsSettle() == true) {
fanli/src/main/java/com/yeshi/fanli/service/impl/money/UserMoneyDetailServiceImpl.java
@@ -39,14 +39,15 @@
    }
    @Override
    public List<UserMoneyDetailHistoryVO> listUserMoneyDetailForClient(Long uid, Long userMoneyDetailId, Integer type, Date maxTime) {
    public List<UserMoneyDetailHistoryVO> listUserMoneyDetailForClient(Long uid, Long userMoneyDetailId, Integer type,
            Date maxTime) {
        List<UserMoneyDetailHistoryVO> finalList = new ArrayList<>();
        List<UserMoneyDetail> list = null;
        if (userMoneyDetailId == null) {// 首次请求
            if (maxTime == null)// 没有筛选时间
            {
                Date date = new Date(System.currentTimeMillis() + 1000 * 60 * 60L);
                list = userMoneyDetailMapper.selectByMaxCreateTime(uid,    date, 20, type);
                list = userMoneyDetailMapper.selectByMaxCreateTime(uid, date, 20, type);
                System.out.println("maxTime == null");
            } else {// 筛选了时间
                System.out.println("maxTime != null");
@@ -74,7 +75,8 @@
        } else {// 二次请求
            int size = 21;
            List<UserMoneyDetail> tempList = userMoneyDetailMapper.selectByUidWithIndexId(uid, userMoneyDetailId, size, type);
            List<UserMoneyDetail> tempList = userMoneyDetailMapper.selectByUidWithIndexId(uid, userMoneyDetailId, size,
                    type);
            Set<Date> dateSet = new HashSet<>();// 用于储存是否在同一时间上面(精确到秒)
            if (tempList.size() > 0) {
                for (UserMoneyDetail umd : tempList) {
@@ -187,14 +189,15 @@
                inType = true;
                break;
            }
        if (inType)
        if (inType) {
            detail.setTitle(detail.getTitle() + "【" + Constant.getSourceName(detail.getOrderType()) + "】");
        }
        return detail;
    }
    @Override
    public long countUserMoneyDetailForClient(Long uid, Long userMoneyDetailId,Integer type, Date maxTime) {
        //TODO 增加type筛选
    public long countUserMoneyDetailForClient(Long uid, Long userMoneyDetailId, Integer type, Date maxTime) {
        // TODO 增加type筛选
        long monthCount = 0L;
        long detailCount = 0L;
        // 未通过时间筛选,查询所有
@@ -244,14 +247,13 @@
        BigDecimal money = userMoneyDetailMapper.getTotalMoneyByTypeAndUidWithDate(uid, list, minDate, maxDate, show);
        return money == null ? new BigDecimal(0) : money;
    }
    @Override
    public UserMoneyDetail selectByTypeAndUidAndIdentifyCode(UserMoneyDetailTypeEnum type, Long uid,
            Long sourceIdentifyId) {
        return userMoneyDetailMapper.selectByTypeAndUidAndIdentifyCode(type, uid, sourceIdentifyId);
    }
    @Override
    public List<UserMoneyDetail> listQuery(int page, int pageSize, String key, Integer keyType) {
        return userMoneyDetailMapper.listQuery((page - 1) * pageSize, pageSize, key, keyType);
@@ -259,11 +261,11 @@
    @Override
    public long countQuery(String key, Integer keyType) {
         Long count = userMoneyDetailMapper.countQuery(key, keyType);
         if (count == null) {
             count = 0L;
         }
         return count;
        Long count = userMoneyDetailMapper.countQuery(key, keyType);
        if (count == null) {
            count = 0L;
        }
        return count;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/money/extract/ExtractServiceImpl.java
@@ -178,7 +178,6 @@
        updateExtract.setId(id);
        updateExtract.setState(Extract.STATE_PROCESSING);
        extractMapper.updateByPrimaryKeySelective(updateExtract);
        // TODO 新版部署后删除
        // 改变资金记录状态
        UserMoneyDetail detail = userMoneyDetailService.selectByTypeAndUidAndIdentifyCode(
                UserMoneyDetailTypeEnum.extract, find.getUserInfo().getId(), find.getId());
@@ -327,7 +326,7 @@
        // 新版资金详情
        UserMoneyDetail userMoneyDetail = null;
        try {
            userMoneyDetail = UserMoneyDetailFactory.createExtract(extract);
            userMoneyDetail = UserMoneyDetailFactory.createExtract(extract, null);
        } catch (UserMoneyDetailException e2) {
            try {
                LogHelper.errorDetailInfo(e2);
@@ -552,6 +551,24 @@
        if (payInfoList != null && payInfoList.size() > 0)
            alipayNo = payInfoList.get(0).getOrderId();
        UserMoneyDetail detailNew = null;
        try {
            detailNew = UserMoneyDetailFactory.createExtract(updateExtract, alipayNo);
        } catch (UserMoneyDetailException e) {
            e.printStackTrace();
        }
        // 外显账户明细
        UserMoneyDetail userMoneyDetail = userMoneyDetailMapper.selectByTypeAndUidAndIdentifyCode(
                UserMoneyDetailTypeEnum.extract, extract.getUserInfo().getId(), extract.getId());
        if (userMoneyDetail != null) {
            UserMoneyDetail detail = new UserMoneyDetail(userMoneyDetail.getId());
            detail.setShow(true);
            detail.setUpdateTime(new Date());
            if (detailNew != null)
                detail.setDescInfo(detailNew.getDescInfo());
            userMoneyDetailMapper.updateByPrimaryKeySelective(detail);
        }
        // 新版通知
        userMoneyMsgNotificationService.extractSuccess(extract, alipayNo);
    }
@@ -716,16 +733,6 @@
            // 更新提现记录审核表
            extractAuditRecordMapper.updateByPrimaryKeySelective(auditRecord);
        }
        // 外显账户明细
        UserMoneyDetail userMoneyDetail = userMoneyDetailMapper.selectByTypeAndUidAndIdentifyCode(
                UserMoneyDetailTypeEnum.extract, extract.getUserInfo().getId(), extract.getId());
        if (userMoneyDetail != null) {
            UserMoneyDetail detail = new UserMoneyDetail(userMoneyDetail.getId());
            detail.setShow(true);
            detail.setUpdateTime(new Date());
            userMoneyDetailMapper.updateByPrimaryKeySelective(detail);
        }
    }
fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoV2ServiceImpl.java
@@ -30,6 +30,7 @@
import com.yeshi.fanli.entity.bus.user.ThreeSale;
import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.order.CommonOrder;
import com.yeshi.fanli.entity.order.CommonOrderGoods;
import com.yeshi.fanli.entity.order.HongBaoOrder;
@@ -263,7 +264,7 @@
            return false;
        if (type == HongBaoV2.TYPE_ZIGOU) {// 获取自购的返利比例
            BigDecimal fanliRate = hongBaoManageService.getFanLiRate(commonOrder.getCreateTime().getTime());
            BigDecimal fanliRate = hongBaoManageService.getFanLiRate(UserLevelEnum.daRen,commonOrder.getCreateTime().getTime());
            // 免单处理
            boolean mianDan = false;
            List<CommonOrder> orderList = commonOrderService.listBySourceTypeAndOrderId(Constant.SOURCE_TYPE_TAOBAO,
@@ -517,7 +518,7 @@
                    && commonOrder.getSourcePosition().equalsIgnoreCase(TaoBaoConstant.TAOBAO_TLJ_RELATION_PID_DEFAULT))
                fanliRate = hongBaoManageService.getTLJShareRate(commonOrder.getCreateTime().getTime());
            else
                fanliRate = hongBaoManageService.getShareRate(commonOrder.getCreateTime().getTime());
                fanliRate = hongBaoManageService.getShareRate(UserLevelEnum.daRen,commonOrder.getCreateTime().getTime());
            List<ShareGoodsActivityOrder> list = shareGoodsActivityOrderService
                    .listByOrderIdAndUid(commonOrder.getUserInfo().getId(), commonOrder.getOrderNo());
@@ -641,7 +642,7 @@
    private void saveHongBao(CommonOrder commonOrder, int type, Map<Integer, HongBaoOrder> notificationMap)
            throws HongBaoException, UserAccountException {
        if (type == HongBaoV2.TYPE_ZIGOU) {// 获取自购的返利比例
            BigDecimal fanliRate = hongBaoManageService.getFanLiRate(commonOrder.getCreateTime().getTime());
            BigDecimal fanliRate = hongBaoManageService.getFanLiRate(UserLevelEnum.daRen,commonOrder.getCreateTime().getTime());
            // 查询是否有免单计划
            BigDecimal mianDanMoney = null;
            if (commonOrder.getState() == CommonOrder.STATE_JS || commonOrder.getState() == CommonOrder.STATE_FK) {
@@ -856,7 +857,7 @@
                    && commonOrder.getSourcePosition().equalsIgnoreCase(TaoBaoConstant.TAOBAO_TLJ_RELATION_PID_DEFAULT))// 来自于淘礼金的分享
                shareRate = hongBaoManageService.getTLJShareRate(commonOrder.getCreateTime().getTime());
            else
                shareRate = hongBaoManageService.getShareRate(commonOrder.getCreateTime().getTime());
                shareRate = hongBaoManageService.getShareRate(UserLevelEnum.daRen,commonOrder.getCreateTime().getTime());
            // 判断订单分享活动是否开启
            if ("1".equalsIgnoreCase(configService.get(ConfigKeyEnum.shareGoodsActivityOpen.getKey()))) {
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderHongBaoMoneyComputeServiceImpl.java
@@ -52,7 +52,8 @@
            else
                return null;
        } else {
            BigDecimal rate = hongBaoManageService.getFanLiRate(order.getThirdCreateTime().getTime());
            BigDecimal rate = hongBaoManageService.getFanLiRate(UserLevelEnum.daRen,
                    order.getThirdCreateTime().getTime());
            if (order.getState() == CommonOrder.STATE_JS || order.getState() == CommonOrder.STATE_WQ)
                return MoneyBigDecimalUtil.div(MoneyBigDecimalUtil.mul(rate, order.geteIncome()), new BigDecimal(100));
            else if (order.getEstimate() != null)
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderMoneySettleServiceImpl.java
@@ -2,7 +2,6 @@
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
@@ -710,22 +709,8 @@
        if (sharemoney.compareTo(new BigDecimal(0)) > 0) {
            // 添加新版详情记录
            try {
                // 计算本月的有效订单,失效订单,维权订单
                Calendar ca = Calendar.getInstance();
                Date maxDate = new Date(TimeUtil
                        .convertToTimeTemp(ca.get(Calendar.YEAR) + "-" + (ca.get(Calendar.MONTH) + 1), "yyyy-M"));
                ca.add(Calendar.MONTH, -1);
                Date minDate = new Date(TimeUtil
                        .convertToTimeTemp(ca.get(Calendar.YEAR) + "-" + (ca.get(Calendar.MONTH) + 1), "yyyy-M"));
                long validCount = hongBaoV2Mapper.countShareOrderCountByUidAndSettleTime(uid, CommonOrder.STATE_JS,
                        minDate, maxDate, Constant.SOURCE_TYPE_TAOBAO);
                long weiQuanCount = hongBaoV2Mapper.countShareOrderCountByUidAndSettleTime(uid, CommonOrder.STATE_WQ,
                        minDate, maxDate, Constant.SOURCE_TYPE_TAOBAO);
                UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createShare(uid, Constant.SOURCE_TYPE_TAOBAO,
                        (int) validCount, (int) weiQuanCount, sharemoney, new Date());
                        sharemoney, new Date());
                // 添加资金
                userMoneyService.addUserMoney(uid, sharemoney, userMoneyDetail);
@@ -809,22 +794,8 @@
        if (sharemoney.compareTo(new BigDecimal(0)) > 0) {
            // 添加新版详情记录
            try {
                // 计算本月的有效订单,失效订单,维权订单
                Calendar ca = Calendar.getInstance();
                Date maxDate = new Date(TimeUtil
                        .convertToTimeTemp(ca.get(Calendar.YEAR) + "-" + (ca.get(Calendar.MONTH) + 1), "yyyy-M"));
                ca.add(Calendar.MONTH, -1);
                Date minDate = new Date(TimeUtil
                        .convertToTimeTemp(ca.get(Calendar.YEAR) + "-" + (ca.get(Calendar.MONTH) + 1), "yyyy-M"));
                long validCount = hongBaoV2Mapper.countShareOrderCountByUidAndSettleTime(uid, CommonOrder.STATE_JS,
                        minDate, maxDate, sourceType);
                long weiQuanCount = hongBaoV2Mapper.countShareOrderCountByUidAndSettleTime(uid, CommonOrder.STATE_WQ,
                        minDate, maxDate, sourceType);
                UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createShare(uid, sourceType, (int) validCount,
                        (int) weiQuanCount, sharemoney, new Date());
                UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createShare(uid, sourceType, sharemoney,
                        new Date());
                // 添加资金
                userMoneyService.addUserMoney(uid, sharemoney, userMoneyDetail);
@@ -868,9 +839,9 @@
     */
    @Transactional(rollbackFor = Exception.class)
    @Override
    public void inviteSubsidySettle(Long uid, String taskKey,Date maxPreGetTime)
    public void inviteSubsidySettle(Long uid, String taskKey, Date maxPreGetTime)
            throws OrderMoneySettleException, TeamEincomeRecordException, ParamsException {
        teamSubsidyManager.addToTeamEincome(uid, taskKey,maxPreGetTime);
        teamSubsidyManager.addToTeamEincome(uid, taskKey, maxPreGetTime);
    }
    private String getTaskKey(Long uid) {
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderRepairServiceImpl.java
@@ -27,6 +27,7 @@
import com.yeshi.fanli.dao.mybatis.order.OrderRepairHistoryMapper;
import com.yeshi.fanli.entity.bus.user.HongBaoV2;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.entity.money.ExtractCheckCompensate;
import com.yeshi.fanli.entity.money.UserMoneyDetail;
@@ -147,7 +148,7 @@
    @Resource
    private ExtractCheckCompensateMapper extractCheckCompensateMapper;
    @Transactional(rollbackFor=Exception.class)
    @Transactional(rollbackFor = Exception.class)
    @Override
    public void repairOrder(String orderId) throws Exception {
        // 比较CommonOrder与TaoBaoOrder的预估收益
@@ -391,10 +392,10 @@
    }
    // 修改订单信息
    @Transactional(rollbackFor=Exception.class)
    @Transactional(rollbackFor = Exception.class)
    private void updateOrderInfo(TaoBaoOrder taoBaoOrder, Long commonOrderId) throws Exception {
        HongBaoOrder hongBaoOrder = hongBaoOrderService.selectDetailByCommonOrderId(commonOrderId);
        CommonOrder newCommonOrder =  CommonOrderFactory.create(taoBaoOrder);
        CommonOrder newCommonOrder = CommonOrderFactory.create(taoBaoOrder);
        List<CommonOrderGoods> commonGoodsList = commonOrderGoodsMapper
                .listByGoodsIdAndGoodsType(taoBaoOrder.getAuctionId() + "", newCommonOrder.getSourceType());
        CommonOrderGoods cog = null;
@@ -432,7 +433,8 @@
        CommonOrder commonOrder = commonOrderService.selectByPrimaryKey(newCommonOrder.getId());
        if (hongBaoOrder.getHongBaoV2().getType() == HongBaoV2.TYPE_ZIGOU) {
            BigDecimal fanliRate = hongBaoManageService.getFanLiRate(commonOrder.getCreateTime().getTime());
            BigDecimal fanliRate = hongBaoManageService.getFanLiRate(UserLevelEnum.daRen,
                    commonOrder.getCreateTime().getTime());
            // 免单处理
            boolean mianDan = false;
            List<CommonOrder> orderList = commonOrderService.listBySourceTypeAndOrderId(Constant.SOURCE_TYPE_TAOBAO,
@@ -442,7 +444,8 @@
                if (commonOrder.getState() == CommonOrder.STATE_JS)
                    payMent = commonOrder.getSettlement();
                if (payMent.compareTo(new BigDecimal(10)) < 0) {
                    mianDan = userSystemCouponRecordService.isSuccessMianDan(commonOrder.getSourceType(),commonOrder.getOrderNo());
                    mianDan = userSystemCouponRecordService.isSuccessMianDan(commonOrder.getSourceType(),
                            commonOrder.getOrderNo());
                }
            }
@@ -519,7 +522,8 @@
                }
        } else if (hongBaoOrder.getHongBaoV2().getType() == HongBaoV2.TYPE_SHARE_GOODS) {
            BigDecimal fanliRate = hongBaoManageService.getShareRate(commonOrder.getCreateTime().getTime());
            BigDecimal fanliRate = hongBaoManageService.getShareRate(UserLevelEnum.daRen,
                    commonOrder.getCreateTime().getTime());
            List<ShareGoodsActivityOrder> list = shareGoodsActivityOrderService
                    .listByOrderIdAndUid(commonOrder.getUserInfo().getId(), commonOrder.getOrderNo());
            if (list != null && list.size() > 0) {
@@ -598,7 +602,7 @@
        }
    }
    @Transactional(rollbackFor=Exception.class)
    @Transactional(rollbackFor = Exception.class)
    public void addOrder(CommonOrder commonOrder, int type, Long firstUid, Long secondUid) throws Exception {
        // 增加commonOrder
        commonOrder.setCreateTime(commonOrder.getThirdCreateTime());
@@ -637,7 +641,8 @@
        // 添加红包
        if (type == HongBaoV2.TYPE_ZIGOU) {// 获取自购的返利比例
            BigDecimal fanliRate = hongBaoManageService.getFanLiRate(commonOrder.getCreateTime().getTime());
            BigDecimal fanliRate = hongBaoManageService.getFanLiRate(UserLevelEnum.daRen,
                    commonOrder.getCreateTime().getTime());
            // 查询是否有免单计划
            BigDecimal mianDanMoney = null;
            if (commonOrder.getState() == CommonOrder.STATE_JS || commonOrder.getState() == CommonOrder.STATE_FK) {
@@ -813,7 +818,8 @@
            if (commonOrder.getState() == CommonOrder.STATE_SX || commonOrder.getState() == CommonOrder.STATE_WQ)
                return;
            // 分享赚
            BigDecimal shareRate = hongBaoManageService.getShareRate(commonOrder.getCreateTime().getTime());
            BigDecimal shareRate = hongBaoManageService.getShareRate(UserLevelEnum.daRen,
                    commonOrder.getCreateTime().getTime());
            HongBaoV2 hongBao = new HongBaoV2();
            hongBao.setBeizhu("2019年7月批量修改");
@@ -960,7 +966,7 @@
        return orderInfoMap.get(orderId);
    }
    @Transactional(rollbackFor=Exception.class)
    @Transactional(rollbackFor = Exception.class)
    @Override
    public void repireFirstAndSecondLevel(String orderId) throws Exception {
        repireFirstShare(orderId);
fanli/src/main/java/com/yeshi/fanli/service/impl/order/config/HongBaoManageServiceImpl.java
@@ -13,10 +13,8 @@
import com.yeshi.fanli.dao.mybatis.HongBaoManageMapper;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.dto.order.OrderHongBaoRateParams;
import com.yeshi.fanli.entity.bus.user.HongBaoManage;
import com.yeshi.fanli.entity.order.CommonOrder;
import com.yeshi.fanli.exception.order.HongBaoException;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
import com.yeshi.fanli.util.Constant;
@@ -72,38 +70,34 @@
    }
    @Override
    public BigDecimal getFanLiRate(long time) {
        String key = "hongbao_goods_proportion";
    public BigDecimal getFanLiRate(UserLevelEnum level, long time) {
        HongBaoManage hongBaoManage = hongBaoManageMapper.selectByKeyAndMaxValidTime(key, time);
        if (hongBaoManage == null)
            hongBaoManage = hongBaoManageMapper.selectByKey(key);
        if (hongBaoManage != null)
            return new BigDecimal(hongBaoManage.getValue());
        LogHelper.error("获取返利分成比例出错");
        return null;
        return getBaseFanliRate(time).add(new BigDecimal(get("official_subsidy_zigou_" + level.getLevel())));
    }
    @Override
    public BigDecimal getShareRate(long time) {
        String key = "share_proportion";
        HongBaoManage hongBaoManage = hongBaoManageMapper.selectByKeyAndMaxValidTime(key, time);
        if (hongBaoManage == null)
            hongBaoManage = hongBaoManageMapper.selectByKey(key);
        if (hongBaoManage != null)
            return new BigDecimal(hongBaoManage.getValue());
        LogHelper.error("获取分享赚分成比例出错");
        return null;
    public BigDecimal getShareRate(UserLevelEnum level, long time) {
        return getBaseFanliRate(time).add(new BigDecimal(get("official_subsidy_share_" + level.getLevel())));
    }
    @Override
    public BigDecimal getFanLiRate(UserLevelEnum level) {
        return getFanLiRate(level, System.currentTimeMillis());
    }
    @Override
    public BigDecimal getFanLiRate() {
        return getFanLiRate(System.currentTimeMillis());
        return getFanLiRate(UserLevelEnum.daRen);
    }
    @Override
    public BigDecimal getShareRate(UserLevelEnum level) {
        return getShareRate(level, System.currentTimeMillis());
    }
    @Override
    public BigDecimal getShareRate() {
        return getShareRate(System.currentTimeMillis());
        return getShareRate(UserLevelEnum.daRen);
    }
    @Override
@@ -236,122 +230,25 @@
    }
    @Override
    public BigDecimal getVIPFanLiRate(long time) {
        String key = "hongbao_goods_proportion_vip";
        HongBaoManage hongBaoManage = hongBaoManageMapper.selectByKeyAndMaxValidTime(key, time);
        if (hongBaoManage == null)
            hongBaoManage = hongBaoManageMapper.selectByKey(key);
        if (hongBaoManage != null)
            return new BigDecimal(hongBaoManage.getValue());
        LogHelper.error("获取返利分成比例出错");
        return null;
    }
    public ConfigParamsDTO getShowComputeRate(String platform, String version, UserLevelEnum userLevel) {
    @Override
    public BigDecimal getVIPShareRate(long time) {
        String key = "share_proportion_vip";
        HongBaoManage hongBaoManage = hongBaoManageMapper.selectByKeyAndMaxValidTime(key, time);
        if (hongBaoManage == null)
            hongBaoManage = hongBaoManageMapper.selectByKey(key);
        if (hongBaoManage != null)
            return new BigDecimal(hongBaoManage.getValue());
        LogHelper.error("获取返利分成比例出错");
        return null;
    }
    @Override
    public BigDecimal getVIPFanLiRate() {
        return getVIPFanLiRate(System.currentTimeMillis());
    }
    @Override
    public BigDecimal getVIPShareRate() {
        return getVIPShareRate(System.currentTimeMillis());
    }
    /**
     * 获取比例
     *
     * @param level
     *            0-本级 1-下级 2-下下级
     * @param orderType
     * @param isVip本级是否为VIP
     * @param isWorkerVip下级是否为VIP
     * @return
     */
    public BigDecimal getRate(OrderHongBaoRateParams params) throws HongBaoException {
        if (params == null)
            throw new HongBaoException(1, "比例参数错误");
        long time = params.getOrderCreateTime().getTime();
        if (params.getLevel() == 0) {// 本级
            if (params.getOrderType() == CommonOrder.ORDER_TYPE_ZIGOU) {
                if (params.isVip())
                    return getVIPFanLiRate(time);
                else
                    return getFanLiRate(time);
            } else {
                if (params.isVip())
                    return getVIPShareRate(time);
                else
                    return getShareRate(time);
            }
        } else if (params.getLevel() == 1) {// 上级
            if (params.getOrderType() == CommonOrder.ORDER_TYPE_ZIGOU) {// 自购
                if (params.isSubsidy()) {// 补贴比例
                    if (params.isVip()) {// 下级为会员不补贴
                        return new BigDecimal("0");
                    } else {
                        return getInviteFirstLevelSubsidyRate(time);
                    }
                } else {// 奖金比例
                    if (params.isVip()) {
                        return getByKeyAndMaxTime("new_invite_vip_6", time);
                    } else {
                        return getByKeyAndMaxTime("new_invite_6", time);
                    }
                }
            } else {// 分享
                if (params.isVip()) {
                    return getByKeyAndMaxTime("new_share_vip_21", time);
                } else {
                    return getByKeyAndMaxTime("new_share_21", time);
                }
            }
        } else if (params.getLevel() == 2) {// 上上级
            if (params.getOrderType() == CommonOrder.ORDER_TYPE_ZIGOU) {// 自购
                if (params.isSubsidy()) {// 补贴比例
                    if (params.isVip()) {// 下下级为会员不补贴
                        return new BigDecimal("0");
                    } else {
                        return getInviteSecondLevelSubsidyRate(time);
                    }
                } else {// 奖金比例
                    if (params.isVip())
                        return new BigDecimal("0");
                    else
                        return getByKeyAndMaxTime("new_invite_7", time);
                }
            } else {// 分享
                if (params.isVip())
                    return new BigDecimal("0");
                else
                    return getByKeyAndMaxTime("new_share_22", time);
            }
        BigDecimal fanLiRate = getFanLiRate(userLevel);
        BigDecimal shareRate = getShareRate(userLevel);
        ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
                getFanLiRate(UserLevelEnum.superVIP));
        if (VersionUtil.greaterThan_2_0_5(platform, version)) {
            paramsDTO.setMaxRewardRate(null);
        }
        throw new HongBaoException(2, "未匹配到比例参数");
        return paramsDTO;
    }
    @Override
    public ConfigParamsDTO getShowComputeRate(String platform, String version) {
        BigDecimal fanLiRate = getFanLiRate();
        BigDecimal shareRate = getShareRate();
        BigDecimal fanLiRate = getFanLiRate(UserLevelEnum.daRen);
        BigDecimal shareRate = getShareRate(UserLevelEnum.daRen);
        ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
                getVIPFanLiRate());
                getFanLiRate(UserLevelEnum.superVIP));
        if (VersionUtil.greaterThan_2_0_5(platform, version)) {
            paramsDTO.setMaxRewardRate(null);
        }
fanli/src/main/java/com/yeshi/fanli/service/impl/pdd/PDDGoodsServiceImpl.java
@@ -110,7 +110,7 @@
    }
    @Override
    @Transactional(rollbackFor=Exception.class)
    @Transactional(rollbackFor = Exception.class)
    @Cacheable(value = "pddSpecialCache", key = "'specialSearch-'+#page+'-'+#cid")
    public List<PDDGoodsDetail> specialSearch(Integer page, Long cid) throws PDDOrderException {
        if (cid == null) {
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoShopServiceImpl.java
@@ -15,6 +15,7 @@
import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoShopMapper;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
import com.yeshi.fanli.entity.taobao.TaoBaoShop;
@@ -174,7 +175,7 @@
            return null;
        }
        BigDecimal proportion = hongBaoManageService.getFanLiRate();
        BigDecimal proportion = hongBaoManageService.getFanLiRate(UserLevelEnum.daRen);
        for (TaoBaoShopVO taoBaoShopVO : list) {
            String shopLink = taoBaoShopVO.getShopLink();
@@ -210,7 +211,7 @@
            return null;
        }
        ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(platform, version);
        ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(platform, version,UserLevelEnum.daRen);
        for (TaoBaoShopVO taoBaoShopVO : list) {
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinRecordServiceImpl.java
@@ -25,6 +25,7 @@
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinRecord;
import com.yeshi.fanli.entity.bus.user.TokenRecord;
import com.yeshi.fanli.entity.bus.user.TokenRecord.TokenTypeEnum;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.bus.user.UserMoneyExtra;
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.entity.system.ConfigKeyEnum;
@@ -473,7 +474,7 @@
            BigDecimal shareMoney = new BigDecimal(0);
            BigDecimal commission = userTaoLiJinRecordVO.getCommission();
            if (commission != null && commission.compareTo(shareMoney) > 0) {
                BigDecimal shareRate = hongBaoManageService.getShareRate();
                BigDecimal shareRate = hongBaoManageService.getShareRate(UserLevelEnum.daRen);
                shareMoney = MoneyBigDecimalUtil.mul(commission,
                        MoneyBigDecimalUtil.div(shareRate, new BigDecimal(100)));
                shareMoney = BigDecimalUtil.getWithNoZera(shareMoney);
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserGoodsStorageServiceImpl.java
@@ -20,6 +20,7 @@
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
import com.yeshi.fanli.dto.share.ShareGoodsRecordDTO;
import com.yeshi.fanli.entity.bus.user.UserGoodsStorage;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.entity.jd.JDGoods;
import com.yeshi.fanli.entity.system.ConfigKeyEnum;
@@ -290,7 +291,7 @@
            }
        }
        BigDecimal rate = manageService.getFanLiRate();
        BigDecimal rate = manageService.getFanLiRate(UserLevelEnum.daRen);
        Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
@@ -373,7 +374,7 @@
        BigDecimal totalMoney = new BigDecimal(0.00);
        List<TaoBaoGoodsBrief> listGoodsBrief = new ArrayList<TaoBaoGoodsBrief>();
        BigDecimal rate = hongBaoManageService.getShareRate();
        BigDecimal rate = hongBaoManageService.getShareRate(UserLevelEnum.daRen);
        for (UserGoodsStorage userGoodsStorage : listResult) {
            CommonGoods commonGoods = userGoodsStorage.getCommonGoods();
            TaoBaoGoodsBrief goodsBrief = TaoBaoUtil.convert(commonGoods);
@@ -420,7 +421,7 @@
        List<CommonGoods> listCommonGoods = new ArrayList<CommonGoods>();
        Integer goodsType = null;
        BigDecimal rate = hongBaoManageService.getShareRate();
        BigDecimal rate = hongBaoManageService.getShareRate(UserLevelEnum.daRen);
        for (UserGoodsStorage userGoodsStorage : listResult) {
            CommonGoods commonGoods = userGoodsStorage.getCommonGoods();
            BigDecimal money = CommonGoodsUtil.getCommission(commonGoods, rate);
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserShareGoodsRecordServiceImpl.java
@@ -32,6 +32,7 @@
import com.yeshi.fanli.entity.bus.share.UserShareGoodsRecord.ShareSourceTypeEnum;
import com.yeshi.fanli.entity.bus.user.UserGoodsStorage;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.entity.jd.JDGoods;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
@@ -97,7 +98,6 @@
    @Resource
    private IntegralGetService integralGetService;
    @Override
    public int insert(UserShareGoodsRecord record) {
@@ -332,7 +332,7 @@
     * @param userShareGoodsRecord
     * @param listGoods
     */
    @Transactional(rollbackFor=Exception.class)
    @Transactional(rollbackFor = Exception.class)
    public void multipleGoodsShareRecord(Long shareId, List<CommonGoods> listGoods)
            throws UserShareGoodsRecordException {
        // 分享记录
@@ -375,7 +375,7 @@
     * @param userShareGoodsRecord
     * @param listGoods
     */
    @Transactional(rollbackFor=Exception.class)
    @Transactional(rollbackFor = Exception.class)
    public FileUploadResult multipleGoodsShare(UserShareGoodsRecord userShareGoodsRecord,
            List<TaoBaoGoodsBrief> listGoods) throws UserShareGoodsRecordException {
@@ -489,7 +489,8 @@
        InputStream inputStream = ImageUtil.drawGoodsShareBigImg(erCodeInputStream, portrait, listGoods);
        FileUploadResult shareImg = COSManager.getInstance().uploadInputStream(inputStream,
                FilePathEnum.shareGoods.getPath() + "share_" + uid + "_" + shareId + "_" + System.currentTimeMillis() + ".png");
                FilePathEnum.shareGoods.getPath() + "share_" + uid + "_" + shareId + "_" + System.currentTimeMillis()
                        + ".png");
        return shareImg;
    }
@@ -525,7 +526,8 @@
        Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
        BigDecimal shareRate = hongBaoManageService.getShareRate(java.lang.System.currentTimeMillis());
        BigDecimal shareRate = hongBaoManageService.getShareRate(UserLevelEnum.daRen,
                java.lang.System.currentTimeMillis());
        for (UserShareGoodsGroup goodsGroup : list) {
            CommonGoods commonGoods = goodsGroup.getCommonGoods();
@@ -610,7 +612,8 @@
            Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                    .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
            BigDecimal shareRate = hongBaoManageService.getShareRate(java.lang.System.currentTimeMillis());
            BigDecimal shareRate = hongBaoManageService.getShareRate(UserLevelEnum.daRen,
                    java.lang.System.currentTimeMillis());
            for (UserShareGoodsGroup goodsGroup : list) {
                CommonGoods commonGoods = goodsGroup.getCommonGoods();
@@ -678,7 +681,8 @@
        recordDTO.setSource(ShareSourceTypeEnum.goodsDetail);
        // 分享id
        String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.emptyKey, StringUtil.Md5(uid + "#GoodsDetail#" + auctionId + "#Type#" + goodsType));
        String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.emptyKey,
                StringUtil.Md5(uid + "#GoodsDetail#" + auctionId + "#Type#" + goodsType));
        redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(recordDTO), 60 * 20);
        recordDTO.setRedisKey(key);
@@ -762,7 +766,7 @@
        recordDTO.setSource(ShareSourceTypeEnum.storage);
        // 缓存分享商品信息
        String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.emptyKey,StringUtil.Md5(uid + "#GoodsStorage#" + id));
        String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.emptyKey, StringUtil.Md5(uid + "#GoodsStorage#" + id));
        recordDTO.setRedisKey(key);
        redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(recordDTO), 60 * 20);
@@ -1025,11 +1029,12 @@
        InputStream inputStream = ImageUtil.drawGoodsSharePicture(erCodeInputStream, portrait, listGoods);
        FileUploadResult shareImg = COSManager.getInstance().uploadInputStream(inputStream,
                FilePathEnum.shareGoods.getPath() + "share_" + uid + "_" + shareId + "_" + System.currentTimeMillis() + ".png");
                FilePathEnum.shareGoods.getPath() + "share_" + uid + "_" + shareId + "_" + System.currentTimeMillis()
                        + ".png");
        return shareImg;
    }
    @Override
    public void saveShareRecord(Long uid, CommonGoods goods) throws UserShareGoodsRecordException {
        if (goods == null || uid == null) {
@@ -1047,7 +1052,7 @@
            throw new UserShareGoodsRecordException(1, "商品存入失败");
        }
        UserShareGoodsGroup singleGoods = userShareGoodsGroupService.getSingleGoods(resultCommonGoods.getId(),uid);
        UserShareGoodsGroup singleGoods = userShareGoodsGroupService.getSingleGoods(resultCommonGoods.getId(), uid);
        if (singleGoods != null) {
            // 单个商品多次分享
            userShareGoodsRecord.setPicture(resultCommonGoods.getPicture());
@@ -1078,7 +1083,5 @@
            userShareGoodsGroupService.insertSelective(singleGoods);
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
@@ -43,6 +43,7 @@
import com.yeshi.fanli.entity.common.JumpDetailV2;
import com.yeshi.fanli.entity.money.UserMoneyDetail;
import com.yeshi.fanli.entity.order.CommonOrder;
import com.yeshi.fanli.entity.order.HongBaoOrder;
import com.yeshi.fanli.entity.system.ConfigKeyEnum;
import com.yeshi.fanli.entity.system.SystemCoupon;
import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
@@ -178,7 +179,7 @@
    @Resource(name = "producer")
    private Producer producer;
    @Resource
    private UserInviteService userInviteService;
@@ -227,34 +228,33 @@
        return userSystemCouponMapper.countUserCouponList(uid);
    }
    @Override
    @Transactional(rollbackFor=Exception.class)
    public UserSystemCoupon freeCouponWin(Long uid, CouponTypeEnum typeEnum, String source, int num, boolean notify) throws UserSystemCouponException, Exception{
    @Transactional(rollbackFor = Exception.class)
    public UserSystemCoupon freeCouponWin(Long uid, CouponTypeEnum typeEnum, String source, int num, boolean notify)
            throws UserSystemCouponException, Exception {
        if (typeEnum == null || uid == null || StringUtil.isNullOrEmpty(source) || num < 1) {
            throw new UserSystemCouponException(1, "参数不正确");
        }
        SystemCoupon coupon = systemCouponService.getCouponByType(typeEnum.name());
        if (coupon == null) {
            throw new UserSystemCouponException(1, "券类型不正确");
        }
        // 激活状态
        int stateActivated = 0;
        // 自购免单券、赠送免单券可直接使用
        if (coupon.getType() == CouponTypeEnum.freeCouponBuy || coupon.getType() == CouponTypeEnum.freeCouponGive) {
            stateActivated = 1;
        }
        // 有效时长
        Integer expiryDay = null;
        if (stateActivated == 0)
            expiryDay = coupon.getActivateDay();
        if (expiryDay == null || expiryDay == 0)
            expiryDay = coupon.getExpiryDay();
        // 计算结束日期
        Date nowTime = new Date();
        String endDay = DateUtil.plusDay(expiryDay - 1, nowTime);
@@ -263,10 +263,10 @@
            endDay += " 23:59:59";
        }
        Date endTime = format.parse(endDay);
        UserSystemCoupon userSystemCoupon = null;
        for (int i = 0; i < num; i ++) {
            UserSystemCoupon userCoupon = new UserSystemCoupon();
        for (int i = 0; i < num; i++) {
            UserSystemCoupon userCoupon = new UserSystemCoupon();
            userCoupon.setUid(uid);
            userCoupon.setSource(source);
            userCoupon.setSystemCoupon(coupon);
@@ -281,28 +281,28 @@
            if (typeEnum == CouponTypeEnum.freeCoupon) {
                userSystemCouponActivateService.addActivateRecord(userCoupon.getId());
            }
            if (num == 1) {
                userSystemCoupon = userCoupon;
            }
        }
            }
        }
        executor.execute(new Runnable() {
            @Override
            public void run() {
            public void run() {
                if (notify) { // 消息推送
                    try {
                        userOtherMsgNotificationService.freeCouponWinMsg(uid, typeEnum.getDesc(), source,
                                num, "成功获得", nowTime, endTime);
                        userOtherMsgNotificationService.freeCouponWinMsg(uid, typeEnum.getDesc(), source, num, "成功获得",
                                nowTime, endTime);
                    } catch (Exception e) {
                         e.printStackTrace();
                        e.printStackTrace();
                    }
                }
                // 福利中心红点
                UserInfoExtra extra = userInfoExtraService.getUserInfoExtra(uid);
                if (extra != null) {
                    UserInfoExtra updateExtra =    new UserInfoExtra();
                    UserInfoExtra updateExtra = new UserInfoExtra();
                    updateExtra.setId(extra.getId());
                    if (extra.getCouponNews() == null) {
                        updateExtra.setCouponNews(1);
@@ -313,26 +313,24 @@
                }
            }
        });
       return userSystemCoupon;
        return userSystemCoupon;
    }
    @Override
    @Transactional(rollbackFor=Exception.class)
    public UserSystemCoupon rewardCouponWin(Long uid, String source, int num, boolean notify,
            BigDecimal percent) throws UserSystemCouponException, Exception{
        if (uid == null || percent == null|| StringUtil.isNullOrEmpty(source) || num < 1) {
    @Transactional(rollbackFor = Exception.class)
    public UserSystemCoupon rewardCouponWin(Long uid, String source, int num, boolean notify, BigDecimal percent)
            throws UserSystemCouponException, Exception {
        if (uid == null || percent == null || StringUtil.isNullOrEmpty(source) || num < 1) {
            throw new UserSystemCouponException(1, "参数不正确");
        }
        String name = CouponTypeEnum.rebatePercentCoupon.name();
        SystemCoupon coupon = systemCouponService.getCouponByTypeAndPercent(name, percent);
        if (coupon == null) {
            throw new UserSystemCouponException(1, "券类型不正确");
        }
        // 计算结束日期
        Date nowTime = new Date();
        Integer expiryDay = coupon.getExpiryDay();
@@ -342,10 +340,10 @@
            endDay += " 23:59:59";
        }
        Date endTime = format.parse(endDay);
        UserSystemCoupon userSystemCoupon = null;
        for (int i = 0; i < num; i ++) {
            UserSystemCoupon userCoupon = new UserSystemCoupon();
        for (int i = 0; i < num; i++) {
            UserSystemCoupon userCoupon = new UserSystemCoupon();
            userCoupon.setUid(uid);
            userCoupon.setSource(source);
            userCoupon.setSystemCoupon(coupon);
@@ -358,24 +356,24 @@
            userSystemCouponMapper.insertSelective(userCoupon);
            if (num == 1) {
                userSystemCoupon = userCoupon;
            }
        }
            }
        }
        executor.execute(new Runnable() {
            @Override
            public void run() {
            public void run() {
                if (notify) { // 消息推送
                    try {
                        userOtherMsgNotificationService.rewardCouponWinMsg(uid, source, num, "成功获得", nowTime, endTime);
                    } catch (Exception e) {
                         e.printStackTrace();
                        e.printStackTrace();
                    }
                }
                // 福利中心红点
                UserInfoExtra extra = userInfoExtraService.getUserInfoExtra(uid);
                if (extra != null) {
                    UserInfoExtra updateExtra =    new UserInfoExtra();
                    UserInfoExtra updateExtra = new UserInfoExtra();
                    updateExtra.setId(extra.getId());
                    if (extra.getCouponNews() == null) {
                        updateExtra.setCouponNews(1);
@@ -386,15 +384,11 @@
                }
            }
        });
       return userSystemCoupon;
    }
    @Transactional(rollbackFor=Exception.class)
        return userSystemCoupon;
    }
    @Transactional(rollbackFor = Exception.class)
    @Override
    public List<UserSystemCouponVO> getUserCouponVOList(long start, int count, Long uid, boolean changeJump)
            throws UserSystemCouponException, Exception {
@@ -660,7 +654,7 @@
        return hasCoupon;
    }
    @Transactional(rollbackFor=Exception.class)
    @Transactional(rollbackFor = Exception.class)
    @Override
    public List<UserSystemCouponVO> getOrderCouponList(Long uid) throws UserSystemCouponException, Exception {
@@ -683,7 +677,7 @@
        return getEnableListByCouponId(uid, 1, couponList);
    }
    @Transactional(rollbackFor=Exception.class)
    @Transactional(rollbackFor = Exception.class)
    @Override
    public List<UserSystemCouponVO> getGoodsCouponList(Long uid, Long auctionId)
            throws UserSystemCouponException, Exception {
@@ -751,8 +745,7 @@
        return userSystemCouponMapper.countUsableByUid(uid, listCouponId);
    }
    @Override
    public long countGiveFreeCoupon(Long uid) {
        if (uid == null)
@@ -769,8 +762,6 @@
        return userSystemCouponMapper.countUsableByUid(uid, listCouponId);
    }
    @Override
    public long countUsableRewardCoupon(Long uid) {
@@ -914,26 +905,25 @@
                }
            }
        }
        if (weiquan) {
            throw new UserSystemCouponException(1, "亲,很遗憾,售后维权订单不能使用返利奖励券~");
        }
        // 订单
        List<CommonOrderVO> listVo = commonOrderService.listGroupOrderNoByUid(0, 1, uid, 2, 1,1, orderNo, null,
                null, null, sourceType);
        if (listVo == null || listVo.size() == 0)
        List<CommonOrderVO> listVo = commonOrderService.listGroupOrderNoByUid(0, 1, uid, 2, 1, 1, orderNo, null, null,
                null, sourceType);
        if (listVo == null || listVo.size() == 0)
            throw new UserSystemCouponException(1, "亲,很遗憾,该订单已不能使用返利奖励券~");
        CommonOrderVO orderVO = listVo.get(0);
        // 2.1新版
        Date thirdCreateTime = orderVO.getThirdCreateTime();
        Date accountTime = orderVO.getAccountTime();
        if (thirdCreateTime == null || accountTime == null)
        if (thirdCreateTime == null || accountTime == null)
            throw new UserSystemCouponException(1, "该订单不能使用奖励券");
        long downOrderTime = thirdCreateTime.getTime();
        long limitDate = TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME);
        if (downOrderTime > limitDate) {
@@ -956,7 +946,7 @@
                        valid = true;
                }
            }
            if (!valid)
                throw new UserSystemCouponException(1, "该订单不能使用奖励券");
        }
@@ -983,7 +973,7 @@
            UserSystemCouponUseMQMsg mqMsg = new UserSystemCouponUseMQMsg(userSystemCoupon.getId(), order.getOrderId(),
                    sourceType, systemCoupon.getType().name());
            if (Constant.IS_TEST) {
                useRewardCouponCore(userSystemCoupon, money, hongBao, uid, order);
            } else { // 事务消息
@@ -1009,7 +999,7 @@
        }
    }
    @Transactional(rollbackFor=Exception.class)
    @Transactional(rollbackFor = Exception.class)
    public void useRewardCouponCore(UserSystemCoupon userSystemCoupon, BigDecimal money, BigDecimal hongBao, Long uid,
            Order order) throws Exception {
        org.springframework.transaction.TransactionStatus transactionStatus = transactionManager
@@ -1032,9 +1022,19 @@
            // 2.插入关联
            orderHongBaoMapService.addOrderHongBaoMap(hongBaoV2, order);
            // 计算该订单原有返利
            List<HongBaoOrder> hongBaoOrderlist = hongBaoOrderService
                    .listDetailByOrderIdAndSourceType(order.getOrderId(), order.getOrderType());
            BigDecimal originalMoney = new BigDecimal(0);
            if (hongBaoOrderlist != null)
                for (HongBaoOrder ho : hongBaoOrderlist) {
                    if (ho.getHongBaoV2() != null && ho.getHongBaoV2().getState() == HongBaoV2.STATE_YILINGQU)
                        originalMoney = originalMoney.add(ho.getHongBaoV2().getMoney());
                }
            // 3.插入资金明细,用户余额
            UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createOrderReward(order.getOrderId(),
                    order.getOrderType(), money, new UserInfo(uid));
                    order.getOrderType(), money, originalMoney, new UserInfo(uid));
            userMoneyDetailService.addUserMoneyDetail(userMoneyDetail);
            userInfoService.addMoney(new UserInfo(uid), money);
@@ -1357,8 +1357,7 @@
        return userRecordVO;
    }
    @Transactional(rollbackFor=Exception.class)
    @Transactional(rollbackFor = Exception.class)
    @Override
    public void updateStateByDrawback(String orderNo) throws Exception {
@@ -1380,7 +1379,7 @@
        sendBackCoupon(record.getUserSystemCoupon(), record);
    }
    @Transactional(rollbackFor=Exception.class)
    @Transactional(rollbackFor = Exception.class)
    @Override
    public void updateStateByArrivalAccount(String orderNo) throws Exception {
@@ -1398,14 +1397,13 @@
        record.setState(UserSystemCouponRecord.STATE_SUCCESS);
        userSystemCouponRecordService.updateByPrimaryKeySelective(record);
    }
    @Override
    public List<UserSystemCoupon> getCounponNowInvalid(int count) {
        return userSystemCouponMapper.getCounponNowInvalid(count);
    }
    @Transactional(rollbackFor=Exception.class)
    @Transactional(rollbackFor = Exception.class)
    @Override
    public boolean updateCouponRecordUsed(Long uid, String orderNo, BigDecimal payment, Long auctionId)
            throws Exception {
@@ -1475,8 +1473,6 @@
        return isfree;
    }
    /**
     * 随机券比例
     * 
@@ -1531,7 +1527,7 @@
    }
    @Override
    @Transactional(rollbackFor=Exception.class)
    @Transactional(rollbackFor = Exception.class)
    public void exchangeCoupon(Long uid, String couponType, String source, BigDecimal percent)
            throws UserSystemCouponException, Exception {
        if (couponType == null || uid == null) {
@@ -1587,7 +1583,7 @@
        insertSelective(userCoupon);
    }
    @Transactional(rollbackFor=Exception.class)
    @Transactional(rollbackFor = Exception.class)
    @Override
    public List<UserSystemCouponVO> getCouponList(AcceptData acceptData, long start, int count, Long uid)
            throws UserSystemCouponException, Exception {
@@ -2014,16 +2010,17 @@
                continue;
            }
            try { // 消息推送
                Long uid = userCoupon.getUid();
                String source = userCoupon.getSource();
                 if (baseCoupon.getType() == CouponTypeEnum.freeCoupon || baseCoupon.getType() == CouponTypeEnum.freeCouponBuy) {
                     userOtherMsgNotificationService.freeCouponEndMsg(uid, "自购免单券", source, 1, "已过期");
                 } else if (baseCoupon.getType() == CouponTypeEnum.freeCouponGive) {
                     userOtherMsgNotificationService.freeCouponEndMsg(uid, "赠送免单券", source, 1, "已过期");
                } if (baseCoupon.getType() == CouponTypeEnum.rebatePercentCoupon) {
                     userOtherMsgNotificationService.rewardCouponEndMsg(uid, source, 1, "已过期");
                if (baseCoupon.getType() == CouponTypeEnum.freeCoupon
                        || baseCoupon.getType() == CouponTypeEnum.freeCouponBuy) {
                    userOtherMsgNotificationService.freeCouponEndMsg(uid, "自购免单券", source, 1, "已过期");
                } else if (baseCoupon.getType() == CouponTypeEnum.freeCouponGive) {
                    userOtherMsgNotificationService.freeCouponEndMsg(uid, "赠送免单券", source, 1, "已过期");
                }
                if (baseCoupon.getType() == CouponTypeEnum.rebatePercentCoupon) {
                    userOtherMsgNotificationService.rewardCouponEndMsg(uid, source, 1, "已过期");
                }
            } catch (Exception e) {
                e.printStackTrace();
@@ -2068,7 +2065,7 @@
            Long uid = userCoupon.getUid();
            String source = userCoupon.getSource();
            Date startTime = userCoupon.getStartTime();
            if (CouponTypeEnum.freeCoupon.name().equals(record.getCouponType())
            if (CouponTypeEnum.freeCoupon.name().equals(record.getCouponType())
                    || CouponTypeEnum.freeCouponBuy.name().equals(record.getCouponType())) {
                userOtherMsgNotificationService.freeCouponWinMsg(uid, "自购免单券", source, 1, "使用退回", startTime, endTime);
            }
@@ -2197,11 +2194,11 @@
        String source = userCoupon.getSource();
        CouponTypeEnum type = systemCoupon.getType();
        if (CouponTypeEnum.freeCouponGive == type) {
            userOtherMsgNotificationService.freeCouponWinMsg(uid, type.getDesc(), source, 1, "使用退回",
            userOtherMsgNotificationService.freeCouponWinMsg(uid, type.getDesc(), source, 1, "使用退回",
                    userCoupon.getStartTime(), userCoupon.getEndTime());
        } else if (CouponTypeEnum.rebatePercentCoupon == systemCoupon.getType()) {
            userOtherMsgNotificationService.rewardCouponWinMsg(uid, source, 1, "使用退回",
                    userCoupon.getStartTime(), userCoupon.getEndTime());
            userOtherMsgNotificationService.rewardCouponWinMsg(uid, source, 1, "使用退回", userCoupon.getStartTime(),
                    userCoupon.getEndTime());
        }
    }
@@ -2272,11 +2269,11 @@
            String source = userCoupon.getSource();
            CouponTypeEnum type = systemCoupon.getType();
            if (CouponTypeEnum.freeCouponGive == type) {
                userOtherMsgNotificationService.freeCouponWinMsg(uid, type.getDesc(), source, 1, "使用退回",
                userOtherMsgNotificationService.freeCouponWinMsg(uid, type.getDesc(), source, 1, "使用退回",
                        userCoupon.getStartTime(), userCoupon.getEndTime());
            } else if (CouponTypeEnum.rebatePercentCoupon == systemCoupon.getType()) {
                userOtherMsgNotificationService.rewardCouponWinMsg(uid, source, 1, "使用退回",
                        userCoupon.getStartTime(), userCoupon.getEndTime());
                userOtherMsgNotificationService.rewardCouponWinMsg(uid, source, 1, "使用退回", userCoupon.getStartTime(),
                        userCoupon.getEndTime());
            }
        }
    }
@@ -2285,13 +2282,13 @@
    public boolean getValidRebateCoupon(Long uid) {
        // 过期券
        updateInvalidSate(uid);
        List<UserSystemCouponVO> listCoupon = userSystemCouponMapper.getValidByUidAndType(uid, CouponTypeEnum.rebatePercentCoupon.name());
        List<UserSystemCouponVO> listCoupon = userSystemCouponMapper.getValidByUidAndType(uid,
                CouponTypeEnum.rebatePercentCoupon.name());
        if (listCoupon == null || listCoupon.size() == 0)
            return false;
        return true;
    }
    @Override
    public List<UserSystemCouponVO> listIncludeNotExchange(Long uid) throws Exception {
@@ -2301,8 +2298,8 @@
        // 退回券
        sendBackTimeOutCoupon(uid);
        List<UserSystemCouponVO> listCoupon = userSystemCouponMapper.getValidByUidAndType(uid, CouponTypeEnum.rebatePercentCoupon.name());
        List<UserSystemCouponVO> listCoupon = userSystemCouponMapper.getValidByUidAndType(uid,
                CouponTypeEnum.rebatePercentCoupon.name());
        if (listCoupon == null || listCoupon.size() == 0)
            return null;
@@ -2466,8 +2463,7 @@
                public void run() {
                    Long uid = coupon.getUid();
                    String source = coupon.getSource();
                    userOtherMsgNotificationService.freeCouponWinMsg(uid, "自购免单券", source, 1,
                            "激活成功", nowDate, endTime);
                    userOtherMsgNotificationService.freeCouponWinMsg(uid, "自购免单券", source, 1, "激活成功", nowDate, endTime);
                }
            });
        } catch (Exception e) {
fanli/src/main/java/com/yeshi/fanli/service/inter/order/config/HongBaoManageService.java
@@ -7,9 +7,8 @@
import org.springframework.cache.annotation.CacheEvict;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.dto.order.OrderHongBaoRateParams;
import com.yeshi.fanli.entity.bus.user.HongBaoManage;
import com.yeshi.fanli.exception.order.HongBaoException;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
public interface HongBaoManageService {
@@ -17,7 +16,7 @@
    public void update(List<HongBaoManage> hongBaoManageList);
    public String get(String key);
    public BigDecimal getByKeyAndMaxTime(String key, Long time);
    public Map<String, String> convertMap();
@@ -28,15 +27,7 @@
     * @param time
     * @return
     */
    public BigDecimal getFanLiRate(long time);
    /**
     * VIP用户返利比例
     *
     * @param time
     * @return
     */
    public BigDecimal getVIPFanLiRate(long time);
    public BigDecimal getFanLiRate(UserLevelEnum level, long time);
    /**
     * 获取分享订单返利比例
@@ -44,21 +35,16 @@
     * @param time
     * @return
     */
    public BigDecimal getShareRate(long time);
    /**
     * 获取VIP用户的分享比例
     *
     * @param time
     * @return
     */
    public BigDecimal getVIPShareRate(long time);
    public BigDecimal getShareRate(UserLevelEnum level, long time);
    /**
     * 获取返利订单返利比例
     * 
     * @return
     */
    public BigDecimal getFanLiRate(UserLevelEnum level);
    public BigDecimal getFanLiRate();
    /**
@@ -66,21 +52,9 @@
     * 
     * @return
     */
    public BigDecimal getShareRate(UserLevelEnum level);
    public BigDecimal getShareRate();
    /**
     * 获取VIP返利订单返利比例
     *
     * @return
     */
    public BigDecimal getVIPFanLiRate();
    /**
     * 获取VIP分享订单返利比例
     *
     * @return
     */
    public BigDecimal getVIPShareRate();
    /**
     * 获取第一级的邀请赚比例
@@ -171,16 +145,7 @@
     * @return
     */
    public BigDecimal getInviteSecondLevelSubsidyRate(Long time);
    /**
     * 获取返利比例(订单处理时使用)
     *
     * @param params
     * @return
     * @throws HongBaoException
     */
    public BigDecimal getRate(OrderHongBaoRateParams params) throws HongBaoException;
    /**
     * 获取需要显示计算的比例实体
     * 
@@ -188,6 +153,9 @@
     * @param version
     * @return
     */
    public ConfigParamsDTO getShowComputeRate(String platform, String version,UserLevelEnum userLevel);
    public ConfigParamsDTO getShowComputeRate(String platform, String version);
    /**
fanli/src/main/java/com/yeshi/fanli/service/manger/money/TeamEincomeManager.java
@@ -13,10 +13,12 @@
import com.yeshi.fanli.entity.money.UserMoneyDetail;
import com.yeshi.fanli.exception.ParamsException;
import com.yeshi.fanli.exception.money.TeamEincomeRecordException;
import com.yeshi.fanli.exception.money.UserMoneyDetailException;
import com.yeshi.fanli.service.inter.money.TeamEincomeRecordService;
import com.yeshi.fanli.service.inter.money.UserMoneyService;
import com.yeshi.fanli.service.inter.money.msg.UserMoneyMsgNotificationService;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
import com.yeshi.fanli.util.factory.money.TeamEincomeRecordFactory;
/**
@@ -90,6 +92,7 @@
    }
    /**
     * @throws UserMoneyDetailException
     * 到账到用户余额
     * @Title: addTOUserAccount
     * @Description: 
@@ -99,7 +102,7 @@
     * @throws
     */
    @Transactional(rollbackFor = Exception.class)
    public void addTOUserAccount(Date preSendTime, Long uid) {
    public void addTOUserAccount(Date preSendTime, Long uid) throws UserMoneyDetailException {
        Date now = new Date();
        List<TeamEincomeRecord> list = teamEincomeRecordService.listCanRecieveRecord(preSendTime, uid);
        BigDecimal money = new BigDecimal(0);
@@ -109,8 +112,8 @@
            teamEincomeRecordService.setRecieved(record.getId());
        }
        // TODO 到账
        UserMoneyDetail detail = null;
        UserMoneyDetail detail = UserMoneyDetailFactory.createTeamReward(uid, money, preSendTime);
        userMoneyService.addUserMoney(uid, money, detail);
        // 发送消息
        BigDecimal balance = userMoneyService.getBalance(uid);
fanli/src/main/java/com/yeshi/fanli/service/manger/order/TeamDividentsManager.java
@@ -79,6 +79,9 @@
    @Transactional(rollbackFor = Exception.class)
    public void addDividentsSourceOrder(List<CommonOrder> commonOrderList) throws TeamDividentsSourceOrderException {
        if (commonOrderList.get(0).getThirdCreateTime().getTime() < Constant.NEW_ORDER_FANLI_RULE_TIME)
            return;
        UserLevelEnum level = UserLevelUtil.getByOrderRank(commonOrderList.get(0).getUrank());
        if (level == null)
            level = UserLevelEnum.daRen;
@@ -91,7 +94,6 @@
        } catch (ParamsException e) {
            throw new TeamDividentsSourceOrderException(101, "参数不完整");
        }
    }
    /**
fanli/src/main/java/com/yeshi/fanli/util/Constant.java
@@ -257,7 +257,7 @@
            "4c7b166fecb6d9f53837e993f2214673", "", "");
    // 新的规则生效时间
    public static final long NEW_ORDER_FANLI_RULE_TIME = TimeUtil.convertToTimeTemp("2020-04-14", "yyyy-MM-dd");
    public static final long NEW_ORDER_FANLI_RULE_TIME = TimeUtil.convertToTimeTemp("2020-04-18", "yyyy-MM-dd");
    // 新人抽奖-最大次数
    public static final int MAX_COUNT_LOTTERY_NEWBIES = 5;
fanli/src/main/java/com/yeshi/fanli/util/account/UserUtil.java
@@ -77,7 +77,7 @@
    public static String getInviteCode(int base, Long uid) {
        long num = base * 100000000L + uid ;
        long num = base * 100000000L + uid;
        return convert10To36(num);
    }
@@ -179,6 +179,17 @@
        return account;
    }
    public static String filterAlipayName(String name) {
        String st = "";
        for (int i = 0; i < name.length(); i++) {
            if (i == 0)
                st += name.charAt(i);
            else
                st += "*";
        }
        return st;
    }
    public static String filterOrderId(String orderId) {
        if (orderId == null || orderId.length() <= 6)
            return orderId;
fanli/src/main/java/com/yeshi/fanli/util/factory/UserMoneyDetailFactory.java
@@ -42,9 +42,9 @@
        detail.setIdentifyCode(StringUtil
                .Md5(UserMoneyDetailTypeEnum.fanli.name() + "-" + uid + "-" + orderType + "-" + orderId + "-" + hbIds));
        detail.setMoney(money);
        detail.setTitle(UserMoneyDetailTypeEnum.fanli.getDesc());
        detail.setType(UserMoneyDetailTypeEnum.fanli);
        detail.setDescInfo("订单号:" + orderId);
        detail.setTitle(UserMoneyDetailTypeEnum.fanliNew.getDesc());
        detail.setType(UserMoneyDetailTypeEnum.fanliNew);
        detail.setDescInfo(Constant.getSourceName(orderType) + ":" + orderId);
        detail.setUpdateTime(new Date());
        detail.setUserInfo(new UserInfo(uid));
        detail.setOrderType(orderType);
@@ -98,8 +98,8 @@
     * @return
     * @throws UserMoneyDetailException
     */
    public static UserMoneyDetail createShare(Long uid, int orderType, int validCount, int weiQuanCount,
            BigDecimal money, Date time) throws UserMoneyDetailException {
    public static UserMoneyDetail createShare(Long uid, int orderType, BigDecimal money, Date time)
            throws UserMoneyDetailException {
        if (money == null)
            throw new UserMoneyDetailException(1, "返利金额为空");
@@ -113,16 +113,16 @@
        ca.setTime(time);
        ca.add(Calendar.MONTH, -1);
        String timeF = TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyy.M");
        String timeF = TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyy年M月");
        UserMoneyDetail detail = new UserMoneyDetail();
        detail.setCreateTime(new Date());
        detail.setIdentifyCode(
                StringUtil.Md5(UserMoneyDetailTypeEnum.share.name() + "-" + orderType + "-" + uid + "-" + timeF));
        detail.setMoney(money);
        detail.setTitle(timeF + UserMoneyDetailTypeEnum.share.getDesc());
        detail.setType(UserMoneyDetailTypeEnum.share);
        detail.setDescInfo(String.format("有效订单:%s笔  维权订单:%s笔", validCount, weiQuanCount));
        detail.setTitle(UserMoneyDetailTypeEnum.shareNew.getDesc());
        detail.setType(UserMoneyDetailTypeEnum.shareNew);
        detail.setDescInfo(Constant.getSourceName(orderType) + ":" + timeF);
        detail.setUpdateTime(new Date());
        detail.setUserInfo(new UserInfo(uid));
        detail.setOrderType(orderType);
@@ -202,11 +202,11 @@
        detail.setIdentifyCode(StringUtil
                .Md5(UserMoneyDetailTypeEnum.fanliWeiQuan.name() + "-" + uid + "-" + drawBack.getOrderItemId()));
        detail.setMoney(new BigDecimal("0").subtract(money));
        detail.setTitle(UserMoneyDetailTypeEnum.fanliWeiQuan.getDesc());
        detail.setSubTitle("订单售后");
        detail.setType(UserMoneyDetailTypeEnum.fanliWeiQuan);
        detail.setTitle(UserMoneyDetailTypeEnum.fanliWeiQuanNew.getDesc());
        detail.setType(UserMoneyDetailTypeEnum.fanliWeiQuanNew);
        detail.setSourceIdentifyId(drawBack.getId());
        detail.setDescInfo("订单号:" + drawBack.getOrderId());
        detail.setDescInfo(
                Constant.getSourceName(Constant.SOURCE_TYPE_TAOBAO) + ":" + drawBack.getOrderId() + "-部分商品售后");
        detail.setUpdateTime(new Date());
        detail.setUserInfo(new UserInfo(uid));
        detail.setOrderType(Constant.SOURCE_TYPE_TAOBAO);
@@ -299,7 +299,7 @@
     * @param extract
     * @return
     */
    public static UserMoneyDetail createExtract(Extract extract) throws UserMoneyDetailException {
    public static UserMoneyDetail createExtract(Extract extract, String alipayNo) throws UserMoneyDetailException {
        if (extract == null)
            throw new UserMoneyDetailException(1, "提现记录不能为空");
        if (extract.getId() == null)
@@ -309,14 +309,18 @@
        if (extract.getUserInfo() == null || extract.getUserInfo().getId() == null)
            throw new UserMoneyDetailException(1, "提现用户不能为空");
        if (alipayNo != null && alipayNo.length() > 10)
            alipayNo = "*" + alipayNo.substring(alipayNo.length() - 10, alipayNo.length());
        UserMoneyDetail detail = new UserMoneyDetail();
        detail.setCreateTime(new Date());
        detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.extract.name() + ":" + extract.getId()));
        detail.setMoney(new BigDecimal("0").subtract(extract.getMoney()));
        detail.setSourceIdentifyId(extract.getId());
        detail.setTitle(UserMoneyDetailTypeEnum.extract.getDesc());
        detail.setType(UserMoneyDetailTypeEnum.extract);
        detail.setTitle(UserMoneyDetailTypeEnum.extractNew.getDesc());
        detail.setType(UserMoneyDetailTypeEnum.extractNew);
        detail.setUpdateTime(new Date());
        detail.setDescInfo("支付宝订单号:" + alipayNo);
        detail.setUserInfo(extract.getUserInfo());
        detail.setShow(false);
        return detail;
@@ -344,10 +348,44 @@
        detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.extractVerify.name() + ":" + aa.getId()));
        detail.setMoney(new BigDecimal("0").subtract(money));
        detail.setSourceIdentifyId(aa.getId());
        detail.setTitle(UserMoneyDetailTypeEnum.extractVerify.getDesc());
        detail.setType(UserMoneyDetailTypeEnum.extractVerify);
        detail.setTitle(UserMoneyDetailTypeEnum.extractVerifyNew.getDesc());
        detail.setType(UserMoneyDetailTypeEnum.extractVerifyNew);
        detail.setUpdateTime(new Date());
        detail.setUserInfo(new UserInfo(aa.getUid()));
        detail.setDescInfo(String.format("支付宝:%s -姓名-%s", UserUtil.filterAlipayAccount(aa.getAccount()),
                UserUtil.filterAlipayName(aa.getName())));
        return detail;
    }
    /**
     * 系统扣除
     * @Title: createSystemTakeOff
     * @Description:
     * @param uid
     * @param money
     * @param desc
     * @return
     * @throws UserMoneyDetailException
     * UserMoneyDetail 返回类型
     * @throws
     */
    public static UserMoneyDetail createSystemTakeOff(Long uid, BigDecimal money, String desc)
            throws UserMoneyDetailException {
        if (uid == null)
            throw new UserMoneyDetailException(1, "UID不能为空");
        if (money == null)
            throw new UserMoneyDetailException(1, "金额不能为空");
        UserMoneyDetail detail = new UserMoneyDetail();
        detail.setCreateTime(new Date());
        detail.setIdentifyCode(
                StringUtil.Md5(uid + "-" + UserMoneyDetailTypeEnum.systemTakeOff.name() + System.currentTimeMillis()));
        detail.setMoney(new BigDecimal("0").subtract(money));
        detail.setTitle(UserMoneyDetailTypeEnum.systemTakeOff.getDesc());
        detail.setType(UserMoneyDetailTypeEnum.systemTakeOff);
        detail.setUpdateTime(new Date());
        detail.setUserInfo(new UserInfo(uid));
        detail.setDescInfo(desc);
        return detail;
    }
@@ -462,8 +500,8 @@
     * @return
     * @throws UserMoneyDetailException
     */
    public static UserMoneyDetail createOrderReward(String orderId, int orderType, BigDecimal money, UserInfo user)
            throws UserMoneyDetailException {
    public static UserMoneyDetail createOrderReward(String orderId, int orderType, BigDecimal money,
            BigDecimal originalMoney, UserInfo user) throws UserMoneyDetailException {
        if (StringUtil.isNullOrEmpty(orderId))
            throw new UserMoneyDetailException(1, "订单号不能为空");
        if (user == null)
@@ -475,12 +513,12 @@
        detail.setCreateTime(new Date());
        detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.hongbao.name() + "-" + "老版本" + "-" + orderId));
        detail.setMoney(money);
        detail.setTitle(UserMoneyDetailTypeEnum.orderReward.getDesc());
        detail.setType(UserMoneyDetailTypeEnum.orderReward);
        detail.setTitle(UserMoneyDetailTypeEnum.orderRewardNew.getDesc());
        detail.setType(UserMoneyDetailTypeEnum.orderRewardNew);
        detail.setUpdateTime(new Date());
        detail.setUserInfo(user);
        detail.setOrderType(orderType);
        detail.setDescInfo("订单号:" + orderId);
        detail.setDescInfo(Constant.getSourceName(orderType) + ":" + orderId + "-原返利:" + originalMoney);
        return detail;
    }
@@ -528,8 +566,8 @@
        detail.setIdentifyCode(StringUtil.Md5(
                UserMoneyDetailTypeEnum.systemEqualize.name() + "-" + System.currentTimeMillis() + "-" + user.getId()));
        detail.setMoney(money);
        detail.setTitle(UserMoneyDetailTypeEnum.systemEqualize.getDesc());
        detail.setType(UserMoneyDetailTypeEnum.systemEqualize);
        detail.setTitle(UserMoneyDetailTypeEnum.systemEqualizeNew.getDesc());
        detail.setType(UserMoneyDetailTypeEnum.systemEqualizeNew);
        detail.setUpdateTime(new Date());
        detail.setUserInfo(user);
        if (!StringUtil.isNullOrEmpty(desc)) {
@@ -602,8 +640,8 @@
    }
    /**
     * 团队分红
     * @Title: createOrderTeamDividents
     * 团队收益
     * @Title: createTeamReward
     * @Description: 
     * @param uid
     * @param money
@@ -613,7 +651,8 @@
     * UserMoneyDetail 返回类型
     * @throws
     */
    public static UserMoneyDetail createOrderTeamDividents(Long uid, BigDecimal money, Date time)
    public static UserMoneyDetail createTeamReward(Long uid, BigDecimal money, Date time)
            throws UserMoneyDetailException {
        if (money == null)
            throw new UserMoneyDetailException(1, "返利金额为空");
@@ -628,16 +667,57 @@
        ca.setTime(time);
        ca.add(Calendar.MONTH, -1);
        String timeF = TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyy.M");
        String timeF = TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyy年M月");
        UserMoneyDetail detail = new UserMoneyDetail();
        detail.setCreateTime(new Date());
        detail.setIdentifyCode(
                StringUtil.Md5(UserMoneyDetailTypeEnum.orderTeamDividents.name() + "-" + uid + "-" + timeF));
        detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.teamReward.name() + "-" + uid + "-" + timeF));
        detail.setMoney(money);
        detail.setTitle(timeF + UserMoneyDetailTypeEnum.orderTeamDividents.getDesc());
        detail.setType(UserMoneyDetailTypeEnum.orderTeamDividents);
        detail.setDescInfo("团队分红");
        detail.setTitle(UserMoneyDetailTypeEnum.teamReward.getDesc());
        detail.setType(UserMoneyDetailTypeEnum.teamReward);
        detail.setDescInfo(timeF);
        detail.setUpdateTime(new Date());
        detail.setUserInfo(new UserInfo(uid));
        return detail;
    }
    /**
     * 团队分红
     * @Title: createTeamDividents
     * @Description:
     * @param uid
     * @param money
     * @param time
     * @return
     * @throws UserMoneyDetailException
     * UserMoneyDetail 返回类型
     * @throws
     */
    public static UserMoneyDetail createTeamDividents(Long uid, BigDecimal money, Date time)
            throws UserMoneyDetailException {
        if (money == null)
            throw new UserMoneyDetailException(1, "返利金额为空");
        if (uid == null)
            throw new UserMoneyDetailException(1, "UID为空");
        if (time == null)
            throw new UserMoneyDetailException(1, "发生时间为空");
        Calendar ca = Calendar.getInstance();
        ca.setTime(time);
        ca.add(Calendar.MONTH, -1);
        String timeF = TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyy年M月");
        UserMoneyDetail detail = new UserMoneyDetail();
        detail.setCreateTime(new Date());
        detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.teamDividents.name() + "-" + uid + "-" + timeF));
        detail.setMoney(money);
        detail.setTitle(UserMoneyDetailTypeEnum.teamDividents.getDesc());
        detail.setType(UserMoneyDetailTypeEnum.teamDividents);
        detail.setDescInfo(timeF);
        detail.setUpdateTime(new Date());
        detail.setUserInfo(new UserInfo(uid));
        return detail;
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java
@@ -44,6 +44,7 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.common.ImageInfo;
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.entity.taobao.SearchFilter;
@@ -1021,7 +1022,7 @@
            tg.setTaoBaoQuanInfo(quanInfo);
        }
        BigDecimal proportion = taoBaoUtil.manageService.getFanLiRate();
        BigDecimal proportion = taoBaoUtil.manageService.getFanLiRate(UserLevelEnum.daRen);
        TaoBaoHongBaoInfo hongBaoInfo = new TaoBaoHongBaoInfo();
        String tkMktStatus = tb.getTkMktStatus();
        if ("1".equals(tkMktStatus)) {