update
This commit is contained in:
parent
8bbd3177c6
commit
66ce0bda91
|
@ -3,6 +3,7 @@ package com.ydool.staff.controller;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
import com.ydool.common.base.BaseController;
|
||||
import com.ydool.common.constant.ArgsConst;
|
||||
import com.ydool.common.constant.UrlConstant;
|
||||
import com.ydool.common.data.dto.AjaxResult;
|
||||
import com.ydool.staff.dto.DirectorsSupervisorsDto;
|
||||
|
@ -63,4 +64,11 @@ public class DirectorsSupervisorsController extends BaseController {
|
|||
public AjaxResult deleteDirectorsSupervisors(@RequestBody IdsRequest 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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,5 +28,7 @@ public interface IDirectorsSupervisorsService {
|
|||
AjaxResult selectDirectorsSupervisorsById(String id);
|
||||
|
||||
AjaxResult selectDirectorsSupervisorsFile(Page<Attachment> page, String id);
|
||||
|
||||
AjaxResult submitDirectorsSupervisors(String id, String directors);
|
||||
}
|
||||
|
||||
|
|
|
@ -205,7 +205,7 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
|||
one.setAuditState(ArgsConst.PASS);
|
||||
boolean update = updateById(one);
|
||||
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);
|
||||
updateById(one1);
|
||||
recruitment.setFirstTrial(auditRequest.getAuditOpinion());
|
||||
|
|
|
@ -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.CollectionUtil;
|
||||
import cn.hutool.core.util.IdcardUtil;
|
||||
|
@ -7,6 +8,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.staff.dto.AttachmentDto;
|
||||
|
@ -20,7 +22,12 @@ import com.ydool.staff.mapper.AttachmentMapper;
|
|||
import com.ydool.staff.mapper.AuditMapper;
|
||||
import com.ydool.staff.mapper.CompanyNameMapper;
|
||||
import com.ydool.staff.mapper.DirectorsSupervisorsMapper;
|
||||
import com.ydool.staff.service.IAuditService;
|
||||
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 org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -30,6 +37,7 @@ import org.thymeleaf.util.StringUtils;
|
|||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -51,6 +59,12 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
|
|||
CompanyNameMapper companyNameMapper;
|
||||
@Autowired
|
||||
AuditMapper auditMapper;
|
||||
@Autowired
|
||||
IAuditService auditService;
|
||||
@Autowired
|
||||
UserMapper userMapper;
|
||||
@Autowired
|
||||
ConfigMapper configMapper;
|
||||
|
||||
@Override
|
||||
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));
|
||||
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("送审失败!");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue