| | |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | |
| | | @Autowired |
| | | private TDriverPromotionActivityService driverPromotionActivityService; |
| | | |
| | | |
| | | @Value("${callbackPath}") |
| | | private String callbackPath; |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public synchronized ResultUtil<LoginWarpper> captchaLogin(String phone, String code, String registIp, String registAreaCode,String loginType,Integer driverId) throws Exception { |
| | | public synchronized ResultUtil<LoginWarpper> captchaLogin(String phone, String code, String registIp, String registAreaCode,String loginType) throws Exception { |
| | | UserInfo userInfo = userInfoMapper.queryByPhone(phone); |
| | | String nickName = null; |
| | | if (null == userInfo) { |
| | |
| | | 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); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // 是否需要绑定司机 |
| | | TDriverPromotionActivity tDriverPromotionActivity = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("districtCode", registAreaCode).ge("startTime", new Date()).lt("endTime", new Date()).last(" limit 1")); |
| | | if(tDriverPromotionActivity!=null){ |
| | | Integer bindingDays = tDriverPromotionActivity.getBindingDays(); |
| | | // 当前时间+绑定天数 |
| | | Date endTime = DateUtils.addDays(new Date(), bindingDays); |
| | | userInfo.setBindDriverId(driverId); |
| | | userInfo.setBindExpireDate(endTime); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | @Override |
| | | public synchronized ResultUtil<LoginWarpper> captchaLogin(String phone, String code, Integer uid, Integer type, Integer userType,String loginType) throws Exception { |
| | | ResultUtil<LoginWarpper> resultUtil = this.captchaLogin(phone, code, null, null,loginType,null); |
| | | ResultUtil<LoginWarpper> resultUtil = this.captchaLogin(phone, code, null, null,loginType); |
| | | if(resultUtil.getCode() == 200 && null != uid){ |
| | | if(type == 2){//司机分享 |
| | | Driver driver = driverMapper.selectById(uid); |
| | |
| | | @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) { |
| | |
| | | if(null == userInfo){ |
| | | return ResultUtil.error("获取用户信息失败"); |
| | | } |
| | | return this.captchaLogin(userInfo.get("phone"), "1234", null, registAreaCode, loginType,null); |
| | | return this.captchaLogin(userInfo.get("phone"), "1234", null, registAreaCode, loginType); |
| | | }else{ |
| | | return ResultUtil.error(jsonObject.getString("msg")); |
| | | } |