|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.ydool.staff.service.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
import cn.hutool.core.collection.CollStreamUtil;
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
@ -10,6 +11,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import com.ydool.common.base.BaseService;
|
|
|
|
|
import com.ydool.common.constant.AgesConst;
|
|
|
|
|
import com.ydool.common.data.dto.AjaxResult;
|
|
|
|
|
import com.ydool.common.utils.ColumnUtil;
|
|
|
|
|
import com.ydool.staff.dto.AttachmentDto;
|
|
|
|
|
import com.ydool.staff.dto.PersonnelByExchangeDto;
|
|
|
|
|
import com.ydool.staff.dto.PersonnelDto;
|
|
|
|
@ -33,6 +35,7 @@ import com.ydool.staff.service.IAttachmentService;
|
|
|
|
|
import com.ydool.staff.service.IPersonnelService;
|
|
|
|
|
import com.ydool.system.entity.Dept;
|
|
|
|
|
import com.ydool.system.mapper.DeptMapper;
|
|
|
|
|
import org.apache.poi.ss.formula.functions.Column;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.thymeleaf.util.StringUtils;
|
|
|
|
@ -160,17 +163,17 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
|
|
|
|
return AjaxResult.fail().msg("该人员修改的资料未审批完成,请联系管理员!");
|
|
|
|
|
}
|
|
|
|
|
String type =AgesConst.PERSONNEL;
|
|
|
|
|
saveAlteration("民族更改",per.getNation(),updateRequest.getNation(),type,updateRequest.getId());
|
|
|
|
|
saveAlteration("政治面貌更改",per.getPoliticsStatus(),updateRequest.getPoliticsStatus(),type,updateRequest.getId());
|
|
|
|
|
saveAlteration("学历更改",per.getEducation(),updateRequest.getEducation(),type,updateRequest.getId());
|
|
|
|
|
saveAlteration("是否应届毕业生更改",per.getFreshGraduate(),updateRequest.getFreshGraduate(),type,updateRequest.getId());
|
|
|
|
|
saveAlteration("毕业院校更改",per.getAcademy(),updateRequest.getAcademy(),type,updateRequest.getId());
|
|
|
|
|
saveAlteration("专业更改",per.getSpecialty(),updateRequest.getSpecialty(),type,updateRequest.getId());
|
|
|
|
|
saveAlteration("所在部门更改",per.getPresentDept(),updateRequest.getPresentDept(),type,updateRequest.getId());
|
|
|
|
|
saveAlteration("合同形式更改",per.getContractModality(),updateRequest.getContractModality(),type,updateRequest.getId());
|
|
|
|
|
saveAlteration("身份证附件更改",per.getCardFile(),card,type,updateRequest.getId());
|
|
|
|
|
saveAlteration("学历证书附件更改",per.getEducationFile(),education,type,updateRequest.getId());
|
|
|
|
|
saveAlteration("审批资料附件更改",per.getAuditFile(),audit,type,updateRequest.getId());
|
|
|
|
|
saveAlteration("民族更改",per.getNation(),updateRequest.getNation(),type,updateRequest.getId(),ColumnUtil.getFieldName(Personnel::getNation));
|
|
|
|
|
saveAlteration("政治面貌更改",per.getPoliticsStatus(),updateRequest.getPoliticsStatus(),type,updateRequest.getId(),ColumnUtil.getFieldName(Personnel::getPoliticsStatus));
|
|
|
|
|
saveAlteration("学历更改",per.getEducation(),updateRequest.getEducation(),type,updateRequest.getId(),ColumnUtil.getFieldName(Personnel::getEducation));
|
|
|
|
|
saveAlteration("是否应届毕业生更改",per.getFreshGraduate(),updateRequest.getFreshGraduate(),type,updateRequest.getId(),ColumnUtil.getFieldName(Personnel::getFreshGraduate));
|
|
|
|
|
saveAlteration("毕业院校更改",per.getAcademy(),updateRequest.getAcademy(),type,updateRequest.getId(),ColumnUtil.getFieldName(Personnel::getAcademy));
|
|
|
|
|
saveAlteration("专业更改",per.getSpecialty(),updateRequest.getSpecialty(),type,updateRequest.getId(),ColumnUtil.getFieldName(Personnel::getSpecialty));
|
|
|
|
|
saveAlteration("所在部门更改",per.getPresentDept(),updateRequest.getPresentDept(),type,updateRequest.getId(),ColumnUtil.getFieldName(Personnel::getPresentDept));
|
|
|
|
|
saveAlteration("合同形式更改",per.getContractModality(),updateRequest.getContractModality(),type,updateRequest.getId(),ColumnUtil.getFieldName(Personnel::getContractModality));
|
|
|
|
|
saveAlteration("身份证附件更改",per.getCardFile(),card,type,updateRequest.getId(),ColumnUtil.getFieldName(Personnel::getCardFile));
|
|
|
|
|
saveAlteration("学历证书附件更改",per.getEducationFile(),education,type,updateRequest.getId(),ColumnUtil.getFieldName(Personnel::getEducationFile));
|
|
|
|
|
saveAlteration("审批资料附件更改",per.getAuditFile(),audit,type,updateRequest.getId(),ColumnUtil.getFieldName(Personnel::getAuditFile));
|
|
|
|
|
|
|
|
|
|
per.setAuditState(0);
|
|
|
|
|
boolean update = updateById(per);
|
|
|
|
@ -197,20 +200,20 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
|
|
|
|
String engage = StringUtils.join(saveFilePath(engageFiles,AgesConst.ENGAGE_FILE,type,request.getId()),',');
|
|
|
|
|
String education = StringUtils.join(saveFilePath(educationFiles,AgesConst.EDUCATION_FILE,type,request.getId()),',');
|
|
|
|
|
String audit = StringUtils.join(saveFilePath(auditFiles,AgesConst.AUDIT_FILE,type,request.getId()),',');
|
|
|
|
|
saveAlteration("录用方式更改",per.getHireType(),request.getHireType(),type,request.getId());
|
|
|
|
|
saveAlteration("执业资格更改",per.getQualification(),request.getQualification(),type,request.getId());
|
|
|
|
|
saveAlteration("专业技术职称更改",per.getJobTitle(),request.getJobTitle(),type,request.getId());
|
|
|
|
|
saveAlteration("岗位职务更改",per.getPosition(),request.getPosition(),type,request.getId());
|
|
|
|
|
saveAlteration("工作状态更改",per.getWorkState(),request.getWorkState(),type,request.getId());
|
|
|
|
|
saveAlteration("人员性质更改",per.getPersonnelCharacter(),request.getPersonnelCharacter(),type,request.getId());
|
|
|
|
|
saveAlteration("年薪更改",per.getAnnualSalary(),request.getAnnualSalary(),type,request.getId());
|
|
|
|
|
saveAlteration("退休时间更改",per.getRetirementTime(),request.getRetirementTime(),type,request.getId());
|
|
|
|
|
saveAlteration("人员招聘单号更改",per.getRecruitNumber(),request.getRecruitNumber(),type,request.getId());
|
|
|
|
|
saveAlteration("身份证附件更改",per.getCardFile(),card,type,request.getId());
|
|
|
|
|
saveAlteration("聘任证书附件更改",per.getEngageFile(),jobTitle,type,request.getId());
|
|
|
|
|
saveAlteration("职称证书附件更改",per.getJobTitleFile(),engage,type,request.getId());
|
|
|
|
|
saveAlteration("学历证书附件更改",per.getEducationFile(),education,type,request.getId());
|
|
|
|
|
saveAlteration("审批资料附件更改",per.getAuditFile(),audit,type,request.getId());
|
|
|
|
|
saveAlteration("录用方式更改",per.getHireType(),request.getHireType(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getHireType));
|
|
|
|
|
saveAlteration("执业资格更改",per.getQualification(),request.getQualification(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getQualification));
|
|
|
|
|
saveAlteration("专业技术职称更改",per.getJobTitle(),request.getJobTitle(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getJobTitle));
|
|
|
|
|
saveAlteration("岗位职务更改",per.getPosition(),request.getPosition(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getPosition));
|
|
|
|
|
saveAlteration("工作状态更改",per.getWorkState(),request.getWorkState(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getWorkState));
|
|
|
|
|
saveAlteration("人员性质更改",per.getPersonnelCharacter(),request.getPersonnelCharacter(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getPersonnelCharacter));
|
|
|
|
|
saveAlteration("年薪更改",per.getAnnualSalary(),request.getAnnualSalary(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getAnnualSalary));
|
|
|
|
|
saveAlteration("退休时间更改",per.getRetirementTime(),request.getRetirementTime(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getRetirementTime));
|
|
|
|
|
saveAlteration("人员招聘单号更改",per.getRecruitNumber(),request.getRecruitNumber(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getRecruitNumber));
|
|
|
|
|
saveAlteration("身份证附件更改",per.getCardFile(),card,type,request.getId(),ColumnUtil.getFieldName(Personnel::getCardFile));
|
|
|
|
|
saveAlteration("聘任证书附件更改",per.getEngageFile(),jobTitle,type,request.getId(),ColumnUtil.getFieldName(Personnel::getEngageFile));
|
|
|
|
|
saveAlteration("职称证书附件更改",per.getJobTitleFile(),engage,type,request.getId(),ColumnUtil.getFieldName(Personnel::getJobTitleFile));
|
|
|
|
|
saveAlteration("学历证书附件更改",per.getEducationFile(),education,type,request.getId(),ColumnUtil.getFieldName(Personnel::getEducationFile));
|
|
|
|
|
saveAlteration("审批资料附件更改",per.getAuditFile(),audit,type,request.getId(),ColumnUtil.getFieldName(Personnel::getAuditFile));
|
|
|
|
|
per.setAuditState(0);
|
|
|
|
|
boolean update = updateById(per);
|
|
|
|
|
saveAttachment(cardFiles,AgesConst.CARD_FILE,request.getId(),AgesConst.UPDATE);
|
|
|
|
@ -266,10 +269,11 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
|
|
|
|
return new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void saveAlteration(String details,Object before ,Object after,String type, String id){
|
|
|
|
|
public void saveAlteration(String details,Object before ,Object after,String type, String id,String fieldName){
|
|
|
|
|
if (!before.equals(after)){
|
|
|
|
|
Alteration alteration = new Alteration();
|
|
|
|
|
alteration.setDetails(details);
|
|
|
|
|
alteration.setFieldName(fieldName);
|
|
|
|
|
alteration.setType(type);
|
|
|
|
|
alteration.setRelevancyId(id);
|
|
|
|
|
if (ObjectUtil.isNotNull(before)){
|
|
|
|
@ -314,7 +318,7 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
|
|
|
|
.eq(ObjectUtil.isNotNull(request.getHireDate()),Personnel::getHireDate,request.getHireDate())
|
|
|
|
|
.eq(ObjectUtil.isNotNull(request.getResignationTime()),Personnel::getResignationTime,request.getResignationTime())
|
|
|
|
|
.eq(StrUtil.isNotBlank(request.getWorkState()),Personnel::getWorkState,request.getWorkState())
|
|
|
|
|
.eq(StrUtil.isNotBlank(request.getRecruitNumber()),Personnel::getRecruitNumber,request.getRecruitNumber())
|
|
|
|
|
.eq(StrUtil.isNotBlank(request.getReceipts()),Personnel::getRecruitNumber,request.getReceipts())
|
|
|
|
|
.eq(StrUtil.isNotBlank(request.getAlterationSign()),Personnel::getAlterationSign,request.getAlterationSign());
|
|
|
|
|
wrapper.lambda().like(Personnel::getUserName,request.getUserName())
|
|
|
|
|
.like(Personnel::getNumberId,request.getNumberId())
|
|
|
|
|