From 6a07620ba362197f89673f66e85d50a86b555edf Mon Sep 17 00:00:00 2001 From: wangliwen Date: Wed, 22 Jun 2022 09:11:39 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E8=B5=84=E6=BA=90=E6=98=AF=E5=90=A6=E5=BD=92?= =?UTF-8?q?=E5=B1=9E=E4=B8=8A=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/renren/common/controller/CensusControllerV2.java | 4 +++- renren-admin/src/main/resources/application.yml | 4 +++- 2 files changed, 6 insertions(+), 2 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 cfdf9fd8..2ffaf28d 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 @@ -42,6 +42,8 @@ import java.util.stream.Collectors; public class CensusControllerV2 { @Value("${project.place}") private Integer projectPlace; + @Value("${project.higher}") + private Boolean higher; private static final Logger logger = LoggerFactory.getLogger(CensusControllerV2.class); @Autowired @@ -175,7 +177,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())) { // 有上级部门 + 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) { diff --git a/renren-admin/src/main/resources/application.yml b/renren-admin/src/main/resources/application.yml index 35bf83c3..d7b7112e 100644 --- a/renren-admin/src/main/resources/application.yml +++ b/renren-admin/src/main/resources/application.yml @@ -1,6 +1,8 @@ project: -# 平台部署位置 0:青岛市区 1:青岛西海岸 2:包头 + # 平台部署位置 0:青岛市区 1:青岛西海岸 2:包头 place: 0 + # 是否将资源归为上级 + higher: false # 大数据部门相关配置 big_date: name: 青岛市大数据发展管理局 From c81aaa34b01cf9ea44475e97dd8c1bae1cec2aaf Mon Sep 17 00:00:00 2001 From: wangliwen Date: Wed, 22 Jun 2022 09:49:17 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E6=88=91=E7=9A=84=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E6=9D=A5=E6=BA=90=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../notice/service/impl/SysNoticeServiceImpl.java | 13 ++++++++++--- .../main/resources/mapper/notice/SysNoticeDao.xml | 3 +++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java index 9eab13e2..e1dffe8b 100644 --- a/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java @@ -44,10 +44,17 @@ public class SysNoticeServiceImpl extends CrudServiceImpl getWrapper(Map params) { - String type = (String) params.get("type"); - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(type), "type", type); + params.keySet().stream().filter(index -> null != params.get(index)).forEach(index -> { + switch (index) { + case "type": + wrapper.eq(StringUtils.isNotBlank((String) params.get("type")), "type", (String) params.get("type")); + break; + case "from": + wrapper.eq(StringUtils.isNotBlank((String) params.get("from")), "from", (String) params.get("from")); + break; + } + }); wrapper.orderByDesc(Constant.CREATE_DATE); return wrapper; } diff --git a/renren-admin/src/main/resources/mapper/notice/SysNoticeDao.xml b/renren-admin/src/main/resources/mapper/notice/SysNoticeDao.xml index ddcb68e2..538ed962 100644 --- a/renren-admin/src/main/resources/mapper/notice/SysNoticeDao.xml +++ b/renren-admin/src/main/resources/mapper/notice/SysNoticeDao.xml @@ -16,6 +16,9 @@ AND read_status = #{readStatus} + + AND from = #{from} + order by t2.create_date desc \ No newline at end of file From 8ac9091f9bb16f5eac2622d1af0636014fe17d23 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Wed, 22 Jun 2022 09:57:38 +0800 Subject: [PATCH 03/12] sql --- renren-admin/src/main/resources/mapper/notice/SysNoticeDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renren-admin/src/main/resources/mapper/notice/SysNoticeDao.xml b/renren-admin/src/main/resources/mapper/notice/SysNoticeDao.xml index 538ed962..224fca21 100644 --- a/renren-admin/src/main/resources/mapper/notice/SysNoticeDao.xml +++ b/renren-admin/src/main/resources/mapper/notice/SysNoticeDao.xml @@ -17,7 +17,7 @@ AND read_status = #{readStatus} - AND from = #{from} + AND `from` = #{from} order by t2.create_date desc From 40817f2ddf2b8b7f9c77f9bf8f2f708bf950eaa7 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Wed, 22 Jun 2022 10:22:48 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E7=AB=99=E5=86=85=E4=BF=A1=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E5=8C=BA=E5=88=86=E6=9D=A5=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/renren/common/controller/CensusControllerV2.java | 3 ++- renren-admin/src/main/resources/mapper/notice/SysNoticeDao.xml | 3 ++- 2 files changed, 4 insertions(+), 2 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 2ffaf28d..e71f2384 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 @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiOperation; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; +import org.apache.commons.lang3.ObjectUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -197,7 +198,7 @@ public class CensusControllerV2 { re.put("deptName", sysDeptService.get(Long.valueOf(index)).getName()); re.put("count", i.get(index).stream().mapToLong(index_ -> index_.values().stream().mapToLong(count_ -> count_).sum()).sum()); return re; - }).collect(Collectors.toList()); + }).filter(index -> ObjectUtils.allNotNull(index)).collect(Collectors.toList()); result.sort(Comparator.comparing(x -> { ObjectMapper mapper = new ObjectMapper(); try { diff --git a/renren-admin/src/main/resources/mapper/notice/SysNoticeDao.xml b/renren-admin/src/main/resources/mapper/notice/SysNoticeDao.xml index 224fca21..f1c4ffdb 100644 --- a/renren-admin/src/main/resources/mapper/notice/SysNoticeDao.xml +++ b/renren-admin/src/main/resources/mapper/notice/SysNoticeDao.xml @@ -11,7 +11,8 @@