Procházet zdrojové kódy

入职-导出数据添加教育经历相关字段

huangguoce před 5 dny
rodič
revize
571c531455

+ 55 - 0
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/enrollment/enrollmentRegistration/controller/EnrollmentRegistrationController.java

@@ -59,6 +59,9 @@ public class EnrollmentRegistrationController {
     private EnrollmentRegistrationService service;
 
     @Resource
+    private EnrollmentEduInfoService eduInfoService;
+
+    @Resource
     private EnrollmentSocialSecurityCardService securityCardService;
 
     @Resource
@@ -797,6 +800,7 @@ public class EnrollmentRegistrationController {
             page.setCurrent (0);
             result = service.exportList(page,exportTemplate).getRecords();
         }
+        fillEducationInfoForExport(result);
         EasyPoiUtil.exportExcel ( result, sheetName,  sheetName, ExportDTO.class, fileName, response );
 
     }
@@ -808,6 +812,57 @@ public class EnrollmentRegistrationController {
         dingTalkSyncUtil.getUserByMobileSyncData();
     }
 
+    /**
+     * 导出添加教育经历信息
+     * @param result
+     */
+    private void fillEducationInfoForExport(List<ExportDTO> result) {
+        if (result == null || result.isEmpty()) {
+            return;
+        }
+        Map<String, Optional<EnrollmentEduInfo>> eduInfoMap = new HashMap<>();
+        for (ExportDTO item : result) {
+            if (item == null || StringUtils.isBlank(item.getUserId())) {
+                continue;
+            }
+            Optional<EnrollmentEduInfo> eduInfoOptional = eduInfoMap.computeIfAbsent(item.getUserId(), this::getExportEduInfo);
+            if (!eduInfoOptional.isPresent()) {
+                continue;
+            }
+            EnrollmentEduInfo eduInfo = eduInfoOptional.get();
+            item.setGraduatedFrom(eduInfo.getGraduatedFrom());
+            item.setSpeciality(eduInfo.getSpeciality());
+            item.setDegree(eduInfo.getDegree());
+            item.setEducation(eduInfo.getEducation());
+            item.setEducationStartDate(eduInfo.getStartDate());
+            item.setEducationEndDate(eduInfo.getEndDate());
+        }
+    }
+
+    private Optional<EnrollmentEduInfo> getExportEduInfo(String userId) {
+        List<EnrollmentEduInfo> list = eduInfoService.findByUserId(userId, "5");
+        if (list == null || list.isEmpty()) {
+            return Optional.empty();
+        }
+        EnrollmentEduInfo eduInfo = list.stream()
+                .filter(this::isHighestEducation)
+                .findFirst()
+                .orElse(list.get(0));
+        return Optional.ofNullable(eduInfo);
+    }
+
+    private boolean isHighestEducation(EnrollmentEduInfo eduInfo) {
+        if (eduInfo == null || StringUtils.isBlank(eduInfo.getIsHighestEducation())) {
+            return false;
+        }
+        String flag = eduInfo.getIsHighestEducation().trim();
+        return "1".equals(flag)
+                || "是".equals(flag)
+                || "Y".equalsIgnoreCase(flag)
+                || "YES".equalsIgnoreCase(flag)
+                || "TRUE".equalsIgnoreCase(flag);
+    }
+
 
     /**
      * 根据选中的用户批量下载附件

+ 52 - 3
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/enrollment/enrollmentRegistration/mapper/xml/EnrollmentRegistrationMapper.xml

@@ -35,7 +35,53 @@
         a.entry_date,
         a.contract_start_date,
         a.contract_end_date,
-        a.tenant_id,
+        a.type,
+        a.proc_ins_id,
+        a.process_definition_id,
+        a.user_id,
+        a.project_manager,
+        a.remarks,
+        a.on_job_status,
+        a.process_type,
+        a.join_work_date,
+        a.join_industry_date,
+        a.trial_duration,
+        a.trial_end_date,
+        a.dd_type
+    </sql>
+    <sql id="Export_Column_List">
+        a.id,
+        a.create_by_id,
+        a.create_time,
+        a.update_by_id,
+        a.update_time,
+        a.del_flag,
+        a.name,
+        a.sex,
+        a.age,
+        a.birthday,
+        a.political_outlook,
+        COALESCE(npa_id.name, npa_code.name, a.native_place) AS native_place,
+        a.nation,
+        a.marital_status,
+        a.mobile_phone,
+        a.id_card,
+        a.home_address,
+        a.permanent_address,
+        a.graduated_from,
+        a.speciality,
+        a.start_time,
+        a.end_time,
+        a.education,
+        a.dd_id,
+        a.education_nature,
+        a.graduated_or_not,
+        a.english_level,
+        a.ncre,
+        a.department,
+        a.entry_date,
+        a.contract_start_date,
+        a.contract_end_date,
         a.type,
         a.proc_ins_id,
         a.process_definition_id,
@@ -87,7 +133,7 @@
     <select id="exportList"
             resultType="com.jeeplus.human.enrollment.enrollmentRegistration.service.dto.ExportDTO">
         select
-        <include refid="Base_Column_List"></include>,
+        <include refid="Export_Column_List"></include>,
         d.ID_ AS task_id,
         su.name as projectManagerName,
         so.name as departmentName,
@@ -97,6 +143,8 @@
         left join sys_user su on a.project_manager = su.id
         left join sys_office so on a.department = so.id
         left join sys_office so1 on so.parent_id = so1.id
+        left join sys_area npa_id on npa_id.id = a.native_place and npa_id.del_flag = '0'
+        left join sys_area npa_code on npa_code.code = a.native_place and npa_code.del_flag = '0'
         ${ew.customSqlSegment}
         ORDER BY a.create_time DESC
     </select>
@@ -118,6 +166,7 @@
         c.gs_account_holder_front as gsAccountHolderFront,
         c.gs_account_holder_opposite as gsAccountHolderOpposite,
         c.id as wageCardId,
+        su.tenant_id,
         su.login_name as loginName
         from human_resources_enrollment_registration a
         left join human_resources_enrollment_social_security_card b on a.id = b.enrollment_registration_id and b.del_flag = '0'
@@ -248,4 +297,4 @@
           AND attachment_id = #{id}
     </select>
 
-</mapper>
+</mapper>

+ 20 - 1
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/enrollment/enrollmentRegistration/service/dto/ExportDTO.java

@@ -34,7 +34,6 @@ public class ExportDTO extends BaseEntity {
 
     @Excel(name = "所属部门",width = 25)
     private String departmentName;          //所属部门
-    private String entryDate;           //进所日期
 
     @TableField(exist = false)
     @Excel(name = "所属公司",width = 25)
@@ -48,6 +47,26 @@ public class ExportDTO extends BaseEntity {
     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @Excel(name = "进所日期",exportFormat = "yyyy-MM-dd",importFormat = "yyyy-MM-dd")
     private Date inDate;  //进所日期
+    @Excel(name = "入职日期",width = 25)
+    private String entryDate;           //进所日期
+
+    @Excel(name = "毕业院校", width = 25)
+    private String graduatedFrom;
+
+    @Excel(name = "专业", width = 25)
+    private String speciality;
+
+    @Excel(name = "学位", width = 25, dict = "degree")
+    private String degree;
+
+    @Excel(name = "学历", width = 25, dict = "education")
+    private String education;
+
+    @Excel(name = "开始时间", width = 25, exportFormat = "yyyy-MM-dd")
+    private Date educationStartDate;
+
+    @Excel(name = "结束时间", width = 25, exportFormat = "yyyy-MM-dd")
+    private Date educationEndDate;
 
     private String department;
     private String companyId;