修改指标,登记,董监

This commit is contained in:
zhuyy 2023-06-16 17:32:13 +08:00
parent 1a7a1ce696
commit 2246904236
8 changed files with 130 additions and 144 deletions

View File

@ -19,6 +19,9 @@ import java.util.List;
@Data @Data
public class PersonnelIndicatorsDto implements Serializable { public class PersonnelIndicatorsDto implements Serializable {
@ApiModelProperty(value = "审批")
private Boolean btn = Boolean.FALSE;
@ApiModelProperty(value = "企业信息") @ApiModelProperty(value = "企业信息")
private Organization organization; private Organization organization;

View File

@ -12,6 +12,9 @@ import java.util.List;
@Data @Data
public class RecruitmentDto implements Serializable { public class RecruitmentDto implements Serializable {
@ApiModelProperty(value = "审批")
private Boolean btn = Boolean.FALSE;
@ApiModelProperty(value = "企业信息") @ApiModelProperty(value = "企业信息")
private Organization organization; private Organization organization;

View File

@ -52,6 +52,7 @@ public class DirectorsSupervisors extends BaseEntity {
@ApiModelProperty(value = "出生年月") @ApiModelProperty(value = "出生年月")
@NotNull(message = "出生年月不能为空") @NotNull(message = "出生年月不能为空")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date dataBirth; private Date dataBirth;
@ApiModelProperty(value = "身份证") @ApiModelProperty(value = "身份证")
@ -84,15 +85,18 @@ public class DirectorsSupervisors extends BaseEntity {
@ApiModelProperty(value = "任职开始时间") @ApiModelProperty(value = "任职开始时间")
@NotNull(message = "任职开始时间不能为空") @NotNull(message = "任职开始时间不能为空")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date serviceStartTime; private Date serviceStartTime;
@ApiModelProperty(value = "任职结束时间") @ApiModelProperty(value = "任职结束时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date serviceEndTime; private Date serviceEndTime;
@ApiModelProperty(value = "人员状态") @ApiModelProperty(value = "人员状态")
private String personnelStatus; private String personnelStatus;
@ApiModelProperty(value = "离职时间") @ApiModelProperty(value = "离职时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date dimissionTime; private Date dimissionTime;
@ApiModelProperty(value = "离职原因") @ApiModelProperty(value = "离职原因")
@ -130,6 +134,14 @@ public class DirectorsSupervisors extends BaseEntity {
@ApiModelProperty(value = "审批状态 0 未审批 1 待审批2已通过3已拒绝") @ApiModelProperty(value = "审批状态 0 未审批 1 待审批2已通过3已拒绝")
private Integer auditState; private Integer auditState;
@ApiModelProperty(value = "保存preserve/送审approval")
@TableField(exist = false)
private String type;
@ApiModelProperty(value = "审批")
@TableField(exist = false)
private Boolean btn = Boolean.FALSE;
@ApiModelProperty(value = "附件") @ApiModelProperty(value = "附件")
@TableField(exist = false) @TableField(exist = false)
private List<AttachmentDto> attachmentDtoList; private List<AttachmentDto> attachmentDtoList;

View File

@ -306,24 +306,6 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
User byId = userMapper.selectById(one.getApprover()); User byId = userMapper.selectById(one.getApprover());
// 同意 // 同意
if ("2".equals(auditRequest.getStatus())) { if ("2".equals(auditRequest.getStatus())) {
// 人事初审批同意
// 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);
// }
// saveAuditLog(auditRequest.getPersonnelId(), loginId, "organization", "人事审批通过", auditRequest.getAuditOpinion());
// 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())); CompanyName companyName = companyNameMapper.selectOne(new LambdaQueryWrapper<CompanyName>().eq(CompanyName::getId, organization.getCompanyId()));
// 名额 // 名额
@ -356,24 +338,17 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
placesMapper.insert(places); placesMapper.insert(places);
} }
} }
WorkFlowNotice workFlowNotice = new WorkFlowNotice();
workFlowNotice.setStatus(Boolean.FALSE);
workFlowNotice.setFlowType(ArgsConst.ORGANIZATION);
workFlowNotice.setUserId(one.getCreatedId());
workFlowNotice.setTitle("您的招聘登记已通过");
workFlowNotice.setFlowId(auditRequest.getPersonnelId());
workFlowNoticeService.save(workFlowNotice);
saveAuditLog(auditRequest.getPersonnelId(), loginId, ArgsConst.ORGANIZATION, "领导审批通过", auditRequest.getAuditOpinion()); saveAuditLog(auditRequest.getPersonnelId(), loginId, ArgsConst.ORGANIZATION, "领导审批通过", auditRequest.getAuditOpinion());
return update ? AjaxResult.ok().msg("领导审批成功!") : AjaxResult.fail().msg("领导审批失败!"); return update ? AjaxResult.ok().msg("领导审批成功!") : AjaxResult.fail().msg("领导审批失败!");
} }
} else { } else {
// 人事初审批拒绝
// 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);
// }
// saveAuditLog(auditRequest.getPersonnelId(), loginId, "organization", "人事审批拒绝", auditRequest.getAuditOpinion());
// return update ? AjaxResult.ok().msg("人事审批拒绝!") : AjaxResult.fail().msg("人事审批失败!");
// }
// 领导终审批拒绝 // 领导终审批拒绝
if (leadership.getParamValue().equals(byId.getLoginName())) { if (leadership.getParamValue().equals(byId.getLoginName())) {
one.setAuditOrder(ArgsConst.LAST); one.setAuditOrder(ArgsConst.LAST);
@ -386,6 +361,13 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
organization.setLastInstance(auditRequest.getAuditOpinion()); organization.setLastInstance(auditRequest.getAuditOpinion());
organizationMapper.updateById(organization); organizationMapper.updateById(organization);
} }
WorkFlowNotice workFlowNotice = new WorkFlowNotice();
workFlowNotice.setStatus(Boolean.FALSE);
workFlowNotice.setFlowType(ArgsConst.ORGANIZATION);
workFlowNotice.setUserId(one.getCreatedId());
workFlowNotice.setTitle("您的招聘登记已驳回");
workFlowNotice.setFlowId(auditRequest.getPersonnelId());
workFlowNoticeService.save(workFlowNotice);
saveAuditLog(auditRequest.getPersonnelId(), loginId, ArgsConst.ORGANIZATION, "领导审批拒绝", auditRequest.getAuditOpinion()); saveAuditLog(auditRequest.getPersonnelId(), loginId, ArgsConst.ORGANIZATION, "领导审批拒绝", auditRequest.getAuditOpinion());
return update ? AjaxResult.ok().msg("领导审批拒绝!") : AjaxResult.fail().msg("领导审批失败!"); return update ? AjaxResult.ok().msg("领导审批拒绝!") : AjaxResult.fail().msg("领导审批失败!");
} }
@ -411,30 +393,12 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
if (ObjectUtil.isNull(one)) { if (ObjectUtil.isNull(one)) {
return AjaxResult.fail().msg("该用户不能审批!"); 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)); Config leadership = configMapper.selectOne(new LambdaQueryWrapper<Config>().eq(Config::getParamKey, ConfigCache.SYS_USER_LEADERSHIP));
// 同意 // 同意
User byId = userMapper.selectById(one.getApprover()); User byId = userMapper.selectById(one.getApprover());
User user = userMapper.selectById(loginId);
if ("2".equals(auditRequest.getStatus())) { if ("2".equals(auditRequest.getStatus())) {
// // 人事初审批同意
// 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);
// }
// saveAuditLog(auditRequest.getPersonnelId(), loginId, "personnel_indicators", "人事审批通过", auditRequest.getAuditOpinion());
// 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())); CompanyName companyName = companyNameMapper.selectOne(new LambdaQueryWrapper<CompanyName>().eq(CompanyName::getId, organization.getCompanyId()));
@ -457,32 +421,17 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
organization.setLastInstance(auditRequest.getAuditOpinion()); organization.setLastInstance(auditRequest.getAuditOpinion());
organizationMapper.updateById(organization); organizationMapper.updateById(organization);
} }
// WorkFlowNotice workFlowNotice = new WorkFlowNotice(); WorkFlowNotice workFlowNotice = new WorkFlowNotice();
// workFlowNotice.setStatus(Boolean.FALSE); workFlowNotice.setStatus(Boolean.FALSE);
// workFlowNotice.setFlowType(ArgsConst.PERSONNEL_INDICATORS); workFlowNotice.setFlowType(ArgsConst.PERSONNEL_INDICATORS);
// workFlowNotice.setUserId(one.getApprover()); workFlowNotice.setUserId(one.getCreatedId());
// workFlowNotice.setTitle(byId.getUserName() + "的指标申报待你审批"); workFlowNotice.setTitle("的指标申报审批通过");
// workFlowNotice.setFlowId(auditRequest.getPersonnelId()); workFlowNotice.setFlowId(auditRequest.getPersonnelId());
// workFlowNoticeService.save(workFlowNotice); workFlowNoticeService.save(workFlowNotice);
saveAuditLog(auditRequest.getPersonnelId(), loginId, ArgsConst.PERSONNEL_INDICATORS, "领导审批通过", auditRequest.getAuditOpinion()); saveAuditLog(auditRequest.getPersonnelId(), loginId, ArgsConst.PERSONNEL_INDICATORS, "领导审批通过", auditRequest.getAuditOpinion());
return update ? AjaxResult.ok().msg("领导审批成功!") : AjaxResult.fail().msg("领导审批失败!"); return update ? AjaxResult.ok().msg("领导审批成功!") : AjaxResult.fail().msg("领导审批失败!");
} }
} else { } 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);
// }
// saveAuditLog(auditRequest.getPersonnelId(), loginId, "personnel_indicators", "人事审批拒绝", auditRequest.getAuditOpinion());
// return update ? AjaxResult.ok().msg("人事审批拒绝!") : AjaxResult.fail().msg("人事审批失败!");
// }
// 领导终审批拒绝 // 领导终审批拒绝
if (leadership.getParamValue().equals(byId.getLoginName())) { if (leadership.getParamValue().equals(byId.getLoginName())) {
one.setAuditOrder(ArgsConst.LAST); one.setAuditOrder(ArgsConst.LAST);
@ -495,13 +444,13 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
organization.setLastInstance(auditRequest.getAuditOpinion()); organization.setLastInstance(auditRequest.getAuditOpinion());
organizationMapper.updateById(organization); organizationMapper.updateById(organization);
} }
// WorkFlowNotice workFlowNotice = new WorkFlowNotice(); WorkFlowNotice workFlowNotice = new WorkFlowNotice();
// workFlowNotice.setStatus(Boolean.FALSE); workFlowNotice.setStatus(Boolean.FALSE);
// workFlowNotice.setFlowType(ArgsConst.PERSONNEL_INDICATORS); workFlowNotice.setFlowType(ArgsConst.PERSONNEL_INDICATORS);
// workFlowNotice.setUserId(one.getApprover()); workFlowNotice.setUserId(one.getCreatedId());
// workFlowNotice.setTitle(byId.getUserName() + "的指标申报已驳回"); workFlowNotice.setTitle("的指标申报已驳回");
// workFlowNotice.setFlowId(auditRequest.getPersonnelId()); workFlowNotice.setFlowId(auditRequest.getPersonnelId());
// workFlowNoticeService.save(workFlowNotice); workFlowNoticeService.save(workFlowNotice);
saveAuditLog(auditRequest.getPersonnelId(), loginId, ArgsConst.PERSONNEL_INDICATORS, "领导审批拒绝", auditRequest.getAuditOpinion()); saveAuditLog(auditRequest.getPersonnelId(), loginId, ArgsConst.PERSONNEL_INDICATORS, "领导审批拒绝", auditRequest.getAuditOpinion());
return update ? AjaxResult.ok().msg("领导审批拒绝!") : AjaxResult.fail().msg("领导审批失败!"); return update ? AjaxResult.ok().msg("领导审批拒绝!") : AjaxResult.fail().msg("领导审批失败!");
} }
@ -534,22 +483,6 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
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));
User byId = userMapper.selectById(audit.getApprover()); User byId = userMapper.selectById(audit.getApprover());
if ("2".equals(auditRequest.getStatus())) { if ("2".equals(auditRequest.getStatus())) {
// 人事初审批同意
// if (director.getParamValue().equals(byId.getLoginName())) {
// audit.setAuditOrder(ArgsConst.FIRST);
// audit.setAuditState(ArgsConst.PASS);
// boolean update = updateById(audit);
// if (update) {
// Audit one1 = getOne(new LambdaQueryWrapper<Audit>().eq(Audit::getPersonnelId, auditRequest.getPersonnelId()).eq(Audit::getAuditOrder, ArgsConst.LAST));
// one1.setAuditOrder(ArgsConst.WAITING);
// updateById(one1);
// recruitment.setAuditState(2);
// recruitment.setFirstTime(new Date());
// recruitment.setFirstTrial(auditRequest.getAuditOpinion());
// directorsSupervisorsMapper.updateById(recruitment);
// }
// return update ? AjaxResult.ok().msg("人事审批成功!") : AjaxResult.fail().msg("人事审批失败!");
// }
// 领导终审批同意 // 领导终审批同意
if (leadership.getParamValue().equals(byId.getLoginName())) { if (leadership.getParamValue().equals(byId.getLoginName())) {
audit.setAuditOrder(ArgsConst.LAST); audit.setAuditOrder(ArgsConst.LAST);
@ -562,23 +495,17 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
recruitment.setLastInstance(auditRequest.getAuditOpinion()); recruitment.setLastInstance(auditRequest.getAuditOpinion());
directorsSupervisorsMapper.updateById(recruitment); directorsSupervisorsMapper.updateById(recruitment);
} }
WorkFlowNotice workFlowNotice = new WorkFlowNotice();
workFlowNotice.setStatus(Boolean.FALSE);
workFlowNotice.setFlowType(ArgsConst.DIRECTORS);
workFlowNotice.setUserId(byId.getCreatedId());
workFlowNotice.setTitle("您的董监申报已通过");
workFlowNotice.setFlowId(auditRequest.getPersonnelId());
workFlowNoticeService.save(workFlowNotice);
saveAuditLog(auditRequest.getPersonnelId(), loginId, ArgsConst.DIRECTORS, "领导审批通过", auditRequest.getAuditOpinion()); saveAuditLog(auditRequest.getPersonnelId(), loginId, ArgsConst.DIRECTORS, "领导审批通过", auditRequest.getAuditOpinion());
return update ? AjaxResult.ok().msg("领导审批成功!") : AjaxResult.fail().msg("领导审批失败!"); return update ? AjaxResult.ok().msg("领导审批成功!") : AjaxResult.fail().msg("领导审批失败!");
} }
} else { } else {
// 人事初审批拒绝
// if (director.getParamValue().equals(byId.getLoginName())) {
// audit.setAuditOrder(ArgsConst.FIRST);
// audit.setAuditState(ArgsConst.REJECT);
// boolean update = updateById(audit);
// if (update) {
// recruitment.setAuditState(4);
// recruitment.setFirstTime(new Date());
// recruitment.setFirstTrial(auditRequest.getAuditOpinion());
// directorsSupervisorsMapper.updateById(recruitment);
// }
// return update ? AjaxResult.ok().msg("人事审批拒绝!") : AjaxResult.fail().msg("人事审批失败!");
// }
// 领导终审批拒绝 // 领导终审批拒绝
if (leadership.getParamValue().equals(byId.getLoginName())) { if (leadership.getParamValue().equals(byId.getLoginName())) {
audit.setAuditOrder(ArgsConst.LAST); audit.setAuditOrder(ArgsConst.LAST);
@ -591,6 +518,13 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
recruitment.setLastInstance(auditRequest.getAuditOpinion()); recruitment.setLastInstance(auditRequest.getAuditOpinion());
directorsSupervisorsMapper.updateById(recruitment); directorsSupervisorsMapper.updateById(recruitment);
} }
WorkFlowNotice workFlowNotice = new WorkFlowNotice();
workFlowNotice.setStatus(Boolean.FALSE);
workFlowNotice.setFlowType(ArgsConst.DIRECTORS);
workFlowNotice.setUserId(byId.getCreatedId());
workFlowNotice.setTitle("您的董监申报已驳回");
workFlowNotice.setFlowId(auditRequest.getPersonnelId());
workFlowNoticeService.save(workFlowNotice);
saveAuditLog(auditRequest.getPersonnelId(), loginId, ArgsConst.DIRECTORS, "领导审批拒绝", auditRequest.getAuditOpinion()); saveAuditLog(auditRequest.getPersonnelId(), loginId, ArgsConst.DIRECTORS, "领导审批拒绝", auditRequest.getAuditOpinion());
return update ? AjaxResult.ok().msg("领导审批拒绝!") : AjaxResult.fail().msg("领导审批失败!"); return update ? AjaxResult.ok().msg("领导审批拒绝!") : AjaxResult.fail().msg("领导审批失败!");
} }

