招聘导入模板增加招聘类型下拉框

This commit is contained in:
wkc
2026-05-07 00:13:00 +08:00
parent 402a0c3e2f
commit 4d1acc7484
4 changed files with 70 additions and 0 deletions

View File

@@ -69,6 +69,7 @@ public class CcdiStaffRecruitmentExcel implements Serializable {
/** 招聘类型 */
@ExcelProperty(value = "招聘类型", index = 7)
@ColumnWidth(12)
@DictDropdown(dictType = "ccdi_recruit_type")
@Required
private String recruitType;

View File

@@ -180,6 +180,11 @@ class EasyExcelUtilTemplateTest {
buildDictData("未录用"),
buildDictData("放弃")
));
mocked.when(() -> DictUtils.getDictCache("ccdi_recruit_type"))
.thenReturn(List.of(
buildDictData("社招", "SOCIAL"),
buildDictData("校招", "CAMPUS")
));
EasyExcelUtil.importTemplateWithDictDropdown(
response,
@@ -195,6 +200,8 @@ class EasyExcelUtilTemplateTest {
assertEquals(2, workbook.getNumberOfSheets(), "招聘导入模板应输出双Sheet");
assertEquals("招聘信息", workbook.getSheetAt(0).getSheetName());
assertEquals("历史工作经历", workbook.getSheetAt(1).getSheetName());
assertTrue(hasValidationOnColumn(workbook.getSheetAt(0), 5), "录用情况列应包含下拉校验");
assertTrue(hasValidationOnColumn(workbook.getSheetAt(0), 7), "招聘类型列应包含下拉校验");
}
}
@@ -369,6 +376,8 @@ class EasyExcelUtilTemplateTest {
.thenReturn(List.of(buildDictData("本人")));
mocked.when(() -> DictUtils.getDictCache("ccdi_admit_status"))
.thenReturn(List.of(buildDictData("录用")));
mocked.when(() -> DictUtils.getDictCache("ccdi_recruit_type"))
.thenReturn(List.of(buildDictData("社招", "SOCIAL")));
}
private SysDictData buildDictData(String label) {