| | |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.account.server.UserWithdrawalService; |
| | | import com.stylefeng.guns.modular.account.util.OssUploadUtil; |
| | | import com.stylefeng.guns.modular.shunfeng.model.DriverRide; |
| | | import com.stylefeng.guns.modular.shunfeng.service.IDriverRideService; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.util.WeChatUtil; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.EmployeeUtil; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.UserUtil; |
| | | import com.stylefeng.guns.modular.system.util.zhenglian.TokenUtil; |
| | | import com.stylefeng.guns.modular.system.util.zhenglian.ZhengLianUtil; |
| | | import com.stylefeng.guns.modular.system.util.zhenglian.model.TokenRequest; |
| | | import com.stylefeng.guns.modular.system.util.zhenglian.model.TradeTerminalInfo; |
| | | import com.stylefeng.guns.modular.system.util.zhenglian.model.ZLUserInfo; |
| | | import com.stylefeng.guns.modular.system.warpper.LoginWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.UserInfoWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.VerifiedWarpper; |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.InputStream; |
| | | import java.net.InetAddress; |
| | | import java.net.NetworkInterface; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | |
| | | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | | /*顺风车司机*/ |
| | | @Autowired |
| | | private IDriverRideService driverRideService; |
| | | |
| | | @Autowired |
| | | private IVerifiedService verifiedService; |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/user/oneClickLogin") |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/user/wxLogin") |
| | | @ApiOperation(value = "微信授权登录", tags = {"用户端-登录"}, notes = "") |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/user/wxLoginIsBind") |
| | | @ApiOperation(value = "微信授权登录--查看是否绑定手机号", tags = {"用户端-登录"}, notes = "") |
| | |
| | | userInfo.setOnconUUID(onconUUIDByMobile); |
| | | userInfoService.updateById(userInfo); |
| | | } |
| | | |
| | | Map<String, Object> map = userInfoService.queryUserInfo(uid); |
| | | UserWithdrawal userWithdrawal1 = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>() |
| | | .eq("phone", map.get("phone")) |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/base/user/getDriverCode") |
| | | @ApiOperation(value = "获取司机端的二维码", tags = {"获取司机端的二维码"}, notes = "") |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/user/addAppUser") |
| | | public String addAppUser(String phone, String code, String areaCode){ |
| | | public String addAppUser(String phone, String code, String areaCode, String onconUUID){ |
| | | try { |
| | | return userInfoService.addAppUser(phone, code, areaCode); |
| | | return userInfoService.addAppUser(phone, code, areaCode, onconUUID); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/getZLToken") |
| | | @ApiOperation(value = "获取证联token(黔云通)", tags = {"司机端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "当前设备IP地址", name = "ip", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "当前设备mac地址", name = "mac", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "01 证联收银台支付\n" + |
| | | "\t 04 HOME 页\n" + |
| | | "\t 06 申请免密签约\n" + |
| | | "\t 07 商户收银台支付\n" + |
| | | "\t 08 开户(绑卡)\n" + |
| | | "\t 09 开通支付账户\n" + |
| | | "\t 10 打开付款码", name = "type", required = true, dataType = "String"), |
| | | }) |
| | | public ResultUtil<String> getZLToken(String ip, String mac, String type, HttpServletRequest request){ |
| | | try { |
| | | Integer userId = userInfoService.getUserIdFormRedis(request); |
| | | if (null == userId) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | UserInfo userInfo = userInfoService.selectById(userId); |
| | | if(null == userInfo.getDriverId()){ |
| | | return ResultUtil.error("请先开通顺风车司机"); |
| | | } |
| | | if(null == userInfo.getIdCard()){ |
| | | return ResultUtil.error("请先完成实名认证"); |
| | | } |
| | | DriverRide driverRide = driverRideService.selectById(userInfo.getDriverId()); |
| | | TokenRequest tokenRequest = new TokenRequest(); |
| | | tokenRequest.setAppUserId(driverRide.getEmpId().toString()); |
| | | tokenRequest.setUserName(userInfo.getName()); |
| | | tokenRequest.setCertNo(userInfo.getIdCard()); |
| | | tokenRequest.setPhone(userInfo.getPhone()); |
| | | TradeTerminalInfo tradeTerminalInfo = new TradeTerminalInfo(); |
| | | tradeTerminalInfo.setIp(ip); |
| | | tradeTerminalInfo.setTerminal("1"); |
| | | tradeTerminalInfo.setMac(mac); |
| | | tokenRequest.setTradeTerminalInfo(tradeTerminalInfo); |
| | | tokenRequest.setType(type); |
| | | String token = TokenUtil.getToken(tokenRequest); |
| | | return ResultUtil.success(token); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | } |