From 81b5b28743a9b283c327f70271ed434f8d2e5a0b Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Fri, 22 Jul 2022 14:43:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E9=87=91=E5=AE=8F?= =?UTF-8?q?=E7=8E=AF=E5=A2=83-=E8=83=BD=E5=8A=9B=E7=BB=9F=E8=AE=A1-?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=9B=BE=E8=B0=B1-=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B-=E8=83=BD=E5=8A=9B=E9=9B=86-=E6=8C=89?= =?UTF-8?q?=E7=85=A7=E6=95=B0=E6=8D=AE=E8=B5=84=E6=BA=90=E6=9F=A5=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=8E=A5=E5=8F=A3=E8=B0=83=E7=94=A8=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/renren/common/controller/CensusController.java | 2 +- .../modules/resource/service/impl/ResourceServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java index 1c78a1ca..9b8183a4 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java +++ b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java @@ -308,7 +308,7 @@ public class CensusController { } catch (JsonProcessingException e) { throw new RuntimeException(e); } - }).reversed().thenComparing(i -> i.toString()) + }).reversed().thenComparing(Object::toString) ); // 按应用领域数目逆序排序 return new Result>>().ok(result); } 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 bc2188c8..f168e1e8 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 @@ -1077,7 +1077,7 @@ public class ResourceServiceImpl extends CrudServiceImpl factory = DataResourceFactory.build(); if (factory.isPresent()) { From aa54a9a8fc8a37bfa784ad9397773b595e03a4cc Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 22 Jul 2022 15:45:11 +0800 Subject: [PATCH 2/2] =?UTF-8?q?pageWithAttr=E5=A2=9E=E5=8A=A0=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=8A=A0=E5=85=A5=E7=94=B3=E8=B4=AD=E8=BD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/renren/modules/resource/dto/ResourceDTO.java | 2 ++ .../renren/modules/security/config/ShiroConfig.java | 2 +- .../main/resources/mapper/resource/ResourceDao.xml | 11 ++++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/dto/ResourceDTO.java b/renren-admin/src/main/java/io/renren/modules/resource/dto/ResourceDTO.java index 83e0d4ac..34a3383f 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/dto/ResourceDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/dto/ResourceDTO.java @@ -92,6 +92,8 @@ public class ResourceDTO extends AuditingBaseDTO implements Serializable { private String applyCount; @ApiModelProperty(value = "部门ID集合") private List deptIds; + @ApiModelProperty(value = "是否在申购车内") + private Boolean isInShoppingCart; @ApiModelProperty(value = "属性信息") 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 48e9db01..dcbe3650 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 @@ -31,7 +31,7 @@ public class ShiroConfig { DefaultWebSessionManager sessionManager = new DefaultWebSessionManager(); sessionManager.setSessionValidationSchedulerEnabled(false); sessionManager.setSessionIdUrlRewritingEnabled(false); - + sessionManager.setGlobalSessionTimeout(-1000l); return sessionManager; } diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index 6b8964bc..a79a2a93 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -105,13 +105,15 @@ IFNULL(trc.collectCount, 0) AS "collectCount", IFNULL(sd.name, '暂无部门单位信息') AS "deptName", IFNULL(trc2.isCollect, 'false') AS "isCollect", - (IFNULL(tdr.visits / 100, 0) + IFNULL(trs.score, 0) + IFNULL(taa.applyCount, 0)+ IFNULL(trc.collectCount, 0)) AS - total + (IFNULL(tdr.visits / 100, 0) + IFNULL(trs.score, 0) + IFNULL(taa.applyCount, 0)+ IFNULL(trc.collectCount, 0)) AS total, + IF ( IFNULL( trcar.car, 0 ) > 0, TRUE, FALSE ) AS "isInShoppingCart" FROM tb_data_resource tdr LEFT JOIN tb_data_attr tda ON tdr.id = tda.data_resource_id LEFT JOIN ( SELECT resource_id, AVG(score) AS "score" FROM tb_resource_score WHERE 1 = 1 AND del_flag = 0 GROUP BY resource_id ) trs ON tdr.id = trs.resource_id + LEFT JOIN ( SELECT resource_id, COUNT( id ) AS "car" FROM tb_resource_car WHERE 1 = 1 AND del_flag = 0 GROUP BY resource_id ) trcar + ON tdr.id = trcar.resource_id LEFT JOIN ( SELECT resource_id, COUNT(id) AS "applyCount" FROM t_ability_application WHERE 1 = 1 AND del_flag = 0 GROUP BY resource_id ) taa ON tdr.id = taa.resource_id LEFT JOIN ( SELECT resource_id, COUNT(id) AS "collectCount" FROM tb_resource_collection WHERE 1 = 1 AND del_flag @@ -360,11 +362,14 @@ IFNULL(trc.collectCount, 0) AS "collectCount", sd.name AS "deptName", IFNULL(trc2.isCollect, 'false') AS "isCollect", - IFNULL(taa2.approve_status, '未申请') AS "applyState" + IFNULL(taa2.approve_status, '未申请') AS "applyState", + IF ( IFNULL( trcar.car, 0 ) > 0, TRUE, FALSE ) AS "isInShoppingCart" FROM tb_data_resource tdr LEFT JOIN ( SELECT resource_id, AVG(score) AS "score" FROM tb_resource_score WHERE 1 = 1 AND del_flag = 0 GROUP BY resource_id ) trs ON tdr.id = trs.resource_id + LEFT JOIN ( SELECT resource_id, COUNT( id ) AS "car" FROM tb_resource_car WHERE 1 = 1 AND del_flag = 0 GROUP BY resource_id ) trcar + ON tdr.id = trcar.resource_id LEFT JOIN ( SELECT resource_id, COUNT(id) AS "applyCount" FROM t_ability_application WHERE 1 = 1 AND del_flag = 0 GROUP BY resource_id ) taa ON tdr.id = taa.resource_id LEFT JOIN ( SELECT resource_id, COUNT(id) AS "collectCount" FROM tb_resource_collection WHERE 1 = 1 AND del_flag