byId = new HashMap<>();
+ for (StudentListEchoVO echo : echos) {
+ if (echo != null && echo.getBh() != null) {
+ byId.put(echo.getBh(), echo);
+ }
+ }
+ for (XYXX row : records) {
+ StudentListEchoVO echo = byId.get(row.getBh());
+ if (echo == null) {
+ continue;
+ }
+ row.setNj(echo.getNj());
+ row.setZy(echo.getZy());
+ row.setBc(echo.getBc());
+ row.setKsqk(echo.getKsqk());
+ row.setBjgms(echo.getBjgms() == null ? 0 : echo.getBjgms());
+ row.setGljg(echo.getGljg());
+ }
+ }
+
/**
* 全字段动态查询条件。
*
@@ -135,6 +291,10 @@ public class StudentRecordsServiceImpl implements StudentRecordsService {
// 需要模糊匹配的字段(属性名)
Set fuzzyFields = Set.of("xm", "lxdh", "txdz");
for (Field field : XYXX.class.getDeclaredFields()) {
+ TableField tableField = field.getAnnotation(TableField.class);
+ if (tableField != null && !tableField.exist()) {
+ continue;
+ }
Object value = getFieldValue(field, query);
if (value == null || !(value instanceof String) || ((String) value).isEmpty()) {
continue;
@@ -191,13 +351,14 @@ public class StudentRecordsServiceImpl implements StudentRecordsService {
// ========== 学员课程成绩查询 ==========
@Override
- public PageResult pageCourseGrades(PageQuery query, String xybh, Integer nd) {
- String studentId = xybh;
+ public PageResult pageCourseGrades(PageQuery query, String kcbh, String xydbh, String xh, Integer nd) {
+ String selfStudentId = null;
if (jwglRoleHelper.isStudent()) {
- studentId = jwglRoleHelper.requireStudentId();
+ selfStudentId = jwglRoleHelper.requireStudentId();
}
Page page = new Page<>(query.getPageNum(), query.getPageSize());
- Page result = xykccjMapper.selectPageByCondition(page, studentId, nd);
+ Page result = xykccjMapper.selectPageByCondition(
+ page, trimToNull(kcbh), trimToNull(xydbh), trimToNull(xh), nd, selfStudentId);
return new PageResult<>(result.getRecords(), result.getTotal(),
query.getPageNum(), query.getPageSize());
}
@@ -387,6 +548,7 @@ public class StudentRecordsServiceImpl implements StudentRecordsService {
@Transactional
public void addApplication(XYXJYDSQB entity) {
LocalDateTime now = LocalDateTime.now();
+ entity.setBh(UuidUtil.getUUID());
entity.setCjsj(now);
entity.setXgsj(now);
// 状态默认待审核(0)
@@ -668,7 +830,24 @@ public class StudentRecordsServiceImpl implements StudentRecordsService {
return list.size();
}
+ @Override
+ public List listTrainingTasks(Integer ztpxrw) {
+ if (ztpxrw == null || (ztpxrw != 0 && ztpxrw != 1)) {
+ throw new ServiceException("主体培训任务只能为 0 或 1");
+ }
+ List list = pxrwMapper.selectByZtpxrw(ztpxrw);
+ return list == null ? new ArrayList<>() : list;
+ }
+
private String nvl(String value) {
return value == null ? "" : value;
}
+
+ private String trimToNull(String value) {
+ if (value == null) {
+ return null;
+ }
+ String text = value.trim();
+ return text.isEmpty() ? null : text;
+ }
}
diff --git a/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/service/impl/ZYJXJHBServiceImpl.java b/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/service/impl/ZYJXJHBServiceImpl.java
index 9ee21f51..9886daff 100644
--- a/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/service/impl/ZYJXJHBServiceImpl.java
+++ b/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/service/impl/ZYJXJHBServiceImpl.java
@@ -2,9 +2,12 @@ package com.roomroot.jwgl.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.roomroot.jwgl.entity.ZYJXJHB;
import com.roomroot.jwgl.mapper.ZYJXJHBMapper;
import com.roomroot.jwgl.service.ZYJXJHBService;
+import com.roomroot.jwgl.unit.PageQuery;
+import com.roomroot.jwgl.unit.PageResult;
import com.roomroot.jwgl.utils.UuidUtil;
import org.springframework.stereotype.Service;
@@ -65,11 +68,19 @@ public class ZYJXJHBServiceImpl implements ZYJXJHBService {
}
@Override
- public List listByZydhAndTy(String zydh, Integer ty) {
+ public PageResult pageByZydhAndTy(PageQuery query, String zydh, Integer ty) {
+ Page page = new Page<>(query.getPageNum(), query.getPageSize());
LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>();
- wrapper.eq(ZYJXJHB::getZydh, zydh)
- .eq(ZYJXJHB::getTy, ty);
- return zyjxjhbMapper.selectList(wrapper);
+ if (zydh != null && !zydh.isEmpty()) {
+ wrapper.eq(ZYJXJHB::getZydh, zydh);
+ }
+ if (ty != null) {
+ wrapper.eq(ZYJXJHB::getTy, ty);
+ }
+ wrapper.orderByAsc(ZYJXJHB::getZydh);
+ Page result = zyjxjhbMapper.selectPage(page, wrapper);
+ return new PageResult<>(result.getRecords(), result.getTotal(),
+ query.getPageNum(), query.getPageSize());
}
@Override
diff --git a/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/vo/StudentListEchoVO.java b/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/vo/StudentListEchoVO.java
new file mode 100644
index 00000000..703a8e0b
--- /dev/null
+++ b/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/vo/StudentListEchoVO.java
@@ -0,0 +1,31 @@
+package com.roomroot.jwgl.vo;
+
+import lombok.Data;
+
+/**
+ * 学员列表回显字段:年级、专业、班次、考试情况、不及格门数、管理机构。
+ */
+@Data
+public class StudentListEchoVO {
+
+ /** 学员编号 */
+ private String bh;
+
+ /** 年级 */
+ private String nj;
+
+ /** 专业 */
+ private String zy;
+
+ /** 班次 */
+ private String bc;
+
+ /** 考试情况 */
+ private String ksqk;
+
+ /** 不及格门数 */
+ private Integer bjgms;
+
+ /** 管理机构 */
+ private String gljg;
+}