yujian
2019-04-08 1da17d215d48e3e3aa9e8d7a3ef526904764f408
1.5.3部分需求 提交
58个文件已修改
22个文件已添加
4706 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/AuthCallBackController.java 64 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/ClientJspController.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/HomeNavbarAdminController.java 218 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/apph5/AppH5QualityGoodsController.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/ConfigController.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/GoodsClassController.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/HomeNavbarController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/InviteGetMoneyController.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/RecommendController.java 250 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/SMSController.java 117 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserAccountController.java 209 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserAuthController.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserCouponController.java 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserInfoController.java 254 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java 159 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserOrderController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/ThreeSaleMapper.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/UserInfoMapper.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/HomeNavbarMapper.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/SpecialPlaceMapper.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/SwiperPictureMapper.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/lable/QualityFactoryMapper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/taobao/TaoBaoUnionAuthRecordMapper.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserExtraTaoBaoInfoMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserInviteRecordMapper.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserLotteryRecordMapper.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/HomeNavbar.java 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/Special.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/SpecialPlace.java 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserExtraTaoBaoInfo.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserInviteRecord.java 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserLotteryRecord.java 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserSystemCoupon.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/SpecialPlaceException.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/homemodule/HomeNavbarException.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/user/UserExtraTaoBaoInfoException.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/user/UserInfoException.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/user/UserLotteryRecordException.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/ThreeSaleMapper.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/HomeNavbarMapper.xml 146 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SpecialPlaceMapper.xml 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SwiperPictureMapper.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/lable/QualityFactoryMapper.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/taobao/TaoBaoUnionAuthRecordMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserExtraTaoBaoInfoMapper.xml 211 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserInviteRecordMapper.xml 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserLotteryRecordMapper.xml 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/HomeNavbarServiceImpl.java 255 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialPlaceImpl.java 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SwiperPictureServiceImpl.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/ThreeSaleSerivceImpl.java 82 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/lable/QualityGoodsServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoUnionAuthRecordServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/SMSServiceImpl.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountServiceImpl.java 206 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserExtraTaoBaoInfoServiceImpl.java 208 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java 140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoServiceImpl.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInviteRecordServiceImpl.java 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserLotteryRecordServiceImpl.java 206 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/HomeNavbarService.java 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SpecialPlaceService.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SpecialService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SwiperPictureService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/hongbao/ThreeSaleSerivce.java 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/lable/QualityGoodsService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/taobao/TaoBaoUnionAuthRecordService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/SMSService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserAccountService.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserExtraTaoBaoInfoService.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInfoExtraService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInfoService.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInviteRecordService.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserLotteryRecordService.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/Constant.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/msg/ActivityInfo.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/msg/UserMsgCenter.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/AuthCallBackController.java
@@ -14,6 +14,7 @@
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.taobao.TaoBaoUnionAuthRecord;
import com.yeshi.fanli.exception.user.UserExtraTaoBaoInfoException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionAuthRecordService;
import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
@@ -89,14 +90,56 @@
                        Constant.TAOBAO_AUTH_APPSECRET);// 渠道ID
                if (StringUtil.isNullOrEmpty(relationId))
                    LogHelper.test(uid + "渠道备案失败");
                userExtraTaoBaoInfoService.addRelationId(uid, relationId, taoBaoUid, true);
            } else {
                try {
                    userExtraTaoBaoInfoService.addRelationId(uid, relationId, taoBaoUid,nickName, true);
                } catch (UserExtraTaoBaoInfoException e) {
                    LogHelper.test(e.getMsg());
                    errCode = 5;
                }
            } else if ("zigou".equalsIgnoreCase(source))  {
                String specialId = TaoKeApiUtil.getSpecialId(accessToken, Constant.TAOBAO_AUTH_APPKEY,
                        Constant.TAOBAO_AUTH_APPSECRET);
                if (StringUtil.isNullOrEmpty(specialId))
                    LogHelper.test(uid + "会员备案失败");
                userExtraTaoBaoInfoService.addSpecialId(uid, specialId, taoBaoUid, true);
                try {
                    userExtraTaoBaoInfoService.addSpecialId(uid, specialId, taoBaoUid, nickName, true);
                } catch (UserExtraTaoBaoInfoException e) {
                    LogHelper.test(e.getMsg());
                    errCode = 5;
                }
            } else if ("bind".equalsIgnoreCase(source)) {
                boolean bindInfo = true;
                // 绑定淘宝:V1.5.3
                String relationId = TaoKeApiUtil.getRelationId(accessToken, Constant.TAOBAO_AUTH_APPKEY, Constant.TAOBAO_AUTH_APPSECRET);// 渠道ID
                if (StringUtil.isNullOrEmpty(relationId)) {
                    LogHelper.test(uid + "渠道备案失败");
                    bindInfo = false;
                }
                String specialId = null;
                if(bindInfo) {
                    specialId = TaoKeApiUtil.getSpecialId(accessToken, Constant.TAOBAO_AUTH_APPKEY,
                            Constant.TAOBAO_AUTH_APPSECRET);
                    if (StringUtil.isNullOrEmpty(specialId)) {
                        LogHelper.test(uid + "会员备案失败");
                        bindInfo = false;
                    }
                }
                if (!bindInfo) {
                    errCode = 5;// 信息获取不全
                } else {
                    try {
                        userExtraTaoBaoInfoService.saveUserTaoBaoInfo(uid, relationId, specialId, taoBaoUid, nickName, true);
                    } catch (UserExtraTaoBaoInfoException e) {
                        LogHelper.test(e.getMsg());
                        errCode = 6;
                    }
                }
            }
            if (!StringUtil.isNullOrEmpty(nickName))
                try {
@@ -111,6 +154,7 @@
            record.setTaoBaoUserNick(nickName);
            record.setCreateTime(new Date());
            taoBaoUnionAuthRecordService.addAuthRecord(record);
        } catch (Exception e) {
            errCode = 4;
            try {
@@ -123,15 +167,21 @@
        try {
            if (errCode == 0)// 成功
            {
                if ("share".equalsIgnoreCase(source))
                if ("share".equalsIgnoreCase(source)) {
                    response.sendRedirect("http://apph5.yeshitv.com/apppage/flq_bonusState.html?code=0");
                else
                } else if ("zigou".equalsIgnoreCase(source)) {
                    response.sendRedirect("http://apph5.yeshitv.com/apppage/flq_rebateState.html?code=0");
                } else if ("bind".equalsIgnoreCase(source)) {
                    response.getWriter().print("<script>yestv.toast(\"恭喜你,淘宝绑定成功\");yestv.finishPage();</script>");
                }
            } else {// 失败
                if ("share".equalsIgnoreCase(source))
                if ("share".equalsIgnoreCase(source)) {
                    response.sendRedirect("http://apph5.yeshitv.com/apppage/flq_bonusState.html?code=1");
                else
                } else if ("zigou".equalsIgnoreCase(source)) {
                    response.sendRedirect("http://apph5.yeshitv.com/apppage/flq_rebateState.html?code=1");
                } else if ("bind".equalsIgnoreCase(source)) {
                    response.getWriter().print("<script>yestv.toast(\"抱歉,淘宝绑定失败\");yestv.finishPage();</script>");
                }
            }
        } catch (Exception e) {
fanli/src/main/java/com/yeshi/fanli/controller/ClientJspController.java
@@ -55,6 +55,7 @@
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
import com.yeshi.fanli.service.inter.user.ShamUserService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.service.inter.user.UserInviteRecordService;
import com.yeshi.fanli.util.AESUtil;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.GsonUtil;
@@ -114,6 +115,9 @@
    @Resource
    private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
    @Resource
    private UserInviteRecordService userInviteRecordService;
    @Resource
    private RedisManager redisManager;
@@ -283,20 +287,9 @@
            // request.setAttribute("error", "1");
            return "redirect:" + down;
        }
        if (code == null) {// 用户取消了登陆!
            return "redirect:" + down;
        }
        UserInfo inviter = userInfoService.getUserById(Long.parseLong(uid));
        if (inviter == null) {// 没得这个人
            return "redirect:" + down;
        }
        boolean b = userInfoService.inviteWXUserInfo(code, inviter);
        if (!b) { // 绑定失败
            // request.setAttribute("msg", "非常遗憾,你已领取过红包,请勿再次领取。");
            return "redirect:" + down;
        }
        // 保存邀请记录
        userInviteRecordService.saveInviteRecord(code, uid);
        return "redirect:" + down;
    }
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/HomeNavbarAdminController.java
@@ -2,23 +2,21 @@
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.yeshi.utils.JsonUtil;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar;
import com.yeshi.fanli.entity.bus.homemodule.SuperHomeNavbar;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.exception.homemodule.HomeNavbarException;
import com.yeshi.fanli.service.AdminUserService;
import com.yeshi.fanli.service.inter.homemodule.HomeNavbarService;
import com.yeshi.fanli.service.inter.homemodule.SuperHomeNavbarService;
@@ -42,129 +40,36 @@
    private SuperHomeNavbarService superHomeNavbarService;
    
    
    
    /**
     * 新增
     * 保存信息
     *
     * @param callback
     * @param special
     * @param out
     */
    @RequestMapping(value = "saveAdd")
    public void saveAdd(String callback, HomeNavbar homeNavbar, PrintWriter out) {
    @RequestMapping(value = "save")
    public void save(String callback, HomeNavbar homeNavbar, String jumpType, HttpServletRequest request,PrintWriter out) {
        try {
            // 1. 先判断httpRequest 是否含有文件类型
            if (request instanceof MultipartHttpServletRequest) {
                MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
                homeNavbarService.saveObject(fileRequest.getFile("file"), homeNavbar);
            }else{
                homeNavbarService.saveObject(null, homeNavbar);
            }
            
            String name = homeNavbar.getName();
            if (StringUtil.isNullOrEmpty(name)) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("导航名称不能为空"));
                return;
            }
            homeNavbar.setCreatetime(new Date());
            homeNavbar.setUpdatetime(new Date());
            int maxOrder = homeNavbarService.getMaxOrder();
            homeNavbar.setOrderby(maxOrder + 1);
            homeNavbarService.insert(homeNavbar);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("添加成功"));
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
        } catch (HomeNavbarException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("保存失败"));
            e.printStackTrace();
        }
    }
    /**
     * 修改
     * @param callback
     * @param special
     * @param out
     */
    @RequestMapping(value = "saveModify")
    public void saveModify(String callback, HomeNavbar homeNavbar, PrintWriter out) {
        try {
            Long id = homeNavbar.getId();
            if (id == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
                return;
            }
            String name = homeNavbar.getName();
            if (StringUtil.isNullOrEmpty(name)) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("导航名称不能为空"));
                return;
            }
            HomeNavbar resultObj = homeNavbarService.selectByPrimaryKey(id);
            if (resultObj == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作数据已不存在"));
                return;
            }
            homeNavbar.setUpdatetime(new Date());
            homeNavbarService.updateByPrimaryKeySelective(homeNavbar);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("修改成功"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
            e.printStackTrace();
        }
    }
    /**
     * 修改系统状态
     * @param callback
     * @param type
     * @param cardId
     * @param systemId
     * @param out
     */
    @RequestMapping(value = "saveSystemState")
    public void saveSystemState(String callback, Long id, Long systemId, PrintWriter out) {
        if (id == null || systemId == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("传递参数不能为空"));
            return;
        }
        try {
            List<SuperHomeNavbar> list = superHomeNavbarService.querybyNavbarId(id, systemId);
            if (list != null && list.size() > 0) {
                superHomeNavbarService.deletebyNavbarId(id, systemId);
                JSONObject data = new JSONObject();
                data.put("check", 0);
                JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
            } else {
                HomeNavbar homeNavbar = new HomeNavbar();
                homeNavbar.setId(id);
                BusinessSystem system = new BusinessSystem();
                system.setId(systemId);
                SuperHomeNavbar superNavbar = new  SuperHomeNavbar();
                superNavbar.setHomeNavbar(homeNavbar);
                superNavbar.setSystem(system);
                superHomeNavbarService.insertSelective(superNavbar);
                JSONObject data = new JSONObject();
                data.put("check", 1);
                JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
            }
        } catch (Exception e1) {
            e1.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("修改失败"));
        }
    }
    
    /**
     * 修改排序
@@ -173,49 +78,17 @@
     * @param goodsClass
     * @param out
     */
    @RequestMapping(value = "saveOrder")
    public void saveOrder(String callback, Long id, Integer moveType, PrintWriter out) {
        if (moveType == null || (!moveType.equals(1) && !moveType.equals(-1))) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("传递的类型不正确"));
            return;
        }
        if (id == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
            return;
        }
    @RequestMapping(value = "updateOrder")
    public void updateOrder(String callback, Long id, Integer moveType, PrintWriter out) {
        try {
            HomeNavbar resultObj = homeNavbarService.selectByPrimaryKey(id);
            if (resultObj == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作数据已不存在"));
                return;
            }
            Integer oldOrder = resultObj.getOrderby();
            List<HomeNavbar> list = homeNavbarService.getChangeOrder(moveType, oldOrder);
            if (list != null && list.size() > 0) {
                HomeNavbar changeObj = list.get(0);
                // 交换排序序号
                resultObj.setOrderby(changeObj.getOrderby());
                changeObj.setOrderby(oldOrder);
                homeNavbarService.updateByPrimaryKeySelective(changeObj);
            }
            homeNavbarService.updateByPrimaryKeySelective(resultObj);
            homeNavbarService.updateOrder(id, moveType);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
        } catch (HomeNavbarException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
            e.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
        }
    }
    
@@ -303,45 +176,4 @@
            e.printStackTrace();
        }
    }
    /**
     * 专题图片上传
     * @param file
     * @param uid
     * @param id
     * @param request
     * @param response
     * @param out
     */
    @RequestMapping(value = "uploadPic")
    public void uploadPic(@RequestParam("file") CommonsMultipartFile file, Long id, PrintWriter out) {
        if (file == null) {
            out.print(JsonUtil.loadFalseResult("上传文件为空"));
            return;
        }
        if (id == null) {
            out.print(JsonUtil.loadFalseResult("ID不能为空"));
            return;
        }
        try {
            HomeNavbar resultObj = homeNavbarService.selectByPrimaryKey(id);
            if (resultObj == null) {
                out.print(JsonUtil.loadFalseResult("操作数据已不存在"));
                return;
            }
            homeNavbarService.uploadPicture(file, resultObj);
            out.print(JsonUtil.loadTrueResult("上传成功"));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult("操作失败"));
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/apph5/AppH5QualityGoodsController.java
@@ -31,6 +31,7 @@
import com.yeshi.fanli.service.inter.goods.CollectionGoodsV2Service;
import com.yeshi.fanli.service.inter.goods.GoodsClassService;
import com.yeshi.fanli.service.inter.goods.TaoBaoClassService;
import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.lable.LabelService;
import com.yeshi.fanli.service.inter.lable.MergeClassService;
@@ -56,6 +57,9 @@
    @Resource
    private QualityFactoryService selectionGoodsService;
    @Resource
    private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
    @Resource
    private TaobaoMeterialService taobaoMeterialService;
@@ -864,14 +868,26 @@
     * @param out
     */
    @RequestMapping("getFlashSale")
    public void getFlashSale(String callback, Integer page, PrintWriter out) {
    public void getFlashSale(String callback, Integer page, Long auctionId, PrintWriter out) {
        if (page == null)
            page = 1;
        int pageSize = Constant.PAGE_SIZE;
        int type = qualityFlashSaleService.getNowType();
        TaoBaoGoodsBrief goodsBrief = null;
        if (page == 1 && auctionId != null) {
            List<TaoBaoGoodsBrief> list = taoBaoGoodsBriefService.queryByAuctionId(auctionId);
            if (list != null && list.size() > 0) {
                goodsBrief = list.get(0);
            }
        }
        if (goodsBrief != null) {
            pageSize = pageSize -1;
        }
        List<QualityFactory> listQuery = qualityGoodsService.listQueryByFlashSale((page - 1) * pageSize, pageSize);
        // 精选库数据为空
@@ -889,14 +905,21 @@
        BigDecimal proportion = manageService.getFanLiRate();
        if (goodsBrief != null) {
            array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(goodsBrief, proportion.toString(), null)));
        }
        // 遍历列表数据
        for (QualityFactory quality : listQuery) {
            TaoBaoGoodsBrief taoBaoGoodsBrief = quality.getTaoBaoGoodsBrief();
            if (taoBaoGoodsBrief == null) {
                continue;
            }
            if (goodsBrief != null && auctionId.equals(taoBaoGoodsBrief.getAuctionId())) {
                continue;
            }
            int biz30day = taoBaoGoodsBrief.getBiz30day();
            if (biz30day >= 10000) {
fanli/src/main/java/com/yeshi/fanli/controller/client/ConfigController.java
@@ -14,9 +14,6 @@
import com.yeshi.fanli.entity.bus.homemodule.FloatAD;
import com.yeshi.fanli.entity.config.AppHomeFloatImg;
import com.yeshi.fanli.entity.taobao.ClientTBPid;
import com.yeshi.fanli.entity.taobao.PidUser;
import com.yeshi.fanli.entity.taobao.TBPid;
import com.yeshi.fanli.entity.taobao.TaoBaoUnionConfig;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.homemodule.FloatADService;
import com.yeshi.fanli.service.inter.order.CommonOrderCountService;
@@ -96,6 +93,12 @@
        // 领券帮助链接,1.5.2后生效
        String couponHelp = configService.get("taobao_coupon_help");
        data.put("couponHelpUrl", couponHelp);
        // 底部网页链接
        String platform = acceptData.getPlatform();
        if ("android".equalsIgnoreCase(platform)) {
            data.put("htmlLink", configService.get("index_html_link_android"));
        }
        out.print(JsonUtil.loadTrueResult(data));
    }
fanli/src/main/java/com/yeshi/fanli/controller/client/GoodsClassController.java
@@ -22,6 +22,7 @@
import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
import com.yeshi.fanli.entity.bus.clazz.GoodsSecondClass;
import com.yeshi.fanli.entity.bus.clazz.GoodsSubClass;
import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
import com.yeshi.fanli.entity.bus.lable.QualityFactory;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.entity.taobao.SearchFilter;
@@ -38,6 +39,8 @@
import com.yeshi.fanli.service.inter.goods.SuperGoodsClassService;
import com.yeshi.fanli.service.inter.goods.TaoBaoClassService;
import com.yeshi.fanli.service.inter.goods.TaoBaoCouponService;
import com.yeshi.fanli.service.inter.homemodule.HomeNavbarService;
import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.lable.LabelClassService;
import com.yeshi.fanli.service.inter.lable.QualityFactoryService;
@@ -103,6 +106,12 @@
    @Resource
    private MonitorService monitorService;
    @Resource
    private HomeNavbarService homeNavbarService;
    @Resource
    private SwiperPictureService swiperPictureService;
    @Resource(name = "taskExecutor")
    private TaskExecutor executor;
@@ -153,22 +162,30 @@
     * @param out
     */
    @RequestMapping(value = "getgoodssecondclass", method = RequestMethod.POST)
    public void getGoodsSecondClass(AcceptData acceptData, long gcid, PrintWriter out) {
    public void getGoodsSecondClass(AcceptData acceptData, long gcid, Long swpid, PrintWriter out) {
        try {
            GoodsClass goodsClass = goodsClassService.getGoodsClassCache(gcid);
            if (goodsClass == null) {
                out.print(JsonUtil.loadFalseResult("暂无数据"));
                return;
            }
            // 轮播图
            List<SwiperPicture> picList = null;
            if (swpid != null) {
                picList = swiperPictureService.getByBannerId(swpid);
            }
            if (picList == null) {
                picList = new ArrayList<SwiperPicture>();
            }
            List<GoodsSubClass> goodsSubClassList = goodsSubClassService.getSubClassCache(gcid, 1);
            if (goodsSubClassList == null) {
                goodsSubClassList = new ArrayList<GoodsSubClass>();
            }
            JSONObject data = new JSONObject();
            data.put("picList", JsonUtil.getApiCommonGson().toJson(picList));
            data.put("count", goodsSubClassList.size());
            data.put("goodsSecondClassList", JsonUtil.getApiCommonGson().toJson(goodsSubClassList));
            out.print(JsonUtil.loadTrueResult(data));
fanli/src/main/java/com/yeshi/fanli/controller/client/HomeNavbarController.java
@@ -69,7 +69,7 @@
        
        JSONObject data = new JSONObject();
        data.put("count", listNavbar.size());
        data.put("listNavbar", listNavbar);
        data.put("listNavbar", JsonUtil.getApiCommonGson().toJson(listNavbar));
        
        out.print(JsonUtil.loadTrueResult(data));
    }
fanli/src/main/java/com/yeshi/fanli/controller/client/InviteGetMoneyController.java
@@ -11,6 +11,7 @@
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.HttpUtil;
import org.yeshi.utils.JsonUtil;
import com.yeshi.fanli.dto.money.InviteGetMoney;
@@ -176,7 +177,7 @@
     * @throws IOException
     */
    @RequestMapping(value = "/listInviteFriendImg", method = RequestMethod.POST)
    public void listInviteFriendImg(AcceptData acceptData, PrintWriter out, Long uid)
    public void listInviteFriendImg(AcceptData acceptData,  Long uid, PrintWriter out)
            throws NotExistObjectException, IOException {
        JSONObject data = new JSONObject();
        if (uid != null && !uid.equals("0")) {
@@ -184,9 +185,14 @@
            data.put("imgUrlList", JsonUtil.getSimpleGsonWithDate().toJson(imgList));
        }
        // 邀请链接
        String shortLink = HttpUtil.getShortLink("http://" + Constant.wxGZConfig.getLoginHost() + "/"
                 + Constant.systemCommonConfig.getProjectName() + "/client/threeShareNew?uid=" + uid);
        data.put("inviteLink", shortLink);
        // 邀请规则
        String key = "inviteRules"; // key值
        com.yeshi.fanli.entity.system.BusinessSystem system = new BusinessSystem();
        BusinessSystem system = new BusinessSystem();
        system.setCreatetime(java.lang.System.currentTimeMillis());
        system.setPlatform(1);
        system.setId(4L);
@@ -250,7 +256,7 @@
                return;
            }
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("激活成功"));
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("邀请码激活成功"));
        } catch (UserInfoExtraException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
@@ -260,6 +266,31 @@
        }
    }
    /**
     * 激活邀请
     *
     * @param callback
     * @param uid
     *            用户id
     * @param inviteCode
     *            邀请嘛
     * @param out
     */
    @RequestMapping(value = "activationInviteWX")
    public void activationInviteWX(AcceptData acceptData, Long uid, String  code, PrintWriter out) {
        try {
            userInfoExtraService.activationInviteWX(uid, code);
            out.print(JsonUtil.loadTrueResult("邀请码激活成功"));
        } catch (UserInfoExtraException e) {
            out.print(JsonUtil.loadFalseResult(e.getMsg()));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult("邀请码激活失败"));
            e.printStackTrace();
        }
    }
    /**
     * 获取邀请码
     * 
fanli/src/main/java/com/yeshi/fanli/controller/client/RecommendController.java
@@ -28,11 +28,11 @@
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import com.yeshi.fanli.dao.mybatis.HongBaoManageMapper;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.homemodule.Special;
import com.yeshi.fanli.entity.bus.homemodule.SuperSpecial;
import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
import com.yeshi.fanli.entity.bus.lable.QualityFactory;
import com.yeshi.fanli.entity.bus.recommend.Honest;
import com.yeshi.fanli.entity.bus.recommend.RecommendBanner;
import com.yeshi.fanli.entity.bus.recommend.RecommendBannerV2;
@@ -74,7 +74,6 @@
import com.yeshi.fanli.service.inter.config.SystemConfigService;
import com.yeshi.fanli.service.inter.goods.CollectionGoodsV2Service;
import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
import com.yeshi.fanli.service.inter.goods.RecommendBannerService;
import com.yeshi.fanli.service.inter.goods.ScanHistoryV2Service;
import com.yeshi.fanli.service.inter.goods.SuperRecommendBannerService;
import com.yeshi.fanli.service.inter.goods.SuperRecommendBannerV2Service;
@@ -85,6 +84,7 @@
import com.yeshi.fanli.service.inter.homemodule.SuperSpecialService;
import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.lable.QualityFlashSaleService;
import com.yeshi.fanli.service.inter.lable.QualityGoodsService;
import com.yeshi.fanli.service.inter.monitor.MonitorService;
import com.yeshi.fanli.service.inter.order.OrderService;
@@ -104,7 +104,6 @@
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.util.factory.MonitorFactory;
import com.yeshi.fanli.util.taobao.TaoBaoCouponUtil;
import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import com.yeshi.fanli.vo.user.UserSettingsVO;
@@ -213,6 +212,10 @@
    @Resource
    private UserInfoExtraService userInfoExtraService;
    @Resource
    private QualityFlashSaleService qualityFlashSaleService;
    @RequestMapping(value = "getHonestList")
    public void getHonestList(AcceptData acceptData, PrintWriter out) {
@@ -1572,17 +1575,71 @@
    @RequestMapping(value = "getRecommendIndex")
    public void getRecommendIndex(AcceptData acceptData, Long uid, PrintWriter out) {
        BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
                acceptData.getPackages());
        if (system == null) {
            out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
            return;
        }
        try {
            BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
                    acceptData.getPackages());
            if (system == null) {
                out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
                return;
            }
        // 轮播图
            JSONObject root = specialService.getSpecialListCache("native_index", system.getId());
            // 顶部轮播图
            List<SwiperPicture> topPicList = getSwiperByCard("weex_index");
            if (topPicList == null) {
                topPicList = new ArrayList<SwiperPicture>();
            }
            root.put("topPicList", JsonUtil.getApiCommonGson().toJson(topPicList));
            // 邀请有奖图片
            List<SwiperPicture> invitePicList = null;
//            if ("ios".equalsIgnoreCase(acceptData.getPlatform())
//                    && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()))) {
//                // 如果IOS当前版本处于审核状态就不返回
//            } else {
//                if (uid == null) {
//                    invitePicList = getSwiperByCard("invitePrizes");
//                } else {
//                    try {
//                        UserSettingsVO vo = userCustomSettingsService.getMySettings(uid);
//                        if (vo == null || vo.getNoInvitationBonus() == null || vo.getNoInvitationBonus() == 0) {
//                            invitePicList = getSwiperByCard("invitePrizes");    // 没有关闭邀请
//                        }
//                    } catch (UserCustomSettingsException e) {
//                        e.printStackTrace();
//                    }
//                }
//            }
            invitePicList = getSwiperByCard("invitePrizes");
            if (invitePicList == null) {
                invitePicList = new ArrayList<SwiperPicture>();
            }
            root.put("invitePicList", JsonUtil.getApiCommonGson().toJson(invitePicList));
            // 底部网页链接
            String platform = acceptData.getPlatform();
            if ("ios".equalsIgnoreCase(platform)) {
                root.put("htmlLink", configService.get("index_html_link_ios"));
            }
            out.print(JsonUtil.loadTrueResult(root));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult(1, "获取数据失败"));
            try {
                LogHelper.errorDetailInfo(e);
            } catch (Exception e1) {
                e1.printStackTrace();
            }
        }
    }
    public List<SwiperPicture> getSwiperByCard(String card){
        List<SwiperPicture> swiperList = null;
        try {
            swiperList = swiperPictureService.getByBannerCard("weex_index");
            swiperList = swiperPictureService.getByBannerCard(card);
        } catch (Exception e) {
            try {
                LogHelper.errorDetailInfo(e);
@@ -1591,112 +1648,87 @@
            }
            e.printStackTrace();
        }
        if (swiperList == null) {
            swiperList = new ArrayList<SwiperPicture>();
        return swiperList;
    }
    /**
     * 限时秒杀 1.5.3
     *
     * @param acceptData
     * @param out
     */
    @RequestMapping(value = "getSpikeGoods")
    public void getSpikeGoods(AcceptData acceptData, PrintWriter out) {
        // 下一次倒计时的时间
        int type = qualityFlashSaleService.getNowType() + 1;
        int hour = 0;
        switch(type) {
            case 1:
                hour = 0;
                break;
            case 2:
                hour = 9;
                break;
            case 3:
                hour = 12;
                break;
            case 4:
                hour = 14;
                break;
            case 5:
                hour = 16;
                break;
            case 6:
                hour = 20;
                break;
            case 7:
                hour = 22;
                break;
            default:
                break;
        }
        
        Calendar nextTime = Calendar.getInstance();
        nextTime.set(Calendar.HOUR_OF_DAY, hour);
        nextTime.set(Calendar.MINUTE, 0);
        nextTime.set(Calendar.SECOND, 0);
        nextTime.set(Calendar.MILLISECOND, 0);
        
        Special miaoShaSpecial = null;
        // 两行圆形专题
        List<Special> arcList = new ArrayList<Special>();
        // 活动列表
        List<Special> activityList = new ArrayList<Special>();
        // 方块部分
        List<Special> blockList = new ArrayList<Special>();
        try {
            List<Special> listSpecial = specialService.listBySystemAndCard("index", system.getId());
            if (listSpecial != null && listSpecial.size() > 0) {
                for (Special special : listSpecial) {
                    if ("限时秒杀".equals(special.getName())) {
                        miaoShaSpecial = special;
                        continue;
                    }
                    if (Special.SHOWTYPE_ARC.equals(special.getShowType())) {
                        // 两行圆形专题
                        arcList.add(special);
                    } else if (Special.SHOWTYPE_BLOCK.equals(special.getShowType())) {
                        // 方块部分
                        blockList.add(special);
                    } else if (Special.SHOWTYPE_ACTIVITY.equals(special.getShowType())) {
                        // 动态
                        activityList.add(special);
                    }
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        /* 限时秒杀 - 时间处理 */
        JSONObject msJSON = JSONObject.fromObject(new Gson().toJson(miaoShaSpecial));
        if (miaoShaSpecial != null) {
            // 获取秒杀
            int[] hours = new int[] { 0, 9, 12, 14, 16, 20, 22 };
            int hour = -1;
            Calendar calendar = Calendar.getInstance();
            calendar.setTimeInMillis(Long.parseLong(acceptData.getTime()));
            int nowHour = calendar.get(Calendar.HOUR_OF_DAY);
            for (int i = 0; i < hours.length - 1; i++) {
                if (nowHour >= hours[i] && nowHour < hours[i + 1]) {
                    hour = hours[i + 1];
                    break;
                }
            }
            if (hour < 0)
                hour = 24;
            long time = TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(calendar.getTimeInMillis(), "yyyy-MM-dd"),
                    "yyyy-MM-dd") + 1000 * 60 * 60 * hour;
            msJSON.put("time", time);
        }
        JSONObject root = new JSONObject();
        root.put("swiperList", JsonUtil.getApiCommonGson().toJson(swiperList));
        root.put("arcList", JsonUtil.getApiCommonGson().toJson(arcList));
        root.put("activityList", JsonUtil.getApiCommonGson().toJson(activityList));
        root.put("blockList", JsonUtil.getApiCommonGson().toJson(blockList));
        root.put("miaoSha", msJSON);
        // 增加邀请有奖
        JSONObject invite = new JSONObject();
        JumpDetailV2 jumpDetail = jumpDetailV2Service.getByTypeCache("invite");
        invite.put("jumpDetail", jumpDetail);
        invite.put("picture", configService.get("home_invite_banner"));
        if ("ios".equalsIgnoreCase(acceptData.getPlatform())
                && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()))) {
            // 如果IOS当前版本处于审核状态就不返回
        root.put("time", nextTime.getTimeInMillis());
        JSONArray array = new JSONArray();
        String cachekey = "spikeGoodsList" ;
        String cacheValue = redisManager.getCommonString(cachekey);
        if (!StringUtil.isNullOrEmpty(cacheValue)) {
            array = JSONArray.fromObject(cacheValue);
        } else {
            // 按照版本返回,版本覆盖足够后可删除
            if (("android".equalsIgnoreCase(acceptData.getPlatform()) && Integer.parseInt(acceptData.getVersion()) > 30)
                    || ("ios".equalsIgnoreCase(acceptData.getPlatform())
                            && Integer.parseInt(acceptData.getVersion()) > 37)) {
                if (uid != null) {
                    try {
                        UserSettingsVO vo = userCustomSettingsService.getMySettings(uid);
                        if (vo == null || vo.getNoInvitationBonus() == null || vo.getNoInvitationBonus() == 0)// 没有关闭邀请
                            root.put("invite", invite);
                    } catch (UserCustomSettingsException e) {
                        e.printStackTrace();
                    }
                } else
                    root.put("invite", invite);
            BigDecimal proportion = manageService.getFanLiRate();
            Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                    .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
            // 缓存中不存在
            List<QualityFactory> listGoods = qualityGoodsService.listFlashSaleRandGoods();
            if (listGoods == null) {
                listGoods = new ArrayList<QualityFactory>();
            }
            /* 遍历列表数据 */
            for (QualityFactory qualityFactory : listGoods) {
                TaoBaoGoodsBrief taoBaoGoodsBrief = qualityFactory.getTaoBaoGoodsBrief();
                if (taoBaoGoodsBrief == null) {
                    continue;
                }
                array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null)));
            }
            // 缓存半个小时
            redisManager.cacheCommonString(cachekey, array.toString(), 60 * 30);
        }
        root.put("listgoods", array);
        out.print(JsonUtil.loadTrueResult(root));
    }
    
    
