Przeglądaj źródła

修求职者信息导出

DESKTOP-VAEGFGM\zqc 2 miesięcy temu
rodzic
commit
f4e32acfc0

+ 36 - 3
menduner/menduner-system-biz/src/main/java/com/citu/module/menduner/system/controller/admin/person/PersonInfoController.java

@@ -5,9 +5,12 @@ import com.citu.framework.common.pojo.CommonResult;
 import com.citu.framework.common.pojo.PageParam;
 import com.citu.framework.common.pojo.PageResult;
 import com.citu.framework.common.util.object.BeanUtils;
+import com.citu.framework.dict.core.DictFrameworkUtils;
+import com.citu.framework.excel.core.convert.DictConvert;
 import com.citu.framework.excel.core.util.ExcelUtils;
 import com.citu.framework.security.core.annotations.PreAuthenticated;
 import com.citu.framework.signature.core.annotation.ApiSignature;
+import com.citu.module.menduner.system.controller.admin.person.vo.PersonInfoRespExcelVO;
 import com.citu.module.menduner.system.controller.base.person.PersonMapQueryReqVO;
 import com.citu.module.menduner.system.controller.base.person.PersonQueryReqVO;
 import com.citu.module.menduner.system.controller.base.person.PersonRecommendQueryReqVO;
@@ -20,6 +23,7 @@ import com.citu.module.menduner.system.service.person.info.PersonInfoService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.Parameter;
 import io.swagger.v3.oas.annotations.tags.Tag;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
