提交 b346f14b 作者: 贺晋豫

人物 导入导出接口修改、新增模板下载接口

上级 f56fb9ae
......@@ -214,14 +214,14 @@ public class CharacterBasicInfoController {
}
@PostMapping("/exportExcel")
public ResponseEntity<byte[]> exportExcel(@RequestBody BasicInfoListVo basicInfoListVo,@RequestParam String category) {
basicInfoListVo.setCategory(category);
public ResponseEntity<byte[]> exportExcel(@RequestBody BasicInfoListVo basicInfoListVo) {
String category = basicInfoListVo.getCategory();
basicInfoListVo.setColumn(SortUtil.humpToLine(basicInfoListVo.getColumn()));
List<CharacterBasicInfo> list = characterBasicInfoService.getAllList(basicInfoListVo);
Map<String, String> importFieldMap = getImportFieldMap(category);
ResponseEntity<byte[]> responseEntity;
try {
responseEntity = characterBasicInfoService.exportExcel(list,importFieldMap);
responseEntity = characterBasicInfoService.exportExcel(category,list,importFieldMap);
} catch (IOException e) {
throw new RuntimeException(e);
}
......@@ -233,7 +233,19 @@ public class CharacterBasicInfoController {
Map<String, String> importFieldMap = getImportFieldMap(category);
ResponseEntity<byte[]> responseEntity;
try {
responseEntity = characterBasicInfoService.exportExcelByIds(ids,importFieldMap);
responseEntity = characterBasicInfoService.exportExcelByIds(category,ids,importFieldMap);
} catch (IOException e) {
throw new RuntimeException(e);
}
return responseEntity;
}
@GetMapping("/exportTemplate")
public ResponseEntity<byte[]> exportTemplate(@RequestParam String category) {
Map<String, String> importFieldMap = getImportFieldMap(category);
ResponseEntity<byte[]> responseEntity;
try {
responseEntity = characterBasicInfoService.exportTemplate(importFieldMap);
} catch (IOException e) {
throw new RuntimeException(e);
}
......@@ -266,20 +278,11 @@ public class CharacterBasicInfoController {
importFieldMap1.put("出生年月", "birthday");
importFieldMap1.put("籍贯", "nativePlace");
importFieldMap1.put("毕业院校", "school");
importFieldMap1.put("毕业专业", "schoolSpeciality");
importFieldMap1.put("学历", "education");
importFieldMap1.put("单位名称", "department");
importFieldMap1.put("所在部门", "depart");
importFieldMap1.put("职务", "duty");
importFieldMap1.put("任职开始时间", "takeOfficeTime");
importFieldMap1.put("任职结束时间", "takeOfficeTimeEnd");
importFieldMap1.put("顶尖专家/领军专家", "expertType");
importFieldMap1.put("研究领域", "researchField");
importFieldMap1.put("专业方向", "speciality");
importFieldMap1.put("已入选的人才计划", "talentPlanning");
importFieldMap1.put("专业技术职称", "technicalTitles");
importFieldMap1.put("专业技术职称取得时间", "technicalDate");
importFieldMap1.put("参加工作时间", "workDate");
importFieldMap1.put("分类", "typeId");
}
......@@ -315,19 +318,12 @@ public class CharacterBasicInfoController {
importFieldMap3.put("性别", "sex");
importFieldMap3.put("出生年月", "birthday");
importFieldMap3.put("籍贯", "nativePlace");
importFieldMap3.put("毕业专业", "schoolSpeciality");
importFieldMap3.put("毕业院校", "school");
importFieldMap3.put("学历", "education");
importFieldMap3.put("单位名称", "department");
importFieldMap3.put("所在部门", "depart");
importFieldMap3.put("职务", "duty");
importFieldMap3.put("任职开始时间", "takeOfficeTime");
importFieldMap3.put("任职结束时间", "takeOfficeTimeEnd");
importFieldMap3.put("顶尖专家/领军专家", "expertType");
importFieldMap3.put("研究领域", "researchField");
importFieldMap3.put("已入选的人才计划", "talentPlanning");
importFieldMap3.put("专业技术职称", "technicalTitles");
importFieldMap3.put("专业技术职称取得时间", "technicalDate");
importFieldMap3.put("参加工作时间", "workDate");
importFieldMap3.put("分类", "typeId");
}
}
......
......@@ -58,13 +58,15 @@ public interface CharacterBasicInfoService extends IService<CharacterBasicInfo>
List<CharacterBasicInfo> getAllList(BasicInfoListVo basicInfoListVo);
CharacterBasicInfo getBasicInfoByUid(String uid);
CharacterBasicInfo getBasicInfoByUid(String uid, String department, String basicInfoDepartment);
CharacterBasicInfo getByNameAndByDepartment(String category, String typeId, String name, String department);
String importExcel(String absolutePath, String category, Map<String, String> importFieldMap);
ResponseEntity<byte[]> exportExcel(List<CharacterBasicInfo> list, Map<String, String> importFieldMap) throws IOException;
ResponseEntity<byte[]> exportExcel(String category, List<CharacterBasicInfo> list, Map<String, String> importFieldMap) throws IOException;
ResponseEntity<byte[]> exportExcelByIds(String ids, Map<String, String> importFieldMap) throws IOException;
ResponseEntity<byte[]> exportExcelByIds(String category, String ids, Map<String, String> importFieldMap) throws IOException;
ResponseEntity<byte[]> exportTemplate(Map<String, String> importFieldMap) throws IOException;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论