| | |
| | | |
| | | if(ToolUtil.isEmpty(img)) { |
| | | RestTemplate rest = new RestTemplate(); |
| | | String url = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=" + accessToken; |
| | | // String url = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=" + accessToken; |
| | | String url = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + accessToken; |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("path", "pages/home/home?driverId=" + uid); |
| | | param.put("page", "pages/home/home"); |
| | | param.put("width", 430); //二维码尺寸 |
| | | param.put("scene", "driverId=" + uid); //二维码尺寸 |
| | | param.put("env_version", "trial"); //二维码尺寸 |
| | | HttpRequest post = HttpUtil.createPost(url); |
| | | post.body(JSON.toJSONString(param)); |
| | | |
| | |
| | | if(companyCities.isEmpty()){ |
| | | return ResultUtil.success(companyVos); |
| | | } |
| | | Wrapper<Company> in = new EntityWrapper<Company>().ne("type", 1).ne("flag", 3).in("id", companyCities.stream().map(CompanyCity::getCompanyId).collect(Collectors.toList())); |
| | | Wrapper<Company> in = new EntityWrapper<Company>().eq("type", 2).ne("flag", 3).in("id", companyCities.stream().map(CompanyCity::getCompanyId).collect(Collectors.toList())); |
| | | |
| | | if(ToolUtil.isNotEmpty( name)){ |
| | | in.like("name", name); |
| | |
| | | driver.setAuthState(3); |
| | | driverService.updateById(driver); |
| | | //开始验证当前账号是否在别处登录 |
| | | String value = (String) redisTemplate.opsForValue().get("DRIVER_" + driverId); |
| | | String value = (String) redisTemplate.opsForValue().get("dache:DRIVER_" + driverId); |
| | | if (ToolUtil.isNotEmpty(value)) {//将另外设备上的强迫下线 |
| | | //开始清除redis中无效的数据 |
| | | String key = (String) redisTemplate.opsForValue().get("DRIVER_" + driver.getPhone()); |
| | | String key = (String) redisTemplate.opsForValue().get("dache:DRIVER_" + driver.getPhone()); |
| | | redisTemplate.delete(key);//删除个人信息数据 |
| | | redisTemplate.delete("DRIVER_" + driver.getPhone());//删除后台冻结相关缓存 |
| | | redisTemplate.delete("DRIVER_" + driverId);//清除存储的token |
| | | redisTemplate.delete("dache:DRIVER_" + driver.getPhone());//删除后台冻结相关缓存 |
| | | redisTemplate.delete("dache:DRIVER_" + driverId);//清除存储的token |
| | | } |
| | | return ResultUtil.success(); |
| | | } catch (Exception e) { |
| | |
| | | @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, HttpServletRequest request){ |
| | | public ResultUtil<String> getZLToken(String ip, String mac, String type, HttpServletRequest request){ |
| | | try { |
| | | Integer driverId = driverService.getUserIdFormRedis(request); |
| | | if (null == driverId) { |
| | |
| | | tradeTerminalInfo.setTerminal("1"); |
| | | tradeTerminalInfo.setMac(mac); |
| | | tokenRequest.setTradeTerminalInfo(tradeTerminalInfo); |
| | | tokenRequest.setType(type); |
| | | String token = TokenUtil.getToken(tokenRequest); |
| | | return ResultUtil.success(token); |
| | | }catch (Exception e){ |