yujian
2019-06-20 ecf9f0669734d4397aa1277f9a22f515aa410062
冲突文件
42个文件已修改
1430 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java 71 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/GoodsController.java 193 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/HomeNavbarController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java 162 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java 180 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserAccountController.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserInfoController.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/HomeNavbarControllerV2.java 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/h5/H5RecommendController.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/FloatADMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/HomeNavbarMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/SpecialMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/clazz/GoodsClass.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/FloatAD.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/HomeNavbar.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/Special.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserCustomSettings.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/goods/ShareGoodsTextTemplate.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/taobao/TaoBaoGoodsBriefExtra.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/goods/ShareGoodsTextTemplateMapper.xml 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/FloatADMapper.xml 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/HomeNavbarMapper.xml 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SpecialMapper.xml 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/lable/QualityFactoryMapper.xml 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/ShareGoodsServiceImpl.java 142 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/ShareGoodsTextTemplateServiceImpl.java 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/FloatADServiceImpl.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/HomeNavbarServiceImpl.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/HomeNavbarUserServiceImpl.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgOtherDetailServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserCustomSettingsServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/ShareGoodsService.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/ShareGoodsTextTemplateService.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/FloatADService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/HomeNavbarService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/HomeNavbarUserService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SpecialService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java 65 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/user/UserSettingsVO.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java
@@ -13,6 +13,9 @@
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.homemodule.FloatAD;
import com.yeshi.fanli.entity.bus.msg.MsgDeviceReadState;
import com.yeshi.fanli.entity.bus.tlj.DeviceTaoLiJinRecord;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin.TaoLiJinOriginEnum;
import com.yeshi.fanli.entity.config.AppHomeFloatImg;
import com.yeshi.fanli.entity.taobao.ClientTBPid;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
@@ -20,6 +23,8 @@
import com.yeshi.fanli.service.inter.homemodule.FloatADService;
import com.yeshi.fanli.service.inter.msg.MsgDeviceReadStateService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
import com.yeshi.fanli.service.inter.tlj.DeviceTaoLiJinRecordService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
import com.yeshi.fanli.service.inter.user.TBPidService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.util.Constant;
@@ -59,6 +64,14 @@
    @Resource
    private MsgDeviceReadStateService msgDeviceReadStateService;
    @Resource
    private UserTaoLiJinOriginService uerTaoLiJinOriginService;
    @Resource
    private DeviceTaoLiJinRecordService deviceTaoLiJinRecordService;
    /**
     * 首页配置信息
     * 
@@ -82,8 +95,25 @@
            data.put("floatNotifyImg", notifyImg);
        }
        // 悬浮大图 1.5.2 -2019.3.20
        FloatAD floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX);
        FloatAD floatAD = null;
        if (uid == null) {
            DeviceTaoLiJinRecord deviceRecord = deviceTaoLiJinRecordService.getByDevice(acceptData.getDevice());
            if (deviceRecord == null) {
                floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX, 1);
            }
        } else {
            UserTaoLiJinOrigin userTaoLiJin = uerTaoLiJinOriginService.getByUidAndOrigin(uid, TaoLiJinOriginEnum.newbiesWin.name());
            if (userTaoLiJin == null) {
                floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX, 1);
            }
        }
        // 无新人弹框 则查询默认
        if (floatAD == null) {
            floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX, null);
        }
        if (floatAD != null) {
            JSONObject detail = new JSONObject();
            detail.put("img", floatAD.getPicture());
@@ -91,13 +121,7 @@
            detail.put("params", floatAD.getParams());
            detail.put("showTime", floatAD.getShowMode());
            detail.put("accountLogin", floatAD.isJumpNeedLogin());
            if (uid != null && userInfoExtraService.isNewUser(uid)) {
                // 新用户
                data.put("floatImgDetail", detail);
            } else {
                data.put("floatImgDetail", detail);
            }
        }
        // 领券帮助链接,1.5.2后生效
@@ -113,6 +137,37 @@
        out.print(JsonUtil.loadTrueResult(data));
    }
    /**
     * 消息中心弹框
     * @param acceptData
     * @param uid
     * @param out
     */
    @RequestMapping(value = "getMSGConfig", method = RequestMethod.POST)
    public void getMSGConfig(AcceptData acceptData, Long uid, PrintWriter out) {
        JSONObject data = new JSONObject();
        boolean show = false;
        if (uid != null ) {
            show = uerTaoLiJinOriginService.hasRankHongBao(uid);
        }
        if (show) {
            FloatAD floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_MSGCENTER, null);
            if (floatAD != null) {
                JSONObject detail = new JSONObject();
                detail.put("img", floatAD.getPicture());
                detail.put("jumpDetail", floatAD.getJumpDetail());
                detail.put("params", floatAD.getParams());
                detail.put("showTime", floatAD.getShowMode());
                detail.put("accountLogin", floatAD.isJumpNeedLogin());
                data.put("floatImgDetail", detail);
            }
        }
        out.print(JsonUtil.loadTrueResult(data));
    }
    @RequestMapping(value = "getTaoBaoCartConfig", method = RequestMethod.POST)
    public void getTaoBaoCartConfig(AcceptData acceptData, String position, Long uid, PrintWriter out) {
        if (uid == null || uid <= 0) {
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/GoodsController.java
@@ -252,6 +252,199 @@
        }
    }
    /**
     * 获取淘宝的分享链接 (淘礼金新建)
     *
     * @param acceptData
     * @param uid
     *            -用户ID
     * @param auctionId-商品ID
     * @param out
     */
    @RequestMapping(value = "getTaoBaoGoodsLink")
    public void getTaoBaoGoodsLink(AcceptData acceptData, Long uid, Long auctionId, String from, HttpServletRequest request,
            PrintWriter out) {
        if (uid == null || uid <= 0) {
            out.print(JsonUtil.loadFalseResult(1, "用户ID不能为空"));
            return;
        }
        UserInfo user = userInfoService.getUserByIdWithMybatis(uid);
        if (user != null && user.getState() != UserInfo.STATE_NORMAL) {
            out.print(JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC));
            return;
        }
        if (auctionId == null || auctionId <= 0) {
            out.print(JsonUtil.loadFalseResult(2, "商品ID不能为空"));
            return;
        }
        TaoBaoGoodsBrief goods = null;
        try {
            goods = TaoKeApiUtil.getSimpleGoodsInfo(auctionId);
        } catch (TaobaoGoodsDownException e) {
            out.print(JsonUtil.loadFalseResult(3, "商品已下架"));
            return;
        } catch (Exception e) {
            try {
                LogHelper.errorDetailInfo(e, "获取商品简版详情出错", auctionId + "");
            } catch (Exception e1) {
                e1.printStackTrace();
            }
        }
        JSONObject data = new JSONObject();
        boolean isNative = false;
        String pid = null;
        boolean specialConvert = false;
        if (goods.getMaterialLibType() != null && goods.getMaterialLibType() == 1) {
            specialConvert = true;
        } else
            specialConvert = false;
        String specialId = null;
        String relationId = null;
        // 查询用户ID是否绑定了会员运营ID
        UserExtraTaoBaoInfo userInfo = userExtraTaoBaoInfoService.getByUid(uid);
        if (userInfo != null && !StringUtil.isNullOrEmpty(userInfo.getSpecialId()) && userInfo.getSpecialValid() != null
                && userInfo.getSpecialValid() == true) {
            specialId = userInfo.getSpecialId();
            relationId = userInfo.getRelationId();
            // 已经绑定
            if (specialConvert) {
                isNative = true;
            } else
                isNative = false;
            pid = TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT;
        } else {// 尚未绑定
            isNative = true;
        }
        data.put("native", isNative);
        int pidType = PidUser.TYPE_FANLI_ANDROID;
        if (acceptData.getPlatform().equalsIgnoreCase("ios"))
            pidType = PidUser.TYPE_FANLI_IOS;
        try {
            TaoBaoLink taoBaoLink = null;
            // 是返利商品库的商品
            if (specialConvert) {
                if (!StringUtil.isNullOrEmpty(specialId)) {
                    if (from != null && from.equals("taolijin")) {
                        taoBaoLink = shareGoodsService.getTaoLiJinLinkForBuy(uid, specialId, auctionId);
                    } else {
                        taoBaoLink = shareGoodsService.getTaoBaoLinkForBuyWithSpecial(uid, specialId, auctionId);
                    }
                    data.put("native", true);
                } else {
                    if (!specialConvert && !isNative) {
                        if (pidType == PidUser.TYPE_FANLI_ANDROID)
                            taoBaoLink = shareGoodsService.getTaoBaoLink(uid, auctionId,
                                    tbPidService.getAndroidDefault().getPid());
                        else
                            taoBaoLink = shareGoodsService.getTaoBaoLink(uid, auctionId,
                                    tbPidService.getIOSDefault().getPid());
                    } else
                        taoBaoLink = shareGoodsService.getTaoBaoLinkForBuy(uid, auctionId, pidType);
                    LogHelper.test("购买转链:默认PID转链-" + uid + ":" + auctionId);
                }
            } else {// 不是返利库的商品,用特殊PID替代
                try {
                    relationId = taoBaoBuyRelationMapService.getRelationId(uid);
                } catch (Exception e) {
                    LogHelper.errorDetailInfo(e, "uid:" + uid, null);
                }
                if (!StringUtil.isNullOrEmpty(relationId)) {//
                    taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, auctionId, relationId,
                            TaoBaoConstant.TAOBAO_RELATION_AS_SPECIAL_PID);
                    data.put("native", true);
                } else {
                    if (pidType == PidUser.TYPE_FANLI_ANDROID)
                        taoBaoLink = shareGoodsService.getTaoBaoLink(uid, auctionId,
                                tbPidService.getAndroidDefault().getPid());
                    else
                        taoBaoLink = shareGoodsService.getTaoBaoLink(uid, auctionId,
                                tbPidService.getIOSDefault().getPid());
                    LogHelper.test("购买转链:默认PID转链-非返利库商品-" + uid + ":" + auctionId);
                }
            }
            JSONObject link = new JSONObject();
            link.put("clickUrl", taoBaoLink.getClickUrl());
            link.put("couponUrl", taoBaoLink.getCouponLink());
            data.put("type", 1);
            data.put("link", link);
            out.print(JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            isNative = false;
            try {
                monitorService.addClientAPIMonitor(MonitorFactory.createClientAPI(request, 0, 0, "购买淘宝商品转链出错"));
            } catch (Exception e1) {
                e1.printStackTrace();
            }
            TBPid tbPid = null;
            if (acceptData.getPlatform().equalsIgnoreCase("android")) {
                tbPid = tbPidService.getTBPid(uid, PidUser.TYPE_FANLI_ANDROID);
            } else {
                tbPid = tbPidService.getTBPid(uid, PidUser.TYPE_FANLI_IOS);
            }
            LogHelper.test("购买转链:默认PID转链-异常商品-" + uid + ":" + auctionId);
            data.put("native", isNative);
            if (tbPid != null) {
                try {
                    TaoBaoLink taoBaoLink = null;
                    if (pidType == PidUser.TYPE_FANLI_ANDROID)
                        taoBaoLink = shareGoodsService.getTaoBaoLink(uid, auctionId,
                                tbPidService.getAndroidDefault().getPid());
                    else
                        taoBaoLink = shareGoodsService.getTaoBaoLink(uid, auctionId,
                                tbPidService.getIOSDefault().getPid());
                    JSONObject link = new JSONObject();
                    link.put("clickUrl", taoBaoLink.getClickUrl());
                    link.put("couponUrl", taoBaoLink.getCouponLink());
                    data.put("type", 1);
                    data.put("link", link);
                    data.put("native", true);
                } catch (Exception e1) {
                    String siteId = tbPid.getPid().split("_")[2];
                    String adzoneId = tbPid.getPid().split("_")[3];
                    TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(siteId);
                    ClientTBPid clientTBPid = new ClientTBPid(config.getAppKey(), tbPid.getPid(), siteId, adzoneId);
                    data.put("type", 2);
                    data.put("tbPidInfo", clientTBPid);
                    data.put("native", true);
                }
                out.print(JsonUtil.loadTrueResult(data));
            } else {
                out.print(JsonUtil.loadFalseResult(1, "请求失败"));
            }
            businessEmergent110Service.buyTaoBaoGoodsError(StringUtil.Md5(auctionId + ""));
        }
    }
    /**
     * 是否在参与推广
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/HomeNavbarController.java
@@ -33,7 +33,7 @@
     */
    @RequestMapping(value = "gethomenavbar", method = RequestMethod.POST)
    public void gethomenavbar(AcceptData acceptData, PrintWriter out) {
        List<HomeNavbar> listNavbar = homeNavbarService.listQueryDefaultNavbar();
        List<HomeNavbar> listNavbar = homeNavbarService.listQueryDefaultNavbar(0);
        if (listNavbar == null) {
            listNavbar = new ArrayList<HomeNavbar>();
        }
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java
@@ -41,6 +41,7 @@
import com.yeshi.fanli.entity.bus.user.Order;
import com.yeshi.fanli.entity.bus.user.ShamUser;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserMoneyExtra;
import com.yeshi.fanli.entity.common.ImageInfo;
import com.yeshi.fanli.entity.common.JumpDetail;
import com.yeshi.fanli.entity.common.JumpDetailV2;
@@ -80,6 +81,7 @@
import com.yeshi.fanli.service.inter.goods.SuperRecommendSpecialService;
import com.yeshi.fanli.service.inter.goods.TaoBaoCouponService;
import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
import com.yeshi.fanli.service.inter.homemodule.DeviceSexService;
import com.yeshi.fanli.service.inter.homemodule.SpecialService;
import com.yeshi.fanli.service.inter.homemodule.SuperSpecialService;
import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
@@ -93,12 +95,17 @@
import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
import com.yeshi.fanli.service.inter.tlj.DeviceTaoLiJinRecordService;
import com.yeshi.fanli.service.inter.tlj.GoodsTaoLiJinRateService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
import com.yeshi.fanli.service.inter.user.ShamUserService;
import com.yeshi.fanli.service.inter.user.TBPidService;
import com.yeshi.fanli.service.inter.user.UserCustomSettingsService;
import com.yeshi.fanli.service.inter.user.UserGoodsStorageService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.service.inter.user.UserMoneyExtraService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.RedisManager;
@@ -113,6 +120,7 @@
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
import com.yeshi.fanli.vo.tlj.SpreadHongBao;
import com.yeshi.fanli.vo.user.UserSettingsVO;
import net.sf.json.JSONArray;
@@ -229,6 +237,26 @@
    @Resource
    private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
    @Resource
    private GoodsTaoLiJinRateService goodsTaoLiJinRateService;
    @Resource
    private UserMoneyExtraService userMoneyExtraService;
    @Resource
    private UserTaoLiJinOriginService userTaoLiJinOriginService;
    @Resource
    private ConfigTaoLiJinService configTaoLiJinService;
    @Resource
    private DeviceTaoLiJinRecordService deviceTaoLiJinRecordService;
    @Resource
    private DeviceSexService deviceSexService;
    @RequestMapping(value = "getHonestList")
    public void getHonestList(AcceptData acceptData, PrintWriter out) {
@@ -1579,8 +1607,11 @@
    @RequestMapping(value = "getRecommendIndex")
    public void getRecommendIndex(AcceptData acceptData, Long uid, PrintWriter out) {
        try {
            // 获取设备定义性别
            int deviceSex = deviceSexService.getDeviceSex(acceptData.getDevice());
            // 1、专题模块
            JSONObject root = specialService.listCacheSpecialToIndex(acceptData);
            JSONObject root = specialService.listCacheSpecialToIndex(acceptData, deviceSex);
            // 2、顶部轮播图
            List<SwiperPicture> topPicList = getSwiperByCard("index_top");
@@ -1784,13 +1815,9 @@
     * @param out
     */
    @RequestMapping(value = "getgoodsinfo", method = RequestMethod.POST)
    public void getGoodsInfo(AcceptData acceptData, String id, String uid, String from, PrintWriter out) {
    public void getGoodsInfo(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) {
        if ("0".equalsIgnoreCase(uid)) {
            uid = "";
        }
        if (StringUtil.isNullOrEmpty(id)) {
        if (id == null) {
            out.print(JsonUtil.loadFalseResult(1, "请上传id"));
            return;
        }
@@ -1834,14 +1861,14 @@
        if (!convertInServer) {
            try {
                goods = taoBaoGoodsCacheUtil.getCommonTaoBaoGoodsInfo(Long.parseLong(id));
                goods = taoBaoGoodsCacheUtil.getCommonTaoBaoGoodsInfo(id);
                if (goods == null) {
                    TaoKeAppInfo app = new TaoKeAppInfo();
                    app.setAppKey(TaoBaoConstant.TAOBAO_COMMON_APPKEY);
                    app.setAppSecret(TaoBaoConstant.TAOBAO_COMMON_APPSECRET);
                    app.setPid(TaoBaoConstant.TAOBAO_COMMON_PID);
                    app.setAdzoneId(TaoBaoConstant.TAOBAO_COMMON_PID.split("_")[3]);
                    goods = TaoKeApiUtil.searchGoodsDetail(Long.parseLong(id), app);
                    goods = TaoKeApiUtil.searchGoodsDetail(id, app);
                    final TaoBaoGoodsBrief finalGoods = goods;
                    if (goods != null) {
                        ThreadUtil.run(new Runnable() {
@@ -1856,7 +1883,7 @@
                // 商品下架
                ThreadUtil.run(new Runnable() {
                    public void run() {
                        taoBaoGoodsUpdateService.offlineTaoBaoGoods(Long.parseLong(id));
                        taoBaoGoodsUpdateService.offlineTaoBaoGoods(id);
                    }
                });
@@ -1873,7 +1900,7 @@
            app.setPid(clientPid);
            try {
                goods = TaoKeApiUtil.searchGoodsDetail(Long.parseLong(id), app);
                goods = TaoKeApiUtil.searchGoodsDetail(id, app);
                if (goods != null) {
                    ticket.put("clickUrl", goods.getAuctionUrl());
                    // 测试使用
@@ -1895,7 +1922,7 @@
            } catch (TaobaoGoodsDownException e) {
                ThreadUtil.run(new Runnable() {
                    public void run() {
                        taoBaoGoodsUpdateService.offlineTaoBaoGoods(Long.parseLong(id));
                        taoBaoGoodsUpdateService.offlineTaoBaoGoods(id);
                    }
                });
            }
@@ -1969,11 +1996,10 @@
        }
        // 判断收藏
        if (StringUtil.isNullOrEmpty(uid)) {
        if (uid == null) {
            data.put("collected", false);
        } else {
            CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(Long.parseLong(uid),
                    Long.parseLong(id));
            CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid,    id);
            data.put("collected", collectionGoods != null ? true : false);
        }
@@ -2101,26 +2127,23 @@
            goodsJson.put("shopInfo", tbShopInfo);
        }
        goodsJson.put("fanliValid", true);// 是否有返利
        // 分享路径
        String shareUrl = String.format("%s?id=" + tb.getAuctionId(), Constant.systemCommonConfig.getAppShareInfoUrl());
        // 是否加入选品库: 0未加入 1 已加入
        boolean storageState = false;
        if (uid != null && uid.trim().length() > 0) {
            storageState = userGoodsStorageService.isExistStorage(Long.parseLong(uid), Long.parseLong(id));
        if (uid != null) {
            storageState = userGoodsStorageService.isExistStorage(uid, id);
        }
        data.put("storageState", storageState);
        data.put("shareUrl", shareUrl);
        data.put("goods", goodsJson);
        data.put("shareUsers", listShareUser);
        data.put("couponUsers", listCouponUser);
        data.put("detailWebUrl", "http://apph5.yeshitv.com/apppage/goods_img.html?id=" + id);
        data.put("noRebateHelpLink", configService.get("no_rebate_help_link"));
        String noRebateHelpLink = null;
        // 商品链接
        String h5Url = String.format("http://%s%s?id=%s&appType=flq", configService.getH5Host(),
@@ -2130,6 +2153,74 @@
        } catch (Exception e) {
            data.put("h5Url", h5Url);
        }
        // 是否有返利
        boolean fanliValid = true;
        //资金类型 1-返  2-奖
        int moneyType = 1;
        // 推广红包
        if (from != null && from.equals("taolijin")) {
            // 是否为新用户
            boolean isNewUser = userInfoExtraService.isNewUser(uid);
            if (!isNewUser) {
                moneyType = 2;
                fanliValid = false;
                ClientTextStyleVO textStyleVO1 = new ClientTextStyleVO();
                textStyleVO1.setContent("分享");
                textStyleVO1.setColor("#666666");
                ClientTextStyleVO textStyleVO2 = new ClientTextStyleVO();
                textStyleVO2.setContent("赚奖金");
                textStyleVO2.setColor("#F14242");
                ClientTextStyleVO textStyleVO3 = new ClientTextStyleVO();
                textStyleVO3.setContent(",好友");
                textStyleVO3.setColor("#666666");
                ClientTextStyleVO textStyleVO4 = new ClientTextStyleVO();
                textStyleVO4.setContent("领红包");
                textStyleVO4.setColor("#F14242");
                List<ClientTextStyleVO> listText = new ArrayList<ClientTextStyleVO>();
                listText.add(textStyleVO1);
                listText.add(textStyleVO2);
                listText.add(textStyleVO3);
                listText.add(textStyleVO4);
                data.put("listTip", listText);
            }
            BigDecimal spreadMoney = goodsTaoLiJinRateService.getGoodsSpreadMoney(goods);
            // 推广红包 不能小于1
            if (spreadMoney.compareTo(new BigDecimal(1)) < 0) {
                out.print(JsonUtil.loadFalseResult(2, "商品不存在"));
                return;
            }
            SpreadHongBao spreadHongBao = new SpreadHongBao();
            spreadHongBao.setMoney(spreadMoney.toString());
            spreadHongBao.setTip("当日领取,两天内使用,过时无效");
            goodsJson.put("spreadHongBao", spreadHongBao);
            // 用户剩余可以淘礼金验证
            UserMoneyExtra userMoneyExtra = userMoneyExtraService.selectByPrimaryKey(uid);
            if (userMoneyExtra == null ||  userMoneyExtra.getTlj() == null) {
                data.put("userHongbao", new BigDecimal(0));
            } else {
                data.put("userHongbao", userMoneyExtra.getTlj());
            }
            noRebateHelpLink = configTaoLiJinService.getValueByKey("share_goods_help_link");
        }
        goodsJson.put("moneyType", moneyType);
        goodsJson.put("fanliValid", fanliValid);
        data.put("goods", goodsJson);
        if (!StringUtil.isNullOrEmpty(noRebateHelpLink)) {
            data.put("noRebateHelpLink", noRebateHelpLink);
        } else {
            data.put("noRebateHelpLink", configService.get("no_rebate_help_link"));
        }
        // 取消分享活动
        // if (!StringUtil.isNullOrEmpty(uid)
@@ -2151,15 +2242,12 @@
        out.print(JsonUtil.loadTrueResult(data));
        final String tempUid = uid;
        final TaoBaoGoodsBrief goodsInfo = tb;
        ThreadUtil.run(new Runnable() {
            public void run() {
                // 添加浏览记录
                try {
                    scanHistoryV2Service.addScanHistory(
                            StringUtil.isNullOrEmpty(tempUid) ? null : Long.parseLong(tempUid), acceptData.getDevice(),
                            goodsInfo);
                    scanHistoryV2Service.addScanHistory(uid, acceptData.getDevice(),goodsInfo);
                } catch (Exception e) {
                    e.printStackTrace();
                }
@@ -2367,6 +2455,28 @@
                listSpecial = new ArrayList<Special>();
            }
            for (Special special: listSpecial) {
                JumpDetailV2 jumpDetail = special.getJumpDetail();
                if (jumpDetail != null) {
                    jumpDetail.setNeedLogin(special.isJumpLogin());
                    special.setJumpDetail(jumpDetail);
                }
                String name = special.getName();
                if (StringUtil.isNullOrEmpty(name)) {
                    continue;
                }
                // 是否需要弹出框
                if (name.equals("账户等级特权")) {
                    if (uid != null) {
                        special.setElastic(userTaoLiJinOriginService.hasRankHongBao(uid));
                    }
                }
            }
            JSONObject root = new JSONObject();
            root.put("special", JsonUtil.getApiCommonGson().toJson(listSpecial));
            out.print(JsonUtil.loadTrueResult(root));
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java
@@ -22,6 +22,7 @@
import com.yeshi.fanli.entity.bus.share.UserShareGoodsGroup;
import com.yeshi.fanli.entity.bus.share.UserShareGoodsHistory;
import com.yeshi.fanli.entity.bus.share.UserShareGoodsRecord;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinRecord;
import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
@@ -37,6 +38,7 @@
import com.yeshi.fanli.exception.goods.ShareGoodsTextTemplateException;
import com.yeshi.fanli.exception.share.UserShareGoodsRecordException;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
import com.yeshi.fanli.exception.tlj.UserTaoLiJinRecordException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.config.SystemClientParamsService;
@@ -47,6 +49,9 @@
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.monitor.BusinessEmergent110Service;
import com.yeshi.fanli.service.inter.monitor.MonitorService;
import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
import com.yeshi.fanli.service.inter.tlj.GoodsTaoLiJinRateService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinRecordService;
import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
@@ -127,6 +132,16 @@
    @Resource
    private BusinessEmergent110Service businessEmergent110Service;
    @Resource
    private ConfigTaoLiJinService configTaoLiJinService;
    @Resource
    private GoodsTaoLiJinRateService goodsTaoLiJinRateService;
    @Resource
    private UserTaoLiJinRecordService userTaoLiJinRecordService;
    // 获取商品分享链接
    @RequestMapping(value = "getGoodsShareUrl")
    public void getGoodsShareUrl(AcceptData acceptData, long id, PrintWriter out) {
@@ -144,8 +159,9 @@
     * @param out
     */
    @RequestMapping(value = "gettaobaosharelink")
    public void getTaobaoShareLink(AcceptData acceptData, Long uid, Long auctionId, HttpServletRequest request,
            PrintWriter out) {
    public void getTaobaoShareLink(AcceptData acceptData, Long uid, Long auctionId, String source, Integer totalNum,
            HttpServletRequest request, PrintWriter out) {
        if (uid == null || uid <= 0) {
            out.print(JsonUtil.loadFalseResult(1, "用户ID不能为空"));
            return;
@@ -168,12 +184,55 @@
            if (extraInfo != null && extraInfo.getRelationId() != null && extraInfo.getRelationValid() != null
                    && extraInfo.getRelationValid() == true)
                relationId = extraInfo.getRelationId();
            TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, auctionId, relationId);
            TaoBaoLink taoBaoLink  = new TaoBaoLink();
            if (source != null && "taolijin".equals(source)) {
                taoBaoLink = shareGoodsService.getTaoLiJinLinkForShare(uid, auctionId, relationId);
            } else {
                taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, auctionId, relationId);
            }
            JSONObject data = new JSONObject();
            String url = String.format("http://%s%s?uid=%s&id=%s&appType=flq", configService.getH5Host(),
                    Constant.systemCommonConfig.getShareGoodsPagePath(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY),
                    auctionId + "");
            if (source != null && "taolijin".equals(source)) {
                BigDecimal spreadMoney = goodsTaoLiJinRateService.getGoodsSpreadMoney(taoBaoLink.getGoods());
                // 推广红包 不能小于1
                if (spreadMoney.compareTo(new BigDecimal(1)) < 0) {
                    out.print(JsonUtil.loadFalseResult(1, "该商品淘礼金不足1元"));
                    return;
                }
                data.put("spreadMoney", "淘礼金 ¥" + spreadMoney.toString());
                String taoLiJinLink = null;
                try {
                    UserTaoLiJinRecord record = userTaoLiJinRecordService.createShareTaoLiJin(uid, totalNum, taoBaoLink.getGoods());
                    taoLiJinLink = record.getSendUrl();
                    data.put("tljId", record.getId());
                    data.put("surplusMoney", record.getSurplusMoney());
                } catch (UserTaoLiJinRecordException e) {
                    out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
                    return;
                }
                // 创建淘口令
                TaoBaoGoodsBrief goods = taoBaoLink.getGoods();
                if (!StringUtil.isNullOrEmpty(taoLiJinLink)) {// 通过立即推广方式获取淘口令成功
                    String quanToken = TaoKeApiUtil.getTKToken(goods.getPictUrl(), goods.getTitle(), taoLiJinLink);
                    if (!StringUtil.isNullOrEmpty(quanToken)) {
                        taoBaoLink.setTaoToken(quanToken);
                    }
                } else if (!StringUtil.isNullOrEmpty(taoBaoLink.getClickUrl())) {
                    String quanToken = TaoKeApiUtil.getTKToken(goods.getPictUrl(), goods.getTitle(), taoBaoLink.getClickUrl());
                    if (!StringUtil.isNullOrEmpty(quanToken)) {
                        taoBaoLink.setTaoToken(quanToken);
                    }
                }
            }
            String shortLink = HttpUtil.getShortLink(url);
            if (!StringUtil.isNullOrEmpty(shortLink)) {
@@ -190,6 +249,7 @@
            // 无券
            String shopType = taoBaoLink.getGoods().getUserType() == 0 ? "淘宝价" : "天猫价";
            if (StringUtil.isNullOrEmpty(taoBaoLink.getGoods().getCouponInfo())) {
                String text = shareGoodsTextTemplateService.getCommonTemplate(uid);
                if (StringUtil.isNullOrEmpty(text))
@@ -198,6 +258,18 @@
                        MoneyBigDecimalUtil.getWithNoZera(taoBaoLink.getGoods().getZkPrice()) + "");
            } else// 有券
            {
                if (source != null && "taolijin".equals(source)) {
                    String text = shareGoodsTextTemplateService.getTaoLiJinTemplate(uid);
                    if (StringUtil.isNullOrEmpty(text))
                        text = configTaoLiJinService.getValueByKey("goods_share_text");
                    shareText = text.replace("{标题}", taoBaoLink.getGoods().getTitle())
                            .replace("{商品原价}", MoneyBigDecimalUtil.getWithNoZera(taoBaoLink.getGoods().getZkPrice()) + "")
                            .replace("{优惠券面额}",
                                    MoneyBigDecimalUtil.getWithNoZera(taoBaoLink.getGoods().getCouponAmount()).toString())
                            .replace("{淘礼金面额}", MoneyBigDecimalUtil.getWithNoZera(goodsTaoLiJinRateService.getGoodsSpreadMoney(taoBaoLink.getGoods())).toString())
                            .replace("{优惠券价}", TaoBaoUtil.getAfterUseCouplePrice(taoBaoLink.getGoods()) + "");
                } else {
                String text = shareGoodsTextTemplateService.geteCouponTemplate(uid);
                if (StringUtil.isNullOrEmpty(text))
                    text = configService.get("goods_share_text_coupon");
@@ -208,6 +280,11 @@
                                MoneyBigDecimalUtil.getWithNoZera(taoBaoLink.getGoods().getCouponAmount()).toString())
                        .replace("{优惠券价}", TaoBaoUtil.getAfterUseCouplePrice(taoBaoLink.getGoods()) + "");
            }
            }
            shareText = shareText.replace("{店铺类型}", shopType)
                    .replace("{月销量}", TaoBaoUtil.getSaleCount(taoBaoLink.getGoods().getBiz30day()))
                    .replace("{领券短链}", shortLink).replace("{淘口令}", taoBaoLink.getTaoToken());
@@ -241,6 +318,7 @@
            }
            out.print(JsonUtil.loadTrueResult(data));
            final TaoBaoLink taobaoLink = taoBaoLink;
            // 异步操作
            com.yeshi.fanli.util.ThreadUtil.run(new Runnable() {
                @Override
@@ -251,13 +329,13 @@
                    history.setHongbao(shareMoney);
                    history.setCreateTime(new Date());
                    history.setGoodsType(UserShareGoodsHistory.TYPE_TAOBAO);
                    history.setTkCode(taoBaoLink.getTaoToken());
                    history.setLink(taoBaoLink.getClickUrl());
                    history.setQuanLink(taoBaoLink.getCouponLink());
                    history.setGoodsId(taoBaoLink.getGoods().getAuctionId());
                    history.setPostPicture(taoBaoLink.getGoods().getPictUrl());
                    history.setTkCode(taobaoLink.getTaoToken());
                    history.setLink(taobaoLink.getClickUrl());
                    history.setQuanLink(taobaoLink.getCouponLink());
                    history.setGoodsId(taobaoLink.getGoods().getAuctionId());
                    history.setPostPicture(taobaoLink.getGoods().getPictUrl());
                    List<String> imgList = taoBaoLink.getGoods().getImgList();
                    List<String> imgList = taobaoLink.getGoods().getImgList();
                    if (imgList == null) {
                        imgList = new ArrayList<>();
                    }
@@ -455,7 +533,7 @@
     * @param out
     */
    @RequestMapping(value = "viewShareTextTemplate", method = RequestMethod.POST)
    public void preViewShareTextTemplate(AcceptData acceptData, Long uid, String template, Long goodsId,
    public void preViewShareTextTemplate(AcceptData acceptData, Long uid, String template, Long goodsId, Long tljId,
            Boolean hasCoupon, PrintWriter out) {
        if (uid == null) {
            out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
@@ -480,19 +558,32 @@
            return;
        }
        String from = null;
        if (tljId != null) {
            from = "taolijin";
        }
        if (StringUtil.isNullOrEmpty(template))
            template = getShareTemplate(uid, hasCoupon);
            template = getShareTemplate(uid, hasCoupon, from);
        // 校验券模板是否正确
        if (hasCoupon) {
            // 有券商品
            if (tljId != null) {
                try {
                    shareGoodsTextTemplateService.isTaoLiJinTemplateRight(template);
                } catch (ShareGoodsTextTemplateException e) {
                    out.print(JsonUtil.loadFalseResult(5, e.getMsg()));
                    return;
                }
            } else {
            try {
                shareGoodsTextTemplateService.isCouponTemplateRight(template);
            } catch (ShareGoodsTextTemplateException e) {
                out.print(JsonUtil.loadFalseResult(5, e.getMsg()));
                return;
            }
            }
        } else {
            // 普通商品
            try {
@@ -503,12 +594,25 @@
            }
        }
        // 查询是否有分享
        UserShareGoodsHistory userShareHistory = shareGoodsService.getShareGoodsHistory(uid, goods.getAuctionId());
        String url = String.format("http://%s%s?uid=%s&id=%s&appType=flq", configService.getH5Host(),
        String url = null;
        if (tljId != null) {
            UserTaoLiJinRecord userTaoLiJinRecord = userTaoLiJinRecordService.selectByPrimaryKey(tljId);
            if (userTaoLiJinRecord == null) {
                out.print(JsonUtil.loadFalseResult(5, "淘礼金领取链接不存在"));
                return;
            }
            url = userTaoLiJinRecord.getSendUrl();
        } else {
            url = String.format("http://%s%s?uid=%s&id=%s&appType=flq", configService.getH5Host(),
                Constant.systemCommonConfig.getShareGoodsPagePath(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY),
                goods.getAuctionId() + "");
        }
        String shortLink = HttpUtil.getShortLink(url);
        // 查询是否有分享
        UserShareGoodsHistory userShareHistory = shareGoodsService.getShareGoodsHistory(uid, goods.getAuctionId());
        String token = "";
        if (userShareHistory != null) {
            token = userShareHistory.getTkCode();
@@ -527,7 +631,7 @@
                                : goodsLink.getCouponLink());
        }
        String content = shareGoodsTextTemplateService.createContentByTemplate(template, uid, goods, token, shortLink,
                hasCoupon);
                hasCoupon, from);
        JSONObject data = new JSONObject();
        data.put("content", content);
        out.print(JsonUtil.loadTrueResult(data));
@@ -543,7 +647,7 @@
     * @param out
     */
    @RequestMapping(value = "saveShareTextTemplate", method = RequestMethod.POST)
    public void saveShareTextTemplate(AcceptData acceptData, Long uid, Boolean hasCoupon, String template,
    public void saveShareTextTemplate(AcceptData acceptData, Long uid, Long tljId, Boolean hasCoupon, String template,
            PrintWriter out) {
        if (StringUtil.isNullOrEmpty(template)) {
            out.print(JsonUtil.loadFalseResult(1, "分享模板为空"));
@@ -552,6 +656,16 @@
        // 校验券模板是否正确
        if (hasCoupon) {
            // 有券商品
            if (tljId != null) {
                try {
                    shareGoodsTextTemplateService.isTaoLiJinTemplateRight(template);
                    shareGoodsTextTemplateService.saveTaoLiJinTemplate(uid, template);
                    out.print(JsonUtil.loadTrueResult(""));
                } catch (ShareGoodsTextTemplateException e) {
                    out.print(JsonUtil.loadFalseResult(5, e.getMsg()));
                    return;
                }
            } else {
            try {
                shareGoodsTextTemplateService.isCouponTemplateRight(template);
                shareGoodsTextTemplateService.saveCouponTemplate(uid, template);
@@ -560,7 +674,7 @@
                out.print(JsonUtil.loadFalseResult(5, e.getMsg()));
                return;
            }
            }
        } else {
            // 普通商品
            try {
@@ -585,32 +699,46 @@
     * @param out
     */
    @RequestMapping(value = "resetShareTextTemplate", method = RequestMethod.POST)
    public void resetShareTextTemplate(AcceptData acceptData, Long uid, Long goodsId, Boolean hasCoupon,
    public void resetShareTextTemplate(AcceptData acceptData, Long uid, Long goodsId, Long tljId, Boolean hasCoupon,
            PrintWriter out) {
        if (uid == null) {
            out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
        }
        if (hasCoupon) {
            if (tljId != null) {
                shareGoodsTextTemplateService.resetTaoLijinTemplate(uid);
            } else {
            shareGoodsTextTemplateService.resetCouponTemplate(uid);
            }
        } else {
            shareGoodsTextTemplateService.resetCommonTemplate(uid);
        }
        if (goodsId != null) {
            preViewShareTextTemplate(acceptData, uid, null, goodsId, hasCoupon, out);
            preViewShareTextTemplate(acceptData, uid, null, goodsId, tljId, hasCoupon, out);
            return;
        }
        out.print(JsonUtil.loadTrueResult(""));
    }
    private String getShareTemplate(Long uid, boolean hasCoupon) {
    private String getShareTemplate(Long uid, boolean hasCoupon, String from) {
        if (hasCoupon) {
            if (!StringUtil.isNullOrEmpty(from) && "taolijin".equals(from)) {
                String template = shareGoodsTextTemplateService.getTaoLiJinTemplate(uid);
                if (StringUtil.isNullOrEmpty(template))
                    template = configTaoLiJinService.getValueByKey("goods_share_text");
                return template;
            } else {
            String template = shareGoodsTextTemplateService.geteCouponTemplate(uid);
            if (StringUtil.isNullOrEmpty(template))
                template = configService.get("goods_share_text_coupon");
            return template;
            }
        } else {
            String template = shareGoodsTextTemplateService.getCommonTemplate(uid);
            if (StringUtil.isNullOrEmpty(template))
@@ -628,13 +756,13 @@
     * @param out
     */
    @RequestMapping(value = "getShareTextTemplate", method = RequestMethod.POST)
    public void getShareTextTemplate(AcceptData acceptData, Long uid, Boolean hasCoupon, PrintWriter out) {
    public void getShareTextTemplate(AcceptData acceptData, Long uid, String from, Boolean hasCoupon, PrintWriter out) {
        if (uid == null) {
            out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
        }
        JSONObject data = new JSONObject();
        data.put("template", getShareTemplate(uid, hasCoupon));
        data.put("template", getShareTemplate(uid, hasCoupon, from));
        out.print(JsonUtil.loadTrueResult(data));
    }
@@ -645,9 +773,13 @@
     * @param out
     */
    @RequestMapping(value = "getShareTextTemplateRules", method = RequestMethod.POST)
    public void getShareTextTemplateRules(AcceptData acceptData, PrintWriter out) {
    public void getShareTextTemplateRules(AcceptData acceptData, String from, PrintWriter out) {
        if (!StringUtil.isNullOrEmpty(from) && "taolijin".equals(from)) {
            out.print(JsonUtil.loadTrueResult( configTaoLiJinService.getValueByKey("share_goods_rules")));
        } else {
        out.print(JsonUtil.loadTrueResult(configService.get("share_goods_template_rules")));
    }
    }
    /**
     * 查询顶部分类
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserAccountController.java
@@ -41,6 +41,7 @@
import com.yeshi.fanli.service.inter.order.OrderService;
import com.yeshi.fanli.service.inter.push.DeviceTokenHWService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
import com.yeshi.fanli.service.inter.user.BindingAccountService;
import com.yeshi.fanli.service.inter.user.ExtractService;
import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
@@ -145,6 +146,10 @@
    
    @Resource
    private UserInfoDeleteRecordService userInfoDeleteRecordService;
    @Resource
    private UserTaoLiJinOriginService userTaoLiJinOriginService;
    private static final String PASSWORD_MAX_ERROR = "password_max_error";
    private static final String EXTRACT_MIN_MONEY = "extract_min_money";
@@ -1161,8 +1166,8 @@
                            LogHelper.errorDetailInfo(e);
                        }
                        
                        try {
                            /* 同步未登录之前设备抽奖数据 */
                        try {
                            int platformType = 0;
                            String platform = acceptData.getPlatform();
                            if ("android".equals(platform)) {
@@ -1174,6 +1179,16 @@
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                        /* 新人红包 */
                        try {
                            userTaoLiJinOriginService.synchDeviceHongbao(uuser.getId(),  device);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    }
                });
            }
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserInfoController.java
@@ -578,7 +578,9 @@
        if (mySettings.getNoInvitationBonus() == null) {
            mySettings.setNoInvitationBonus(0);
        }
        if (mySettings.getOpenSpreadHongBao() == null) {
            mySettings.setOpenSpreadHongBao(0);
        }
        data.put("moduleState", mySettings);
        int welfareCenterNews = 0;
@@ -2088,6 +2090,9 @@
            if (mySettings.getNoInvitationBonus() == null) {
                mySettings.setNoInvitationBonus(0);
            }
            if (mySettings.getOpenSpreadHongBao() == null) {
                mySettings.setOpenSpreadHongBao(0);
            }
            data.put("moduleState", mySettings);
            int welfareCenterNews = 0;
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/HomeNavbarControllerV2.java
@@ -18,6 +18,7 @@
import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar.NavbarTypeEnum;
import com.yeshi.fanli.entity.bus.homemodule.HomeNavbarUser;
import com.yeshi.fanli.exception.homemodule.HomeNavbarUserException;
import com.yeshi.fanli.service.inter.homemodule.DeviceSexService;
import com.yeshi.fanli.service.inter.homemodule.HomeNavbarService;
import com.yeshi.fanli.service.inter.homemodule.HomeNavbarUserService;
import com.yeshi.fanli.util.StringUtil;
@@ -34,19 +35,51 @@
    @Resource
    private HomeNavbarUserService homeNavbarUserService;
    @Resource
    private DeviceSexService deviceSexService;
    /**
     * 改变性别
     * @param acceptData
     * @param sex
     * @param out
     */
    @RequestMapping(value = "changeSex", method = RequestMethod.POST)
    public void changeSex(AcceptData acceptData, Integer sex, PrintWriter out) {
        try {
            // 获取设备定义性别
            int deviceSex = deviceSexService.changeDeviceSex(sex, acceptData.getDevice());
            JSONObject data = new JSONObject();
            data.put("sex", deviceSex);
            out.print(JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult("切换失败"));
        }
    }
    /**
     * 获取导航栏内容
     *
     * @param acceptData
     * @param uid
     * @param sex 0通用 1男 2女
     * @param out
     */
    @RequestMapping(value = "getHomeItems", method = RequestMethod.POST)
    public void getHomeItems(AcceptData acceptData, Long uid, PrintWriter out) {
        List<HomeNavbar> listNavbar = homeNavbarUserService.listEffectiveNavbar(uid, acceptData.getDevice());
        // 获取设备定义性别
        int deviceSex = deviceSexService.getDeviceSex(acceptData.getDevice());
        List<HomeNavbar> listNavbar = homeNavbarUserService.listEffectiveNavbar(uid, acceptData.getDevice(), deviceSex);
        if (listNavbar == null) {
            listNavbar = new ArrayList<HomeNavbar>();
        }
        JSONObject data = new JSONObject();
        data.put("sex", deviceSex);
        data.put("count", listNavbar.size());
        data.put("listNavbar", JsonUtil.getApiCommonGson().toJson(listNavbar));
        out.print(JsonUtil.loadTrueResult(data));
@@ -85,14 +118,14 @@
                    }
                    if (homeNavbar.getIsDefault()) {
                        listExist.add(homeNavbar);
                        if (homeNavbar.getIsFixed()) {
                            nonCount++;
                        }
                        listExist.add(homeNavbar);
                        listItems.remove(homeNavbar);
                        i--;
                        continue;
                    }
                }
@@ -183,6 +216,10 @@
            homeNavbarUserService.addNavbarUser(uid, acceptData.getDevice(), list);
            out.print(JsonUtil.loadTrueResult("保存成功"));
            // 设置为通用
            deviceSexService.changeDeviceSex(0, acceptData.getDevice());
        } catch (HomeNavbarUserException e) {
            out.print(JsonUtil.loadFalseResult(1, e.getMsg()));
        }
@@ -202,6 +239,7 @@
            List<HomeNavbar> listExist = new ArrayList<HomeNavbar>();
            List<HomeNavbar> listItems = new ArrayList<HomeNavbar>();
            List<HomeNavbar> listNavbar = homeNavbarUserService.restoreSystemDefault(uid, acceptData.getDevice());
            if (listNavbar != null && listNavbar.size() > 0) {
                listItems.addAll(listNavbar);
@@ -220,13 +258,15 @@
                if (!homeNavbar.getIsDefault()) {
                    break;
                } else {
                    // 固定个数
                    if (homeNavbar.getIsFixed()) {
                        nonCount++;
                    }
                    // 默认项
                    listExist.add(homeNavbar);
                    listItems.remove(homeNavbar);
                    i--;
                    continue;
                }
            }
@@ -235,6 +275,10 @@
            data.put("listExist", JsonUtil.getApiCommonGson().toJson(listExist));
            data.put("listItems", JsonUtil.getApiCommonGson().toJson(listItems));
            out.print(JsonUtil.loadTrueResult(data));
            // 设置为通用
            deviceSexService.changeDeviceSex(0, acceptData.getDevice());
        } catch (HomeNavbarUserException e) {
            out.print(JsonUtil.loadFalseResult(1, e.getMsg()));
        }
fanli/src/main/java/com/yeshi/fanli/controller/h5/H5RecommendController.java
@@ -36,6 +36,7 @@
import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinRecordService;
import com.yeshi.fanli.service.inter.user.TBPidService;
import com.yeshi.fanli.service.inter.user.UserShareGoodsGroupService;
import com.yeshi.fanli.util.AESUtil;
@@ -88,6 +89,10 @@
    @Resource
    private UserShareGoodsGroupService userShareGoodsGroupService;
    @Resource
    private UserTaoLiJinRecordService userTaoLiJinRecordService;
    /**
     * 
@@ -295,6 +300,14 @@
            // 老版本兼容
            data.put("quan", true);
        }
        // 查询商品淘礼金
        BigDecimal taoLiJin = userTaoLiJinRecordService.getShareHongBaoByUidAndGoodsId(Long.parseLong(uid), Long.parseLong(id));
        if (taoLiJin != null && taoLiJin.compareTo(new BigDecimal(0)) == 1) {
            data.put("taoLiJin", "可获淘礼金红包 ¥" + taoLiJin);
        }
        out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
        final String tempUid = uid;
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/FloatADMapper.java
@@ -58,7 +58,7 @@
     * @param position
     * @return
     */
    FloatAD getEffectiveFloatAD(@Param("position") String position);
    FloatAD getEffectiveFloatAD(@Param("position") String position, @Param("type") Integer type);
}
    
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/HomeNavbarMapper.java
@@ -54,7 +54,7 @@
     * 默认导航栏
     * @return
     */
    List<HomeNavbar> listQueryDefaultNavbar();
    List<HomeNavbar> listQueryDefaultNavbar(@Param("sex") Integer sex);
    
    
    /**
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/SpecialMapper.java
@@ -73,6 +73,6 @@
     * @param systemId
     * @return
     */
    List<Special> listByPlaceKey(@Param("placeKey") String placeKey);
    List<Special> listByPlaceKey(@Param("placeKey") String placeKey, @Param("sex")Integer sex);
    
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/clazz/GoodsClass.java
@@ -21,6 +21,15 @@
     * 
     */
    private static final long serialVersionUID = 1L;
    public final static int SEX_DEFAULT = 0;  // 通用
    public final static int SEX_WOMAN = 1;  // 女
    public final static int SEX_MAN = 2;  //  男
    public final static int SEX_DEFAULT_WOMAN = 10;  // 女+ 通用
    public final static int SEX_DEFAULT_MAN = 20;  // 男+ 通用
    public final static int SEX_MAN_WOMAN = 12;  // 男+ 女
    public final static int SEX_ALL = 120;  // 男+ 女 + 通用
    @Expose
    @Column(name = "id")
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/FloatAD.java
@@ -26,6 +26,8 @@
    
    // 展示位置 -首页
    public static String POSITION_INDEX = "index";
    // 展示位置 - 消息中心
    public static String POSITION_MSGCENTER = "msgCenter";
    
    
    @Column(name = "fa_id")
@@ -77,6 +79,10 @@
    // 排序-优先权
    @Column(name = "fa_order")
    private Integer order;
    // 适用类型 1新人
    @Column(name = "fa_type")
    private Integer type;
    // 启用状态
    @Column(name = "fa_state")
@@ -225,5 +231,12 @@
        this.endTime_str = endTime_str;
    }
    
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/HomeNavbar.java
@@ -71,6 +71,13 @@
    @Column(name = "br_orderby")
    private Integer orderby;
    // 排序
    @Column(name = "br_order_man")
    private Integer orderMan;
    // 排序
    @Column(name = "br_order_woman")
    private Integer orderWoman;
    //起始时间
    @Column(name = "br_start_time")
    private Date startTime;
@@ -112,6 +119,8 @@
    private String swiperName;
    // 分类名称
    private String className;
    private Integer sex;
    
    
    public HomeNavbar() {}
@@ -280,4 +289,28 @@
    public void setIsFixed(Boolean isFixed) {
        this.isFixed = isFixed;
    }
    public Integer getSex() {
        return sex;
    }
    public void setSex(Integer sex) {
        this.sex = sex;
    }
    public Integer getOrderMan() {
        return orderMan;
    }
    public void setOrderMan(Integer orderMan) {
        this.orderMan = orderMan;
    }
    public Integer getOrderWoman() {
        return orderWoman;
    }
    public void setOrderWoman(Integer orderWoman) {
        this.orderWoman = orderWoman;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/Special.java
@@ -16,10 +16,24 @@
 *
 * @date 2018年10月23日
 */
/**
 * @author Administrator
 *
 */
@Table("yeshi_ec_special")
public class Special implements Serializable {
    private static final long serialVersionUID = 1L;
    public final static int SEX_DEFAULT = 0;  // 通用
    public final static int SEX_WOMAN = 1;  // 女
    public final static int SEX_MAN = 2;  // 男
    public final static int SEX_DEFAULT_WOMAN = 10;  // 女+ 通用
    public final static int SEX_DEFAULT_MAN = 20;  // 男+ 通用
    public final static int SEX_MAN_WOMAN = 12;  // 男+ 女
    public final static int SEX_ALL = 120;  // 男+女+通用
    @Expose
    @Column(name = "b_id")
@@ -72,9 +86,21 @@
    @Column(name = "b_orderby")
    private Integer orderby;
    
    // 排序
    @Column(name = "b_order_man")
    private Integer orderMan;
    // 排序
    @Column(name = "b_order_woman")
    private Integer orderWoman;
    // 状态
    @Column(name = "b_state")
    private Long state;
    // 性别区分
    @Column(name = "b_sex")
    private Integer sex;
    
    // 显示类型:圆形图 、大图
    @Expose
@@ -100,6 +126,11 @@
    private Boolean delIcon;
    private Boolean delPicture;
    private Boolean delSubPicture;
    // 是否弹框
    @Expose
    private boolean elastic;
    public Long getId() {
        return id;
@@ -262,4 +293,36 @@
        this.delSubPicture = delSubPicture;
    }
    
    public boolean isElastic() {
        return elastic;
    }
    public void setElastic(boolean elastic) {
        this.elastic = elastic;
    }
    public Integer getSex() {
        return sex;
    }
    public void setSex(Integer sex) {
        this.sex = sex;
    }
    public Integer getOrderMan() {
        return orderMan;
    }
    public void setOrderMan(Integer orderMan) {
        this.orderMan = orderMan;
    }
    public Integer getOrderWoman() {
        return orderWoman;
    }
    public void setOrderWoman(Integer orderWoman) {
        this.orderWoman = orderWoman;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserCustomSettings.java
@@ -16,7 +16,7 @@
    // 消息类型的枚举
    public enum UserSettingTypeEnum {
        cancelNotice("通知免打扰(20:00-8:00)"), noNewsRedDot("不看消息红点提醒"), noBonusCount("不看奖金统计"),
        noShareRecordAndStorage("不看分享记录和选品库"),noInvitationBonus("不看邀请拿奖金");
        noShareRecordAndStorage("不看分享记录和选品库"),noInvitationBonus("不看邀请拿奖金"), openSpreadHongBao("开启推广红包");
        
        private final String desc;
fanli/src/main/java/com/yeshi/fanli/entity/goods/ShareGoodsTextTemplate.java
@@ -21,6 +21,8 @@
    private String shareTextTemplate;// 普通商品分享模板
    @Column(name = "st_share_coupon_text_template")
    private String shareCouponTextTemplate;// 券分享模板
    @Column(name = "st_share_taolijin_text_template")
    private String shareTaoLiJinTextTemplate;// 淘礼金分享模板
    @Column(name = "st_create_time")
    private Date createTime;
    @Column(name = "st_update_time")
@@ -73,4 +75,12 @@
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    public String getShareTaoLiJinTextTemplate() {
        return shareTaoLiJinTextTemplate;
    }
    public void setShareTaoLiJinTextTemplate(String shareTaoLiJinTextTemplate) {
        this.shareTaoLiJinTextTemplate = shareTaoLiJinTextTemplate;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/taobao/TaoBaoGoodsBriefExtra.java
@@ -31,7 +31,7 @@
    private int collected; // 0-没有收藏 1-已收藏
    
    @Expose
    private int moneyType;////资金类型1-返  2-奖
    private int moneyType;// 资金类型 1-返  2-奖
    
    @Expose
    private List<ClientTextStyleVO> labels;////标签
@@ -44,6 +44,9 @@
    
    @Expose
    private boolean recommend = true; // 是否推荐
    @Expose
    private String spreadMoney;// 推广红包
    
    public int getMoneyType() {
@@ -150,4 +153,12 @@
        this.recommend = recommend;
    }
    public String getSpreadMoney() {
        return spreadMoney;
    }
    public void setSpreadMoney(String spreadMoney) {
        this.spreadMoney = spreadMoney;
    }
}
fanli/src/main/java/com/yeshi/fanli/mapping/goods/ShareGoodsTextTemplateMapper.xml
@@ -10,10 +10,13 @@
            jdbcType="VARCHAR" />
        <result column="st_share_coupon_text_template" property="shareCouponTextTemplate"
            jdbcType="VARCHAR" />
        <result column="st_share_taolijin_text_template" property="shareTaoLiJinTextTemplate" jdbcType="VARCHAR" />
        <result column="st_create_time" property="createTime" jdbcType="TIMESTAMP" />
        <result column="st_update_time" property="updateTime" jdbcType="TIMESTAMP" />
    </resultMap>
    <sql id="Base_Column_List">st_id,st_uid,st_share_text_template,st_share_coupon_text_template,st_create_time,st_update_time
    <sql id="Base_Column_List">st_id,st_uid,st_share_text_template,st_share_coupon_text_template,st_share_taolijin_text_template,st_create_time,st_update_time
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
@@ -35,9 +38,9 @@
    <insert id="insert" parameterType="com.yeshi.fanli.entity.goods.ShareGoodsTextTemplate"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_share_template
        (st_id,st_uid,st_share_text_template,st_share_coupon_text_template,st_create_time,st_update_time)
        (st_id,st_uid,st_share_text_template,st_share_coupon_text_template,st_share_taolijin_text_template,st_create_time,st_update_time)
        values
        (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{shareTextTemplate,jdbcType=VARCHAR},#{shareCouponTextTemplate,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
        (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{shareTextTemplate,jdbcType=VARCHAR},#{shareCouponTextTemplate,jdbcType=VARCHAR},#{shareTaoLiJinTextTemplate,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.goods.ShareGoodsTextTemplate"
        useGeneratedKeys="true" keyProperty="id">
@@ -47,6 +50,7 @@
            <if test="uid != null">st_uid,</if>
            <if test="shareTextTemplate != null">st_share_text_template,</if>
            <if test="shareCouponTextTemplate != null">st_share_coupon_text_template,</if>
            <if test="shareTaoLiJinTextTemplate != null">st_share_taolijin_text_template,</if>
            <if test="createTime != null">st_create_time,</if>
            <if test="updateTime != null">st_update_time,</if>
        </trim>
@@ -56,6 +60,7 @@
            <if test="uid != null">#{uid,jdbcType=BIGINT},</if>
            <if test="shareTextTemplate != null">#{shareTextTemplate,jdbcType=VARCHAR},</if>
            <if test="shareCouponTextTemplate != null">#{shareCouponTextTemplate,jdbcType=VARCHAR},</if>
            <if test="shareTaoLiJinTextTemplate != null">#{shareTaoLiJinTextTemplate,jdbcType=VARCHAR},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
        </trim>
@@ -64,7 +69,8 @@
        yeshi_ec_share_template set st_uid =
        #{uid,jdbcType=BIGINT},st_share_text_template =
        #{shareTextTemplate,jdbcType=VARCHAR},st_share_coupon_text_template =
        #{shareCouponTextTemplate,jdbcType=VARCHAR},st_create_time =
        #{shareCouponTextTemplate,jdbcType=VARCHAR},st_share_taolijin_text_template =
        #{shareTaoLiJinTextTemplate,jdbcType=VARCHAR},st_create_time =
        #{createTime,jdbcType=TIMESTAMP},st_update_time =
        #{updateTime,jdbcType=TIMESTAMP} where st_id = #{id,jdbcType=BIGINT}
    </update>
@@ -76,6 +82,8 @@
            </if>
            <if test="shareCouponTextTemplate != null">st_share_coupon_text_template=#{shareCouponTextTemplate,jdbcType=VARCHAR},
            </if>
            <if test="shareTaoLiJinTextTemplate != null">st_share_taolijin_text_template=#{shareTaoLiJinTextTemplate,jdbcType=VARCHAR},
            </if>
            <if test="createTime != null">st_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">st_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
        </set>
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/FloatADMapper.xml
@@ -14,6 +14,7 @@
    <result column="fa_end_time" property="endTime" jdbcType="TIMESTAMP"/>
    <result column="fa_position" property="position" jdbcType="VARCHAR"/>
    <result column="fa_order" property="order" jdbcType="INTEGER"/>
    <result column="fa_type" property="type" jdbcType="INTEGER"/>
    <result column="fa_state" property="state" jdbcType="INTEGER"/>
    <result column="fa_create_time" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="fa_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
@@ -23,12 +24,12 @@
    </association>
    
  </resultMap>
  <sql id="Base_Column_List">fa_id,fa_name,fa_picture,fa_show_mode,fa_jumpid,fa_params,fa_jump_need_login,fa_start_time,fa_end_time,fa_position,fa_order,fa_state,fa_create_time,fa_update_time</sql>
  <sql id="Base_Column_List">fa_id,fa_name,fa_picture,fa_show_mode,fa_jumpid,fa_params,fa_jump_need_login,fa_start_time,fa_end_time,fa_position,fa_order,fa_type,fa_state,fa_create_time,fa_update_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_float_ad where fa_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_float_ad where fa_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_float_ad (fa_id,fa_name,fa_picture,fa_show_mode,fa_jumpid,fa_params,fa_jump_need_login,fa_start_time,fa_end_time,fa_position,fa_order,fa_state,fa_create_time,fa_update_time) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{showMode,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{jumpNeedLogin,jdbcType=VARCHAR},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{position,jdbcType=VARCHAR},#{order,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_float_ad (fa_id,fa_name,fa_picture,fa_show_mode,fa_jumpid,fa_params,fa_jump_need_login,fa_start_time,fa_end_time,fa_position,fa_order,fa_type,fa_state,fa_create_time,fa_update_time) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{showMode,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{jumpNeedLogin,jdbcType=VARCHAR},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{position,jdbcType=VARCHAR},#{order,jdbcType=INTEGER},#{type,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_float_ad
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">fa_id,</if>
@@ -42,6 +43,7 @@
      <if test="endTime != null">fa_end_time,</if>
      <if test="position != null">fa_position,</if>
      <if test="order != null">fa_order,</if>
      <if test="type != null">fa_type,</if>
      <if test="state != null">fa_state,</if>
      <if test="createTime != null">fa_create_time,</if>
      <if test="updateTime != null">fa_update_time,</if>
@@ -58,12 +60,13 @@
      <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if>
      <if test="position != null">#{position,jdbcType=VARCHAR},</if>
      <if test="order != null">#{order,jdbcType=INTEGER},</if>
      <if test="type != null">#{type,jdbcType=INTEGER},</if>
      <if test="state != null">#{state,jdbcType=INTEGER},</if>
      <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD">update yeshi_ec_float_ad set fa_name = #{name,jdbcType=VARCHAR},fa_picture = #{picture,jdbcType=VARCHAR},fa_show_mode = #{showMode,jdbcType=VARCHAR},fa_jumpid = #{jumpDetail.id,jdbcType=BIGINT},fa_params = #{params,jdbcType=VARCHAR},fa_jump_need_login = #{jumpNeedLogin,jdbcType=VARCHAR},fa_start_time = #{startTime,jdbcType=TIMESTAMP},fa_end_time = #{endTime,jdbcType=TIMESTAMP},fa_position = #{position,jdbcType=VARCHAR},fa_order = #{order,jdbcType=INTEGER},fa_state = #{state,jdbcType=INTEGER},fa_create_time = #{createTime,jdbcType=TIMESTAMP},fa_update_time = #{updateTime,jdbcType=TIMESTAMP} where fa_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD">update yeshi_ec_float_ad set fa_name = #{name,jdbcType=VARCHAR},fa_picture = #{picture,jdbcType=VARCHAR},fa_show_mode = #{showMode,jdbcType=VARCHAR},fa_jumpid = #{jumpDetail.id,jdbcType=BIGINT},fa_params = #{params,jdbcType=VARCHAR},fa_jump_need_login = #{jumpNeedLogin,jdbcType=VARCHAR},fa_start_time = #{startTime,jdbcType=TIMESTAMP},fa_end_time = #{endTime,jdbcType=TIMESTAMP},fa_position = #{position,jdbcType=VARCHAR},fa_order = #{order,jdbcType=INTEGER},fa_type = #{type,jdbcType=INTEGER},fa_state = #{state,jdbcType=INTEGER},fa_create_time = #{createTime,jdbcType=TIMESTAMP},fa_update_time = #{updateTime,jdbcType=TIMESTAMP} where fa_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD">update yeshi_ec_float_ad
    <set>
      <if test="name != null">fa_name=#{name,jdbcType=VARCHAR},</if>
@@ -76,6 +79,7 @@
      <if test="endTime != null">fa_end_time=#{endTime,jdbcType=TIMESTAMP},</if>
      <if test="position != null">fa_position=#{position,jdbcType=VARCHAR},</if>
      <if test="order != null">fa_order=#{order,jdbcType=INTEGER},</if>
      <if test="type != null">fa_type=#{type,jdbcType=INTEGER},</if>
      <if test="state != null">fa_state=#{state,jdbcType=INTEGER},</if>
      <if test="createTime != null">fa_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updateTime != null">fa_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
@@ -144,9 +148,12 @@
   
       <select id="getEffectiveFloatAD" resultMap="BaseResultMap">
           SELECT * FROM yeshi_ec_float_ad fd 
        WHERE fd.`fa_position` = 'index' AND fd.`fa_state` = 1
        WHERE fd.`fa_position` = #{position} AND fd.`fa_state` = 1
               AND IF(fd.`fa_start_time` IS NULL,TRUE,fd.`fa_start_time` <![CDATA[<=]]> NOW()) 
               AND IF(fd.`fa_end_time` IS NULL,TRUE,fd.`fa_end_time` <![CDATA[>=]]> NOW())
               <if test="type != null">
                   AND fa_type = #{type}
               </if>
        ORDER BY fd.`fa_order` 
        LIMIT 1
       </select>
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/HomeNavbarMapper.xml
@@ -11,6 +11,8 @@
    <result column="br_url" property="url" jdbcType="VARCHAR"/>
    <result column="br_type" property="type" jdbcType="VARCHAR"/>
    <result column="br_orderby" property="orderby" jdbcType="INTEGER"/>
    <result column="br_order_man" property="orderMan" jdbcType="INTEGER"/>
    <result column="br_order_woman" property="orderWoman" jdbcType="INTEGER"/>
    <result column="br_start_time" property="startTime" jdbcType="TIMESTAMP"/>
    <result column="br_end_time" property="endTime" jdbcType="TIMESTAMP"/>
    <result column="br_state" property="state" jdbcType="INTEGER"/>
@@ -19,9 +21,13 @@
    <result column="br_createtime" property="createtime" jdbcType="TIMESTAMP"/>
    <result column="br_updatetime" property="updatetime" jdbcType="TIMESTAMP"/>
    <result column="br_type" property="type" typeHandler="com.yeshi.fanli.util.mybatishandler.NavbarTypeEnumHandler"/>
    <result column="sex" property="sex" jdbcType="INTEGER"/>
  </resultMap>
  
  <sql id="Base_Column_List">br_id,br_name,br_picture,br_class_id,br_swiper_banner_id,br_url,br_type,br_orderby,br_start_time,br_end_time,br_state,br_is_default,br_is_fixed,br_createtime,br_updatetime</sql>
  <sql id="Base_Column_List">br_id,br_name,br_picture,br_class_id,br_swiper_banner_id,br_url,br_type,br_orderby,br_order_man,br_order_woman,br_start_time,br_end_time,br_state,br_is_default,br_is_fixed,br_createtime,br_updatetime</sql>
  
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_home_navbar where br_id = #{id,jdbcType=BIGINT}
@@ -65,20 +71,41 @@
   </select>
      
   <select id="listQueryEffective" resultMap="BaseResultMap">
      SELECT * FROM    yeshi_ec_home_navbar
      WHERE br_state = 1
              AND IF(br_start_time IS NULL,TRUE, br_start_time<![CDATA[<=]]> NOW())
              AND IF(br_end_time IS NULL,TRUE, br_end_time <![CDATA[>=]]> NOW())
      ORDER BY br_orderby
      SELECT h.*,c.sex AS sex FROM yeshi_ec_home_navbar h
      LEFT JOIN `yeshi_ec_class` c ON c.`id` = h.`br_class_id`
      WHERE h.br_state = 1
              AND IF(h.br_start_time IS NULL,TRUE, h.br_start_time<![CDATA[<=]]> NOW())
              AND IF(h.br_end_time IS NULL,TRUE, h.br_end_time <![CDATA[>=]]> NOW())
            ORDER BY h.br_orderby
   </select>
   
   
   <select id="listQueryDefaultNavbar" resultMap="BaseResultMap">
      SELECT * FROM    yeshi_ec_home_navbar
      WHERE br_state = 1 AND br_is_default = 1
              AND IF(br_start_time IS NULL,TRUE, br_start_time<![CDATA[<=]]> NOW())
              AND IF(br_end_time IS NULL,TRUE, br_end_time <![CDATA[>=]]> NOW())
      ORDER BY br_orderby
      SELECT h.*,c.sex AS sex FROM    yeshi_ec_home_navbar h
      LEFT JOIN `yeshi_ec_class` c ON c.`id` = h.`br_class_id`
      WHERE h.br_state = 1 AND br_is_default = 1
              AND IF(h.br_start_time IS NULL,TRUE, h.br_start_time<![CDATA[<=]]> NOW())
              AND IF(h.br_end_time IS NULL,TRUE, h.br_end_time <![CDATA[>=]]> NOW())
              <!-- 全部使用 -->
            <if test="sex == null">
                AND c.`sex`= 120
                ORDER BY h.br_orderby
            </if>
            <!-- 通用版 -->
            <if test="sex == 0">
                AND (c.`sex`= 120 OR c.`sex` = 0 OR c.`sex` = 10 OR c.`sex` = 20)
                ORDER BY h.br_orderby
            </if>
            <!-- 女版 -->
            <if test="sex == 1">
                AND (c.`sex`= 120 OR c.`sex` = 1 OR c.`sex` = 10 OR c.`sex` = 12)
                ORDER BY h.br_order_woman
            </if>
            <!-- 男版 -->
            <if test="sex == 2">
                AND (c.`sex`= 120 OR c.`sex` = 2 OR c.`sex` = 20 OR c.`sex` = 12)
                ORDER BY h.br_order_man
            </if>
   </select>
   
   <select id="listQueryFixedNavbar" resultMap="BaseResultMap">
@@ -105,7 +132,7 @@
      delete from yeshi_ec_home_navbar where br_id = #{id,jdbcType=BIGINT}
  </delete>
  
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_home_navbar (br_id,br_name,br_picture,br_class_id,br_swiper_banner_id,br_url,br_type,br_orderby,br_start_time,br_end_time,br_state,br_is_default,br_is_fixed,br_createtime,br_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{classId,jdbcType=BIGINT},#{swiperBannerId,jdbcType=BIGINT},#{url,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{isDefault,jdbcType=VARCHAR},#{isFixed,jdbcType=VARCHAR},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_home_navbar (br_id,br_name,br_picture,br_class_id,br_swiper_banner_id,br_url,br_type,br_orderby,br_order_man,br_order_woman,br_start_time,br_end_time,br_state,br_is_default,br_is_fixed,br_createtime,br_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{classId,jdbcType=BIGINT},#{swiperBannerId,jdbcType=BIGINT},#{url,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{orderMan,jdbcType=INTEGER},#{orderWoman,jdbcType=INTEGER},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{isDefault,jdbcType=VARCHAR},#{isFixed,jdbcType=VARCHAR},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert>
  
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_home_navbar
    <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -117,6 +144,8 @@
      <if test="url != null">br_url,</if>
      <if test="type != null">br_type,</if>
      <if test="orderby != null">br_orderby,</if>
      <if test="orderMan != null">br_order_man,</if>
      <if test="orderWoman != null">br_order_woman,</if>
      <if test="startTime != null">br_start_time,</if>
      <if test="endTime != null">br_end_time,</if>
      <if test="state != null">br_state,</if>
@@ -134,6 +163,8 @@
      <if test="url != null">#{url,jdbcType=VARCHAR},</if>
      <if test="type != null">#{type,jdbcType=VARCHAR},</if>
      <if test="orderby != null">#{orderby,jdbcType=INTEGER},</if>
      <if test="orderMan != null">#{orderMan,jdbcType=INTEGER},</if>
      <if test="orderWoman != null">#{orderWoman,jdbcType=INTEGER},</if>
      <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if>
      <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if>
      <if test="state != null">#{state,jdbcType=INTEGER},</if>
@@ -144,7 +175,7 @@
    </trim>
  </insert>
  
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar">update yeshi_ec_home_navbar set br_name = #{name,jdbcType=VARCHAR},br_picture = #{picture,jdbcType=VARCHAR},br_class_id = #{classId,jdbcType=BIGINT},br_swiper_banner_id = #{swiperBannerId,jdbcType=BIGINT},br_url = #{url,jdbcType=VARCHAR},br_type = #{type,jdbcType=VARCHAR},br_orderby = #{orderby,jdbcType=INTEGER},br_start_time = #{startTime,jdbcType=TIMESTAMP},br_end_time = #{endTime,jdbcType=TIMESTAMP},br_state = #{state,jdbcType=INTEGER},br_is_default = #{isDefault,jdbcType=VARCHAR},br_is_fixed = #{isFixed,jdbcType=VARCHAR},br_createtime = #{createtime,jdbcType=TIMESTAMP},br_updatetime = #{updatetime,jdbcType=TIMESTAMP} where br_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar">update yeshi_ec_home_navbar set br_name = #{name,jdbcType=VARCHAR},br_picture = #{picture,jdbcType=VARCHAR},br_class_id = #{classId,jdbcType=BIGINT},br_swiper_banner_id = #{swiperBannerId,jdbcType=BIGINT},br_url = #{url,jdbcType=VARCHAR},br_type = #{type,jdbcType=VARCHAR},br_orderby = #{orderby,jdbcType=INTEGER},br_order_man = #{orderMan,jdbcType=INTEGER},br_order_woman = #{orderWoman,jdbcType=INTEGER},br_start_time = #{startTime,jdbcType=TIMESTAMP},br_end_time = #{endTime,jdbcType=TIMESTAMP},br_state = #{state,jdbcType=INTEGER},br_is_default = #{isDefault,jdbcType=VARCHAR},br_is_fixed = #{isFixed,jdbcType=VARCHAR},br_createtime = #{createtime,jdbcType=TIMESTAMP},br_updatetime = #{updatetime,jdbcType=TIMESTAMP} where br_id = #{id,jdbcType=BIGINT}</update>
 
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar">update yeshi_ec_home_navbar
    <set>
@@ -155,6 +186,8 @@
      <if test="url != null">br_url=#{url,jdbcType=VARCHAR},</if>
      <if test="type != null">br_type=#{type,jdbcType=VARCHAR},</if>
      <if test="orderby != null">br_orderby=#{orderby,jdbcType=INTEGER},</if>
      <if test="orderMan != null">br_order_man=#{orderMan,jdbcType=INTEGER},</if>
      <if test="orderWoman != null">br_order_woman=#{orderWoman,jdbcType=INTEGER},</if>
      <if test="startTime != null">br_start_time=#{startTime,jdbcType=TIMESTAMP},</if>
      <if test="endTime != null">br_end_time=#{endTime,jdbcType=TIMESTAMP},</if>
      <if test="state != null">br_state=#{state,jdbcType=INTEGER},</if>
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SpecialMapper.xml
@@ -13,7 +13,10 @@
    <result column="b_params" property="params" jdbcType="VARCHAR"/>
    <result column="b_jump_login" property="jumpLogin" jdbcType="VARCHAR"/>
    <result column="b_orderby" property="orderby" jdbcType="INTEGER"/>
    <result column="b_order_man" property="orderMan" jdbcType="INTEGER"/>
    <result column="b_order_woman" property="orderWoman" jdbcType="INTEGER"/>
    <result column="b_state" property="state" jdbcType="BIGINT"/>
    <result column="b_sex" property="sex" jdbcType="INTEGER"/>
    <result column="b_show_type" property="showType" jdbcType="VARCHAR"/>
    <result column="b_remark" property="remark" jdbcType="VARCHAR"/>
    <result column="b_createtime" property="createtime" jdbcType="TIMESTAMP"/>
@@ -27,12 +30,12 @@
    </association>
    
  </resultMap>
  <sql id="Base_Column_List">b_id,b_name,b_card,b_card_id,b_main_picture,b_icon,b_sub_picture,b_jumpid,b_params,b_jump_login,b_orderby,b_state,b_show_type,b_remark,b_createtime,b_updatetime</sql>
  <sql id="Base_Column_List">b_id,b_name,b_card,b_card_id,b_main_picture,b_icon,b_sub_picture,b_jumpid,b_params,b_jump_login,b_orderby,b_order_man,b_order_woman,b_state,b_sex,b_show_type,b_remark,b_createtime,b_updatetime</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_special where b_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_special where b_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special (b_id,b_name,b_card,b_card_id,b_main_picture,b_icon,b_sub_picture,b_jumpid,b_params,b_jump_login,b_orderby,b_state,b_show_type,b_remark,b_createtime,b_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{card,jdbcType=VARCHAR},#{cardId,jdbcType=BIGINT},#{picture,jdbcType=VARCHAR},#{icon,jdbcType=VARCHAR},#{subPicture,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{jumpLogin,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{state,jdbcType=BIGINT},#{showType,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special (b_id,b_name,b_card,b_card_id,b_main_picture,b_icon,b_sub_picture,b_jumpid,b_params,b_jump_login,b_orderby,b_order_man,b_order_woman,b_state,b_sex,b_show_type,b_remark,b_createtime,b_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{card,jdbcType=VARCHAR},#{cardId,jdbcType=BIGINT},#{picture,jdbcType=VARCHAR},#{icon,jdbcType=VARCHAR},#{subPicture,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{jumpLogin,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{orderMan,jdbcType=INTEGER},#{orderWoman,jdbcType=INTEGER},#{state,jdbcType=BIGINT},#{sex,jdbcType=INTEGER},#{showType,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">b_id,</if>
@@ -46,7 +49,10 @@
      <if test="params != null">b_params,</if>
      <if test="jumpLogin != null">b_jump_login,</if>
      <if test="orderby != null">b_orderby,</if>
      <if test="orderMan != null">b_order_man,</if>
      <if test="orderWoman != null">b_order_woman,</if>
      <if test="state != null">b_state,</if>
      <if test="sex != null">b_sex,</if>
      <if test="showType != null">b_show_type,</if>
      <if test="remark != null">b_remark,</if>
      <if test="createtime != null">b_createtime,</if>
@@ -64,14 +70,17 @@
      <if test="params != null">#{params,jdbcType=VARCHAR},</if>
      <if test="jumpLogin != null">#{jumpLogin,jdbcType=VARCHAR},</if>
      <if test="orderby != null">#{orderby,jdbcType=INTEGER},</if>
      <if test="orderMan != null">#{orderMan,jdbcType=INTEGER},</if>
      <if test="orderWoman != null">#{orderWoman,jdbcType=INTEGER},</if>
      <if test="state != null">#{state,jdbcType=BIGINT},</if>
      <if test="sex != null">#{sex,jdbcType=INTEGER},</if>
      <if test="showType != null">#{showType,jdbcType=VARCHAR},</if>
      <if test="remark != null">#{remark,jdbcType=VARCHAR},</if>
      <if test="createtime != null">#{createtime,jdbcType=TIMESTAMP},</if>
      <if test="updatetime != null">#{updatetime,jdbcType=TIMESTAMP},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special">update yeshi_ec_special set b_name = #{name,jdbcType=VARCHAR},b_card = #{card,jdbcType=VARCHAR},b_card_id = #{cardId,jdbcType=BIGINT},b_main_picture = #{picture,jdbcType=VARCHAR},b_icon = #{icon,jdbcType=VARCHAR},b_sub_picture = #{subPicture,jdbcType=VARCHAR},b_jumpid = #{jumpDetail.id,jdbcType=BIGINT},b_params = #{params,jdbcType=VARCHAR},b_jump_login = #{jumpLogin,jdbcType=VARCHAR},b_orderby = #{orderby,jdbcType=INTEGER},b_state = #{state,jdbcType=BIGINT},b_show_type = #{showType,jdbcType=VARCHAR},b_remark = #{remark,jdbcType=VARCHAR},b_createtime = #{createtime,jdbcType=TIMESTAMP},b_updatetime = #{updatetime,jdbcType=TIMESTAMP} where b_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special">update yeshi_ec_special set b_name = #{name,jdbcType=VARCHAR},b_card = #{card,jdbcType=VARCHAR},b_card_id = #{cardId,jdbcType=BIGINT},b_main_picture = #{picture,jdbcType=VARCHAR},b_icon = #{icon,jdbcType=VARCHAR},b_sub_picture = #{subPicture,jdbcType=VARCHAR},b_jumpid = #{jumpDetail.id,jdbcType=BIGINT},b_params = #{params,jdbcType=VARCHAR},b_jump_login = #{jumpLogin,jdbcType=VARCHAR},b_orderby = #{orderby,jdbcType=INTEGER},b_order_man = #{orderMan,jdbcType=INTEGER},b_order_woman = #{orderWoman,jdbcType=INTEGER},b_state = #{state,jdbcType=BIGINT},b_show_type = #{showType,jdbcType=VARCHAR},b_remark = #{remark,jdbcType=VARCHAR},b_createtime = #{createtime,jdbcType=TIMESTAMP},b_updatetime = #{updatetime,jdbcType=TIMESTAMP} where b_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special">update yeshi_ec_special
    <set>
      <if test="name != null">b_name=#{name,jdbcType=VARCHAR},</if>
@@ -84,7 +93,10 @@
      <if test="params != null">b_params=#{params,jdbcType=VARCHAR},</if>
      <if test="jumpLogin != null">b_jump_login=#{jumpLogin,jdbcType=VARCHAR},</if>
      <if test="orderby != null">b_orderby=#{orderby,jdbcType=INTEGER},</if>
      <if test="orderMan != null">b_order_man=#{orderMan,jdbcType=INTEGER},</if>
      <if test="orderWoman != null">b_order_woman=#{orderWoman,jdbcType=INTEGER},</if>
      <if test="state != null">b_state=#{state,jdbcType=BIGINT},</if>
      <if test="sex != null">b_sex=#{orderby,jdbcType=INTEGER},</if>
      <if test="showType != null">b_show_type=#{showType,jdbcType=VARCHAR},</if>
      <if test="remark != null">b_remark=#{remark,jdbcType=VARCHAR},</if>
      <if test="createtime != null">b_createtime=#{createtime,jdbcType=TIMESTAMP},</if>
@@ -181,9 +193,27 @@
            AND IF(c.`cd_start_time` IS NULL,TRUE, c.`cd_start_time`<![CDATA[<=]]>NOW()) 
            AND IF(c.`cd_end_time` IS NULL,TRUE,c.`cd_end_time`<![CDATA[>=]]>NOW())
            AND pc.`sp_key` = #{placeKey}
            ORDER BY c.`cd_start_time` DESC
            LIMIT 1)c ON  sp.`b_card_id` = c.`cd_id`
        WHERE sp.`b_state` = 0
            <!-- 全部使用 -->
            <if test="sex == null">
                AND sp.`b_sex`= 120
        ORDER BY sp.`b_orderby`
            </if>
            <!-- 通用版 -->
            <if test="sex == 0">
                AND (sp.`b_sex`= 120 OR sp.`b_sex`= 0 OR sp.`b_sex` = 10 OR sp.`b_sex` = 20)
                ORDER BY sp.`b_orderby`
            </if>
            <!-- 女版 -->
            <if test="sex == 1">
                AND (sp.`b_sex`= 120 OR sp.`b_sex`= 1 OR sp.`b_sex` = 10 OR sp.`b_sex` = 12)
                ORDER BY sp.`b_order_woman`
            </if>
            <!-- 男版 -->
            <if test="sex == 2">
                AND (sp.`b_sex`= 120 OR sp.`b_sex`= 2 OR sp.`b_sex` = 20 OR sp.`b_sex` = 12)
                ORDER BY sp.`b_order_man`
            </if>
   </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/lable/QualityFactoryMapper.xml
@@ -1343,15 +1343,10 @@
     <select id="listFreeGoods" resultMap="GoodsResultMap">
         SELECT * FROM `yeshi_ec_quality_factory` h
        LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id`
        WHERE tb.`couponAmount` > 0 AND tb.`couponTotalCount` > 0
             AND IF(tb.`zkPrice` - tb.`couponStartFee`>=0, TRUE, FALSE)
             <!-- 在售价  209.9 -->
             AND tb.`zkPrice` <![CDATA[<=]]> 209.9
             <!--  券后价范围  0~9.9 -->
        WHERE tb.`couponAmount` > 0 AND tb.`couponTotalCount` <![CDATA[>]]> 0
      AND IF(tb.`zkPrice` - tb.`couponStartFee`<![CDATA[>=]]>0, TRUE, FALSE)
             AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[>]]> 0
             AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[<= ]]> 9.9
             <!-- 比例  20 -->
             AND  tb.`tkRate` <![CDATA[>=]]> 20
      AND  tb.`tkRate` * (tb.`zkPrice` - tb.`couponAmount`) *0.05*0.01 <![CDATA[>]]> 1
        ORDER BY h.sg_weight desc
        LIMIT ${start},${count}
    </select>
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/ShareGoodsServiceImpl.java
@@ -24,7 +24,9 @@
import com.yeshi.fanli.dao.mybatis.UserShareGoodsHistoryMapper;
import com.yeshi.fanli.dao.mybatis.share.PidUserMapper;
import com.yeshi.fanli.entity.bus.share.UserShareGoodsHistory;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinRecord;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserMoneyExtra;
import com.yeshi.fanli.entity.taobao.PidUser;
import com.yeshi.fanli.entity.taobao.TBPid;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
@@ -33,14 +35,18 @@
import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
import com.yeshi.fanli.exception.ShareGoodsException;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
import com.yeshi.fanli.exception.tlj.UserTaoLiJinRecordException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
import com.yeshi.fanli.service.inter.tlj.GoodsTaoLiJinRateService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinRecordService;
import com.yeshi.fanli.service.inter.user.TBPidService;
import com.yeshi.fanli.service.inter.user.UserAccountService;
import com.yeshi.fanli.service.inter.user.UserMoneyExtraService;
import com.yeshi.fanli.service.inter.user.UserShareGoodsRecordService;
import com.yeshi.fanli.util.AESUtil;
import com.yeshi.fanli.util.Constant;
@@ -90,6 +96,16 @@
    @Resource
    private CommonGoodsService commonGoodsService;
    @Resource
    private UserMoneyExtraService userMoneyExtraService;
    @Resource
    private GoodsTaoLiJinRateService goodsTaoLiJinRateService;
    @Resource
    private UserTaoLiJinRecordService userTaoLiJinRecordService;
    @Override
    public void addShareGoodsHistory(UserShareGoodsHistory history) {
@@ -548,6 +564,7 @@
        return taoBaoLink;
    }
    @Override
    public UserShareGoodsHistory getShareGoodsHistory(Long uid, Long auctionId) {
        return userShareGoodsHistoryMapper.selectByUidAndAuctionId(uid, auctionId);
@@ -643,4 +660,129 @@
        return tbLink;
    }
    @Override
    public TaoBaoLink getTaoLiJinLinkForBuy(Long uid, String specialId, Long auctionId) throws ShareGoodsException {
        if (uid == null || uid <= 0) {
            throw new ShareGoodsException(1, "用户ID不能为空");
        }
        if (auctionId == null || auctionId <= 0) {
            throw new ShareGoodsException(2, "商品ID不能为空");
        }
        // 用户剩余可以淘礼金验证
        UserMoneyExtra userMoneyExtra = userMoneyExtraService.selectByPrimaryKey(uid);
        if (userMoneyExtra == null ||  userMoneyExtra.getTlj() == null) {
            throw new ShareGoodsException(101, "红包余额不足");
        }
        TaoKeAppInfo app = new TaoKeAppInfo();
        app.setAppKey(TaoBaoConstant.TAOBAO_AUTH_APPKEY);
        app.setAppSecret(TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
        app.setPid(TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT);
        TaoBaoGoodsBrief goods = TaoKeApiUtil.specialConvertCoupon(auctionId, app);
        if (goods == null) {
            throw new ShareGoodsException(1, "");
        }
        String taoLiJinLink = null;
        try {
             UserTaoLiJinRecord createUserTaoLiJin = userTaoLiJinRecordService.createSelfBuyTaoLiJin(uid, 1, goods);
             taoLiJinLink = createUserTaoLiJin.getSendUrl();
        } catch (UserTaoLiJinRecordException e) {
            throw new ShareGoodsException(e.getCode(), e.getMsg());
        }
        TaoBaoLink taoBaoLink = new TaoBaoLink();
        taoBaoLink.setAuctionId(auctionId);
        taoBaoLink.setClickUrl(goods.getAuctionUrl());
        taoBaoLink.setCouponLink(taoLiJinLink);
        taoBaoLink.setGoods(goods);
        return taoBaoLink;
    }
    @Override
    public TaoBaoLink getTaoLiJinLinkForShare(Long uid, Long auctionId, String relationId) throws ShareGoodsException {
        if (uid == null || uid <= 0) {
            throw new ShareGoodsException(1, "用户ID不能为空");
        }
        if (auctionId == null || auctionId <= 0) {
            throw new ShareGoodsException(2, "商品ID不能为空");
        }
        TaoKeAppInfo info = new TaoKeAppInfo();
        if (!StringUtil.isNullOrEmpty(relationId)) {
            String pid = TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT;
            String appId = pid.split("_")[2];
            String adzoneId = pid.split("_")[3];
            TaoBaoUnionConfig taoBaoUnionConfig = taoBaoUnionConfigService.getConfigByAppIdCache(appId);
            info.setAdzoneId(adzoneId);
            info.setAppKey(taoBaoUnionConfig.getAppKey());
            info.setAppSecret(taoBaoUnionConfig.getAppSecret());
            info.setPid(pid);
        } else {
            TBPid tbPid = tbPidService.getTBPid(uid, PidUser.TYPE_SHARE_GOODS);
            if (tbPid == null) {
                throw new ShareGoodsException(3, "获取推广位失败");
            }
            String appId = tbPid.getPid().split("_")[2];
            TaoBaoUnionConfig taoBaoUnionConfig = taoBaoUnionConfigService.getConfigByAppIdCache(appId);
            String adzoneId = tbPid.getPid().split("_")[3];
            info.setAdzoneId(adzoneId);
            info.setAppKey(taoBaoUnionConfig.getAppKey());
            info.setAppSecret(taoBaoUnionConfig.getAppSecret());
            info.setPid(tbPid.getPid());
        }
        TaoBaoGoodsBrief goods = null;
        try {
            goods = TaoKeApiUtil.searchGoodsDetail(auctionId, info);
        } catch (TaobaoGoodsDownException e) {
            throw new ShareGoodsException(4, "商品已下架");
        } finally {
        }
        if (goods == null) {
            throw new ShareGoodsException(5, "获取商品详情失败");
        }
        if (StringUtil.isNullOrEmpty(goods.getCouponLink()) && !goods.getAuctionUrl().contains("s.click.taobao.com")) {
            TaoBaoUnionConfig taoBaoUnionConfig = taoBaoUnionConfigService
                    .getConfigByAppIdCache(info.getPid().split("_")[2]);
            TaoBaoGoodsBrief taoBaoLink = TaoKeApiUtil.specialConvertCoupon(auctionId, info);
            if (taoBaoLink == null) {
                throw new ShareGoodsException(201, "商品转链失败");
            }
            goods.setCouponLink(taoBaoLink.getCouponLink());
            goods.setAuctionUrl(taoBaoLink.getAuctionUrl());
        }
        if (!StringUtil.isNullOrEmpty(relationId)) {
            if (!StringUtil.isNullOrEmpty(goods.getAuctionUrl()))
                goods.setAuctionUrl(goods.getAuctionUrl() + "&relationId=" + relationId);
            if (!StringUtil.isNullOrEmpty(goods.getCouponLink()))
                goods.setCouponLink(goods.getCouponLink() + "&relationId=" + relationId);
        }
        // 保存商品详情
        // 创建淘口令
        TaoBaoLink tbLink = new TaoBaoLink();
        tbLink.setAuctionId(goods.getAuctionId());
        tbLink.setClickUrl(goods.getAuctionUrl());
        tbLink.setCouponLink(goods.getCouponLink());
        tbLink.setGoods(goods);
        // 存储分享商品的信息,用于加快分享网页接口请求速度
        if (Constant.IS_OUTNET)
            redisManager.saveTaoBaoGoodsBriefTemp(goods);
        return tbLink;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/ShareGoodsTextTemplateServiceImpl.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.service.impl.goods;
import java.math.BigDecimal;
import java.util.Date;
import javax.annotation.Resource;
@@ -7,7 +8,6 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.yeshi.utils.BigDecimalUtil;
import org.yeshi.utils.HttpUtil;
import com.yeshi.fanli.dao.mybatis.goods.ShareGoodsTextTemplateMapper;
import com.yeshi.fanli.entity.goods.ShareGoodsTextTemplate;
@@ -15,11 +15,9 @@
import com.yeshi.fanli.exception.goods.ShareGoodsTextTemplateException;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.goods.ShareGoodsTextTemplateService;
import com.yeshi.fanli.util.AESUtil;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.service.inter.tlj.GoodsTaoLiJinRateService;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
/**
 * 分享商品模板
@@ -35,6 +33,9 @@
    @Resource
    private ConfigService configService;
    @Resource
    private GoodsTaoLiJinRateService goodsTaoLiJinRateService;
    @Override
    public void saveCommonTemplate(Long uid, String template) throws ShareGoodsTextTemplateException {
@@ -67,7 +68,9 @@
    @Transactional
    @Override
    public void saveCouponTemplate(Long uid, String template) throws ShareGoodsTextTemplateException {
        isCouponTemplateRight(template);
        // 格式验证
        isTaoLiJinTemplateRight(template);
        ShareGoodsTextTemplate old = shareGoodsTextTemplateMapper.selectByUid(uid);
        if (old != null) {
            ShareGoodsTextTemplate update = new ShareGoodsTextTemplate();
@@ -82,6 +85,29 @@
            textTemplate.setUid(uid);
            shareGoodsTextTemplateMapper.insertSelective(textTemplate);
        }
    }
    @Transactional
    @Override
    public void saveTaoLiJinTemplate(Long uid, String template) throws ShareGoodsTextTemplateException {
        isCouponTemplateRight(template);
        ShareGoodsTextTemplate old = shareGoodsTextTemplateMapper.selectByUid(uid);
        if (old != null) {
            ShareGoodsTextTemplate update = new ShareGoodsTextTemplate();
            update.setId(old.getId());
            update.setShareTaoLiJinTextTemplate(template);
            update.setUpdateTime(new Date());
            shareGoodsTextTemplateMapper.updateByPrimaryKeySelective(update);
        } else {
            ShareGoodsTextTemplate textTemplate = new ShareGoodsTextTemplate();
            textTemplate.setCreateTime(new Date());
            textTemplate.setShareTaoLiJinTextTemplate(template);
            textTemplate.setUid(uid);
            shareGoodsTextTemplateMapper.insertSelective(textTemplate);
        }
    }
@@ -90,6 +116,15 @@
        ShareGoodsTextTemplate template = shareGoodsTextTemplateMapper.selectByUid(uid);
        if (template != null)
            return template.getShareCouponTextTemplate();
        return null;
    }
    @Override
    public String getTaoLiJinTemplate(Long uid) {
        ShareGoodsTextTemplate template = shareGoodsTextTemplateMapper.selectByUid(uid);
        if (template != null)
            return template.getShareTaoLiJinTextTemplate();
        return null;
    }
@@ -115,9 +150,31 @@
            throw new ShareGoodsTextTemplateException(1, "模板格式有误");
    }
    @Override
    public void isTaoLiJinTemplateRight(String template) throws ShareGoodsTextTemplateException {
        String[] keys = new String[] { "{标题}", "{店铺类型}", "{商品原价}", "{优惠券面额}", "{淘礼金面额}", "{优惠券价}", "{月销量}", "{领券短链}", "{淘口令}" };
        int keysCount = 0;
        for (String key : keys)
            if (template != null && template.contains(key))
                keysCount++;
        if (keysCount == 0)
            throw new ShareGoodsTextTemplateException(1, "模板格式有误");
    }
    @Override
    public String createContentByTemplate(String template, Long uid, TaoBaoGoodsBrief goods, String token,
            String shortLink, boolean hasCoupon) {
            String shortLink, boolean hasCoupon, String from) {
        if (!StringUtil.isNullOrEmpty(from) && "taolijin".equals(from)) {
            BigDecimal spreadMoney = goodsTaoLiJinRateService.getGoodsSpreadMoney(goods);
            return template.replace("{标题}", goods.getTitle()).replace("{商品原价}", BigDecimalUtil.getWithNoZera( goods.getZkPrice()).toString())
                    .replace("{月销量}", TaoBaoUtil.getSaleCount(goods.getBiz30day())).replace("{领券短链}", shortLink)
                    .replace("{淘口令}", token).replace("{优惠券面额}", BigDecimalUtil.getWithNoZera(goods.getCouponAmount()).toString())
                    .replace("{淘礼金面额}", BigDecimalUtil.getWithNoZera(spreadMoney).toString()).replace("{优惠券价}", BigDecimalUtil.getWithNoZera( TaoBaoUtil.getAfterUseCouplePrice(goods)).toString())
                    .replace("{店铺类型}", goods.getUserType() == 1 ? "天猫价" : "淘宝价");
        }
        if (!hasCoupon) {
            return template.replace("{标题}", goods.getTitle()).replace("{商品原价}",  BigDecimalUtil.getWithNoZera(goods.getZkPrice()).toString())
@@ -158,4 +215,16 @@
        }
    }
    @Override
    public void resetTaoLijinTemplate(Long uid) {
        ShareGoodsTextTemplate template = shareGoodsTextTemplateMapper.selectByUid(uid);
        if (template != null) {
            ShareGoodsTextTemplate update = new ShareGoodsTextTemplate();
            update.setId(template.getId());
            update.setShareTaoLiJinTextTemplate("");
            update.setUpdateTime(new Date());
            shareGoodsTextTemplateMapper.updateByPrimaryKeySelective(update);
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/FloatADServiceImpl.java
@@ -93,6 +93,10 @@
                record.setState(0);
            }
            
            Integer type = record.getType();
            if (type == null) {
                record.setType(0);
            }
            record.setOrder(maxOrder + 1);
            record.setCreateTime(new Date());
            record.setUpdateTime(new Date());
@@ -113,6 +117,7 @@
                record.setPicture(resultObj.getPicture());
            }
            
            record.setType(resultObj.getType());
            record.setOrder(resultObj.getOrder());
            record.setCreateTime(resultObj.getCreateTime());
            record.setUpdateTime(new Date());
@@ -258,8 +263,8 @@
    }
    @Override
    public FloatAD getEffectiveFloatAD(String position) {
        FloatAD floatAD = floatADMapper.getEffectiveFloatAD(position);
    public FloatAD getEffectiveFloatAD(String position, Integer type) {
        FloatAD floatAD = floatADMapper.getEffectiveFloatAD(position, type);
        if (floatAD != null) {
            JumpDetailV2 jumpDetail = floatAD.getJumpDetail();
            
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/HomeNavbarServiceImpl.java
@@ -309,12 +309,14 @@
    
    
    @Override
    @Cacheable(value = "configCache", key = "'listQueryDefaultNavbar'")
    public List<HomeNavbar> listQueryDefaultNavbar() {
        return homeNavbarMapper.listQueryDefaultNavbar();
    @Cacheable(value = "configCache", key = "'listQueryDefaultNavbar-'+#sex")
    public List<HomeNavbar> listQueryDefaultNavbar(Integer sex) {
        return homeNavbarMapper.listQueryDefaultNavbar(sex);
    }
    
    
    @Override
    @Cacheable(value = "configCache", key = "'listQueryFixedNavbar'")
    public List<HomeNavbar> listQueryFixedNavbar() {
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/HomeNavbarUserServiceImpl.java
@@ -31,15 +31,16 @@
    @Resource
    private UserInfoExtraService userInfoExtraService;
    @Override
    public List<HomeNavbar> listEffectiveNavbar(Long uid, String device) {
    public List<HomeNavbar> listEffectiveNavbar(Long uid, String device, Integer sex) {
        List<HomeNavbar> list = new ArrayList<HomeNavbar>();
        if (sex == null || sex == 0) {
        if (uid != null || !StringUtil.isNullOrEmpty(device)) {
            if (uid != null) {
                device = null;
            }
            // 自定义导航
            List<HomeNavbarUser> listUserNavbar = homeNavbarUserMapper.listEffectiveNavbars(uid, device);
            
@@ -80,7 +81,16 @@
        }
        if (list.size() == 0) {
            list = homeNavbarService.listQueryDefaultNavbar();
                List<HomeNavbar> listDefault = homeNavbarService.listQueryDefaultNavbar(sex);
                if (listDefault != null) {
                    list.addAll(listDefault);
                }
            }
        } else {
            List<HomeNavbar> listDefault = homeNavbarService.listQueryDefaultNavbar(sex);
            if (listDefault != null) {
                list.addAll(listDefault);
            }
        }
        return list;
    }
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java
@@ -30,7 +30,6 @@
import com.yeshi.fanli.util.VersionUtil;
import net.sf.json.JSONObject;
import sun.security.krb5.internal.ccache.CCacheInputStream;
@Service
public class SpecialServiceImpl implements SpecialService {
@@ -317,24 +316,24 @@
    }
    @Override
    @Cacheable(value = "configCache", key = "'listBySystemAndCard-'+#card+'-'+#systemId")
    @Cacheable(value = "specialCache", key = "'listBySystemAndCard-'+#card+'-'+#systemId")
    public List<Special> listBySystemAndCard(String card, Long systemId) {
        return specialMapper.listBySystemAndCard(card, systemId);
    }
    @Override
    @Cacheable(value = "configCache", key = "'listPageBySystemAndCard-'+#start+'-'+#count+'-'+#card+'-'+#systemId")
    @Cacheable(value = "specialCache", key = "'listPageBySystemAndCard-'+#start+'-'+#count+'-'+#card+'-'+#systemId")
    public List<Special> listPageBySystemAndCard(long start, int count, String card, Long systemId) {
        return specialMapper.listPageBySystemAndCard(start, count, card, systemId);
    }
    @Override
    @Cacheable(value = "configCache", key = "'listCacheSpecialToIndex'+#acceptData.platform+'-'+#acceptData.version")
    public JSONObject listCacheSpecialToIndex(AcceptData acceptData) throws Exception {
    @Cacheable(value = "specialCache", key = "'listCacheSpecialToIndex'+#acceptData.platform+'-'+#acceptData.version+'-'+#sex")
    public JSONObject listCacheSpecialToIndex(AcceptData acceptData, Integer sex) throws Exception {
        // 首页-5圆形2排区域
        JSONObject arcMap = new JSONObject();
        List<Special> listArc = specialMapper.listByPlaceKey("index_arc");
        List<Special> listArc = specialMapper.listByPlaceKey("index_arc", sex);
        if (listArc == null) {
            listArc = new ArrayList<Special>();
        } else if (listArc.size() > 0) {
@@ -368,7 +367,7 @@
                && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()))) {
            // 如果IOS当前版本处于审核状态就不返回
        } else {
            listActivity = specialMapper.listByPlaceKey("index_activity");
            listActivity = specialMapper.listByPlaceKey("index_activity", null);
        }
        if (listActivity == null) {
@@ -387,7 +386,7 @@
        // 首页-方形专题(品牌券、母婴...)
        JSONObject blockJsonMap = new JSONObject();
        List<Special> listBlock = specialMapper.listByPlaceKey("index_block");
        List<Special> listBlock = specialMapper.listByPlaceKey("index_block", sex);
        if (listBlock == null) {
            listBlock = new ArrayList<Special>();
        } else if (listBlock.size() > 0) {
@@ -397,6 +396,7 @@
                blockJsonMap.put("bottomPicture", special.getBottomPicture());
            }
        }
        // 品牌券
        // >=1.5.40后的版本可以用
@@ -422,7 +422,7 @@
    @Override
    public List<Special> listByPlaceKey(String placeKey) {
        return specialMapper.listByPlaceKey(placeKey);
        return specialMapper.listByPlaceKey(placeKey, null);
    }
    /**
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgOtherDetailServiceImpl.java
@@ -27,7 +27,6 @@
    @Override
    public void addMsgOtherDetail(MsgOtherDetail detail) throws MsgOtherDetailException {
        if (detail.getType() == MsgTypeOtherTypeEnum.couponMianDan
                || detail.getType() == MsgTypeOtherTypeEnum.couponReward
                || detail.getType() == MsgTypeOtherTypeEnum.couponWelfareMianDan) {
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java
@@ -282,4 +282,18 @@
        }
    }
//    @Override
//    public void taoLiJinGet(UserSystemCoupon coupon, int percent) {
//        if (coupon == null || coupon.getUid() == null)
//            return;
//        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createRewardCouponGet(getLeftDay(coupon),
//                coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
//        try {
//            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
//                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, "返利已到账后再奖励返利的" + percent + "%"));
//        } catch (MsgOtherDetailException e) {
//            e.printStackTrace();
//        }
//    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserCustomSettingsServiceImpl.java
@@ -39,6 +39,8 @@
            mineTypeNum = UserSettingTypeEnum.noShareRecordAndStorage;
        } else if (type.equals(UserSettingTypeEnum.noInvitationBonus.name())) {
            mineTypeNum = UserSettingTypeEnum.noInvitationBonus;
        } else if (type.equals(UserSettingTypeEnum.openSpreadHongBao.name())) {
            mineTypeNum = UserSettingTypeEnum.openSpreadHongBao;
        } else {
            throw new UserCustomSettingsException(1, "参数类型不匹配");    
        }
@@ -113,6 +115,8 @@
                    userSettingsVO.setNoShareRecordAndStorage(state);
                } else if (typeEnum.equals(UserSettingTypeEnum.noInvitationBonus)){
                    userSettingsVO.setNoInvitationBonus(state);
                } else if (typeEnum.equals(UserSettingTypeEnum.openSpreadHongBao)){
                    userSettingsVO.setOpenSpreadHongBao(state);
                } 
                
            }
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/ShareGoodsService.java
@@ -110,4 +110,24 @@
     */
    public TaoBaoLink getTaoBaoLink(Long uid, Long auctionId, String pid) throws ShareGoodsException;
    /**
     * 淘礼金领取链接
     * @param uid
     * @param specialId
     * @param auctionId
     * @return
     * @throws ShareGoodsException
     */
    public TaoBaoLink getTaoLiJinLinkForBuy(Long uid, String specialId, Long auctionId) throws ShareGoodsException;
    /**
     * 淘礼金 链接
     * @param uid
     * @param auctionId
     * @param relationId
     * @return
     * @throws ShareGoodsException
     */
    public TaoBaoLink getTaoLiJinLinkForShare(Long uid, Long auctionId, String relationId) throws ShareGoodsException;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/ShareGoodsTextTemplateService.java
@@ -63,7 +63,8 @@
     * @param goods
     * @return
     */
    public String createContentByTemplate(String template, Long uid, TaoBaoGoodsBrief goods,String token,String shortLink, boolean hasCoupon);
    public String createContentByTemplate(String template, Long uid, TaoBaoGoodsBrief goods,String token,
            String shortLink, boolean hasCoupon, String from);
    /**
     * 还原普通模板
@@ -78,4 +79,32 @@
     * @param uid
     */
    public void resetCouponTemplate(Long uid);
    /**
     * 淘礼金模板是否正确
     * @param template
     * @throws ShareGoodsTextTemplateException
     */
    public void isTaoLiJinTemplateRight(String template) throws ShareGoodsTextTemplateException;
    /**
     * 保存淘礼金模板
     * @param uid
     * @param template
     * @throws ShareGoodsTextTemplateException
     */
    public void saveTaoLiJinTemplate(Long uid, String template) throws ShareGoodsTextTemplateException;
    /**
     * 还原淘礼金模板
     * @param uid
     */
    public void resetTaoLijinTemplate(Long uid);
    /**
     * 淘礼金模板
     * @param uid
     * @return
     */
    public String getTaoLiJinTemplate(Long uid);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/FloatADService.java
@@ -56,7 +56,7 @@
     * 查询有效的悬浮大图
     * @return
     */
    public FloatAD getEffectiveFloatAD(String position);
    public FloatAD getEffectiveFloatAD(String position, Integer type);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/HomeNavbarService.java
@@ -75,7 +75,7 @@
     * 默认导航栏
     * @return
     */
    public List<HomeNavbar> listQueryDefaultNavbar();
    public List<HomeNavbar> listQueryDefaultNavbar(Integer sex);
    /**
     *  固定的导航栏
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/HomeNavbarUserService.java
@@ -12,7 +12,7 @@
     * 查询导航栏
     * @return
     */
    public List<HomeNavbar> listEffectiveNavbar(Long uid, String device);
    public List<HomeNavbar> listEffectiveNavbar(Long uid, String device, Integer sex);
    /**
     * 保存用户自定义
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SpecialService.java
@@ -86,7 +86,7 @@
     * @return
     * @throws Exception
     */
    public JSONObject listCacheSpecialToIndex(AcceptData acceptData) throws Exception;
    public JSONObject listCacheSpecialToIndex(AcceptData acceptData, Integer sex) throws Exception;
    /**
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java
@@ -767,13 +767,13 @@
        tg.setSalesType(1);
        // 测试使用
        // tg.setSalesType(Math.random() > 0.5 ? tg.getSalesType() : 3);
        if(Constant.IS_TEST)
        {
         List<ClientTextStyleVO> labels = new ArrayList<>();
         labels.add(new ClientTextStyleVO("标签内容", "#F14242"));
         labels.add(new ClientTextStyleVO("标签内容", "#00FF00"));
         tg.setLabels(labels);
        }
//        if(Constant.IS_TEST)
//        {
//         List<ClientTextStyleVO> labels = new ArrayList<>();
//         labels.add(new ClientTextStyleVO("标签内容", "#F14242"));
//         labels.add(new ClientTextStyleVO("标签内容", "#00FF00"));
//         tg.setLabels(labels);
//        }
        return tg;
    }
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java
@@ -12,6 +12,7 @@
import com.taobao.api.ApiException;
import com.yeshi.fanli.dto.taobao.TaoBaoShopInfoDTO;
import com.yeshi.fanli.dto.taobao.TaoLiJinDTO;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinReport;
import com.yeshi.fanli.entity.taobao.RelateGoods;
import com.yeshi.fanli.entity.taobao.SearchFilter;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
@@ -1946,9 +1947,8 @@
    }
    // 淘礼金创建
    public static TaoLiJinDTO createTaoLiJin(Long auctionId, String name, BigDecimal perface, int totalNum,
            int useDayLimit, Date sendStartTime, Date sendEndTime, Date useStartTime) {
            Date sendStartTime, Date sendEndTime, Date useStartTime, Date useEndTime) {
        Map<String, String> map = new HashMap<>();
        map.put("method", "taobao.tbk.dg.vegas.tlj.create");
        map.put("adzone_id", TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT.split("_")[3]);
@@ -1959,16 +1959,25 @@
        map.put("security_switch", "false");
        map.put("per_face", perface.toString());
        map.put("send_start_time", TimeUtil.getGernalTime(sendStartTime.getTime(), "yyyy-MM-dd HH:mm:ss"));
        if(sendEndTime != null)
        map.put("send_end_time", TimeUtil.getGernalTime(sendEndTime.getTime(), "yyyy-MM-dd HH:mm:ss"));
        map.put("use_end_time", useDayLimit + "");
        map.put("use_end_time_mode", "1");
        map.put("use_start_time", TimeUtil.getGernalTime(useStartTime.getTime(), "yyyy-MM-dd HH:mm:ss"));
        if(useEndTime != null) {
            map.put("use_end_time", TimeUtil.getGernalTime(useEndTime.getTime(), "yyyy-MM-dd"));
            map.put("use_end_time_mode", "2");
        }
        if(useStartTime != null)
            map.put("use_start_time", TimeUtil.getGernalTime(useStartTime.getTime(), "yyyy-MM-dd"));
        TaoKeAppInfo app = new TaoKeAppInfo();
        app.setAppKey(TaoBaoConstant.TAOBAO_AUTH_APPKEY);
        app.setAppSecret(TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
        try {
            JSONObject json = TaoKeBaseUtil.baseRequest(map, app);
            String result = TaoKeBaseUtil.baseRequestForThreeTimes(map, app);
            JSONObject json = JSONObject.fromObject(result);
            System.out.println(json);
            JSONObject root = json.optJSONObject("tbk_dg_vegas_tlj_create_response");
            if (root != null && root.optJSONObject("result") != null) {
@@ -1980,28 +1989,58 @@
                    return dto;
                }
            }
        } catch (TaoKeApiException e) {
            e.printStackTrace();
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
        return null;
    }
    // lCj1Alo8b9L4Ed6yJLq6iqJ7%2BkHL3AEW
    public static void getTaoLiJinEffective() {
    // 淘礼金报告
    public static UserTaoLiJinReport getTaoLiJinEffective(String rightsId) {
        Map<String, String> map = new HashMap<>();
        map.put("method", "taobao.tbk.dg.vegas.tlj.instance.report");
        map.put("rights_id", "ZrIIvF/nd7SlL5Bg59eTK6J7+kHL3AEW");
        map.put("rights_id", rightsId);
        TaoKeAppInfo app = new TaoKeAppInfo();
        app.setAppKey(TaoBaoConstant.TAOBAO_AUTH_APPKEY);
        app.setAppSecret(TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
        String json = TaoKeBaseUtil.baseRequestForThreeTimes(map, app);
        try {
            String result = TaoKeBaseUtil.baseRequestForThreeTimes(map, app);
            JSONObject json = JSONObject.fromObject(result);
        System.out.println(json);
    }
            JSONObject root = json.optJSONObject("tbk_dg_vegas_tlj_instance_report_response");
            if (root != null && root.optJSONObject("result") != null) {
                if (root.optJSONObject("result").optBoolean("success")) {
                    JSONObject modelJson = root.optJSONObject("result").optJSONObject("model");
                    if (modelJson != null && modelJson.size() > 0) {
                        UserTaoLiJinReport report = new UserTaoLiJinReport();
                        report.setId(rightsId);
                        report.setUnfreezeAmount(new BigDecimal(modelJson.optString("unfreeze_amount")));
                        report.setUnfreezeNum(modelJson.optInt("unfreeze_num"));
                        report.setRefundAmount(new BigDecimal(modelJson.optString("refund_amount")));
                        report.setRefundNum(modelJson.optInt("refund_num"));
                        report.setAlipayAmount(new BigDecimal(modelJson.optString("alipay_amount")));
                        report.setUseAmount(new BigDecimal(modelJson.optString("use_amount")));
                        report.setUseNum(modelJson.optInt("use_num"));
                        report.setWinAmount(new BigDecimal(modelJson.optString("win_amount")));
                        report.setWinNum(modelJson.optInt("win_num"));
                        report.setPreCommissionAmount(new BigDecimal(modelJson.optString("pre_commission_amount")));
                        return report;
                    }
                }
            }
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
        return null;
    }
}
class QuanInfo {
fanli/src/main/java/com/yeshi/fanli/vo/user/UserSettingsVO.java
@@ -16,6 +16,10 @@
    private Integer noShareRecordAndStorage;
    // 不看邀请拿奖金
    private Integer noInvitationBonus;
    // 开启推广红包
    private Integer openSpreadHongBao;
    public Integer getCancelNotice() {
        return cancelNotice;
@@ -57,4 +61,12 @@
        this.noInvitationBonus = noInvitationBonus;
    }
    public Integer getOpenSpreadHongBao() {
        return openSpreadHongBao;
    }
    public void setOpenSpreadHongBao(Integer openSpreadHongBao) {
        this.openSpreadHongBao = openSpreadHongBao;
    }
}