Browse Source

Merge branch 'refs/heads/master' into 企微聊天

# Conflicts:
#	fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java
ct 5 days ago
parent
commit
2cdf048823
32 changed files with 576 additions and 311 deletions
  1. 41 0
      fs-admin/src/main/java/com/fs/course/business/FsVideoResourceBusinessService.java
  2. 27 23
      fs-admin/src/main/java/com/fs/course/controller/FsVideoResourceController.java
  3. 5 1
      fs-admin/src/main/java/com/fs/his/controller/FsUserCouponController.java
  4. 1 1
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreOrderScrmController.java
  5. 23 0
      fs-admin/src/main/java/com/fs/live/controller/LiveDataController.java
  6. 1 1
      fs-ipad-task/src/main/java/com/fs/app/service/IpadSendServer.java
  7. 2 0
      fs-service/src/main/java/com/fs/course/domain/FsUserCourseVideo.java
  8. 18 13
      fs-service/src/main/java/com/fs/course/mapper/FsUserCourseVideoMapper.java
  9. 16 6
      fs-service/src/main/java/com/fs/course/service/IFsUserCourseVideoService.java
  10. 172 214
      fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java
  11. 1 1
      fs-service/src/main/java/com/fs/his/service/impl/FsUserInformationCollectionServiceImpl.java
  12. 11 11
      fs-service/src/main/java/com/fs/hisStore/mapper/FsShippingTemplatesScrmMapper.java
  13. 11 11
      fs-service/src/main/java/com/fs/hisStore/service/IFsShippingTemplatesScrmService.java
  14. 3 3
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsShippingTemplatesScrmServiceImpl.java
  15. 22 0
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderScrmServiceImpl.java
  16. 4 0
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreProductScrmServiceImpl.java
  17. 1 1
      fs-service/src/main/java/com/fs/live/mapper/LiveAfterSalesMapper.java
  18. 3 1
      fs-service/src/main/java/com/fs/live/mapper/LiveMapper.java
  19. 8 4
      fs-service/src/main/java/com/fs/live/service/ILiveDataService.java
  20. 73 0
      fs-service/src/main/java/com/fs/live/service/impl/LiveDataServiceImpl.java
  21. 1 0
      fs-service/src/main/java/com/fs/live/vo/LiveDataDetailVo.java
  22. 56 0
      fs-service/src/main/java/com/fs/live/vo/LiveUserDetailExportVO.java
  23. 1 0
      fs-service/src/main/java/com/fs/live/vo/LiveUserDetailVo.java
  24. 1 0
      fs-service/src/main/java/com/fs/live/vo/ProductSalesVo.java
  25. 1 0
      fs-service/src/main/java/com/fs/store/config/StoreConfig.java
  26. 13 7
      fs-service/src/main/java/com/fs/system/service/impl/SysDictDataServiceImpl.java
  27. 3 3
      fs-service/src/main/resources/application-config-druid-cfryt-test.yml
  28. 3 3
      fs-service/src/main/resources/application-config-druid-cfryt.yml
  29. 1 1
      fs-service/src/main/resources/application-config-fzbt.yml
  30. 1 1
      fs-service/src/main/resources/application-config-myhk.yml
  31. 4 4
      fs-service/src/main/resources/mapper/live/LiveDataMapper.xml
  32. 48 1
      fs-user-app/src/main/java/com/fs/app/controller/live/LiveGoodsController.java

+ 41 - 0
fs-admin/src/main/java/com/fs/course/business/FsVideoResourceBusinessService.java

