This commit is contained in:
zhuyy 2023-02-10 17:47:33 +08:00
parent 0b36cd1492
commit 0d01a569cd
28 changed files with 479 additions and 85 deletions

View File

@ -39,6 +39,7 @@ public interface UrlConstant {
String ORGANIZATION = API + "/organization";
String PARTY_ORGANIZATION = API + "/party_organization";
String DIRECTORS_SUPERVISORS = API + "/directors_supervisors";
String PERSONNEL_INDICATORS = API + "/personnel_indicators";
String ALTERATION = API + "/alteration";

View File

@ -31,6 +31,12 @@ public class DirectorsSupervisorsController extends BaseController {
return directorsSupervisorsService.selectDirectorsSupervisorsList(new Page<>(getPageNum(), getPageSize()), directorsSupervisorsDto);
}
@GetMapping("/selectDirectorsSupervisorsFile")
@ApiOperation(value = "董监任免申报附件列表")
public AjaxResult selectDirectorsSupervisorsFile(String id){
return directorsSupervisorsService.selectDirectorsSupervisorsFile(new Page<>(getPageNum(), getPageSize()), id);
}
@GetMapping("/selectDirectorsSupervisorsById")
@ApiOperation(value = "董监任免申报详情")
@ApiImplicitParam(name = "id", value = "董监任免id", dataType = "String", required = true)

View File

@ -35,6 +35,7 @@ public class OrganizationController extends BaseController {
/**
* =======================内设机构登记=========================
*
* @return
*/
@ -50,7 +51,7 @@ public class OrganizationController extends BaseController {
@ApiOperationSupport(order = 2)
@ApiOperation(value = "内设机构附件列表")
@ApiImplicitParams({@ApiImplicitParam(name = "id", value = "企业Id")})
public AjaxResult selectOrganizationFileList(String id){
public AjaxResult selectOrganizationFileList(String id) {
return attachmentService.selectOrganizationFileList(id);
}
@ -71,26 +72,36 @@ public class OrganizationController extends BaseController {
/**
* ===========================机构信息============================
*
* @return
*/
@PostMapping("/saveMechanism")
@ApiOperation(value = "机构信息新增")
@GetMapping("/selectCompanyNameByIdMechanismPartyOrganization")
@ApiOperation(value = "企业id查内设机构和党组织信息")
@ApiOperationSupport(order = 6)
public AjaxResult saveMechanism(@RequestBody @Validated MechanismRequest mechanismRequest) {
return mechanismService.saveOrganizationMechanism(mechanismRequest);
@ApiImplicitParams({@ApiImplicitParam(name = "id", value = "企业Id")})
public AjaxResult selectCompanyNameByIdMechanismPartyOrganization(String id) {
return mechanismService.selectCompanyNameByIdMechanismPartyOrganization(id);
}
@PostMapping("/saveMechanismPartyOrganization")
@ApiOperation(value = "机构信息和党组织信息新增")
@ApiOperationSupport(order = 7)
public AjaxResult saveMechanismPartyOrganization(@RequestBody @Validated MechanismRequest mechanismRequest) {
return mechanismService.saveMechanismPartyOrganization(mechanismRequest);
}
/**
* ==========================党组织信息===========================
*
* @return
*/
@PostMapping("/savePartyOrganization")
@ApiOperation(value = "党组织信息新增")
@ApiOperationSupport(order = 7)
public AjaxResult savePartyOrganization(@RequestBody @Validated PartyOrganization partyOrganization) {
return partyOrganizationService.savePartyOrganization(partyOrganization);
}
// @PostMapping("/savePartyOrganization")
// @ApiOperation(value = "党组织信息新增")
// @ApiOperationSupport(order = 7)
// public AjaxResult savePartyOrganization(@RequestBody @Validated PartyOrganization partyOrganization) {
// return partyOrganizationService.savePartyOrganization(partyOrganization);
// }
}

View File

@ -0,0 +1,41 @@
package com.ydool.staff.controller;
import com.ydool.common.base.BaseController;
import com.ydool.common.constant.UrlConstant;
import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.request.PersonnelIndicatorsRequest;
import com.ydool.staff.service.IPersonnelIndicatorsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* @author Zhuyy
* @ClassName PersonnelIndicatorsController
* @Description TODO
* @date 2023/2/10 11:32
* @Version 1.0
*/
@RestController
@RequestMapping(UrlConstant.PERSONNEL_INDICATORS)
@Api(tags = "人员指标申报", value = "人员指标申报")
public class PersonnelIndicatorsController extends BaseController {
@Autowired
IPersonnelIndicatorsService personnelIndicatorsService;
@PostMapping("/savePersonnelIndicators")
@ApiOperation(value = "人员指标申报登记")
public AjaxResult savePersonnelIndicators(@RequestBody @Validated PersonnelIndicatorsRequest personnelIndicatorsRequest) {
return personnelIndicatorsService.savePersonnelIndicators(personnelIndicatorsRequest);
}
@GetMapping("/selectPersonnelIndicatorsById")
@ApiOperation(value = "人员招聘详情")
public AjaxResult selectPersonnelIndicatorsById(String id) {
return personnelIndicatorsService.selectPersonnelIndicatorsById(id);
}
}

View File

@ -1,8 +1,11 @@
package com.ydool.staff.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.common.base.BaseController;
import com.ydool.common.constant.UrlConstant;
import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.request.RecruitmentRequest;
import com.ydool.staff.request.RecruitmentSearch;
import com.ydool.staff.service.ICompanyNameService;
import com.ydool.staff.service.IRecruitmentService;
import io.swagger.annotations.Api;
@ -14,25 +17,25 @@ import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping(UrlConstant.RECRUITMENT)
@Api(tags = "员工登记", value = "员工登记")
public class RecruitmentController {
@Api(tags = "人员招聘登记", value = "人员招聘登记")
public class RecruitmentController extends BaseController {
// @Autowired
// IRecruitmentService recruitmentService;
@Autowired
IRecruitmentService recruitmentService;
// @Autowired
// ICompanyNameService companyNameService;
// @GetMapping("/RecruitmentList")
// @ApiOperation(value = "人员登记列表")
// public AjaxResult recruitmentList() {
// return recruitmentService.recruitmentList();
// }
@GetMapping("/selectRecruitmentList")
@ApiOperation(value = "人员登记列表")
public AjaxResult selectRecruitmentList(@RequestBody RecruitmentSearch recruitmentSearch) {
return recruitmentService.selectRecruitmentList(new Page<>(getPageNum(), getPageSize()), recruitmentSearch);
}
// @PostMapping("/insertRecruitment")
// @ApiOperation(value = "人员登记")
// public AjaxResult insertRecruitment(@RequestBody @Validated RecruitmentRequest recruitmentRequest) {
// return recruitmentService.saveRecruitment(recruitmentRequest);
// }
@PostMapping("/insertRecruitment")
@ApiOperation(value = "人员招聘登记")
public AjaxResult insertRecruitment(@RequestBody @Validated RecruitmentRequest recruitmentRequest) {
return recruitmentService.saveRecruitment(recruitmentRequest);
}
// @DeleteMapping("/deleteRecruitment")
// @ApiOperation(value = "人员删除")
@ -40,11 +43,11 @@ public class RecruitmentController {
// return recruitmentService.deleteRecruitment(id);
// }
// @GetMapping("/selectCompanyNameById")
// @ApiOperation(value = "人员招聘详情")
// public AjaxResult selectCompanyNameById(String id) {
// return companyNameService.selectCompanyNameById(id);
// }
@GetMapping("/selectCompanyNameById")
@ApiOperation(value = "人员招聘登记详情")
public AjaxResult selectCompanyNameById(String id) {
return recruitmentService.selectRecruitmentById(id);
}
// @PostMapping("/recruitmentSaveBatch")
// @ApiOperation(value = "批量人员登记")

View File

@ -0,0 +1,26 @@
package com.ydool.staff.dto;
import com.ydool.staff.entity.CompanyName;
import com.ydool.staff.entity.PersonnelIndicators;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author Zhuyy
* @ClassName PersonnelIndicatorsDto
* @Description TODO
* @date 2023/2/10 11:43
* @Version 1.0
*/
@Data
public class PersonnelIndicatorsDto implements Serializable {
@ApiModelProperty(value = "企业信息")
private CompanyName companyName;
@ApiModelProperty(value = "人员指标申报")
private List<PersonnelIndicators> personnelIndicators;
}

View File

@ -1,17 +1,19 @@
package com.ydool.staff.dto;
import com.ydool.staff.request.RecruitmentRequest;
import com.ydool.staff.entity.CompanyName;
import com.ydool.staff.entity.Recruitment;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.List;
@Data
public class RecruitmentDto implements Serializable {
@NotEmpty(message = "不能为空")
@ApiModelProperty(value = "批量人员登记")
private List<RecruitmentRequest> recruitment;
@ApiModelProperty(value = "企业信息")
private CompanyName companyName;
@ApiModelProperty(value = "人员招聘登记")
private List<Recruitment> recruitments;
}

View File

@ -47,4 +47,6 @@ public class CompanyName extends BaseEntity {
@ApiModelProperty(value = "备注")
private String remarks;
@ApiModelProperty(value = "附件")
private String file;
}

View File

@ -38,6 +38,9 @@ public class DirectorsSupervisors extends BaseEntity {
@NotBlank(message = "企业Id不能为空")
private String organizationId;
@ApiModelProperty(value = "信用代码")
private String creditCode;
@ApiModelProperty(value = "姓名")
@NotBlank(message = "姓名不能为空")
private String username;

View File

@ -26,9 +26,9 @@ public class PartyOrganization extends BaseEntity{
private static final long serialVersionUID = 1L;
// @ApiModelProperty(value = "企业Id")
// @NotBlank(message = "企业Id不能为空")
// private String organizationId;
@ApiModelProperty(value = "企业Id")
@NotBlank(message = "企业Id不能为空")
private String organizationId;
@ApiModelProperty(value = "姓名")
@NotBlank(message = "姓名不能为空")

View File

@ -0,0 +1,44 @@
package com.ydool.staff.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ydool.common.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
* 人员指标申报
* </p>
*
* @author ljq
* @since 2023-02-10
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_lc_personnel_indicators")
@ApiModel(value="PersonnelIndicators对象", description="人员指标申报")
public class PersonnelIndicators extends BaseEntity{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "企业id")
private String organizationId;
@ApiModelProperty(value = "部门")
private String deptId;
@ApiModelProperty(value = "岗位")
private String job;
@ApiModelProperty(value = "指标说明")
private String indexExplain;
@ApiModelProperty(value = "标准指标人数")
private Long standardNumber;
@ApiModelProperty(value = "增加指标人数")
private Long addNumber;
}

View File

@ -0,0 +1,18 @@
package com.ydool.staff.mapper;
import com.ydool.staff.entity.PersonnelIndicators;
import com.github.yulichang.base.MPJBaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* 人员指标申报 Mapper 接口
* </p>
*
* @author ljq
* @since 2023-02-10
*/
@Mapper
public interface PersonnelIndicatorsMapper extends MPJBaseMapper<PersonnelIndicators> {
}

View File

@ -0,0 +1,26 @@
package com.ydool.staff.request;
import com.ydool.staff.entity.Mechanism;
import com.ydool.staff.entity.PartyOrganization;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author Zhuyy
* @ClassName MechanismPartyOrganization
* @Description TODO
* @date 2023/2/10 15:35
* @Version 1.0
*/
@Data
public class MechanismPartyOrganization implements Serializable {
@ApiModelProperty(value = "内设机构信息")
private List<Mechanism> mechanisms;
@ApiModelProperty(value = "党组织信息")
private List<PartyOrganization> partyOrganizations;
}

View File

@ -1,7 +1,9 @@
package com.ydool.staff.request;
import com.ydool.staff.dto.AttachmentDto;
import com.ydool.staff.entity.Attachment;
import com.ydool.staff.entity.Mechanism;
import com.ydool.staff.entity.PartyOrganization;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -13,9 +15,9 @@ import java.util.List;
@Data
public class MechanismRequest implements Serializable {
@ApiModelProperty(value = "企业名称")
@NotBlank(message = "企业名称不能为空")
private String companyName;
@ApiModelProperty(value = "企业id")
@NotBlank(message = "企业id不能为空")
private String companyId;
@ApiModelProperty(value = "信用代码")
private String creditCode;
@ -24,9 +26,13 @@ public class MechanismRequest implements Serializable {
private String remark;
@ApiModelProperty(value = "附件列表")
private List<Attachment> attachments;
private List<AttachmentDto> attachmentsDto;
@ApiModelProperty(value = "机构信息")
@NotEmpty(message = "机构信息不能为空")
private List<Mechanism> mechments;
private List<Mechanism> mechanism;
@ApiModelProperty(value = "党组织信息")
@NotEmpty(message = "党组织信息不能为空")
private List<PartyOrganization> partyOrganizations;
}

View File

@ -17,9 +17,6 @@ import java.util.List;
@Data
public class OrganizationRequest implements Serializable {
// @ApiModelProperty(value = "机构")
// private Organization organization;
@ApiModelProperty(value = "企业Id")
private String companyId;
@ -36,5 +33,5 @@ public class OrganizationRequest implements Serializable {
private List<Mechanism> mechanismList;
@ApiModelProperty(value = "党组织信息")
List<PartyOrganization> partyList;
private List<PartyOrganization> partyList;
}

View File

@ -0,0 +1,27 @@
package com.ydool.staff.request;
import com.ydool.staff.entity.PersonnelIndicators;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* @Author Zhuyy
* @ClassName PersonnelIndicatorsRequest
* @Description TODO
* @date 2023/2/10 11:38
* @Version 1.0
*/
@Data
public class PersonnelIndicatorsRequest implements Serializable {
@ApiModelProperty(value = "企业id")
@NotBlank(message = "企业id不能为空")
private String companyId;
@ApiModelProperty(value = "人员指标申报")
private List<PersonnelIndicators> personnelIndicators;
}

View File

@ -1,31 +1,24 @@
package com.ydool.staff.request;
import com.ydool.staff.dto.RecruitmentDto;
import com.ydool.staff.entity.CompanyName;
import com.ydool.staff.entity.Recruitment;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
@Data
public class RecruitmentRequest implements Serializable {
@ApiModelProperty(value = "企业名称")
@NotBlank(message = "企业名称不能为空")
@ApiModelProperty(value = "企业id")
@NotBlank(message = "企业id不能为空")
private String companyId;
@ApiModelProperty(value = "部门")
@NotBlank(message = "部门不能为空")
private String deptId;
@ApiModelProperty(value = "人员招聘登记")
private List<Recruitment> recruitments;
@ApiModelProperty(value = "岗位职务")
@NotBlank(message = "岗位职务不能为空")
private String position;
@ApiModelProperty(value = "名额")
@NotNull(message = "名额不能为空")
private Integer places;
@ApiModelProperty(value = "条件要求")
private String requirements;
}

View File

@ -0,0 +1,22 @@
package com.ydool.staff.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author Zhuyy
* @ClassName RecruitmentSearch
* @Description TODO
* @date 2023/2/10 13:11
* @Version 1.0
*/
@Data
public class RecruitmentSearch {
@ApiModelProperty(value = "企业名称")
private String companyName;
@ApiModelProperty(value = "审批单号")
private String approvalNumber;
}

View File

@ -3,6 +3,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.DirectorsSupervisorsDto;
import com.ydool.staff.entity.Attachment;
import com.ydool.staff.entity.DirectorsSupervisors;
import com.ydool.system.request.IdsRequest;
@ -25,5 +26,7 @@ public interface IDirectorsSupervisorsService {
AjaxResult deleteDirectorsSupervisors(IdsRequest ids);
AjaxResult selectDirectorsSupervisorsById(String id);
AjaxResult selectDirectorsSupervisorsFile(Page<Attachment> page, String id);
}

View File

@ -1,5 +1,6 @@
package com.ydool.staff.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.entity.Mechanism;
import com.ydool.staff.request.MechanismRequest;
@ -30,6 +31,8 @@ public interface IMechanismService {
*/
AjaxResult deleteMechanism(IdsRequest id);
AjaxResult saveOrganizationMechanism(MechanismRequest mechanismRequest);
AjaxResult saveMechanismPartyOrganization(MechanismRequest mechanismRequest);
AjaxResult selectCompanyNameByIdMechanismPartyOrganization(String id);
}

View File

@ -24,5 +24,7 @@ public interface IOrganizationService {
AjaxResult selectOrganizationByName(String companyName);
AjaxResult selectOrganization();
AjaxResult selectCompanyNameByOrganization(Page<Organization> page, String id);
}

View File

@ -0,0 +1,20 @@
package com.ydool.staff.service;
import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.request.PersonnelIndicatorsRequest;
/**
* <p>
* 人员指标申报 服务类
* </p>
*
* @author ljq
* @since 2023-02-10
*/
public interface IPersonnelIndicatorsService {
AjaxResult savePersonnelIndicators(PersonnelIndicatorsRequest personnelIndicatorsRequest);
AjaxResult selectPersonnelIndicatorsById(String id);
}

View File

@ -1,7 +1,10 @@
package com.ydool.staff.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.entity.Recruitment;
import com.ydool.staff.request.RecruitmentRequest;
import com.ydool.staff.request.RecruitmentSearch;
import java.util.List;
@ -11,7 +14,7 @@ public interface IRecruitmentService {
* 人员列表
* @return
*/
AjaxResult recruitmentList();
AjaxResult selectRecruitmentList(Page<Recruitment> page, RecruitmentSearch recruitmentSearch);
/**
* 新增人员

View File

@ -11,9 +11,11 @@ import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.dto.AttachmentDto;
import com.ydool.staff.dto.DirectorsSupervisorsDto;
import com.ydool.staff.entity.Attachment;
import com.ydool.staff.entity.CompanyName;
import com.ydool.staff.entity.DirectorsSupervisors;
import com.ydool.common.base.BaseService;
import com.ydool.staff.mapper.AttachmentMapper;
import com.ydool.staff.mapper.CompanyNameMapper;
import com.ydool.staff.mapper.DirectorsSupervisorsMapper;
import com.ydool.staff.service.IDirectorsSupervisorsService;
import com.ydool.system.request.IdsRequest;
@ -42,17 +44,22 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
DirectorsSupervisorsMapper directorsSupervisorsMapper;
@Autowired
AttachmentMapper attachmentMapper;
@Autowired
CompanyNameMapper companyNameMapper;
@Override
public AjaxResult selectDirectorsSupervisorsList(Page<DirectorsSupervisors> page, DirectorsSupervisorsDto directorsSupervisorsDto) {
LambdaQueryWrapper<DirectorsSupervisors> directorsSupervisorsLambdaQueryWrapper = new LambdaQueryWrapper<>();
directorsSupervisorsLambdaQueryWrapper.exists(StrUtil.isNotBlank(directorsSupervisorsDto.getCompanyName()), "select t2.id from t_lc_company_name t2 where t_lc_directors_supervisors.organization_id = t2.id and t2.company_name like '%" + directorsSupervisorsDto.getCompanyName() + "%'");
directorsSupervisorsLambdaQueryWrapper.eq(StrUtil.isNotBlank(directorsSupervisorsDto.getUsername()), DirectorsSupervisors::getUsername, directorsSupervisorsDto.getUsername());
directorsSupervisorsLambdaQueryWrapper.like(StrUtil.isNotBlank(directorsSupervisorsDto.getUsername()), DirectorsSupervisors::getUsername, directorsSupervisorsDto.getUsername());
directorsSupervisorsLambdaQueryWrapper.eq(StrUtil.isNotBlank(directorsSupervisorsDto.getDirectorsType()), DirectorsSupervisors::getDirectorsType, directorsSupervisorsDto.getDirectorsType());
directorsSupervisorsLambdaQueryWrapper.eq(StrUtil.isNotBlank(directorsSupervisorsDto.getPersonnelType()), DirectorsSupervisors::getPersonnelType, directorsSupervisorsDto.getPersonnelType());
directorsSupervisorsLambdaQueryWrapper.eq(StrUtil.isNotBlank(directorsSupervisorsDto.getPoliticsStatus()), DirectorsSupervisors::getPoliticsStatus, directorsSupervisorsDto.getPoliticsStatus());
directorsSupervisorsLambdaQueryWrapper.eq(StrUtil.isNotBlank(directorsSupervisorsDto.getPersonnelStatus()), DirectorsSupervisors::getPersonnelStatus, directorsSupervisorsDto.getPersonnelStatus());
Page<DirectorsSupervisors> directorsSupervisors = directorsSupervisorsMapper.selectPage(page, directorsSupervisorsLambdaQueryWrapper);
for (DirectorsSupervisors record : directorsSupervisors.getRecords()) {
record.setOrganizationId(companyNameMapper.selectById(record.getOrganizationId()).getCompanyName());
}
return AjaxResult.ok().data(directorsSupervisors);
}
@ -109,5 +116,11 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
directorsSupervisors.setAttachmentDtoList(attachmentDtos);
return AjaxResult.ok().data(directorsSupervisors);
}
@Override
public AjaxResult selectDirectorsSupervisorsFile(Page<Attachment> page, String id) {
Page<Attachment> attachmentPage = attachmentMapper.selectPage(page, new LambdaQueryWrapper<Attachment>().eq(Attachment::getTargetId, id).eq(Attachment::getTargetType, ArgsConst.DIRECTORS));
return AjaxResult.ok().data(attachmentPage);
}
}

View File

@ -3,16 +3,23 @@ package com.ydool.staff.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
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.constant.ArgsConst;
import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.dto.AttachmentDto;
import com.ydool.staff.entity.Attachment;
import com.ydool.staff.entity.Mechanism;
import com.ydool.common.base.BaseService;
import com.ydool.staff.entity.Organization;
import com.ydool.staff.entity.PartyOrganization;
import com.ydool.staff.mapper.AttachmentMapper;
import com.ydool.staff.mapper.MechanismMapper;
import com.ydool.staff.mapper.OrganizationMapper;
import com.ydool.staff.mapper.PartyOrganizationMapper;
import com.ydool.staff.request.AttachmentRequest;
import com.ydool.staff.request.MechanismPartyOrganization;
import com.ydool.staff.request.MechanismRequest;
import com.ydool.staff.request.OrganizationRequest;
import com.ydool.staff.service.IMechanismService;
@ -43,6 +50,8 @@ public class MechanismServiceImpl extends BaseService<MechanismMapper, Mechanism
OrganizationMapper organizationMapper;
@Autowired
AttachmentMapper attachmentMapper;
@Autowired
PartyOrganizationMapper partyOrganizationMapper;
@Override
@Transactional(rollbackFor = Exception.class)
@ -64,35 +73,64 @@ public class MechanismServiceImpl extends BaseService<MechanismMapper, Mechanism
@Override
@Transactional(rollbackFor = Exception.class)
public AjaxResult saveOrganizationMechanism(MechanismRequest mechanismRequest) {
public AjaxResult saveMechanismPartyOrganization(MechanismRequest mechanismRequest) {
Organization organization = new Organization();
List<String> list = new ArrayList<>();
List<Attachment> attachmentList = mechanismRequest.getAttachments();
for (Attachment attachment : attachmentList) {
List<AttachmentDto> attachmentList = mechanismRequest.getAttachmentsDto();
for (AttachmentDto attachment : attachmentList) {
list.add(attachment.getPath());
}
organization.setAttachment(StringUtils.join(list,","));
organization.setAttachment(StringUtils.join(list, ","));
organization.setCreditCode(mechanismRequest.getCreditCode());
organization.setCompanyId(mechanismRequest.getCompanyName());
organization.setCompanyId(mechanismRequest.getCompanyId());
organization.setRemark(mechanismRequest.getRemark());
int i = organizationMapper.insert(organization);
if (i > 0) {
List<Attachment> attachments = mechanismRequest.getAttachments();
for (Attachment attachment : attachments) {
List<AttachmentDto> attachments = mechanismRequest.getAttachmentsDto();
List<Attachment> copyToList = BeanUtil.copyToList(attachments, Attachment.class);
for (Attachment attachment : copyToList) {
attachment.setTargetId(organization.getId());
attachment.setTargetType(ArgsConst.ORGANIZATION);
attachment.setSize(attachment.getSize());
attachment.setSuffix(attachment.getSuffix());
attachmentMapper.insert(attachment);
}
List<Mechanism> mechments = mechanismRequest.getMechments();
// 机构信息
List<Mechanism> mechments = mechanismRequest.getMechanism();
for (Mechanism mechment : mechments) {
int mechanism = mechanismMapper.selectCount(new LambdaQueryWrapper<Mechanism>().eq(Mechanism::getOrganizationId, organization.getId()).eq(Mechanism::getId, mechment.getId()));
if (mechanism == 0) {
mechment.setOrganizationId(organization.getId());
mechanismMapper.insert(mechment);
} else {
mechanismMapper.delete(new LambdaQueryWrapper<Mechanism>().eq(Mechanism::getOrganizationId, organization.getId()));
}
boolean batch = saveBatch(mechments);
return batch ? AjaxResult.ok().msg("新增成功!") : AjaxResult.fail().msg("新增失败!");
}
// 党组织信息
List<PartyOrganization> partyOrganizations = mechanismRequest.getPartyOrganizations();
for (PartyOrganization partyOrganization : partyOrganizations) {
int party = partyOrganizationMapper.selectCount(new LambdaQueryWrapper<PartyOrganization>().eq(PartyOrganization::getOrganizationId, organization.getId()).eq(PartyOrganization::getId, partyOrganization.getId()));
if (party == 0) {
partyOrganization.setOrganizationId(organization.getId());
partyOrganizationMapper.insert(partyOrganization);
} else {
partyOrganizationMapper.delete(new LambdaQueryWrapper<PartyOrganization>().eq(PartyOrganization::getOrganizationId, organization.getId()));
}
}
return AjaxResult.ok().msg("新增成功!");
}
return AjaxResult.fail().msg("新增失败!");
}
@Override
public AjaxResult selectCompanyNameByIdMechanismPartyOrganization(String id) {
if (StrUtil.isBlank(id)) {
return AjaxResult.fail().msg("企业id不能为空");
}
MechanismPartyOrganization mechanismPartyOrganization = new MechanismPartyOrganization();
List<Mechanism> mechanism = mechanismMapper.selectList(new LambdaQueryWrapper<Mechanism>().eq(Mechanism::getOrganizationId, id));
List<PartyOrganization> partyOrganizations = partyOrganizationMapper.selectList(new LambdaQueryWrapper<PartyOrganization>().eq(PartyOrganization::getOrganizationId, id));
mechanismPartyOrganization.setMechanisms(mechanism);
mechanismPartyOrganization.setPartyOrganizations(partyOrganizations);
return AjaxResult.ok().data(mechanismPartyOrganization);
}
}

View File

@ -70,7 +70,7 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
} else {
List<Mechanism> mechanismList = mechanismMapper.selectList(new LambdaQueryWrapper<Mechanism>().eq(Mechanism::getOrganizationId, organization.getId()));
List<Attachment> attachmentList = attachmentMapper.selectList(new LambdaQueryWrapper<Attachment>().eq(Attachment::getTargetId, organization.getId()).eq(Attachment::getTargetType, ArgsConst.ORGANIZATION));
List<PartyOrganization> partyOrganizationList = partyOrganizationMapper.selectList(new LambdaQueryWrapper<PartyOrganization>());
List<PartyOrganization> partyOrganizationList = partyOrganizationMapper.selectList(new LambdaQueryWrapper<PartyOrganization>().eq(PartyOrganization::getOrganizationId, organization.getId()));
List<AttachmentDto> toList = BeanUtil.copyToList(attachmentList, AttachmentDto.class);
OrganizationRequest organizationRequest = new OrganizationRequest();
organizationRequest.setRemark(organization.getRemark());
@ -104,5 +104,11 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
public AjaxResult selectOrganization() {
return AjaxResult.ok().data(organizationMapper.selectList(null));
}
@Override
public AjaxResult selectCompanyNameByOrganization(Page<Organization> page, String id) {
Page<Organization> organizationPage = organizationMapper.selectPage(page, new LambdaQueryWrapper<Organization>().eq(Organization::getCompanyId, id));
return AjaxResult.ok().data(organizationPage);
}
}

View File

@ -0,0 +1,58 @@
package com.ydool.staff.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.dto.PersonnelIndicatorsDto;
import com.ydool.staff.entity.CompanyName;
import com.ydool.staff.entity.PersonnelIndicators;
import com.ydool.common.base.BaseService;
import com.ydool.staff.mapper.CompanyNameMapper;
import com.ydool.staff.mapper.PersonnelIndicatorsMapper;
import com.ydool.staff.request.PersonnelIndicatorsRequest;
import com.ydool.staff.service.IPersonnelIndicatorsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 人员指标申报 服务类
* </p>
*
* @author ljq
* @since 2023-02-10
*/
@Service
public class PersonnelIndicatorsServiceImpl extends BaseService<PersonnelIndicatorsMapper, PersonnelIndicators> implements IPersonnelIndicatorsService {
@Autowired
PersonnelIndicatorsMapper personnelIndicatorsMapper;
@Autowired
CompanyNameMapper companyNameMapper;
@Override
public AjaxResult savePersonnelIndicators(PersonnelIndicatorsRequest personnelIndicatorsRequest) {
List<PersonnelIndicators> personnelIndicators = personnelIndicatorsRequest.getPersonnelIndicators();
for (PersonnelIndicators personnelIndicator : personnelIndicators) {
personnelIndicator.setOrganizationId(personnelIndicatorsRequest.getCompanyId());
}
return saveBatch(personnelIndicators) ? AjaxResult.ok().msg("添加成功!") : AjaxResult.fail().msg("添加失败!");
}
@Override
public AjaxResult selectPersonnelIndicatorsById(String id) {
PersonnelIndicators recruitment = personnelIndicatorsMapper.selectById(id);
if (ObjectUtil.isNull(recruitment)) {
return AjaxResult.fail().msg("未找到相关信息!");
}
CompanyName companyName = companyNameMapper.selectById(recruitment.getOrganizationId());
List<PersonnelIndicators> recruitments = personnelIndicatorsMapper.selectList(new LambdaQueryWrapper<PersonnelIndicators>().eq(PersonnelIndicators::getOrganizationId, companyName.getId()));
PersonnelIndicatorsDto recruitmentRequest = new PersonnelIndicatorsDto();
recruitmentRequest.setCompanyName(companyName);
recruitmentRequest.setPersonnelIndicators(recruitments);
return AjaxResult.ok().data(recruitmentRequest);
}
}

View File

@ -2,12 +2,18 @@ package com.ydool.staff.service.impl;
import cn.hutool.core.bean.BeanUtil;
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.data.dto.AjaxResult;
import com.ydool.staff.dto.RecruitmentDto;
import com.ydool.staff.entity.CompanyName;
import com.ydool.staff.entity.Recruitment;
import com.ydool.common.base.BaseService;
import com.ydool.staff.mapper.CompanyNameMapper;
import com.ydool.staff.mapper.RecruitmentMapper;
import com.ydool.staff.request.RecruitmentRequest;
import com.ydool.staff.request.RecruitmentSearch;
import com.ydool.staff.service.IRecruitmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -32,16 +38,21 @@ public class RecruitmentServiceImpl extends BaseService<RecruitmentMapper, Recru
CompanyNameMapper companyNameMapper;
@Override
public AjaxResult recruitmentList() {
return AjaxResult.ok().data(recruitmentMapper.recruitmentList());
public AjaxResult selectRecruitmentList(Page<Recruitment> page, RecruitmentSearch recruitmentSearch) {
LambdaQueryWrapper<Recruitment> recruitmentLambdaQueryWrapper = new LambdaQueryWrapper<>();
// recruitmentLambdaQueryWrapper.exists(StrUtil.isNotBlank(recruitmentSearch.getCompanyName()), "");
Page<Recruitment> recruitmentPage = recruitmentMapper.selectPage(page, recruitmentLambdaQueryWrapper);
return AjaxResult.ok().data(recruitmentPage);
}
@Override
@Transactional(rollbackFor = Exception.class)
public AjaxResult saveRecruitment(RecruitmentRequest recruitmentRequest) {
Recruitment recruitment = BeanUtil.copyProperties(recruitmentRequest, Recruitment.class);
int i = recruitmentMapper.insert(recruitment);
return i > 0 ? AjaxResult.ok().msg("添加成功!") : AjaxResult.fail().msg("添加失败!");
List<Recruitment> recruitments = recruitmentRequest.getRecruitments();
for (Recruitment recruitment : recruitments) {
recruitment.setCompanyId(recruitment.getCompanyId());
}
return saveBatch(recruitments) ? AjaxResult.ok().msg("添加成功!") : AjaxResult.fail().msg("添加失败!");
}
@Override
@ -58,7 +69,16 @@ public class RecruitmentServiceImpl extends BaseService<RecruitmentMapper, Recru
@Override
public AjaxResult selectRecruitmentById(String id) {
return AjaxResult.ok().data(recruitmentMapper.selectById(id));
Recruitment recruitment = recruitmentMapper.selectById(id);
if (ObjectUtil.isNull(recruitment)) {
return AjaxResult.fail().msg("未找到相关信息!");
}
CompanyName companyName = companyNameMapper.selectById(recruitment.getCompanyId());
List<Recruitment> recruitments = recruitmentMapper.selectList(new LambdaQueryWrapper<Recruitment>().eq(Recruitment::getCompanyId, companyName.getId()));
RecruitmentDto recruitmentRequest = new RecruitmentDto();
recruitmentRequest.setCompanyName(companyName);
recruitmentRequest.setRecruitments(recruitments);
return AjaxResult.ok().data(recruitmentRequest);
}
@Override