guyue
3 天以前 72e086578b8c5d9dccdb51f8840f72f38addc744
UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserInfoServiceImpl.java
@@ -27,6 +27,7 @@
import com.stylefeng.guns.modular.taxi.model.PaymentRecord;
import com.stylefeng.guns.modular.taxi.service.IPaymentRecordService;
import com.stylefeng.guns.modular.taxi.service.ITransactionDetailsService;
import org.apache.commons.lang.time.DateUtils;
import org.apache.shiro.authc.SimpleAuthenticationInfo;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.authc.credential.HashedCredentialsMatcher;
@@ -50,6 +51,7 @@
import java.net.URLConnection;
import java.security.spec.AlgorithmParameterSpec;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Lock;
@@ -124,6 +126,9 @@
    @Autowired
    private PayMoneyUtil payMoneyUtil;
    @Value("${callbackPath}")
    private String callbackPath;
@@ -230,25 +235,25 @@
            nickName = userInfo.getNickName();
        }
        //调中台接口查询用户
        List<QYTUserInfo> infoByPhone = UserUtil.getUserInfoByPhone(phone);
        if (null == infoByPhone || infoByPhone.isEmpty()) {
            RegisterViaMobileRequest request = new RegisterViaMobileRequest();
            request.setMobile(phone);
            request.setEncryptType("aesbase64");
            request.setPassword(AESUtils.encryptBase64("123456"));
            request.setNickname(nickName);
            request.setVerify_code(code);
            request.setVerify_code_type("0");
            RegisterViaMobile register = UserUtil.registerViaMobile(request);
            if (!"0".equals(register.getStatus())) {
                return ResultUtil.error(register.getDesc());
            }
        } else {
            boolean b = this.checkCaptcha(phone, code);
            if (!b) {
                return ResultUtil.error("验证码无效");
            }
        }
//        List<QYTUserInfo> infoByPhone = UserUtil.getUserInfoByPhone(phone);
//        if (null == infoByPhone || infoByPhone.isEmpty()) {
//            RegisterViaMobileRequest request = new RegisterViaMobileRequest();
//            request.setMobile(phone);
//            request.setEncryptType("aesbase64");
//            request.setPassword(AESUtils.encryptBase64("123456"));
//            request.setNickname(nickName);
//            request.setVerify_code(code);
//            request.setVerify_code_type("0");
//            RegisterViaMobile register = UserUtil.registerViaMobile(request);
//            if (!"0".equals(register.getStatus())) {
//                return ResultUtil.error(register.getDesc());
//            }
//        } else {
//            boolean b = this.checkCaptcha(phone, code);
//            if (!b) {
//                return ResultUtil.error("验证码无效");
//            }
//        }
    
        if (null == userInfo) {
            userInfo = new UserInfo();
@@ -269,6 +274,9 @@
            }else {
                userInfo.setCompanyId(1);
            }
            this.insert(userInfo);
            this.addCoupon(userInfo);//添加优惠券
@@ -468,10 +476,10 @@
    @Override
    public ResultUtil<LoginWarpper> userLogin(String phone, String password,String loginType) throws Exception {
        //调中台接口查询用户
        List<QYTUserInfo> infoByPhone = UserUtil.getUserInfoByPhone(phone);
        if (null == infoByPhone || infoByPhone.isEmpty()) {
            return ResultUtil.error("账号无效");
        }
//        List<QYTUserInfo> infoByPhone = UserUtil.getUserInfoByPhone(phone);
//        if (null == infoByPhone || infoByPhone.isEmpty()) {
//            return ResultUtil.error("账号无效");
//        }
    
        UserInfo userInfo = this.queryByPhone(phone);
        if (null == userInfo) {
@@ -491,6 +499,7 @@
        LoginWarpper loginWarpper = new LoginWarpper();
        loginWarpper.setId(userInfo.getId());
        loginWarpper.setToken(token);
        loginWarpper.setExpirationTime(15552000L);
        loginWarpper.setAppid(UUIDUtil.getRandomCode());
        loginWarpper.setEmergencyContact(userInfo.getEmergencyContact());
        loginWarpper.setEmergencyContactNumber(userInfo.getEmergencyContactNumber());