| | |
| | | @Autowired |
| | | private RongYunUtil rongYunUtil; |
| | | |
| | | @Autowired |
| | | private PushUtil pushUtil; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | String code = driverRegisterWarpper.getCode(); |
| | | BranchOffice branchOffice = branchOfficeService.selectOne(new EntityWrapper<BranchOffice>().eq("districtCode", code).eq("status", 1)); |
| | | if(null == branchOffice){ |
| | | throw new Exception("该区域无服务商"); |
| | | branchOffice = branchOfficeService.selectOne(new EntityWrapper<BranchOffice>().eq("cityCode", code).eq("status", 1)); |
| | | if(null == branchOffice){ |
| | | throw new Exception("该区域无服务商"); |
| | | } |
| | | } |
| | | driver.setBranchOfficeId(branchOffice.getId()); |
| | | driver.setAgentId(branchOffice.getAgentId()); |
| | |
| | | driver.setApprovalTime(null); |
| | | driver.setApprovalUserId(null); |
| | | driver.setStatus(1); |
| | | driver.setSource(driverRegisterWarpper.getSource()); |
| | | return driver; |
| | | } |
| | | |
| | |
| | | usernamePasswordToken, simpleAuthenticationInfo); |
| | | |
| | | if (passwordTrueFlag) { |
| | | String token = JwtTokenUtil.generateToken(phone); |
| | | String token = JwtTokenUtil.generateToken(phone + System.currentTimeMillis()); |
| | | String key = token; |
| | | if(token.length() > 16){ |
| | | key = token.substring(token.length() - 16); |
| | | } |
| | | redisUtil.setStrValue(key, driver.getId().toString(), 7 * 24 * 60 * 60);//7天 |
| | | redisUtil.setStrValue("DRIVER_" + phone, key, 7 * 24 * 60 * 60);//7天 |
| | | |
| | | //下线 |
| | | for (int i = 0; i < 5; i++) { |
| | | Integer code = pushUtil.pushOffline(driver.getId(), 2); |
| | | if(200 == code){ |
| | | break; |
| | | } |
| | | } |
| | | return token; |
| | | } |
| | | return ""; |
| | |
| | | Driver driver = this.selectById(uid); |
| | | DriverInfoWarpper driverInfo = new DriverInfoWarpper(); |
| | | BeanUtils.copyProperties(driver, driverInfo); |
| | | driverInfo.setWithdrawBalance(driver.getBalance()); |
| | | driverInfo.setBalance(driver.getBalance() + driver.getBackgroundBalance() + driver.getCouponBalance() + driver.getCommission()); |
| | | |
| | | YouTuiDriver youTuiDriver = youTuiDriverService.selectOne(new EntityWrapper<YouTuiDriver>().eq("driverId", uid) |
| | | .eq("state", 2).last(" and failureTime > now() order by failureTime limit 0, 1")); |
| | | if(null != youTuiDriver){ |
| | |
| | | accountChangeDetail.setType(1); |
| | | accountChangeDetail.setCreateTime(new Date()); |
| | | accountChangeDetail.setExplain("余额充值"); |
| | | accountChangeDetail.setOldData(driver1.getBalance()); |
| | | accountChangeDetail.setOldData(driver1.getBalance() + driver1.getBackgroundBalance() + driver1.getCouponBalance() + driver1.getCommission()); |
| | | driver1.setBalance(driver1.getBalance() + amount); |
| | | accountChangeDetail.setNewData(driver1.getBalance()); |
| | | accountChangeDetail.setNewData(driver1.getBalance() + driver1.getBackgroundBalance() + driver1.getCouponBalance() + driver1.getCommission()); |
| | | DriverServiceImpl.this.updateById(driver1); |
| | | accountChangeDetailService.saveData(accountChangeDetail); |
| | | |
| | |
| | | accountChangeDetail.setType(1); |
| | | accountChangeDetail.setCreateTime(new Date()); |
| | | accountChangeDetail.setExplain("余额充值"); |
| | | accountChangeDetail.setOldData(driver1.getBalance()); |
| | | accountChangeDetail.setOldData(driver1.getBalance() + driver1.getBackgroundBalance() + driver1.getCouponBalance() + driver1.getCommission()); |
| | | driver1.setBalance(driver1.getBalance() + rechargeRecord1.getAmount()); |
| | | accountChangeDetail.setNewData(driver1.getBalance()); |
| | | accountChangeDetail.setNewData(driver1.getBalance() + driver1.getBackgroundBalance() + driver1.getCouponBalance() + driver1.getCommission()); |
| | | this.updateById(driver1); |
| | | accountChangeDetailService.saveData(accountChangeDetail); |
| | | |