| | |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.*; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.dao.DriverPunishMapper; |
| | | import com.stylefeng.guns.modular.system.dao.DriverTrainMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.apache.commons.lang.time.DateUtils; |
| | | import org.apache.poi.hdf.extractor.TC; |
| | | import org.apache.poi.ss.usermodel.Cell; |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.apache.poi.ss.usermodel.*; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | import java.text.DateFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 司机审核列表控制器 |
| | |
| | | |
| | | @Value("${pushMinistryOfTransport}") |
| | | private boolean pushMinistryOfTransport; |
| | | |
| | | @Autowired |
| | | private ITLineCompanyService lineCompanyService; |
| | | |
| | | |
| | | |
| | |
| | | model.addAttribute("seven",seven); |
| | | |
| | | //查询线路列表 |
| | | List<TLine> lineList = itLineService.selectList(new EntityWrapper<TLine>().eq("state", 1)); |
| | | model.addAttribute("lineList",lineList); |
| | | List<TLineCompany> lineCompanies = lineCompanyService.selectList(new EntityWrapper<TLineCompany>().eq("companyId", tDriver.getCompanyId())); |
| | | if(lineCompanies.size() > 0){ |
| | | List<Integer> collect = lineCompanies.stream().map(TLineCompany::getLineId).collect(Collectors.toList()); |
| | | List<TLine> lineList = itLineService.selectList(new EntityWrapper<TLine>().eq("state", 1).in("id", collect)); |
| | | model.addAttribute("lineList",lineList); |
| | | }else{ |
| | | model.addAttribute("lineList",new ArrayList<>()); |
| | | } |
| | | //查询驾驶员已添加的线路列表 |
| | | List<Map<String, Object>> driverLineList = tDriverLineService.getDriverLineListByDriverId(tDriverId); |
| | | model.addAttribute("driverLineList",driverLineList); |
| | |
| | | shellList.add("出租车资格证号"); |
| | | shellList.add("工号[选填]"); |
| | | shellList.add("经营业务:专车[是/否]"); |
| | | shellList.add("经营业务:出租车[是/否]"); |
| | | shellList.add("经营业务:跨城[是/否]"); |
| | | shellList.add("经营业务:小件同城物流[是/否]"); |
| | | shellList.add("经营业务:小件跨城物流[是/否]"); |
| | | shellList.add("经营业务:包车[是/否]"); |
| | | shellList.add("登录账号[手机号]"); |
| | | shellList.add("登录密码[密码长度为6-18]"); |
| | | }else if (ShiroKit.getUser().getRoleType() == 2){ |
| | |
| | | shellList.add("出租车资格证号"); |
| | | shellList.add("工号[选填]"); |
| | | shellList.add("经营业务:专车[是/否]"); |
| | | shellList.add("经营业务:出租车[是/否]"); |
| | | shellList.add("经营业务:跨城[是/否]"); |
| | | shellList.add("经营业务:小件同城物流[是/否]"); |
| | | shellList.add("经营业务:小件跨城物流[是/否]"); |
| | | shellList.add("经营业务:包车[是/否]"); |
| | | shellList.add("登录账号[手机号]"); |
| | | shellList.add("登录密码[密码长度为6-18]"); |
| | | }else if (ShiroKit.getUser().getRoleType() == 3){ |
| | |
| | | shellList.add("出租车资格证号"); |
| | | shellList.add("工号[选填]"); |
| | | shellList.add("经营业务:专车[是/否]"); |
| | | shellList.add("经营业务:出租车[是/否]"); |
| | | shellList.add("经营业务:跨城[是/否]"); |
| | | shellList.add("经营业务:小件同城物流[是/否]"); |
| | | shellList.add("经营业务:小件跨城物流[是/否]"); |
| | | shellList.add("经营业务:包车[是/否]"); |
| | | shellList.add("登录账号[手机号]"); |
| | | shellList.add("登录密码[密码长度为6-18]"); |
| | | } |
| | |
| | | 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)){ |
| | | zero = String.valueOf(cell0.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell1 = row.getCell(1); //所属机构[平台司机/加盟司机] |
| | | |
| | | Cell cell1 = row.getCell(1); //所属加盟商[选填] |
| | | String one = null; |
| | | if (SinataUtil.isNotEmpty(cell1)){ |
| | | one = String.valueOf(cell1.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell2 = row.getCell(2); //所属分公司[提示:加盟司机选填] |
| | | |
| | | Cell cell2 = row.getCell(2); //所属分公司 |
| | | String two = null; |
| | | if (SinataUtil.isNotEmpty(cell2)){ |
| | | two = String.valueOf(cell2.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell3 = row.getCell(3); //所属加盟商[提示:加盟司机选填] |
| | | |
| | | Cell cell3 = row.getCell(3); //所属加盟商 |
| | | String three = null; |
| | | if (SinataUtil.isNotEmpty(cell3)){ |
| | | three = String.valueOf(cell3.getStringCellValue()).trim(); |
| | | if(cell3.getCellType().equals(CellType.NUMERIC)){ |
| | | three = String.valueOf(cell3.getNumericCellValue()).trim(); |
| | | }else{ |
| | | three = String.valueOf(cell3.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell4 = row.getCell(4); //性别[男/女] |
| | | |
| | | Cell cell4 = row.getCell(4); //性别 |
| | | String four = null; |
| | | if (SinataUtil.isNotEmpty(cell4)){ |
| | | four = String.valueOf(cell4.getStringCellValue()).trim(); |
| | | if(cell4.getCellType().equals(CellType.NUMERIC)){ |
| | | four = String.valueOf(cell4.getNumericCellValue()).trim(); |
| | | }else{ |
| | | four = String.valueOf(cell4.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | |
| | | Cell cell5 = row.getCell(5); //驾驶证号码 |
| | | String five = null; |
| | | if (SinataUtil.isNotEmpty(cell5)){ |
| | | five = String.valueOf(cell5.getStringCellValue()).trim(); |
| | | if(cell5.getCellType().equals(CellType.NUMERIC)){ |
| | | five = String.valueOf(cell5.getNumericCellValue()).trim(); |
| | | }else{ |
| | | five = String.valueOf(cell5.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | |
| | | Cell cell6 = row.getCell(6); //驾龄 |
| | | String six = null; |
| | | if (SinataUtil.isNotEmpty(cell6)){ |
| | | six = String.valueOf(cell6.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | |
| | | Cell cell7 = row.getCell(7); //身份证号 |
| | | String seven = null; |
| | | if (SinataUtil.isNotEmpty(cell7)){ |
| | | seven = String.valueOf(cell7.getStringCellValue()).trim(); |
| | | if(cell7.getCellType().equals(CellType.NUMERIC)){ |
| | | seven = String.valueOf(cell7.getNumericCellValue()).trim(); |
| | | }else{ |
| | | seven = String.valueOf(cell7.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | |
| | | Cell cell8 = row.getCell(8); //居住地址 |
| | | String eight = null; |
| | | if (SinataUtil.isNotEmpty(cell8)){ |
| | | eight = String.valueOf(cell8.getStringCellValue()).trim(); |
| | | if(cell8.getCellType().equals(CellType.NUMERIC)){ |
| | | eight = String.valueOf(cell8.getNumericCellValue()).trim(); |
| | | }else{ |
| | | eight = String.valueOf(cell8.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | |
| | | Cell cell9 = row.getCell(9); //出租车资格证号 |
| | | String nine = null; |
| | | if (SinataUtil.isNotEmpty(cell9)){ |
| | | nine = String.valueOf(cell9.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | |
| | | Cell cell10 = row.getCell(10); //工号[选填] |
| | | String ten = null; |
| | | if (SinataUtil.isNotEmpty(cell10)){ |
| | | ten = String.valueOf(cell10.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | |
| | | Cell cell11 = row.getCell(11); //经营业务:专车[是/否] |
| | | String eleven = null; |
| | | if (SinataUtil.isNotEmpty(cell11)){ |
| | | eleven = String.valueOf(cell11.getStringCellValue()).trim(); |
| | | if(cell11.getCellType().equals(CellType.NUMERIC)){ |
| | | eleven = String.valueOf(cell11.getNumericCellValue()).trim(); |
| | | }else{ |
| | | eleven = String.valueOf(cell11.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell12 = row.getCell(12); //经营业务:专车[是/否] |
| | | |
| | | Cell cell12 = row.getCell(12); //经营业务:跨城[是/否] |
| | | String twelve = null; |
| | | if (SinataUtil.isNotEmpty(cell12)){ |
| | | twelve = String.valueOf(cell12.getStringCellValue()).trim(); |
| | | if(cell12.getCellType().equals(CellType.NUMERIC)){ |
| | | twelve = String.valueOf(cell12.getNumericCellValue()).trim(); |
| | | }else{ |
| | | twelve = String.valueOf(cell12.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell13 = row.getCell(13); //经营业务:跨城出行[是/否] |
| | | |
| | | Cell cell13 = row.getCell(13); //登录账号[手机号] |
| | | String thirteen = null; |
| | | if (SinataUtil.isNotEmpty(cell13)){ |
| | | thirteen = String.valueOf(cell13.getStringCellValue()).trim(); |
| | | if(cell13.getCellType().equals(CellType.NUMERIC)){ |
| | | thirteen = String.valueOf(cell13.getNumericCellValue()).trim(); |
| | | }else{ |
| | | thirteen = String.valueOf(cell13.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell14 = row.getCell(14); //经营业务:小件同城物流[是/否] |
| | | |
| | | Cell cell14 = row.getCell(14); //登录密码[密码长度为6-18] |
| | | String fourteen = null; |
| | | if (SinataUtil.isNotEmpty(cell14)){ |
| | | fourteen = String.valueOf(cell14.getStringCellValue()).trim(); |
| | | if(cell14.getCellType().equals(CellType.NUMERIC)){ |
| | | fourteen = String.valueOf(cell14.getNumericCellValue()).trim(); |
| | | }else{ |
| | | fourteen = String.valueOf(cell14.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell15 = row.getCell(15); //经营业务:小件跨城物流[是/否] |
| | | String fifteen = null; |
| | | if (SinataUtil.isNotEmpty(cell15)){ |
| | | fifteen = String.valueOf(cell15.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell16 = row.getCell(16); //经营业务:包车[是/否] |
| | | String sixteen = null; |
| | | if (SinataUtil.isNotEmpty(cell16)){ |
| | | sixteen = String.valueOf(cell16.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell17 = row.getCell(17); //登录账号[手机号] |
| | | String seventeen = null; |
| | | if (SinataUtil.isNotEmpty(cell17)){ |
| | | seventeen = String.valueOf(cell17.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell18 = row.getCell(18); //登录密码[密码长度为6-18] |
| | | String eighteen = null; |
| | | if (SinataUtil.isNotEmpty(cell18)){ |
| | | eighteen = String.valueOf(cell18.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | 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(fourteen) || SinataUtil.isEmpty(fifteen) || SinataUtil.isEmpty(sixteen) |
| | | || SinataUtil.isEmpty(seventeen)|| SinataUtil.isEmpty(eighteen)){ |
| | | |
| | | if (SinataUtil.isEmpty(zero) || SinataUtil.isEmpty(one) || SinataUtil.isEmpty(two) |
| | | || SinataUtil.isEmpty(four) || SinataUtil.isEmpty(five) || SinataUtil.isEmpty(six) |
| | | || SinataUtil.isEmpty(seven) || SinataUtil.isEmpty(eight) || SinataUtil.isEmpty(nine) || SinataUtil.isEmpty(ten) |
| | | || SinataUtil.isEmpty(eleven) || SinataUtil.isEmpty(twelve) || SinataUtil.isEmpty(thirteen) || SinataUtil.isEmpty(fourteen)){ |
| | | return new ErrorTip(500, "单元格不能为空"); |
| | | }else{ |
| | | //判断账号是否存在 |
| | | int count = tDriverService.selectCount(new EntityWrapper<TDriver>().eq("phone", seventeen).in("authState", "1,2,3").ne("flag", 3)); |
| | | int count = tDriverService.selectCount(new EntityWrapper<TDriver>().eq("phone", thirteen).in("authState", "1,2,3").ne("flag", 3)); |
| | | if (count > 0){ |
| | | continue; |
| | | } |
| | | |
| | | //判断所属机构 |
| | | if (!one.equals("平台司机") && !one.equals("加盟司机")){ |
| | | if (!Arrays.asList("平台司机", "加盟司机").contains(one)){ |
| | | return new ErrorTip(500, "所属机构内容不正确"); |
| | | } |
| | | //判断性别 |
| | | if (!four.equals("男") && !four.equals("女")){ |
| | | if (!Arrays.asList("男", "女").contains(four)){ |
| | | return new ErrorTip(500, "性别内容不正确"); |
| | | } |
| | | //判断经营业务【专车】 |
| | | if (!eleven.equals("是") && !eleven.equals("否")){ |
| | | if (!Arrays.asList("是", "否").contains(eleven)){ |
| | | return new ErrorTip(500, "经营业务【专车】内容不正确"); |
| | | } |
| | | //判断经营业务【出租车】 |
| | | if (!twelve.equals("是") && !twelve.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【出租车】内容不正确"); |
| | | } |
| | | //判断经营业务【跨城出行】 |
| | | if (!thirteen.equals("是") && !thirteen.equals("否")){ |
| | | if (!Arrays.asList("是", "否").contains(twelve)){ |
| | | return new ErrorTip(500, "经营业务【跨城】内容不正确"); |
| | | } |
| | | //判断经营业务【小件同城物流】 |
| | | if (!fourteen.equals("是") && !fourteen.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【小件同城物流】内容不正确"); |
| | | } |
| | | //判断经营业务【小件跨城物流】 |
| | | if (!fifteen.equals("是") && !fifteen.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【小件跨城物流】内容不正确"); |
| | | } |
| | | //判断经营业务【包车】 |
| | | if (!sixteen.equals("是") && !sixteen.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【包车】内容不正确"); |
| | | } |
| | | //判断驾龄 |
| | | if (!isInteger(six)){ |
| | | return new ErrorTip(500, "驾龄格式不正确"); |
| | | } |
| | | //判断手机号 |
| | | if (!isPhone(seventeen)){ |
| | | if (!isPhone(thirteen)){ |
| | | return new ErrorTip(500, "登录账号[手机号]格式不正确"); |
| | | } |
| | | //判断登录密码 |
| | | if (!isPassword(eighteen)){ |
| | | if (!isPassword(fourteen)){ |
| | | return new ErrorTip(500, "登录密码格式不正确"); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | TDriver driver = new TDriver(); |
| | | driver.setAccount(seventeen); |
| | | driver.setAccount(thirteen); |
| | | driver.setJobNumber(ten); |
| | | driver.setPhone(seventeen); |
| | | driver.setPassword(ShiroKit.md5(eighteen, "SA;d5#")); |
| | | driver.setPhone(thirteen); |
| | | driver.setPassword(ShiroKit.md5(fourteen, "SA;d5#")); |
| | | driver.setName(zero); |
| | | if ("男".equals(four)){ |
| | | driver.setSex(1); |
| | |
| | | } |
| | | driver.setCompanyId(companyId); |
| | | driver.setFranchiseeId(franchiseeId); |
| | | driver.setState(2); |
| | | driver.setState(1); |
| | | driver.setAuthState(2); |
| | | driver.setFlag("1"); |
| | | driver.setInsertUser(ShiroKit.getUser().getId()); |
| | |
| | | service.setType(1); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加出租车服务模式 |
| | | if ("是".equals(twelve)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(2); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加跨城出行服务模式 |
| | | if ("是".equals(thirteen)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(3); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加小件同城物流服务模式 |
| | | if ("是".equals(fourteen)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(4); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加小件跨城物流服务模式 |
| | | if ("是".equals(fifteen)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(5); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加包车服务模式 |
| | | if ("是".equals(sixteen)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(6); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | } |
| | |
| | | one = String.valueOf(cell1.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell2 = row.getCell(2); //性别[男/女] |
| | | Cell cell2 = row.getCell(2); //所属分公司 |
| | | String two = null; |
| | | if (SinataUtil.isNotEmpty(cell2)){ |
| | | two = String.valueOf(cell2.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell3 = row.getCell(3); //驾驶证号码 |
| | | Cell cell3 = row.getCell(3); //所属加盟商 |
| | | String three = null; |
| | | if (SinataUtil.isNotEmpty(cell3)){ |
| | | three = String.valueOf(cell3.getStringCellValue()).trim(); |
| | | if(cell3.getCellType().equals(CellType.NUMERIC)){ |
| | | three = String.valueOf(cell3.getNumericCellValue()).trim(); |
| | | }else{ |
| | | three = String.valueOf(cell3.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell4 = row.getCell(4); //驾龄 |
| | | Cell cell4 = row.getCell(4); //性别 |
| | | String four = null; |
| | | if (SinataUtil.isNotEmpty(cell4)){ |
| | | four = String.valueOf(cell4.getStringCellValue()).trim(); |
| | | if(cell4.getCellType().equals(CellType.NUMERIC)){ |
| | | four = String.valueOf(cell4.getNumericCellValue()).trim(); |
| | | }else{ |
| | | four = String.valueOf(cell4.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell5 = row.getCell(5); //身份证号 |
| | | Cell cell5 = row.getCell(5); //驾驶证号码 |
| | | String five = null; |
| | | if (SinataUtil.isNotEmpty(cell5)){ |
| | | five = String.valueOf(cell5.getStringCellValue()).trim(); |
| | | if(cell5.getCellType().equals(CellType.NUMERIC)){ |
| | | five = String.valueOf(cell5.getNumericCellValue()).trim(); |
| | | }else{ |
| | | five = String.valueOf(cell5.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell6 = row.getCell(6); //居住地址 |
| | | Cell cell6 = row.getCell(6); //驾龄 |
| | | String six = null; |
| | | if (SinataUtil.isNotEmpty(cell6)){ |
| | | six = String.valueOf(cell6.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell7 = row.getCell(7); //出租车资格证号 |
| | | Cell cell7 = row.getCell(7); //身份证号 |
| | | String seven = null; |
| | | if (SinataUtil.isNotEmpty(cell7)){ |
| | | seven = String.valueOf(cell7.getStringCellValue()).trim(); |
| | | if(cell7.getCellType().equals(CellType.NUMERIC)){ |
| | | seven = String.valueOf(cell7.getNumericCellValue()).trim(); |
| | | }else{ |
| | | seven = String.valueOf(cell7.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell8 = row.getCell(8); //工号[选填] |
| | | Cell cell8 = row.getCell(8); //居住地址 |
| | | String eight = null; |
| | | if (SinataUtil.isNotEmpty(cell8)){ |
| | | eight = String.valueOf(cell8.getStringCellValue()).trim(); |
| | | if(cell8.getCellType().equals(CellType.NUMERIC)){ |
| | | eight = String.valueOf(cell8.getNumericCellValue()).trim(); |
| | | }else{ |
| | | eight = String.valueOf(cell8.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell9 = row.getCell(9); //经营业务:专车[是/否] |
| | | Cell cell9 = row.getCell(9); //出租车资格证号 |
| | | String nine = null; |
| | | if (SinataUtil.isNotEmpty(cell9)){ |
| | | nine = String.valueOf(cell9.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell10 = row.getCell(10); //经营业务:出租车[是/否] |
| | | Cell cell10 = row.getCell(10); //工号[选填] |
| | | String ten = null; |
| | | if (SinataUtil.isNotEmpty(cell10)){ |
| | | ten = String.valueOf(cell10.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell11 = row.getCell(11); //经营业务:跨城出行[是/否] |
| | | Cell cell11 = row.getCell(11); //经营业务:专车[是/否] |
| | | String eleven = null; |
| | | if (SinataUtil.isNotEmpty(cell11)){ |
| | | eleven = String.valueOf(cell11.getStringCellValue()).trim(); |
| | | if(cell11.getCellType().equals(CellType.NUMERIC)){ |
| | | eleven = String.valueOf(cell11.getNumericCellValue()).trim(); |
| | | }else{ |
| | | eleven = String.valueOf(cell11.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell12 = row.getCell(12); //经营业务:小件同城物流[是/否] |
| | | Cell cell12 = row.getCell(12); //经营业务:跨城[是/否] |
| | | String twelve = null; |
| | | if (SinataUtil.isNotEmpty(cell12)){ |
| | | twelve = String.valueOf(cell12.getStringCellValue()).trim(); |
| | | if(cell12.getCellType().equals(CellType.NUMERIC)){ |
| | | twelve = String.valueOf(cell12.getNumericCellValue()).trim(); |
| | | }else{ |
| | | twelve = String.valueOf(cell12.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell13 = row.getCell(13); //经营业务:小件跨城物流[是/否] |
| | | |
| | | Cell cell13 = row.getCell(13); //登录账号[手机号] |
| | | String thirteen = null; |
| | | if (SinataUtil.isNotEmpty(cell13)){ |
| | | thirteen = String.valueOf(cell13.getStringCellValue()).trim(); |
| | | if(cell13.getCellType().equals(CellType.NUMERIC)){ |
| | | thirteen = String.valueOf(cell13.getNumericCellValue()).trim(); |
| | | }else{ |
| | | thirteen = String.valueOf(cell13.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell14 = row.getCell(14); //经营业务:包车[是/否] |
| | | |
| | | Cell cell14 = row.getCell(14); //登录密码[密码长度为6-18] |
| | | String fourteen = null; |
| | | if (SinataUtil.isNotEmpty(cell14)){ |
| | | fourteen = String.valueOf(cell14.getStringCellValue()).trim(); |
| | | if(cell14.getCellType().equals(CellType.NUMERIC)){ |
| | | fourteen = String.valueOf(cell14.getNumericCellValue()).trim(); |
| | | }else{ |
| | | fourteen = String.valueOf(cell14.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell15 = row.getCell(15); //登录账号[手机号] |
| | | String fifteen = null; |
| | | if (SinataUtil.isNotEmpty(cell15)){ |
| | | fifteen = String.valueOf(cell15.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell16 = row.getCell(16); //登录密码[密码长度为6-18] |
| | | String sixteen = null; |
| | | if (SinataUtil.isNotEmpty(cell16)){ |
| | | sixteen = String.valueOf(cell16.getStringCellValue()).trim(); |
| | | } |
| | | 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(twelve) || SinataUtil.isEmpty(thirteen) |
| | | || SinataUtil.isEmpty(fourteen) || SinataUtil.isEmpty(fifteen) || SinataUtil.isEmpty(sixteen)){ |
| | | if (SinataUtil.isEmpty(zero) || SinataUtil.isEmpty(one) || SinataUtil.isEmpty(two) |
| | | || SinataUtil.isEmpty(four) || SinataUtil.isEmpty(five) || SinataUtil.isEmpty(six) |
| | | || SinataUtil.isEmpty(seven) || SinataUtil.isEmpty(eight) || SinataUtil.isEmpty(nine) || SinataUtil.isEmpty(ten) |
| | | || SinataUtil.isEmpty(eleven) || SinataUtil.isEmpty(twelve) || SinataUtil.isEmpty(thirteen) || SinataUtil.isEmpty(fourteen)){ |
| | | return new ErrorTip(500, "单元格不能为空"); |
| | | }else{ |
| | | //判断账号是否存在 |
| | | int count = tDriverService.selectCount(new EntityWrapper<TDriver>().eq("phone", fifteen).in("authState", "1,2,3").ne("flag", 3)); |
| | | int count = tDriverService.selectCount(new EntityWrapper<TDriver>().eq("phone", thirteen).in("authState", "1,2,3").ne("flag", 3)); |
| | | if (count > 0){ |
| | | continue; |
| | | } |
| | | //判断性别 |
| | | if (!two.equals("男") && !two.equals("女")){ |
| | | if (!Arrays.asList("男", "女").contains(four)){ |
| | | return new ErrorTip(500, "性别内容不正确"); |
| | | } |
| | | //判断经营业务【专车】 |
| | | if (!nine.equals("是") && !nine.equals("否")){ |
| | | if (!Arrays.asList("是", "否").contains(eleven)){ |
| | | return new ErrorTip(500, "经营业务【专车】内容不正确"); |
| | | } |
| | | //判断经营业务【出租车】 |
| | | if (!ten.equals("是") && !ten.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【出租车】内容不正确"); |
| | | } |
| | | //判断经营业务【跨城出行】 |
| | | if (!eleven.equals("是") && !eleven.equals("否")){ |
| | | if (!Arrays.asList("是", "否").contains(twelve)){ |
| | | return new ErrorTip(500, "经营业务【跨城】内容不正确"); |
| | | } |
| | | //判断经营业务【小件同城物流】 |
| | | if (!twelve.equals("是") && !twelve.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【小件同城物流】内容不正确"); |
| | | } |
| | | //判断经营业务【小件跨城物流】 |
| | | if (!thirteen.equals("是") && !thirteen.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【小件跨城物流】内容不正确"); |
| | | } |
| | | //判断经营业务【包车】 |
| | | if (!fourteen.equals("是") && !fourteen.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【包车】内容不正确"); |
| | | } |
| | | //判断驾龄 |
| | | if (!isInteger(four)){ |
| | | if (!isInteger(six)){ |
| | | return new ErrorTip(500, "驾龄格式不正确"); |
| | | } |
| | | //判断手机号 |
| | | if (!isPhone(fifteen)){ |
| | | if (!isPhone(thirteen)){ |
| | | return new ErrorTip(500, "登录账号[手机号]格式不正确"); |
| | | } |
| | | //判断登录密码 |
| | | if (!isPassword(sixteen)){ |
| | | if (!isPassword(fourteen)){ |
| | | return new ErrorTip(500, "登录密码格式不正确"); |
| | | } |
| | | //查找平台公司 |
| | | Integer companyId = ShiroKit.getUser().getObjectId(); |
| | | Integer franchiseeId = 0; |
| | | //判断所属分公司是否存在 |
| | | if (SinataUtil.isNotEmpty(one)){ |
| | | TCompany franchisee = itCompanyService.selectOne(new EntityWrapper<TCompany>().eq("superiorId",companyId).eq("name", one).eq("type", 3).notIn("flag", "3").last(" limit 1")); |
| | | if (SinataUtil.isNotEmpty(three)){ |
| | | TCompany franchisee = itCompanyService.selectOne(new EntityWrapper<TCompany>().eq("superiorId",companyId).eq("name", three).eq("type", 3).notIn("flag", "3").last(" limit 1")); |
| | | if (SinataUtil.isNotEmpty(franchisee)){ |
| | | franchiseeId = franchisee.getId(); |
| | | } |
| | | } |
| | | |
| | | TDriver driver = new TDriver(); |
| | | driver.setAccount(fifteen); |
| | | driver.setJobNumber(eight); |
| | | driver.setPhone(fifteen); |
| | | driver.setPassword(ShiroKit.md5(sixteen, "SA;d5#")); |
| | | driver.setAccount(thirteen); |
| | | driver.setJobNumber(ten); |
| | | driver.setPhone(thirteen); |
| | | driver.setPassword(ShiroKit.md5(fourteen, "SA;d5#")); |
| | | driver.setName(zero); |
| | | if ("男".equals(two)){ |
| | | if ("男".equals(four)){ |
| | | driver.setSex(1); |
| | | }else if ("女".equals(two)){ |
| | | }else if ("女".equals(four)){ |
| | | driver.setSex(2); |
| | | } |
| | | driver.setIdCard(five); |
| | | driver.setDriverAge(Integer.valueOf(four)); |
| | | driver.setDriveCard(three); |
| | | driver.setTaxiAptitudeCard(seven); |
| | | driver.setIdCard(seven); |
| | | driver.setDriverAge(Integer.valueOf(six)); |
| | | driver.setDriveCard(five); |
| | | driver.setTaxiAptitudeCard(nine); |
| | | driver.setIsPlatCar(2); |
| | | driver.setCompanyId(companyId); |
| | | driver.setFranchiseeId(franchiseeId); |
| | | driver.setState(1); |
| | | driver.setAuthState(1); |
| | | driver.setAuthState(2); |
| | | driver.setFlag("1"); |
| | | driver.setInsertUser(ShiroKit.getUser().getId()); |
| | | driver.setInsertTime(new Date()); |
| | | driver.setAddType(3); |
| | | driver.setAddObjectId(ShiroKit.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(six)){ |
| | | driver.setDriverAddress(six); |
| | | if (SinataUtil.isNotEmpty(eight)){ |
| | | driver.setDriverAddress(eight); |
| | | } |
| | | tDriverService.insert(driver); |
| | | |
| | | //添加专车服务模式 |
| | | if ("是".equals(nine)){ |
| | | if ("是".equals(eleven)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(1); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加出租车服务模式 |
| | | if ("是".equals(ten)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(2); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | |
| | | //添加跨城出行服务模式 |
| | | if ("是".equals(eleven)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(3); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加小件同城物流服务模式 |
| | | if ("是".equals(twelve)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(4); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加小件跨城物流服务模式 |
| | | if ("是".equals(thirteen)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(5); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加包车服务模式 |
| | | if ("是".equals(fourteen)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(6); |
| | | service.setType(3); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | |
| | |
| | | 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)){ |
| | | zero = String.valueOf(cell0.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell2 = row.getCell(1); //性别[男/女] |
| | | |
| | | Cell cell1 = row.getCell(1); //所属加盟商[选填] |
| | | String one = null; |
| | | if (SinataUtil.isNotEmpty(cell2)){ |
| | | one = String.valueOf(cell2.getStringCellValue()).trim(); |
| | | if (SinataUtil.isNotEmpty(cell1)){ |
| | | one = String.valueOf(cell1.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell3 = row.getCell(2); //驾驶证号码 |
| | | |
| | | Cell cell2 = row.getCell(2); //所属分公司 |
| | | String two = null; |
| | | if (SinataUtil.isNotEmpty(cell3)){ |
| | | two = String.valueOf(cell3.getStringCellValue()).trim(); |
| | | if (SinataUtil.isNotEmpty(cell2)){ |
| | | two = String.valueOf(cell2.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell4 = row.getCell(3); //驾龄 |
| | | |
| | | Cell cell3 = row.getCell(3); //所属加盟商 |
| | | String three = null; |
| | | if (SinataUtil.isNotEmpty(cell4)){ |
| | | three = String.valueOf(cell4.getStringCellValue()).trim(); |
| | | if (SinataUtil.isNotEmpty(cell3)){ |
| | | if(cell3.getCellType().equals(CellType.NUMERIC)){ |
| | | three = String.valueOf(cell3.getNumericCellValue()).trim(); |
| | | }else{ |
| | | three = String.valueOf(cell3.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell5 = row.getCell(4); //身份证号 |
| | | |
| | | Cell cell4 = row.getCell(4); //性别 |
| | | String four = null; |
| | | if (SinataUtil.isNotEmpty(cell5)){ |
| | | four = String.valueOf(cell5.getStringCellValue()).trim(); |
| | | if (SinataUtil.isNotEmpty(cell4)){ |
| | | if(cell4.getCellType().equals(CellType.NUMERIC)){ |
| | | four = String.valueOf(cell4.getNumericCellValue()).trim(); |
| | | }else{ |
| | | four = String.valueOf(cell4.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell6 = row.getCell(5); //居住地址 |
| | | |
| | | Cell cell5 = row.getCell(5); //驾驶证号码 |
| | | String five = null; |
| | | if (SinataUtil.isNotEmpty(cell6)){ |
| | | five = String.valueOf(cell6.getStringCellValue()).trim(); |
| | | if (SinataUtil.isNotEmpty(cell5)){ |
| | | if(cell5.getCellType().equals(CellType.NUMERIC)){ |
| | | five = String.valueOf(cell5.getNumericCellValue()).trim(); |
| | | }else{ |
| | | five = String.valueOf(cell5.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell7 = row.getCell(6); //出租车资格证号 |
| | | |
| | | Cell cell6 = row.getCell(6); //驾龄 |
| | | String six = null; |
| | | if (SinataUtil.isNotEmpty(cell7)){ |
| | | six = String.valueOf(cell7.getStringCellValue()).trim(); |
| | | if (SinataUtil.isNotEmpty(cell6)){ |
| | | six = String.valueOf(cell6.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell8 = row.getCell(7); //工号[选填] |
| | | |
| | | Cell cell7 = row.getCell(7); //身份证号 |
| | | String seven = null; |
| | | if (SinataUtil.isNotEmpty(cell8)){ |
| | | seven = String.valueOf(cell8.getStringCellValue()).trim(); |
| | | if (SinataUtil.isNotEmpty(cell7)){ |
| | | if(cell7.getCellType().equals(CellType.NUMERIC)){ |
| | | seven = String.valueOf(cell7.getNumericCellValue()).trim(); |
| | | }else{ |
| | | seven = String.valueOf(cell7.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell9 = row.getCell(8); //经营业务:专车[是/否] |
| | | |
| | | Cell cell8 = row.getCell(8); //居住地址 |
| | | String eight = null; |
| | | if (SinataUtil.isNotEmpty(cell9)){ |
| | | eight = String.valueOf(cell9.getStringCellValue()).trim(); |
| | | if (SinataUtil.isNotEmpty(cell8)){ |
| | | if(cell8.getCellType().equals(CellType.NUMERIC)){ |
| | | eight = String.valueOf(cell8.getNumericCellValue()).trim(); |
| | | }else{ |
| | | eight = String.valueOf(cell8.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell10 = row.getCell(9); //经营业务:出租车[是/否] |
| | | |
| | | Cell cell9 = row.getCell(9); //出租车资格证号 |
| | | String nine = null; |
| | | if (SinataUtil.isNotEmpty(cell10)){ |
| | | nine = String.valueOf(cell10.getStringCellValue()).trim(); |
| | | if (SinataUtil.isNotEmpty(cell9)){ |
| | | nine = String.valueOf(cell9.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell11 = row.getCell(10); //经营业务:跨城出行[是/否] |
| | | |
| | | Cell cell10 = row.getCell(10); //工号[选填] |
| | | String ten = null; |
| | | if (SinataUtil.isNotEmpty(cell11)){ |
| | | ten = String.valueOf(cell11.getStringCellValue()).trim(); |
| | | if (SinataUtil.isNotEmpty(cell10)){ |
| | | ten = String.valueOf(cell10.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell12 = row.getCell(11); //经营业务:小件同城物流[是/否] |
| | | |
| | | Cell cell11 = row.getCell(11); //经营业务:专车[是/否] |
| | | String eleven = null; |
| | | if (SinataUtil.isNotEmpty(cell12)){ |
| | | eleven = String.valueOf(cell12.getStringCellValue()).trim(); |
| | | if (SinataUtil.isNotEmpty(cell11)){ |
| | | if(cell11.getCellType().equals(CellType.NUMERIC)){ |
| | | eleven = String.valueOf(cell11.getNumericCellValue()).trim(); |
| | | }else{ |
| | | eleven = String.valueOf(cell11.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell13 = row.getCell(12); //经营业务:小件跨城物流[是/否] |
| | | |
| | | Cell cell12 = row.getCell(12); //经营业务:跨城[是/否] |
| | | String twelve = null; |
| | | if (SinataUtil.isNotEmpty(cell13)){ |
| | | twelve = String.valueOf(cell13.getStringCellValue()).trim(); |
| | | if (SinataUtil.isNotEmpty(cell12)){ |
| | | if(cell12.getCellType().equals(CellType.NUMERIC)){ |
| | | twelve = String.valueOf(cell12.getNumericCellValue()).trim(); |
| | | }else{ |
| | | twelve = String.valueOf(cell12.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell14 = row.getCell(13); //经营业务:包车[是/否] |
| | | |
| | | Cell cell13 = row.getCell(13); //登录账号[手机号] |
| | | String thirteen = null; |
| | | if (SinataUtil.isNotEmpty(cell14)){ |
| | | thirteen = String.valueOf(cell14.getStringCellValue()).trim(); |
| | | if (SinataUtil.isNotEmpty(cell13)){ |
| | | if(cell13.getCellType().equals(CellType.NUMERIC)){ |
| | | thirteen = String.valueOf(cell13.getNumericCellValue()).trim(); |
| | | }else{ |
| | | thirteen = String.valueOf(cell13.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell15 = row.getCell(14); //登录账号[手机号] |
| | | |
| | | Cell cell14 = row.getCell(14); //登录密码[密码长度为6-18] |
| | | String fourteen = null; |
| | | if (SinataUtil.isNotEmpty(cell15)){ |
| | | fourteen = String.valueOf(cell15.getStringCellValue()).trim(); |
| | | if (SinataUtil.isNotEmpty(cell14)){ |
| | | if(cell14.getCellType().equals(CellType.NUMERIC)){ |
| | | fourteen = String.valueOf(cell14.getNumericCellValue()).trim(); |
| | | }else{ |
| | | fourteen = String.valueOf(cell14.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell16 = row.getCell(15); //登录密码[密码长度为6-18] |
| | | String fifteen = null; |
| | | if (SinataUtil.isNotEmpty(cell16)){ |
| | | fifteen = String.valueOf(cell16.getStringCellValue()).trim(); |
| | | } |
| | | 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(eleven) || SinataUtil.isEmpty(twelve) || SinataUtil.isEmpty(thirteen) |
| | | || SinataUtil.isEmpty(fourteen) || SinataUtil.isEmpty(fifteen) ){ |
| | | if (SinataUtil.isEmpty(zero) || SinataUtil.isEmpty(one) || SinataUtil.isEmpty(two) |
| | | || SinataUtil.isEmpty(four) || SinataUtil.isEmpty(five) || SinataUtil.isEmpty(six) |
| | | || SinataUtil.isEmpty(seven) || SinataUtil.isEmpty(eight) || SinataUtil.isEmpty(nine) || SinataUtil.isEmpty(ten) |
| | | || SinataUtil.isEmpty(eleven) || SinataUtil.isEmpty(twelve) || SinataUtil.isEmpty(thirteen) || SinataUtil.isEmpty(fourteen)){ |
| | | return new ErrorTip(500, "单元格不能为空"); |
| | | }else{ |
| | | //判断账号是否存在 |
| | | int count = tDriverService.selectCount(new EntityWrapper<TDriver>().eq("phone", fourteen).in("authState", "1,2,3").ne("flag", 3)); |
| | | int count = tDriverService.selectCount(new EntityWrapper<TDriver>().eq("phone", thirteen).in("authState", "1,2,3").ne("flag", 3)); |
| | | if (count > 0){ |
| | | continue; |
| | | } |
| | | //判断性别 |
| | | if (!one.equals("男") && !one.equals("女")){ |
| | | if (!Arrays.asList("男", "女").contains(four)){ |
| | | return new ErrorTip(500, "性别内容不正确"); |
| | | } |
| | | //判断经营业务【专车】 |
| | | if (!eight.equals("是") && !eight.equals("否")){ |
| | | if (!Arrays.asList("是", "否").contains(eleven)){ |
| | | return new ErrorTip(500, "经营业务【专车】内容不正确"); |
| | | } |
| | | //判断经营业务【出租车】 |
| | | if (!nine.equals("是") && !nine.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【出租车】内容不正确"); |
| | | } |
| | | //判断经营业务【跨城出行】 |
| | | if (!ten.equals("是") && !ten.equals("否")){ |
| | | if (!Arrays.asList("是", "否").contains(twelve)){ |
| | | return new ErrorTip(500, "经营业务【跨城】内容不正确"); |
| | | } |
| | | //判断经营业务【小件同城物流】 |
| | | if (!eleven.equals("是") && !eleven.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【小件同城物流】内容不正确"); |
| | | } |
| | | //判断经营业务【小件跨城物流】 |
| | | if (!twelve.equals("是") && !twelve.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【小件跨城物流】内容不正确"); |
| | | } |
| | | //判断经营业务【包车】 |
| | | if (!thirteen.equals("是") && !thirteen.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【包车】内容不正确"); |
| | | } |
| | | //判断驾龄 |
| | | if (!isInteger(three)){ |
| | | if (!isInteger(six)){ |
| | | return new ErrorTip(500, "驾龄格式不正确"); |
| | | } |
| | | //判断手机号 |
| | | if (!isPhone(fourteen)){ |
| | | if (!isPhone(thirteen)){ |
| | | return new ErrorTip(500, "登录账号[手机号]格式不正确"); |
| | | } |
| | | //判断登录密码 |
| | | if (!isPassword(fifteen)){ |
| | | if (!isPassword(fourteen)){ |
| | | return new ErrorTip(500, "登录密码格式不正确"); |
| | | } |
| | | //查找平台公司 |
| | |
| | | } |
| | | |
| | | TDriver driver = new TDriver(); |
| | | driver.setAccount(fourteen); |
| | | driver.setJobNumber(seven); |
| | | driver.setPhone(fourteen); |
| | | driver.setPassword(ShiroKit.md5(fifteen, "SA;d5#")); |
| | | driver.setAccount(thirteen); |
| | | driver.setJobNumber(ten); |
| | | driver.setPhone(thirteen); |
| | | driver.setPassword(ShiroKit.md5(fourteen, "SA;d5#")); |
| | | driver.setName(zero); |
| | | if ("男".equals(one)){ |
| | | if ("男".equals(four)){ |
| | | driver.setSex(1); |
| | | }else if ("女".equals(one)){ |
| | | }else if ("女".equals(four)){ |
| | | driver.setSex(2); |
| | | } |
| | | driver.setIdCard(four); |
| | | driver.setDriverAge(Integer.valueOf(three)); |
| | | driver.setDriveCard(two); |
| | | driver.setTaxiAptitudeCard(six); |
| | | driver.setIdCard(seven); |
| | | driver.setDriverAge(Integer.valueOf(six)); |
| | | driver.setDriveCard(five); |
| | | driver.setTaxiAptitudeCard(nine); |
| | | driver.setIsPlatCar(2); |
| | | driver.setCompanyId(companyId); |
| | | driver.setFranchiseeId(franchiseeId); |
| | |
| | | driver.setInsertTime(new Date()); |
| | | driver.setAddType(4); |
| | | driver.setAddObjectId(ShiroKit.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(five)){ |
| | | driver.setDriverAddress(five); |
| | | if (SinataUtil.isNotEmpty(eight)){ |
| | | driver.setDriverAddress(eight); |
| | | } |
| | | tDriverService.insert(driver); |
| | | |
| | | //添加专车服务模式 |
| | | if ("是".equals(eight)){ |
| | | if ("是".equals(eleven)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(1); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加出租车服务模式 |
| | | if ("是".equals(nine)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(2); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加跨城出行服务模式 |
| | | if ("是".equals(ten)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(3); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加小件同城物流服务模式 |
| | | if ("是".equals(eleven)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(4); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加小件跨城物流服务模式 |
| | | if ("是".equals(twelve)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(5); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加包车服务模式 |
| | | if ("是".equals(thirteen)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(6); |
| | | service.setType(3); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | } |
| | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/getCompanyLine") |
| | | public List<TLine> getCompanyLine(Integer companyId){ |
| | | //查询线路列表 |
| | | List<TLineCompany> lineCompanies = lineCompanyService.selectList(new EntityWrapper<TLineCompany>().eq("companyId", companyId)); |
| | | if(lineCompanies.size() > 0){ |
| | | List<Integer> collect = lineCompanies.stream().map(TLineCompany::getLineId).collect(Collectors.toList()); |
| | | return itLineService.selectList(new EntityWrapper<TLine>().eq("state", 1).in("id", collect)); |
| | | }else{ |
| | | return new ArrayList<>(); |
| | | } |
| | | } |
| | | |
| | | } |