|
@@ -1,23 +1,20 @@
|
|
|
package com.cyksj.web.controller.sys;
|
|
package com.cyksj.web.controller.sys;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
import com.cyksj.dto.Result;
|
|
import com.cyksj.dto.Result;
|
|
|
import com.cyksj.enums.GatewayResponse;
|
|
import com.cyksj.enums.GatewayResponse;
|
|
|
|
|
+import com.cyksj.mapper.manage.help.HelpQuestionClassificationMapper;
|
|
|
import com.cyksj.mapper.manage.help.HelpQuestionMapper;
|
|
import com.cyksj.mapper.manage.help.HelpQuestionMapper;
|
|
|
import com.cyksj.model.entity.HelpQuestion;
|
|
import com.cyksj.model.entity.HelpQuestion;
|
|
|
import com.cyksj.model.entity.SysConfig;
|
|
import com.cyksj.model.entity.SysConfig;
|
|
|
import com.cyksj.model.views.HelpQuestionClassificationView;
|
|
import com.cyksj.model.views.HelpQuestionClassificationView;
|
|
|
import com.cyksj.service.sys.SysConfigService;
|
|
import com.cyksj.service.sys.SysConfigService;
|
|
|
-import com.ejlchina.searcher.BeanSearcher;
|
|
|
|
|
-import com.ejlchina.searcher.SearchResult;
|
|
|
|
|
-import com.ejlchina.searcher.util.MapUtils;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* @author chan
|
|
* @author chan
|
|
|
* @date 2022/10/20 10:08 AM
|
|
* @date 2022/10/20 10:08 AM
|
|
@@ -32,7 +29,7 @@ public class SysConfigController {
|
|
|
|
|
|
|
|
private final HelpQuestionMapper helpQuestionMapper;
|
|
private final HelpQuestionMapper helpQuestionMapper;
|
|
|
|
|
|
|
|
- private final BeanSearcher beanSearcher;
|
|
|
|
|
|
|
+ private final HelpQuestionClassificationMapper helpQuestionClassificationMapper;
|
|
|
|
|
|
|
|
@GetMapping("/get")
|
|
@GetMapping("/get")
|
|
|
public Result<SysConfig> get(String key) {
|
|
public Result<SysConfig> get(String key) {
|
|
@@ -70,18 +67,15 @@ public class SysConfigController {
|
|
|
* 问题分类列表
|
|
* 问题分类列表
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/help/question/classification/get")
|
|
@GetMapping("/help/question/classification/get")
|
|
|
- public Result<SearchResult<HelpQuestionClassificationView>> get(HttpServletRequest request) {
|
|
|
|
|
- SearchResult<HelpQuestionClassificationView> search = beanSearcher.search(HelpQuestionClassificationView.class,
|
|
|
|
|
- MapUtils.flatBuilder(request.getParameterMap())
|
|
|
|
|
- .orderBy(HelpQuestionClassificationView::getSort).desc()
|
|
|
|
|
- .build());
|
|
|
|
|
- search.getDataList().forEach(data -> {
|
|
|
|
|
|
|
+ public Result<Page<HelpQuestionClassificationView>> get(Long goodsId, @RequestParam(defaultValue = "1") Integer start, @RequestParam(defaultValue = "5") Integer limit) {
|
|
|
|
|
+ Page<HelpQuestionClassificationView> page = helpQuestionClassificationMapper.getQuestionClassificationView(goodsId, new Page<>(start, limit));
|
|
|
|
|
+ page.getRecords().forEach(data -> {
|
|
|
data.setQuestions(helpQuestionMapper.selectList(Wrappers.lambdaQuery(HelpQuestion.class)
|
|
data.setQuestions(helpQuestionMapper.selectList(Wrappers.lambdaQuery(HelpQuestion.class)
|
|
|
.eq(HelpQuestion::getClassificationId, data.getId())
|
|
.eq(HelpQuestion::getClassificationId, data.getId())
|
|
|
.eq(HelpQuestion::getDeleted, true)
|
|
.eq(HelpQuestion::getDeleted, true)
|
|
|
.orderByDesc(HelpQuestion::getSort)));
|
|
.orderByDesc(HelpQuestion::getSort)));
|
|
|
});
|
|
});
|
|
|
- return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(page);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|