| | |
| | | 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; |
| | |
| | | @Service |
| | | @AllArgsConstructor |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Slf4j |
| | | public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Department> implements DepartmentService { |
| | | |
| | | DepartmentMapper departmentMapper; |
| | |
| | | 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))); |