update
This commit is contained in:
parent
62c729fa9e
commit
59f90ca9a0
|
@ -81,4 +81,13 @@ public class AuditController extends BaseController {
|
||||||
return AjaxResult.fail().msg("审批状态错误");
|
return AjaxResult.fail().msg("审批状态错误");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("submitPersonnelIndicatorsAudit")
|
||||||
|
@ApiOperation(value = "人员指标申报审批 同意/拒绝")
|
||||||
|
public AjaxResult submitPersonnelIndicatorsAudit(@RequestBody AuditRequest auditRequest) {
|
||||||
|
if ("2".equals(auditRequest.getStatus()) || "3".equals(auditRequest.getStatus())) {
|
||||||
|
return auditService.submitPersonnelIndicatorsAudit(auditRequest);
|
||||||
|
}
|
||||||
|
return AjaxResult.fail().msg("审批状态错误");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,6 +55,6 @@ public class OrganizationController extends BaseController {
|
||||||
@ApiOperation(value = "人员指标申报送审")
|
@ApiOperation(value = "人员指标申报送审")
|
||||||
@ApiImplicitParams({@ApiImplicitParam(value = "申报id", name = "id")})
|
@ApiImplicitParams({@ApiImplicitParam(value = "申报id", name = "id")})
|
||||||
public AjaxResult submitPersonnelIndicators(String id) {
|
public AjaxResult submitPersonnelIndicators(String id) {
|
||||||
return organizationService.submitPersonnelIndicators(id, ArgsConst.PERSONNEL_INDICATORS);
|
return organizationService.submitRecruitment(id, ArgsConst.PERSONNEL_INDICATORS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ydool.staff.dto;
|
package com.ydool.staff.dto;
|
||||||
|
|
||||||
|
import com.ydool.staff.entity.CompanyName;
|
||||||
import com.ydool.staff.entity.Organization;
|
import com.ydool.staff.entity.Organization;
|
||||||
import com.ydool.staff.entity.PersonnelIndicators;
|
import com.ydool.staff.entity.PersonnelIndicators;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
@ -19,7 +20,7 @@ import java.util.List;
|
||||||
public class PersonnelIndicatorsDto implements Serializable {
|
public class PersonnelIndicatorsDto implements Serializable {
|
||||||
|
|
||||||
@ApiModelProperty(value = "企业信息")
|
@ApiModelProperty(value = "企业信息")
|
||||||
private Organization organization;
|
private CompanyName organization;
|
||||||
|
|
||||||
@ApiModelProperty(value = "人员指标申报")
|
@ApiModelProperty(value = "人员指标申报")
|
||||||
private List<PersonnelIndicators> personnelIndicators;
|
private List<PersonnelIndicators> personnelIndicators;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ydool.staff.dto;
|
package com.ydool.staff.dto;
|
||||||
|
|
||||||
|
import com.ydool.staff.entity.CompanyName;
|
||||||
import com.ydool.staff.entity.Organization;
|
import com.ydool.staff.entity.Organization;
|
||||||
import com.ydool.staff.entity.Recruitment;
|
import com.ydool.staff.entity.Recruitment;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
@ -12,7 +13,7 @@ import java.util.List;
|
||||||
public class RecruitmentDto implements Serializable {
|
public class RecruitmentDto implements Serializable {
|
||||||
|
|
||||||
@ApiModelProperty(value = "企业信息")
|
@ApiModelProperty(value = "企业信息")
|
||||||
private Organization organization;
|
private CompanyName organization;
|
||||||
|
|
||||||
@ApiModelProperty(value = "人员招聘登记")
|
@ApiModelProperty(value = "人员招聘登记")
|
||||||
private List<Recruitment> recruitments;
|
private List<Recruitment> recruitments;
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class CompanyName extends BaseEntity {
|
||||||
@ApiModelProperty(value = "审批单号")
|
@ApiModelProperty(value = "审批单号")
|
||||||
private String approvalNumber;
|
private String approvalNumber;
|
||||||
|
|
||||||
@ApiModelProperty(value = "核定指标人数")
|
@ApiModelProperty(value = "原核定用工指标人数")
|
||||||
private Long checkNumber;
|
private Long checkNumber;
|
||||||
|
|
||||||
@ApiModelProperty(value = "在职人数")
|
@ApiModelProperty(value = "在职人数")
|
||||||
|
@ -44,7 +44,7 @@ public class CompanyName extends BaseEntity {
|
||||||
@ApiModelProperty(value = "剩余指标人数")
|
@ApiModelProperty(value = "剩余指标人数")
|
||||||
private Long residueNumber;
|
private Long residueNumber;
|
||||||
|
|
||||||
@ApiModelProperty(value = "本次核定总人数")
|
@ApiModelProperty(value = "本次核准后总指标人数")
|
||||||
private Long thisApprovalNumber;
|
private Long thisApprovalNumber;
|
||||||
|
|
||||||
@ApiModelProperty(value = "类型 登记organization 申报personnel_indicators")
|
@ApiModelProperty(value = "类型 登记organization 申报personnel_indicators")
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.ydool.staff.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.ydool.common.base.BaseEntity;
|
import com.ydool.common.base.BaseEntity;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
@ -106,12 +107,26 @@ public class DirectorsSupervisors extends BaseEntity {
|
||||||
@ApiModelProperty(value = "单据状态")
|
@ApiModelProperty(value = "单据状态")
|
||||||
private String documentStatus;
|
private String documentStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "初审人")
|
||||||
|
private String firstId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "初审意见")
|
@ApiModelProperty(value = "初审意见")
|
||||||
private String firstTrial;
|
private String firstTrial;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "初审时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
|
private Date firstTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "终审人")
|
||||||
|
private String lastId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "终审意见")
|
@ApiModelProperty(value = "终审意见")
|
||||||
private String lastInstance;
|
private String lastInstance;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "终审时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
|
private Date lastTime;
|
||||||
|
|
||||||
@ApiModelProperty(value = "审批状态 0 未审批 1 待审批,2已通过,3已拒绝")
|
@ApiModelProperty(value = "审批状态 0 未审批 1 待审批,2已通过,3已拒绝")
|
||||||
private Integer auditState;
|
private Integer auditState;
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class Exchange extends BaseEntity{
|
||||||
private String excFile;
|
private String excFile;
|
||||||
|
|
||||||
@ApiModelProperty(value = "审批状态 0 未送审 1 待人事审批,2 待领导审批,3已通过,4已拒绝 ")
|
@ApiModelProperty(value = "审批状态 0 未送审 1 待人事审批,2 待领导审批,3已通过,4已拒绝 ")
|
||||||
private String auditState;
|
private Integer auditState;
|
||||||
|
|
||||||
@ApiModelProperty(value = "数据状态:0历史数据 1当前数据")
|
@ApiModelProperty(value = "数据状态:0历史数据 1当前数据")
|
||||||
private String state;
|
private String state;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.ydool.staff.entity;
|
package com.ydool.staff.entity;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.ydool.common.base.BaseEntity;
|
import com.ydool.common.base.BaseEntity;
|
||||||
import com.ydool.staff.request.AttachmentRequest;
|
import com.ydool.staff.request.AttachmentRequest;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
|
@ -9,6 +10,7 @@ import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -61,15 +63,29 @@ public class Organization extends BaseEntity{
|
||||||
@ApiModelProperty(value = "单据状态")
|
@ApiModelProperty(value = "单据状态")
|
||||||
private String documentStatus;
|
private String documentStatus;
|
||||||
|
|
||||||
@ApiModelProperty(value = "审批状态 0 未审批 1 待审批,2已通过,3已拒绝\n")
|
@ApiModelProperty(value = "审批状态 0 未送审 1 待人事审批,2 待领导审批,3 已通过,4 已拒绝")
|
||||||
private Integer auditState;
|
private Integer auditState;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "初审人")
|
||||||
|
private String firstId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "初审意见")
|
@ApiModelProperty(value = "初审意见")
|
||||||
private String firstTrial;
|
private String firstTrial;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "初审时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
|
private Date firstTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "终审人")
|
||||||
|
private String lastId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "终审意见")
|
@ApiModelProperty(value = "终审意见")
|
||||||
private String lastInstance;
|
private String lastInstance;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "终审时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
|
private Date lastTime;
|
||||||
|
|
||||||
@ApiModelProperty(value = "修改人")
|
@ApiModelProperty(value = "修改人")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String updatedName;
|
private String updatedName;
|
||||||
|
|
|
@ -38,10 +38,10 @@ public class PersonnelIndicators extends BaseEntity {
|
||||||
private String indexExplain;
|
private String indexExplain;
|
||||||
|
|
||||||
@ApiModelProperty(value = "标准指标人数")
|
@ApiModelProperty(value = "标准指标人数")
|
||||||
private String standardNumber;
|
private Long standardNumber;
|
||||||
|
|
||||||
@ApiModelProperty(value = "增加指标人数")
|
@ApiModelProperty(value = "增加指标人数")
|
||||||
private String addNumber;
|
private Long addNumber;
|
||||||
|
|
||||||
@ApiModelProperty(value = "初审意见")
|
@ApiModelProperty(value = "初审意见")
|
||||||
private String firstTrial;
|
private String firstTrial;
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class Recruitment extends BaseEntity {
|
||||||
private String position;
|
private String position;
|
||||||
|
|
||||||
@ApiModelProperty(value = "名额")
|
@ApiModelProperty(value = "名额")
|
||||||
private String places;
|
private Long places;
|
||||||
|
|
||||||
@ApiModelProperty(value = "条件要求")
|
@ApiModelProperty(value = "条件要求")
|
||||||
private String requirements;
|
private String requirements;
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.ydool.staff.mapper;
|
||||||
import com.ydool.staff.entity.PersonnelIndicators;
|
import com.ydool.staff.entity.PersonnelIndicators;
|
||||||
import com.github.yulichang.base.MPJBaseMapper;
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -15,4 +16,19 @@ import org.apache.ibatis.annotations.Mapper;
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface PersonnelIndicatorsMapper extends MPJBaseMapper<PersonnelIndicators> {
|
public interface PersonnelIndicatorsMapper extends MPJBaseMapper<PersonnelIndicators> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计要求增加指标人数
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Select("SELECT sum(standard_number) standard_number FROM `t_lc_personnel_indicators` where organization_id = '#{id}'")
|
||||||
|
Long personnelIndicatorsStandardNumber(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计核准指标人数
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Select("SELECT sum(add_number) add_number FROM `t_lc_personnel_indicators` where organization_id = '#{id}'")
|
||||||
|
Long personnelIndicatorsAddNumber(String id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.github.yulichang.base.MPJBaseMapper;
|
||||||
import com.ydool.staff.request.CompanyNameRequest;
|
import com.ydool.staff.request.CompanyNameRequest;
|
||||||
import com.ydool.staff.request.RecruitmentRequest;
|
import com.ydool.staff.request.RecruitmentRequest;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -24,4 +25,8 @@ public interface RecruitmentMapper extends MPJBaseMapper<Recruitment> {
|
||||||
// + "from t_lc_company_name c ,t_lc_recruitment r where c.id = r.company_id")
|
// + "from t_lc_company_name c ,t_lc_recruitment r where c.id = r.company_id")
|
||||||
@Select("select c.id,c.company_name,c.check_number,c.active_staff,c.residue_number from t_lc_company_name c,t_lc_recruitment r where c.id = r.company_id")
|
@Select("select c.id,c.company_name,c.check_number,c.active_staff,c.residue_number from t_lc_company_name c,t_lc_recruitment r where c.id = r.company_id")
|
||||||
List<CompanyNameRequest> recruitmentList();
|
List<CompanyNameRequest> recruitmentList();
|
||||||
|
|
||||||
|
|
||||||
|
@Select("SELECT SUM(places) places FROM `t_lc_recruitment` WHERE company_id = #{companyId}")
|
||||||
|
Long recruitmentPlaces(String companyId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,5 +23,7 @@ public interface IAuditService {
|
||||||
AjaxResult submitDirectorsSupervisorsAudit(AuditRequest auditRequest);
|
AjaxResult submitDirectorsSupervisorsAudit(AuditRequest auditRequest);
|
||||||
|
|
||||||
AjaxResult submitRecruitmentAudit(AuditRequest auditRequest);
|
AjaxResult submitRecruitmentAudit(AuditRequest auditRequest);
|
||||||
|
|
||||||
|
AjaxResult submitPersonnelIndicatorsAudit(AuditRequest auditRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,5 @@ public interface IOrganizationService {
|
||||||
|
|
||||||
AjaxResult submitRecruitment(String id, String type);
|
AjaxResult submitRecruitment(String id, String type);
|
||||||
|
|
||||||
AjaxResult submitPersonnelIndicators(String id, String type);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ import cn.dev33.satoken.stp.StpUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.yulichang.query.MPJQueryWrapper;
|
||||||
import com.ydool.common.base.BaseService;
|
import com.ydool.common.base.BaseService;
|
||||||
import com.ydool.common.cache.ConfigCache;
|
import com.ydool.common.cache.ConfigCache;
|
||||||
import com.ydool.common.constant.ArgsConst;
|
import com.ydool.common.constant.ArgsConst;
|
||||||
|
@ -12,7 +13,6 @@ import com.ydool.staff.entity.*;
|
||||||
import com.ydool.staff.mapper.*;
|
import com.ydool.staff.mapper.*;
|
||||||
import com.ydool.staff.request.AuditRequest;
|
import com.ydool.staff.request.AuditRequest;
|
||||||
import com.ydool.staff.service.IAuditService;
|
import com.ydool.staff.service.IAuditService;
|
||||||
import com.ydool.staff.service.IPersonnelService;
|
|
||||||
import com.ydool.system.entity.Config;
|
import com.ydool.system.entity.Config;
|
||||||
import com.ydool.system.entity.User;
|
import com.ydool.system.entity.User;
|
||||||
import com.ydool.system.mapper.ConfigMapper;
|
import com.ydool.system.mapper.ConfigMapper;
|
||||||
|
@ -57,6 +57,12 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
||||||
private PersonnelMapper personnelMapper;
|
private PersonnelMapper personnelMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private PersonnelMiddleMapper personnelMiddleMapper;
|
private PersonnelMiddleMapper personnelMiddleMapper;
|
||||||
|
@Autowired
|
||||||
|
PersonnelIndicatorsMapper personnelIndicatorsMapper;
|
||||||
|
@Autowired
|
||||||
|
CompanyNameMapper companyNameMapper;
|
||||||
|
@Autowired
|
||||||
|
RecruitmentMapper recruitmentMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult getAuditList(Page page) {
|
public AjaxResult getAuditList(Page page) {
|
||||||
|
@ -106,7 +112,7 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
||||||
personnelMapper.updateById(personnel);
|
personnelMapper.updateById(personnel);
|
||||||
}else if(ArgsConst.EXCHANGE.equals(auditRequest.getType())){
|
}else if(ArgsConst.EXCHANGE.equals(auditRequest.getType())){
|
||||||
Exchange exchange = exchangeMapper.selectById(auditOne.getPersonnelId());
|
Exchange exchange = exchangeMapper.selectById(auditOne.getPersonnelId());
|
||||||
exchange.setAuditState("2");
|
exchange.setAuditState(2);
|
||||||
exchangeMapper.updateById(exchange);
|
exchangeMapper.updateById(exchange);
|
||||||
}
|
}
|
||||||
saveAuditLog(auditRequest.getPersonnelId(),loginId,auditRequest.getType(),"一般初审通过",auditRequest.getAuditOpinion());
|
saveAuditLog(auditRequest.getPersonnelId(),loginId,auditRequest.getType(),"一般初审通过",auditRequest.getAuditOpinion());
|
||||||
|
@ -145,7 +151,7 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
||||||
personnelMiddleMapper.updateById(middle);
|
personnelMiddleMapper.updateById(middle);
|
||||||
}else if (ArgsConst.EXCHANGE.equals(auditRequest.getType())){
|
}else if (ArgsConst.EXCHANGE.equals(auditRequest.getType())){
|
||||||
Exchange exchange = exchangeMapper.selectOne(new LambdaQueryWrapper<Exchange>().eq(Exchange::getState,"1").eq(Exchange::getId,auditRequest.getPersonnelId()));
|
Exchange exchange = exchangeMapper.selectOne(new LambdaQueryWrapper<Exchange>().eq(Exchange::getState,"1").eq(Exchange::getId,auditRequest.getPersonnelId()));
|
||||||
exchange.setAuditState("3");
|
exchange.setAuditState(3);
|
||||||
exchange.setState("0");
|
exchange.setState("0");
|
||||||
Personnel personnel = personnelMapper.selectById(exchange.getPersonnelId());
|
Personnel personnel = personnelMapper.selectById(exchange.getPersonnelId());
|
||||||
personnel.setCompanyName(exchange.getWillCompanyId());
|
personnel.setCompanyName(exchange.getWillCompanyId());
|
||||||
|
@ -177,7 +183,7 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
||||||
updateByPer(afterPersonnel.getId(),personnel,auditRequest.getType());
|
updateByPer(afterPersonnel.getId(),personnel,auditRequest.getType());
|
||||||
}
|
}
|
||||||
if(ArgsConst.EXCHANGE.equals(auditRequest.getType())){
|
if(ArgsConst.EXCHANGE.equals(auditRequest.getType())){
|
||||||
exchange.setAuditState("4");
|
exchange.setAuditState(4);
|
||||||
exchange.setState("0");
|
exchange.setState("0");
|
||||||
exchangeMapper.updateById(exchange);
|
exchangeMapper.updateById(exchange);
|
||||||
}
|
}
|
||||||
|
@ -197,7 +203,7 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
||||||
if (ArgsConst.PERSONNEL.equals(auditRequest.getType())||ArgsConst.CHANGE.equals(auditRequest.getType())){
|
if (ArgsConst.PERSONNEL.equals(auditRequest.getType())||ArgsConst.CHANGE.equals(auditRequest.getType())){
|
||||||
updateByPer(afterPersonnel.getId(),personnel,auditRequest.getType());
|
updateByPer(afterPersonnel.getId(),personnel,auditRequest.getType());
|
||||||
}else if(ArgsConst.EXCHANGE.equals(auditRequest.getType())){
|
}else if(ArgsConst.EXCHANGE.equals(auditRequest.getType())){
|
||||||
exchange.setAuditState("4");
|
exchange.setAuditState(4);
|
||||||
exchange.setState("0");
|
exchange.setState("0");
|
||||||
exchangeMapper.updateById(exchange);
|
exchangeMapper.updateById(exchange);
|
||||||
}
|
}
|
||||||
|
@ -210,6 +216,7 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer saveAuditLog(String personnelId,String approverId,String type,String auditSate,String opinion){
|
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);
|
||||||
|
@ -219,6 +226,7 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
||||||
auditLog.setAuditState(auditSate);
|
auditLog.setAuditState(auditSate);
|
||||||
return auditLogMapper.insert(auditLog);
|
return auditLogMapper.insert(auditLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateByPer(String afterId,Personnel personnel,String type){
|
public void updateByPer(String afterId,Personnel personnel,String type){
|
||||||
delete(afterId);
|
delete(afterId);
|
||||||
if (ArgsConst.PERSONNEL.equals(type)){
|
if (ArgsConst.PERSONNEL.equals(type)){
|
||||||
|
@ -234,14 +242,16 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 招聘登记
|
* 招聘登记
|
||||||
|
*
|
||||||
* @param auditRequest
|
* @param auditRequest
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public AjaxResult submitRecruitmentAudit(AuditRequest auditRequest) {
|
public AjaxResult submitRecruitmentAudit(AuditRequest auditRequest) {
|
||||||
Organization recruitment = organizationMapper.selectById(auditRequest.getPersonnelId());
|
Organization organization = organizationMapper.selectById(auditRequest.getPersonnelId());
|
||||||
if (3 == recruitment.getAuditState()) {
|
|
||||||
|
if (3 == organization.getAuditState()) {
|
||||||
return AjaxResult.fail().msg("已拒绝请勿重复审批!");
|
return AjaxResult.fail().msg("已拒绝请勿重复审批!");
|
||||||
}
|
}
|
||||||
String loginId = StpUtil.getLoginIdAsString();
|
String loginId = StpUtil.getLoginIdAsString();
|
||||||
|
@ -265,20 +275,29 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
||||||
Audit one1 = getOne(new LambdaQueryWrapper<Audit>().eq(Audit::getPersonnelId, auditRequest.getPersonnelId()).eq(Audit::getAuditOrder, ArgsConst.LAST));
|
Audit one1 = getOne(new LambdaQueryWrapper<Audit>().eq(Audit::getPersonnelId, auditRequest.getPersonnelId()).eq(Audit::getAuditOrder, ArgsConst.LAST));
|
||||||
one1.setAuditOrder(ArgsConst.WAITING);
|
one1.setAuditOrder(ArgsConst.WAITING);
|
||||||
updateById(one1);
|
updateById(one1);
|
||||||
recruitment.setFirstTrial(auditRequest.getAuditOpinion());
|
organization.setAuditState(2);
|
||||||
organizationMapper.updateById(recruitment);
|
organization.setFirstTime(new Date());
|
||||||
|
organization.setFirstTrial(auditRequest.getAuditOpinion());
|
||||||
|
organizationMapper.updateById(organization);
|
||||||
}
|
}
|
||||||
return update ? AjaxResult.ok().msg("人事审批成功!") : AjaxResult.fail().msg("人事审批失败!");
|
return update ? AjaxResult.ok().msg("人事审批成功!") : AjaxResult.fail().msg("人事审批失败!");
|
||||||
}
|
}
|
||||||
// 领导终审批同意
|
// 领导终审批同意
|
||||||
if (leadership.getParamValue().equals(byId.getLoginName())) {
|
if (leadership.getParamValue().equals(byId.getLoginName())) {
|
||||||
|
CompanyName companyName = companyNameMapper.selectOne(new LambdaQueryWrapper<CompanyName>().eq(CompanyName::getId, organization.getCompanyId()));
|
||||||
|
Long places = recruitmentMapper.selectOne(new MPJQueryWrapper<Recruitment>().select(" SUM(places) places ").eq("company_id", organization.getId())).getPlaces();
|
||||||
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) {
|
||||||
recruitment.setAuditState(2);
|
companyName.setResidueNumber(companyName.getCheckNumber() - places);
|
||||||
recruitment.setLastInstance(auditRequest.getAuditOpinion());
|
companyName.setThisApprovalNumber(organization.getThisApprovalNumber());
|
||||||
organizationMapper.updateById(recruitment);
|
companyNameMapper.updateById(companyName);
|
||||||
|
organization.setAuditState(3);
|
||||||
|
organization.setResidualNumber(companyName.getResidueNumber());
|
||||||
|
organization.setLastTime(new Date());
|
||||||
|
organization.setLastInstance(auditRequest.getAuditOpinion());
|
||||||
|
organizationMapper.updateById(organization);
|
||||||
}
|
}
|
||||||
return update ? AjaxResult.ok().msg("领导审批成功!") : AjaxResult.fail().msg("领导审批失败!");
|
return update ? AjaxResult.ok().msg("领导审批成功!") : AjaxResult.fail().msg("领导审批失败!");
|
||||||
}
|
}
|
||||||
|
@ -290,9 +309,10 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
||||||
one.setAuditState(ArgsConst.REJECT);
|
one.setAuditState(ArgsConst.REJECT);
|
||||||
boolean update = updateById(one);
|
boolean update = updateById(one);
|
||||||
if (update) {
|
if (update) {
|
||||||
recruitment.setAuditState(3);
|
organization.setAuditState(4);
|
||||||
recruitment.setFirstTrial(auditRequest.getAuditOpinion());
|
organization.setFirstTime(new Date());
|
||||||
organizationMapper.updateById(recruitment);
|
organization.setFirstTrial(auditRequest.getAuditOpinion());
|
||||||
|
organizationMapper.updateById(organization);
|
||||||
}
|
}
|
||||||
return update ? AjaxResult.ok().msg("人事审批拒绝!") : AjaxResult.fail().msg("人事审批失败!");
|
return update ? AjaxResult.ok().msg("人事审批拒绝!") : AjaxResult.fail().msg("人事审批失败!");
|
||||||
}
|
}
|
||||||
|
@ -302,9 +322,10 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
||||||
one.setAuditState(ArgsConst.REJECT);
|
one.setAuditState(ArgsConst.REJECT);
|
||||||
boolean update = updateById(one);
|
boolean update = updateById(one);
|
||||||
if (update) {
|
if (update) {
|
||||||
recruitment.setAuditState(3);
|
organization.setAuditState(4);
|
||||||
recruitment.setLastInstance(auditRequest.getAuditOpinion());
|
organization.setLastTime(new Date());
|
||||||
organizationMapper.updateById(recruitment);
|
organization.setLastInstance(auditRequest.getAuditOpinion());
|
||||||
|
organizationMapper.updateById(organization);
|
||||||
}
|
}
|
||||||
return update ? AjaxResult.ok().msg("领导审批拒绝!") : AjaxResult.fail().msg("领导审批失败!");
|
return update ? AjaxResult.ok().msg("领导审批拒绝!") : AjaxResult.fail().msg("领导审批失败!");
|
||||||
}
|
}
|
||||||
|
@ -312,6 +333,107 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指标申报
|
||||||
|
*
|
||||||
|
* @param auditRequest
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public AjaxResult submitPersonnelIndicatorsAudit(AuditRequest auditRequest) {
|
||||||
|
Organization organization = organizationMapper.selectById(auditRequest.getPersonnelId());
|
||||||
|
|
||||||
|
if (3 == organization.getAuditState()) {
|
||||||
|
return AjaxResult.fail().msg("已拒绝请勿重复审批!");
|
||||||
|
}
|
||||||
|
String loginId = StpUtil.getLoginIdAsString();
|
||||||
|
Audit one = getOne(new LambdaQueryWrapper<Audit>().eq(Audit::getPersonnelId, auditRequest.getPersonnelId()).eq(Audit::getAuditOrder, ArgsConst.WAITING).eq(Audit::getApprover, loginId));
|
||||||
|
if (ObjectUtil.isNull(one)) {
|
||||||
|
return AjaxResult.fail().msg("该用户不能审批!");
|
||||||
|
}
|
||||||
|
// 人事部负责人
|
||||||
|
Config director = configMapper.selectOne(new LambdaQueryWrapper<Config>().eq(Config::getParamKey, ConfigCache.SYS_USER_PERSONNEL_DIRECTOR));
|
||||||
|
// 领导
|
||||||
|
Config leadership = configMapper.selectOne(new LambdaQueryWrapper<Config>().eq(Config::getParamKey, ConfigCache.SYS_USER_LEADERSHIP));
|
||||||
|
// 同意
|
||||||
|
if ("2".equals(auditRequest.getStatus())) {
|
||||||
|
User byId = userMapper.selectById(one.getApprover());
|
||||||
|
// 人事初审批同意
|
||||||
|
if (director.getParamValue().equals(byId.getLoginName())) {
|
||||||
|
one.setAuditOrder(ArgsConst.FIRST);
|
||||||
|
one.setAuditState(ArgsConst.PASS);
|
||||||
|
boolean update = updateById(one);
|
||||||
|
if (update) {
|
||||||
|
Audit one1 = getOne(new LambdaQueryWrapper<Audit>().eq(Audit::getPersonnelId, auditRequest.getPersonnelId()).eq(Audit::getAuditOrder, ArgsConst.LAST));
|
||||||
|
one1.setAuditOrder(ArgsConst.WAITING);
|
||||||
|
updateById(one1);
|
||||||
|
organization.setAuditState(2);
|
||||||
|
organization.setFirstTime(new Date());
|
||||||
|
organization.setFirstTrial(auditRequest.getAuditOpinion());
|
||||||
|
organizationMapper.updateById(organization);
|
||||||
|
}
|
||||||
|
return update ? AjaxResult.ok().msg("人事审批成功!") : AjaxResult.fail().msg("人事审批失败!");
|
||||||
|
}
|
||||||
|
// 领导终审批同意
|
||||||
|
if (leadership.getParamValue().equals(byId.getLoginName())) {
|
||||||
|
//统计核准指标人数
|
||||||
|
Long addNumber = personnelIndicatorsMapper.selectOne(new MPJQueryWrapper<PersonnelIndicators>().select(" SUM(add_number) addNumber ").eq("organization_id", organization.getId())).getAddNumber();
|
||||||
|
//统计要求增加指标人数
|
||||||
|
Long standardNumber = personnelIndicatorsMapper.selectOne(new MPJQueryWrapper<PersonnelIndicators>().select(" SUM(standard_number) standardNumber ").eq("organization_id", organization.getId())).getStandardNumber();
|
||||||
|
Long thisApprovalNumber = organizationMapper.selectOne(new MPJQueryWrapper<Organization>().select(" SUM(this_approval_number) thisApprovalNumber ").eq("company_id", organization.getCompanyId()).eq("type", ArgsConst.PERSONNEL_INDICATORS)).getThisApprovalNumber();
|
||||||
|
CompanyName companyName = companyNameMapper.selectOne(new LambdaQueryWrapper<CompanyName>().eq(CompanyName::getId, organization.getCompanyId()));
|
||||||
|
one.setAuditOrder(ArgsConst.LAST);
|
||||||
|
one.setAuditState(ArgsConst.PASS);
|
||||||
|
boolean update = updateById(one);
|
||||||
|
if (update) {
|
||||||
|
//原核定用工指标人数
|
||||||
|
companyName.setCheckNumber(addNumber + companyName.getCheckNumber());
|
||||||
|
//本次核准后总指标人数
|
||||||
|
companyName.setThisApprovalNumber(standardNumber + companyName.getThisApprovalNumber());
|
||||||
|
companyNameMapper.updateById(companyName);
|
||||||
|
organization.setCheckNumber(companyName.getCheckNumber());
|
||||||
|
organization.setThisApprovalNumber(thisApprovalNumber);
|
||||||
|
organization.setAuditState(3);
|
||||||
|
organization.setLastTime(new Date());
|
||||||
|
organization.setLastInstance(auditRequest.getAuditOpinion());
|
||||||
|
organizationMapper.updateById(organization);
|
||||||
|
}
|
||||||
|
return update ? AjaxResult.ok().msg("领导审批成功!") : AjaxResult.fail().msg("领导审批失败!");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 人事初审批拒绝
|
||||||
|
User byId = userMapper.selectById(one.getApprover());
|
||||||
|
if (director.getParamValue().equals(byId.getLoginName())) {
|
||||||
|
one.setAuditOrder(ArgsConst.FIRST);
|
||||||
|
one.setAuditState(ArgsConst.REJECT);
|
||||||
|
boolean update = updateById(one);
|
||||||
|
if (update) {
|
||||||
|
organization.setAuditState(4);
|
||||||
|
organization.setFirstTime(new Date());
|
||||||
|
organization.setFirstTrial(auditRequest.getAuditOpinion());
|
||||||
|
organizationMapper.updateById(organization);
|
||||||
|
}
|
||||||
|
return update ? AjaxResult.ok().msg("人事审批拒绝!") : AjaxResult.fail().msg("人事审批失败!");
|
||||||
|
}
|
||||||
|
// 领导终审批拒绝
|
||||||
|
if (leadership.getParamValue().equals(byId.getLoginName())) {
|
||||||
|
one.setAuditOrder(ArgsConst.LAST);
|
||||||
|
one.setAuditState(ArgsConst.REJECT);
|
||||||
|
boolean update = updateById(one);
|
||||||
|
if (update) {
|
||||||
|
organization.setAuditState(4);
|
||||||
|
organization.setLastTime(new Date());
|
||||||
|
organization.setLastInstance(auditRequest.getAuditOpinion());
|
||||||
|
organizationMapper.updateById(organization);
|
||||||
|
}
|
||||||
|
return update ? AjaxResult.ok().msg("领导审批拒绝!") : AjaxResult.fail().msg("领导审批失败!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 董监审批
|
* 董监审批
|
||||||
*
|
*
|
||||||
|
@ -345,6 +467,8 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
||||||
Audit one1 = getOne(new LambdaQueryWrapper<Audit>().eq(Audit::getPersonnelId, auditRequest.getPersonnelId()).eq(Audit::getAuditOrder, ArgsConst.LAST));
|
Audit one1 = getOne(new LambdaQueryWrapper<Audit>().eq(Audit::getPersonnelId, auditRequest.getPersonnelId()).eq(Audit::getAuditOrder, ArgsConst.LAST));
|
||||||
one1.setAuditOrder(ArgsConst.WAITING);
|
one1.setAuditOrder(ArgsConst.WAITING);
|
||||||
updateById(one1);
|
updateById(one1);
|
||||||
|
recruitment.setAuditState(2);
|
||||||
|
recruitment.setFirstTime(new Date());
|
||||||
recruitment.setFirstTrial(auditRequest.getAuditOpinion());
|
recruitment.setFirstTrial(auditRequest.getAuditOpinion());
|
||||||
directorsSupervisorsMapper.updateById(recruitment);
|
directorsSupervisorsMapper.updateById(recruitment);
|
||||||
}
|
}
|
||||||
|
@ -356,7 +480,8 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
||||||
audit.setAuditState(ArgsConst.PASS);
|
audit.setAuditState(ArgsConst.PASS);
|
||||||
boolean update = updateById(audit);
|
boolean update = updateById(audit);
|
||||||
if (update) {
|
if (update) {
|
||||||
recruitment.setAuditState(2);
|
recruitment.setAuditState(3);
|
||||||
|
recruitment.setLastTime(new Date());
|
||||||
recruitment.setLastInstance(auditRequest.getAuditOpinion());
|
recruitment.setLastInstance(auditRequest.getAuditOpinion());
|
||||||
directorsSupervisorsMapper.updateById(recruitment);
|
directorsSupervisorsMapper.updateById(recruitment);
|
||||||
}
|
}
|
||||||
|
@ -369,7 +494,8 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
||||||
audit.setAuditState(ArgsConst.REJECT);
|
audit.setAuditState(ArgsConst.REJECT);
|
||||||
boolean update = updateById(audit);
|
boolean update = updateById(audit);
|
||||||
if (update) {
|
if (update) {
|
||||||
recruitment.setAuditState(3);
|
recruitment.setAuditState(4);
|
||||||
|
recruitment.setFirstTime(new Date());
|
||||||
recruitment.setFirstTrial(auditRequest.getAuditOpinion());
|
recruitment.setFirstTrial(auditRequest.getAuditOpinion());
|
||||||
directorsSupervisorsMapper.updateById(recruitment);
|
directorsSupervisorsMapper.updateById(recruitment);
|
||||||
}
|
}
|
||||||
|
@ -381,7 +507,8 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
||||||
audit.setAuditState(ArgsConst.REJECT);
|
audit.setAuditState(ArgsConst.REJECT);
|
||||||
boolean update = updateById(audit);
|
boolean update = updateById(audit);
|
||||||
if (update) {
|
if (update) {
|
||||||
recruitment.setAuditState(3);
|
recruitment.setAuditState(4);
|
||||||
|
recruitment.setLastTime(new Date());
|
||||||
recruitment.setLastInstance(auditRequest.getAuditOpinion());
|
recruitment.setLastInstance(auditRequest.getAuditOpinion());
|
||||||
directorsSupervisorsMapper.updateById(recruitment);
|
directorsSupervisorsMapper.updateById(recruitment);
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,6 +123,8 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
|
||||||
return AjaxResult.fail().msg("Id不能为空!");
|
return AjaxResult.fail().msg("Id不能为空!");
|
||||||
} else {
|
} else {
|
||||||
int i = directorsSupervisorsMapper.deleteBatchIds(asList);
|
int i = directorsSupervisorsMapper.deleteBatchIds(asList);
|
||||||
|
attachmentMapper.delete(new LambdaQueryWrapper<Attachment>().eq(Attachment::getTargetType, ArgsConst.DIRECTORS).in(Attachment::getTargetId, asList));
|
||||||
|
auditMapper.delete(new LambdaQueryWrapper<Audit>().eq(Audit::getPerType, ArgsConst.DIRECTORS).in(Audit::getPersonnelId, asList));
|
||||||
return i > 0 ? AjaxResult.ok().msg("删除成功!") : AjaxResult.fail().msg("删除失败!");
|
return i > 0 ? AjaxResult.ok().msg("删除成功!") : AjaxResult.fail().msg("删除失败!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -145,6 +147,10 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
|
||||||
return AjaxResult.fail().msg("id不能为空!");
|
return AjaxResult.fail().msg("id不能为空!");
|
||||||
}
|
}
|
||||||
Page<Attachment> attachmentPage = attachmentMapper.selectPage(page, new LambdaQueryWrapper<Attachment>().eq(Attachment::getTargetId, id).eq(Attachment::getTargetType, ArgsConst.DIRECTORS));
|
Page<Attachment> attachmentPage = attachmentMapper.selectPage(page, new LambdaQueryWrapper<Attachment>().eq(Attachment::getTargetId, id).eq(Attachment::getTargetType, ArgsConst.DIRECTORS));
|
||||||
|
for (Attachment record : attachmentPage.getRecords()) {
|
||||||
|
record.setCreatedId(userMapper.selectById(record.getCreatedId()).getUserName());
|
||||||
|
record.setUpdatedId(userMapper.selectById(record.getUpdatedId()).getUserName());
|
||||||
|
}
|
||||||
return AjaxResult.ok().data(attachmentPage);
|
return AjaxResult.ok().data(attachmentPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,20 +166,27 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
|
||||||
audit.setPersonnelId(id);
|
audit.setPersonnelId(id);
|
||||||
audit.setPerType(type);
|
audit.setPerType(type);
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
|
// 未审批
|
||||||
audit.setAuditState(ArgsConst.SUBMIT);
|
audit.setAuditState(ArgsConst.SUBMIT);
|
||||||
audit.setAuditOrder(ArgsConst.GIVE_AUDIT);
|
audit.setAuditOrder(ArgsConst.GIVE_AUDIT);
|
||||||
audit.setApprover(loginId);
|
audit.setApprover(loginId);
|
||||||
audit.setApproverTime(new Date());
|
audit.setApproverTime(new Date());
|
||||||
} else if (i == 1) {
|
} else if (i == 1) {
|
||||||
|
// 待审批 人事部负责人
|
||||||
Config config = configMapper.selectOne(new LambdaQueryWrapper<Config>().eq(Config::getParamKey, ConfigCache.SYS_USER_PERSONNEL_DIRECTOR));
|
Config config = configMapper.selectOne(new LambdaQueryWrapper<Config>().eq(Config::getParamKey, ConfigCache.SYS_USER_PERSONNEL_DIRECTOR));
|
||||||
|
User user1 = userMapper.selectOne(new LambdaQueryWrapper<User>().eq(User::getLoginName, config.getParamValue()));
|
||||||
audit.setAuditOrder(ArgsConst.WAITING);
|
audit.setAuditOrder(ArgsConst.WAITING);
|
||||||
audit.setApprover(userMapper.selectOne(new LambdaQueryWrapper<User>().eq(User::getLoginName, config.getParamValue())).getId());
|
audit.setApprover(user1.getId());
|
||||||
audit.setApproverTime(new Date());
|
audit.setApproverTime(new Date());
|
||||||
|
directorsSupervisors.setFirstId(user1.getUserName());
|
||||||
} else if (i == 2) {
|
} else if (i == 2) {
|
||||||
|
// 领导
|
||||||
Config config = configMapper.selectOne(new LambdaQueryWrapper<Config>().eq(Config::getParamKey, ConfigCache.SYS_USER_LEADERSHIP));
|
Config config = configMapper.selectOne(new LambdaQueryWrapper<Config>().eq(Config::getParamKey, ConfigCache.SYS_USER_LEADERSHIP));
|
||||||
|
User user2 = userMapper.selectOne(new LambdaQueryWrapper<User>().eq(User::getLoginName, config.getParamValue()));
|
||||||
audit.setAuditOrder(ArgsConst.LAST);
|
audit.setAuditOrder(ArgsConst.LAST);
|
||||||
audit.setApprover(userMapper.selectOne(new LambdaQueryWrapper<User>().eq(User::getLoginName, config.getParamValue())).getId());
|
audit.setApprover(user2.getId());
|
||||||
audit.setApproverTime(new Date());
|
audit.setApproverTime(new Date());
|
||||||
|
directorsSupervisors.setLastId(user2.getUserName());
|
||||||
}
|
}
|
||||||
auditMapper.insert(audit);
|
auditMapper.insert(audit);
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,6 +64,7 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
|
||||||
organizationLambdaQueryWrapper.ge(StrUtil.isNotBlank(organizationSearch.getCreatedAt()), Organization::getCreatedAt, organizationSearch.getCreatedAt());
|
organizationLambdaQueryWrapper.ge(StrUtil.isNotBlank(organizationSearch.getCreatedAt()), Organization::getCreatedAt, organizationSearch.getCreatedAt());
|
||||||
organizationLambdaQueryWrapper.le(StrUtil.isNotBlank(organizationSearch.getUpdatedAt()), Organization::getUpdatedAt, organizationSearch.getUpdatedAt());
|
organizationLambdaQueryWrapper.le(StrUtil.isNotBlank(organizationSearch.getUpdatedAt()), Organization::getUpdatedAt, organizationSearch.getUpdatedAt());
|
||||||
organizationLambdaQueryWrapper.eq(Organization::getType, organizationSearch.getType());
|
organizationLambdaQueryWrapper.eq(Organization::getType, organizationSearch.getType());
|
||||||
|
organizationLambdaQueryWrapper.orderByDesc(Organization::getCreatedAt);
|
||||||
Page<Organization> selectPage = organizationMapper.selectPage(page, organizationLambdaQueryWrapper);
|
Page<Organization> selectPage = organizationMapper.selectPage(page, organizationLambdaQueryWrapper);
|
||||||
for (Organization record : selectPage.getRecords()) {
|
for (Organization record : selectPage.getRecords()) {
|
||||||
record.setCompanyId(companyNameMapper.selectById(record.getCompanyId()).getCompanyName());
|
record.setCompanyId(companyNameMapper.selectById(record.getCompanyId()).getCompanyName());
|
||||||
|
@ -82,6 +83,8 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
personnelIndicatorsMapper.delete(new LambdaQueryWrapper<PersonnelIndicators>().in(PersonnelIndicators::getOrganizationId, asList));
|
personnelIndicatorsMapper.delete(new LambdaQueryWrapper<PersonnelIndicators>().in(PersonnelIndicators::getOrganizationId, asList));
|
||||||
recruitmentMapper.delete(new LambdaQueryWrapper<Recruitment>().in(Recruitment::getCompanyId, asList));
|
recruitmentMapper.delete(new LambdaQueryWrapper<Recruitment>().in(Recruitment::getCompanyId, asList));
|
||||||
|
auditMapper.delete(new LambdaQueryWrapper<Audit>().eq(Audit::getPerType, ArgsConst.RECRUITMENT).in(Audit::getPersonnelId, asList));
|
||||||
|
auditMapper.delete(new LambdaQueryWrapper<Audit>().eq(Audit::getPerType, ArgsConst.PERSONNEL_INDICATORS).in(Audit::getPersonnelId, asList));
|
||||||
return AjaxResult.ok().msg("删除成功!");
|
return AjaxResult.ok().msg("删除成功!");
|
||||||
}
|
}
|
||||||
return AjaxResult.fail().msg("删除失败!");
|
return AjaxResult.fail().msg("删除失败!");
|
||||||
|
@ -102,14 +105,14 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
|
||||||
if (1 == organization.getAuditState()) {
|
if (1 == organization.getAuditState()) {
|
||||||
return AjaxResult.fail().msg("该数据已送审,请勿重复操作!");
|
return AjaxResult.fail().msg("该数据已送审,请勿重复操作!");
|
||||||
}
|
}
|
||||||
extracted(id, type, loginId);
|
extracted(organization, 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("送审失败!");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void extracted(String id, String type, String loginId) {
|
private void extracted(Organization organization, String id, String type, String loginId) {
|
||||||
for (int i = 0; i <= 2; i++) {
|
for (int i = 0; i <= 2; i++) {
|
||||||
Audit audit = new Audit();
|
Audit audit = new Audit();
|
||||||
audit.setPersonnelId(id);
|
audit.setPersonnelId(id);
|
||||||
|
@ -123,38 +126,27 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
|
||||||
} else if (i == 1) {
|
} else if (i == 1) {
|
||||||
// 待审批 人事部负责人
|
// 待审批 人事部负责人
|
||||||
Config config = configMapper.selectOne(new LambdaQueryWrapper<Config>().eq(Config::getParamKey, ConfigCache.SYS_USER_PERSONNEL_DIRECTOR));
|
Config config = configMapper.selectOne(new LambdaQueryWrapper<Config>().eq(Config::getParamKey, ConfigCache.SYS_USER_PERSONNEL_DIRECTOR));
|
||||||
|
User user1 = userMapper.selectOne(new LambdaQueryWrapper<User>().eq(User::getLoginName, config.getParamValue()));
|
||||||
audit.setAuditOrder(ArgsConst.WAITING);
|
audit.setAuditOrder(ArgsConst.WAITING);
|
||||||
audit.setApprover(userMapper.selectOne(new LambdaQueryWrapper<User>().eq(User::getLoginName, config.getParamValue())).getId());
|
audit.setApprover(user1.getId());
|
||||||
audit.setApproverTime(new Date());
|
audit.setApproverTime(new Date());
|
||||||
|
organization.setFirstId(user1.getUserName());
|
||||||
} else if (i == 2) {
|
} else if (i == 2) {
|
||||||
// 领导
|
// 领导
|
||||||
Config config = configMapper.selectOne(new LambdaQueryWrapper<Config>().eq(Config::getParamKey, ConfigCache.SYS_USER_LEADERSHIP));
|
Config config = configMapper.selectOne(new LambdaQueryWrapper<Config>().eq(Config::getParamKey, ConfigCache.SYS_USER_LEADERSHIP));
|
||||||
|
User user2 = userMapper.selectOne(new LambdaQueryWrapper<User>().eq(User::getLoginName, config.getParamValue()));
|
||||||
audit.setAuditOrder(ArgsConst.LAST);
|
audit.setAuditOrder(ArgsConst.LAST);
|
||||||
audit.setApprover(userMapper.selectOne(new LambdaQueryWrapper<User>().eq(User::getLoginName, config.getParamValue())).getId());
|
audit.setApprover(user2.getId());
|
||||||
audit.setApproverTime(new Date());
|
audit.setApproverTime(new Date());
|
||||||
|
organization.setLastId(user2.getUserName());
|
||||||
}
|
}
|
||||||
auditMapper.insert(audit);
|
auditMapper.insert(audit);
|
||||||
}
|
}
|
||||||
|
// organization.setAuditState(1);
|
||||||
|
// updateById(organization);
|
||||||
|
// Integer i = auditService.saveAuditLog(id, loginId, "送审","送审","");
|
||||||
|
// return i > 0 ? AjaxResult.ok().msg("送审成功!") : AjaxResult.ok().msg("送审失败!");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 人员指标申报
|
|
||||||
* @param id
|
|
||||||
* @param type
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public AjaxResult submitPersonnelIndicators(String id, String type) {
|
|
||||||
String loginId = StpUtil.getLoginIdAsString();
|
|
||||||
PersonnelIndicators organization = personnelIndicatorsMapper.selectById(id);
|
|
||||||
if (1 == organization.getAuditState()) {
|
|
||||||
return AjaxResult.fail().msg("该数据已送审,请勿重复操作!");
|
|
||||||
}
|
|
||||||
extracted(id, type, loginId);
|
|
||||||
organization.setAuditState(1);
|
|
||||||
personnelIndicatorsMapper.updateById(organization);
|
|
||||||
Integer i = auditService.saveAuditLog(id, loginId, type,"送审","");
|
|
||||||
return i > 0 ? AjaxResult.ok().msg("送审成功!") : AjaxResult.ok().msg("送审失败!");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,11 +5,13 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.util.NumberUtil;
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
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.PersonnelIndicatorsDto;
|
import com.ydool.staff.dto.PersonnelIndicatorsDto;
|
||||||
import com.ydool.staff.entity.*;
|
import com.ydool.staff.entity.*;
|
||||||
import com.ydool.common.base.BaseService;
|
import com.ydool.common.base.BaseService;
|
||||||
import com.ydool.staff.entity.PersonnelIndicators;
|
import com.ydool.staff.entity.PersonnelIndicators;
|
||||||
|
import com.ydool.staff.mapper.CompanyNameMapper;
|
||||||
import com.ydool.staff.mapper.OrganizationMapper;
|
import com.ydool.staff.mapper.OrganizationMapper;
|
||||||
import com.ydool.staff.mapper.PersonnelIndicatorsMapper;
|
import com.ydool.staff.mapper.PersonnelIndicatorsMapper;
|
||||||
import com.ydool.staff.mapper.PersonnelMapper;
|
import com.ydool.staff.mapper.PersonnelMapper;
|
||||||
|
@ -38,26 +40,21 @@ public class PersonnelIndicatorsServiceImpl extends BaseService<PersonnelIndicat
|
||||||
@Autowired
|
@Autowired
|
||||||
OrganizationMapper organizationMapper;
|
OrganizationMapper organizationMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
PersonnelMapper personnelMapper;
|
CompanyNameMapper companyNameMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult savePersonnelIndicators(PersonnelIndicatorsRequest personnelIndicatorsRequest) {
|
public AjaxResult savePersonnelIndicators(PersonnelIndicatorsRequest personnelIndicatorsRequest) {
|
||||||
OrganizationRequest organizationRequest = personnelIndicatorsRequest.getOrganizationRequest();
|
OrganizationRequest organizationRequest = personnelIndicatorsRequest.getOrganizationRequest();
|
||||||
Organization organization = BeanUtil.copyProperties(organizationRequest, Organization.class);
|
Organization organization = BeanUtil.copyProperties(organizationRequest, Organization.class);
|
||||||
organization.setType("personnel_indicators");
|
organization.setType(ArgsConst.PERSONNEL_INDICATORS);
|
||||||
// organization.setDocumentStatus("国资审核");
|
|
||||||
int i = organizationMapper.insert(organization);
|
int i = organizationMapper.insert(organization);
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
List<PersonnelIndicators> personnelIndicators = personnelIndicatorsRequest.getPersonnelIndicators();
|
List<PersonnelIndicators> personnelIndicators = personnelIndicatorsRequest.getPersonnelIndicators();
|
||||||
List<String> list = personnelIndicators.stream().map(PersonnelIndicators::getAddNumber).collect(Collectors.toList());
|
|
||||||
for (PersonnelIndicators personnelIndicator : personnelIndicators) {
|
for (PersonnelIndicators personnelIndicator : personnelIndicators) {
|
||||||
if (!NumberUtil.isNumber(personnelIndicator.getAddNumber()) || !NumberUtil.isNumber(personnelIndicator.getStandardNumber())){
|
|
||||||
return AjaxResult.fail().msg("指标人数输入不合法!");
|
|
||||||
}
|
|
||||||
personnelIndicator.setOrganizationId(organization.getId());
|
personnelIndicator.setOrganizationId(organization.getId());
|
||||||
personnelIndicatorsMapper.insert(personnelIndicator);
|
|
||||||
return AjaxResult.ok().msg("添加成功!");
|
|
||||||
}
|
}
|
||||||
|
saveBatch(personnelIndicators);
|
||||||
|
return AjaxResult.ok().msg("添加成功!");
|
||||||
}
|
}
|
||||||
return AjaxResult.fail().msg("添加失败!");
|
return AjaxResult.fail().msg("添加失败!");
|
||||||
}
|
}
|
||||||
|
@ -68,9 +65,10 @@ public class PersonnelIndicatorsServiceImpl extends BaseService<PersonnelIndicat
|
||||||
if (ObjectUtil.isNull(organization)) {
|
if (ObjectUtil.isNull(organization)) {
|
||||||
return AjaxResult.fail().msg("未找到相关信息!");
|
return AjaxResult.fail().msg("未找到相关信息!");
|
||||||
}
|
}
|
||||||
|
CompanyName companyName = companyNameMapper.selectById(organization.getCompanyId());
|
||||||
List<PersonnelIndicators> personnelIndicators = personnelIndicatorsMapper.selectList(new LambdaQueryWrapper<PersonnelIndicators>().eq(PersonnelIndicators::getOrganizationId, organization.getId()));
|
List<PersonnelIndicators> personnelIndicators = personnelIndicatorsMapper.selectList(new LambdaQueryWrapper<PersonnelIndicators>().eq(PersonnelIndicators::getOrganizationId, organization.getId()));
|
||||||
PersonnelIndicatorsDto recruitmentRequest = new PersonnelIndicatorsDto();
|
PersonnelIndicatorsDto recruitmentRequest = new PersonnelIndicatorsDto();
|
||||||
recruitmentRequest.setOrganization(organization);
|
recruitmentRequest.setOrganization(companyName);
|
||||||
recruitmentRequest.setPersonnelIndicators(personnelIndicators);
|
recruitmentRequest.setPersonnelIndicators(personnelIndicators);
|
||||||
return AjaxResult.ok().data(recruitmentRequest);
|
return AjaxResult.ok().data(recruitmentRequest);
|
||||||
}
|
}
|
||||||
|
|
|
@ -562,7 +562,7 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
||||||
}
|
}
|
||||||
if (ArgsConst.EXCHANGE.equals(request.getType())){
|
if (ArgsConst.EXCHANGE.equals(request.getType())){
|
||||||
Exchange exchange = exchangeMapper.selectById(id);
|
Exchange exchange = exchangeMapper.selectById(id);
|
||||||
exchange.setAuditState("1");
|
exchange.setAuditState(1);
|
||||||
exchangeMapper.updateById(exchange);
|
exchangeMapper.updateById(exchange);
|
||||||
}
|
}
|
||||||
auditService.saveAuditLog(id, loginId,request.getType(), "一般送审提交","");
|
auditService.saveAuditLog(id, loginId,request.getType(), "一般送审提交","");
|
||||||
|
|
|
@ -5,12 +5,15 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.util.NumberUtil;
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
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.RecruitmentDto;
|
import com.ydool.staff.dto.RecruitmentDto;
|
||||||
|
import com.ydool.staff.entity.CompanyName;
|
||||||
import com.ydool.staff.entity.Organization;
|
import com.ydool.staff.entity.Organization;
|
||||||
import com.ydool.staff.entity.Personnel;
|
import com.ydool.staff.entity.Personnel;
|
||||||
import com.ydool.staff.entity.Recruitment;
|
import com.ydool.staff.entity.Recruitment;
|
||||||
import com.ydool.common.base.BaseService;
|
import com.ydool.common.base.BaseService;
|
||||||
|
import com.ydool.staff.mapper.CompanyNameMapper;
|
||||||
import com.ydool.staff.mapper.OrganizationMapper;
|
import com.ydool.staff.mapper.OrganizationMapper;
|
||||||
import com.ydool.staff.mapper.PersonnelMapper;
|
import com.ydool.staff.mapper.PersonnelMapper;
|
||||||
import com.ydool.staff.mapper.RecruitmentMapper;
|
import com.ydool.staff.mapper.RecruitmentMapper;
|
||||||
|
@ -39,7 +42,7 @@ public class RecruitmentServiceImpl extends BaseService<RecruitmentMapper, Recru
|
||||||
@Autowired
|
@Autowired
|
||||||
RecruitmentMapper recruitmentMapper;
|
RecruitmentMapper recruitmentMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
PersonnelMapper personnelMapper;
|
CompanyNameMapper companyNameMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
OrganizationMapper organizationMapper;
|
OrganizationMapper organizationMapper;
|
||||||
|
|
||||||
|
@ -48,19 +51,15 @@ public class RecruitmentServiceImpl extends BaseService<RecruitmentMapper, Recru
|
||||||
public AjaxResult saveRecruitment(RecruitmentRequest recruitmentRequest) {
|
public AjaxResult saveRecruitment(RecruitmentRequest recruitmentRequest) {
|
||||||
OrganizationRequest organizationRequest = recruitmentRequest.getOrganizationRequest();
|
OrganizationRequest organizationRequest = recruitmentRequest.getOrganizationRequest();
|
||||||
Organization organization = BeanUtil.copyProperties(organizationRequest, Organization.class);
|
Organization organization = BeanUtil.copyProperties(organizationRequest, Organization.class);
|
||||||
organization.setType("organization");
|
organization.setType(ArgsConst.ORGANIZATION);
|
||||||
// organization.setDocumentStatus("国资审核");
|
|
||||||
int i = organizationMapper.insert(organization);
|
int i = organizationMapper.insert(organization);
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
List<Recruitment> recruitments = recruitmentRequest.getRecruitments();
|
List<Recruitment> recruitments = recruitmentRequest.getRecruitments();
|
||||||
for (Recruitment recruitment : recruitments) {
|
for (Recruitment recruitment : recruitments) {
|
||||||
if (!NumberUtil.isNumber(recruitment.getPlaces())){
|
|
||||||
return AjaxResult.fail().msg("名额输入不合法!");
|
|
||||||
}
|
|
||||||
recruitment.setCompanyId(organization.getId());
|
recruitment.setCompanyId(organization.getId());
|
||||||
recruitmentMapper.insert(recruitment);
|
|
||||||
return AjaxResult.ok().msg("添加成功!");
|
|
||||||
}
|
}
|
||||||
|
saveBatch(recruitments);
|
||||||
|
return AjaxResult.ok().msg("添加成功!");
|
||||||
}
|
}
|
||||||
return AjaxResult.fail().msg("添加失败!");
|
return AjaxResult.fail().msg("添加失败!");
|
||||||
}
|
}
|
||||||
|
@ -83,9 +82,10 @@ public class RecruitmentServiceImpl extends BaseService<RecruitmentMapper, Recru
|
||||||
if (ObjectUtil.isNull(organization)) {
|
if (ObjectUtil.isNull(organization)) {
|
||||||
return AjaxResult.fail().msg("未找到相关信息!");
|
return AjaxResult.fail().msg("未找到相关信息!");
|
||||||
}
|
}
|
||||||
|
CompanyName companyName = companyNameMapper.selectById(organization.getCompanyId());
|
||||||
List<Recruitment> recruitments = recruitmentMapper.selectList(new LambdaQueryWrapper<Recruitment>().eq(Recruitment::getCompanyId, organization.getId()));
|
List<Recruitment> recruitments = recruitmentMapper.selectList(new LambdaQueryWrapper<Recruitment>().eq(Recruitment::getCompanyId, organization.getId()));
|
||||||
RecruitmentDto recruitmentRequest = new RecruitmentDto();
|
RecruitmentDto recruitmentRequest = new RecruitmentDto();
|
||||||
recruitmentRequest.setOrganization(organization);
|
recruitmentRequest.setOrganization(companyName);
|
||||||
recruitmentRequest.setRecruitments(recruitments);
|
recruitmentRequest.setRecruitments(recruitments);
|
||||||
return AjaxResult.ok().data(recruitmentRequest);
|
return AjaxResult.ok().data(recruitmentRequest);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue