| | |
| | | |
| | | @Autowired |
| | | private ITLineService itLineService; |
| | | |
| | | @Autowired |
| | | private ITRegionService tRegionService; |
| | | |
| | | @Autowired |
| | | private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; |
| | |
| | | //查询线路列表 |
| | | List<TLine> lineList = itLineService.selectList(new EntityWrapper<TLine>().eq("state", 1)); |
| | | model.addAttribute("lineList",lineList); |
| | | List<TRegion> provinceList = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("provinceList",provinceList); |
| | | return PREFIX + "tDriver_add.html"; |
| | | } |
| | | |
| | |
| | | //查询驾驶员已添加的线路列表 |
| | | List<Map<String, Object>> driverLineList = tDriverLineService.getDriverLineListByDriverId(tDriverId); |
| | | model.addAttribute("driverLineList",driverLineList); |
| | | model.addAttribute("provinceId", 1); |
| | | if(ToolUtil.isNotEmpty(tDriver.getPlaceOfEmployment())){ |
| | | TRegion area = tRegionService.selectOne(new EntityWrapper<TRegion>().eq("code", tDriver.getPlaceOfEmployment())); |
| | | model.addAttribute("areaId",area.getId()); |
| | | TRegion city = tRegionService.selectOne(new EntityWrapper<TRegion>().eq("id", area.getParentId())); |
| | | model.addAttribute("cityId",city.getId()); |
| | | TRegion province = tRegionService.selectOne(new EntityWrapper<TRegion>().eq("id", city.getParentId())); |
| | | model.addAttribute("provinceId",province.getId()); |
| | | |
| | | //市 |
| | | List<TRegion> cityList = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", city.getParentId())); |
| | | model.addAttribute("cityList",cityList); |
| | | //区 |
| | | List<TRegion> areaList = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", area.getParentId())); |
| | | model.addAttribute("areaList",areaList); |
| | | } |
| | | //省 |
| | | List<TRegion> provinceList = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("provinceList",provinceList); |
| | | return PREFIX + "tDriver_edit.html"; |
| | | } |
| | | |
| | |
| | | if (count > 0){ |
| | | return "error"; |
| | | } |
| | | if(ToolUtil.isEmpty(tDriver.getIdCard())){ |
| | | return "身份证号不能为空"; |
| | | } |
| | | Boolean b = UserUtil.idCardAuth(tDriver.getName(), tDriver.getIdCard()); |
| | | if(!b){ |
| | | return "司机姓名和身份证号不匹配"; |
| | | } |
| | | |
| | | if (1 == roleType){ //平台 |
| | | if (2 == companyType.intValue()){ |
| | | if (SinataUtil.isNotEmpty(oneId)){ |
| | |
| | | } |
| | | } |
| | | tDriverService.updateById(driver); |
| | | String value = (String) redisTemplate.opsForValue().get("DRIVER_" + driver.getPhone()); |
| | | String value = (String) redisTemplate.opsForValue().get("dache:DRIVER_" + driver.getPhone()); |
| | | if (ToolUtil.isNotEmpty(value)) { |
| | | redisTemplate.delete(value); |
| | | } |
| | | redisTemplate.delete("DRIVER_" + driver.getId()); |
| | | redisTemplate.delete("DRIVER_" + driver.getPhone()); |
| | | redisTemplate.delete("dache:DRIVER_" + driver.getId()); |
| | | redisTemplate.delete("dache:DRIVER_" + driver.getPhone()); |
| | | return SUCCESS_TIP; |
| | | } |
| | | /** |
| | |
| | | } |
| | | }).start(); |
| | | |
| | | String value = (String) redisTemplate.opsForValue().get("DRIVER_" + tDriver.getPhone()); |
| | | String value = (String) redisTemplate.opsForValue().get("dache:DRIVER_" + tDriver.getPhone()); |
| | | if (ToolUtil.isNotEmpty(value)) { |
| | | redisTemplate.delete(value); |
| | | } |
| | | redisTemplate.delete("DRIVER_" + tDriver.getId()); |
| | | redisTemplate.delete("DRIVER_" + tDriver.getPhone()); |
| | | redisTemplate.delete("dache:DRIVER_" + tDriver.getId()); |
| | | redisTemplate.delete("dache:DRIVER_" + tDriver.getPhone()); |
| | | } |
| | | tDriver.setRemark(remark); |
| | | //审核通过,在中台添加司机账号 |
| | |
| | | if (count > 0){ |
| | | return "error"; |
| | | } |
| | | } |
| | | if(ToolUtil.isEmpty(tDriver.getIdCard())){ |
| | | return "身份证号不能为空"; |
| | | } |
| | | Boolean b = UserUtil.idCardAuth(tDriver.getName(), tDriver.getIdCard()); |
| | | if(!b){ |
| | | return "司机姓名和身份证号不匹配"; |
| | | } |
| | | if (1 == roleType){ //平台 |
| | | if (2 == companyType.intValue()){ |
| | |
| | | obj.setEmergencyContactAddress(tDriver.getEmergencyContactAddress()); |
| | | obj.setUpdateTime(new Date()); |
| | | obj.setUpdateUser(shiroExtUtil.getUser().getId()); |
| | | obj.setPlaceOfEmployment(tDriver.getPlaceOfEmployment()); |
| | | tDriverService.updateAllColumnById(obj); |
| | | |
| | | //删除业务 |
| | |
| | | shellList.add("经营业务:跨城出行[是/否]"); |
| | | shellList.add("登录账号[手机号]"); |
| | | shellList.add("登录密码[密码长度为6-18]"); |
| | | shellList.add("从业地行政编号"); |
| | | } else if (shiroExtUtil.getUser().getRoleType() == 2) { |
| | | title = "分公司导入司机模板"; |
| | | |
| | |
| | | shellList.add("经营业务:跨城出行[是/否]"); |
| | | shellList.add("登录账号[手机号]"); |
| | | shellList.add("登录密码[密码长度为6-18]"); |
| | | shellList.add("从业地行政编号"); |
| | | } else if (shiroExtUtil.getUser().getRoleType() == 3) { |
| | | title = "加盟商导入司机模板"; |
| | | |
| | |
| | | shellList.add("经营业务:跨城出行[是/否]"); |
| | | shellList.add("登录账号[手机号]"); |
| | | shellList.add("登录密码[密码长度为6-18]"); |
| | | shellList.add("从业地行政编号"); |
| | | } |
| | | dataList.add(shellList); |
| | | |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | Cell cell2 = row.getCell(2); //所属分公司[提示:加盟司机选填] |
| | | String two = null; |
| | | if (SinataUtil.isNotEmpty(cell2)) { |
| | |
| | | } |
| | | } |
| | | |
| | | Cell cell20 = row.getCell(16); //从业地行政编号 |
| | | String cell201 = null; |
| | | if (SinataUtil.isNotEmpty(cell20)){ |
| | | int cellType = cell20.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | cell201 = cell20.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | cell201 = String.valueOf((long)cell20.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (SinataUtil.isEmpty(zero) || SinataUtil.isEmpty(one) || SinataUtil.isEmpty(four) |
| | | || SinataUtil.isEmpty(five) || SinataUtil.isEmpty(six) || SinataUtil.isEmpty(nine) |
| | | || SinataUtil.isEmpty(eleven) || SinataUtil.isEmpty(twelve) || SinataUtil.isEmpty(thirteen) |
| | | || SinataUtil.isEmpty(seventeen)|| SinataUtil.isEmpty(eighteen)){ |
| | | || SinataUtil.isEmpty(seventeen)|| SinataUtil.isEmpty(eighteen)|| SinataUtil.isEmpty(cell201)){ |
| | | return new ErrorTip(500, "单元格不能为空"); |
| | | }else{ |
| | | //判断账号是否存在 |
| | |
| | | if (count > 0){ |
| | | continue; |
| | | } |
| | | |
| | | Boolean b = UserUtil.idCardAuth(zero, seven); |
| | | if(!b){ |
| | | return new ErrorTip(500, "司机姓名和身份证号不匹配"); |
| | | } |
| | | //判断所属机构 |
| | | if (!one.equals("平台司机") && !one.equals("加盟司机")){ |
| | | return new ErrorTip(500, "所属机构内容不正确"); |
| | |
| | | //判断登录密码 |
| | | if (!isPassword(eighteen)){ |
| | | return new ErrorTip(500, "登录密码格式不正确"); |
| | | } |
| | | //从业地行政编号 |
| | | if (!isPassword(cell201)){ |
| | | return new ErrorTip(500, "从业地行政编号不正确"); |
| | | } |
| | | |
| | | //查找平台公司 |
| | |
| | | driver.setInsertTime(new Date()); |
| | | driver.setAddType(2); |
| | | driver.setAddObjectId(shiroExtUtil.getUser().getObjectId()); |
| | | driver.setPlaceOfEmployment(cell201); |
| | | if (SinataUtil.isNotEmpty(eight)) { |
| | | driver.setDriverAddress(eight); |
| | | } |
| | | |
| | | |
| | | //审核通过,在中台添加司机账号 |
| | | if (2 == driver.getAuthState()) { |
| | | Integer objectId = driver.getCompanyId(); |
| | |
| | | empId = userInfoByPhone.get(0).getEmpId(); |
| | | empnew = 0; |
| | | } |
| | | |
| | | |
| | | driver.setEmpId(empId); |
| | | driver.setEntercode(tCompany.getEnterCode()); |
| | | driver.setEnterId(Long.valueOf(tCompany.getEnterCode())); |
| | | driver.setEmpnew(empnew); |
| | | } |
| | | tDriverService.insert(driver); |
| | | |
| | | |
| | | |
| | | |
| | | //添加快车服务模式 |
| | | if ("是".equals(eleven)) { |
| | | TDriverService service = new TDriverService(); |
| | |
| | | Sheet sh = book.getSheetAt(0); //获取到第一个表 |
| | | for (int i = 1; i <= sh.getLastRowNum(); i++) { |
| | | Row row = sh.getRow(i); |
| | | |
| | | |
| | | Cell cell0 = row.getCell(0); //司机名称 |
| | | String zero = null; |
| | | if (SinataUtil.isNotEmpty(cell0)) { |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | Cell cell1 = row.getCell(1); //所属加盟商[选填] |
| | | String one = null; |
| | | if (SinataUtil.isNotEmpty(cell1)) { |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | Cell cell2 = row.getCell(2); //性别[男/女] |
| | | String two = null; |
| | | if (SinataUtil.isNotEmpty(cell2)) { |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell17 = row.getCell(14); //从业地行政编号 |
| | | String cell1701 = null; |
| | | if (SinataUtil.isNotEmpty(cell17)){ |
| | | int cellType = cell17.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | cell1701 = cell17.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | cell1701 = String.valueOf((long)cell17.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | if (SinataUtil.isEmpty(zero) || SinataUtil.isEmpty(two) || SinataUtil.isEmpty(three) || SinataUtil.isEmpty(four) |
| | | || SinataUtil.isEmpty(five) || SinataUtil.isEmpty(seven) |
| | | || SinataUtil.isEmpty(nine) || SinataUtil.isEmpty(ten) |
| | | || SinataUtil.isEmpty(eleven) || SinataUtil.isEmpty(fifteen) || SinataUtil.isEmpty(sixteen)){ |
| | | || SinataUtil.isEmpty(eleven) || SinataUtil.isEmpty(fifteen) |
| | | || SinataUtil.isEmpty(sixteen) || SinataUtil.isEmpty(cell1701)){ |
| | | return new ErrorTip(500, "单元格不能为空"); |
| | | }else{ |
| | | //判断账号是否存在 |
| | | int count = tDriverService.selectCount(new EntityWrapper<TDriver>().eq("phone", fifteen).in("authState", "1,2,3").ne("flag", 3)); |
| | | if (count > 0){ |
| | | continue; |
| | | } |
| | | |
| | | Boolean b = UserUtil.idCardAuth(zero, five); |
| | | if(!b){ |
| | | return new ErrorTip(500, "司机姓名和身份证号不匹配"); |
| | | } |
| | | //判断性别 |
| | | if (!two.equals("男") && !two.equals("女")){ |
| | |
| | | if (!isPassword(sixteen)) { |
| | | return new ErrorTip(500, "登录密码格式不正确"); |
| | | } |
| | | //从业地行政编号 |
| | | if (!isPassword(cell1701)) { |
| | | return new ErrorTip(500, "从业地行政编号不正确"); |
| | | } |
| | | |
| | | |
| | | //查找平台公司 |
| | | Integer companyId = shiroExtUtil.getUser().getObjectId(); |
| | | Integer franchiseeId = 0; |
| | |
| | | franchiseeId = franchisee.getId(); |
| | | } |
| | | } |
| | | |
| | | |
| | | TDriver driver = new TDriver(); |
| | | driver.setAccount(fifteen); |
| | | driver.setJobNumber(eight); |
| | |
| | | driver.setInsertTime(new Date()); |
| | | driver.setAddType(3); |
| | | driver.setAddObjectId(shiroExtUtil.getUser().getObjectId()); |
| | | driver.setPlaceOfEmployment(cell1701); |
| | | if (SinataUtil.isNotEmpty(six)) { |
| | | driver.setDriverAddress(six); |
| | | } |
| | | tDriverService.insert(driver); |
| | | |
| | | |
| | | //添加快车服务模式 |
| | | if ("是".equals(nine)) { |
| | | TDriverService service = new TDriverService(); |
| | |
| | | service.setType(3); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | } else if (shiroExtUtil.getUser().getRoleType() == 3) { |
| | |
| | | Sheet sh = book.getSheetAt(0); //获取到第一个表 |
| | | for (int i = 1; i <= sh.getLastRowNum(); i++) { |
| | | Row row = sh.getRow(i); |
| | | |
| | | |
| | | Cell cell0 = row.getCell(0); //司机名称 |
| | | String zero = null; |
| | | if (SinataUtil.isNotEmpty(cell0)) { |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | Cell cell2 = row.getCell(1); //性别[男/女] |
| | | String one = null; |
| | | if (SinataUtil.isNotEmpty(cell2)) { |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | Cell cell3 = row.getCell(2); //驾驶证号码 |
| | | String two = null; |
| | | if (SinataUtil.isNotEmpty(cell3)) { |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell17 = row.getCell(13); //登录密码[密码长度为6-18] |
| | | String cell1701 = null; |
| | | if (SinataUtil.isNotEmpty(cell17)){ |
| | | int cellType = cell17.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | cell1701 = cell17.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | cell1701 = String.valueOf((long)cell17.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | if (SinataUtil.isEmpty(zero) || SinataUtil.isEmpty(one) || SinataUtil.isEmpty(two) || SinataUtil.isEmpty(three) || SinataUtil.isEmpty(four) |
| | | || SinataUtil.isEmpty(six) || SinataUtil.isEmpty(eight) |
| | | || SinataUtil.isEmpty(nine) || SinataUtil.isEmpty(ten) |
| | | || SinataUtil.isEmpty(fourteen) || SinataUtil.isEmpty(fifteen) ){ |
| | | || SinataUtil.isEmpty(fourteen) || SinataUtil.isEmpty(fifteen) |
| | | || SinataUtil.isEmpty(cell1701)){ |
| | | return new ErrorTip(500, "单元格不能为空"); |
| | | }else{ |
| | | //判断账号是否存在 |
| | | int count = tDriverService.selectCount(new EntityWrapper<TDriver>().eq("phone", fourteen).in("authState", "1,2,3").ne("flag", 3)); |
| | | if (count > 0){ |
| | | continue; |
| | | } |
| | | Boolean b = UserUtil.idCardAuth(zero, four); |
| | | if(!b){ |
| | | return new ErrorTip(500, "司机姓名和身份证号不匹配"); |
| | | } |
| | | //判断性别 |
| | | if (!one.equals("男") && !one.equals("女")){ |
| | |
| | | driver.setInsertTime(new Date()); |
| | | driver.setAddType(4); |
| | | driver.setAddObjectId(shiroExtUtil.getUser().getObjectId()); |
| | | driver.setPlaceOfEmployment(cell1701); |
| | | if (SinataUtil.isNotEmpty(five)) { |
| | | driver.setDriverAddress(five); |
| | | } |
| | |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("sex"))){ |
| | | shellList.add(object.get("sex").toString() == "1"?"男":"女"); |
| | | shellList.add(object.get("sex").toString().equals("1")?"男":"女"); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |