From 75dbe78b0d332644655b25e69c8485950ff3f3fc Mon Sep 17 00:00:00 2001 From: chenyuxi <chenyuxi@wanxin-holdings.com> Date: Thu, 20 Mar 2025 17:57:28 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=85=A5=E7=A6=BB=E8=81=8C=E7=99=BB?= =?UTF-8?q?=E8=AE=B0=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/dapr/util/ArchivesDaprUtil.java | 4 +- .../EmployeeRegistrationController.java | 29 ++++++++++ .../service/EmployeeRegistrationService.java | 16 ++++++ .../impl/EmployeeRegistrationServiceImpl.java | 53 ++++++++++++++++--- 4 files changed, 94 insertions(+), 8 deletions(-) diff --git a/yifu-common/yifu-common-dapr/src/main/java/com/yifu/cloud/plus/v1/yifu/common/dapr/util/ArchivesDaprUtil.java b/yifu-common/yifu-common-dapr/src/main/java/com/yifu/cloud/plus/v1/yifu/common/dapr/util/ArchivesDaprUtil.java index 67126ea45..d41e6127b 100644 --- a/yifu-common/yifu-common-dapr/src/main/java/com/yifu/cloud/plus/v1/yifu/common/dapr/util/ArchivesDaprUtil.java +++ b/yifu-common/yifu-common-dapr/src/main/java/com/yifu/cloud/plus/v1/yifu/common/dapr/util/ArchivesDaprUtil.java @@ -568,9 +568,9 @@ public class ArchivesDaprUtil { public R<SysAutoDictItemVo> getDictListByDeptNo(String deptNo){ SysAutoDictItemVo dictItemVo = new SysAutoDictItemVo(); dictItemVo.setDeptNo(deptNo); - R<SysAutoDictItemVo> res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/tsettledomain/getSettleDomainSelectVoById",dictItemVo, SysAutoDictItemVo.class, SecurityConstants.FROM_IN); + R<SysAutoDictItemVo> res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/sysautodictitem/getSettleDomainSelectVoById",dictItemVo, SysAutoDictItemVo.class, SecurityConstants.FROM_IN); if (Common.isEmpty(res)){ - return R.failed("获å–æ´¾å•æ ¡éªŒéœ€è¦çš„档案信æ¯å¤±è´¥ï¼"); + return R.failed("获å–项目å—典项失败ï¼"); } return res; } diff --git a/yifu-csp/yifu-csp-biz/src/main/java/com/yifu/cloud/plus/v1/csp/controller/EmployeeRegistrationController.java b/yifu-csp/yifu-csp-biz/src/main/java/com/yifu/cloud/plus/v1/csp/controller/EmployeeRegistrationController.java index dbdccf31b..9fc6e3ead 100644 --- a/yifu-csp/yifu-csp-biz/src/main/java/com/yifu/cloud/plus/v1/csp/controller/EmployeeRegistrationController.java +++ b/yifu-csp/yifu-csp-biz/src/main/java/com/yifu/cloud/plus/v1/csp/controller/EmployeeRegistrationController.java @@ -77,6 +77,21 @@ public class EmployeeRegistrationController { return new R<>(employeeRegistrationService.getHrEmployeeRegistrationPage(page, employeeRegistration)); } + /** + * 作业自动化-入离èŒç™»è®°åˆ—表简å•åˆ†é¡µæŸ¥è¯¢ + * + * @param page 分页对象 + * @param employeeRegistration 入离èŒç™»è®°è¡¨ + * @return + */ + @Operation(description = "作业自动化-入离èŒç™»è®°åˆ—表简å•åˆ†é¡µæŸ¥è¯¢") + @GetMapping("/hrRegistrationPage") + public R<IPage<EmployeeRegistration>> getHrAutoEmployeeRegistrationPage(Page<EmployeeRegistration> page, EmployeeRegistrationSearchVo employeeRegistration) { + YifuUser user = SecurityUtils.getUser(); + menuUtil.setAuthSql(user, employeeRegistration); + return new R<>(employeeRegistrationService.getHrAutoEmployeeRegistrationPage(page, employeeRegistration)); + } + /** * 通过id查询入离èŒç™»è®°è¡¨ * @@ -182,6 +197,20 @@ public class EmployeeRegistrationController { employeeRegistrationService.listHrExport(response, searchVo); } + /** + * 作业自动化-入离èŒç™»è®°å¯¼å‡º + * + * @author huych + * @date 2025-02-25 14:48:11 + **/ + @Operation(description = "作业自动化-入离èŒç™»è®°å¯¼å‡º") + @PostMapping("/hrRegistrationExport") + public void hrRegistrationExport(HttpServletResponse response, @RequestBody EmployeeRegistrationSearchVo searchVo) { + YifuUser user = SecurityUtils.getUser(); + menuUtil.setAuthSql(user, searchVo); + employeeRegistrationService.hrRegistrationExport(response, searchVo); + } + /** * @Description: 获å–已接收的入离èŒç”³è¯·ï¼ŒåŒæ—¶æ›´æ–°ä¸ºå·²å¤„ç† * @Author: hgw diff --git a/yifu-csp/yifu-csp-biz/src/main/java/com/yifu/cloud/plus/v1/csp/service/EmployeeRegistrationService.java b/yifu-csp/yifu-csp-biz/src/main/java/com/yifu/cloud/plus/v1/csp/service/EmployeeRegistrationService.java index 3648bb9e2..8b8312e59 100644 --- a/yifu-csp/yifu-csp-biz/src/main/java/com/yifu/cloud/plus/v1/csp/service/EmployeeRegistrationService.java +++ b/yifu-csp/yifu-csp-biz/src/main/java/com/yifu/cloud/plus/v1/csp/service/EmployeeRegistrationService.java @@ -38,6 +38,14 @@ public interface EmployeeRegistrationService extends IService<EmployeeRegistrati */ IPage<EmployeeRegistration> getHrEmployeeRegistrationPage(Page<EmployeeRegistration> page, EmployeeRegistrationSearchVo employeeRegistration); + /** + * 作业自动化-入离èŒç™»è®°åˆ—表简å•åˆ†é¡µæŸ¥è¯¢ + * @param employeeRegistration 入离èŒç™»è®°è¡¨ + * @return + */ + IPage<EmployeeRegistration> getHrAutoEmployeeRegistrationPage(Page<EmployeeRegistration> page, EmployeeRegistrationSearchVo employeeRegistration); + + /** * å…¥èŒå¾…确认简å•åˆ†é¡µæŸ¥è¯¢ * @param employeeRegistration 入离èŒç™»è®°è¡¨ @@ -87,6 +95,14 @@ public interface EmployeeRegistrationService extends IService<EmployeeRegistrati */ void listHrExport(HttpServletResponse response, EmployeeRegistrationSearchVo searchVo); + /** + * 作业自动化-入离èŒç™»è®°å¯¼å‡º + * @param searchVo 入离èŒç™»è®° + * @return + */ + void hrRegistrationExport(HttpServletResponse response, EmployeeRegistrationSearchVo searchVo); + + /** * å…¥èŒå¾…确认表导出 * @param searchVo 入离èŒç™»è®° diff --git a/yifu-csp/yifu-csp-biz/src/main/java/com/yifu/cloud/plus/v1/csp/service/impl/EmployeeRegistrationServiceImpl.java b/yifu-csp/yifu-csp-biz/src/main/java/com/yifu/cloud/plus/v1/csp/service/impl/EmployeeRegistrationServiceImpl.java index 9ae8becbe..203018d43 100644 --- a/yifu-csp/yifu-csp-biz/src/main/java/com/yifu/cloud/plus/v1/csp/service/impl/EmployeeRegistrationServiceImpl.java +++ b/yifu-csp/yifu-csp-biz/src/main/java/com/yifu/cloud/plus/v1/csp/service/impl/EmployeeRegistrationServiceImpl.java @@ -104,12 +104,25 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr @Override public IPage<EmployeeRegistration> getHrEmployeeRegistrationPage(Page<EmployeeRegistration> page, EmployeeRegistrationSearchVo employeeRegistration) { YifuUser user = SecurityUtils.getUser(); + // å…¨æœç®¡ç†è€… long roleId = 1839501715787390978L; boolean isSsc = this.haveRole(user, roleId); if (isSsc) { employeeRegistration.setCustomerUserLoginname(null); } - // å‰ç«¯å®¢æœçš„所有项目æƒé™èµ‹å€¼ + return baseMapper.getEmployeeRegistrationPage(page, employeeRegistration); + } + + /** + * 作业自动化-入离èŒç™»è®°åˆ—表简å•åˆ†é¡µæŸ¥è¯¢ + * + * @param employeeRegistration 入离èŒç™»è®°è¡¨ + * @return + */ + @Override + public IPage<EmployeeRegistration> getHrAutoEmployeeRegistrationPage(Page<EmployeeRegistration> page, EmployeeRegistrationSearchVo employeeRegistration) { + employeeRegistration.setCustomerUserLoginname(null); + // 项目æƒé™èµ‹å€¼ employeeRegistration.setType(CommonConstants.TWO_STRING); initSearchVo(employeeRegistration); return baseMapper.getEmployeeRegistrationPage(page, employeeRegistration); @@ -182,10 +195,9 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr } /** - * 入离èŒç™»è®°è¡¨æ‰¹é‡å¯¼å‡º + * 入离èŒä»£åŠžè¡¨æ‰¹é‡å¯¼å‡º * * @param searchVo 入离èŒç™»è®°è¡¨ - * @return */ @Override public void listHrExport(HttpServletResponse response, EmployeeRegistrationSearchVo searchVo) { @@ -196,11 +208,39 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr if (isSsc) { searchVo.setCustomerUserLoginname(null); } + + String fileName = "入离èŒå¾…办任务表批é‡å¯¼å‡º" + DateUtil.getThisTime() + ".xlsx"; + + this.hrExportCommon(response,searchVo,fileName); + } + + /** + * 作业自动化-入离èŒç™»è®°å¯¼å‡º + * + * @param searchVo 入离èŒç™»è®°è¡¨ + * @since 1.9.8 + * @author chenyuxi + */ + @Override + public void hrRegistrationExport(HttpServletResponse response, EmployeeRegistrationSearchVo searchVo) { + // 1.9.8: å‰ç«¯å®¢æœåŽ»æŽ‰æŒ‡å®šäººæŸ¥è¯¢ + searchVo.setCustomerUserLoginname(null); + // 1.9.8: 项目æƒé™èµ‹å€¼ searchVo.setType(CommonConstants.TWO_STRING); - // 1.9.8: å‰ç«¯å®¢æœçš„所有项目æƒé™èµ‹å€¼ initSearchVo(searchVo); - String fileName = "入离èŒå¾…办任务表批é‡å¯¼å‡º" + DateUtil.getThisTime() + ".xlsx"; + String fileName = "入离èŒç™»è®°æ‰¹é‡å¯¼å‡º" + DateUtil.getThisTime() + ".xlsx"; + + this.hrExportCommon(response,searchVo,fileName); + + } + + /** + * 入离èŒå¯¼å‡ºå…¬å…± + * + * @param searchVo 入离èŒç™»è®°è¡¨ + */ + private void hrExportCommon(HttpServletResponse response, EmployeeRegistrationSearchVo searchVo, String fileName){ //获å–è¦å¯¼å‡ºçš„列表 List<EmployeeRegistrationHrExportVo> list = new ArrayList<>(); long count = baseMapper.selectExportCount(searchVo); @@ -240,6 +280,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr } } + /** * å…¥èŒå¾…确认批é‡å¯¼å‡º * @param searchVo å…¥èŒå¾…确认 @@ -311,7 +352,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr // 1.9.8:获å–项目é…置的å—典值 List<String> postConfigList = new ArrayList<>(); - R<SysAutoDictItemVo> domainDictR = archivesDaprUtil.getDictListByDeptNo(selectVo.getDepartNo()); + R<SysAutoDictItemVo> domainDictR = archivesDaprUtil.getDictListByDeptNo(deptId); if (Common.isNotNull(domainDictR) && Common.isNotNull(domainDictR.getData()) && Common.isNotNull(domainDictR.getData().getSysAutoDictItemList())) { List<SysAutoDictItem> dictItemList = domainDictR.getData().getSysAutoDictItemList(); for(SysAutoDictItem sysAutoDictItem : dictItemList){ -- 2.18.1