Eric преди 1 година
родител
ревизия
3c13cd7b36

+ 42 - 4
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/EmployeeInfo.java

@@ -2,6 +2,7 @@ package com.ym.mec.biz.dal.entity;
 
 import io.swagger.annotations.ApiModelProperty;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 import com.ym.mec.biz.dal.enums.JobNatureEnum;
@@ -138,6 +139,9 @@ public class EmployeeInfo extends BaseEntity {
 	@ApiModelProperty(value = "是否覆盖", required = false)
 	private Boolean isCover = false;
 
+	@ApiModelProperty("学历信息")
+	private String educationBackgroundStr;
+
     public Boolean getCover() {
 		return isCover;
 	}
@@ -482,6 +486,14 @@ public class EmployeeInfo extends BaseEntity {
 		this.hrbp = hrbp;
 	}
 
+	public String getEducationBackgroundStr() {
+		return educationBackgroundStr;
+	}
+
+	public void setEducationBackgroundStr(String educationBackgroundStr) {
+		this.educationBackgroundStr = educationBackgroundStr;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);
@@ -491,10 +503,18 @@ public class EmployeeInfo extends BaseEntity {
     // 教育背景
     //[{"level":"本科","school":"测试院校","year":"2023-01-31T16:00:00.000Z","subject":"测试"},{"level":"本科","school":"测试院校2","year":"2023-09-30T16:00:00.000Z","subject":"测试"}]
     public static class EduBackground {
-        private String level;
-        private String school;
-        private String year;
-        private String subject;
+
+		@ApiModelProperty("学历")
+		private String level;
+
+		@ApiModelProperty("毕业学校")
+		private String school;
+
+		@ApiModelProperty("毕业时间")
+		private String year;
+
+		@ApiModelProperty("专业")
+		private String subject;
 
         public EduBackground() {
         }
@@ -537,5 +557,23 @@ public class EmployeeInfo extends BaseEntity {
         public void setSubject(String subject) {
             this.subject = subject;
         }
+
+		public String getEducationBackground() {
+
+			String educationBackground = "";
+			// 毕业学校
+			if (StringUtils.isNotBlank(getSchool())) {
+				educationBackground += getSchool();
+			}
+			// 学历
+			if (StringUtils.isNotBlank(getLevel())) {
+				educationBackground += "-" + getLevel();
+			}
+			// 毕业时间
+			if (StringUtils.isNotBlank(getYear())) {
+				educationBackground += "-" + getYear().split("T")[0];
+			}
+			return educationBackground;
+		}
     }
 }

+ 20 - 5
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -1,6 +1,6 @@
 package com.ym.mec.web.controller;
 
-import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSON;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.*;
@@ -2324,7 +2324,22 @@ public class ExportController extends BaseController {
             throw new BizException("没有可导出的记录");
         }
 
-        for (EmployeeInfo row : rows) {
+        // 填充老师学历信息
+        for (EmployeeInfo item : rows) {
+            if (StringUtils.isNotBlank(item.getEducationalBackground())
+                && item.getEducationalBackground().matches("^\\[.?|.+\\]$")) {
+
+                String collect = JSON.parseArray(item.getEducationalBackground(), EmployeeInfo.EduBackground.class).stream()
+                    .map(EmployeeInfo.EduBackground::getEducationBackground)
+                    .filter(StringUtils::isNotEmpty)
+                    .collect(Collectors.joining(","));
+
+                // 老师学历信息
+                item.setEducationBackgroundStr(collect);
+            }
+        }
+
+        /*for (EmployeeInfo row : rows) {
             if (StringUtils.isNotBlank(row.getEducationalBackground())) {
                 List<EmployeeInfo.EduBackground> eduBackgrounds = JSONArray.parseArray(row.getEducationalBackground(), EmployeeInfo.EduBackground.class);
                 if (!CollectionUtils.isEmpty(eduBackgrounds)) {
@@ -2334,7 +2349,7 @@ public class ExportController extends BaseController {
                 }
 
             }
-        }
+        }*/
 
         OutputStream outputStream = response.getOutputStream();
         try {
@@ -2342,12 +2357,12 @@ public class ExportController extends BaseController {
                     "声部", "所在城市", "工作意向", "信息来源", "下次沟通时间", "入职时间",
                     "职位", "分部", "人员状态", "证件号码", "年龄", "性别",
                     "银行卡", "开户行", "紧急联系人", "紧急联系人关系", "紧急联系人电话", "最后一次操作时间",
-                    "HRBP", "离职时间","背景描述"
+                    "HRBP", "离职时间","学历"
             };
             String[] body = {"id", "realName", "mobileNo", "wechatNo", "subjectName", "liveCity", "intentionCity",
                     "sourceFrom", "nextVisitDateStr", "entryDateStr", "position.msg", "organName", "status.desc",
                     "idCard", "age", "gender?'男':'女'", "bankCardNo", "bankAddress", "emergencyContactName",
-                    "emergencyContactRelation", "emergencyContactPhone", "updateTime", "hrbpName", "resignationDateStr","educationalBackground"};
+                    "emergencyContactRelation", "emergencyContactPhone", "updateTime", "hrbpName", "resignationDateStr","educationBackgroundStr"};
             HSSFWorkbook workbook = POIUtil.exportExcel(header, body, rows);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=employeeInfo-" + DateUtil.getDate(new Date()) + ".xls");