This commit is contained in:
zhuyy 2023-02-21 16:21:45 +08:00
parent 8bbd3177c6
commit 66ce0bda91
4 changed files with 60 additions and 1 deletions

View File

@ -3,6 +3,7 @@ package com.ydool.staff.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiSupport; import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.ydool.common.base.BaseController; import com.ydool.common.base.BaseController;
import com.ydool.common.constant.ArgsConst;
import com.ydool.common.constant.UrlConstant; import com.ydool.common.constant.UrlConstant;
import com.ydool.common.data.dto.AjaxResult; import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.dto.DirectorsSupervisorsDto; import com.ydool.staff.dto.DirectorsSupervisorsDto;
@ -63,4 +64,11 @@ public class DirectorsSupervisorsController extends BaseController {
public AjaxResult deleteDirectorsSupervisors(@RequestBody IdsRequest ids) { public AjaxResult deleteDirectorsSupervisors(@RequestBody IdsRequest ids) {
return directorsSupervisorsService.deleteDirectorsSupervisors(ids); return directorsSupervisorsService.deleteDirectorsSupervisors(ids);
} }
@GetMapping("/submitDirectorsSupervisors")
@ApiOperation(value = "董监任免申报送审")
@ApiImplicitParams({@ApiImplicitParam(value = "董监id", name = "id")})
public AjaxResult submitDirectorsSupervisors(String id) {
return directorsSupervisorsService.submitDirectorsSupervisors(id, ArgsConst.DIRECTORS);
}
} }

View File

@ -28,5 +28,7 @@ public interface IDirectorsSupervisorsService {
AjaxResult selectDirectorsSupervisorsById(String id); AjaxResult selectDirectorsSupervisorsById(String id);
AjaxResult selectDirectorsSupervisorsFile(Page<Attachment> page, String id); AjaxResult selectDirectorsSupervisorsFile(Page<Attachment> page, String id);
AjaxResult submitDirectorsSupervisors(String id, String directors);
} }

View File

@ -205,7 +205,7 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
one.setAuditState(ArgsConst.PASS); one.setAuditState(ArgsConst.PASS);
boolean update = updateById(one); boolean update = updateById(one);
if (update) { if (update) {
Audit one1 = getOne(new LambdaQueryWrapper<Audit>().eq(Audit::getPersonnelId, auditRequest.getPersonnelId()).eq(Audit::getApprover, loginId).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()); recruitment.setFirstTrial(auditRequest.getAuditOpinion());

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.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.IdcardUtil; import cn.hutool.core.util.IdcardUtil;
@ -7,6 +8,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.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.common.cache.ConfigCache;
import com.ydool.common.constant.ArgsConst; import com.ydool.common.constant.ArgsConst;
import com.ydool.common.data.dto.AjaxResult; import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.dto.AttachmentDto; import com.ydool.staff.dto.AttachmentDto;
@ -20,7 +22,12 @@ import com.ydool.staff.mapper.AttachmentMapper;
import com.ydool.staff.mapper.AuditMapper; import com.ydool.staff.mapper.AuditMapper;
import com.ydool.staff.mapper.CompanyNameMapper; import com.ydool.staff.mapper.CompanyNameMapper;
import com.ydool.staff.mapper.DirectorsSupervisorsMapper; import com.ydool.staff.mapper.DirectorsSupervisorsMapper;
import com.ydool.staff.service.IAuditService;
import com.ydool.staff.service.IDirectorsSupervisorsService; import com.ydool.staff.service.IDirectorsSupervisorsService;
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;
@ -30,6 +37,7 @@ import org.thymeleaf.util.StringUtils;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@ -51,6 +59,12 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
CompanyNameMapper companyNameMapper; CompanyNameMapper companyNameMapper;
@Autowired @Autowired
AuditMapper auditMapper; AuditMapper auditMapper;
@Autowired
IAuditService auditService;
@Autowired
UserMapper userMapper;
@Autowired
ConfigMapper configMapper;
@Override @Override
public AjaxResult selectDirectorsSupervisorsList(Page<DirectorsSupervisors> page, DirectorsSupervisorsDto directorsSupervisorsDto) { public AjaxResult selectDirectorsSupervisorsList(Page<DirectorsSupervisors> page, DirectorsSupervisorsDto directorsSupervisorsDto) {
@ -133,5 +147,40 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
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));
return AjaxResult.ok().data(attachmentPage); return AjaxResult.ok().data(attachmentPage);
} }
@Override
public AjaxResult submitDirectorsSupervisors(String id, String type) {
String loginId = StpUtil.getLoginIdAsString();
DirectorsSupervisors directorsSupervisors = get(id);
if (1 == directorsSupervisors.getAuditState()) {
return AjaxResult.fail().msg("该数据已送审,请勿重复操作!");
}
for (int i = 0; i <= 2; i++) {
Audit audit = new Audit();
audit.setPersonnelId(id);
audit.setPerType(type);
if (i == 0) {
audit.setAuditState(ArgsConst.SUBMIT);
audit.setAuditOrder(ArgsConst.GIVE_AUDIT);
audit.setApprover(loginId);
audit.setApproverTime(new Date());
} else if (i == 1) {
Config config = configMapper.selectOne(new LambdaQueryWrapper<Config>().eq(Config::getParamKey, ConfigCache.SYS_USER_PERSONNEL_DIRECTOR));
audit.setAuditOrder(ArgsConst.WAITING);
audit.setApprover(userMapper.selectOne(new LambdaQueryWrapper<User>().eq(User::getLoginName, config.getParamValue())).getId());
audit.setApproverTime(new Date());
} else if (i == 2) {
Config config = configMapper.selectOne(new LambdaQueryWrapper<Config>().eq(Config::getParamKey, ConfigCache.SYS_USER_LEADERSHIP));
audit.setAuditOrder(ArgsConst.LAST);
audit.setApprover(userMapper.selectOne(new LambdaQueryWrapper<User>().eq(User::getLoginName, config.getParamValue())).getId());
audit.setApproverTime(new Date());
}
auditMapper.insert(audit);
}
directorsSupervisors.setAuditState(1);
updateById(directorsSupervisors);
Integer a = auditService.saveAuditLog(id, loginId, "送审");
return a > 0 ? AjaxResult.ok().msg("送审成功!") : AjaxResult.fail().msg("送审失败!");
}
} }