|
|
|
@ -211,7 +211,20 @@ public class BaseMaterialInfoServiceImpl implements IBaseMaterialInfoService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//名称校验
|
|
|
|
|
if (StringUtils.isNotBlank(entity.getMaterialName())) {
|
|
|
|
|
BaseMaterialInfoBo query = new BaseMaterialInfoBo();
|
|
|
|
|
query.setMaterialName(entity.getMaterialName());
|
|
|
|
|
MPJLambdaWrapper<BaseMaterialInfo> lqw = JoinWrappers.lambda(BaseMaterialInfo.class)
|
|
|
|
|
.selectAll(BaseMaterialInfo.class)
|
|
|
|
|
//buildQueryWrapper中getMaterialName是like,相似搜索
|
|
|
|
|
.eq(StringUtils.isNotBlank(query.getMaterialName()), BaseMaterialInfo::getMaterialName, query.getMaterialName());
|
|
|
|
|
BaseMaterialInfo baseMaterialInfo = baseMapper.selectOne(lqw);
|
|
|
|
|
if ( !ObjectUtils.isEmpty(baseMaterialInfo)
|
|
|
|
|
&& !baseMaterialInfo.getMaterialId().equals(entity.getMaterialId())) {
|
|
|
|
|
throw new ServiceException("名称已存在");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|