人事信息查询表
This commit is contained in:
parent
013afd73fc
commit
f4f9c84fba
|
@ -5,6 +5,7 @@ import com.ydool.common.base.BaseController;
|
|||
import com.ydool.common.constant.UrlConstant;
|
||||
import com.ydool.common.data.dto.AjaxResult;
|
||||
import com.ydool.staff.dto.AuditLogDto;
|
||||
import com.ydool.staff.dto.PersonnelStatementDto;
|
||||
import com.ydool.staff.request.AuditRequest;
|
||||
import com.ydool.staff.service.IAuditLogService;
|
||||
import com.ydool.staff.service.IAuditService;
|
||||
|
@ -62,4 +63,12 @@ public class AuditController extends BaseController {
|
|||
}
|
||||
return AjaxResult.fail().msg("审批状态错误");
|
||||
}
|
||||
@GetMapping("perStatement")
|
||||
@ApiOperation(value = "人事信息报表",response = PersonnelStatementDto.class)
|
||||
@ApiImplicitParam(name = "id",value = "企业id")
|
||||
public AjaxResult perStatement(String id) {
|
||||
return auditService.perStatement(id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -60,9 +60,12 @@ public class PersonnelController extends BaseController {
|
|||
|
||||
@GetMapping("getById")
|
||||
@ApiOperation(value = "查询一条",response = PersonnelUpdateDto.class)
|
||||
@ApiImplicitParam(name = "id",value = "id" )
|
||||
public AjaxResult getById(String id){
|
||||
return personnelService.getById(id);
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id",value = "id" ),
|
||||
@ApiImplicitParam(name = "type",value = "类型,修改传update,审批传audit" ),
|
||||
})
|
||||
public AjaxResult getById(String id,String type){
|
||||
return personnelService.getById(id,type);
|
||||
}
|
||||
|
||||
@PostMapping(value = "savePersonnel")
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
package com.ydool.staff.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author msh
|
||||
* @version 1.0
|
||||
* @date 2023/2/20 13:59
|
||||
*/
|
||||
@Data
|
||||
public class PersonnelStatementDto {
|
||||
@ApiModelProperty(value = "主管部门名称")
|
||||
private String competentDeptName;
|
||||
|
||||
@ApiModelProperty(value = "统一社会信用代码")
|
||||
private String socialCreditCode;
|
||||
|
||||
@ApiModelProperty(value = "国有企业名称")
|
||||
private String competent;
|
||||
|
||||
@ApiModelProperty(value = "注册资本")
|
||||
private Integer capital;
|
||||
|
||||
@ApiModelProperty(value = "内设机构数")
|
||||
private Integer mechanismNum;
|
||||
|
||||
@ApiModelProperty(value = "用工计划数")
|
||||
private Integer EmploymentNum;
|
||||
|
||||
@ApiModelProperty(value = "现用工人数")
|
||||
private Integer num;
|
||||
|
||||
@ApiModelProperty(value = "其中:用工计划数")
|
||||
private Integer thereIntoNum;
|
||||
}
|
|
@ -20,5 +20,7 @@ public interface IAuditService {
|
|||
|
||||
Integer saveAuditLog(String personnelId,String approverId,String auditSate);
|
||||
|
||||
AjaxResult perStatement(String id);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.ydool.staff.service;
|
||||
|
||||
import com.ydool.staff.entity.PersonnelMiddle;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 人员修改中间表 服务类
|
||||
|
@ -10,5 +12,6 @@ package com.ydool.staff.service;
|
|||
*/
|
||||
public interface IPersonnelMiddleService {
|
||||
|
||||
Boolean savePer(PersonnelMiddle middle);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.ydool.staff.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ydool.common.data.dto.AjaxResult;
|
||||
import com.ydool.staff.dto.AttachmentDto;
|
||||
import com.ydool.staff.entity.SelectRequest;
|
||||
import com.ydool.staff.request.ChangeRequest;
|
||||
import com.ydool.staff.request.PersonnelDeleteRequest;
|
||||
|
@ -10,6 +11,7 @@ import com.ydool.staff.request.PersonnelUpdateRequest;
|
|||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -26,7 +28,7 @@ public interface IPersonnelService {
|
|||
*/
|
||||
AjaxResult personnelList(Page page , SelectRequest request, String orderBy,String column);
|
||||
|
||||
AjaxResult getById(String id);
|
||||
AjaxResult getById(String id,String type);
|
||||
AjaxResult personnelByExchangeList();
|
||||
|
||||
/**
|
||||
|
@ -65,5 +67,8 @@ public interface IPersonnelService {
|
|||
AjaxResult getEntityParam();
|
||||
|
||||
AjaxResult giveAudit(String id, String type);
|
||||
|
||||
List<AttachmentDto> nameAndPath(String file, String id);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -2,22 +2,27 @@ package com.ydool.staff.service.impl;
|
|||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ydool.common.base.BaseService;
|
||||
import com.ydool.common.cache.ConfigCache;
|
||||
import com.ydool.common.constant.ArgsConst;
|
||||
import com.ydool.common.data.dto.AjaxResult;
|
||||
import com.ydool.staff.dto.PersonnelStatementDto;
|
||||
import com.ydool.staff.entity.Audit;
|
||||
import com.ydool.staff.entity.AuditLog;
|
||||
import com.ydool.staff.entity.CompanyName;
|
||||
import com.ydool.staff.entity.Personnel;
|
||||
import com.ydool.staff.entity.PersonnelMiddle;
|
||||
import com.ydool.staff.mapper.AuditLogMapper;
|
||||
import com.ydool.staff.mapper.AuditMapper;
|
||||
import com.ydool.staff.mapper.CompanyNameMapper;
|
||||
import com.ydool.staff.mapper.PersonnelMapper;
|
||||
import com.ydool.staff.mapper.PersonnelMiddleMapper;
|
||||
import com.ydool.staff.request.AuditRequest;
|
||||
import com.ydool.staff.service.IAuditService;
|
||||
import com.ydool.staff.service.IPersonnelService;
|
||||
import com.ydool.system.entity.Config;
|
||||
import com.ydool.system.entity.User;
|
||||
import com.ydool.system.mapper.ConfigMapper;
|
||||
|
@ -46,6 +51,12 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
|||
@Resource
|
||||
private AuditLogMapper auditLogMapper;
|
||||
|
||||
@Resource
|
||||
private IPersonnelService personnelService;
|
||||
|
||||
@Resource
|
||||
private AuditMapper auditMapper;
|
||||
|
||||
@Resource
|
||||
private PersonnelMapper personnelMapper;
|
||||
@Resource
|
||||
|
@ -97,14 +108,16 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
|||
Personnel personnel = personnelMapper.selectById(auditRequest.getPersonnelId());
|
||||
PersonnelMiddle middle = personnelMiddleMapper.selectOne(new LambdaQueryWrapper<PersonnelMiddle>().eq(PersonnelMiddle::getBeforeId, personnel.getId()).eq(PersonnelMiddle::getState, "1"));
|
||||
System.out.println("middle = " + middle);
|
||||
Personnel personnel1 = personnelMapper.selectById(middle.getAfterId());
|
||||
String id = personnel1.getId();
|
||||
personnel1.setState("2");
|
||||
personnel1.setId(personnel.getId());
|
||||
Personnel personnelOne = personnelMapper.selectById(middle.getAfterId());
|
||||
String id = personnelOne.getId();
|
||||
personnelOne.setState("2");
|
||||
personnelOne.setId(personnel.getId());
|
||||
personnel.setId(id);
|
||||
personnel.setState("0");
|
||||
personnelMapper.updateById(personnel1);
|
||||
middle.setState("0");
|
||||
personnelMapper.updateById(personnelOne);
|
||||
personnelMapper.updateById(personnel);
|
||||
personnelMiddleMapper.updateById(middle);
|
||||
}
|
||||
|
||||
return update ? AjaxResult.ok().msg("审批成功!"):AjaxResult.fail().msg("审批成功!");
|
||||
|
@ -157,5 +170,22 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
|||
return auditLogMapper.insert(auditLog);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult perStatement(String id) {
|
||||
CompanyNameMapper companyNameMapper = SpringUtil.getBean(CompanyNameMapper.class);
|
||||
PersonnelStatementDto statementDto = new PersonnelStatementDto();
|
||||
CompanyName companyName = companyNameMapper.selectById(id);
|
||||
statementDto.setCompetentDeptName("县发展和改革局");
|
||||
statementDto.setSocialCreditCode(companyName.getCreditCode());
|
||||
statementDto.setCompetent(companyName.getCompanyName());
|
||||
statementDto.setCapital(100);
|
||||
statementDto.setMechanismNum(5);
|
||||
statementDto.setEmploymentNum(16);
|
||||
statementDto.setNum(1);
|
||||
statementDto.setThereIntoNum(0);
|
||||
return AjaxResult.ok().data(statementDto);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,8 @@ import org.springframework.stereotype.Service;
|
|||
*/
|
||||
@Service
|
||||
public class PersonnelMiddleServiceImpl extends BaseService<PersonnelMiddleMapper, PersonnelMiddle> implements IPersonnelMiddleService {
|
||||
|
||||
public Boolean savePer(PersonnelMiddle middle){
|
||||
return save(middle);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ import com.ydool.staff.request.PersonnelRequest;
|
|||
import com.ydool.staff.request.PersonnelUpdateRequest;
|
||||
import com.ydool.staff.service.IAttachmentService;
|
||||
import com.ydool.staff.service.IAuditService;
|
||||
import com.ydool.staff.service.IPersonnelMiddleService;
|
||||
import com.ydool.staff.service.IPersonnelService;
|
||||
import com.ydool.system.entity.Config;
|
||||
import com.ydool.system.entity.Dept;
|
||||
|
@ -104,6 +105,8 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
|||
@Resource
|
||||
private ConfigMapper configMapper;
|
||||
@Resource
|
||||
private IPersonnelMiddleService personnelMiddleService;
|
||||
@Resource
|
||||
private PersonnelMiddleMapper personnelMiddleMapper;
|
||||
|
||||
|
||||
|
@ -134,28 +137,36 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
|||
return AjaxResult.ok().data(personnelPage);
|
||||
}
|
||||
|
||||
public AjaxResult getById(String id) {
|
||||
if (StrUtil.isNotBlank(id)) {
|
||||
Personnel personnel = personnelMapper.selectById(id);
|
||||
PersonnelUpdateDto personnelUpdateDto = BeanUtil.copyProperties(personnel, PersonnelUpdateDto.class);
|
||||
List<Audit> list = auditMapper.selectList(new LambdaQueryWrapper<Audit>()
|
||||
.eq(Audit::getPersonnelId, personnel.getId())
|
||||
.eq(Audit::getApprover,StpUtil.getLoginIdAsString()));
|
||||
for (Audit audit : list) {
|
||||
if (ArgsConst.WAITING.equals(audit.getAuditOrder())){
|
||||
personnelUpdateDto.setAuditBtn(true);
|
||||
}
|
||||
}
|
||||
|
||||
personnelUpdateDto.setCardFiles(nameAndPath(personnel.getCardFile(), personnel.getId()));
|
||||
personnelUpdateDto.setEngageFiles(nameAndPath(personnel.getEngageFile(), personnel.getId()));
|
||||
personnelUpdateDto.setEducationFiles(nameAndPath(personnel.getEducationFile(), personnel.getId()));
|
||||
personnelUpdateDto.setJobTitleFiles(nameAndPath(personnel.getJobTitleFile(), personnel.getId()));
|
||||
personnelUpdateDto.setAuditFiles(nameAndPath(personnel.getAuditFile(), personnel.getId()));
|
||||
|
||||
return AjaxResult.ok().data(personnelUpdateDto);
|
||||
public AjaxResult getById(String id,String type) {
|
||||
if (StrUtil.isBlank(id)) {
|
||||
return AjaxResult.fail().msg("id不能为空,查询失败!");
|
||||
}
|
||||
return AjaxResult.fail().msg("查询失败!");
|
||||
Personnel personnel = new Personnel();
|
||||
if (type.equals(ArgsConst.UPDATE)){
|
||||
BeanUtil.copyProperties(personnelMapper.selectById(id),personnel);
|
||||
}else {
|
||||
PersonnelMiddle middle = personnelMiddleMapper.selectOne(new LambdaQueryWrapper<PersonnelMiddle>()
|
||||
.eq(PersonnelMiddle::getBeforeId, id).eq(PersonnelMiddle::getState, "1"));
|
||||
BeanUtil.copyProperties(personnelMapper.selectById(middle.getAfterId()),personnel);
|
||||
}
|
||||
PersonnelUpdateDto personnelUpdateDto = BeanUtil.copyProperties(personnel, PersonnelUpdateDto.class);
|
||||
List<Audit> list = auditMapper.selectList(new LambdaQueryWrapper<Audit>()
|
||||
.eq(Audit::getPersonnelId, personnel.getId())
|
||||
.eq(Audit::getApprover,StpUtil.getLoginIdAsString()));
|
||||
for (Audit audit : list) {
|
||||
if (ArgsConst.WAITING.equals(audit.getAuditOrder())){
|
||||
personnelUpdateDto.setAuditBtn(true);
|
||||
}
|
||||
}
|
||||
personnelUpdateDto.setCardFiles(nameAndPath(personnel.getCardFile(), personnel.getId()));
|
||||
personnelUpdateDto.setEngageFiles(nameAndPath(personnel.getEngageFile(), personnel.getId()));
|
||||
personnelUpdateDto.setEducationFiles(nameAndPath(personnel.getEducationFile(), personnel.getId()));
|
||||
personnelUpdateDto.setJobTitleFiles(nameAndPath(personnel.getJobTitleFile(), personnel.getId()));
|
||||
personnelUpdateDto.setAuditFiles(nameAndPath(personnel.getAuditFile(), personnel.getId()));
|
||||
|
||||
return AjaxResult.ok().data(personnelUpdateDto);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -238,7 +249,7 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
|||
per.setState("1");
|
||||
save(per);
|
||||
middle.setAfterId(per.getId());
|
||||
personnelMiddleMapper.insert(middle);
|
||||
personnelMiddleService.savePer(middle);
|
||||
saveAttachment(cardFile, ArgsConst.CARD_FILE, updateRequest.getId(), ArgsConst.UPDATE);
|
||||
saveAttachment(educationFile, ArgsConst.EDUCATION_FILE, updateRequest.getId(), ArgsConst.UPDATE);
|
||||
saveAttachment(auditFile, ArgsConst.AUDIT_FILE, updateRequest.getId(), ArgsConst.UPDATE);
|
||||
|
@ -287,7 +298,7 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
|||
per.setState("1");
|
||||
save(per);
|
||||
middle.setAfterId(per.getId());
|
||||
personnelMiddleMapper.insert(middle);
|
||||
personnelMiddleService.savePer(middle);
|
||||
saveAttachment(cardFiles, ArgsConst.CARD_FILE, request.getId(), ArgsConst.UPDATE);
|
||||
saveAttachment(jobTitleFiles, ArgsConst.JOBTITLE_FILE, request.getId(), ArgsConst.UPDATE);
|
||||
saveAttachment(engageFiles, ArgsConst.ENGAGE_FILE, request.getId(), ArgsConst.UPDATE);
|
||||
|
|
Loading…
Reference in New Issue