From 57fc705f91f6972b956d92da85e1ab2771709874 Mon Sep 17 00:00:00 2001
From: luoyb <412940104@qq.com>
Date: 星期二, 16 三月 2021 15:37:57 +0800
Subject: [PATCH] fix(bug修复): 岗位变更显示部门全称
---
febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/service/impl/EmpBaseInfoServiceImpl.java | 728 ++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 530 insertions(+), 198 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 ec3c1e4..7501963 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
@@ -1,57 +1,48 @@
package cc.mrbird.febs.server.hr.service.impl;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.*;
-import java.util.function.Consumer;
-
+import cc.mrbird.febs.common.core.constant.DicCode;
+import cc.mrbird.febs.common.core.constant.ModuleCode;
+import cc.mrbird.febs.common.core.entity.QueryRequest;
+import cc.mrbird.febs.common.core.entity.constant.FebsConstant;
import cc.mrbird.febs.common.core.entity.constant.StringConstant;
+import cc.mrbird.febs.common.core.entity.system.Dept;
+import cc.mrbird.febs.common.core.entity.system.DicItem;
+import cc.mrbird.febs.common.core.entity.system.Position;
import cc.mrbird.febs.common.core.entity.system.SysConfig;
-import cc.mrbird.febs.common.core.exception.FebsException;
-import cc.mrbird.febs.common.core.utils.MyUtil;
-import cc.mrbird.febs.server.hr.entity.EmpDimissionLog;
-import cc.mrbird.febs.server.hr.entity.EmpJobChange;
+import cc.mrbird.febs.common.core.utils.*;
+import cc.mrbird.febs.common.redis.service.RedisService;
+import cc.mrbird.febs.server.hr.entity.*;
+import cc.mrbird.febs.server.hr.feign.IRemoteDeptService;
+import cc.mrbird.febs.server.hr.feign.IRemoteDicItemService;
+import cc.mrbird.febs.server.hr.feign.IRemotePositionService;
import cc.mrbird.febs.server.hr.feign.IRemoteUserService;
-import cc.mrbird.febs.server.hr.mapper.EmpContractInfoMapper;
+import cc.mrbird.febs.server.hr.mapper.*;
import cc.mrbird.febs.server.hr.properties.FebsServerHrProperties;
-import cc.mrbird.febs.server.hr.service.IEmpContractInfoService;
+import cc.mrbird.febs.server.hr.service.IEmpBaseInfoService;
import cc.mrbird.febs.server.hr.service.IEmpDimissionLogService;
import cc.mrbird.febs.server.hr.service.IEmpJobChangeService;
-import cn.hutool.core.date.DateUnit;
+import cc.mrbird.febs.server.hr.util.PoiExportExcel;
import cn.hutool.core.date.DateUtil;
-import cc.mrbird.febs.server.hr.entity.*;
import cn.hutool.core.util.StrUtil;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Propagation;
-import org.springframework.transaction.annotation.Transactional;
-
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-
-import cc.mrbird.febs.common.core.constant.DicCode;
-import cc.mrbird.febs.common.core.constant.ModuleCode;
-import cc.mrbird.febs.common.core.entity.QueryRequest;
-import cc.mrbird.febs.common.core.entity.system.Dept;
-import cc.mrbird.febs.common.core.entity.system.DicItem;
-import cc.mrbird.febs.common.core.utils.CastUtil;
-import cc.mrbird.febs.common.core.utils.FebsUtil;
-import cc.mrbird.febs.common.core.utils.SequenceUtil;
-import cc.mrbird.febs.common.redis.service.RedisService;
-import cc.mrbird.febs.server.hr.entity.EmpBaseInfo;
-import cc.mrbird.febs.server.hr.feign.IRemoteDeptService;
-import cc.mrbird.febs.server.hr.mapper.EmpBaseInfoMapper;
-import cc.mrbird.febs.server.hr.service.IEmpBaseInfoService;
import lombok.RequiredArgsConstructor;
-import org.springframework.util.FileSystemUtils;
-import org.springframework.validation.annotation.Validated;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.*;
+import java.util.function.Consumer;
+import java.util.stream.Collectors;
/**
* name:EmpBaseinfo
@@ -74,9 +65,23 @@
private final EmpContractInfoMapper empContractInfoMapper;
private final FebsServerHrProperties properties;
private final IRemoteDeptService remoteDeptService;
- private final String operatorId = Optional.ofNullable(FebsUtil.getCurrentUser())
- .map(u -> u.getUserId().toString())
- .orElse("1");
+ private final EmpWorkExperienceMapper empWorkExperienceMapper;
+ private final EmpPhysicalExamMapper empPhysicalExamMapper;
+ private final EmpJobChangeMapper empJobChangeMapper;
+ private final EmpLeaveInfoMapper empLeaveInfoMapper;
+ private final EmpUnemploymentMapper empUnemploymentMapper;
+ private final EmpDimissionAttendMapper empDimissionAttendMapper;
+ private final EmpInsuranceMapper empInsuranceMapper;
+ private final EmpAccidentCasesMapper empAccidentCasesMapper;
+ private final EmpLaborTroubleMapper empLaborTroubleMapper;
+ private final EmpBadRecordMapper empBadRecordMapper;
+ private final EmpRemarkInfoMapper empRemarkInfoMapper;
+ private final IRemoteDicItemService remoteDicItemService;
+ private final EmpOccupationalMapper empOccupationalMapper;
+ private final IRemotePositionService remotePositionService;
+ private final EmpDimissionLogMapper empDimissionLogMapper;
+ private final EmpOpenArchivesMapper empOpenArchivesMapper;
+ private final EmpResignMapper empResignMapper;
@Override
public IPage<EmpBaseInfo> findEmpBaseInfos(QueryRequest request, EmpBaseInfo empBaseInfo) {
@@ -86,27 +91,30 @@
@Override
public IPage<EmpBaseInfo> findZsEmpBaseInfos(QueryRequest request, EmpBaseInfo empBaseInfo) {
Page<EmpBaseInfo> page = new Page<>(request.getPageNum(), request.getPageSize());
+ SortUtil.handlePageSort(request, page, "createTime", FebsConstant.ORDER_DESC, true);
IPage<EmpBaseInfo> iPage = empBaseInfoMapper.selectPageVo(page, createQueryWrapper(empBaseInfo));
//设置部门
- List<EmpBaseInfo> list = setDeptName(iPage.getRecords());
+ // List<EmpBaseInfo> list = setDeptName(iPage.getRecords());
+ List<EmpBaseInfo> list = iPage.getRecords();
List<DicItem> dicItems = CastUtil.castList(redisService.get("dicItems"), DicItem.class);
list.forEach(p -> {
p.setSexName("1".equals(p.getSex()) ? "男" : "女");
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()))
.findFirst()
.map(DicItem::getDicItemName)
- .orElse("汉族"));
+ .orElse("正式工"));
// 设置民族
p.setNationName(dicItems.stream()
.filter(k -> DicCode.NATION.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getNation()))
@@ -137,6 +145,16 @@
.findFirst()
.map(DicItem::getDicItemName)
.orElse("未知"));
+ p.setEntryTypeName(dicItems.stream()
+ .filter(k -> DicCode.IN_OUT_TYPE.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getEntryType()))
+ .findFirst()
+ .map(DicItem::getDicItemName)
+ .orElse(""));
+ p.setDimissionTypeName(dicItems.stream()
+ .filter(k -> DicCode.IN_OUT_TYPE.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getDimissionType()))
+ .findFirst()
+ .map(DicItem::getDicItemName)
+ .orElse(""));
});
iPage.setRecords(list);
return iPage;
@@ -152,6 +170,7 @@
@Override
@Transactional(rollbackFor = Exception.class)
public void createEmpBaseInfo(EmpBaseInfo empBaseInfo) {
+ String operatorId = Optional.of(FebsUtil.getUserId()).orElse("1");
EmpBaseInfo dbInfo = this.getEmpBaseInfo(empBaseInfo);
if (dbInfo == null) {
empBaseInfo.setEmpId(SequenceUtil.generateId(0L, ModuleCode.HR_EMPLOYEE));
@@ -173,6 +192,7 @@
@Override
@Transactional(rollbackFor = Exception.class)
public void updateEmpBaseInfo(EmpBaseInfo empBaseInfo) {
+ String operatorId = Optional.of(FebsUtil.getUserId()).orElse("1");
if (StrUtil.isNotBlank(empBaseInfo.getImagePath())) {
String path = properties.getEmpBaseInfoPath() + empBaseInfo.getEmpId() + ".png";
if (MyUtil.generateImage(empBaseInfo.getImagePath(), path)) {
@@ -186,6 +206,12 @@
empBaseInfo.setDelFlag(dbData.getDelFlag());
empBaseInfo.setModifyTime(new Date());
empBaseInfo.setModifier(operatorId);
+ if(StringUtils.isBlank(empBaseInfo.getImagePath())){
+ empBaseInfo.setImagePath(dbData.getImagePath());
+ }
+ if(StringUtils.isBlank(empBaseInfo.getAllDeptName())){
+ empBaseInfo.setAllDeptName(dbData.getAllDeptName());
+ }
this.saveOrUpdate(empBaseInfo);
}
@@ -209,9 +235,29 @@
@Override
@Transactional(rollbackFor = Exception.class)
public void logicDelEmpBaseInfo(String ids) {
+ String operatorId = Optional.of(FebsUtil.getUserId()).orElse("1");
String[] str = ids.split(",");
List<String> list = new ArrayList<>(Arrays.asList(str));
empBaseInfoMapper.logicDeleteByIds(list, operatorId);
+
+ //同步删除关联数据
+ //不良记录
+ empBadRecordMapper.logicDelByUserIds(list,operatorId);
+ empAccidentCasesMapper.logicDelByUserIds(list,operatorId);
+ empContractInfoMapper.logicDelByUserIds(list,operatorId);
+ empDimissionAttendMapper.logicDelByUserIds(list,operatorId);
+ empDimissionLogMapper.logicDelByUserIds(list,operatorId);
+ empInsuranceMapper.logicDelByUserIds(list,operatorId);
+ empJobChangeMapper.logicDelByUserIds(list,operatorId);
+ empLaborTroubleMapper.logicDelByUserIds(list,operatorId);
+ empLeaveInfoMapper.logicDelByUserIds(list,operatorId);
+ empOccupationalMapper.logicDelByUserIds(list,operatorId);
+ empOpenArchivesMapper.logicDelByUserIds(list,operatorId);
+ empPhysicalExamMapper.logicDelByUserIds(list,operatorId);
+ empRemarkInfoMapper.logicDelByUserIds(list,operatorId);
+ empResignMapper.logicDelByUserIds(list,operatorId);
+ empUnemploymentMapper.logicDelByUserIds(list,operatorId);
+ empWorkExperienceMapper.logicDelByUserIds(list,operatorId);
}
/**
@@ -232,6 +278,11 @@
.findFirst()
.map(Dept::getDeptName)
.orElse(""));
+ empBaseInfo.setAllDeptName(depts.stream()
+ .filter(k -> k.getDeptId().equals(empBaseInfo.getDeptId()))
+ .findFirst()
+ .map(Dept::getAllDeptName)
+ .orElse(""));
}
return empBaseInfoList;
}
@@ -241,18 +292,16 @@
QueryWrapper<EmpBaseInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(EmpBaseInfo::getEmpNumb, empBaseInfo.getEmpNumb())
.ne(EmpBaseInfo::getDelFlag, 1);
- if (empBaseInfo.getEmpId()!=null) {
+ if (empBaseInfo.getEmpId() != null) {
queryWrapper.lambda().ne(EmpBaseInfo::getEmpId, empBaseInfo.getEmpId());
}
- if (this.count(queryWrapper) <= 0) {
- return false;
- }
- return true;
+ return this.count(queryWrapper) > 0;
}
@Override
public boolean momentToNormal(String ids) {
+ String operatorId = Optional.of(FebsUtil.getUserId()).orElse("1");
String[] str = ids.split(",");
List<String> list = new ArrayList<>(Arrays.asList(str));
return empBaseInfoMapper.momentToNormal(list, operatorId) > 0;
@@ -278,6 +327,7 @@
*/
@Override
public boolean closeEmpArchives(EmpDimissionLog empDimissionLog) {
+ String operatorId = Optional.of(FebsUtil.getUserId()).orElse("1");
String[] str = empDimissionLog.getEmpIds().split(",");
List<String> list = new ArrayList<>(Arrays.asList(str));
String[] strDate = empDimissionLog.getEntryDates().split(",");
@@ -307,7 +357,6 @@
switch (flag) {
case 1:
//解除合同
-
empContractInfoMapper.terminateContract(new ArrayList<>(Arrays.asList(empDimissionLog.getEmpIds().split(StringConstant.COMMA))), operatorId);
break;
case 2:
@@ -334,6 +383,7 @@
*/
@Override
public boolean changeEmpJob(EmpJobChange empJobChange) {
+ String operatorId = Optional.of(FebsUtil.getUserId()).orElse("1");
String[] str = empJobChange.getEmpIds().split(",");
List<String> list = new ArrayList<>(Arrays.asList(str));
String[] strName = empJobChange.getEmpNames().split(",");
@@ -350,6 +400,7 @@
saveChange.setOldDeptName(strDeptName[i]);
saveChange.setOldJobName(strJobName[i]);
saveChange.setNewDeptName(empJobChange.getNewDeptName());
+ saveChange.setAllDeptName(empJobChange.getAllDeptName());
saveChange.setNewJobName(empJobChange.getNewJobName());
saveChange.setChangeType(empJobChange.getChangeType());
saveChange.setChangeDate(empJobChange.getChangeDate());
@@ -364,6 +415,7 @@
Map<String, Object> mapParams = new HashMap<>();
mapParams.put("deptId", empJobChange.getDeptId());
mapParams.put("deptName", empJobChange.getNewDeptName());
+ mapParams.put("allDeptName", empJobChange.getAllDeptName());
mapParams.put("jobId", empJobChange.getJobId());
mapParams.put("jobName", empJobChange.getNewJobName());
mapParams.put("operatorId", operatorId);
@@ -377,7 +429,7 @@
*/
@Override
@Transactional(rollbackFor = Exception.class)
- public void importEmpBaseInfo(List<List<Object>> listObject, List<String> returnList) {
+ public void importEmpBaseInfo(List<List<Object>> listObject, List<String> returnList,List<DicItem> dicItems) {
for (List<Object> list : listObject) {
if (list.size() == 0) {
continue;
@@ -390,49 +442,121 @@
empBaseInfo.setEmpId(SequenceUtil.generateId(0L, ModuleCode.HR_EMPLOYEE));
empBaseInfo.setArchivesNumb(list.get(0).toString());
empBaseInfo.setEmpNumb(list.get(1).toString());
- empBaseInfo.setEmpName(list.get(2).toString());
+
List<Dept> depts = CastUtil.castList(redisService.get("depts"), Dept.class);
- empBaseInfo.setDeptName(list.get(3).toString());
- Dept dept = depts.stream().filter(d -> d.getDeptName().equals(list.get(3).toString())).findFirst().orElse(null);
+ empBaseInfo.setDeptName(list.get(2).toString());
+ Dept dept = depts.stream().filter(d -> d.getDeptName().equals(list.get(2).toString())).findFirst().orElse(null);
if (null == dept) {
- returnList.add(StrUtil.format("导入员工基本信息异常: 出现位置第{}行, 原因:{}部门不存在", listObject.indexOf(list) + 1, list.get(3).toString()));
+ returnList.add(StrUtil.format("导入员工基本信息异常: 出现位置第{}行, 原因:{}部门不存在", listObject.indexOf(list) + 1, list.get(2).toString()));
continue;
}
+
+ empBaseInfo.setAllDeptName(dept.getAllDeptName());
+
empBaseInfo.setDeptId(dept.getDeptId());
- empBaseInfo.setJobName(list.get(4).toString());
- empBaseInfo.setEmpType(list.get(5).toString());
+ List<Position> positionList = CastUtil.castList(redisService.get("position"), Position.class);
+ if (null==positionList){
+ positionList = remotePositionService.setPositionRedis();
+ if (null==positionList){
+ returnList.add(StrUtil.format("导入员工基本信息异常: 出现位置第{}行, 原因:{}获取岗位为空,请设置岗位", listObject.indexOf(list) + 1, list.get(3).toString()));
+ continue;
+ }
+ }
+ Position position = positionList.stream().filter(d -> d.getPositionName().equals(list.get(3).toString())).findFirst().orElse(null);
+ if (null == position){
+ returnList.add(StrUtil.format("导入员工基本信息异常: 出现位置第{}行, 原因:{}获取岗位为空", listObject.indexOf(list) + 1, list.get(3).toString()));
+ continue;
+ }
+ empBaseInfo.setJobId(position.getPositionId());
+ empBaseInfo.setJobName(list.get(3).toString());
+ empBaseInfo.setEmpName(list.get(4).toString());
+ empBaseInfo.setCertificateNumb(list.get(5).toString());
empBaseInfo.setSex("男".equals(list.get(6).toString()) ? "1" : "2");
- empBaseInfo.setNation(list.get(7).toString());
- empBaseInfo.setCertificateNumb(list.get(8).toString());
- empBaseInfo.setMarriage(list.get(9).toString());
- if (StringUtils.isNotBlank(list.get(10).toString())) {
- empBaseInfo.setStature(Integer.valueOf(list.get(10).toString()));
+
+ //民族
+ DicItem dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"nation")&&StrUtil.equals(j.getDicItemName(),list.get(7).toString())).findFirst().orElse(null);
+ if (null!=dicItem){
+ empBaseInfo.setNation(dicItem.getDicItemCode());
}
- empBaseInfo.setPolitics(list.get(11).toString());
- if (StringUtils.isNotBlank(list.get(12).toString())) {
- empBaseInfo.setEntryDate(DateUtil.parseDate(list.get(12).toString()));
+
+ //婚姻状况
+ dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"marriage")&&StrUtil.equals(j.getDicItemName(),list.get(8).toString())).findFirst().orElse(null);
+ if (null!=dicItem){
+ empBaseInfo.setMarriage(dicItem.getDicItemCode());
}
- empBaseInfo.setEducation(list.get(13).toString());
- if (StringUtils.isNotBlank(list.get(14).toString())) {
- empBaseInfo.setSeniority(Integer.valueOf(list.get(14).toString()));
+
+ if (StringUtils.isNotBlank(list.get(9).toString())) {
+ empBaseInfo.setStature(Integer.valueOf(list.get(9).toString()));
}
- empBaseInfo.setNativePlace(list.get(15).toString());
- empBaseInfo.setCensusAddress(list.get(16).toString());
- empBaseInfo.setCurrentAddress(list.get(17).toString());
+ //政治面貌
+ dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(), "plitical")&&StrUtil.equals(j.getDicItemName(),list.get(10).toString())).findFirst().orElse(null);
+ if (null!=dicItem){
+ empBaseInfo.setPolitics(dicItem.getDicItemCode());
+ }
+
+ if (StringUtils.isNotBlank(list.get(11).toString())) {
+ empBaseInfo.setEntryDate(DateUtil.parseDate(list.get(11).toString()));
+ }
+
+ //最高学历
+ dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"education")&&StrUtil.equals(j.getDicItemName(),list.get(12).toString())).findFirst().orElse(null);
+ if (null!=dicItem){
+ empBaseInfo.setEducation(dicItem.getDicItemCode());
+ }
+
+ if (StringUtils.isNotBlank(list.get(13).toString())) {
+ empBaseInfo.setSeniority(Integer.valueOf(list.get(13).toString()));
+ }
+
+ //籍贯
+ dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"nativePlace")&&StrUtil.equals(j.getDicItemName(),list.get(14).toString())).findFirst().orElse(null);
+ if (null!=dicItem){
+ empBaseInfo.setNativePlace(dicItem.getDicItemCode());
+ }
+
+ empBaseInfo.setCensusAddress(list.get(15).toString());
+ empBaseInfo.setCurrentAddress(list.get(16).toString());
+
+ dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"empType")&&StrUtil.equals(j.getDicItemName(),list.get(17).toString())).findFirst().orElse(null);
+ if (null!=dicItem){
+ empBaseInfo.setEmpType(dicItem.getDicItemCode());
+ }
+
empBaseInfo.setGuardNumb(list.get(18).toString());
empBaseInfo.setReturnReceipt(list.get(19).toString());
empBaseInfo.setTelePhone(list.get(20).toString());
empBaseInfo.setIntroducer(list.get(21).toString());
empBaseInfo.setBankName(list.get(22).toString());
empBaseInfo.setBankNumb(list.get(23).toString());
- empBaseInfo.setInsuranceType(list.get(24).toString());
+ //保险类型
+ dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"insuranceType")&&StrUtil.equals(j.getDicItemName(),list.get(24).toString())).findFirst().orElse(null);
+ if (null!=dicItem){
+ empBaseInfo.setInsuranceType(dicItem.getDicItemCode());
+ }
+
empBaseInfo.setSocialNumb(list.get(25).toString());
empBaseInfo.setFamily(list.get(26).toString());
empBaseInfo.setUrgencyPhone(list.get(27).toString());
- empBaseInfo.setHandbookStatus(list.get(28).toString());
- empBaseInfo.setEmpCardStatus(list.get(29).toString());
+ //员工手册
+ dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"handbookStatus")&&StrUtil.equals(j.getDicItemName(),list.get(28).toString())).findFirst().orElse(null);
+ if (null!=dicItem){
+ empBaseInfo.setHandbookStatus(dicItem.getDicItemCode());
+ }
+
+ //工作证
+ dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"empCardStatus")&&StrUtil.equals(j.getDicItemName(),list.get(29).toString())).findFirst().orElse(null);
+ if (null!=dicItem){
+ empBaseInfo.setEmpCardStatus(dicItem.getDicItemCode());
+ }
+
+
empBaseInfo.setCertificateList(list.get(30).toString());
empBaseInfo.setDelFlag(2);
+ //入职类型
+ dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"lztype")&&StrUtil.equals(j.getDicItemName(),list.get(31).toString())).findFirst().orElse(null);
+ if (null!=dicItem){
+ empBaseInfo.setEntryType(dicItem.getDicItemCode());
+ }
empBaseInfo.setEmpStatus("0");
this.save(empBaseInfo);
}
@@ -471,24 +595,26 @@
manOld = sysConfig.get(0).getConfigValue();
womanOld = sysConfig.get(1).getConfigValue();
}
+ String[] split = remoteDeptService.userRightDepts().split(StringConstant.COMMA);
+ List<String> lists= Arrays.asList(split);
if ("1".equals(number)) { //在职员工
- iPage = this.empBaseInfoMapper.zzbaseInfoList(page, index, btime, etime, name);
+ iPage = this.empBaseInfoMapper.zzbaseInfoList(page, index, btime, etime, name,lists);
} else if ("2".equals(number)) { //新进员工
- iPage = this.empBaseInfoMapper.xjbaseInfoList(page, index, btime, etime, name);
+ iPage = this.empBaseInfoMapper.xjbaseInfoList(page, index, btime, etime, name,lists);
} else if ("3".equals(number)) { //正式员工
- iPage = this.empBaseInfoMapper.zsbaseInfoList(page, index, btime, etime, name);
+ iPage = this.empBaseInfoMapper.zsbaseInfoList(page, index, btime, etime, name,lists);
} else if ("4".equals(number)) { //临时员工
- iPage = this.empBaseInfoMapper.lsbaseInfoList(page, index, btime, etime, name);
+ iPage = this.empBaseInfoMapper.lsbaseInfoList(page, index, btime, etime, name,lists);
} else if ("5".equals(number)) { //超龄员工
- iPage = this.empBaseInfoMapper.clbaseInfoList(page, index, btime, etime, name, manOld, womanOld);
+ iPage = this.empBaseInfoMapper.clbaseInfoList(page, index, btime, etime, name, manOld, womanOld,lists);
} else if ("6".equals(number)) { //离职员工总数
- iPage = this.empBaseInfoMapper.lzbaseInfoList(page, index, btime, etime, name);
+ iPage = this.empBaseInfoMapper.lzbaseInfoList(page, index, btime, etime, name,lists);
} else if ("7".equals(number)) { //辞职申请人数
- iPage = this.empBaseInfoMapper.cjbaseInfoList(page, index, btime, etime, name);
+ iPage = this.empBaseInfoMapper.cjbaseInfoList(page, index, btime, etime, name,lists);
} else if ("8".equals(number) || "9".equals(number) || "10".equals(number)) { //正常离职人数 ,自动离职人数 ,公司辞退人数
- iPage = this.empBaseInfoMapper.zcbaseInfoList(page, index, btime, etime, name, number);
+ iPage = this.empBaseInfoMapper.zcbaseInfoList(page, index, btime, etime, name, number,lists);
} else if ("11".equals(number)) { //身份证到期
- iPage = this.empBaseInfoMapper.sfzbaseInfoList(page, index, btime, etime, name);
+ iPage = this.empBaseInfoMapper.sfzbaseInfoList(page, index, btime, etime, name,lists);
}
//设置部门
List<EmpBaseInfo> list = setDeptName(iPage.getRecords());
@@ -552,12 +678,14 @@
public IPage<EmpBaseInfo> baseInfoHeList(String index, String btime, String etime, String pageSize, String pageNum, String number, String name) {
Page<EmpBaseInfo> page = new Page<EmpBaseInfo>(new Long(pageNum), new Long(pageSize));
IPage<EmpBaseInfo> iPage = null;
+ String[] split = remoteDeptService.userRightDepts().split(StringConstant.COMMA);
+ List<String> lists= Arrays.asList(split);
if ("11".equals(number) || "13".equals(number) || "14".equals(number)) { //有效合同 ,新签合同,续签合同
- iPage = this.empBaseInfoMapper.yxbaseInfoList(page, index, btime, etime, name, number);
+ iPage = this.empBaseInfoMapper.yxbaseInfoList(page, index, btime, etime, name, number,lists);
} else if ("12".equals(number)) { //到期合同
- iPage = this.empBaseInfoMapper.dqbaseInfoList(page, index, btime, etime, name);
+ iPage = this.empBaseInfoMapper.dqbaseInfoList(page, index, btime, etime, name,lists);
} else if ("15".equals(number)) { //解除合同
- iPage = this.empBaseInfoMapper.jcseInfoList(page, index, btime, etime, name);
+ iPage = this.empBaseInfoMapper.jcseInfoList(page, index, btime, etime, name,lists);
}
//设置部门
List<EmpBaseInfo> list = setDeptName(iPage.getRecords());
@@ -581,7 +709,9 @@
Page<EmpDimissionAttend> page = new Page<EmpDimissionAttend>(new Long(pageNum), new Long(pageSize));
IPage<EmpDimissionAttend> iPage = null;
//q出勤人数 员工加班 员工旷工
- iPage = this.empBaseInfoMapper.empBaseInfoCqList(page, index, btime, etime, name, number);
+ String[] split = remoteDeptService.userRightDepts().split(StringConstant.COMMA);
+ List<String> lists= Arrays.asList(split);
+ iPage = this.empBaseInfoMapper.empBaseInfoCqList(page, index, btime, etime, name, number,lists);
return iPage;
}
@@ -591,7 +721,9 @@
Page<EmpLeaveInfo> page = new Page<EmpLeaveInfo>(new Long(pageNum), new Long(pageSize));
IPage<EmpLeaveInfo> iPage = null;
//员工请假
- iPage = this.empBaseInfoMapper.empBaseInfoQjList(page, index, btime, etime, name, number);
+ String[] split = remoteDeptService.userRightDepts().split(StringConstant.COMMA);
+ List<String> lists= Arrays.asList(split);
+ iPage = this.empBaseInfoMapper.empBaseInfoQjList(page, index, btime, etime, name, number,lists);
return iPage;
}
@@ -600,7 +732,9 @@
Page<EmpPhysicalExam> page = new Page<EmpPhysicalExam>(new Long(pageNum), new Long(pageSize));
IPage<EmpPhysicalExam> iPage = null;
//员工体检
- iPage = this.empBaseInfoMapper.empBaseInfoTjList(page, index, btime, etime, name, number);
+ String[] split = remoteDeptService.userRightDepts().split(StringConstant.COMMA);
+ List<String> lists= Arrays.asList(split);
+ iPage = this.empBaseInfoMapper.empBaseInfoTjList(page, index, btime, etime, name, number,lists);
return iPage;
}
@@ -609,7 +743,9 @@
Page<EmpLaborTrouble> page = new Page<EmpLaborTrouble>(new Long(pageNum), new Long(pageSize));
IPage<EmpLaborTrouble> iPage = null;
//劳资案件
- iPage = this.empBaseInfoMapper.empBaseInfoLzList(page, index, btime, etime, name, number);
+ String[] split = remoteDeptService.userRightDepts().split(StringConstant.COMMA);
+ List<String> lists= Arrays.asList(split);
+ iPage = this.empBaseInfoMapper.empBaseInfoLzList(page, index, btime, etime, name, number,lists);
return iPage;
}
@@ -618,7 +754,9 @@
Page<EmpJobChange> page = new Page<EmpJobChange>(new Long(pageNum), new Long(pageSize));
IPage<EmpJobChange> iPage = null;
//调岗
- iPage = this.empBaseInfoMapper.empBaseInfoTgList(page, index, btime, etime, name, number);
+ String[] split = remoteDeptService.userRightDepts().split(StringConstant.COMMA);
+ List<String> lists= Arrays.asList(split);
+ iPage = this.empBaseInfoMapper.empBaseInfoTgList(page, index, btime, etime, name, number,lists);
return iPage;
}
@@ -627,7 +765,9 @@
Page<EmpOccupational> page = new Page<EmpOccupational>(new Long(pageNum), new Long(pageSize));
IPage<EmpOccupational> iPage = null;
//工伤案件
- iPage = this.empBaseInfoMapper.empBaseInfoGsList(page, index, btime, etime, name, number);
+ String[] split = remoteDeptService.userRightDepts().split(StringConstant.COMMA);
+ List<String> lists= Arrays.asList(split);
+ iPage = this.empBaseInfoMapper.empBaseInfoGsList(page, index, btime, etime, name, number,lists);
return iPage;
}
@@ -636,7 +776,9 @@
Page<EmpAccidentCases> page = new Page<EmpAccidentCases>(new Long(pageNum), new Long(pageSize));
IPage<EmpAccidentCases> iPage = null;
//意外险案件
- iPage = this.empBaseInfoMapper.empBaseInfoYwList(page, index, btime, etime, name, number);
+ String[] split = remoteDeptService.userRightDepts().split(StringConstant.COMMA);
+ List<String> lists= Arrays.asList(split);
+ iPage = this.empBaseInfoMapper.empBaseInfoYwList(page, index, btime, etime, name, number,lists);
return iPage;
}
@@ -645,7 +787,9 @@
Page<EmpInsurance> page = new Page<EmpInsurance>(new Long(pageNum), new Long(pageSize));
IPage<EmpInsurance> iPage = null;
//社保
- iPage = this.empBaseInfoMapper.empBaseInfoSbList(page, index, btime, etime, name, number);
+ String[] split = remoteDeptService.userRightDepts().split(StringConstant.COMMA);
+ List<String> lists= Arrays.asList(split);
+ iPage = this.empBaseInfoMapper.empBaseInfoSbList(page, index, btime, etime, name, number,lists);
return iPage;
}
@@ -654,7 +798,9 @@
Page<EmpUnemployment> page = new Page<EmpUnemployment>(new Long(pageNum), new Long(pageSize));
IPage<EmpUnemployment> iPage = null;
//失业金
- iPage = this.empBaseInfoMapper.empBaseInfoSyjList(page, index, btime, etime, name, number);
+ String[] split = remoteDeptService.userRightDepts().split(StringConstant.COMMA);
+ List<String> lists= Arrays.asList(split);
+ iPage = this.empBaseInfoMapper.empBaseInfoSyjList(page, index, btime, etime, name, number,lists);
return iPage;
}
@@ -663,7 +809,9 @@
Page<EmpBadRecord> page = new Page<EmpBadRecord>(new Long(pageNum), new Long(pageSize));
IPage<EmpBadRecord> iPage = null;
//不良记录
- iPage = this.empBaseInfoMapper.empBaseInfoBlList(page, index, btime, etime, name, number);
+ String[] split = remoteDeptService.userRightDepts().split(StringConstant.COMMA);
+ List<String> lists= Arrays.asList(split);
+ iPage = this.empBaseInfoMapper.empBaseInfoBlList(page, index, btime, etime, name, number,lists);
return iPage;
}
@@ -676,55 +824,59 @@
manOld = sysConfig.get(0).getConfigValue();
womanOld = sysConfig.get(1).getConfigValue();
}
+ QueryWrapper queryWrapper=new QueryWrapper();
+ queryWrapper.in("t1.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA));
//在职员工,正式员工,临时员工,超龄员工
- Map<String, Object> stringObjectMap = this.baseMapper.countBaseInfoList(index, btime, etime, manOld, womanOld);
+ Map<String, Object> stringObjectMap = this.baseMapper.countBaseInfoList(index, btime, etime, manOld, womanOld,queryWrapper);
//正常离职,自动离职,公司辞退 判断条件创建日期
- Map<String, Object> zclzObjectMap = this.baseMapper.countZcygBaseInfoList(index, btime, etime);
+ Map<String, Object> zclzObjectMap = this.baseMapper.countZcygBaseInfoList(index, btime, etime,queryWrapper);
if (zclzObjectMap != null) {
stringObjectMap.put("zclz", zclzObjectMap.get("zclz").toString());
stringObjectMap.put("zdlz", zclzObjectMap.get("zdlz").toString());
stringObjectMap.put("gsct", zclzObjectMap.get("gsct").toString());
}
//新进员工 判断条件入职日期
- Integer xjygObjectMap = this.baseMapper.countXjygBaseInfoList(index, btime, etime);
+ Integer xjygObjectMap = this.baseMapper.countXjygBaseInfoList(index, btime, etime,queryWrapper);
if (xjygObjectMap != null) {
stringObjectMap.put("xjyg", xjygObjectMap);
}
//离职员工总数
- Integer empStatus = this.baseMapper.selectCount(new QueryWrapper<EmpBaseInfo>().eq("empStatus", 1));
+ Integer empStatus = this.baseMapper.selectCountlz(new QueryWrapper<EmpBaseInfo>()
+ .eq("t.delFlag", 0).eq("t.empStatus", 1)
+ .in("t1.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA)));
if (empStatus != null) {
stringObjectMap.put("lzyg", empStatus);
}
//解除合同 判断条件离职申请日期
- Map<String, Object> lzygObjectMap = this.baseMapper.countLzygBaseInfoList(index, btime, etime);
+ Map<String, Object> lzygObjectMap = this.baseMapper.countLzygBaseInfoList(index, btime, etime,queryWrapper);
if (lzygObjectMap != null) {
stringObjectMap.put("jcht", lzygObjectMap.get("jcht").toString());
}
//辞职申请员工总数 判断条件辞职申请日期
- Integer czygObjectMap = this.baseMapper.countCzygBaseInfoList(index, btime, etime);
+ Integer czygObjectMap = this.baseMapper.countCzygBaseInfoList(index, btime, etime,queryWrapper);
if (czygObjectMap != null) {
stringObjectMap.put("czyg", czygObjectMap);
}
//有效合同 判断条件合同签订日期
- Map<String, Object> yxhtObjectMap = this.baseMapper.countYxhtBaseInfoList(index, btime, etime);
+ Map<String, Object> yxhtObjectMap = this.baseMapper.countYxhtBaseInfoList(index, btime, etime,queryWrapper);
if (yxhtObjectMap != null) {
stringObjectMap.put("yxht", yxhtObjectMap.get("yxht").toString());
}
//新签合同,续签合同 判断条件合同签订日期
- Map<String, Object> xqhtObjectMap = this.baseMapper.countXqhtBaseInfoList(index, btime, etime);
+ Map<String, Object> xqhtObjectMap = this.baseMapper.countXqhtBaseInfoList(index, btime, etime,queryWrapper);
if (yxhtObjectMap != null) {
stringObjectMap.put("xinqht", xqhtObjectMap.get("xinqht").toString());
stringObjectMap.put("xqht", xqhtObjectMap.get("xqht").toString());
}
//到期合同 判断条件合同结束时间
- Integer dqhtObjectMap = this.baseMapper.countDqhtBaseInfoList(index, btime, etime);
+ Integer dqhtObjectMap = this.baseMapper.countDqhtBaseInfoList(index, btime, etime,queryWrapper);
if (dqhtObjectMap != null) {
stringObjectMap.put("dqht", dqhtObjectMap);
}
//出勤人数,员工加班,员工旷工 判断条件考勤月份 本年,本月
- Map<String, Object> cqrsObjectMap = this.baseMapper.countCqrsBaseInfoList(index, btime, etime);
+ Map<String, Object> cqrsObjectMap = this.baseMapper.countCqrsBaseInfoList(index, btime, etime,queryWrapper);
if (cqrsObjectMap != null) {
stringObjectMap.put("cqrs", cqrsObjectMap.get("cqrs").toString());
stringObjectMap.put("ygjb", cqrsObjectMap.get("ygjb").toString());
@@ -732,51 +884,51 @@
}
//员工请假 判断条件到岗时间
- Integer ygqjObjectMap = this.baseMapper.countYgqjBaseInfoList(index, btime, etime);
+ Integer ygqjObjectMap = this.baseMapper.countYgqjBaseInfoList(index, btime, etime,queryWrapper);
if (ygqjObjectMap != null) {
stringObjectMap.put("ygqj", ygqjObjectMap);
}
//劳资案件 判断条件仲裁日期
- Integer lzajObjectMap = this.baseMapper.countLzajBaseInfoList(index, btime, etime);
+ Integer lzajObjectMap = this.baseMapper.countLzajBaseInfoList(index, btime, etime,queryWrapper);
if (lzajObjectMap != null) {
stringObjectMap.put("lzaj", lzajObjectMap);
}
//工伤案件,意外险案件 判断条件受伤日期
- Map<String, Object> gsajObjectMap = this.baseMapper.countGsajBaseInfoList(index, btime, etime);
+ Map<String, Object> gsajObjectMap = this.baseMapper.countGsajBaseInfoList(index, btime, etime,queryWrapper);
if (gsajObjectMap != null) {
stringObjectMap.put("gsaj", gsajObjectMap.get("gsaj").toString());
stringObjectMap.put("ywxaj", gsajObjectMap.get("ywxaj").toString());
}
//社保申请 判断条件社保申请日期
- Integer sbsqObjectMap = this.baseMapper.countSbsqBaseInfoList(index, btime, etime);
+ Integer sbsqObjectMap = this.baseMapper.countSbsqBaseInfoList(index, btime, etime,queryWrapper);
if (sbsqObjectMap != null) {
stringObjectMap.put("sbsq", sbsqObjectMap);
}
//失业金领取 判断条件失业金申请日期
- Integer syjObjectMap = this.baseMapper.countSyjBaseInfoList(index, btime, etime);
+ Integer syjObjectMap = this.baseMapper.countSyjBaseInfoList(index, btime, etime,queryWrapper);
if (syjObjectMap != null) {
stringObjectMap.put("syj", syjObjectMap);
}
//员工体检 判断条件体检日期
- Integer ygtjObjectMap = this.baseMapper.countYgtjBaseInfoList(index, btime, etime);
+ Integer ygtjObjectMap = this.baseMapper.countYgtjBaseInfoList(index, btime, etime,queryWrapper);
if (ygtjObjectMap != null) {
stringObjectMap.put("ygtj", ygtjObjectMap);
}
//身份证到期 判断条件身份证有效时间
- Integer sfzObjectMap = this.baseMapper.countSfzBaseInfoList(index, btime, etime);
+ Integer sfzObjectMap = this.baseMapper.countSfzBaseInfoList(index, btime, etime,queryWrapper);
if (sfzObjectMap != null) {
stringObjectMap.put("sfz", sfzObjectMap);
}
//员工调岗 判断条件身份证有效时间
- Integer ygtgObjectMap = this.baseMapper.countYgtgBaseInfoList(index, btime, etime);
+ Integer ygtgObjectMap = this.baseMapper.countYgtgBaseInfoList(index, btime, etime,queryWrapper);
if (ygtgObjectMap != null) {
stringObjectMap.put("ygtg", ygtgObjectMap);
}
//不良记录 判断条件身份证有效时间
- Integer bljlObjectMap = this.baseMapper.countBljlBaseInfoList(index, btime, etime);
+ Integer bljlObjectMap = this.baseMapper.countBljlBaseInfoList(index, btime, etime,queryWrapper);
if (bljlObjectMap != null) {
stringObjectMap.put("bljl", bljlObjectMap);
}
@@ -806,30 +958,6 @@
if (StringUtils.isNotBlank(empBaseInfo.getCertificateNumb())) {
hasCondition = hasCondition | 1;
}
- if (StringUtils.isNotBlank(empBaseInfo.getEntryDateStr())) {
- hasCondition = hasCondition | 1;
- }
- if (StringUtils.isNotBlank(empBaseInfo.getDimissionDateStr())) {
- hasCondition = hasCondition | 1;
- }
- if (StringUtils.isNotBlank(empBaseInfo.getSex())) {
- hasCondition = hasCondition | 1;
- }
- if (StringUtils.isNotBlank(empBaseInfo.getEducation())) {
- hasCondition = hasCondition | 1;
- }
- if (StringUtils.isNotBlank(empBaseInfo.getPolitics())) {
- hasCondition = hasCondition | 1;
- }
- if (StringUtils.isNotBlank(empBaseInfo.getAgeStr())) {
- hasCondition = hasCondition | 1;
- }
- if (StringUtils.isNotBlank(empBaseInfo.getArchivesStatus())) {
- hasCondition = hasCondition | 1;
- }
- if (StringUtils.isNotBlank(empBaseInfo.getInsuranceType())) {
- hasCondition = hasCondition | 1;
- }
return hasCondition == 1;
}
@@ -844,67 +972,102 @@
//人员的状态,0-在职 1-离职 2-退休
if (StringUtils.isNotBlank(empBaseInfo.getEmpStatus())) {
queryWrapper.in("a.EmpStatus", empBaseInfo.getEmpStatus().split(","));
- } else {
- queryWrapper.in("a.EmpStatus", 0);
}
- // 下面的条件就是人员的属性条件,条件之间是或的关系
- if (this.checkQueryCondition(empBaseInfo)) {
+ if (StringUtils.isNotBlank(empBaseInfo.getEmpCardStatus())) {
+ queryWrapper.in("a.empCardStatus", empBaseInfo.getEmpCardStatus().split(","));
+ }
+ if (StringUtils.isNotBlank(empBaseInfo.getHandbookStatus())) {
+ queryWrapper.in("a.handBookStatus", empBaseInfo.getHandbookStatus().split(","));
+ }
+ // 关键词查询,是或的关系
+ if (StringUtils.isNotBlank(empBaseInfo.getBaseKey())) {
queryWrapper.and(p -> {
- if (StringUtils.isNotBlank(empBaseInfo.getEmpNumb())) {
- p.like("a.EmpNumb", empBaseInfo.getEmpNumb());
- }
- if (StringUtils.isNotBlank(empBaseInfo.getEmpName())) {
- p.or().like("a.EmpName", empBaseInfo.getEmpName());
- }
- if (StringUtils.isNotBlank(empBaseInfo.getDeptName())) {
- p.or().like("a.DeptName", empBaseInfo.getDeptName());
- }
- if (StringUtils.isNotBlank(empBaseInfo.getCertificateNumb())) {
- p.or().like("a.CertificateNumb", empBaseInfo.getCertificateNumb());
- }
- if (StringUtils.isNotBlank(empBaseInfo.getEntryDateStr())) {
- p.or().between("a.EntryDate", empBaseInfo.getEntryDateStr().split(",")[0], empBaseInfo.getEntryDateStr().split(",")[1]);
- }
- if (StringUtils.isNotBlank(empBaseInfo.getDimissionDateStr())) {
- p.or().between("a.DimissionDate", empBaseInfo.getDimissionDateStr().split(",")[0], empBaseInfo.getDimissionDateStr().split(",")[1]);
- }
- if (StringUtils.isNotBlank(empBaseInfo.getSex())) {
- p.or().in("a.Sex", empBaseInfo.getSex().split(","));
- }
- if (StringUtils.isNotBlank(empBaseInfo.getEducation())) {
- p.or().in("a.Education", empBaseInfo.getEducation().split(","));
- }
- if (StringUtils.isNotBlank(empBaseInfo.getPolitics())) {
- p.or().in("a.Politics", empBaseInfo.getPolitics().split(","));
- }
- if (StringUtils.isNotBlank(empBaseInfo.getAgeStr())) {
- String[] ages = empBaseInfo.getAgeStr().split(",");
- Consumer<QueryWrapper<EmpBaseInfo>> consumer = new Consumer<QueryWrapper<EmpBaseInfo>>() {
- public void accept(QueryWrapper<EmpBaseInfo> wrapper) {
- for (int i = 0; i < ages.length; i++) {
- String ageBtn = ages[i];
- wrapper.or().between("a.Age", ageBtn.split("-")[0], ageBtn.split("-")[1]);
- }
- }
- };
- p.or().and(consumer);
- }
- if (StringUtils.isNotBlank(empBaseInfo.getArchivesStatus())) {
- p.or().in("a.ArchivesStatus", empBaseInfo.getArchivesStatus().split(","));
- }
- if (StringUtils.isNotBlank(empBaseInfo.getInsuranceType())) {
- p.or().in("a.InsuranceType", empBaseInfo.getInsuranceType().split(","));
- }
- if (StringUtils.isNotBlank(empBaseInfo.getHandbookStatus())) {
- p.or().in("a.HandbookStatus", empBaseInfo.getHandbookStatus().split(","));
- }
- if (StringUtils.isNotBlank(empBaseInfo.getEmpCardStatus())) {
- p.or().in("a.EmpCardStatus", empBaseInfo.getEmpCardStatus().split(","));
- }
- if (StringUtils.isNotBlank(empBaseInfo.getEmpType())) {
- p.or().in("a.empType", empBaseInfo.getEmpType().split(","));
- }
+ p.like("a.EmpNumb", empBaseInfo.getBaseKey());
+ p.or().like("a.allDeptName", empBaseInfo.getBaseKey());
+ p.or().like("a.empName", empBaseInfo.getBaseKey());
+ p.or().like("a.CertificateNumb", empBaseInfo.getBaseKey());
+ p.or().like("a.archivesNumb", empBaseInfo.getBaseKey());
+ p.or().like("a.stature", empBaseInfo.getBaseKey());
+ p.or().like("a.seniority", empBaseInfo.getBaseKey());
+ p.or().like("a.nativePlace", empBaseInfo.getBaseKey());
+ p.or().like("a.censusAddress", empBaseInfo.getBaseKey());
+ p.or().like("a.guardNumb", empBaseInfo.getBaseKey());
+ p.or().like("a.telePhone", empBaseInfo.getBaseKey());
+ p.or().like("a.socialNumb", empBaseInfo.getBaseKey());
+ p.or().like("a.bankName", empBaseInfo.getBaseKey());
+ p.or().like("a.bankNumb", empBaseInfo.getBaseKey());
+ p.or().like("a.family", empBaseInfo.getBaseKey());
+ p.or().like("a.certificateList", empBaseInfo.getBaseKey());
});
+ }
+
+ if (StringUtils.isNotBlank(empBaseInfo.getEmpNumb())) {
+ queryWrapper.like("a.EmpNumb", empBaseInfo.getEmpNumb());
+ }
+ if (StringUtils.isNotBlank(empBaseInfo.getEmpName())) {
+ queryWrapper.like("a.EmpName", empBaseInfo.getEmpName());
+ }
+ if (StringUtils.isNotBlank(empBaseInfo.getDeptName())) {
+ queryWrapper.like("a.allDeptName", empBaseInfo.getDeptName());
+ }
+ if (StringUtils.isNotBlank(empBaseInfo.getCertificateNumb())) {
+ queryWrapper.like("a.CertificateNumb", empBaseInfo.getCertificateNumb());
+ }
+ if (StringUtils.isNotBlank(empBaseInfo.getEntryDateStr())) {
+ queryWrapper.between("a.EntryDate", empBaseInfo.getEntryDateStr().split(",")[0], empBaseInfo.getEntryDateStr().split(",")[1]);
+ }
+ if (StringUtils.isNotBlank(empBaseInfo.getDimissionDateStr())) {
+ queryWrapper.between("a.DimissionDate", empBaseInfo.getDimissionDateStr().split(",")[0], empBaseInfo.getDimissionDateStr().split(",")[1]);
+ }
+ if (StringUtils.isNotBlank(empBaseInfo.getSex())) {
+ queryWrapper.in("a.Sex", empBaseInfo.getSex().split(","));
+ }
+ if (StringUtils.isNotBlank(empBaseInfo.getEducation())) {
+ queryWrapper.in("a.Education", empBaseInfo.getEducation().split(","));
+ }
+ if (StringUtils.isNotBlank(empBaseInfo.getPolitics())) {
+ queryWrapper.in("a.Politics", empBaseInfo.getPolitics().split(","));
+ }
+ if (StringUtils.isNotBlank(empBaseInfo.getAgeStr())) {
+ String[] ages = empBaseInfo.getAgeStr().split(",");
+ Consumer<QueryWrapper<EmpBaseInfo>> consumer = new Consumer<QueryWrapper<EmpBaseInfo>>() {
+ @Override
+ public void accept(QueryWrapper<EmpBaseInfo> wrapper) {
+ for (int i = 0; i < ages.length; i++) {
+ String ageBtn = ages[i];
+ wrapper.or().between("a.Age", ageBtn.split("-")[0], ageBtn.split("-")[1]);
+ }
+ }
+ };
+ queryWrapper.and(consumer);
+ }
+ if (StringUtils.isNotBlank(empBaseInfo.getArchivesStatus())) {
+ queryWrapper.in("a.ArchivesStatus", empBaseInfo.getArchivesStatus().split(","));
+ }
+ if (StringUtils.isNotBlank(empBaseInfo.getInsuranceType())) {
+ queryWrapper.in("a.InsuranceType", empBaseInfo.getInsuranceType().split(","));
+ }
+ if (StringUtils.isNotBlank(empBaseInfo.getHandbookStatus())) {
+ queryWrapper.in("a.HandbookStatus", empBaseInfo.getHandbookStatus().split(","));
+ }
+ if (StringUtils.isNotBlank(empBaseInfo.getEmpCardStatus())) {
+ queryWrapper.in("a.EmpCardStatus", empBaseInfo.getEmpCardStatus().split(","));
+ }
+ if (StringUtils.isNotBlank(empBaseInfo.getEmpType())) {
+ queryWrapper.in("a.empType", empBaseInfo.getEmpType().split(","));
+ }
+ if (StringUtils.isNotBlank(empBaseInfo.getEntryType())) {
+ queryWrapper.in("a.entryType", empBaseInfo.getEntryType().split(","));
+ }
+ 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;
@@ -934,10 +1097,179 @@
@Override
public EmpBaseInfo getEmpBaseInfoByEmpNumb(String empNumb) {
try {
- return this.getOne(new LambdaQueryWrapper<EmpBaseInfo>().eq(EmpBaseInfo::getEmpNumb,empNumb).ne(EmpBaseInfo::getDelFlag,1));
- }catch (Exception e){
- return null;
+ return this.getOne(new LambdaQueryWrapper<EmpBaseInfo>().eq(EmpBaseInfo::getEmpNumb, empNumb).ne(EmpBaseInfo::getDelFlag, 1));
+ } catch (Exception e) {
+ return null;
}
}
+
+ @Override
+ public void exportEmpAll(HttpServletResponse response, EmpBaseInfo empBaseinfo) throws IOException {
+ //获取字典
+ List<DicItem> dicItemList = remoteDicItemService.getAllDicitemsAll();
+ Map<String, Object> map = new HashMap<>();
+
+ List<Long> itemCode = dicItemList.stream().map(i -> i.getDicId()).distinct().collect(Collectors.toList());
+ itemCode.stream().forEach(i -> {
+ List<DicItem> dicItems = dicItemList.stream().filter(j -> j.getDicId().equals(i)).collect(Collectors.toList());
+ Map<String, Object> itemMap = new HashMap<>();
+ dicItems.stream().forEach(dicItem -> itemMap.put(dicItem.getDicItemCode(), dicItem.getDicItemName()));
+ map.put(dicItems.get(0).getDicCode().toLowerCase(), itemMap);
+ });
+ List<String> sheetNames = new ArrayList<>();
+ sheetNames.add("基本信息");
+ //基本信息
+ QueryRequest request = new QueryRequest();
+ request.setPageSize(25535);
+ request.setPageNum(1);
+ List<EmpBaseInfo> exportList = this.findZsEmpBaseInfos(request, empBaseinfo).getRecords();
+ List<Map<String, Object>> listMapDicItem = new ArrayList();
+ listMapDicItem.add(map);
+ String exportField = "archivesNumb, deptName, jobName, empName, certificateNumb, certificateValidity, sexName, nationName, age, marriageName, stature, birthdate, politicsName, empTypeName, educationName, nativePlaceName, censusAddress, currentAddress, guardNumb, returnReceipt, archivesStatusName, bankName, bankNumb, telePhone, entryDate, InsuranceTypeName, socialNumb, introducer, seniority, empCardStatusName, certificateList, urgencyPhone, handbookStatusName, family, empStatusName, dimissionDate";
+ List<Map<String, Object>> allList = PoiExportExcel.getDataList(exportField, exportList, null);
+ Page<EmpBaseInfo> page = new Page<>(request.getPageNum(), request.getPageSize());
+ List<Long> empIds = exportList.stream().map(i -> i.getEmpId()).collect(Collectors.toList());
+
+ //工作经历
+ IPage<EmpWorkExperience> workExperienceIPage = empWorkExperienceMapper.selectPageVo(page, new QueryWrapper<EmpWorkExperience>().in("a.empId", empIds).ne("a.delFlag", 1));
+ 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));
+ sheetNames.add("工作经历");
+ }
+
+ //体检信息
+ IPage<EmpPhysicalExam> empPhysicalExamIPage = empPhysicalExamMapper.selectPageVo(page, new QueryWrapper<EmpPhysicalExam>().in("a.empId", empIds).ne("a.delFlag", 1));
+ 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));
+ sheetNames.add("体检信息");
+ }
+
+ //调岗记录
+ IPage<EmpJobChange> jobChangeIPage = empJobChangeMapper.selectPageVoBean(page, new QueryWrapper<EmpJobChange>().in("a.empId", empIds).ne("a.delFlag", 1));
+ 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));
+ sheetNames.add("调岗记录");
+ }
+
+ //合同信息
+ IPage<EmpContractInfo> empContractInfoIPage = empContractInfoMapper.selectPageVo(page, new QueryWrapper<EmpContractInfo>().in("a.empId", empIds).ne("a.delFlag", 1));
+ 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));
+ sheetNames.add("合同信息");
+ }
+
+ //入离职记录
+ IPage<EmpDimissionAttend> empDimissionAttendIPage = empDimissionAttendMapper.selectPageVo(page, new QueryWrapper<EmpDimissionAttend>().in("a.empId", empIds).ne("a.delFlag", 1));
+ 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));
+ sheetNames.add("入离职记录");
+ }
+
+ //请假记录
+ IPage<EmpLeaveInfo> empLeaveInfoIPage = empLeaveInfoMapper.selectPageVo(page, new QueryWrapper<EmpLeaveInfo>().in("a.empId", empIds).ne("a.delFlag", 1));
+ 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));
+ sheetNames.add("请假记录");
+ }
+
+
+ //失业金领取
+ IPage<EmpUnemployment> empUnemploymentIPage = empUnemploymentMapper.selectPageVo(page, new QueryWrapper<EmpUnemployment>().in("a.empId", empIds).ne("a.delFlag", 1));
+ 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));
+ sheetNames.add("失业金领取");
+ }
+
+ //社保申请
+ IPage<EmpInsurance> empInsuranceIPage = empInsuranceMapper.selectPageVo(page, new QueryWrapper<EmpInsurance>().in("a.empId", empIds).ne("a.delFlag", 1));
+ 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));
+ sheetNames.add("社保申请");
+ }
+
+
+ //意外险案件
+ IPage<EmpAccidentCases> empAccidentCasesIPage = empAccidentCasesMapper.selectPageVo(page, new QueryWrapper<EmpInsurance>().in("a.empId", empIds).ne("a.delFlag", 1));
+ 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));
+ sheetNames.add("意外险案件");
+ }
+
+ //工伤案件
+ IPage<EmpOccupational> empOccupationalIPage = empOccupationalMapper.selectPageVo(page, new QueryWrapper<EmpOccupational>().in("a.empId", empIds).ne("a.delFlag", 1));
+ 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));
+ sheetNames.add("工伤案件");
+ }
+
+ //劳资案件
+ IPage<EmpLaborTrouble> empLaborTroubleIPage = empLaborTroubleMapper.selectPageVo(page, new QueryWrapper<EmpInsurance>().in("a.empId", empIds).ne("a.delFlag", 1));
+ 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));
+ sheetNames.add("劳资案件");
+ }
+
+
+ //不良记录
+ IPage<EmpBadRecord> empBadRecordIPage = empBadRecordMapper.selectPageVo(page, new QueryWrapper<EmpInsurance>().in("a.empId", empIds).ne("a.delFlag", 1));
+ 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));
+ sheetNames.add("不良记录");
+ }
+
+
+ //备注信息
+ IPage<EmpRemarkInfo> empRemarkInfoIPage = empRemarkInfoMapper.selectPageVo(page, new QueryWrapper<EmpRemarkInfo>().in("a.empId", empIds).ne("a.delFlag", 1));
+ 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));
+ sheetNames.add("备注信息");
+ }
+
+
+ boolean result = PoiExportExcel.exportCommonExcelMultiSheet(response, "在职员工列表", allList, sheetNames);
+ }
+
+ @Override
+ public boolean verifyCertificateNumb(EmpBaseInfo empBaseInfo) {
+ QueryWrapper<EmpBaseInfo> queryWrapper = new QueryWrapper<>();
+ queryWrapper.lambda().eq(EmpBaseInfo::getCertificateNumb, empBaseInfo.getCertificateNumb())
+ .ne(EmpBaseInfo::getDelFlag, 1);;
+ if (empBaseInfo.getEmpId()!=null) {
+ queryWrapper.lambda().ne(EmpBaseInfo::getEmpId, empBaseInfo.getEmpId());
+ }
+
+ return this.count(queryWrapper) > 0;
+ }
+
+ @Override
+ public List<EmpBaseInfo> listAll(QueryWrapper<EmpBaseInfo> wrapper) {
+ return this.baseMapper.listAll(wrapper);
+ }
}
--
Gitblit v1.8.0