| | |
| | | @Override |
| | | public Boolean wxRegister(User user) { |
| | | User params = new User(); |
| | | params.setPhone(user.getPhone()); |
| | | //查看数据库是否有相同手机号 |
| | | params.setCardid(user.getCardid()); |
| | | //查看数据库是否有相同身份证号 |
| | | List<User> list = list(Condition.getQueryWrapper(params)); |
| | | if (list.size()>0){ |
| | | throw new ServiceException("该用户已注册"); |
| | | throw new ServiceException("该身份证号已注册"); |
| | | } |
| | | |
| | | //注册新用户 |
| | |
| | | } |
| | | } |
| | | |
| | | //根据身份证获取用户 |
| | | User userInfoByIdCardNo = baseMapper.getUserInfoByIdCardNo(userExcel.getCardid()); |
| | | //根据身份证、保安证编号获取用户 |
| | | User userInfoByIdCardNo = baseMapper.getUserInfoByIdCardNoAndSecurityNumber(userExcel.getCardid(),userExcel.getSecuritynumber()); |
| | | |
| | | if (!userInfoByIdCardNo.getSecuritynumber().equals( userExcel.getSecuritynumber())){ |
| | | throw new ServiceException("导入失败!保安证编号与系统不匹配!"); |
| | | if (userInfoByIdCardNo == null){ |
| | | throw new ServiceException("导入失败!身份证号和保安证编号与系统不匹配!"); |
| | | } |
| | | |
| | | |
| | | User user = new User(); |
| | | user.setId(userInfoByIdCardNo.getId()); |