添加公司时用公司名称去重
This commit is contained in:
parent
d18402ba2e
commit
6f258e06e4
@ -305,6 +305,19 @@ public class PsCompanyInfoServiceImpl implements IPsCompanyInfoService {
|
|||||||
//新增时公司类型默认为签约公司
|
//新增时公司类型默认为签约公司
|
||||||
add.setCompanyType(add.getId() == null && StringUtils.isBlank(add.getCompanyType()) ? "1" : add.getCompanyType());
|
add.setCompanyType(add.getId() == null && StringUtils.isBlank(add.getCompanyType()) ? "1" : add.getCompanyType());
|
||||||
validEntityBeforeSave(add);
|
validEntityBeforeSave(add);
|
||||||
|
|
||||||
|
if (add.getId() == null){
|
||||||
|
QueryWrapper queryWrapper = new QueryWrapper();
|
||||||
|
queryWrapper.eq("company_name", add.getCompanyName());
|
||||||
|
queryWrapper.eq("company_type", add.getCompanyType());
|
||||||
|
List<PsCompanyInfo> list = baseMapper.selectList(queryWrapper);
|
||||||
|
if (!list.isEmpty()){
|
||||||
|
add.setId(list.get(0).getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
boolean flag = baseMapper.insertOrUpdate(add);
|
boolean flag = baseMapper.insertOrUpdate(add);
|
||||||
if (flag) {
|
if (flag) {
|
||||||
bo.setId(add.getId());
|
bo.setId(add.getId());
|
||||||
|
Loading…
Reference in New Issue
Block a user