From 182edd4941ef74c3e98813c2a28ac774c262a22d Mon Sep 17 00:00:00 2001
From: luoyb <412940104@qq.com>
Date: 星期三, 10 三月 2021 00:03:27 +0800
Subject: [PATCH] fix(bug修复): 员工智搜和信息录入

---
 febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/service/impl/EmpBaseInfoServiceImpl.java |   40 ++++++++++++++++++++++++----------------
 1 files changed, 24 insertions(+), 16 deletions(-)

diff --git a/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/service/impl/EmpBaseInfoServiceImpl.java b/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/service/impl/EmpBaseInfoServiceImpl.java
index 07a5060..21bfec9 100644
--- a/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/service/impl/EmpBaseInfoServiceImpl.java
+++ b/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/service/impl/EmpBaseInfoServiceImpl.java
@@ -104,12 +104,13 @@
             p.setArchivesStatusName("0".equals(p.getArchivesStatus()) ? "未移交" : "已移交");
             p.setEmpCardStatusName("1".equals(p.getEmpCardStatus()) ? "未发" : "已发");
             p.setHandbookStatusName("1".equals(p.getHandbookStatus()) ? "未发" : "已发");
+            p.setEmpStatusName("0".equals(p.getEmpStatus()) ? "在职" : "离职");
             //保险类型
             p.setInsuranceTypeName(dicItems.stream()
                     .filter(k -> DicCode.INSURANCETYPE.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getInsuranceType()))
                     .findFirst()
                     .map(DicItem::getDicItemName)
-                    .orElse("汉族"));
+                    .orElse("未知"));
             //员工类别
             p.setEmpTypeName(dicItems.stream()
                     .filter(k -> DicCode.EMPTYPE.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getEmpType()))
@@ -150,12 +151,12 @@
                     .filter(k -> DicCode.IN_OUT_TYPE.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getEntryType()))
                     .findFirst()
                     .map(DicItem::getDicItemName)
-                    .orElse("未知"));
+                    .orElse(""));
             p.setDimissionTypeName(dicItems.stream()
                     .filter(k -> DicCode.IN_OUT_TYPE.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getDimissionType()))
                     .findFirst()
                     .map(DicItem::getDicItemName)
-                    .orElse("未知"));
+                    .orElse(""));
         });
         iPage.setRecords(list);
         return iPage;
@@ -934,6 +935,13 @@
         if (StringUtils.isNotBlank(empBaseInfo.getDimissionType())) {
             queryWrapper.in("a.dimissionType", empBaseInfo.getDimissionType().split(","));
         }
+        if (StringUtils.isNotBlank(empBaseInfo.getInOutType())) {
+            queryWrapper.and(p->{
+                p.in("a.dimissionType", empBaseInfo.getInOutType().split(","));
+                p.or().in("a.entryType",empBaseInfo.getInOutType().split(","));
+            });
+            //queryWrapper.in("a.dimissionType", empBaseInfo.getDimissionType().split(","));
+        }
         queryWrapper.in("c.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA));
         return queryWrapper;
     }
@@ -998,7 +1006,7 @@
 
         //工作经历
         IPage<EmpWorkExperience> workExperienceIPage = empWorkExperienceMapper.selectPageVo(page, new QueryWrapper<EmpWorkExperience>().in("a.empId", empIds).ne("a.delFlag", 1));
