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

添加新课程Feign接口

parent bf9dc5b3
......@@ -66,7 +66,7 @@ public class ProductService {
private TopicService topicService;
public void transferAttachement(ThemeQo themeQo){
public void transferAttachement(ThemeQo themeQo) {
ArrayList<ThemeQo> themeQos = new ArrayList<>();
themeQos.add(themeQo);
transferAttachments(themeQos);
......@@ -137,39 +137,43 @@ public class ProductService {
List<String> topicIds = Lists.newArrayList();
// 获取关联资源id
if (themeQos != null) {
themeQos.stream().forEach(o -> o.getContent().stream().forEach(c -> {
if (c.getType().equals(RelTypeEnum.LIVE.type)) {
zhiboIds.add(c.getValue());
} else if (c.getType().equals(RelTypeEnum.SHORT_VIDEO.type)) {
shortVideoIds.add(c.getValue());
} else if (c.getType().equals(RelTypeEnum.FUND.type)) {
if (c.getProductType() == ProductTypeEnum.PUBLIC.type) {
publicFundIds.add(c.getValue());
} else if (c.getProductType() == ProductTypeEnum.PRIVATE.type) {
fundIds.add(c.getValue());
} else if (c.getProductType() == ProductTypeEnum.TAMP.type) {
tanpuFundIds.add(c.getValue());
} else if (c.getProductType() == ProductTypeEnum.CUSTOMER_IMPORT.type) {
ifaFundIds.add(c.getValue());
} else if (c.getProductType() == ProductTypeEnum.NOT_NET_PRODUCT.type) {
notNetFundIds.add(c.getValue());
}
} else if (c.getType().equals(RelTypeEnum.VIDEO.type) || c.getType().equals(RelTypeEnum.AUDIO.type)) {
curriculumIds.add(c.getValue());
} else if (c.getType().equals(RelTypeEnum.SINGLE_IMG.type)) {
imageIds.add(c.getValue());
} else if (c.getType().equals(RelTypeEnum.NEW_COURSE_SECTION_AUDIO.type) ||
c.getType().equals(RelTypeEnum.NEW_COURSE_SECTION_VIDEO.type)) {
courseIds.add(c.getValue());
}
}));
themeQos.stream().forEach(o -> {
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)) {
zhiboIds.add(c.getValue());
} else if (c.getType().equals(RelTypeEnum.SHORT_VIDEO.type)) {
shortVideoIds.add(c.getValue());
} else if (c.getType().equals(RelTypeEnum.FUND.type)) {
if (c.getProductType() == ProductTypeEnum.PUBLIC.type) {
publicFundIds.add(c.getValue());
} else if (c.getProductType() == ProductTypeEnum.PRIVATE.type) {
fundIds.add(c.getValue());
} else if (c.getProductType() == ProductTypeEnum.TAMP.type) {
tanpuFundIds.add(c.getValue());
} else if (c.getProductType() == ProductTypeEnum.CUSTOMER_IMPORT.type) {
ifaFundIds.add(c.getValue());
} else if (c.getProductType() == ProductTypeEnum.NOT_NET_PRODUCT.type) {
notNetFundIds.add(c.getValue());
}
} else if (c.getType().equals(RelTypeEnum.VIDEO.type) || c.getType().equals(RelTypeEnum.AUDIO.type)) {
curriculumIds.add(c.getValue());
} else if (c.getType().equals(RelTypeEnum.SINGLE_IMG.type)) {
imageIds.add(c.getValue());
} else if (c.getType().equals(RelTypeEnum.NEW_COURSE_SECTION_AUDIO.type) ||
c.getType().equals(RelTypeEnum.NEW_COURSE_SECTION_VIDEO.type)) {
courseIds.add(c.getValue());
}
});
}
});
}
if (!CollectionUtils.isEmpty(shortVideoIds)) {
// 短视频列表
......@@ -339,6 +343,9 @@ public class ProductService {
if (!StringUtils.isEmpty(themeQo.getTopicId()) && topicMap.containsKey(themeQo.getTopicId())) {
themeQo.setTopicTitle(topicMap.get(themeQo.getTopicId()));
}
if (themeQo.getContent()==null){
continue;
}
for (ThemeContentQo themeContent : themeQo.getContent()) {
if (themeContent.getType().equals(RelTypeEnum.LIVE.type)) {
if (zhiboMap.containsKey(themeContent.getValue())) {
......
......@@ -25,6 +25,7 @@ public class ConvertUtil {
ThemeQo themeQO = new ThemeQo();
BeanUtils.copyProperties(themeEntity, themeQO);
List<ThemeContentQo> themeContentQos = JsonUtil.toBean(themeEntity.getContent(), new TypeReference<List<ThemeContentQo>>() {});
themeQO.setContent(themeContentQos);
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