人员变更审核

This commit is contained in:
mash 2023-02-22 14:59:29 +08:00
parent 588830390a
commit cfdf59fd4b
7 changed files with 40 additions and 19 deletions

View File

@ -78,4 +78,5 @@ public class ExchangeController extends BaseController {
return exchangeService.deleteExchangeById(ids);
}
}

View File

@ -35,4 +35,7 @@ public class AuditLog extends BaseEntity{
@ApiModelProperty(value = "处理意见")
private String opinion;
@ApiModelProperty(value = "日志类型personnel 人员 change变更 ")
private String type;
}

View File

@ -18,7 +18,7 @@ public interface IAuditService {
AjaxResult audit(AuditRequest auditRequest);
Integer saveAuditLog(String personnelId,String approverId,String auditSate);
Integer saveAuditLog(String personnelId,String approverId,String type,String auditSate);
AjaxResult submitDirectorsSupervisorsAudit(AuditRequest auditRequest);

View File

@ -97,9 +97,13 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
auditOne.setAuditOrder(ArgsConst.WAITING);
updateById(auditOne);
Personnel personnel = personnelMapper.selectById(auditOne.getPersonnelId());
if (ArgsConst.PERSONNEL.equals(auditRequest.getType())){
personnel.setAuditState(2);
}else if (ArgsConst.CHANGE.equals(auditRequest.getType())){
personnel.setChangeAuditState(2);
}
personnelMapper.updateById(personnel);
saveAuditLog(auditRequest.getPersonnelId(),loginId,"一般初审通过");
saveAuditLog(auditRequest.getPersonnelId(),loginId,auditRequest.getType(),"一般初审通过");
}
return update ? AjaxResult.ok().msg("审批成功!"):AjaxResult.fail().msg("审批成功!");
}
@ -111,14 +115,20 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
one.setAuditState(ArgsConst.PASS);
boolean update = updateById(one);
if (update){
saveAuditLog(auditRequest.getPersonnelId(),loginId,"一般终审通过");
saveAuditLog(auditRequest.getPersonnelId(),loginId,auditRequest.getType(),"一般终审通过");
Personnel personnel = personnelMapper.selectById(auditRequest.getPersonnelId());
PersonnelMiddle middle = personnelMiddleMapper.selectOne(new LambdaQueryWrapper<PersonnelMiddle>().eq(PersonnelMiddle::getBeforeId, personnel.getId()).eq(PersonnelMiddle::getState, "1"));
Personnel personnelOne = personnelMapper.selectById(middle.getAfterId());
String id = personnelOne.getId();
personnelOne.setState("2");
if (ArgsConst.PERSONNEL.equals(auditRequest.getType())){
personnelOne.setAlterationSign("2");
personnelOne.setAuditState(3);
}
if (ArgsConst.CHANGE.equals(auditRequest.getType())){
personnelOne.setChangeAlterationSign("2");
personnelOne.setChangeAuditState(3);
}
personnelOne.setId(personnel.getId());
personnel.setId(id);
personnel.setState("0");
@ -138,12 +148,13 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
Personnel afterPersonnel = personnelMapper.selectById(middle.getAfterId());
Personnel personnel = personnelMapper.selectById(auditRequest.getPersonnelId());
if (loginUser.getLoginName().equals(director.getParamValue())){
one.setAuditOrder(ArgsConst.REJECT);
one.setOpinion(auditRequest.getAuditOpinion());
boolean update = updateById(one);
if (update){
saveAuditLog(auditRequest.getPersonnelId(),loginId,"一般初审拒绝");
updateByPer(afterPersonnel.getId(),personnel);
saveAuditLog(auditRequest.getPersonnelId(),loginId,auditRequest.getType(),"一般初审拒绝");
updateByPer(afterPersonnel.getId(),personnel,auditRequest.getType());
for (Audit auditOne : auditList) {
delete(auditOne.getId());
}
@ -156,8 +167,8 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
one.setOpinion(auditRequest.getAuditOpinion());
boolean update = updateById(one);
if (update){
saveAuditLog(auditRequest.getPersonnelId(),loginId,"一般终审拒绝");
updateByPer(afterPersonnel.getId(),personnel);
saveAuditLog(auditRequest.getPersonnelId(),loginId,auditRequest.getType(),"一般终审拒绝");
updateByPer(afterPersonnel.getId(),personnel,auditRequest.getType());
for (Audit auditOne : auditList) {
delete(auditOne.getId());
}
@ -167,17 +178,24 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
return null;
}
public Integer saveAuditLog(String personnelId,String approverId,String auditSate){
public Integer saveAuditLog(String personnelId,String approverId,String type,String auditSate){
AuditLog auditLog = new AuditLog();
auditLog.setPersonnelId(personnelId);
auditLog.setType(type);
auditLog.setApprover(approverId);
auditLog.setAuditState(auditSate);
return auditLogMapper.insert(auditLog);
}
public void updateByPer(String afterId,Personnel personnel){
public void updateByPer(String afterId,Personnel personnel,String type){
delete(afterId);
if (ArgsConst.PERSONNEL.equals(type)){
personnel.setAuditState(4);
personnel.setAlterationSign("2");
}else if (ArgsConst.CHANGE.equals(type)){
personnel.setChangeAuditState(4);
personnel.setChangeAlterationSign("2");
}
personnelMapper.updateById(personnel);
}

View File

@ -179,7 +179,7 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
}
directorsSupervisors.setAuditState(1);
updateById(directorsSupervisors);
Integer a = auditService.saveAuditLog(id, loginId, "送审");
Integer a = auditService.saveAuditLog(id, loginId, type,"送审");
return a > 0 ? AjaxResult.ok().msg("送审成功!") : AjaxResult.fail().msg("送审失败!");
}
}

View File

@ -105,7 +105,7 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
extracted(id, type, loginId);
organization.setAuditState(1);
updateById(organization);
Integer i = auditService.saveAuditLog(id, loginId, "送审");
Integer i = auditService.saveAuditLog(id, loginId, type,"送审");
return i > 0 ? AjaxResult.ok().msg("送审成功!") : AjaxResult.ok().msg("送审失败!");
}
@ -153,7 +153,7 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
extracted(id, type, loginId);
organization.setAuditState(1);
personnelIndicatorsMapper.updateById(organization);
Integer i = auditService.saveAuditLog(id, loginId, "送审");
Integer i = auditService.saveAuditLog(id, loginId, type,"送审");
return i > 0 ? AjaxResult.ok().msg("送审成功!") : AjaxResult.ok().msg("送审失败!");
}
}

View File

@ -550,7 +550,7 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
Personnel personnel = get(id);
personnel.setAuditState(1);
updateById(personnel);
auditService.saveAuditLog(id, loginId, "一般送审提交");
auditService.saveAuditLog(id, loginId,request.getType(), "一般送审提交");
}
if (ids.length==1){
@ -584,7 +584,6 @@ 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("该数据已送审请勿重复操作!");