-        if (workExperienceIPage.getRecords().size()!=0){
+        if (workExperienceIPage.getRecords().size() != 0) {
             exportField = FebsUtil.reflectAnnotation(EmpWorkExperience.class);
             List<Map<String, Object>> allListEmpWork = PoiExportExcel.getDataList(exportField, workExperienceIPage.getRecords(), listMapDicItem);
             allList.add(allListEmpWork.get(0));
@@ -1007,7 +1015,7 @@
 
         //体检信息
         IPage<EmpPhysicalExam> empPhysicalExamIPage = empPhysicalExamMapper.selectPageVo(page, new QueryWrapper<EmpPhysicalExam>().in("a.empId", empIds).ne("a.delFlag", 1));
-        if (empPhysicalExamIPage.getRecords().size()!=0){
+        if (empPhysicalExamIPage.getRecords().size() != 0) {
             exportField = FebsUtil.reflectAnnotation(EmpWorkExperience.class);
             List<Map<String, Object>> allListEmpPhysical = PoiExportExcel.getDataList(exportField, empPhysicalExamIPage.getRecords(), listMapDicItem);
             allList.add(allListEmpPhysical.get(0));
@@ -1016,7 +1024,7 @@
 
         //调岗记录
         IPage<EmpJobChange> jobChangeIPage = empJobChangeMapper.selectPageVoBean(page, new QueryWrapper<EmpJobChange>().in("a.empId", empIds).ne("a.delFlag", 1));
-        if (jobChangeIPage.getRecords().size()!=0){
+        if (jobChangeIPage.getRecords().size() != 0) {
             exportField = FebsUtil.reflectAnnotation(EmpJobChange.class);
             List<Map<String, Object>> allListjobChangeI = PoiExportExcel.getDataList(exportField, jobChangeIPage.getRecords(), listMapDicItem);
             allList.add(allListjobChangeI.get(0));
@@ -1025,7 +1033,7 @@
 
         //合同信息
         IPage<EmpContractInfo> empContractInfoIPage = empContractInfoMapper.selectPageVo(page, new QueryWrapper<EmpContractInfo>().in("a.empId", empIds).ne("a.delFlag", 1));
-        if (empContractInfoIPage.getRecords().size()!=0){
+        if (empContractInfoIPage.getRecords().size() != 0) {
             exportField = FebsUtil.reflectAnnotation(EmpContractInfo.class);
             List<Map<String, Object>> allListEmpContractInfo = PoiExportExcel.getDataList(exportField, empContractInfoIPage.getRecords(), listMapDicItem);
             allList.add(allListEmpContractInfo.get(0));
@@ -1034,7 +1042,7 @@
 
         //入离职记录
         IPage<EmpDimissionAttend> empDimissionAttendIPage = empDimissionAttendMapper.selectPageVo(page, new QueryWrapper<EmpDimissionAttend>().in("a.empId", empIds).ne("a.delFlag", 1));
-        if (empDimissionAttendIPage.getRecords().size()!=0){
+        if (empDimissionAttendIPage.getRecords().size() != 0) {
             exportField = FebsUtil.reflectAnnotation(EmpDimissionAttend.class);
             List<Map<String, Object>> allListEmpDimissionAtt = PoiExportExcel.getDataList(exportField, empDimissionAttendIPage.getRecords(), listMapDicItem);
             allList.add(allListEmpDimissionAtt.get(0));
@@ -1043,7 +1051,7 @@
 
         //请假记录
         IPage<EmpLeaveInfo> empLeaveInfoIPage = empLeaveInfoMapper.selectPageVo(page, new QueryWrapper<EmpLeaveInfo>().in("a.empId", empIds).ne("a.delFlag", 1));
-        if (empLeaveInfoIPage.getRecords().size()!=0){
+        if (empLeaveInfoIPage.getRecords().size() != 0) {
             exportField = FebsUtil.reflectAnnotation(EmpLeaveInfo.class);
             List<Map<String, Object>> allListEmpLoeaveInfo = PoiExportExcel.getDataList(exportField, empLeaveInfoIPage.getRecords(), listMapDicItem);
             allList.add(allListEmpLoeaveInfo.get(0));
@@ -1053,7 +1061,7 @@
 
         //失业金领取
         IPage<EmpUnemployment> empUnemploymentIPage = empUnemploymentMapper.selectPageVo(page, new QueryWrapper<EmpUnemployment>().in("a.empId", empIds).ne("a.delFlag", 1));
-        if (empUnemploymentIPage.getRecords().size()!=0){
+        if (empUnemploymentIPage.getRecords().size() != 0) {
             exportField = FebsUtil.reflectAnnotation(EmpUnemployment.class);
             List<Map<String, Object>> allListEmpUnemployment = PoiExportExcel.getDataList(exportField, empUnemploymentIPage.getRecords(), listMapDicItem);
             allList.add(allListEmpUnemployment.get(0));
@@ -1062,7 +1070,7 @@
 
         //社保申请
         IPage<EmpInsurance> empInsuranceIPage = empInsuranceMapper.selectPageVo(page, new QueryWrapper<EmpInsurance>().in("a.empId", empIds).ne("a.delFlag", 1));
-        if (empInsuranceIPage.getRecords().size()!=0){
+        if (empInsuranceIPage.getRecords().size() != 0) {
             exportField = FebsUtil.reflectAnnotation(EmpInsurance.class);
             List<Map<String, Object>> allListEmpInsurance = PoiExportExcel.getDataList(exportField, empInsuranceIPage.getRecords(), listMapDicItem);
             allList.add(allListEmpInsurance.get(0));
@@ -1072,7 +1080,7 @@
 
         //意外险案件
         IPage<EmpAccidentCases> empAccidentCasesIPage = empAccidentCasesMapper.selectPageVo(page, new QueryWrapper<EmpInsurance>().in("a.empId", empIds).ne("a.delFlag", 1));
-        if (empAccidentCasesIPage.getRecords().size()!=0){
+        if (empAccidentCasesIPage.getRecords().size() != 0) {
             exportField = FebsUtil.reflectAnnotation(EmpAccidentCases.class);
             List<Map<String, Object>> allListEmpAccidentCases = PoiExportExcel.getDataList(exportField, empAccidentCasesIPage.getRecords(), listMapDicItem);
             allList.add(allListEmpAccidentCases.get(0));
@@ -1081,7 +1089,7 @@
 
         //工伤案件
         IPage<EmpOccupational> empOccupationalIPage = empOccupationalMapper.selectPageVo(page, new QueryWrapper<EmpOccupational>().in("a.empId", empIds).ne("a.delFlag", 1));
-        if (empOccupationalIPage.getRecords().size()!=0){
+        if (empOccupationalIPage.getRecords().size() != 0) {
             exportField = FebsUtil.reflectAnnotation(EmpOccupational.class);
             List<Map<String, Object>> allListEmpOccupational = PoiExportExcel.getDataList(exportField, empOccupationalIPage.getRecords(), listMapDicItem);
             allList.add(allListEmpOccupational.get(0));
@@ -1090,7 +1098,7 @@
 
         //劳资案件
         IPage<EmpLaborTrouble> empLaborTroubleIPage = empLaborTroubleMapper.selectPageVo(page, new QueryWrapper<EmpInsurance>().in("a.empId", empIds).ne("a.delFlag", 1));
-        if (empLaborTroubleIPage.getRecords().size()!=0){
+        if (empLaborTroubleIPage.getRecords().size() != 0) {
             exportField = FebsUtil.reflectAnnotation(EmpLaborTrouble.class);
             List<Map<String, Object>> allListEmpLaborTrouble = PoiExportExcel.getDataList(exportField, empLaborTroubleIPage.getRecords(), listMapDicItem);
             allList.add(allListEmpLaborTrouble.get(0));
@@ -1100,7 +1108,7 @@
 
         //不良记录
         IPage<EmpBadRecord> empBadRecordIPage = empBadRecordMapper.selectPageVo(page, new QueryWrapper<EmpInsurance>().in("a.empId", empIds).ne("a.delFlag", 1));
-        if (empBadRecordIPage.getRecords().size()!=0){
+        if (empBadRecordIPage.getRecords().size() != 0) {
             exportField = FebsUtil.reflectAnnotation(EmpBadRecord.class);
             List<Map<String, Object>> allListEmpBadRecord = PoiExportExcel.getDataList(exportField, empBadRecordIPage.getRecords(), listMapDicItem);
             allList.add(allListEmpBadRecord.get(0));
@@ -1110,7 +1118,7 @@
 
         //备注信息
         IPage<EmpRemarkInfo> empRemarkInfoIPage = empRemarkInfoMapper.selectPageVo(page, new QueryWrapper<EmpRemarkInfo>().in("a.empId", empIds).ne("a.delFlag", 1));
-        if (empRemarkInfoIPage.getRecords().size()!=0){
+        if (empRemarkInfoIPage.getRecords().size() != 0) {
             exportField = FebsUtil.reflectAnnotation(EmpRemarkInfo.class);
             List<Map<String, Object>> allListEmpRemarkInfo = PoiExportExcel.getDataList(exportField, empRemarkInfoIPage.getRecords(), listMapDicItem);
             allList.add(allListEmpRemarkInfo.get(0));

--
Gitblit v1.8.0