| | |
| | | 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(); |
| | | } |
| | | } |
| | | |
| | | |
| | | Cell cell6 = row.getCell(6); //驾龄 |
| | | String six = null; |
| | | if (SinataUtil.isNotEmpty(cell6)){ |
| | | if(cell6.getCellType().equals(CellType.NUMERIC)){ |
| | | six = String.valueOf(cell6.getNumericCellValue()).trim(); |
| | | }else{ |
| | | six = String.valueOf(cell6.getStringCellValue()).trim(); |
| | | } |
| | | six = String.valueOf(cell6.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | |
| | | Cell cell7 = row.getCell(7); //身份证号 |
| | | String seven = null; |
| | | if (SinataUtil.isNotEmpty(cell7)){ |
| | |
| | | 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)){ |
| | | if(cell9.getCellType().equals(CellType.NUMERIC)){ |
| | | nine = String.valueOf(cell9.getNumericCellValue()).trim(); |
| | | }else{ |
| | | nine = String.valueOf(cell9.getStringCellValue()).trim(); |
| | | } |
| | | nine = String.valueOf(cell9.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | |
| | | Cell cell10 = row.getCell(10); //工号[选填] |
| | | String ten = null; |
| | | if (SinataUtil.isNotEmpty(cell10)){ |
| | | if(cell10.getCellType().equals(CellType.NUMERIC)){ |
| | | ten = String.valueOf(cell10.getNumericCellValue()).trim(); |
| | | }else{ |
| | | ten = String.valueOf(cell10.getStringCellValue()).trim(); |
| | | } |
| | | 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 cell13 = row.getCell(12); //经营业务:跨城出行[是/否] |
| | | |
| | | Cell cell12 = row.getCell(12); //经营业务:跨城[是/否] |
| | | String twelve = null; |
| | | if (SinataUtil.isNotEmpty(cell12)){ |
| | | if(cell12.getCellType().equals(CellType.NUMERIC)){ |
| | | twelve = String.valueOf(cell12.getNumericCellValue()).trim(); |
| | | }else{ |
| | | twelve = String.valueOf(cell12.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell13 = row.getCell(13); //登录账号[手机号] |
| | | String thirteen = null; |
| | | if (SinataUtil.isNotEmpty(cell13)){ |
| | | thirteen = String.valueOf(cell13.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell17 = row.getCell(13); //登录账号[手机号] |
| | | String seventeen = null; |
| | | if (SinataUtil.isNotEmpty(cell17)){ |
| | | if(cell17.getCellType().equals(CellType.NUMERIC)){ |
| | | seventeen = String.valueOf(cell17.getNumericCellValue()).trim(); |
| | | if(cell13.getCellType().equals(CellType.NUMERIC)){ |
| | | thirteen = String.valueOf(cell13.getNumericCellValue()).trim(); |
| | | }else{ |
| | | seventeen = String.valueOf(cell17.getStringCellValue()).trim(); |
| | | thirteen = String.valueOf(cell13.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell18 = row.getCell(14); //登录密码[密码长度为6-18] |
| | | String eighteen = null; |
| | | if (SinataUtil.isNotEmpty(cell18)){ |
| | | if(cell18.getCellType().equals(CellType.NUMERIC)){ |
| | | eighteen = String.valueOf(cell18.getNumericCellValue()).trim(); |
| | | |
| | | Cell cell14 = row.getCell(14); //登录密码[密码长度为6-18] |
| | | String fourteen = null; |
| | | if (SinataUtil.isNotEmpty(cell14)){ |
| | | if(cell14.getCellType().equals(CellType.NUMERIC)){ |
| | | fourteen = String.valueOf(cell14.getNumericCellValue()).trim(); |
| | | }else{ |
| | | eighteen = String.valueOf(cell18.getStringCellValue()).trim(); |
| | | fourteen = String.valueOf(cell14.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(thirteen) |
| | | || 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 (!thirteen.equals("是") && !thirteen.equals("否")){ |
| | | if (!Arrays.asList("是", "否").contains(twelve)){ |
| | | return new ErrorTip(500, "经营业务【跨城】内容不正确"); |
| | | } |
| | | //判断驾龄 |
| | |
| | | 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); |
| | |
| | | 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)){ |
| | | if(cell3.getCellType().equals(CellType.NUMERIC)){ |
| | |
| | | } |
| | | } |
| | | |
| | | Cell cell4 = row.getCell(4); //驾龄 |
| | | Cell cell4 = row.getCell(4); //性别 |
| | | String four = null; |
| | | if (SinataUtil.isNotEmpty(cell4)){ |
| | | if(cell4.getCellType().equals(CellType.NUMERIC)){ |
| | |
| | | } |
| | | } |
| | | |
| | | Cell cell5 = row.getCell(5); //身份证号 |
| | | Cell cell5 = row.getCell(5); //驾驶证号码 |
| | | String five = null; |
| | | if (SinataUtil.isNotEmpty(cell5)){ |
| | | if(cell5.getCellType().equals(CellType.NUMERIC)){ |
| | |
| | | } |
| | | } |
| | | |
| | | 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)){ |
| | | if(cell7.getCellType().equals(CellType.NUMERIC)){ |
| | |
| | | } |
| | | } |
| | | |
| | | Cell cell8 = row.getCell(8); //工号[选填] |
| | | Cell cell8 = row.getCell(8); //居住地址 |
| | | String eight = null; |
| | | if (SinataUtil.isNotEmpty(cell8)){ |
| | | if(cell8.getCellType().equals(CellType.NUMERIC)){ |
| | |
| | | } |
| | | } |
| | | |
| | | Cell cell9 = row.getCell(9); //经营业务:专车[是/否] |
| | | Cell cell9 = row.getCell(9); //出租车资格证号 |
| | | String nine = null; |
| | | 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(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(); |
| | | } |
| | | |
| | | Cell cell15 = row.getCell(11); //登录账号[手机号] |
| | | String fifteen = null; |
| | | if (SinataUtil.isNotEmpty(cell15)){ |
| | | if(cell15.getCellType().equals(CellType.NUMERIC)){ |
| | | fifteen = String.valueOf(cell15.getNumericCellValue()).trim(); |
| | | if(cell11.getCellType().equals(CellType.NUMERIC)){ |
| | | eleven = String.valueOf(cell11.getNumericCellValue()).trim(); |
| | | }else{ |
| | | fifteen = String.valueOf(cell15.getStringCellValue()).trim(); |
| | | eleven = String.valueOf(cell11.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell16 = row.getCell(12); //登录密码[密码长度为6-18] |
| | | String sixteen = null; |
| | | if (SinataUtil.isNotEmpty(cell16)){ |
| | | if(cell16.getCellType().equals(CellType.NUMERIC)){ |
| | | sixteen = String.valueOf(cell16.getNumericCellValue()).trim(); |
| | | Cell cell12 = row.getCell(12); //经营业务:跨城[是/否] |
| | | String twelve = null; |
| | | if (SinataUtil.isNotEmpty(cell12)){ |
| | | if(cell12.getCellType().equals(CellType.NUMERIC)){ |
| | | twelve = String.valueOf(cell12.getNumericCellValue()).trim(); |
| | | }else{ |
| | | sixteen = String.valueOf(cell16.getStringCellValue()).trim(); |
| | | twelve = String.valueOf(cell12.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(eleven) || SinataUtil.isEmpty(fifteen) || SinataUtil.isEmpty(sixteen)){ |
| | | |
| | | Cell cell13 = row.getCell(13); //登录账号[手机号] |
| | | String thirteen = null; |
| | | if (SinataUtil.isNotEmpty(cell13)){ |
| | | if(cell13.getCellType().equals(CellType.NUMERIC)){ |
| | | thirteen = String.valueOf(cell13.getNumericCellValue()).trim(); |
| | | }else{ |
| | | thirteen = String.valueOf(cell13.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell14 = row.getCell(14); //登录密码[密码长度为6-18] |
| | | String fourteen = null; |
| | | if (SinataUtil.isNotEmpty(cell14)){ |
| | | if(cell14.getCellType().equals(CellType.NUMERIC)){ |
| | | fourteen = String.valueOf(cell14.getNumericCellValue()).trim(); |
| | | }else{ |
| | | fourteen = String.valueOf(cell14.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | 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 (!eleven.equals("是") && !eleven.equals("否")){ |
| | | if (!Arrays.asList("是", "否").contains(twelve)){ |
| | | 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.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); |
| | |
| | | } |
| | | |
| | | //添加跨城出行服务模式 |
| | | if ("是".equals(eleven)){ |
| | | if ("是".equals(twelve)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(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)){ |
| | | 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(cell2)){ |
| | | two = String.valueOf(cell2.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell3 = row.getCell(3); //所属加盟商 |
| | | String three = null; |
| | | if (SinataUtil.isNotEmpty(cell3)){ |
| | | if(cell3.getCellType().equals(CellType.NUMERIC)){ |
| | | two = String.valueOf(cell3.getNumericCellValue()).trim(); |
| | | three = String.valueOf(cell3.getNumericCellValue()).trim(); |
| | | }else{ |
| | | two = String.valueOf(cell3.getStringCellValue()).trim(); |
| | | three = String.valueOf(cell3.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell4 = row.getCell(3); //驾龄 |
| | | String three = null; |
| | | |
| | | Cell cell4 = row.getCell(4); //性别 |
| | | String four = null; |
| | | if (SinataUtil.isNotEmpty(cell4)){ |
| | | if(cell4.getCellType().equals(CellType.NUMERIC)){ |
| | | three = String.valueOf(cell4.getNumericCellValue()).trim(); |
| | | four = String.valueOf(cell4.getNumericCellValue()).trim(); |
| | | }else{ |
| | | three = String.valueOf(cell4.getStringCellValue()).trim(); |
| | | four = String.valueOf(cell4.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell5 = row.getCell(4); //身份证号 |
| | | String four = null; |
| | | |
| | | Cell cell5 = row.getCell(5); //驾驶证号码 |
| | | String five = null; |
| | | if (SinataUtil.isNotEmpty(cell5)){ |
| | | if(cell5.getCellType().equals(CellType.NUMERIC)){ |
| | | four = String.valueOf(cell5.getNumericCellValue()).trim(); |
| | | five = String.valueOf(cell5.getNumericCellValue()).trim(); |
| | | }else{ |
| | | four = String.valueOf(cell5.getStringCellValue()).trim(); |
| | | five = String.valueOf(cell5.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell6 = row.getCell(5); //居住地址 |
| | | String five = null; |
| | | if (SinataUtil.isNotEmpty(cell6)){ |
| | | five = String.valueOf(cell6.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell7 = 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); //身份证号 |
| | | String seven = null; |
| | | if (SinataUtil.isNotEmpty(cell7)){ |
| | | if(cell7.getCellType().equals(CellType.NUMERIC)){ |
| | | six = String.valueOf(cell7.getNumericCellValue()).trim(); |
| | | seven = String.valueOf(cell7.getNumericCellValue()).trim(); |
| | | }else{ |
| | | six = String.valueOf(cell7.getStringCellValue()).trim(); |
| | | seven = String.valueOf(cell7.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell8 = row.getCell(7); //工号[选填] |
| | | String seven = null; |
| | | |
| | | Cell cell8 = row.getCell(8); //居住地址 |
| | | String eight = null; |
| | | if (SinataUtil.isNotEmpty(cell8)){ |
| | | if(cell8.getCellType().equals(CellType.NUMERIC)){ |
| | | seven = String.valueOf(cell8.getNumericCellValue()).trim(); |
| | | eight = String.valueOf(cell8.getNumericCellValue()).trim(); |
| | | }else{ |
| | | seven = String.valueOf(cell8.getStringCellValue()).trim(); |
| | | eight = String.valueOf(cell8.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell9 = row.getCell(8); //经营业务:专车[是/否] |
| | | String eight = null; |
| | | |
| | | Cell cell9 = row.getCell(9); //出租车资格证号 |
| | | String nine = null; |
| | | if (SinataUtil.isNotEmpty(cell9)){ |
| | | if(cell9.getCellType().equals(CellType.NUMERIC)){ |
| | | eight = String.valueOf(cell9.getNumericCellValue()).trim(); |
| | | }else{ |
| | | eight = String.valueOf(cell9.getStringCellValue()).trim(); |
| | | } |
| | | nine = String.valueOf(cell9.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell11 = row.getCell(9); //经营业务:跨城出行[是/否] |
| | | |
| | | 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)){ |
| | | ten = 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 cell15 = row.getCell(10); //登录账号[手机号] |
| | | |
| | | Cell cell12 = row.getCell(12); //经营业务:跨城[是/否] |
| | | String twelve = null; |
| | | if (SinataUtil.isNotEmpty(cell12)){ |
| | | if(cell12.getCellType().equals(CellType.NUMERIC)){ |
| | | twelve = String.valueOf(cell12.getNumericCellValue()).trim(); |
| | | }else{ |
| | | twelve = String.valueOf(cell12.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell13 = row.getCell(13); //登录账号[手机号] |
| | | String thirteen = null; |
| | | if (SinataUtil.isNotEmpty(cell13)){ |
| | | if(cell13.getCellType().equals(CellType.NUMERIC)){ |
| | | thirteen = String.valueOf(cell13.getNumericCellValue()).trim(); |
| | | }else{ |
| | | thirteen = String.valueOf(cell13.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell14 = row.getCell(14); //登录密码[密码长度为6-18] |
| | | String fourteen = null; |
| | | if (SinataUtil.isNotEmpty(cell15)){ |
| | | if(cell15.getCellType().equals(CellType.NUMERIC)){ |
| | | fourteen = String.valueOf(cell15.getNumericCellValue()).trim(); |
| | | if (SinataUtil.isNotEmpty(cell14)){ |
| | | if(cell14.getCellType().equals(CellType.NUMERIC)){ |
| | | fourteen = String.valueOf(cell14.getNumericCellValue()).trim(); |
| | | }else{ |
| | | fourteen = String.valueOf(cell15.getStringCellValue()).trim(); |
| | | fourteen = String.valueOf(cell14.getStringCellValue()).trim(); |
| | | } |
| | | } |
| | | |
| | | Cell cell16 = row.getCell(11); //登录密码[密码长度为6-18] |
| | | String fifteen = null; |
| | | if (SinataUtil.isNotEmpty(cell16)){ |
| | | if(cell16.getCellType().equals(CellType.NUMERIC)){ |
| | | fifteen = String.valueOf(cell16.getNumericCellValue()).trim(); |
| | | }else{ |
| | | 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(ten) |
| | | || 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 (!ten.equals("是") && !ten.equals("否")){ |
| | | if (!Arrays.asList("是", "否").contains(twelve)){ |
| | | 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(ten)){ |
| | | if ("是".equals(twelve)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(3); |