diff --git a/src/main/java/com/ydool/common/constant/UrlConstant.java b/src/main/java/com/ydool/common/constant/UrlConstant.java index 00b4221..fc6cf69 100644 --- a/src/main/java/com/ydool/common/constant/UrlConstant.java +++ b/src/main/java/com/ydool/common/constant/UrlConstant.java @@ -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"; diff --git a/src/main/java/com/ydool/staff/controller/DirectorsSupervisorsController.java b/src/main/java/com/ydool/staff/controller/DirectorsSupervisorsController.java index 54a0609..7b44483 100644 --- a/src/main/java/com/ydool/staff/controller/DirectorsSupervisorsController.java +++ b/src/main/java/com/ydool/staff/controller/DirectorsSupervisorsController.java @@ -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) diff --git a/src/main/java/com/ydool/staff/controller/OrganizationController.java b/src/main/java/com/ydool/staff/controller/OrganizationController.java index 40b3277..c89d1f4 100644 --- a/src/main/java/com/ydool/staff/controller/OrganizationController.java +++ b/src/main/java/com/ydool/staff/controller/OrganizationController.java @@ -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); + // } } diff --git a/src/main/java/com/ydool/staff/controller/PersonnelIndicatorsController.java b/src/main/java/com/ydool/staff/controller/PersonnelIndicatorsController.java new file mode 100644 index 0000000..a342855 --- /dev/null +++ b/src/main/java/com/ydool/staff/controller/PersonnelIndicatorsController.java @@ -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); + } +} diff --git a/src/main/java/com/ydool/staff/controller/RecruitmentController.java b/src/main/java/com/ydool/staff/controller/RecruitmentController.java index 390ab66..da52d6a 100644 --- a/src/main/java/com/ydool/staff/controller/RecruitmentController.java +++ b/src/main/java/com/ydool/staff/controller/RecruitmentController.java @@ -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 = "批量人员登记") diff --git a/src/main/java/com/ydool/staff/dto/PersonnelIndicatorsDto.java b/src/main/java/com/ydool/staff/dto/PersonnelIndicatorsDto.java new file mode 100644 index 0000000..407799e --- /dev/null +++ b/src/main/java/com/ydool/staff/dto/PersonnelIndicatorsDto.java @@ -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; +} diff --git a/src/main/java/com/ydool/staff/dto/RecruitmentDto.java b/src/main/java/com/ydool/staff/dto/RecruitmentDto.java index 69dbd2d..4260dad 100644 --- a/src/main/java/com/ydool/staff/dto/RecruitmentDto.java +++ b/src/main/java/com/ydool/staff/dto/RecruitmentDto.java @@ -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 recruitment; + @ApiModelProperty(value = "企业信息") + private CompanyName companyName; + + @ApiModelProperty(value = "人员招聘登记") + private List recruitments; } diff --git a/src/main/java/com/ydool/staff/entity/CompanyName.java b/src/main/java/com/ydool/staff/entity/CompanyName.java index 698dafb..fe63e69 100644 --- a/src/main/java/com/ydool/staff/entity/CompanyName.java +++ b/src/main/java/com/ydool/staff/entity/CompanyName.java @@ -47,4 +47,6 @@ public class CompanyName extends BaseEntity { @ApiModelProperty(value = "备注") private String remarks; + @ApiModelProperty(value = "附件") + private String file; } diff --git a/src/main/java/com/ydool/staff/entity/DirectorsSupervisors.java b/src/main/java/com/ydool/staff/entity/DirectorsSupervisors.java index cde4f27..8aef445 100644 --- a/src/main/java/com/ydool/staff/entity/DirectorsSupervisors.java +++ b/src/main/java/com/ydool/staff/entity/DirectorsSupervisors.java @@ -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; diff --git a/src/main/java/com/ydool/staff/entity/PartyOrganization.java b/src/main/java/com/ydool/staff/entity/PartyOrganization.java index b2e9b5a..ce2d7d3 100644 --- a/src/main/java/com/ydool/staff/entity/PartyOrganization.java +++ b/src/main/java/com/ydool/staff/entity/PartyOrganization.java @@ -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 = "姓名不能为空") diff --git a/src/main/java/com/ydool/staff/entity/PersonnelIndicators.java b/src/main/java/com/ydool/staff/entity/PersonnelIndicators.java new file mode 100644 index 0000000..a5c8b3f --- /dev/null +++ b/src/main/java/com/ydool/staff/entity/PersonnelIndicators.java @@ -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; +/** + *

