指标库新增web页面树形接口

This commit is contained in:
ly19960718 2021-04-14 14:26:08 +08:00
parent ab8b7eb7d0
commit 7eb0e3cf71
7 changed files with 82 additions and 23 deletions

View File

@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.tags.Param;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -38,6 +39,15 @@ public class IndexLibController extends DefaultBaseController {
@Autowired
private IIndexLibService indexLibService;
@ApiOperation(value = "web页面导航列表", notes = "web页面导航列表接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("listwebtags")
public List<IndexLibZTreeDTO> listWebTags(){
Map<String, Object> params = new HashMap<String, Object>();
params.put("indexLibParentId","0");
return indexLibService.listWebTags(params);
}
@ApiOperation(value = "web页面指标库树形列表", notes = "web页面指标库树形列表接口")

View File

@ -1,5 +1,6 @@
package com.tenlion.twoduty.pojo.dtos.indexlib;
import com.tenlion.twoduty.pojo.dtos.indextemplate.IndexTemplateDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -26,12 +27,19 @@ public class IndexLibDTO {
private Integer indexLibSort;
@ApiModelProperty(name = "indexLibRemark", value = "指标备注")
private String indexLibRemark;
@ApiModelProperty(name = "indexLibState", value = "指标状态")
private Integer indexLibState;
@ApiModelProperty(name = "indexTemplateId", value = "模板ID")
private String indexTemplateId;
@ApiModelProperty(name = "indexTemplateName", value = "模板名称")
private String indexTemplateName;
@ApiModelProperty(name = "indexLibState", value = "指标状态")
private Integer indexLibState;
@ApiModelProperty(name = "indexTemplateSavePath", value = "保存路径")
private String indexTemplateSavePath;
@ApiModelProperty(name = "indexTemplateUploadPath", value = "修改路径")
private String indexTemplateUploadPath;
@ApiModelProperty(name = "indexTemplateListPath", value = "列表路径")
private String indexTemplateListPath;
@ -83,6 +91,13 @@ public class IndexLibDTO {
this.indexLibRemark = indexLibRemark;
}
public Integer getIndexLibState() {
return indexLibState;
}
public void setIndexLibState(Integer indexLibState) {
this.indexLibState = indexLibState;
}
public String getIndexTemplateId() {
return indexTemplateId;
@ -100,11 +115,27 @@ public class IndexLibDTO {
this.indexTemplateName = indexTemplateName;
}
public Integer getIndexLibState() {
return indexLibState;
public String getIndexTemplateSavePath() {
return indexTemplateSavePath;
}
public void setIndexLibState(Integer indexLibState) {
this.indexLibState = indexLibState;
public void setIndexTemplateSavePath(String indexTemplateSavePath) {
this.indexTemplateSavePath = indexTemplateSavePath;
}
public String getIndexTemplateUploadPath() {
return indexTemplateUploadPath;
}
public void setIndexTemplateUploadPath(String indexTemplateUploadPath) {
this.indexTemplateUploadPath = indexTemplateUploadPath;
}
public String getIndexTemplateListPath() {
return indexTemplateListPath;
}
public void setIndexTemplateListPath(String indexTemplateListPath) {
this.indexTemplateListPath = indexTemplateListPath;
}
}

View File

@ -21,14 +21,12 @@ public class IndexTemplateDTO {
@ApiModelProperty(name = "indexTemplateName", value = "模板名称")
private String indexTemplateName;
@ApiModelProperty(name = "indexTemplateSavePath", value = "保存路径")
private String indexTemplateSavePath;
@ApiModelProperty(name = "indexTemplateUploadPath", value = "修改路径")
private String indexTemplateUploadPath;
@ApiModelProperty(name = "indexTemplateListPath", value = "列表路径")
private String indexTemplateListPath;
@ApiModelProperty(name = "indexTemplateRemark", value = "模板说明")
private String indexTemplateRemark;
@ApiModelProperty(name = "indexTemplateState", value = "模板状态")

View File

@ -20,6 +20,16 @@ import java.util.Map;
**/
public interface IIndexLibService {
/**
* 获取web页面导航
* @param params
* @return
* @throws Exception
*/
List<IndexLibZTreeDTO> listWebTags(Map<String, Object> params);
/**
* web页面树形列表递归处理
* @param params
@ -29,6 +39,13 @@ public interface IIndexLibService {
List<IndexLibZTreeDTO> listZTreeWeb(Map<String, Object> params);
/**
* 树形列表
* @param params
* @return
* @throws Exception
*/
List<IndexLibZTreeDTO> listZTree(Map<String, Object> params);
/**
* 新增

View File

@ -1,6 +1,7 @@
package com.tenlion.twoduty.service.indexlib.impl;
import com.tenlion.twoduty.pojo.dtos.indexlib.IndexLibZTreeDTO;
import com.tenlion.twoduty.service.indextemplate.IIndexTemplateService;
import ink.wgink.common.base.DefaultBaseService;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.result.SuccessResult;
@ -33,6 +34,13 @@ public class IndexLibServiceImpl extends DefaultBaseService implements IIndexLib
@Autowired
private IIndexLibDao indexLibDao;
@Autowired
private IIndexTemplateService indexTemplateService;
public List<IndexLibZTreeDTO> listWebTags(Map<String, Object> params){
return indexLibDao.listZTreeWeb(params);
}
public List<IndexLibZTreeDTO> listZTreeWeb(Map<String, Object> params){
List<IndexLibZTreeDTO> list = indexLibDao.listZTreeWeb(params);
@ -40,21 +48,10 @@ public class IndexLibServiceImpl extends DefaultBaseService implements IIndexLib
Map<String,Object> data = new HashMap<>();
data.put("indexLibParentId",indexLibZTreeDTO.getId());
indexLibZTreeDTO.setChildrens(this.listZTreeWeb(data));
// Map<String,Object> 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<IndexLibZTreeDTO> listZTree(Map<String, Object> params){
List<IndexLibZTreeDTO> list = indexLibDao.listZTree(params);
for (IndexLibZTreeDTO indexLibZTreeDTO : list) {

View File

@ -12,6 +12,9 @@
<result column="index_lib_state" property="indexLibState"/>
<result column="index_template_id" property="indexTemplateId"/>
<result column="index_template_name" property="indexTemplateName"/>
<result column="index_template_save_path" property="indexTemplateSavePath"/>
<result column="index_template_upload_path" property="indexTemplateUploadPath"/>
<result column="index_template_list_path" property="indexTemplateListPath"/>
</resultMap>
<resultMap id="indexLibBO" type="com.tenlion.twoduty.pojo.bos.indexlib.IndexLibBO">
@ -182,6 +185,9 @@
<if test="indexLibParentId != null and indexLibParentId != ''">
index_lib_parent_id = #{indexLibParentId},
</if>
<if test="indexTemplateId != null and indexTemplateId != ''">
index_template_id = #{indexTemplateId},
</if>
<if test="indexLibSort != null and indexLibSort != ''">
index_lib_sort = #{indexLibSort},
</if>
@ -281,7 +287,10 @@
t1.index_lib_remark,
t1.index_lib_state,
t1.index_template_id,
t3.index_template_name
t3.index_template_name,
t3.index_template_save_path,
t3.index_template_upload_path,
t3.index_template_list_path
FROM
duty_index_lib t1
LEFT JOIN duty_index_lib t2

View File

@ -97,14 +97,11 @@
var laytpl = layui.laytpl;
var laydate = layui.laydate;
var indexLibId = top.restAjax.params(window.location.href).indexLibId;
var wangEditor = window.wangEditor;
var wangEditorObj = {};
var viewerObj = {};
function initIndexTemplateList(selectValue){
top.restAjax.get(top.restAjax.path("api/indextemplate/list",[]),{},null,function (code,data,args) {
laytpl(document.getElementById('indexTemplateIdTemplate').innerHTML).render(data, function(html) {