人员选调审核1.0
This commit is contained in:
parent
cfdf59fd4b
commit
62c729fa9e
|
@ -7,6 +7,7 @@ import com.ydool.common.data.dto.AjaxResult;
|
||||||
import com.ydool.staff.dto.ExchangePageDto;
|
import com.ydool.staff.dto.ExchangePageDto;
|
||||||
import com.ydool.staff.dto.PersonnelByExchangeDto;
|
import com.ydool.staff.dto.PersonnelByExchangeDto;
|
||||||
import com.ydool.staff.request.ExchangeRequest;
|
import com.ydool.staff.request.ExchangeRequest;
|
||||||
|
import com.ydool.staff.request.GiveAuditRequest;
|
||||||
import com.ydool.staff.request.PersonnelDeleteRequest;
|
import com.ydool.staff.request.PersonnelDeleteRequest;
|
||||||
import com.ydool.staff.service.IExchangeService;
|
import com.ydool.staff.service.IExchangeService;
|
||||||
import com.ydool.staff.service.IPersonnelService;
|
import com.ydool.staff.service.IPersonnelService;
|
||||||
|
@ -79,4 +80,5 @@ public class ExchangeController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,4 +52,7 @@ public class ExchangePageDto {
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
@ApiModelProperty(value = "填报时间")
|
@ApiModelProperty(value = "填报时间")
|
||||||
private LocalDateTime createdAt;
|
private LocalDateTime createdAt;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "审批状态 0 未送审 1 待人事审批,2 待领导审批,3已通过,4已拒绝 ")
|
||||||
|
private String auditState;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,15 @@ public class PersonnelDto {
|
||||||
@ApiModelProperty(value = "审批状态 0 未审批 1 待审批,2已通过,3已拒绝")
|
@ApiModelProperty(value = "审批状态 0 未审批 1 待审批,2已通过,3已拒绝")
|
||||||
private Integer auditState;
|
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 workState;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,10 @@ public class Exchange extends BaseEntity{
|
||||||
@ApiModelProperty(value = "选调相关附件")
|
@ApiModelProperty(value = "选调相关附件")
|
||||||
private String excFile;
|
private String excFile;
|
||||||
|
|
||||||
@ApiModelProperty(value = "审批状态")
|
@ApiModelProperty(value = "审批状态 0 未送审 1 待人事审批,2 待领导审批,3已通过,4已拒绝 ")
|
||||||
private String auditState;
|
private String auditState;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "数据状态:0历史数据 1当前数据")
|
||||||
|
private String state;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ public class AuditRequest {
|
||||||
@ApiModelProperty(value = "审批意见")
|
@ApiModelProperty(value = "审批意见")
|
||||||
private String auditOpinion;
|
private String auditOpinion;
|
||||||
|
|
||||||
@ApiModelProperty(value = "人员类型:personnel:人员 change:变更")
|
@ApiModelProperty(value = "人员类型:personnel:人员 change:变更 exchange:选调")
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ public class GiveAuditRequest {
|
||||||
@ApiModelProperty(value = "人员类型:personnel 变更:change")
|
@ApiModelProperty(value = "人员类型:personnel 变更:change")
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "修改数据")
|
@ApiModelProperty(value = "修改数据")
|
||||||
private PersonnelUpdateRequest request;
|
private PersonnelUpdateRequest request;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ public interface IAuditService {
|
||||||
|
|
||||||
AjaxResult audit(AuditRequest auditRequest);
|
AjaxResult audit(AuditRequest auditRequest);
|
||||||
|
|
||||||
Integer saveAuditLog(String personnelId,String approverId,String type,String auditSate);
|
Integer saveAuditLog(String personnelId,String approverId,String type,String auditSate,String opinion);
|
||||||
|
|
||||||
AjaxResult submitDirectorsSupervisorsAudit(AuditRequest auditRequest);
|
AjaxResult submitDirectorsSupervisorsAudit(AuditRequest auditRequest);
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.ydool.staff.service;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.ydool.common.data.dto.AjaxResult;
|
import com.ydool.common.data.dto.AjaxResult;
|
||||||
import com.ydool.staff.request.ExchangeRequest;
|
import com.ydool.staff.request.ExchangeRequest;
|
||||||
|
import com.ydool.staff.request.GiveAuditRequest;
|
||||||
import com.ydool.staff.request.PersonnelDeleteRequest;
|
import com.ydool.staff.request.PersonnelDeleteRequest;
|
||||||
import com.ydool.staff.request.PersonnelUpdateRequest;
|
import com.ydool.staff.request.PersonnelUpdateRequest;
|
||||||
|
|
||||||
|
@ -23,5 +24,6 @@ public interface IExchangeService {
|
||||||
AjaxResult deleteExchangeById(PersonnelDeleteRequest request);
|
AjaxResult deleteExchangeById(PersonnelDeleteRequest request);
|
||||||
|
|
||||||
AjaxResult selectById(String id);
|
AjaxResult selectById(String id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class AuditLogServiceImpl extends BaseService<AuditLogMapper, AuditLog> i
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult auditLog(String id) {
|
public AjaxResult auditLog(String id) {
|
||||||
List<AuditLog> list = list(new LambdaQueryWrapper<AuditLog>().eq(AuditLog::getPersonnelId, id));
|
List<AuditLog> list = list(new LambdaQueryWrapper<AuditLog>().eq(AuditLog::getPersonnelId, id).orderByDesc(AuditLog::getCreatedAt));
|
||||||
List<AuditLogDto> auditLogDtos = BeanUtil.copyToList(list, AuditLogDto.class);
|
List<AuditLogDto> auditLogDtos = BeanUtil.copyToList(list, AuditLogDto.class);
|
||||||
for (AuditLogDto auditLogDto : auditLogDtos) {
|
for (AuditLogDto auditLogDto : auditLogDtos) {
|
||||||
User user = userMapper.selectById(auditLogDto.getApprover());
|
User user = userMapper.selectById(auditLogDto.getApprover());
|
||||||
|
|
|
@ -50,6 +50,9 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
||||||
@Resource
|
@Resource
|
||||||
private AuditMapper auditMapper;
|
private AuditMapper auditMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ExchangeMapper exchangeMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private PersonnelMapper personnelMapper;
|
private PersonnelMapper personnelMapper;
|
||||||
@Resource
|
@Resource
|
||||||
|
@ -71,21 +74,18 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
||||||
.eq(Audit::getPerType,auditRequest.getType())
|
.eq(Audit::getPerType,auditRequest.getType())
|
||||||
.eq(Audit::getAuditOrder, ArgsConst.WAITING)
|
.eq(Audit::getAuditOrder, ArgsConst.WAITING)
|
||||||
.eq(Audit::getApprover, loginId));
|
.eq(Audit::getApprover, loginId));
|
||||||
System.out.println("one = " + one);
|
|
||||||
one.setOpinion(auditRequest.getAuditOpinion());
|
|
||||||
one.setApproverTime(new Date());
|
|
||||||
if(ObjectUtil.isEmpty(one)){
|
if(ObjectUtil.isEmpty(one)){
|
||||||
return AjaxResult.fail().msg("该用户不能审批!");
|
return AjaxResult.fail().msg("该用户不能审批!");
|
||||||
}
|
}
|
||||||
if(ArgsConst.PASS.equals(one.getAuditState())){
|
if(ArgsConst.PASS.equals(one.getAuditState())){
|
||||||
return AjaxResult.fail().msg("用户已审批,请勿重复操作!");
|
return AjaxResult.fail().msg("用户已审批,请勿重复操作!");
|
||||||
}
|
}
|
||||||
|
one.setOpinion(auditRequest.getAuditOpinion());
|
||||||
|
one.setApproverTime(new Date());
|
||||||
//同意
|
//同意
|
||||||
if ("2".equals(auditRequest.getStatus())){
|
if ("2".equals(auditRequest.getStatus())){
|
||||||
Config director = configMapper.selectOne(new LambdaQueryWrapper<Config>().eq(Config::getParamKey, ConfigCache.SYS_USER_PERSONNEL_DIRECTOR));
|
Config director = configMapper.selectOne(new LambdaQueryWrapper<Config>().eq(Config::getParamKey, ConfigCache.SYS_USER_PERSONNEL_DIRECTOR));
|
||||||
System.out.println("director = " + director);
|
|
||||||
if (loginUser.getLoginName().equals(director.getParamValue())){
|
if (loginUser.getLoginName().equals(director.getParamValue())){
|
||||||
System.out.println("111111111111111");
|
|
||||||
one.setAuditOrder(ArgsConst.FIRST);
|
one.setAuditOrder(ArgsConst.FIRST);
|
||||||
one.setAuditState(ArgsConst.PASS);
|
one.setAuditState(ArgsConst.PASS);
|
||||||
boolean update = updateById(one);
|
boolean update = updateById(one);
|
||||||
|
@ -96,46 +96,64 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
||||||
Audit auditOne = getOne(new LambdaQueryWrapper<Audit>().eq(Audit::getApprover, user.getId()).eq(Audit::getPersonnelId, auditRequest.getPersonnelId()));
|
Audit auditOne = getOne(new LambdaQueryWrapper<Audit>().eq(Audit::getApprover, user.getId()).eq(Audit::getPersonnelId, auditRequest.getPersonnelId()));
|
||||||
auditOne.setAuditOrder(ArgsConst.WAITING);
|
auditOne.setAuditOrder(ArgsConst.WAITING);
|
||||||
updateById(auditOne);
|
updateById(auditOne);
|
||||||
Personnel personnel = personnelMapper.selectById(auditOne.getPersonnelId());
|
if (ArgsConst.PERSONNEL.equals(auditRequest.getType())||ArgsConst.CHANGE.equals(auditRequest.getType())){
|
||||||
if (ArgsConst.PERSONNEL.equals(auditRequest.getType())){
|
Personnel personnel = personnelMapper.selectById(auditOne.getPersonnelId());
|
||||||
personnel.setAuditState(2);
|
if (ArgsConst.PERSONNEL.equals(auditRequest.getType())){
|
||||||
}else if (ArgsConst.CHANGE.equals(auditRequest.getType())){
|
personnel.setAuditState(2);
|
||||||
personnel.setChangeAuditState(2);
|
}else if (ArgsConst.CHANGE.equals(auditRequest.getType())){
|
||||||
|
personnel.setChangeAuditState(2);
|
||||||
|
}
|
||||||
|
personnelMapper.updateById(personnel);
|
||||||
|
}else if(ArgsConst.EXCHANGE.equals(auditRequest.getType())){
|
||||||
|
Exchange exchange = exchangeMapper.selectById(auditOne.getPersonnelId());
|
||||||
|
exchange.setAuditState("2");
|
||||||
|
exchangeMapper.updateById(exchange);
|
||||||
}
|
}
|
||||||
personnelMapper.updateById(personnel);
|
saveAuditLog(auditRequest.getPersonnelId(),loginId,auditRequest.getType(),"一般初审通过",auditRequest.getAuditOpinion());
|
||||||
saveAuditLog(auditRequest.getPersonnelId(),loginId,auditRequest.getType(),"一般初审通过");
|
|
||||||
}
|
}
|
||||||
return update ? AjaxResult.ok().msg("审批成功!"):AjaxResult.fail().msg("审批成功!");
|
return update ? AjaxResult.ok().msg("审批成功!"):AjaxResult.fail().msg("审批成功!");
|
||||||
}
|
}
|
||||||
Config leadership = configMapper.selectOne(new LambdaQueryWrapper<Config>().eq(Config::getParamKey, ConfigCache.SYS_USER_LEADERSHIP));
|
Config leadership = configMapper.selectOne(new LambdaQueryWrapper<Config>().eq(Config::getParamKey, ConfigCache.SYS_USER_LEADERSHIP));
|
||||||
System.out.println("leadership = " + leadership);
|
|
||||||
if (leadership.getParamValue().equals(loginUser.getLoginName())){
|
if (leadership.getParamValue().equals(loginUser.getLoginName())){
|
||||||
System.out.println("22222222222222");
|
|
||||||
one.setAuditOrder(ArgsConst.LAST);
|
one.setAuditOrder(ArgsConst.LAST);
|
||||||
one.setAuditState(ArgsConst.PASS);
|
one.setAuditState(ArgsConst.PASS);
|
||||||
boolean update = updateById(one);
|
boolean update = updateById(one);
|
||||||
if (update){
|
if (update){
|
||||||
saveAuditLog(auditRequest.getPersonnelId(),loginId,auditRequest.getType(),"一般终审通过");
|
saveAuditLog(auditRequest.getPersonnelId(),loginId,auditRequest.getType(),"一般终审通过",auditRequest.getAuditOpinion());
|
||||||
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());
|
if (ArgsConst.PERSONNEL.equals(auditRequest.getType())||ArgsConst.CHANGE.equals(auditRequest.getType())){
|
||||||
String id = personnelOne.getId();
|
Personnel personnel = personnelMapper.selectById(auditRequest.getPersonnelId());
|
||||||
personnelOne.setState("2");
|
PersonnelMiddle middle = personnelMiddleMapper.selectOne(new LambdaQueryWrapper<PersonnelMiddle>().eq(PersonnelMiddle::getBeforeId, personnel.getId()).eq(PersonnelMiddle::getState, "1"));
|
||||||
if (ArgsConst.PERSONNEL.equals(auditRequest.getType())){
|
Personnel personnelOne = personnelMapper.selectById(middle.getAfterId());
|
||||||
personnelOne.setAlterationSign("2");
|
String id = personnelOne.getId();
|
||||||
personnelOne.setAuditState(3);
|
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");
|
||||||
|
middle.setState("0");
|
||||||
|
personnelMapper.updateById(personnelOne);
|
||||||
|
personnelMapper.updateById(personnel);
|
||||||
|
personnelMiddleMapper.updateById(middle);
|
||||||
|
}else if (ArgsConst.EXCHANGE.equals(auditRequest.getType())){
|
||||||
|
Exchange exchange = exchangeMapper.selectOne(new LambdaQueryWrapper<Exchange>().eq(Exchange::getState,"1").eq(Exchange::getId,auditRequest.getPersonnelId()));
|
||||||
|
exchange.setAuditState("3");
|
||||||
|
exchange.setState("0");
|
||||||
|
Personnel personnel = personnelMapper.selectById(exchange.getPersonnelId());
|
||||||
|
personnel.setCompanyName(exchange.getWillCompanyId());
|
||||||
|
personnel.setPresentDept(exchange.getWillDept());
|
||||||
|
personnel.setPosition(exchange.getWillPosition());
|
||||||
|
exchangeMapper.updateById(exchange);
|
||||||
|
personnelMapper.updateById(personnel);
|
||||||
}
|
}
|
||||||
if (ArgsConst.CHANGE.equals(auditRequest.getType())){
|
|
||||||
personnelOne.setChangeAlterationSign("2");
|
|
||||||
personnelOne.setChangeAuditState(3);
|
|
||||||
}
|
|
||||||
personnelOne.setId(personnel.getId());
|
|
||||||
personnel.setId(id);
|
|
||||||
personnel.setState("0");
|
|
||||||
middle.setState("0");
|
|
||||||
personnelMapper.updateById(personnelOne);
|
|
||||||
personnelMapper.updateById(personnel);
|
|
||||||
personnelMiddleMapper.updateById(middle);
|
|
||||||
}
|
}
|
||||||
return update ? AjaxResult.ok().msg("审批成功!"):AjaxResult.fail().msg("审批成功!");
|
return update ? AjaxResult.ok().msg("审批成功!"):AjaxResult.fail().msg("审批成功!");
|
||||||
}
|
}
|
||||||
|
@ -147,14 +165,22 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
||||||
PersonnelMiddle middle = personnelMiddleMapper.selectOne(new LambdaQueryWrapper<PersonnelMiddle>().eq(PersonnelMiddle::getBeforeId, auditRequest.getPersonnelId()).eq(PersonnelMiddle::getState, "1"));
|
PersonnelMiddle middle = personnelMiddleMapper.selectOne(new LambdaQueryWrapper<PersonnelMiddle>().eq(PersonnelMiddle::getBeforeId, auditRequest.getPersonnelId()).eq(PersonnelMiddle::getState, "1"));
|
||||||
Personnel afterPersonnel = personnelMapper.selectById(middle.getAfterId());
|
Personnel afterPersonnel = personnelMapper.selectById(middle.getAfterId());
|
||||||
Personnel personnel = personnelMapper.selectById(auditRequest.getPersonnelId());
|
Personnel personnel = personnelMapper.selectById(auditRequest.getPersonnelId());
|
||||||
|
Exchange exchange = exchangeMapper.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,auditRequest.getType(),"一般初审拒绝");
|
saveAuditLog(auditRequest.getPersonnelId(),loginId,auditRequest.getType(),"一般初审拒绝",auditRequest.getAuditOpinion());
|
||||||
updateByPer(afterPersonnel.getId(),personnel,auditRequest.getType());
|
if (ArgsConst.PERSONNEL.equals(auditRequest.getType())||ArgsConst.CHANGE.equals(auditRequest.getType())){
|
||||||
|
updateByPer(afterPersonnel.getId(),personnel,auditRequest.getType());
|
||||||
|
}
|
||||||
|
if(ArgsConst.EXCHANGE.equals(auditRequest.getType())){
|
||||||
|
exchange.setAuditState("4");
|
||||||
|
exchange.setState("0");
|
||||||
|
exchangeMapper.updateById(exchange);
|
||||||
|
}
|
||||||
for (Audit auditOne : auditList) {
|
for (Audit auditOne : auditList) {
|
||||||
delete(auditOne.getId());
|
delete(auditOne.getId());
|
||||||
}
|
}
|
||||||
|
@ -167,8 +193,14 @@ 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,auditRequest.getType(),"一般终审拒绝");
|
saveAuditLog(auditRequest.getPersonnelId(),loginId,auditRequest.getType(),"一般终审拒绝",auditRequest.getAuditOpinion());
|
||||||
updateByPer(afterPersonnel.getId(),personnel,auditRequest.getType());
|
if (ArgsConst.PERSONNEL.equals(auditRequest.getType())||ArgsConst.CHANGE.equals(auditRequest.getType())){
|
||||||
|
updateByPer(afterPersonnel.getId(),personnel,auditRequest.getType());
|
||||||
|
}else if(ArgsConst.EXCHANGE.equals(auditRequest.getType())){
|
||||||
|
exchange.setAuditState("4");
|
||||||
|
exchange.setState("0");
|
||||||
|
exchangeMapper.updateById(exchange);
|
||||||
|
}
|
||||||
for (Audit auditOne : auditList) {
|
for (Audit auditOne : auditList) {
|
||||||
delete(auditOne.getId());
|
delete(auditOne.getId());
|
||||||
}
|
}
|
||||||
|
@ -178,10 +210,11 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
public Integer saveAuditLog(String personnelId,String approverId,String type,String auditSate){
|
public Integer saveAuditLog(String personnelId,String approverId,String type,String auditSate,String opinion){
|
||||||
AuditLog auditLog = new AuditLog();
|
AuditLog auditLog = new AuditLog();
|
||||||
auditLog.setPersonnelId(personnelId);
|
auditLog.setPersonnelId(personnelId);
|
||||||
auditLog.setType(type);
|
auditLog.setType(type);
|
||||||
|
auditLog.setOpinion(opinion);
|
||||||
auditLog.setApprover(approverId);
|
auditLog.setApprover(approverId);
|
||||||
auditLog.setAuditState(auditSate);
|
auditLog.setAuditState(auditSate);
|
||||||
return auditLogMapper.insert(auditLog);
|
return auditLogMapper.insert(auditLog);
|
||||||
|
|
|
@ -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, type,"送审");
|
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("送审失败!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,12 +9,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.ydool.common.base.BaseService;
|
import com.ydool.common.base.BaseService;
|
||||||
|
import com.ydool.common.cache.ConfigCache;
|
||||||
import com.ydool.common.constant.ArgsConst;
|
import com.ydool.common.constant.ArgsConst;
|
||||||
import com.ydool.common.data.dto.AjaxResult;
|
import com.ydool.common.data.dto.AjaxResult;
|
||||||
import com.ydool.staff.dto.AttachmentDto;
|
import com.ydool.staff.dto.AttachmentDto;
|
||||||
import com.ydool.staff.dto.ExchangeOneDto;
|
import com.ydool.staff.dto.ExchangeOneDto;
|
||||||
import com.ydool.staff.dto.ExchangePageDto;
|
import com.ydool.staff.dto.ExchangePageDto;
|
||||||
import com.ydool.staff.entity.Attachment;
|
import com.ydool.staff.entity.Attachment;
|
||||||
|
import com.ydool.staff.entity.Audit;
|
||||||
import com.ydool.staff.entity.CompanyName;
|
import com.ydool.staff.entity.CompanyName;
|
||||||
import com.ydool.staff.entity.Exchange;
|
import com.ydool.staff.entity.Exchange;
|
||||||
import com.ydool.staff.entity.Personnel;
|
import com.ydool.staff.entity.Personnel;
|
||||||
|
@ -23,10 +25,13 @@ import com.ydool.staff.mapper.CompanyNameMapper;
|
||||||
import com.ydool.staff.mapper.ExchangeMapper;
|
import com.ydool.staff.mapper.ExchangeMapper;
|
||||||
import com.ydool.staff.mapper.PersonnelMapper;
|
import com.ydool.staff.mapper.PersonnelMapper;
|
||||||
import com.ydool.staff.request.ExchangeRequest;
|
import com.ydool.staff.request.ExchangeRequest;
|
||||||
|
import com.ydool.staff.request.GiveAuditRequest;
|
||||||
import com.ydool.staff.request.PersonnelDeleteRequest;
|
import com.ydool.staff.request.PersonnelDeleteRequest;
|
||||||
import com.ydool.staff.service.IExchangeService;
|
import com.ydool.staff.service.IExchangeService;
|
||||||
|
import com.ydool.system.entity.Config;
|
||||||
import com.ydool.system.entity.Dept;
|
import com.ydool.system.entity.Dept;
|
||||||
import com.ydool.system.entity.User;
|
import com.ydool.system.entity.User;
|
||||||
|
import com.ydool.system.mapper.ConfigMapper;
|
||||||
import com.ydool.system.mapper.DeptMapper;
|
import com.ydool.system.mapper.DeptMapper;
|
||||||
import com.ydool.system.mapper.UserMapper;
|
import com.ydool.system.mapper.UserMapper;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
@ -36,6 +41,7 @@ import org.thymeleaf.util.StringUtils;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@ -64,10 +70,13 @@ public class ExchangeServiceImpl extends BaseService<ExchangeMapper, Exchange> i
|
||||||
private CompanyNameMapper companyNameMapper;
|
private CompanyNameMapper companyNameMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private UserMapper userMapper;
|
private UserMapper userMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ConfigMapper configMapper;
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult exchangePage(Page page,String userName,String numberId,String willCompanyName,String companyName,String receipts) {
|
public AjaxResult exchangePage(Page page,String userName,String numberId,String willCompanyName,String companyName,String receipts) {
|
||||||
QueryWrapper<Exchange> wrapper = new QueryWrapper<>();
|
QueryWrapper<Exchange> wrapper = new QueryWrapper<>();
|
||||||
wrapper.lambda().eq(StrUtil.isNotBlank(willCompanyName),Exchange::getWillCompanyId,willCompanyName)
|
wrapper.lambda().eq(StrUtil.isNotBlank(willCompanyName),Exchange::getWillCompanyId,willCompanyName).eq(Exchange::getState,"1")
|
||||||
.exists(StrUtil.isNotBlank(companyName),
|
.exists(StrUtil.isNotBlank(companyName),
|
||||||
"select p.id from t_lc_personnel p where t_lc_exchange.personnel_id = p.id and p.company_name = " +"'"+ companyName+"'")
|
"select p.id from t_lc_personnel p where t_lc_exchange.personnel_id = p.id and p.company_name = " +"'"+ companyName+"'")
|
||||||
.exists(StrUtil.isNotBlank(receipts),
|
.exists(StrUtil.isNotBlank(receipts),
|
||||||
|
@ -185,5 +194,6 @@ public class ExchangeServiceImpl extends BaseService<ExchangeMapper, Exchange> i
|
||||||
return AjaxResult.ok().data(exchangeOneDto);
|
return AjaxResult.ok().data(exchangeOneDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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, type,"送审");
|
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, type,"送审");
|
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("送审失败!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@ import com.ydool.staff.entity.Alteration;
|
||||||
import com.ydool.staff.entity.Attachment;
|
import com.ydool.staff.entity.Attachment;
|
||||||
import com.ydool.staff.entity.Audit;
|
import com.ydool.staff.entity.Audit;
|
||||||
import com.ydool.staff.entity.CompanyName;
|
import com.ydool.staff.entity.CompanyName;
|
||||||
|
import com.ydool.staff.entity.Exchange;
|
||||||
import com.ydool.staff.entity.Personnel;
|
import com.ydool.staff.entity.Personnel;
|
||||||
import com.ydool.staff.entity.PersonnelMiddle;
|
import com.ydool.staff.entity.PersonnelMiddle;
|
||||||
import com.ydool.staff.entity.SelectRequest;
|
import com.ydool.staff.entity.SelectRequest;
|
||||||
|
@ -34,6 +35,7 @@ import com.ydool.staff.mapper.AlterationMapper;
|
||||||
import com.ydool.staff.mapper.AuditLogMapper;
|
import com.ydool.staff.mapper.AuditLogMapper;
|
||||||
import com.ydool.staff.mapper.AuditMapper;
|
import com.ydool.staff.mapper.AuditMapper;
|
||||||
import com.ydool.staff.mapper.CompanyNameMapper;
|
import com.ydool.staff.mapper.CompanyNameMapper;
|
||||||
|
import com.ydool.staff.mapper.ExchangeMapper;
|
||||||
import com.ydool.staff.mapper.PersonnelMapper;
|
import com.ydool.staff.mapper.PersonnelMapper;
|
||||||
import com.ydool.staff.mapper.PersonnelMiddleMapper;
|
import com.ydool.staff.mapper.PersonnelMiddleMapper;
|
||||||
import com.ydool.staff.request.AttachmentRequest;
|
import com.ydool.staff.request.AttachmentRequest;
|
||||||
|
@ -109,6 +111,8 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
||||||
private IPersonnelMiddleService personnelMiddleService;
|
private IPersonnelMiddleService personnelMiddleService;
|
||||||
@Resource
|
@Resource
|
||||||
private PersonnelMiddleMapper personnelMiddleMapper;
|
private PersonnelMiddleMapper personnelMiddleMapper;
|
||||||
|
@Resource
|
||||||
|
private ExchangeMapper exchangeMapper;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -126,6 +130,7 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
||||||
CompanyName companyName = companyNameMapper.selectById(e.getCompanyName());
|
CompanyName companyName = companyNameMapper.selectById(e.getCompanyName());
|
||||||
Dept dept = deptMapper.selectById(e.getPresentDept());
|
Dept dept = deptMapper.selectById(e.getPresentDept());
|
||||||
dto.setAlterationSign("0".equals(e.getAlterationSign())?"未变更":("1".equals(e.getAlterationSign())?"变更中":"变更完成"));
|
dto.setAlterationSign("0".equals(e.getAlterationSign())?"未变更":("1".equals(e.getAlterationSign())?"变更中":"变更完成"));
|
||||||
|
dto.setChangeAlterationSign("0".equals(e.getChangeAlterationSign())?"未变更":("1".equals(e.getChangeAlterationSign())?"变更中":"变更完成"));
|
||||||
if (ObjectUtil.isNotNull(companyName)){
|
if (ObjectUtil.isNotNull(companyName)){
|
||||||
dto.setCompanyName(companyName.getCompanyName());
|
dto.setCompanyName(companyName.getCompanyName());
|
||||||
}
|
}
|
||||||
|
@ -521,7 +526,10 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public AjaxResult giveAudit(GiveAuditRequest request) {
|
public AjaxResult giveAudit(GiveAuditRequest request) {
|
||||||
String[] ids = request.getIds();
|
String[] ids = request.getIds();
|
||||||
verifyIds(ids,request.getType());
|
String s = verifyIds(ids, request.getType());
|
||||||
|
if (StrUtil.isNotBlank(s)){
|
||||||
|
return AjaxResult.fail().msg(s);
|
||||||
|
}
|
||||||
String loginId = (String) StpUtil.getLoginId();
|
String loginId = (String) StpUtil.getLoginId();
|
||||||
for (String id : ids) {
|
for (String id : ids) {
|
||||||
for(int i=0;i<=2;i++ ){
|
for(int i=0;i<=2;i++ ){
|
||||||
|
@ -547,10 +555,17 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
||||||
}
|
}
|
||||||
auditMapper.insert(audit);
|
auditMapper.insert(audit);
|
||||||
}
|
}
|
||||||
Personnel personnel = get(id);
|
if (ArgsConst.PERSONNEL.equals(request.getType())||ArgsConst.CHANGE.equals(request.getType())){
|
||||||
personnel.setAuditState(1);
|
Personnel personnel = get(id);
|
||||||
updateById(personnel);
|
personnel.setAuditState(1);
|
||||||
auditService.saveAuditLog(id, loginId,request.getType(), "一般送审提交");
|
updateById(personnel);
|
||||||
|
}
|
||||||
|
if (ArgsConst.EXCHANGE.equals(request.getType())){
|
||||||
|
Exchange exchange = exchangeMapper.selectById(id);
|
||||||
|
exchange.setAuditState("1");
|
||||||
|
exchangeMapper.updateById(exchange);
|
||||||
|
}
|
||||||
|
auditService.saveAuditLog(id, loginId,request.getType(), "一般送审提交","");
|
||||||
|
|
||||||
}
|
}
|
||||||
if (ids.length==1){
|
if (ids.length==1){
|
||||||
|
@ -581,26 +596,37 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public AjaxResult verifyIds(String[] ids,String type){
|
public String verifyIds(String[] ids,String type){
|
||||||
|
String message = "";
|
||||||
for (String id : ids) {
|
for (String id : ids) {
|
||||||
Personnel personnel = get(id);
|
|
||||||
if (ArgsConst.PERSONNEL.equals(type)){
|
if (ArgsConst.PERSONNEL.equals(type)){
|
||||||
|
Personnel personnel = get(id);
|
||||||
if (1 == (personnel.getAuditState())) {
|
if (1 == (personnel.getAuditState())) {
|
||||||
return AjaxResult.fail().msg("该数据已送审请勿重复操作!");
|
return message="该数据已送审请勿重复操作!";
|
||||||
}
|
}
|
||||||
if ("0".equals(personnel.getAlterationSign())) {
|
if ("0".equals(personnel.getAlterationSign())) {
|
||||||
return AjaxResult.fail().msg("变更数据未保存,不能送审!");
|
return message="变更数据未保存,不能送审!";
|
||||||
}
|
}
|
||||||
}else if (ArgsConst.CHANGE.equals(type)){
|
}else if (ArgsConst.CHANGE.equals(type)){
|
||||||
|
Personnel personnel = get(id);
|
||||||
if (1 == (personnel.getChangeAuditState())) {
|
if (1 == (personnel.getChangeAuditState())) {
|
||||||
return AjaxResult.fail().msg("该数据已送审请勿重复操作!");
|
return message="该数据已送审请勿重复操作!";
|
||||||
}
|
}
|
||||||
if ("0".equals(personnel.getChangeAlterationSign())) {
|
if ("0".equals(personnel.getChangeAlterationSign())) {
|
||||||
return AjaxResult.fail().msg("变更数据未保存,不能送审!");
|
return message="变更数据未保存,不能送审!";
|
||||||
|
}
|
||||||
|
}else if (ArgsConst.EXCHANGE.equals(type)) {
|
||||||
|
Exchange exchange = exchangeMapper.selectById(id);
|
||||||
|
Personnel personnel = get(exchange.getPersonnelId());
|
||||||
|
if ("1".equals(personnel.getAlterationSign())||"1".equals(personnel.getChangeAlterationSign())){
|
||||||
|
return message="该人员有变更数据,不能进行选调!";
|
||||||
|
}
|
||||||
|
if ("1".equals(exchange.getAuditState())) {
|
||||||
|
return message="该数据已送审请勿重复操作!";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue