| | |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.EmployeeUtil; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.UserUtil; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.*; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.DeleteStafNodeRequest; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.QYTUserInfo; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.SaveStaffNode; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.SaveStaffNodeRequest; |
| | | import org.apache.poi.ss.usermodel.Cell; |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | |
| | | |
| | | @Autowired |
| | | private ITLineService itLineService; |
| | | |
| | | @Autowired |
| | | private ITRegionService tRegionService; |
| | | |
| | | @Autowired |
| | | private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; |
| | |
| | | @Autowired |
| | | private IUserService userService; |
| | | |
| | | @Resource |
| | | @Autowired |
| | | private ShiroExtUtil shiroExtUtil; |
| | | |
| | | /** |
| | |
| | | //查询线路列表 |
| | | 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"; |
| | | } |
| | | |
| | |
| | | public String tDriver_look(@PathVariable Integer tDriverId, Model model) { |
| | | Map<String, Object> tDriver = tDriverService.getDriverById(tDriverId); |
| | | model.addAttribute("item",tDriver); |
| | | String placeOfPractice = tDriver.get("placeOfPractice").toString().replaceAll(",", "-"); |
| | | model.addAttribute("placeOfPractice", placeOfPractice); |
| | | Object placeOfPractice1 = tDriver.get("placeOfPractice"); |
| | | if(placeOfPractice1==null){ |
| | | model.addAttribute("placeOfPractice", ""); |
| | | }else { |
| | | model.addAttribute("placeOfPractice", placeOfPractice1.toString().replaceAll(",", "-")); |
| | | } |
| | | LogObjectHolder.me().set(tDriver); |
| | | return PREFIX + "tDriver_look.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"; |
| | | } |
| | | |
| | |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | if (shiroExtUtil.getUser().getRoleType() != 1) { |
| | | page.setRecords(null); |
| | | User user = userService.selectById(shiroExtUtil.getUser().getId()); |
| | | page.setRecords(tDriverService.getAuthDriverList(page, beginTime, endTime, companyName, phone, account, addType, authState, user.getObjectId())); |
| | | } else { |
| | | page.setRecords(tDriverService.getAuthDriverList(page, beginTime, endTime, companyName, phone, account, addType, authState)); |
| | | page.setRecords(tDriverService.getAuthDriverList(page, beginTime, endTime, companyName, phone, account, addType, authState, null)); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | |
| | | @ResponseBody |
| | | public Object authOpt(Integer id,Integer authState) { |
| | | if (SinataUtil.isNotEmpty(id) && SinataUtil.isNotEmpty(authState)){ |
| | | ShiroUser user1 = shiroExtUtil.getUser(); |
| | | User user2 = userService.selectById(user1.getId()); |
| | | TDriver tDriver = tDriverService.selectById(id); |
| | | Integer type = 0; |
| | | if (1 == authState){ |
| | |
| | | System.out.println("司机注册审核发送短信 :【driverId=" + tDriver.getId().toString() + "】,调用接口:" + result); |
| | | //审核通过,在中台添加司机账号 |
| | | if (2 == tDriver.getAuthState()) { |
| | | ShiroUser user = shiroExtUtil.getUser(); |
| | | Integer objectId = user.getObjectId(); |
| | | Integer objectId = tDriver.getCompanyId(); |
| | | TCompany tCompany = itCompanyService.selectById(objectId); |
| | | List<QYTUserInfo> userInfoByPhone = UserUtil.getUserInfoByPhone(tDriver.getPhone(), tCompany.getEnterCode()); |
| | | Long empId = null; |
| | | Integer empnew = null; |
| | | if(null == userInfoByPhone || userInfoByPhone.size() == 0){ |
| | | SaveStaffNodeRequest request = new SaveStaffNodeRequest(); |
| | | request.setMobile(tCompany.getPrincipalPhone()); |
| | | request.setMobile(user2.getPhone()); |
| | | request.setEntercode(tCompany.getEnterCode()); |
| | | request.setEmpName(tDriver.getName()); |
| | | request.setEmpNickname(tDriver.getName()); |
| | |
| | | request.setPositionId(1); |
| | | request.setSuperLevel(0); |
| | | request.setHideMobile(0); |
| | | SaveStaffNode saveStaffNode = EmployeeUtil.saveStaffNode(request); |
| | | ResultUtil<SaveStaffNode> resultUtil = EmployeeUtil.saveStaffNode(request); |
| | | if(200 != resultUtil.getStatus()){ |
| | | return new ErrorTip(resultUtil.getStatus(), resultUtil.getMsg()); |
| | | } |
| | | SaveStaffNode saveStaffNode = resultUtil.getData(); |
| | | empId = saveStaffNode.getEmpId(); |
| | | empnew = 1; |
| | | }else{ |
| | | empId = userInfoByPhone.get(0).getEmpId(); |
| | | empnew = 0; |
| | | } |
| | | TCompany tCompany1 = itCompanyService.selectById(tDriver.getCompanyId()); |
| | | tDriver.setEmpId(empId); |
| | | tDriver.setEntercode(tCompany1.getEnterCode()); |
| | | tDriver.setEnterId(Long.valueOf(tCompany1.getEnterCode())); |
| | | tDriver.setEntercode(tCompany.getEnterCode()); |
| | | tDriver.setEnterId(Long.valueOf(tCompany.getEnterCode())); |
| | | tDriver.setEmpnew(empnew); |
| | | } |
| | | tDriverService.updateById(tDriver); |
| | | } |
| | |
| | | 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)){ |
| | |
| | | tDriver.setInsertTime(new Date()); |
| | | tDriver.setInsertUser(shiroExtUtil.getUser().getId()); |
| | | // tDriver.setPassword(MD5Util.encrypt(tDriver.getPassword())); |
| | | |
| | | tDriver.setAccount(tDriver.getPhone()); |
| | | tDriver.setPassword(ShiroKit.md5(tDriver.getPassword(), "SA;d5#")); |
| | | //审核通过,在中台添加司机账号 |
| | | if (2 == tDriver.getAuthState()) { |
| | | ShiroUser user = shiroExtUtil.getUser(); |
| | | User user2 = userService.selectById(user.getId()); |
| | | Integer objectId = user.getObjectId(); |
| | | TCompany tCompany = itCompanyService.selectById(objectId); |
| | | List<QYTUserInfo> userInfoByPhone = UserUtil.getUserInfoByPhone(tDriver.getPhone(), tCompany.getEnterCode()); |
| | | Long empId = null; |
| | | Integer empnew = null; |
| | | if(null == userInfoByPhone || userInfoByPhone.size() == 0){ |
| | | SaveStaffNodeRequest request = new SaveStaffNodeRequest(); |
| | | request.setMobile(tCompany.getPrincipalPhone()); |
| | | request.setMobile(user2.getPhone()); |
| | | request.setEntercode(tCompany.getEnterCode()); |
| | | request.setEmpName(tDriver.getName()); |
| | | request.setEmpNickname(tDriver.getName()); |
| | |
| | | request.setPositionId(1); |
| | | request.setSuperLevel(0); |
| | | request.setHideMobile(0); |
| | | SaveStaffNode saveStaffNode = EmployeeUtil.saveStaffNode(request); |
| | | ResultUtil<SaveStaffNode> resultUtil = EmployeeUtil.saveStaffNode(request); |
| | | if(200 != resultUtil.getStatus()){ |
| | | return new ErrorTip(resultUtil.getStatus(), resultUtil.getMsg()); |
| | | } |
| | | SaveStaffNode saveStaffNode = resultUtil.getData(); |
| | | empId = saveStaffNode.getEmpId(); |
| | | empnew = 1; |
| | | }else{ |
| | | empId = userInfoByPhone.get(0).getEmpId(); |
| | | empnew = 0; |
| | | } |
| | | |
| | | TCompany tCompany1 = itCompanyService.selectById(tDriver.getCompanyId()); |
| | | tDriver.setEmpId(empId); |
| | | tDriver.setEntercode(tCompany1.getEnterCode()); |
| | | tDriver.setEnterId(Long.valueOf(tCompany1.getEnterCode())); |
| | | tDriver.setEmpnew(empnew); |
| | | } |
| | | tDriverService.insert(tDriver); |
| | | |
| | |
| | | driver.setFlag("3"); |
| | | ShiroUser user = shiroExtUtil.getUser(); |
| | | TCompany tCompany = itCompanyService.selectById(user.getObjectId()); |
| | | if (null != driver.getEmpId()) { |
| | | if (null != driver.getEmpId() && 1 == driver.getEmpnew()) { |
| | | //中台先删除司机 |
| | | GetStaffNodeRequest request = new GetStaffNodeRequest(); |
| | | request.setEmpId(driver.getEmpId()); |
| | | request.setMobile(tCompany.getPrincipalPhone()); |
| | | request.setEntercode(tCompany.getEnterCode()); |
| | | StaffNodeInfo staffNode = EmployeeUtil.getStaffNode(request); |
| | | if (null != staffNode && "1".equals(staffNode.getIsValid())) { |
| | | List<QYTUserInfo> userInfoByPhone = UserUtil.getUserInfoByPhone(driver.getPhone(), tCompany.getEnterCode()); |
| | | if (null != userInfoByPhone && 0 < userInfoByPhone.size() && 1 == driver.getEmpnew()) { |
| | | DeleteStafNodeRequest deleteStafNodeRequest = new DeleteStafNodeRequest(); |
| | | deleteStafNodeRequest.setEmpId(driver.getEmpId()); |
| | | deleteStafNodeRequest.setEntercode(tCompany.getEnterCode()); |
| | | deleteStafNodeRequest.setMobile(tCompany.getPrincipalPhone()); |
| | | EmployeeUtil.ecrmDeleteStafNode(deleteStafNodeRequest); |
| | | ResultUtil resultUtil = EmployeeUtil.ecrmDeleteStafNode(deleteStafNodeRequest); |
| | | if(200 != resultUtil.getStatus()){ |
| | | return new ErrorTip(resultUtil.getStatus(), resultUtil.getMsg()); |
| | | } |
| | | } |
| | | } |
| | | 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 (2 == tDriver.getAuthState() && tDriver.getEmpId() == null) { |
| | | ShiroUser user = shiroExtUtil.getUser(); |
| | | Integer objectId = user.getObjectId(); |
| | | User user2 = userService.selectById(user.getId()); |
| | | Integer objectId = tDriver.getCompanyId(); |
| | | TCompany tCompany = itCompanyService.selectById(objectId); |
| | | List<QYTUserInfo> userInfoByPhone = UserUtil.getUserInfoByPhone(tDriver.getPhone(), tCompany.getEnterCode()); |
| | | Long empId = null; |
| | | Integer empnew = null; |
| | | if(null == userInfoByPhone || userInfoByPhone.size() == 0){ |
| | | SaveStaffNodeRequest request = new SaveStaffNodeRequest(); |
| | | request.setMobile(tCompany.getPrincipalPhone()); |
| | | request.setMobile(user2.getPhone()); |
| | | request.setEntercode(tCompany.getEnterCode()); |
| | | request.setEmpName(tDriver.getName()); |
| | | request.setEmpNickname(tDriver.getName()); |
| | |
| | | request.setPositionId(1); |
| | | request.setSuperLevel(0); |
| | | request.setHideMobile(0); |
| | | SaveStaffNode saveStaffNode = EmployeeUtil.saveStaffNode(request); |
| | | ResultUtil<SaveStaffNode> resultUtil = EmployeeUtil.saveStaffNode(request); |
| | | if(200 != resultUtil.getStatus()){ |
| | | return new ErrorTip(resultUtil.getStatus(), resultUtil.getMsg()); |
| | | } |
| | | SaveStaffNode saveStaffNode = resultUtil.getData(); |
| | | empId = saveStaffNode.getEmpId(); |
| | | empnew = 1; |
| | | }else{ |
| | | empId = userInfoByPhone.get(0).getEmpId(); |
| | | empnew = 0; |
| | | } |
| | | |
| | | TCompany tCompany1 = itCompanyService.selectById(tDriver.getCompanyId()); |
| | | tDriver.setEmpId(empId); |
| | | tDriver.setEntercode(tCompany1.getEnterCode()); |
| | | tDriver.setEnterId(Long.valueOf(tCompany1.getEnterCode())); |
| | | tDriver.setEntercode(tCompany.getEnterCode()); |
| | | tDriver.setEnterId(Long.valueOf(tCompany.getEnterCode())); |
| | | tDriver.setEmpnew(empnew); |
| | | } |
| | | |
| | | tDriverService.updateById(tDriver); |
| | |
| | | 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("经营业务:跨城出行[是/否]"); |
| | | shellList.add("经营业务:小件同城物流[是/否]"); |
| | | shellList.add("经营业务:小件跨城物流[是/否]"); |
| | | shellList.add("经营业务:包车[是/否]"); |
| | | shellList.add("登录账号[手机号]"); |
| | | shellList.add("登录密码[密码长度为6-18]"); |
| | | shellList.add("从业地行政编号"); |
| | | } else if (shiroExtUtil.getUser().getRoleType() == 2) { |
| | | title = "分公司导入司机模板"; |
| | | |
| | |
| | | shellList.add("经营业务:快车[是/否]"); |
| | | shellList.add("经营业务:出租车[是/否]"); |
| | | shellList.add("经营业务:跨城出行[是/否]"); |
| | | shellList.add("经营业务:小件同城物流[是/否]"); |
| | | shellList.add("经营业务:小件跨城物流[是/否]"); |
| | | shellList.add("经营业务:包车[是/否]"); |
| | | shellList.add("登录账号[手机号]"); |
| | | shellList.add("登录密码[密码长度为6-18]"); |
| | | shellList.add("从业地行政编号"); |
| | | } else if (shiroExtUtil.getUser().getRoleType() == 3) { |
| | | title = "加盟商导入司机模板"; |
| | | |
| | |
| | | shellList.add("经营业务:快车[是/否]"); |
| | | shellList.add("经营业务:出租车[是/否]"); |
| | | shellList.add("经营业务:跨城出行[是/否]"); |
| | | shellList.add("经营业务:小件同城物流[是/否]"); |
| | | shellList.add("经营业务:小件跨城物流[是/否]"); |
| | | shellList.add("经营业务:包车[是/否]"); |
| | | shellList.add("登录账号[手机号]"); |
| | | shellList.add("登录密码[密码长度为6-18]"); |
| | | shellList.add("从业地行政编号"); |
| | | } |
| | | dataList.add(shellList); |
| | | |
| | |
| | | @RequestMapping(value="/exportDriver",method = RequestMethod.POST) |
| | | @ResponseBody |
| | | public Object exportDriver(HttpServletRequest request){ |
| | | ShiroUser user = shiroExtUtil.getUser(); |
| | | User user2 = userService.selectById(user.getId()); |
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | | MultipartFile file = (MultipartFile) multipartRequest.getFile("myfile"); |
| | | try { |
| | |
| | | Cell cell0 = row.getCell(0); //司机名称 |
| | | String zero = null; |
| | | if (SinataUtil.isNotEmpty(cell0)) { |
| | | zero = String.valueOf(cell0.getStringCellValue()).trim(); |
| | | int cellType = cell0.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | zero = cell0.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | zero = String.valueOf((long)cell0.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell1 = row.getCell(1); //所属机构[平台司机/加盟司机] |
| | | String one = null; |
| | | if (SinataUtil.isNotEmpty(cell1)) { |
| | | one = String.valueOf(cell1.getStringCellValue()).trim(); |
| | | int cellType = cell1.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | one = cell1.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | one = String.valueOf((long)cell1.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | Cell cell2 = row.getCell(2); //所属分公司[提示:加盟司机选填] |
| | | String two = null; |
| | | if (SinataUtil.isNotEmpty(cell2)) { |
| | | two = String.valueOf(cell2.getStringCellValue()).trim(); |
| | | int cellType = cell2.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | two = cell2.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | two = String.valueOf((long)cell2.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell3 = row.getCell(3); //所属加盟商[提示:加盟司机选填] |
| | | String three = null; |
| | | if (SinataUtil.isNotEmpty(cell3)){ |
| | | three = String.valueOf(cell3.getStringCellValue()).trim(); |
| | | int cellType = cell3.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | three = cell3.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | three = String.valueOf((long)cell3.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell4 = row.getCell(4); //性别[男/女] |
| | | String four = null; |
| | | if (SinataUtil.isNotEmpty(cell4)){ |
| | | four = String.valueOf(cell4.getStringCellValue()).trim(); |
| | | int cellType = cell4.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | four = cell4.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | four = String.valueOf((long)cell4.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell5 = row.getCell(5); //驾驶证号码 |
| | | String five = null; |
| | | if (SinataUtil.isNotEmpty(cell5)){ |
| | | five = String.valueOf(cell5.getStringCellValue()).trim(); |
| | | int cellType = cell5.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | five = cell5.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | five = String.valueOf((long)cell5.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell6 = row.getCell(6); //驾龄 |
| | | String six = null; |
| | | if (SinataUtil.isNotEmpty(cell6)){ |
| | | six = String.valueOf(cell6.getStringCellValue()).trim(); |
| | | int cellType = cell6.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | six = cell6.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | six = String.valueOf((long)cell6.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell7 = row.getCell(7); //身份证号 |
| | | String seven = null; |
| | | if (SinataUtil.isNotEmpty(cell7)){ |
| | | seven = String.valueOf(cell7.getStringCellValue()).trim(); |
| | | int cellType = cell7.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | seven = cell7.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | seven = String.valueOf((long)cell7.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell8 = row.getCell(8); //居住地址 |
| | | String eight = null; |
| | | if (SinataUtil.isNotEmpty(cell8)){ |
| | | eight = String.valueOf(cell8.getStringCellValue()).trim(); |
| | | int cellType = cell8.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | eight = cell8.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | eight = String.valueOf((long)cell8.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell9 = row.getCell(9); //出租车资格证号 |
| | | String nine = null; |
| | | if (SinataUtil.isNotEmpty(cell9)){ |
| | | nine = String.valueOf(cell9.getStringCellValue()).trim(); |
| | | int cellType = cell9.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | nine = cell9.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | nine = String.valueOf((long)cell9.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell10 = row.getCell(10); //工号[选填] |
| | | String ten = null; |
| | | if (SinataUtil.isNotEmpty(cell10)){ |
| | | ten = String.valueOf(cell10.getStringCellValue()).trim(); |
| | | int cellType = cell10.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | ten = cell10.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | ten = String.valueOf((long)cell10.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell11 = row.getCell(11); //经营业务:快车[是/否] |
| | | String eleven = null; |
| | | if (SinataUtil.isNotEmpty(cell11)){ |
| | | eleven = String.valueOf(cell11.getStringCellValue()).trim(); |
| | | int cellType = cell11.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | eleven = cell11.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | eleven = String.valueOf((long)cell11.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell12 = row.getCell(12); //经营业务:快车[是/否] |
| | | String twelve = null; |
| | | if (SinataUtil.isNotEmpty(cell12)){ |
| | | twelve = String.valueOf(cell12.getStringCellValue()).trim(); |
| | | int cellType = cell12.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | twelve = cell12.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | twelve = String.valueOf((long)cell12.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell13 = row.getCell(13); //经营业务:跨城出行[是/否] |
| | | String thirteen = null; |
| | | if (SinataUtil.isNotEmpty(cell13)){ |
| | | thirteen = String.valueOf(cell13.getStringCellValue()).trim(); |
| | | int cellType = cell13.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | thirteen = cell13.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | thirteen = String.valueOf((long)cell13.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell14 = row.getCell(14); //经营业务:小件同城物流[是/否] |
| | | String fourteen = null; |
| | | if (SinataUtil.isNotEmpty(cell14)){ |
| | | 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); //登录账号[手机号] |
| | | Cell cell17 = row.getCell(14); //登录账号[手机号] |
| | | String seventeen = null; |
| | | if (SinataUtil.isNotEmpty(cell17)){ |
| | | seventeen = String.valueOf(cell17.getStringCellValue()).trim(); |
| | | int cellType = cell17.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | seventeen = cell17.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | seventeen = String.valueOf((long)cell17.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell18 = row.getCell(18); //登录密码[密码长度为6-18] |
| | | Cell cell18 = row.getCell(15); //登录密码[密码长度为6-18] |
| | | String eighteen = null; |
| | | if (SinataUtil.isNotEmpty(cell18)){ |
| | | eighteen = String.valueOf(cell18.getStringCellValue()).trim(); |
| | | int cellType = cell18.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | eighteen = cell18.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | eighteen = String.valueOf((long)cell18.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | 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(fourteen) || SinataUtil.isEmpty(fifteen) || SinataUtil.isEmpty(sixteen) |
| | | || 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 (!thirteen.equals("是") && !thirteen.equals("否")){ |
| | | 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 (!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()) { |
| | | ShiroUser user = shiroExtUtil.getUser(); |
| | | Integer objectId = user.getObjectId(); |
| | | Integer objectId = driver.getCompanyId(); |
| | | TCompany tCompany = itCompanyService.selectById(objectId); |
| | | List<QYTUserInfo> userInfoByPhone = UserUtil.getUserInfoByPhone(driver.getPhone(), tCompany.getEnterCode()); |
| | | Long empId = null; |
| | | Integer empnew = null; |
| | | if(null == userInfoByPhone || userInfoByPhone.size() == 0){ |
| | | SaveStaffNodeRequest saveStaffNodeRequest = new SaveStaffNodeRequest(); |
| | | saveStaffNodeRequest.setMobile(tCompany.getPrincipalPhone()); |
| | | saveStaffNodeRequest.setMobile(user2.getPhone()); |
| | | saveStaffNodeRequest.setEntercode(tCompany.getEnterCode()); |
| | | saveStaffNodeRequest.setEmpName(driver.getName()); |
| | | saveStaffNodeRequest.setEmpNickname(driver.getName()); |
| | |
| | | saveStaffNodeRequest.setPositionId(1); |
| | | saveStaffNodeRequest.setSuperLevel(0); |
| | | saveStaffNodeRequest.setHideMobile(0); |
| | | SaveStaffNode saveStaffNode = EmployeeUtil.saveStaffNode(saveStaffNodeRequest); |
| | | ResultUtil<SaveStaffNode> resultUtil = EmployeeUtil.saveStaffNode(saveStaffNodeRequest); |
| | | if(200 != resultUtil.getStatus()){ |
| | | return new ErrorTip(resultUtil.getStatus(), resultUtil.getMsg()); |
| | | } |
| | | SaveStaffNode saveStaffNode = resultUtil.getData(); |
| | | empId = saveStaffNode.getEmpId(); |
| | | empnew = 1; |
| | | }else{ |
| | | empId = userInfoByPhone.get(0).getEmpId(); |
| | | empnew = 0; |
| | | } |
| | | |
| | | TCompany tCompany1 = itCompanyService.selectById(driver.getCompanyId()); |
| | | |
| | | driver.setEmpId(empId); |
| | | driver.setEntercode(tCompany1.getEnterCode()); |
| | | driver.setEnterId(Long.valueOf(tCompany1.getEnterCode())); |
| | | driver.setEntercode(tCompany.getEnterCode()); |
| | | driver.setEnterId(Long.valueOf(tCompany.getEnterCode())); |
| | | driver.setEmpnew(empnew); |
| | | } |
| | | tDriverService.insert(driver); |
| | | |
| | | |
| | | |
| | | |
| | | //添加快车服务模式 |
| | | if ("是".equals(eleven)) { |
| | | TDriverService service = new TDriverService(); |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | } else if (shiroExtUtil.getUser().getRoleType() == 2) { |
| | |
| | | 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(); |
| | | int cellType = cell0.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | zero = cell0.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | zero = String.valueOf((long)cell0.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | Cell cell1 = row.getCell(1); //所属加盟商[选填] |
| | | String one = null; |
| | | if (SinataUtil.isNotEmpty(cell1)) { |
| | | one = String.valueOf(cell1.getStringCellValue()).trim(); |
| | | int cellType = cell1.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | one = cell1.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | one = String.valueOf((long)cell1.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | Cell cell2 = row.getCell(2); //性别[男/女] |
| | | String two = null; |
| | | if (SinataUtil.isNotEmpty(cell2)) { |
| | | two = String.valueOf(cell2.getStringCellValue()).trim(); |
| | | int cellType = cell2.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | two = cell2.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | two = String.valueOf((long)cell2.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell3 = row.getCell(3); //驾驶证号码 |
| | | String three = null; |
| | | if (SinataUtil.isNotEmpty(cell3)){ |
| | | three = String.valueOf(cell3.getStringCellValue()).trim(); |
| | | int cellType = cell3.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | three = cell3.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | three = String.valueOf((long)cell3.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell4 = row.getCell(4); //驾龄 |
| | | String four = null; |
| | | if (SinataUtil.isNotEmpty(cell4)){ |
| | | four = String.valueOf(cell4.getStringCellValue()).trim(); |
| | | int cellType = cell4.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | four = cell4.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | four = String.valueOf((long)cell4.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell5 = row.getCell(5); //身份证号 |
| | | String five = null; |
| | | if (SinataUtil.isNotEmpty(cell5)){ |
| | | five = String.valueOf(cell5.getStringCellValue()).trim(); |
| | | int cellType = cell5.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | five = cell5.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | five = String.valueOf((long)cell5.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell6 = row.getCell(6); //居住地址 |
| | | String six = null; |
| | | if (SinataUtil.isNotEmpty(cell6)){ |
| | | six = String.valueOf(cell6.getStringCellValue()).trim(); |
| | | int cellType = cell6.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | six = cell6.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | six = String.valueOf((long)cell6.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell7 = row.getCell(7); //出租车资格证号 |
| | | String seven = null; |
| | | if (SinataUtil.isNotEmpty(cell7)){ |
| | | seven = String.valueOf(cell7.getStringCellValue()).trim(); |
| | | int cellType = cell7.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | seven = cell7.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | seven = String.valueOf((long)cell7.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell8 = row.getCell(8); //工号[选填] |
| | | String eight = null; |
| | | if (SinataUtil.isNotEmpty(cell8)){ |
| | | eight = String.valueOf(cell8.getStringCellValue()).trim(); |
| | | int cellType = cell8.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | eight = cell8.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | eight = String.valueOf((long)cell8.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell9 = row.getCell(9); //经营业务:快车[是/否] |
| | | String nine = null; |
| | | if (SinataUtil.isNotEmpty(cell9)){ |
| | | nine = String.valueOf(cell9.getStringCellValue()).trim(); |
| | | int cellType = cell9.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | nine = cell9.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | nine = String.valueOf((long)cell9.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell10 = row.getCell(10); //经营业务:出租车[是/否] |
| | | String ten = null; |
| | | if (SinataUtil.isNotEmpty(cell10)){ |
| | | ten = String.valueOf(cell10.getStringCellValue()).trim(); |
| | | int cellType = cell10.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | ten = cell10.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | ten = String.valueOf((long)cell10.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell11 = row.getCell(11); //经营业务:跨城出行[是/否] |
| | | String eleven = null; |
| | | if (SinataUtil.isNotEmpty(cell11)){ |
| | | eleven = String.valueOf(cell11.getStringCellValue()).trim(); |
| | | int cellType = cell11.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | eleven = cell11.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | eleven = String.valueOf((long)cell11.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell12 = row.getCell(12); //经营业务:小件同城物流[是/否] |
| | | String twelve = null; |
| | | if (SinataUtil.isNotEmpty(cell12)){ |
| | | 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 cell14 = row.getCell(14); //经营业务:包车[是/否] |
| | | String fourteen = null; |
| | | if (SinataUtil.isNotEmpty(cell14)){ |
| | | fourteen = String.valueOf(cell14.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell15 = row.getCell(15); //登录账号[手机号] |
| | | Cell cell15 = row.getCell(12); //登录账号[手机号] |
| | | String fifteen = null; |
| | | if (SinataUtil.isNotEmpty(cell15)){ |
| | | fifteen = String.valueOf(cell15.getStringCellValue()).trim(); |
| | | int cellType = cell15.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | fifteen = cell15.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | fifteen = String.valueOf((long)cell15.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell16 = row.getCell(16); //登录密码[密码长度为6-18] |
| | | Cell cell16 = row.getCell(13); //登录密码[密码长度为6-18] |
| | | String sixteen = null; |
| | | if (SinataUtil.isNotEmpty(cell16)){ |
| | | sixteen = String.valueOf(cell16.getStringCellValue()).trim(); |
| | | int cellType = cell16.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | sixteen = cell16.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | sixteen = String.valueOf((long)cell16.getNumericCellValue()).trim(); |
| | | 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(twelve) || SinataUtil.isEmpty(thirteen) |
| | | || SinataUtil.isEmpty(fourteen) || 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 (!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 (!fourteen.equals("是") && !fourteen.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【包车】内容不正确"); |
| | | } |
| | | //判断驾龄 |
| | | if (!isInteger(four)){ |
| | | return new ErrorTip(500, "驾龄格式不正确"); |
| | |
| | | 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); |
| | | } |
| | | //添加小件同城物流服务模式 |
| | | 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); |
| | | 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)) { |
| | | zero = String.valueOf(cell0.getStringCellValue()).trim(); |
| | | int cellType = cell0.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | zero = cell0.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | zero = String.valueOf((long)cell0.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | Cell cell2 = row.getCell(1); //性别[男/女] |
| | | String one = null; |
| | | if (SinataUtil.isNotEmpty(cell2)) { |
| | | one = String.valueOf(cell2.getStringCellValue()).trim(); |
| | | int cellType = cell2.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | one = cell2.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | one = String.valueOf((long)cell2.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | Cell cell3 = row.getCell(2); //驾驶证号码 |
| | | String two = null; |
| | | if (SinataUtil.isNotEmpty(cell3)) { |
| | | two = String.valueOf(cell3.getStringCellValue()).trim(); |
| | | int cellType = cell3.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | two = cell3.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | two = String.valueOf((long)cell3.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell4 = row.getCell(3); //驾龄 |
| | | String three = null; |
| | | if (SinataUtil.isNotEmpty(cell4)){ |
| | | three = String.valueOf(cell4.getStringCellValue()).trim(); |
| | | int cellType = cell4.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | three = cell4.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | three = String.valueOf((long)cell4.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell5 = row.getCell(4); //身份证号 |
| | | String four = null; |
| | | if (SinataUtil.isNotEmpty(cell5)){ |
| | | four = String.valueOf(cell5.getStringCellValue()).trim(); |
| | | int cellType = cell5.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | four = cell5.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | four = String.valueOf((long)cell5.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell6 = row.getCell(5); //居住地址 |
| | | String five = null; |
| | | if (SinataUtil.isNotEmpty(cell6)){ |
| | | five = String.valueOf(cell6.getStringCellValue()).trim(); |
| | | int cellType = cell6.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | five = cell6.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | five = String.valueOf((long)cell6.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell7 = row.getCell(6); //出租车资格证号 |
| | | String six = null; |
| | | if (SinataUtil.isNotEmpty(cell7)){ |
| | | six = String.valueOf(cell7.getStringCellValue()).trim(); |
| | | int cellType = cell7.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | six = cell7.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | six = String.valueOf((long)cell7.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell8 = row.getCell(7); //工号[选填] |
| | | String seven = null; |
| | | if (SinataUtil.isNotEmpty(cell8)){ |
| | | seven = String.valueOf(cell8.getStringCellValue()).trim(); |
| | | int cellType = cell8.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | seven = cell8.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | seven = String.valueOf((long)cell8.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell9 = row.getCell(8); //经营业务:快车[是/否] |
| | | String eight = null; |
| | | if (SinataUtil.isNotEmpty(cell9)){ |
| | | eight = String.valueOf(cell9.getStringCellValue()).trim(); |
| | | int cellType = cell9.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | eight = cell9.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | eight = String.valueOf((long)cell9.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell10 = row.getCell(9); //经营业务:出租车[是/否] |
| | | String nine = null; |
| | | if (SinataUtil.isNotEmpty(cell10)){ |
| | | nine = String.valueOf(cell10.getStringCellValue()).trim(); |
| | | int cellType = cell10.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | nine = cell10.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | nine = String.valueOf((long)cell10.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell11 = row.getCell(10); //经营业务:跨城出行[是/否] |
| | | String ten = null; |
| | | if (SinataUtil.isNotEmpty(cell11)){ |
| | | ten = String.valueOf(cell11.getStringCellValue()).trim(); |
| | | int cellType = cell11.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | ten = cell11.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | ten = String.valueOf((long)cell11.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell12 = row.getCell(11); //经营业务:小件同城物流[是/否] |
| | | String eleven = null; |
| | | if (SinataUtil.isNotEmpty(cell12)){ |
| | | eleven = String.valueOf(cell12.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell13 = row.getCell(12); //经营业务:小件跨城物流[是/否] |
| | | String twelve = null; |
| | | if (SinataUtil.isNotEmpty(cell13)){ |
| | | twelve = String.valueOf(cell13.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell14 = row.getCell(13); //经营业务:包车[是/否] |
| | | String thirteen = null; |
| | | if (SinataUtil.isNotEmpty(cell14)){ |
| | | thirteen = String.valueOf(cell14.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell15 = row.getCell(14); //登录账号[手机号] |
| | | Cell cell15 = row.getCell(11); //登录账号[手机号] |
| | | String fourteen = null; |
| | | if (SinataUtil.isNotEmpty(cell15)){ |
| | | fourteen = String.valueOf(cell15.getStringCellValue()).trim(); |
| | | int cellType = cell15.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | fourteen = cell15.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | fourteen = String.valueOf((long)cell15.getNumericCellValue()).trim(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Cell cell16 = row.getCell(15); //登录密码[密码长度为6-18] |
| | | Cell cell16 = row.getCell(12); //登录密码[密码长度为6-18] |
| | | String fifteen = null; |
| | | if (SinataUtil.isNotEmpty(cell16)){ |
| | | fifteen = String.valueOf(cell16.getStringCellValue()).trim(); |
| | | int cellType = cell16.getCellType(); |
| | | switch (cellType) { |
| | | case Cell.CELL_TYPE_STRING: |
| | | fifteen = cell16.getStringCellValue().trim(); |
| | | break; |
| | | case Cell.CELL_TYPE_NUMERIC: |
| | | fifteen = String.valueOf((long)cell16.getNumericCellValue()).trim(); |
| | | 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(eleven) || SinataUtil.isEmpty(twelve) || SinataUtil.isEmpty(thirteen) |
| | | || 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("女")){ |
| | |
| | | //判断经营业务【跨城出行】 |
| | | if (!ten.equals("是") && !ten.equals("否")){ |
| | | 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)){ |
| | |
| | | driver.setInsertTime(new Date()); |
| | | driver.setAddType(4); |
| | | driver.setAddObjectId(shiroExtUtil.getUser().getObjectId()); |
| | | driver.setPlaceOfEmployment(cell1701); |
| | | if (SinataUtil.isNotEmpty(five)) { |
| | | driver.setDriverAddress(five); |
| | | } |
| | |
| | | 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); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | } |
| | |
| | | * 导出司机信息 |
| | | */ |
| | | @RequestMapping(value = "/outDriver") |
| | | public void outDriver(HttpServletRequest request, HttpServletResponse response) { |
| | | List<Map<String, Object>> listMap = tDriverService.getDriverListNoPage(shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId()); |
| | | public void outDriver(String insertTime, |
| | | String companyName, |
| | | String phone, |
| | | String name, |
| | | Integer addType, |
| | | Integer authState, HttpServletRequest request, HttpServletResponse response) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | if (SinataUtil.isNotEmpty(insertTime)){ |
| | | String[] timeArray = insertTime.split(" - "); |
| | | beginTime = timeArray[0]; |
| | | endTime = timeArray[1]; |
| | | } |
| | | Page<Map<String, Object>> page = new Page<>(0, 10000); |
| | | List<Map<String, Object>> listMap = tDriverService.getDriverList(page, shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), beginTime, endTime, companyName, phone, name, addType, authState); |
| | | |
| | | // 表格数据【封装】 |
| | | List<List<String>> dataList = new ArrayList<>(); |
| | |
| | | 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("-"); |
| | | } |