fanli/src/main/java/com/yeshi/fanli/controller/client/SMSController.java
@@ -7,16 +7,19 @@
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.JsonUtil;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode;
import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode.ForbiddenUserIdentifyCodeTypeEnum;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.exception.SMSException;
import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
import com.yeshi.fanli.service.inter.user.SMSService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.annotation.RequestSerializableByKey;
import org.yeshi.utils.JsonUtil;
@Controller
@RequestMapping("api/v1/sms")
@@ -30,6 +33,9 @@
    @Resource
    private UserInfoService userInfoService;
    @Resource
    private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService;
    // 发送短信
@@ -57,12 +63,119 @@
                out.print(JsonUtil.loadFalseResult(4, "电话号码格式不正确"));
                return;
            }
            String msg = smsService.sendLoginVCode(phone);
            smsService.sendLoginVCode(phone, 6);
            out.print(JsonUtil.loadTrueResult("发送成功"));
        } catch (SMSException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
        }
    }
    /**
     * 1.5.3  登录发送短信
     * @param acceptData
     * @param phone
     * @param uid
     * @param out
     */
    @RequestMapping(value = "sendMSMLogin", method = RequestMethod.POST)
    public void sendMSMLogin(AcceptData acceptData, String phone, boolean slideVerify, PrintWriter out) {
        if (phone == null || !StringUtil.isMobile(phone.replaceAll(" ", ""))) {
            out.print(JsonUtil.loadFalseResult(1, "手机号输入有误,请修改"));
            return;
        }
        phone = phone.replaceAll(" ", "");
        sendMSNnew(phone,slideVerify, 1, StringUtil.Md5(phone + "-" + acceptData.getDevice()), out);
    }
    /**
     * 1.5.3 绑定发送短信
     * @param acceptData
     * @param phone
     * @param uid
     * @param out
     */
    @RequestMapping(value = "sendMSMBind", method = RequestMethod.POST)
    public void sendMSMBind(AcceptData acceptData, String phone, boolean slideVerify, PrintWriter out) {
        if (phone == null || !StringUtil.isMobile(phone.replaceAll(" ", ""))) {
            out.print(JsonUtil.loadFalseResult(1, "手机号输入有误,请修改"));
            return;
        }
        phone = phone.replaceAll(" ", "");
        // 判断手机号码是否被封禁
        ForbiddenUserIdentifyCode identifyCode1 = forbiddenUserIdentifyCodeService
                .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.phone, phone);
        if (identifyCode1 != null && identifyCode1.getEffective() != null && identifyCode1.getEffective()) {
            out.print(JsonUtil.loadFalseResult(9001,"该电话号码被占用"));
            return;
        }
        // 判断手机号码是否被封禁
        UserInfo phoneUser = userInfoService.getEffectiveUserInfoByPhone(phone);
        if (phoneUser != null) {
            out.print(JsonUtil.loadFalseResult(9001,"该电话号码被占用"));
            return;
        }
        sendMSNnew(phone,slideVerify, 2, StringUtil.Md5(phone + "-" + acceptData.getDevice()), out);
    }
    @RequestSerializableByKey(key = "key")
    public void sendMSNnew(String phone, boolean slideVerify, int type, String key, PrintWriter out) {
        try {
            int count = 0;
            String cachekey = null;
            if (type == 1) {
                // 登录验证码
                cachekey = "sendMSNLoginCount" + phone;
            } else if (type == 2) {
                // 绑定验证码
                cachekey = "sendMSNBindCount" + phone;
            }
            if (cachekey == null) {
                out.print(JsonUtil.loadFalseResult(1,"发送失败"));
                return;
            }
            String cacheValue = redisManager.getCommonString(cachekey);
            if (!StringUtil.isNullOrEmpty(cacheValue)) {
                count = Integer.parseInt(cacheValue);
                // 限制3次
                if (count >= 3) {
                    out.print(JsonUtil.loadFalseResult(3,"验证码次数超限,请稍后再试"));
                    return;
                }
            }
            if (count == 2 && !slideVerify) {
                out.print(JsonUtil.loadFalseResult(2,"需要滑动验证"));
                return;
            }
            // 缓存一个小时
            count ++;
            redisManager.cacheCommonString(cachekey, count + "", 60 * 60);
            if (type == 1) {
                // 登录验证码
                smsService.sendLoginVCode(phone, 4);
            } else if (type == 2) {
                // 绑定验证码
                smsService.sendBindVCode(phone, 4);
            }
            out.print(JsonUtil.loadTrueResult("发送成功"));
        } catch (SMSException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult(1, "发送失败"));
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/UserAccountController.java
@@ -9,6 +9,7 @@
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.encrypt.DESUtil;
@@ -1104,4 +1105,212 @@
            deviceTokenHWService.unBindDeviceToken(acceptData.getDevice());
        out.print(JsonUtil.loadTrueResult(""));
    }
    /**
     *   新版登录  V1.5.3
     * @param acceptData
     * @param vcode
     * @param phone
     * @param code
     * @param loginType 登录方式:  1-手机登录   2-微信登录
     * @param request
     * @param out
     */
    @RequestMapping(value = "loginNew", method = RequestMethod.POST)
    public void loginNew(AcceptData acceptData, String vcode, String phone, String code,
            int loginType, HttpServletRequest request, PrintWriter out) {
        try {
            BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
                    acceptData.getPackages());
            if (system == null) {
                out.print(JsonUtil.loadFalseResult("系统不存在"));
                return;
            }
            UserInfo userInfo = null;
            // 手机登录
            if (loginType == 1) {
                userInfo = userAccountService.loginPhone(request, loginType, vcode, phone, system.getAppid());
            }
            // 微信登录
            if (loginType == 2) {
                userInfo = userAccountService.loginWinXin(request,loginType, code, system.getAppid());
            }
            if (userInfo == null) {
                out.print(JsonUtil.loadFalseResult("登录失败"));
            } else {
                JSONObject data = new JSONObject();
                data.put("userInfo", UserUtil.filterForClientUser(userInfo));
                out.print(JsonUtil.loadTrueResult(data));
                /* 同步未登录之前设备抽奖数据  */
                final UserInfo uuser = userInfo;
                ThreadUtil.run(new Runnable() {
                    public void run() {
                        try {
                            int platformType = 0;
                            String platform = acceptData.getPlatform();
                            if ("android".equals(platform)) {
                                platformType = 1;
                            } else if ("ios".equals(platform)) {
                                platformType = 2;
                            }
                            userSystemCouponService.copyLotteryPrize(uuser.getId(), platformType, acceptData.getDevice());
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    }
                });
            }
        } catch (UserAccountException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
            try {
                LogHelper.cookieLog("登录出错:" + e.getCode() + "-" + e.getMessage());
            } catch (Exception e1) {
                e1.printStackTrace();
            }
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult("登录失败"));
            try {
                LogHelper.errorDetailInfo(e);
            } catch (Exception e1) {
                e1.printStackTrace();
            }
        }
    }
    /**
     *   绑定电话号码  V1.5.3
     *
     * @param acceptData
     * @param vcode
     * @param phone
     * @param out
     */
    @RequestMapping(value = "bindPhoneNew")
    public void bindPhoneNew(AcceptData acceptData, Long uid, String vcode, String phone, PrintWriter out) {
        BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
                acceptData.getPackages());
        if (system == null) {
            out.print(JsonUtil.loadFalseResult("系统不存在"));
            return;
        }
        if (StringUtil.isNullOrEmpty(vcode)) {
            out.print(JsonUtil.loadFalseResult("验证码不能为空"));
            return;
        }
        if (StringUtil.isNullOrEmpty(phone)) {
            out.print(JsonUtil.loadFalseResult("电话号码不能为空"));
            return;
        }
        phone = phone.replaceAll(" ", "");
        String oldVCode = redisManager.getSMSVCode(phone, SMSHistory.TYPE_BIND);
        if (Constant.IS_OUTNET) {
            if (!vcode.equalsIgnoreCase(oldVCode)) {
                out.print(JsonUtil.loadFalseResult(9001, "验证码错误,重新输入"));
                return;
            }
            redisManager.clearSMSFrequencyLimit(phone, SMSHistory.TYPE_BIND);
        }
        try {
            // 绑定用户
            userAccountService.bindPhoneNew(uid, phone);
            UserInfo user = userInfoService.getUserByIdWithMybatis(uid);
            // 判断电话号码是否已经封禁
            ForbiddenUserIdentifyCode ic = forbiddenUserIdentifyCodeService
                    .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.phone, phone);
            if (ic != null && ic.getEffective() != null && ic.getEffective()) {
                out.print(JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC));
                // 封禁用户
                // 封禁绑定的正常用户
                if (user != null && user.getState() != null && user.getState() == UserInfo.STATE_NORMAL) {
                    UserInfo update = new UserInfo(uid);
                    update.setState(UserInfo.STATE_FORBIDDEN);
                    update.setStateDesc("绑定被封禁的电话号码被封禁");
                    userInfoService.updateByPrimaryKeySelective(update);
                }
                return;
            }
            JSONObject data = new JSONObject();
            data.put("userInfo", UserUtil.filterForClientUser(user));
            out.print(JsonUtil.loadTrueResult(data));
        } catch (UserAccountException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult(1, "绑定失败"));
        }
    }
    /**
     * 更改微信
     *
     * @param acceptData
     * @param uid
     * @param code
     * @param out
     */
    @RequestMapping(value = "bindWeiXin")
    public void bindWeiXin(AcceptData acceptData, Long uid, String code, PrintWriter out) {
        BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
                acceptData.getPackages());
        if (system == null) {
            out.print(JsonUtil.loadFalseResult("系统不存在"));
            return;
        }
        if (StringUtil.isNullOrEmpty(code)) {
            out.print(JsonUtil.loadFalseResult("请上传code"));
            return;
        }
        try {
            userAccountService.bindWeiXin(uid, code);
            UserInfo user = userInfoService.getUserByIdWithMybatis(uid);
            // 判断taoBaoUid是否已经封禁
            ForbiddenUserIdentifyCode ic = forbiddenUserIdentifyCodeService
                    .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.wxUnionId, user.getWxUnionId());
            if (ic != null && ic.getEffective() != null && ic.getEffective()) {
                out.print(JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC));
                // 封禁用户
                // 封禁绑定的正常用户
                if (user != null && user.getState() != null && user.getState() == UserInfo.STATE_NORMAL) {
                    UserInfo update = new UserInfo(uid);
                    update.setState(UserInfo.STATE_FORBIDDEN);
                    update.setStateDesc("绑定被封禁的微信号被封禁");
                    userInfoService.updateByPrimaryKeySelective(update);
                }
                return;
            }
            JSONObject data = new JSONObject();
            data.put("userInfo", UserUtil.filterForClientUser(user));
            out.print(JsonUtil.loadTrueResult(data));
        } catch (UserAccountException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/UserAuthController.java
@@ -101,4 +101,76 @@
        else
            out.print(JsonUtil.loadTrue(0, data, "淘宝授权未成功,请稍后再试"));
    }
    /**
     * 获取淘宝授权信息
     *
     * @param acceptData
     * @param uid
     * @param source
     * @param out
     */
    @RequestMapping(value = "getTaoBaoAuthInfoNew", method = RequestMethod.POST)
    public void getTaoBaoAuthInfoNew(AcceptData acceptData, Long uid, String source, Boolean first, PrintWriter out) {
        if (uid == null) {
            out.print(JsonUtil.loadFalseResult(2, "用户未登录"));
            return;
        }
        if (StringUtil.isNullOrEmpty(source)) {
            out.print(JsonUtil.loadFalseResult(3, "来源错误"));
            return;
        }
        if (first == null) {
            out.print(JsonUtil.loadFalseResult(4, "请传first"));
            return;
        }
        if (!"1".equalsIgnoreCase(configService.get("open_speical_and_relation_apply"))) {
            out.print(JsonUtil.loadFalseResult(1, "暂不开放申请"));
            return;
        }
        //
        UserExtraTaoBaoInfo user = userExtraTaoBaoInfoService.getByUid(uid);
        if ("share".equalsIgnoreCase(source)) {
            if (user != null && !StringUtil.isNullOrEmpty(user.getRelationId()) && user.getRelationValid()) {
                out.print(JsonUtil.loadFalseResult(1, "无需授权"));
                return;
            }
        } else if ("zigou".equalsIgnoreCase(source)) {
            if (user != null && !StringUtil.isNullOrEmpty(user.getSpecialId()) && user.getSpecialValid()) {
                out.print(JsonUtil.loadFalseResult(1, "无需授权"));
                return;
            }
        }
        String link = TaoBaoUtil.getTaoBaoUnionAuthUrl(Constant.TAOBAO_AUTH_APPKEY,
                "http://api.flqapp.com/fanli/client/v1/auth/callback/tb", uid, source);
        String orderJS = "var orderId= document.getElementById('tp-bought-root').getElementsByClassName('js-order-container')[0].getElementsByTagName('div')[0].getAttribute('data-id');";
        orderJS += "if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {window.location.href='yestv://taobaoorder#'+orderId;} else {window.handle.showOrder(orderId)}";
        JSONObject data = new JSONObject();
        data.put("authLink", link);
        try {
            data.put("orderJS", DESUtil.encode(orderJS, StringUtil.getBase64String("YeShiFANLI889*+"),
                    StringUtil.getBase64String("*M#34f?,")));
        } catch (Exception e) {
            e.printStackTrace();
        }
        data.put("orderUrl", "https://buyertrade.taobao.com/trade/itemlist/list_bought_items.htm");
        if (first)
            out.print(JsonUtil.loadTrueResult(data));
        else
            out.print(JsonUtil.loadTrue(0, data, "淘宝授权未成功,请稍后再试"));
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/UserCouponController.java
@@ -17,10 +17,12 @@
import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
import com.yeshi.fanli.entity.bus.user.DeviceLotteryRecord;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.bus.user.UserLotteryRecord;
import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
import com.yeshi.fanli.entity.system.SystemCoupon;
import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
import com.yeshi.fanli.exception.user.UserInfoExtraException;
import com.yeshi.fanli.exception.user.UserLotteryRecordException;
import com.yeshi.fanli.exception.user.UserSystemCouponException;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.config.SystemCouponService;
@@ -30,6 +32,7 @@
import com.yeshi.fanli.service.inter.order.CommonOrderService;
import com.yeshi.fanli.service.inter.user.DeviceLotteryRecordService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.UserLotteryRecordService;
import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.vo.user.UserSystemCouponRecordVO;
@@ -79,6 +82,10 @@
    @Resource
    private ThreeSaleSerivce threeSaleSerivce;
    @Resource
    private UserLotteryRecordService userLotteryRecordService;
    /**
@@ -542,7 +549,7 @@
                // 已抽中的奖品
                List<UserSystemCoupon> list = userSystemCouponService.getUserCouponBySource(uid,
                        UserSystemCoupon.SOURCE_CHOUJIANG);
                        UserSystemCoupon.SOURCE_NEWBIES);
                
                if (list == null || list.size() == 0) {
                    // 抽奖
@@ -572,7 +579,7 @@
                        prize = null;
                    } else {
                        // 插入券信息
                        userSystemCouponService.insertUserCoupon(uid, prize, UserSystemCoupon.SOURCE_CHOUJIANG);
                        userSystemCouponService.insertUserCoupon(uid, prize, UserSystemCoupon.SOURCE_NEWBIES);
                    }
                }
                
@@ -643,4 +650,47 @@
        return prize;
    }
    /**
     * 获取抽奖次数- 天天抽奖励券
     *
     * @param callback
     * @param acceptData
     * @param uid
     * @param out
     */
    @RequestMapping(value = "getDailyCount")
    public void getDailyCount(String callback, AcceptData acceptData, Long uid, PrintWriter out) {
        try {
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult( userLotteryRecordService.getLotteryCountDaily(uid)));
        } catch (UserLotteryRecordException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getCode(),e.getMsg()));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("信息获取失败"));
            e.printStackTrace();
        }
    }
    /**
     * 获取抽奖结果 - 天天抽奖励券`
     *
     *
     *
     * @param callback
     * @param acceptData
     * @param uid
     * @param out
     */
    @RequestMapping(value = "getDailyResult")
    public void getDailyResult(String callback, AcceptData acceptData, Long uid, PrintWriter out) {
        try {
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult( userLotteryRecordService.executeLotteryDaily(uid)));
        } catch (UserLotteryRecordException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getCode(),e.getMsg()));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("抽奖失败"));
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/UserInfoController.java
@@ -66,6 +66,7 @@
import com.yeshi.fanli.exception.taobao.TaoKeApiException;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
import com.yeshi.fanli.exception.user.UserCustomSettingsException;
import com.yeshi.fanli.exception.user.UserInfoException;
import com.yeshi.fanli.exception.user.UserInfoExtraException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.AdminUserService;
@@ -517,6 +518,7 @@
                }
            }
        }
        GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
