Explorar o código

意见反馈查询

liude hai 1 ano
pai
achega
04d9abe66a

+ 49 - 0
vehicle-api/src/main/java/com/chelvc/cloud/vehicle/api/param/FeedBackPagingParam.java

@@ -0,0 +1,49 @@
+package com.chelvc.cloud.vehicle.api.param;
+import com.chelvc.framework.common.model.Paging;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.SuperBuilder;
+
+import javax.validation.constraints.NotEmpty;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import java.io.Serializable;
+
+/**
+ * 意见反馈数据模型
+ *
+ * @author liude
+ * @data 2023/1/12
+ */
+@Data
+@SuperBuilder
+@NoArgsConstructor
+@AllArgsConstructor
+public class FeedBackPagingParam implements Serializable {
+    /**
+     * 标题
+     */
+    @Size(max = 255, message = "标题长度不能大于255")
+    private String title;
+
+    /**
+     * 分页信息
+     */
+    @NotNull(message = "分页不能为空")
+    private Paging paging;
+
+    /**
+     * 类型
+     */
+    private String type;
+
+    /**
+     * 状态  1 - 待处理 2- 已处理 3- 已完结
+     */
+    private String status;
+    /**
+     * 渠道类型  0- 用户端 1-商家端
+     */
+    private String channel;
+}

+ 9 - 0
vehicle-api/src/main/java/com/chelvc/cloud/vehicle/api/service/FeedbackService.java

@@ -1,6 +1,8 @@
 package com.chelvc.cloud.vehicle.api.service;
 import com.chelvc.cloud.vehicle.api.dto.FeedBackDTO;
 import com.chelvc.cloud.vehicle.api.param.FeedBackModifyParam;
+import com.chelvc.cloud.vehicle.api.param.FeedBackPagingParam;
+import com.chelvc.framework.common.model.Pagination;
 
 import java.util.List;
 
@@ -33,4 +35,11 @@ public interface FeedbackService {
      * @return
      */
     List<FeedBackDTO> getFeedback(String channel);
+
+    /**
+     * 意见反馈分页查询
+     * @param param
+     * @return
+     */
+    Pagination<FeedBackDTO> getFeedbackPaging(FeedBackPagingParam param);
 }

+ 17 - 0
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/impl/FeedbackServiceImpl.java

@@ -1,13 +1,18 @@
 package com.chelvc.cloud.vehicle.server.service.impl;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.chelvc.cloud.vehicle.api.dto.FeedBackDTO;
 import com.chelvc.cloud.vehicle.api.param.FeedBackModifyParam;
+import com.chelvc.cloud.vehicle.api.param.FeedBackPagingParam;
 import com.chelvc.cloud.vehicle.server.copier.FeedbackCopier;
 import com.chelvc.cloud.vehicle.server.dao.FeedbackMapper;
 import com.chelvc.cloud.vehicle.server.entity.FeedBack;
 import com.chelvc.cloud.vehicle.server.service.FeedbackService;
 import com.chelvc.framework.base.context.SessionContextHolder;
+import com.chelvc.framework.common.model.Pagination;
 import com.chelvc.framework.common.util.AssertUtils;
+import com.chelvc.framework.common.util.StringUtils;
+import com.chelvc.framework.database.context.DatabaseContextHolder;
 import lombok.NonNull;
 import org.apache.dubbo.config.annotation.DubboService;
 
@@ -51,4 +56,16 @@ public class FeedbackServiceImpl extends ServiceImpl<FeedbackMapper, FeedBack> i
         return FeedbackCopier.INSTANCE.copying(feedBack);
     }
 
+    @Override
+    public Pagination<FeedBackDTO> getFeedbackPaging(FeedBackPagingParam param){
+        Page<FeedBack> page = this.lambdaQuery()
+                .eq(StringUtils.notEmpty(param.getStatus()),FeedBack::getStatus,param.getStatus())
+                .like(StringUtils.notEmpty(param.getTitle()),FeedBack::getTitle,param.getTitle())
+                .eq(StringUtils.notEmpty(param.getChannel()),FeedBack::getChannel,param.getChannel())
+                .orderByDesc(FeedBack::getCreateTime)
+                .page(DatabaseContextHolder.page(param.getPaging()));
+
+        return DatabaseContextHolder.pagination(page,FeedbackCopier.INSTANCE::copying);
+    }
+
  }