com.github.rexsheng.springboot.faster.system.user.domain.DeptDomainService Maven / Gradle / Ivy
The newest version!
package com.github.rexsheng.springboot.faster.system.user.domain;
import com.github.rexsheng.springboot.faster.system.dept.application.DeptService;
import jakarta.annotation.Resource;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@Service("userDept")
@ConditionalOnClass(SqlSessionFactoryBean.class)
public class DeptDomainService {
@Resource
private DeptService deptService;
public List queryDeptAndChildrenIds(Integer deptId){
if(deptId==null){
return new ArrayList<>();
}
return deptService.queryWithChildren(deptId).stream().map(a->a.getDeptId()).collect(Collectors.toList());
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy