|
@@ -112,13 +112,13 @@ public class BizCompanyServiceImpl extends ServiceImpl<BizCompanyMapper, BizCom
|
|
|
@Override
|
|
|
public boolean save(BizCompany company) {
|
|
|
// 判断客户名是否重复
|
|
|
- if(this.query().eq("name", company.getName()).ne("id", company.getId() == null ? 0L :company.getId()).count() > 0) throw new ServiceException("客户名称重复", HttpStatus.ERROR);
|
|
|
+ if(this.query().eq("tenant_id",company.getTenantId()).eq("name", company.getName()).ne("id", company.getId() == null ? 0L :company.getId()).count() > 0) throw new ServiceException("客户名称重复", HttpStatus.ERROR);
|
|
|
AtomicBoolean res = new AtomicBoolean(super.save(company));
|
|
|
return res.get();
|
|
|
}
|
|
|
@Override
|
|
|
public boolean updateById(BizCompany company) {
|
|
|
- if(this.query().eq("name", company.getName()).ne("id", company.getId() == null ? 0L :company.getId()).count() > 0) throw new ServiceException("客户名称重复", HttpStatus.ERROR);
|
|
|
+ if(this.query().eq("tenant_id",company.getTenantId()).eq("name", company.getName()).ne("id", company.getId() == null ? 0L :company.getId()).count() > 0) throw new ServiceException("客户名称重复", HttpStatus.ERROR);
|
|
|
AtomicBoolean res = new AtomicBoolean(super.updateById(company));
|
|
|
return res.get();
|
|
|
}
|