From 35cfaa7259f3d494e7bd03aec5c7e035049ee19b Mon Sep 17 00:00:00 2001
From: yubo <autumnal_wind@yeah.net>
Date: 星期三, 24 九月 2025 19:34:09 +0800
Subject: [PATCH] feat: 新增社保档位提醒功能

---
 febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/controller/EmpBaseInfoController.java |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/controller/EmpBaseInfoController.java b/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/controller/EmpBaseInfoController.java
index 4de9d98..f9bb82a 100644
--- a/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/controller/EmpBaseInfoController.java
+++ b/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/controller/EmpBaseInfoController.java
@@ -103,6 +103,7 @@
            throw new FebsException("已存在此身份证号:" + empBaseinfo.getCertificateNumb());
        }
         try {
+            empBaseinfo.setEntryType("20");
             this.empBaseInfoService.createEmpBaseInfo(empBaseinfo);
         } catch (Exception e) {
             String message = "新增员工基本信息失败";
@@ -126,6 +127,7 @@
 
     @ApiOperation(value = "人员基本信息逻辑删除")
     @DeleteMapping("{ids}")
+    @PreAuthorize("hasAuthority('empBaseinfo:delete')")
     public void logicDeleteEmpBaseInfo(@NotBlank(message = "{required}")  @PathVariable("ids") String ids) throws FebsException {
         try {
             this.empBaseInfoService.logicDelEmpBaseInfo(ids);
@@ -242,6 +244,7 @@
 
     @ApiOperation(value = "关闭员工档案")
     @PostMapping("dimission")
+    @PreAuthorize("hasAuthority('empBaseinfo:dimission')")
     public void dimissionEmp(EmpDimissionLog empDimissionLog) throws FebsException {
         try {
             this.empBaseInfoService.closeEmpArchives(empDimissionLog);
@@ -253,6 +256,7 @@
     }
     @ApiOperation(value = "员工岗位变更")
     @PostMapping("jobChange")
+    @PreAuthorize("hasAuthority('empBaseinfo:jobChange')")
     public void changeEmpJob(EmpJobChange empJobChange) throws FebsException {
         try {
             this.empBaseInfoService.changeEmpJob(empJobChange);
@@ -287,4 +291,25 @@
             throw new FebsException(message);
         }
     }
+
+    @ApiOperation(value = "社保提醒人员基本信息翻页列表")
+    @GetMapping("insurance/alert")
+    @PreAuthorize("hasAuthority('empBaseinfo:list')")
+    public FebsResponse insuranceAlertEmpBaseInfoList(QueryRequest request, EmpBaseInfo empBaseinfo) {
+        Map<String, Object> dataTable = FebsUtil.getDataTable(this.empBaseInfoService.findInsuranceEmpBaseInfos(request, empBaseinfo));
+        return new FebsResponse().data(dataTable);
+    }
+    @ApiOperation(value = "导出员工")
+    @RequestMapping(value = "export/insurance",method= RequestMethod.POST)
+    @ControllerEndpoint(operation = "导出社保提醒数据", exceptionMessage = "导出Excel失败")
+    public void exportInsuranceWithField(QueryRequest request, HttpServletResponse response, String exportField,EmpBaseInfo empBaseinfo) throws IOException {
+        request.setPageSize(25535);
+        request.setPageNum(1);
+        List<EmpBaseInfo> exportList = this.empBaseInfoService.findInsuranceEmpBaseInfos(request, empBaseinfo).getRecords();
+        List<Map<String, Object>> allList = PoiExportExcel.getDataList(exportField, exportList, null);
+        String fileName = "社保四险员工列表";
+        Date currentDate = new Date();
+        String dateStr = DateUtil.formatDate(currentDate);
+        boolean result = PoiExportExcel.exportCommonExcel(response, fileName + dateStr, fileName, allList);
+    }
 }

--
Gitblit v1.8.0