diff --git a/src/main/java/com/ydool/staff/dto/PersonnelIndicatorsDto.java b/src/main/java/com/ydool/staff/dto/PersonnelIndicatorsDto.java index 153eae5..79fb948 100644 --- a/src/main/java/com/ydool/staff/dto/PersonnelIndicatorsDto.java +++ b/src/main/java/com/ydool/staff/dto/PersonnelIndicatorsDto.java @@ -19,6 +19,9 @@ import java.util.List; @Data public class PersonnelIndicatorsDto implements Serializable { + @ApiModelProperty(value = "审批") + private Boolean btn = Boolean.FALSE; + @ApiModelProperty(value = "企业信息") private Organization organization; diff --git a/src/main/java/com/ydool/staff/dto/RecruitmentDto.java b/src/main/java/com/ydool/staff/dto/RecruitmentDto.java index 781c9a4..3a6008b 100644 --- a/src/main/java/com/ydool/staff/dto/RecruitmentDto.java +++ b/src/main/java/com/ydool/staff/dto/RecruitmentDto.java @@ -12,6 +12,9 @@ import java.util.List; @Data public class RecruitmentDto implements Serializable { + @ApiModelProperty(value = "审批") + private Boolean btn = Boolean.FALSE; + @ApiModelProperty(value = "企业信息") private Organization organization; diff --git a/src/main/java/com/ydool/staff/entity/DirectorsSupervisors.java b/src/main/java/com/ydool/staff/entity/DirectorsSupervisors.java index c3bed5c..80cc818 100644 --- a/src/main/java/com/ydool/staff/entity/DirectorsSupervisors.java +++ b/src/main/java/com/ydool/staff/entity/DirectorsSupervisors.java @@ -52,6 +52,7 @@ public class DirectorsSupervisors extends BaseEntity { @ApiModelProperty(value = "出生年月") @NotNull(message = "出生年月不能为空") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date dataBirth; @ApiModelProperty(value = "身份证") @@ -84,15 +85,18 @@ public class DirectorsSupervisors extends BaseEntity { @ApiModelProperty(value = "任职开始时间") @NotNull(message = "任职开始时间不能为空") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date serviceStartTime; @ApiModelProperty(value = "任职结束时间") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date serviceEndTime; @ApiModelProperty(value = "人员状态") private String personnelStatus; @ApiModelProperty(value = "离职时间") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date dimissionTime; @ApiModelProperty(value = "离职原因") @@ -130,6 +134,14 @@ public class DirectorsSupervisors extends BaseEntity { @ApiModelProperty(value = "审批状态 0 未审批 1 待审批,2已通过,3已拒绝") 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 = "附件") @TableField(exist = false) private List attachmentDtoList; diff --git a/src/main/java/com/ydool/staff/service/impl/AuditServiceImpl.java b/src/main/java/com/ydool/staff/service/impl/AuditServiceImpl.java index a70ec7e..1fdd3b0 100644 --- a/src/main/java/com/ydool/staff/service/impl/AuditServiceImpl.java +++ b/src/main/java/com/ydool/staff/service/impl/AuditServiceImpl.java @@ -306,24 +306,6 @@ public class AuditServiceImpl extends BaseService implements User byId = userMapper.selectById(one.getApprover()); // 同意 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().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())) { CompanyName companyName = companyNameMapper.selectOne(new LambdaQueryWrapper().eq(CompanyName::getId, organization.getCompanyId())); // 名额 @@ -356,24 +338,17 @@ public class AuditServiceImpl extends BaseService implements 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()); return update ? AjaxResult.ok().msg("领导审批成功!") : AjaxResult.fail().msg("领导审批失败!"); } } 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())) { one.setAuditOrder(ArgsConst.LAST); @@ -386,6 +361,13 @@ public class AuditServiceImpl extends BaseService implements organization.setLastInstance(auditRequest.getAuditOpinion()); 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()); return update ? AjaxResult.ok().msg("领导审批拒绝!") : AjaxResult.fail().msg("领导审批失败!"); } @@ -411,30 +393,12 @@ public class AuditServiceImpl extends BaseService implements if (ObjectUtil.isNull(one)) { return AjaxResult.fail().msg("该用户不能审批!"); } - // 人事部负责人 - // Config director = configMapper.selectOne(new LambdaQueryWrapper().eq(Config::getParamKey, ConfigCache.SYS_USER_PERSONNEL_DIRECTOR)); // 领导 Config leadership = configMapper.selectOne(new LambdaQueryWrapper().eq(Config::getParamKey, ConfigCache.SYS_USER_LEADERSHIP)); // 同意 User byId = userMapper.selectById(one.getApprover()); + User user = userMapper.selectById(loginId); 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().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())) { CompanyName companyName = companyNameMapper.selectOne(new LambdaQueryWrapper().eq(CompanyName::getId, organization.getCompanyId())); @@ -457,32 +421,17 @@ public class AuditServiceImpl extends BaseService implements organization.setLastInstance(auditRequest.getAuditOpinion()); organizationMapper.updateById(organization); } - // WorkFlowNotice workFlowNotice = new WorkFlowNotice(); - // workFlowNotice.setStatus(Boolean.FALSE); - // workFlowNotice.setFlowType(ArgsConst.PERSONNEL_INDICATORS); - // workFlowNotice.setUserId(one.getApprover()); - // workFlowNotice.setTitle(byId.getUserName() + "的指标申报待你审批"); - // workFlowNotice.setFlowId(auditRequest.getPersonnelId()); - // workFlowNoticeService.save(workFlowNotice); + WorkFlowNotice workFlowNotice = new WorkFlowNotice(); + workFlowNotice.setStatus(Boolean.FALSE); + workFlowNotice.setFlowType(ArgsConst.PERSONNEL_INDICATORS); + workFlowNotice.setUserId(one.getCreatedId()); + workFlowNotice.setTitle("您的指标申报审批通过"); + workFlowNotice.setFlowId(auditRequest.getPersonnelId()); + workFlowNoticeService.save(workFlowNotice); saveAuditLog(auditRequest.getPersonnelId(), loginId, ArgsConst.PERSONNEL_INDICATORS, "领导审批通过", auditRequest.getAuditOpinion()); 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); - // } - // saveAuditLog(auditRequest.getPersonnelId(), loginId, "personnel_indicators", "人事审批拒绝", auditRequest.getAuditOpinion()); - // return update ? AjaxResult.ok().msg("人事审批拒绝!") : AjaxResult.fail().msg("人事审批失败!"); - // } // 领导终审批拒绝 if (leadership.getParamValue().equals(byId.getLoginName())) { one.setAuditOrder(ArgsConst.LAST); @@ -495,13 +444,13 @@ public class AuditServiceImpl extends BaseService implements organization.setLastInstance(auditRequest.getAuditOpinion()); organizationMapper.updateById(organization); } - // WorkFlowNotice workFlowNotice = new WorkFlowNotice(); - // workFlowNotice.setStatus(Boolean.FALSE); - // workFlowNotice.setFlowType(ArgsConst.PERSONNEL_INDICATORS); - // workFlowNotice.setUserId(one.getApprover()); - // workFlowNotice.setTitle(byId.getUserName() + "的指标申报已驳回"); - // workFlowNotice.setFlowId(auditRequest.getPersonnelId()); - // workFlowNoticeService.save(workFlowNotice); + WorkFlowNotice workFlowNotice = new WorkFlowNotice(); + workFlowNotice.setStatus(Boolean.FALSE); + workFlowNotice.setFlowType(ArgsConst.PERSONNEL_INDICATORS); + workFlowNotice.setUserId(one.getCreatedId()); + workFlowNotice.setTitle("您的指标申报已驳回"); + workFlowNotice.setFlowId(auditRequest.getPersonnelId()); + workFlowNoticeService.save(workFlowNotice); saveAuditLog(auditRequest.getPersonnelId(), loginId, ArgsConst.PERSONNEL_INDICATORS, "领导审批拒绝", auditRequest.getAuditOpinion()); return update ? AjaxResult.ok().msg("领导审批拒绝!") : AjaxResult.fail().msg("领导审批失败!"); } @@ -534,22 +483,6 @@ public class AuditServiceImpl extends BaseService implements Config leadership = configMapper.selectOne(new LambdaQueryWrapper().eq(Config::getParamKey, ConfigCache.SYS_USER_LEADERSHIP)); User byId = userMapper.selectById(audit.getApprover()); 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().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())) { audit.setAuditOrder(ArgsConst.LAST); @@ -562,23 +495,17 @@ public class AuditServiceImpl extends BaseService implements recruitment.setLastInstance(auditRequest.getAuditOpinion()); 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()); return update ? AjaxResult.ok().msg("领导审批成功!") : AjaxResult.fail().msg("领导审批失败!"); } } 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())) { audit.setAuditOrder(ArgsConst.LAST); @@ -591,6 +518,13 @@ public class AuditServiceImpl extends BaseService implements recruitment.setLastInstance(auditRequest.getAuditOpinion()); 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()); return update ? AjaxResult.ok().msg("领导审批拒绝!") : AjaxResult.fail().msg("领导审批失败!"); } diff --git a/src/main/java/com/ydool/staff/service/impl/DirectorsSupervisorsServiceImpl.java b/src/main/java/com/ydool/staff/service/impl/DirectorsSupervisorsServiceImpl.java index 25eaede..7c7fd66 100644 --- a/src/main/java/com/ydool/staff/service/impl/DirectorsSupervisorsServiceImpl.java +++ b/src/main/java/com/ydool/staff/service/impl/DirectorsSupervisorsServiceImpl.java @@ -12,6 +12,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ydool.common.cache.ConfigCache; import com.ydool.common.constant.ArgsConst; 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.DirectorsSupervisorsDto; import com.ydool.staff.entity.*; @@ -59,6 +61,10 @@ public class DirectorsSupervisorsServiceImpl extends BaseService page, DirectorsSupervisorsDto directorsSupervisorsDto) { @@ -86,12 +92,6 @@ public class DirectorsSupervisorsServiceImpl extends BaseService list = new ArrayList<>(); - List attachmentList = directorsSupervisors.getAttachmentDtoList(); - for (AttachmentDto attachment : attachmentList) { - list.add(attachment.getPath()); - } - directorsSupervisors.setCorrelationFile(StringUtils.join(list, ",")); int i = directorsSupervisorsMapper.insert(directorsSupervisors); if (i > 0) { List attachmentDtoList = directorsSupervisors.getAttachmentDtoList(); @@ -101,6 +101,10 @@ public class DirectorsSupervisorsServiceImpl extends BaseService 0 ? AjaxResult.ok().msg("修改成功!") : AjaxResult.fail().msg("修改失败!"); + if (i > 0) { + attachmentMapper.delete(Wrappers.lambdaQuery(Attachment.class).eq(Attachment::getTargetId, directorsSupervisors.getId())); + List attachmentDtoList = directorsSupervisors.getAttachmentDtoList(); + List 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 @@ -133,9 +148,14 @@ public class DirectorsSupervisorsServiceImpl extends BaseService().eq(Config::getParamKey, ConfigCache.SYS_USER_LEADERSHIP)); + User byId = userMapper.selectById(StpUtil.getLoginIdAsString()); List attachmentList = attachmentMapper.selectList(new LambdaQueryWrapper().eq(Attachment::getTargetId, directorsSupervisors.getId()).eq(Attachment::getTargetType, ArgsConst.DIRECTORS)); List attachmentDos = BeanUtil.copyToList(attachmentList, AttachmentDto.class); directorsSupervisors.setAttachmentDtoList(attachmentDos); + if (leadership.getParamValue().equals(byId.getLoginName())) { + directorsSupervisors.setBtn(Boolean.TRUE); + } return AjaxResult.ok().data(directorsSupervisors); } @@ -154,11 +174,12 @@ public class DirectorsSupervisorsServiceImpl extends BaseService 0) { return AjaxResult.fail("当前有未审批的董监申报!"); } String loginId = StpUtil.getLoginIdAsString(); + User user = userMapper.selectById(loginId); DirectorsSupervisors directorsSupervisors = get(id); if (1 == directorsSupervisors.getAuditState()) { return AjaxResult.fail().msg("该数据已送审,请勿重复操作!"); @@ -173,14 +194,6 @@ public class DirectorsSupervisorsServiceImpl extends BaseService().eq(Config::getParamKey, ConfigCache.SYS_USER_PERSONNEL_DIRECTOR)); - // User user1 = userMapper.selectOne(new LambdaQueryWrapper().eq(User::getLoginName, config.getParamValue())); - // audit.setAuditOrder(ArgsConst.WAITING); - // audit.setApprover(user1.getId()); - // audit.setApproverTime(new Date()); - // directorsSupervisors.setFirstId(user1.getUserName()); } else { // 领导 Config config = configMapper.selectOne(new LambdaQueryWrapper().eq(Config::getParamKey, ConfigCache.SYS_USER_LEADERSHIP)); @@ -188,6 +201,13 @@ public class DirectorsSupervisorsServiceImpl extends BaseService().eq(Config::getParamKey, ConfigCache.SYS_USER_PERSONNEL_DIRECTOR)); - // User user1 = userMapper.selectOne(new LambdaQueryWrapper().eq(User::getLoginName, config.getParamValue())); - // audit.setAuditOrder(ArgsConst.WAITING); - // audit.setApprover(user1.getId()); - // audit.setApproverTime(new Date()); - // organization.setFirstId(user1.getUserName()); } else { // 领导 Config config = configMapper.selectOne(new LambdaQueryWrapper().eq(Config::getParamKey, ConfigCache.SYS_USER_LEADERSHIP)); @@ -153,7 +145,7 @@ public class OrganizationServiceImpl extends BaseService 0) { @@ -90,8 +100,13 @@ public class PersonnelIndicatorsServiceImpl extends BaseService().eq(Config::getParamKey, ConfigCache.SYS_USER_LEADERSHIP)); + User byId = userMapper.selectById(StpUtil.getLoginIdAsString()); List personnelIndicators = personnelIndicatorsMapper.selectList(new LambdaQueryWrapper().eq(PersonnelIndicators::getOrganizationId, organization.getId())); PersonnelIndicatorsDto recruitmentRequest = new PersonnelIndicatorsDto(); + if (leadership.getParamValue().equals(byId.getLoginName())) { + recruitmentRequest.setBtn(Boolean.TRUE); + } recruitmentRequest.setOrganization(organization); recruitmentRequest.setPersonnelIndicators(personnelIndicators); return AjaxResult.ok().data(recruitmentRequest); diff --git a/src/main/java/com/ydool/staff/service/impl/RecruitmentServiceImpl.java b/src/main/java/com/ydool/staff/service/impl/RecruitmentServiceImpl.java index 86562d3..f551847 100644 --- a/src/main/java/com/ydool/staff/service/impl/RecruitmentServiceImpl.java +++ b/src/main/java/com/ydool/staff/service/impl/RecruitmentServiceImpl.java @@ -1,5 +1,6 @@ package com.ydool.staff.service.impl; +import cn.dev33.satoken.stp.StpUtil; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; @@ -8,6 +9,7 @@ import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.ydool.common.cache.ConfigCache; import com.ydool.common.constant.ArgsConst; import com.ydool.common.data.dto.AjaxResult; 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.service.IOrganizationService; 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 org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -51,6 +57,10 @@ public class RecruitmentServiceImpl extends BaseService 0) { @@ -76,14 +86,6 @@ public class RecruitmentServiceImpl extends BaseService e.setCompanyId(organization.getId())); saveBatch(recruitments); - // List 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())) { return organizationService.submitRecruitment(organization.getId(), ArgsConst.RECRUITMENT); @@ -111,8 +113,13 @@ public class RecruitmentServiceImpl extends BaseService().eq(Config::getParamKey, ConfigCache.SYS_USER_LEADERSHIP)); + User byId = userMapper.selectById(StpUtil.getLoginIdAsString()); List recruitments = recruitmentMapper.selectList(new LambdaQueryWrapper().eq(Recruitment::getCompanyId, organization.getId())); RecruitmentDto recruitmentRequest = new RecruitmentDto(); + if (leadership.getParamValue().equals(byId.getLoginName())) { + recruitmentRequest.setBtn(Boolean.TRUE); + } recruitmentRequest.setOrganization(organization); recruitmentRequest.setRecruitments(recruitments); return AjaxResult.ok().data(recruitmentRequest);