高校显示 班级名称 班级年级 班主任名称 模糊查询
This commit is contained in:
@@ -29,13 +29,17 @@ public interface SchClassRepository extends JpaRepository<SchClass, Integer>, Jp
|
||||
"AND (:campusId IS NULL OR c.campusId = :campusId) " +
|
||||
"AND (:divisionId IS NULL OR c.divisionId = :divisionId) " +
|
||||
"AND (:majorsId IS NULL OR c.majorsId = :majorsId) " +
|
||||
"AND (:years IS NULL OR c.enrollYear IN :years)"+
|
||||
"AND (:years IS NULL OR c.enrollYear IN :years) " +
|
||||
"AND (:keyword IS NULL OR :keyword = '' " +
|
||||
" OR c.name LIKE CONCAT('%', :keyword, '%') " +
|
||||
" OR c.cname LIKE CONCAT('%', :keyword, '%')) " +
|
||||
"AND c.enrollYear = c.gradeId AND c.graduate = 0")
|
||||
Page<SchClass> findClassesByConditions(@Param("schId") Integer schId,
|
||||
@Param("campusId") Integer campusId,
|
||||
@Param("divisionId") Integer divisionId,
|
||||
@Param("majorsId") Integer majorsId,
|
||||
@Param("years") List<Integer> years,
|
||||
@Param("keyword") String keyword,
|
||||
Pageable pageable);
|
||||
|
||||
boolean existsBySchIdAndGroupIdAndName(Integer schId, Integer groupId, String name);
|
||||
|
||||
@@ -97,8 +97,9 @@ public class SchClassController {
|
||||
@RequestParam(required = false) Integer campusId,
|
||||
@RequestParam(required = false) Integer divisionId,
|
||||
@RequestParam(required = false) Integer majorsId,
|
||||
@RequestParam(required = false) String keyword,
|
||||
Pageable pageable) {
|
||||
return schClassService.searcHigherSchClass(UserContext.getSchId(),year,campusId,divisionId,majorsId,pageable);
|
||||
return schClassService.searcHigherSchClass(UserContext.getSchId(),year,campusId,divisionId,majorsId,keyword,pageable);
|
||||
}
|
||||
|
||||
@PostMapping("saveHigherSchClass")
|
||||
|
||||
+11
@@ -73,6 +73,17 @@ public class SysOperationLogController extends BaseController {
|
||||
.body(new InputStreamResource(bis));
|
||||
}
|
||||
|
||||
/** 查询某条日志的响应原文(GZIP 解压),供详情页伸缩框展示 */
|
||||
@GetMapping("response/{id}")
|
||||
public Map<String, Object> response(@PathVariable Long id) {
|
||||
denyIfNotSuperAdmin();
|
||||
String data = sysOperationLogService.getResponseData(id);
|
||||
Map<String, Object> m = new LinkedHashMap<>();
|
||||
m.put("success", true);
|
||||
m.put("data", data == null ? "该条审计日志未记录响应数据" : data);
|
||||
return m;
|
||||
}
|
||||
|
||||
/** 重试某条失败的操作:按记录中的 classMethod + requestParams 反射重放原始操作 */
|
||||
@PostMapping("retry/{id}")
|
||||
public Map<String, Object> retry(@PathVariable Long id) {
|
||||
|
||||
@@ -49,6 +49,7 @@ public interface ISchClassService {
|
||||
Integer campusId,
|
||||
Integer divisionId,
|
||||
Integer majorsId,
|
||||
String keyword,
|
||||
Pageable pageable);
|
||||
|
||||
void saveHigherSchClass(UserContext.UserInfo user, SchClass entity);
|
||||
|
||||
@@ -91,8 +91,8 @@ public class SchClassService implements ISchClassService {
|
||||
|
||||
@Override
|
||||
public PageVO<HigherSchClassVO> searcHigherSchClass(Integer schId, Integer year, Integer campusId,
|
||||
Integer divisionId, Integer majorsId, Pageable pageable) {
|
||||
return queryService.searcHigherSchClass(schId, year, campusId, divisionId, majorsId, pageable);
|
||||
Integer divisionId, Integer majorsId,String keyword, Pageable pageable) {
|
||||
return queryService.searcHigherSchClass(schId, year, campusId, divisionId, majorsId,keyword, pageable);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+9
-6
@@ -162,12 +162,12 @@ public class SchClassQueryService {
|
||||
|
||||
// ---------- 职业教育查询 ----------
|
||||
public PageVO<HigherSchClassVO> searcHigherSchClass(Integer schId, Integer year, Integer campusId,
|
||||
Integer divisionId, Integer majorsId, Pageable pageable) {
|
||||
Integer divisionId, Integer majorsId,String keyword, Pageable pageable) {
|
||||
List<Integer> years = new ArrayList<>();
|
||||
if (year != null && year > 0) years.add(year);
|
||||
years = years.isEmpty() ? null : years;
|
||||
|
||||
Page<SchClass> classPage = schClassRepository.findClassesByConditions(schId, campusId, divisionId, majorsId, years, pageable);
|
||||
Page<SchClass> classPage = schClassRepository.findClassesByConditions(schId, campusId, divisionId, majorsId, years,keyword, pageable);
|
||||
if (classPage.isEmpty()) {
|
||||
return PageVO.empty(pageable.getPageSize());
|
||||
}
|
||||
@@ -176,9 +176,9 @@ public class SchClassQueryService {
|
||||
Map<Integer, String> campusNameMap = schDicCampusService.toIdAndNameMap(schId);
|
||||
Map<Integer, String> divisionsNameMap = schDicDivisionService.toIdAndNameMap(schId);
|
||||
Map<Integer, String> majorssNameMap = schDicMajorsService.toIdAndNameMap(schId);
|
||||
|
||||
Map<Integer, String> teacherNameMap = schTeacherService.toIdAndNameMap(schId);
|
||||
List<HigherSchClassVO> voList = classList.stream()
|
||||
.map(clazz -> convertHigherSchClassToVO(clazz, campusNameMap, divisionsNameMap, majorssNameMap))
|
||||
.map(clazz -> convertHigherSchClassToVO(clazz, campusNameMap, divisionsNameMap, majorssNameMap,teacherNameMap))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
return new PageVO<>(pageable.getPageNumber() + 1,
|
||||
@@ -190,12 +190,15 @@ public class SchClassQueryService {
|
||||
private HigherSchClassVO convertHigherSchClassToVO(SchClass clazz,
|
||||
Map<Integer, String> campusNameMap,
|
||||
Map<Integer, String> divisionsNameMap,
|
||||
Map<Integer, String> majorssNameMap) {
|
||||
Map<Integer, String> majorssNameMap,
|
||||
Map<Integer, String> teacherNameMap) {
|
||||
HigherSchClassVO vo = ModelMapperUtil.map(clazz, HigherSchClassVO.class);
|
||||
vo.setCampusName(campusNameMap.get(clazz.getCampusId()));
|
||||
vo.setDivisionName(divisionsNameMap.get(clazz.getDivisionId()));
|
||||
vo.setMajorsName(majorssNameMap.get(clazz.getMajorsId()));
|
||||
vo.setFirstTeacherName(null);
|
||||
vo.setGradeName(vo.getGradeId()+"级");
|
||||
vo.setFirstTeacherName(teacherNameMap.get(clazz.getFirstTeacherId()));
|
||||
|
||||
vo.setSecondTeacherName(null);
|
||||
return vo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user