| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | } |
| | | //调中台接口查询用户 |
| | | List<QYTUserInfo> infoByPhone = UserUtil.getUserInfoByPhone(phone); |
| | | String onconUUID = null; |
| | | if (null == infoByPhone || infoByPhone.isEmpty()) { |
| | | RegisterViaMobileRequest request = new RegisterViaMobileRequest(); |
| | | request.setMobile(phone); |
| | |
| | | if (!"0".equals(register.getStatus())) { |
| | | return ResultUtil.error(register.getDesc()); |
| | | } |
| | | onconUUID = register.getOnconUUID(); |
| | | } else { |
| | | boolean b = this.checkCaptcha(phone, code); |
| | | if (!b) { |
| | |
| | | |
| | | if (null == userInfo) { |
| | | userInfo = new UserInfo(); |
| | | userInfo.setAvatar("https://traffic.qytzt.cn/v1/AUTH_d8bef0a04db511f0b79d01a3e2b7587e/qyt20250702/imgs/management/d081e7a9-13d4-4eec-afb6-afd10885a664.png"); |
| | | userInfo.setPhone(phone); |
| | | userInfo.setPassWord(ShiroKit.md5("", salt)); |
| | | userInfo.setNickName(nickName); |
| | |
| | | userInfo.setConsumption(0D); |
| | | userInfo.setBalance(0D); |
| | | userInfo.setState(1); |
| | | if(null != onconUUID){ |
| | | userInfo.setOnconUUID(onconUUID); |
| | | } |
| | | |
| | | //用户所属企业 |
| | | if(null != registAreaCode){ |
| | |
| | | UserInfo userInfo = userInfoMapper.queryByPhone(phone); |
| | | if (null == userInfo) { |
| | | userInfo = new UserInfo(); |
| | | userInfo.setAvatar("https://traffic.qytzt.cn/v1/AUTH_d8bef0a04db511f0b79d01a3e2b7587e/qyt20250702/imgs/management/d081e7a9-13d4-4eec-afb6-afd10885a664.png"); |
| | | userInfo.setPhone(phone); |
| | | userInfo.setPassWord(ShiroKit.md5("", salt)); |
| | | userInfo.setNickName(this.getDefaultName()); |
| | |
| | | } |
| | | if (null == userInfo) { |
| | | userInfo = new UserInfo(); |
| | | userInfo.setAvatar("https://traffic.qytzt.cn/v1/AUTH_d8bef0a04db511f0b79d01a3e2b7587e/qyt20250702/imgs/management/d081e7a9-13d4-4eec-afb6-afd10885a664.png"); |
| | | userInfo.setPassWord(ShiroKit.md5("", salt)); |
| | | userInfo.setRegistIp(registIp); |
| | | userInfo.setSex(sex); |
| | |
| | | int i =0; |
| | | if(null == userInfo){ |
| | | userInfo = new UserInfo(); |
| | | userInfo.setAvatar("https://traffic.qytzt.cn/v1/AUTH_d8bef0a04db511f0b79d01a3e2b7587e/qyt20250702/imgs/management/d081e7a9-13d4-4eec-afb6-afd10885a664.png"); |
| | | if(ToolUtil.isEmpty(phone)){ |
| | | String phone2 = getPhone(sessionKey, encryptedData, iv); |
| | | List<UserInfo> phone1 = userInfoMapper.selectList(new EntityWrapper<UserInfo>().eq("phone", phone2).eq("state",1).ne("flag",3)); |
| | |
| | | nickName = userInfo.getNickName(); |
| | | } |
| | | //调中台接口查询用户 |
| | | List<QYTUserInfo> infoByPhone = UserUtil.getUserInfoByPhone(phone); |
| | | String onconUUID = null; |
| | | List<QYTUserInfo> infoByPhone = UserUtil.getUserInfoByPhone(phone); |
| | | if (null == infoByPhone || infoByPhone.isEmpty()) { |
| | | RegisterViaMobileRequest request = new RegisterViaMobileRequest(); |
| | | request.setMobile(phone); |
| | |
| | | if (!"0".equals(register.getStatus())) { |
| | | return ResultUtil.error(register.getDesc()); |
| | | } |
| | | onconUUID = register.getOnconUUID(); |
| | | } else { |
| | | boolean b = this.checkCaptcha(phone, code); |
| | | if (!b) { |
| | |
| | | userInfo1.setAvatar(userInfo.getAvatar()); |
| | | userInfo1.setSex(userInfo.getSex()); |
| | | userInfo1.setNickName(userInfo.getNickName()); |
| | | userInfo1.setOnconUUID(onconUUID); |
| | | this.updateById(userInfo1); |
| | | |
| | | if (ToolUtil.isNotEmpty(loginType) && loginType.equals("Applets")) {//小程序登录后绑定手机号码 |
| | |
| | | loginWarpper.setPhone(2); |
| | | return ResultUtil.success(loginWarpper); |
| | | } |
| | | |
| | | userInfo.setOnconUUID(onconUUID); |
| | | userInfo.setPhone(phone); |
| | | userInfo.setUpdateTime(new Date()); |
| | | userInfo.setUpdateUser(userInfo.getId()); |
| | |
| | | } |
| | | return ResultUtil.success(loginWarpper); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String addAppUser(String phone, String code, String areaCode) throws Exception { |
| | | UserInfo userInfo = userInfoMapper.queryByPhone(phone); |
| | | String nickName = null; |
| | | if (null == userInfo) { |
| | | nickName = this.getDefaultName(); |
| | | } else { |
| | | nickName = userInfo.getNickName(); |
| | | } |
| | | //调中台接口查询用户 |
| | | List<QYTUserInfo> infoByPhone = UserUtil.getUserInfoByPhone(phone); |
| | | String onconUUID = null; |
| | | 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 null; |
| | | } |
| | | onconUUID = register.getOnconUUID(); |
| | | } |
| | | |
| | | if (null == userInfo) { |
| | | userInfo = new UserInfo(); |
| | | userInfo.setAvatar("https://traffic.qytzt.cn/v1/AUTH_d8bef0a04db511f0b79d01a3e2b7587e/qyt20250702/imgs/management/d081e7a9-13d4-4eec-afb6-afd10885a664.png"); |
| | | userInfo.setPhone(phone); |
| | | userInfo.setPassWord(ShiroKit.md5("", salt)); |
| | | userInfo.setNickName(nickName); |
| | | userInfo.setIsAuth(1); |
| | | userInfo.setConsumption(0D); |
| | | userInfo.setBalance(0D); |
| | | userInfo.setState(1); |
| | | if(null != onconUUID){ |
| | | userInfo.setOnconUUID(onconUUID); |
| | | } |
| | | |
| | | //用户所属企业 |
| | | if(null != areaCode){ |
| | | Company query = companyCityService.query(areaCode); |
| | | userInfo.setCompanyId(null != query ? query.getId() : 1); |
| | | userInfo.setRegistAreaCode(areaCode); |
| | | }else { |
| | | userInfo.setCompanyId(1); |
| | | } |
| | | |
| | | this.insert(userInfo); |
| | | } |
| | | return userInfo.getId().toString(); |
| | | } |
| | | } |