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 ec8843d..de0c989 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 @@ -1,5 +1,6 @@ package com.tenlion.twoduty.controller.api.indexlib; +import com.tenlion.twoduty.pojo.dtos.indexlib.IndexLibCountDTO; import com.tenlion.twoduty.pojo.dtos.indexlib.IndexLibZTreeDTO; import ink.wgink.annotation.CheckRequestBodyAnnotation; import ink.wgink.common.base.DefaultBaseController; @@ -39,6 +40,18 @@ public class IndexLibController extends DefaultBaseController { @Autowired private IIndexLibService indexLibService; + + @ApiOperation(value = "指标统计", notes = "指标统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("countIndexLib/{indexLibParentId}") + public IndexLibCountDTO countIndexLib(@PathVariable("indexLibParentId") String indexLibParentId ){ + return indexLibService.countIndexLib(indexLibParentId); + } + + + + + @ApiOperation(value = "web页面导航列表", notes = "web页面导航列表接口") @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("listwebtags") @@ -53,10 +66,6 @@ public class IndexLibController extends DefaultBaseController { @GetMapping("listztreeweb/{indexLibParentId}") public List listZTreeWeb(@PathVariable("indexLibParentId") String indexLibParentId ) { 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); } 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 726fde7..0e5da6d 100644 --- a/src/main/java/com/tenlion/twoduty/controller/route/indexWebController.java +++ b/src/main/java/com/tenlion/twoduty/controller/route/indexWebController.java @@ -28,7 +28,7 @@ public class indexWebController extends DefaultBaseController { @ApiOperation(value = "后台页面首页", notes = "后台页面首页接口") @GetMapping("indexweb") - public ModelAndView indexweb(){ + public ModelAndView indexWeb(){ ModelAndView mv = new ModelAndView("index"); mv.addObject("userName",securityComponent.getCurrentUser().getUserName()); mv.addObject("userUserName",securityComponent.getCurrentUser().getUserUsername()); 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 d7f8135..380d723 100644 --- a/src/main/java/com/tenlion/twoduty/dao/indexlib/IIndexLibDao.java +++ b/src/main/java/com/tenlion/twoduty/dao/indexlib/IIndexLibDao.java @@ -1,5 +1,6 @@ package com.tenlion.twoduty.dao.indexlib; +import com.tenlion.twoduty.pojo.dtos.indexlib.IndexLibCountDTO; import com.tenlion.twoduty.pojo.dtos.indexlib.IndexLibZTreeDTO; import ink.wgink.exceptions.RemoveException; import ink.wgink.exceptions.SaveException; @@ -153,4 +154,13 @@ public interface IIndexLibDao { */ Integer countByParentIdWeb(Map params) throws SearchException; + + /** + * 统计指标状态数量 + * @param params + * @return + * @throws SearchException + */ + IndexLibCountDTO countIndexLibAuditStatusNum(Map params) throws SearchException; + } \ No newline at end of file diff --git a/src/main/java/com/tenlion/twoduty/pojo/bos/indextemplate/IndexTemplateBO.java b/src/main/java/com/tenlion/twoduty/pojo/bos/indextemplate/IndexTemplateBO.java index 0807087..3c8ba86 100644 --- a/src/main/java/com/tenlion/twoduty/pojo/bos/indextemplate/IndexTemplateBO.java +++ b/src/main/java/com/tenlion/twoduty/pojo/bos/indextemplate/IndexTemplateBO.java @@ -1,5 +1,7 @@ package com.tenlion.twoduty.pojo.bos.indextemplate; +import io.swagger.annotations.ApiModelProperty; + /** * * @ClassName: IndexTemplateBO @@ -15,6 +17,7 @@ public class IndexTemplateBO { private String indexTemplateSavePath; private String indexTemplateUploadPath; private String indexTemplateListPath; + private String indexTemplateTableName; private String indexTemplateRemark; private Integer indexTemplateState; private String gmtCreate; @@ -118,4 +121,12 @@ public class IndexTemplateBO { public void setIndexTemplateState(Integer indexTemplateState) { this.indexTemplateState = indexTemplateState; } + + public String getIndexTemplateTableName() { + return indexTemplateTableName; + } + + public void setIndexTemplateTableName(String indexTemplateTableName) { + this.indexTemplateTableName = indexTemplateTableName; + } } diff --git a/src/main/java/com/tenlion/twoduty/pojo/dtos/indexlib/IndexLibCountDTO.java b/src/main/java/com/tenlion/twoduty/pojo/dtos/indexlib/IndexLibCountDTO.java new file mode 100644 index 0000000..5141c04 --- /dev/null +++ b/src/main/java/com/tenlion/twoduty/pojo/dtos/indexlib/IndexLibCountDTO.java @@ -0,0 +1,52 @@ +package com.tenlion.twoduty.pojo.dtos.indexlib; + + +/** + * 统计实体 + * @version 1.0 + * @author LY + * @date 2021/4/15 15:56 + */ +public class IndexLibCountDTO { + + + + private Integer count1; + + private Integer count2; + + private Integer count3; + private Integer count4; + + public Integer getCount1() { + return count1; + } + + public void setCount1(Integer count1) { + this.count1 = count1; + } + + public Integer getCount2() { + return count2; + } + + public void setCount2(Integer count2) { + this.count2 = count2; + } + + public Integer getCount3() { + return count3; + } + + public void setCount3(Integer count3) { + this.count3 = count3; + } + + public Integer getCount4() { + return count4; + } + + public void setCount4(Integer count4) { + this.count4 = count4; + } +} diff --git a/src/main/java/com/tenlion/twoduty/pojo/dtos/indextemplate/IndexTemplateDTO.java b/src/main/java/com/tenlion/twoduty/pojo/dtos/indextemplate/IndexTemplateDTO.java index 9fdd3af..550e3a8 100644 --- a/src/main/java/com/tenlion/twoduty/pojo/dtos/indextemplate/IndexTemplateDTO.java +++ b/src/main/java/com/tenlion/twoduty/pojo/dtos/indextemplate/IndexTemplateDTO.java @@ -27,6 +27,8 @@ public class IndexTemplateDTO { private String indexTemplateUploadPath; @ApiModelProperty(name = "indexTemplateListPath", value = "列表路径") private String indexTemplateListPath; + @ApiModelProperty(name = "indexTemplateTableName", value = "业务表名") + private String indexTemplateTableName; @ApiModelProperty(name = "indexTemplateRemark", value = "模板说明") private String indexTemplateRemark; @ApiModelProperty(name = "indexTemplateState", value = "模板状态") @@ -87,4 +89,12 @@ public class IndexTemplateDTO { public void setIndexTemplateState(Integer indexTemplateState) { this.indexTemplateState = indexTemplateState; } + + public String getIndexTemplateTableName() { + return indexTemplateTableName; + } + + public void setIndexTemplateTableName(String indexTemplateTableName) { + this.indexTemplateTableName = indexTemplateTableName; + } } diff --git a/src/main/java/com/tenlion/twoduty/pojo/pos/indextemplate/IndexTemplatePO.java b/src/main/java/com/tenlion/twoduty/pojo/pos/indextemplate/IndexTemplatePO.java index e0e7747..8ae0a23 100644 --- a/src/main/java/com/tenlion/twoduty/pojo/pos/indextemplate/IndexTemplatePO.java +++ b/src/main/java/com/tenlion/twoduty/pojo/pos/indextemplate/IndexTemplatePO.java @@ -17,6 +17,7 @@ public class IndexTemplatePO { private String indexTemplateSavePath; private String indexTemplateUploadPath; private String indexTemplateListPath; + private String indexTemplateTableName; private String indexTemplateRemark; private Integer indexTemplateState; private String gmtCreate; @@ -120,4 +121,12 @@ public class IndexTemplatePO { public void setIndexTemplateState(Integer indexTemplateState) { this.indexTemplateState = indexTemplateState; } + + public String getIndexTemplateTableName() { + return indexTemplateTableName; + } + + public void setIndexTemplateTableName(String indexTemplateTableName) { + this.indexTemplateTableName = indexTemplateTableName; + } } diff --git a/src/main/java/com/tenlion/twoduty/pojo/vos/indextemplate/IndexTemplateVO.java b/src/main/java/com/tenlion/twoduty/pojo/vos/indextemplate/IndexTemplateVO.java index a49bde1..7c1faae 100644 --- a/src/main/java/com/tenlion/twoduty/pojo/vos/indextemplate/IndexTemplateVO.java +++ b/src/main/java/com/tenlion/twoduty/pojo/vos/indextemplate/IndexTemplateVO.java @@ -25,6 +25,8 @@ public class IndexTemplateVO { private String indexTemplateUploadPath; @ApiModelProperty(name = "indexTemplateListPath", value = "列表路径") private String indexTemplateListPath; + @ApiModelProperty(name = "indexTemplateTableName", value = "业务表名") + private String indexTemplateTableName; @ApiModelProperty(name = "indexTemplateRemark", value = "模板说明") private String indexTemplateRemark; @ApiModelProperty(name = "indexTemplateState", value = "模板状态") @@ -78,4 +80,12 @@ public class IndexTemplateVO { public void setIndexTemplateState(Integer indexTemplateState) { this.indexTemplateState = indexTemplateState; } + + public String getIndexTemplateTableName() { + return indexTemplateTableName; + } + + public void setIndexTemplateTableName(String indexTemplateTableName) { + this.indexTemplateTableName = indexTemplateTableName; + } } 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 9667e4a..143daef 100644 --- a/src/main/java/com/tenlion/twoduty/service/indexlib/IIndexLibService.java +++ b/src/main/java/com/tenlion/twoduty/service/indexlib/IIndexLibService.java @@ -1,5 +1,6 @@ package com.tenlion.twoduty.service.indexlib; +import com.tenlion.twoduty.pojo.dtos.indexlib.IndexLibCountDTO; import com.tenlion.twoduty.pojo.dtos.indexlib.IndexLibZTreeDTO; import ink.wgink.pojo.ListPage; import ink.wgink.pojo.result.SuccessResultList; @@ -20,6 +21,12 @@ import java.util.Map; **/ public interface IIndexLibService { + /** + * 统计指标状态数量 + * @param indexLibParentId + * @return + */ + IndexLibCountDTO countIndexLib(String indexLibParentId); /** * 获取web页面导航 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 ff70900..77d97b6 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 @@ -1,6 +1,8 @@ package com.tenlion.twoduty.service.indexlib.impl; +import com.tenlion.twoduty.pojo.dtos.indexlib.IndexLibCountDTO; import com.tenlion.twoduty.pojo.dtos.indexlib.IndexLibZTreeDTO; +import com.tenlion.twoduty.pojo.dtos.indextemplate.IndexTemplateDTO; import com.tenlion.twoduty.service.indextemplate.IIndexTemplateService; import ink.wgink.common.base.DefaultBaseService; import ink.wgink.pojo.ListPage; @@ -19,6 +21,7 @@ import com.github.pagehelper.PageInfo; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.web.bind.annotation.PathVariable; import java.util.*; @@ -37,6 +40,51 @@ public class IndexLibServiceImpl extends DefaultBaseService implements IIndexLib @Autowired private IIndexTemplateService indexTemplateService; + public IndexLibCountDTO countIndexLib(String indexLibParentId){ + Integer count1 = 0; + Integer count2 = 0; + Integer count3 = 0; + Integer count4 = 0; + Map params = new HashMap(); + params.put("indexLibParentId",indexLibParentId); + //查询指标分类树 + List listZTreeWeb = this.listZTreeWeb(params); + for (IndexLibZTreeDTO indexLibZTreeDTO : listZTreeWeb) { + params.clear(); + params.put("indexLibState",1); + params.put("indexLibParentId",indexLibZTreeDTO.getId()); + //查询具体指标 + List list = this.list(params); + for (IndexLibDTO indexLibDTO : list) { + String templateId = indexLibDTO.getIndexTemplateId(); + if (StringUtils.isBlank(templateId)) { + IndexTemplateDTO indexTemplateDTO = indexTemplateService.get(templateId); + String templateTableName = indexTemplateDTO.getIndexTemplateTableName(); + if (StringUtils.isBlank(templateTableName)) { + //统计 + Map counts = new HashMap(); + counts.put("tableName",templateTableName); + counts.put("indexLibId",indexLibZTreeDTO.getId()); + IndexLibCountDTO indexLibCountDTO = indexLibDao.countIndexLibAuditStatusNum(counts); + count1 += indexLibCountDTO.getCount1(); + count2 += indexLibCountDTO.getCount2(); + count3 += indexLibCountDTO.getCount3(); + count4 += indexLibCountDTO.getCount4(); + } + } + } + } + IndexLibCountDTO indexLibCountDTO = new IndexLibCountDTO(); + indexLibCountDTO.setCount1(count1); + indexLibCountDTO.setCount2(count2); + indexLibCountDTO.setCount3(count3); + indexLibCountDTO.setCount4(count4); + return indexLibCountDTO; + } + + + + public List listWebTags(Map params){ return indexLibDao.listZTreeWeb(params); } diff --git a/src/main/resources/mybatis/mapper/indexLib/indexLib-mapper.xml b/src/main/resources/mybatis/mapper/indexLib/indexLib-mapper.xml index 0f74884..6a0c07e 100644 --- a/src/main/resources/mybatis/mapper/indexLib/indexLib-mapper.xml +++ b/src/main/resources/mybatis/mapper/indexLib/indexLib-mapper.xml @@ -47,14 +47,21 @@ - - + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/indexTemplate/indexTemplate-mapper.xml b/src/main/resources/mybatis/mapper/indexTemplate/indexTemplate-mapper.xml index c3ab366..c450379 100644 --- a/src/main/resources/mybatis/mapper/indexTemplate/indexTemplate-mapper.xml +++ b/src/main/resources/mybatis/mapper/indexTemplate/indexTemplate-mapper.xml @@ -8,6 +8,7 @@ + @@ -18,6 +19,7 @@ + @@ -33,6 +35,7 @@ + @@ -50,6 +53,7 @@ index_template_save_path, index_template_upload_path, index_template_list_path, + index_template_table_name, index_template_remark, index_template_state, gmt_create, @@ -63,6 +67,7 @@ #{indexTemplateSavePath}, #{indexTemplateUploadPath}, #{indexTemplateListPath}, + #{indexTemplateTableName} #{indexTemplateRemark}, #{indexTemplateState}, #{gmtCreate}, @@ -107,24 +112,15 @@ UPDATE duty_index_template SET - - index_template_name = #{indexTemplateName}, - - - index_template_save_path = #{indexTemplateSavePath}, - - - index_template_upload_path = #{indexTemplateUploadPath}, - - - index_template_list_path = #{indexTemplateListPath}, - - - index_template_remark = #{indexTemplateRemark}, - index_template_state = #{indexTemplateState}, + index_template_name = #{indexTemplateName}, + index_template_save_path = #{indexTemplateSavePath}, + index_template_upload_path = #{indexTemplateUploadPath}, + index_template_list_path = #{indexTemplateListPath}, + index_template_table_name = #{indexTemplateTableName}, + index_template_remark = #{indexTemplateRemark}, modifier = #{modifier}, gmt_modified = #{gmtModified} WHERE @@ -138,6 +134,7 @@ t1.index_template_save_path, t1.index_template_upload_path, t1.index_template_list_path, + t1.index_template_table_name, t1.index_template_remark, t1.index_template_state, t1.index_template_id @@ -159,6 +156,7 @@ t1.index_template_save_path, t1.index_template_upload_path, t1.index_template_list_path, + t1.index_template_table_name, t1.index_template_remark, t1.index_template_state, t1.gmt_create, @@ -183,6 +181,7 @@ t1.index_template_save_path, t1.index_template_upload_path, t1.index_template_list_path, + t1.index_template_table_name, t1.index_template_remark, t1.index_template_state, t1.gmt_create, @@ -207,6 +206,7 @@ t1.index_template_save_path, t1.index_template_upload_path, t1.index_template_list_path, + t1.index_template_table_name, t1.index_template_remark, t1.index_template_state FROM @@ -236,6 +236,7 @@ t1.index_template_save_path, t1.index_template_upload_path, t1.index_template_list_path, + t1.index_template_table_name, t1.index_template_remark, t1.index_template_state, t1.gmt_create, @@ -269,6 +270,7 @@ t1.index_template_save_path, t1.index_template_upload_path, t1.index_template_list_path, + t1.index_template_table_name, t1.index_template_remark, t1.index_template_state, t1.gmt_create, diff --git a/src/main/resources/static/assets/js/vendor/ueditor/lang/zh-cn/images/localimage.png b/src/main/resources/static/assets/js/vendor/ueditor/lang/zh-cn/images/localimage.png index 7303c36..e073553 100644 Binary files a/src/main/resources/static/assets/js/vendor/ueditor/lang/zh-cn/images/localimage.png and b/src/main/resources/static/assets/js/vendor/ueditor/lang/zh-cn/images/localimage.png differ diff --git a/src/main/resources/static/assets/js/vendor/ueditor/themes/iframe.css b/src/main/resources/static/assets/js/vendor/ueditor/themes/iframe.css index 9241470..2de88a7 100644 --- a/src/main/resources/static/assets/js/vendor/ueditor/themes/iframe.css +++ b/src/main/resources/static/assets/js/vendor/ueditor/themes/iframe.css @@ -1 +1,4 @@ -/*可以在这里添加你自己的css*/ \ No newline at end of file +/*可以在这里添加你自己的css*/ +img { + max-width: 100%; /*图片自适应宽度*/ +} \ No newline at end of file diff --git a/src/main/resources/static/route/indexTemplate/list.html b/src/main/resources/static/route/indexTemplate/list.html index 80751f8..9dc8892 100644 --- a/src/main/resources/static/route/indexTemplate/list.html +++ b/src/main/resources/static/route/indexTemplate/list.html @@ -120,6 +120,15 @@ return rowData; } }, + {field: 'indexTemplateTableName', width: 180, title: '业务表名', align:'center', + templet: function(row) { + var rowData = row[this.field]; + if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + return '-'; + } + return rowData; + } + }, {field: 'indexTemplateRemark', width: 180, title: '模板说明', align:'center', templet: function(row) { var rowData = row[this.field]; diff --git a/src/main/resources/static/route/indexTemplate/save.html b/src/main/resources/static/route/indexTemplate/save.html index ab2b0b4..930ef03 100644 --- a/src/main/resources/static/route/indexTemplate/save.html +++ b/src/main/resources/static/route/indexTemplate/save.html @@ -46,6 +46,12 @@ +
+ +
+ +
+
diff --git a/src/main/resources/static/route/indexTemplate/update.html b/src/main/resources/static/route/indexTemplate/update.html index 0a97ffe..b19c912 100644 --- a/src/main/resources/static/route/indexTemplate/update.html +++ b/src/main/resources/static/route/indexTemplate/update.html @@ -46,6 +46,12 @@
+
+ +
+ +
+