| | |
| | | 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.entity.constant.StringConstant; |
| | | 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.server.hr.feign.IRemoteUserService; |
| | | import cc.mrbird.febs.server.hr.mapper.EmpContractInfoMapper; |
| | | import cc.mrbird.febs.server.hr.properties.FebsServerHrProperties; |
| | | import cc.mrbird.febs.server.hr.service.IEmpContractInfoService; |
| | | import cc.mrbird.febs.server.hr.service.IEmpDimissionLogService; |
| | | import cc.mrbird.febs.server.hr.service.IEmpJobChangeService; |
| | | import cn.hutool.core.date.DateUnit; |
| | | 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 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 javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * name:EmpBaseinfo |
| | |
| | | @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) |
| | | class EmpBaseInfoServiceImpl extends ServiceImpl<EmpBaseInfoMapper, EmpBaseInfo> implements IEmpBaseInfoService { |
| | | private final RedisService redisService; |
| | | private final IRemoteDeptService remoteDeptService; |
| | | private final IRemoteUserService iRemoteUserService; |
| | | private final EmpBaseInfoMapper empBaseInfoMapper; |
| | | private final IEmpDimissionLogService dimissionLogService; |
| | | private final IEmpJobChangeService jobChangeService; |
| | | |
| | | 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"); |
| | | |
| | | @Override |
| | | public IPage<EmpBaseInfo> findEmpBaseInfos(QueryRequest request, EmpBaseInfo empBaseInfo) { |
| | | LambdaQueryWrapper<EmpBaseInfo> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(EmpBaseInfo::getDelFlag, empBaseInfo.getDelFlag()); |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpNumb())) { |
| | | queryWrapper.like(EmpBaseInfo::getEmpNumb, empBaseInfo.getEmpNumb()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpName())) { |
| | | queryWrapper.like(EmpBaseInfo::getEmpName, empBaseInfo.getEmpName()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getCertificateNumb())) { |
| | | queryWrapper.like(EmpBaseInfo::getCertificateNumb, empBaseInfo.getCertificateNumb()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getDeptName())) { |
| | | queryWrapper.like(EmpBaseInfo::getDeptName, empBaseInfo.getDeptName()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEntryDateStr())) { |
| | | queryWrapper.between(EmpBaseInfo::getEntryDate, empBaseInfo.getEntryDateStr().split(",")[0], empBaseInfo.getEntryDateStr().split(",")[1]); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getDimissionDateStr())) { |
| | | queryWrapper.between(EmpBaseInfo::getDimissionDate, empBaseInfo.getDimissionDateStr().split(",")[0], empBaseInfo.getDimissionDateStr().split(",")[1]); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getSex())) { |
| | | queryWrapper.eq(EmpBaseInfo::getSex, empBaseInfo.getSex()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEducation())) { |
| | | queryWrapper.like(EmpBaseInfo::getEducation, empBaseInfo.getEducation()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getPolitics())) { |
| | | queryWrapper.like(EmpBaseInfo::getPolitics, empBaseInfo.getPolitics()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getAgeStr())) { |
| | | queryWrapper.between(EmpBaseInfo::getAge, empBaseInfo.getAgeStr().split(",")[0], empBaseInfo.getAgeStr().split(",")[1]); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getArchivesStatus())) { |
| | | queryWrapper.eq(EmpBaseInfo::getArchivesStatus, empBaseInfo.getArchivesStatus()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getInsuranceType())) { |
| | | queryWrapper.eq(EmpBaseInfo::getInsuranceType, empBaseInfo.getInsuranceType()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpStatus())) { |
| | | queryWrapper.eq(EmpBaseInfo::getEmpStatus, empBaseInfo.getEmpStatus()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getHandbookStatus())) { |
| | | queryWrapper.eq(EmpBaseInfo::getHandbookStatus, empBaseInfo.getHandbookStatus()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpCardStatus())) { |
| | | queryWrapper.eq(EmpBaseInfo::getEmpCardStatus, empBaseInfo.getEmpCardStatus()); |
| | | } |
| | | return this.findZsEmpBaseInfos(request, empBaseInfo); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<EmpBaseInfo> findZsEmpBaseInfos(QueryRequest request, EmpBaseInfo empBaseInfo) { |
| | | Page<EmpBaseInfo> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<EmpBaseInfo> iPage = this.page(page, queryWrapper); |
| | | IPage<EmpBaseInfo> iPage = empBaseInfoMapper.selectPageVo(page, createQueryWrapper(empBaseInfo)); |
| | | //设置部门 |
| | | List<EmpBaseInfo> list = setDeptName(iPage.getRecords()); |
| | | List<DicItem> dicItems = CastUtil.castList(redisService.get("dicItems"), DicItem.class); |
| | | list.forEach(p -> { |
| | | p.setSexName("1".equals(p.getSex()) ? "男" : "女"); |
| | | p.setEmpTypeName("1".equals(p.getEmpType()) ? "正式工" : "临时工"); |
| | | p.setInsuranceTypeName("1".equals(p.getInsuranceType()) ? "(深户)五险一档" : "(非深户)五险一档"); |
| | | p.setArchivesStatusName("0".equals(p.getArchivesStatus()) ? "未移交" : "已移交"); |
| | | // 设置民族 |
| | | p.setNationName(dicItems.stream() |
| | | .filter(k -> DicCode.NATION.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getNation())) |
| | | p.setEmpCardStatusName("1".equals(p.getEmpCardStatus()) ? "未发" : "已发"); |
| | | p.setHandbookStatusName("1".equals(p.getHandbookStatus()) ? "未发" : "已发"); |
| | | //保险类型 |
| | | p.setInsuranceTypeName(dicItems.stream() |
| | | .filter(k -> DicCode.INSURANCETYPE.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getInsuranceType())) |
| | | .findFirst() |
| | | .map(DicItem::getDicItemName) |
| | | .orElse("汉族")); |
| | | // 设置政治面貌 |
| | | p.setPoliticsName(dicItems.stream() |
| | | .filter(k -> DicCode.PLITICAL.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getPolitics())) |
| | | //员工类别 |
| | | p.setEmpTypeName(dicItems.stream() |
| | | .filter(k -> DicCode.EMPTYPE.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getEmpType())) |
| | | .findFirst() |
| | | .map(DicItem::getDicItemName) |
| | | .orElse("群众")); |
| | | // 设置婚姻状况 |
| | | p.setMarriageName(dicItems.stream() |
| | | .filter(k -> DicCode.MARRIAGE.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getMarriage())) |
| | | .findFirst() |
| | | .map(DicItem::getDicItemName) |
| | | .orElse("未婚")); |
| | | // 设置学历 |
| | | p.setEducationName(dicItems.stream() |
| | | .filter(k -> DicCode.EDUCATION.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getEducation())) |
| | | .findFirst() |
| | | .map(DicItem::getDicItemName) |
| | | .orElse("无学历")); |
| | | // 设置籍贯 |
| | | p.setNativePlaceName(dicItems.stream() |
| | | .filter(k -> DicCode.NATIVEPLACE.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getNativePlace())) |
| | | .findFirst() |
| | | .map(DicItem::getDicItemName) |
| | | .orElse("未知")); |
| | | }); |
| | | iPage.setRecords(list); |
| | | return iPage; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<EmpBaseInfo> findZsEmpBaseInfos(QueryRequest request, EmpBaseInfo empBaseInfo) { |
| | | LambdaQueryWrapper<EmpBaseInfo> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(EmpBaseInfo::getDelFlag, empBaseInfo.getDelFlag()); |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpNumb())) { |
| | | queryWrapper.like(EmpBaseInfo::getEmpNumb, empBaseInfo.getEmpNumb()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpName())) { |
| | | queryWrapper.like(EmpBaseInfo::getEmpName, empBaseInfo.getEmpName()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getCertificateNumb())) { |
| | | queryWrapper.like(EmpBaseInfo::getCertificateNumb, empBaseInfo.getCertificateNumb()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getDeptName())) { |
| | | queryWrapper.like(EmpBaseInfo::getDeptName, empBaseInfo.getDeptName()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEntryDateStr())) { |
| | | queryWrapper.between(EmpBaseInfo::getEntryDate, empBaseInfo.getEntryDateStr().split(",")[0], empBaseInfo.getEntryDateStr().split(",")[1]); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getDimissionDateStr())) { |
| | | queryWrapper.between(EmpBaseInfo::getDimissionDate, empBaseInfo.getDimissionDateStr().split(",")[0], empBaseInfo.getDimissionDateStr().split(",")[1]); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getSex())) { |
| | | queryWrapper.in(EmpBaseInfo::getSex, empBaseInfo.getSex().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEducation())) { |
| | | queryWrapper.in(EmpBaseInfo::getEducation, empBaseInfo.getEducation().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getPolitics())) { |
| | | queryWrapper.in(EmpBaseInfo::getPolitics, empBaseInfo.getPolitics().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getAgeStr())) { |
| | | String[] ages=empBaseInfo.getAgeStr().split(","); |
| | | for (int i = 0; i < ages.length; i++) { |
| | | String ageBtn=ages[i]; |
| | | queryWrapper.between(EmpBaseInfo::getAge, ageBtn.split("-")[0], ageBtn.split("-")[1]); |
| | | } |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getArchivesStatus())) { |
| | | queryWrapper.in(EmpBaseInfo::getArchivesStatus, empBaseInfo.getArchivesStatus().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getInsuranceType())) { |
| | | queryWrapper.in(EmpBaseInfo::getInsuranceType, empBaseInfo.getInsuranceType().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpStatus())) { |
| | | queryWrapper.in(EmpBaseInfo::getEmpStatus, empBaseInfo.getEmpStatus().split(",")); |
| | | } |
| | | Page<EmpBaseInfo> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<EmpBaseInfo> iPage = this.page(page, queryWrapper); |
| | | //设置部门 |
| | | List<EmpBaseInfo> list = setDeptName(iPage.getRecords()); |
| | | List<DicItem> dicItems = CastUtil.castList(redisService.get("dicItems"), DicItem.class); |
| | | list.forEach(p -> { |
| | | p.setSexName("1".equals(p.getSex()) ? "男" : "女"); |
| | | p.setEmpTypeName("1".equals(p.getEmpType()) ? "正式工" : "临时工"); |
| | | p.setInsuranceTypeName("1".equals(p.getInsuranceType()) ? "(深户)五险一档" : "(非深户)五险一档"); |
| | | p.setArchivesStatusName("0".equals(p.getArchivesStatus()) ? "未移交" : "已移交"); |
| | | .orElse("汉族")); |
| | | // 设置民族 |
| | | p.setNationName(dicItems.stream() |
| | | .filter(k -> DicCode.NATION.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getNation())) |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void createEmpBaseInfo(EmpBaseInfo empBaseInfo) { |
| | | EmpBaseInfo dbInfo = this.getEmpBaseInfo(empBaseInfo); |
| | | if(dbInfo==null) { |
| | | if (dbInfo == null) { |
| | | empBaseInfo.setEmpId(SequenceUtil.generateId(0L, ModuleCode.HR_EMPLOYEE)); |
| | | } else{ |
| | | } else { |
| | | empBaseInfo.setEmpId(dbInfo.getEmpId()); |
| | | } |
| | | if (StrUtil.isNotBlank(empBaseInfo.getImagePath())) { |
| | | String path = properties.getEmpBaseInfoPath() + empBaseInfo.getEmpId() + ".png"; |
| | | if (MyUtil.generateImage(empBaseInfo.getImagePath(), path)) { |
| | | empBaseInfo.setImagePath(empBaseInfo.getEmpId() + ".png"); |
| | | } |
| | | ; |
| | | } |
| | | empBaseInfo.setCreator(operatorId); |
| | | empBaseInfo.setModifier(operatorId); |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateEmpBaseInfo(EmpBaseInfo empBaseInfo) { |
| | | if (StrUtil.isNotBlank(empBaseInfo.getImagePath())) { |
| | | String path = properties.getEmpBaseInfoPath() + empBaseInfo.getEmpId() + ".png"; |
| | | if (MyUtil.generateImage(empBaseInfo.getImagePath(), path)) { |
| | | empBaseInfo.setImagePath(empBaseInfo.getEmpId() + ".png"); |
| | | } |
| | | |
| | | } |
| | | EmpBaseInfo dbData = this.getById(empBaseInfo.getEmpId()); |
| | | empBaseInfo.setCreateTime(dbData.getCreateTime()); |
| | | empBaseInfo.setCreator(dbData.getCreator()); |
| | |
| | | @Override |
| | | public boolean verifyEmpNumb(EmpBaseInfo empBaseInfo) { |
| | | QueryWrapper<EmpBaseInfo> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.lambda().eq(EmpBaseInfo::getEmpNumb, empBaseInfo.getEmpNumb()); |
| | | EmpBaseInfo tempEmpBaseInfo = this.getOne(queryWrapper); |
| | | if (tempEmpBaseInfo == null) { |
| | | queryWrapper.lambda().eq(EmpBaseInfo::getEmpNumb, empBaseInfo.getEmpNumb()) |
| | | .ne(EmpBaseInfo::getDelFlag, 1); |
| | | if (empBaseInfo.getEmpId()!=null) { |
| | | queryWrapper.lambda().ne(EmpBaseInfo::getEmpId, empBaseInfo.getEmpId()); |
| | | } |
| | | |
| | | if (this.count(queryWrapper) <= 0) { |
| | | return false; |
| | | } |
| | | return !empBaseInfo.getEmpId().equals(tempEmpBaseInfo.getEmpId()); |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | public EmpBaseInfo getEmpBaseInfo(EmpBaseInfo empBaseInfo) { |
| | | QueryWrapper<EmpBaseInfo> queryWrapper = new QueryWrapper<>(); |
| | | if(StringUtils.isNotEmpty(empBaseInfo.getCertificateNumb())){ |
| | | if (StringUtils.isNotEmpty(empBaseInfo.getCertificateNumb())) { |
| | | queryWrapper.lambda().eq(EmpBaseInfo::getCertificateNumb, empBaseInfo.getCertificateNumb()); |
| | | } |
| | | return this.getOne(queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 关闭员工档案 |
| | | * |
| | | * <p> |
| | | * date 2021-02-18 12:54 |
| | | * @author: luoyibo |
| | | * |
| | | * @param empDimissionLog |
| | | * @return boolean |
| | | * @author: luoyibo |
| | | */ |
| | | @Override |
| | | public boolean closeEmpArchives(EmpDimissionLog empDimissionLog) { |
| | | String[] str = empDimissionLog.getEmpIds().split(","); |
| | | List<String> list = new ArrayList<>(Arrays.asList(str)); |
| | | String[] strDate = empDimissionLog.getEntryDates().split(","); |
| | | |
| | | EmpDimissionLog dimissionLog = null; |
| | | for (int i = 0,k=str.length; i < k; i++) { |
| | | for (int i = 0, k = str.length; i < k; i++) { |
| | | dimissionLog = new EmpDimissionLog(); |
| | | dimissionLog.setCloseId(SequenceUtil.generateId(0L, ModuleCode.HR_EMPLOYEE)); |
| | | dimissionLog.setEmpId(Long.parseLong(str[i])); |
| | | dimissionLog.setEntryDate(DateUtil.parse(strDate[i],"yyyy-MM-dd")); |
| | | dimissionLog.setEntryDate(DateUtil.parse(strDate[i], "yyyy-MM-dd")); |
| | | dimissionLog.setDimissionDate(empDimissionLog.getDimissionDate()); |
| | | dimissionLog.setDimissionType(empDimissionLog.getDimissionType()); |
| | | dimissionLog.setRemark(empDimissionLog.getRemark()); |
| | |
| | | dimissionLog.setReporter(empDimissionLog.getReporter()); |
| | | dimissionLog.setCreator(operatorId); |
| | | dimissionLog.setModifier(operatorId); |
| | | |
| | | dimissionLogService.save(dimissionLog); |
| | | } |
| | | return empBaseInfoMapper.closeEmpArchives(list, empDimissionLog.getDimissionType(), empDimissionLog.getDimissionDate(), empDimissionLog.getRemark(), operatorId)>0; |
| | | |
| | | if (StrUtil.isNotBlank(empDimissionLog.getAfterOperation())) { |
| | | String[] strAfterOperation = empDimissionLog.getAfterOperation().split(","); |
| | | int flag = 0; |
| | | for (String s : strAfterOperation) { |
| | | flag = flag + Integer.parseInt(s); |
| | | } |
| | | switch (flag) { |
| | | case 1: |
| | | //解除合同 |
| | | |
| | | empContractInfoMapper.terminateContract(new ArrayList<>(Arrays.asList(empDimissionLog.getEmpIds().split(StringConstant.COMMA))), operatorId); |
| | | break; |
| | | case 2: |
| | | //禁用账户 |
| | | iRemoteUserService.updateStatus(empDimissionLog.getCertificateNumb()); |
| | | break; |
| | | case 3: |
| | | empContractInfoMapper.terminateContract(new ArrayList<>(Arrays.asList(empDimissionLog.getEmpIds().split(StringConstant.COMMA))), operatorId); |
| | | iRemoteUserService.updateStatus(empDimissionLog.getCertificateNumb()); |
| | | break; |
| | | } |
| | | } |
| | | return empBaseInfoMapper.closeEmpArchives(list, empDimissionLog.getDimissionType(), empDimissionLog.getDimissionDate(), empDimissionLog.getRemark(), operatorId) > 0; |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 员工岗位变更 |
| | | * |
| | | * <p> |
| | | * date 2021-02-18 20:32 |
| | | * @author: luoyibo |
| | | * |
| | | * @param empJobChange 1 |
| | | * @return boolean |
| | | * @author: luoyibo |
| | | */ |
| | | @Override |
| | | public boolean changeEmpJob(EmpJobChange empJobChange) { |
| | |
| | | |
| | | EmpJobChange saveChange = null; |
| | | |
| | | for (int i = 0,k=str.length; i <k ; i++) { |
| | | for (int i = 0, k = str.length; i < k; i++) { |
| | | saveChange = new EmpJobChange(); |
| | | saveChange.setJobChangeId(SequenceUtil.generateId(0L, ModuleCode.HR_EMPLOYEE)); |
| | | saveChange.setEmpId(Long.parseLong(str[i])); |
| | |
| | | mapParams.put("jobId", empJobChange.getJobId()); |
| | | mapParams.put("jobName", empJobChange.getNewJobName()); |
| | | mapParams.put("operatorId", operatorId); |
| | | return empBaseInfoMapper.changeEmpJob(list,mapParams)>0; |
| | | return empBaseInfoMapper.changeEmpJob(list, mapParams) > 0; |
| | | } |
| | | |
| | | /** |
| | | * 导入员工 |
| | | * |
| | | * @param listObject |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void importEmpBaseInfo(List<List<Object>> listObject) { |
| | | for (List<Object> list : listObject) { |
| | | EmpBaseInfo empBaseInfo = new EmpBaseInfo(); |
| | | empBaseInfo.setEmpId(SequenceUtil.generateId(0L, ModuleCode.HR_EMPLOYEE)); |
| | | empBaseInfo.setEmpNumb(list.get(0).toString()); |
| | | List<Dept> depts = CastUtil.castList(redisService.get("depts"), Dept.class); |
| | | empBaseInfo.setDeptName(list.get(1).toString()); |
| | | Long deptId=depts.stream().filter(d -> d.getDeptName().equals(list.get(1).toString())).findFirst().get().getDeptId(); |
| | | empBaseInfo.setDeptId(deptId); |
| | | empBaseInfo.setJobName(list.get(2).toString()); |
| | | empBaseInfo.setEmpName(list.get(3).toString()); |
| | | empBaseInfo.setCertificateNumb(list.get(4).toString()); |
| | | empBaseInfo.setSex("男".equals(list.get(5).toString())?"1":"0"); |
| | | if (StringUtils.isNotBlank(list.get(6).toString())) { |
| | | empBaseInfo.setAge(Integer.valueOf(list.get(6).toString())); |
| | | } |
| | | empBaseInfo.setEducation(list.get(7).toString()); |
| | | empBaseInfo.setNativePlace(list.get(8).toString()); |
| | | empBaseInfo.setTelePhone(list.get(9).toString()); |
| | | if (StringUtils.isNotBlank(list.get(10).toString())) { |
| | | empBaseInfo.setEntryDate(DateUtil.parseDate(list.get(10).toString())); |
| | | } |
| | | empBaseInfo.setEmpStatus("0"); |
| | | this.save(empBaseInfo); |
| | | } |
| | | public void importEmpBaseInfo(List<List<Object>> listObject, List<String> returnList) { |
| | | for (List<Object> list : listObject) { |
| | | if (list.size() == 0) { |
| | | continue; |
| | | } |
| | | if (this.count(new LambdaQueryWrapper<EmpBaseInfo>().eq(EmpBaseInfo::getEmpNumb, list.get(1).toString()).ne(EmpBaseInfo::getDelFlag, 1)) > 0) { |
| | | returnList.add(StrUtil.format("导入员工基本信息异常: 出现位置第{}行, 原因:{}员工编号重复", listObject.indexOf(list) + 1, list.get(1).toString())); |
| | | continue; |
| | | } |
| | | EmpBaseInfo empBaseInfo = new EmpBaseInfo(); |
| | | 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); |
| | | if (null == dept) { |
| | | returnList.add(StrUtil.format("导入员工基本信息异常: 出现位置第{}行, 原因:{}部门不存在", listObject.indexOf(list) + 1, list.get(3).toString())); |
| | | continue; |
| | | } |
| | | empBaseInfo.setDeptId(dept.getDeptId()); |
| | | empBaseInfo.setJobName(list.get(4).toString()); |
| | | empBaseInfo.setEmpType(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())); |
| | | } |
| | | empBaseInfo.setPolitics(list.get(11).toString()); |
| | | if (StringUtils.isNotBlank(list.get(12).toString())) { |
| | | empBaseInfo.setEntryDate(DateUtil.parseDate(list.get(12).toString())); |
| | | } |
| | | empBaseInfo.setEducation(list.get(13).toString()); |
| | | if (StringUtils.isNotBlank(list.get(14).toString())) { |
| | | empBaseInfo.setSeniority(Integer.valueOf(list.get(14).toString())); |
| | | } |
| | | empBaseInfo.setNativePlace(list.get(15).toString()); |
| | | empBaseInfo.setCensusAddress(list.get(16).toString()); |
| | | empBaseInfo.setCurrentAddress(list.get(17).toString()); |
| | | 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()); |
| | | 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()); |
| | | empBaseInfo.setCertificateList(list.get(30).toString()); |
| | | empBaseInfo.setDelFlag(2); |
| | | empBaseInfo.setEmpStatus("0"); |
| | | this.save(empBaseInfo); |
| | | } |
| | | } |
| | | |
| | | } |
| | | @Override |
| | | public void getImage(String empId, HttpServletResponse response) throws Exception { |
| | | EmpBaseInfo empBaseInfo = this.getById(empId); |
| | | if (StrUtil.isBlank(empBaseInfo.getImagePath())) { |
| | | return; |
| | | } |
| | | String path = properties.getEmpBaseInfoPath() + empBaseInfo.getEmpId() + ".png"; |
| | | try (InputStream inputStream = new FileInputStream(path); OutputStream out = response.getOutputStream()) { |
| | | |
| | | //byte数组用于存放图片字节数据 |
| | | byte[] buff = new byte[inputStream.available()]; |
| | | |
| | | inputStream.read(buff); |
| | | inputStream.close(); |
| | | |
| | | //设置发送到客户端的响应内容类型 |
| | | response.setContentType("image/png"); |
| | | |
| | | out.write(buff); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public IPage<EmpBaseInfo> baseInfoList(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; |
| | | List<SysConfig> sysConfig=this.baseMapper.sysConfig(); |
| | | String manOld=""; |
| | | String womanOld=""; |
| | | if(sysConfig.size()>0){ |
| | | manOld=sysConfig.get(0).getConfigValue(); |
| | | womanOld=sysConfig.get(1).getConfigValue(); |
| | | IPage<EmpBaseInfo> iPage = null; |
| | | List<SysConfig> sysConfig = this.baseMapper.sysConfig(); |
| | | String manOld = ""; |
| | | String womanOld = ""; |
| | | if (sysConfig.size() > 0) { |
| | | manOld = sysConfig.get(0).getConfigValue(); |
| | | womanOld = sysConfig.get(1).getConfigValue(); |
| | | } |
| | | if("1".equals(number)){ //在职员工 |
| | | iPage = this.empBaseInfoMapper.zzbaseInfoList(page, index,btime,etime,name); |
| | | }else if("2".equals(number)){ //新进员工 |
| | | iPage = this.empBaseInfoMapper.xjbaseInfoList(page, index,btime,etime,name); |
| | | }else if("3".equals(number)){ //正式员工 |
| | | iPage = this.empBaseInfoMapper.zsbaseInfoList(page, index,btime,etime,name); |
| | | }else if("4".equals(number)){ //临时员工 |
| | | iPage = this.empBaseInfoMapper.lsbaseInfoList(page, index,btime,etime,name); |
| | | }else if("5".equals(number)){ //超龄员工 |
| | | iPage = this.empBaseInfoMapper.clbaseInfoList(page, index,btime,etime,name,manOld,womanOld); |
| | | }else if("6".equals(number)){ //离职员工总数 |
| | | iPage = this.empBaseInfoMapper.lzbaseInfoList(page, index,btime,etime,name); |
| | | }else if("7".equals(number)){ //辞职申请人数 |
| | | iPage = this.empBaseInfoMapper.cjbaseInfoList(page, index,btime,etime,name); |
| | | }else if("8".equals(number) || "9".equals(number) || "10".equals(number)){ //正常离职人数 ,自动离职人数 ,公司辞退人数 |
| | | iPage = this.empBaseInfoMapper.zcbaseInfoList(page, index,btime,etime,name,number); |
| | | }else if("11".equals(number)){ //身份证到期 |
| | | iPage = this.empBaseInfoMapper.sfzbaseInfoList(page, index,btime,etime,name); |
| | | if ("1".equals(number)) { //在职员工 |
| | | iPage = this.empBaseInfoMapper.zzbaseInfoList(page, index, btime, etime, name); |
| | | } else if ("2".equals(number)) { //新进员工 |
| | | iPage = this.empBaseInfoMapper.xjbaseInfoList(page, index, btime, etime, name); |
| | | } else if ("3".equals(number)) { //正式员工 |
| | | iPage = this.empBaseInfoMapper.zsbaseInfoList(page, index, btime, etime, name); |
| | | } else if ("4".equals(number)) { //临时员工 |
| | | iPage = this.empBaseInfoMapper.lsbaseInfoList(page, index, btime, etime, name); |
| | | } else if ("5".equals(number)) { //超龄员工 |
| | | iPage = this.empBaseInfoMapper.clbaseInfoList(page, index, btime, etime, name, manOld, womanOld); |
| | | } else if ("6".equals(number)) { //离职员工总数 |
| | | iPage = this.empBaseInfoMapper.lzbaseInfoList(page, index, btime, etime, name); |
| | | } else if ("7".equals(number)) { //辞职申请人数 |
| | | iPage = this.empBaseInfoMapper.cjbaseInfoList(page, index, btime, etime, name); |
| | | } else if ("8".equals(number) || "9".equals(number) || "10".equals(number)) { //正常离职人数 ,自动离职人数 ,公司辞退人数 |
| | | iPage = this.empBaseInfoMapper.zcbaseInfoList(page, index, btime, etime, name, number); |
| | | } else if ("11".equals(number)) { //身份证到期 |
| | | iPage = this.empBaseInfoMapper.sfzbaseInfoList(page, index, btime, etime, name); |
| | | } |
| | | //设置部门 |
| | | List<EmpBaseInfo> list = setDeptName(iPage.getRecords()); |
| | | List<DicItem> dicItems = CastUtil.castList(redisService.get("dicItems"), DicItem.class); |
| | | list.forEach(p -> { |
| | | p.setSexName("1".equals(p.getSex()) ? "男" : "女"); |
| | | if(StringUtils.isNotBlank(p.getEmpType())){ |
| | | if (StringUtils.isNotBlank(p.getEmpType())) { |
| | | p.setEmpTypeName("1".equals(p.getEmpType()) ? "正式工" : "临时工"); |
| | | } |
| | | if(StringUtils.isNotBlank(p.getDimissionType())){ |
| | | if("1".equals(p.getDimissionType())){ |
| | | if (StringUtils.isNotBlank(p.getDimissionType())) { |
| | | if ("1".equals(p.getDimissionType())) { |
| | | p.setDimissionTypeName("正常离职"); |
| | | }else if("2".equals(p.getDimissionType())){ |
| | | } else if ("2".equals(p.getDimissionType())) { |
| | | p.setDimissionTypeName("自动离职"); |
| | | }else if("3".equals(p.getDimissionType())){ |
| | | } else if ("3".equals(p.getDimissionType())) { |
| | | p.setDimissionTypeName("公司劝退"); |
| | | }else if("4".equals(p.getDimissionType())){ |
| | | } else if ("4".equals(p.getDimissionType())) { |
| | | p.setDimissionTypeName("公司辞退"); |
| | | }else if("5".equals(p.getDimissionType())){ |
| | | } else if ("5".equals(p.getDimissionType())) { |
| | | p.setDimissionTypeName("试用期内"); |
| | | } |
| | | } |
| | |
| | | @Override |
| | | 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; |
| | | if("11".equals(number) || "13".equals(number) || "14".equals(number)){ //有效合同 ,新签合同,续签合同 |
| | | iPage = this.empBaseInfoMapper.yxbaseInfoList(page, index,btime,etime,name,number); |
| | | }else if("12".equals(number)){ //到期合同 |
| | | iPage = this.empBaseInfoMapper.dqbaseInfoList(page, index,btime,etime,name); |
| | | }else if("15".equals(number)){ //解除合同 |
| | | iPage = this.empBaseInfoMapper.jcseInfoList(page, index,btime,etime,name); |
| | | IPage<EmpBaseInfo> iPage = null; |
| | | if ("11".equals(number) || "13".equals(number) || "14".equals(number)) { //有效合同 ,新签合同,续签合同 |
| | | iPage = this.empBaseInfoMapper.yxbaseInfoList(page, index, btime, etime, name, number); |
| | | } else if ("12".equals(number)) { //到期合同 |
| | | iPage = this.empBaseInfoMapper.dqbaseInfoList(page, index, btime, etime, name); |
| | | } else if ("15".equals(number)) { //解除合同 |
| | | iPage = this.empBaseInfoMapper.jcseInfoList(page, index, btime, etime, name); |
| | | } |
| | | //设置部门 |
| | | List<EmpBaseInfo> list = setDeptName(iPage.getRecords()); |
| | | list.forEach(p -> { |
| | | if("1".equals(p.getContractStatus())){ |
| | | p.setContractStatus("新签"); |
| | | }else if("2".equals(p.getContractStatus())){ |
| | | p.setContractStatus("续签"); |
| | | }else if("3".equals(p.getContractStatus())){ |
| | | p.setContractStatus("解除"); |
| | | }else if("4".equals(p.getContractStatus())){ |
| | | p.setContractStatus("到期"); |
| | | } |
| | | if ("1".equals(p.getContractStatus())) { |
| | | p.setContractStatus("新签"); |
| | | } else if ("2".equals(p.getContractStatus())) { |
| | | p.setContractStatus("续签"); |
| | | } else if ("3".equals(p.getContractStatus())) { |
| | | p.setContractStatus("解除"); |
| | | } else if ("4".equals(p.getContractStatus())) { |
| | | p.setContractStatus("到期"); |
| | | } |
| | | }); |
| | | iPage.setRecords(list); |
| | | return iPage; |
| | |
| | | @Override |
| | | public IPage<EmpDimissionAttend> empBaseInfoCqList(String index, String btime, String etime, String pageSize, String pageNum, String number, String name) { |
| | | Page<EmpDimissionAttend> page = new Page<EmpDimissionAttend>(new Long(pageNum), new Long(pageSize)); |
| | | IPage<EmpDimissionAttend> iPage =null; |
| | | IPage<EmpDimissionAttend> iPage = null; |
| | | //q出勤人数 员工加班 员工旷工 |
| | | iPage = this.empBaseInfoMapper.empBaseInfoCqList(page, index,btime,etime,name,number); |
| | | iPage = this.empBaseInfoMapper.empBaseInfoCqList(page, index, btime, etime, name, number); |
| | | |
| | | return iPage; |
| | | } |
| | |
| | | @Override |
| | | public IPage<EmpLeaveInfo> empBaseInfoQjList(String index, String btime, String etime, String pageSize, String pageNum, String number, String name) { |
| | | Page<EmpLeaveInfo> page = new Page<EmpLeaveInfo>(new Long(pageNum), new Long(pageSize)); |
| | | IPage<EmpLeaveInfo> iPage =null; |
| | | IPage<EmpLeaveInfo> iPage = null; |
| | | //员工请假 |
| | | iPage = this.empBaseInfoMapper.empBaseInfoQjList(page, index,btime,etime,name,number); |
| | | iPage = this.empBaseInfoMapper.empBaseInfoQjList(page, index, btime, etime, name, number); |
| | | return iPage; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<EmpPhysicalExam> empBaseInfoTjList(String index, String btime, String etime, String pageSize, String pageNum, String number, String name) { |
| | | Page<EmpPhysicalExam> page = new Page<EmpPhysicalExam>(new Long(pageNum), new Long(pageSize)); |
| | | IPage<EmpPhysicalExam> iPage =null; |
| | | IPage<EmpPhysicalExam> iPage = null; |
| | | //员工体检 |
| | | iPage = this.empBaseInfoMapper.empBaseInfoTjList(page, index,btime,etime,name,number); |
| | | iPage = this.empBaseInfoMapper.empBaseInfoTjList(page, index, btime, etime, name, number); |
| | | return iPage; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<EmpLaborTrouble> empBaseInfoLzList(String index, String btime, String etime, String pageSize, String pageNum, String number, String name) { |
| | | Page<EmpLaborTrouble> page = new Page<EmpLaborTrouble>(new Long(pageNum), new Long(pageSize)); |
| | | IPage<EmpLaborTrouble> iPage =null; |
| | | IPage<EmpLaborTrouble> iPage = null; |
| | | //劳资案件 |
| | | iPage = this.empBaseInfoMapper.empBaseInfoLzList(page, index,btime,etime,name,number); |
| | | iPage = this.empBaseInfoMapper.empBaseInfoLzList(page, index, btime, etime, name, number); |
| | | return iPage; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<EmpJobChange> empBaseInfoTgList(String index, String btime, String etime, String pageSize, String pageNum, String number, String name) { |
| | | Page<EmpJobChange> page = new Page<EmpJobChange>(new Long(pageNum), new Long(pageSize)); |
| | | IPage<EmpJobChange> iPage =null; |
| | | IPage<EmpJobChange> iPage = null; |
| | | //调岗 |
| | | iPage = this.empBaseInfoMapper.empBaseInfoTgList(page, index,btime,etime,name,number); |
| | | iPage = this.empBaseInfoMapper.empBaseInfoTgList(page, index, btime, etime, name, number); |
| | | return iPage; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<EmpOccupational> empBaseInfoGsList(String index, String btime, String etime, String pageSize, String pageNum, String number, String name) { |
| | | Page<EmpOccupational> page = new Page<EmpOccupational>(new Long(pageNum), new Long(pageSize)); |
| | | IPage<EmpOccupational> iPage =null; |
| | | IPage<EmpOccupational> iPage = null; |
| | | //工伤案件 |
| | | iPage = this.empBaseInfoMapper.empBaseInfoGsList(page, index,btime,etime,name,number); |
| | | iPage = this.empBaseInfoMapper.empBaseInfoGsList(page, index, btime, etime, name, number); |
| | | return iPage; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<EmpAccidentCases> empBaseInfoYwList(String index, String btime, String etime, String pageSize, String pageNum, String number, String name) { |
| | | Page<EmpAccidentCases> page = new Page<EmpAccidentCases>(new Long(pageNum), new Long(pageSize)); |
| | | IPage<EmpAccidentCases> iPage =null; |
| | | IPage<EmpAccidentCases> iPage = null; |
| | | //意外险案件 |
| | | iPage = this.empBaseInfoMapper.empBaseInfoYwList(page, index,btime,etime,name,number); |
| | | iPage = this.empBaseInfoMapper.empBaseInfoYwList(page, index, btime, etime, name, number); |
| | | return iPage; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<EmpInsurance> empBaseInfoSbList(String index, String btime, String etime, String pageSize, String pageNum, String number, String name) { |
| | | Page<EmpInsurance> page = new Page<EmpInsurance>(new Long(pageNum), new Long(pageSize)); |
| | | IPage<EmpInsurance> iPage =null; |
| | | IPage<EmpInsurance> iPage = null; |
| | | //社保 |
| | | iPage = this.empBaseInfoMapper.empBaseInfoSbList(page, index,btime,etime,name,number); |
| | | iPage = this.empBaseInfoMapper.empBaseInfoSbList(page, index, btime, etime, name, number); |
| | | return iPage; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<EmpUnemployment> empBaseInfoSyjList(String index, String btime, String etime, String pageSize, String pageNum, String number, String name) { |
| | | Page<EmpUnemployment> page = new Page<EmpUnemployment>(new Long(pageNum), new Long(pageSize)); |
| | | IPage<EmpUnemployment> iPage =null; |
| | | IPage<EmpUnemployment> iPage = null; |
| | | //失业金 |
| | | iPage = this.empBaseInfoMapper.empBaseInfoSyjList(page, index,btime,etime,name,number); |
| | | iPage = this.empBaseInfoMapper.empBaseInfoSyjList(page, index, btime, etime, name, number); |
| | | return iPage; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<EmpBadRecord> empBaseInfoBlList(String index, String btime, String etime, String pageSize, String pageNum, String number, String name) { |
| | | Page<EmpBadRecord> page = new Page<EmpBadRecord>(new Long(pageNum), new Long(pageSize)); |
| | | IPage<EmpBadRecord> iPage =null; |
| | | IPage<EmpBadRecord> iPage = null; |
| | | //不良记录 |
| | | iPage = this.empBaseInfoMapper.empBaseInfoBlList(page, index,btime,etime,name,number); |
| | | iPage = this.empBaseInfoMapper.empBaseInfoBlList(page, index, btime, etime, name, number); |
| | | return iPage; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> countBaseInfoList(String index, String btime, String etime) { |
| | | List<SysConfig> sysConfig=this.baseMapper.sysConfig(); |
| | | String manOld=""; |
| | | String womanOld=""; |
| | | if(sysConfig.size()>0){ |
| | | manOld=sysConfig.get(0).getConfigValue(); |
| | | womanOld=sysConfig.get(1).getConfigValue(); |
| | | List<SysConfig> sysConfig = this.baseMapper.sysConfig(); |
| | | String manOld = ""; |
| | | String womanOld = ""; |
| | | if (sysConfig.size() > 0) { |
| | | manOld = sysConfig.get(0).getConfigValue(); |
| | | womanOld = sysConfig.get(1).getConfigValue(); |
| | | } |
| | | //在职员工,正式员工,临时员工,超龄员工 |
| | | Map<String, Object> stringObjectMap = this.baseMapper.countBaseInfoList(index,btime,etime,manOld,womanOld); |
| | | Map<String, Object> stringObjectMap = this.baseMapper.countBaseInfoList(index, btime, etime, manOld, womanOld); |
| | | //正常离职,自动离职,公司辞退 判断条件创建日期 |
| | | Map<String, Object> zclzObjectMap =this.baseMapper.countZcygBaseInfoList(index,btime,etime); |
| | | if(zclzObjectMap!=null){ |
| | | stringObjectMap.put("zclz",zclzObjectMap.get("zclz").toString()); |
| | | stringObjectMap.put("zdlz",zclzObjectMap.get("zdlz").toString()); |
| | | stringObjectMap.put("gsct",zclzObjectMap.get("gsct").toString()); |
| | | Map<String, Object> zclzObjectMap = this.baseMapper.countZcygBaseInfoList(index, btime, etime); |
| | | 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); |
| | | if(xjygObjectMap!=null){ |
| | | stringObjectMap.put("xjyg",xjygObjectMap); |
| | | Integer xjygObjectMap = this.baseMapper.countXjygBaseInfoList(index, btime, etime); |
| | | if (xjygObjectMap != null) { |
| | | stringObjectMap.put("xjyg", xjygObjectMap); |
| | | } |
| | | |
| | | //离职员工总数 |
| | | Integer empStatus = this.baseMapper.selectCount(new QueryWrapper<EmpBaseInfo>().eq("empStatus", 1)); |
| | | if(empStatus!=null){ |
| | | stringObjectMap.put("lzyg",empStatus); |
| | | if (empStatus != null) { |
| | | stringObjectMap.put("lzyg", empStatus); |
| | | } |
| | | //解除合同 判断条件离职申请日期 |
| | | Map<String, Object> lzygObjectMap =this.baseMapper.countLzygBaseInfoList(index,btime,etime); |
| | | if(lzygObjectMap!=null){ |
| | | stringObjectMap.put("jcht",lzygObjectMap.get("jcht").toString()); |
| | | Map<String, Object> lzygObjectMap = this.baseMapper.countLzygBaseInfoList(index, btime, etime); |
| | | if (lzygObjectMap != null) { |
| | | stringObjectMap.put("jcht", lzygObjectMap.get("jcht").toString()); |
| | | } |
| | | //辞职申请员工总数 判断条件辞职申请日期 |
| | | Integer czygObjectMap =this.baseMapper.countCzygBaseInfoList(index,btime,etime); |
| | | if(czygObjectMap!=null){ |
| | | stringObjectMap.put("czyg",czygObjectMap); |
| | | Integer czygObjectMap = this.baseMapper.countCzygBaseInfoList(index, btime, etime); |
| | | if (czygObjectMap != null) { |
| | | stringObjectMap.put("czyg", czygObjectMap); |
| | | } |
| | | //有效合同 判断条件合同签订日期 |
| | | Map<String, Object> yxhtObjectMap =this.baseMapper.countYxhtBaseInfoList(index,btime,etime); |
| | | if(yxhtObjectMap!=null){ |
| | | stringObjectMap.put("yxht",yxhtObjectMap.get("yxht").toString()); |
| | | Map<String, Object> yxhtObjectMap = this.baseMapper.countYxhtBaseInfoList(index, btime, etime); |
| | | if (yxhtObjectMap != null) { |
| | | stringObjectMap.put("yxht", yxhtObjectMap.get("yxht").toString()); |
| | | } |
| | | //新签合同,续签合同 判断条件合同签订日期 |
| | | Map<String, Object> xqhtObjectMap =this.baseMapper.countXqhtBaseInfoList(index,btime,etime); |
| | | if(yxhtObjectMap!=null){ |
| | | stringObjectMap.put("xinqht",xqhtObjectMap.get("xinqht").toString()); |
| | | stringObjectMap.put("xqht",xqhtObjectMap.get("xqht").toString()); |
| | | Map<String, Object> xqhtObjectMap = this.baseMapper.countXqhtBaseInfoList(index, btime, etime); |
| | | 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); |
| | | if(dqhtObjectMap!=null){ |
| | | stringObjectMap.put("dqht",dqhtObjectMap); |
| | | Integer dqhtObjectMap = this.baseMapper.countDqhtBaseInfoList(index, btime, etime); |
| | | if (dqhtObjectMap != null) { |
| | | stringObjectMap.put("dqht", dqhtObjectMap); |
| | | } |
| | | |
| | | //出勤人数,员工加班,员工旷工 判断条件考勤月份 本年,本月 |
| | | Map<String, Object> cqrsObjectMap =this.baseMapper.countCqrsBaseInfoList(index,btime,etime); |
| | | if(cqrsObjectMap!=null){ |
| | | stringObjectMap.put("cqrs",cqrsObjectMap.get("cqrs").toString()); |
| | | stringObjectMap.put("ygjb",cqrsObjectMap.get("ygjb").toString()); |
| | | stringObjectMap.put("ygkg",cqrsObjectMap.get("ygkg").toString()); |
| | | Map<String, Object> cqrsObjectMap = this.baseMapper.countCqrsBaseInfoList(index, btime, etime); |
| | | if (cqrsObjectMap != null) { |
| | | stringObjectMap.put("cqrs", cqrsObjectMap.get("cqrs").toString()); |
| | | stringObjectMap.put("ygjb", cqrsObjectMap.get("ygjb").toString()); |
| | | stringObjectMap.put("ygkg", cqrsObjectMap.get("ygkg").toString()); |
| | | } |
| | | |
| | | //员工请假 判断条件到岗时间 |
| | | Integer ygqjObjectMap =this.baseMapper.countYgqjBaseInfoList(index,btime,etime); |
| | | if(ygqjObjectMap!=null){ |
| | | stringObjectMap.put("ygqj",ygqjObjectMap); |
| | | Integer ygqjObjectMap = this.baseMapper.countYgqjBaseInfoList(index, btime, etime); |
| | | if (ygqjObjectMap != null) { |
| | | stringObjectMap.put("ygqj", ygqjObjectMap); |
| | | } |
| | | |
| | | //劳资案件 判断条件仲裁日期 |
| | | Integer lzajObjectMap =this.baseMapper.countLzajBaseInfoList(index,btime,etime); |
| | | if(lzajObjectMap!=null){ |
| | | stringObjectMap.put("lzaj",lzajObjectMap); |
| | | Integer lzajObjectMap = this.baseMapper.countLzajBaseInfoList(index, btime, etime); |
| | | if (lzajObjectMap != null) { |
| | | stringObjectMap.put("lzaj", lzajObjectMap); |
| | | } |
| | | //工伤案件,意外险案件 判断条件受伤日期 |
| | | Map<String, Object> gsajObjectMap =this.baseMapper.countGsajBaseInfoList(index,btime,etime); |
| | | if(gsajObjectMap!=null){ |
| | | stringObjectMap.put("gsaj",gsajObjectMap.get("gsaj").toString()); |
| | | stringObjectMap.put("ywxaj",gsajObjectMap.get("ywxaj").toString()); |
| | | Map<String, Object> gsajObjectMap = this.baseMapper.countGsajBaseInfoList(index, btime, etime); |
| | | 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); |
| | | if(sbsqObjectMap!=null){ |
| | | stringObjectMap.put("sbsq",sbsqObjectMap); |
| | | Integer sbsqObjectMap = this.baseMapper.countSbsqBaseInfoList(index, btime, etime); |
| | | if (sbsqObjectMap != null) { |
| | | stringObjectMap.put("sbsq", sbsqObjectMap); |
| | | } |
| | | //失业金领取 判断条件失业金申请日期 |
| | | Integer syjObjectMap =this.baseMapper.countSyjBaseInfoList(index,btime,etime); |
| | | if(syjObjectMap!=null){ |
| | | stringObjectMap.put("syj",syjObjectMap); |
| | | Integer syjObjectMap = this.baseMapper.countSyjBaseInfoList(index, btime, etime); |
| | | if (syjObjectMap != null) { |
| | | stringObjectMap.put("syj", syjObjectMap); |
| | | } |
| | | //员工体检 判断条件体检日期 |
| | | Integer ygtjObjectMap =this.baseMapper.countYgtjBaseInfoList(index,btime,etime); |
| | | if(ygtjObjectMap!=null){ |
| | | stringObjectMap.put("ygtj",ygtjObjectMap); |
| | | Integer ygtjObjectMap = this.baseMapper.countYgtjBaseInfoList(index, btime, etime); |
| | | if (ygtjObjectMap != null) { |
| | | stringObjectMap.put("ygtj", ygtjObjectMap); |
| | | } |
| | | //身份证到期 判断条件身份证有效时间 |
| | | Integer sfzObjectMap =this.baseMapper.countSfzBaseInfoList(index,btime,etime); |
| | | if(sfzObjectMap!=null){ |
| | | stringObjectMap.put("sfz",sfzObjectMap); |
| | | Integer sfzObjectMap = this.baseMapper.countSfzBaseInfoList(index, btime, etime); |
| | | if (sfzObjectMap != null) { |
| | | stringObjectMap.put("sfz", sfzObjectMap); |
| | | } |
| | | |
| | | //员工调岗 判断条件身份证有效时间 |
| | | Integer ygtgObjectMap =this.baseMapper.countYgtgBaseInfoList(index,btime,etime); |
| | | if(ygtgObjectMap!=null){ |
| | | stringObjectMap.put("ygtg",ygtgObjectMap); |
| | | Integer ygtgObjectMap = this.baseMapper.countYgtgBaseInfoList(index, btime, etime); |
| | | if (ygtgObjectMap != null) { |
| | | stringObjectMap.put("ygtg", ygtgObjectMap); |
| | | } |
| | | |
| | | //不良记录 判断条件身份证有效时间 |
| | | Integer bljlObjectMap =this.baseMapper.countBljlBaseInfoList(index,btime,etime); |
| | | if(bljlObjectMap!=null){ |
| | | stringObjectMap.put("bljl",bljlObjectMap); |
| | | Integer bljlObjectMap = this.baseMapper.countBljlBaseInfoList(index, btime, etime); |
| | | if (bljlObjectMap != null) { |
| | | stringObjectMap.put("bljl", bljlObjectMap); |
| | | } |
| | | return stringObjectMap; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 检查是否是带条件查询 |
| | | * <p> |
| | | * date 2021-02-26 13:49 |
| | | * |
| | | * @param empBaseInfo 人员参数 |
| | | * @return boolean |
| | | * @author: luoyibo |
| | | */ |
| | | private boolean checkQueryCondition(EmpBaseInfo empBaseInfo) { |
| | | int hasCondition = 0; |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpNumb())) { |
| | | hasCondition = hasCondition | 1; |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpName())) { |
| | | hasCondition = hasCondition | 1; |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getDeptName())) { |
| | | hasCondition = hasCondition | 1; |
| | | } |
| | | 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; |
| | | } |
| | | |
| | | private QueryWrapper<EmpBaseInfo> createQueryWrapper(EmpBaseInfo empBaseInfo) { |
| | | QueryWrapper<EmpBaseInfo> queryWrapper = new QueryWrapper<>(); |
| | | //记录的状态,0-正常 1-删除 2-暂存 |
| | | if (StringUtils.isNotBlank(empBaseInfo.getDelFlag().toString())) { |
| | | queryWrapper.eq("a.DelFlag", empBaseInfo.getDelFlag()); |
| | | } else { |
| | | queryWrapper.eq("a.DelFlag", 0); |
| | | } |
| | | //人员的状态,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)) { |
| | | 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(",")); |
| | | } |
| | | }); |
| | | } |
| | | queryWrapper.in("c.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA)); |
| | | return queryWrapper; |
| | | } |
| | | |
| | | @Override |
| | | public EmpBaseInfo addInEmpBaseInfo(EmpBaseInfo empBaseInfo) { |
| | | EmpBaseInfo dbEmpInfo = this.getEmpBaseInfo(empBaseInfo); |
| | | if (dbEmpInfo == null) { |
| | | this.createEmpBaseInfo(empBaseInfo); |
| | | return null; |
| | | } else { |
| | | return dbEmpInfo; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Long getEmpIdByEmpNumb(String empNumb) { |
| | | try { |
| | | return this.getOne(new LambdaQueryWrapper<EmpBaseInfo>().eq(EmpBaseInfo::getEmpNumb, empNumb).ne(EmpBaseInfo::getDelFlag, 1)).getEmpId(); |
| | | } catch (Exception e) { |
| | | return null; |
| | | } |
| | | |
| | | } |
| | | } |