admin
2019-09-12 155913b57ad50126240bc3d5c1aef6ebfe12e3cf
微信开放平台修改
5个文件已删除
14个文件已修改
1个文件已添加
1814 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/AuthCallBackController.java 90 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/InviteGetMoneyController.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserAccountController.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserInfoController.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConfigControllerV2.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java 116 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/xcx/XcxGoodsClassController.java 305 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/xcx/XcxMiniControllerUtil.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/xcx/XcxSearchController.java 442 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/xcx/XcxSystemMiniController.java 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/xcx/XcxUserInfoController.java 440 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/wx/WXAccountInfoDTO.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountServiceImpl.java 94 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserAccountService.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInfoExtraService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/Constant.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/wx/WXLoginUtil.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/AuthCallBackController.java
@@ -13,6 +13,7 @@
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.yeshi.fanli.entity.bus.user.UserActiveLog;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoModifyRecord.ModifyTypeEnum;
import com.yeshi.fanli.entity.taobao.TaoBaoUnionAuthRecord;
@@ -21,6 +22,7 @@
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.msg.UserAccountMsgNotificationService;
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.UserInfoModifyRecordService;
import com.yeshi.fanli.util.AESUtil;
@@ -29,6 +31,7 @@
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TaoBaoConstant;
import com.yeshi.fanli.util.ThreadUtil;
import com.yeshi.fanli.util.VersionUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import net.sf.json.JSONObject;
@@ -51,12 +54,15 @@
    @Resource
    private UserAccountMsgNotificationService userAccountMsgNotificationService;
    @Resource
    private UserInfoModifyRecordService userInfoModifyRecordService;
    @Resource
    private RedisManager redisManager;
    @Resource
    private UserActiveLogService userActiveLogService;
    @RequestMapping(value = "tb")
    public void tb(String code, String state, HttpServletRequest request, HttpServletResponse response) {
@@ -119,7 +125,7 @@
                String relationId = null;
                try {
                    relationId=    TaoKeApiUtil.getRelationId(accessToken, TaoBaoConstant.TAOBAO_AUTH_APPKEY,
                    relationId = TaoKeApiUtil.getRelationId(accessToken, TaoBaoConstant.TAOBAO_AUTH_APPKEY,
                            TaoBaoConstant.TAOBAO_AUTH_APPSECRET);// 渠道ID
                } catch (TaoBaoAuthException e) {
                    if (e.getCode() == TaoBaoAuthException.CODE_NOT_REAL_NAME)
@@ -134,8 +140,8 @@
                    LogHelper.test(e.getMsg());
                    errCode = 5;
                }
                final String relationId2  = relationId;
                final String relationId2 = relationId;
                // 异步申请会员ID
                ThreadUtil.run(new Runnable() {
@@ -153,7 +159,7 @@
                            LogHelper.test(uid + "会员备案失败");
                        try {
                            userExtraTaoBaoInfoService.addSpecialId(uid, specialId, taoBaoUid, name, true);
                            if (!StringUtil.isNullOrEmpty(specialId) && !StringUtil.isNullOrEmpty(relationId2))
                                userInfoModifyRecordService.addModifyRecord(uid, ModifyTypeEnum.bindTaoBao, taoBaoUid);
                        } catch (UserExtraTaoBaoInfoException e) {
@@ -161,8 +167,8 @@
                        }
                    }
                });
                //稍作延迟
                // 稍作延迟
                Thread.sleep(50);
            } else if ("zigou".equalsIgnoreCase(source)) {
                String specialId = null;
@@ -200,7 +206,7 @@
                            LogHelper.test(uid + "渠道备案失败");
                        try {
                            userExtraTaoBaoInfoService.addRelationId(uid, relationId, taoBaoUid, name, true);
                            if (!StringUtil.isNullOrEmpty(specialId2) && !StringUtil.isNullOrEmpty(relationId))
                                userInfoModifyRecordService.addModifyRecord(uid, ModifyTypeEnum.bindTaoBao, taoBaoUid);
                        } catch (UserExtraTaoBaoInfoException e) {
@@ -208,7 +214,7 @@
                        }
                    }
                });
                //稍作延迟
                // 稍作延迟
                Thread.sleep(50);
            } else if ("bind".equalsIgnoreCase(source)) {
@@ -253,7 +259,7 @@
                    try {
                        userExtraTaoBaoInfoService.saveUserTaoBaoInfo(uid, relationId, specialId, taoBaoUid, nickName,
                                true);
                        if (!StringUtil.isNullOrEmpty(specialId) && !StringUtil.isNullOrEmpty(relationId))
                            userInfoModifyRecordService.addModifyRecord(uid, ModifyTypeEnum.bindTaoBao, taoBaoUid);
                    } catch (UserExtraTaoBaoInfoException e) {
@@ -283,33 +289,65 @@
            LogHelper.errorDetailInfo(e);
        }
        UserActiveLog activeLog = userActiveLogService.getUserLatestActiveInfo(uid);
        boolean isNewJump = false;
        if (activeLog != null) {
            String platform = null;
            String version = activeLog.getVersionCode();
            if (activeLog.getChannel().equalsIgnoreCase("appstore")) {
                platform = "ios";
            } else {
                platform = "android";
            }
            if (VersionUtil.greaterThan_2_0(platform, version)) {
                isNewJump = true;
            }
        }
        try {
            if (errCode == 0)// 成功
            {
                if ("share".equalsIgnoreCase(source)) {
                    // response.sendRedirect("http://apph5.yeshitv.com/apppage/flq_bonusState.html?code=0");
                    closeWebPage(response.getWriter());
                    if (isNewJump)
                        response.sendRedirect("http://apph5.yeshitv.com/flqWeb/h5/tbauth/success.html");
                    else
                        closeWebPage(response.getWriter());
                } else if ("zigou".equalsIgnoreCase(source)) {
                    // response.sendRedirect("http://apph5.yeshitv.com/apppage/flq_rebateState.html?code=0");
                    closeWebPage(response.getWriter());
                    if (isNewJump)
                        response.sendRedirect("http://apph5.yeshitv.com/flqWeb/h5/tbauth/success.html");
                    else
                        closeWebPage(response.getWriter());
                } else if ("bind".equalsIgnoreCase(source)) {
                    String script = String.format(
                            "<script>if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {window.location.href = 'yestv://toast#%s';setTimeout(function(){window.location.href = 'yestv://finishPage';},100);} else {yestv.toast(\"恭喜你,淘宝绑定成功\");yestv.finishPage();}</script>",
                            StringUtil.getBase64String("恭喜你,淘宝绑定成功"));
                    response.getWriter().print(script);
                    if (isNewJump)
                        response.sendRedirect("http://apph5.yeshitv.com/flqWeb/h5/tbauth/success.html");
                    else {
                        String script = String.format(
                                "<script>if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {window.location.href = 'yestv://toast#%s';setTimeout(function(){window.location.href = 'yestv://finishPage';},100);} else {yestv.toast(\"恭喜你,淘宝绑定成功\");yestv.finishPage();}</script>",
                                StringUtil.getBase64String("恭喜你,淘宝绑定成功"));
                        response.getWriter().print(script);
                    }
                }
            } else {// 失败
                if ("share".equalsIgnoreCase(source)) {
                    // response.sendRedirect("http://apph5.yeshitv.com/apppage/flq_bonusState.html?code=1");
                    closeWebPage(response.getWriter());
                    if (isNewJump)
                        response.sendRedirect("http://apph5.yeshitv.com/flqWeb/h5/tbauth/fail.html");
                    else
                        closeWebPage(response.getWriter());
                } else if ("zigou".equalsIgnoreCase(source)) {
                    // response.sendRedirect("http://apph5.yeshitv.com/apppage/flq_rebateState.html?code=1");
                    closeWebPage(response.getWriter());
                    if (isNewJump)
                        response.sendRedirect("http://apph5.yeshitv.com/flqWeb/h5/tbauth/fail.html");
                    else
                        closeWebPage(response.getWriter());
                } else if ("bind".equalsIgnoreCase(source)) {
                    String script = String.format(
                            "<script>if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {window.location.href = 'yestv://toast#%s';setTimeout(function(){window.location.href = 'yestv://finishPage';},100);} else {yestv.toast(\"抱歉,淘宝绑定失败\");yestv.finishPage();}</script>",
                            StringUtil.getBase64String("抱歉,淘宝绑定失败"));
                    response.getWriter().print(script);
                    if (isNewJump)
                        response.sendRedirect("http://apph5.yeshitv.com/flqWeb/h5/tbauth/fail.html");
                    else {
                        String script = String.format(
                                "<script>if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {window.location.href = 'yestv://toast#%s';setTimeout(function(){window.location.href = 'yestv://finishPage';},100);} else {yestv.toast(\"抱歉,淘宝绑定失败\");yestv.finishPage();}</script>",
                                StringUtil.getBase64String("抱歉,淘宝绑定失败"));
                        response.getWriter().print(script);
                    }
                }
            }
        } catch (Exception e) {
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java
@@ -282,7 +282,8 @@
            data.put("serviceProtocolLink", serviceProtocol);
            data.put("privacyProtocolLink", privacyProtocol);
            // 购物车跳转方式(包含jumpDetail与params)
            JSONObject source = JSONObject.fromObject(configService.get("taobao_cart_jump_detail"));
            JSONObject source = JSONObject.fromObject(configService.getByVersion("taobao_cart_jump_detail",
                    acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion())));
            data.put("taoBaoCart", source);
            out.print(JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/InviteGetMoneyController.java
@@ -137,7 +137,6 @@
            data.put("topBanner", pictureJson);
        }
        data.put("desc", configService.get("invite_desc"));
        boolean hasCode = false;
@@ -173,7 +172,7 @@
     * @throws IOException
     */
    @RequestMapping(value = "/listInviteFriendImg", method = RequestMethod.POST)
    public void listInviteFriendImg(AcceptData acceptData,  Long uid, PrintWriter out)
    public void listInviteFriendImg(AcceptData acceptData, Long uid, PrintWriter out)
            throws NotExistObjectException, IOException {
        JSONObject data = new JSONObject();
        if (uid != null && !uid.equals("0")) {
@@ -182,15 +181,15 @@
        }
        // 邀请链接
        String shortLink = HttpUtil.getShortLink("http://" + Constant.wxGZConfig.getLoginHost() + "/"
                 + Constant.systemCommonConfig.getProjectName() + "/client/threeShareNew?uid=" + uid);
        String shortLink = HttpUtil.getShortLink("http://" + Constant.wxGZConfig.getLoginHost() + "/"
                + Constant.systemCommonConfig.getProjectName() + "/client/threeShareNew?uid=" + uid);
        data.put("inviteLink", shortLink);
        UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
        if (userInfoExtra != null) {
            data.put("inviteCode", userInfoExtra.getInviteCode());
        }
        // 邀请规则
        String key = "inviteRules"; // key值
        BusinessSystem system = new BusinessSystem();
@@ -203,7 +202,7 @@
        String valueBr = valueN.replace("\n", "<br><br>");
        data.put("helpLink", configService.get("invite_help_link"));
        data.put("inviteRules", valueBr);
        out.print(JsonUtil.loadTrue(0, JsonUtil.getSimpleGson().toJson(data), "成功"));
    }
@@ -244,7 +243,7 @@
     *            邀请嘛
     * @param out
     */
    @RequestSerializableByKey(key ="'activationInvite-'+#uid")
    @RequestSerializableByKey(key = "'activationInvite-'+#uid")
    @RequestMapping(value = "activationInvite")
    public void activationInvite(AcceptData acceptData, String callback, Long uid, String inviteCode, PrintWriter out) {
        try {
@@ -270,7 +269,6 @@
        }
    }
    /**
     * 激活邀请
     * 
@@ -281,11 +279,12 @@
     *            邀请嘛
     * @param out
     */
    @RequestSerializableByKey(key ="'activationInviteWX-'+#uid")
    @RequestSerializableByKey(key = "'activationInviteWX-'+#uid")
    @RequestMapping(value = "activationInviteWX")
    public void activationInviteWX(AcceptData acceptData, Long uid, String  code, PrintWriter out) {
    public void activationInviteWX(AcceptData acceptData, Long uid, String code, PrintWriter out) {
        try {
            userInfoExtraService.activationInviteWX(uid, code);
            userInfoExtraService.activationInviteWX(
                    Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion()), uid, code);
            out.print(JsonUtil.loadTrueResult("邀请码激活成功"));
        } catch (UserInfoExtraException e) {
            out.print(JsonUtil.loadFalseResult(e.getMsg()));
@@ -295,7 +294,6 @@
        }
    }
    /**
     * 获取邀请码
     * 
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserAccountController.java
@@ -14,6 +14,7 @@
import org.yeshi.utils.encrypt.DESUtil;
import com.alipay.api.AlipayApiException;
import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.BindingAccount;
import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode;
@@ -152,7 +153,7 @@
    @Resource
    private UserTaoLiJinOriginService userTaoLiJinOriginService;
    @Resource
    private UserInfoModifyRecordService userInfoModifyRecordService;
@@ -221,8 +222,8 @@
        tbUserInfo.setTbPic(tbPortrait);
        try {
            LoginResult result = userAccountService.login(request, first, system.getAppid(), code, phone, tbUserInfo,
                    wxinstall, loginType);
            LoginResult result = userAccountService.login(request, acceptData, first, system.getAppid(), code, phone,
                    tbUserInfo, wxinstall, loginType);
            if (result == null)
                LogHelper.error("login-result为空值");
@@ -387,7 +388,10 @@
        }
        UserInfo user = null;
        if (!StringUtil.isNullOrEmpty(code)) {
            WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code);
            WXAccountInfoDTO accountInfo = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
            WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code, accountInfo.getAppId(),
                    accountInfo.getAppSecret());
            if (weiXinUser == null) {
                out.print(JsonUtil.loadFalseResult(1, "获取微信用户信息失败"));
                return;
@@ -640,7 +644,7 @@
        }
        try {
            userAccountService.changeWXBind(uid, code);
            userAccountService.changeWXBind(acceptData, uid, code);
            UserInfo user = userInfoService.getUserByIdWithMybatis(uid);
            // 判断taoBaoUid是否已经封禁
            ForbiddenUserIdentifyCode ic = forbiddenUserIdentifyCodeService
@@ -941,6 +945,8 @@
        String[] ALIPAY_CODES = new String[] { "SYSTEM_ERROR", "PERMIT_CHECK_PERM_LIMITED", "PERM_AML_NOT_REALNAME_REV",
                "PERM_AML_NOT_REALNAME_REV", "PAYEE_USER_INFO_ERROR", "PAYEE_ACC_OCUPIED",
                "PERMIT_CHECK_PERM_IDENTITY_THEFT", "PERMIT_NON_BANK_LIMIT_PAYEE", "EXCEED_LIMIT_UNRN_DM_AMOUNT" };
        BindingAccount oldBindingAccount = bindingAccountService.getBindingAccountByUidAndType(uid,
                BindingAccount.TYPE_ALIPAY);
        try {
            BigDecimal balance = user.getMyHongBao();
            BindingAccount bindingAccount = bindingAccountService.changeAlipayBindingWithVerify(uid, name, account);
@@ -951,7 +957,7 @@
            else
                out.print(JsonUtil.loadTrue(0, JsonUtil.getGson().toJson(bindingAccount),
                        "系统已成功转账0.1元到提现账号中,提现账号验证通过,恭喜你!可以提现了。注:此0.1元将会在后续产生的余额中合理扣除,敬请知晓。"));
            userInfoModifyRecordService.addModifyRecord(uid, ModifyTypeEnum.bindAlipay, account);
        } catch (AlipayTransferException e1) {
            if (e1.getSubCode().equalsIgnoreCase("PAYEE_NOT_EXIST")) {
@@ -974,7 +980,11 @@
        } catch (AlipayAccountException e3) {
            // 账户无余额
            if (e3.getCode() == AlipayAccountException.CODE_NO_MONEY) {
                out.print(JsonUtil.loadFalseResult(5, "你的账户目前没有余额,无需绑定提现账号。"));
                if (oldBindingAccount != null) {
                    out.print(JsonUtil.loadFalseResult(5, "当前账户没有余额,无需修改,请有余额后修改"));
                } else {
                    out.print(JsonUtil.loadFalseResult(5, "当前账户没有余额,请有余额后绑定"));
                }
                return;
                // 提现次数限制
            } else if (e3.getCode() == AlipayAccountException.CODE_TIMES_LIMIT) {
@@ -1156,7 +1166,7 @@
            // 微信登录
            if (loginType == 2) {
                userInfo = userAccountService.loginWinXin(request, loginType, code, system.getAppid());
                userInfo = userAccountService.loginWinXin(request, acceptData, loginType, code, system.getAppid());
            }
            if (userInfo == null) {
@@ -1312,7 +1322,7 @@
        }
        try {
            userAccountService.bindWeiXin(uid, code);
            userAccountService.bindWeiXin(acceptData,uid, code);
            UserInfo user = userInfoService.getUserByIdWithMybatis(uid);
            // 判断taoBaoUid是否已经封禁
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserInfoController.java
@@ -40,6 +40,7 @@
import com.yeshi.fanli.dto.HongBaoDTO;
import com.yeshi.fanli.dto.money.AccountDetails;
import com.yeshi.fanli.dto.order.OrderItem;
import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
import com.yeshi.fanli.entity.AppVersionInfo;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.AccountMessage;
@@ -293,7 +294,9 @@
            int loginType = form.getLoginType();
            // WeiXinUserParam wxParam = null;
            // 如果是微信登陆,那需要先获取到微信的unionid
            WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code);
            WXAccountInfoDTO account = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
            WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code, account.getAppId(),
                    account.getAppSecret());
            if (loginType == Constant.WEIXIN && StringUtil.isNullOrEmpty(form.getWxUnionId())) {
                // wxParam = WXinUtil.getWxParam(code);
                if (weiXinUser == null) {
@@ -388,7 +391,11 @@
                                                 * StringUtil.isNullOrEmpty(form
                                                 * .getWxOpenId())
                                                 */) {
                WeiXinUser xinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code);
                WXAccountInfoDTO account = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
                WeiXinUser xinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code, account.getAppId(),
                        account.getAppSecret());
                if (xinUser == null) {
                    out.print(JsonUtil.loadFalseResult("登录失败"));
                    return;
@@ -647,7 +654,9 @@
        }
        int loginType = form.getLoginType();
        if (loginType == Constant.WEIXIN) {
            WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code);
            WXAccountInfoDTO account = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
            WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code, account.getAppId(),
                    account.getAppSecret());
            if (weiXinUser == null) {
                out.print(JsonUtil.loadFalseResult("绑定失败,用户异常请重试!"));
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConfigControllerV2.java
@@ -245,11 +245,17 @@
        JSONObject data = new JSONObject();
        if (url != null && url.contains("ifeeds.tmall.com/article.html?")) {
            data.put("baichuan", true);
            if (VersionUtil.greaterThan_2_0(acceptData.getPlatform(), acceptData.getVersion()))
                data.put("baichuan", false);
            else
                data.put("baichuan", true);
            data.put("goodsDetail", false);
        } else if (url != null && (url.contains("s.click") || url.contains("taobao.com") || url.contains("tmall.com")
                || url.contains("m.tb.cn"))) {
            data.put("baichuan", true);// 采用阿里百川的方式加载webview
            if (VersionUtil.greaterThan_2_0(acceptData.getPlatform(), acceptData.getVersion()))
                data.put("baichuan", false);
            else
                data.put("baichuan", true);
            data.put("goodsDetail", true);// 需要拦截商品详情
        } else if (url != null && (url.contains("jd.com"))) {
            // 不能包含详情页
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java
@@ -34,37 +34,34 @@
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@Controller
@RequestMapping("api/v2/invite")
public class InviteControllerV2 {
    @Resource
    private ConfigService configService;
    @Resource
    private PushService pushService;
    @Resource
    private UserSystemMsgService userSystemMsgService;
    @Resource
    private ThreeSaleSerivce threeSaleSerivce;
    @Resource
    private UserInfoService userInfoService;
    @Resource
    private UserInfoExtraService userInfoExtraService;
    @Resource
    private ThreeSaleExtraInfoSerivce threeSaleExtraInfoSerivce;
    /**
     * 邀请码验证
     *
     * @param out
     */
    @RequestMapping(value = "verifyCode")
@@ -80,16 +77,17 @@
            out.print(JsonUtil.loadFalseResult(e.getMsg()));
        }
    }
    /**
     * 邀请码微信
     *
     * @param out
     */
    @RequestMapping(value = "verifyWX")
    public void verifyWX(AcceptData acceptData, Long uid, String code, PrintWriter out) {
        try {
            UserInfo userInfo = userInfoExtraService.getInviterInfo(uid, code);
            UserInfo userInfo = userInfoExtraService.getInviterInfo(
                    Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion()), uid, code);
            JSONObject data = new JSONObject();
            data.put("nickName", userInfo.getNickName());
            data.put("portrait", userInfo.getPortrait());
@@ -99,7 +97,7 @@
            out.print(JsonUtil.loadFalseResult(e.getMsg()));
        }
    }
    /**
     * 用户队员列表查询 1.5.3查询有效队员
     * 
@@ -123,10 +121,10 @@
            listTeam = threeSaleSerivce.listSecondTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid, 1);
            count = threeSaleSerivce.countSecondTeam(uid, 1);
        }
        // 组织数据
        JSONObject resultData = organizeTeam(count, listTeam, uid, type);
        // 第一页判断是否激活 是否有队员
        if (type == 1 && page == 1) {
            boolean hasCode = false;
@@ -136,15 +134,14 @@
                    hasCode = true;
            }
            resultData.put("hasCode", hasCode);
            resultData.put("hasTeam", count > 0? true:false);
            resultData.put("hasTeam", count > 0 ? true : false);
        }
        out.print(JsonUtil.loadTrueResult(resultData));
    }
    /**
     * 组织数据
     *
     * @param count
     * @param list
     * @param uid
@@ -154,28 +151,28 @@
    private JSONObject organizeTeam(long count, List<ThreeSale> list, Long uid, int type) {
        JSONObject result = new JSONObject();
        JSONArray resultArray = new JSONArray();
        Date todayTime = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("MM.dd HH:mm");
        SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd HH:mm");
        SimpleDateFormat formatYears = new SimpleDateFormat("yyyy");
        for (ThreeSale threeSale : list) {
            UserInfo worker = threeSale.getWorker();
            if (worker == null) {
                continue;
            }
            Long workerId = worker.getId();
            JSONObject object = new JSONObject();
            object.put("workerId", worker.getId());
            object.put("nickName", worker.getNickName());
            object.put("portrait", worker.getPortrait());
            object.put("inviteId", threeSale.getId());
            Date inviteTime = new Date(threeSale.getCreateTime());
            object.put("inviteTime", format.format(inviteTime) + " 加入");
            String fontColor1 = "#888888";
            JSONArray array = new JSONArray();
            if (threeSale.getState()) {
@@ -194,9 +191,9 @@
                    contentJson.put("content", "最近登录 " + format.format(lastLoginTime));
                }
                array.add(contentJson);
                // 一级队员 查询
                if(type == 1) {
                if (type == 1) {
                    String memoName = null;
                    ThreeSaleExtraInfo threeSaleExtraInfo = threeSale.getThreeSaleExtraInfo();
                    if (threeSaleExtraInfo != null) {
@@ -205,7 +202,7 @@
                        }
                    }
                    object.put("memoName", memoName);
                    UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(workerId);
                    if (userInfoExtra != null && !StringUtil.isNullOrEmpty(userInfoExtra.getWeiXin())) {
                        object.put("weiXin", userInfoExtra.getWeiXin());
@@ -221,7 +218,7 @@
                        }
                    }
                }
            }
            }
            object.put("state", 1);
            object.put("recentMsg", array);
            resultArray.add(object);
@@ -232,7 +229,6 @@
        return result;
    }
    /**
     * 用户队员统计- IOS
     * 
@@ -244,7 +240,7 @@
    public void countMyTeam(AcceptData acceptData, long uid, PrintWriter out) {
        JSONObject bossData = getBossInfo(acceptData, uid, threeSaleSerivce.getMyBoss(uid));
        JSONObject resultData = new JSONObject();
        long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1);
        resultData.put("boss", bossData);
        resultData.put("helpLink", configService.get("team_help_url"));
@@ -252,25 +248,25 @@
        resultData.put("firstTeamTotal", threeSaleSerivce.countFirstTeam(uid, null));
        resultData.put("secondTeam", threeSaleSerivce.countSecondTeam(uid, 1));
        resultData.put("secondTeamTotal", threeSaleSerivce.countSecondTeam(uid, null));
        boolean hasTeam = true;
        if (firstTeam <= 0) {
            hasTeam = false;
            resultData.put("invitelink", configService.get("invite_activation_url"));
        }
        resultData.put("hasTeam", hasTeam);
        boolean hasCode = false;
        boolean bdWeiXin = false;
        UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
        if (userInfoExtra != null) {
            if (!StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode()))
                hasCode = true;
            if (!StringUtil.isNullOrEmpty(userInfoExtra.getWeiXin()))
                bdWeiXin = true;
        }
        // 未激活邀请码
        resultData.put("hasCode", hasCode);
        if (!hasCode) {
@@ -280,7 +276,7 @@
            tipCode.add("邀请激活功能,必须要有邀请码,邀请码可以通过金币兑换,也可以全网搜索。");
            resultData.put("tipCode", tipCode);
        }
        // 未添加微信号
        List<String> tipWeiXin = new ArrayList<String>();
        if (!bdWeiXin) {
@@ -290,12 +286,13 @@
        resultData.put("tipWeiXin", tipWeiXin);
        resultData.put("tipWeiXinAdd", "添加微信号后,你的邀请人和一级队员可以通过微信与你建立联系。");
        resultData.put("bdWeiXin", bdWeiXin);
        out.print(JsonUtil.loadTrueResult(resultData));
    }
    /**
     * 上级信息组织
     *
     * @param acceptData
     * @param uid
     * @param threeSale
@@ -312,7 +309,7 @@
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
            Long createTime = threeSale.getCreateTime();
            Date inviteTime = new Date(createTime);
            UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(boss.getId());
            if (userInfoExtra != null && !StringUtil.isNullOrEmpty(userInfoExtra.getWeiXin())) {
                bossData.put("weiXin", userInfoExtra.getWeiXin());
@@ -331,15 +328,14 @@
        } else {
            bossData.put("hasBoss", false);
            bossData.put("helpLink", configService.get("invite_code_hlep_link"));
            bossData.put("weiXinTip", "恭喜你,我们的优质用户;\r\n你并没有邀请人,但你的邀请激活功能是被默认开启的;\r\n你拥有独特的无邀请人激活码。");
            bossData.put("weiXinTip", "恭喜你,我们的优质用户;\r\n你并没有邀请人,但你的邀请激活功能是被默认开启的;\r\n你拥有独特的无邀请人激活码。");
        }
        return bossData;
    }
    }
    /**
     * 站内信提醒队员添加微信号
     *
     * @param acceptData
     * @param uid
     * @param inviteId
@@ -351,19 +347,19 @@
            out.print(JsonUtil.loadFalseResult("传递参数缺失"));
            return;
        }
        UserInfo userInfo = userInfoService.selectByPKey(uid);
        if (userInfo == null) {
            out.print(JsonUtil.loadFalseResult("用户信息不存在"));
            return;
        }
        ThreeSale threeSale = threeSaleSerivce.selectByPrimaryKey(inviteId);
        if (threeSale == null) {
            out.print(JsonUtil.loadFalseResult("关系id不存在"));
            return;
        }
        }
        Long remindId = null;
        boolean remindBoss = true;
        if (uid.longValue() == threeSale.getWorker().getId().longValue()) {
@@ -371,13 +367,13 @@
        } else if (uid.longValue() == threeSale.getBoss().getId().longValue()) {
            remindBoss = false;
            remindId = threeSale.getWorker().getId(); // 提醒下级
        }
        }
        if (remindId == null) {
            out.print(JsonUtil.loadFalseResult("信息验证未通过"));
            return;
        }
        Long bossId = null;
        Long workerId = null;
        String title = "队员提醒消息";
@@ -386,29 +382,31 @@
            // 提示队长
            bossId = remindId;
            workerId = uid;
            content = "你的一级队员"+ userInfo.getNickName() +",提醒你添加微信号,以便于和你取得联系和学习省钱技巧,赶快去添加吧;注:请升级到本软件最新版本在“我的-我的信息”中添加。";
            content = "你的一级队员" + userInfo.getNickName()
                    + ",提醒你添加微信号,以便于和你取得联系和学习省钱技巧,赶快去添加吧;注:请升级到本软件最新版本在“我的-我的信息”中添加。";
        } else {
            // 提示队员
            bossId = uid;
            workerId = remindId;
            content = "你的邀请人"+ userInfo.getNickName() +",提醒你添加微信号,以便于和你取得联系帮助你更好的省钱,赶快去添加吧;注:请升级到本软件最新版本在“我的-我的信息”中添加。";
            content = "你的邀请人" + userInfo.getNickName()
                    + ",提醒你添加微信号,以便于和你取得联系帮助你更好的省钱,赶快去添加吧;注:请升级到本软件最新版本在“我的-我的信息”中添加。";
        }
        try {
            List<String> listIOS = new ArrayList<String>();
            List<String> listAndroid = new ArrayList<String>();
            pushService.pushZNX(remindId, title, content, listIOS, listAndroid);
            userSystemMsgService.addUserSystemMsg(remindId, UserSystemMsgTypeEnum.common,
                    title, content, UserSystemMsg.TIME_TAG_COMMON, null);
            userSystemMsgService.addUserSystemMsg(remindId, UserSystemMsgTypeEnum.common, title, content,
                    UserSystemMsg.TIME_TAG_COMMON, null);
            ThreeSaleExtraInfo newInfo = new ThreeSaleExtraInfo();
            if (remindBoss) {
                newInfo.setRemindBoss(1);
            } else {
                newInfo.setRemindWorker(1);
            }
            ThreeSaleExtraInfo threeExtra = threeSaleExtraInfoSerivce.getbyBossIdAndWorkerId(bossId, workerId);
            if (threeExtra != null) {
                newInfo.setId(threeExtra.getId());
@@ -421,7 +419,7 @@
                newInfo.setUpdateTime(new Date());
                threeSaleExtraInfoSerivce.insertSelective(newInfo);
            }
            JSONObject data = new JSONObject();
            data.put("weiXinState", 2);
            data.put("weiXinTip", "系统已发送提醒,邀请人添加微信后你可复制,如对方迟迟不添加,你可联系人工客服寻求帮助");
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java
@@ -370,8 +370,7 @@
        try {
            TaoBaoGoodsBrief goods = null;
            try {
                goods = TaoKeApiUtil.searchGoodsDetail(auctionId, new TaoKeAppInfo(TaoBaoConstant.TAOBAO_AUTH_APPKEY,
                        TaoBaoConstant.TAOBAO_AUTH_APPSECRET, TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT));
                goods = TaoKeApiUtil.searchGoodsDetail(auctionId);
            } catch (TaobaoGoodsDownException e2) {
                e2.printStackTrace();
            }
@@ -381,11 +380,16 @@
                return;
            }
            if (goods.getTkRate() == null || goods.getTkRate().compareTo(new BigDecimal(0)) <= 0) {
                //TaoKeApiUtil.specialConvertCoupon(auctionId, app);
            }
            // 计算推广红包
            String warningRate = configTaoLiJinService.getValueByKey("warning_value", new Date());
            LogHelper.error("推广红包比例:"+warningRate);
            LogHelper.error("推广红包比例:" + warningRate);
            BigDecimal spreadMoney = TaoLiJinUtil.getSpreadMoney(warningRate, goods);
            LogHelper.error("推广红包:"+spreadMoney);
            LogHelper.error("推广红包:" + spreadMoney);
            // 推广红包 不能小于1
            if (spreadMoney.compareTo(new BigDecimal(1.1)) < 0) {
                out.print(JsonUtil.loadFalseResult(1, "该商品淘礼金不足"));
fanli/src/main/java/com/yeshi/fanli/controller/xcx/XcxGoodsClassController.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/controller/xcx/XcxMiniControllerUtil.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/controller/xcx/XcxSearchController.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/controller/xcx/XcxSystemMiniController.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/controller/xcx/XcxUserInfoController.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/dto/wx/WXAccountInfoDTO.java
New file
@@ -0,0 +1,53 @@
package com.yeshi.fanli.dto.wx;
public class WXAccountInfoDTO {
    // 公众号
    private String gzAppId;
    private String gzAppSecret;
    // APP
    private String appId;
    private String appSecret;
    public WXAccountInfoDTO(String gzAppId, String gzAppSecret, String appId, String appSecret) {
        this.gzAppId = gzAppId;
        this.gzAppSecret = gzAppSecret;
        this.appId = appId;
        this.appSecret = appSecret;
    }
    public WXAccountInfoDTO() {
    }
    public String getGzAppId() {
        return gzAppId;
    }
    public void setGzAppId(String gzAppId) {
        this.gzAppId = gzAppId;
    }
    public String getGzAppSecret() {
        return gzAppSecret;
    }
    public void setGzAppSecret(String gzAppSecret) {
        this.gzAppSecret = gzAppSecret;
    }
    public String getAppId() {
        return appId;
    }
    public void setAppId(String appId) {
        this.appId = appId;
    }
    public String getAppSecret() {
        return appSecret;
    }
    public void setAppSecret(String appSecret) {
        this.appSecret = appSecret;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountServiceImpl.java
@@ -24,6 +24,8 @@
import com.yeshi.fanli.dao.mybatis.AccountMessageMapper;
import com.yeshi.fanli.dao.mybatis.UserConnectHistoryMapper;
import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.BindingAccount;
import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode;
import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode.ForbiddenUserIdentifyCodeTypeEnum;
@@ -111,16 +113,16 @@
    @Resource
    private JedisPool jedisPool;
    @Lazy
    @Resource
    private UserInfoModifyRecordService userInfoModifyRecordService;
    @Transactional
    @Override
    public LoginResult login(HttpServletRequest request, Boolean first, String appId, String code, String phone,
            UserInfo tbUserInfo, boolean wxinstall, int loginType) throws UserAccountException {
    public LoginResult login(HttpServletRequest request, AcceptData acceptData, Boolean first, String appId,
            String code, String phone, UserInfo tbUserInfo, boolean wxinstall, int loginType)
            throws UserAccountException {
        JSONObject logInfo = new JSONObject();
        logInfo.put("appId", appId);
@@ -182,7 +184,9 @@
            case 2:// 微信
                    // 通过Code换取信息
                weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code);
                WXAccountInfoDTO wxAccount = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
                weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code, wxAccount.getAppId(),
                        wxAccount.getAppSecret());
                if (weiXinUser == null)
                    throw new UserAccountException(1001, "无法获取到微信个人信息");
                LogHelper.test("微信授权用户信息:" + new Gson().toJson(weiXinUser));
@@ -363,7 +367,7 @@
            }
        } else {// 没有安装微信
            LoginResult result = loginNoInstallWX(appId, code, phone, tbUserInfo, loginType);
            LoginResult result = loginNoInstallWX(acceptData, appId, code, phone, tbUserInfo, loginType);
            if (result.getType() == LoginResult.TYPE_CREATE)
                session.setAttribute("LAST_LOGIN_USER", result.getUser());
            return result;
@@ -372,8 +376,8 @@
    @Transactional
    @Override
    public LoginResult loginNoInstallWX(String appId, String code, String phone, UserInfo tbUserInfo, int loginType)
            throws UserAccountException {
    public LoginResult loginNoInstallWX(AcceptData acceptData, String appId, String code, String phone,
            UserInfo tbUserInfo, int loginType) throws UserAccountException {
        JSONObject logInfo = new JSONObject();
        logInfo.put("appId", appId);
        logInfo.put("code", code);
@@ -397,7 +401,9 @@
            break;
        case 2:// 微信
                // 通过Code换取信息
            weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code);
            WXAccountInfoDTO wxAccount = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
            weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code, wxAccount.getAppId(),
                    wxAccount.getAppSecret());
            if (weiXinUser == null)
                throw new UserAccountException(1001, "无法获取到微信个人信息");
@@ -698,7 +704,7 @@
        if (StringUtil.isNullOrEmpty(user.getPortrait()))
            user.setPortrait(Constant.systemCommonConfig.getDefaultPortrait());
        userInfoMapper.insertSelective(user);
        // 昵称为空时 默认昵称
        if (StringUtil.isNullOrEmpty(user.getNickName())) {
            UserInfo updateUserInfo = new UserInfo(user.getId());
@@ -712,14 +718,13 @@
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (!StringUtil.isNullOrEmpty(user.getPhone()))
        if (!StringUtil.isNullOrEmpty(user.getPhone()))
            userInfoModifyRecordService.addModifyRecord(uid, ModifyTypeEnum.bindPhone, user.getPhone());
        if (!StringUtil.isNullOrEmpty(user.getWxUnionId()))
        if (!StringUtil.isNullOrEmpty(user.getWxUnionId()))
            userInfoModifyRecordService.addModifyRecord(uid, ModifyTypeEnum.bindWeiXin, user.getWxUnionId());
    }
    @Override
@@ -744,8 +749,7 @@
        update.setPhone(phone);
        userInfoMapper.updateByPrimaryKeySelective(update);
        userAccountMsgNotificationService.bindingSuccess(uid, MsgAccountDetailFactory.TYPE_PHONE);
        userInfoModifyRecordService.addModifyRecord(uid, ModifyTypeEnum.bindPhone, phone);
    }
@@ -830,11 +834,13 @@
    }
    @Override
    public void changeWXBind(Long uid, String code) throws UserAccountException {
    public void changeWXBind(AcceptData acceptData, Long uid, String code) throws UserAccountException {
        UserInfo user = userInfoMapper.selectByPrimaryKey(uid);
        if (user == null)
            throw new UserAccountException(4, "用户不存在");
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code);
        WXAccountInfoDTO wxAccount = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code, wxAccount.getAppId(),
                wxAccount.getAppSecret());
        if (weiXinUser == null)
            throw new UserAccountException(10, "获取微信用户信息失败");
        if (weiXinUser.getUnionid().equalsIgnoreCase(user.getWxUnionId()))
@@ -842,14 +848,14 @@
        UserInfo newUser = getUserInfoByWXUnionId(user.getAppId(), weiXinUser.getUnionid());
        if (newUser != null)
            throw new UserAccountException(13, "亲,你要更换绑定的微信号已被其他账号绑定");
            throw new UserAccountException(13, "该微信号已被其他账号绑定");
        UserInfo updateUserInfo = new UserInfo(uid);
        updateUserInfo.setWxName(weiXinUser.getNickname());
        updateUserInfo.setWxOpenId(weiXinUser.getOpenid());
        updateUserInfo.setWxPic(weiXinUser.getHeadimgurl());
        updateUserInfo.setWxUnionId(weiXinUser.getUnionid());
        // 将默认昵称替换成微信昵称
        String defaultNickName = Constant.systemCommonConfig.getDefaultNickName();
        if (!StringUtil.isNullOrEmpty(defaultNickName) && !StringUtil.isNullOrEmpty(weiXinUser.getNickname())) {
@@ -865,12 +871,11 @@
                && defaultPortrait.equals(user.getPortrait())) {
            updateUserInfo.setPortrait(weiXinUser.getHeadimgurl());
        }
        userInfoMapper.updateByPrimaryKeySelective(updateUserInfo);
        userAccountMsgNotificationService.changeBindingSuccess(uid, MsgAccountDetailFactory.TYPE_WX);
        userInfoModifyRecordService.addModifyRecord(uid, ModifyTypeEnum.bindWeiXin, weiXinUser.getUnionid());
    }
@@ -1023,7 +1028,7 @@
            if (exec == null || exec.size() == 0) {
                throw new UserAccountException(10, "请稍后再试");
            } else {
                // 查询是否存在该电话历史用户
                UserInfo userInfo = userInfoMapper.getEffectiveUserInfoByPhone(phone);
                if (userInfo != null) {
@@ -1032,7 +1037,7 @@
                } else {
                    userInfo = new UserInfo();
                    userInfo.setAppId(appId);
                    //userInfo.setNickName(Constant.systemCommonConfig.getDefaultNickName());
                    // userInfo.setNickName(Constant.systemCommonConfig.getDefaultNickName());
                    userInfo.setPortrait(Constant.systemCommonConfig.getDefaultPortrait());
                    userInfo.setPhone(phone);
                    userInfo.setLoginType(loginType);
@@ -1046,10 +1051,10 @@
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    userInfoModifyRecordService.addModifyRecord(userInfo.getId(), ModifyTypeEnum.bindPhone, phone);
                }
                return userInfo;
            }
        } catch (Exception e) {
@@ -1064,8 +1069,8 @@
    @Transactional
    @Override
    public UserInfo loginWinXin(HttpServletRequest request, int loginType, String code, String appId)
            throws UserAccountException {
    public UserInfo loginWinXin(HttpServletRequest request, AcceptData acceptData, int loginType, String code,
            String appId) throws UserAccountException {
        // 日志信息
        JSONObject logInfo = new JSONObject();
        logInfo.put("appId", appId);
@@ -1074,7 +1079,9 @@
        LogHelper.lgoinInfo(logInfo.toString());
        // 通过Code换取信息
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code);
        WXAccountInfoDTO wxAccount = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code, wxAccount.getAppId(),
                wxAccount.getAppSecret());
        if (weiXinUser == null) {
            throw new UserAccountException(1, "微信帐号授权失败");
        }
@@ -1132,8 +1139,9 @@
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    userInfoModifyRecordService.addModifyRecord(userInfo.getId(), ModifyTypeEnum.bindWeiXin, weiXinUser.getUnionid());
                    userInfoModifyRecordService.addModifyRecord(userInfo.getId(), ModifyTypeEnum.bindWeiXin,
                            weiXinUser.getUnionid());
                }
                return userInfo;
            }
@@ -1199,19 +1207,20 @@
        // 发送消息
        userAccountMsgNotificationService.bindingSuccess(uid, MsgAccountDetailFactory.TYPE_PHONE);
        userInfoModifyRecordService.addModifyRecord(uid, ModifyTypeEnum.bindPhone, phone);
    }
    @Override
    public void bindWeiXin(Long uid, String code) throws UserAccountException {
    public void bindWeiXin(AcceptData acceptData, Long uid, String code) throws UserAccountException {
        UserInfo user = userInfoMapper.selectByPrimaryKey(uid);
        if (user == null) {
            throw new UserAccountException(1, "用户不存在");
        }
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code);
        WXAccountInfoDTO wxAccount = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code, wxAccount.getAppId(),
                wxAccount.getAppSecret());
        if (weiXinUser == null) {
            throw new UserAccountException(2, "微信帐号授权失败");
        }
@@ -1249,7 +1258,7 @@
                updateUserInfo.setNickName(weiXinUser.getNickname());
            }
        }
        // 将默认头像替换成微信头像
        String defaultPortrait = Constant.systemCommonConfig.getDefaultPortrait();
        if (!StringUtil.isNullOrEmpty(weiXinUser.getHeadimgurl()) && !StringUtil.isNullOrEmpty(defaultPortrait)
@@ -1272,8 +1281,7 @@
        userAccountBindingHistoryService.addUserAccountBindingHistory(history);
        userAccountMsgNotificationService.bindingSuccess(uid, MsgAccountDetailFactory.TYPE_WX);
        userInfoModifyRecordService.addModifyRecord(uid, ModifyTypeEnum.bindWeiXin, wxUnionId);
    }
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java
@@ -16,6 +16,7 @@
import com.yeshi.fanli.dao.mybatis.user.UserInfoExtraMapper;
import com.yeshi.fanli.dao.mybatis.user.UserRankRecordMapper;
import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
import com.yeshi.fanli.entity.bus.user.ThreeSale;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
@@ -384,7 +385,7 @@
    
    
    @Override
    public void activationInviteWX(Long uid, String code) throws UserInfoExtraException{
    public void activationInviteWX(WXAccountInfoDTO wxAccount, Long uid, String code) throws UserInfoExtraException{
        if (uid == null || code == null) {
            throw new UserInfoExtraException(1, "激活信息不完整");
        }
@@ -405,7 +406,7 @@
        }
        
        // 获取微信信息
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code);
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code,wxAccount.getAppId(),wxAccount.getAppSecret());
        if (weiXinUser == null) {
            throw new UserInfoExtraException(1, "微信授权失败");
        }
@@ -608,7 +609,7 @@
    
    
    @Override
    public UserInfo getInviterInfo(Long uid, String code) throws UserInfoExtraException{
    public UserInfo getInviterInfo(WXAccountInfoDTO wxAccount,Long uid, String code) throws UserInfoExtraException{
        if (code == null) {
            throw new UserInfoExtraException(1, "code信息不完整");
        }
@@ -629,7 +630,7 @@
        }
        
        // 获取微信信息
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUser(code);
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUser(code,wxAccount.getAppId(),wxAccount.getAppSecret());
        if (weiXinUser == null) {
            throw new UserInfoExtraException(1, "微信授权失败");
        }
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserAccountService.java
@@ -3,6 +3,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.LoginResult;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.exception.user.UserAccountException;
@@ -25,7 +26,7 @@
     * @return
     * @throws UserAccountException
     */
    public LoginResult login(HttpServletRequest request, Boolean first, String appId, String code, String phone,
    public LoginResult login(HttpServletRequest request,AcceptData acceptData,  Boolean first, String appId, String code, String phone,
            UserInfo tbUserInfo, boolean wxinstall, int loginType) throws UserAccountException;
    /**
@@ -39,7 +40,7 @@
     * @return
     * @throws UserAccountException
     */
    public LoginResult loginNoInstallWX(String appId, String code, String phone, UserInfo tbUserInfo, int loginType)
    public LoginResult loginNoInstallWX(AcceptData acceptData, String appId, String code, String phone, UserInfo tbUserInfo, int loginType)
            throws UserAccountException;
    /**
@@ -152,7 +153,7 @@
     * @param uid
     * @param code
     */
    public void changeWXBind(Long uid, String code) throws UserAccountException;
    public void changeWXBind(AcceptData acceptData,Long uid, String code) throws UserAccountException;
    /**
     * 清理用户头像
@@ -190,7 +191,7 @@
     * @return
     * @throws UserAccountException
     */
    public UserInfo loginWinXin(HttpServletRequest request,int loginType, String code, String appId)
    public UserInfo loginWinXin(HttpServletRequest request,AcceptData acceptData,int loginType, String code, String appId)
            throws UserAccountException;
    /**
@@ -207,7 +208,7 @@
     * @param code
     * @throws UserAccountException
     */
    public void bindWeiXin(Long uid, String code) throws UserAccountException;
    public void bindWeiXin(AcceptData acceptData,Long uid, String code) throws UserAccountException;
    /**
     * 账户封禁
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInfoExtraService.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.service.inter.user;
import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.bus.user.UserRank;
@@ -81,7 +82,7 @@
     * @param code
     * @throws UserInfoExtraException
     */
    public void activationInviteWX(Long uid, String code) throws UserInfoExtraException;
    public void activationInviteWX(WXAccountInfoDTO wxAccount,Long uid, String code) throws UserInfoExtraException;
    /**
     * 判断是否是新用户
@@ -119,6 +120,6 @@
     * @return
     * @throws UserInfoExtraException
     */
    public UserInfo getInviterInfo(Long uid, String code) throws UserInfoExtraException;
    public UserInfo getInviterInfo(WXAccountInfoDTO wxAccount,Long uid, String code) throws UserInfoExtraException;
    
}
fanli/src/main/java/com/yeshi/fanli/util/Constant.java
@@ -7,7 +7,7 @@
import org.yeshi.utils.annotation.MapUtil;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
import com.yeshi.fanli.entity.config.AlipayConfig;
import com.yeshi.fanli.entity.config.ConstantConfig;
import com.yeshi.fanli.entity.config.SMSConfig;
@@ -268,4 +268,14 @@
        else
            return "返利券";
    }
    public static WXAccountInfoDTO getWXAccount(String platform, String version) {
//        if (VersionUtil.greaterThan_2_0(platform, version)) {
//            return new WXAccountInfoDTO("wxa99686bb65a9f466", "57390718ddedaa1591f6876cdcf96f43", "wx879fb78463222cd5",
//                    "2ad8ec333a9f96b13c5c5c1c2b13cd67");
//        } else {
            return new WXAccountInfoDTO("wx43617e2ed82c5b28", "f8a65908fb4681bdd181de70f6ab9a3b", "wx5c0d167c6e3ad726",
                    "0c79d5869bb0f2d7c13e43f9a18f440d");
//        }
    }
}
fanli/src/main/java/com/yeshi/fanli/util/wx/WXLoginUtil.java
@@ -19,14 +19,9 @@
    public static String WEXIN_APPID = "wx43617e2ed82c5b28";
    public static String WEXIN_SECRET = "f8a65908fb4681bdd181de70f6ab9a3b";
    static String APPID = "wx5c0d167c6e3ad726";
    static String SECRET = "0c79d5869bb0f2d7c13e43f9a18f440d";
    static {
        WEXIN_APPID = Constant.systemCommonConfig.getWxGZAppId();
        WEXIN_SECRET = Constant.systemCommonConfig.getWxGZAppSecret();
        APPID = Constant.systemCommonConfig.getWxOpenAppId();
        SECRET = Constant.systemCommonConfig.getWxOpenAppSecret();
    }
    // 通过code获取access_token openId
