lidongdong
2022-11-23 19b96e1b86b3ffd8a75de1bcf95bcbce85fb36e8
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;
@@ -25,6 +27,9 @@
    @Resource
    private IAutomessagePolicyDocumentsService iAutomessagePolicyDocumentsService;
    @Resource
    private IOrganizationChartService iOrganizationChartService;
    /**
     * 获取法律法规政策文件列表(分页)
@@ -44,8 +49,12 @@
                                          @RequestParam(value = "departmentId",required = false) Integer departmentId,
                                          @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 (sysUser!=null&&(sysUser.getUserType().equals("2")||sysUser.getIsDivisionHead().equals("1"))){
           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 +71,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);
    }