mitao
2025-03-14 08f1b1f1804a8bd833d42f257908d80e88387b55
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,19 +39,26 @@
     */
    @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")
    @Authorization
    public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum,
                                          @RequestParam(value = "pageSize",required = false) Integer pageSize,
                                          @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));
    }
    /**
@@ -63,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);
    }
@@ -129,7 +141,6 @@
     */
    @ApiOperation(value = " 根据id获取法律法规政策文件数据 ",response = AutomessagePolicyDocuments.class)
    @GetMapping("/selectAutomessagePolicyDocumentById")
    @Authorization
    public ResultData selectAutomessagePolicyDocumentById(@RequestParam(value = "id") Integer id){
        AutomessagePolicyDocuments automessagePolicyDocuments = iAutomessagePolicyDocumentsService.selectAutomessagePolicyDocumentById(id);
        if (automessagePolicyDocuments!=null){