diff --git a/src/main/java/com/tenlion/twoduty/controller/api/indexlib/IndexLibController.java b/src/main/java/com/tenlion/twoduty/controller/api/indexlib/IndexLibController.java index 4d280a8..ed08edb 100644 --- a/src/main/java/com/tenlion/twoduty/controller/api/indexlib/IndexLibController.java +++ b/src/main/java/com/tenlion/twoduty/controller/api/indexlib/IndexLibController.java @@ -40,6 +40,30 @@ public class IndexLibController extends DefaultBaseController { + @ApiOperation(value = "web页面指标库树形列表", notes = "web页面指标库树形列表接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listztreeweb") + public List listZTreeWeb() { + Map params = requestParams(); + String indexLibParentId = "0"; + if (!StringUtils.isBlank(params.get("id") == null ? null : params.get("id").toString())) { + indexLibParentId = params.get("id").toString(); + } + params.put("indexLibParentId",indexLibParentId); + return indexLibService.listZTreeWeb(params); + } + + + + + + + + + + + + @ApiOperation(value = "修改指标状态", notes = "修改指标状态接口") @ApiImplicitParams({ @ApiImplicitParam(name = "indexLibId", value = "ID", paramType = "path"), diff --git a/src/main/java/com/tenlion/twoduty/dao/indexlib/IIndexLibDao.java b/src/main/java/com/tenlion/twoduty/dao/indexlib/IIndexLibDao.java index 08aafd4..d7f8135 100644 --- a/src/main/java/com/tenlion/twoduty/dao/indexlib/IIndexLibDao.java +++ b/src/main/java/com/tenlion/twoduty/dao/indexlib/IIndexLibDao.java @@ -24,6 +24,15 @@ import java.util.Map; public interface IIndexLibDao { + /** + * web页面树形列表 + * @param params + * @return + * @throws SearchException + */ + List listZTreeWeb(Map params) throws SearchException; + + /** * 树形列表 * @param params @@ -135,4 +144,13 @@ public interface IIndexLibDao { */ Integer countByParentId(Map params) throws SearchException; + + /** + * web页面根据父级ID统计 + * @param params + * @return + * @throws SearchException + */ + Integer countByParentIdWeb(Map params) throws SearchException; + } \ No newline at end of file diff --git a/src/main/java/com/tenlion/twoduty/service/indexlib/IIndexLibService.java b/src/main/java/com/tenlion/twoduty/service/indexlib/IIndexLibService.java index ed20077..26ebe48 100644 --- a/src/main/java/com/tenlion/twoduty/service/indexlib/IIndexLibService.java +++ b/src/main/java/com/tenlion/twoduty/service/indexlib/IIndexLibService.java @@ -20,13 +20,15 @@ import java.util.Map; **/ public interface IIndexLibService { - /** - * 树形列表 + * web页面树形列表 * @param params * @return * @throws Exception */ + List listZTreeWeb(Map params); + + List listZTree(Map params); /** * 新增 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 add968b..becd848 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 @@ -34,6 +34,23 @@ public class IndexLibServiceImpl extends DefaultBaseService implements IIndexLib @Autowired private IIndexLibDao indexLibDao; + public List listZTreeWeb(Map params){ + List list = indexLibDao.listZTreeWeb(params); + for (IndexLibZTreeDTO indexLibZTreeDTO : list) { + Map data = new HashMap<>(); + data.put("parentId",indexLibZTreeDTO.getId()); + Integer count = countByParentIdWeb(data); + if (count > 0){ + indexLibZTreeDTO.setIsParent(true); + }else{ + indexLibZTreeDTO.setIsParent(false); + } + } + return list; + } + + + public List listZTree(Map params){ List list = indexLibDao.listZTree(params); @@ -50,15 +67,6 @@ public class IndexLibServiceImpl extends DefaultBaseService implements IIndexLib return list; } - - - - - - - - - @Override public void save(IndexLibVO indexLibVO) { saveReturnId(indexLibVO); @@ -201,5 +209,9 @@ public class IndexLibServiceImpl extends DefaultBaseService implements IIndexLib Integer count = indexLibDao.countByParentId(params); return count == null ? 0 : count; } + public Integer countByParentIdWeb(Map params) { + Integer count = indexLibDao.countByParentIdWeb(params); + return count == null ? 0 : count; + } } \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/indexLib/indexLib-mapper.xml b/src/main/resources/mybatis/mapper/indexLib/indexLib-mapper.xml index 95d4470..09976c4 100644 --- a/src/main/resources/mybatis/mapper/indexLib/indexLib-mapper.xml +++ b/src/main/resources/mybatis/mapper/indexLib/indexLib-mapper.xml @@ -53,6 +53,35 @@ + + + + + +