From ac5aecf51809909ea8d803ba55a3523bc6e7d3d1 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 6 May 2022 10:59:27 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9C=80=E6=B1=82=E4=B8=BB=E9=A2=98=E6=A8=A1?= =?UTF-8?q?=E7=B3=8A=E6=9F=A5=E8=AF=A2=E4=B8=8E=E9=9C=80=E6=B1=82=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=E6=A8=A1=E7=B3=8A=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/TDemandDataServiceImpl.java | 4 ++++ .../controller/TDemandCommentController.java | 3 ++- .../impl/TDemandCommentServiceImpl.java | 18 +++++++++++++++++- .../io/renren/common/constant/Constant.java | 7 +++++-- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/demanData/service/impl/TDemandDataServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/demanData/service/impl/TDemandDataServiceImpl.java index a9f39cfe..53de3468 100644 --- a/renren-admin/src/main/java/io/renren/modules/demanData/service/impl/TDemandDataServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/demanData/service/impl/TDemandDataServiceImpl.java @@ -1,6 +1,7 @@ package io.renren.modules.demanData.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.renren.common.constant.Constant; import io.renren.common.service.impl.CrudServiceImpl; import io.renren.modules.demanData.dao.TDemandDataDao; import io.renren.modules.demanData.dto.TDemandDataDTO; @@ -34,6 +35,9 @@ public class TDemandDataServiceImpl extends CrudServiceImpl> page(@ApiIgnore @RequestParam Map params) { diff --git a/renren-admin/src/main/java/io/renren/modules/demandComment/service/impl/TDemandCommentServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/demandComment/service/impl/TDemandCommentServiceImpl.java index 513e13f9..87221b58 100644 --- a/renren-admin/src/main/java/io/renren/modules/demandComment/service/impl/TDemandCommentServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/demandComment/service/impl/TDemandCommentServiceImpl.java @@ -2,14 +2,19 @@ package io.renren.modules.demandComment.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import io.renren.common.constant.Constant; import io.renren.common.service.impl.CrudServiceImpl; +import io.renren.modules.demanData.service.TDemandDataService; import io.renren.modules.demandComment.dao.TDemandCommentDao; import io.renren.modules.demandComment.dto.TDemandCommentDTO; import io.renren.modules.demandComment.entity.TDemandCommentEntity; import io.renren.modules.demandComment.service.TDemandCommentService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.HashMap; import java.util.Map; +import java.util.stream.Collectors; /** * 需求评论 @@ -19,6 +24,8 @@ import java.util.Map; */ @Service public class TDemandCommentServiceImpl extends CrudServiceImpl implements TDemandCommentService { + @Autowired + private TDemandDataService tDemandDataService; @Override public QueryWrapper getWrapper(Map params) { @@ -31,9 +38,18 @@ public class TDemandCommentServiceImpl extends CrudServiceImpl() { + { + put(Constant.SEARCHKEY, params.get(Constant.SEARCHKEY).toString()); + } + }).stream().map(index_ -> index_.getId()).collect(Collectors.toList()).toArray()); + } + break; } }); -// wrapper.groupBy("target_id"); + wrapper.orderByDesc("create_date"); return wrapper; } diff --git a/renren-common/src/main/java/io/renren/common/constant/Constant.java b/renren-common/src/main/java/io/renren/common/constant/Constant.java index 03ad1619..104bc037 100644 --- a/renren-common/src/main/java/io/renren/common/constant/Constant.java +++ b/renren-common/src/main/java/io/renren/common/constant/Constant.java @@ -2,9 +2,12 @@ package io.renren.common.constant; /** * 常量 - * */ public interface Constant { + /** + * 模糊查询时key + */ + String SEARCHKEY = "searchKey"; /** * 成功 */ @@ -34,7 +37,7 @@ public interface Constant { */ Long DICT_ROOT = 0L; /** - * 升序 + * 升序 */ String ASC = "asc"; /**