| | |
| | | |
| | | private String salt = "SA;d5#"; |
| | | |
| | | @Autowired |
| | | private SMSUtil smsUtil; |
| | | |
| | | |
| | | @Override |
| | | public Integer getAppOpenInfo(Integer type) { |
| | |
| | | */ |
| | | @Override |
| | | public ResultUtil queryCaptcha(String phone, Integer type, Integer language) throws Exception { |
| | | if(type == 3){ |
| | | Driver driver1 = driverMapper.queryByPhone(phone); |
| | | if(null != driver1){ |
| | | if(driver1.getAuthState() == 1){ |
| | | return ResultUtil.error(language == 1 ? "该司机正在审核中" : language == 2 ? "The driver is currently under review" : "The driver is currently under review"); |
| | | } |
| | | if(driver1.getAuthState() == 2){ |
| | | return ResultUtil.error(language == 1 ? "该司机已存在" : language == 2 ? "The driver already exists" : "Les Driver already exists"); |
| | | } |
| | | if(driver1.getAuthState() == 3){ |
| | | return ResultUtil.error(language == 1 ? "该司机账号已被冻结" : language == 2 ? "The driver's account has been frozen" : "Le compte du conducteur a été froid"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | Random random = new Random(); |
| | | StringBuffer sb = new StringBuffer(); |
| | | for(int i = 0; i < 4; i++){ |
| | | sb.append((int) (random.nextDouble() * 10)); |
| | | } |
| | | String authCode = sb.toString(); |
| | | String sms = "短信验证码【" + authCode + "】已发到您的手机,验证码将在5分钟后失效."; |
| | | String sms = ""; |
| | | |
| | | //发送验证码短信 |
| | | redisUtil.setStrValue(phone, authCode, 5 * 60);//设置五分钟过期 |
| | | String templateId = ""; |
| | | switch (language){ |
| | | case 1: |
| | | templateId = "b793ae3d41a049059197bfe92cf8bc83"; |
| | | sms = "您的验证码为:" + authCode + ",该验证码5分钟内有效,请勿泄漏于他人!"; |
| | | break; |
| | | case 2: |
| | | templateId = "058c7d11ce594d668841cceb49fb5c9a"; |
| | | sms = "Your verification code is: " + authCode + ", the verification code is valid within 5 minutes, do not leak to others!"; |
| | | break; |
| | | case 3: |
| | | templateId = "4edbe604da6546808ffda582085b3c83"; |
| | | sms = "Votre code de vérification est: " + authCode + ". Ce code est valide pendant 5 minutes. Ne le divulguez pas aux autres!"; |
| | | break; |
| | | } |
| | | SMSUtil.send_huawei_sms(templateId, "+" + phone, "[\"" + authCode + "\"]"); |
| | | smsUtil.sendCellulantMessage(phone, sms); |
| | | System.out.println(sms); |
| | | return ResultUtil.success(); |
| | | } |
| | |
| | | //发送验证码短信 |
| | | redisUtil.setStrValue(email, authCode, 5 * 60);//设置五分钟过期 |
| | | |
| | | String path = templatePath + "index.html"; |
| | | String path = templatePath + "driver/index.html"; |
| | | Document document = Jsoup.parse(new File(path), "UTF-8"); |
| | | if(1 == language){ |
| | | document.getElementById("english").remove(); |
| | |
| | | driverMapper.updateById(driver); |
| | | |
| | | if(ToolUtil.isNotEmpty(driver.getEmail())){ |
| | | String path = templatePath + "index.html"; |
| | | String path = templatePath + "driver/index.html"; |
| | | Document document = Jsoup.parse(new File(path), "UTF-8"); |
| | | if(1 == language){ |
| | | document.getElementById("english").remove(); |
| | |
| | | return ResultUtil.success(loginWarpper); |
| | | } |
| | | |
| | | |
| | | driver1 = driverMapper.queryByPhone(phone); |
| | | if(null != driver1){ |
| | | LoginWarpper loginWarpper = new LoginWarpper(); |
| | |
| | | Driver driver = this.selectById(uid); |
| | | driver.setLastName(registeredWarpper.getLastName()); |
| | | driver.setFirstName(registeredWarpper.getFirstName()); |
| | | driver.setSex(registeredWarpper.getSex()); |
| | | // driver.setSex(registeredWarpper.getSex()); |
| | | driver.setIdCard(registeredWarpper.getIdCard()); |
| | | driver.setBirthday(registeredWarpper.getBirthday()); |
| | | |
| | |
| | | driver.setPlaceOfPractice(language == 1 ? city1.getChineseName() : language == 2 ? city1.getEnglishName() : city1.getFrenchName()); |
| | | |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(registeredWarpper.getGetDriverLicenseDate()); |
| | | // calendar.setTime(registeredWarpper.getGetDriverLicenseDate()); |
| | | Calendar now = Calendar.getInstance(); |
| | | now.setTime(new Date()); |
| | | driver.setDriverAge(now.get(Calendar.YEAR) - calendar.get(Calendar.YEAR)); |
| | | driver.setGetDriverLicenseDate(registeredWarpper.getGetDriverLicenseDate()); |
| | | // driver.setGetDriverLicenseDate(registeredWarpper.getGetDriverLicenseDate()); |
| | | driver.setDriveCardImgUrl1(registeredWarpper.getDriveCardImgUrl()); |
| | | driver.setDriveCardImgUrl2(registeredWarpper.getDriveCardImgUrl2()); |
| | | driver.setEmail(registeredWarpper.getEmail()); |
| | |
| | | } |
| | | |
| | | if(ToolUtil.isNotEmpty(driver.getEmail())){ |
| | | String path1 = templatePath + "index.html"; |
| | | String path1 = templatePath + "driver/index.html"; |
| | | Document document1 = Jsoup.parse(new File(path1), "UTF-8"); |
| | | if(1 == language){ |
| | | document1.getElementById("english").remove(); |
| | |
| | | driverMapper.updateById(driver); |
| | | |
| | | if(ToolUtil.isNotEmpty(driver.getEmail())){ |
| | | String path1 = templatePath + "index.html"; |
| | | String path1 = templatePath + "driver/index.html"; |
| | | Document document1 = Jsoup.parse(new File(path1), "UTF-8"); |
| | | if(1 == language){ |
| | | document1.getElementById("english").remove(); |
| | |
| | | int size = this.queryMyActivity(uid, new Date(), language).size(); |
| | | map.put("activity", size); |
| | | //获取司机待支付的现金支付订单推送司机支付 |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | List<OrderPrivateCar> orderPrivateCars = orderPrivateCarService.selectList(new EntityWrapper<OrderPrivateCar>().eq("driverId", uid).eq("payType", 4) |
| | | .eq("driverPay", 1).eq("isDelete", 1)); |
| | | if(orderPrivateCars.size() > 0){ |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCars.get(0); |
| | | pushUtil.pushOfflinePayment(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1); |
| | | return; |
| | | } |
| | | List<OrderLogistics> orderLogistics = orderLogisticsService.selectList(new EntityWrapper<OrderLogistics>().eq("driverId", uid).eq("payType", 4) |
| | | .eq("isDelete", 1).eq("driverPay", 1)); |
| | | if(orderLogistics.size() > 0){ |
| | | OrderLogistics orderLogistics1 = orderLogistics.get(0); |
| | | pushUtil.pushOfflinePayment(2, orderLogistics1.getDriverId(), orderLogistics1.getId(), orderLogistics1.getType()); |
| | | } |
| | | } |
| | | }).start(); |
| | | // new Thread(new Runnable() { |
| | | // @Override |
| | | // public void run() { |
| | | // List<OrderPrivateCar> orderPrivateCars = orderPrivateCarService.selectList(new EntityWrapper<OrderPrivateCar>().eq("driverId", uid).eq("payType", 4) |
| | | // .eq("driverPay", 1).eq("isDelete", 1)); |
| | | // if(orderPrivateCars.size() > 0){ |
| | | // OrderPrivateCar orderPrivateCar = orderPrivateCars.get(0); |
| | | // pushUtil.pushOfflinePayment(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1); |
| | | // return; |
| | | // } |
| | | // List<OrderLogistics> orderLogistics = orderLogisticsService.selectList(new EntityWrapper<OrderLogistics>().eq("driverId", uid).eq("payType", 4) |
| | | // .eq("isDelete", 1).eq("driverPay", 1)); |
| | | // if(orderLogistics.size() > 0){ |
| | | // OrderLogistics orderLogistics1 = orderLogistics.get(0); |
| | | // pushUtil.pushOfflinePayment(2, orderLogistics1.getDriverId(), orderLogistics1.getId(), orderLogistics1.getType()); |
| | | // } |
| | | // } |
| | | // }).start(); |
| | | return map; |
| | | } |
| | | |
| | |
| | | driver.setPassword(ShiroKit.md5(password, salt)); |
| | | this.updateById(driver); |
| | | if(ToolUtil.isNotEmpty(driver.getEmail())){ |
| | | String path1 = templatePath + "index.html"; |
| | | String path1 = templatePath + "driver/index.html"; |
| | | Document document1 = Jsoup.parse(new File(path1), "UTF-8"); |
| | | if(1 == language){ |
| | | document1.getElementById("english").remove(); |
| | |
| | | driverActivityHistoryMapper.insert(driverActivityHistory); |
| | | |
| | | if(ToolUtil.isNotEmpty(driver.getEmail())) { |
| | | String path1 = templatePath + "index.html"; |
| | | String path1 = templatePath + "driver/index.html"; |
| | | Document document1 = Jsoup.parse(new File(path1), "UTF-8"); |
| | | if (1 == language) { |
| | | document1.getElementById("english").remove(); |
| | |
| | | driverActivityHistoryMapper.insert(driverActivityHistory); |
| | | |
| | | if(ToolUtil.isNotEmpty(driver.getEmail())) { |
| | | String path1 = templatePath + "index.html"; |
| | | String path1 = templatePath + "driver/index.html"; |
| | | Document document1 = Jsoup.parse(new File(path1), "UTF-8"); |
| | | if (1 == language) { |
| | | document1.getElementById("english").remove(); |
| | |
| | | driverActivityHistoryMapper.insert(driverActivityHistory); |
| | | |
| | | if(ToolUtil.isNotEmpty(driver.getEmail())) { |
| | | String path1 = templatePath + "index.html"; |
| | | String path1 = templatePath + "driver/index.html"; |
| | | Document document1 = Jsoup.parse(new File(path1), "UTF-8"); |
| | | if (1 == language) { |
| | | document1.getElementById("english").remove(); |
| | |
| | | driverActivityHistoryMapper.insert(driverActivityHistory); |
| | | |
| | | if(ToolUtil.isNotEmpty(driver.getEmail())) { |
| | | String path1 = templatePath + "index.html"; |
| | | String path1 = templatePath + "driver/index.html"; |
| | | Document document1 = Jsoup.parse(new File(path1), "UTF-8"); |
| | | if (1 == language) { |
| | | document1.getElementById("english").remove(); |
| | |
| | | |
| | | |
| | | if(ToolUtil.isNotEmpty(driver.getEmail())) { |
| | | String path1 = templatePath + "index.html"; |
| | | String path1 = templatePath + "driver/index.html"; |
| | | Document document1 = Jsoup.parse(new File(path1), "UTF-8"); |
| | | if (1 == language) { |
| | | document1.getElementById("english").remove(); |
| | |
| | | incomeService.saveData(2, dah.getDriverId(), 1, dao.getId(), null, dah.getMoney()); |
| | | |
| | | if(ToolUtil.isNotEmpty(driver.getEmail())) { |
| | | String path1 = templatePath + "index.html"; |
| | | String path1 = templatePath + "driver/index.html"; |
| | | Document document1 = Jsoup.parse(new File(path1), "UTF-8"); |
| | | if (1 == language) { |
| | | document1.getElementById("english").remove(); |
| | |
| | | * @param id |
| | | */ |
| | | private void singlePointLogin(Integer id){ |
| | | pushUtil.pushOffline(id, 2); |
| | | //开始验证当前账号是否在别处登录 |
| | | String value = redisUtil.getValue("DRIVER_" + id); |
| | | if(ToolUtil.isNotEmpty(value)){//将另外设备上的强迫下线(如果是车载端不需要下线) |
| | |
| | | redisUtil.remove("DRIVER_" + driver.getPhone());//删除后台冻结相关缓存 |
| | | redisUtil.remove("DRIVER_" + id);//清除存储的token |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |