| | |
| | | import com.supersavedriving.user.modular.system.util.MallBook.model.QueryOrder; |
| | | import com.supersavedriving.user.modular.system.util.MallBook.util.Transfer; |
| | | import com.supersavedriving.user.modular.system.util.MallBook.util.TrhRequest; |
| | | import com.supersavedriving.user.modular.system.util.qianyuntong.AESUtils; |
| | | import com.supersavedriving.user.modular.system.util.qianyuntong.UserUtil; |
| | | import com.supersavedriving.user.modular.system.util.qianyuntong.model.QYTUserInfo; |
| | | import com.supersavedriving.user.modular.system.util.qianyuntong.model.RegisterViaMobile; |
| | | import com.supersavedriving.user.modular.system.util.qianyuntong.model.RegisterViaMobileRequest; |
| | | import com.supersavedriving.user.modular.system.util.weChat.WXCore; |
| | | import com.supersavedriving.user.modular.system.util.weChat.WeChatUtil; |
| | | import com.supersavedriving.user.modular.system.util.weChat.model.Code2Session; |
| | |
| | | } |
| | | String openid = code2Session.getOpenid(); |
| | | AppUser appUser = this.selectOne(new EntityWrapper<AppUser>().eq("phone", phone).ne("status", 3)); |
| | | |
| | | String nickName = null; |
| | | if (null == appUser) { |
| | | nickName = this.getDefaultName(); |
| | | } else { |
| | | nickName = appUser.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 ResultUtil.error(register.getDesc()); |
| | | } |
| | | onconUUID = register.getOnconUUID(); |
| | | } else { |
| | | boolean b = AppUserUtil.checkCaptcha(phone, code); |
| | | if (!b) { |
| | | return ResultUtil.error("验证码无效"); |
| | | } |
| | | } |
| | | |
| | | |
| | | if(null == appUser){ |
| | | appUser = new AppUser(); |
| | | appUser.setNickname("亲爱的用户"); |
| | |
| | | appUser.setInviterId(verificationCodeLogin.getInviterId()); |
| | | appUser.setInviterType(verificationCodeLogin.getInviterType()); |
| | | } |
| | | if(null != onconUUID){ |
| | | appUser.setOnconUUID(onconUUID); |
| | | } |
| | | //同步用户数据到打车系统 |
| | | String s = AppUserUtil.addUser(phone, code, verificationCodeLogin.getAreaCode()); |
| | | String s = AppUserUtil.addUser(phone, code, verificationCodeLogin.getAreaCode(), onconUUID); |
| | | if(ToolUtil.isEmpty(s)){ |
| | | return ResultUtil.error("登录失败"); |
| | | } |
| | |
| | | public List<CouponsWarpper> queryMyCoupons(Integer uid, Integer state, Integer pageNum, Integer pageSize) throws Exception { |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取默认名称 |
| | | * @return |
| | | */ |
| | | public String getDefaultName(){ |
| | | int num = this.selectCount(new EntityWrapper<AppUser>().ne("status", 3)) + 1000001; |
| | | return "GRJY-DJ" + String.valueOf(num).substring(1); |
| | | } |
| | | } |