admin
2019-04-12 8eacbd15374d01296926e87be3125731521000ee
手机号修改7天内禁止事件添加
7个文件已修改
5个文件已添加
406 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/ShareController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserAccountController.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserInfoController.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserAccountBindingHistoryMapper.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserAccountBindingHistory.java 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserAccountBindingHistoryMapper.xml 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/BindingAccountServiceImpl.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/ExtractServiceImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountBindingHistoryServiceImpl.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountServiceImpl.java 53 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserExtraTaoBaoInfoServiceImpl.java 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserAccountBindingHistoryService.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/ShareController.java
@@ -499,7 +499,8 @@
     * @param out
     */
    @RequestMapping(value = "resetShareTextTemplate", method = RequestMethod.POST)
    public void resetShareTextTemplate(AcceptData acceptData, Long uid, Boolean hasCoupon, PrintWriter out) {
    public void resetShareTextTemplate(AcceptData acceptData, Long uid, Long goodsId, Boolean hasCoupon,
            PrintWriter out) {
        if (uid == null) {
            out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
@@ -510,6 +511,11 @@
            shareGoodsTextTemplateService.resetCommonTemplate(uid);
        }
        if (goodsId != null) {
            preViewShareTextTemplate(acceptData, uid, null, goodsId, hasCoupon, out);
            return;
        }
        out.print(JsonUtil.loadTrueResult(""));
    }
fanli/src/main/java/com/yeshi/fanli/controller/client/UserAccountController.java
@@ -20,6 +20,7 @@
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.UserAccountBindingHistory;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.WeiXinUser;
import com.yeshi.fanli.entity.system.BusinessSystem;
@@ -46,6 +47,7 @@
import com.yeshi.fanli.service.inter.user.ShamUserService;
import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
import com.yeshi.fanli.service.inter.user.TBPidService;
import com.yeshi.fanli.service.inter.user.UserAccountBindingHistoryService;
import com.yeshi.fanli.service.inter.user.UserAccountService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.service.inter.user.UserMoneyService;
@@ -134,6 +136,8 @@
    @Resource
    private UserMoneyService userMoneyService;
    
    @Resource
    private UserAccountBindingHistoryService userAccountBindingHistoryService;
    private static final String PASSWORD_MAX_ERROR = "password_max_error";
    private static final String EXTRACT_MIN_MONEY = "extract_min_money";
@@ -912,6 +916,8 @@
        }
        redisManager.cacheCommonString(key, "1", 120);
        // 支付宝绑定
        ForbiddenUserIdentifyCode ic = forbiddenUserIdentifyCodeService
                .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.alipayAccount, account);
