|
|
@@ -1,18 +1,24 @@
|
|
|
package com.fdkankan.ucenter.controller;
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.fdkankan.ucenter.common.BaseController;
|
|
|
import com.fdkankan.ucenter.common.Result;
|
|
|
+import com.fdkankan.ucenter.common.ResultData;
|
|
|
import com.fdkankan.ucenter.entity.Article;
|
|
|
import com.fdkankan.ucenter.entity.Case;
|
|
|
import com.fdkankan.ucenter.service.IArticleService;
|
|
|
import com.fdkankan.ucenter.service.ICaseService;
|
|
|
+import com.fdkankan.ucenter.service.IFeedbackOptionService;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* <p>
|
|
|
* 前端控制器
|
|
|
@@ -27,6 +33,8 @@ public class ArticleController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
ICaseService caseService;
|
|
|
+ @Autowired
|
|
|
+ IFeedbackOptionService feedbackOptionService;
|
|
|
/**
|
|
|
* 行业解决方案-案例展示
|
|
|
*/
|
|
|
@@ -44,15 +52,34 @@ public class ArticleController extends BaseController {
|
|
|
if("zh".equals(lang)){
|
|
|
lang = "cn";
|
|
|
}
|
|
|
- LambdaQueryWrapper<Case> wrapper = new LambdaQueryWrapper<>();
|
|
|
- if(StringUtils.isNotBlank(caseEntity.getTypeId())){
|
|
|
- wrapper.eq(Case::getTypeId,caseEntity.getTypeId());
|
|
|
+ caseEntity.setLanguage(lang);
|
|
|
+
|
|
|
+ return Result.success(caseService.allList(caseEntity));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/feedbackOptionList")
|
|
|
+ public Result feedbackOptionList(){
|
|
|
+ Case caseEntity = new Case();
|
|
|
+ String lang = getLang();
|
|
|
+ if("zh".equals(lang)){
|
|
|
+ lang = "cn";
|
|
|
+ }
|
|
|
+ caseEntity.setLanguage(lang);
|
|
|
+ List<Case> cases = caseService.allList(caseEntity);
|
|
|
+ List<String> ids = new ArrayList<>();
|
|
|
+ for (Case aCase : cases) {
|
|
|
+ if(StringUtils.isNotBlank(aCase.getFeedbackOptionIds())){
|
|
|
+ JSONArray jsonArray = JSONArray.parseArray(aCase.getFeedbackOptionIds());
|
|
|
+ for (Object object : jsonArray) {
|
|
|
+ ids.add((String) object);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- wrapper.eq(Case::getLanguage,lang);
|
|
|
- wrapper.eq(Case::getIsPublic,1);
|
|
|
- wrapper.orderByAsc(Case::getSort);
|
|
|
- wrapper.orderByAsc(Case::getId);
|
|
|
- return Result.success(caseService.list(wrapper));
|
|
|
+ if(ids.isEmpty()){
|
|
|
+ return Result.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ return Result.success(feedbackOptionService.listByIds(ids));
|
|
|
}
|
|
|
}
|
|
|
|