@@ -45,6 +49,7 @@ public class PersonInfoController {
     @Resource
     private PersonIntegrationService personIntegrationService;
 
+
     @PostMapping("/create")
     @Operation(summary = "创建人才信息-人才档案")
     @PreAuthorize("@ss.hasPermission('menduner:system:person-info:create')")
@@ -100,10 +105,38 @@ public class PersonInfoController {
     public void exportUserInfoExcel(@Valid PersonInfoPageReqVO pageReqVO,
                                     HttpServletResponse response) throws IOException {
         pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
-        List<PersonInfoDO> list = personInfoService.getUserInfoPage(pageReqVO).getList();
+        List<PersonInfoRespExcelVO> list = BeanUtils.toBean(personInfoService.getUserInfoPage(pageReqVO).getList(), PersonInfoRespExcelVO.class);
+        for (PersonInfoRespExcelVO personInfoRespExcelVO : list) {
+            // 替换字典信息
+            if (StringUtils.isNotBlank(personInfoRespExcelVO.getJobType())) {
+                personInfoRespExcelVO.setJobType(DictFrameworkUtils.getDictDataLabel("menduner_job_type", personInfoRespExcelVO.getJobType()));
+            }
+            if (StringUtils.isNotBlank(personInfoRespExcelVO.getJobStatus())) {
+            personInfoRespExcelVO.setJobStatus(DictFrameworkUtils.getDictDataLabel("menduner_job_status", personInfoRespExcelVO.getJobStatus()));
+             }
+            if (StringUtils.isNotBlank(personInfoRespExcelVO.getSex())) {
+                personInfoRespExcelVO.setSex(DictFrameworkUtils.getDictDataLabel("sex", personInfoRespExcelVO.getSex()));
+            }
+            if (StringUtils.isNotBlank(personInfoRespExcelVO.getType())) {
+                personInfoRespExcelVO.setType(DictFrameworkUtils.getDictDataLabel("menduner_user_type",personInfoRespExcelVO.getType()));
+            }
+            if (StringUtils.isNotBlank(personInfoRespExcelVO.getEduType())) {
+                personInfoRespExcelVO.setEduType(DictFrameworkUtils.getDictDataLabel("menduner_education_type", personInfoRespExcelVO.getEduType()));
+            }
+            if (StringUtils.isNotBlank(personInfoRespExcelVO.getExpType())) {
+            personInfoRespExcelVO.setExpType(DictFrameworkUtils.getDictDataLabel("menduner_exp_type", personInfoRespExcelVO.getExpType()));
+            }
+            if(null!=personInfoRespExcelVO.getTagList() && !personInfoRespExcelVO.getTagList().isEmpty()){
+                personInfoRespExcelVO.setTagLists(StringUtils.join(personInfoRespExcelVO.getTagList(),","));
+            }
+            if(null!=personInfoRespExcelVO.getLastWorkExp()){
+                personInfoRespExcelVO.setWorkEnterpriseName(personInfoRespExcelVO.getLastWorkExp().getEnterpriseName());
+                personInfoRespExcelVO.setWorkJob(personInfoRespExcelVO.getLastWorkExp().getPositionName());
+            }
+
+        }
         // 导出 Excel
-        ExcelUtils.write(response, "人才信息-人才档案.xls", "数据", PersonInfoRespVO.class,
-                BeanUtils.toBean(list, PersonInfoRespVO.class));
+        ExcelUtils.write(response, "人才信息-人才档案.xls", "数据", PersonInfoRespExcelVO.class, list);
     }
 
     @GetMapping("/sync/graph")

+ 129 - 0
menduner/menduner-system-biz/src/main/java/com/citu/module/menduner/system/controller/admin/person/vo/PersonInfoRespExcelVO.java

@@ -0,0 +1,129 @@
+package com.citu.module.menduner.system.controller.admin.person.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.citu.module.menduner.system.controller.app.recruit.person.workexp.AppRecruitWorkExpRespVO;
+import com.citu.module.menduner.system.controller.base.area.AreaWebRespVO;
+import com.citu.module.menduner.system.controller.base.position.PositionWebRespVO;
+import com.citu.module.menduner.system.controller.base.workexp.WorkExpRespVO;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+import java.util.List;
+
+@Data
+public class PersonInfoRespExcelVO {
+
+    @Schema(description = "类型(0求职者 1学生)", example = "18804")
+    @ExcelProperty("类型")
+    private String type;
+
+
+
+    @Schema(description = "外文名", example = "mike")
+    @ExcelProperty("外文名")
+    private String foreignName;
+
+    @Schema(description = "真实姓名", example = "王五")
+    @ExcelProperty("真实姓名")
+    private String name;
+
+    @Schema(description = "用户性别")
+    @ExcelProperty("用户性别")
+    private String sex;
+
+    @Schema(description = "头像地址")
+    @ExcelProperty("头像地址")
+    private String avatar;
+
+    @Schema(description = "联系手机号")
+    @ExcelProperty("联系手机号")
+    private String phone;
+
+    @Schema(description = "用户邮箱")
+    @ExcelProperty("用户邮箱")
+    private String email;
+
+    @Schema(description = "微信号")
+    @ExcelProperty("微信号")
+    private String wxCode;
+
+    @Schema(description = "出生日期")
+    @ExcelProperty("出生日期")
+    private LocalDateTime birthday;
+//
+//    @Schema(description = "婚姻状况(0未婚 1已婚 2离异 3暂不透露)", example = "1")
+//    @ExcelProperty("婚姻状况(0未婚 1已婚 2离异 3暂不透露)")
+//    private String maritalStatus;
+//
+//    @Schema(description = "现居住地", example = "8366")
+//    @ExcelProperty("现居住地")
+//    @ExcelIgnore
+//    private Long areaId;
+//
+//    @Schema(description = "户籍地", example = "8366")
+//    @ExcelProperty("户籍地")
+//    @ExcelIgnore
+//    private Long regId;
+
+    @Schema(description = "求职类型(0全职 1兼职 2临时 3实习)", example = "1")
+//    @ExcelProperty("求职类型(0全职 1兼职 2临时 3实习)")
+    @ExcelIgnore
+    private String jobType;
+
+    @Schema(description = "求职状态(0离职-随时到岗 1在职-月内到岗 2在职-考虑机会 3在职-暂不考虑)", example = "1")
+    @ExcelProperty("求职状态(0离职-随时到岗 1在职-月内到岗 2在职-考虑机会 3在职-暂不考虑)")
+    private String jobStatus;
+
+    @Schema(description = "首次工作时间")
+    @ExcelProperty("首次工作时间")
+    private LocalDateTime firstWorkTime;
+
+    @Schema(description = "人才优势")
+    @ExcelProperty("人才优势")
+    private String advantage;
+
+    @Schema(description = "工作经验", example = "1")
+    @ExcelProperty("工作经验")
+    private String expType;
+
+    @Schema(description = "学历", example = "2")
+    @ExcelProperty("学历")
+    private String eduType;
+
+    @Schema(description = "人才标签")
+    @ExcelProperty("人才标签")
+    @ExcelIgnore
+    private List<String> tagList;
+
+    @ExcelProperty("人才标签")
+    private String tagLists;
+
+    @ExcelProperty("任职企业")
+    private String workEnterpriseName;
+
+    @ExcelProperty("任职岗位")
+    private String workJob;
+
+    @Schema(description = "现居住地")
+    @ExcelIgnore
+    private AreaWebRespVO area;
+
+    @Schema(description = "户籍地")
+    @ExcelIgnore
+    private AreaWebRespVO reg;
+
+    @Schema(description = "感兴趣职位信息")
+    @ExcelIgnore
+    private PositionWebRespVO position;
+
+    @Schema(description = "最近工作经历")
+    @ExcelIgnore
+    private WorkExpRespVO lastWorkExp;
+
+    @ExcelIgnore
+    List<AppRecruitWorkExpRespVO> workExpList;
+
+
+}

+ 13 - 1
menduner/menduner-system-biz/src/main/java/com/citu/module/menduner/system/controller/base/person/info/PersonInfoRespVO.java

@@ -1,5 +1,6 @@
 package com.citu.module.menduner.system.controller.base.person.info;
 
+import com.alibaba.excel.annotation.ExcelIgnore;
 import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
 import com.alibaba.excel.annotation.ExcelProperty;
 import com.citu.module.menduner.system.controller.app.recruit.person.workexp.AppRecruitWorkExpRespVO;
@@ -20,6 +21,7 @@ public class PersonInfoRespVO {
 
     @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "25036")
     @ExcelProperty("id")
+    @ExcelIgnore
     private Long id;
 
     @Schema(description = "类型(0求职者 1学生)", example = "18804")
@@ -31,6 +33,7 @@ public class PersonInfoRespVO {
     private Long userId;
 
     @Schema(description = "外文名", example = "mike")
+    @ExcelProperty("外文名")
     private String foreignName;
 
     @Schema(description = "真实姓名", example = "王五")
@@ -67,14 +70,17 @@ public class PersonInfoRespVO {
 
     @Schema(description = "现居住地", example = "8366")
     @ExcelProperty("现居住地")
+    @ExcelIgnore
     private Long areaId;
 
     @Schema(description = "户籍地", example = "8366")
     @ExcelProperty("户籍地")
+    @ExcelIgnore
     private Long regId;
 
     @Schema(description = "求职类型(0全职 1兼职 2临时 3实习)", example = "1")
-    @ExcelProperty("求职类型(0全职 1兼职 2临时 3实习)")
+//    @ExcelProperty("求职类型(0全职 1兼职 2临时 3实习)")
+    @ExcelIgnore
     private String jobType;
 
     @Schema(description = "求职状态(0离职-随时到岗 1在职-月内到岗 2在职-考虑机会 3在职-暂不考虑)", example = "1")
@@ -99,6 +105,7 @@ public class PersonInfoRespVO {
 
     @Schema(description = "人才标签")
     @ExcelProperty("人才标签")
+    @ExcelIgnore
     private List<String> tagList;
 
     @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@@ -110,17 +117,22 @@ public class PersonInfoRespVO {
     private LocalDateTime updateTime;
 
     @Schema(description = "现居住地")
+    @ExcelIgnore
     private AreaWebRespVO area;
 
     @Schema(description = "户籍地")
+    @ExcelIgnore
     private AreaWebRespVO reg;
 
     @Schema(description = "感兴趣职位信息")
+    @ExcelIgnore
     private PositionWebRespVO position;
 
     @Schema(description = "最近工作经历")
+    @ExcelIgnore
     private WorkExpRespVO lastWorkExp;
 
+    @ExcelIgnore
     List<AppRecruitWorkExpRespVO> workExpList;