View File

@ -12,6 +12,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.common.cache.ConfigCache; 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.oa.workFlow.data.entity.WorkFlowNotice;
import com.ydool.oa.workFlow.service.WorkFlowNoticeService;
import com.ydool.staff.dto.AttachmentDto; import com.ydool.staff.dto.AttachmentDto;
import com.ydool.staff.dto.DirectorsSupervisorsDto; import com.ydool.staff.dto.DirectorsSupervisorsDto;
import com.ydool.staff.entity.*; import com.ydool.staff.entity.*;
@ -59,6 +61,10 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
UserMapper userMapper; UserMapper userMapper;
@Autowired @Autowired
ConfigMapper configMapper; ConfigMapper configMapper;
@Autowired
WorkFlowNoticeService workFlowNoticeService;
@Autowired
OrganizationServiceImpl organizationService;
@Override @Override
public AjaxResult selectDirectorsSupervisorsList(Page<DirectorsSupervisors> page, DirectorsSupervisorsDto directorsSupervisorsDto) { public AjaxResult selectDirectorsSupervisorsList(Page<DirectorsSupervisors> page, DirectorsSupervisorsDto directorsSupervisorsDto) {
@ -86,12 +92,6 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
if (!IdcardUtil.isValidCard(directorsSupervisors.getIdentityCard())) { if (!IdcardUtil.isValidCard(directorsSupervisors.getIdentityCard())) {
return AjaxResult.fail().msg("身份证号格式不正确!"); return AjaxResult.fail().msg("身份证号格式不正确!");
} }
List<String> list = new ArrayList<>();
List<AttachmentDto> attachmentList = directorsSupervisors.getAttachmentDtoList();
for (AttachmentDto attachment : attachmentList) {
list.add(attachment.getPath());
}
directorsSupervisors.setCorrelationFile(StringUtils.join(list, ","));
int i = directorsSupervisorsMapper.insert(directorsSupervisors); int i = directorsSupervisorsMapper.insert(directorsSupervisors);
if (i > 0) { if (i > 0) {
List<AttachmentDto> attachmentDtoList = directorsSupervisors.getAttachmentDtoList(); List<AttachmentDto> attachmentDtoList = directorsSupervisors.getAttachmentDtoList();
@ -101,6 +101,10 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
attachment.setTargetType(ArgsConst.DIRECTORS); attachment.setTargetType(ArgsConst.DIRECTORS);
attachmentMapper.insert(attachment); attachmentMapper.insert(attachment);
} }
// 保存并且送审
if ("approval".equals(directorsSupervisors.getType())) {
return submitDirectorsSupervisors(directorsSupervisors.getId(), ArgsConst.DIRECTORS);
}
return AjaxResult.ok().msg("新增成功!"); return AjaxResult.ok().msg("新增成功!");
} }
return AjaxResult.fail().msg("新增失败!"); return AjaxResult.fail().msg("新增失败!");
@ -110,7 +114,18 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public AjaxResult editDirectorsSupervisors(DirectorsSupervisors directorsSupervisors) { public AjaxResult editDirectorsSupervisors(DirectorsSupervisors directorsSupervisors) {
int i = directorsSupervisorsMapper.updateById(directorsSupervisors); int i = directorsSupervisorsMapper.updateById(directorsSupervisors);
return i > 0 ? AjaxResult.ok().msg("修改成功!") : AjaxResult.fail().msg("修改失败!"); if (i > 0) {
attachmentMapper.delete(Wrappers.lambdaQuery(Attachment.class).eq(Attachment::getTargetId, directorsSupervisors.getId()));
List<AttachmentDto> attachmentDtoList = directorsSupervisors.getAttachmentDtoList();
List<Attachment> attachments = BeanUtil.copyToList(attachmentDtoList, Attachment.class);
for (Attachment attachment : attachments) {
attachment.setTargetId(directorsSupervisors.getId());
attachment.setTargetType(ArgsConst.DIRECTORS);
attachmentMapper.insert(attachment);
}
return AjaxResult.ok().msg("修改成功!");
}
return AjaxResult.fail().msg("修改失败!");
} }
@Override @Override
@ -133,9 +148,14 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
if (ObjectUtil.isNull(directorsSupervisors)) { if (ObjectUtil.isNull(directorsSupervisors)) {
return AjaxResult.fail().msg("未找到相关信息!"); return AjaxResult.fail().msg("未找到相关信息!");
} }
Config leadership = configMapper.selectOne(new LambdaQueryWrapper<Config>().eq(Config::getParamKey, ConfigCache.SYS_USER_LEADERSHIP));
User byId = userMapper.selectById(StpUtil.getLoginIdAsString());
List<Attachment> attachmentList = attachmentMapper.selectList(new LambdaQueryWrapper<Attachment>().eq(Attachment::getTargetId, directorsSupervisors.getId()).eq(Attachment::getTargetType, ArgsConst.DIRECTORS)); List<Attachment> attachmentList = attachmentMapper.selectList(new LambdaQueryWrapper<Attachment>().eq(Attachment::getTargetId, directorsSupervisors.getId()).eq(Attachment::getTargetType, ArgsConst.DIRECTORS));
List<AttachmentDto> attachmentDos = BeanUtil.copyToList(attachmentList, AttachmentDto.class); List<AttachmentDto> attachmentDos = BeanUtil.copyToList(attachmentList, AttachmentDto.class);
directorsSupervisors.setAttachmentDtoList(attachmentDos); directorsSupervisors.setAttachmentDtoList(attachmentDos);
if (leadership.getParamValue().equals(byId.getLoginName())) {
directorsSupervisors.setBtn(Boolean.TRUE);
}
return AjaxResult.ok().data(directorsSupervisors); return AjaxResult.ok().data(directorsSupervisors);
} }
@ -154,11 +174,12 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
@Override @Override
public AjaxResult submitDirectorsSupervisors(String id, String type) { public AjaxResult submitDirectorsSupervisors(String id, String type) {
Integer count = directorsSupervisorsMapper.selectCount(Wrappers.lambdaQuery(DirectorsSupervisors.class).eq(DirectorsSupervisors::getAuditState, 2)); Integer count = directorsSupervisorsMapper.selectCount(Wrappers.lambdaQuery(DirectorsSupervisors.class).eq(DirectorsSupervisors::getAuditState, 2));
if (count > 0) { if (count > 0) {
return AjaxResult.fail("当前有未审批的董监申报!"); return AjaxResult.fail("当前有未审批的董监申报!");
} }
String loginId = StpUtil.getLoginIdAsString(); String loginId = StpUtil.getLoginIdAsString();
User user = userMapper.selectById(loginId);
DirectorsSupervisors directorsSupervisors = get(id); DirectorsSupervisors directorsSupervisors = get(id);
if (1 == directorsSupervisors.getAuditState()) { if (1 == directorsSupervisors.getAuditState()) {
return AjaxResult.fail().msg("该数据已送审,请勿重复操作!"); return AjaxResult.fail().msg("该数据已送审,请勿重复操作!");
@ -173,14 +194,6 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
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) {
// // 待审批 人事部负责人
// 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.setApprover(user1.getId());
// audit.setApproverTime(new Date());
// directorsSupervisors.setFirstId(user1.getUserName());
} else { } else {
// 领导 // 领导
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));
@ -188,6 +201,13 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
audit.setAuditOrder(ArgsConst.WAITING); audit.setAuditOrder(ArgsConst.WAITING);
audit.setApprover(user2.getId()); audit.setApprover(user2.getId());
directorsSupervisors.setLastId(user2.getUserName()); directorsSupervisors.setLastId(user2.getUserName());
WorkFlowNotice workFlowNotice = new WorkFlowNotice();
workFlowNotice.setStatus(Boolean.FALSE);
workFlowNotice.setFlowType(ArgsConst.DIRECTORS);
workFlowNotice.setUserId(user2.getId());
workFlowNotice.setTitle(user.getUserName() + "的董监申报待你审批");
workFlowNotice.setFlowId(directorsSupervisors.getId());
workFlowNoticeService.save(workFlowNotice);
} }
auditMapper.insert(audit); auditMapper.insert(audit);
} }

