From 08f1b1f1804a8bd833d42f257908d80e88387b55 Mon Sep 17 00:00:00 2001
From: mitao <2763622819@qq.com>
Date: 星期五, 14 三月 2025 11:27:47 +0800
Subject: [PATCH] 3.5增加登录验证、修改密码、人员列表调整

---
 flower_city/src/main/java/com/dg/core/controller/AutomessagePolicyDocumentsController.java |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/flower_city/src/main/java/com/dg/core/controller/AutomessagePolicyDocumentsController.java b/flower_city/src/main/java/com/dg/core/controller/AutomessagePolicyDocumentsController.java
index 005855c..ffb6bd2 100644
--- a/flower_city/src/main/java/com/dg/core/controller/AutomessagePolicyDocumentsController.java
+++ b/flower_city/src/main/java/com/dg/core/controller/AutomessagePolicyDocumentsController.java
@@ -7,12 +7,14 @@
 import com.dg.core.db.gen.entity.AutomessagePolicyDocuments;
 import com.dg.core.db.gen.entity.SysUser;
 import com.dg.core.service.IAutomessagePolicyDocumentsService;
+import com.dg.core.service.IOrganizationChartService;
 import com.dg.core.util.TableDataInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import lombok.Data;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -26,6 +28,9 @@
     @Resource
     private IAutomessagePolicyDocumentsService iAutomessagePolicyDocumentsService;
 
+    @Resource
+    private IOrganizationChartService iOrganizationChartService;
+
     /**
      * 获取法律法规政策文件列表(分页)
      * @param name
@@ -34,7 +39,9 @@
      */
     @ApiOperation(value = "获取法律法规政策文件列表(分页)",response = AutomessagePolicyDocuments.class)
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "type", value = "类型(1.法律法规2.政策文件)", required = true, dataType = "String", paramType = "query")
+            @ApiImplicitParam(name = "type", value = "类型(1.法律法规2.政策文件)", required = true, dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "isPortal", value = "是否门户网(1.是 2.否) 不传则是门户网", required = true, dataType = "String", paramType = "query")
+
     })
     @GetMapping("/selectConfigList")
     public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum,
@@ -42,10 +49,16 @@
                                           @RequestParam(value = "name",required = false) String name,
                                           @RequestParam(value = "type",required = false) String type,
                                           @RequestParam(value = "departmentId",required = false) Integer departmentId,
+                                          @RequestParam(value = "isPortal",required = false) String isPortal,
                                           @CurrentUser SysUser sysUser){
         Page<AutomessagePolicyDocuments> pageParam = new Page<>(pageNum,pageSize);
-        List<AutomessagePolicyDocuments> list = iAutomessagePolicyDocumentsService.selectConfigList(pageParam,pageSize,name,type,sysUser,departmentId);
-        return getDataTable(list,iAutomessagePolicyDocumentsService.selectCountList(name,type,departmentId));
+        List<String> ids=null;
+        if ( (isPortal != null && isPortal.equals("2"))&&sysUser!=null&&(sysUser.getUserType().equals("2")||sysUser.getIsDivisionHead().equals("1"))){
+            if (sysUser.getDepartmentId()!=null)
+                ids=iOrganizationChartService.getDepartmentId(sysUser.getDepartmentId());
+        }
+        List<AutomessagePolicyDocuments> list = iAutomessagePolicyDocumentsService.selectConfigList(pageParam,pageSize,name,type,sysUser,departmentId,ids);
+        return getDataTable(list,iAutomessagePolicyDocumentsService.selectCountList(name,type,departmentId,ids));
     }
 
     /**
@@ -62,7 +75,7 @@
     public ResultData selectConfigList(@RequestParam(value = "name",required = false) String name,
                                           @RequestParam(value = "type",required = false) String type,
                                        @RequestParam(value = "departmentId",required = false) Integer departmentId){
-        List<AutomessagePolicyDocuments> list = iAutomessagePolicyDocumentsService.selectConfigList(name,type,departmentId);
+        List<AutomessagePolicyDocuments> list = iAutomessagePolicyDocumentsService.selectConfigList(name,type,departmentId,null);
         return  ResultData.success(list);
     }
 

--
Gitblit v1.7.1