From df7e623f4fb5c823549c8e7e869a2106804d7bee Mon Sep 17 00:00:00 2001 From: pan <380711010@qq.com> Date: Tue, 3 Sep 2024 16:16:36 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=89=80=E6=9C=89=E6=90=9C=E7=B4=A2=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E8=B0=83=E6=95=B4=202.=E7=BB=9F=E8=AE=A1=E5=88=86?= =?UTF-8?q?=E6=9E=90=E8=B0=83=E6=95=B4=203.=E5=AF=BC=E5=87=BAword=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/service/impl/DocumentServiceImpl.java | 34 ++++++++++++++++--- .../web/service/impl/ToolServiceImpl.java | 29 ++++++++++++++-- .../resources/mapper/DownloadCountMapper.xml | 6 ++++ .../src/main/resources/mapper/ToolMapper.xml | 2 +- 4 files changed, 64 insertions(+), 7 deletions(-) diff --git a/tool-tech-admin/src/main/java/com/rzdata/web/service/impl/DocumentServiceImpl.java b/tool-tech-admin/src/main/java/com/rzdata/web/service/impl/DocumentServiceImpl.java index c6a7ec9..9ee4e17 100644 --- a/tool-tech-admin/src/main/java/com/rzdata/web/service/impl/DocumentServiceImpl.java +++ b/tool-tech-admin/src/main/java/com/rzdata/web/service/impl/DocumentServiceImpl.java @@ -286,12 +286,17 @@ public class DocumentServiceImpl implements IDocumentService private void assembleData(List> countType, List> countSource) { // - List toolTypeList = sysDictTypeService.selectDictDataByType("doc_class"); - List toolSourceList = sysDictTypeService.selectDictDataByType("doc_source"); + List docClassList = sysDictTypeService.selectDictDataByType("doc_class"); + List docSourceList = sysDictTypeService.selectDictDataByType("doc_source"); + + //初始化数据 + initDictData(docClassList,countType); + initDictData(docSourceList, countSource); + if(CollUtil.isNotEmpty(countType)){ for (Map map : countType) { map.put("value", map.get("statistics")); - for (SysDictData sysDictData : toolTypeList) { + for (SysDictData sysDictData : docClassList) { if(sysDictData.getDictValue().equals(map.get("types"))){ map.put("name", sysDictData.getDictLabel()); break; @@ -302,7 +307,7 @@ public class DocumentServiceImpl implements IDocumentService if(CollUtil.isNotEmpty(countSource)){ for (Map map : countSource) { map.put("value", map.get("statistics")); - for (SysDictData sysDictData : toolSourceList) { + for (SysDictData sysDictData : docSourceList) { if(sysDictData.getDictValue().equals(map.get("types"))){ map.put("name", sysDictData.getDictLabel()); break; @@ -312,6 +317,27 @@ public class DocumentServiceImpl implements IDocumentService } } + private void initDictData(List dictDataList, List> mapTypeList) { + for (SysDictData sysDictData : dictDataList) { + boolean flag = false; + for (Map map : mapTypeList) { + if(sysDictData.getDictValue().equals(map.get("types"))){ + flag = true; + break; + } + } + if(!flag){ + Map map = new HashMap<>(); + map.put("value", "0"); + map.put("name", sysDictData.getDictLabel()); + map.put("types", sysDictData.getDictValue()); + map.put("statistics", "0"); + mapTypeList.add(map); + } + } + } + + @Override public List selectAllList(Document document) { List documents = documentMapper.selectDocumentList(document); diff --git a/tool-tech-admin/src/main/java/com/rzdata/web/service/impl/ToolServiceImpl.java b/tool-tech-admin/src/main/java/com/rzdata/web/service/impl/ToolServiceImpl.java index 25a5cc5..636e25e 100644 --- a/tool-tech-admin/src/main/java/com/rzdata/web/service/impl/ToolServiceImpl.java +++ b/tool-tech-admin/src/main/java/com/rzdata/web/service/impl/ToolServiceImpl.java @@ -286,7 +286,7 @@ public class ToolServiceImpl implements IToolService List> countToolType = toolMapper.countToolType(); List> toolSource = toolMapper.toolSource(); List> recordStatus = toolMapper.recordStatus(); - //组织数据 + //组装数据 assembleData(countToolType, toolSource, recordStatus); result.put("countToolType", countToolType); @@ -298,9 +298,14 @@ public class ToolServiceImpl implements IToolService private void assembleData(List> countToolType, List> toolSource, List> recordStatus) { List toolTypeList = sysDictTypeService.selectDictDataByType("tool_type"); - List flowStatusList = sysDictTypeService.selectDictDataByType("flow_status"); + List flowStatusList = sysDictTypeService.selectDictDataByType("flow_status").stream().filter(item -> !item.getDictValue().equals("cancel")).collect(Collectors.toList()); List toolSourceList = sysDictTypeService.selectDictDataByType("tool_source"); + //初始化数据 + initDictData(toolTypeList, countToolType); + initDictData(toolSourceList, toolSource); + initDictData(flowStatusList, recordStatus); + if(CollUtil.isNotEmpty(countToolType)){ for (Map map : countToolType) { map.put("value", map.get("statistics")); @@ -340,6 +345,26 @@ public class ToolServiceImpl implements IToolService } } + private void initDictData(List dictDataList, List> mapTypeList) { + for (SysDictData sysDictData : dictDataList) { + boolean flag = false; + for (Map map : mapTypeList) { + if(sysDictData.getDictValue().equals(map.get("types"))){ + flag = true; + break; + } + } + if(!flag){ + Map map = new HashMap<>(); + map.put("value", "0"); + map.put("name", sysDictData.getDictLabel()); + map.put("types", sysDictData.getDictValue()); + map.put("statistics", "0"); + mapTypeList.add(map); + } + } + } + @Override public List selectAllList(Tool tool) { diff --git a/tool-tech-admin/src/main/resources/mapper/DownloadCountMapper.xml b/tool-tech-admin/src/main/resources/mapper/DownloadCountMapper.xml index 7fc6b7b..09eac70 100644 --- a/tool-tech-admin/src/main/resources/mapper/DownloadCountMapper.xml +++ b/tool-tech-admin/src/main/resources/mapper/DownloadCountMapper.xml @@ -35,6 +35,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND date_format(tdc.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') + + AND tl.tool_code like concat('%', #{toolCode}, '%') + + + AND tl.tool_name like concat('%', #{toolName}, '%') + group by tdc.tool_id,tl.tool_code,tl.tool_name diff --git a/tool-tech-admin/src/main/resources/mapper/ToolMapper.xml b/tool-tech-admin/src/main/resources/mapper/ToolMapper.xml index ecec678..d722bfc 100644 --- a/tool-tech-admin/src/main/resources/mapper/ToolMapper.xml +++ b/tool-tech-admin/src/main/resources/mapper/ToolMapper.xml @@ -155,7 +155,7 @@ AND u.tool_id = #{toolId} - AND u.tool_code = #{toolCode} + AND u.tool_code like concat('%', #{toolCode}, '%') AND u.tool_name like concat('%', #{toolName}, '%')