admin
2020-09-24 ca1ad791b7b7b04e57db6bd4fb93f0c1066a9f99
fanli/src/main/java/com/yeshi/fanli/service/impl/money/extract/BindingAccountServiceImpl.java
@@ -7,6 +7,7 @@
import javax.annotation.Resource;
import com.yeshi.fanli.entity.SystemEnum;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -121,13 +122,22 @@
         throw new AlipayAccountException(AlipayAccountException.CODE_NO_PARAMS, "账号不能为空");
      if (StringUtil.isNullOrEmpty(name))
         throw new AlipayAccountException(AlipayAccountException.CODE_NO_PARAMS, "真实姓名不能为空");
      //
      List<BindingAccount> bindingAccountList = bindingAccountMapper.selectByAccount(account);
      if (bindingAccountList != null && bindingAccountList.size() > 0) {
         if (bindingAccountList.get(0).getUserInfo().getId().longValue() != uid)
            UserInfo user = userInfoMapper.selectByPrimaryKey(uid);
            SystemEnum systemEnum = user.getSystem();
            for (int i = 0; i < bindingAccountList.size(); i++) {
                UserInfo u = userInfoMapper.selectByPrimaryKey(bindingAccountList.get(i).getUserInfo().getId());
                //同一系统下绑定账号不能重复
                if (u.getSystem() == systemEnum && bindingAccountList.get(i).getUserInfo().getId().longValue() != uid) {
            throw new AlipayAccountException(AlipayAccountException.CODE_ALREADY_BIND,
                  "该支付宝账号已被其他账号绑定,请更换其他的支付宝账号来绑定");
      }
            }
        }
      AlipayAccountValidNormalHistory latest = alipayAccountValidNormalHistoryMapper.selectLatestByUid(uid);
      if (latest != null) {