@@ -34,8 +29,8 @@
    public static String weiXinUrl2 = "https://api.weixin.qq.com/sns/userinfo?access_token=%s&openid=%s&lang=zh_CN";
    public static WeiXinUserParam getWxParam(String code) {
        String wxUrl = String.format(weiXinUrl1, APPID, SECRET, code);
    public static WeiXinUserParam getWxParam(String code,String appId,String appSecret) {
        String wxUrl = String.format(weiXinUrl1, appId, appSecret, code);
        String result = HttpUtil.get(wxUrl);
        WeiXinUserParam weiXinUserParam = getWeiXinUserParam(result);
        return weiXinUserParam;
@@ -76,8 +71,8 @@
        return weiXinUser;
    }
    public static WeiXinUser getWeiXinUser(String code) {
        WeiXinUserParam param = getWxParam(code);
    public static WeiXinUser getWeiXinUser(String code,String appId,String appSecret) {
        WeiXinUserParam param = getWxParam(code,appId,appSecret);
        if (param == null) {
            return null;
        }
@@ -95,8 +90,8 @@
     * @param code
     * @return
     */
    public static WeiXinUser getWeiXinUserWithSavePortrait(String code) {
        WeiXinUser user = getWeiXinUser(code);
    public static WeiXinUser getWeiXinUserWithSavePortrait(String code,String appId,String appSecret) {
        WeiXinUser user = getWeiXinUser(code,appId,appSecret);
        if (user != null) {
            if (!StringUtil.isNullOrEmpty(user.getHeadimgurl())) {