update 优化新增流程分类判断

This commit is contained in:
AprilWind 2024-12-17 17:02:13 +08:00
parent 927565c02b
commit e745ccc0cb

View File

@ -192,13 +192,9 @@ public class FlwCategoryServiceImpl implements IFlwCategoryService {
*/ */
@Override @Override
public int insertByBo(FlowCategoryBo bo) { public int insertByBo(FlowCategoryBo bo) {
FlowCategory info = baseMapper.selectById(bo.getParentId());
FlowCategory category = MapstructUtils.convert(bo, FlowCategory.class); FlowCategory category = MapstructUtils.convert(bo, FlowCategory.class);
if(bo.getParentId().intValue()==0) { category.setAncestors(info.getAncestors() + StringUtils.SEPARATOR + category.getParentId());
category.setAncestors(SystemConstants.NORMAL);
}else{
FlowCategory info = baseMapper.selectById(bo.getParentId());
category.setAncestors(info.getAncestors() + StringUtils.SEPARATOR + category.getParentId());
}
return baseMapper.insert(category); return baseMapper.insert(category);
} }