DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/DriverController.java
@@ -8,6 +8,7 @@ import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; import com.stylefeng.guns.modular.system.model.City; import com.stylefeng.guns.modular.system.model.Driver; import com.stylefeng.guns.modular.system.model.Income; import com.stylefeng.guns.modular.system.model.OrderPosition; @@ -72,6 +73,9 @@ @Autowired private IDriverOnlineService driverOnlineService; @Autowired private ICityService cityService; @@ -255,6 +259,23 @@ } @ResponseBody @PostMapping("/base/driver/queryAllCity") @ApiOperation(value = "获取所有城市", tags = {"司机端-注册"}, notes = "") @ApiImplicitParams({ }) public ResultUtil<List<City>> queryAllCity(){ try { List<City> cities = cityService.selectList(null); return ResultUtil.success(cities); }catch (Exception e){ e.printStackTrace(); return ResultUtil.runErr(); } } /** * 司机注册后完善个人信息 DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/PhoneController.java
@@ -31,18 +31,18 @@ /** * 获取个人中心的客服电话 * @param code * @return */ @ResponseBody @PostMapping("/queryCustomerPhone") @ApiOperation(value = "获取个人中心的客服电话", tags = {"司机端-首页"}, notes = "platform(平台电话),company(本地电话),scheduling(调度电话)") @ApiOperation(value = "获取个人中心的客服电话【1.0】", tags = {"司机端-首页"}, notes = "platform(平台电话),company(本地电话),scheduling(调度电话)") @ApiImplicitParams({ @ApiImplicitParam(value = "当前定位行政区域编号", name = "code", required = true, dataType = "string"), @ApiImplicitParam(value = "当前定位纬度", name = "lat", required = true, dataType = "double"), @ApiImplicitParam(value = "当前定位经度", name = "lnt", required = true, dataType = "double"), }) public ResultUtil queryCustomerPhone(String code){ public ResultUtil queryCustomerPhone(Double lat, Double lnt){ try { Map<String, Object> map = phoneService.queryCustomerPhone(code); Map<String, Object> map = phoneService.queryCustomerPhone(lat, lnt); return ResultUtil.success(map); }catch (Exception e){ e.printStackTrace(); DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IPhoneService.java
@@ -18,9 +18,8 @@ /** * 获取客服电话(个人中心) * @param code * @return * @throws Exception */ Map<String, Object> queryCustomerPhone(String code) throws Exception; Map<String, Object> queryCustomerPhone(Double lat, Double lnt) throws Exception; } DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverServiceImpl.java
@@ -367,6 +367,7 @@ driver.setName(registeredWarpper.getName()); driver.setSex(registeredWarpper.getSex()); driver.setIdCard(registeredWarpper.getIdCard()); driver.setBirthday(registeredWarpper.getBirthday()); City city1 = cityService.selectById(registeredWarpper.getPlaceOfPracticeId()); String[] city = new String[]{city1.getEnglishName()}; DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/PhoneServiceImpl.java
@@ -1,9 +1,17 @@ package com.stylefeng.guns.modular.system.service.impl; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.stylefeng.guns.modular.system.dao.CompanyMapper; import com.stylefeng.guns.modular.system.dao.PhoneMapper; import com.stylefeng.guns.modular.system.model.Company; import com.stylefeng.guns.modular.system.model.Phone; import com.stylefeng.guns.modular.system.service.ICompanyService; import com.stylefeng.guns.modular.system.service.IPhoneService; import com.stylefeng.guns.modular.system.util.GoogleMap.AddressComponentsVo; import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -17,6 +25,9 @@ @Resource private PhoneMapper phoneMapper; @Resource private CompanyMapper companyMapper; /** * 获取所有系统电话 @@ -46,34 +57,32 @@ * @throws Exception */ @Override public Map<String, Object> queryCustomerPhone(String code) throws Exception { String province = code.substring(0, 2) + "0000"; String city = code.substring(0, 4) + "00"; public Map<String, Object> queryCustomerPhone(Double lat, Double lnt) throws Exception { ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lat); if(null == reverseGeocode){ System.err.println("获取地图信息出错"); return new HashMap<>(); } AddressComponentsVo[] addressComponentsVos = reverseGeocode.getAddressComponentsVos(); String[] city = new String[addressComponentsVos.length]; for (int i = 0; i < addressComponentsVos.length; i++) { city[i] = addressComponentsVos[i].getLongName(); } Map<String, Object> map = new HashMap<>(); //平台电话 Phone query = phoneMapper.query(2, 1, null, null, null); map.put("platform", null != query ? query.getPhone() : ""); //公司 query = phoneMapper.query(2, null, province, city, code); if(query == null){ query = phoneMapper.query(2, null, province, city, null); List<Company> companies = companyMapper.queryList(city, null); if(companies.size() > 0){ Integer id = companies.get(0).getId(); Phone phone = this.selectOne(new EntityWrapper<Phone>().eq("type", 2).eq("companyId", id)); map.put("company", phone.getPhone()); phone = this.selectOne(new EntityWrapper<Phone>().eq("type", 3).eq("companyId", id)); map.put("scheduling", phone.getPhone()); } if(query == null){ query = phoneMapper.query(2, null, province, null, null); } map.put("company", null != query ? query.getPhone() : ""); //调度电话 query = phoneMapper.query(3, null, province, city, code); if(query == null){ query = phoneMapper.query(3, null, province, city, null); } if(query == null){ query = phoneMapper.query(3, null, province, null, null); } map.put("scheduling", null != query ? query.getPhone() : ""); return map; } } DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/RegisteredWarpper.java
@@ -15,6 +15,8 @@ private String name; @ApiModelProperty("性别(1=男,2=女)") private Integer sex; @ApiModelProperty("生日") private Date birthday; @ApiModelProperty("居住地") private String driverContactAddress; @ApiModelProperty("居住地(带分隔符)") @@ -169,6 +171,14 @@ this.driveCardImgUrl2 = driveCardImgUrl2; } public Date getBirthday() { return birthday; } public void setBirthday(Date birthday) { this.birthday = birthday; } @Override public String toString() { return "RegisteredWarpper{" +