@@ -0,0 +1,41 @@
+package com.fs.course.business;
+
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.fs.course.domain.FsUserCourseVideo;
+import com.fs.course.domain.FsVideoResource;
+import com.fs.course.service.IFsUserCourseVideoService;
+import com.fs.course.service.IFsVideoResourceService;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+@Service
+public class FsVideoResourceBusinessService {
+
+    private final IFsVideoResourceService fsVideoResourceService;
+
+    private final IFsUserCourseVideoService fsUserCourseVideoService;
+
+    public FsVideoResourceBusinessService(IFsVideoResourceService fsVideoResourceService,
+                                          IFsUserCourseVideoService fsUserCourseVideoService) {
+        this.fsVideoResourceService = fsVideoResourceService;
+        this.fsUserCourseVideoService = fsUserCourseVideoService;
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    public void edit(FsVideoResource fsVideoResource) {
+        FsVideoResource oldResource = fsVideoResourceService.getById(fsVideoResource.getId());
+        fsVideoResourceService.updateById(fsVideoResource);
+        fsUserCourseVideoService.update(new UpdateWrapper<FsUserCourseVideo>()
+                .eq("video_url", oldResource.getVideoUrl())
+                .set("video_url", fsVideoResource.getVideoUrl())
+                .set("line_one", fsVideoResource.getLine1())
+                .set("line_two", fsVideoResource.getLine2())
+                .set("line_three", fsVideoResource.getLine3())
+                .set("duration", fsVideoResource.getDuration())
+                .set("file_size", fsVideoResource.getFileSize())
+                .set("file_key", fsVideoResource.getFileKey())
+                .set("file_name", fsVideoResource.getFileName())
+                .set("thumbnail", fsVideoResource.getThumbnail())
+        );
+    }
+}

+ 27 - 23
fs-admin/src/main/java/com/fs/course/controller/FsVideoResourceController.java

@@ -11,6 +11,8 @@ import com.fs.common.core.domain.model.LoginUser;
 import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
 import com.fs.common.utils.ServletUtils;
+import com.fs.config.cloud.CloudHostProper;
+import com.fs.course.business.FsVideoResourceBusinessService;
 import com.fs.course.config.CourseConfig;
 import com.fs.course.domain.FsVideoResource;
 import com.fs.course.service.IFsVideoResourceService;
@@ -19,7 +21,6 @@ import com.fs.framework.web.service.TokenService;
 import com.fs.system.service.ISysConfigService;
 import com.github.pagehelper.PageHelper;
 import lombok.AllArgsConstructor;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
@@ -37,11 +38,13 @@ public class FsVideoResourceController extends BaseController {
 
     private final IFsVideoResourceService fsVideoResourceService;
 
-    @Autowired
-    private TokenService tokenService;
+    private final TokenService tokenService;
 
-    @Autowired
-    private ISysConfigService configService;
+    private final ISysConfigService configService;
+
+    private final CloudHostProper cloudHostProper;
+
+    private final FsVideoResourceBusinessService videoResourceBusinessService;
 
     /**
      * 查询视频素材库列表
@@ -53,8 +56,7 @@ public class FsVideoResourceController extends BaseController {
                               @RequestParam(required = false) Integer typeId,
                               @RequestParam(required = false) Integer typeSubId,
                               @RequestParam(required = false, defaultValue = "1") Integer pageNum,
-                              @RequestParam(required = false, defaultValue = "10") Integer pageSize)
-    {
+                              @RequestParam(required = false, defaultValue = "10") Integer pageSize) {
         Map<String, Object> params = new HashMap<>();
         params.put("resourceName", resourceName);
         params.put("fileName", fileName);
@@ -63,7 +65,7 @@ public class FsVideoResourceController extends BaseController {
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         String json = configService.selectConfigByKey("course.config");
         CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
-        if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
+        if (ObjectUtil.isNotEmpty(config.getIsBound()) && config.getIsBound()) {
             params.put("userId", loginUser.getUser().getUserId());
         }
         PageHelper.startPage(pageNum, pageSize);
@@ -77,8 +79,7 @@ public class FsVideoResourceController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('course:videoResource:query')")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(fsVideoResourceService.getById(id));
     }
 
@@ -88,13 +89,12 @@ public class FsVideoResourceController extends BaseController {
     @PreAuthorize("@ss.hasPermi('course:videoResource:add')")
     @Log(title = "视频素材库", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody FsVideoResource fsVideoResource)
-    {
+    public AjaxResult add(@RequestBody FsVideoResource fsVideoResource) {
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         Long userId = loginUser.getUser().getUserId();
         String json = configService.selectConfigByKey("course.config");
         CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
-        if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
+        if (ObjectUtil.isNotEmpty(config.getIsBound()) && config.getIsBound()) {
             fsVideoResource.setUserId(userId);
         }
         fsVideoResource.setCreateTime(LocalDateTime.now());
@@ -108,8 +108,12 @@ public class FsVideoResourceController extends BaseController {
     @PreAuthorize("@ss.hasPermi('course:videoResource:edit')")
     @Log(title = "视频素材库", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody FsVideoResource fsVideoResource)
-    {
+    public AjaxResult edit(@RequestBody FsVideoResource fsVideoResource) {
+        if (("今正科技".equals(cloudHostProper.getCompanyName()))) {
+            // 同步资源到课程
+            videoResourceBusinessService.edit(fsVideoResource);
+            return AjaxResult.success();
+        }
         fsVideoResourceService.updateById(fsVideoResource);
         return AjaxResult.success();
     }
@@ -120,8 +124,7 @@ public class FsVideoResourceController extends BaseController {
     @PreAuthorize("@ss.hasPermi('course:videoResource:remove')")
     @Log(title = "视频素材库", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
+    public AjaxResult remove(@PathVariable Long[] ids) {
         Wrapper<FsVideoResource> updateWrapper = Wrappers.<FsVideoResource>lambdaUpdate()
                 .set(FsVideoResource::getIsDel, 1)
                 .in(FsVideoResource::getId, Arrays.asList(ids));
@@ -131,6 +134,7 @@ public class FsVideoResourceController extends BaseController {
 
     /**
      * 批量修改视频分类
+     *
      * @param typeId
      * @param typeSubId
      * @param ids
@@ -142,13 +146,13 @@ public class FsVideoResourceController extends BaseController {
     public AjaxResult batchUpdateClass(@RequestParam("typeId") Long typeId,
                                        @RequestParam("typeSubId") Long typeSubId,
                                        @RequestParam("ids") String ids) {
-        if(typeId == null || typeId <= 0){
+        if (typeId == null || typeId <= 0) {
             return AjaxResult.error("请选择分类");
         }
-        if(typeSubId == null || typeSubId <= 0){
+        if (typeSubId == null || typeSubId <= 0) {
             return AjaxResult.error("请选择子分类");
         }
-        if(ids == null || ids.isEmpty()){
+        if (ids == null || ids.isEmpty()) {
             return AjaxResult.error("请选择要修改的分类");
         }
 
@@ -178,12 +182,12 @@ public class FsVideoResourceController extends BaseController {
         String json = configService.selectConfigByKey("course.config");
         CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
 
-        list.forEach(v ->{
+        list.forEach(v -> {
             v.setCreateTime(LocalDateTime.now());
-            if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
+            if (ObjectUtil.isNotEmpty(config.getIsBound()) && config.getIsBound()) {
                 v.setUserId(userId);
             }
-        } );
+        });
         fsVideoResourceService.saveBatch(list);
         return AjaxResult.success();
     }

+ 5 - 1
fs-admin/src/main/java/com/fs/his/controller/FsUserCouponController.java

@@ -3,6 +3,7 @@ package com.fs.his.controller;
 import java.util.List;
 
 import com.fs.common.annotation.RepeatSubmit;
+import com.fs.common.utils.StringUtils;
 import com.fs.his.param.FsUserCouponParam;
 import com.fs.his.param.FsUserCouponSendParam;
 import com.fs.his.vo.FsFollowExcelListVO;
@@ -62,7 +63,10 @@ public class FsUserCouponController extends BaseController
         startPage();
         List<FsUserCouponListVO> list = fsUserCouponService.selectFsUserCouponListVO(fsUserCoupon);
         for (FsUserCouponListVO vo : list) {
-            vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+            String phone = vo.getPhone();
+            if (StringUtils.isNotBlank(phone)) {
+                vo.setPhone(phone.replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+            }
         }
         return getDataTable(list);
     }

+ 1 - 1
fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreOrderScrmController.java

@@ -209,7 +209,7 @@ public class FsStoreOrderScrmController extends BaseController {
                     }
                 }
                 //
-                if (loginUser.getPermissions().contains("his:storeAfterSales:finance") || loginUser.getPermissions().contains("*:*:*")) {
+                if ((loginUser.getPermissions().contains("his:storeAfterSales:finance")) || loginUser.getPermissions().contains("*:*:*") && (vo.getCost() != null && vo.getTotalNum() != null)) {
                     vo.setFPrice(vo.getCost().multiply(BigDecimal.valueOf(vo.getTotalNum())));
                 } else {
                     vo.setPayPostage(BigDecimal.ZERO);

+ 23 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveDataController.java

@@ -1,13 +1,18 @@
 package com.fs.live.controller;
 
+import com.fs.common.annotation.Log;
 import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
 import com.fs.common.core.domain.R;
 import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
 import com.fs.common.utils.SecurityUtils;
+import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.live.domain.LiveData;
 import com.fs.live.param.LiveDataParam;
 import com.fs.live.service.ILiveDataService;
 import com.fs.live.vo.LiveUserFirstVo;
+import com.fs.live.vo.LiveUserDetailExportVO;
 import com.github.pagehelper.PageHelper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -153,4 +158,22 @@ public class LiveDataController extends BaseController {
         return liveDataService.getLiveUserDetailListByServer(liveId);
     }
 
+    /**
+     * 导出直播间用户详情数据
+     * @param liveId 直播间ID
+     * @return Excel文件
+     */
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:export')")
+    @Log(title = "直播间用户详情", businessType = BusinessType.EXPORT)
+    @GetMapping("/exportLiveUserDetail")
+    public AjaxResult exportLiveUserDetail(@RequestParam Long liveId) {
+        List<LiveUserDetailExportVO> list = liveDataService.exportLiveUserDetail(liveId);
+        if (list == null || list.isEmpty()) {
+            return AjaxResult.error("未找到用户详情数据");
+        }
+        
+        ExcelUtil<LiveUserDetailExportVO> util = new ExcelUtil<>(LiveUserDetailExportVO.class);
+        return util.exportExcel(list, "直播间用户详情数据");
+    }
+
 }

+ 1 - 1
fs-ipad-task/src/main/java/com/fs/app/service/IpadSendServer.java

@@ -83,7 +83,7 @@ public class IpadSendServer {
 
     private final IFsCoursePlaySourceConfigService playSourceConfigService;
     private final FsUserMapper fsUserMapper;
-    private static final List<String> PROJECT_NAMES = Arrays.asList("济南联志健康", "北京存在文化");
+    private static final List<String> PROJECT_NAMES = Arrays.asList("济南联志健康", "北京存在文化","宽益堂");
     private void sendMiniProgram(BaseVo vo, QwSopCourseFinishTempSetting.Setting content, Map<String, FsCoursePlaySourceConfig> miniMap, Long companyId) {
         // 发送参数原本的appid
         String appid = content.getMiniprogramAppid();

+ 2 - 0
fs-service/src/main/java/com/fs/course/domain/FsUserCourseVideo.java

@@ -1,5 +1,6 @@
 package com.fs.course.domain;
 
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.BaseEntity;
@@ -64,6 +65,7 @@ public class FsUserCourseVideo extends BaseEntity
 
     private String fileName;
 
+    @TableLogic(value = "0", delval = "1")
     private Integer isDel;
 
     /**

+ 18 - 13
fs-service/src/main/java/com/fs/course/mapper/FsUserCourseVideoMapper.java

@@ -1,5 +1,6 @@
 package com.fs.course.mapper;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.course.domain.FsUserCourseVideo;
 import com.fs.course.param.CourseVideoUpdates;
 import com.fs.course.param.FsCourseListBySidebarParam;
@@ -25,8 +26,7 @@ import java.util.Map;
  * @author fs
  * @date 2024-05-17
  */
-public interface FsUserCourseVideoMapper
-{
+public interface FsUserCourseVideoMapper extends BaseMapper<FsUserCourseVideo> {
     /**
      * 查询课堂视频
      *
@@ -94,7 +94,7 @@ public interface FsUserCourseVideoMapper
             "<if test = ' maps.userId!=null and maps.userId != \"\" '> " +
             "and v.user_id = #{maps.userId} " +
             "</if>" +
-            " order by v.course_sort  "+
+            " order by v.course_sort  " +
             "</script>"})
     List<FsUserCourseVideo> selectFsUserCourseVideoListByCourseId(@Param("maps") FsUserCourseVideo fsUserCourseVideo);
 
@@ -110,7 +110,7 @@ public interface FsUserCourseVideoMapper
             "<if test = ' maps.keyword!=null and maps.keyword != \"\" '> " +
             "and v.title like CONCAT('%',#{maps.keyword},'%') " +
             "</if>" +
-            " order by v.course_sort  "+
+            " order by v.course_sort  " +
             "</script>"})
     List<FsUserCourseVideoListUVO> selectFsUserCourseVideoListUVOByCourseId(@Param("maps") FsUserCourseVideoListUParam param);
 
@@ -121,7 +121,7 @@ public interface FsUserCourseVideoMapper
             "<if test = ' maps.keyword!=null and maps.keyword != \"\" '> " +
             "and v.title like CONCAT('%',#{maps.keyword},'%') " +
             "</if>" +
-            " order by v.course_sort  "+
+            " order by v.course_sort  " +
             "</script>"})
     List<FsUserCourseVideoListUVO> selectFsUserCourseVideoListByCourseIdAll(@Param("maps") FsUserCourseVideoListUParam param);
 
@@ -129,6 +129,7 @@ public interface FsUserCourseVideoMapper
     @Select("select v.*  from fs_user_course_video v  " +
             "where v.is_del = 0 and v.course_id = #{courseId}  order by v.course_sort  ")
     List<FsUserCourseVideo> selectFsUserCourseListByCourseId(Long courseId);
+
     @Select({"<script> " +
             "select v.video_id, v.title, v.video_url, v.thumbnail, SEC_TO_TIME(v.duration) as duration,v.create_time, v.talent_id, v.course_id, " +
             " v.status, v.course_sort  from fs_user_course_video v  " +
@@ -140,10 +141,10 @@ public interface FsUserCourseVideoMapper
     Long selectVideoCountByCourseId(@Param("courseId") Long courseId);
 
     @Select("select course_sort from fs_user_course_video where course_id = #{courseId} and is_del = 0 order by course_sort desc limit 1 ")
-    Long selectCourseVideoSort(@Param("courseId")Long courseId);
+    Long selectCourseVideoSort(@Param("courseId") Long courseId);
 
     @Select("select count(0) from fs_user_course_video where course_id = #{courseId} and course_sort = #{courseSort} and is_del = 0 ")
-    Long selectFsUserCourseVideoByCourseSort(@Param("courseId")Long courseId, @Param("courseSort")Long courseSort);
+    Long selectFsUserCourseVideoByCourseSort(@Param("courseId") Long courseId, @Param("courseSort") Long courseSort);
 
 
     @Select("select video_id dict_value, title dict_label  from fs_user_course_video where course_id=#{id} and is_del = 0 order by course_sort")
@@ -156,7 +157,7 @@ public interface FsUserCourseVideoMapper
             "<if test = ' maps.title!=null and maps.title != \"\" '> " +
             "and v.title = #{maps.title} " +
             "</if>" +
-            " order by v.course_sort  "+
+            " order by v.course_sort  " +
             "</script>"})
     List<FsUserCourseVideoVO> selectFsUserCourseVideoListByCourseIdAndCompany(@Param("maps") FsUserCourseVideoParam fsUserCourseVideo);
 
@@ -164,10 +165,13 @@ public interface FsUserCourseVideoMapper
             "left join fs_user_course c on c.course_id = v.course_id " +
             "where c.is_private = 1 and v.is_del = 0 ")
     List<FsUserCourseVideo> selectVideoIsPrivate();
+
     @Select("select * from fs_user_course_video WHERE video_id=#{videoId}")
     FsUserCourseVideo selectFsUserCourseVideoByVideoStringId(String videoId);
+
     @Select("select * from fs_user_course_video WHERE course_id=#{courseId} and is_del = 0 order by course_sort,video_id")
     List<FsUserCourseVideo> selectVideoByCourseId(Long courseId);
+
     @Select("select v.* from fs_user_course_video v " +
             "left join fs_user_course c on c.course_id = v.course_id " +
             "where c.is_private = 1 and v.is_del = 0 and v.is_transcode = #{isTranscode}")
@@ -192,8 +196,9 @@ public interface FsUserCourseVideoMapper
 
     /**
      * 获取选项列表
-     * @param params    参数
-     * @return  list
+     *
+     * @param params 参数
+     * @return list
      */
     List<OptionsVO> selectVideoListByMap(@Param("params") Map<String, Object> params);
 
@@ -227,7 +232,7 @@ public interface FsUserCourseVideoMapper
 
     List<FsUserCourseVideoPageListVO> selectFsUserCourseVideoListByMap(@Param("params") Map<String, Object> params);
 
-    FsUserCourseVideo selectByFileKey(@Param("params")String fileKey);
+    FsUserCourseVideo selectByFileKey(@Param("params") String fileKey);
 
     @Select("select * from fs_user_course_video where file_key = #{fileKey} ")
     List<FsUserCourseVideo> selectVideoByFileKey(@Param("fileKey") String fileKey);
@@ -243,7 +248,7 @@ public interface FsUserCourseVideoMapper
     @Select("select title from fs_user_course_video WHERE video_id=#{videoId}")
     String selectFsUserCourseVideoByVideoForTitle(@Param("videoId") Long videoId);
 
-    FsUserCourseVideo selectFsUserCourseVideoByVideoIdAndUserId(@Param("videoId") Long videoId,@Param("userId") Long userId);
+    FsUserCourseVideo selectFsUserCourseVideoByVideoIdAndUserId(@Param("videoId") Long videoId, @Param("userId") Long userId);
 
     /**
      * 查询选择使用的视频列表
@@ -255,7 +260,7 @@ public interface FsUserCourseVideoMapper
      */
     List<FsUserCourseVideoAppletVO> getFsUserCourseVideoAppletVOListByIds(@Param("videoIds") List<Long> videoIds);
 
-    FsUserCourseVO selectFsUserCourseVideoVoByVideoIdAndCourdeId(@Param("videoId") Long videoId,@Param("courseId") Long courseId);
+    FsUserCourseVO selectFsUserCourseVideoVoByVideoIdAndCourdeId(@Param("videoId") Long videoId, @Param("courseId") Long courseId);
 
     @Select("select video_id,is_first,course_sort,tg_id,watching_tg_id,watched_tg_id,watching_tag_id,watched_tag_id,tag_group_id from fs_user_course_video")
     @MapKey("videoId")

+ 16 - 6
fs-service/src/main/java/com/fs/course/service/IFsUserCourseVideoService.java

@@ -17,7 +17,6 @@ import com.fs.course.vo.newfs.FsUserVideoListVO;
 import com.fs.his.domain.FsUser;
 import com.fs.his.vo.OptionsVO;
 import com.fs.qw.param.FsUserCourseRedPageParam;
-import com.fs.sop.domain.QwSopTempDay;
 
 import java.util.List;
 import java.util.Map;
@@ -28,8 +27,7 @@ import java.util.Map;
  * @author fs
  * @date 2024-05-17
  */
-public interface IFsUserCourseVideoService
-{
+public interface IFsUserCourseVideoService extends IService<FsUserCourseVideo> {
     /**
      * 查询课堂视频
      *
@@ -63,6 +61,7 @@ public interface IFsUserCourseVideoService
     public int updateFsUserCourseVideo(FsUserCourseVideo fsUserCourseVideo);
 
     public int updateFsUserCourseRedPage(FsUserCourseRedPageParam userCourseRedPageParam);
+
     public void sortCourseVideo(List<FsUserCourseVideo> list);
 
     /**
@@ -107,12 +106,14 @@ public interface IFsUserCourseVideoService
 
     /**
      * 获取课程视频分页列表
+     *
      * @return FsUserCourseVideoPageListVO
      */
     List<FsUserCourseVideoPageListVO> pageListCourseVideo(UserCourseVideoPageParam param);
 
     /**
      * 获取课程视频详情
+     *
      * @return FsUserCourseVideoDetailsVO
      */
     ResponseResult<FsUserCourseVideoDetailsVO> getVideoDetails(Long videoId);
@@ -121,6 +122,7 @@ public interface IFsUserCourseVideoService
 
     /**
      * 获取下拉视频列表(有分页,仅返回两个字段)
+     *
      * @param param 入参
      * @return list
      */
@@ -128,6 +130,7 @@ public interface IFsUserCourseVideoService
 
     /**
      * 判断是否添加销售
+     *
      * @param param 入参
      * @return 是/否 成功
      */
@@ -135,6 +138,7 @@ public interface IFsUserCourseVideoService
 
     /**
      * 获取链接用户课程详情
+     *
      * @param param 入参
      */
     ResponseResult<FsUserCourseVideoLinkDetailsVO> getLinkCourseVideoDetails(FsUserCourseVideoLinkParam param);
@@ -144,6 +148,7 @@ public interface IFsUserCourseVideoService
 
     /**
      * 更新看课时长
+     *
      * @param param 入参
      * @return
      */
@@ -157,8 +162,9 @@ public interface IFsUserCourseVideoService
 
     /**
      * 获取选项列表
-     * @param params    参数
-     * @return  list
+     *
+     * @param params 参数
+     * @return list
      */
     List<OptionsVO> selectVideoListByMap(Map<String, Object> params);
 
@@ -166,16 +172,19 @@ public interface IFsUserCourseVideoService
 
     /**
      * 只查询用户当天课程章节数据
+     *
      * @param param
      * @return
      */
     List<FsCourseVideoListBySidebarVO> getFsCourseVideoListBySidebarToday(FsCourseListBySidebarParam param);
 
     R createMiniLink(FsCourseLinkMiniParam param);
+
     R createCartLink(FsCourseLinkMiniParam param);
 
     /**
      * 校验时长
+     *
      * @param param
      * @return
      */
@@ -197,7 +206,8 @@ public interface IFsUserCourseVideoService
 
     R checkUserInfo(Long userId);
 
-    public FsUserCourseVideoQVO selectFsUserCourseVideoByVideoIdVO(Long videoId,Long userId);
+    public FsUserCourseVideoQVO selectFsUserCourseVideoByVideoIdVO(Long videoId, Long userId);
+
     R updateWatchDurationIsOpen(FsUserCourseVideoFinishUParam param);
 
     R isAddKfIsOpen(FsUserCourseVideoAddKfUParam param);

File diff suppressed because it is too large
+ 172 - 214
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java


+ 1 - 1
fs-service/src/main/java/com/fs/his/service/impl/FsUserInformationCollectionServiceImpl.java

@@ -1003,7 +1003,7 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
             }
         }
         CompanyUser companyUser = companyUserMapper.selectCompanyUserById(info.getCompanyUserId());
-        info.setCompanyId(companyUser.getCompanyId());
+        vo.setCompanyId(companyUser.getCompanyId());
         return vo;
     }
 

+ 11 - 11
fs-service/src/main/java/com/fs/hisStore/mapper/FsShippingTemplatesScrmMapper.java

@@ -6,23 +6,23 @@ import org.apache.ibatis.annotations.Select;
 
 /**
  * 运费模板Mapper接口
- * 
+ *
  * @author fs
  * @date 2022-03-15
  */
-public interface FsShippingTemplatesScrmMapper 
+public interface FsShippingTemplatesScrmMapper
 {
     /**
      * 查询运费模板
-     * 
-     * @param shippingId 运费模板ID
+     *
+     * @param id 运费模板ID
      * @return 运费模板
      */
     public FsShippingTemplatesScrm selectFsShippingTemplatesById(Long id);
 
     /**
      * 查询运费模板列表
-     * 
+     *
      * @param fsShippingTemplates 运费模板
      * @return 运费模板集合
      */
@@ -30,7 +30,7 @@ public interface FsShippingTemplatesScrmMapper
 
     /**
      * 新增运费模板
-     * 
+     *
      * @param fsShippingTemplates 运费模板
      * @return 结果
      */
@@ -38,7 +38,7 @@ public interface FsShippingTemplatesScrmMapper
 
     /**
      * 修改运费模板
-     * 
+     *
      * @param fsShippingTemplates 运费模板
      * @return 结果
      */
@@ -46,16 +46,16 @@ public interface FsShippingTemplatesScrmMapper
 
     /**
      * 删除运费模板
-     * 
-     * @param shippingId 运费模板ID
+     *
+     * @param id 运费模板ID
      * @return 结果
      */
     public int deleteFsShippingTemplatesById(Long id);
 
     /**
      * 批量删除运费模板
-     * 
-     * @param shippingIds 需要删除的数据ID
+     *
+     * @param id 需要删除的数据ID
      * @return 结果
      */
     public int deleteFsShippingTemplatesByIds(Long[] id);

+ 11 - 11
fs-service/src/main/java/com/fs/hisStore/service/IFsShippingTemplatesScrmService.java

@@ -8,23 +8,23 @@ import com.fs.hisStore.param.FsShippingTemplatesAddEditParam;
 
 /**
  * 运费模板Service接口
- * 
+ *
  * @author fs
  * @date 2022-03-15
  */
-public interface IFsShippingTemplatesScrmService 
+public interface IFsShippingTemplatesScrmService
 {
     /**
      * 查询运费模板
-     * 
-     * @param shippingId 运费模板ID
+     *
+     * @param id 运费模板ID
      * @return 运费模板
      */
     public FsShippingTemplatesScrm selectFsShippingTemplatesById(Long id);
 
     /**
      * 查询运费模板列表
-     * 
+     *
      * @param fsShippingTemplates 运费模板
      * @return 运费模板集合
      */
@@ -32,7 +32,7 @@ public interface IFsShippingTemplatesScrmService
 
     /**
      * 新增运费模板
-     * 
+     *
      * @param fsShippingTemplates 运费模板
      * @return 结果
      */
@@ -40,7 +40,7 @@ public interface IFsShippingTemplatesScrmService
 
     /**
      * 修改运费模板
-     * 
+     *
      * @param fsShippingTemplates 运费模板
      * @return 结果
      */
@@ -48,16 +48,16 @@ public interface IFsShippingTemplatesScrmService
 
     /**
      * 批量删除运费模板
-     * 
-     * @param shippingIds 需要删除的运费模板ID
+     *
+     * @param ids 需要删除的运费模板ID
      * @return 结果
      */
     public int deleteFsShippingTemplatesByIds(Long[] ids);
 
     /**
      * 删除运费模板信息
-     * 
-     * @param shippingId 运费模板ID
+     *
+     * @param id 运费模板ID
      * @return 结果
      */
     public int deleteFsShippingTemplatesById(Long id);

+ 3 - 3
fs-service/src/main/java/com/fs/hisStore/service/impl/FsShippingTemplatesScrmServiceImpl.java

@@ -46,7 +46,7 @@ public class FsShippingTemplatesScrmServiceImpl implements IFsShippingTemplatesS
     /**
      * 查询运费模板
      *
-     * @param shippingId 运费模板ID
+     * @param id 运费模板ID
      * @return 运费模板
      */
     @Override
@@ -96,7 +96,7 @@ public class FsShippingTemplatesScrmServiceImpl implements IFsShippingTemplatesS
     /**
      * 批量删除运费模板
      *
-     * @param shippingIds 需要删除的运费模板ID
+     * @param ids 需要删除的运费模板ID
      * @return 结果
      */
     @Override
@@ -108,7 +108,7 @@ public class FsShippingTemplatesScrmServiceImpl implements IFsShippingTemplatesS
     /**
      * 删除运费模板信息
      *
-     * @param shippingId 运费模板ID
+     * @param ids 运费模板ID
      * @return 结果
      */
     @Override

+ 22 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderScrmServiceImpl.java

@@ -4092,6 +4092,17 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
                     if (amount != null){
                         payMoney=amount;
                     }
+                    //运费
+                    BigDecimal payPostage = order.getPayPostage();
+                    if (payPostage == null || payPostage.compareTo(BigDecimal.ZERO) <= 0){
+                        payPostage = storeConfig.getPayPostage();
+                        if (payPostage == null){
+                            payPostage = BigDecimal.ZERO;
+                        }
+                        order.setPayPrice(order.getPayPrice().add(payPostage));
+                    }
+                    order.setPayPostage(payPostage);
+                    payMoney = payMoney.add(payPostage);
                     order.setPayMoney(payMoney);
                     order.setPayDelivery(order.getPayPrice().subtract(payMoney) );
                 }
@@ -4591,6 +4602,17 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
                     if (amount != null){
                         payMoney=amount;
                     }
+                    //运费
+                    BigDecimal payPostage = order.getPayPostage();
+                    if (payPostage == null || payPostage.compareTo(BigDecimal.ZERO) <= 0){
+                        payPostage = storeConfig.getPayPostage();
+                        if (payPostage == null){
+                            payPostage = BigDecimal.ZERO;
+                        }
+                        order.setPayPrice(order.getPayPrice().add(payPostage));
+                    }
+                    order.setPayPostage(payPostage);
+                    payMoney = payMoney.add(payPostage);
                     order.setPayMoney(payMoney);
                     order.setPayDelivery(order.getPayPrice().subtract(payMoney) );
                 }

+ 4 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreProductScrmServiceImpl.java

@@ -1404,6 +1404,10 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
                         }
                     }
                 }
+                //重命名
+                product.setProductName(product.getProductName() + " - 副本");
+                product.setCreateTime(new Date());
+                product.setUpdateTime(new Date());
 
                 fsStoreProductMapper.insertFsStoreProduct(product);
                 Long fsStoreProductId = product.getProductId();

+ 1 - 1
fs-service/src/main/java/com/fs/live/mapper/LiveAfterSalesMapper.java

@@ -110,7 +110,7 @@ public interface LiveAfterSalesMapper {
     Map<Long, LiveAfterSales> findByOrderIds(@Param("orderIdList") List<Long> orderIdList);
 
     @Select({"<script> " +
-            "select *  from live_after_sales  " +
+            "select lo.order_code,las.*  from live_after_sales las left join live_order lo on lo.order_id = las.order_id " +
             "where 1=1 " +
             "<if test = 'maps.status != null and maps.status ==1   '> " +
             "and sales_status = 0 " +

+ 3 - 1
fs-service/src/main/java/com/fs/live/mapper/LiveMapper.java

@@ -137,7 +137,8 @@ public interface LiveMapper
     @Select({"<script>" +
             "select * from live where 1=1 " +
             " <if test='param.companyId!=null' > and company_id = #{param.companyId} </if> and live_type IN (1,2, 3) AND status IN (3, 4) AND is_del = 0 and is_audit=1 " +
-            " <if test='param.liveName!=null' > and live_name like concat('%' ,#{param.liveName},'%') </if>" +
+            " <if test='param.liveName!=null' > and live_name like concat('%' ,#{param.liveName},'%') </if> " +
+            " order by create_time desc" +
             " </script>"})
     List<Live> listLiveData(@Param("param") LiveDataParam param);
 
@@ -145,6 +146,7 @@ public interface LiveMapper
             "select count(1) from live where 1=1 " +
             " <if test='param.companyId!=null' > and company_id = #{param.companyId} </if> and live_type IN (1,2, 3) AND status IN (3, 4) AND is_del = 0 and is_audit=1" +
             " <if test='param.liveName!=null' > and live_name like concat('%' ,#{param.liveName},'%') </if>" +
+            "  order by create_time desc " +
             " </script>"})
     int listLiveDataCount(@Param("param") LiveDataParam param);
 

+ 8 - 4
fs-service/src/main/java/com/fs/live/service/ILiveDataService.java

@@ -4,10 +4,7 @@ package com.fs.live.service;
 import com.fs.common.core.domain.R;
 import com.fs.live.domain.LiveData;
 import com.fs.live.param.LiveDataParam;
-import com.fs.live.vo.ColumnsConfigVo;
-import com.fs.live.vo.LiveUserFirstVo;
-import com.fs.live.vo.RecentLiveDataVo;
-import com.fs.live.vo.TrendDataVO;
+import com.fs.live.vo.*;
 
 import java.util.List;
 import java.util.Map;
@@ -163,4 +160,11 @@ public interface ILiveDataService {
      * @return 用户详情列表
      */
     R getLiveUserDetailListByServer(Long liveId);
+
+    /**
+     * 导出直播间用户详情数据
+     * @param liveId 直播间ID
+     * @return 导出VO列表
+     */
+    List<LiveUserDetailExportVO> exportLiveUserDetail(Long liveId);
 }

+ 73 - 0
fs-service/src/main/java/com/fs/live/service/impl/LiveDataServiceImpl.java

@@ -1075,4 +1075,77 @@ public class LiveDataServiceImpl implements ILiveDataService {
         return result;
     }
 
+    /**
+     * 导出直播间用户详情数据
+     * @param liveId 直播间ID
+     * @return 导出VO列表
+     */
+    @Override
+    public List<LiveUserDetailExportVO> exportLiveUserDetail(Long liveId) {
+        // 查询用户详情列表
+        List<LiveUserDetailVo> userDetailList = liveDataMapper.selectLiveUserDetailListBySql(liveId);
+        if (userDetailList == null || userDetailList.isEmpty()) {
+            return new ArrayList<>();
+        }
+
+        // 转换为导出VO列表
+        List<LiveUserDetailExportVO> exportList = new ArrayList<>();
+        for (LiveUserDetailVo userDetail : userDetailList) {
+            LiveUserDetailExportVO exportVO = new LiveUserDetailExportVO();
+
+            // 用户基本信息
+            exportVO.setUserId(userDetail.getUserId());
+            exportVO.setUserName(userDetail.getUserName());
+
+            // 观看时长(秒转分钟)
+            exportVO.setLiveWatchDuration(formatSecondsToMinutes(userDetail.getLiveWatchDuration()));
+            exportVO.setPlaybackWatchDuration(formatSecondsToMinutes(userDetail.getPlaybackWatchDuration()));
+
+            // 计算总观看时长
+            Long totalSeconds = (userDetail.getLiveWatchDuration() != null ? userDetail.getLiveWatchDuration() : 0L) +
+                               (userDetail.getPlaybackWatchDuration() != null ? userDetail.getPlaybackWatchDuration() : 0L);
+//            exportVO.setTotalWatchDuration(formatSecondsToMinutes(totalSeconds));
+
+            // 订单信息
+            exportVO.setOrderCount(Math.toIntExact(userDetail.getOrderCount()));
+            exportVO.setOrderAmount(formatMoney(userDetail.getOrderAmount()));
+
+            // 公司和销售信息
+            exportVO.setCompanyName(userDetail.getCompanyName());
+            exportVO.setSalesName(userDetail.getSalesName());
+
+            // 是否完课(根据观看时长判断,假设30分钟以上为完课)
+            if (totalSeconds >= 1800) {
+                exportVO.setIsCompleted("是");
+            } else {
+                exportVO.setIsCompleted("否");
+            }
+
+            exportList.add(exportVO);
+        }
+
+        return exportList;
+    }
+
+    /**
+     * 格式化秒数为分钟(保留2位小数)
+     */
+    private String formatSecondsToMinutes(Long seconds) {
+        if (seconds == null || seconds == 0) {
+            return "0.00";
+        }
+        BigDecimal minutes = new BigDecimal(seconds).divide(new BigDecimal(60), 2, RoundingMode.HALF_UP);
+        return minutes.toString();
+    }
+
+    /**
+     * 格式化金额
+     */
+    private String formatMoney(BigDecimal value) {
+        if (value == null) {
+            return "0.00";
+        }
+        return value.setScale(2, RoundingMode.HALF_UP).toString();
+    }
+
 }

+ 1 - 0
fs-service/src/main/java/com/fs/live/vo/LiveDataDetailVo.java

@@ -96,3 +96,4 @@ public class LiveDataDetailVo {
 }
 
 
+

+ 56 - 0
fs-service/src/main/java/com/fs/live/vo/LiveUserDetailExportVO.java

@@ -0,0 +1,56 @@
+package com.fs.live.vo;
+
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+/**
+ * 直播间用户详情导出VO
+ *
+ * @author fs
+ * @date 2025-12-02
+ */
+@Data
+public class LiveUserDetailExportVO {
+
+    /** 用户ID */
+    @Excel(name = "用户ID")
+    private Long userId;
+
+    /** 用户名称 */
+    @Excel(name = "用户名称")
+    private String userName;
+
+    /** 直播观看时长(分钟) */
+    @Excel(name = "直播观看时长(分钟)")
+    private String liveWatchDuration;
+
+    /** 回放观看时长(分钟) */
+    @Excel(name = "回放观看时长(分钟)")
+    private String playbackWatchDuration;
+
+//    /** 总观看时长(分钟) */
+//    @Excel(name = "总观看时长(分钟)")
+//    private String totalWatchDuration;
+
+    /** 订单数 */
+    @Excel(name = "订单数")
+    private Integer orderCount;
+
+    /** 订单金额(元) */
+    @Excel(name = "订单金额(元)")
+    private String orderAmount;
+
+    /** 分公司 */
+    @Excel(name = "分公司")
+    private String companyName;
+
+    /** 销售 */
+    @Excel(name = "销售")
+    private String salesName;
+
+    /** 是否完课 */
+    @Excel(name = "是否完课")
+    private String isCompleted;
+
+}
+

+ 1 - 0
fs-service/src/main/java/com/fs/live/vo/LiveUserDetailVo.java

@@ -38,3 +38,4 @@ public class LiveUserDetailVo {
 }
 
 
+

+ 1 - 0
fs-service/src/main/java/com/fs/live/vo/ProductSalesVo.java

@@ -26,3 +26,4 @@ public class ProductSalesVo {
 }
 
 
+

+ 1 - 0
fs-service/src/main/java/com/fs/store/config/StoreConfig.java

@@ -22,5 +22,6 @@ public class StoreConfig implements Serializable {
     private String refundPhoneNumber;
     private String refundAddress;
     private Integer auditSwitch; // 订单审核开关
+    private BigDecimal payPostage; // 货到付款邮费
 
 }

+ 13 - 7
fs-service/src/main/java/com/fs/system/service/impl/SysDictDataServiceImpl.java

@@ -12,7 +12,7 @@ import com.fs.system.service.ISysDictDataService;
 
 /**
  * 字典 业务层处理
- * 
+ *
 
  */
 @Service
@@ -23,7 +23,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService
 
     /**
      * 根据条件分页查询字典数据
-     * 
+     *
      * @param dictData 字典数据信息
      * @return 字典数据集合信息
      */
@@ -35,7 +35,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService
 
     /**
      * 根据字典类型和字典键值查询字典数据信息
-     * 
+     *
      * @param dictType 字典类型
      * @param dictValue 字典键值
      * @return 字典标签
@@ -48,7 +48,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService
 
     /**
      * 根据字典数据ID查询信息
-     * 
+     *
      * @param dictCode 字典数据ID
      * @return 字典数据
      */
@@ -60,7 +60,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService
 
     /**
      * 批量删除字典数据信息
-     * 
+     *
      * @param dictCodes 需要删除的字典数据ID
      * @return 结果
      */
@@ -78,13 +78,19 @@ public class SysDictDataServiceImpl implements ISysDictDataService
 
     /**
      * 新增保存字典数据信息
-     * 
+     *
      * @param data 字典数据信息
      * @return 结果
      */
     @Override
     public int insertDictData(SysDictData data)
     {
+        // 数据库数据已经有问题了,唯一索引创建不了,在这个地方 dict_value dict_type 查询有记录不允许插入
+        SysDictData label=dictDataMapper.selectDictDataByTypeAndValue( data.getDictType(),data.getDictValue());
+        if(label!=null){
+            throw new RuntimeException("字典数据已经存在,请更换数据键值");
+        }
+
         int row = dictDataMapper.insertDictData(data);
         if (row > 0)
         {
@@ -96,7 +102,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService
 
     /**
      * 修改保存字典数据信息
-     * 
+     *
      * @param data 字典数据信息
      * @return 结果
      */

+ 3 - 3
fs-service/src/main/resources/application-config-druid-cfryt-test.yml

@@ -69,13 +69,13 @@ nuonuo:
 tencent_cloud_config:
   secret_id: AKIDiMq9lDf2EOM9lIfqqfKo7FNgM5meD0sT
   secret_key: u5SuS80342xzx8FRBukza9lVNHKNMSaB
-  bucket: syysy-1323137866
+  bucket: ryt-1323137866
   app_id: 1323137866
   region: ap-chongqing
-  proxy: syysy
+  proxy: ryt
 cloud_host:
   company_name: 赤峰润
-  projectCode: SYYSY
+  projectCode: ryt
 #看课授权时显示的头像
 headerImg:
   imgUrl: https://ysy-1329817240.cos.ap-guangzhou.myqcloud.com/ysy/20250820/2c47e4f105b641b4a49df50a77338e32.png

+ 3 - 3
fs-service/src/main/resources/application-config-druid-cfryt.yml

@@ -69,13 +69,13 @@ nuonuo:
 tencent_cloud_config:
   secret_id: AKIDiMq9lDf2EOM9lIfqqfKo7FNgM5meD0sT
   secret_key: u5SuS80342xzx8FRBukza9lVNHKNMSaB
-  bucket: cfryt-1323137866
+  bucket: ryt-1323137866
   app_id: 1323137866
   region: ap-chongqing
-  proxy: cfryt
+  proxy: ryt
 cloud_host:
   company_name: 赤峰润
-  projectCode: SYYSY
+  projectCode: ryt
 #看课授权时显示的头像
 headerImg:
   imgUrl: https://ysy-1329817240.cos.ap-guangzhou.myqcloud.com/ysy/20250820/2c47e4f105b641b4a49df50a77338e32.png

+ 1 - 1
fs-service/src/main/resources/application-config-fzbt.yml

@@ -53,7 +53,7 @@ fs :
   commonApi: http://172.27.0.17:8010
   jwt:
     # 加密秘钥
-    secret: f4e2e52034348f86b67cde581c0f9eb5
+    secret: fzbt-zxqzbl
     # token有效时长,7天,单位秒
     expire: 31536000
     header: AppToken

+ 1 - 1
fs-service/src/main/resources/application-config-myhk.yml

@@ -67,7 +67,7 @@ fs :
   commonApi: http://172.27.0.7:8010
   jwt:
     # 加密秘钥
-    secret: f4e2e52034348f86b67cde581c0f9eb5
+    secret: myhk-zxqzbl
     # token有效时长,7天,单位秒
     expire: 31536000
     header: AppToken

+ 4 - 4
fs-service/src/main/resources/mapper/live/LiveDataMapper.xml

@@ -412,7 +412,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectLiveDataDetailBySql" resultType="com.fs.live.vo.LiveDataDetailVo">
         SELECT
             COALESCE(video_duration.total_duration, 0) AS videoDuration,
-            COUNT(DISTINCT lwu.user_id) AS totalViewers,
+            (COUNT(DISTINCT CASE WHEN lwu.live_flag = 1 AND lwu.replay_flag = 0 THEN lwu.user_id END) +  COUNT(DISTINCT CASE WHEN lwu.live_flag = 0 AND lwu.replay_flag = 1 THEN lwu.user_id END)) AS totalViewers,
             COUNT(DISTINCT CASE
                 WHEN lwu.online_seconds >= COALESCE(video_duration.total_duration, 0) AND video_duration.total_duration > 0
                 THEN lwu.user_id
@@ -536,9 +536,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             WHERE live_id = #{liveId} AND user_id IS NOT NULL AND user_id != ''
             GROUP BY user_id
         ) order_info ON lwu.user_id = order_info.user_id
-        LEFT JOIN fs_user_company_user fucu ON lwu.user_id = fucu.user_id
-        LEFT JOIN company c ON fucu.company_id = c.company_id
-        LEFT JOIN company_user cu ON fucu.company_user_id = cu.user_id
+        left join live_user_first_entry lufe on lwu.live_id = lufe.live_id and lwu.user_id = lufe.user_id
+        LEFT JOIN company c ON lufe.company_id = c.company_id
+        LEFT JOIN company_user cu ON lufe.company_user_id = cu.user_id
         WHERE lwu.live_id = #{liveId}
         GROUP BY u.user_id, u.nick_name, u.nickname, order_info.orderCount, order_info.orderAmount, c.company_name, cu.user_name
         ORDER BY order_info.orderAmount DESC, liveWatchDuration DESC

+ 48 - 1
fs-user-app/src/main/java/com/fs/app/controller/live/LiveGoodsController.java

@@ -9,6 +9,13 @@ import com.fs.common.enums.BusinessType;
 import com.fs.common.utils.ServletUtils;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.his.service.IFsStoreProductService;
+import com.fs.hisStore.domain.FsStoreProductAttrScrm;
+import com.fs.hisStore.domain.FsStoreProductAttrValueScrm;
+import com.fs.hisStore.domain.FsStoreProductRelationScrm;
+import com.fs.hisStore.domain.FsStoreProductScrm;
+import com.fs.hisStore.service.IFsStoreProductAttrScrmService;
+import com.fs.hisStore.service.IFsStoreProductAttrValueScrmService;
+import com.fs.hisStore.service.IFsStoreProductRelationScrmService;
 import com.fs.hisStore.service.IFsStoreProductScrmService;
 import com.fs.live.domain.LiveGoods;
 import com.fs.live.service.ILiveGoodsService;
@@ -17,6 +24,7 @@ import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -37,6 +45,13 @@ public class LiveGoodsController extends AppBaseController
 
     @Autowired
     private RedisCache redisCache;
+    @Autowired
+    private IFsStoreProductAttrScrmService attrService;
+    @Autowired
+    private IFsStoreProductRelationScrmService productRelationService;
+
+    @Autowired
+    private IFsStoreProductAttrValueScrmService attrValueService;
 
     /**
      * 查询直播商品列表
@@ -119,7 +134,39 @@ public class LiveGoodsController extends AppBaseController
     @GetMapping("/liveGoodsDetail/{productId}")
     public R liveGoodsDetail(@PathVariable Long productId)
     {
-        return R.ok().put("data",fsStoreProductService.selectFsStoreProductById(productId));
+        FsStoreProductScrm product = fsStoreProductService.selectFsStoreProductById(productId);
+        if(product==null){
+            return R.error("商品不存在或已下架");
+        }
+        List<FsStoreProductAttrScrm> productAttr=attrService.selectFsStoreProductAttrByProductId(productId);
+        List<FsStoreProductAttrValueScrm> productValues=attrValueService.selectFsStoreProductAttrValueByProductId(productId);
+//获取用户的TOKEN写入足迹
+        String userId=getUserId();
+        if(userId!=null){
+            FsStoreProductRelationScrm productRelation=new FsStoreProductRelationScrm();
+            productRelation.setIsDel(0);
+            productRelation.setUserId(Long.parseLong(userId));
+            productRelation.setProductId(product.getProductId());
+            productRelation.setType("foot");
+            List<FsStoreProductRelationScrm> productRelations=productRelationService.selectFsStoreProductRelationList(productRelation);
+            if(productRelations!=null&&productRelations.size()>0){
+                FsStoreProductRelationScrm relation=productRelations.get(0);
+                relation.setUpdateTime(new Date());
+                productRelationService.updateFsStoreProductRelation(relation);
+            }
+            else{
+                FsStoreProductRelationScrm relation=new FsStoreProductRelationScrm();
+                relation.setUserId(Long.parseLong(userId));
+                relation.setIsDel(0);
+                relation.setProductId(product.getProductId());
+                relation.setUpdateTime(new Date());
+                relation.setType("foot");
+                relation.setCreateTime(new Date());
+                relation.setUpdateTime(new Date());
+                productRelationService.insertFsStoreProductRelation(relation);
+            }
+        }
+        return R.ok().put("product",product).put("productAttr",productAttr).put("productValues",productValues);
     }
 
     /**

Some files were not shown because too many files changed in this diff