|
|
|
@ -12,10 +12,12 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
import org.springblade.system.feign.ISysClient; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import java.util.Comparator; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Optional; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
@ -113,10 +115,10 @@ public class ImsDutyClassServiceImpl extends BaseServiceImpl<ImsDutyClassMapper,
|
|
|
|
|
@Override |
|
|
|
|
public List<DutyClassTypeTree> getDutyClassTree(Long deptId) { |
|
|
|
|
List<DutyClassTypeTree> dutyClassTrees = this.baseMapper.getDutyClassTree(deptId); |
|
|
|
|
dutyClassTrees.forEach(node -> { |
|
|
|
|
node.setName(Optional.ofNullable(sysClient.getDeptName(node.getId())).map(R::getData).orElse(null)); |
|
|
|
|
}); |
|
|
|
|
return dutyClassTrees; |
|
|
|
|
List<DutyClassTypeTree> result = dutyClassTrees.stream().peek(node -> node.setName(Optional.ofNullable(sysClient.getDeptName(node.getId())).map(R::getData).orElse(null))) |
|
|
|
|
.filter(t -> Func.isNotEmpty(t.getName())) |
|
|
|
|
.sorted(Comparator.comparing(DutyClassTypeTree::getName)).collect(Collectors.toList()); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|