1、停用教员的同时禁用该教员的账号;
2、教员导入的时候,如果有错误,跳过并返回具体报错行; 3、教研室接口权限添加控制
This commit is contained in:
@@ -5,6 +5,7 @@ import com.roomroot.jwgl.dto.courserunning.SemesterImportDTO;
|
||||
import com.roomroot.jwgl.dto.courserunning.SingleCourseImportDTO;
|
||||
import com.roomroot.jwgl.dto.departmentpersonnel.DepartmentPersonnelCreateDTO;
|
||||
import com.roomroot.jwgl.dto.discipline.MajorImportRowDTO;
|
||||
import com.roomroot.jwgl.dto.faculty.TeacherImportRowDTO;
|
||||
import com.roomroot.jwgl.entity.JXSSJH;
|
||||
import com.roomroot.jwgl.entity.JYB;
|
||||
import com.roomroot.jwgl.entity.JYSB;
|
||||
@@ -401,8 +402,8 @@ public class ExcelParseUtil {
|
||||
* @return 教员实体列表(离职状态由业务层默认填充)
|
||||
* @throws Exception 解析异常
|
||||
*/
|
||||
public static List<JYB> parseJYBExcel(InputStream inputStream, String fileName) throws Exception {
|
||||
List<JYB> result = new ArrayList<>();
|
||||
public static List<TeacherImportRowDTO> parseJYBExcel(InputStream inputStream, String fileName) throws Exception {
|
||||
List<TeacherImportRowDTO> result = new ArrayList<>();
|
||||
Workbook workbook = createWorkbook(inputStream, fileName);
|
||||
try {
|
||||
Sheet sheet = workbook.getSheetAt(0);
|
||||
@@ -425,10 +426,14 @@ public class ExcelParseUtil {
|
||||
entity.setBz(getCellStringValue(row.getCell(9)));
|
||||
entity.setXh(getCellStringValue(row.getCell(10)));
|
||||
entity.setXslx(parseIntCell(row.getCell(11)));
|
||||
// 至少要有姓名才视为有效行
|
||||
if (entity.getJyxm() != null && !entity.getJyxm().isEmpty()) {
|
||||
result.add(entity);
|
||||
// 整行全空的跳过;有任何字段即保留,由业务层逐行校验并聚合报错
|
||||
if (isAllBlank(entity.getJybh(), entity.getJyxm(), entity.getJysdh(),
|
||||
entity.getZc(), entity.getZyjszwdj(), entity.getJylb(),
|
||||
entity.getSjh(), entity.getSfzh(), entity.getBz(), entity.getXh())
|
||||
&& entity.getXb() == null && entity.getXslx() == null) {
|
||||
continue;
|
||||
}
|
||||
result.add(new TeacherImportRowDTO(rowNum + 1, entity));
|
||||
}
|
||||
} finally {
|
||||
workbook.close();
|
||||
@@ -436,6 +441,15 @@ public class ExcelParseUtil {
|
||||
return result;
|
||||
}
|
||||
|
||||
private static boolean isAllBlank(String... values) {
|
||||
for (String v : values) {
|
||||
if (v != null && !v.trim().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析培养方案(专业表)导入 Excel 文件(支持 .xls / .xlsx)。
|
||||
* <p>表头顺序:</p>
|
||||
|
||||
Reference in New Issue
Block a user