From 013afd73fcefc9ec71310bc8abe73a07b624d016 Mon Sep 17 00:00:00 2001 From: zhuyy Date: Mon, 20 Feb 2023 14:29:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ydool/common/constant/UrlConstant.java | 1 + .../DirectorsSupervisorsController.java | 4 +- .../controller/OrganizationController.java | 4 +- .../PersonnelIndicatorsController.java | 6 +- .../controller/PersonnelReportController.java | 70 +++++++++++++++++++ .../controller/RecruitmentController.java | 8 ++- .../dto/EnterpriseIndicatorsExportDto.java | 21 ++++++ .../staff/dto/PersonnelReportExportDto.java | 20 ++++++ .../com/ydool/staff/entity/CompanyName.java | 3 + .../staff/entity/DirectorsSupervisors.java | 2 +- .../excel/EnterpriseIndicatorsExportVO.java | 53 ++++++++++++++ .../staff/excel/PersonnelReportExportVO.java | 45 ++++++++++++ .../staff/request/OrganizationRequest.java | 2 - .../staff/service/ICompanyNameService.java | 16 ++++- .../service/impl/CompanyNameServiceImpl.java | 58 ++++++++++++++- .../impl/DirectorsSupervisorsServiceImpl.java | 7 ++ .../impl/PersonnelIndicatorsServiceImpl.java | 2 +- .../service/impl/RecruitmentServiceImpl.java | 8 +-- 18 files changed, 310 insertions(+), 20 deletions(-) create mode 100644 src/main/java/com/ydool/staff/controller/PersonnelReportController.java create mode 100644 src/main/java/com/ydool/staff/dto/EnterpriseIndicatorsExportDto.java create mode 100644 src/main/java/com/ydool/staff/dto/PersonnelReportExportDto.java create mode 100644 src/main/java/com/ydool/staff/excel/EnterpriseIndicatorsExportVO.java create mode 100644 src/main/java/com/ydool/staff/excel/PersonnelReportExportVO.java diff --git a/src/main/java/com/ydool/common/constant/UrlConstant.java b/src/main/java/com/ydool/common/constant/UrlConstant.java index ab0a3eb..2ec9c93 100644 --- a/src/main/java/com/ydool/common/constant/UrlConstant.java +++ b/src/main/java/com/ydool/common/constant/UrlConstant.java @@ -40,6 +40,7 @@ public interface UrlConstant { String PARTY_ORGANIZATION = API + "/party_organization"; String DIRECTORS_SUPERVISORS = API + "/directors_supervisors"; String PERSONNEL_INDICATORS = API + "/personnel_indicators"; + String PERSONNEL_REPORT = API + "/personnel_report"; String ALTERATION = API + "/alteration"; String Attachment = API + "/attachment"; diff --git a/src/main/java/com/ydool/staff/controller/DirectorsSupervisorsController.java b/src/main/java/com/ydool/staff/controller/DirectorsSupervisorsController.java index 7b44483..3c2a24f 100644 --- a/src/main/java/com/ydool/staff/controller/DirectorsSupervisorsController.java +++ b/src/main/java/com/ydool/staff/controller/DirectorsSupervisorsController.java @@ -1,6 +1,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.UrlConstant; import com.ydool.common.data.dto.AjaxResult; @@ -19,6 +20,7 @@ import org.springframework.web.bind.annotation.*; @RestController @RequestMapping(UrlConstant.DIRECTORS_SUPERVISORS) @Api(tags = "董监任免申报", value = "董监任免申报") +@ApiSupport(order = 19) public class DirectorsSupervisorsController extends BaseController { @Autowired @@ -45,7 +47,7 @@ public class DirectorsSupervisorsController extends BaseController { } @PostMapping("/saveDirectorsSupervisors") - @ApiOperation(value = "新增董监任免申报") + @ApiOperation(value = "新增董监任免申报 auditState 0保存1送审") public AjaxResult saveDirectorsSupervisors(@RequestBody @Validated DirectorsSupervisors directorsSupervisors) { return directorsSupervisorsService.saveDirectorsSupervisors(directorsSupervisors); } diff --git a/src/main/java/com/ydool/staff/controller/OrganizationController.java b/src/main/java/com/ydool/staff/controller/OrganizationController.java index 00d2ec1..3175491 100644 --- a/src/main/java/com/ydool/staff/controller/OrganizationController.java +++ b/src/main/java/com/ydool/staff/controller/OrganizationController.java @@ -2,6 +2,7 @@ package com.ydool.staff.controller; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.github.xiaoymin.knife4j.annotations.ApiSupport; import com.github.xiaoymin.knife4j.annotations.DynamicParameter; import com.github.xiaoymin.knife4j.annotations.DynamicResponseParameters; import com.ydool.common.base.BaseController; @@ -21,6 +22,7 @@ import org.springframework.web.bind.annotation.*; @RestController @RequestMapping(UrlConstant.ORGANIZATION) @Api(tags = "人员招聘登记人员指标申报列表", value = "人员招聘登记人员指标申报列表") +@ApiSupport(order = 16) public class OrganizationController extends BaseController { @Autowired @@ -36,7 +38,7 @@ public class OrganizationController extends BaseController { @PostMapping("/deleteOrganizationAndPersonnelIndicators") @ApiOperation(value = "人员招聘登记人员指标申报删除") - @ApiOperationSupport(order = 2) + @ApiOperationSupport(responses = @DynamicResponseParameters(properties = {@DynamicParameter(name = "data", dataTypeClass = IdsRequest.class)}), order = 2) public AjaxResult deleteOrganization(@RequestBody IdsRequest id) { return organizationService.deleteOrganization(id); } diff --git a/src/main/java/com/ydool/staff/controller/PersonnelIndicatorsController.java b/src/main/java/com/ydool/staff/controller/PersonnelIndicatorsController.java index 2752011..4d17f67 100644 --- a/src/main/java/com/ydool/staff/controller/PersonnelIndicatorsController.java +++ b/src/main/java/com/ydool/staff/controller/PersonnelIndicatorsController.java @@ -1,6 +1,7 @@ package com.ydool.staff.controller; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.github.xiaoymin.knife4j.annotations.ApiSupport; import com.github.xiaoymin.knife4j.annotations.DynamicParameter; import com.github.xiaoymin.knife4j.annotations.DynamicResponseParameters; import com.ydool.common.base.BaseController; @@ -26,6 +27,7 @@ import org.springframework.web.bind.annotation.*; @RestController @RequestMapping(UrlConstant.PERSONNEL_INDICATORS) @Api(tags = "人员指标申报", value = "人员指标申报") +@ApiSupport(order = 18) public class PersonnelIndicatorsController extends BaseController { @Autowired @@ -33,14 +35,14 @@ public class PersonnelIndicatorsController extends BaseController { @PostMapping("/savePersonnelIndicators") @ApiOperation(value = "人员指标申报登记") - @ApiOperationSupport(responses = @DynamicResponseParameters(properties = {@DynamicParameter(name = "data", dataTypeClass = PersonnelIndicatorsRequest.class)}), order = 2) + @ApiOperationSupport(responses = @DynamicResponseParameters(properties = {@DynamicParameter(name = "data", dataTypeClass = PersonnelIndicatorsRequest.class)}), order = 1) public AjaxResult savePersonnelIndicators(@RequestBody @Validated PersonnelIndicatorsRequest personnelIndicatorsRequest) { return personnelIndicatorsService.savePersonnelIndicators(personnelIndicatorsRequest); } @GetMapping("/selectPersonnelIndicatorsById") @ApiOperation(value = "人员指标申报详情") - @ApiOperationSupport(responses = @DynamicResponseParameters(properties = {@DynamicParameter(name = "data", dataTypeClass = PersonnelIndicatorsDto.class)}), order = 3) + @ApiOperationSupport(responses = @DynamicResponseParameters(properties = {@DynamicParameter(name = "data", dataTypeClass = PersonnelIndicatorsDto.class)}), order = 2) public AjaxResult selectPersonnelIndicatorsById(String id) { return personnelIndicatorsService.selectPersonnelIndicatorsById(id); } diff --git a/src/main/java/com/ydool/staff/controller/PersonnelReportController.java b/src/main/java/com/ydool/staff/controller/PersonnelReportController.java new file mode 100644 index 0000000..5804b36 --- /dev/null +++ b/src/main/java/com/ydool/staff/controller/PersonnelReportController.java @@ -0,0 +1,70 @@ +package com.ydool.staff.controller; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.github.xiaoymin.knife4j.annotations.ApiSupport; +import com.github.xiaoymin.knife4j.annotations.DynamicParameter; +import com.github.xiaoymin.knife4j.annotations.DynamicResponseParameters; +import com.ydool.common.base.BaseController; +import com.ydool.common.constant.UrlConstant; +import com.ydool.common.data.dto.AjaxResult; +import com.ydool.staff.dto.EnterpriseIndicatorsExportDto; +import com.ydool.staff.dto.PersonnelReportExportDto; +import com.ydool.staff.excel.EnterpriseIndicatorsExportVO; +import com.ydool.staff.excel.PersonnelReportExportVO; +import com.ydool.staff.service.ICompanyNameService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; + +/** + * @Author Zhuyy + * @ClassName PersonnelReport + * @Description TODO + * @date 2023/2/20 9:16 + * @Version 1.0 + */ + +@RestController +@RequestMapping(UrlConstant.PERSONNEL_REPORT) +@Api(tags = "人事报表", value = "人事报表") +@ApiSupport(order = 20) +public class PersonnelReportController extends BaseController { + + @Autowired + ICompanyNameService companyNameService; + + @GetMapping("/personnelReport") + @ApiOperation(value = "企业人员综合信息") + @ApiImplicitParams({@ApiImplicitParam(value = "企业id", name = "companyId"), @ApiImplicitParam(value = "工作状态 入职/在职/离职/退休", name = "workState", required = true), @ApiImplicitParam(value = "在职时间", name = "hireDate")}) + @ApiOperationSupport(responses = @DynamicResponseParameters(properties = {@DynamicParameter(name = "data", dataTypeClass = PersonnelReportExportVO.class)}), order = 1) + public AjaxResult getPersonnelReport(String companyId, String workState, String hireDate) { + return companyNameService.getPersonnelReport(companyId, workState, hireDate); + } + + @PostMapping("/exportPersonnelReport") + @ApiOperation(value = "企业人员综合信息导出") + @ApiOperationSupport(responses = @DynamicResponseParameters(properties = {@DynamicParameter(name = "data", dataTypeClass = PersonnelReportExportVO.class)}), order = 2) + public void exportPersonnelReport(@RequestBody PersonnelReportExportDto personnelReportExportVO, HttpServletResponse response) { + companyNameService.exportPersonnelReport(personnelReportExportVO, response); + } + + @GetMapping("/enterpriseIndicators") + @ApiOperation(value = "国有企业指标人数") + @ApiOperationSupport(responses = @DynamicResponseParameters(properties = {@DynamicParameter(name = "data", dataTypeClass = EnterpriseIndicatorsExportVO.class)}), order = 3) + @ApiImplicitParams({@ApiImplicitParam(value = "企业id", name = "companyId"), @ApiImplicitParam(value = "在职时间", name = "hireDate")}) + public AjaxResult getEnterpriseIndicators(String companyId, String hireDate) { + return companyNameService.getEnterpriseIndicators(companyId, hireDate); + } + + @PostMapping("/exportEnterpriseIndicators") + @ApiOperation(value = "国有企业指标人数导出") + @ApiOperationSupport(responses = @DynamicResponseParameters(properties = {@DynamicParameter(name = "data", dataTypeClass = EnterpriseIndicatorsExportVO.class)}), order = 4) + public void exportEnterpriseIndicators(@RequestBody EnterpriseIndicatorsExportDto enterpriseIndicatorsExportVO, HttpServletResponse response) { + companyNameService.exportEnterpriseIndicators(enterpriseIndicatorsExportVO, response); + } +} diff --git a/src/main/java/com/ydool/staff/controller/RecruitmentController.java b/src/main/java/com/ydool/staff/controller/RecruitmentController.java index f85f320..7db0f52 100644 --- a/src/main/java/com/ydool/staff/controller/RecruitmentController.java +++ b/src/main/java/com/ydool/staff/controller/RecruitmentController.java @@ -1,6 +1,7 @@ package com.ydool.staff.controller; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.github.xiaoymin.knife4j.annotations.ApiSupport; import com.github.xiaoymin.knife4j.annotations.DynamicParameter; import com.github.xiaoymin.knife4j.annotations.DynamicResponseParameters; import com.ydool.common.base.BaseController; @@ -20,6 +21,7 @@ import org.springframework.web.bind.annotation.*; @RestController @RequestMapping(UrlConstant.RECRUITMENT) @Api(tags = "人员招聘登记", value = "人员招聘登记") +@ApiSupport(order = 17) public class RecruitmentController extends BaseController { @Autowired @@ -27,21 +29,21 @@ public class RecruitmentController extends BaseController { @GetMapping("/selectCompanyNameById") @ApiOperation(value = "人员招聘登记详情") - @ApiOperationSupport(responses = @DynamicResponseParameters(properties = {@DynamicParameter(name = "data", dataTypeClass = RecruitmentDto.class)}), order = 2) + @ApiOperationSupport(responses = @DynamicResponseParameters(properties = {@DynamicParameter(name = "data", dataTypeClass = RecruitmentDto.class)}), order = 1) public AjaxResult selectCompanyNameById(String id) { return recruitmentService.selectRecruitmentById(id); } @PostMapping("/insertRecruitment") @ApiOperation(value = "人员招聘登记新增") - @ApiOperationSupport(responses = @DynamicResponseParameters(properties = {@DynamicParameter(name = "data", dataTypeClass = RecruitmentRequest.class)}), order = 3) + @ApiOperationSupport(responses = @DynamicResponseParameters(properties = {@DynamicParameter(name = "data", dataTypeClass = RecruitmentRequest.class)}), order = 2) public AjaxResult insertRecruitment(@RequestBody @Validated RecruitmentRequest recruitmentRequest) { return recruitmentService.saveRecruitment(recruitmentRequest); } @PostMapping("/deleteRecruitment") @ApiOperation(value = "人员招聘登记删除") - @ApiOperationSupport(order = 5) + @ApiOperationSupport(order = 3) public AjaxResult deleteRecruitment(@RequestBody IdsRequest id) { return recruitmentService.deleteRecruitment(id); } diff --git a/src/main/java/com/ydool/staff/dto/EnterpriseIndicatorsExportDto.java b/src/main/java/com/ydool/staff/dto/EnterpriseIndicatorsExportDto.java new file mode 100644 index 0000000..34a7a8e --- /dev/null +++ b/src/main/java/com/ydool/staff/dto/EnterpriseIndicatorsExportDto.java @@ -0,0 +1,21 @@ +package com.ydool.staff.dto; + +import com.ydool.staff.excel.EnterpriseIndicatorsExportVO; +import com.ydool.staff.excel.PersonnelReportExportVO; +import lombok.Data; + +import java.util.List; + +/** + * @Author Zhuyy + * @ClassName PersonnelReportExportDto + * @Description TODO + * @date 2023/2/20 10:05 + * @Version 1.0 + */ + +@Data +public class EnterpriseIndicatorsExportDto { + + private List enterpriseIndicatorsExportVO; +} diff --git a/src/main/java/com/ydool/staff/dto/PersonnelReportExportDto.java b/src/main/java/com/ydool/staff/dto/PersonnelReportExportDto.java new file mode 100644 index 0000000..8f4a53b --- /dev/null +++ b/src/main/java/com/ydool/staff/dto/PersonnelReportExportDto.java @@ -0,0 +1,20 @@ +package com.ydool.staff.dto; + +import com.ydool.staff.excel.PersonnelReportExportVO; +import lombok.Data; + +import java.util.List; + +/** + * @Author Zhuyy + * @ClassName PersonnelReportExportDto + * @Description TODO + * @date 2023/2/20 10:05 + * @Version 1.0 + */ + +@Data +public class PersonnelReportExportDto { + + private List personnelReportExportVOList; +} diff --git a/src/main/java/com/ydool/staff/entity/CompanyName.java b/src/main/java/com/ydool/staff/entity/CompanyName.java index 1cf08e1..e169d25 100644 --- a/src/main/java/com/ydool/staff/entity/CompanyName.java +++ b/src/main/java/com/ydool/staff/entity/CompanyName.java @@ -47,6 +47,9 @@ public class CompanyName extends BaseEntity { @ApiModelProperty(value = "本次核定总人数") private Long thisApprovalNumber; + @ApiModelProperty(value = "类型 登记organization 申报personnel_indicators") + private String type; + @ApiModelProperty(value = "备注") private String remarks; diff --git a/src/main/java/com/ydool/staff/entity/DirectorsSupervisors.java b/src/main/java/com/ydool/staff/entity/DirectorsSupervisors.java index e0d1cc8..affb1fe 100644 --- a/src/main/java/com/ydool/staff/entity/DirectorsSupervisors.java +++ b/src/main/java/com/ydool/staff/entity/DirectorsSupervisors.java @@ -112,7 +112,7 @@ public class DirectorsSupervisors extends BaseEntity { @ApiModelProperty(value = "终审意见") private String lastInstance; - @ApiModelProperty(value = "审批状态 0 未审批 1 待审批,2已通过,3已拒绝\n") + @ApiModelProperty(value = "审批状态 0 未审批 1 待审批,2已通过,3已拒绝") private Integer auditState; @ApiModelProperty(value = "附件") diff --git a/src/main/java/com/ydool/staff/excel/EnterpriseIndicatorsExportVO.java b/src/main/java/com/ydool/staff/excel/EnterpriseIndicatorsExportVO.java new file mode 100644 index 0000000..36e91f7 --- /dev/null +++ b/src/main/java/com/ydool/staff/excel/EnterpriseIndicatorsExportVO.java @@ -0,0 +1,53 @@ +package com.ydool.staff.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.alibaba.excel.annotation.write.style.ContentStyle; +import com.alibaba.excel.annotation.write.style.HeadRowHeight; +import com.alibaba.excel.annotation.write.style.HeadStyle; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.apache.poi.ss.usermodel.VerticalAlignment; + +import java.io.Serializable; + +/** + * @Author Zhuyy + * @ClassName PersonnelReportExportVO + * @Description TODO + * @date 2023/2/20 9:50 + * @Version 1.0 + */ + +@Data +@HeadRowHeight(20) +@ColumnWidth(30) +@HeadStyle(horizontalAlignment = HorizontalAlignment.CENTER) +@ContentStyle(verticalAlignment = VerticalAlignment.CENTER) +public class EnterpriseIndicatorsExportVO implements Serializable { + + @ExcelProperty({"国有企业指标人数", "国有企业名称"}) + @ApiModelProperty(value = "国有企业名称") + private String companyName; + + @ExcelProperty({"国有企业指标人数", "统一社会信用代码"}) + @ApiModelProperty(value = "统一社会信用代码") + private String creditCode; + + @ExcelProperty({"国有企业指标人数", "指标人数"}) + @ApiModelProperty(value = "指标人数") + private String checkNumber; + + @ExcelProperty({"国有企业指标人数", "指标内在职人数"}) + @ApiModelProperty(value = "指标内在职人数") + private String targetInner; + + @ExcelProperty({"国有企业指标人数", "指标剩余人数"}) + @ApiModelProperty(value = "指标剩余人数") + private String residueNumber; + + @ExcelProperty({"国有企业指标人数", "指标外在职人数"}) + @ApiModelProperty(value = "指标外在职人数") + private String targetOuter; +} diff --git a/src/main/java/com/ydool/staff/excel/PersonnelReportExportVO.java b/src/main/java/com/ydool/staff/excel/PersonnelReportExportVO.java new file mode 100644 index 0000000..fb64bf5 --- /dev/null +++ b/src/main/java/com/ydool/staff/excel/PersonnelReportExportVO.java @@ -0,0 +1,45 @@ +package com.ydool.staff.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.alibaba.excel.annotation.write.style.ContentStyle; +import com.alibaba.excel.annotation.write.style.HeadRowHeight; +import com.alibaba.excel.annotation.write.style.HeadStyle; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.apache.poi.ss.usermodel.VerticalAlignment; + +import java.io.Serializable; + +/** + * @Author Zhuyy + * @ClassName PersonnelReportExportVO + * @Description TODO + * @date 2023/2/20 9:50 + * @Version 1.0 + */ + +@Data +@HeadRowHeight(20) +@ColumnWidth(30) +@HeadStyle(horizontalAlignment = HorizontalAlignment.CENTER) +@ContentStyle(verticalAlignment = VerticalAlignment.CENTER) +public class PersonnelReportExportVO implements Serializable { + + @ExcelProperty({"企业人员综合信息", "国有企业名称"}) + @ApiModelProperty(value = "国有企业名称") + private String companyName; + + @ExcelProperty({"企业人员综合信息", "统一社会信用代码"}) + @ApiModelProperty(value = "统一社会信用代码") + private String creditCode; + + @ExcelProperty({"企业人员综合信息", "指标内在职人数"}) + @ApiModelProperty(value = "指标内在职人数") + private String targetInner; + + @ExcelProperty({"企业人员综合信息", "指标外在职人数"}) + @ApiModelProperty(value = "指标外在职人数") + private String targetOuter; +} diff --git a/src/main/java/com/ydool/staff/request/OrganizationRequest.java b/src/main/java/com/ydool/staff/request/OrganizationRequest.java index e335204..959f5e0 100644 --- a/src/main/java/com/ydool/staff/request/OrganizationRequest.java +++ b/src/main/java/com/ydool/staff/request/OrganizationRequest.java @@ -31,11 +31,9 @@ public class OrganizationRequest implements Serializable { private Long residualNumber; @ApiModelProperty(value = "类型 登记organization 申报personnel_indicators") - @NotBlank(message = "类型不能为空") private String type; @ApiModelProperty(value = "单据状态 默认国资审核,送审") - @NotBlank(message = "单据状态不能为空") private String documentStatus; @ApiModelProperty(value = "备注") diff --git a/src/main/java/com/ydool/staff/service/ICompanyNameService.java b/src/main/java/com/ydool/staff/service/ICompanyNameService.java index a1b5731..cf276b4 100644 --- a/src/main/java/com/ydool/staff/service/ICompanyNameService.java +++ b/src/main/java/com/ydool/staff/service/ICompanyNameService.java @@ -1,10 +1,16 @@ package com.ydool.staff.service; import com.ydool.common.data.dto.AjaxResult; +import com.ydool.staff.dto.EnterpriseIndicatorsExportDto; +import com.ydool.staff.dto.PersonnelReportExportDto; +import com.ydool.staff.excel.EnterpriseIndicatorsExportVO; +import com.ydool.staff.excel.PersonnelReportExportVO; + +import javax.servlet.http.HttpServletResponse; /** *

- * 服务类 + * 服务类 *

* * @author msf @@ -17,5 +23,13 @@ public interface ICompanyNameService { AjaxResult companyName(String companyName); AjaxResult selectCompanyNameById(String id); + + AjaxResult getPersonnelReport(String companyId, String workState, String hireDate); + + void exportPersonnelReport(PersonnelReportExportDto personnelReportExportDto, HttpServletResponse response); + + AjaxResult getEnterpriseIndicators(String companyId, String hireDate); + + void exportEnterpriseIndicators(EnterpriseIndicatorsExportDto enterpriseIndicatorsExportVO, HttpServletResponse response); } diff --git a/src/main/java/com/ydool/staff/service/impl/CompanyNameServiceImpl.java b/src/main/java/com/ydool/staff/service/impl/CompanyNameServiceImpl.java index 68d05ff..db90c8d 100644 --- a/src/main/java/com/ydool/staff/service/impl/CompanyNameServiceImpl.java +++ b/src/main/java/com/ydool/staff/service/impl/CompanyNameServiceImpl.java @@ -1,12 +1,20 @@ package com.ydool.staff.service.impl; import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.github.yulichang.query.MPJQueryWrapper; import com.ydool.common.base.BaseService; import com.ydool.common.data.dto.AjaxResult; +import com.ydool.common.utils.EasyExcelAlibabaUtil; +import com.ydool.staff.dto.EnterpriseIndicatorsExportDto; +import com.ydool.staff.dto.PersonnelReportExportDto; import com.ydool.staff.entity.CompanyName; import com.ydool.staff.entity.Personnel; import com.ydool.staff.entity.Recruitment; +import com.ydool.staff.excel.EnterpriseIndicatorsExportVO; +import com.ydool.staff.excel.ExcelPersonnel; +import com.ydool.staff.excel.PersonnelReportExportVO; import com.ydool.staff.mapper.CompanyNameMapper; import com.ydool.staff.mapper.PersonnelMapper; import com.ydool.staff.mapper.RecruitmentMapper; @@ -16,6 +24,7 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import javax.servlet.http.HttpServletResponse; import java.util.List; /** @@ -44,7 +53,7 @@ public class CompanyNameServiceImpl extends BaseService().eq(CompanyName::getId, id)); - companyName.setActiveStaff(Long.valueOf(personnelMapper.selectCount(new LambdaQueryWrapper().eq(Personnel::getWorkState, "在职").eq(Personnel::getPersonnelType,"指标内").eq(Personnel::getCompanyName, id)))); + companyName.setActiveStaff(Long.valueOf(personnelMapper.selectCount(new LambdaQueryWrapper().eq(Personnel::getWorkState, "在职").eq(Personnel::getPersonnelType, "指标内").eq(Personnel::getCompanyName, id)))); return AjaxResult.ok().data(companyName); } @@ -61,5 +70,52 @@ public class CompanyNameServiceImpl extends BaseService mpjQueryWrapper = new MPJQueryWrapper<>(); + mpjQueryWrapper.select("t.company_name, t.credit_code "); + mpjQueryWrapper.select("SUM(IF( t1.work_state = '" + workState + "', IF ( t1.personnel_type = '指标内', 1, 0 ), 0 )) as target_inner "); + mpjQueryWrapper.select("SUM(IF( t1.personnel_type = '指标外', IF ( t1.work_state = '" + workState + "', 1, 0 ), 0 )) as target_outer "); + mpjQueryWrapper.leftJoin("t_lc_personnel t1 on t.id = t1.company_name "); + mpjQueryWrapper.eq(StrUtil.isNotBlank(companyId), "t.id", companyId); + mpjQueryWrapper.ge(StrUtil.isNotBlank(hireDate), "t1.hire_date", hireDate); + mpjQueryWrapper.groupBy("t.company_name, t.credit_code"); + return AjaxResult.ok().data(companyNameMapper.selectMaps(mpjQueryWrapper)); + } + + @Override + public void exportPersonnelReport(PersonnelReportExportDto personnelReportDto, HttpServletResponse response) { + EasyExcelAlibabaUtil.download(PersonnelReportExportVO.class, personnelReportDto.getPersonnelReportExportVOList(), "企业人员综合信息.xlsx"); + } + + /** + * ==============================国有企业指标人数==================================== + */ + + @Override + public AjaxResult getEnterpriseIndicators(String companyId, String hireDate) { + MPJQueryWrapper mpjQueryWrapper = new MPJQueryWrapper<>(); + mpjQueryWrapper.select("t.company_name, t.credit_code "); + mpjQueryWrapper.select("t.check_number "); + mpjQueryWrapper.select("SUM(IF( t1.work_state = '在职', IF ( t1.personnel_type = '指标内', 1, 0 ), 0 )) as target_inner "); + mpjQueryWrapper.select("t.residue_number "); + mpjQueryWrapper.select("SUM(IF( t1.personnel_type = '指标外', IF ( t1.work_state = '在职', 1, 0 ), 0 )) as target_outer "); + mpjQueryWrapper.leftJoin("t_lc_personnel t1 on t.id = t1.company_name "); + mpjQueryWrapper.eq(StrUtil.isNotBlank(companyId), "t.id", companyId); + mpjQueryWrapper.ge(StrUtil.isNotBlank(hireDate), "t1.hire_date", hireDate); + mpjQueryWrapper.groupBy("t.company_name, t.credit_code"); + return AjaxResult.ok().data(companyNameMapper.selectMaps(mpjQueryWrapper)); + } + + @Override + public void exportEnterpriseIndicators(EnterpriseIndicatorsExportDto enterpriseIndicatorsExportVO, HttpServletResponse response) { + EasyExcelAlibabaUtil.download(EnterpriseIndicatorsExportVO.class, enterpriseIndicatorsExportVO.getEnterpriseIndicatorsExportVO(), "国有企业指标人数.xlsx"); + } + + } 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 01a94de..a3bdb13 100644 --- a/src/main/java/com/ydool/staff/service/impl/DirectorsSupervisorsServiceImpl.java +++ b/src/main/java/com/ydool/staff/service/impl/DirectorsSupervisorsServiceImpl.java @@ -12,10 +12,12 @@ 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.Audit; 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.AuditMapper; import com.ydool.staff.mapper.CompanyNameMapper; import com.ydool.staff.mapper.DirectorsSupervisorsMapper; import com.ydool.staff.service.IDirectorsSupervisorsService; @@ -47,6 +49,8 @@ public class DirectorsSupervisorsServiceImpl extends BaseService page, DirectorsSupervisorsDto directorsSupervisorsDto) { @@ -123,6 +127,9 @@ public class DirectorsSupervisorsServiceImpl extends BaseService page, String id) { + if (StrUtil.isBlank(id)) { + return AjaxResult.fail().msg("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/PersonnelIndicatorsServiceImpl.java b/src/main/java/com/ydool/staff/service/impl/PersonnelIndicatorsServiceImpl.java index f3f1296..a8c42f8 100644 --- a/src/main/java/com/ydool/staff/service/impl/PersonnelIndicatorsServiceImpl.java +++ b/src/main/java/com/ydool/staff/service/impl/PersonnelIndicatorsServiceImpl.java @@ -44,7 +44,7 @@ public class PersonnelIndicatorsServiceImpl extends BaseService 0) { 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 675b101..dae68b8 100644 --- a/src/main/java/com/ydool/staff/service/impl/RecruitmentServiceImpl.java +++ b/src/main/java/com/ydool/staff/service/impl/RecruitmentServiceImpl.java @@ -43,18 +43,12 @@ public class RecruitmentServiceImpl extends BaseService 0) {