| | |
| | | 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; |
| | |
| | | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | |
| | | |
| | | |
| | | @Value("${callbackPath}") |
| | | private String callbackPath; |
| | |
| | | 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(); |
| | |
| | | }else { |
| | | userInfo.setCompanyId(1); |
| | | } |
| | | |
| | | |
| | | |
| | | this.insert(userInfo); |
| | | |
| | | this.addCoupon(userInfo);//添加优惠券 |
| | |
| | | @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) { |
| | |
| | | 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()); |