修改保存企业信息
This commit is contained in:
@@ -172,13 +172,11 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
|
||||
List<CompanyContact> contactList = company.getCompanyContactList();
|
||||
if (!Objects.isNull(contactList)) {
|
||||
for (CompanyContact x : contactList) {
|
||||
CompanyContact entity = new CompanyContact();
|
||||
entity.setCompanyId(company.getCompanyId());
|
||||
BeanUtils.copyProperties(x, entity);
|
||||
if (entity.getId() != null) {
|
||||
companyContactMapper.updateById(entity);
|
||||
if (x.getId() != null) {
|
||||
companyContactMapper.updateById(x);
|
||||
} else {
|
||||
companyContactMapper.insert(entity);
|
||||
x.setCompanyId(company.getCompanyId());
|
||||
companyContactMapper.insert(x);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user