+ * 人员指标申报 + *

+ * + * @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; + +} diff --git a/src/main/java/com/ydool/staff/mapper/PersonnelIndicatorsMapper.java b/src/main/java/com/ydool/staff/mapper/PersonnelIndicatorsMapper.java new file mode 100644 index 0000000..dae282d --- /dev/null +++ b/src/main/java/com/ydool/staff/mapper/PersonnelIndicatorsMapper.java @@ -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; + +/** + *

+ * 人员指标申报 Mapper 接口 + *

+ * + * @author ljq + * @since 2023-02-10 + */ +@Mapper +public interface PersonnelIndicatorsMapper extends MPJBaseMapper { + +} diff --git a/src/main/java/com/ydool/staff/request/MechanismPartyOrganization.java b/src/main/java/com/ydool/staff/request/MechanismPartyOrganization.java new file mode 100644 index 0000000..ec0969b --- /dev/null +++ b/src/main/java/com/ydool/staff/request/MechanismPartyOrganization.java @@ -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 mechanisms; + + @ApiModelProperty(value = "党组织信息") + private List partyOrganizations; +} diff --git a/src/main/java/com/ydool/staff/request/MechanismRequest.java b/src/main/java/com/ydool/staff/request/MechanismRequest.java index 4615a28..f3c05f7 100644 --- a/src/main/java/com/ydool/staff/request/MechanismRequest.java +++ b/src/main/java/com/ydool/staff/request/MechanismRequest.java @@ -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 attachments; + private List attachmentsDto; @ApiModelProperty(value = "机构信息") @NotEmpty(message = "机构信息不能为空") - private List mechments; + private List mechanism; + + @ApiModelProperty(value = "党组织信息") + @NotEmpty(message = "党组织信息不能为空") + private List partyOrganizations; } diff --git a/src/main/java/com/ydool/staff/request/OrganizationRequest.java b/src/main/java/com/ydool/staff/request/OrganizationRequest.java index a1c0f12..7923886 100644 --- a/src/main/java/com/ydool/staff/request/OrganizationRequest.java +++ b/src/main/java/com/ydool/staff/request/OrganizationRequest.java @@ -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 mechanismList; @ApiModelProperty(value = "党组织信息") - List partyList; + private List partyList; } diff --git a/src/main/java/com/ydool/staff/request/PersonnelIndicatorsRequest.java b/src/main/java/com/ydool/staff/request/PersonnelIndicatorsRequest.java new file mode 100644 index 0000000..5c976ff --- /dev/null +++ b/src/main/java/com/ydool/staff/request/PersonnelIndicatorsRequest.java @@ -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; +} diff --git a/src/main/java/com/ydool/staff/request/RecruitmentRequest.java b/src/main/java/com/ydool/staff/request/RecruitmentRequest.java index 732027c..1390d41 100644 --- a/src/main/java/com/ydool/staff/request/RecruitmentRequest.java +++ b/src/main/java/com/ydool/staff/request/RecruitmentRequest.java @@ -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 recruitments; - @ApiModelProperty(value = "岗位职务") - @NotBlank(message = "岗位职务不能为空") - private String position; - - @ApiModelProperty(value = "名额") - @NotNull(message = "名额不能为空") - private Integer places; - - @ApiModelProperty(value = "条件要求") - private String requirements; } diff --git a/src/main/java/com/ydool/staff/request/RecruitmentSearch.java b/src/main/java/com/ydool/staff/request/RecruitmentSearch.java new file mode 100644 index 0000000..250868c --- /dev/null +++ b/src/main/java/com/ydool/staff/request/RecruitmentSearch.java @@ -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; + +} diff --git a/src/main/java/com/ydool/staff/service/IDirectorsSupervisorsService.java b/src/main/java/com/ydool/staff/service/IDirectorsSupervisorsService.java index c77f59c..910c47a 100644 --- a/src/main/java/com/ydool/staff/service/IDirectorsSupervisorsService.java +++ b/src/main/java/com/ydool/staff/service/IDirectorsSupervisorsService.java @@ -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 page, String id); } diff --git a/src/main/java/com/ydool/staff/service/IMechanismService.java b/src/main/java/com/ydool/staff/service/IMechanismService.java index 0349f2a..3fc0da8 100644 --- a/src/main/java/com/ydool/staff/service/IMechanismService.java +++ b/src/main/java/com/ydool/staff/service/IMechanismService.java @@ -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); } diff --git a/src/main/java/com/ydool/staff/service/IOrganizationService.java b/src/main/java/com/ydool/staff/service/IOrganizationService.java index f4c946d..2800b27 100644 --- a/src/main/java/com/ydool/staff/service/IOrganizationService.java +++ b/src/main/java/com/ydool/staff/service/IOrganizationService.java @@ -24,5 +24,7 @@ public interface IOrganizationService { AjaxResult selectOrganizationByName(String companyName); AjaxResult selectOrganization(); + + AjaxResult selectCompanyNameByOrganization(Page page, String id); } diff --git a/src/main/java/com/ydool/staff/service/IPersonnelIndicatorsService.java b/src/main/java/com/ydool/staff/service/IPersonnelIndicatorsService.java new file mode 100644 index 0000000..63236fe --- /dev/null +++ b/src/main/java/com/ydool/staff/service/IPersonnelIndicatorsService.java @@ -0,0 +1,20 @@ +package com.ydool.staff.service; + +import com.ydool.common.data.dto.AjaxResult; +import com.ydool.staff.request.PersonnelIndicatorsRequest; + +/** + *

+ * 人员指标申报 服务类 + *

+ * + * @author ljq + * @since 2023-02-10 + */ +public interface IPersonnelIndicatorsService { + + AjaxResult savePersonnelIndicators(PersonnelIndicatorsRequest personnelIndicatorsRequest); + + AjaxResult selectPersonnelIndicatorsById(String id); +} + diff --git a/src/main/java/com/ydool/staff/service/IRecruitmentService.java b/src/main/java/com/ydool/staff/service/IRecruitmentService.java index 175a0e7..c58aede 100644 --- a/src/main/java/com/ydool/staff/service/IRecruitmentService.java +++ b/src/main/java/com/ydool/staff/service/IRecruitmentService.java @@ -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 page, RecruitmentSearch recruitmentSearch); /** * 新增人员 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 0d567e9..951ee5a 100644 --- a/src/main/java/com/ydool/staff/service/impl/DirectorsSupervisorsServiceImpl.java +++ b/src/main/java/com/ydool/staff/service/impl/DirectorsSupervisorsServiceImpl.java @@ -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 page, DirectorsSupervisorsDto directorsSupervisorsDto) { LambdaQueryWrapper 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 = 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 page, String id) { + Page attachmentPage = attachmentMapper.selectPage(page, new LambdaQueryWrapper().eq(Attachment::getTargetId, id).eq(Attachment::getTargetType, ArgsConst.DIRECTORS)); + return AjaxResult.ok().data(attachmentPage); + } } diff --git a/src/main/java/com/ydool/staff/service/impl/MechanismServiceImpl.java b/src/main/java/com/ydool/staff/service/impl/MechanismServiceImpl.java index 3893ed2..c0e5c46 100644 --- a/src/main/java/com/ydool/staff/service/impl/MechanismServiceImpl.java +++ b/src/main/java/com/ydool/staff/service/impl/MechanismServiceImpl.java @@ -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 list = new ArrayList<>(); - List attachmentList = mechanismRequest.getAttachments(); - for (Attachment attachment : attachmentList) { + List 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 attachments = mechanismRequest.getAttachments(); - for (Attachment attachment : attachments) { + List attachments = mechanismRequest.getAttachmentsDto(); + List 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 mechments = mechanismRequest.getMechments(); + // 机构信息 + List mechments = mechanismRequest.getMechanism(); for (Mechanism mechment : mechments) { - mechment.setOrganizationId(organization.getId()); + int mechanism = mechanismMapper.selectCount(new LambdaQueryWrapper().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().eq(Mechanism::getOrganizationId, organization.getId())); + } } - boolean batch = saveBatch(mechments); - return batch ? AjaxResult.ok().msg("新增成功!") : AjaxResult.fail().msg("新增失败!"); + // 党组织信息 + List partyOrganizations = mechanismRequest.getPartyOrganizations(); + for (PartyOrganization partyOrganization : partyOrganizations) { + int party = partyOrganizationMapper.selectCount(new LambdaQueryWrapper().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().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 = mechanismMapper.selectList(new LambdaQueryWrapper().eq(Mechanism::getOrganizationId, id)); + List partyOrganizations = partyOrganizationMapper.selectList(new LambdaQueryWrapper().eq(PartyOrganization::getOrganizationId, id)); + mechanismPartyOrganization.setMechanisms(mechanism); + mechanismPartyOrganization.setPartyOrganizations(partyOrganizations); + return AjaxResult.ok().data(mechanismPartyOrganization); + } } diff --git a/src/main/java/com/ydool/staff/service/impl/OrganizationServiceImpl.java b/src/main/java/com/ydool/staff/service/impl/OrganizationServiceImpl.java index 6322c73..22f5e5c 100644 --- a/src/main/java/com/ydool/staff/service/impl/OrganizationServiceImpl.java +++ b/src/main/java/com/ydool/staff/service/impl/OrganizationServiceImpl.java @@ -70,7 +70,7 @@ public class OrganizationServiceImpl extends BaseService mechanismList = mechanismMapper.selectList(new LambdaQueryWrapper().eq(Mechanism::getOrganizationId, organization.getId())); List attachmentList = attachmentMapper.selectList(new LambdaQueryWrapper().eq(Attachment::getTargetId, organization.getId()).eq(Attachment::getTargetType, ArgsConst.ORGANIZATION)); - List partyOrganizationList = partyOrganizationMapper.selectList(new LambdaQueryWrapper()); + List partyOrganizationList = partyOrganizationMapper.selectList(new LambdaQueryWrapper().eq(PartyOrganization::getOrganizationId, organization.getId())); List toList = BeanUtil.copyToList(attachmentList, AttachmentDto.class); OrganizationRequest organizationRequest = new OrganizationRequest(); organizationRequest.setRemark(organization.getRemark()); @@ -104,5 +104,11 @@ public class OrganizationServiceImpl extends BaseService page, String id) { + Page organizationPage = organizationMapper.selectPage(page, new LambdaQueryWrapper().eq(Organization::getCompanyId, id)); + return AjaxResult.ok().data(organizationPage); + } } diff --git a/src/main/java/com/ydool/staff/service/impl/PersonnelIndicatorsServiceImpl.java b/src/main/java/com/ydool/staff/service/impl/PersonnelIndicatorsServiceImpl.java new file mode 100644 index 0000000..835e746 --- /dev/null +++ b/src/main/java/com/ydool/staff/service/impl/PersonnelIndicatorsServiceImpl.java @@ -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; + +/** + *

+ * 人员指标申报 服务类 + *

+ * + * @author ljq + * @since 2023-02-10 + */ +@Service +public class PersonnelIndicatorsServiceImpl extends BaseService implements IPersonnelIndicatorsService { + + @Autowired + PersonnelIndicatorsMapper personnelIndicatorsMapper; + @Autowired + CompanyNameMapper companyNameMapper; + + @Override + public AjaxResult savePersonnelIndicators(PersonnelIndicatorsRequest personnelIndicatorsRequest) { + List 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 recruitments = personnelIndicatorsMapper.selectList(new LambdaQueryWrapper().eq(PersonnelIndicators::getOrganizationId, companyName.getId())); + PersonnelIndicatorsDto recruitmentRequest = new PersonnelIndicatorsDto(); + recruitmentRequest.setCompanyName(companyName); + recruitmentRequest.setPersonnelIndicators(recruitments); + 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 9652b68..88ccb6d 100644 --- a/src/main/java/com/ydool/staff/service/impl/RecruitmentServiceImpl.java +++ b/src/main/java/com/ydool/staff/service/impl/RecruitmentServiceImpl.java @@ -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 page, RecruitmentSearch recruitmentSearch) { + LambdaQueryWrapper recruitmentLambdaQueryWrapper = new LambdaQueryWrapper<>(); + // recruitmentLambdaQueryWrapper.exists(StrUtil.isNotBlank(recruitmentSearch.getCompanyName()), ""); + Page 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 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 recruitments = recruitmentMapper.selectList(new LambdaQueryWrapper().eq(Recruitment::getCompanyId, companyName.getId())); + RecruitmentDto recruitmentRequest = new RecruitmentDto(); + recruitmentRequest.setCompanyName(companyName); + recruitmentRequest.setRecruitments(recruitments); + return AjaxResult.ok().data(recruitmentRequest); } @Override