|
|
@@ -42,14 +42,25 @@ public class AmbServiceImpl extends BaseMybatisDao<AmbSystemMapper> implements A
|
|
|
|
|
|
@Override
|
|
|
public int updateAmb(InputAmb in) {
|
|
|
- if (in.getParentId()!=null){
|
|
|
+ AmbSystem use = ambSystemMapper.selectByPrimaryKey(in.getId());
|
|
|
+ int i=0;
|
|
|
+ if (in.getParentId()!=use.getParentId()){
|
|
|
getParentParam(in);
|
|
|
+ i=updateAncestorsNames(in,use.getName(),i);
|
|
|
+ }
|
|
|
+ if (!in.getName().equals(use.getName())){
|
|
|
+ i=updateAncestorsNames(in,use.getName(),i);
|
|
|
}
|
|
|
in.setUpdateBy(TokenManager.getAdminId());
|
|
|
in.setUpdateTime(new Date());
|
|
|
return ambSystemMapper.updateByPrimaryKeySelective(in);
|
|
|
}
|
|
|
|
|
|
+ private int updateAncestorsNames(InputAmb in,String useName,Integer i) {
|
|
|
+ if (i>0)return i;
|
|
|
+ return ambSystemMapper.updateAncestorsNames(in.getId(),in.getName(),useName);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public Pagination<OutAmb> selectAmb(InputAmb in) {
|
|
|
HashMap<String, Object> param = new HashMap<>();
|