@@ -573,10 +575,20 @@
        data.put("moduleState", mySettings);
        int welfareCenterNews = 0;
        String invitCode = null;
        UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(user.getId());
        if (userInfoExtra != null && userInfoExtra.getCouponNews() != null) {
            welfareCenterNews = userInfoExtra.getCouponNews();
        if (userInfoExtra != null  ) {
            if(userInfoExtra.getCouponNews() != null) {
                welfareCenterNews = userInfoExtra.getCouponNews();
            }
            if(userInfoExtra.getInviteCode() != null && userInfoExtra.getInviteCode().trim().length() > 0) {
                invitCode = userInfoExtra.getInviteCode();
            }
        }
        // 邀请码
        data.put("invitCode", invitCode);
        // 福利中心消息
        data.put("welfareCenterNews", welfareCenterNews);
        out.print(JsonUtil.loadTrueResult(data));
@@ -1576,9 +1588,9 @@
            JSONObject resultData = new JSONObject();
            if (type == 1) {
                resultData = threeSaleSerivce.getMyFirstTeam((page - 1) * pageSize, pageSize, uid);
                resultData = threeSaleSerivce.getMyFirstTeam((page - 1) * pageSize, pageSize, uid, null);
            } else if (type == 2) {
                resultData = threeSaleSerivce.getMySecondTeam((page - 1) * pageSize, pageSize, uid);
                resultData = threeSaleSerivce.getMySecondTeam((page - 1) * pageSize, pageSize, uid, null);
            }
            // 安卓系统返回所有数据
@@ -1638,6 +1650,81 @@
    }
    /**
     * 用户队员列表查询 1.5.3查询有效队员
     *
     * @param acceptData
     * @param id
     * @param out
     */
    @RequestMapping(value = "getMyTeamNew", method = RequestMethod.POST)
    public void getMyTeamNew(AcceptData acceptData, long page, long uid, long type, PrintWriter out) {
        try {
            int pageSize = Constant.PAGE_SIZE;
            JSONObject resultData = new JSONObject();
            if (type == 1) {
                resultData = threeSaleSerivce.getMyFirstTeam((page - 1) * pageSize, pageSize, uid, 1);
            } else if (type == 2) {
                resultData = threeSaleSerivce.getMySecondTeam((page - 1) * pageSize, pageSize, uid, 1);
            }
            // 安卓系统返回所有数据
            String platform = acceptData.getPlatform();
            if ("android".equalsIgnoreCase(platform)) {
                long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1);
                long secondTeam = threeSaleSerivce.countSecondTeam(uid, 1);
                JSONObject bossData = null;
                ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
                if (threeSale != null) {
                    bossData = new JSONObject();
                    UserInfo boss = threeSale.getBoss();
                    if (boss != null) {
                        bossData.put("nickName", boss.getNickName());
                        bossData.put("portrait", boss.getPortrait());
                    }
                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
                    Long createTime = threeSale.getCreateTime();
                    Date inviteTime = new Date(createTime);
                    bossData.put("inviteTime", "邀请时间: " + sdf.format(inviteTime));
                }
                String helpLink = configService.get("team_help_url");
                if (helpLink == null) {
                    helpLink = "";
                }
                boolean hasCode = false;
                String inviteCode = userInfoExtraService.getUserInviteCode(uid);
                if (inviteCode != null && inviteCode.trim().length() > 0) {
                    hasCode = true; // 已有邀请码
                } else {
                    // 邀请激活链接
                    resultData.put("activationlink", configService.get("invite_activation_url"));
                }
                resultData.put("hasCode", hasCode);
                resultData.put("helpLink", helpLink);
                resultData.put("firstTeam", firstTeam);
                resultData.put("secondTeam", secondTeam);
                resultData.put("boss", bossData);
            }
            out.print(JsonUtil.loadTrueResult(resultData));
        } catch (UserInfoExtraException e) {
            out.print(JsonUtil.loadFalseResult(e.getMsg()));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult("统计失败"));
            e.printStackTrace();
        }
    }
    /**
     * 用户队员统计 1.4.1
     * 
@@ -1909,4 +1996,163 @@
            e.printStackTrace();
        }
    }
    /**
     * 获取用户信息
     *
     * @param acceptData
     * @param form
     * @param requst
     * @param out
     */
    @RequestMapping(value = "getuserinfoNew", method = RequestMethod.POST)
    public void getuserinfoNew(AcceptData acceptData, Long uid, HttpServletRequest requst, PrintWriter out) {
        try {
            BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
                    acceptData.getPackages());
            if (system == null) {
                out.print(JsonUtil.loadFalseResult("系统不存在"));
                return;
            }
            if (uid == null) {
                out.print(JsonUtil.loadFalseResult("请求参数为空"));
                return;
            }
            UserInfo userInfo = userInfoService.getUserInfo(uid);
            // 添加用户活跃记录
            UserActiveLog userActiveLog = new UserActiveLog();
            userActiveLog.setChannel(acceptData.getChannel());
            userActiveLog.setIp(requst.getRemoteHost());
            userActiveLog.setUid(userInfo.getId());
            userActiveLog.setVersionCode(acceptData.getVersion());
            userActiveLog.setOsVersion(acceptData.getOsVersion());
            userActiveLog.setDeviceType(acceptData.getDeviceType());
            userActiveLogService.addUserActiveLog(userActiveLog);
            // 处理用户信息
            outUserInfoHandle(userInfo);
            GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
            JSONObject data = new JSONObject();
            data.put("user", JsonUtil.getConvertBigDecimalToStringBuilder(gsonBuilder).create().toJson(userInfo));
//            if ("ios".equalsIgnoreCase(acceptData.getPlatform())
//                    && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()))) {
//                data.put("inviteList", String.format("http://%s/%s/client/share/friends_new_online.html",
//                        Constant.systemCommonConfig.getProjectHost(), Constant.systemCommonConfig.getProjectName()));
//            } else {
//                data.put("inviteList", configService.get("team_list"));
//            }
//
            // 界面状态
            UserSettingsVO mySettings = null;
            try {
                mySettings = userCustomSettingsService.getMySettings(uid);
            } catch (UserCustomSettingsException e) {
                mySettings = new UserSettingsVO();
                e.printStackTrace();
            }
            if (mySettings.getCancelNotice() == null) {
                mySettings.setCancelNotice(0);
            }
            if (mySettings.getNoBonusCount() == null) {
                mySettings.setNoBonusCount(0);
            }
            if (mySettings.getNoNewsRedDot() == null) {
                mySettings.setNoNewsRedDot(0);
            }
            if (mySettings.getNoShareRecordAndStorage() == null) {
                mySettings.setNoShareRecordAndStorage(0);
            }
            if (mySettings.getNoInvitationBonus() == null) {
                mySettings.setNoInvitationBonus(0);
            }
            data.put("moduleState", mySettings);
            int welfareCenterNews = 0;
            String invitCode = null;
            UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
            if (userInfoExtra != null  ) {
                if(userInfoExtra.getCouponNews() != null) {
                    welfareCenterNews = userInfoExtra.getCouponNews();
                }
                if(userInfoExtra.getInviteCode() != null && userInfoExtra.getInviteCode().trim().length() > 0) {
                    invitCode = userInfoExtra.getInviteCode();
                }
                if (userInfoExtra.getUserRank() != null) {
                    String picture = userInfoExtra.getUserRank().getPicture();
                    String icon = userInfoExtra.getUserRank().getIcon();
                    userInfo.setRankNamePicture(picture);
                    userInfo.setRankIcon(icon);
                } else {
                    userInfo.setRankNamePicture(null);
                    userInfo.setRankIcon(null);
                }
            }
            data.put("invitCode", invitCode); // 邀请码
            data.put("welfareCenterNews", welfareCenterNews);// 福利中心消息
            out.print(JsonUtil.loadTrueResult(data));
            final UserInfo uuser = userInfo;
            ThreadUtil.run(new Runnable() {
                public void run() {
                    try {
                        // 获取邀请码:若无邀请码且存在有效的队员关系 则自动生成邀请码
                        userInfoExtraService.getUserInviteCode(uuser.getId());
                    } catch (UserInfoExtraException e) {
                        e.printStackTrace();
                    }
                    // 更新用户附加信息,老用户不存在的需要添加
                    try {
                        userInfoExtraService.updateUserRankByUid(uuser.getId());
                    } catch (UserInfoExtraException e) {
                        e.printStackTrace();
                    }
                }
            });
        } catch (UserInfoException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult("获取失败"));
            e.printStackTrace();
        }
    }
    private void outUserInfoHandle(UserInfo user) {
        // 红包处理
        user.setTotalHongBao(new BigDecimal(0));
        user.setNoOpenHongBao(new BigDecimal(0));
        user.setCanOpenHongBao(new BigDecimal(0));
        // 电话号码处理
        if (!StringUtil.isNullOrEmpty(user.getPhone())) {
            if (user.getPhone().length() > 5) {
                String phone = user.getPhone().substring(0, 3);
                phone += "******";
                phone += user.getPhone().substring(user.getPhone().length() - 2, user.getPhone().length());
                user.setPhone(phone);
            }
        }
        UserInfoExtraVO userInfoExtra = userInfoExtraService.getInfoExtraVOByUid(user.getId());
        if (userInfoExtra != null && userInfoExtra.getUserRank() != null) {
            String picture = userInfoExtra.getUserRank().getPicture();
            String icon = userInfoExtra.getUserRank().getIcon();
            user.setRankNamePicture(picture);
            user.setRankIcon(icon);
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java
@@ -5,9 +5,13 @@
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.Resource;
@@ -27,6 +31,7 @@
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.homemodule.Special;
import com.yeshi.fanli.entity.bus.lable.QualityFactory;
import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail;
import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail;
@@ -37,14 +42,17 @@
import com.yeshi.fanli.entity.bus.msg.UserSystemMsg;
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.entity.goods.RecommendUserGoods;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
import com.yeshi.fanli.exception.goods.CommonGoodsException;
import com.yeshi.fanli.exception.goods.RecommendUserGoodsException;
import com.yeshi.fanli.exception.msg.UserSystemMsgException;
import com.yeshi.fanli.exception.user.UserCustomSettingsException;
import com.yeshi.fanli.service.inter.config.BusinessSystemService;
import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
import com.yeshi.fanli.service.inter.goods.RecommendUserGoodsService;
import com.yeshi.fanli.service.inter.homemodule.SpecialService;
import com.yeshi.fanli.service.inter.lable.QualityFactoryService;
import com.yeshi.fanli.service.inter.msg.MsgAccountDetailService;
import com.yeshi.fanli.service.inter.msg.MsgInviteDetailService;
@@ -63,6 +71,7 @@
import com.yeshi.fanli.util.factory.msg.UserMsgVOFactory;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import com.yeshi.fanli.vo.msg.UserHomeMsgVO;
import com.yeshi.fanli.vo.msg.UserMsgCenter;
import com.yeshi.fanli.vo.msg.UserMsgVO;
import com.yeshi.fanli.vo.msg.UserSystemMsgVO;
import com.yeshi.fanli.vo.user.UserSettingsVO;
@@ -73,6 +82,8 @@
@RequestMapping("api/v1/user/msg")
public class UserMsgController {
    @Resource
    private BusinessSystemService businessSystemService;
    @Resource
    private MsgOrderDetailService msgOrderDetailService;
@@ -111,6 +122,10 @@
    @Resource
    private RedisManager redisManager;
    @Resource
    private SpecialService specialService;
    // 消息的类型
    final static String MSG_TYPE_ORDER = "order";
@@ -507,7 +522,151 @@
        root.put("count", count);
        out.print(JsonUtil.loadTrueResult(root));
    }
    /**
     * 获取消息列表
     *
     * @param acceptData
     * @param uid
     * @param page
     * @param type
     * @param out
     */
    @RequestMapping(value = "getHomeMsgListNew", method = RequestMethod.POST)
    public void getHomeMsgListNew(AcceptData acceptData, Long uid, PrintWriter out) {
        if (uid == null) {
            out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
        }
        BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
                acceptData.getPackages());
        if (system == null) {
            out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
            return;
        }
        int page = 1;
        List<UserMsgVO> list = new ArrayList<>();
        List<MsgOrderDetail> detailList = msgOrderDetailService.listMsgOrderDetail(uid, page);
        if (detailList != null && detailList.size() > 0) {
            for (MsgOrderDetail detail : detailList) {
                list.add(UserMsgVOFactory.create(detail));
            }
        }
        List<MsgMoneyDetail> detailList1 = msgMoneyDetailService.listMsgMoneyDetail(uid, page);
        if (detailList1 != null && detailList1.size() > 0) {
            for (MsgMoneyDetail detail : detailList1) {
                list.add(UserMsgVOFactory.create(detail));
            }
        }
        List<MsgAccountDetail> detailList2 = msgAccountDetailService.listMsgAccountDetail(uid, page);
        if (detailList2 != null && detailList2.size() > 0) {
            for (MsgAccountDetail detail : detailList2) {
                list.add(UserMsgVOFactory.create(detail));
            }
        }
        List<MsgInviteDetail> detailList3 = msgInviteDetailService.listMsgInviteDetail(uid, page);
        if (detailList3 != null && detailList3.size() > 0) {
            for (MsgInviteDetail detail : detailList3) {
                UserMsgVO vo = UserMsgVOFactory.create(detail);
                if (vo != null) {
                    list.add(vo);
                }
            }
        }
        List<MsgOtherDetail> detailList4 = msgOtherDetailService.listMsgOtherDetail(uid, page);
        if (detailList4 != null && detailList4.size() > 0) {
            for (MsgOtherDetail detail : detailList4) {
                UserMsgVO vo = UserMsgVOFactory.create(detail);
                if (vo != null) {
                    list.add(vo);
                }
            }
        }
        List<UserMsgCenter> listCenter = new ArrayList<>();
        List<Special> listSpecial = specialService.listBySystemAndCard("", system.getId());
        if (listSpecial != null && listSpecial.size() > 0) {
            for (Special special: listSpecial) {
                UserMsgCenter msgCenter = new UserMsgCenter();
                msgCenter.setSpecial(special);
                listCenter.add(msgCenter);
            }
        }
        if (list.size() > 0 ) {
            // 时间排序
            listSort(list);
            if (list.size() <= 20 ) {
            } else {
                list = list.subList(0, 19);
            }
            for (UserMsgVO userMsgVO: list) {
                UserMsgCenter userMsgCenter = new UserMsgCenter();
                userMsgCenter.setUserMsg(userMsgVO);
                listCenter.add(userMsgCenter);
            }
        }
        // 添加欢迎语
        Long time = (uid == null ? System.currentTimeMillis() : userInfoService.selectByPKey(uid).getCreatetime());
        // 创建时间在28号后的才有新人欢迎
        if ((time > TimeUtil.convertToTimeTemp("2019-01-28", "yyyy-MM-dd") || uid == null)) {
            Map<String, Object> map = new HashMap<String, Object>();
            map.put("title", "新人欢迎");
            map.put("content", "恭喜你,成为返利券的用户\n独家优惠券帮你省钱;\n参与奖金活动帮你赚钱;\n让返利券成为你的省钱助手吧!");
            map.put("createTime",new Date(time));
            UserMsgCenter msgCenternre = new UserMsgCenter();
            msgCenternre.setWelcomeMsg(map);
            listCenter.add(msgCenternre);
        }
        GsonBuilder builder = new GsonBuilder();
        builder = getTimeDescJsonBuilder(builder);
        JSONObject root = new JSONObject();
        UserMsgUnReadNum num = userMsgReadStateService.getReadStateByUid(uid);
        UserSystemMsg usm = userSystemMsgService.getLatestUserSystemMsg(uid);
        if (usm != null) {
            root.put("systemMsg", new UserSystemMsgVO(usm.getId(), usm.getType().name(), usm.getSolved(), "系统消息", usm.getTitle(),
                usm.getTimeTag() == 1 ? "http://img.flqapp.com/resource/msg/icon_emergent.png" : "", "http://img.flqapp.com/resource/msg/icon_msg_system.png",getTimeDesc(new Date(), usm.getCreateTime()), num.getTypeSystem()));
        }
        root.put("list", builder.create().toJson(listCenter));
        root.put("count", listCenter.size());
        out.print(JsonUtil.loadTrueResult(root));
    }
    public static void listSort(List<UserMsgVO> list) {
        Collections.sort(list, new Comparator<UserMsgVO>() {
            @Override
            public int compare(UserMsgVO o1, UserMsgVO o2) {
                if (o1.getTime().getTime() > o2.getTime().getTime()) {
                    return -1;
                } else if (o1 == o2) {
                    return 0;
                } else {
                    return 1;
                }
            }
        });
    }
    /**
     * 获取系统消息列表
     * 
fanli/src/main/java/com/yeshi/fanli/controller/client/UserOrderController.java
@@ -67,7 +67,7 @@
     * @param page
     * @param uid
     * @param state
     *            状态:0全部 1-未到账 2-已到账 3-已失效
     *            状态:0全部 1-未到账 2-已到账 3-已失效  4已收货
     * @param type
     *            类型:1-返利订单 2-分享订单 3-邀请订单
     * @param orderState
@@ -103,6 +103,12 @@
            state = null;// 所有状态
        }
        // 转换状态
        if (state != null && state == 4) {
            orderState = state; // 已收货状态
            state = null; // 清空
        }
        if (type != null && type == 0) {
            type = null; // 所有类型订单
        }
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/ThreeSaleMapper.java
@@ -149,7 +149,8 @@
     * @param paramLong1
     * @return
     */
    List<ThreeSale> listFirstTeam(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid);
    List<ThreeSale> listFirstTeam(@Param("start") long start, @Param("count") int count,
            @Param("uid") Long uid, @Param("state") Integer state);
    /**
     * 统计一级队员
@@ -168,7 +169,8 @@
     * @param uid
     * @return
     */
    List<ThreeSale> listSecondTeam(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid);
    List<ThreeSale> listSecondTeam(@Param("start") long start, @Param("count") int count,
            @Param("uid") Long uid,@Param("state") Integer state);
    /**
     * 统计二级队员
@@ -222,4 +224,11 @@
    ThreeSale getRelationshipByBossIdAndWorkerId(@Param("bossId") Long bossId, @Param("workerId") Long workerId);
    
    /**
     * 根据邀请者ID查询未失效关系
     *
     * @param workerId
     * @return
     */
    ThreeSale getByWorkerId(Long workerId);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/UserInfoMapper.java
@@ -47,7 +47,14 @@
    // 根据AppId与电话号码获取用户
    List<UserInfo> listByAppIdAndPhone(@Param("appId") String appId, @Param("phone") String phone);
    // 根据获取电话号码有效用户
    UserInfo getEffectiveUserInfoByPhone(@Param("phone") String phone);
    // 根据获WXUnionId有效用户
    UserInfo getEffectiveUserInfoByWXUnionId(@Param("unionId") String unionId);
    Long getMaxUid();
    /**
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/HomeNavbarMapper.java
@@ -4,21 +4,11 @@
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar;
public interface HomeNavbarMapper {
public interface HomeNavbarMapper extends BaseMapper<HomeNavbar>{
    int deleteByPrimaryKey(Long id);
    int insert(HomeNavbar record);
    int insertSelective(HomeNavbar record);
    HomeNavbar selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(HomeNavbar record);
    int updateByPrimaryKey(HomeNavbar record);
    
    /**
     * 根据主键批量删除
@@ -40,7 +30,7 @@
     * @param order 排序值
     * @return
     */
    List<HomeNavbar> getChangeOrder(@Param("type") Integer type, @Param("order") Integer order);
    HomeNavbar getChangeOrder(@Param("type") Integer type, @Param("order") Integer order);
    
    /**
     * 后端列表查询
@@ -52,4 +42,18 @@
    List<HomeNavbar> listQuery(@Param("start") long start, @Param("count") int count, @Param("key") String key);
    
    long countListQuery(@Param("key") String key);
    /**
     * 查询有效导航栏
     * @return
     */
    List<HomeNavbar> listQueryEffective();
    /**
     * 根据分类查询有效导航栏
     * @param classId
     * @return
     */
    HomeNavbar getEffectiveByClassId(@Param("classId") Long classId);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/SpecialPlaceMapper.java
New file
@@ -0,0 +1,39 @@
package com.yeshi.fanli.dao.mybatis.homemodule;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.bus.homemodule.SpecialPlace;
public interface SpecialPlaceMapper extends BaseMapper<SpecialPlace> {
    /**
     * 获取所有
     * @return
     */
    List<SpecialPlace> getList();
    /**
     * 批量删除
     * @param list
     * @return
     */
    int deleteByPrimaryKeyList(List<Long> list);
   /**
     *  后端列表查询
    * @param start
    * @param count
    * @param key
    * @param state
    * @return
    */
    List<SpecialPlace> listQuery(@Param("start") long start, @Param("count") int count, @Param("key") String key);
    long countQuery(@Param("key") String key);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/SwiperPictureMapper.java
@@ -47,4 +47,12 @@
    List<SwiperPicture> getByBannerCard(@Param("card") String card);
    
    
    /**
     * 根据 唯一标识查询
     * @param card 唯一标识
     * @return
     */
    List<SwiperPicture> getByBannerId(@Param("bannerId") Long bannerId);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/lable/QualityFactoryMapper.java
@@ -218,6 +218,12 @@
    long countQueryByFlashSale();
    /**
     * 限时秒杀 随机3个商品
     * @return
     */
    List<QualityFactory> listFlashSaleRandGoods();
    /**
     * 返利金额数据查询
     * 
     * @param start
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/taobao/TaoBaoUnionAuthRecordMapper.java
@@ -1,9 +1,11 @@
package com.yeshi.fanli.dao.mybatis.taobao;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.taobao.TaoBaoUnionAuthRecord;
public interface TaoBaoUnionAuthRecordMapper extends BaseMapper<TaoBaoUnionAuthRecord>{
    String getTaoBaoUserNick(@Param("uid") Long uid);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserExtraTaoBaoInfoMapper.java
@@ -1,5 +1,7 @@
package com.yeshi.fanli.dao.mybatis.user;
import java.util.List;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
@@ -44,5 +46,10 @@
     * @return
     */
    UserExtraTaoBaoInfo selectBySpecialIdWithUidNotNull(String specialId);
    /**
     * 统计正在使用的该淘宝的用户
     */
    List<UserExtraTaoBaoInfo> listByTaoBaoUid(String taoBaoUid);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserInviteRecordMapper.java
New file
@@ -0,0 +1,26 @@
package com.yeshi.fanli.dao.mybatis.user;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.bus.user.UserInviteRecord;
public interface UserInviteRecordMapper extends BaseMapper<UserInviteRecord>{
    /**
     *    获取邀请记录
     * @param inviterId 邀请人id
     * @param wxUnionId 微信id
     * @return
     */
    UserInviteRecord getByInviterIdAndUnionid(@Param("inviterId")Long inviterId, @Param("wxUnionId")String wxUnionId);
    /**
     *    获取最新 inviterId 邀请人id
     * @param wxUnionId 微信id
     * @return
     */
    Long getNewestInviterId(@Param("wxUnionId")String wxUnionId);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserLotteryRecordMapper.java
New file
@@ -0,0 +1,18 @@
package com.yeshi.fanli.dao.mybatis.user;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.bus.user.UserLotteryRecord;
public interface UserLotteryRecordMapper extends BaseMapper<UserLotteryRecord>{
    /**
     * 根据用户、抽奖类型查询记录
     * @param uid
     * @param type
     * @return
     */
    UserLotteryRecord getByTypeAndUid(@Param("uid")Long uid, @Param("type")String type);
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/HomeNavbar.java
@@ -7,6 +7,7 @@
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.google.gson.annotations.Expose;
import com.yeshi.fanli.entity.system.BusinessSystem;
/**
@@ -17,12 +18,13 @@
 * @date 2018年10月23日
 */
@Table("yeshi_ec_home_navbar")
public class HomeNavbar implements Serializable {
public class HomeNavbar implements Serializable{
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    // 消息类型的枚举
    public enum NavbarTypeEnum {
        category("分类"), weex("阿里百川"), web("网页");
        private final String desc;
@@ -41,22 +43,32 @@
    private Long id;
    // 名称
    @Expose
    @Column(name = "br_name")
    private String name;
    // 图片
    @Expose
    @Column(name = "br_picture")
    private String picture;
    // 分类id
    @Expose
    @Column(name = "br_class_id")
    private Long classId;
    // 对应轮播图标识
    @Expose
    @Column(name = "br_swiper_banner_id")
    private Long swiperBannerId;
    // 跳转链接
    @Expose
    @Column(name = "br_url")
    private String url;
    // 类型
    @Expose
    @Column(name = "br_type")
    private NavbarTypeEnum type;
@@ -64,6 +76,18 @@
    @Column(name = "br_orderby")
    private Integer orderby;
    //起始时间
    @Column(name = "br_start_time")
    private Date startTime;
    //结束时间
    @Column(name = "br_end_time")
    private Date endTime;
    // 状态:1启用 0 停用
    @Column(name = "br_state")
    private Integer state;
    // 创建时间
    @Column(name = "br_createtime")
    private Date createtime;
@@ -72,9 +96,17 @@
    @Column(name = "br_updatetime")
    private Date updatetime;
    
    // 是否定时
    private boolean timeTask;
    // 起始时间
    private String startTime_str;
    // 结束时间
    private String endTime_str;
    // 系统关联列表
    private List<BusinessSystem> systemList;
    public Long getId() {
        return id;
    }
@@ -147,6 +179,62 @@
        this.updatetime = updatetime;
    }
    public Long getSwiperBannerId() {
        return swiperBannerId;
    }
    public void setSwiperBannerId(Long swiperBannerId) {
        this.swiperBannerId = swiperBannerId;
    }
    public Date getStartTime() {
        return startTime;
    }
    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }
    public Date getEndTime() {
        return endTime;
    }
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }
    public Integer getState() {
        return state;
    }
    public void setState(Integer state) {
        this.state = state;
    }
    public boolean isTimeTask() {
        return timeTask;
    }
    public void setTimeTask(boolean timeTask) {
        this.timeTask = timeTask;
    }
    public String getStartTime_str() {
        return startTime_str;
    }
    public void setStartTime_str(String startTime_str) {
        this.startTime_str = startTime_str;
    }
    public String getEndTime_str() {
        return endTime_str;
    }
    public void setEndTime_str(String endTime_str) {
        this.endTime_str = endTime_str;
    }
    public List<BusinessSystem> getSystemList() {
        return systemList;
    }
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/Special.java
@@ -21,6 +21,14 @@
    private static final long serialVersionUID = 1L;
    // 圆形
    public static String SHOWTYPE_ARC = "arc";
    // 方块
    public static String SHOWTYPE_BLOCK = "block";
    // 活动
    public static String SHOWTYPE_ACTIVITY = "activity";
    @Column(name = "b_id")
    private Long id;
@@ -67,7 +75,7 @@
    @Column(name = "b_state")
    private Long state;
    
    // 显示类型
    // 显示类型:圆形图 、大图
    @Expose
    @Column(name = "b_show_type")
    private String showType;
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/SpecialPlace.java
New file
@@ -0,0 +1,98 @@
package com.yeshi.fanli.entity.bus.homemodule;
import java.util.Date;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
/**
 *  专题位置管理
 *
 * @author yj
 *
 * @date 2018年10月23日
 */
@Table("yeshi_ec_special_place")
public class SpecialPlace {
    // 圆形
    public static String SHOWTYPE_ARC = "arc";
    // 方块
    public static String SHOWTYPE_BLOCK = "block";
    // 活动
    public static String SHOWTYPE_ACTIVITY = "activity";
    @Column(name = "sp_id")
    private Long id;
    // 位置
    @Column(name = "sp_place_name")
    private String placeName;
    // 位置标识
    @Column(name = "sp_key")
    private String key;
    // 背景图片
    @Column(name = "sp_bottom_picture")
    private String bottomPicture;
    // 创建时间
    @Column(name = "sp_create_time")
    private Date createTime;
    // 更新时间
    @Column(name = "sp_update_time")
    private Date updateTime;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getPlaceName() {
        return placeName;
    }
    public void setPlaceName(String placeName) {
        this.placeName = placeName;
    }
    public String getKey() {
        return key;
    }
    public void setKey(String key) {
        this.key = key;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    public String getBottomPicture() {
        return bottomPicture;
    }
    public void setBottomPicture(String bottomPicture) {
        this.bottomPicture = bottomPicture;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserExtraTaoBaoInfo.java
@@ -27,6 +27,8 @@
    private String taoBaoUid;// 淘宝的用户ID
    @Column(name = "uiet_taobao_order_end_6_num")
    private String taoBaoOrderEnd6Num;// 订单结尾的6个数字
    @Column(name = "uiet_taobao_nick_name")
    private String taoBaoNickName;// 淘宝昵称
    @Column(name = "uiet_create_time")
    private Date createTime;
    @Column(name = "uiet_update_time")
@@ -128,4 +130,11 @@
        this.updateTime = updateTime;
    }
    public String getTaoBaoNickName() {
        return taoBaoNickName;
    }
    public void setTaoBaoNickName(String taoBaoNickName) {
        this.taoBaoNickName = taoBaoNickName;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserInviteRecord.java
New file
@@ -0,0 +1,75 @@
package com.yeshi.fanli.entity.bus.user;
import java.util.Date;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
/**
 * 用户邀请记录
 *
 * @author Administrator
 *
 */
@Table("yeshi_user_invite_record")
public class UserInviteRecord {
    @Column(name = "uir_id")
    private Long id;
    // 邀请人id
    @Column(name = "uir_inviter_id")
    private Long inviterId;
    // 微信id
    @Column(name = "uir_wx_unionid")
    private String wxUnionid;
    // 创建时间
    @Column(name = "uir_create_time")
    private Date createTime;
    // 更新时间
    @Column(name = "uir_update_time")
    private Date updateTime;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public Long getInviterId() {
        return inviterId;
    }
    public void setInviterId(Long inviterId) {
        this.inviterId = inviterId;
    }
    public String getWxUnionid() {
        return wxUnionid;
    }
    public void setWxUnionid(String wxUnionid) {
        this.wxUnionid = wxUnionid;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserLotteryRecord.java
New file
@@ -0,0 +1,105 @@
package com.yeshi.fanli.entity.bus.user;
import java.util.Date;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
/**
 *    抽奖次数记录
 * @author Administrator
 *
 */
@Table("yeshi_ec_user_lottery_record")
public class UserLotteryRecord {
    // 新人抽奖
    public static String TYPE_NEWBIES = "newbies";
    // 天天抽奖-奖励券
    public static String TYPE_DAILY_REBATE= "dailyRebate";
    // 新人抽奖
    public static int COUNT_NEWBIES = 5;
    // 天天抽奖-奖励券
    public static int COUNT_DAILY_REBATE= 5;
    @Column(name = "ulr_id")
    private Long id;
    // 抽奖类型
    @Column(name = "ulr_type")
    private String type;
    // 图片
    @Column(name = "ulr_uid")
    private Long uid;
    // 剩余次数
    @Column(name = "ulr_count")
    private Integer count;
    // 创建时间
    @Column(name = "ulr_create_time")
    private Date createTime;
    // 更新时间
    @Column(name = "ulr_update_time")
    private Date updateTime;
    public UserLotteryRecord(){}
    public UserLotteryRecord(Long id){
        this.id = id;
    }
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public Long getUid() {
        return uid;
    }
    public void setUid(Long uid) {
        this.uid = uid;
    }
    public Integer getCount() {
        return count;
    }
    public void setCount(Integer count) {
        this.count = count;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserSystemCoupon.java
@@ -24,9 +24,10 @@
    
    
    // 来源: 新人抽奖、邀请奖励
    public final static String SOURCE_CHOUJIANG = "新人抽奖";
    public final static String SOURCE_NEWBIES = "新人抽奖";
    public final static String SOURCE_YAOQING = "邀请奖励";
    public final static String SOURCE_SYSTEM_PUSH = "系统赠送";
    public final static String SOURCE_DAILY_REBATE = "奖励券天天抽";
    
    @Expose
    @Column(name = "usc_id")
fanli/src/main/java/com/yeshi/fanli/exception/SpecialPlaceException.java
New file
@@ -0,0 +1,32 @@
package com.yeshi.fanli.exception;
public class SpecialPlaceException extends Exception {
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    private int code;
    private String msg;
    public int getCode() {
        return code;
    }
    public String getMsg() {
        return msg;
    }
    public SpecialPlaceException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public SpecialPlaceException() {
    }
    @Override
    public String getMessage() {
        return this.msg;
    }
}
fanli/src/main/java/com/yeshi/fanli/exception/homemodule/HomeNavbarException.java
New file
@@ -0,0 +1,32 @@
package com.yeshi.fanli.exception.homemodule;
public class HomeNavbarException extends Exception {
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    private int code;
    private String msg;
    public int getCode() {
        return code;
    }
    public String getMsg() {
        return msg;
    }
    public HomeNavbarException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public HomeNavbarException() {
    }
    @Override
    public String getMessage() {
        return this.msg;
    }
}
fanli/src/main/java/com/yeshi/fanli/exception/user/UserExtraTaoBaoInfoException.java
New file
@@ -0,0 +1,32 @@
package com.yeshi.fanli.exception.user;
public class UserExtraTaoBaoInfoException extends Exception {
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    private int code;
    private String msg;
    public int getCode() {
        return code;
    }
    public String getMsg() {
        return msg;
    }
    public UserExtraTaoBaoInfoException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public UserExtraTaoBaoInfoException() {
    }
    @Override
    public String getMessage() {
        return this.msg;
    }
}
fanli/src/main/java/com/yeshi/fanli/exception/user/UserInfoException.java
New file
@@ -0,0 +1,32 @@
package com.yeshi.fanli.exception.user;
public class UserInfoException extends Exception {
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    private int code;
    private String msg;
    public int getCode() {
        return code;
    }
    public String getMsg() {
        return msg;
    }
    public UserInfoException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public UserInfoException() {
    }
    @Override
    public String getMessage() {
        return this.msg;
    }
}
fanli/src/main/java/com/yeshi/fanli/exception/user/UserLotteryRecordException.java
New file
@@ -0,0 +1,32 @@
package com.yeshi.fanli.exception.user;
public class UserLotteryRecordException extends Exception {
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    private int code;
    private String msg;
    public int getCode() {
        return code;
    }
    public String getMsg() {
        return msg;
    }
    public UserLotteryRecordException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public UserLotteryRecordException() {
    }
    @Override
    public String getMessage() {
        return this.msg;
    }
}
fanli/src/main/java/com/yeshi/fanli/mapping/ThreeSaleMapper.xml
@@ -81,6 +81,12 @@
    </select>
<!-- 根据邀请者ID查询关系 -->
    <select id="getByWorkerId" resultMap="BaseResultMap" parameterType="java.lang.Long">
        select     <include refid="Base_Column_List" /> from yeshi_ec_threeSale
        where worker_id = #{0} AND t.state=0 AND (t.expire = 0 OR t.expire IS NULL)
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_threeSale where id = #{id,jdbcType=BIGINT}
@@ -394,6 +400,9 @@
        LEFT JOIN `yeshi_ec_threesale_extra_info` ff
        ON ts.`boss_id` = ff.`tf_boss_id` AND ts.`worker_id`=ff.`tf_worker_id`
        WHERE ts.`boss_id` = #{uid}
            <if test="state != null">
                AND ts.`state` = #{state}
            </if>
        ORDER BY ts.state DESC, ts.expire,
        ts.createTime DESC
        LIMIT ${start},${count}
@@ -419,6 +428,10 @@
        LEFT JOIN `yeshi_ec_threesale_extra_info` ff
        ON yet.`boss_id` =
        ff.`tf_boss_id` AND yet.`worker_id` =ff.`tf_worker_id`
        WHERE
            <if test="state != null">
                AND yet.`state` = #{state}
            </if>
        ORDER BY
        yet.state DESC, yet.expire, yet.createTime DESC
        LIMIT ${start},${count}
fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml
@@ -244,6 +244,21 @@
        <include refid="Base_Column_List" />
        from yeshi_ec_user where appid=#{appId} and phone=#{phone} 
    </select>
    <!-- 根据AppId与电话号码获取用户 -->
    <select id="getEffectiveUserInfoByPhone" resultMap="BaseResultMap">
        select <include refid="Base_Column_List" /> from yeshi_ec_user
        where phone=#{phone} AND state = 0
        LIMIT 1
    </select>
    <!-- 根据AppId与电话号码获取用户 -->
    <select id="getEffectiveUserInfoByWXUnionId" resultMap="BaseResultMap">
        select <include refid="Base_Column_List" /> from yeshi_ec_user
        where wx_union_id=#{unionId} AND state = 0
        LIMIT 1
    </select>
    <select id="getMaxUid" resultType="java.lang.Long">select max(id) from
        yeshi_ec_user
    </select>
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/HomeNavbarMapper.xml
@@ -2,75 +2,33 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeshi.fanli.dao.mybatis.homemodule.HomeNavbarMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar">
    <id column="br_id" property="id" jdbcType="BIGINT"/>
    <result column="br_name" property="name" jdbcType="VARCHAR"/>
    <result column="br_picture" property="picture" jdbcType="VARCHAR"/>
    <result column="br_class_id" property="classId" jdbcType="BIGINT"/>
    <result column="br_swiper_banner_id" property="swiperBannerId" jdbcType="BIGINT"/>
    <result column="br_url" property="url" jdbcType="VARCHAR"/>
     <result column="br_type" property="type"
            typeHandler="com.yeshi.fanli.util.mybatishandler.NavbarTypeEnumHandler" />
    <result column="br_type" property="type" jdbcType="VARCHAR"/>
    <result column="br_orderby" property="orderby" 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"/>
    <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" />
  </resultMap>
  
  <sql id="Base_Column_List">br_id,br_name,br_picture,br_class_id,br_url,br_type,br_orderby,br_createtime,br_updatetime</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
  <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_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}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">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_url,br_type,br_orderby,br_createtime,br_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{classId,jdbcType=BIGINT},#{url,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{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=",">
      <if test="id != null">br_id,</if>
      <if test="name != null">br_name,</if>
      <if test="picture != null">br_picture,</if>
      <if test="classId != null">br_class_id,</if>
      <if test="url != null">br_url,</if>
      <if test="type != null">br_type,</if>
      <if test="orderby != null">br_orderby,</if>
      <if test="createtime != null">br_createtime,</if>
      <if test="updatetime != null">br_updatetime,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="name != null">#{name,jdbcType=VARCHAR},</if>
      <if test="picture != null">#{picture,jdbcType=VARCHAR},</if>
      <if test="classId != null">#{classId,jdbcType=BIGINT},</if>
      <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="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.HomeNavbar">update yeshi_ec_home_navbar set br_name = #{name,jdbcType=VARCHAR},br_picture = #{picture,jdbcType=VARCHAR},br_class_id = #{classId,jdbcType=BIGINT},br_url = #{url,jdbcType=VARCHAR},br_type = #{type,jdbcType=VARCHAR},br_orderby = #{orderby,jdbcType=INTEGER},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>
      <if test="name != null">br_name=#{name,jdbcType=VARCHAR},</if>
      <if test="picture != null">br_picture=#{picture,jdbcType=VARCHAR},</if>
      <if test="classId != null">br_class_id=#{classId,jdbcType=BIGINT},</if>
      <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="createtime != null">br_createtime=#{createtime,jdbcType=TIMESTAMP},</if>
      <if test="updatetime != null">br_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if>
    </set> where br_id = #{id,jdbcType=BIGINT}
  </update>
   <select id="getMaxOrder" resultType="java.lang.Integer">
  <select id="getMaxOrder" resultType="java.lang.Integer">
        SELECT IFNULL(MAX(br_orderby),0) FROM yeshi_ec_home_navbar
   </select>
  </select>
  
   <select id="getChangeOrder" resultMap="BaseResultMap">
  <select id="getChangeOrder" resultMap="BaseResultMap">
        SELECT  <include refid="Base_Column_List" /> FROM yeshi_ec_home_navbar
        WHERE 1=1
        <if test="type == -1">
@@ -82,9 +40,10 @@
            <![CDATA[and br_orderby > #{order} ]]>  
            order by br_orderby 
        </if>
         LIMIT 1
   </select>
   
    <select id="listQuery" resultMap="BaseResultMap">
   <select id="listQuery" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />  FROM yeshi_ec_home_navbar
        WHERE 1=1
           <if test='key != null and key != ""'>
@@ -100,12 +59,83 @@
           <if test='key != null and key != ""'>
                  AND (br_name like '%${key}%') 
           </if>
    </select>
   </select>
      
      <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List">
   <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>
    <select id="getEffectiveByClassId" resultMap="BaseResultMap">
      SELECT * FROM    yeshi_ec_home_navbar
      WHERE br_state = 1  AND br_class_id = #{classId}
      LIMIT 1
   </select>
   <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List">
        delete from yeshi_ec_home_navbar WHERE br_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
    </delete>
   </delete>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
      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_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},#{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=",">
      <if test="id != null">br_id,</if>
      <if test="name != null">br_name,</if>
      <if test="picture != null">br_picture,</if>
      <if test="classId != null">br_class_id,</if>
      <if test="swiperBannerId != null">br_swiper_banner_id,</if>
      <if test="url != null">br_url,</if>
      <if test="type != null">br_type,</if>
      <if test="orderby != null">br_orderby,</if>
      <if test="startTime != null">br_start_time,</if>
      <if test="endTime != null">br_end_time,</if>
      <if test="state != null">br_state,</if>
      <if test="createtime != null">br_createtime,</if>
      <if test="updatetime != null">br_updatetime,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="name != null">#{name,jdbcType=VARCHAR},</if>
      <if test="picture != null">#{picture,jdbcType=VARCHAR},</if>
      <if test="classId != null">#{classId,jdbcType=BIGINT},</if>
      <if test="swiperBannerId != null">#{swiperBannerId,jdbcType=BIGINT},</if>
      <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="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if>
      <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</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.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_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>
      <if test="name != null">br_name=#{name,jdbcType=VARCHAR},</if>
      <if test="picture != null">br_picture=#{picture,jdbcType=VARCHAR},</if>
      <if test="classId != null">br_class_id=#{classId,jdbcType=BIGINT},</if>
      <if test="swiperBannerId != null">br_swiper_banner_id=#{swiperBannerId,jdbcType=BIGINT},</if>
      <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="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>
      <if test="createtime != null">br_createtime=#{createtime,jdbcType=TIMESTAMP},</if>
      <if test="updatetime != null">br_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if>
    </set> where br_id = #{id,jdbcType=BIGINT}
  </update>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SpecialPlaceMapper.xml
New file
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeshi.fanli.dao.mybatis.homemodule.SpecialPlaceMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.homemodule.SpecialPlace">
    <id column="sp_id" property="id" jdbcType="BIGINT"/>
    <result column="sp_place_name" property="placeName" jdbcType="VARCHAR"/>
    <result column="sp_key" property="key" jdbcType="VARCHAR"/>
    <result column="sp_bottom_picture" property="bottomPicture" jdbcType="VARCHAR"/>
    <result column="sp_create_time" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="sp_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
  </resultMap>
  <sql id="Base_Column_List">sp_id,sp_place_name,sp_key,sp_bottom_picture,sp_create_time,sp_update_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_special_place where sp_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_special_place where sp_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.SpecialPlace" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special_place (sp_id,sp_place_name,sp_key,sp_bottom_picture,sp_create_time,sp_update_time) values (#{id,jdbcType=BIGINT},#{placeName,jdbcType=VARCHAR},#{key,jdbcType=VARCHAR},#{bottomPicture,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.SpecialPlace" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special_place
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">sp_id,</if>
      <if test="placeName != null">sp_place_name,</if>
      <if test="key != null">sp_key,</if>
      <if test="bottomPicture != null">sp_bottom_picture,</if>
      <if test="createTime != null">sp_create_time,</if>
      <if test="updateTime != null">sp_update_time,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="placeName != null">#{placeName,jdbcType=VARCHAR},</if>
      <if test="key != null">#{key,jdbcType=VARCHAR},</if>
      <if test="bottomPicture != null">#{bottomPicture,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.SpecialPlace">update yeshi_ec_special_place set sp_place_name = #{placeName,jdbcType=VARCHAR},sp_key = #{key,jdbcType=VARCHAR},sp_bottom_picture = #{bottomPicture,jdbcType=VARCHAR},sp_create_time = #{createTime,jdbcType=TIMESTAMP},sp_update_time = #{updateTime,jdbcType=TIMESTAMP} where sp_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.SpecialPlace">update yeshi_ec_special_place
    <set>
      <if test="placeName != null">sp_place_name=#{placeName,jdbcType=VARCHAR},</if>
      <if test="key != null">sp_key=#{key,jdbcType=VARCHAR},</if>
      <if test="bottomPicture != null">sp_bottom_picture=#{bottomPicture,jdbcType=VARCHAR},</if>
      <if test="createTime != null">sp_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updateTime != null">sp_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
    </set> where sp_id = #{id,jdbcType=BIGINT}
  </update>
  <delete id="deleteByPrimaryKeyList" parameterType="java.util.List">
    delete from yeshi_ec_special_place
    WHERE sp_id in <foreach collection="list" item="item" open="(" separator="," close=")">#{item}</foreach>
  </delete>
  <select id="getList" resultMap="BaseResultMap">
      SELECT * FROM `yeshi_ec_special_place`
  </select>
   <select id="listQuery" resultMap="BaseResultMap">
      SELECT * FROM yeshi_ec_special_place
      WHERE 1=1
          <if test="key != null and key !='' ">
              AND (sp_place_name LIKE '%${key}%' OR sp_key LIKE '%${key}%')
          </if>
      ORDER BY sp_create_time DESC
      LIMIT ${start},${count}
  </select>
  <select id="countQuery" resultType="java.lang.Long">
      SELECT IFNULL(COUNT(sp_id),0) FROM yeshi_ec_special_place
     WHERE 1=1
          <if test="key != null and key !='' ">
              AND (sp_place_name LIKE '%${key}%' OR sp_key LIKE '%${key}%')
          </if>
  </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SwiperPictureMapper.xml
@@ -16,7 +16,9 @@
    <result column="pic_end_time" property="endTime" jdbcType="TIMESTAMP"/>
    <result column="pic_createtime" property="createtime" jdbcType="TIMESTAMP"/>
    <result column="pic_updatetime" property="updatetime" jdbcType="TIMESTAMP"/>
    <association property="jumpDetail" column="pic_jumpid" resultMap="com.yeshi.fanli.dao.mybatis.common.JumpDetailV2Mapper.BaseResultMap"/>
  </resultMap>
  
  <sql id="Base_Column_List">pic_id,pic_banner_id,pic_src,pic_jumpid,pic_params,pic_jump_need_login,pic_order,pic_remark,pic_state,pic_auto_control,pic_start_time,pic_end_time,pic_createtime,pic_updatetime</sql>
@@ -146,4 +148,13 @@
        ORDER BY p.`pic_order`
   </select>
   
    <select id="getByBannerId" resultMap="BaseResultMap">
        SELECT * FROM `yeshi_ec_swiper_banner` w
        LEFT JOIN  `yeshi_ec_swiper_banner_picture` p ON p.`pic_banner_id` = w.`sp_id`
        LEFT JOIN `yeshi_ec_action_jumpdetail_v2` j ON j.`jp_id` = p.`pic_jumpid`
        WHERE w.`sp_id` = #{bannerId} AND w.`sp_state` = 0 AND p.`pic_state`= 0
            <![CDATA[AND IF(p.`pic_auto_control` = 1, p.`pic_start_time` <= NOW() AND p.`pic_end_time` >= NOW(),TRUE)]]>
        ORDER BY p.`pic_order`
   </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/lable/QualityFactoryMapper.xml
@@ -964,6 +964,19 @@
    </select>
    <select id="listFlashSaleRandGoods" resultMap="GoodsResultMap">
        SELECT h.*, tb.* FROM yeshi_ec_quality_factory h
        RIGHT JOIN yeshi_ec_quality_flash_sale s ON h.`sg_id` = s.`fs_qfgoods_id`
        LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id`
        WHERE  s.`fs_id` IS NOT NULL AND tb.`biz30day` <![CDATA[>=]]> 10000
             AND tb.`couponTotalCount` <![CDATA[>]]>10
             AND tb.couponLeftCount <![CDATA[<]]> tb.couponTotalCount
        ORDER BY RAND()
        LIMIT 3
    </select>
    <!-- 查询精选商品信息 -->
    <select id="listQueryByKeyAndlabIDs" resultMap="BaseResultMap">
fanli/src/main/java/com/yeshi/fanli/mapping/taobao/TaoBaoUnionAuthRecordMapper.xml
@@ -88,4 +88,12 @@
        </set>
        where tuar_id = #{id,jdbcType=BIGINT}
    </update>
    <select id="getTaoBaoUserNick" resultType="java.lang.String">
        SELECT u.`tuar_taobao_user_nick` FROM `yeshi_ec_taobao_union_auth_record` u
        WHERE u.`tuar_uid` = #{uid}
        ORDER BY u.`tuar_create_time` DESC
        LIMIT 1
    </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserExtraTaoBaoInfoMapper.xml
@@ -2,46 +2,31 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeshi.fanli.dao.mybatis.user.UserExtraTaoBaoInfoMapper">
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo">
        <id column="uiet_id" property="id" jdbcType="BIGINT" />
        <result column="uiet_relation_id" property="relationId"
            jdbcType="VARCHAR" />
        <result column="uiet_relation_update_time" property="relationUpdateTime"
            jdbcType="TIMESTAMP" />
        <result column="uiet_special_id" property="specialId" jdbcType="VARCHAR" />
        <result column="uiet_special_update_time" property="specialUpdateTime"
            jdbcType="TIMESTAMP" />
        <result column="uiet_create_time" property="createTime"
            jdbcType="TIMESTAMP" />
        <result column="uiet_update_time" property="updateTime"
            jdbcType="TIMESTAMP" />
        <result column="uiet_relation_valid" property="relationValid"
            jdbcType="BOOLEAN" />
        <result column="uiet_special_valid" property="specialValid"
            jdbcType="BOOLEAN" />
        <result column="uiet_taobao_uid" property="taoBaoUid" jdbcType="VARCHAR" />
        <result column="uiet_taobao_order_end_6_num" property="taoBaoOrderEnd6Num"
            jdbcType="VARCHAR" />
        <association property="user" column="uiet_uid"
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo">
    <id column="uiet_id" property="id" jdbcType="BIGINT"/>
    <result column="uiet_relation_id" property="relationId" jdbcType="VARCHAR"/>
    <result column="uiet_relation_valid" property="relationValid" jdbcType="BOOLEAN"/>
    <result column="uiet_relation_update_time" property="relationUpdateTime" jdbcType="TIMESTAMP"/>
    <result column="uiet_special_id" property="specialId" jdbcType="VARCHAR"/>
    <result column="uiet_special_valid" property="specialValid" jdbcType="BOOLEAN"/>
    <result column="uiet_special_update_time" property="specialUpdateTime" jdbcType="TIMESTAMP"/>
    <result column="uiet_taobao_uid" property="taoBaoUid" jdbcType="VARCHAR"/>
    <result column="uiet_taobao_order_end_6_num" property="taoBaoOrderEnd6Num" jdbcType="VARCHAR"/>
    <result column="uiet_taobao_nick_name" property="taoBaoNickName" jdbcType="VARCHAR"/>
    <result column="uiet_create_time" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="uiet_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
    <association property="user" column="uiet_uid"
            javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
            <id column="uiet_uid" property="id" />
        </association>
    </resultMap>
    <sql id="Base_Column_List">uiet_id,uiet_uid,uiet_relation_id,uiet_relation_update_time,uiet_special_id,uiet_special_update_time,uiet_create_time,uiet_update_time,uiet_relation_valid,uiet_special_valid,uiet_taobao_uid,uiet_taobao_order_end_6_num
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_user_info_extra_taobao where uiet_id =
        #{id,jdbcType=BIGINT}
    </select>
  </resultMap>
  <sql id="Base_Column_List">uiet_id,uiet_uid,uiet_relation_id,uiet_relation_valid,uiet_relation_update_time,uiet_special_id,uiet_special_valid,uiet_special_update_time,uiet_taobao_uid,uiet_taobao_order_end_6_num,uiet_taobao_nick_name,uiet_create_time,uiet_update_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_user_info_extra_taobao where uiet_id = #{id,jdbcType=BIGINT}
  </select>
    <select id="selectByUid" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
@@ -57,6 +42,11 @@
        from yeshi_ec_user_info_extra_taobao where uiet_taobao_uid =
        #{0} limit
        1
    </select>
    <select id="listByTaoBaoUid" resultMap="BaseResultMap" parameterType="java.lang.String">
        SELECT * FROM yeshi_ec_user_info_extra_taobao tb
        WHERE  tb.`uiet_taobao_uid` = #{0} AND tb.`uiet_uid` IS NOT NULL
    </select>
@@ -79,94 +69,61 @@
        #{0} and
        uiet_uid is not null limit 1
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_user_info_extra_taobao where uiet_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_user_info_extra_taobao
        (uiet_id,uiet_uid,uiet_relation_id,uiet_relation_update_time,uiet_special_id,uiet_special_update_time,uiet_create_time,uiet_update_time,uiet_relation_valid,uiet_special_valid,uiet_taobao_uid,uiet_taobao_order_end_6_num)
        values
        (#{id,jdbcType=BIGINT},#{user.id,jdbcType=BIGINT},#{relationId,jdbcType=VARCHAR},#{relationUpdateTime,jdbcType=TIMESTAMP},#{specialId,jdbcType=VARCHAR},#{specialUpdateTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{relationValid,jdbcType=BOOLEAN},#{specialValid,jdbcType=BOOLEAN},#{taoBaoUid,jdbcType=VARCHAR},#{taoBaoOrderEnd6Num,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_user_info_extra_taobao
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">uiet_id,</if>
            <if test="user != null">uiet_uid,</if>
            <if test="relationId != null">uiet_relation_id,</if>
            <if test="relationUpdateTime != null">uiet_relation_update_time,</if>
            <if test="specialId != null">uiet_special_id,</if>
            <if test="specialUpdateTime != null">uiet_special_update_time,</if>
            <if test="createTime != null">uiet_create_time,</if>
            <if test="updateTime != null">uiet_update_time,</if>
            <if test="relationValid != null">uiet_relation_valid,</if>
            <if test="specialValid != null">uiet_special_valid,</if>
            <if test="taoBaoUid != null">uiet_taobao_uid,</if>
            <if test="taoBaoOrderEnd6Num != null">uiet_taobao_order_end_6_num,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="user != null">#{user.id,jdbcType=BIGINT},</if>
            <if test="relationId != null">#{relationId,jdbcType=VARCHAR},</if>
            <if test="relationUpdateTime != null">#{relationUpdateTime,jdbcType=TIMESTAMP},</if>
            <if test="specialId != null">#{specialId,jdbcType=VARCHAR},</if>
            <if test="specialUpdateTime != null">#{specialUpdateTime,jdbcType=TIMESTAMP},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="relationValid != null">#{relationValid,jdbcType=BOOLEAN},</if>
            <if test="specialValid != null">#{specialValid,jdbcType=BOOLEAN},</if>
            <if test="taoBaoUid != null">#{taoBaoUid,jdbcType=VARCHAR},</if>
            <if test="taoBaoOrderEnd6Num != null">#{taoBaoOrderEnd6Num,jdbcType=VARCHAR},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo">update
        yeshi_ec_user_info_extra_taobao set uiet_uid =
        #{user.id,jdbcType=BIGINT},uiet_relation_id =
        #{relationId,jdbcType=VARCHAR},uiet_relation_update_time =
        #{relationUpdateTime,jdbcType=TIMESTAMP},uiet_special_id =
        #{specialId,jdbcType=VARCHAR},uiet_special_update_time =
        #{specialUpdateTime,jdbcType=TIMESTAMP},uiet_create_time =
        #{createTime,jdbcType=TIMESTAMP},uiet_update_time =
        #{updateTime,jdbcType=TIMESTAMP} ,uiet_relation_valid
        =#{relationValid,jdbcType=BOOLEAN} ,uiet_special_valid
        =#{specialValid,jdbcType=BOOLEAN} ,uiet_taobao_uid
        =#{taoBaoUid,jdbcType=VARCHAR},uiet_taobao_order_end_6_num
        =#{taoBaoOrderEnd6Num,jdbcType=VARCHAR}
        where uiet_id =
        #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo">
        update yeshi_ec_user_info_extra_taobao
        <set>
            <if test="user != null">uiet_uid=#{user.id,jdbcType=BIGINT},</if>
            <if test="relationId != null">uiet_relation_id=#{relationId,jdbcType=VARCHAR},</if>
            <if test="relationUpdateTime != null">uiet_relation_update_time=#{relationUpdateTime,jdbcType=TIMESTAMP},
            </if>
            <if test="specialId != null">uiet_special_id=#{specialId,jdbcType=VARCHAR},</if>
            <if test="specialUpdateTime != null">uiet_special_update_time=#{specialUpdateTime,jdbcType=TIMESTAMP},
            </if>
            <if test="createTime != null">uiet_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">uiet_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="id !=null">uiet_id =#{id,jdbcType=BIGINT},</if>
            <if test="relationValid !=null">uiet_relation_valid =#{relationValid,jdbcType=BOOLEAN},
            </if>
            <if test="specialValid !=null">uiet_special_valid =#{specialValid,jdbcType=BOOLEAN},
            </if>
            <if test="taoBaoUid !=null">uiet_taobao_uid =#{taoBaoUid,jdbcType=VARCHAR},</if>
            <if test="taoBaoOrderEnd6Num !=null">uiet_taobao_order_end_6_num=#{taoBaoOrderEnd6Num,jdbcType=VARCHAR},
            </if>
        </set>
        where uiet_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="clearUid" parameterType="java.lang.Long">
        update
        yeshi_ec_user_info_extra_taobao set uiet_uid=null where uiet_uid=#{0}
    </update>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_info_extra_taobao where uiet_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_info_extra_taobao (uiet_id,uiet_uid,uiet_relation_id,uiet_relation_valid,uiet_relation_update_time,uiet_special_id,uiet_special_valid,uiet_special_update_time,uiet_taobao_uid,uiet_taobao_order_end_6_num,uiet_taobao_nick_name,uiet_create_time,uiet_update_time) values (#{id,jdbcType=BIGINT},#{user.id,jdbcType=BIGINT},#{relationId,jdbcType=VARCHAR},#{relationValid,jdbcType=BOOLEAN},#{relationUpdateTime,jdbcType=TIMESTAMP},#{specialId,jdbcType=VARCHAR},#{specialValid,jdbcType=BOOLEAN},#{specialUpdateTime,jdbcType=TIMESTAMP},#{taoBaoUid,jdbcType=VARCHAR},#{taoBaoOrderEnd6Num,jdbcType=VARCHAR},#{taoBaoNickName,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_info_extra_taobao
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">uiet_id,</if>
      <if test="user != null">uiet_uid,</if>
      <if test="relationId != null">uiet_relation_id,</if>
      <if test="relationValid != null">uiet_relation_valid,</if>
      <if test="relationUpdateTime != null">uiet_relation_update_time,</if>
      <if test="specialId != null">uiet_special_id,</if>
      <if test="specialValid != null">uiet_special_valid,</if>
      <if test="specialUpdateTime != null">uiet_special_update_time,</if>
      <if test="taoBaoUid != null">uiet_taobao_uid,</if>
      <if test="taoBaoOrderEnd6Num != null">uiet_taobao_order_end_6_num,</if>
      <if test="taoBaoNickName != null">uiet_taobao_nick_name,</if>
      <if test="createTime != null">uiet_create_time,</if>
      <if test="updateTime != null">uiet_update_time,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="user != null">#{user.id,jdbcType=BIGINT},</if>
      <if test="relationId != null">#{relationId,jdbcType=VARCHAR},</if>
      <if test="relationValid != null">#{relationValid,jdbcType=BOOLEAN},</if>
      <if test="relationUpdateTime != null">#{relationUpdateTime,jdbcType=TIMESTAMP},</if>
      <if test="specialId != null">#{specialId,jdbcType=VARCHAR},</if>
      <if test="specialValid != null">#{specialValid,jdbcType=BOOLEAN},</if>
      <if test="specialUpdateTime != null">#{specialUpdateTime,jdbcType=TIMESTAMP},</if>
      <if test="taoBaoUid != null">#{taoBaoUid,jdbcType=VARCHAR},</if>
      <if test="taoBaoOrderEnd6Num != null">#{taoBaoOrderEnd6Num,jdbcType=VARCHAR},</if>
      <if test="taoBaoNickName != null">#{taoBaoNickName,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.user.UserExtraTaoBaoInfo">update yeshi_ec_user_info_extra_taobao set uiet_uid = #{user.id,jdbcType=BIGINT},uiet_relation_id = #{relationId,jdbcType=VARCHAR},uiet_relation_valid = #{relationValid,jdbcType=BOOLEAN},uiet_relation_update_time = #{relationUpdateTime,jdbcType=TIMESTAMP},uiet_special_id = #{specialId,jdbcType=VARCHAR},uiet_special_valid = #{specialValid,jdbcType=BOOLEAN},uiet_special_update_time = #{specialUpdateTime,jdbcType=TIMESTAMP},uiet_taobao_uid = #{taoBaoUid,jdbcType=VARCHAR},uiet_taobao_order_end_6_num = #{taoBaoOrderEnd6Num,jdbcType=VARCHAR},uiet_taobao_nick_name = #{taoBaoNickName,jdbcType=VARCHAR},uiet_create_time = #{createTime,jdbcType=TIMESTAMP},uiet_update_time = #{updateTime,jdbcType=TIMESTAMP} where uiet_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo">update yeshi_ec_user_info_extra_taobao
    <set>
      <if test="user != null">uiet_uid=#{user.id,jdbcType=BIGINT},</if>
      <if test="relationId != null">uiet_relation_id=#{relationId,jdbcType=VARCHAR},</if>
      <if test="relationValid != null">uiet_relation_valid=#{relationValid,jdbcType=BOOLEAN},</if>
      <if test="relationUpdateTime != null">uiet_relation_update_time=#{relationUpdateTime,jdbcType=TIMESTAMP},</if>
      <if test="specialId != null">uiet_special_id=#{specialId,jdbcType=VARCHAR},</if>
      <if test="specialValid != null">uiet_special_valid=#{specialValid,jdbcType=BOOLEAN},</if>
      <if test="specialUpdateTime != null">uiet_special_update_time=#{specialUpdateTime,jdbcType=TIMESTAMP},</if>
      <if test="taoBaoUid != null">uiet_taobao_uid=#{taoBaoUid,jdbcType=VARCHAR},</if>
      <if test="taoBaoOrderEnd6Num != null">uiet_taobao_order_end_6_num=#{taoBaoOrderEnd6Num,jdbcType=VARCHAR},</if>
      <if test="taoBaoNickName != null">uiet_taobao_nick_name=#{taoBaoNickName,jdbcType=VARCHAR},</if>
      <if test="createTime != null">uiet_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updateTime != null">uiet_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
    </set> where uiet_id = #{id,jdbcType=BIGINT}
  </update>
  <update id="clearUid" parameterType="java.lang.Long">
    update yeshi_ec_user_info_extra_taobao set uiet_uid=null where uiet_uid=#{0}
  </update>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserInviteRecordMapper.xml
New file
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeshi.fanli.dao.mybatis.user.UserInviteRecordMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.UserInviteRecord">
    <id column="uir_id" property="id" jdbcType="BIGINT"/>
    <result column="uir_inviter_id" property="inviterId" jdbcType="BIGINT"/>
    <result column="uir_wx_unionid" property="wxUnionid" jdbcType="VARCHAR"/>
    <result column="uir_create_time" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="uir_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
  </resultMap>
  <sql id="Base_Column_List">uir_id,uir_inviter_id,uir_wx_unionid,uir_create_time,uir_update_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_user_invite_record where uir_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_user_invite_record where uir_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserInviteRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_user_invite_record (uir_id,uir_inviter_id,uir_wx_unionid,uir_create_time,uir_update_time) values (#{id,jdbcType=BIGINT},#{inviterId,jdbcType=BIGINT},#{wxUnionid,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInviteRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_user_invite_record
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">uir_id,</if>
      <if test="inviterId != null">uir_inviter_id,</if>
      <if test="wxUnionid != null">uir_wx_unionid,</if>
      <if test="createTime != null">uir_create_time,</if>
      <if test="updateTime != null">uir_update_time,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="inviterId != null">#{inviterId,jdbcType=BIGINT},</if>
      <if test="wxUnionid != null">#{wxUnionid,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.user.UserInviteRecord">update yeshi_user_invite_record set uir_inviter_id = #{inviterId,jdbcType=BIGINT},uir_wx_unionid = #{wxUnionid,jdbcType=VARCHAR},uir_create_time = #{createTime,jdbcType=TIMESTAMP},uir_update_time = #{updateTime,jdbcType=TIMESTAMP} where uir_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInviteRecord">update yeshi_user_invite_record
    <set>
      <if test="inviterId != null">uir_inviter_id=#{inviterId,jdbcType=BIGINT},</if>
      <if test="wxUnionid != null">uir_wx_unionid=#{wxUnionid,jdbcType=VARCHAR},</if>
      <if test="createTime != null">uir_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updateTime != null">uir_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
    </set> where uir_id = #{id,jdbcType=BIGINT}
  </update>
  <select id="getByInviterIdAndUnionid" resultMap="BaseResultMap">
      SELECT * FROM yeshi_user_invite_record d
    WHERE d.`uir_inviter_id` = #{inviterId} AND d.`uir_wx_unionid`= #{wxUnionId}
    LIMIT 1
  </select>
  <select id="getNewestInviterId" resultType="java.lang.Long">
      SELECT uir_inviter_id FROM yeshi_user_invite_record d
    WHERE d.`uir_wx_unionid`= #{wxUnionId}
    ORDER BY d.`uir_update_time` DESC
    LIMIT 1
  </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserLotteryRecordMapper.xml
New file
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeshi.fanli.dao.mybatis.user.UserLotteryRecordMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.UserLotteryRecord">
    <id column="ulr_id" property="id" jdbcType="BIGINT"/>
    <result column="ulr_type" property="type" jdbcType="VARCHAR"/>
    <result column="ulr_uid" property="uid" jdbcType="BIGINT"/>
    <result column="ulr_count" property="count" jdbcType="INTEGER"/>
    <result column="ulr_create_time" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="ulr_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
  </resultMap>
  <sql id="Base_Column_List">ulr_id,ulr_type,ulr_uid,ulr_count,ulr_create_time,ulr_update_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_user_lottery_record where ulr_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_lottery_record where ulr_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserLotteryRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_lottery_record (ulr_id,ulr_type,ulr_uid,ulr_count,ulr_create_time,ulr_update_time) values (#{id,jdbcType=BIGINT},#{type,jdbcType=VARCHAR},#{uid,jdbcType=BIGINT},#{count,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserLotteryRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_lottery_record
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">ulr_id,</if>
      <if test="type != null">ulr_type,</if>
      <if test="uid != null">ulr_uid,</if>
      <if test="count != null">ulr_count,</if>
      <if test="createTime != null">ulr_create_time,</if>
      <if test="updateTime != null">ulr_update_time,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="type != null">#{type,jdbcType=VARCHAR},</if>
      <if test="uid != null">#{uid,jdbcType=BIGINT},</if>
      <if test="count != null">#{count,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.user.UserLotteryRecord">update yeshi_ec_user_lottery_record set ulr_type = #{type,jdbcType=VARCHAR},ulr_uid = #{uid,jdbcType=BIGINT},ulr_count = #{count,jdbcType=INTEGER},ulr_create_time = #{createTime,jdbcType=TIMESTAMP},ulr_update_time = #{updateTime,jdbcType=TIMESTAMP} where ulr_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.UserLotteryRecord">update yeshi_ec_user_lottery_record
    <set>
      <if test="type != null">ulr_type=#{type,jdbcType=VARCHAR},</if>
      <if test="uid != null">ulr_uid=#{uid,jdbcType=BIGINT},</if>
      <if test="count != null">ulr_count=#{count,jdbcType=INTEGER},</if>
      <if test="createTime != null">ulr_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updateTime != null">ulr_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
    </set> where ulr_id = #{id,jdbcType=BIGINT}
  </update>
  <select id="getByTypeAndUid" resultMap="BaseResultMap">
      SELECT * FROM  yeshi_ec_user_lottery_record  t
    WHERE t.`ulr_uid` = #{uid} AND  t.`ulr_type` = #{type}
  </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/HomeNavbarServiceImpl.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.service.impl.homemodule;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -19,6 +20,8 @@
import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar;
import com.yeshi.fanli.entity.bus.homemodule.SuperHomeNavbar;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.exception.ActivityException;
import com.yeshi.fanli.exception.homemodule.HomeNavbarException;
import com.yeshi.fanli.service.inter.config.BusinessSystemService;
import com.yeshi.fanli.service.inter.homemodule.HomeNavbarService;
import com.yeshi.fanli.util.StringUtil;
@@ -35,36 +38,6 @@
    private SuperHomeNavbarMapper superHomeNavbarMapper;
    
    @Override
    public int deleteByPrimaryKey(Long id) {
        return homeNavbarMapper.deleteByPrimaryKey(id);
    }
    @Override
    public int insert(HomeNavbar record) {
        return homeNavbarMapper.insert(record);
    }
    @Override
    public int insertSelective(HomeNavbar record) {
        return homeNavbarMapper.insertSelective(record);
    }
    @Override
    public HomeNavbar selectByPrimaryKey(Long id) {
        return homeNavbarMapper.selectByPrimaryKey(id);
    }
    @Override
    public int updateByPrimaryKeySelective(HomeNavbar record) {
        return homeNavbarMapper.updateByPrimaryKeySelective(record);
    }
    @Override
    public int updateByPrimaryKey(HomeNavbar record) {
        return homeNavbarMapper.updateByPrimaryKey(record);
    }
    @Override
    @Transactional
    public int deleteBatchByPrimaryKey(List<Long> list) {
@@ -83,18 +56,160 @@
        return homeNavbarMapper.deleteBatchByPrimaryKey(list);
    }
    @Override
    public int getMaxOrder() {
        return homeNavbarMapper.getMaxOrder();
    }
    @Override
    public List<HomeNavbar> getChangeOrder(Integer type, Integer order) {
        return homeNavbarMapper.getChangeOrder(type, order);
    public void saveObject(MultipartFile file, HomeNavbar record) throws HomeNavbarException, Exception{
        String name = record.getName();
        if (name == null || name.trim().length() == 0) {
            throw new HomeNavbarException(1, "导航名称不能为空");
        }
        // 时间转换
        conversionTime(record);
        // 图片上传
        String picture = null;
        if (file != null) {
            picture = uploadPicture(file);
        }
        Long id = record.getId();
        if (id == null) {
            record.setPicture(picture);
            record.setCreatetime(new Date());
            record.setUpdatetime(new Date());
            Integer state = record.getState();
            if (state == null) {
                record.setState(0);
            }
            int maxOrder = homeNavbarMapper.getMaxOrder();
            record.setOrderby(maxOrder + 1);
            homeNavbarMapper.insert(record);
        } else {
            // 修改
            HomeNavbar resultObj = homeNavbarMapper.selectByPrimaryKey(id);
            if (resultObj == null) {
                throw new HomeNavbarException(1, "修改内容已不存在");
            }
            if (picture != null && picture.trim().length() > 0) {
                // 删除老图
                removePicture(resultObj.getPicture());
                // 存储新图
                record.setPicture(picture);
            } else {
                record.setPicture(resultObj.getPicture());
            }
            record.setOrderby(resultObj.getOrderby());
            record.setCreatetime(resultObj.getCreatetime());
            record.setUpdatetime(new Date());
            homeNavbarMapper.updateByPrimaryKey(record);
        }
    }
    /**
     * 上传图片
     * @param file
     * @return
     * @throws Exception
     */
    public String uploadPicture(MultipartFile file) throws Exception {
        // 文件解析
        InputStream inputStream = file.getInputStream();
        String contentType = file.getContentType();
        String type = contentType.substring(contentType.indexOf("/") + 1);
        // 文件路径
        String filePath="/img/HomeNavbar/"+UUID.randomUUID().toString().replace("-", "") + "." + type;
        // 执行上传
        String fileLink= COSManager.getInstance().uploadFile(inputStream, filePath).getUrl();
        return fileLink;
    }
    /**
     * 删除图片-不更新数据库
     * @param record
     * @throws Exception
     */
    public void removePicture(String picture) throws Exception {
        if (picture != null && picture.trim().length() > 0) {
            COSManager.getInstance().deleteFile(picture);
        }
    }
    /**
     * web段时间转换
     * @param record
     */
    public void conversionTime(HomeNavbar record) throws ActivityException, Exception {
        // 是否时间控制
        if(!record.isTimeTask()) {
            record.setStartTime(null);
            record.setEndTime(null);
        } else {
            String startTime_str = record.getStartTime_str();
            String endTime_str = record.getEndTime_str();
            if ((startTime_str == null|| startTime_str.trim().length() == 0)
                    && (endTime_str == null || endTime_str.trim().length() == 0)) {
                throw new ActivityException(1, "请输入控制时间");
            } else {
                SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
                if (startTime_str != null && startTime_str.trim().length() > 0) {
                    startTime_str = startTime_str.replaceAll("T", " ");
                    record.setStartTime(format.parse(startTime_str));
                }
                if (endTime_str != null && endTime_str.trim().length() > 0) {
                    endTime_str = endTime_str.replaceAll("T", " ");
                    record.setEndTime(format.parse(endTime_str));
                }
            }
        }
    }
    @Override
    public List<HomeNavbar> listQuery(long start, int count, String key) {
    public void updateOrder(Long id, Integer moveType) throws HomeNavbarException, Exception{
        if (moveType == null || (!moveType.equals(1) && !moveType.equals(-1))) {
            throw new HomeNavbarException(1, "传递的类型不正确");
        }
        if (id == null) {
            throw new HomeNavbarException(1, "ID不能为空");
        }
        HomeNavbar resultObj = homeNavbarMapper.selectByPrimaryKey(id);
        if (resultObj == null) {
            throw new HomeNavbarException(1, "操作数据已不存在");
        }
        Integer oldOrder = resultObj.getOrderby();
        HomeNavbar changeObj = homeNavbarMapper.getChangeOrder(moveType, oldOrder);
        if (changeObj == null ) {
            throw new HomeNavbarException(1, "已经在最边缘,无可交换的位置");
        }
        // 交换排序序号
        resultObj.setOrderby(changeObj.getOrderby());
        changeObj.setOrderby(oldOrder);
        homeNavbarMapper.updateByPrimaryKeySelective(changeObj);
        homeNavbarMapper.updateByPrimaryKeySelective(resultObj);
    }
    @Override
    public List<HomeNavbar> listQueryAndBusinessSystem(long start, int count, String key) {
        
        List<HomeNavbar> listObj = homeNavbarMapper.listQuery(start, count, key);
        if (listObj == null || listObj.size() == 0) {
@@ -162,35 +277,57 @@
        return listObj;
    }
    @Override
    public List<HomeNavbar> listQuery(long start, int count, String key) {
        List<HomeNavbar> listObj = homeNavbarMapper.listQuery(start, count, key);
        if (listObj == null || listObj.size() == 0) {
            return null;
        }
        for (HomeNavbar homeNavbar: listObj) {
            Date startTime = homeNavbar.getStartTime();
            Date endTime = homeNavbar.getEndTime();
            if (startTime == null && endTime == null) {
                homeNavbar.setTimeTask(false);
                homeNavbar.setStartTime_str("");
                homeNavbar.setEndTime_str("");
            } else {
                homeNavbar.setTimeTask(true);
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
                if (startTime == null) {
                    homeNavbar.setStartTime_str("");
                } else {
                    homeNavbar.setStartTime_str(sdf.format(startTime));
                }
                if (endTime == null) {
                    homeNavbar.setEndTime_str("");
                } else {
                    homeNavbar.setEndTime_str(sdf.format(endTime));
                }
            }
        }
        return listObj;
    }
    @Override
    public long countlistQuery(String key) {
        return homeNavbarMapper.countListQuery(key);
    }
    @Override
    public List<HomeNavbar> listQueryEffective() {
        return homeNavbarMapper.listQueryEffective();
    }
    @Override
    public void uploadPicture(MultipartFile file, HomeNavbar homeNavbar) throws Exception {
        InputStream inputStream = file.getInputStream();
        String contentType = file.getContentType();
        String type = contentType.substring(contentType.indexOf("/") + 1);
        // 上传文件相对位置
        String fileUrl="HomeNavbar/"+UUID.randomUUID().toString().replace("-", "") + "." + type;
        /*  修改图片时,先删除已存在图片  */
        String picture = homeNavbar.getPicture();
        if (!StringUtil.isNullOrEmpty(picture)) {
            COSManager.getInstance().deleteFile(picture);
        }
        String uploadFilePath = COSManager.getInstance().uploadFile(inputStream, fileUrl).getUrl();
        /*  更新数据库信息  */
        if (!StringUtil.isNullOrEmpty(uploadFilePath)) {
            homeNavbar.setUpdatetime(new Date());
            homeNavbar.setPicture(uploadFilePath);
            updateByPrimaryKeySelective(homeNavbar);
        }
    public HomeNavbar getEffectiveByClassId(Long classId) {
        return homeNavbarMapper.getEffectiveByClassId(classId);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialPlaceImpl.java
New file
@@ -0,0 +1,82 @@
package com.yeshi.fanli.service.impl.homemodule;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import javax.transaction.Transactional;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.homemodule.SpecialPlaceMapper;
import com.yeshi.fanli.entity.bus.homemodule.SpecialPlace;
import com.yeshi.fanli.exception.FloatADException;
import com.yeshi.fanli.exception.SpecialPlaceException;
import com.yeshi.fanli.service.inter.homemodule.SpecialPlaceService;
@Service
public class SpecialPlaceImpl implements SpecialPlaceService {
    @Resource
    private SpecialPlaceMapper specialPlaceMapper;
    @Override
    public void saveObject(SpecialPlace record) throws SpecialPlaceException, Exception{
        String placeName = record.getPlaceName();
        if (placeName == null || placeName.trim().length() == 0) {
            throw new FloatADException(1, "位置名称不能为空");
        }
        String key = record.getKey();
        if (key == null || key.trim().length() == 0) {
            throw new FloatADException(1, "位置标识不能为空");
        }
        Long id = record.getId();
        if (id == null) {
            record.setCreateTime(new Date());
            record.setUpdateTime(new Date());
            specialPlaceMapper.insert(record);
        } else {
            // 修改
            SpecialPlace resultObj = specialPlaceMapper.selectByPrimaryKey(id);
            if (resultObj == null) {
                throw new FloatADException(1, "修改内容已不存在");
            }
            record.setCreateTime(resultObj.getCreateTime());
            record.setUpdateTime(new Date());
            specialPlaceMapper.updateByPrimaryKey(record);
        }
    }
    @Override
    @Transactional
    public int deleteByPrimaryKeyList(List<Long> list) throws Exception{
        return specialPlaceMapper.deleteByPrimaryKeyList(list);
    }
    @Override
    public List<SpecialPlace> listQuery(long start, int count, String key) throws Exception {
        return specialPlaceMapper.listQuery(start, count, key);
    }
    @Override
    public long countQuery(String key) {
        return specialPlaceMapper.countQuery(key);
    }
    @Override
    public List<SpecialPlace> getList() {
        return specialPlaceMapper.getList();
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.service.impl.homemodule;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
@@ -11,12 +12,17 @@
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.tencentcloud.COSManager;
import com.yeshi.fanli.dao.mybatis.homemodule.SpecialMapper;
import com.yeshi.fanli.entity.bus.homemodule.Special;
import com.yeshi.fanli.entity.bus.homemodule.SpecialPlace;
import com.yeshi.fanli.service.inter.homemodule.SpecialPlaceService;
import com.yeshi.fanli.service.inter.homemodule.SpecialService;
import com.yeshi.fanli.util.StringUtil;
import net.sf.json.JSONObject;
@Service
@@ -24,6 +30,9 @@
    
    @Resource
    private SpecialMapper specialMapper;
    @Resource
    private SpecialPlaceService specialPlaceService;
    
    @Override
@@ -120,6 +129,69 @@
    
    @Override
    @Cacheable(value = "configCache", key = "'getSpecialListCache-'+#card+'-'+#systemId")
    public JSONObject getSpecialListCache(String card, Long systemId) throws Exception{
        // 两行圆形专题
        List<Special> arcList = new ArrayList<Special>();
        // 活动列表
        List<Special> activityList = new ArrayList<Special>();
        // 方块部分
        List<Special> blockList = new ArrayList<Special>();
        List<Special> list = specialMapper.listBySystemAndCard(card, systemId);
        if (list != null && list.size() > 0) {
            for (Special special : list) {
                if (Special.SHOWTYPE_ARC.equals(special.getShowType())) {
                    // 两行圆形专题
                    arcList.add(special);
                } else if (Special.SHOWTYPE_BLOCK.equals(special.getShowType())) {
                    // 方块部分
                    blockList.add(special);
                } else if (Special.SHOWTYPE_ACTIVITY.equals(special.getShowType())) {
                    // 动态
                    activityList.add(special);
                }
            }
        }
        JSONObject arcMap = new JSONObject();
        arcMap.put("list", JsonUtil.getApiCommonGson().toJson(arcList));
        JSONObject activityMap = new JSONObject();
        activityMap.put("list", JsonUtil.getApiCommonGson().toJson(activityList));
        JSONObject blockJsonMap = new JSONObject();
        blockJsonMap.put("list", JsonUtil.getApiCommonGson().toJson(blockList));
        // 背景图片
        List<SpecialPlace> listPlace = specialPlaceService.getList();
        if (listPlace != null && listPlace.size() > 0) {
            for (SpecialPlace specialPlace: listPlace) {
                String bottomPicture = specialPlace.getBottomPicture();
                if (bottomPicture != null && bottomPicture.trim().length() > 0) {
                    if (Special.SHOWTYPE_ARC.equals(specialPlace.getKey())) {
                        arcMap.put("bottomPicture", bottomPicture);
                    } else if (Special.SHOWTYPE_BLOCK.equals(specialPlace.getKey())) {
                        blockJsonMap.put("bottomPicture", bottomPicture);
                    } else if (Special.SHOWTYPE_ACTIVITY.equals(specialPlace.getKey())) {
                        activityMap.put("bottomPicture", bottomPicture);
                    }
                }
            }
        }
        JSONObject rootMap = new JSONObject();
        rootMap.put("arcArea", arcMap);
        rootMap.put("activityArea", activityMap);
        rootMap.put("blockArea", blockJsonMap);
        return rootMap;
    }
    @Override
    public void uploadPicture(MultipartFile file, Special record, Long cardId) throws Exception {
        
        InputStream inputStream = file.getInputStream();
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SwiperPictureServiceImpl.java
@@ -233,7 +233,25 @@
    @Override
    @Cacheable(value = "bannerCache", key = "'getByBannerCard-'+#card")
    public List<SwiperPicture> getByBannerCard(String card) throws SwiperPictureException {
        return swiperPictureMapper.getByBannerCard(card);
        List<SwiperPicture> list = swiperPictureMapper.getByBannerCard(card);
        if (list != null && list.size() > 0) {
            for (SwiperPicture swiperPicture: list) {
                boolean needLogin = swiperPicture.isJumpNeedLogin();
                JumpDetailV2 jumpDetail = swiperPicture.getJumpDetail();
                if (jumpDetail != null) {
                    jumpDetail.setNeedLogin(needLogin);
                    swiperPicture.setJumpDetail(jumpDetail);
                }
            }
        }
        return list;
    }
    @Override
    @Cacheable(value = "bannerCache", key = "'getByBannerId-'+#bannerId")
    public List<SwiperPicture> getByBannerId(Long bannerId) throws SwiperPictureException {
        return swiperPictureMapper.getByBannerId(bannerId);
    }
    
}
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/ThreeSaleSerivceImpl.java
@@ -297,20 +297,12 @@
        return threeSaleMapper.countSuperiorQuery(state, uid);
    }
    @Override
    public List<ThreeSale> listFirstTeam(long start, int count, Long uid) {
        return threeSaleMapper.listFirstTeam(start, count, uid);
    }
    @Override
    public long countFirstTeam(Long uid, Integer state) {
        return threeSaleMapper.countFirstTeam(uid, state);
    }
    @Override
    public List<ThreeSale> listSecondTeam(long start, int count, Long uid) {
        return threeSaleMapper.listSecondTeam(start, count, uid);
    }
    @Override
    public long countSecondTeam(Long uid, Integer state) {
@@ -333,9 +325,9 @@
    }
    @Override
    public JSONObject getMyFirstTeam(long start, int count, Long uid) {
    public JSONObject getMyFirstTeam(long start, int count, Long uid, Integer state) {
        List<ThreeSale> list = threeSaleMapper.listFirstTeam(start, count, uid);
        List<ThreeSale> list = threeSaleMapper.listFirstTeam(start, count, uid, state);
        if (list == null) {
            list = new ArrayList<ThreeSale>();
        }
@@ -346,8 +338,8 @@
    }
    @Override
    public JSONObject getMySecondTeam(long start, int count, Long uid) {
        List<ThreeSale> list = threeSaleMapper.listSecondTeam(start, count, uid);
    public JSONObject getMySecondTeam(long start, int count, Long uid, Integer state) {
        List<ThreeSale> list = threeSaleMapper.listSecondTeam(start, count, uid, state);
        if (list == null) {
            list = new ArrayList<ThreeSale>();
        }
@@ -486,9 +478,9 @@
    @Transactional
    public void bindRelationshipByInviteCode(UserInfo invitee, UserInfo inviter) throws ThreeSaleException {
        if (invitee == null || inviter == null)
        if (invitee == null || inviter == null)
            throw new ThreeSaleException(1, "用户信息为空");
        // 获取有效的邀请关系
        ThreeSale threeSale = threeSaleMapper.getRelationshipByBossIdAndWorkerId(inviter.getId(), invitee.getId());
@@ -510,7 +502,6 @@
            threeSale.setCreateTime(java.lang.System.currentTimeMillis());
            threeSale.setUpdateTime(java.lang.System.currentTimeMillis());
            threeSaleMapper.insertSelective(threeSale);
        }
        List<ThreeSale> listExpire = threeSaleMapper.getExpireRecord(inviter.getId(), invitee.getId());
@@ -531,6 +522,67 @@
    }
    @Override
    @Transactional
    public void bindRelationshipByWX(UserInfo invitee, Long inviterId, ThreeSale threeSaleOld) throws ThreeSaleException {
        if (invitee == null || (inviterId == null && threeSaleOld == null))
            throw new ThreeSaleException(1, "用户信息为空");
        ThreeSale threeSale = null;
        if (inviterId != null ) {
            // 新建立确定关系
            threeSale  = new ThreeSale();
            threeSale.setBoss(new UserInfo(inviterId));
            threeSale.setWorker(invitee);
            threeSale.setState(true);
            threeSale.setExpire(ThreeSale.EXPIRE_NORMAL);
            threeSale.setSucceedTime(java.lang.System.currentTimeMillis());
            threeSale.setCreateTime(java.lang.System.currentTimeMillis());
            threeSale.setUpdateTime(java.lang.System.currentTimeMillis());
            threeSaleMapper.insertSelective(threeSale);
            // 邀请关系失效  1.5.3 之前失效
            if (threeSaleOld != null) {
                ThreeSale three  = new ThreeSale();
                three.setId(threeSaleOld.getId());
                three.setExpire(ThreeSale.EXPIRE_OUTOFDATE);
                three.setUpdateTime(java.lang.System.currentTimeMillis());
                threeSaleMapper.updateByPrimaryKeySelective(three);
            }
        } else if (threeSaleOld != null && inviterId == null) {
            // 1.5.3 之前生效
            threeSaleOld.setState(true);
            threeSaleOld.setExpire(ThreeSale.EXPIRE_NORMAL);
            threeSaleOld.setSucceedTime(java.lang.System.currentTimeMillis());
            threeSaleOld.setUpdateTime(java.lang.System.currentTimeMillis());
            threeSaleMapper.updateByPrimaryKeySelective(threeSaleOld);
            threeSale = threeSaleOld;
        }
        if (threeSale == null) {
            throw new ThreeSaleException(1, "关系绑定失败");
        }
        // 添加到队列
        ThreeSaleCMQManager.getInstance().addThreeSaleMsg(threeSale);
        // 邀请消息
        userInviteMsgNotificationService.inviteSuccess(threeSale.getBoss().getId(), threeSale);
    }
    /**
     * 根据邀请者查询关系
     *
     * @param workerId
     * @return
     */
    @Override
    public ThreeSale getByWorkerId(Long workerId) {
        return threeSaleMapper.getByWorkerId(workerId);
    }
    @Override
    public long countSuccessFirstTeam(Long uid) {
        return threeSaleMapper.countFirstTeam(uid, 1);
    }
fanli/src/main/java/com/yeshi/fanli/service/impl/lable/QualityGoodsServiceImpl.java
@@ -79,6 +79,12 @@
        return qualityFactoryMapper.countQueryByFlashSale();
    }
    
    @Override
    public List<QualityFactory> listFlashSaleRandGoods() {
        return qualityFactoryMapper.listFlashSaleRandGoods();
    }
    /**
     * 今日必抢 - 9k9
     * @param start
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoUnionAuthRecordServiceImpl.java
@@ -22,4 +22,9 @@
        taoBaoUnionAuthRecordMapper.insertSelective(record);
    }
    @Override
    public String getTaoBaoUserNick(Long uid) {
        return taoBaoUnionAuthRecordMapper.getTaoBaoUserNick(uid);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/SMSServiceImpl.java
@@ -26,12 +26,12 @@
    private RedisManager redisManager;
    @Override
    public String sendLoginVCode(String phone) throws SMSException {
    public String sendLoginVCode(String phone, int codeLength) throws SMSException {
        boolean limit = redisManager.isSmsFrequencyLimit(phone, SMSHistory.TYPE_LOGIN);
        if (limit)
            throw new SMSException(1001, "请过60秒再试");
        String msgCode = StringUtil.getVerifyCode(6);
        System.out.println(msgCode);
        String msgCode = StringUtil.getVerifyCode(codeLength);
        // 验证码模板
        String msg = Constant.smsConfig.getSmsLogin().replace("[签名]", Constant.smsConfig.getSmsSign()).replace("[验证码]",
                msgCode);
@@ -40,6 +40,7 @@
        // 缓存
        redisManager.sendSms(phone, SMSHistory.TYPE_LOGIN);
        redisManager.saveSMSVCode(phone, SMSHistory.TYPE_LOGIN, msgCode);
        SMSHistory smsHistory = new SMSHistory();
        smsHistory.setContent(msg);
        smsHistory.setCreateTime(new Date());
@@ -50,18 +51,28 @@
    }
    @Override
    public void sendBindVCode(String phone) throws SMSException {
    public void sendBindVCode(String phone, int codeLength) throws SMSException {
        boolean limit = redisManager.isSmsFrequencyLimit(phone, SMSHistory.TYPE_BIND);
        if (limit)
            throw new SMSException(1001, "请过60秒再试");
        String msgCode = StringUtil.getRandomCode(6);
        String msgCode = StringUtil.getVerifyCode(codeLength);
        // 验证码模板
        String msg = Constant.smsConfig.getSmsBind().replace("[签名]", Constant.smsConfig.getSmsSign()).replace("[验证码]",
                msgCode);
        // 发送短信
        TencentSMSUtil.sendSingleMsg(phone, msg);
        // 缓存
        redisManager.sendSms(phone, SMSHistory.TYPE_BIND);
        redisManager.saveSMSVCode(phone, SMSHistory.TYPE_BIND, msgCode);
        SMSHistory smsHistory = new SMSHistory();
        smsHistory.setContent(msg);
        smsHistory.setCreateTime(new Date());
        smsHistory.setPhone(phone);
        smsHistory.setType(SMSHistory.TYPE_BIND);
        smsHistoryMapper.insertSelective(smsHistory);
    }
    @Override
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountServiceImpl.java
@@ -27,6 +27,7 @@
import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode;
import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode.ForbiddenUserIdentifyCodeTypeEnum;
import com.yeshi.fanli.entity.bus.user.LoginResult;
import com.yeshi.fanli.entity.bus.user.SMSHistory;
import com.yeshi.fanli.entity.bus.user.ThreeSale;
import com.yeshi.fanli.entity.bus.user.UserConnectHistory;
import com.yeshi.fanli.entity.bus.user.UserInfo;
@@ -42,6 +43,7 @@
import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.FileUtil;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.util.factory.msg.MsgAccountDetailFactory;
@@ -51,6 +53,9 @@
@Service
public class UserAccountServiceImpl implements UserAccountService {
    @Resource
    private RedisManager redisManager;
    @Resource
    private UserInfoMapper userInfoMapper;
@@ -532,6 +537,7 @@
     * @param unionId
     * @return
     */
    @Override
    public UserInfo getUserInfoByWXUnionId(String appId, String unionId) throws UserAccountException {
        if (StringUtil.isNullOrEmpty(appId))
            throw new UserAccountException(1, "appId为空");
@@ -890,4 +896,204 @@
        return user.getPortrait();
    }
    @Transactional
    @Override
    public UserInfo loginPhone(HttpServletRequest request,int loginType, String vcode, String phone,
            String appId) throws UserAccountException {
        // 空额清理
        if (phone == null || phone.trim().length() == 0) {
            throw new UserAccountException(1, "请输入手机号码");
        }
        phone = phone.replaceAll(" ", "");
        // 苹果应用商店上线测试号码
        if ("17316780233".equalsIgnoreCase(phone) && "258168".equalsIgnoreCase(vcode)) {
            ;
        } else {
            if (StringUtil.isNullOrEmpty(vcode)) {
                throw new UserAccountException(1, "请输入验证码");
            }
            String oldVcode = redisManager.getSMSVCode(phone, SMSHistory.TYPE_LOGIN);
            LogHelper.test("----------------------登录验证码: " + oldVcode);
            if (StringUtil.isNullOrEmpty(oldVcode) || !oldVcode.equalsIgnoreCase(vcode)) {
                throw new UserAccountException(1, "验证码错误,重新输入");
            }
        }
        redisManager.clearSMSFrequencyLimit(phone, SMSHistory.TYPE_LOGIN);
        JSONObject logInfo = new JSONObject();
        logInfo.put("appId", appId);
        logInfo.put("phone", phone);
        logInfo.put("loginType", loginType);
        LogHelper.lgoinInfo(logInfo.toString());
        // 判断手机号码是否被封禁
        ForbiddenUserIdentifyCode identifyCode1 = forbiddenUserIdentifyCodeService
                .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.phone, phone);
        if (identifyCode1 != null && identifyCode1.getEffective() != null && identifyCode1.getEffective()) {
            throw new UserAccountException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
        }
        // 查询是否存在该电话历史用户
        UserInfo userInfo = userInfoMapper.getEffectiveUserInfoByPhone(phone);
        if (userInfo != null) {
            // 更新账户登录信息
            updateLonginInfo(userInfo, loginType, request);
        } else {
            userInfo = new UserInfo();
            userInfo.setAppId(appId);
            userInfo.setNickName(Constant.systemCommonConfig.getDefaultNickName());
            userInfo.setPortrait(Constant.systemCommonConfig.getDefaultPortrait());
            userInfo.setPhone(phone);
            userInfo.setLoginType(loginType);
            userInfo.setState(UserInfo.STATE_NORMAL);
            // 创建用户
            addUser(userInfo);
        }
        return userInfo;
    }
    @Transactional
    @Override
    public UserInfo loginWinXin(HttpServletRequest request,int loginType, String code, String appId) throws UserAccountException {
        // 日志信息
        JSONObject logInfo = new JSONObject();
        logInfo.put("appId", appId);
        logInfo.put("code", code);
        logInfo.put("loginType", loginType);
        LogHelper.lgoinInfo(logInfo.toString());
        // 通过Code换取信息
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code);
        if (weiXinUser == null) {
            throw new UserAccountException(1, "微信帐号授权失败");
        }
        LogHelper.test("微信授权用户信息:" + new Gson().toJson(weiXinUser));
        // 判断微信unionid是否被封禁
        ForbiddenUserIdentifyCode identifyCode = forbiddenUserIdentifyCodeService
                .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.wxUnionId, weiXinUser.getUnionid());
        if (identifyCode != null && identifyCode.getEffective() != null && identifyCode.getEffective()) {
            throw new UserAccountException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
        }
        UserInfo userInfo = userInfoMapper.getEffectiveUserInfoByWXUnionId(weiXinUser.getUnionid());
        // 直接用的微信登录
        if (userInfo != null) {
            // 更新账户登录信息
            updateLonginInfo(userInfo, loginType, request);
        } else {
            // 创建新账户
            userInfo = new UserInfo();
            userInfo.setPortrait(weiXinUser.getHeadimgurl());
            userInfo.setAppId(appId);
            userInfo.setNickName(weiXinUser.getNickname());
            userInfo.setWxName(weiXinUser.getNickname());
            userInfo.setWxOpenId(weiXinUser.getOpenid());
            userInfo.setWxUnionId(weiXinUser.getUnionid());
            userInfo.setWxPic(weiXinUser.getHeadimgurl());
            userInfo.setLastLoginTime(System.currentTimeMillis());
            userInfo.setLoginType(loginType);
            userInfo.setLastLoginIp(request.getRemoteHost());
            userInfo.setState(UserInfo.STATE_NORMAL);
            addUser(userInfo);
        }
        return userInfo;
    }
    /**
     * 更新账户登录信息
     * @param userInfo
     * @param loginType
     * @param request
     */
    public void updateLonginInfo(UserInfo userInfo, int loginType, HttpServletRequest request) {
        // 设置登录时间与登录类型
        UserInfo updateUserInfo = new UserInfo(userInfo.getId());
        updateUserInfo.setLastLoginTime(System.currentTimeMillis());
        updateUserInfo.setLoginType(loginType);
        updateUserInfo.setLastLoginIp(request.getRemoteHost());
        userInfoMapper.updateByPrimaryKeySelective(updateUserInfo);
    }
    @Override
    public void bindPhoneNew(Long uid, String phone) throws UserAccountException {
        UserInfo user = userInfoMapper.selectByPrimaryKey(uid);
        if (user == null) {
            throw new UserAccountException(1, "用户不存在");
        }
        String hasPhone = user.getPhone();
        if (!StringUtil.isNullOrEmpty(hasPhone) && hasPhone.equals(phone)) {
            throw new UserAccountException(2, "您已经绑定了该电话号码");
        }
        UserInfo phoneUser = userInfoMapper.getEffectiveUserInfoByPhone(phone);
        if (phoneUser != null) {
            throw new UserAccountException(2, "号码已经被占用");
        }
        // 更新电话号码
        UserInfo update = new UserInfo(user.getId());
        update.setPhone(phone);
        userInfoMapper.updateByPrimaryKeySelective(update);
        // 发送消息
        userAccountMsgNotificationService.bindingSuccess(uid, MsgAccountDetailFactory.TYPE_PHONE);
    }
    @Override
    public void bindWeiXin(Long uid, String code) throws UserAccountException {
        UserInfo user = userInfoMapper.selectByPrimaryKey(uid);
        if (user == null) {
            throw new UserAccountException(1, "用户不存在");
        }
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code);
        if (weiXinUser == null) {
            throw new UserAccountException(2, "微信帐号授权失败");
        }
        if (weiXinUser.getUnionid().equalsIgnoreCase(user.getWxUnionId())) {
            throw new UserAccountException(3, "微信帐号一致无需更换");
        }
        UserInfo newUser = userInfoMapper.getEffectiveUserInfoByWXUnionId(weiXinUser.getUnionid());
        if (newUser != null) {
            throw new UserAccountException(4, "该微信号已被其他帐号绑定");
        }
        String wxUnionId = user.getWxUnionId();
        if (!StringUtil.isNullOrEmpty(wxUnionId) && StringUtil.isNullOrEmpty(user.getPhone())) {
            throw new UserAccountException(5, "该帐号没有绑定手机号码,需绑定手机号码才能完成微信更换");
        }
        UserInfo updateUserInfo = new UserInfo(uid);
        updateUserInfo.setWxName(weiXinUser.getNickname());
        updateUserInfo.setWxOpenId(weiXinUser.getOpenid());
        updateUserInfo.setWxPic(weiXinUser.getHeadimgurl());
        updateUserInfo.setWxUnionId(weiXinUser.getUnionid());
        updateUserInfo.setNickName(weiXinUser.getNickname());
        updateUserInfo.setPortrait(weiXinUser.getHeadimgurl());
        if (StringUtil.isNullOrEmpty(weiXinUser.getNickname())) {
            updateUserInfo.setNickName(Constant.systemCommonConfig.getDefaultNickName());
        }
        if (StringUtil.isNullOrEmpty(weiXinUser.getHeadimgurl())) {
            updateUserInfo.setPortrait(Constant.systemCommonConfig.getDefaultPortrait());
        }
        userInfoMapper.updateByPrimaryKeySelective(updateUserInfo);
        userAccountMsgNotificationService.bindingSuccess(uid, MsgAccountDetailFactory.TYPE_WX);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserExtraTaoBaoInfoServiceImpl.java
@@ -1,15 +1,22 @@
package com.yeshi.fanli.service.impl.user;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import javax.transaction.Transactional;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.user.UserExtraTaoBaoInfoMapper;
import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode;
import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode.ForbiddenUserIdentifyCodeTypeEnum;
import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.exception.user.UserExtraTaoBaoInfoException;
import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
@Service
@@ -17,57 +24,178 @@
    @Resource
    private UserExtraTaoBaoInfoMapper userExtraTaoBaoInfoMapper;
    @Resource
    private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService;
    @Transactional
    @Override
    public void addRelationId(Long uid, String relationId, String taoBaoUid, boolean valid) {
        if (uid == null || relationId == null)
            return;
        UserExtraTaoBaoInfo info = getByUid(uid);
        if (info == null) {
            info = new UserExtraTaoBaoInfo();
            info.setUser(new UserInfo(uid));
            info.setCreateTime(new Date());
            info.setRelationId(relationId);
            info.setRelationUpdateTime(new Date());
            info.setRelationValid(valid);
            info.setTaoBaoUid(taoBaoUid);
            userExtraTaoBaoInfoMapper.insertSelective(info);
    public void addRelationId(Long uid, String relationId, String taoBaoUid,String nickName,
            boolean valid) throws UserExtraTaoBaoInfoException{
        if (uid == null || StringUtil.isNullOrEmpty(relationId) || StringUtil.isNullOrEmpty(taoBaoUid)) {
            throw new UserExtraTaoBaoInfoException(1, "传递参数为空");
        }
        // 验证taoBaoUid是否被封禁
        if(validateTaoBaoUidForbidden(taoBaoUid)) {
            throw new UserExtraTaoBaoInfoException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
        }
        UserExtraTaoBaoInfo taoBaoInfo = new UserExtraTaoBaoInfo();
        taoBaoInfo.setUser(new UserInfo(uid));
        taoBaoInfo.setTaoBaoNickName(nickName);
        taoBaoInfo.setTaoBaoUid(taoBaoUid);
        taoBaoInfo.setRelationId(relationId);
        taoBaoInfo.setRelationValid(valid);
        taoBaoInfo.setRelationUpdateTime(new Date());
        List<UserExtraTaoBaoInfo> list = userExtraTaoBaoInfoMapper.listByTaoBaoUid(taoBaoUid);
        if (list == null || list.size() == 0) {
            //新增
            taoBaoInfo.setCreateTime(new Date());
            userExtraTaoBaoInfoMapper.insertSelective(taoBaoInfo);
        } else {
            UserExtraTaoBaoInfo update = new UserExtraTaoBaoInfo();
            update.setId(info.getId());
            update.setRelationId(relationId);
            update.setRelationValid(valid);
            update.setRelationUpdateTime(new Date());
            update.setTaoBaoUid(taoBaoUid);
            userExtraTaoBaoInfoMapper.updateByPrimaryKeySelective(update);
            // 取第一个替换uid 等信息
            taoBaoInfo.setId(list.get(0).getId());
            taoBaoInfo.setUpdateTime(new Date());
            userExtraTaoBaoInfoMapper.updateByPrimaryKeySelective(taoBaoInfo);
            // 清空多余已绑定数据
            if (list.size() > 1) {
                for (int i = 1; i < list.size(); i++) {
                    clearTaoBaoInfo(list.get(i));
                }
            }
        }
    }
    @Transactional
    @Override
    public void addSpecialId(Long uid, String specialId, String taoBaoUid, boolean valid) {
        if (uid == null || specialId == null)
            return;
        UserExtraTaoBaoInfo info = getByUid(uid);
        if (info == null) {
            info = new UserExtraTaoBaoInfo();
            info.setUser(new UserInfo(uid));
            info.setCreateTime(new Date());
            info.setSpecialId(specialId);
            info.setSpecialUpdateTime(new Date());
            info.setSpecialValid(valid);
            info.setTaoBaoUid(taoBaoUid);
            userExtraTaoBaoInfoMapper.insertSelective(info);
    public void addSpecialId(Long uid, String specialId, String taoBaoUid, String nickName,
            boolean valid) throws UserExtraTaoBaoInfoException{
        if (uid == null || StringUtil.isNullOrEmpty(specialId) || StringUtil.isNullOrEmpty(taoBaoUid)) {
            throw new UserExtraTaoBaoInfoException(1, "传递参数为空");
        }
        // 验证taoBaoUid是否被封禁
        if(validateTaoBaoUidForbidden(taoBaoUid)) {
            throw new UserExtraTaoBaoInfoException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
        }
        UserExtraTaoBaoInfo taoBaoInfo = new UserExtraTaoBaoInfo();
        taoBaoInfo.setUser(new UserInfo(uid));
        taoBaoInfo.setTaoBaoNickName(nickName);
        taoBaoInfo.setTaoBaoUid(taoBaoUid);
        taoBaoInfo.setSpecialValid(valid);
        taoBaoInfo.setSpecialId(specialId);
        taoBaoInfo.setSpecialUpdateTime(new Date());
        List<UserExtraTaoBaoInfo> list = userExtraTaoBaoInfoMapper.listByTaoBaoUid(taoBaoUid);
        if (list == null || list.size() == 0) {
            //新增
            taoBaoInfo.setCreateTime(new Date());
            userExtraTaoBaoInfoMapper.insertSelective(taoBaoInfo);
        } else {
            UserExtraTaoBaoInfo update = new UserExtraTaoBaoInfo();
            update.setId(info.getId());
            update.setSpecialId(specialId);
            update.setSpecialUpdateTime(new Date());
            update.setSpecialValid(valid);
            update.setTaoBaoUid(taoBaoUid);
            userExtraTaoBaoInfoMapper.updateByPrimaryKeySelective(update);
            // 取第一个替换uid 等信息
            taoBaoInfo.setId(list.get(0).getId());
            taoBaoInfo.setUpdateTime(new Date());
            userExtraTaoBaoInfoMapper.updateByPrimaryKeySelective(taoBaoInfo);
            // 清空多余已绑定数据
            if (list.size() > 1) {
                for (int i = 1; i < list.size(); i++) {
                    clearTaoBaoInfo(list.get(i));
                }
            }
        }
    }
    @Transactional
    @Override
    public void saveUserTaoBaoInfo(Long uid, String relationId, String specialId, String taoBaoUid,
            String nickName, boolean valid) throws UserExtraTaoBaoInfoException {
        if (uid == null || StringUtil.isNullOrEmpty(relationId) || StringUtil.isNullOrEmpty(specialId)
                || StringUtil.isNullOrEmpty(taoBaoUid)) {
            throw new UserExtraTaoBaoInfoException(1, "传递参数部分为空");
        }
        // 验证taoBaoUid是否被封禁
        if(validateTaoBaoUidForbidden(taoBaoUid)) {
            throw new UserExtraTaoBaoInfoException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
        }
        UserExtraTaoBaoInfo taoBaoInfo = new UserExtraTaoBaoInfo();
        taoBaoInfo.setTaoBaoUid(taoBaoUid);
        taoBaoInfo.setTaoBaoNickName(nickName);
        taoBaoInfo.setUser(new UserInfo(uid));
        // 渠道
        taoBaoInfo.setRelationValid(valid);
        taoBaoInfo.setRelationId(relationId);
        taoBaoInfo.setRelationUpdateTime(new Date());
        // 绑定
        taoBaoInfo.setSpecialValid(valid);
        taoBaoInfo.setSpecialId(specialId);
        taoBaoInfo.setSpecialUpdateTime(new Date());
        List<UserExtraTaoBaoInfo> list = userExtraTaoBaoInfoMapper.listByTaoBaoUid(taoBaoUid);
        if (list == null || list.size() == 0) {
            //新增
            taoBaoInfo.setCreateTime(new Date());
            userExtraTaoBaoInfoMapper.insertSelective(taoBaoInfo);
        } else {
            // 取第一个替换uid 等信息
            taoBaoInfo.setId(list.get(0).getId());
            taoBaoInfo.setUpdateTime(new Date());
            userExtraTaoBaoInfoMapper.updateByPrimaryKeySelective(taoBaoInfo);
            // 清空多余已绑定数据
            if (list.size() > 1) {
                for (int i = 1; i < list.size(); i++) {
                    clearTaoBaoInfo(list.get(i));
                }
            }
        }
    }
    /**
     * 验证taoBaoUid  是否被封
     * @param taoBaoUid
     * @return
     */
    public boolean validateTaoBaoUidForbidden(String taoBaoUid) {
        boolean validate = false;
        ForbiddenUserIdentifyCode identifyCode = forbiddenUserIdentifyCodeService.listByTypeAndIdentifyCode(
                ForbiddenUserIdentifyCodeTypeEnum.taobaoUid, taoBaoUid);
        // 账号被封
        if (identifyCode != null && identifyCode.getEffective() != null && identifyCode.getEffective()) {
            validate = true;
        }
        return validate;
    }
    /**
     * 清空多余绑定淘宝账号信息
     * @param otherInfo
     */
    public void clearTaoBaoInfo(UserExtraTaoBaoInfo otherInfo ) {
        otherInfo.setUser(null);
        otherInfo.setTaoBaoUid(null);
        otherInfo.setTaoBaoNickName(null);
        otherInfo.setRelationValid(null);
        otherInfo.setRelationId(null);
        otherInfo.setRelationUpdateTime(null);
        otherInfo.setSpecialValid(null);
        otherInfo.setSpecialId(null);
        otherInfo.setSpecialUpdateTime(new Date());
        userExtraTaoBaoInfoMapper.updateByPrimaryKey(otherInfo);
    }
    @Override
    public UserExtraTaoBaoInfo getByUid(Long uid) {
        return userExtraTaoBaoInfoMapper.selectByUid(uid);
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java
@@ -14,21 +14,28 @@
import com.yeshi.fanli.dao.mybatis.user.UserInfoExtraMapper;
import com.yeshi.fanli.dao.mybatis.user.UserRankRecordMapper;
import com.yeshi.fanli.entity.bus.user.ThreeSale;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.bus.user.UserRank;
import com.yeshi.fanli.entity.bus.user.UserRankRecord;
import com.yeshi.fanli.entity.bus.user.WeiXinUser;
import com.yeshi.fanli.exception.ThreeSaleException;
import com.yeshi.fanli.exception.user.UserInfoExtraException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
import com.yeshi.fanli.service.inter.order.CommonOrderCountService;
import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
import com.yeshi.fanli.service.inter.user.UserAccountService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.service.inter.user.UserInviteRecordService;
import com.yeshi.fanli.service.inter.user.UserRankService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.account.UserUtil;
import com.yeshi.fanli.util.wx.WXLoginUtil;
import com.yeshi.fanli.vo.user.UserInfoExtraVO;
@@ -55,6 +62,15 @@
    
    @Resource
    private UserInfoService userInfoService;
    @Resource
    private UserAccountService userAccountService;
    @Resource
    private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService;
    @Resource
    private UserInviteRecordService userInviteRecordService;
    
    @Override
@@ -293,6 +309,12 @@
            throw new UserInfoExtraException(1, "用户id、邀请码不能为空");
        }
        
        // 被邀请人信息
        UserInfo invitee = userInfoService.selectByPKey(uid);
        if (invitee == null) {
            throw new UserInfoExtraException(1, "用户不存在");
        }
        UserInfoExtra extra = userInfoExtraMapper.getInfoExtraByUid(uid);
        if (extra != null) {
            String inviteCodeHas = extra.getInviteCode();
@@ -301,16 +323,10 @@
            }
        }
        
        // 被邀请人信息
        UserInfo invitee = userInfoService.selectByPKey(uid);
        if (invitee == null) {
            throw new UserInfoExtraException(1, "用户不存在");
        }
        // 邀请人信息
        UserInfo inviter = userInfoService.getInfoByPhoneOrInviteCode(inviteCode, inviteCode);
        if (inviter == null) {
            throw new UserInfoExtraException(1, "请输入有效的邀请码");
            throw new UserInfoExtraException(1, "上级邀请码不存在");
        }
        
        // 绑定关系
@@ -347,6 +363,114 @@
        
        return code;
    }
    @Override
    public void activationInviteWX(Long uid, String code) throws UserInfoExtraException{
        if (uid == null || code == null) {
            throw new UserInfoExtraException(1, "用户id、邀请码不能为空");
        }
        // 用户信息
        UserInfo invitee = userInfoService.selectByPKey(uid);
        if (invitee == null) {
            throw new UserInfoExtraException(1, "用户不存在");
        }
        // 用户额外信息
        UserInfoExtra extra = userInfoExtraMapper.getInfoExtraByUid(uid);
        if (extra != null) {
            String inviteCodeHas = extra.getInviteCode();
            if (inviteCodeHas != null && inviteCodeHas.trim().length() > 0) {
                throw new UserInfoExtraException(1, "已经激活, 无需再次激活");
            }
        }
        // 获取微信信息
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinWYUser(code);
        if (weiXinUser == null) {
            throw new UserInfoExtraException(1, "微信授权失败");
        }
        String wxUnionId = weiXinUser.getUnionid();
        if (wxUnionId == null || wxUnionId.trim().length() == 0) {
            throw new UserInfoExtraException(1, "微信授权失败");
        }
        // 自动绑定微信
        UserInfo updateUserInfo = new UserInfo(uid);
        updateUserInfo.setWxName(weiXinUser.getNickname());
        updateUserInfo.setWxOpenId(weiXinUser.getOpenid());
        updateUserInfo.setWxPic(weiXinUser.getHeadimgurl());
        updateUserInfo.setWxUnionId(weiXinUser.getUnionid());
        updateUserInfo.setNickName(weiXinUser.getNickname());
        updateUserInfo.setPortrait(weiXinUser.getHeadimgurl());
        if (StringUtil.isNullOrEmpty(weiXinUser.getNickname())) {
            updateUserInfo.setNickName(Constant.systemCommonConfig.getDefaultNickName());
        }
        if (StringUtil.isNullOrEmpty(weiXinUser.getHeadimgurl())) {
            updateUserInfo.setPortrait(Constant.systemCommonConfig.getDefaultPortrait());
        }
        userInfoService.updateByPrimaryKeySelective(updateUserInfo);
        // 邀请人ID -1.5.3新版
        Long inviterId = userInviteRecordService.getNewestInviterId(wxUnionId);
        // 兼容1.5.3 之前版本
        ThreeSale threeSale = threeSaleSerivce.getByWorkerId(uid);
        if (inviterId == null && threeSale != null) {
            Long bossId = threeSale.getBoss().getId();
            UserInfoExtra inviterExtra = userInfoExtraMapper.getInfoExtraByUid(bossId);
            if (inviterExtra != null && inviterExtra.getInviteCode() == null ) {
                // 更新邀请码
                UserInfoExtra inviterInfoExtra = new UserInfoExtra();
                inviterInfoExtra.setId(inviterExtra.getId());
                inviterInfoExtra.setInviteCode(UserUtil.getInviteCode(bossId));
                userInfoExtraMapper.updateByPrimaryKeySelective(inviterInfoExtra);
            }
        }
        // 没有被邀请过
        if (inviterId == null && threeSale == null) {
            throw new UserInfoExtraException(1, "微信激活失败");
        }
        // 绑定关系
        try {
            threeSaleSerivce.bindRelationshipByWX(invitee, inviterId, threeSale);
        } catch (ThreeSaleException e) {
            try {
                LogHelper.errorDetailInfo(e);
            } catch (Exception e1) {
                e1.printStackTrace();
            }
            throw new UserInfoExtraException(1, "激活失败");
        }
        // 邀请码有效、生成邀请码
        String inviteCode = UserUtil.getInviteCode(uid);
        if (inviteCode == null || inviteCode.trim().length() == 0) {
            throw new UserInfoExtraException(1, "激活码生成失败");
        }
        // 保存邀请码
        UserInfoExtra userInfoExtra = new UserInfoExtra();
        userInfoExtra.setUserInfo(invitee);
        userInfoExtra.setInviteCode(inviteCode);
        userInfoExtra.setUpdateTime(new Date());
        if (extra != null) {
            userInfoExtra.setId(extra.getId());
            userInfoExtraMapper.updateByPrimaryKeySelective(userInfoExtra);
        } else {
            userInfoExtra.setCreateTime(new Date());
            userInfoExtraMapper.insertSelective(userInfoExtra);
        }
    }
    
    @Override
    public UserInfoExtra getUserInfoExtra(Long uid) {
@@ -396,7 +520,5 @@
    public long countByRankId(Long rankId) {
        return userInfoExtraMapper.countByRankId(rankId);
    }
    
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoServiceImpl.java
@@ -36,14 +36,19 @@
import com.yeshi.fanli.dao.user.UserInfoDao;
import com.yeshi.fanli.entity.bus.user.BindingAccount;
import com.yeshi.fanli.entity.bus.user.InviteUser;
import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.WeiXinUser;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.exception.ThreeSaleException;
import com.yeshi.fanli.exception.user.UserInfoException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionAuthRecordService;
import com.yeshi.fanli.service.inter.user.UserActiveLogService;
import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.service.inter.user.UserRankService;
import com.yeshi.fanli.util.Constant;
@@ -93,6 +98,16 @@
    
    @Resource
    private UserRankService userRankService;
    @Resource
    private UserActiveLogService userActiveLogService;
    @Resource
    private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
    @Resource
    private TaoBaoUnionAuthRecordService taoBaoUnionAuthRecordService;
    
    public UserInfo getUserByLoginTypeAndOpenId(int loginType, String openid, String appid) {
@@ -833,4 +848,61 @@
        return userInfoMapper.getInfoByPhoneOrInviteCode(phone, inviteCode);
    }
    
    @Override
    public UserInfo getEffectiveUserInfoByPhone(String phone) {
        return userInfoMapper.getEffectiveUserInfoByPhone(phone);
    }
    @Override
    public UserInfo getEffectiveUserInfoByWXUnionId(String unionId) {
        return userInfoMapper.getEffectiveUserInfoByWXUnionId(unionId);
    }
    @Override
    public UserInfo getUserInfo(Long uid) throws UserInfoException{
        if (uid == null) {
            throw new UserInfoException(1, "请求参数为空");
        }
        UserInfo userInfo = userInfoMapper.selectByPKey(uid);
        if(userInfo == null) {
            throw new UserInfoException(1, "用户不存在");
        }
        if (userInfo.getState() == UserInfo.STATE_FORBIDDEN) {
            throw new UserInfoException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
        }
        if (userInfo.getState()!= UserInfo.STATE_NORMAL) {
            throw new UserInfoException(1, "用户不存在");
        }
        // 淘宝昵称 组织
        boolean clearTbName = true;
        UserExtraTaoBaoInfo extraTaoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid);
        if (extraTaoBaoInfo != null) {
            String specialId = extraTaoBaoInfo.getSpecialId();
            String relationId = extraTaoBaoInfo.getRelationId();
            String taoBaoNickName = extraTaoBaoInfo.getTaoBaoNickName();
            if(!StringUtil.isNullOrEmpty(specialId) && !StringUtil.isNullOrEmpty(relationId)) {
                if(!StringUtil.isNullOrEmpty(taoBaoNickName)) {
                    userInfo.setTbName(taoBaoNickName);
                    clearTbName = false;
                } else {
                    String taoBaoUserNick = taoBaoUnionAuthRecordService.getTaoBaoUserNick(uid);
                    if(!StringUtil.isNullOrEmpty(taoBaoUserNick)) {
                        userInfo.setTbName(taoBaoUserNick);
                        clearTbName = false;
                    }
                }
            }
        }
        if (clearTbName) {
            userInfo.setTbName(null);
        }
        return userInfo;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInviteRecordServiceImpl.java
New file
@@ -0,0 +1,82 @@
package com.yeshi.fanli.service.impl.user;
import java.util.Date;
import javax.annotation.Resource;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.user.UserInviteRecordMapper;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInviteRecord;
import com.yeshi.fanli.entity.bus.user.WeiXinUser;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.service.inter.user.UserInviteRecordService;
import com.yeshi.fanli.util.wx.WXLoginUtil;
@Service
public class UserInviteRecordServiceImpl implements UserInviteRecordService {
    @Resource
    private UserInviteRecordMapper userInviteRecordMapper;
    @Resource
    private UserInfoService  userInfoService;
    @Async("pushExecutor")
    @Override
    public void saveInviteRecord(String code, String uid) {
        // 用户code 未获取到
        if (code == null || uid == null || uid.trim().length() == 0) {
            return;
        }
        // 没得这个人
        Long invitId = Long.parseLong(uid);
        UserInfo inviter = userInfoService.getUserById(invitId);
        if (inviter == null) {
            return;
        }
        // 获取微信信息
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinWYUser(code);
        if (weiXinUser == null) {
            return;
        }
        String wxUnionId = weiXinUser.getUnionid();
        if (wxUnionId == null || wxUnionId.trim().length() == 0) {
            return;
        }
        // 是否是邀请者自己识别
        if (wxUnionId.equals(inviter.getWxUnionId())) {
            return;
        }
        UserInviteRecord record  = userInviteRecordMapper.getByInviterIdAndUnionid(invitId, wxUnionId);
        if (record != null) {
            UserInviteRecord userInviteRecord = new UserInviteRecord();
            userInviteRecord.setId(record.getId());
            userInviteRecord.setUpdateTime(new Date());
            userInviteRecordMapper.updateByPrimaryKey(record);
        } else {
            UserInviteRecord userInviteRecord = new UserInviteRecord();
            userInviteRecord.setInviterId(invitId);
            userInviteRecord.setWxUnionid(wxUnionId);
            userInviteRecord.setCreateTime(new Date());
            userInviteRecord.setUpdateTime(new Date());
            userInviteRecordMapper.insertSelective(userInviteRecord);
        }
    }
    @Override
    public Long getNewestInviterId(String wxUnionId) {
        return userInviteRecordMapper.getNewestInviterId(wxUnionId);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserLotteryRecordServiceImpl.java
New file
@@ -0,0 +1,206 @@
package com.yeshi.fanli.service.impl.user;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.yeshi.utils.DateUtil;
import com.yeshi.fanli.dao.mybatis.user.UserLotteryRecordMapper;
import com.yeshi.fanli.entity.bus.user.UserLotteryRecord;
import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
import com.yeshi.fanli.exception.user.UserLotteryRecordException;
import com.yeshi.fanli.exception.user.UserSystemCouponException;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.order.CommonOrderCountService;
import com.yeshi.fanli.service.inter.user.UserLotteryRecordService;
import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
@Service
public class UserLotteryRecordServiceImpl implements UserLotteryRecordService {
    @Resource
    private UserLotteryRecordMapper userLotteryRecordMapper;
    @Resource
    private ConfigService configService;
    @Resource
    private CommonOrderCountService commonOrderCountService;
    @Resource
    private UserSystemCouponService userSystemCouponService;
    public UserLotteryRecord getLotteryByTypeAndUid(Long uid, String type) {
        int num = 0;
        UserLotteryRecord record = userLotteryRecordMapper.getByTypeAndUid(uid, type);
        if (record != null) {
            // 今日之内是否已抽过奖
            Date updateTime = record.getUpdateTime();
            if (updateTime != null && DateUtil.isSameDay(updateTime, new Date())) {
                num = record.getCount();
            } else {
                if (UserLotteryRecord.TYPE_DAILY_REBATE.equals(type)) {
                    // 1、天天送抽奖次数
                    num = UserLotteryRecord.COUNT_DAILY_REBATE;
                } else if(UserLotteryRecord.TYPE_NEWBIES.equals(type))  {
                    // 2、新人抽奖
                    num = record.getCount();
                }
            }
        } else {
            if (UserLotteryRecord.TYPE_DAILY_REBATE.equals(type)) {
                // 1、天天送抽奖次数
                num = UserLotteryRecord.COUNT_DAILY_REBATE;
            } else if(UserLotteryRecord.TYPE_NEWBIES.equals(type))  {
                // 2、新人抽奖
                boolean hasOrder = commonOrderCountService.hasRebateAndShareOrder(uid);
                // 新用户存在5次抽奖机会 (无订单:返利、分享订单)
                if (!hasOrder) {
                    num = UserLotteryRecord.COUNT_NEWBIES;
                }
            }
            if (num > 0)  {
                // 插入抽奖记录
                record = new UserLotteryRecord();
                record.setUid(uid);
                record.setType(type);
                record.setCount(num);
                record.setCreateTime(new Date());
                record.setUpdateTime(new Date());
                userLotteryRecordMapper.insertSelective(record);
            }
        }
        if (record == null) {
            record = new UserLotteryRecord();
            record.setUid(uid);
            record.setType(type);
            record.setCount(num);
        }
        return record;
    }
    @Override
    public Map<String, Object> getLotteryCountDaily(Long uid) throws UserLotteryRecordException,Exception {
        if (uid == null || uid == 0) {
             throw new UserLotteryRecordException(1, "未登录系统");
        }
        //抽奖次数
        int count = 0;
        UserLotteryRecord record = getLotteryByTypeAndUid(uid, UserLotteryRecord.TYPE_DAILY_REBATE);
        if (record != null) {
            count = record.getCount();
        }
        // 抽奖规则
        String lotteryRule = configService.get("lottery_rule_newbies");
        Map<String,Object> map = new HashMap<String, Object>();
        map.put("count", count);
        map.put("rule", lotteryRule);
        return map;
    }
    @Override
    public Map<String, Object> executeLotteryDaily(Long uid) throws UserLotteryRecordException,Exception{
        if (uid == null || uid == 0) {
             throw new UserLotteryRecordException(1, "未登录系统");
        }
        UserLotteryRecord record = getLotteryByTypeAndUid(uid, UserLotteryRecord.TYPE_DAILY_REBATE);
        if (record == null) {
            throw new UserLotteryRecordException(1, "暂无抽奖机会");
        }
        int count = record.getCount();
        // 抽奖次数不足
        if (count == 0) {
            throw new UserLotteryRecordException(2,  "抽奖次数不足");
        }
        int countPrize = 0;
        String prize = getLotteryPrizeDaily(countPrize, count);
        if (prize == null || prize.trim().length() == 0) {
            prize = "NoPrize";
        }
        try {
            // 插入券信息
            if ("rebateCoupon".equals(prize)) {
                String rebateCoupon = CouponTypeEnum.rebatePercentCoupon.name(); // 奖励券
                userSystemCouponService.insertUserCoupon(uid, rebateCoupon, UserSystemCoupon.SOURCE_NEWBIES);
            } else if ("doubleCoupon".equals(prize)) {
                String rebateCoupon = CouponTypeEnum.rebatePercentCoupon.name(); // 奖励券
                userSystemCouponService.insertUserCoupon(uid, rebateCoupon, UserSystemCoupon.SOURCE_NEWBIES);
                userSystemCouponService.insertUserCoupon(uid, rebateCoupon, UserSystemCoupon.SOURCE_NEWBIES);
            }
        } catch (UserSystemCouponException e) {
            throw new UserLotteryRecordException(1,  "抽奖失败");
        }
        count--;
        // 更新记录
        UserLotteryRecord updateRecord = new UserLotteryRecord();
        updateRecord.setId(record.getId());
        updateRecord.setCount(count);
        updateRecord.setUpdateTime(new Date());
        userLotteryRecordMapper.updateByPrimaryKeySelective(updateRecord);
        Map<String,Object> map = new HashMap<String, Object>();
        map.put("count", count);
        map.put("result", prize);
        return map;
    }
    /**
     *  奖品抽取
     *
     * @param countPrize   已抽次数
     * @param countUsed 券id
     * @return
     */
    public String getLotteryPrizeDaily(int countPrize, int count) {
        String prize = null;
        String rebateCoupon = "rebateCoupon"; // 一张奖励券
        String doubleCoupon = "doubleCoupon"; // 奖励券
        if (countPrize == 0 && count== 1) {
            // 剩余最后一次 且未中奖则本次必中
            long result = (1 + Math.round(Math.random() * (9)));
            if (result <= 7) {
                prize = rebateCoupon;
            } else {
                prize = doubleCoupon;
            }
        } else {
            long result = (1 + Math.round(Math.random() * (9)));
            if (result <= 2) {
                prize = rebateCoupon;
            } else if (result <= 5) {
                prize = doubleCoupon;
            }
        }
        return prize;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
@@ -1456,7 +1456,7 @@
            UserSystemCoupon userCoupon = new UserSystemCoupon();
            userCoupon.setUid(uid);
            userCoupon.setSource(UserSystemCoupon.SOURCE_CHOUJIANG);
            userCoupon.setSource(UserSystemCoupon.SOURCE_NEWBIES);
            userCoupon.setSystemCoupon(systemCoupon);
            userCoupon.setState(UserSystemCoupon.STATE_CAN_USE);
            userCoupon.setStateActivated(stateActivated);
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/HomeNavbarService.java
@@ -2,9 +2,11 @@
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.multipart.MultipartFile;
import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar;
import com.yeshi.fanli.exception.homemodule.HomeNavbarException;
/**
 *  APP导航栏
@@ -14,17 +16,6 @@
 */
public interface HomeNavbarService {
    public int deleteByPrimaryKey(Long id);
    public int insert(HomeNavbar record);
    public int insertSelective(HomeNavbar record);
    public HomeNavbar selectByPrimaryKey(Long id);
    public int updateByPrimaryKeySelective(HomeNavbar record);
    public int updateByPrimaryKey(HomeNavbar record);
    
    /**
     * 根据主键批量删除
@@ -33,23 +24,38 @@
     */
    public int deleteBatchByPrimaryKey(List<Long> list);
    
    /**
     * 获取最大的排序值
     * @param card
     * @return
     * 保存
     * @param file
     * @param record
     * @param jumpType
     * @throws HomeNavbarException
     * @throws Exception
     */
    public int getMaxOrder();
    public void saveObject(MultipartFile file, HomeNavbar record) throws HomeNavbarException, Exception;
    /**
     * 更新排序顺序
     * @param id
     * @param moveType
     * @throws HomeNavbarException
     * @throws Exception
     */
    public void updateOrder(Long id, Integer moveType) throws HomeNavbarException, Exception;
    
    /**
     * 查询交换排序对象
     * @param type
     * @param order 排序值
     * 后端列表查询-同时super
     * @param start
     * @param count
     * @param key
     * @return
     */
    public List<HomeNavbar> getChangeOrder(Integer type, Integer order);
    public List<HomeNavbar> listQueryAndBusinessSystem(long start, int count, String key);
    
    /**
     * 后端列表查询
     * 后端查询
     * @param start
     * @param count
     * @param key
@@ -58,13 +64,19 @@
    public List<HomeNavbar> listQuery(long start, int count, String key);
    
    public long countlistQuery(String key);
    /**
     * 图片上传
     * @param file
     * @param homeNavbar
     * @throws Exception
     * 查询有效导航栏
     * @return
     */
    public void uploadPicture(MultipartFile file, HomeNavbar homeNavbar) throws Exception;
    public List<HomeNavbar> listQueryEffective();
    /**
     * 根据分类查询有效导航栏
     * @param classId
     * @return
     */
    public HomeNavbar getEffectiveByClassId(@Param("classId") Long classId);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SpecialPlaceService.java
New file
@@ -0,0 +1,45 @@
package com.yeshi.fanli.service.inter.homemodule;
import java.util.List;
import com.yeshi.fanli.entity.bus.homemodule.SpecialPlace;
import com.yeshi.fanli.exception.SpecialPlaceException;
public interface SpecialPlaceService {
    /**
     * 保存、修改
     * @param record
     * @throws SpecialPlaceException
     * @throws Exception
     */
    public void saveObject(SpecialPlace record) throws SpecialPlaceException, Exception;
    /**
     * 批量删除
     * @param list
     * @return
     * @throws Exception
     */
    public int deleteByPrimaryKeyList(List<Long> list) throws Exception;
    /**
     * 后端查询
     * @param start
     * @param count
     * @param key
     * @return
     * @throws Exception
     */
    public List<SpecialPlace> listQuery(long start, int count, String key) throws Exception;
    public long countQuery(String key);
    /**
     * 获取所有专题位置
     * @return
     */
    public List<SpecialPlace> getList();
}
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SpecialService.java
@@ -6,6 +6,8 @@
import com.yeshi.fanli.entity.bus.homemodule.Special;
import net.sf.json.JSONObject;
/**
 *  专题
 * 
@@ -89,4 +91,13 @@
     */
    public List<Special> listPageBySystemAndCard(long start, int count, String card, Long systemId);
    /**
     *   获取专题列表
     * @param card
     * @param systemId
     * @return
     * @throws Exception
     */
    public JSONObject getSpecialListCache(String card, Long systemId) throws Exception;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SwiperPictureService.java
@@ -87,4 +87,12 @@
     * @throws SwiperPictureException
     */
    public void saveObject(MultipartFile file, SwiperPicture record, String jumpType) throws SwiperPictureException, Exception;
    /**
     * 根据管理id 查询有效轮播图
     * @param bannerId
     * @return
     * @throws SwiperPictureException
     */
    public List<SwiperPicture> getByBannerId(Long bannerId) throws SwiperPictureException;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/hongbao/ThreeSaleSerivce.java
@@ -133,15 +133,6 @@
    public long countSuperiorQuery(Integer state, Long uid);
    /**
     * app端一级查询1.4.1
     *
     * @param start
     * @param count
     * @param uid
     * @return
     */
    public List<ThreeSale> listFirstTeam(long start, int count, Long uid);
    /**
     * 统计所有一级队员
@@ -152,16 +143,6 @@
     * @return
     */
    public long countFirstTeam(Long uid, Integer state);
    /**
     * app端二级查询1.4.1
     *
     * @param start
     * @param count
     * @param uid
     * @return
     */
    public List<ThreeSale> listSecondTeam(long start, int count, Long uid);
    /**
     * 统计二级队员
@@ -181,7 +162,7 @@
     * @param uid
     * @return
     */
    public JSONObject getMyFirstTeam(long start, int count, Long uid);
    public JSONObject getMyFirstTeam(long start, int count, Long uid, Integer state);
    /**
     * 前端查询二级队员
@@ -191,7 +172,7 @@
     * @param uid
     * @return
     */
    public JSONObject getMySecondTeam(long start, int count, Long uid);
    public JSONObject getMySecondTeam(long start, int count, Long uid, Integer state);
    /**
     * 获取上级
@@ -245,4 +226,20 @@
     */
    public long countSuccessFirstTeam(Long uid);
    /**
     * 根据邀请者查询关系
     *
     * @param workerId
     * @return
     */
    public ThreeSale getByWorkerId(Long workerId);
    /**
     * 微信激活邀请队员关系
     * @param invitee
     * @param inviterId
     * @param threeSaleOld
     * @throws ThreeSaleException
     */
    public void bindRelationshipByWX(UserInfo invitee, Long inviterId, ThreeSale threeSaleOld) throws ThreeSaleException;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/lable/QualityGoodsService.java
@@ -195,4 +195,10 @@
    public List<QualityFactory> listFreeGoods(long start, int count, Double tkRate, String lableName);
    public long countFreeGoods(Double tkRate, String lableName);
    /**
     * 限时秒杀随机3个商品
     * @return
     */
    public List<QualityFactory> listFlashSaleRandGoods();
}
fanli/src/main/java/com/yeshi/fanli/service/inter/taobao/TaoBaoUnionAuthRecordService.java
@@ -11,4 +11,12 @@
     */
    public void addAuthRecord(TaoBaoUnionAuthRecord record);
    /**
     * 获取淘宝昵称
     * @param uid
     * @return
     */
    public String getTaoBaoUserNick(Long uid);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/SMSService.java
@@ -18,7 +18,7 @@
     * @param phone
     * @throws SMSException
     */
    public String sendLoginVCode(String phone) throws SMSException;
    public String sendLoginVCode(String phone, int codeLength) throws SMSException;
    /**
     * 发送绑定验证码
@@ -26,7 +26,7 @@
     * @param phone
     * @throws SMSException
     */
    public void sendBindVCode(String phone) throws SMSException;
    public void sendBindVCode(String phone, int codeLength) throws SMSException;
    /**
     * 发送提现验证码
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserAccountService.java
@@ -167,4 +167,45 @@
     * @param uid
     */
    public String repairPortrait(Long uid);
    /**
     * 电话号码登录 1.5.3
     * @param request
     * @param first
     * @param appId
     * @param phone
     * @return
     * @throws UserAccountException
     */
    public UserInfo loginPhone(HttpServletRequest request, int loginType, String vcode, String phone,  String appId)
            throws UserAccountException;
    /**
     *微信登录 1.5.3
     * @param request
     * @param first
     * @param appId
     * @param code
     * @param loginType
     * @return
     * @throws UserAccountException
     */
    public UserInfo loginWinXin(HttpServletRequest request,int loginType, String code, String appId)
            throws UserAccountException;
    /**
     *   绑定电话号码  V1.5.3
     * @param uid
     * @param phone
     * @throws UserAccountException
     */
    public void bindPhoneNew(Long uid, String phone) throws UserAccountException;
    /**
     *  绑定微信 V1.5.3
     * @param uid
     * @param code
     * @throws UserAccountException
     */
    public void bindWeiXin(Long uid, String code) throws UserAccountException;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserExtraTaoBaoInfoService.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.service.inter.user;
import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
import com.yeshi.fanli.exception.user.UserExtraTaoBaoInfoException;
/**
 * 用户淘宝联盟服务
@@ -16,7 +17,8 @@
     * @param uid
     * @param relationId
     */
    public void addRelationId(Long uid, String relationId, String taoBaoUid, boolean valid);
    public void addRelationId(Long uid, String relationId, String taoBaoUid, String nickName,
            boolean valid)  throws UserExtraTaoBaoInfoException;
    /**
     * 添加会员ID
@@ -24,7 +26,8 @@
     * @param uid
     * @param specialId
     */
    public void addSpecialId(Long uid, String specialId, String taoBaoUid, boolean valid);
    public void addSpecialId(Long uid, String specialId, String taoBaoUid,  String nickName,
            boolean valid)  throws UserExtraTaoBaoInfoException;
    /**
     * 通过UID获取淘宝联盟渠道信息
@@ -69,4 +72,17 @@
     * @return
     */
    public UserExtraTaoBaoInfo getBySpecialId(String specialId);
    /**
     * 添加会员ID/渠道ID
     * @param uid
     * @param relationId 渠道ID
     * @param specialId 会员ID
     * @param taoBaoUid
     * @param valid
     * @throws UserExtraTaoBaoInfoException
     */
    public void saveUserTaoBaoInfo(Long uid, String relationId, String specialId, String taoBaoUid, String nickName,
            boolean valid) throws UserExtraTaoBaoInfoException;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInfoExtraService.java
@@ -72,5 +72,13 @@
     *  统计各个等级用户数
     */
    public long countByRankId(Long rankId);
    /**
     * 微信邀请激活上级关系 1.5.3
     * @param uid
     * @param code
     * @throws UserInfoExtraException
     */
    public void activationInviteWX(Long uid, String code) throws UserInfoExtraException;
    
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInfoService.java
@@ -7,6 +7,7 @@
import com.yeshi.fanli.entity.bus.user.InviteUser;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.exception.user.UserInfoException;
import com.yeshi.fanli.vo.user.UserInfoVO;
public interface UserInfoService {
@@ -155,4 +156,26 @@
     */
    public UserInfo getInfoByPhoneOrInviteCode(String phone, String inviteCode);
    /**
     * 根据电话号码 获取有效用户
     * @param phone
     * @return
     */
    public UserInfo getEffectiveUserInfoByPhone(String phone);
    /**
     * 获取用户信息
     * @param uid
     * @return
     * @throws UserInfoException
     */
    public UserInfo getUserInfo(Long uid) throws UserInfoException;
    /**
     * 根据微信获取有效用户
     * @param unionId
     * @return
     */
    public UserInfo getEffectiveUserInfoByWXUnionId(String unionId);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInviteRecordService.java
New file
@@ -0,0 +1,18 @@
package com.yeshi.fanli.service.inter.user;
public interface UserInviteRecordService {
    /**
     *   添加/更新邀请记录
     * @param code
     * @param inviter
     */
    public void saveInviteRecord(String code, String uid);
    /**
     *    获取最新 inviterId 邀请人id
     * @param wxUnionId 微信id
     * @return
     */
    public Long getNewestInviterId(String wxUnionId);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserLotteryRecordService.java
New file
@@ -0,0 +1,29 @@
package com.yeshi.fanli.service.inter.user;
import java.util.Map;
import com.yeshi.fanli.exception.user.UserLotteryRecordException;
public interface UserLotteryRecordService {
    /**
     * 根据uid以及抽奖类型 获取抽奖次数
     * @param uid
     * @param type
     * @return
     */
    public Map<String, Object> getLotteryCountDaily(Long uid) throws UserLotteryRecordException, Exception;
    /**
     * 抽奖-天天抽奖励券
     * @param uid
     * @return
     * @throws UserLotteryRecordException
     * @throws Exception
     */
    public Map<String, Object> executeLotteryDaily(Long uid) throws UserLotteryRecordException, Exception;
}
fanli/src/main/java/com/yeshi/fanli/util/Constant.java
@@ -13,7 +13,7 @@
public class Constant {
    public static boolean IS_TASK = false;
    // 外网环境
    public static boolean IS_OUTNET = false;
    public static boolean IS_OUTNET = true;
    public static boolean IS_TEST = true;
fanli/src/main/java/com/yeshi/fanli/vo/msg/ActivityInfo.java
New file
@@ -0,0 +1,43 @@
package com.yeshi.fanli.vo.msg;
import java.util.Date;
public class ActivityInfo {
    private String icon;
    private String title;
    private Date time;
    private String picture;
    private String content;
    public String getIcon() {
        return icon;
    }
    public void setIcon(String icon) {
        this.icon = icon;
    }
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    public Date getTime() {
        return time;
    }
    public void setTime(Date time) {
        this.time = time;
    }
    public String getPicture() {
        return picture;
    }
    public void setPicture(String picture) {
        this.picture = picture;
    }
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
}
fanli/src/main/java/com/yeshi/fanli/vo/msg/UserMsgCenter.java
New file
@@ -0,0 +1,32 @@
package com.yeshi.fanli.vo.msg;
import java.util.Map;
import com.yeshi.fanli.entity.bus.homemodule.Special;
public class UserMsgCenter {
    private Special special;
    private UserMsgVO userMsg;
    private Map<String, Object> welcomeMsg;
    public Special getSpecial() {
        return special;
    }
    public void setSpecial(Special special) {
        this.special = special;
    }
    public UserMsgVO getUserMsg() {
        return userMsg;
    }
    public void setUserMsg(UserMsgVO userMsg) {
        this.userMsg = userMsg;
    }
    public Map<String, Object> getWelcomeMsg() {
        return welcomeMsg;
    }
    public void setWelcomeMsg(Map<String, Object> welcomeMsg) {
        this.welcomeMsg = welcomeMsg;
    }
}