| | |
| | | throw new ServiceException("该企业已存在"); |
| | | } |
| | | //身份证二要素校验 |
| | | Boolean res = aliyunCloudAuthUtil.verifyIdCard(dto.getLegalPersonName(), dto.getIdCardNumber()); |
| | | if (!res) { |
| | | throw new ServiceException("身份证信息不匹配"); |
| | | } |
| | | identityVerification(dto, company, user); |
| | | this.save(company); |
| | | } |
| | | |
| | |
| | | if (Objects.isNull(user)) { |
| | | throw new ServiceException("该企业账号不存在"); |
| | | } |
| | | Long accountCount = userService.lambdaQuery().ne(User::getUserId, user.getUserId()).eq(User::getAccountName, dto.getAccountName()).count(); |
| | | Long accountCount = userService.lambdaQuery() |
| | | .ne(User::getUserId, user.getUserId()) |
| | | .eq(User::getAccountName, dto.getAccountName()) |
| | | .count(); |
| | | if (accountCount > 0) { |
| | | throw new ServiceException("账户名重复"); |
| | | } |
| | |
| | | if (StringUtils.isNotBlank(company.getCompanyName())){ |
| | | Long count = this.lambdaQuery() |
| | | .ne(Company::getId, dto.getId()) |
| | | .eq(Company::getSocialCode, company.getSocialCode()) |
| | | .eq(Company::getCompanyName, dto.getCompanyName()) |
| | | .and(i -> { |
| | | i.eq(Company::getSocialCode, dto.getSocialCode()); |
| | | i.or(); |
| | | i.eq(Company::getCompanyName, dto.getCompanyName()); |
| | | }) |
| | | .count(); |
| | | if (count > 0) { |
| | | throw new ServiceException("该企业已存在"); |
| | | } |
| | | } |
| | | identityVerification(dto, company, user); |
| | | Company companyUpd = BeanUtils.copyBean(dto, Company.class); |
| | | companyUpd.setId(company.getId()); |
| | | this.updateById(companyUpd); |
| | | } |
| | | |
| | | private void identityVerification(MgtCompanyDTO dto, Company company, User user) { |
| | | //身份证二要素校验 |
| | | Boolean res = aliyunCloudAuthUtil.verifyIdCard(dto.getLegalPersonName(), dto.getIdCardNumber()); |
| | | if (!res) { |
| | | throw new ServiceException("身份证信息不匹配"); |
| | | } |
| | | Company companyUpd = BeanUtils.copyBean(dto, Company.class); |
| | | companyUpd.setId(company.getId()); |
| | | this.updateById(companyUpd); |
| | | //营业执照二要素校验 |
| | | res = aliyunCloudAuthUtil.verifyBusinessLicense(dto.getSocialCode(), company.getCompanyName(), user.getUserId()); |
| | | if (!res) { |
| | | throw new ServiceException("营业执照信息不匹配"); |
| | | } |
| | | } |
| | | |
| | | /** |