mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-12-22 18:29:51 +08:00
增加部门删选核查api
This commit is contained in:
@@ -38,4 +38,6 @@ public interface CourseService extends IService<Course> {
|
||||
void updateClassHour(Integer courseId, Integer classHour);
|
||||
|
||||
void removeCategoryIdRelate(Integer categoryId);
|
||||
|
||||
List<Course> chunks(List<Integer> ids, List<String> fields);
|
||||
}
|
||||
|
||||
@@ -33,4 +33,8 @@ public interface DepartmentService extends IService<Department> {
|
||||
|
||||
void remoteRelateUsersByDepId(Integer depId);
|
||||
|
||||
List<Integer> getUserIdsByDepId(Integer depId);
|
||||
|
||||
List<Integer> getCourseIdsByDepId(Integer depId);
|
||||
|
||||
}
|
||||
|
||||
@@ -36,4 +36,6 @@ public interface UserService extends IService<User> {
|
||||
List<Integer> getDepIdsByUserId(Integer userId);
|
||||
|
||||
void passwordChange(User user, String oldPassword, String newPassword) throws ServiceException;
|
||||
|
||||
List<User> chunks(List<Integer> ids, List<String> fields);
|
||||
}
|
||||
|
||||
@@ -193,6 +193,11 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
|
||||
public void removeCategoryIdRelate(Integer categoryId) {
|
||||
courseCategoryService.removeByCategoryId(categoryId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Course> chunks(List<Integer> ids, List<String> fields) {
|
||||
return list(query().getWrapper().in("id", ids).select(fields));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,9 +5,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import xyz.playedu.api.domain.CourseDepartment;
|
||||
import xyz.playedu.api.domain.Department;
|
||||
import xyz.playedu.api.domain.UserDepartment;
|
||||
import xyz.playedu.api.exception.NotFoundException;
|
||||
import xyz.playedu.api.service.CourseDepartmentService;
|
||||
import xyz.playedu.api.service.DepartmentService;
|
||||
import xyz.playedu.api.mapper.DepartmentMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -29,6 +31,9 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
|
||||
@Autowired
|
||||
private UserDepartmentService userDepartmentService;
|
||||
|
||||
@Autowired
|
||||
private CourseDepartmentService courseDepartmentService;
|
||||
|
||||
@Override
|
||||
public List<Department> listByParentId(Integer id) {
|
||||
return list(query().getWrapper().eq("parent_id", id).orderByAsc("sort"));
|
||||
@@ -176,6 +181,16 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
|
||||
QueryWrapper<UserDepartment> wrapper = userDepartmentService.query().getWrapper().eq("dep_id", depId);
|
||||
userDepartmentService.remove(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Integer> getUserIdsByDepId(Integer depId) {
|
||||
return userDepartmentService.list(userDepartmentService.query().getWrapper().eq("dep_id", depId)).stream().map(UserDepartment::getUserId).toList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Integer> getCourseIdsByDepId(Integer depId) {
|
||||
return courseDepartmentService.list(courseDepartmentService.query().getWrapper().eq("dep_id", depId)).stream().map(CourseDepartment::getCourseId).toList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -215,6 +215,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
||||
setPassword(HelperUtil.MD5(newPassword + user.getSalt()));
|
||||
}});
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<User> chunks(List<Integer> ids, List<String> fields) {
|
||||
return list(query().getWrapper().in("id", ids).select(fields));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user