|
|
@@ -3,6 +3,9 @@ package com.fs.app.controller.course;
|
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
+import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
+import com.fasterxml.jackson.databind.JsonNode;
|
|
|
+import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.fs.app.annotation.Login;
|
|
|
import com.fs.app.annotation.UserOperationLog;
|
|
|
import com.fs.app.controller.AppBaseController;
|
|
|
@@ -15,6 +18,8 @@ import com.fs.course.config.CourseConfig;
|
|
|
import com.fs.course.domain.FsCourseQuestionBank;
|
|
|
import com.fs.course.domain.FsCourseWatchLog;
|
|
|
import com.fs.course.domain.FsUserCourseVideo;
|
|
|
+import com.fs.course.mapper.FsDepVideoShowMapper;
|
|
|
+import com.fs.course.mapper.FsUserCourseVideoMapper;
|
|
|
import com.fs.course.param.*;
|
|
|
import com.fs.course.service.*;
|
|
|
import com.fs.course.service.impl.TencentCloudCosService;
|
|
|
@@ -22,6 +27,7 @@ import com.fs.course.vo.*;
|
|
|
import com.fs.fastGpt.service.IFastgptEventLogTotalService;
|
|
|
import com.fs.his.enums.FsUserOperationEnum;
|
|
|
import com.fs.his.service.IFsIntegralGoodsService;
|
|
|
+import com.fs.hisStore.domain.FsStoreProductScrm;
|
|
|
import com.fs.sop.domain.QwSop;
|
|
|
import com.fs.sop.service.IQwSopService;
|
|
|
import com.fs.system.service.ISysConfigService;
|
|
|
@@ -39,10 +45,12 @@ import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.validation.Valid;
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
@@ -83,6 +91,13 @@ public class CourseQwController extends AppBaseController {
|
|
|
@Autowired
|
|
|
private IQwSopService qwSopService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private FsDepVideoShowMapper fsDepVideoShowMapper;
|
|
|
+ @Autowired
|
|
|
+ private FsUserCourseVideoMapper fsUserCourseVideoMapper;
|
|
|
+ @Value("${cloud_host.company_name}")
|
|
|
+ private String companyName;
|
|
|
+
|
|
|
@ApiOperation("查询全部公域的课程")
|
|
|
@GetMapping("/getAppletCourse")
|
|
|
public R getAppletCourse()
|
|
|
@@ -171,6 +186,9 @@ public class CourseQwController extends AppBaseController {
|
|
|
if (log.getLogType()==2){
|
|
|
isFinish=1;
|
|
|
}
|
|
|
+ if ("北京卓美".equals(companyName)){
|
|
|
+ getGoodsAndShow(param, course);
|
|
|
+ }
|
|
|
|
|
|
//将视频时长也存到redis
|
|
|
String videoRedisKey = "h5user:video:duration:" + param.getVideoId();
|
|
|
@@ -206,7 +224,9 @@ public class CourseQwController extends AppBaseController {
|
|
|
if (log.getLogType()==2){
|
|
|
isFinish=1;
|
|
|
}
|
|
|
-
|
|
|
+ if ("北京卓美".equals(companyName)){
|
|
|
+ getGoodsAndShow(param, course);
|
|
|
+ }
|
|
|
return R.ok().put("course",course).put("questions",questionVOList).put("config",config).put("playDuration",duration).put("isFinish",isFinish);
|
|
|
}
|
|
|
|
|
|
@@ -492,5 +512,39 @@ public class CourseQwController extends AppBaseController {
|
|
|
fastgptEventLogTotalService.eventLogTotals(startTime,endTime);
|
|
|
return R.ok();
|
|
|
}
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 小黄车商品和展示
|
|
|
+ */
|
|
|
+ private void getGoodsAndShow(FsUserCourseVideoFinishUParam param, FsUserCourseVideoH5DVO course) {
|
|
|
+ Long videoId = param.getVideoId();
|
|
|
+ String show = fsDepVideoShowMapper.selectFsDepVideoShowByVideoId(videoId, null);
|
|
|
+ course.setShowProduct(show);
|
|
|
+ FsUserCourseVideo courseVideo = fsUserCourseVideoMapper.selectFsUserCourseVideoByVideoId(videoId);
|
|
|
+ String packageJson = courseVideo.getPackageJson();
|
|
|
+ if (StringUtils.isNotEmpty(packageJson)) {
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
+ JsonNode jsonNode = null;
|
|
|
+ try {
|
|
|
+ jsonNode = objectMapper.readTree(packageJson);
|
|
|
+ } catch (JsonProcessingException e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ if (jsonNode.isArray()) {
|
|
|
+ List<FsStoreProductScrm> fsStoreProductScrms = new ArrayList<>();
|
|
|
+ for (JsonNode node : jsonNode) {
|
|
|
+ FsStoreProductScrm fsStoreProductScrm = new FsStoreProductScrm();
|
|
|
+ fsStoreProductScrm.setProductId(node.path("productId").asLong());
|
|
|
+ fsStoreProductScrm.setImages(node.path("image").asText());
|
|
|
+ fsStoreProductScrm.setImgUrl(node.path("imgUrl").asText());
|
|
|
+ fsStoreProductScrm.setBarCode(node.path("barCode").asText());
|
|
|
+ fsStoreProductScrm.setPrice(new BigDecimal(node.path("price").asText()));
|
|
|
+ fsStoreProductScrm.setProductName(node.path("productName").asText());
|
|
|
+ fsStoreProductScrms.add(fsStoreProductScrm);
|
|
|
+ }
|
|
|
+ course.setFsStoreProductScrms(fsStoreProductScrms);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ course.setFsStoreProductScrms(new ArrayList<>());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|