| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 司机审核列表控制器 |
| | |
| | | User user2 = userService.selectById(user.getId()); |
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | | MultipartFile file = (MultipartFile) multipartRequest.getFile("myfile"); |
| | | List<String> drivers = new ArrayList<>(); |
| | | try { |
| | | if (shiroExtUtil.getUser().getRoleType() == 1) { |
| | | Workbook book = WoUtil.ImportFile(file); |
| | |
| | | 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", seventeen).in("authState", Arrays.asList(1,2,3)).ne("flag", 3)); |
| | | if (count > 0){ |
| | | continue; |
| | | } |
| | | Boolean b = UserUtil.idCardAuth(zero, seven); |
| | | if(!b){ |
| | | return new ErrorTip(500, "司机姓名和身份证号不匹配"); |
| | | drivers.add(zero); |
| | | continue; |
| | | } |
| | | //判断所属机构 |
| | | if (!one.equals("平台司机") && !one.equals("加盟司机")){ |
| | |
| | | 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", fifteen).in("authState", Arrays.asList(1,2,3)).ne("flag", 3)); |
| | | if (count > 0){ |
| | | continue; |
| | | } |
| | | |
| | | Boolean b = UserUtil.idCardAuth(zero, five); |
| | | if(!b){ |
| | | return new ErrorTip(500, "司机姓名和身份证号不匹配"); |
| | | drivers.add(zero); |
| | | continue; |
| | | } |
| | | //判断性别 |
| | | if (!two.equals("男") && !two.equals("女")){ |
| | |
| | | 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", fourteen).in("authState", Arrays.asList(1,2,3)).ne("flag", 3)); |
| | | if (count > 0){ |
| | | continue; |
| | | } |
| | | Boolean b = UserUtil.idCardAuth(zero, four); |
| | | if(!b){ |
| | | return new ErrorTip(500, "司机姓名和身份证号不匹配"); |
| | | drivers.add(zero); |
| | | continue; |
| | | } |
| | | //判断性别 |
| | | if (!one.equals("男") && !one.equals("女")){ |
| | |
| | | } |
| | | } |
| | | } |
| | | if(drivers.size() > 0){ |
| | | return new ErrorTip(500, "司机姓名和身份证号不匹配【" + drivers.stream().collect(Collectors.joining(",")).toString() + "】"); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |