From 5f2b7d7778d44500efe7f233f4f6ef32cf783fb4 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Wed, 26 Oct 2022 09:44:20 +0800 Subject: [PATCH 1/7] =?UTF-8?q?pageWithAttrs=20=E6=94=AF=E6=8C=81=E9=9D=9E?= =?UTF-8?q?=E4=B8=AD=E6=96=87=E8=AF=95=E7=94=A8=20like=20=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/resource/dao/ResourceDao.java | 7 +++- .../service/impl/ResourceServiceImpl.java | 16 ++++---- .../resources/mapper/resource/ResourceDao.xml | 40 ++++++++++++------- 3 files changed, 40 insertions(+), 23 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java b/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java index 5eaa24d4..21982609 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java @@ -26,7 +26,9 @@ public interface ResourceDao extends BaseDao { @Cacheable(value = "selectWithAttrs", key = "#p0+'-'+#orderField+'-'+#orderType") List selectWithAttrs(@Param("dto") ResourceDTO resourceDTO, @Param("orderField") String orderField, - @Param("orderType") String orderType); + @Param("orderType") String orderType, + @Param("nonChinese") Boolean nonChinese + ); List selectTypeCount(String type); @@ -39,7 +41,8 @@ public interface ResourceDao extends BaseDao { @Param("pageSize") Integer pageSize, @Param("orderField") String orderField, @Param("orderType") String orderType, - @Param("ids") List ids + @Param("ids") List ids, + @Param("nonChinese") Boolean nonChinese ); /** diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index 21b81203..22073c80 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -404,6 +404,7 @@ public class ResourceServiceImpl extends CrudServiceImpl common(Page resultPage, List selectDTOPageSpecilTotal, ResourceDTO resourceDTO, String orderField, String orderType, Integer pageNum, Integer pageSize) { + private Page common(Page resultPage, List selectDTOPageSpecilTotal, ResourceDTO resourceDTO, + String orderField, String orderType, Integer pageNum, Integer pageSize, Boolean nonChinese) { if (resourceDTO.getInfoList().isEmpty()) { List resourceDTOS; if (orderField.equals("total")) { // 对总体评价特殊处理 @@ -514,7 +516,7 @@ public class ResourceServiceImpl extends CrudServiceImpl { ResourceDTO index = (ResourceDTO) x; @@ -544,13 +546,13 @@ public class ResourceServiceImpl extends CrudServiceImpl resourceDTOS = resourceDao.selectWithAttrs(resourceDTO, orderField, orderType); + List resourceDTOS = resourceDao.selectWithAttrs(resourceDTO, orderField, orderType, nonChinese); if (resourceDTOS.isEmpty()) { resultPage.setRecords(new ArrayList<>()); resultPage.setTotal(0); @@ -1501,7 +1503,7 @@ public class ResourceServiceImpl extends CrudServiceImpl maps = resourceDao.selectAppList((pageNum - 1) * 9, type, area); maps.forEach(x -> x.put("pic", resourceDao.selectPicByResId(x.get("id").toString()))); return new HashMap() {{ - put("appList",maps); + put("appList", maps); put("total", resourceDao.selectAppListCount(type, area)); }}; } diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index 9763fa3c..3c653387 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -157,9 +157,12 @@ AND MATCH (tdr.type) AGAINST ( #{dto.type} IN BOOLEAN MODE) - + AND MATCH (tdr.name) AGAINST ( #{dto.name} IN BOOLEAN MODE) + + AND tdr.name LIKE CONCAT( '%', #{dto.name}, '%' ) + AND tdr.district_id = #{dto.districtId} @@ -210,7 +213,6 @@ ORDER BY ${orderField} ${orderType} - @@ -442,9 +444,12 @@ AND tdr.type != '赋能案例' - + AND MATCH (tdr.name) AGAINST ( #{dto.name} IN BOOLEAN MODE) + + AND tdr.name LIKE CONCAT( '%', #{dto.name}, '%' ) + AND MATCH (tdr.type) AGAINST ( #{dto.type} IN BOOLEAN MODE) @@ -1601,7 +1606,8 @@ AND sd.type = #{type} - AND JSON_EXTRACT( info_list, JSON_UNQUOTE( REPLACE ( JSON_SEARCH( info_list, 'all', '应用领域', NULL, '$[*].attrType' ), 'attrType', 'attrValue' ) ) ) LIKE CONCAT( '%', #{area}, '%' ) + AND JSON_EXTRACT( info_list, JSON_UNQUOTE( REPLACE ( JSON_SEARCH( info_list, 'all', '应用领域', NULL, + '$[*].attrType' ), 'attrType', 'attrValue' ) ) ) LIKE CONCAT( '%', #{area}, '%' ) ORDER BY sd.type, sr.sort, sd.sort, tdr.dept_id, tdr.visitor DESC, tdr.id DESC @@ -1868,7 +1874,8 @@ @@ -2201,12 +2209,14 @@ 1 = 1 AND MATCH ( tdr.type ) AGAINST ( '组件服务' IN BOOLEAN MODE ) AND tdr.del_flag = 0 - AND tdr.id IN ( SELECT data_resource_id FROM tb_data_attr WHERE attr_type = '组件类型' AND attr_value = #{type} AND del_flag = 0 ) - + AND tdr.id IN ( SELECT data_resource_id FROM tb_data_attr WHERE attr_type = '组件类型' AND attr_value = #{type} + AND del_flag = 0 ) + AND sd.type = #{deptType} - - AND JSON_EXTRACT( info_list, JSON_UNQUOTE( REPLACE ( JSON_SEARCH( info_list, 'all', '应用领域', NULL, '$[*].attrType' ), 'attrType', 'attrValue' ) ) ) LIKE CONCAT( '%', #{area}, '%') + + AND JSON_EXTRACT( info_list, JSON_UNQUOTE( REPLACE ( JSON_SEARCH( info_list, 'all', '应用领域', NULL, + '$[*].attrType' ), 'attrType', 'attrValue' ) ) ) LIKE CONCAT( '%', #{area}, '%') ORDER BY sd.type, @@ -2226,12 +2236,14 @@ 1 = 1 AND MATCH ( tdr.type ) AGAINST ( '组件服务' IN BOOLEAN MODE ) AND tdr.del_flag = 0 - AND tdr.id IN ( SELECT data_resource_id FROM tb_data_attr WHERE attr_type = '组件类型' AND attr_value = #{type} AND del_flag = 0 ) - + AND tdr.id IN ( SELECT data_resource_id FROM tb_data_attr WHERE attr_type = '组件类型' AND attr_value = #{type} + AND del_flag = 0 ) + AND sd.type = #{deptType} - - AND JSON_EXTRACT( info_list, JSON_UNQUOTE( REPLACE ( JSON_SEARCH( info_list, 'all', '应用领域', NULL, '$[*].attrType' ), 'attrType', 'attrValue' ) ) ) LIKE CONCAT( '%', #{area}, '%') + + AND JSON_EXTRACT( info_list, JSON_UNQUOTE( REPLACE ( JSON_SEARCH( info_list, 'all', '应用领域', NULL, + '$[*].attrType' ), 'attrType', 'attrValue' ) ) ) LIKE CONCAT( '%', #{area}, '%') From e836bcb271c04a0dbc8f48ea66fbd2218ca30cd9 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Wed, 26 Oct 2022 10:34:11 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E5=85=A8=E5=B1=80=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E6=94=AF=E6=8C=81=E9=9D=9E=E4=B8=AD=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/resource/controller/ResourceController.java | 4 ++-- .../java/io/renren/modules/resource/dao/ResourceDao.java | 2 +- .../renren/modules/resource/service/ResourceService.java | 2 +- .../resource/service/impl/ResourceServiceImpl.java | 8 ++++---- .../src/main/resources/mapper/resource/ResourceDao.xml | 5 ++++- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java index ac0403a3..6b3d82bb 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java @@ -636,8 +636,8 @@ public class ResourceController { @GetMapping("/getCountByFuzzyQuery") @ApiOperation("获取各类资源模糊查询总数") @LogOperation("获取各类资源模糊查询总数") - public Result getCountByFuzzyQuery(@RequestParam String keyWorld) { - return new Result<>().ok(resourceService.getCountByFuzzyQuery(keyWorld)); + public Result getCountByFuzzyQuery(@RequestParam String keyWorld, @RequestParam String nonChinese) { + return new Result<>().ok(resourceService.getCountByFuzzyQuery(keyWorld, nonChinese)); } diff --git a/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java b/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java index 21982609..aac0a00e 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java @@ -178,7 +178,7 @@ public interface ResourceDao extends BaseDao { String selectPicByResId(@Param("id") String id); - List selectTypeCountByName(@Param("keyWorld") String keyWorld); + List selectTypeCountByName(@Param("keyWorld") String keyWorld, @Param("nonChinese") Boolean nonChinese); List countByCIMType(@Param("deptId") Long deptId); diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/ResourceService.java b/renren-admin/src/main/java/io/renren/modules/resource/service/ResourceService.java index a6caed9b..db38453c 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/ResourceService.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/ResourceService.java @@ -140,7 +140,7 @@ public interface ResourceService extends CrudService common(Page resultPage, List selectDTOPageSpecilTotal, ResourceDTO resourceDTO, - String orderField, String orderType, Integer pageNum, Integer pageSize, Boolean nonChinese) { + private Page common(Page resultPage, List selectDTOPageSpecilTotal, ResourceDTO resourceDTO, String orderField, String orderType, Integer pageNum, Integer pageSize, Boolean nonChinese) { if (resourceDTO.getInfoList().isEmpty()) { List resourceDTOS; if (orderField.equals("total")) { // 对总体评价特殊处理 @@ -1978,9 +1977,10 @@ public class ResourceServiceImpl extends CrudServiceImpl resultList = new ArrayList<>(); - CompletableFuture DBresourceCount = CompletableFuture.runAsync(() -> resultList.addAll(resourceDao.selectTypeCountByName(keyWorld))); + Boolean nonChinese_ = Boolean.getBoolean(nonChinese);// 不传默认为中文走全文索引 + CompletableFuture DBresourceCount = CompletableFuture.runAsync(() -> resultList.addAll(resourceDao.selectTypeCountByName(keyWorld, nonChinese_))); final Integer[] meetCountNew = new Integer[1]; switch (Constant.ProjectPlace.getByFlag(projectPlace)) { case TSINGTAO: { diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index 3c653387..d1638dec 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -1632,9 +1632,12 @@ FROM tb_data_resource WHERE 1 = 1 AND del_flag = 0 - + AND MATCH (name) AGAINST ( #{keyWorld} IN BOOLEAN MODE) + + AND name LIKE CONCAT( '%', #{keyWorld}, '%' ) + AND type != '赋能案例' GROUP BY type ORDER BY type From 088559f089397956bbf07b935884610b096d32fc Mon Sep 17 00:00:00 2001 From: wangliwen Date: Wed, 26 Oct 2022 11:23:21 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E7=9F=A5=E8=AF=86=E5=BA=93=E6=95=B0?= =?UTF-8?q?=E7=9B=AE=E4=B8=8D=E4=B8=80=E8=87=B4=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/resource/ResourceDao.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index d1638dec..dc19d09f 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -282,7 +282,7 @@ AND tdr.type != '知识库' AND tdr.type != '赋能案例' - AND MATCH (tdr.type) AGAINST ( #{type} IN BOOLEAN MODE) + AND tdr.type = #{type} AND MATCH (tdr.name) AGAINST ( #{name} IN BOOLEAN MODE) @@ -451,7 +451,7 @@ AND tdr.name LIKE CONCAT( '%', #{dto.name}, '%' ) - AND MATCH (tdr.type) AGAINST ( #{dto.type} IN BOOLEAN MODE) + AND tdr.type = #{dto.type} @@ -511,7 +511,7 @@ AND MATCH (tdr.name) AGAINST ( #{dto.name} IN BOOLEAN MODE) - AND MATCH (tdr.type) AGAINST ( #{dto.type} IN BOOLEAN MODE) + AND tdr.type = #{dto.type} AND tdr.district_id = #{dto.districtId} @@ -543,7 +543,7 @@ AND MATCH (tdr.name) AGAINST ( #{dto.name} IN BOOLEAN MODE) - AND MATCH (tdr.type) AGAINST ( #{dto.type} IN BOOLEAN MODE) + AND tdr.type = #{dto.type} AND tdr.district_id = #{dto.districtId} @@ -663,7 +663,7 @@ sys_dept sd LEFT JOIN ( SELECT dept_id, COUNT( id ) AS "deptCount" FROM tb_data_resource WHERE 1 = 1 AND del_flag = 0 - AND MATCH (type) AGAINST ( #{resourceType} IN BOOLEAN MODE) + AND type = #{resourceType} GROUP BY dept_id ) tdr ON sd.id = tdr.dept_id ) temp1 @@ -704,7 +704,7 @@ LEFT JOIN ( SELECT dept_id, COUNT( id ) AS "deptCount" FROM tb_data_resource WHERE 1 = 1 AND del_flag = 0 - AND MATCH (type) AGAINST ( #{resourceType} IN BOOLEAN MODE) + AND type = #{resourceType} GROUP BY dept_id ) tdr ON sd.id = tdr.dept_id LEFT JOIN sys_region sr ON sd.district = sr.id @@ -1076,7 +1076,7 @@ FROM tb_data_resource WHERE 1 = 1 AND del_flag = 0 - AND MATCH (type) AGAINST ( #{type} IN BOOLEAN MODE) + AND type = #{type} AND type != '赋能案例' From b4db7eb6fcb490e9bf97603246142b398213ebfd Mon Sep 17 00:00:00 2001 From: wangliwen Date: Wed, 26 Oct 2022 13:54:04 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E4=BA=BA=E4=B8=BA?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=97=B6=20=E5=85=81=E8=AE=B8=E8=BD=AC?= =?UTF-8?q?=E5=8A=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../renren/modules/demanData/listener/DemandDataListener.java | 3 +++ .../renren/modules/demandComment/listener/CommentListener.java | 1 + .../modules/processForm/listener/DataCenterListener.java | 1 + .../modules/processForm/listener/v2/CorrectionListenerV2.java | 1 + .../resource/listener/ResourceUndercarriageListener.java | 2 ++ .../resourceMountApply/listener/ResourceOwnerListener.java | 3 +++ 6 files changed, 11 insertions(+) diff --git a/renren-admin/src/main/java/io/renren/modules/demanData/listener/DemandDataListener.java b/renren-admin/src/main/java/io/renren/modules/demanData/listener/DemandDataListener.java index 29ff7cbb..e3f09ccc 100644 --- a/renren-admin/src/main/java/io/renren/modules/demanData/listener/DemandDataListener.java +++ b/renren-admin/src/main/java/io/renren/modules/demanData/listener/DemandDataListener.java @@ -146,6 +146,7 @@ public class DemandDataListener implements TaskListener, ExecutionListener, Acti logger.error("未查到该部门对应的{} ", roleName); taskService.setAssignee(delegateTask.getId(), defaultAssigneeRoleId); assignee = defaultAssigneeRoleId; + taskService.setVariable(delegateTask.getId(), "allowEntrust", Boolean.TRUE); // 允许被委托 } } else { // 填入大数据审批人 logger.error("大数据局名称:{}", bigDateDeptName); @@ -157,10 +158,12 @@ public class DemandDataListener implements TaskListener, ExecutionListener, Acti logger.error("大数据审批人id:{}", userDTO.getId()); taskService.setAssignee(delegateTask.getId(), userDTO.getId().toString()); assignee = userDTO.getId().toString(); + taskService.setVariable(delegateTask.getId(), "allowEntrust", Boolean.TRUE); // 允许被委托 } else { taskService.setAssignee(delegateTask.getId(), defaultAssigneeRoleId); logger.error("未查到大数据部门对应 {}", roleName); assignee = defaultAssigneeRoleId; + taskService.setVariable(delegateTask.getId(), "allowEntrust", Boolean.TRUE); // 允许被委托 } } diff --git a/renren-admin/src/main/java/io/renren/modules/demandComment/listener/CommentListener.java b/renren-admin/src/main/java/io/renren/modules/demandComment/listener/CommentListener.java index b5a0511f..17013a27 100644 --- a/renren-admin/src/main/java/io/renren/modules/demandComment/listener/CommentListener.java +++ b/renren-admin/src/main/java/io/renren/modules/demandComment/listener/CommentListener.java @@ -142,6 +142,7 @@ public class CommentListener implements TaskListener, ExecutionListener, Activit delegateTask.setAssignee(defaultAssigneeRoleId); logger.error("未查到该部门对应 {}", roleName); assignee = defaultAssigneeRoleId; + taskService.setVariable(delegateTask.getId(), "allowEntrust", Boolean.TRUE); // 允许被委托 } Map kv = delegateTask.getVariables(); diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/listener/DataCenterListener.java b/renren-admin/src/main/java/io/renren/modules/processForm/listener/DataCenterListener.java index 7b511222..9a0f253f 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/listener/DataCenterListener.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/listener/DataCenterListener.java @@ -113,6 +113,7 @@ public class DataCenterListener implements TaskListener, ExecutionListener, Acti logger.error("审批人id:" + userDTO.getId()); taskService.setAssignee(delegateTask.getId(), userDTO.getId().toString()); assignee = userDTO.getId().toString(); + taskService.setVariable(delegateTask.getId(), "allowEntrust", Boolean.TRUE); // 允许被委托 } else { delegateTask.setAssignee(defaultAssigneeRoleId); logger.error("未查到该部门对应 " + roleName); diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/listener/v2/CorrectionListenerV2.java b/renren-admin/src/main/java/io/renren/modules/processForm/listener/v2/CorrectionListenerV2.java index 20f90c07..4daec746 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/listener/v2/CorrectionListenerV2.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/listener/v2/CorrectionListenerV2.java @@ -185,6 +185,7 @@ public class CorrectionListenerV2 implements TaskListener, ExecutionListener, Ac logger.error("未查到该部门 {} 对应的 {}", deptId, roleName); taskService.setAssignee(delegateTask.getId(), defaultAssigneeRoleId); assignee = defaultAssigneeRoleId; + taskService.setVariable(delegateTask.getId(), "allowEntrust", Boolean.TRUE); // 允许被委托 } if (kv.containsKey("tAbilityApplicationDTOList")) { List dtoList = (List) kv.get("tAbilityApplicationDTOList"); diff --git a/renren-admin/src/main/java/io/renren/modules/resource/listener/ResourceUndercarriageListener.java b/renren-admin/src/main/java/io/renren/modules/resource/listener/ResourceUndercarriageListener.java index 16ddcc66..33aa24bc 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/listener/ResourceUndercarriageListener.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/listener/ResourceUndercarriageListener.java @@ -143,9 +143,11 @@ public class ResourceUndercarriageListener implements TaskListener, ExecutionLis } else { logger.error("未查到该部门对应的 " + roleName + " 将使用大数据部门审核人"); assignee = defaultUser(delegateTask.getId(), roleDTO); + taskService.setVariable(delegateTask.getId(), "allowEntrust", Boolean.TRUE); // 允许被委托 } } else { assignee = defaultUser(delegateTask.getId(), roleDTO); + taskService.setVariable(delegateTask.getId(), "allowEntrust", Boolean.TRUE); // 允许被委托 } if (StringUtils.isNotEmpty(assignee) diff --git a/renren-admin/src/main/java/io/renren/modules/resourceMountApply/listener/ResourceOwnerListener.java b/renren-admin/src/main/java/io/renren/modules/resourceMountApply/listener/ResourceOwnerListener.java index c859ca37..1c54410f 100644 --- a/renren-admin/src/main/java/io/renren/modules/resourceMountApply/listener/ResourceOwnerListener.java +++ b/renren-admin/src/main/java/io/renren/modules/resourceMountApply/listener/ResourceOwnerListener.java @@ -215,6 +215,7 @@ public class ResourceOwnerListener implements TaskListener, ExecutionListener, A logger.error("未查到该部门对应的 " + roleName); taskService.setAssignee(delegateTask.getId(), defaultAssigneeRoleId); assignee = defaultAssigneeRoleId; + taskService.setVariable(delegateTask.getId(), "allowEntrust", Boolean.TRUE); // 允许被委托 } } else if (resourceMountApplyDTO.getDeptId() != null) { SysUserDTO userDTO = sysUserService.getByDeptIdAndRoleId(Long.valueOf(resourceMountApplyDTO.getDeptId()), roleDTO.getId()); @@ -226,6 +227,7 @@ public class ResourceOwnerListener implements TaskListener, ExecutionListener, A taskService.setAssignee(delegateTask.getId(), defaultAssigneeRoleId); logger.error("未查到部门对应 " + resourceMountApplyDTO.getDeptId()); assignee = defaultAssigneeRoleId; + taskService.setVariable(delegateTask.getId(), "allowEntrust", Boolean.TRUE); // 允许被委托 } } else { logger.error("大数据局名称:" + bigDateDeptName); @@ -241,6 +243,7 @@ public class ResourceOwnerListener implements TaskListener, ExecutionListener, A taskService.setAssignee(delegateTask.getId(), defaultAssigneeRoleId); logger.error("未查到大数据部门对应 " + roleName); assignee = defaultAssigneeRoleId; + taskService.setVariable(delegateTask.getId(), "allowEntrust", Boolean.TRUE); // 允许被委托 } } From a34a6be0f60ee843a79ed4a4d6584d44368d69a8 Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Wed, 26 Oct 2022 17:22:50 +0800 Subject: [PATCH 5/7] =?UTF-8?q?1.=E8=83=BD=E5=8A=9B=E5=B9=BF=E5=9C=BA?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2=E5=A2=9E=E5=8A=A0=E5=9B=BE?= =?UTF-8?q?=E7=89=87=202.=E9=97=A8=E6=88=B7=E9=A6=96=E9=A1=B5-=E8=83=BD?= =?UTF-8?q?=E5=8A=9B=E6=B1=87=E8=81=9A-=E5=9F=BA=E7=A1=80=E8=AE=BE?= =?UTF-8?q?=E6=96=BD=E5=A2=9E=E5=8A=A0=E4=BC=9A=E5=AE=A2=E5=8E=85=E5=92=8C?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E4=BC=9A=E8=AE=AE=E6=95=B0=E9=87=8F=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/resource/dao/ResourceDao.java | 2 +- .../service/impl/ResourceServiceImpl.java | 45 ++++++++++++++----- .../resources/mapper/resource/ResourceDao.xml | 12 ++++- 3 files changed, 46 insertions(+), 13 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java b/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java index aac0a00e..47a3b5b6 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java @@ -176,7 +176,7 @@ public interface ResourceDao extends BaseDao { List selectAppList(@Param("pageNum") int pageNum, @Param("type") Integer type, @Param("area") String area); - String selectPicByResId(@Param("id") String id); + String selectPicByResId(@Param("id") String id, @Param("resourceType") String resourceType); List selectTypeCountByName(@Param("keyWorld") String keyWorld, @Param("nonChinese") Boolean nonChinese); diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index 893c8310..cee417f9 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -16,7 +16,9 @@ import io.renren.common.domain.Tsingtao_xhaProperties; import io.renren.common.page.PageData; import io.renren.common.service.impl.CrudServiceImpl; import io.renren.common.utils.DateUtils; +import io.renren.modules.enke.service.EnkeService; import io.renren.modules.meeting.dao.TMeetingroomMapper; +import io.renren.modules.meeting.entity.TMeetingroom; import io.renren.modules.monitor.dto.CameraChannelDto1; import io.renren.modules.monitor.entity.CameraChannel; import io.renren.modules.monitor.mapper.CameraChannelMapper; @@ -191,6 +193,9 @@ public class ResourceServiceImpl extends CrudServiceImpl getWrapper(Map params) { @@ -1500,7 +1505,7 @@ public class ResourceServiceImpl extends CrudServiceImpl maps = resourceDao.selectAppList((pageNum - 1) * 9, type, area); - maps.forEach(x -> x.put("pic", resourceDao.selectPicByResId(x.get("id").toString()))); + maps.forEach(x -> x.put("pic", resourceDao.selectPicByResId(x.get("id").toString(), "应用资源"))); return new HashMap() {{ put("appList", maps); put("total", resourceDao.selectAppListCount(type, area)); @@ -1877,14 +1882,33 @@ public class ResourceServiceImpl extends CrudServiceImpl resultMap = new HashMap<>(); - Map map = (Map) selectTotal(); - List> list = (List>) map.get("total"); - list.forEach(index -> { - if ("基础设施".equals(index.get("type").toString())) { - resultMap.put("视频资源", Integer.parseInt(index.get("count").toString())); - } - }); resultMap.put("云资源", 0); + //视频资源 + CompletableFuture jcss = CompletableFuture.runAsync(() -> { + Map map = (Map) selectTotal(); + List> list = (List>) map.get("total"); + list.forEach(index -> { + if ("基础设施".equals(index.get("type").toString())) { + resultMap.put("视频资源", Integer.parseInt(index.get("count").toString())); + } + }); + }, executor); + + //新增会客厅和视频会议统计 + //会客厅 + CompletableFuture hkt = CompletableFuture.runAsync(() -> { + QueryWrapper wrapper = new QueryWrapper<>(); + resultMap.put("会客厅", tMeetingroomMapper.selectCount(wrapper)); + + }, executor); + + //视频会议 + CompletableFuture sphy = CompletableFuture.runAsync(() -> { + resultMap.put("视频会议", enkeService.page(new HashMap<>()).getTotal()); + }, executor); + CompletableFuture all = CompletableFuture.allOf(jcss, hkt, sphy); + all.join(); + return resultMap; } @@ -2404,7 +2428,6 @@ public class ResourceServiceImpl extends CrudServiceImpl maps = resourceDao.getSquareList(type, deptType, area, i, pageSize); + maps.forEach(x -> x.put("pic", resourceDao.selectPicByResId(x.get("id").toString(), type))); return new HashMap() {{ - put("list", resourceDao.getSquareList(type, deptType, area, i, pageSize)); + put("list", maps); put("total", resourceDao.getSquareListCount(type, deptType, area)); }}; } diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index dc19d09f..710318ac 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -1620,8 +1620,16 @@ FROM tb_data_attr tda LEFT JOIN tb_data_resource tdr ON tda.data_resource_id = tdr.id - WHERE - tda.attr_type = '应用图片' + WHERE 1 = 1 + + AND tda.attr_type = '应用图片' + + + AND tda.attr_type = '图层缩略图' + + + AND tda.attr_type = '应用场景' + AND tdr.id = #{id} AND tda.del_flag = 0 From 27d2f13fc540190dbb6b9c5a84e1395bad52588a Mon Sep 17 00:00:00 2001 From: lizhicheng Date: Wed, 26 Oct 2022 18:01:05 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=B7=B2=E4=B8=8B=E6=9E=B6=E3=80=81=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E6=97=B6=E9=97=B4=E5=8D=95=E4=BD=8D=E3=80=81=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=81=A9=E7=A7=91=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/db/V7.0__enke_hostinfo_add_table.sql | 14 ++++++++++++-- .../activiti/service/impl/ActivitiServiceImpl.java | 14 +++++++------- .../modules/security/config/ShiroConfig.java | 1 + .../main/resources/mapper/resource/ResourceDao.xml | 12 ++++++------ 4 files changed, 26 insertions(+), 15 deletions(-) diff --git a/config/db/V7.0__enke_hostinfo_add_table.sql b/config/db/V7.0__enke_hostinfo_add_table.sql index 9a4b6e86..e966f635 100644 --- a/config/db/V7.0__enke_hostinfo_add_table.sql +++ b/config/db/V7.0__enke_hostinfo_add_table.sql @@ -39,6 +39,16 @@ VALUES (11, '市公安局', '市公安局', '127.0.0.1', '127.0.0.1', '2022-09-1 INSERT INTO `enke_hostinfo` VALUES (12, '市交通运输局', '市交通运输局', '127.0.0.1', '127.0.0.1', '2022-09-11 09:20:07'); INSERT INTO `enke_hostinfo` -VALUES (13, '一网统揽平台组', '一网统揽平台组', '127.0.0.1', '127.0.0.1', '2022-09-10 09:20:07'); +VALUES (13, '一网统揽平台组', '一网统揽平台组', '127.0.0.1', '127.0.0.1', '2022-09-29 09:20:07'); INSERT INTO `enke_hostinfo` -VALUES (14, '青岛市一网统揽项目组', '青岛市一网统揽项目组', '127.0.0.1', '127.0.0.1', '2022-09-09 09:20:07'); +VALUES (14, '青岛市一网统揽项目组', '青岛市一网统揽项目组', '127.0.0.1', '127.0.0.1', '2022-09-30 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (15, '市北区一网统揽项目组', '市北区一网统揽项目组', '127.0.0.1', '127.0.0.1', '2022-09-28 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (16, '李沧区一网统揽项目组', '李沧区一网统揽项目组', '127.0.0.1', '127.0.0.1', '2022-09-27 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (17, '崂山区一网统揽项目组', '崂山区一网统揽项目组', '127.0.0.1', '127.0.0.1', '2022-09-26 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (18, ' 西海岸新区一网统揽项目组', ' 西海岸新区一网统揽项目组', '127.0.0.1', '127.0.0.1', '2022-09-25 09:20:07'); +INSERT INTO `enke_hostinfo` +VALUES (19, ' 城阳区一网统揽项目组', ' 城阳区一网统揽项目组', '127.0.0.1', '127.0.0.1', '2022-09-24 09:20:07'); diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/service/impl/ActivitiServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/activiti/service/impl/ActivitiServiceImpl.java index 692a59cf..e0db8444 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/service/impl/ActivitiServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/service/impl/ActivitiServiceImpl.java @@ -93,16 +93,16 @@ public class ActivitiServiceImpl extends BaseServiceImpl 0) { - builder.append(duration.toDays() + "d "); - builder.append(duration.minus(Duration.ofDays(duration.toDays())).toHours() + "h"); + builder.append(duration.toDays() + "天 "); + builder.append(duration.minus(Duration.ofDays(duration.toDays())).toHours() + "时"); } else if (duration.toHours() > 0) { - builder.append(duration.toHours() + "h "); - builder.append(duration.minus(Duration.ofHours(duration.toHours())).toMinutes() + "m"); + builder.append(duration.toHours() + "时 "); + builder.append(duration.minus(Duration.ofHours(duration.toHours())).toMinutes() + "分"); } else if (duration.toMinutes() > 0) { - builder.append(duration.toMinutes() + "m "); - builder.append(duration.minus(Duration.ofMinutes(duration.toMinutes())).getSeconds() + "s"); + builder.append(duration.toMinutes() + "分 "); + builder.append(duration.minus(Duration.ofMinutes(duration.toMinutes())).getSeconds() + "秒"); } else { - builder.append(second + "s"); + builder.append(second + "秒"); } return builder.toString(); } diff --git a/renren-admin/src/main/java/io/renren/modules/security/config/ShiroConfig.java b/renren-admin/src/main/java/io/renren/modules/security/config/ShiroConfig.java index 0eec36a3..7965f2f6 100644 --- a/renren-admin/src/main/java/io/renren/modules/security/config/ShiroConfig.java +++ b/renren-admin/src/main/java/io/renren/modules/security/config/ShiroConfig.java @@ -85,6 +85,7 @@ public class ShiroConfig { filterMap.put("/census/center/**", "anon"); // 全局各类统计 包含 /census/center/v2 filterMap.put("/metrics/**", "anon"); filterMap.put("/gateway-monitor/**", "anon"); + filterMap.put("/enke/**", "anon"); filterMap.put("/**", "oauth2"); shiroFilter.setFilterChainDefinitionMap(filterMap); diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index 710318ac..52404ca8 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -1855,16 +1855,16 @@ tdr.type = '业务组件') - AND tdr.del_flag in (0, 5) + AND tdr.del_flag=0 - AND tdr.del_flag not in (0, 1, 5, 6) + AND tdr.del_flag in (2, 3, 4) AND tdr.del_flag=6 - AND tdr.del_flag != 1 + AND tdr.del_flag in (0, 2, 3, 4, 6) @@ -1899,16 +1899,16 @@ WHERE 1=1 AND tdr.dept_id=sd.id - AND tdr.del_flag in (0, 5) + AND tdr.del_flag=0 - AND tdr.del_flag not in (0, 1, 5, 6) + AND tdr.del_flag in (2, 3, 4) AND tdr.del_flag=6 - AND tdr.del_flag != 1 + AND tdr.del_flag in (0, 2, 3, 4, 6) From d9a83fd41d66aa47cf2f2b2b2448bfb24893cb7e Mon Sep 17 00:00:00 2001 From: wangliwen Date: Wed, 26 Oct 2022 19:22:21 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E8=83=BD=E5=8A=9B=E4=B8=8B=E6=9E=B6=20npe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/TResourceMountApplyController.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resourceMountApply/controller/TResourceMountApplyController.java b/renren-admin/src/main/java/io/renren/modules/resourceMountApply/controller/TResourceMountApplyController.java index 803a2247..1464eed4 100644 --- a/renren-admin/src/main/java/io/renren/modules/resourceMountApply/controller/TResourceMountApplyController.java +++ b/renren-admin/src/main/java/io/renren/modules/resourceMountApply/controller/TResourceMountApplyController.java @@ -68,11 +68,13 @@ public class TResourceMountApplyController { // @RequiresPermissions("resourceMountApply:tresourcemountapply:info") public Result get(@PathVariable("id") Long id) { TResourceMountApplyDTO data = tResourceMountApplyService.get(id); - SysDeptDTO sysDeptDTO = sysDeptService.get(Long.valueOf(data.getDeptId())); - if (sysDeptDTO != null) { - ResourceDTO resourceDTO = data.getResourceDTO(); - resourceDTO.setDeptName(sysDeptDTO.getName()); - data.setResourceDTO(resourceDTO); + if (data.getDeptId() != null) { + SysDeptDTO sysDeptDTO = sysDeptService.get(Long.valueOf(data.getDeptId())); + if (sysDeptDTO != null) { + ResourceDTO resourceDTO = data.getResourceDTO(); + resourceDTO.setDeptName(sysDeptDTO.getName()); + data.setResourceDTO(resourceDTO); + } } return new Result().ok(data); }