| | |
| | | private ShiroExtUtil shiroExtUtil; |
| | | @Autowired |
| | | private IDriverWorkService iDriverWorkService; |
| | | @Autowired |
| | | private ITRegionService regionService; |
| | | |
| | | /** |
| | | * 跳转投诉页面 |
| | |
| | | TDriver tDriver = tDriverService.selectById(tDriverId); |
| | | DriverWork driverWork = iDriverWorkService.selectOne(new EntityWrapper<DriverWork>().eq("driverId", tDriverId).eq("state", 1)); |
| | | if(null != driverWork && !tDriver.getCarId().equals(carId)){ |
| | | throw new RuntimeException("司机上班中,不能更换车辆"); |
| | | return ResultUtil.error("司机上班中,不能更换车辆"); |
| | | } |
| | | tDriver.setCarId(carId); |
| | | tDriverService.updateById(tDriver); |
| | | } |
| | | return SUCCESS_TIP; |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | /** |
| | |
| | | driver.setAddType(2); |
| | | driver.setAddObjectId(shiroExtUtil.getUser().getObjectId()); |
| | | driver.setPlaceOfEmployment(cell201); |
| | | if(ToolUtil.isNotEmpty(cell201)){ |
| | | TRegion tRegion = regionService.selectOne(new EntityWrapper<TRegion>().eq("code", cell201)); |
| | | String placeOfPractice = ""; |
| | | if(null != tRegion){ |
| | | Integer parentId = tRegion.getParentId(); |
| | | if(0 != parentId){ |
| | | TRegion tRegion1 = regionService.selectById(parentId); |
| | | if(0 != tRegion1.getParentId()){ |
| | | TRegion tRegion2 = regionService.selectById(tRegion1.getParentId()); |
| | | placeOfPractice = tRegion2.getName() + "," + tRegion1.getName() + "," + tRegion.getName(); |
| | | }else{ |
| | | placeOfPractice = tRegion1.getName() + "," + tRegion.getName(); |
| | | } |
| | | }else{ |
| | | placeOfPractice = tRegion.getName(); |
| | | } |
| | | } |
| | | driver.setPlaceOfPractice(placeOfPractice); |
| | | } |
| | | if (SinataUtil.isNotEmpty(eight)) { |
| | | driver.setDriverAddress(eight); |
| | | } |
| | |
| | | } |
| | | |
| | | // 校验从业地是否在公司经营区域内 |
| | | String placeError = validatePlaceOfEmployment(companyId, cell1701); |
| | | String placeError = validatePlaceOfEmployment(companyId, cell1701, 2); |
| | | if (placeError != null) { |
| | | return new ErrorTip(500, placeError); |
| | | } |
| | |
| | | } |
| | | |
| | | // 校验从业地是否在公司经营区域内 |
| | | String placeError = validatePlaceOfEmployment(companyId, cell1701); |
| | | String placeError = validatePlaceOfEmployment(companyId, cell1701, 3); |
| | | if (placeError != null) { |
| | | return new ErrorTip(500, placeError); |
| | | } |
| | |
| | | * @param placeOfEmployment 从业地行政编号 |
| | | * @return 错误信息,null表示校验通过 |
| | | */ |
| | | private String validatePlaceOfEmployment(Integer companyId, String placeOfEmployment) { |
| | | private String validatePlaceOfEmployment(Integer companyId, String placeOfEmployment, Integer roleType) { |
| | | if (companyId == null || SinataUtil.isEmpty(placeOfEmployment)) { |
| | | return null; |
| | | } |
| | | if (roleType.equals(3)) { |
| | | //查询该加盟商所属的分公司 |
| | | TCompany tCompany = tCompanyService.selectById(companyId); |
| | | if (Objects.nonNull(tCompany) && Objects.nonNull(tCompany.getSuperiorId())) { |
| | | companyId = tCompany.getSuperiorId(); |
| | | } else { |
| | | return null; |
| | | } |
| | | } |
| | | List<TCompanyCity> companyCityList = tCompanyCityService.selectList( |
| | | new EntityWrapper<TCompanyCity>().eq("companyId", companyId).eq("state", 1)); |
| | | if (companyCityList == null || companyCityList.isEmpty()) { |