From d8611fb9575225ae79175c2cadde8e594d6fc251 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Mon, 27 Jun 2022 17:26:31 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=B5=81=E7=A8=8B=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/renren/common/aspect/ActivitiNoticeAspect.java | 7 ++++--- .../renren/common/controller/AbilityCenterController.java | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/common/aspect/ActivitiNoticeAspect.java b/renren-admin/src/main/java/io/renren/common/aspect/ActivitiNoticeAspect.java index 4ee455ac..bd6b7492 100644 --- a/renren-admin/src/main/java/io/renren/common/aspect/ActivitiNoticeAspect.java +++ b/renren-admin/src/main/java/io/renren/common/aspect/ActivitiNoticeAspect.java @@ -1,6 +1,7 @@ package io.renren.common.aspect; +import com.alibaba.fastjson.JSON; import io.renren.common.annotation.ActivitiNoticeOperation; import io.renren.modules.notice.dto.SysNoticeDTO; import io.renren.modules.notice.enums.NoticeStatusEnum; @@ -200,7 +201,7 @@ public class ActivitiNoticeAspect { */ private void end_notice(final DelegateExecution execution, final ActivitiNoticeOperation activitiNoticeOperation) { Map kv = execution.getVariables(); - logger.error("表单:" + kv.toString()); + logger.error("表单:" + JSON.toJSONString(kv)); if (work_.contains(ExecutionListener.EVENTNAME_END + kv.get("id").toString())) { logger.error("------------出现重放------------"); return; @@ -229,9 +230,9 @@ public class ActivitiNoticeAspect { String finalCreator = creator; String finalResult = result; Long resourceId = null; - if (kv.containsKey("resourceId")) { + if (kv.containsKey("resourceId") && kv.get("resourceId") != null) { resourceId = Long.valueOf(kv.get("resourceId").toString()); - } else if (kv.containsKey("id")) { + } else if (kv.containsKey("id") && kv.get("id") != null) { resourceId = Long.valueOf(kv.get("id").toString()); } Optional resourceDTO = Optional.ofNullable(resourceService.get(resourceId)); diff --git a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterController.java b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterController.java index 191e266d..77722914 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterController.java +++ b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterController.java @@ -78,6 +78,10 @@ public class AbilityCenterController { return new Result().error("联系管理员添加流程"); } return new Result().ok(abilityBatchApplicationDTO.getSystem().stream().map(index -> { + if (index.get("resourceId") == null) { + logger.error("未携带资源id"); + return null; + } if (tAbilityApplicationService.countUserResourceApply(SecurityUser.getUserId(), Long.valueOf(index.get("resourceId"))) > 0) { // 防止重复发起申请 logger.error("重复发起申请"); return null; From 78286468fa6afbdc4a61a0e82c071cb26a770d26 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Mon, 27 Jun 2022 17:33:03 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E6=97=B6=20=E6=9B=B4=E6=96=B0infoList=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/resource/service/impl/ResourceServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) 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 f8340468..25c5caeb 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 @@ -171,13 +171,17 @@ public class ResourceServiceImpl extends CrudServiceImpl attrEntities = dto.getInfoList(); + List attrEntities_ = new ArrayList<>(); if (attrEntities != null) { attrEntities.forEach(item -> { item.setDelFlag(ResourceEntityDelFlag.NORMAL.getFlag()); item.setDataResourceId(resourceID); attrDao.insert(item); + attrEntities_.add(item); }); } + resourceEntity.setInfoList(attrEntities_); + resourceDao.updateById(resourceEntity); } @Override From 1e38a30eb561755e15aec80fc288e4c7a64a4da0 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Mon, 27 Jun 2022 17:40:55 +0800 Subject: [PATCH 3/6] npe --- .../io/renren/common/controller/CensusControllerV2.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV2.java b/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV2.java index dd7b6173..3d04f939 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV2.java +++ b/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV2.java @@ -183,7 +183,7 @@ public class CensusControllerV2 { String sql = String.format("SELECT COUNT(id) FROM tb_data_resource WHERE dept_id = %s AND type = '应用资源' AND del_flag = 0;", index.get("id").toString()); logger.info(sql); Long count = jdbcTemplate.queryForObject(sql, Long.class); - if (!"0".equals(index.get("pid").toString()) && higher) { // 有上级部门 且 配置资源归属上级 + if (!"0" .equals(index.get("pid").toString()) && higher) { // 有上级部门 且 配置资源归属上级 Optional sysDeptDTO = Optional.ofNullable(sysDeptService.get(Long.valueOf(index.get("pid").toString()))); if (sysDeptDTO.isPresent() && sysDeptDTO.get().getType() != null && sysDeptDTO.get().getType() >= 2) { @@ -413,7 +413,7 @@ public class CensusControllerV2 { HashMap dataResource = (HashMap) tsingtaoDataResourceService.getDataResource(getDataResourceListDto); result.add(new HashMap() { { - put("amount", dataResource.get("rows")); + put("amount", (dataResource != null && dataResource.containsKey("rows") && dataResource.get("rows") != null) ? dataResource.get("rows") : 0); put("type", "总数据数"); } }); @@ -431,7 +431,7 @@ public class CensusControllerV2 { }); result.add(new HashMap() { { - List lists = (List) dataResource.get("data"); + List lists = (dataResource != null && dataResource.containsKey("data") && dataResource.get("data") != null) ? (List) dataResource.get("data") : new ArrayList<>(); ArrayList list = new ArrayList<>(); lists.forEach(item -> { list.add(new HashMap() {{ From e1fb7b0b9e36f3026d38016bef8c3c142f4a9c1b Mon Sep 17 00:00:00 2001 From: wangliwen Date: Mon, 27 Jun 2022 17:44:01 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E4=BA=91=E5=9B=BE=20=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E6=97=B6=20=E9=BB=98=E8=AE=A4=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/controller/CensusControllerV2.java | 47 ++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV2.java b/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV2.java index 3d04f939..cfb84061 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV2.java +++ b/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV2.java @@ -462,10 +462,22 @@ public class CensusControllerV2 { }); } } else { + result.add(new HashMap() { + { + put("amount", 0L); + put("type", "总数据数"); + } + }); logger.error("青岛西海岸获取失败"); } } catch (Exception exception) { logger.error("青岛西海岸失败", exception); + result.add(new HashMap() { + { + put("amount", 0L); + put("type", "总数据数"); + } + }); } OkHttpClient client1 = new OkHttpClient(); @@ -496,13 +508,46 @@ public class CensusControllerV2 { }).collect(Collectors.toList())); } }); - } } else { logger.error("青岛西海岸获取失败"); + result.add(new HashMap() { + { + put("amount", 0L); + put("type", "总申请次数"); + } + }); + result.add(new HashMap() { + { + put("amount", 0); + put("type", "满足率"); + } + }); + result.add(new HashMap() { + { + put("resourceTop5", new ArrayList<>()); + } + }); } } catch (Exception exception) { logger.error("青岛西海岸失败", exception); + result.add(new HashMap() { + { + put("amount", 0L); + put("type", "总申请次数"); + } + }); + result.add(new HashMap() { + { + put("amount", 0); + put("type", "满足率"); + } + }); + result.add(new HashMap() { + { + put("resourceTop5", new ArrayList<>()); + } + }); } } break; From f4670d45cd27b7d8eb9c14f0c2a1b575809acf14 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Mon, 27 Jun 2022 17:59:30 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BA=8C=E7=BA=A7=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E6=89=8B=E5=8A=A8=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resource/service/impl/ResourceServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 25c5caeb..a69a7e02 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 @@ -158,7 +158,7 @@ public class ResourceServiceImpl extends CrudServiceImpl idList = jsonArray.toJavaList(Long.class); @@ -200,7 +200,7 @@ public class ResourceServiceImpl extends CrudServiceImpl knowledgeUUID = jdbcTemplate.queryForList("SELECT note1 FROM tb_data_resource WHERE type ='知识库' AND note1 IS NOT NULL FOR UPDATE;", String.class).stream().distinct().collect(Collectors.toList()); final int pageSize = 100; From d6df42fe7bd68e8bdc27d97c7d39e008b8583965 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Mon, 27 Jun 2022 18:04:01 +0800 Subject: [PATCH 6/6] ... --- .../modules/resource/service/impl/ResourceServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 a69a7e02..ed79f302 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 @@ -186,7 +186,7 @@ public class ResourceServiceImpl extends CrudServiceImpl idList = jsonArray.toJavaList(Long.class); @@ -200,7 +200,7 @@ public class ResourceServiceImpl extends CrudServiceImpl knowledgeUUID = jdbcTemplate.queryForList("SELECT note1 FROM tb_data_resource WHERE type ='知识库' AND note1 IS NOT NULL FOR UPDATE;", String.class).stream().distinct().collect(Collectors.toList()); final int pageSize = 100;