This commit is contained in:
2025-09-25 11:15:13 +08:00
parent 92e544d5c4
commit ecf5dd2c24
5 changed files with 45 additions and 6 deletions

View File

@@ -68,4 +68,6 @@ public interface ICompanyService
void importLabel();
void importLabelBank();
void register(Company company);
}

View File

@@ -215,4 +215,14 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper,Company> imple
companyLabelMapper.insert(label);
});
}
@Override
public void register(Company company) {
Long userId = SecurityUtils.getUserId();
company.setUserId(userId);
if(companyMapper.selectCount(Wrappers.<Company>lambdaQuery().eq(Company::getName, company.getName()).in(Company::getStatus,Arrays.asList(0,1)))>0){
throw new ServiceException(company.getName()+"已经存在");
}
company.setStatus(0);
}
}