审核改动
This commit is contained in:
parent
31a2f3ede5
commit
588830390a
|
@ -144,12 +144,18 @@ public class Personnel extends BaseEntity {
|
|||
@ApiModelProperty(value = "审批资料附件")
|
||||
private String auditFile;
|
||||
|
||||
@ApiModelProperty(value = "变更标志")
|
||||
@ApiModelProperty(value = "变更标志: 0:未变更 1:变更中 2:变更完成")
|
||||
private String alterationSign;
|
||||
|
||||
@ApiModelProperty(value = "审批状态 0 未审批 1 待审批,2已通过,3已拒绝")
|
||||
@ApiModelProperty(value = "审批状态 0 未送审 1 待人事审批,2待领导审批,3已通过,4已拒绝")
|
||||
private Integer auditState;
|
||||
|
||||
@ApiModelProperty(value = "变更表变更标志: 0:未变更 1:变更中 2:变更完成")
|
||||
private String changeAlterationSign;
|
||||
|
||||
@ApiModelProperty(value = "变更表审批状态 0 未送审 1 待人事审批,2 待领导审批,3已通过,4已拒绝")
|
||||
private Integer changeAuditState;
|
||||
|
||||
@ApiModelProperty(value = "单据状态")
|
||||
private String receipts;
|
||||
|
||||
|
|
|
@ -71,5 +71,8 @@ public class SelectRequest {
|
|||
@ApiModelProperty(value = "变更标志")
|
||||
private String alterationSign;
|
||||
|
||||
@ApiModelProperty(value = "变更表变更标志")
|
||||
private String changeAlterationSign;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.springframework.stereotype.Service;
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -41,9 +42,10 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
|||
private UserMapper userMapper;
|
||||
@Resource
|
||||
private AuditLogMapper auditLogMapper;
|
||||
|
||||
@Resource
|
||||
private IPersonnelService personnelService;
|
||||
private OrganizationMapper organizationMapper;
|
||||
@Resource
|
||||
private DirectorsSupervisorsMapper directorsSupervisorsMapper;
|
||||
|
||||
@Resource
|
||||
private AuditMapper auditMapper;
|
||||
|
@ -52,10 +54,6 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
|||
private PersonnelMapper personnelMapper;
|
||||
@Resource
|
||||
private PersonnelMiddleMapper personnelMiddleMapper;
|
||||
@Autowired
|
||||
DirectorsSupervisorsMapper directorsSupervisorsMapper;
|
||||
@Autowired
|
||||
OrganizationMapper organizationMapper;
|
||||
|
||||
@Override
|
||||
public AjaxResult getAuditList(Page page) {
|
||||
|
@ -67,24 +65,29 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult audit(AuditRequest auditRequest) {
|
||||
String loginId = (String) StpUtil.getLoginId();
|
||||
User loginUser = userMapper.selectById(loginId);
|
||||
Audit one = getOne(new LambdaQueryWrapper<Audit>()
|
||||
.eq(Audit::getPersonnelId, auditRequest.getPersonnelId())
|
||||
.eq(Audit::getPerType,auditRequest.getType())
|
||||
.eq(Audit::getAuditOrder, ArgsConst.WAITING)
|
||||
.eq(Audit::getApprover, loginId));
|
||||
if (ArgsConst.WAITING.equals(one.getAuditState())){
|
||||
System.out.println("one = " + one);
|
||||
one.setOpinion(auditRequest.getAuditOpinion());
|
||||
one.setApproverTime(new Date());
|
||||
if(ObjectUtil.isEmpty(one)){
|
||||
return AjaxResult.fail().msg("该用户不能审批!");
|
||||
}
|
||||
if (ArgsConst.PASS.equals(one.getAuditState())){
|
||||
if(ArgsConst.PASS.equals(one.getAuditState())){
|
||||
return AjaxResult.fail().msg("用户已审批,请勿重复操作!");
|
||||
}
|
||||
List<Audit> list = list(new LambdaQueryWrapper<Audit>().eq(Audit::getPersonnelId, auditRequest.getPersonnelId()));
|
||||
//同意
|
||||
if ("2".equals(auditRequest.getStatus())){
|
||||
for (Audit audit : list) {
|
||||
User byId = userMapper.selectById(audit.getApprover());
|
||||
Config director = configMapper.selectOne(new LambdaQueryWrapper<Config>().eq(Config::getParamKey, ConfigCache.SYS_USER_PERSONNEL_DIRECTOR));
|
||||
if (byId.getLoginName().equals(director.getParamValue())){
|
||||
one.setAuditOrder(ArgsConst.PASS);
|
||||
System.out.println("director = " + director);
|
||||
if (loginUser.getLoginName().equals(director.getParamValue())){
|
||||
System.out.println("111111111111111");
|
||||
one.setAuditOrder(ArgsConst.FIRST);
|
||||
one.setAuditState(ArgsConst.PASS);
|
||||
boolean update = updateById(one);
|
||||
if (update){
|
||||
User user = userMapper.selectOne(new LambdaQueryWrapper<User>()
|
||||
|
@ -93,13 +96,19 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
|||
Audit auditOne = getOne(new LambdaQueryWrapper<Audit>().eq(Audit::getApprover, user.getId()).eq(Audit::getPersonnelId, auditRequest.getPersonnelId()));
|
||||
auditOne.setAuditOrder(ArgsConst.WAITING);
|
||||
updateById(auditOne);
|
||||
Personnel personnel = personnelMapper.selectById(auditOne.getPersonnelId());
|
||||
personnel.setAuditState(2);
|
||||
personnelMapper.updateById(personnel);
|
||||
saveAuditLog(auditRequest.getPersonnelId(),loginId,"一般初审通过");
|
||||
}
|
||||
return update ? AjaxResult.ok().msg("审批成功!"):AjaxResult.fail().msg("审批成功!");
|
||||
}
|
||||
Config leadership = configMapper.selectOne(new LambdaQueryWrapper<Config>().eq(Config::getParamKey, ConfigCache.SYS_USER_LEADERSHIP));
|
||||
if (leadership.getParamValue().equals(byId.getLoginName())){
|
||||
one.setAuditOrder(ArgsConst.PASS);
|
||||
System.out.println("leadership = " + leadership);
|
||||
if (leadership.getParamValue().equals(loginUser.getLoginName())){
|
||||
System.out.println("22222222222222");
|
||||
one.setAuditOrder(ArgsConst.LAST);
|
||||
one.setAuditState(ArgsConst.PASS);
|
||||
boolean update = updateById(one);
|
||||
if (update){
|
||||
saveAuditLog(auditRequest.getPersonnelId(),loginId,"一般终审通过");
|
||||
|
@ -108,6 +117,8 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
|||
Personnel personnelOne = personnelMapper.selectById(middle.getAfterId());
|
||||
String id = personnelOne.getId();
|
||||
personnelOne.setState("2");
|
||||
personnelOne.setAlterationSign("2");
|
||||
personnelOne.setAuditState(3);
|
||||
personnelOne.setId(personnel.getId());
|
||||
personnel.setId(id);
|
||||
personnel.setState("0");
|
||||
|
@ -119,18 +130,16 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
|||
return update ? AjaxResult.ok().msg("审批成功!"):AjaxResult.fail().msg("审批成功!");
|
||||
}
|
||||
}
|
||||
}
|
||||
//拒绝
|
||||
for (Audit audit : list) {
|
||||
|
||||
List<Audit> auditList = list(new LambdaQueryWrapper<Audit>().eq(Audit::getPersonnelId, auditRequest.getPersonnelId()));
|
||||
User byId = userMapper.selectById(audit.getAuditOrder());
|
||||
Config director = configMapper.selectOne(new LambdaQueryWrapper<Config>().eq(Config::getParamKey, ConfigCache.SYS_USER_PERSONNEL_DIRECTOR));
|
||||
PersonnelMiddle middle = personnelMiddleMapper.selectOne(new LambdaQueryWrapper<PersonnelMiddle>().eq(PersonnelMiddle::getBeforeId, auditRequest.getPersonnelId()).eq(PersonnelMiddle::getState, "1"));
|
||||
Personnel afterPersonnel = personnelMapper.selectById(middle.getAfterId());
|
||||
Personnel personnel = personnelMapper.selectById(auditRequest.getPersonnelId());
|
||||
if (byId.getLoginName().equals(director.getParamValue())){
|
||||
if (loginUser.getLoginName().equals(director.getParamValue())){
|
||||
one.setAuditOrder(ArgsConst.REJECT);
|
||||
one.setOpinion(audit.getOpinion());
|
||||
one.setOpinion(auditRequest.getAuditOpinion());
|
||||
boolean update = updateById(one);
|
||||
if (update){
|
||||
saveAuditLog(auditRequest.getPersonnelId(),loginId,"一般初审拒绝");
|
||||
|
@ -142,9 +151,9 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
|||
return update ? AjaxResult.ok().msg("审批成功!"):AjaxResult.fail().msg("审批成功!");
|
||||
}
|
||||
Config leadership = configMapper.selectOne(new LambdaQueryWrapper<Config>().eq(Config::getParamKey, ConfigCache.SYS_USER_LEADERSHIP));
|
||||
if (leadership.getParamValue().equals(byId.getLoginName())){
|
||||
if (leadership.getParamValue().equals(loginUser.getLoginName())){
|
||||
one.setAuditOrder(ArgsConst.REJECT);
|
||||
one.setOpinion(audit.getOpinion());
|
||||
one.setOpinion(auditRequest.getAuditOpinion());
|
||||
boolean update = updateById(one);
|
||||
if (update){
|
||||
saveAuditLog(auditRequest.getPersonnelId(),loginId,"一般终审拒绝");
|
||||
|
@ -155,11 +164,9 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
|||
}
|
||||
return update ? AjaxResult.ok().msg("审批成功!"):AjaxResult.fail().msg("审批成功!");
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer saveAuditLog(String personnelId,String approverId,String auditSate){
|
||||
AuditLog auditLog = new AuditLog();
|
||||
auditLog.setPersonnelId(personnelId);
|
||||
|
@ -167,11 +174,10 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
|||
auditLog.setAuditState(auditSate);
|
||||
return auditLogMapper.insert(auditLog);
|
||||
}
|
||||
|
||||
public void updateByPer(String afterId,Personnel personnel){
|
||||
delete(afterId);
|
||||
personnel.setAuditState(0);
|
||||
personnel.setAlterationSign("0");
|
||||
personnel.setAuditState(4);
|
||||
personnel.setAlterationSign("2");
|
||||
personnelMapper.updateById(personnel);
|
||||
}
|
||||
|
||||
|
|
|
@ -235,19 +235,20 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
|||
per.setAlterationSign("1");
|
||||
boolean update = updateById(per);
|
||||
middle.setBeforeId(per.getId());
|
||||
per.setNation(saveAlteration("民族更改", per.getNation(), updateRequest.getNation(), type, updateRequest.getId(), ColumnUtil.getFieldName(Personnel::getNation)));
|
||||
per.setPoliticsStatus(saveAlteration("政治面貌更改", per.getPoliticsStatus(), updateRequest.getPoliticsStatus(), type, updateRequest.getId(), ColumnUtil.getFieldName(Personnel::getPoliticsStatus)));
|
||||
per.setEducation(saveAlteration("学历更改", per.getEducation(), updateRequest.getEducation(), type, updateRequest.getId(), ColumnUtil.getFieldName(Personnel::getEducation)));
|
||||
per.setFreshGraduate(saveAlteration("是否应届毕业生更改", per.getFreshGraduate(), updateRequest.getFreshGraduate(), type, updateRequest.getId(), ColumnUtil.getFieldName(Personnel::getFreshGraduate)));
|
||||
per.setAcademy(saveAlteration("毕业院校更改", per.getAcademy(), updateRequest.getAcademy(), type, updateRequest.getId(), ColumnUtil.getFieldName(Personnel::getAcademy)));
|
||||
per.setSpecialty(saveAlteration("专业更改", per.getSpecialty(), updateRequest.getSpecialty(), type, updateRequest.getId(), ColumnUtil.getFieldName(Personnel::getSpecialty)));
|
||||
per.setPresentDept(saveAlteration("所在部门更改", per.getPresentDept(), updateRequest.getPresentDept(), type, updateRequest.getId(), ColumnUtil.getFieldName(Personnel::getPresentDept)));
|
||||
per.setContractModality(saveAlteration("合同形式更改", per.getContractModality(), updateRequest.getContractModality(), type, updateRequest.getId(), ColumnUtil.getFieldName(Personnel::getContractModality)));
|
||||
per.setCardFile(saveAlteration("身份证附件更改", per.getCardFile(), card, type, updateRequest.getId(), ColumnUtil.getFieldName(Personnel::getCardFile)));
|
||||
per.setEducationFile(saveAlteration("学历证书附件更改", per.getEducationFile(), education, type, updateRequest.getId(), ColumnUtil.getFieldName(Personnel::getEducationFile)));
|
||||
per.setAuditFile(saveAlteration("审批资料附件更改", per.getAuditFile(), audit, type, updateRequest.getId(), ColumnUtil.getFieldName(Personnel::getAuditFile)));
|
||||
per.setNation(saveAlteration("民族更改", per.getNation(), updateRequest.getNation(), type, updateRequest.getId(), ColumnUtil.getFieldName(Personnel::getNation)).toString());
|
||||
per.setPoliticsStatus(saveAlteration("政治面貌更改", per.getPoliticsStatus(), updateRequest.getPoliticsStatus(), type, updateRequest.getId(), ColumnUtil.getFieldName(Personnel::getPoliticsStatus)).toString());
|
||||
per.setEducation(saveAlteration("学历更改", per.getEducation(), updateRequest.getEducation(), type, updateRequest.getId(), ColumnUtil.getFieldName(Personnel::getEducation)).toString());
|
||||
per.setFreshGraduate(saveAlteration("是否应届毕业生更改", per.getFreshGraduate(), updateRequest.getFreshGraduate(), type, updateRequest.getId(), ColumnUtil.getFieldName(Personnel::getFreshGraduate)).toString());
|
||||
per.setAcademy(saveAlteration("毕业院校更改", per.getAcademy(), updateRequest.getAcademy(), type, updateRequest.getId(), ColumnUtil.getFieldName(Personnel::getAcademy)).toString());
|
||||
per.setSpecialty(saveAlteration("专业更改", per.getSpecialty(), updateRequest.getSpecialty(), type, updateRequest.getId(), ColumnUtil.getFieldName(Personnel::getSpecialty)).toString());
|
||||
per.setPresentDept(saveAlteration("所在部门更改", per.getPresentDept(), updateRequest.getPresentDept(), type, updateRequest.getId(), ColumnUtil.getFieldName(Personnel::getPresentDept)).toString());
|
||||
per.setContractModality(saveAlteration("合同形式更改", per.getContractModality(), updateRequest.getContractModality(), type, updateRequest.getId(), ColumnUtil.getFieldName(Personnel::getContractModality)).toString());
|
||||
per.setCardFile(saveAlteration("身份证附件更改", per.getCardFile(), card, type, updateRequest.getId(), ColumnUtil.getFieldName(Personnel::getCardFile)).toString());
|
||||
per.setEducationFile(saveAlteration("学历证书附件更改", per.getEducationFile(), education, type, updateRequest.getId(), ColumnUtil.getFieldName(Personnel::getEducationFile)).toString());
|
||||
per.setAuditFile(saveAlteration("审批资料附件更改", per.getAuditFile(), audit, type, updateRequest.getId(), ColumnUtil.getFieldName(Personnel::getAuditFile)).toString());
|
||||
per.setId("");
|
||||
per.setState("1");
|
||||
per.setAlterationSign("1");
|
||||
save(per);
|
||||
middle.setAfterId(per.getId());
|
||||
personnelMiddleService.savePer(middle);
|
||||
|
@ -267,7 +268,7 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
|||
List<AttachmentRequest> engageFiles = request.getEngageFiles();
|
||||
List<AttachmentRequest> educationFiles = request.getEducationFiles();
|
||||
List<AttachmentRequest> auditFiles = request.getAuditFiles();
|
||||
if ("1".equals(per.getAlterationSign())) {
|
||||
if ("1".equals(per.getChangeAlterationSign())) {
|
||||
return AjaxResult.fail().msg("该人员修改的资料未审批完成,请联系管理员!");
|
||||
}
|
||||
String type = ArgsConst.CHANGE;
|
||||
|
@ -276,27 +277,38 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
|||
String engage = StringUtils.join(saveFilePath(engageFiles, ArgsConst.ENGAGE_FILE, type, request.getId()), ',');
|
||||
String education = StringUtils.join(saveFilePath(educationFiles, ArgsConst.EDUCATION_FILE, type, request.getId()), ',');
|
||||
String audit = StringUtils.join(saveFilePath(auditFiles, ArgsConst.AUDIT_FILE, type, request.getId()), ',');
|
||||
per.setAlterationSign("0");
|
||||
per.setChangeAlterationSign("1");
|
||||
boolean update = updateById(per);
|
||||
middle.setBeforeId(per.getId());
|
||||
per.setHireType(saveAlteration("录用方式更改",per.getHireType(),request.getHireType(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getHireType)));
|
||||
per.setQualification(saveAlteration("执业资格更改",per.getQualification(),request.getQualification(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getQualification)));
|
||||
per.setJobTitle(saveAlteration("专业技术职称更改",per.getJobTitle(),request.getJobTitle(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getJobTitle)));
|
||||
per.setPosition(saveAlteration("岗位职务更改",per.getPosition(),request.getPosition(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getPosition)));
|
||||
per.setWorkState(saveAlteration("工作状态更改",per.getWorkState(),request.getWorkState(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getWorkState)));
|
||||
per.setPersonnelCharacter(saveAlteration("人员性质更改",per.getPersonnelCharacter(),request.getPersonnelCharacter(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getPersonnelCharacter)));
|
||||
per.setAnnualSalary(Integer.valueOf(saveAlteration("年薪更改",per.getAnnualSalary(),request.getAnnualSalary(),type,request.getId(), ColumnUtil.getFieldName(Personnel::getAnnualSalary))));
|
||||
per.setRecruitNumber(saveAlteration("人员招聘单号更改",per.getRecruitNumber(),request.getRecruitNumber(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getRecruitNumber)));
|
||||
per.setCardFile(saveAlteration("身份证附件更改",per.getCardFile(),card,type,request.getId(),ColumnUtil.getFieldName(Personnel::getCardFile)));
|
||||
per.setEngageFile(saveAlteration("聘任证书附件更改",per.getEngageFile(),jobTitle,type,request.getId(),ColumnUtil.getFieldName(Personnel::getEngageFile)));
|
||||
per.setJobTitleFile(saveAlteration("职称证书附件更改",per.getJobTitleFile(),engage,type,request.getId(),ColumnUtil.getFieldName(Personnel::getJobTitleFile)));
|
||||
per.setEducationFile(saveAlteration("学历证书附件更改",per.getEducationFile(),education,type,request.getId(),ColumnUtil.getFieldName(Personnel::getEducationFile)));
|
||||
per.setAuditFile(saveAlteration("审批资料附件更改",per.getAuditFile(),audit,type,request.getId(),ColumnUtil.getFieldName(Personnel::getAuditFile)));
|
||||
per.setHireType(saveAlteration("录用方式更改",per.getHireType(),request.getHireType(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getHireType)).toString());
|
||||
per.setQualification(saveAlteration("执业资格更改",per.getQualification(),request.getQualification(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getQualification)).toString());
|
||||
per.setJobTitle(saveAlteration("专业技术职称更改",per.getJobTitle(),request.getJobTitle(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getJobTitle)).toString());
|
||||
per.setPosition(saveAlteration("岗位职务更改",per.getPosition(),request.getPosition(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getPosition)).toString());
|
||||
per.setWorkState(saveAlteration("工作状态更改",per.getWorkState(),request.getWorkState(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getWorkState)).toString());
|
||||
per.setPersonnelCharacter(saveAlteration("人员性质更改",per.getPersonnelCharacter(),request.getPersonnelCharacter(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getPersonnelCharacter)).toString());
|
||||
per.setAnnualSalary((Integer) saveAlteration("年薪更改", per.getAnnualSalary(), request.getAnnualSalary(), type, request.getId(), ColumnUtil.getFieldName(Personnel::getAnnualSalary)));
|
||||
per.setRecruitNumber(saveAlteration("人员招聘单号更改",per.getRecruitNumber(),request.getRecruitNumber(),type,request.getId(),ColumnUtil.getFieldName(Personnel::getRecruitNumber)).toString());
|
||||
if (StrUtil.isNotBlank(card)){
|
||||
per.setCardFile(saveAlteration("身份证附件更改",per.getCardFile(),card,type,request.getId(),ColumnUtil.getFieldName(Personnel::getCardFile)).toString());
|
||||
}
|
||||
if (StrUtil.isNotBlank(jobTitle)){
|
||||
per.setEngageFile(saveAlteration("聘任证书附件更改",per.getEngageFile(),jobTitle,type,request.getId(),ColumnUtil.getFieldName(Personnel::getEngageFile)).toString());
|
||||
}
|
||||
if (StrUtil.isNotBlank(engage)){
|
||||
per.setJobTitleFile(saveAlteration("职称证书附件更改",per.getJobTitleFile(),engage,type,request.getId(),ColumnUtil.getFieldName(Personnel::getJobTitleFile)).toString());
|
||||
}
|
||||
if (StrUtil.isNotBlank(education)){
|
||||
per.setEducationFile(saveAlteration("学历证书附件更改",per.getEducationFile(),education,type,request.getId(),ColumnUtil.getFieldName(Personnel::getEducationFile)).toString());
|
||||
}
|
||||
if (StrUtil.isNotBlank(audit)){
|
||||
per.setAuditFile(saveAlteration("审批资料附件更改",per.getAuditFile(),audit,type,request.getId(),ColumnUtil.getFieldName(Personnel::getAuditFile)).toString());
|
||||
}
|
||||
if (ObjectUtil.isNotNull(per.getRetirementTime())){
|
||||
per.setRetirementTime(LocalDate.parse(saveAlteration("退休时间更改",per.getRetirementTime(),request.getRetirementTime(),type,request.getId(), ColumnUtil.getFieldName(Personnel::getRetirementTime))));
|
||||
per.setRetirementTime((LocalDate) saveAlteration("退休时间更改",per.getRetirementTime(),request.getRetirementTime(),type,request.getId(), ColumnUtil.getFieldName(Personnel::getRetirementTime)));
|
||||
}
|
||||
per.setId("");
|
||||
per.setState("1");
|
||||
per.setChangeAlterationSign("1");
|
||||
save(per);
|
||||
middle.setAfterId(per.getId());
|
||||
personnelMiddleService.savePer(middle);
|
||||
|
@ -355,7 +367,7 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
|||
return null;
|
||||
}
|
||||
|
||||
public String saveAlteration(String details,Object before ,Object after,String type, String id,String fieldName){
|
||||
public Object saveAlteration(String details,Object before ,Object after,String type, String id,String fieldName){
|
||||
if (ObjectUtil.isNotNull(after)){
|
||||
if (!after.equals(before)){
|
||||
Alteration alteration = new Alteration();
|
||||
|
@ -372,9 +384,9 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
|||
alterationMapper.insert(alteration);
|
||||
|
||||
}
|
||||
return (String) after;
|
||||
return after;
|
||||
}
|
||||
return (String) before;
|
||||
return before;
|
||||
}
|
||||
|
||||
public List<AttachmentDto> nameAndPath(String file, String id) {
|
||||
|
@ -412,7 +424,9 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
|||
.eq(StrUtil.isNotBlank(request.getWorkState()),Personnel::getWorkState,request.getWorkState())
|
||||
.eq(StrUtil.isNotBlank(request.getReceipts()),Personnel::getReceipts,request.getReceipts())
|
||||
.eq(Personnel::getState,"2")
|
||||
.eq(StrUtil.isNotBlank(request.getAlterationSign()),Personnel::getAlterationSign,request.getAlterationSign());
|
||||
.eq(StrUtil.isNotBlank(request.getAlterationSign()),Personnel::getAlterationSign,request.getAlterationSign())
|
||||
.eq(StrUtil.isNotBlank(request.getChangeAlterationSign()),Personnel::getChangeAlterationSign,request.getChangeAlterationSign());
|
||||
|
||||
wrapper.lambda().like(Personnel::getUserName,request.getUserName())
|
||||
.like(Personnel::getNumberId,request.getNumberId())
|
||||
.exists(StrUtil.isNotBlank(request.getCompanyName()), "select t2.id from t_lc_company_name t2 where " +
|
||||
|
@ -506,21 +520,10 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult giveAudit(GiveAuditRequest request) {
|
||||
String loginId = (String) StpUtil.getLoginId();
|
||||
String[] ids = request.getIds();
|
||||
if (ObjectUtil.isNotEmpty(request)){
|
||||
updatePersonnel(request.getRequest());
|
||||
}
|
||||
verifyIds(ids,request.getType());
|
||||
String loginId = (String) StpUtil.getLoginId();
|
||||
for (String id : ids) {
|
||||
Personnel personnel1 = get(id);
|
||||
System.out.println("personnel1 = " + personnel1);
|
||||
if (1==(personnel1.getAuditState())) {
|
||||
return AjaxResult.fail().msg("该数据已送审,请勿重复操作!");
|
||||
}
|
||||
if ("0".equals(personnel1.getAlterationSign())){
|
||||
return AjaxResult.fail().msg("变更数据未保存,不能送审!");
|
||||
}
|
||||
|
||||
for(int i=0;i<=2;i++ ){
|
||||
Audit audit = new Audit();
|
||||
audit.setPersonnelId(id);
|
||||
|
@ -578,6 +581,29 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
|||
}
|
||||
|
||||
|
||||
public AjaxResult verifyIds(String[] ids,String type){
|
||||
for (String id : ids) {
|
||||
Personnel personnel = get(id);
|
||||
System.out.println("personnel1 = " + personnel);
|
||||
if (ArgsConst.PERSONNEL.equals(type)){
|
||||
if (1 == (personnel.getAuditState())) {
|
||||
return AjaxResult.fail().msg("该数据已送审请勿重复操作!");
|
||||
}
|
||||
if ("0".equals(personnel.getAlterationSign())) {
|
||||
return AjaxResult.fail().msg("变更数据未保存,不能送审!");
|
||||
}
|
||||
}else if (ArgsConst.CHANGE.equals(type)){
|
||||
if (1 == (personnel.getChangeAuditState())) {
|
||||
return AjaxResult.fail().msg("该数据已送审请勿重复操作!");
|
||||
}
|
||||
if ("0".equals(personnel.getChangeAlterationSign())) {
|
||||
return AjaxResult.fail().msg("变更数据未保存,不能送审!");
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue