|
|
@@ -5,7 +5,6 @@ import com.cyksj.dto.Result;
|
|
|
import com.cyksj.enums.GatewayResponse;
|
|
|
import com.cyksj.mapper.CustomerConsultationRecordMapper;
|
|
|
import com.cyksj.model.entity.CustomerConsultationRecord;
|
|
|
-import com.cyksj.model.entity.GoodsDon;
|
|
|
import com.cyksj.model.views.GoodsQaShowView;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
|
import com.ejlchina.searcher.util.MapUtils;
|
|
|
@@ -49,6 +48,7 @@ public class CorpKfQaController {
|
|
|
byType.forEach((type, typeViews) -> {
|
|
|
GoodsQaShowView typeGroup = new GoodsQaShowView();
|
|
|
typeGroup.setType(type);
|
|
|
+ typeGroup.setValue(type);
|
|
|
|
|
|
// 按categoryName分组并转换为QaGoodsType
|
|
|
Map<String, List<GoodsQaShowView>> byCategory = typeViews.stream()
|
|
|
@@ -57,9 +57,10 @@ public class CorpKfQaController {
|
|
|
List<GoodsQaShowView.QaGoodsType> qaGoodsTypes = new ArrayList<>();
|
|
|
byCategory.forEach((categoryName, categoryViews) -> {
|
|
|
GoodsQaShowView.QaGoodsType qaType = new GoodsQaShowView.QaGoodsType();
|
|
|
- qaType.setName(categoryName);
|
|
|
+ qaType.setLabel(categoryName);
|
|
|
+ qaType.setValue(categoryName);
|
|
|
// 假设需要将GoodsQaShowView转换为GoodsDon,此处需要具体逻辑
|
|
|
- List<GoodsDon> goodsDons = categoryViews.stream()
|
|
|
+ List<GoodsQaShowView.QaGoodsType.GoodsDonQaView> goodsDons = categoryViews.stream()
|
|
|
.map(view -> convertToGoodsDon(view)) // 自定义转换方法
|
|
|
.collect(Collectors.toList());
|
|
|
qaType.setChildren(goodsDons);
|
|
|
@@ -83,10 +84,10 @@ public class CorpKfQaController {
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
|
|
|
- private GoodsDon convertToGoodsDon(GoodsQaShowView view) {
|
|
|
- GoodsDon don = new GoodsDon();
|
|
|
- don.setTitle(view.getTitle());
|
|
|
- don.setId(view.getGoodsId());
|
|
|
- return don;
|
|
|
+ private GoodsQaShowView.QaGoodsType.GoodsDonQaView convertToGoodsDon(GoodsQaShowView view) {
|
|
|
+ GoodsQaShowView.QaGoodsType.GoodsDonQaView goodsDonQaView = new GoodsQaShowView.QaGoodsType.GoodsDonQaView();
|
|
|
+ goodsDonQaView.setLabel(view.getTitle());
|
|
|
+ goodsDonQaView.setValue(view.getGoodsId());
|
|
|
+ return goodsDonQaView;
|
|
|
}
|
|
|
}
|