Merge remote-tracking branch 'origin/master'
| | |
| | | /** |
| | | * 请假类型 |
| | | */ |
| | | public final static String LEAVETYPE = "LEAVETYPE"; |
| | | public final static String LEAVE_TYPE = "LEAVETYPE"; |
| | | |
| | | /** |
| | | * 仲裁类型 |
| | | */ |
| | | public final static String ARBITRATIONTYPE = "ARBITRATIONTYPE"; |
| | | |
| | | /** |
| | | * 结案状态 |
| | | */ |
| | | public final static String SETTLE_STATUS = "settleStatus"; |
| | | } |
| | |
| | | package cc.mrbird.febs.server.hr.controller; |
| | | |
| | | import cc.mrbird.febs.server.hr.annotation.ControllerEndpoint; |
| | | import cc.mrbird.febs.server.hr.constant.MyConstant; |
| | | import cc.mrbird.febs.server.hr.entity.EmpLeaveInfo; |
| | | import cc.mrbird.febs.server.hr.entity.EmpOccupational; |
| | | import cc.mrbird.febs.server.hr.service.IEmpOccupationalService; |
| | |
| | | import cc.mrbird.febs.common.core.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.core.exception.FebsException; |
| | | import cc.mrbird.febs.common.core.utils.FebsUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.wuwenze.poi.ExcelKit; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | this.empOccupationalService.createEmpOccupational(empOccupational); |
| | | } catch (Exception e) { |
| | | String message = "新增员工工伤案件失败"; |
| | | if (StrUtil.equals(e.getMessage(), MyConstant.MESSAGE)){ |
| | | message = e.getMessage(); |
| | | } |
| | | log.error(message, e); |
| | | throw new FebsException(message); |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private String badDateStr= ""; |
| | | |
| | | @FieldInfo(name = "empStatus", type = "varchar", explain = "员工状态") |
| | | @TableField("empStatus") |
| | | @ExcelField(value = "员工状态",writeConverterExp = "0=在职,1=离职,2=退休" ) |
| | | private String empStatus = ""; |
| | | } |
| | |
| | | @ExcelField(value = "新岗位") |
| | | private String newJobName= ""; |
| | | |
| | | @TableField(exist = false) |
| | | private String empStatus; |
| | | |
| | | } |
| | |
| | | @ExcelField(value = "身份证号码") |
| | | @TableField(exist = false) |
| | | private String certificateNumb=""; |
| | | |
| | | @TableField(exist = false) |
| | | private String empStatus; |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private String injuredTimeStr= ""; |
| | | |
| | | @FieldInfo(name = "settleStatusName", type = "bit", explain = "结案状态 0-未结案 1-已结案") |
| | | @TableField(exist = false) |
| | | private String settleStatusName = ""; |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private String remarkDateStr= ""; |
| | | |
| | | @TableField(exist = false) |
| | | private String empStatus; |
| | | } |
| | |
| | | |
| | | @TableField(exist = false) |
| | | private String applayDateStr; |
| | | |
| | | @TableField(exist = false) |
| | | private String empStatus; |
| | | |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private String applayDateStr; |
| | | |
| | | @TableField(exist = false) |
| | | private String empStatus; |
| | | } |
| | |
| | | package cc.mrbird.febs.server.hr.mapper; |
| | | |
| | | import cc.mrbird.febs.server.hr.entity.EmpBadRecord; |
| | | import cc.mrbird.febs.server.hr.entity.EmpRemarkInfo; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Update; |
| | | |
| | |
| | | " </foreach>\n" + |
| | | "</script>") |
| | | int momentToNormal(@Param("list") List<String> list, @Param("operatorId") String operatorId); |
| | | |
| | | IPage<EmpBadRecord> selectPageVo(Page<?> page, @Param(Constants.WRAPPER) Wrapper wrapper); |
| | | } |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cc.mrbird.febs.server.hr.mapper.EmpBadRecordMapper"> |
| | | |
| | | <select id="selectPageVo" resultType="cc.mrbird.febs.server.hr.entity.EmpRemarkInfo"> |
| | | select a.* from t_emp_badrecord a |
| | | inner join t_emp_baseinfo b on a.empId = b.empId |
| | | inner join t_dept c on b.deptId = c.DEPT_ID |
| | | ${ew.customSqlSegment} |
| | | </select> |
| | | </mapper> |
| | |
| | | package cc.mrbird.febs.server.hr.service; |
| | | |
| | | import cc.mrbird.febs.common.core.exception.FebsException; |
| | | import cc.mrbird.febs.server.hr.entity.EmpOccupational; |
| | | |
| | | import cc.mrbird.febs.common.core.entity.QueryRequest; |
| | |
| | | * |
| | | * @param empOccupational empOccupational |
| | | */ |
| | | void createEmpOccupational(EmpOccupational empOccupational); |
| | | void createEmpOccupational(EmpOccupational empOccupational) throws FebsException; |
| | | |
| | | /** |
| | | * 修改 |
| | |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> findEmpAccessorys(QueryRequest request, EmpAccessoryVO vo) { |
| | | QueryWrapper<EmpAccessoryVO> queryWrapper = new QueryWrapper<>(); |
| | | QueryWrapper<EmpAccessoryVO> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("a.delFlag", 0); |
| | | if (StrUtil.isNotBlank(vo.getBasic())) { |
| | | queryWrapper.like("a.empNumb", vo.getBasic()).or().like("a.deptName", vo.getBasic()).or().like("a.certificateNumb", vo.getBasic()).or().like("a.certificateNumb", vo.getBasic()).or().like("a.jobName", vo.getBasic()); |
| | | queryWrapper.and(p -> { |
| | | p.like("a.empNumb", vo.getBasic()) |
| | | .or().like("a.deptName", vo.getBasic()) |
| | | .or().like("a.certificateNumb", vo.getBasic()) |
| | | .or().like("a.empName", vo.getBasic()) |
| | | .or().like("a.jobName", vo.getBasic()); |
| | | }); |
| | | } |
| | | if (StrUtil.isNotBlank(vo.getEmpName())) { |
| | | queryWrapper.like("a.empName", vo.getEmpName().split(",")); |
| | | queryWrapper.like("a.empName", vo.getEmpName()); |
| | | } |
| | | if (StrUtil.isNotBlank(vo.getEmpNumb())) { |
| | | queryWrapper.like("a.empNumb", vo.getEmpNumb().split(",")); |
| | | queryWrapper.like("a.empNumb", vo.getEmpNumb()); |
| | | } |
| | | if (StrUtil.isNotBlank(vo.getCertificateNumb())) { |
| | | queryWrapper.like("a.certificateNumb", vo.getCertificateNumb().split(",")); |
| | | queryWrapper.like("a.certificateNumb", vo.getCertificateNumb()); |
| | | } |
| | | if (StrUtil.isNotBlank(vo.getDeptName())) { |
| | | queryWrapper.like("a.deptName", vo.getDeptName().split(",")); |
| | | queryWrapper.like("a.deptName", vo.getDeptName()); |
| | | } |
| | | // if (StrUtil.isNotBlank(vo.getEmpName())) { |
| | | // queryWrapper.like("a.empName", vo.getEmpName().split(",")); |
| | | // } |
| | | // if (StrUtil.isNotBlank(vo.getEmpNumb())) { |
| | | // queryWrapper.like("a.empNumb", vo.getEmpNumb().split(",")); |
| | | // } |
| | | // if (StrUtil.isNotBlank(vo.getCertificateNumb())) { |
| | | // queryWrapper.like("a.certificateNumb", vo.getCertificateNumb().split(",")); |
| | | // } |
| | | // if (StrUtil.isNotBlank(vo.getDeptName())) { |
| | | // queryWrapper.like("a.deptName", vo.getDeptName().split(",")); |
| | | // } |
| | | if (StrUtil.isNotBlank(vo.getEntryDate())) { |
| | | queryWrapper.between("a.entryDate", vo.getEntryDate().split(",")[0], vo.getEntryDate().split(",")[1]); |
| | | } |
| | |
| | | |
| | | } |
| | | if (StrUtil.isNotBlank(vo.getArchivesStatus())) { |
| | | queryWrapper.in("a.archivesStatus", vo.getArchivesStatus().split(",")); |
| | | queryWrapper.in("a.archivesStatus", vo.getArchivesStatus().split(",")); |
| | | } |
| | | if (StrUtil.isNotBlank(vo.getEducation())) { |
| | | queryWrapper.in("a.education", vo.getEducation().split(",")); |
| | | queryWrapper.in("a.education", vo.getEducation().split(",")); |
| | | } |
| | | if (StrUtil.isNotBlank(vo.getSex())) { |
| | | queryWrapper.in("a.sex", vo.getSex().split(",")); |
| | | queryWrapper.in("a.sex", vo.getSex().split(",")); |
| | | } |
| | | if (StrUtil.isNotBlank(vo.getInsuranceType())) { |
| | | queryWrapper.in("a.insuranceType", vo.getInsuranceType().split(",")); |
| | | queryWrapper.in("a.insuranceType", vo.getInsuranceType().split(",")); |
| | | } |
| | | if (StrUtil.isNotBlank(vo.getPolitics())) { |
| | | queryWrapper.in("a.politics", vo.getPolitics().split(",")); |
| | | queryWrapper.in("a.politics", vo.getPolitics().split(",")); |
| | | } |
| | | if (StrUtil.isNotBlank(vo.getEmpStatus())) { |
| | | queryWrapper.in("a.empStatus", vo.getEmpStatus().split(",")); |
| | |
| | | if (StrUtil.isNotBlank(vo.getPolitics())) { |
| | | queryWrapper.in("a.politics", vo.getPolitics().split(",")); |
| | | } |
| | | queryWrapper.eq("a.delFlag", 0); |
| | | |
| | | queryWrapper.in("c.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA)); |
| | | queryWrapper.orderByAsc("a.deptName,a.empName,a.certificateNumb"); |
| | | Page<EmpAccessory> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | |
| | | public void deleteEmpAccessory(String accessoryids) { |
| | | String[] arr = accessoryids.split(","); |
| | | LambdaUpdateWrapper<EmpAccessory> wapper = new LambdaUpdateWrapper<>(); |
| | | wapper.in(EmpAccessory::getAccessoryid,arr); |
| | | wapper.set(EmpAccessory::getDelFlag,1); |
| | | wapper.set(EmpAccessory::getModifier,operatorId); |
| | | wapper.set(EmpAccessory::getModifytime,new Date()); |
| | | wapper.in(EmpAccessory::getAccessoryid, arr); |
| | | wapper.set(EmpAccessory::getDelFlag, 1); |
| | | wapper.set(EmpAccessory::getModifier, operatorId); |
| | | wapper.set(EmpAccessory::getModifytime, new Date()); |
| | | this.update(wapper); |
| | | |
| | | LambdaQueryWrapper<EmpAccessory> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.in(EmpAccessory::getAccessoryid,arr); |
| | | queryWrapper.in(EmpAccessory::getAccessoryid, arr); |
| | | List<EmpAccessory> list = this.list(queryWrapper); |
| | | list.parallelStream().forEach(i-> { |
| | | list.parallelStream().forEach(i -> { |
| | | EmpBaseInfo empBaseInfo = empBaseInfoService.getById(i.getEmpid()); |
| | | String nameAndCertificateNumb = empBaseInfo.getEmpName()+"_"+empBaseInfo.getCertificateNumb()+"/"; |
| | | FileUtil.del(properties.getUploadSinglePath()+nameAndCertificateNumb+"/" + i.getFilesaddress()); |
| | | String nameAndCertificateNumb = empBaseInfo.getEmpName() + "_" + empBaseInfo.getCertificateNumb() + "/"; |
| | | FileUtil.del(properties.getUploadSinglePath() + nameAndCertificateNumb + "/" + i.getFilesaddress()); |
| | | }); |
| | | } |
| | | |
| | |
| | | Arrays.stream(arr).forEach(i -> { |
| | | EmpAccessory accessory = this.getById(i); |
| | | EmpBaseInfo empBaseInfo = empBaseInfoService.getById(accessory.getEmpid()); |
| | | String nameAndCertificateNumb = empBaseInfo.getEmpName()+"_"+empBaseInfo.getCertificateNumb()+"/"; |
| | | String nameAndCertificateNumb = empBaseInfo.getEmpName() + "_" + empBaseInfo.getCertificateNumb() + "/"; |
| | | files.add(new File(properties.getUploadSinglePath() + nameAndCertificateNumb + accessory.getFilesaddress())); |
| | | if ( fileName.parallelStream().filter(filter->StrUtil.equals(accessory.getFilesname(),filter)).count()==0){ |
| | | if (fileName.parallelStream().filter(filter -> StrUtil.equals(accessory.getFilesname(), filter)).count() == 0) { |
| | | fileName.add(accessory.getFilesname()); |
| | | }else{ |
| | | fileName.add(accessory.getFilesname()+fileName.parallelStream().filter(filter->StrUtil.equals(accessory.getFilesname(),filter)).count()+1); |
| | | } else { |
| | | fileName.add(accessory.getFilesname() + fileName.parallelStream().filter(filter -> StrUtil.equals(accessory.getFilesname(), filter)).count() + 1); |
| | | } |
| | | }); |
| | | MyUtil.download(request, response, files, fileName); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void mvFiles(String accessoryids,Long labelid,Long empId) { |
| | | public void mvFiles(String accessoryids, Long labelid, Long empId) { |
| | | String[] arr = accessoryids.split(","); |
| | | LambdaUpdateWrapper<EmpAccessory> wapper = new LambdaUpdateWrapper<>(); |
| | | wapper.in(EmpAccessory::getAccessoryid, arr); |
| | | wapper.set(EmpAccessory::getModifier,operatorId); |
| | | wapper.set(EmpAccessory::getModifytime,new Date()); |
| | | wapper.set(EmpAccessory::getLabelid,labelid); |
| | | wapper.set(EmpAccessory::getModifier, operatorId); |
| | | wapper.set(EmpAccessory::getModifytime, new Date()); |
| | | wapper.set(EmpAccessory::getLabelid, labelid); |
| | | this.update(wapper); |
| | | |
| | | } |
| | |
| | | public void singledownload(String empIds, Long labelid, HttpServletRequest request, HttpServletResponse response) throws IOException { |
| | | String[] arr = empIds.split(","); |
| | | //主文件夹 |
| | | String mianFileStr = properties.getUploadSinglePath()+snowflake.nextIdStr()+"/"; |
| | | String mianFileStr = properties.getUploadSinglePath() + snowflake.nextIdStr() + "/"; |
| | | FileUtil.mkdir(mianFileStr); |
| | | Arrays.stream(arr).forEach(i -> { |
| | | LambdaQueryWrapper<EmpAccessory> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(EmpAccessory::getEmpid,i); |
| | | lambdaQueryWrapper.eq(EmpAccessory::getDelFlag,0); |
| | | if (!labelid.equals(-1L)){ |
| | | lambdaQueryWrapper.eq(EmpAccessory::getLabelid,labelid); |
| | | lambdaQueryWrapper.eq(EmpAccessory::getEmpid, i); |
| | | lambdaQueryWrapper.eq(EmpAccessory::getDelFlag, 0); |
| | | if (!labelid.equals(-1L)) { |
| | | lambdaQueryWrapper.eq(EmpAccessory::getLabelid, labelid); |
| | | } |
| | | List<EmpAccessory> accessory = this.list(lambdaQueryWrapper); |
| | | EmpBaseInfo empBaseInfo = empBaseInfoService.getById(i); |
| | | String nameAndCertificateNumb = empBaseInfo.getEmpName()+"_"+empBaseInfo.getCertificateNumb()+"/"; |
| | | String nameAndCertificateNumb = empBaseInfo.getEmpName() + "_" + empBaseInfo.getCertificateNumb() + "/"; |
| | | //创建个人文件夹 |
| | | String singlefileStr = mianFileStr+nameAndCertificateNumb; |
| | | String singlefileStr = mianFileStr + nameAndCertificateNumb; |
| | | FileUtil.mkdir(singlefileStr); |
| | | accessory.stream().forEach(a->{ |
| | | accessory.stream().forEach(a -> { |
| | | Label label = labelService.getById(a.getLabelid()); |
| | | FileUtil.copy(properties.getUploadSinglePath() + nameAndCertificateNumb + a.getFilesaddress(),singlefileStr+label.getLabelname()+"/"+a.getFilesname(),true); |
| | | FileUtil.copy(properties.getUploadSinglePath() + nameAndCertificateNumb + a.getFilesaddress(), singlefileStr + label.getLabelname() + "/" + a.getFilesname(), true); |
| | | }); |
| | | }); |
| | | ZipUtil.zip(mianFileStr); |
| | | try { |
| | | MyUtil.downloadFile(new File(new StringBuilder().append(mianFileStr, 0, mianFileStr.length() - 1).append(".zip").toString()),response); |
| | | MyUtil.downloadFile(new File(new StringBuilder().append(mianFileStr, 0, mianFileStr.length() - 1).append(".zip").toString()), response); |
| | | } catch (IOException e) { |
| | | log.error("下载文件异常",e); |
| | | log.error("下载文件异常", e); |
| | | } |
| | | FileUtil.del(new StringBuilder().append(mianFileStr, 0, mianFileStr.length() - 1).append(".zip").toString()); |
| | | FileUtil.del(mianFileStr); |
| | |
| | | |
| | | @Override |
| | | public Integer getLabelCount(Long labelId) { |
| | | LambdaQueryWrapper<EmpAccessory> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(EmpAccessory::getDelFlag,0); |
| | | wrapper.eq(EmpAccessory::getLabelid,labelId); |
| | | LambdaQueryWrapper<EmpAccessory> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(EmpAccessory::getDelFlag, 0); |
| | | wrapper.eq(EmpAccessory::getLabelid, labelId); |
| | | return this.count(wrapper); |
| | | } |
| | | } |
| | |
| | | queryWrapper.eq("a.SettleStatus", empAccidentcases.getSettleStatus()); |
| | | } |
| | | if (StringUtils.isNotBlank(empAccidentcases.getEmpStatus())) { |
| | | queryWrapper.eq("a.EmpStatus", empAccidentcases.getEmpStatus()); |
| | | queryWrapper.in("a.EmpStatus", empAccidentcases.getEmpStatus().split(",")); |
| | | } |
| | | queryWrapper.in("c.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA)); |
| | | Page<EmpAccidentCases> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | |
| | | public void createEmpAccidentcases(EmpAccidentCases empAccidentcases) throws FebsException { |
| | | LambdaQueryWrapper<EmpAccidentCases> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(EmpAccidentCases::getEmpId, empAccidentcases.getEmpId()); |
| | | lambdaQueryWrapper.eq(EmpAccidentCases::getHrDoDate, empAccidentcases.getHrDoDate()); |
| | | lambdaQueryWrapper.eq(EmpAccidentCases::getInjuredTime, empAccidentcases.getInjuredTime()); |
| | | lambdaQueryWrapper.ne(EmpAccidentCases::getDelFlag,1); |
| | | if (this.count(lambdaQueryWrapper) > 0) { |
| | | throw new FebsException(MyConstant.MESSAGE); |
| | |
| | | package cc.mrbird.febs.server.hr.service.impl; |
| | | |
| | | import cc.mrbird.febs.common.core.constant.ModuleCode; |
| | | import cc.mrbird.febs.common.core.entity.constant.StringConstant; |
| | | import cc.mrbird.febs.common.core.exception.FebsException; |
| | | import cc.mrbird.febs.server.hr.constant.MyConstant; |
| | | import cc.mrbird.febs.server.hr.entity.EmpAccidentCases; |
| | | import cc.mrbird.febs.server.hr.entity.EmpBadRecord; |
| | | import cc.mrbird.febs.server.hr.entity.EmpBadRecord; |
| | | import cc.mrbird.febs.server.hr.feign.IRemoteDeptService; |
| | | import cc.mrbird.febs.server.hr.mapper.EmpBadRecordMapper; |
| | | import cc.mrbird.febs.server.hr.service.IEmpBadRecordService; |
| | | import cc.mrbird.febs.server.hr.service.IEmpBaseInfoService; |
| | | import cn.hutool.core.date.DateUtil; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | private final RedisService redisService; |
| | | private final EmpBadRecordMapper empBadrecordMapper; |
| | | private final IEmpBaseInfoService empBaseInfoService; |
| | | private final IRemoteDeptService remoteDeptService; |
| | | private final String operatorId = Optional.ofNullable(FebsUtil.getCurrentUser()) |
| | | .map(u -> u.getUserId().toString()) |
| | | .orElse("1"); |
| | | |
| | | @Override |
| | | public IPage<EmpBadRecord> findEmpBadrecords(QueryRequest request, EmpBadRecord empBadrecord) { |
| | | LambdaQueryWrapper<EmpBadRecord> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(EmpBadRecord::getDelFlag, empBadrecord.getDelFlag()); |
| | | if (StringUtils.isNotBlank(empBadrecord.getEmpNumb())) { |
| | | queryWrapper.like(EmpBadRecord::getEmpNumb, empBadrecord.getEmpNumb()); |
| | | QueryWrapper<EmpBadRecord> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("a.delFlag", empBadrecord.getDelFlag()); |
| | | if (StringUtils.isNotBlank(empBadrecord.getEmpNumb())) { |
| | | queryWrapper.like("a.EmpNumb", empBadrecord.getEmpNumb()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBadrecord.getEmpName())) { |
| | | queryWrapper.like(EmpBadRecord::getEmpName, empBadrecord.getEmpName()); |
| | | queryWrapper.like("a.EmpName", empBadrecord.getEmpName()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBadrecord.getCertificateNumb())) { |
| | | queryWrapper.like(EmpBadRecord::getCertificateNumb, empBadrecord.getCertificateNumb()); |
| | | queryWrapper.like("a.CertificateNumb", empBadrecord.getCertificateNumb()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBadrecord.getDeptName())) { |
| | | queryWrapper.like(EmpBadRecord::getDeptName, empBadrecord.getDeptName()); |
| | | queryWrapper.like("a.DeptName", empBadrecord.getDeptName()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBadrecord.getBadDateStr())) { |
| | | queryWrapper.between(EmpBadRecord::getBadDate, empBadrecord.getBadDateStr().split(",")[0], |
| | | empBadrecord.getBadDateStr().split(",")[1]); |
| | | queryWrapper.between("a.badDate", empBadrecord.getBadDateStr().split(",")[0],empBadrecord.getBadDateStr().split(",")[1]); |
| | | } |
| | | if (StringUtils.isNotBlank(empBadrecord.getBadContent())) { |
| | | queryWrapper.like(EmpBadRecord::getBadContent, empBadrecord.getBadContent()); |
| | | queryWrapper.like("a.badContent", empBadrecord.getBadContent()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBadrecord.getEmpStatus())) { |
| | | queryWrapper.in("b.EmpStatus", empBadrecord.getEmpStatus().split(",")); |
| | | } else { |
| | | queryWrapper.in("b.EmpStatus", 0); |
| | | } |
| | | queryWrapper.in("c.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA)); |
| | | Page<EmpBadRecord> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | return this.page(page, queryWrapper); |
| | | return empBadrecordMapper.selectPageVo(page, queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | |
| | | 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 String operatorId = Optional.of(FebsUtil.getUserId()).orElse("1"); |
| | | |
| | | @Override |
| | | public IPage<EmpBaseInfo> findEmpBaseInfos(QueryRequest request, EmpBaseInfo empBaseInfo) { |
| | |
| | | .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())) |
| | |
| | | } else { |
| | | queryWrapper.in("a.EmpStatus", 0); |
| | | } |
| | | 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 (this.checkQueryCondition(empBaseInfo)) { |
| | | queryWrapper.and(p -> { |
| | |
| | | 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]); |
| | | p.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]); |
| | | p.between("a.DimissionDate", empBaseInfo.getDimissionDateStr().split(",")[0], empBaseInfo.getDimissionDateStr().split(",")[1]); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getSex())) { |
| | | p.or().in("a.Sex", empBaseInfo.getSex().split(",")); |
| | |
| | | queryWrapper.between("a.EndDate", empContractinfo.getEndDateStr().split(",")[0], empContractinfo.getEndDateStr().split(",")[1]); |
| | | } |
| | | if (StringUtils.isNotBlank(empContractinfo.getDeptName())) { |
| | | queryWrapper.like("a.EmpStatus", empContractinfo.getEmpStatus()); |
| | | queryWrapper.in("a.deptName", empContractinfo.getDeptName()); |
| | | } |
| | | if (StringUtils.isNotBlank(empContractinfo.getContractStatus())) { |
| | | queryWrapper.eq("a.ContractStatus", empContractinfo.getContractStatus()); |
| | | } |
| | | if (StringUtils.isNotBlank(empContractinfo.getEmpStatus())) { |
| | | queryWrapper.in("a.EmpStatus", empContractinfo.getEmpStatus().split(",")); |
| | | } |
| | | queryWrapper.in("c.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA)); |
| | | Page<EmpContractInfo> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<EmpContractInfo> iPage = empContractinfoMapper.selectPageVo(page, queryWrapper); |
| | |
| | | queryWrapper.like("a.Deduct", empDimissionattend.getDeductStr()); |
| | | } |
| | | if (StringUtils.isNotBlank(empDimissionattend.getEmpStatus())) { |
| | | queryWrapper.eq("a.EmpStatus", empDimissionattend.getEmpStatus()); |
| | | queryWrapper.in("a.EmpStatus", empDimissionattend.getEmpStatus().split(",")); |
| | | } |
| | | queryWrapper.in("c.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA)); |
| | | Page<EmpDimissionAttend> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | |
| | | if (StringUtils.isNotBlank(empDimissionlog.getDimissionType())) { |
| | | queryWrapper.eq("a.dimissionType", empDimissionlog.getDimissionType()); |
| | | } |
| | | if (StringUtils.isNotBlank(empDimissionlog.getEmpStatus())) { |
| | | queryWrapper.in("b.EmpStatus", empDimissionlog.getEmpStatus().split(",")); |
| | | } else { |
| | | queryWrapper.in("b.EmpStatus", 0); |
| | | } |
| | | Page<Map<String, Object>> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | queryWrapper.in("c.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA)); |
| | | return this.baseMapper.selectPageVo(page,queryWrapper); |
| | |
| | | queryWrapper.eq("a.ReportStatus", empInsurance.getReportStatus()); |
| | | } |
| | | if (StringUtils.isNotBlank(empInsurance.getEmpStatus())) { |
| | | queryWrapper.eq("a.EmpStatus", empInsurance.getEmpStatus()); |
| | | queryWrapper.in("a.EmpStatus", empInsurance.getEmpStatus().split(",")); |
| | | } |
| | | queryWrapper.in("c.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA)); |
| | | Page<EmpInsurance> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | |
| | | if (StringUtils.isNotBlank(empJobchange.getChangeType())) { |
| | | queryWrapper.eq("a.changeType", empJobchange.getChangeType()); |
| | | } |
| | | if (StringUtils.isNotBlank(empJobchange.getEmpStatus())) { |
| | | queryWrapper.in("b.EmpStatus", empJobchange.getEmpStatus().split(",")); |
| | | } else { |
| | | queryWrapper.in("b.EmpStatus", 0); |
| | | } |
| | | Page<EmpJobChange> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | queryWrapper.in("c.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA)); |
| | | return this.baseMapper.selectPageVo(page, queryWrapper); |
| | |
| | | queryWrapper.eq("a.ArbitrationStatus", empLabortrouble.getArbitrationStatus()); |
| | | } |
| | | if (StringUtils.isNotBlank(empLabortrouble.getEmpStatus())) { |
| | | queryWrapper.eq("a.EmpStatus", empLabortrouble.getEmpStatus()); |
| | | queryWrapper.in("a.EmpStatus", empLabortrouble.getEmpStatus().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empLabortrouble.getArbitrationReason())) { |
| | | queryWrapper.like("a.ArbitrationReason", empLabortrouble.getArbitrationReason()); |
| | |
| | | queryWrapper.like("a.DeptName", empLeaveinfo.getDeptName()); |
| | | } |
| | | if (StringUtils.isNotBlank(empLeaveinfo.getEmpStatus())) { |
| | | queryWrapper.eq("a.EmpStatus", empLeaveinfo.getEmpStatus()); |
| | | queryWrapper.in("a.EmpStatus", empLeaveinfo.getEmpStatus().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empLeaveinfo.getLeaveDateStr())) { |
| | | queryWrapper.ge("a.BeginTime", empLeaveinfo.getLeaveDateStr().split(",")[0]); |
| | |
| | | list.forEach(p -> { |
| | | //请假类型 |
| | | p.setLeaveTypeName(dicItems.stream() |
| | | .filter(k -> DicCode.LEAVETYPE.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getLeaveType())) |
| | | .filter(k -> DicCode.LEAVE_TYPE.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getLeaveType())) |
| | | .findFirst() |
| | | .map(DicItem::getDicItemName) |
| | | .orElse("事假")); |
| | |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | |
| | | import cc.mrbird.febs.common.core.constant.DicCode; |
| | | import cc.mrbird.febs.common.core.entity.system.DicItem; |
| | | import cc.mrbird.febs.common.core.exception.FebsException; |
| | | import cc.mrbird.febs.server.hr.constant.MyConstant; |
| | | import cc.mrbird.febs.server.hr.entity.EmpAccidentCases; |
| | | import cc.mrbird.febs.server.hr.entity.EmpBaseInfo; |
| | | import cc.mrbird.febs.server.hr.service.IEmpBaseInfoService; |
| | | import cn.hutool.core.util.StrUtil; |
| | |
| | | queryWrapper.eq("a.SettleStatus", empOccupational.getSettleStatus()); |
| | | } |
| | | if (StringUtils.isNotBlank(empOccupational.getEmpStatus())) { |
| | | queryWrapper.eq("a.EmpStatus", empOccupational.getEmpStatus()); |
| | | queryWrapper.in("a.EmpStatus", empOccupational.getEmpStatus().split(",")); |
| | | } |
| | | queryWrapper.in("c.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA)); |
| | | Page<EmpOccupational> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | return empOccupationalMapper.selectPageVo(page, queryWrapper); |
| | | IPage<EmpOccupational> pageList = empOccupationalMapper.selectPageVo(page, queryWrapper); |
| | | List<EmpOccupational> list = pageList.getRecords(); |
| | | //处理数据字典 |
| | | pageList.setRecords(covertDicItemName(list)); |
| | | return pageList; |
| | | } |
| | | |
| | | @Override |
| | | public List<EmpOccupational> findEmpOccupationals(EmpOccupational empOccupational) { |
| | | LambdaQueryWrapper<EmpOccupational> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(EmpOccupational::getDelFlag, empOccupational.getDelFlag()); |
| | | return this.baseMapper.selectList(queryWrapper); |
| | | List<EmpOccupational> list = this.baseMapper.selectList(queryWrapper); |
| | | return covertDicItemName(list); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void createEmpOccupational(EmpOccupational empOccupational) { |
| | | public void createEmpOccupational(EmpOccupational empOccupational) throws FebsException { |
| | | LambdaQueryWrapper<EmpOccupational> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(EmpOccupational::getEmpId, empOccupational.getEmpId()); |
| | | lambdaQueryWrapper.eq(EmpOccupational::getInjuredTime, empOccupational.getInjuredTime()); |
| | | lambdaQueryWrapper.ne(EmpOccupational::getDelFlag,1); |
| | | if (this.count(lambdaQueryWrapper) > 0) { |
| | | throw new FebsException(MyConstant.MESSAGE); |
| | | } |
| | | |
| | | empOccupational.setOccupationalId(SequenceUtil.generateId(0L, ModuleCode.HR_EMPLOYEE)); |
| | | if(empOccupational.getSubmitTime()==null){ |
| | | empOccupational.setSubmitTime(empOccupational.getInjuredTime()); |
| | |
| | | this.save(empOccupational); |
| | | } |
| | | } |
| | | |
| | | private List<EmpOccupational> covertDicItemName(List<EmpOccupational> list){ |
| | | List<DicItem> dicItems = CastUtil.castList(redisService.get("dicItems"), DicItem.class); |
| | | list.parallelStream().forEachOrdered(p -> { |
| | | // 设置结案状态 |
| | | p.setSettleStatusName(dicItems.stream() |
| | | .filter(k -> DicCode.SETTLE_STATUS.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getSettleStatus().toString())) |
| | | .findFirst() |
| | | .map(DicItem::getDicItemName) |
| | | .orElse("")); |
| | | }); |
| | | |
| | | return list; |
| | | } |
| | | } |
| | |
| | | queryWrapper.like("a.Conclusion", empPhysicalexam.getConclusion()); |
| | | } |
| | | if (StringUtils.isNotBlank(empPhysicalexam.getEmpStatus())) { |
| | | queryWrapper.eq("a.EmpStatus", empPhysicalexam.getEmpStatus()); |
| | | queryWrapper.in("a.EmpStatus", empPhysicalexam.getEmpStatus().split(",")); |
| | | } else { |
| | | queryWrapper.in("a.EmpStatus", 0); |
| | | } |
| | | Page<EmpPhysicalExam> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | queryWrapper.in("c.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA)); |
| | |
| | | if (StringUtils.isNotBlank(empRemarkinfo.getRemarkContent())) { |
| | | queryWrapper.like("a.RemarkContent", empRemarkinfo.getRemarkContent()); |
| | | } |
| | | if (StringUtils.isNotBlank(empRemarkinfo.getEmpStatus())) { |
| | | queryWrapper.in("b.EmpStatus", empRemarkinfo.getEmpStatus().split(",")); |
| | | } else { |
| | | queryWrapper.in("b.EmpStatus", 0); |
| | | } |
| | | queryWrapper.in("c.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA)); |
| | | Page<EmpRemarkInfo> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | return empRemarkinfoMapper.selectPageVo(page, queryWrapper); |
| | |
| | | if (StringUtils.isNotBlank(empResign.getReason())) { |
| | | queryWrapper.like("a.Reason", empResign.getReason()); |
| | | } |
| | | if (StringUtils.isNotBlank(empResign.getEmpStatus())) { |
| | | queryWrapper.in("b.EmpStatus", empResign.getEmpStatus().split(",")); |
| | | } else { |
| | | queryWrapper.in("b.EmpStatus", 0); |
| | | } |
| | | queryWrapper.in("c.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA)); |
| | | return empResignMapper.selectPageVo(page, queryWrapper); |
| | | } |
| | |
| | | if (StringUtils.isNotBlank(empUnemployment.getApplayReason())) { |
| | | queryWrapper.like("a.ApplayReason", empUnemployment.getApplayReason()); |
| | | } |
| | | if (StringUtils.isNotBlank(empUnemployment.getEmpStatus())) { |
| | | queryWrapper.in("b.EmpStatus", empUnemployment.getEmpStatus().split(",")); |
| | | } else { |
| | | queryWrapper.in("b.EmpStatus", 0); |
| | | } |
| | | queryWrapper.in("c.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA)); |
| | | Page<EmpUnemployment> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | return empUnemploymentMapper.selectPageVo(page, queryWrapper); |
| | |
| | | private final EmpWorkExperienceMapper empWorkexperienceMapper; |
| | | private final IRemoteDeptService remoteDeptService; |
| | | private final IEmpBaseInfoService empBaseInfoService; |
| | | private final String operatorId = Optional.ofNullable(FebsUtil.getCurrentUser()) |
| | | .map(u -> u.getUserId().toString()) |
| | | .orElse("1"); |
| | | |
| | | private final RedisService redisService; |
| | | |
| | | @Override |
| | |
| | | if (StringUtils.isNotBlank(empWorkexperience.getJobContent())) { |
| | | queryWrapper.like("a.jobContent", empWorkexperience.getJobContent()); |
| | | } |
| | | if (StringUtils.isNotBlank(empWorkexperience.getEmpStatus())) { |
| | | queryWrapper.in("a.EmpStatus", empWorkexperience.getEmpStatus().split(",")); |
| | | } else { |
| | | queryWrapper.in("a.EmpStatus", 0); |
| | | } |
| | | queryWrapper.in("c.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA)); |
| | | |
| | | Page<EmpWorkExperience> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | |
| | | queryWrapper.in("c.dept_Id", remoteDeptService.userRightDepts()); |
| | | return this.empWorkexperienceMapper.selectPageVo(page, queryWrapper); |
| | | } |
| | | |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void createEmpWorkExperience(EmpWorkExperience empWorkexperience) { |
| | | String operatorId = Optional.ofNullable(FebsUtil.getCurrentUser()) |
| | | .map(u -> u.getUserId().toString()) |
| | | .orElse("1"); |
| | | empWorkexperience.setWorkExperienceId(SequenceUtil.generateId(0L, ModuleCode.HR_EMPLOYEE)); |
| | | empWorkexperience.setDeptId(1L); |
| | | empWorkexperience.setJobId(1L); |
| | | empWorkexperience.setCreator(operatorId); |
| | | empWorkexperience.setModifier(operatorId); |
| | | this.save(empWorkexperience); |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateEmpWorkExperience(EmpWorkExperience empWorkexperience) { |
| | | String operatorId = Optional.ofNullable(FebsUtil.getCurrentUser()) |
| | | .map(u -> u.getUserId().toString()) |
| | | .orElse("1"); |
| | | EmpWorkExperience dbData = this.getById(empWorkexperience.getWorkExperienceId()); |
| | | empWorkexperience.setCreateTime(dbData.getCreateTime()); |
| | | empWorkexperience.setCreator(dbData.getCreator()); |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void logicDelEmpWorkExperience(String ids) { |
| | | String operatorId = Optional.ofNullable(FebsUtil.getCurrentUser()) |
| | | .map(u -> u.getUserId().toString()) |
| | | .orElse("1"); |
| | | List<String> list = new ArrayList<>(); |
| | | String[] str = ids.split(","); |
| | | list.addAll(Arrays.asList(str)); |
| | |
| | | |
| | | @Override |
| | | public boolean momentToNormal(String ids) { |
| | | String operatorId = Optional.ofNullable(FebsUtil.getCurrentUser()) |
| | | .map(u -> u.getUserId().toString()) |
| | | .orElse("1"); |
| | | String[] str = ids.split(","); |
| | | List<String> list = new ArrayList<>(Arrays.asList(str)); |
| | | return empWorkexperienceMapper.momentToNormal(list, operatorId)>0; |