| | |
| | | |
| | | @Autowired |
| | | private ICompanyCityService companyCityService; |
| | | @Autowired |
| | | private IOpenCityService openCityService; |
| | | |
| | | @Autowired |
| | | private GDFalconUtil gdFalconUtil; |
| | |
| | | private CarServiceMapper carServiceMapper; |
| | | |
| | | @Autowired |
| | | private PushUtil pushUtil; |
| | | |
| | | @Autowired |
| | | private IOrderLogisticsService orderLogisticsService; |
| | | |
| | | @Value("${pushMinistryOfTransport}") |
| | |
| | | |
| | | private String salt = "SA;d5#"; |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private OrderPrivateCarMapper orderPrivateCarMapper; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private OrderCrossCityMapper orderCrossCityMapper; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private OrderTaxiMapper orderTaxiMapper; |
| | | |
| | | @Autowired |
| | |
| | | driver.setCityCode(registeredWarpper.getCityCode()); |
| | | driver.setProvince(registeredWarpper.getProvince()); |
| | | driver.setProvinceCode(registeredWarpper.getProvinceCode()); |
| | | driver.setCompanyId(registeredWarpper.getCompanyId()); |
| | | |
| | | String code = registeredWarpper.getAreaCode(); |
| | | Company query = companyCityService.query(code); |
| | |
| | | */ |
| | | @Override |
| | | public Map<String, Object> queryPhone(String code) throws Exception { |
| | | Company query = companyCityService.query(code); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if(null == query){ |
| | | map.put("phone", ""); |
| | | }else{ |
| | | Phone phone = phoneMapper.queryInfo(query.getId(), 2); |
| | | map.put("phone", null != phone ? phone.getPhone() : ""); |
| | | } |
| | | OpenCity openCity = openCityService.openCity1(code); |
| | | Phone phone = phoneMapper.queryInfo(openCity.getId(), 2, 2); |
| | | map.put("phone", null != phone ? phone.getPhone() : ""); |
| | | return map; |
| | | } |
| | | |
| | |
| | | loginWarpper.setRongYunToken(token1.getToken()); |
| | | |
| | | //创建高德猎鹰的终端数据 |
| | | String tid = gdFalconUtil.createTerminal(phone); |
| | | loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | loginWarpper.setTerminalId(tid); |
| | | // String tid = gdFalconUtil.createTerminal(phone); |
| | | // loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | // loginWarpper.setTerminalId(tid); |
| | | return ResultUtil.success(loginWarpper); |
| | | } |
| | | |
| | |
| | | driverWorkMapper.updateById(driverWork); |
| | | driver.setState(1); |
| | | |
| | | // 更新车辆使用状态 |
| | | carService.updateUseState(uid); |
| | | |
| | | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | |
| | | return ResultUtil.error("车辆正在使用中"); |
| | | } |
| | | } |
| | | |
| | | //判断车辆是否正在使用中 |
| | | Car car = carService.selectById(driver.getCarId()); |
| | | if(car.getUseDriverId() != null && !car.getUseDriverId().equals(uid)){ |
| | | return ResultUtil.error("当前绑定车辆正在使用中,请更换车辆"); |
| | | }else if(car.getUseDriverId()==null){ |
| | | car.setUseDriverId(uid); |
| | | carService.updateById(car); |
| | | } |
| | | |
| | | |
| | | |
| | | driverWork = new DriverWork(); |
| | | driverWork.setState(1); |
| | | driverWork.setDriverId(uid); |
| | |
| | | driverWorkMapper.updateById(driverWork); |
| | | driver.setState(1); |
| | | |
| | | // 更新车辆使用状态 |
| | | carService.updateUseState(uid); |
| | | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | |
| | | } |
| | | }).start(); |
| | | }else{ |
| | | |
| | | //判断车辆是否正在使用中 |
| | | Car car = carService.selectById(driver.getCarId()); |
| | | if(car.getUseDriverId() != null && !car.getUseDriverId().equals(uid)){ |
| | | return ResultUtil.error("当前绑定车辆正在使用中,请更换车辆"); |
| | | }else if(car.getUseDriverId()==null){ |
| | | car.setUseDriverId(uid); |
| | | carService.updateById(car); |
| | | } |
| | | |
| | | |
| | | |
| | | driverWork = new DriverWork(); |
| | | driverWork.setState(1); |
| | | driverWork.setDriverId(uid); |
| | |
| | | if(driver.getState() == 3){ |
| | | return ResultUtil.error("还在服务中,不能更换"); |
| | | } |
| | | boolean idle = carService.idle(carId); |
| | | // boolean idle = carService.idle(carId); |
| | | // 修改是否别司机在使用 |
| | | boolean idle = carService.useState(carId,uid); |
| | | if(!idle){ |
| | | return ResultUtil.error("当前车辆已经有其他司机在使用,请更换车辆"); |
| | | } |
| | | // 将所有绑定他的车 =null |
| | | carService.updateUseState(carId,uid); |
| | | Car car = carService.selectById(carId); |
| | | car.setUseDriverId(uid); |
| | | carService.updateById( car); |
| | | driver.setCarId(carId); |
| | | this.updateById(driver); |
| | | return ResultUtil.success(); |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public Map<String, Object> queryPhone(Integer uid) throws Exception { |
| | | public Map<String, Object> queryPhone(Integer uid, String code) throws Exception { |
| | | Driver driver = this.selectById(uid); |
| | | Company company = companyMapper.selectById(driver.getFranchiseeId() != null && driver.getFranchiseeId() != 0 ? driver.getFranchiseeId() : ( |
| | | driver.getCompanyId() != null && driver.getCompanyId() != 0 ? driver.getCompanyId() : 1)); |
| | | OpenCity openCity = openCityService.openCity1(code); |
| | | Company company = companyMapper.selectById(driver.getCompanyId()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if(company.getType() == 3){//加盟商 |
| | | Phone phone = phoneMapper.queryInfo(company.getId(), 2); |
| | | map.put("branch", ""); |
| | | Phone phone = phoneMapper.queryInfo(openCity.getId(), 2, 2); |
| | | map.put("franchisee", null != phone ? phone.getPhone() : ""); |
| | | company = companyMapper.selectById(company.getSuperiorId()); |
| | | if(null != company){ |
| | | phone = phoneMapper.queryInfo(company.getId(), 2); |
| | | map.put("branch", null != phone ? phone.getPhone() : ""); |
| | | }else{ |
| | | map.put("branch", ""); |
| | | } |
| | | company = companyMapper.selectById(company.getSuperiorId()); |
| | | if(null != company){ |
| | | phone = phoneMapper.queryInfo(company.getId(), 2); |
| | | map.put("platform", null != phone ? phone.getPhone() : ""); |
| | | }else{ |
| | | map.put("platform", ""); |
| | | } |
| | | phone = phoneMapper.queryInfo(openCity.getId(), 2, 1); |
| | | map.put("platform",null != phone ? phone.getPhone() : ""); |
| | | return map; |
| | | } |
| | | if(company.getType() == 2){//分公司 |
| | | map.put("franchisee", ""); |
| | | Phone phone = phoneMapper.queryInfo(company.getId(), 2); |
| | | Phone phone = phoneMapper.queryInfo(openCity.getId(), 2, 2); |
| | | map.put("branch", null != phone ? phone.getPhone() : ""); |
| | | company = companyMapper.selectById(company.getSuperiorId()); |
| | | if(null != company){ |
| | | phone = phoneMapper.queryInfo(company.getId(), 2); |
| | | map.put("platform",null != phone ? phone.getPhone() : ""); |
| | | }else{ |
| | | map.put("platform", ""); |
| | | } |
| | | phone = phoneMapper.queryInfo(openCity.getId(), 2, 1); |
| | | map.put("platform",null != phone ? phone.getPhone() : ""); |
| | | return map; |
| | | } |
| | | if(company.getType() == 1){//平台 |
| | | map.put("franchisee", ""); |
| | | map.put("branch", ""); |
| | | Phone phone = phoneMapper.queryInfo(company.getId(), 2); |
| | | Phone phone = phoneMapper.queryInfo(company.getId(), 2, 1); |
| | | map.put("platform", null != phone ? phone.getPhone() : ""); |
| | | return map; |
| | | } |
| | |
| | | loginWarpper.setAppid(UUIDUtil.getRandomCode()); |
| | | |
| | | //创建高德猎鹰的终端数据 |
| | | String tid = gdFalconUtil.createTerminal(driver.getPhone()); |
| | | loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | loginWarpper.setTerminalId(tid); |
| | | // String tid = gdFalconUtil.createTerminal(driver.getPhone()); |
| | | // loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | // loginWarpper.setTerminalId(tid); |
| | | return ResultUtil.success(loginWarpper); |
| | | } |
| | | |
| | |
| | | loginWarpper.setAppid(UUIDUtil.getRandomCode()); |
| | | |
| | | //创建高德猎鹰的终端数据 |
| | | String tid = gdFalconUtil.createTerminal(driver.getPhone()); |
| | | loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | loginWarpper.setTerminalId(tid); |
| | | // String tid = gdFalconUtil.createTerminal(driver.getPhone()); |
| | | // loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | // loginWarpper.setTerminalId(tid); |
| | | return ResultUtil.success(loginWarpper); |
| | | } |
| | | |
| | |
| | | loginWarpper.setAppid(UUIDUtil.getRandomCode()); |
| | | |
| | | //创建高德猎鹰的终端数据 |
| | | String tid = gdFalconUtil.createTerminal(driver.getPhone()); |
| | | loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | loginWarpper.setTerminalId(tid); |
| | | // String tid = gdFalconUtil.createTerminal(driver.getPhone()); |
| | | // loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | // loginWarpper.setTerminalId(tid); |
| | | return ResultUtil.success(loginWarpper); |
| | | } |
| | | |