zss
2024-04-17 ad5fa78540fdd7b5470072e0ead2b650afdca2fd
cnas-server/src/main/java/com/yuanchu/mom/service/impl/DepartmentServiceImpl.java
@@ -15,6 +15,7 @@
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.mom.utils.QueryWrappers;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import lombok.var;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -40,6 +41,7 @@
@Service
@AllArgsConstructor
@Transactional(rollbackFor = Exception.class)
@Slf4j
public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Department> implements DepartmentService {
    DepartmentMapper departmentMapper;
@@ -90,9 +92,11 @@
    public Map<String, Object> showUserById(Page page, UserDto user) {
        //根据部门id,查询他的所有子类id
        List<Integer> list = departmentMapper.selectSonById(Integer.parseInt(user.getDepartId()));
        String ids = list.stream()
        List<String> ids = list.stream()
                .map(Object::toString)
                .collect(Collectors.joining(","));
                //.collect(Collectors.joining(","));
                .collect(Collectors.toList());
        log.info(ids+"\n");
        Map<String, Object> map = new HashMap<>();
        map.put("head", PrintChina.printChina(UserDto.class));
        map.put("body", departmentMapper.showUserById(page, ids, QueryWrappers.queryWrappers(user)));