@@ -1107,21 +1113,21 @@
        out.print(JsonUtil.loadTrueResult(""));
    }
    
    /**
     *   新版登录  V1.5.3
     *
     * @param acceptData
     * @param vcode
     * @param phone
     * @param code
     * @param loginType 登录方式:  1-手机登录   2-微信登录
     * @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) {
    public void loginNew(AcceptData acceptData, String vcode, String phone, String code, int loginType,
            HttpServletRequest request, PrintWriter out) {
        
        try {
            BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
@@ -1161,7 +1167,8 @@
                            } else if ("ios".equals(platform)) {
                                platformType = 2;
                            }
                            userSystemCouponService.copyLotteryPrize(uuser.getId(), platformType, acceptData.getDevice());
                            userSystemCouponService.copyLotteryPrize(uuser.getId(), platformType,
                                    acceptData.getDevice());
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
@@ -1185,8 +1192,6 @@
            }
        }
    }
    /**
     *   绑定电话号码  V1.5.3
@@ -1227,7 +1232,6 @@
            redisManager.clearSMSFrequencyLimit(phone, SMSHistory.TYPE_BIND);
        }
        
        try {
            // 绑定用户
            userAccountService.bindPhoneNew(uid, phone);
@@ -1259,7 +1263,6 @@
            out.print(JsonUtil.loadFalseResult(1, "绑定失败"));
        }
    }
    
    /**
     * 更改微信
fanli/src/main/java/com/yeshi/fanli/controller/client/UserInfoController.java
@@ -203,7 +203,6 @@
    @Resource
    private AccountMessageService accountMessageService;
    
    private static final String PASSWORD_MAX_ERROR = "password_max_error";
    private static final String EXTRACT_MIN_MONEY = "extract_min_money";
    private static final String EXTRACT_MAX_MONEY = "extract_max_money";
@@ -519,7 +518,6 @@
                }
            }
        }
        GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
@@ -1053,7 +1051,6 @@
        return;
    }
    /**
     * 新版提现
     * 
@@ -1175,6 +1172,8 @@
            out.print(JsonUtil.loadFalseResult("已超过当日提现金额"));
        } else if (etype == 3) {
            out.print(JsonUtil.loadFalseResult("提现金额大于我的红包"));
        } else if (etype == 111) {
            out.print(JsonUtil.loadFalseResult("更换了手机号后7天内不允许提现"));
        }
    }
@@ -1651,7 +1650,6 @@
    }
    /**
     * 用户队员列表查询 1.5.3查询有效队员
     * 
@@ -1723,8 +1721,6 @@
            e.printStackTrace();
        }
    }
    
    /**
     * 用户队员统计 1.4.1
@@ -2065,7 +2061,6 @@
                mySettings.setNoInvitationBonus(0);
            }
            data.put("moduleState", mySettings);
            
            int welfareCenterNews = 0;
            String invitCode = null;
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserAccountBindingHistoryMapper.java
New file
@@ -0,0 +1,19 @@
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.UserAccountBindingHistory;
public interface UserAccountBindingHistoryMapper extends BaseMapper<UserAccountBindingHistory> {
    /**
     * 获取最近一次的绑定记录
     *
     * @param uid
     * @param type
     * @return
     */
    UserAccountBindingHistory selectLatestByTypeAndUid(@Param("uid") Long uid, @Param("type") int type);
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserAccountBindingHistory.java
New file
@@ -0,0 +1,79 @@
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_account_bind_history")
public class UserAccountBindingHistory {
    public final static int TYPE_WX = 1;
    public final static int TYPE_TB = 2;
    public final static int TYPE_PHONE = 3;
    @Column(name = "uabh_id")
    private Long id;
    @Column(name = "uabh_uid")
    private Long uid;
    @Column(name = "uabh_type")
    private Integer type;
    @Column(name = "uabh_content")
    private String content;
    @Column(name = "uabh_first")
    private Boolean first;
    @Column(name = "uabh_create_time")
    private Date createTime;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public Long getUid() {
        return uid;
    }
    public void setUid(Long uid) {
        this.uid = uid;
    }
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
    public Boolean getFirst() {
        return first;
    }
    public void setFirst(Boolean first) {
        this.first = first;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserAccountBindingHistoryMapper.xml
New file
@@ -0,0 +1,91 @@
<?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.UserAccountBindingHistoryMapper">
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.bus.user.UserAccountBindingHistory">
        <id column="uabh_id" property="id" jdbcType="BIGINT" />
        <result column="uabh_uid" property="uid" jdbcType="BIGINT" />
        <result column="uabh_type" property="type" jdbcType="INTEGER" />
        <result column="uabh_content" property="content" jdbcType="VARCHAR" />
        <result column="uabh_first" property="first" jdbcType="BOOLEAN" />
        <result column="uabh_create_time" property="createTime"
            jdbcType="TIMESTAMP" />
    </resultMap>
    <sql id="Base_Column_List">uabh_id,uabh_uid,uabh_type,uabh_content,uabh_first,uabh_create_time
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_user_account_bind_history where uabh_id =
        #{id,jdbcType=BIGINT}
    </select>
    <select id="selectLatestByTypeAndUid" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_user_account_bind_history where uabh_uid =#{uid} and
        uabh_type=#{type} order by uabh_create_time desc limit 1
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_user_account_bind_history where uabh_id =
        #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert"
        parameterType="com.yeshi.fanli.entity.bus.user.UserAccountBindingHistory"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_user_account_bind_history
        (uabh_id,uabh_uid,uabh_type,uabh_content,uabh_first,uabh_create_time)
        values
        (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{type,jdbcType=INTEGER},#{content,jdbcType=VARCHAR},#{first,jdbcType=BOOLEAN},#{createTime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective"
        parameterType="com.yeshi.fanli.entity.bus.user.UserAccountBindingHistory"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_user_account_bind_history
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">uabh_id,</if>
            <if test="uid != null">uabh_uid,</if>
            <if test="type != null">uabh_type,</if>
            <if test="content != null">uabh_content,</if>
            <if test="first != null">uabh_first,</if>
            <if test="createTime != null">uabh_create_time,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="uid != null">#{uid,jdbcType=BIGINT},</if>
            <if test="type != null">#{type,jdbcType=INTEGER},</if>
            <if test="content != null">#{content,jdbcType=VARCHAR},</if>
            <if test="first != null">#{first,jdbcType=BOOLEAN},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey"
        parameterType="com.yeshi.fanli.entity.bus.user.UserAccountBindingHistory">update yeshi_ec_user_account_bind_history set uabh_uid =
        #{uid,jdbcType=BIGINT},uabh_type =
        #{type,jdbcType=INTEGER},uabh_content =
        #{content,jdbcType=VARCHAR},uabh_first =
        #{first,jdbcType=BOOLEAN},uabh_create_time =
        #{createTime,jdbcType=TIMESTAMP} where uabh_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective"
        parameterType="com.yeshi.fanli.entity.bus.user.UserAccountBindingHistory">
        update yeshi_ec_user_account_bind_history
        <set>
            <if test="uid != null">uabh_uid=#{uid,jdbcType=BIGINT},</if>
            <if test="type != null">uabh_type=#{type,jdbcType=INTEGER},</if>
            <if test="content != null">uabh_content=#{content,jdbcType=VARCHAR},</if>
            <if test="first != null">uabh_first=#{first,jdbcType=BOOLEAN},</if>
            <if test="createTime != null">uabh_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
        </set>
        where uabh_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>
fanli/src/main/java/com/yeshi/fanli/service/impl/user/BindingAccountServiceImpl.java
@@ -22,6 +22,7 @@
import com.yeshi.fanli.dao.mybatis.money.UserMoneyDetailMapper;
import com.yeshi.fanli.entity.bus.user.AlipayAccountValidNormalHistory;
import com.yeshi.fanli.entity.bus.user.BindingAccount;
import com.yeshi.fanli.entity.bus.user.UserAccountBindingHistory;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.money.UserMoneyDetail;
import com.yeshi.fanli.exception.AlipayAccountException;
@@ -30,6 +31,7 @@
import com.yeshi.fanli.exception.money.UserMoneyDetailException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.user.BindingAccountService;
import com.yeshi.fanli.service.inter.user.UserAccountBindingHistoryService;
import com.yeshi.fanli.service.inter.user.UserNotificationService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
@@ -48,6 +50,9 @@
    @Resource
    private UserNotificationService userNotificationService;
    @Resource
    private UserAccountBindingHistoryService userAccountBindingHistoryService;
    @Resource
    private UserMoneyDetailMapper userMoneyDetailMapper;
@@ -199,6 +204,17 @@
    @Override
    public BindingAccount changeAlipayBindingWithVerify(Long uid, String name, String account)
            throws AlipayTransferException, AlipayApiException, AlipayAccountException {
        BindingAccount bindingAccount = bindingAccountMapper.selectByUidAndType(uid, BindingAccount.TYPE_ALIPAY);
        if (bindingAccount != null) {
            // 验证是否7天内更换了手机号
            UserAccountBindingHistory history = userAccountBindingHistoryService.getLatestHistory(uid,
                    UserAccountBindingHistory.TYPE_PHONE);
            // 手机号更换绑定的7天内不能提现
            if (history != null && !history.getFirst()
                    && (System.currentTimeMillis() - history.getCreateTime().getTime()) > 1000 * 60 * 60 * 24 * 7L) {
                throw new AlipayAccountException(111, "修改手机号7天内不允许修改支付宝账号");
            }
        }
        try {
            validAlipayAccount(uid, account, name);
@@ -210,7 +226,6 @@
            throw new AlipayAccountException(e1.getCode(), e1.getMsg());
        }
        BindingAccount bindingAccount = bindingAccountMapper.selectByUidAndType(uid, BindingAccount.TYPE_ALIPAY);
        if (bindingAccount == null)// 创建账号
        {
            bindingAccount = new BindingAccount();
fanli/src/main/java/com/yeshi/fanli/service/impl/user/ExtractServiceImpl.java
@@ -34,6 +34,7 @@
import com.yeshi.fanli.entity.bus.user.ExtractRecord;
import com.yeshi.fanli.entity.bus.user.HongBaoV2;
import com.yeshi.fanli.entity.bus.user.PayInfo;
import com.yeshi.fanli.entity.bus.user.UserAccountBindingHistory;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.common.AdminUser;
import com.yeshi.fanli.entity.money.UserMoneyDetail;
@@ -50,6 +51,7 @@
import com.yeshi.fanli.service.inter.push.PushService;
import com.yeshi.fanli.service.inter.user.ExtractRecordService;
import com.yeshi.fanli.service.inter.user.ExtractService;
import com.yeshi.fanli.service.inter.user.UserAccountBindingHistoryService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.service.inter.user.UserMoneyDetailService;
import com.yeshi.fanli.service.inter.user.UserNotificationService;
@@ -118,6 +120,9 @@
    @Resource
    private UserMoneyDetailService userMoneyDetailService;
    @Resource
    private UserAccountBindingHistoryService userAccountBindingHistoryService;
    @Transactional
    public Integer addExtract(Extract extract) {
@@ -228,6 +233,13 @@
     */
    @Transactional
    private Integer extract(Extract extract) {
        UserAccountBindingHistory history = userAccountBindingHistoryService
                .getLatestHistory(extract.getUserInfo().getId(), UserAccountBindingHistory.TYPE_PHONE);
        // 手机号更换绑定的7天内不能提现
        if (history != null && !history.getFirst()
                && (System.currentTimeMillis() - history.getCreateTime().getTime()) > 1000 * 60 * 60 * 24 * 7L)
            return 111;
        final String autoExtract = configService.get("extract_way"); // 是否自动转账
        final String maxCount = configService.get("extract_count_day");
        final String maxMoney = configService.get("extract_money_day");
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountBindingHistoryServiceImpl.java
New file
@@ -0,0 +1,33 @@
package com.yeshi.fanli.service.impl.user;
import java.util.Date;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.user.UserAccountBindingHistoryMapper;
import com.yeshi.fanli.entity.bus.user.UserAccountBindingHistory;
import com.yeshi.fanli.service.inter.user.UserAccountBindingHistoryService;
import com.yeshi.fanli.util.StringUtil;
@Service
public class UserAccountBindingHistoryServiceImpl implements UserAccountBindingHistoryService {
    @Resource
    private UserAccountBindingHistoryMapper userAccountBindingHistoryMapper;
    @Override
    public void addUserAccountBindingHistory(UserAccountBindingHistory history) {
        if (history.getType() == null || StringUtil.isNullOrEmpty(history.getContent()) || history.getUid() == null)
            return;
        history.setCreateTime(new Date());
        userAccountBindingHistoryMapper.insertSelective(history);
    }
    @Override
    public UserAccountBindingHistory getLatestHistory(Long uid, int type) {
        return userAccountBindingHistoryMapper.selectLatestByTypeAndUid(uid, type);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountServiceImpl.java
@@ -28,6 +28,7 @@
import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode.ForbiddenUserIdentifyCodeTypeEnum;
import com.yeshi.fanli.entity.bus.user.LoginResult;
import com.yeshi.fanli.entity.bus.user.ThreeSale;
import com.yeshi.fanli.entity.bus.user.UserAccountBindingHistory;
import com.yeshi.fanli.entity.bus.user.UserConnectHistory;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.WeiXinUser;
@@ -38,6 +39,7 @@
import com.yeshi.fanli.service.inter.user.BindingAccountService;
import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
import com.yeshi.fanli.service.inter.user.UserAccountBindingHistoryService;
import com.yeshi.fanli.service.inter.user.UserAccountService;
import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
@@ -86,6 +88,9 @@
    
    @Resource
    private UserInfoExtraService userInfoExtraService;
    @Resource
    private UserAccountBindingHistoryService userAccountBindingHistoryService;
    @Transactional
    @Override
@@ -899,12 +904,10 @@
        return user.getPortrait();
    }
    @Transactional
    @Override
    public UserInfo loginPhone(HttpServletRequest request,int loginType, String vcode, String phone,
            String appId) throws UserAccountException {
    public UserInfo loginPhone(HttpServletRequest request, int loginType, String vcode, String phone, String appId)
            throws UserAccountException {
        // 空额清理
        if (phone == null || phone.trim().length() == 0) {
@@ -913,7 +916,8 @@
        phone = phone.replaceAll(" ", "");
                
//        // 苹果应用商店上线测试号码
//        if ("17316780233".equalsIgnoreCase(phone) && "258168".equalsIgnoreCase(vcode)) {
        // if ("17316780233".equalsIgnoreCase(phone) &&
        // "258168".equalsIgnoreCase(vcode)) {
//            ;
//        } else {
//
@@ -921,9 +925,11 @@
//                throw new UserAccountException(1, "请输入验证码");
//            }
//
//            String oldVcode = redisManager.getSMSVCode(phone, SMSHistory.TYPE_LOGIN);
        // String oldVcode = redisManager.getSMSVCode(phone,
        // SMSHistory.TYPE_LOGIN);
//            LogHelper.test("----------------------登录验证码: " + oldVcode);
//            if (StringUtil.isNullOrEmpty(oldVcode) || !oldVcode.equalsIgnoreCase(vcode)) {
        // if (StringUtil.isNullOrEmpty(oldVcode) ||
        // !oldVcode.equalsIgnoreCase(vcode)) {
//                throw new UserAccountException(1, "验证码错误,重新输入");
//            }
//        }
@@ -958,7 +964,6 @@
            // 创建用户
            addUser(userInfo);
            
            try {
                // 第一次登录时创建用户额外信息
                userInfoExtraService.createUserInfoExtra(userInfo.getId());
@@ -972,7 +977,8 @@
    
    @Transactional
    @Override
    public UserInfo loginWinXin(HttpServletRequest request,int loginType, String code, String appId) throws UserAccountException {
    public UserInfo loginWinXin(HttpServletRequest request, int loginType, String code, String appId)
            throws UserAccountException {
        // 日志信息
        JSONObject logInfo = new JSONObject();
        logInfo.put("appId", appId);
@@ -1027,6 +1033,7 @@
    
    /**
     * 更新账户登录信息
     *
     * @param userInfo
     * @param loginType
     * @param request
@@ -1039,7 +1046,6 @@
        updateUserInfo.setLastLoginIp(request.getRemoteHost());
        userInfoMapper.updateByPrimaryKeySelective(updateUserInfo);
    }
    
    @Override
    public void bindPhoneNew(Long uid, String phone) throws UserAccountException {
@@ -1062,11 +1068,22 @@
        UserInfo update = new UserInfo(user.getId());
        update.setPhone(phone);
        userInfoMapper.updateByPrimaryKeySelective(update);
        // 加入绑定记录
        UserAccountBindingHistory history = new UserAccountBindingHistory();
        history.setContent(phone);
        history.setType(UserAccountBindingHistory.TYPE_PHONE);
        history.setUid(uid);
        // 之前已经绑定电话号码
        if (!StringUtil.isNullOrEmpty(user.getPhone()))
            history.setFirst(false);
        else
            history.setFirst(true);
        userAccountBindingHistoryService.addUserAccountBindingHistory(history);
        
        // 发送消息
        userAccountMsgNotificationService.bindingSuccess(uid, MsgAccountDetailFactory.TYPE_PHONE);
    }
    
    @Override
    public void bindWeiXin(Long uid, String code) throws UserAccountException {
@@ -1094,7 +1111,6 @@
            throw new UserAccountException(5, "该帐号没有绑定手机号码,需绑定手机号码才能完成微信更换");
        }
        
        UserInfo updateUserInfo = new UserInfo(uid);
        updateUserInfo.setWxName(weiXinUser.getNickname());
        updateUserInfo.setWxOpenId(weiXinUser.getOpenid());
@@ -1111,6 +1127,19 @@
        }
        userInfoMapper.updateByPrimaryKeySelective(updateUserInfo);
        // 加入绑定记录
        UserAccountBindingHistory history = new UserAccountBindingHistory();
        history.setContent(weiXinUser.getUnionid());
        history.setType(UserAccountBindingHistory.TYPE_WX);
        history.setUid(uid);
        // 之前已经绑定电话号码
        if (!StringUtil.isNullOrEmpty(user.getWxUnionId()))
            history.setFirst(false);
        else
            history.setFirst(true);
        userAccountBindingHistoryService.addUserAccountBindingHistory(history);
        userAccountMsgNotificationService.bindingSuccess(uid, MsgAccountDetailFactory.TYPE_WX);
    }
    
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserExtraTaoBaoInfoServiceImpl.java
@@ -11,10 +11,12 @@
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.UserAccountBindingHistory;
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.UserAccountBindingHistoryService;
import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
@@ -28,11 +30,13 @@
    @Resource
    private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService;
    
    @Resource
    private UserAccountBindingHistoryService userAccountBindingHistoryService;
    @Transactional
    @Override
    public void addRelationId(Long uid, String relationId, String taoBaoUid,String nickName,
            boolean valid) throws UserExtraTaoBaoInfoException{
    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, "传递参数为空");
@@ -73,8 +77,8 @@
    @Transactional
    @Override
    public void addSpecialId(Long uid, String specialId, String taoBaoUid, String nickName,
            boolean valid) throws UserExtraTaoBaoInfoException{
    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, "传递参数为空");
@@ -115,8 +119,8 @@
    @Transactional
    @Override
    public void saveUserTaoBaoInfo(Long uid, String relationId, String specialId, String taoBaoUid,
            String nickName, boolean valid) throws UserExtraTaoBaoInfoException {
    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)) {
@@ -142,6 +146,10 @@
        taoBaoInfo.setSpecialUpdateTime(new Date());
        List<UserExtraTaoBaoInfo> list = userExtraTaoBaoInfoMapper.listByTaoBaoUid(taoBaoUid);
        // 判断之前用户是否绑定过
        UserExtraTaoBaoInfo info = userExtraTaoBaoInfoMapper.selectByUid(uid);
        if (list == null || list.size() == 0) {
            //新增
            taoBaoInfo.setCreateTime(new Date());
@@ -159,17 +167,31 @@
                }
            }
        }
        // 加入绑定记录
        UserAccountBindingHistory history = new UserAccountBindingHistory();
        history.setContent(taoBaoUid);
        history.setType(UserAccountBindingHistory.TYPE_TB);
        history.setUid(uid);
        // 之前已经绑定电话号码
        if (info!=null)
            history.setFirst(false);
        else
            history.setFirst(true);
        userAccountBindingHistoryService.addUserAccountBindingHistory(history);
    }
    /**
     * 验证taoBaoUid  是否被封
     *
     * @param taoBaoUid
     * @return
     */
    public boolean validateTaoBaoUidForbidden(String taoBaoUid) {
        boolean validate = false;
        ForbiddenUserIdentifyCode identifyCode = forbiddenUserIdentifyCodeService.listByTypeAndIdentifyCode(
                ForbiddenUserIdentifyCodeTypeEnum.taobaoUid, taoBaoUid);
        ForbiddenUserIdentifyCode identifyCode = forbiddenUserIdentifyCodeService
                .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.taobaoUid, taoBaoUid);
        // 账号被封
        if (identifyCode != null && identifyCode.getEffective() != null && identifyCode.getEffective()) {
            validate = true;
@@ -179,6 +201,7 @@
    
    /**
     * 清空多余绑定淘宝账号信息
     *
     * @param otherInfo
     */
    public void clearTaoBaoInfo(UserExtraTaoBaoInfo otherInfo ) {
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserAccountBindingHistoryService.java
New file
@@ -0,0 +1,23 @@
package com.yeshi.fanli.service.inter.user;
import com.yeshi.fanli.entity.bus.user.UserAccountBindingHistory;
public interface UserAccountBindingHistoryService {
    /**
     * 添加绑定
     *
     * @param history
     */
    public void addUserAccountBindingHistory(UserAccountBindingHistory history);
    /**
     * 获取最近一次的绑定记录
     *
     * @param uid
     * @param type
     * @return
     */
    public UserAccountBindingHistory getLatestHistory(Long uid, int type);
}