View File

@ -127,14 +127,6 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
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) {
// // 待审批 人事部负责人
// 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.setApprover(user1.getId());
// audit.setApproverTime(new Date());
// organization.setFirstId(user1.getUserName());
} else { } else {
// 领导 // 领导
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));
@ -153,7 +145,7 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
} else { } else {
WorkFlowNotice workFlowNotice = new WorkFlowNotice(); WorkFlowNotice workFlowNotice = new WorkFlowNotice();
workFlowNotice.setStatus(Boolean.FALSE); workFlowNotice.setStatus(Boolean.FALSE);
workFlowNotice.setFlowType(ArgsConst.PERSONNEL_INDICATORS); workFlowNotice.setFlowType(ArgsConst.ORGANIZATION);
workFlowNotice.setUserId(user2.getId()); workFlowNotice.setUserId(user2.getId());
workFlowNotice.setTitle(user.getUserName() + "的招聘登记待你审批"); workFlowNotice.setTitle(user.getUserName() + "的招聘登记待你审批");
workFlowNotice.setFlowId(organization.getId()); workFlowNotice.setFlowId(organization.getId());

View File

@ -1,5 +1,6 @@
package com.ydool.staff.service.impl; package com.ydool.staff.service.impl;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
@ -9,6 +10,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
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.PersonnelIndicatorsDto; import com.ydool.staff.dto.PersonnelIndicatorsDto;
@ -23,6 +25,10 @@ import com.ydool.staff.request.OrganizationRequest;
import com.ydool.staff.request.PersonnelIndicatorsRequest; import com.ydool.staff.request.PersonnelIndicatorsRequest;
import com.ydool.staff.service.IOrganizationService; import com.ydool.staff.service.IOrganizationService;
import com.ydool.staff.service.IPersonnelIndicatorsService; import com.ydool.staff.service.IPersonnelIndicatorsService;
import com.ydool.system.entity.Config;
import com.ydool.system.entity.User;
import com.ydool.system.mapper.ConfigMapper;
import com.ydool.system.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -51,6 +57,10 @@ public class PersonnelIndicatorsServiceImpl extends BaseService<PersonnelIndicat
CompanyNameMapper companyNameMapper; CompanyNameMapper companyNameMapper;
@Autowired @Autowired
IOrganizationService organizationService; IOrganizationService organizationService;
@Autowired
private ConfigMapper configMapper;
@Autowired
UserMapper userMapper;
public static String getNextId() { public static String getNextId() {
int value = counter.incrementAndGet(); int value = counter.incrementAndGet();
@ -65,7 +75,7 @@ public class PersonnelIndicatorsServiceImpl extends BaseService<PersonnelIndicat
} }
OrganizationRequest organizationRequest = personnelIndicatorsRequest.getOrganizationRequest(); OrganizationRequest organizationRequest = personnelIndicatorsRequest.getOrganizationRequest();
Organization organization = BeanUtil.copyProperties(organizationRequest, Organization.class); Organization organization = BeanUtil.copyProperties(organizationRequest, Organization.class);
// organization.setApprovalNumber(DateUtil.format(DateUtil.date(), "yyyyMMddHHmmss" + getNextId())); organization.setApprovalNumber(DateUtil.format(DateUtil.date(), "yyyyMMddHHmmss" + getNextId()));
organization.setType(ArgsConst.PERSONNEL_INDICATORS); organization.setType(ArgsConst.PERSONNEL_INDICATORS);
int i = organizationMapper.insert(organization); int i = organizationMapper.insert(organization);
if (i > 0) { if (i > 0) {
@ -90,8 +100,13 @@ public class PersonnelIndicatorsServiceImpl extends BaseService<PersonnelIndicat
if (ObjectUtil.isNull(organization)) { if (ObjectUtil.isNull(organization)) {
return AjaxResult.fail().msg("未找到相关信息!"); return AjaxResult.fail().msg("未找到相关信息!");
} }
Config leadership = configMapper.selectOne(new LambdaQueryWrapper<Config>().eq(Config::getParamKey, ConfigCache.SYS_USER_LEADERSHIP));
User byId = userMapper.selectById(StpUtil.getLoginIdAsString());
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();
if (leadership.getParamValue().equals(byId.getLoginName())) {
recruitmentRequest.setBtn(Boolean.TRUE);
}
recruitmentRequest.setOrganization(organization); recruitmentRequest.setOrganization(organization);
recruitmentRequest.setPersonnelIndicators(personnelIndicators); recruitmentRequest.setPersonnelIndicators(personnelIndicators);
return AjaxResult.ok().data(recruitmentRequest); return AjaxResult.ok().data(recruitmentRequest);

View File

@ -1,5 +1,6 @@
package com.ydool.staff.service.impl; package com.ydool.staff.service.impl;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
@ -8,6 +9,7 @@ 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.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
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.RecruitmentDto; import com.ydool.staff.dto.RecruitmentDto;
@ -18,6 +20,10 @@ import com.ydool.staff.request.OrganizationRequest;
import com.ydool.staff.request.RecruitmentRequest; import com.ydool.staff.request.RecruitmentRequest;
import com.ydool.staff.service.IOrganizationService; import com.ydool.staff.service.IOrganizationService;
import com.ydool.staff.service.IRecruitmentService; import com.ydool.staff.service.IRecruitmentService;
import com.ydool.system.entity.Config;
import com.ydool.system.entity.User;
import com.ydool.system.mapper.ConfigMapper;
import com.ydool.system.mapper.UserMapper;
import com.ydool.system.request.IdsRequest; import com.ydool.system.request.IdsRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -51,6 +57,10 @@ public class RecruitmentServiceImpl extends BaseService<RecruitmentMapper, Recru
IOrganizationService organizationService; IOrganizationService organizationService;
@Autowired @Autowired
PlacesMapper placesMapper; PlacesMapper placesMapper;
@Autowired
private ConfigMapper configMapper;
@Autowired
UserMapper userMapper;
public static String getNextId() { public static String getNextId() {
int value = counter.incrementAndGet(); int value = counter.incrementAndGet();
@ -66,7 +76,7 @@ public class RecruitmentServiceImpl extends BaseService<RecruitmentMapper, Recru
} }
OrganizationRequest organizationRequest = recruitmentRequest.getOrganizationRequest(); OrganizationRequest organizationRequest = recruitmentRequest.getOrganizationRequest();
Organization organization = BeanUtil.copyProperties(organizationRequest, Organization.class); Organization organization = BeanUtil.copyProperties(organizationRequest, Organization.class);
// organization.setApprovalNumber(DateUtil.format(DateUtil.date(), "yyyyMMddHHmmss" + getNextId())); organization.setApprovalNumber(DateUtil.format(DateUtil.date(), "yyyyMMddHHmmss" + getNextId()));
organization.setType(ArgsConst.ORGANIZATION); organization.setType(ArgsConst.ORGANIZATION);
int i = organizationMapper.insert(organization); int i = organizationMapper.insert(organization);
if (i > 0) { if (i > 0) {
@ -76,14 +86,6 @@ public class RecruitmentServiceImpl extends BaseService<RecruitmentMapper, Recru
} }
recruitments.forEach(e -> e.setCompanyId(organization.getId())); recruitments.forEach(e -> e.setCompanyId(organization.getId()));
saveBatch(recruitments); saveBatch(recruitments);
// List<Long> list = recruitments.stream().map(Recruitment::getPlaces).collect(Collectors.toList());
// for (int j = 0; j < list.size(); j++) {
// Places places = new Places();
// places.setStatus(Boolean.FALSE);
// places.setOrganizationId(organization.getId());
// places.setOdd(DateUtil.format(DateUtil.date(), "yyyyMMddHHmmss" + getNextId()));
// placesMapper.insert(places);
// }
// 保存并且送审 // 保存并且送审
if ("approval".equals(recruitmentRequest.getType())) { if ("approval".equals(recruitmentRequest.getType())) {
return organizationService.submitRecruitment(organization.getId(), ArgsConst.RECRUITMENT); return organizationService.submitRecruitment(organization.getId(), ArgsConst.RECRUITMENT);
@ -111,8 +113,13 @@ public class RecruitmentServiceImpl extends BaseService<RecruitmentMapper, Recru
if (ObjectUtil.isNull(organization)) { if (ObjectUtil.isNull(organization)) {
return AjaxResult.fail().msg("未找到相关信息!"); return AjaxResult.fail().msg("未找到相关信息!");
} }
Config leadership = configMapper.selectOne(new LambdaQueryWrapper<Config>().eq(Config::getParamKey, ConfigCache.SYS_USER_LEADERSHIP));
User byId = userMapper.selectById(StpUtil.getLoginIdAsString());
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();
if (leadership.getParamValue().equals(byId.getLoginName())) {
recruitmentRequest.setBtn(Boolean.TRUE);
}
recruitmentRequest.setOrganization(organization); recruitmentRequest.setOrganization(organization);
recruitmentRequest.setRecruitments(recruitments); recruitmentRequest.setRecruitments(recruitments);
return AjaxResult.ok().data(recruitmentRequest); return AjaxResult.ok().data(recruitmentRequest);