优化多属性模块

This commit is contained in:
季圣华
2021-07-23 00:16:44 +08:00
parent 8ca5c9bf06
commit c7d1ea4e87
2 changed files with 10 additions and 1 deletions

View File

@@ -74,6 +74,7 @@ public class MaterialAttributeService {
materialAttribute.setAttributeName(map.get(field));
for(MaterialAttribute ma: maList) {
if(field.equals(ma.getAttributeField())){
materialAttribute.setId(ma.getId());
materialAttribute.setAttributeName(ma.getAttributeName());
materialAttribute.setAttributeValue(ma.getAttributeValue());
}

View File

@@ -222,7 +222,15 @@ public class MaterialCategoryService {
}
public int checkIsNameExist(Long id, String name)throws Exception {
return 0;
MaterialCategoryExample example = new MaterialCategoryExample();
example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<MaterialCategory> list=null;
try{
list= materialCategoryMapper.selectByExample(example);
}catch(Exception e){
JshException.readFail(logger, e);
}
return list==null?0:list.size();
}
public List<MaterialCategory> findById(Long id)throws Exception {