人员变更审核
This commit is contained in:
parent
588830390a
commit
cfdf59fd4b
|
@ -78,4 +78,5 @@ public class ExchangeController extends BaseController {
|
||||||
return exchangeService.deleteExchangeById(ids);
|
return exchangeService.deleteExchangeById(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,4 +35,7 @@ public class AuditLog extends BaseEntity{
|
||||||
@ApiModelProperty(value = "处理意见")
|
@ApiModelProperty(value = "处理意见")
|
||||||
private String opinion;
|
private String opinion;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "日志类型:personnel 人员 change:变更 ")
|
||||||
|
private String type;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ public interface IAuditService {
|
||||||
|
|
||||||
AjaxResult audit(AuditRequest auditRequest);
|
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);
|
AjaxResult submitDirectorsSupervisorsAudit(AuditRequest auditRequest);
|
||||||
|
|
||||||
|
|
|
@ -97,9 +97,13 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
||||||
auditOne.setAuditOrder(ArgsConst.WAITING);
|
auditOne.setAuditOrder(ArgsConst.WAITING);
|
||||||
updateById(auditOne);
|
updateById(auditOne);
|
||||||
Personnel personnel = personnelMapper.selectById(auditOne.getPersonnelId());
|
Personnel personnel = personnelMapper.selectById(auditOne.getPersonnelId());
|
||||||
|
if (ArgsConst.PERSONNEL.equals(auditRequest.getType())){
|
||||||
personnel.setAuditState(2);
|
personnel.setAuditState(2);
|
||||||
|
}else if (ArgsConst.CHANGE.equals(auditRequest.getType())){
|
||||||
|
personnel.setChangeAuditState(2);
|
||||||
|
}
|
||||||
personnelMapper.updateById(personnel);
|
personnelMapper.updateById(personnel);
|
||||||
saveAuditLog(auditRequest.getPersonnelId(),loginId,"一般初审通过");
|
saveAuditLog(auditRequest.getPersonnelId(),loginId,auditRequest.getType(),"一般初审通过");
|
||||||
}
|
}
|
||||||
return update ? AjaxResult.ok().msg("审批成功!"):AjaxResult.fail().msg("审批成功!");
|
return update ? AjaxResult.ok().msg("审批成功!"):AjaxResult.fail().msg("审批成功!");
|
||||||
}
|
}
|
||||||
|
@ -111,14 +115,20 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
||||||
one.setAuditState(ArgsConst.PASS);
|
one.setAuditState(ArgsConst.PASS);
|
||||||
boolean update = updateById(one);
|
boolean update = updateById(one);
|
||||||
if (update){
|
if (update){
|
||||||
saveAuditLog(auditRequest.getPersonnelId(),loginId,"一般终审通过");
|
saveAuditLog(auditRequest.getPersonnelId(),loginId,auditRequest.getType(),"一般终审通过");
|
||||||
Personnel personnel = personnelMapper.selectById(auditRequest.getPersonnelId());
|
Personnel personnel = personnelMapper.selectById(auditRequest.getPersonnelId());
|
||||||
PersonnelMiddle middle = personnelMiddleMapper.selectOne(new LambdaQueryWrapper<PersonnelMiddle>().eq(PersonnelMiddle::getBeforeId, personnel.getId()).eq(PersonnelMiddle::getState, "1"));
|
PersonnelMiddle middle = personnelMiddleMapper.selectOne(new LambdaQueryWrapper<PersonnelMiddle>().eq(PersonnelMiddle::getBeforeId, personnel.getId()).eq(PersonnelMiddle::getState, "1"));
|
||||||
Personnel personnelOne = personnelMapper.selectById(middle.getAfterId());
|
Personnel personnelOne = personnelMapper.selectById(middle.getAfterId());
|
||||||
String id = personnelOne.getId();
|
String id = personnelOne.getId();
|
||||||
personnelOne.setState("2");
|
personnelOne.setState("2");
|
||||||
|
if (ArgsConst.PERSONNEL.equals(auditRequest.getType())){
|
||||||
personnelOne.setAlterationSign("2");
|
personnelOne.setAlterationSign("2");
|
||||||
personnelOne.setAuditState(3);
|
personnelOne.setAuditState(3);
|
||||||
|
}
|
||||||
|
if (ArgsConst.CHANGE.equals(auditRequest.getType())){
|
||||||
|
personnelOne.setChangeAlterationSign("2");
|
||||||
|
personnelOne.setChangeAuditState(3);
|
||||||
|
}
|
||||||
personnelOne.setId(personnel.getId());
|
personnelOne.setId(personnel.getId());
|
||||||
personnel.setId(id);
|
personnel.setId(id);
|
||||||
personnel.setState("0");
|
personnel.setState("0");
|
||||||
|
@ -138,12 +148,13 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
||||||
Personnel afterPersonnel = personnelMapper.selectById(middle.getAfterId());
|
Personnel afterPersonnel = personnelMapper.selectById(middle.getAfterId());
|
||||||
Personnel personnel = personnelMapper.selectById(auditRequest.getPersonnelId());
|
Personnel personnel = personnelMapper.selectById(auditRequest.getPersonnelId());
|
||||||
if (loginUser.getLoginName().equals(director.getParamValue())){
|
if (loginUser.getLoginName().equals(director.getParamValue())){
|
||||||
|
|
||||||
one.setAuditOrder(ArgsConst.REJECT);
|
one.setAuditOrder(ArgsConst.REJECT);
|
||||||
one.setOpinion(auditRequest.getAuditOpinion());
|
one.setOpinion(auditRequest.getAuditOpinion());
|
||||||
boolean update = updateById(one);
|
boolean update = updateById(one);
|
||||||
if (update){
|
if (update){
|
||||||
saveAuditLog(auditRequest.getPersonnelId(),loginId,"一般初审拒绝");
|
saveAuditLog(auditRequest.getPersonnelId(),loginId,auditRequest.getType(),"一般初审拒绝");
|
||||||
updateByPer(afterPersonnel.getId(),personnel);
|
updateByPer(afterPersonnel.getId(),personnel,auditRequest.getType());
|
||||||
for (Audit auditOne : auditList) {
|
for (Audit auditOne : auditList) {
|
||||||
delete(auditOne.getId());
|
delete(auditOne.getId());
|
||||||
}
|
}
|
||||||
|
@ -156,8 +167,8 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
||||||
one.setOpinion(auditRequest.getAuditOpinion());
|
one.setOpinion(auditRequest.getAuditOpinion());
|
||||||
boolean update = updateById(one);
|
boolean update = updateById(one);
|
||||||
if (update){
|
if (update){
|
||||||
saveAuditLog(auditRequest.getPersonnelId(),loginId,"一般终审拒绝");
|
saveAuditLog(auditRequest.getPersonnelId(),loginId,auditRequest.getType(),"一般终审拒绝");
|
||||||
updateByPer(afterPersonnel.getId(),personnel);
|
updateByPer(afterPersonnel.getId(),personnel,auditRequest.getType());
|
||||||
for (Audit auditOne : auditList) {
|
for (Audit auditOne : auditList) {
|
||||||
delete(auditOne.getId());
|
delete(auditOne.getId());
|
||||||
}
|
}
|
||||||
|
@ -167,17 +178,24 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
||||||
|
|
||||||
return null;
|
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 auditLog = new AuditLog();
|
||||||
auditLog.setPersonnelId(personnelId);
|
auditLog.setPersonnelId(personnelId);
|
||||||
|
auditLog.setType(type);
|
||||||
auditLog.setApprover(approverId);
|
auditLog.setApprover(approverId);
|
||||||
auditLog.setAuditState(auditSate);
|
auditLog.setAuditState(auditSate);
|
||||||
return auditLogMapper.insert(auditLog);
|
return auditLogMapper.insert(auditLog);
|
||||||
}
|
}
|
||||||
public void updateByPer(String afterId,Personnel personnel){
|
public void updateByPer(String afterId,Personnel personnel,String type){
|
||||||
delete(afterId);
|
delete(afterId);
|
||||||
|
if (ArgsConst.PERSONNEL.equals(type)){
|
||||||
personnel.setAuditState(4);
|
personnel.setAuditState(4);
|
||||||
personnel.setAlterationSign("2");
|
personnel.setAlterationSign("2");
|
||||||
|
}else if (ArgsConst.CHANGE.equals(type)){
|
||||||
|
personnel.setChangeAuditState(4);
|
||||||
|
personnel.setChangeAlterationSign("2");
|
||||||
|
}
|
||||||
|
|
||||||
personnelMapper.updateById(personnel);
|
personnelMapper.updateById(personnel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -179,7 +179,7 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
|
||||||
}
|
}
|
||||||
directorsSupervisors.setAuditState(1);
|
directorsSupervisors.setAuditState(1);
|
||||||
updateById(directorsSupervisors);
|
updateById(directorsSupervisors);
|
||||||
Integer a = auditService.saveAuditLog(id, loginId, "送审");
|
Integer a = auditService.saveAuditLog(id, loginId, type,"送审");
|
||||||
return a > 0 ? AjaxResult.ok().msg("送审成功!") : AjaxResult.fail().msg("送审失败!");
|
return a > 0 ? AjaxResult.ok().msg("送审成功!") : AjaxResult.fail().msg("送审失败!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,7 +105,7 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
|
||||||
extracted(id, type, loginId);
|
extracted(id, type, loginId);
|
||||||
organization.setAuditState(1);
|
organization.setAuditState(1);
|
||||||
updateById(organization);
|
updateById(organization);
|
||||||
Integer i = auditService.saveAuditLog(id, loginId, "送审");
|
Integer i = auditService.saveAuditLog(id, loginId, type,"送审");
|
||||||
return i > 0 ? AjaxResult.ok().msg("送审成功!") : AjaxResult.ok().msg("送审失败!");
|
return i > 0 ? AjaxResult.ok().msg("送审成功!") : AjaxResult.ok().msg("送审失败!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
|
||||||
extracted(id, type, loginId);
|
extracted(id, type, loginId);
|
||||||
organization.setAuditState(1);
|
organization.setAuditState(1);
|
||||||
personnelIndicatorsMapper.updateById(organization);
|
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("送审失败!");
|
return i > 0 ? AjaxResult.ok().msg("送审成功!") : AjaxResult.ok().msg("送审失败!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -550,7 +550,7 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
||||||
Personnel personnel = get(id);
|
Personnel personnel = get(id);
|
||||||
personnel.setAuditState(1);
|
personnel.setAuditState(1);
|
||||||
updateById(personnel);
|
updateById(personnel);
|
||||||
auditService.saveAuditLog(id, loginId, "一般送审提交");
|
auditService.saveAuditLog(id, loginId,request.getType(), "一般送审提交");
|
||||||
|
|
||||||
}
|
}
|
||||||
if (ids.length==1){
|
if (ids.length==1){
|
||||||
|
@ -584,7 +584,6 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
||||||
public AjaxResult verifyIds(String[] ids,String type){
|
public AjaxResult verifyIds(String[] ids,String type){
|
||||||
for (String id : ids) {
|
for (String id : ids) {
|
||||||
Personnel personnel = get(id);
|
Personnel personnel = get(id);
|
||||||
System.out.println("personnel1 = " + personnel);
|
|
||||||
if (ArgsConst.PERSONNEL.equals(type)){
|
if (ArgsConst.PERSONNEL.equals(type)){
|
||||||
if (1 == (personnel.getAuditState())) {
|
if (1 == (personnel.getAuditState())) {
|
||||||
return AjaxResult.fail().msg("该数据已送审请勿重复操作!");
|
return AjaxResult.fail().msg("该数据已送审请勿重复操作!");
|
||||||
|
|
Loading…
Reference in New Issue