Commit b75a6026 authored by 刘基明's avatar 刘基明

添加新课程Feign接口

parent bf9dc5b3
...@@ -66,7 +66,7 @@ public class ProductService { ...@@ -66,7 +66,7 @@ public class ProductService {
private TopicService topicService; private TopicService topicService;
public void transferAttachement(ThemeQo themeQo){ public void transferAttachement(ThemeQo themeQo) {
ArrayList<ThemeQo> themeQos = new ArrayList<>(); ArrayList<ThemeQo> themeQos = new ArrayList<>();
themeQos.add(themeQo); themeQos.add(themeQo);
transferAttachments(themeQos); transferAttachments(themeQos);
...@@ -137,8 +137,14 @@ public class ProductService { ...@@ -137,8 +137,14 @@ public class ProductService {
List<String> topicIds = Lists.newArrayList(); List<String> topicIds = Lists.newArrayList();
// 获取关联资源id // 获取关联资源id
if (themeQos != null) { if (themeQos != null) {
themeQos.stream().forEach(o -> {
themeQos.stream().forEach(o -> o.getContent().stream().forEach(c -> { if (o.getTopicId() != null) {
topicIds.add(o.getTopicId());
}
});
themeQos.stream().forEach(o -> {
if (o.getContent() != null) {
o.getContent().stream().forEach(c -> {
if (c.getType().equals(RelTypeEnum.LIVE.type)) { if (c.getType().equals(RelTypeEnum.LIVE.type)) {
zhiboIds.add(c.getValue()); zhiboIds.add(c.getValue());
} else if (c.getType().equals(RelTypeEnum.SHORT_VIDEO.type)) { } else if (c.getType().equals(RelTypeEnum.SHORT_VIDEO.type)) {
...@@ -164,12 +170,10 @@ public class ProductService { ...@@ -164,12 +170,10 @@ public class ProductService {
c.getType().equals(RelTypeEnum.NEW_COURSE_SECTION_VIDEO.type)) { c.getType().equals(RelTypeEnum.NEW_COURSE_SECTION_VIDEO.type)) {
courseIds.add(c.getValue()); courseIds.add(c.getValue());
} }
})); });
themeQos.stream().forEach(o -> {
if (o.getTopicId() != null) {
topicIds.add(o.getTopicId());
} }
}); });
} }
if (!CollectionUtils.isEmpty(shortVideoIds)) { if (!CollectionUtils.isEmpty(shortVideoIds)) {
// 短视频列表 // 短视频列表
...@@ -339,6 +343,9 @@ public class ProductService { ...@@ -339,6 +343,9 @@ public class ProductService {
if (!StringUtils.isEmpty(themeQo.getTopicId()) && topicMap.containsKey(themeQo.getTopicId())) { if (!StringUtils.isEmpty(themeQo.getTopicId()) && topicMap.containsKey(themeQo.getTopicId())) {
themeQo.setTopicTitle(topicMap.get(themeQo.getTopicId())); themeQo.setTopicTitle(topicMap.get(themeQo.getTopicId()));
} }
if (themeQo.getContent()==null){
continue;
}
for (ThemeContentQo themeContent : themeQo.getContent()) { for (ThemeContentQo themeContent : themeQo.getContent()) {
if (themeContent.getType().equals(RelTypeEnum.LIVE.type)) { if (themeContent.getType().equals(RelTypeEnum.LIVE.type)) {
if (zhiboMap.containsKey(themeContent.getValue())) { if (zhiboMap.containsKey(themeContent.getValue())) {
......
...@@ -25,6 +25,7 @@ public class ConvertUtil { ...@@ -25,6 +25,7 @@ public class ConvertUtil {
ThemeQo themeQO = new ThemeQo(); ThemeQo themeQO = new ThemeQo();
BeanUtils.copyProperties(themeEntity, themeQO); BeanUtils.copyProperties(themeEntity, themeQO);
List<ThemeContentQo> themeContentQos = JsonUtil.toBean(themeEntity.getContent(), new TypeReference<List<ThemeContentQo>>() {}); List<ThemeContentQo> themeContentQos = JsonUtil.toBean(themeEntity.getContent(), new TypeReference<List<ThemeContentQo>>() {});
themeQO.setContent(themeContentQos);
return themeQO; return themeQO;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment