diff --git a/src/main/java/com/tenlion/twoduty/controller/api/indexaudit/IndexAuditController.java b/src/main/java/com/tenlion/twoduty/controller/api/indexaudit/IndexAuditController.java index 4cac926..0a31c9f 100644 --- a/src/main/java/com/tenlion/twoduty/controller/api/indexaudit/IndexAuditController.java +++ b/src/main/java/com/tenlion/twoduty/controller/api/indexaudit/IndexAuditController.java @@ -159,7 +159,12 @@ public class IndexAuditController extends DefaultBaseController { @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), - @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "indexAuditStatus", value = "审核状态", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "departmentId", value = "单位ID,为单位", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "indexLibIdParentId", value = "指标分类ID", paramType = "query", dataType = "String"), + }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("listpage") diff --git a/src/main/java/com/tenlion/twoduty/controller/route/indexWebController.java b/src/main/java/com/tenlion/twoduty/controller/route/indexWebController.java index 930a068..4b10c17 100644 --- a/src/main/java/com/tenlion/twoduty/controller/route/indexWebController.java +++ b/src/main/java/com/tenlion/twoduty/controller/route/indexWebController.java @@ -86,7 +86,6 @@ public class indexWebController extends DefaultBaseController { params.put("userName",currentUser.getUserName()); params.put("userUserName",currentUser.getUserUsername()); params.put("departmentId",this.initDepartmentId(currentUser)); - params.put("initButton",this.initWebButton(currentUser)); return params; } diff --git a/src/main/java/com/tenlion/twoduty/pojo/dtos/indexlib/IndexLibDTO.java b/src/main/java/com/tenlion/twoduty/pojo/dtos/indexlib/IndexLibDTO.java index 53097d9..ba5c3e5 100644 --- a/src/main/java/com/tenlion/twoduty/pojo/dtos/indexlib/IndexLibDTO.java +++ b/src/main/java/com/tenlion/twoduty/pojo/dtos/indexlib/IndexLibDTO.java @@ -4,6 +4,8 @@ import com.tenlion.twoduty.pojo.dtos.indextemplate.IndexTemplateDTO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.util.List; + /** * * @ClassName: IndexLibDTO @@ -41,6 +43,8 @@ public class IndexLibDTO { private String indexTemplateListPath; @ApiModelProperty(name = "indexTemplateShowPath", value = "查看路径") private String indexTemplateShowPath; + @ApiModelProperty(name = "initButton", value = "初始化按钮参数 1上报 2查看列表") + private List initButton; @@ -147,4 +151,13 @@ public class IndexLibDTO { public void setIndexTemplateShowPath(String indexTemplateShowPath) { this.indexTemplateShowPath = indexTemplateShowPath; } + + + public List getInitButton() { + return initButton; + } + + public void setInitButton(List initButton) { + this.initButton = initButton; + } } diff --git a/src/main/java/com/tenlion/twoduty/service/indexlib/impl/IndexLibServiceImpl.java b/src/main/java/com/tenlion/twoduty/service/indexlib/impl/IndexLibServiceImpl.java index 2d4f5ae..cc98825 100644 --- a/src/main/java/com/tenlion/twoduty/service/indexlib/impl/IndexLibServiceImpl.java +++ b/src/main/java/com/tenlion/twoduty/service/indexlib/impl/IndexLibServiceImpl.java @@ -8,6 +8,8 @@ import ink.wgink.common.base.DefaultBaseService; import ink.wgink.common.component.SecurityComponent; import ink.wgink.exceptions.ParamsException; import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.bos.UserInfoBO; +import ink.wgink.pojo.pos.RolePO; import ink.wgink.pojo.result.SuccessResult; import ink.wgink.pojo.result.SuccessResultList; import ink.wgink.util.map.HashMapUtil; @@ -44,6 +46,15 @@ public class IndexLibServiceImpl extends DefaultBaseService implements IIndexLib @Autowired private SecurityComponent securityComponent; + /** + * 市局角色 + */ + private final static String ROLE_CODE_1 ="0001"; + /** + * 旗县角色 + */ + private final static String ROLE_CODE_2 ="0002"; + /** * 获取web显示的指标 * @param indexLibParentId @@ -256,7 +267,12 @@ public class IndexLibServiceImpl extends DefaultBaseService implements IIndexLib @Override public List list(Map params) { - return indexLibDao.list(params); + List list = indexLibDao.list(params); + List button = this.initWebButton(); + for (IndexLibDTO indexLibDTO : list) { + indexLibDTO.setInitButton(button); + } + return list; } @Override @@ -291,4 +307,19 @@ public class IndexLibServiceImpl extends DefaultBaseService implements IIndexLib return count == null ? 0 : count; } + public List initWebButton(){ + List list = new ArrayList<>(); + List roles = securityComponent.getCurrentUser().getRoles(); + if(roles.size() == 0){ + return list; + } + for (RolePO role : roles) { + if(ROLE_CODE_2.equals(role.getRoleCode())){ + list.add("1"); + list.add("2"); + } + } + return list; + } + } \ No newline at end of file