Browse Source

直播代码

chenguo 2 weeks ago
parent
commit
3faff14661
96 changed files with 4520 additions and 447 deletions
  1. 9 15
      fs-admin/src/main/java/com/fs/live/controller/LiveAnchorController.java
  2. 9 15
      fs-admin/src/main/java/com/fs/live/controller/LiveController.java
  3. 9 15
      fs-admin/src/main/java/com/fs/live/controller/LiveGoodsController.java
  4. 9 15
      fs-admin/src/main/java/com/fs/live/controller/LiveGoodsOrderController.java
  5. 9 15
      fs-admin/src/main/java/com/fs/live/controller/LiveGoodsOrderItemsController.java
  6. 9 15
      fs-admin/src/main/java/com/fs/live/controller/LiveMsgController.java
  7. 9 15
      fs-admin/src/main/java/com/fs/live/controller/LiveQuestionController.java
  8. 19 15
      fs-admin/src/main/java/com/fs/live/controller/LiveVideoController.java
  9. 33 15
      fs-admin/src/main/java/com/fs/live/controller/LiveWatchUserController.java
  10. 121 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveAnchorController.java
  11. 135 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveController.java
  12. 157 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveDataController.java
  13. 121 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveGoodsController.java
  14. 118 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveGoodsOrderController.java
  15. 116 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveGoodsOrderItemsController.java
  16. 101 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveMsgController.java
  17. 74 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveQuestionBankController.java
  18. 118 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveQuestionController.java
  19. 65 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveQuestionLiveController.java
  20. 107 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveStudentDataController.java
  21. 108 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveVideoController.java
  22. 122 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveWatchUserController.java
  23. 12 3
      fs-service/src/main/java/com/fs/live/domain/Live.java
  24. 10 1
      fs-service/src/main/java/com/fs/live/domain/LiveAnchor.java
  25. 70 0
      fs-service/src/main/java/com/fs/live/domain/LiveData.java
  26. 14 4
      fs-service/src/main/java/com/fs/live/domain/LiveGoods.java
  27. 13 4
      fs-service/src/main/java/com/fs/live/domain/LiveGoodsOrder.java
  28. 13 5
      fs-service/src/main/java/com/fs/live/domain/LiveGoodsOrderItems.java
  29. 12 2
      fs-service/src/main/java/com/fs/live/domain/LiveQuestion.java
  30. 55 0
      fs-service/src/main/java/com/fs/live/domain/LiveQuestionBank.java
  31. 36 0
      fs-service/src/main/java/com/fs/live/domain/LiveQuestionLive.java
  32. 57 0
      fs-service/src/main/java/com/fs/live/domain/LiveQuestionUserLog.java
  33. 71 0
      fs-service/src/main/java/com/fs/live/domain/LiveStudentData.java
  34. 0 4
      fs-service/src/main/java/com/fs/live/domain/LiveWatchUser.java
  35. 19 9
      fs-service/src/main/java/com/fs/live/mapper/LiveAnchorMapper.java
  36. 113 0
      fs-service/src/main/java/com/fs/live/mapper/LiveDataMapper.java
  37. 19 9
      fs-service/src/main/java/com/fs/live/mapper/LiveGoodsMapper.java
  38. 19 9
      fs-service/src/main/java/com/fs/live/mapper/LiveGoodsOrderItemsMapper.java
  39. 19 9
      fs-service/src/main/java/com/fs/live/mapper/LiveGoodsOrderMapper.java
  40. 22 9
      fs-service/src/main/java/com/fs/live/mapper/LiveMapper.java
  41. 19 10
      fs-service/src/main/java/com/fs/live/mapper/LiveMsgMapper.java
  42. 10 0
      fs-service/src/main/java/com/fs/live/mapper/LiveQuestionBankMapper.java
  43. 26 0
      fs-service/src/main/java/com/fs/live/mapper/LiveQuestionLiveMapper.java
  44. 19 9
      fs-service/src/main/java/com/fs/live/mapper/LiveQuestionMapper.java
  45. 7 0
      fs-service/src/main/java/com/fs/live/mapper/LiveQuestionUserLogMapper.java
  46. 68 0
      fs-service/src/main/java/com/fs/live/mapper/LiveStudentDataMapper.java
  47. 19 9
      fs-service/src/main/java/com/fs/live/mapper/LiveVideoMapper.java
  48. 36 8
      fs-service/src/main/java/com/fs/live/mapper/LiveWatchUserMapper.java
  49. 62 0
      fs-service/src/main/java/com/fs/live/param/LiveStudentDataQueryParam.java
  50. 19 9
      fs-service/src/main/java/com/fs/live/service/ILiveAnchorService.java
  51. 99 0
      fs-service/src/main/java/com/fs/live/service/ILiveDataService.java
  52. 18 9
      fs-service/src/main/java/com/fs/live/service/ILiveGoodsOrderItemsService.java
  53. 18 9
      fs-service/src/main/java/com/fs/live/service/ILiveGoodsOrderService.java
  54. 19 9
      fs-service/src/main/java/com/fs/live/service/ILiveGoodsService.java
  55. 9 9
      fs-service/src/main/java/com/fs/live/service/ILiveMsgService.java
  56. 40 0
      fs-service/src/main/java/com/fs/live/service/ILiveQuestionBankService.java
  57. 42 0
      fs-service/src/main/java/com/fs/live/service/ILiveQuestionLiveService.java
  58. 18 9
      fs-service/src/main/java/com/fs/live/service/ILiveQuestionService.java
  59. 7 0
      fs-service/src/main/java/com/fs/live/service/ILiveQuestionUserLogService.java
  60. 26 9
      fs-service/src/main/java/com/fs/live/service/ILiveService.java
  61. 70 0
      fs-service/src/main/java/com/fs/live/service/ILiveStudentDataService.java
  62. 26 9
      fs-service/src/main/java/com/fs/live/service/ILiveVideoService.java
  63. 43 8
      fs-service/src/main/java/com/fs/live/service/ILiveWatchUserService.java
  64. 23 11
      fs-service/src/main/java/com/fs/live/service/impl/LiveAnchorServiceImpl.java
  65. 340 0
      fs-service/src/main/java/com/fs/live/service/impl/LiveDataServiceImpl.java
  66. 25 14
      fs-service/src/main/java/com/fs/live/service/impl/LiveGoodsOrderItemsServiceImpl.java
  67. 24 14
      fs-service/src/main/java/com/fs/live/service/impl/LiveGoodsOrderServiceImpl.java
  68. 24 14
      fs-service/src/main/java/com/fs/live/service/impl/LiveGoodsServiceImpl.java
  69. 12 14
      fs-service/src/main/java/com/fs/live/service/impl/LiveMsgServiceImpl.java
  70. 124 0
      fs-service/src/main/java/com/fs/live/service/impl/LiveQuestionBankServiceImpl.java
  71. 117 0
      fs-service/src/main/java/com/fs/live/service/impl/LiveQuestionLiveServiceImpl.java
  72. 25 14
      fs-service/src/main/java/com/fs/live/service/impl/LiveQuestionServiceImpl.java
  73. 11 0
      fs-service/src/main/java/com/fs/live/service/impl/LiveQuestionUserLogServiceImpl.java
  74. 44 8
      fs-service/src/main/java/com/fs/live/service/impl/LiveServiceImpl.java
  75. 100 0
      fs-service/src/main/java/com/fs/live/service/impl/LiveStudentDataServiceImpl.java
  76. 39 15
      fs-service/src/main/java/com/fs/live/service/impl/LiveVideoServiceImpl.java
  77. 62 7
      fs-service/src/main/java/com/fs/live/service/impl/LiveWatchUserServiceImpl.java
  78. 24 0
      fs-service/src/main/java/com/fs/live/vo/ColumnsConfigVo.java
  79. 11 0
      fs-service/src/main/java/com/fs/live/vo/DateRange.java
  80. 38 0
      fs-service/src/main/java/com/fs/live/vo/LiveQuestionLiveVO.java
  81. 31 0
      fs-service/src/main/java/com/fs/live/vo/LiveWatchUserVO.java
  82. 52 0
      fs-service/src/main/java/com/fs/live/vo/RecentLiveDataVo.java
  83. 31 0
      fs-service/src/main/java/com/fs/live/vo/TrendDataVO.java
  84. 155 0
      fs-service/src/main/resources/mapper/live/LiveDataMapper.xml
  85. 15 2
      fs-service/src/main/resources/mapper/live/LiveGoodsMapper.xml
  86. 15 2
      fs-service/src/main/resources/mapper/live/LiveGoodsOrderItemsMapper.xml
  87. 16 3
      fs-service/src/main/resources/mapper/live/LiveGoodsOrderMapper.xml
  88. 29 3
      fs-service/src/main/resources/mapper/live/LiveMapper.xml
  89. 7 2
      fs-service/src/main/resources/mapper/live/LiveMsgMapper.xml
  90. 7 0
      fs-service/src/main/resources/mapper/live/LiveQuestionBankMapper.xml
  91. 35 0
      fs-service/src/main/resources/mapper/live/LiveQuestionLiveMapper.xml
  92. 15 2
      fs-service/src/main/resources/mapper/live/LiveQuestionMapper.xml
  93. 7 0
      fs-service/src/main/resources/mapper/live/LiveQuestionUserLogMapper.xml
  94. 152 0
      fs-service/src/main/resources/mapper/live/LiveStudentDataMapper.xml
  95. 5 1
      fs-service/src/main/resources/mapper/live/LiveVideoMapper.xml
  96. 33 2
      fs-service/src/main/resources/mapper/live/LiveWatchUserMapper.xml

+ 9 - 15
fs-admin/src/main/java/com/fs/live/controller/LiveAnchorController.java

@@ -1,28 +1,22 @@
-package com.fs.live.controller;
+package com.fs.live.controller.controller;
 
-import java.util.List;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
 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.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.live.domain.LiveAnchor;
 import com.fs.live.service.ILiveAnchorService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
 
 /**
  * 主播Controller
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */

+ 9 - 15
fs-admin/src/main/java/com/fs/live/controller/LiveController.java

@@ -1,28 +1,22 @@
-package com.fs.live.controller;
+package com.fs.live.controller.controller;
 
-import java.util.List;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
 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.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.live.domain.Live;
 import com.fs.live.service.ILiveService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
 
 /**
  * 直播Controller
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */

+ 9 - 15
fs-admin/src/main/java/com/fs/live/controller/LiveGoodsController.java

@@ -1,28 +1,22 @@
-package com.fs.live.controller;
+package com.fs.live.controller.controller;
 
-import java.util.List;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
 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.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.live.domain.LiveGoods;
 import com.fs.live.service.ILiveGoodsService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
 
 /**
  * 直播商品Controller
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */

+ 9 - 15
fs-admin/src/main/java/com/fs/live/controller/LiveGoodsOrderController.java

@@ -1,28 +1,22 @@
-package com.fs.live.controller;
+package com.fs.live.controller.controller;
 
-import java.util.List;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
 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.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.live.domain.LiveGoodsOrder;
 import com.fs.live.service.ILiveGoodsOrderService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
 
 /**
  * 订单Controller
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */

+ 9 - 15
fs-admin/src/main/java/com/fs/live/controller/LiveGoodsOrderItemsController.java

@@ -1,28 +1,22 @@
-package com.fs.live.controller;
+package com.fs.live.controller.controller;
 
-import java.util.List;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
 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.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.live.domain.LiveGoodsOrderItems;
 import com.fs.live.service.ILiveGoodsOrderItemsService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
 
 /**
  * 订单商品Controller
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */

+ 9 - 15
fs-admin/src/main/java/com/fs/live/controller/LiveMsgController.java

@@ -1,28 +1,22 @@
-package com.fs.live.controller;
+package com.fs.live.controller.controller;
 
-import java.util.List;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
 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.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.live.domain.LiveMsg;
 import com.fs.live.service.ILiveMsgService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
 
 /**
  * 直播讨论Controller
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */

+ 9 - 15
fs-admin/src/main/java/com/fs/live/controller/LiveQuestionController.java

@@ -1,28 +1,22 @@
-package com.fs.live.controller;
+package com.fs.live.controller.controller;
 
-import java.util.List;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
 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.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.live.domain.LiveQuestion;
 import com.fs.live.service.ILiveQuestionService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
 
 /**
  * 问答Controller
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */

+ 19 - 15
fs-admin/src/main/java/com/fs/live/controller/LiveVideoController.java

@@ -1,28 +1,22 @@
-package com.fs.live.controller;
+package com.fs.live.controller.controller;
 
-import java.util.List;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
 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.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.live.domain.LiveVideo;
 import com.fs.live.service.ILiveVideoService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
 
 /**
  * 直播视频Controller
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */
@@ -68,6 +62,16 @@ public class LiveVideoController extends BaseController
         return AjaxResult.success(liveVideoService.selectLiveVideoByVideoId(videoId));
     }
 
+    /**
+     * 获取直播视频详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveVideo:query')")
+    @GetMapping(value = "/liveVideoByLiveId/{liveId}")
+    public AjaxResult getLiveVideoByLiveId(@PathVariable("liveId") Long liveId)
+    {
+        return AjaxResult.success(liveVideoService.selectLiveVideoByLiveId(liveId));
+    }
+
     /**
      * 新增直播视频
      */

+ 33 - 15
fs-admin/src/main/java/com/fs/live/controller/LiveWatchUserController.java

@@ -1,28 +1,25 @@
-package com.fs.live.controller;
+package com.fs.live.controller.controller;
 
-import java.util.List;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
 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.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.live.domain.LiveWatchUser;
 import com.fs.live.service.ILiveWatchUserService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
+import com.fs.live.vo.LiveWatchUserVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 /**
  * 直播间观看用户Controller
- * 
+ *
  * @author fs
  * @date 2025-01-18
  */
@@ -45,6 +42,16 @@ public class LiveWatchUserController extends BaseController
         return getDataTable(list);
     }
 
+    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:list')")
+    @GetMapping("/watchUserList")
+    public TableDataInfo watchUserList(@RequestParam Long liveId) {
+        Map<String, Object> params = new HashMap<>();
+        params.put("liveId", liveId);
+        startPage();
+        List<LiveWatchUserVO> onLineUserList = liveWatchUserService.selectWatchUserList(params);
+        return getDataTable(onLineUserList);
+    }
+
     /**
      * 导出直播间观看用户列表
      */
@@ -100,4 +107,15 @@ public class LiveWatchUserController extends BaseController
     {
         return toAjax(liveWatchUserService.deleteLiveWatchUserByIds(ids));
     }
+
+    /**
+     * 修改直播间用户禁言状态
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:edit')")
+    @Log(title = "直播间观看用户", businessType = BusinessType.UPDATE)
+    @PutMapping("/changeUserState")
+    public AjaxResult changeUserState(@RequestParam Long liveId, @RequestParam Long userId) {
+        return toAjax(liveWatchUserService.changeUserState(liveId, userId));
+    }
+
 }

+ 121 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveAnchorController.java

@@ -0,0 +1,121 @@
+package com.fs.company.controller.live;
+
+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.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.company.domain.CompanyUser;
+import com.fs.framework.security.LoginUser;
+import com.fs.framework.security.SecurityUtils;
+import com.fs.live.domain.LiveAnchor;
+import com.fs.live.service.ILiveAnchorService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 主播Controller
+ *
+ * @author fs
+ * @date 2025-01-17
+ */
+@RestController
+@RequestMapping("/live/liveAnchor")
+public class LiveAnchorController extends BaseController
+{
+    @Autowired
+    private ILiveAnchorService liveAnchorService;
+
+    /**
+     * 查询主播列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAnchor:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveAnchor liveAnchor)
+    {
+        // 设置企业ID 企业用户ID
+        setCompanyId(liveAnchor);
+
+        startPage();
+        List<LiveAnchor> list = liveAnchorService.selectLiveAnchorList(liveAnchor);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出主播列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAnchor:export')")
+    @Log(title = "主播", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveAnchor liveAnchor)
+    {
+        // 设置企业ID 企业用户ID
+        setCompanyId(liveAnchor);
+
+        List<LiveAnchor> list = liveAnchorService.selectLiveAnchorList(liveAnchor);
+        ExcelUtil<LiveAnchor> util = new ExcelUtil<LiveAnchor>(LiveAnchor.class);
+        return util.exportExcel(list, "主播数据");
+    }
+
+    /**
+     * 获取主播详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAnchor:query')")
+    @GetMapping(value = "/{anchorId}")
+    public AjaxResult getInfo(@PathVariable("anchorId") Long anchorId)
+    {
+        CompanyUser user = SecurityUtils.getLoginUser().getUser();
+        return AjaxResult.success(liveAnchorService.selectLiveAnchorByAnchorIdAndCompanyIdAndCompanyUserId(anchorId, user.getCompanyId(), user.getUserId()));
+    }
+
+    /**
+     * 新增主播
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAnchor:add')")
+    @Log(title = "主播", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveAnchor liveAnchor)
+    {
+        // 设置企业ID 企业用户ID
+        setCompanyId(liveAnchor);
+        return toAjax(liveAnchorService.insertLiveAnchor(liveAnchor));
+    }
+
+    /**
+     * 修改主播
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAnchor:edit')")
+    @Log(title = "主播", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveAnchor liveAnchor)
+    {
+        return toAjax(liveAnchorService.updateLiveAnchor(liveAnchor));
+    }
+
+    /**
+     * 删除主播
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAnchor:remove')")
+    @Log(title = "主播", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{anchorIds}")
+    public AjaxResult remove(@PathVariable Long[] anchorIds)
+    {
+        return toAjax(liveAnchorService.deleteLiveAnchorByAnchorIds(anchorIds));
+    }
+
+    /**
+     * 设置企业ID 企业用户ID
+     * @param liveAnchor 主播信息
+     */
+    private void setCompanyId(LiveAnchor liveAnchor) {
+        // 设置企业ID 企业用户ID
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        CompanyUser user = loginUser.getUser();
+        liveAnchor.setCompanyId(user.getCompanyId());
+        liveAnchor.setCompanyUserId(user.getUserId());
+    }
+}

+ 135 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveController.java

@@ -0,0 +1,135 @@
+package com.fs.company.controller.live;
+
+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.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.company.domain.CompanyUser;
+import com.fs.framework.security.SecurityUtils;
+import com.fs.live.domain.Live;
+import com.fs.live.service.ILiveService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 直播Controller
+ * 
+ * @author fs
+ * @date 2025-01-17
+ */
+@RestController
+@RequestMapping("/live/live")
+public class LiveController extends BaseController
+{
+    @Autowired
+    private ILiveService liveService;
+
+    /**
+     * 查询直播列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:live:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(Live live)
+    {
+        // 设置企业ID和企业用户ID
+        setCompanyId(live);
+
+        startPage();
+        List<Live> list = liveService.selectLiveList(live);
+        return getDataTable(list);
+    }
+
+    /**
+     * 查询直播列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:live:selectLiveToStudent')")
+    @PostMapping("/selectLiveToStudent")
+    public TableDataInfo selectLiveToStudent(@RequestBody Map<String,String> param)
+    {
+        startPage();
+        String liveName = param.get("liveName");
+        String status = param.get("status");
+        String startTime = param.get("startTime");
+        String finishTime = param.get("finishTime");
+        List<Live> list = liveService.selectLiveToStudent(liveName,status,startTime,finishTime);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:live:export')")
+    @Log(title = "直播", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(Live live)
+    {
+        // 设置企业ID和企业用户ID
+        setCompanyId(live);
+
+        List<Live> list = liveService.selectLiveList(live);
+        ExcelUtil<Live> util = new ExcelUtil<Live>(Live.class);
+        return util.exportExcel(list, "直播数据");
+    }
+
+    /**
+     * 获取直播详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:live:query')")
+    @GetMapping(value = "/{liveId}")
+    public AjaxResult getInfo(@PathVariable("liveId") Long liveId)
+    {
+        CompanyUser user = SecurityUtils.getLoginUser().getUser();
+        return AjaxResult.success(liveService.selectLiveByLiveIdAndCompanyIdAndCompanyUserId(liveId, user.getCompanyId(), user.getUserId()));
+    }
+
+    /**
+     * 新增直播
+     */
+    @PreAuthorize("@ss.hasPermi('live:live:add')")
+    @Log(title = "直播", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody Live live)
+    {
+        // 设置企业ID和企业用户ID
+        setCompanyId(live);
+        return toAjax(liveService.insertLive(live));
+    }
+
+    /**
+     * 修改直播
+     */
+    @PreAuthorize("@ss.hasPermi('live:live:edit')")
+    @Log(title = "直播", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody Live live)
+    {
+        return toAjax(liveService.updateLive(live));
+    }
+
+    /**
+     * 删除直播
+     */
+    @PreAuthorize("@ss.hasPermi('live:live:remove')")
+    @Log(title = "直播", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{liveIds}")
+    public AjaxResult remove(@PathVariable Long[] liveIds)
+    {
+        return toAjax(liveService.deleteLiveByLiveIds(liveIds));
+    }
+
+    /**
+     * 设置企业ID和企业用户ID
+     * @param live 直播间
+     */
+    private void setCompanyId(Live live) {
+        CompanyUser user = SecurityUtils.getLoginUser().getUser();
+        live.setCompanyId(user.getCompanyId());
+        live.setCompanyUserId(user.getUserId());
+    }
+}

+ 157 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveDataController.java

@@ -0,0 +1,157 @@
+package com.fs.company.controller.live;
+
+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.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.framework.security.LoginUser;
+import com.fs.framework.service.TokenService;
+import com.fs.live.domain.LiveData;
+import com.fs.live.service.ILiveDataService;
+import com.fs.live.vo.ColumnsConfigVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 直播数据Controller
+ *
+ * @author fs
+ * @date 2025-03-05
+ */
+@RestController
+@RequestMapping("/liveData/liveData")
+public class LiveDataController extends BaseController
+{
+    @Autowired
+    private ILiveDataService liveDataService;
+    @Autowired
+    private TokenService tokenService;
+
+    /**
+     * 查询直播数据列表
+     */
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveData liveData)
+    {
+        startPage();
+        List<LiveData> list = liveDataService.selectLiveDataList(liveData);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播数据列表
+     */
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:export')")
+    @Log(title = "直播数据", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveData liveData)
+    {
+        List<LiveData> list = liveDataService.selectLiveDataList(liveData);
+        ExcelUtil<LiveData> util = new ExcelUtil<LiveData>(LiveData.class);
+        return util.exportExcel(list, "直播数据数据");
+    }
+
+    /**
+     * 获取直播数据详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:query')")
+    @GetMapping(value = "/{liveId}")
+    public AjaxResult getInfo(@PathVariable("liveId") Long liveId)
+    {
+        return AjaxResult.success(liveDataService.selectLiveDataByLiveId(liveId));
+    }
+
+    /**
+     * 新增直播数据
+     */
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:add')")
+    @Log(title = "直播数据", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveData liveData)
+    {
+        return toAjax(liveDataService.insertLiveData(liveData));
+    }
+
+    /**
+     * 修改直播数据
+     */
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:edit')")
+    @Log(title = "直播数据", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveData liveData)
+    {
+        return toAjax(liveDataService.updateLiveData(liveData));
+    }
+
+    /**
+     * 删除直播数据
+     */
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:remove')")
+    @Log(title = "直播数据", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{liveIds}")
+    public AjaxResult remove(@PathVariable Long[] liveIds)
+    {
+        return toAjax(liveDataService.deleteLiveDataByLiveIds(liveIds));
+    }
+
+    /**
+     * 直播数据页面近期直播卡片数据
+     */
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:recentLive')")
+    @GetMapping("/recentLive")
+    public AjaxResult recentLive(){
+        return AjaxResult.success(liveDataService.getRecentLive());
+    }
+
+    /**
+     * 查询直播top榜数据
+     */
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:getLiveTop')")
+    @GetMapping("/getLiveTop")
+    public AjaxResult getLiveTop(String rankType){
+        System.out.println(rankType);
+        return AjaxResult.success(liveDataService.getLiveTop(rankType));
+    }
+    /**
+     * 查询直播趋势数据
+     * @param
+     * @param
+     * @return
+     */
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:getTrendData')")
+    @PostMapping("/getTrendData")
+    public AjaxResult getTrendData(@RequestBody Map<String,String> queryParams) {
+        String type = queryParams.get("type");
+        String date = queryParams.get("date");
+        String category = queryParams.get("category");
+        return AjaxResult.success(liveDataService.getTrendData(type, date,category));
+    }
+    /*@PreAuthorize("@ss.hasPermi('liveData:liveData:columns')")
+    @GetMapping("/columns")
+    public AjaxResult getTableColumns(HttpServletRequest request, HttpServletResponse response) {
+        LoginUser loginUser = tokenService.getLoginUser(request);
+        //LoginUser loginUser = SecurityUtils.getLoginUser();
+        Long userId = loginUser.getUser().getUserId();
+        List<ColumnsConfigVo> columnsConfig = liveDataService.getColumnsConfig(userId.toString());
+       return AjaxResult.success(columnsConfig);
+    }*/
+
+    @PostMapping("/updateColumns")
+    public AjaxResult updateColumns(@RequestBody List<ColumnsConfigVo> columns, HttpServletRequest request) {
+        LoginUser loginUser = tokenService.getLoginUser(request);
+        Long userId = loginUser.getUser().getUserId();
+        liveDataService.saveColumnsConfig(userId.toString(), columns);
+        return AjaxResult.success("列配置已保存");
+    }
+
+
+
+}

+ 121 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveGoodsController.java

@@ -0,0 +1,121 @@
+package com.fs.company.controller.live;
+
+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.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.company.domain.CompanyUser;
+import com.fs.framework.security.LoginUser;
+import com.fs.framework.security.SecurityUtils;
+import com.fs.live.domain.LiveGoods;
+import com.fs.live.service.ILiveGoodsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 直播商品Controller
+ *
+ * @author fs
+ * @date 2025-01-17
+ */
+@RestController
+@RequestMapping("/live/liveGoods")
+public class LiveGoodsController extends BaseController
+{
+    @Autowired
+    private ILiveGoodsService liveGoodsService;
+
+    /**
+     * 查询直播商品列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveGoods:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveGoods liveGoods)
+    {
+        // 设置企业ID和企业用户ID
+        setCompanyId(liveGoods);
+
+        startPage();
+        List<LiveGoods> list = liveGoodsService.selectLiveGoodsList(liveGoods);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播商品列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveGoods:export')")
+    @Log(title = "直播商品", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveGoods liveGoods)
+    {
+        // 设置企业ID和企业用户ID
+        setCompanyId(liveGoods);
+
+        List<LiveGoods> list = liveGoodsService.selectLiveGoodsList(liveGoods);
+        ExcelUtil<LiveGoods> util = new ExcelUtil<LiveGoods>(LiveGoods.class);
+        return util.exportExcel(list, "直播商品数据");
+    }
+
+    /**
+     * 获取直播商品详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveGoods:query')")
+    @GetMapping(value = "/{goodsId}")
+    public AjaxResult getInfo(@PathVariable("goodsId") Long goodsId)
+    {
+        CompanyUser user = SecurityUtils.getLoginUser().getUser();
+        return AjaxResult.success(liveGoodsService.selectLiveGoodsByGoodsIdAndCompanyIdAndCompanyUserId(goodsId, user.getCompanyId(), user.getUserId()));
+    }
+
+    /**
+     * 新增直播商品
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveGoods:add')")
+    @Log(title = "直播商品", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveGoods liveGoods)
+    {
+        // 设置企业ID和企业用户ID
+        setCompanyId(liveGoods);
+        return toAjax(liveGoodsService.insertLiveGoods(liveGoods));
+    }
+
+    /**
+     * 修改直播商品
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveGoods:edit')")
+    @Log(title = "直播商品", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveGoods liveGoods)
+    {
+        return toAjax(liveGoodsService.updateLiveGoods(liveGoods));
+    }
+
+    /**
+     * 删除直播商品
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveGoods:remove')")
+    @Log(title = "直播商品", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{goodsIds}")
+    public AjaxResult remove(@PathVariable Long[] goodsIds)
+    {
+        return toAjax(liveGoodsService.deleteLiveGoodsByGoodsIds(goodsIds));
+    }
+
+    /**
+     * 设置企业ID 企业用户ID
+     * @param liveGoods 直播商品
+     */
+    private void setCompanyId(LiveGoods liveGoods) {
+        // 设置企业ID 企业用户ID
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        CompanyUser user = loginUser.getUser();
+        liveGoods.setCompanyId(user.getCompanyId());
+        liveGoods.setCompanyUserId(user.getUserId());
+    }
+}

+ 118 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveGoodsOrderController.java

@@ -0,0 +1,118 @@
+package com.fs.company.controller.live;
+
+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.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.company.domain.CompanyUser;
+import com.fs.framework.security.SecurityUtils;
+import com.fs.live.domain.LiveGoodsOrder;
+import com.fs.live.service.ILiveGoodsOrderService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 订单Controller
+ * 
+ * @author fs
+ * @date 2025-01-17
+ */
+@RestController
+@RequestMapping("/live/liveOrder")
+public class LiveGoodsOrderController extends BaseController
+{
+    @Autowired
+    private ILiveGoodsOrderService liveGoodsOrderService;
+
+    /**
+     * 查询订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveGoodsOrder liveGoodsOrder)
+    {
+        // 设置企业ID和企业用户ID
+        setCompanyId(liveGoodsOrder);
+
+        startPage();
+        List<LiveGoodsOrder> list = liveGoodsOrderService.selectLiveGoodsOrderList(liveGoodsOrder);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:export')")
+    @Log(title = "订单", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveGoodsOrder liveGoodsOrder)
+    {
+        // 设置企业ID和企业用户ID
+        setCompanyId(liveGoodsOrder);
+
+        List<LiveGoodsOrder> list = liveGoodsOrderService.selectLiveGoodsOrderList(liveGoodsOrder);
+        ExcelUtil<LiveGoodsOrder> util = new ExcelUtil<LiveGoodsOrder>(LiveGoodsOrder.class);
+        return util.exportExcel(list, "订单数据");
+    }
+
+    /**
+     * 获取订单详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:query')")
+    @GetMapping(value = "/{orderId}")
+    public AjaxResult getInfo(@PathVariable("orderId") Long orderId)
+    {
+        CompanyUser user = SecurityUtils.getLoginUser().getUser();
+        return AjaxResult.success(liveGoodsOrderService.selectLiveGoodsOrderByOrderIdAndCompanyIdAndCompanyUserId(orderId, user.getCompanyId(), user.getUserId()));
+    }
+
+    /**
+     * 新增订单
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:add')")
+    @Log(title = "订单", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveGoodsOrder liveGoodsOrder)
+    {
+        // 设置企业ID和企业用户ID
+        setCompanyId(liveGoodsOrder);
+        return toAjax(liveGoodsOrderService.insertLiveGoodsOrder(liveGoodsOrder));
+    }
+
+    /**
+     * 修改订单
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:edit')")
+    @Log(title = "订单", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveGoodsOrder liveGoodsOrder)
+    {
+        return toAjax(liveGoodsOrderService.updateLiveGoodsOrder(liveGoodsOrder));
+    }
+
+    /**
+     * 删除订单
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:remove')")
+    @Log(title = "订单", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{orderIds}")
+    public AjaxResult remove(@PathVariable Long[] orderIds)
+    {
+        return toAjax(liveGoodsOrderService.deleteLiveGoodsOrderByOrderIds(orderIds));
+    }
+
+    /**
+     * 设置企业ID和企业用户ID
+     * @param liveGoodsOrder 直播商品订单
+     */
+    private void setCompanyId(LiveGoodsOrder liveGoodsOrder) {
+        CompanyUser user = SecurityUtils.getLoginUser().getUser();
+        liveGoodsOrder.setCompanyId(user.getCompanyId());
+        liveGoodsOrder.setCompanyUserId(user.getUserId());
+    }
+}

+ 116 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveGoodsOrderItemsController.java

@@ -0,0 +1,116 @@
+package com.fs.company.controller.live;
+
+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.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.company.domain.CompanyUser;
+import com.fs.framework.security.SecurityUtils;
+import com.fs.live.domain.LiveGoodsOrderItems;
+import com.fs.live.service.ILiveGoodsOrderItemsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 订单商品Controller
+ * 
+ * @author fs
+ * @date 2025-01-17
+ */
+@RestController
+@RequestMapping("/live/liveOrderitems")
+public class LiveGoodsOrderItemsController extends BaseController
+{
+    @Autowired
+    private ILiveGoodsOrderItemsService liveGoodsOrderItemsService;
+
+    /**
+     * 查询订单商品列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderitems:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveGoodsOrderItems liveGoodsOrderItems)
+    {
+        // 设置企业ID和企业用户ID
+        setCompanyId(liveGoodsOrderItems);
+
+        startPage();
+        List<LiveGoodsOrderItems> list = liveGoodsOrderItemsService.selectLiveGoodsOrderItemsList(liveGoodsOrderItems);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出订单商品列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderitems:export')")
+    @Log(title = "订单商品", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveGoodsOrderItems liveGoodsOrderItems)
+    {
+        // 设置企业ID和企业用户ID
+        setCompanyId(liveGoodsOrderItems);
+
+        List<LiveGoodsOrderItems> list = liveGoodsOrderItemsService.selectLiveGoodsOrderItemsList(liveGoodsOrderItems);
+        ExcelUtil<LiveGoodsOrderItems> util = new ExcelUtil<LiveGoodsOrderItems>(LiveGoodsOrderItems.class);
+        return util.exportExcel(list, "订单商品数据");
+    }
+
+    /**
+     * 获取订单商品详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderitems:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        CompanyUser user = SecurityUtils.getLoginUser().getUser();
+        return AjaxResult.success(liveGoodsOrderItemsService.selectLiveGoodsOrderItemsByIdAndCompanyIdAndCompanyUserId(id, user.getCompanyId(), user.getUserId()));
+    }
+
+    /**
+     * 新增订单商品
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderitems:add')")
+    @Log(title = "订单商品", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveGoodsOrderItems liveGoodsOrderItems)
+    {
+        return toAjax(liveGoodsOrderItemsService.insertLiveGoodsOrderItems(liveGoodsOrderItems));
+    }
+
+    /**
+     * 修改订单商品
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderitems:edit')")
+    @Log(title = "订单商品", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveGoodsOrderItems liveGoodsOrderItems)
+    {
+        return toAjax(liveGoodsOrderItemsService.updateLiveGoodsOrderItems(liveGoodsOrderItems));
+    }
+
+    /**
+     * 删除订单商品
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderitems:remove')")
+    @Log(title = "订单商品", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(liveGoodsOrderItemsService.deleteLiveGoodsOrderItemsByIds(ids));
+    }
+
+    /**
+     * 设置企业ID和企业用户ID
+     * @param liveGoodsOrderItems 直播订单商品
+     */
+    private void setCompanyId(LiveGoodsOrderItems liveGoodsOrderItems) {
+        CompanyUser user = SecurityUtils.getLoginUser().getUser();
+        liveGoodsOrderItems.setCompanyId(user.getCompanyId());
+        liveGoodsOrderItems.setCompanyUserId(user.getUserId());
+    }
+}

+ 101 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveMsgController.java

@@ -0,0 +1,101 @@
+package com.fs.company.controller.live;
+
+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.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.company.domain.CompanyUser;
+import com.fs.framework.security.SecurityUtils;
+import com.fs.live.domain.LiveMsg;
+import com.fs.live.service.ILiveMsgService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 直播讨论Controller
+ * 
+ * @author fs
+ * @date 2025-01-17
+ */
+@RestController
+@RequestMapping("/live/liveMsg")
+public class LiveMsgController extends BaseController
+{
+    @Autowired
+    private ILiveMsgService liveMsgService;
+
+    /**
+     * 查询直播讨论列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveMsg:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveMsg liveMsg)
+    {
+        startPage();
+        List<LiveMsg> list = liveMsgService.selectLiveMsgList(liveMsg);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播讨论列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveMsg:export')")
+    @Log(title = "直播讨论", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveMsg liveMsg)
+    {
+        List<LiveMsg> list = liveMsgService.selectLiveMsgList(liveMsg);
+        ExcelUtil<LiveMsg> util = new ExcelUtil<LiveMsg>(LiveMsg.class);
+        return util.exportExcel(list, "直播讨论数据");
+    }
+
+    /**
+     * 获取直播讨论详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveMsg:query')")
+    @GetMapping(value = "/{msgId}")
+    public AjaxResult getInfo(@PathVariable("msgId") Long msgId)
+    {
+        CompanyUser user = SecurityUtils.getLoginUser().getUser();
+        return AjaxResult.success(liveMsgService.selectLiveMsgByMsgId(msgId));
+    }
+
+    /**
+     * 新增直播讨论
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveMsg:add')")
+    @Log(title = "直播讨论", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveMsg liveMsg)
+    {
+        return toAjax(liveMsgService.insertLiveMsg(liveMsg));
+    }
+
+    /**
+     * 修改直播讨论
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveMsg:edit')")
+    @Log(title = "直播讨论", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveMsg liveMsg)
+    {
+        return toAjax(liveMsgService.updateLiveMsg(liveMsg));
+    }
+
+    /**
+     * 删除直播讨论
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveMsg:remove')")
+    @Log(title = "直播讨论", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{msgIds}")
+    public AjaxResult remove(@PathVariable Long[] msgIds)
+    {
+        return toAjax(liveMsgService.deleteLiveMsgByMsgIds(msgIds));
+    }
+
+}

+ 74 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveQuestionBankController.java

@@ -0,0 +1,74 @@
+package com.fs.company.controller.live;
+
+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.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.framework.security.SecurityUtils;
+import com.fs.live.domain.LiveQuestionBank;
+import com.fs.live.service.ILiveQuestionBankService;
+import lombok.AllArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/live/liveQuestionBank")
+@AllArgsConstructor
+public class LiveQuestionBankController extends BaseController {
+
+    private final ILiveQuestionBankService liveQuestionBankService;
+
+    /**
+     * 查询题库列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveQuestionBank:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(@RequestParam(required = false) String title) {
+        startPage();
+        List<LiveQuestionBank> list = liveQuestionBankService.selectLiveQuestionBankList(title);
+        return getDataTable(list);
+    }
+
+    /**
+     * 新增题
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveQuestionBank:add')")
+    @Log(title = "题库", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveQuestionBank liveQuestionBank) {
+        return toAjax(liveQuestionBankService.insertLiveQuestionBank(liveQuestionBank, SecurityUtils.getUsername()));
+    }
+
+    /**
+     * 获取题目详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveQuestionBank:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return AjaxResult.success(liveQuestionBankService.getById(id));
+    }
+
+    /**
+     * 修改题目
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveQuestionBank:edit')")
+    @Log(title = "题库", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveQuestionBank liveQuestionBank) {
+        return toAjax(liveQuestionBankService.updateLiveQuestionBank(liveQuestionBank, SecurityUtils.getUsername()));
+    }
+
+    /**
+     * 删除题目
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveQuestionBank:remove')")
+    @Log(title = "题库", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(liveQuestionBankService.deleteLiveQuestionBankByIds(ids));
+    }
+
+}

+ 118 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveQuestionController.java

@@ -0,0 +1,118 @@
+package com.fs.company.controller.live;
+
+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.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.company.domain.CompanyUser;
+import com.fs.framework.security.SecurityUtils;
+import com.fs.live.domain.LiveQuestion;
+import com.fs.live.service.ILiveQuestionService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 问答Controller
+ * 
+ * @author fs
+ * @date 2025-01-17
+ */
+@RestController
+@RequestMapping("/live/liveQuestion")
+public class LiveQuestionController extends BaseController
+{
+    @Autowired
+    private ILiveQuestionService liveQuestionService;
+
+    /**
+     * 查询问答列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveQuestion:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveQuestion liveQuestion)
+    {
+        // 设置企业ID和企业用户ID
+        setCompanyId(liveQuestion);
+
+        startPage();
+        List<LiveQuestion> list = liveQuestionService.selectLiveQuestionList(liveQuestion);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出问答列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveQuestion:export')")
+    @Log(title = "问答", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveQuestion liveQuestion)
+    {
+        // 设置企业ID和企业用户ID
+        setCompanyId(liveQuestion);
+
+        List<LiveQuestion> list = liveQuestionService.selectLiveQuestionList(liveQuestion);
+        ExcelUtil<LiveQuestion> util = new ExcelUtil<LiveQuestion>(LiveQuestion.class);
+        return util.exportExcel(list, "问答数据");
+    }
+
+    /**
+     * 获取问答详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveQuestion:query')")
+    @GetMapping(value = "/{questionId}")
+    public AjaxResult getInfo(@PathVariable("questionId") Long questionId)
+    {
+        CompanyUser user = SecurityUtils.getLoginUser().getUser();
+        return AjaxResult.success(liveQuestionService.selectLiveQuestionByQuestionIdAndCompanyIdAndCompanyUserId(questionId, user.getCompanyId(), user.getUserId()));
+    }
+
+    /**
+     * 新增问答
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveQuestion:add')")
+    @Log(title = "问答", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveQuestion liveQuestion)
+    {
+        // 设置企业ID和企业用户ID
+        setCompanyId(liveQuestion);
+        return toAjax(liveQuestionService.insertLiveQuestion(liveQuestion));
+    }
+
+    /**
+     * 修改问答
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveQuestion:edit')")
+    @Log(title = "问答", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveQuestion liveQuestion)
+    {
+        return toAjax(liveQuestionService.updateLiveQuestion(liveQuestion));
+    }
+
+    /**
+     * 删除问答
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveQuestion:remove')")
+    @Log(title = "问答", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{questionIds}")
+    public AjaxResult remove(@PathVariable Long[] questionIds)
+    {
+        return toAjax(liveQuestionService.deleteLiveQuestionByQuestionIds(questionIds));
+    }
+
+    /**
+     * 设置企业ID和企业用户ID
+     * @param liveQuestion  问答
+     */
+    private void setCompanyId(LiveQuestion liveQuestion) {
+        CompanyUser user = SecurityUtils.getLoginUser().getUser();
+        liveQuestion.setCompanyId(user.getCompanyId());
+        liveQuestion.setCompanyUserId(user.getUserId());
+    }
+}

+ 65 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveQuestionLiveController.java

@@ -0,0 +1,65 @@
+package com.fs.company.controller.live;
+
+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.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.framework.security.SecurityUtils;
+import com.fs.live.service.ILiveQuestionLiveService;
+import com.fs.live.vo.LiveQuestionLiveVO;
+import lombok.AllArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/live/liveQuestionLive")
+@AllArgsConstructor
+public class LiveQuestionLiveController extends BaseController {
+
+    private final ILiveQuestionLiveService liveQuestionLiveService;
+
+    /**
+     * 查询直播间题库列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveConfig:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(@RequestParam Long liveId) {
+        startPage();
+        List<LiveQuestionLiveVO> list = liveQuestionLiveService.selectLiveQuestionLiveList(liveId);
+        return getDataTable(list);
+    }
+
+    /**
+     * 查询直播间题库列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveConfig:list')")
+    @GetMapping("/optionList")
+    public TableDataInfo optionList(@RequestParam Long liveId, @RequestParam(required = false) String title) {
+        startPage();
+        List<LiveQuestionLiveVO> list = liveQuestionLiveService.selectLiveQuestionOptionList(liveId, title);
+        return getDataTable(list);
+    }
+
+    /**
+     * 新增题
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveConfig:list')")
+    @Log(title = "直播间题库", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestParam Long liveId, @RequestParam List<Long> questionIds) {
+        return toAjax(liveQuestionLiveService.insertLiveQuestion(liveId, questionIds, SecurityUtils.getUsername()));
+    }
+
+    /**
+     * 删除题目
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveConfig:list')")
+    @Log(title = "直播间题库", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{liveId}")
+    public AjaxResult remove(@PathVariable Long liveId, @RequestParam List<Long> ids) {
+        return toAjax(liveQuestionLiveService.deleteLiveQuestionByIds(liveId, ids));
+    }
+}

+ 107 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveStudentDataController.java

@@ -0,0 +1,107 @@
+package com.fs.company.controller.live;
+
+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.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.live.domain.LiveStudentData;
+import com.fs.live.param.LiveStudentDataQueryParam;
+import com.fs.live.service.ILiveStudentDataService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 直播间学员数据Controller
+ *
+ * @author fs
+ * @date 2025-03-11
+ */
+@RestController
+@RequestMapping("/live/studentData")
+public class LiveStudentDataController extends BaseController
+{
+    @Autowired
+    private ILiveStudentDataService liveStudentDataService;
+
+    /**
+     * 查询直播间学员数据列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:studentData:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveStudentData liveStudentData)
+    {
+        startPage();
+        List<LiveStudentData> list = liveStudentDataService.selectLiveStudentDataList(liveStudentData);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播间学员数据列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:studentData:export')")
+    @Log(title = "直播间学员数据", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveStudentData liveStudentData)
+    {
+        List<LiveStudentData> list = liveStudentDataService.selectLiveStudentDataList(liveStudentData);
+        ExcelUtil<LiveStudentData> util = new ExcelUtil<LiveStudentData>(LiveStudentData.class);
+        return util.exportExcel(list, "直播间学员数据数据");
+    }
+
+    /**
+     * 获取直播间学员数据详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:studentData:query')")
+    @GetMapping(value = "/{liveId}")
+    public AjaxResult getInfo(@PathVariable("liveId") Long liveId)
+    {
+        return AjaxResult.success(liveStudentDataService.selectLiveStudentDataByLiveId(liveId));
+    }
+
+    /**
+     * 新增直播间学员数据
+     */
+    @PreAuthorize("@ss.hasPermi('live:studentData:add')")
+    @Log(title = "直播间学员数据", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveStudentData liveStudentData)
+    {
+        return toAjax(liveStudentDataService.insertLiveStudentData(liveStudentData));
+    }
+
+    /**
+     * 修改直播间学员数据
+     */
+    @PreAuthorize("@ss.hasPermi('live:studentData:edit')")
+    @Log(title = "直播间学员数据", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveStudentData liveStudentData)
+    {
+        return toAjax(liveStudentDataService.updateLiveStudentData(liveStudentData));
+    }
+
+    /**
+     * 删除直播间学员数据
+     */
+    @PreAuthorize("@ss.hasPermi('live:studentData:remove')")
+    @Log(title = "直播间学员数据", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{liveIds}")
+    public AjaxResult remove(@PathVariable Long[] liveIds)
+    {
+        return toAjax(liveStudentDataService.deleteLiveStudentDataByLiveIds(liveIds));
+    }
+
+    @PreAuthorize("@ss.hasPermi('live:studentData:queryStudentData')")
+    @PostMapping("/queryStudentData")
+    public TableDataInfo queryStudentData(@RequestBody LiveStudentDataQueryParam param)
+    {
+        startPage();
+        List<LiveStudentData> liveStudentData = liveStudentDataService.queryStudentData(param);
+        return getDataTable(liveStudentData);
+    }
+}

+ 108 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveVideoController.java

@@ -0,0 +1,108 @@
+package com.fs.company.controller.live;
+
+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.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.live.domain.LiveVideo;
+import com.fs.live.service.ILiveVideoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 直播视频Controller
+ *
+ * @author fs
+ * @date 2025-01-17
+ */
+@RestController
+@RequestMapping("/live/liveVideo")
+public class LiveVideoController extends BaseController
+{
+    @Autowired
+    private ILiveVideoService liveVideoService;
+
+    /**
+     * 查询直播视频列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveVideo:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveVideo liveVideo)
+    {
+        startPage();
+        List<LiveVideo> list = liveVideoService.selectLiveVideoList(liveVideo);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播视频列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveVideo:export')")
+    @Log(title = "直播视频", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveVideo liveVideo)
+    {
+        List<LiveVideo> list = liveVideoService.selectLiveVideoList(liveVideo);
+        ExcelUtil<LiveVideo> util = new ExcelUtil<LiveVideo>(LiveVideo.class);
+        return util.exportExcel(list, "直播视频数据");
+    }
+
+    /**
+     * 获取直播视频详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveVideo:query')")
+    @GetMapping(value = "/{videoId}")
+    public AjaxResult getInfo(@PathVariable("videoId") Long videoId)
+    {
+        return AjaxResult.success(liveVideoService.selectLiveVideoByLiveId(videoId));
+    }
+
+    /**
+     * 获取直播视频详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveVideo:query')")
+    @GetMapping(value = "/liveVideoByLiveId/{liveId}")
+    public AjaxResult getLiveVideoByLiveId(@PathVariable("liveId") Long liveId)
+    {
+        return AjaxResult.success(liveVideoService.selectLiveVideoByLiveId(liveId));
+    }
+
+    /**
+     * 新增直播视频
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveVideo:add')")
+    @Log(title = "直播视频", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveVideo liveVideo)
+    {
+        return toAjax(liveVideoService.insertLiveVideo(liveVideo));
+    }
+
+    /**
+     * 修改直播视频
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveVideo:edit')")
+    @Log(title = "直播视频", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveVideo liveVideo)
+    {
+        return toAjax(liveVideoService.updateLiveVideo(liveVideo));
+    }
+
+    /**
+     * 删除直播视频
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveVideo:remove')")
+    @Log(title = "直播视频", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{videoIds}")
+    public AjaxResult remove(@PathVariable Long[] videoIds)
+    {
+        return toAjax(liveVideoService.deleteLiveVideoByVideoIds(videoIds));
+    }
+
+}

+ 122 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveWatchUserController.java

@@ -0,0 +1,122 @@
+package com.fs.company.controller.live;
+
+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.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.live.domain.LiveWatchUser;
+import com.fs.live.service.ILiveWatchUserService;
+import com.fs.live.vo.LiveWatchUserVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 直播间观看用户Controller
+ *
+ * @author fs
+ * @date 2025-01-18
+ */
+@RestController
+@RequestMapping("/live/liveWatchUser")
+public class LiveWatchUserController extends BaseController
+{
+    @Autowired
+    private ILiveWatchUserService liveWatchUserService;
+
+    /**
+     * 查询直播间观看用户列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveWatchUser liveWatchUser)
+    {
+        startPage();
+        List<LiveWatchUser> list = liveWatchUserService.selectLiveWatchUserList(liveWatchUser);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:list')")
+    @GetMapping("/watchUserList")
+    public TableDataInfo watchUserList(@RequestParam Long liveId) {
+        Map<String, Object> params = new HashMap<>();
+        params.put("liveId", liveId);
+
+        startPage();
+        List<LiveWatchUserVO> onLineUserList = liveWatchUserService.selectWatchUserList(params);
+        return getDataTable(onLineUserList);
+    }
+
+    /**
+     * 导出直播间观看用户列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:export')")
+    @Log(title = "直播间观看用户", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveWatchUser liveWatchUser)
+    {
+        List<LiveWatchUser> list = liveWatchUserService.selectLiveWatchUserList(liveWatchUser);
+        ExcelUtil<LiveWatchUser> util = new ExcelUtil<LiveWatchUser>(LiveWatchUser.class);
+        return util.exportExcel(list, "直播间观看用户数据");
+    }
+
+    /**
+     * 获取直播间观看用户详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(liveWatchUserService.selectLiveWatchUserById(id));
+    }
+
+    /**
+     * 新增直播间观看用户
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:add')")
+    @Log(title = "直播间观看用户", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveWatchUser liveWatchUser)
+    {
+        return toAjax(liveWatchUserService.insertLiveWatchUser(liveWatchUser));
+    }
+
+    /**
+     * 修改直播间观看用户
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:edit')")
+    @Log(title = "直播间观看用户", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveWatchUser liveWatchUser)
+    {
+        return toAjax(liveWatchUserService.updateLiveWatchUser(liveWatchUser));
+    }
+
+    /**
+     * 删除直播间观看用户
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:remove')")
+    @Log(title = "直播间观看用户", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(liveWatchUserService.deleteLiveWatchUserByIds(ids));
+    }
+
+    /**
+     * 修改直播间用户禁言状态
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:edit')")
+    @Log(title = "直播间观看用户", businessType = BusinessType.UPDATE)
+    @PutMapping("/changeUserState")
+    public AjaxResult changeUserState(@RequestParam Long liveId, @RequestParam Long userId) {
+        return toAjax(liveWatchUserService.changeUserState(liveId, userId));
+    }
+
+}

+ 12 - 3
fs-service/src/main/java/com/fs/live/domain/Live.java

@@ -1,8 +1,5 @@
 package com.fs.live.domain;
 
-import java.time.LocalDateTime;
-import java.util.Date;
-
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -12,6 +9,8 @@ import com.fs.common.core.domain.BaseEntity;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.time.LocalDateTime;
+
 /**
  * 直播对象 live
  *
@@ -26,6 +25,16 @@ public class Live extends BaseEntity {
     @TableId(type = IdType.AUTO)
     private Long liveId;
 
+    /**
+     * 企业ID
+     */
+    private Long companyId;
+
+    /**
+     * 企业用户ID
+     */
+    private Long companyUserId;
+
     /** 直播名称 */
     @Excel(name = "直播名称")
     private String liveName;

+ 10 - 1
fs-service/src/main/java/com/fs/live/domain/LiveAnchor.java

@@ -18,10 +18,19 @@ import lombok.EqualsAndHashCode;
 public class LiveAnchor extends BaseEntity {
 
     /** ID */
-
     @TableId(type = IdType.AUTO)
     private Long anchorId;
 
+    /**
+     * 企业ID
+     */
+    private Long companyId;
+
+    /**
+     * 企业用户ID
+     */
+    private Long companyUserId;
+
     /** 昵称 */
     @Excel(name = "昵称")
     private String nickName;

+ 70 - 0
fs-service/src/main/java/com/fs/live/domain/LiveData.java

@@ -0,0 +1,70 @@
+package com.fs.live.domain;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 直播数据对象 live_data
+ *
+ * @author fs
+ * @date 2025-03-05
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class LiveData extends BaseEntity{
+
+    /** 直播id */
+    @TableId
+    private Long liveId;
+
+   /* *//** 直播名称 *//*
+    @Excel(name = "直播名称")
+    private String liveName;
+
+    *//** 直播封面 *//*
+    @Excel(name = "直播封面")
+    private String liveImgUrl;
+
+    *//** 1待直播 2直播中 3已结束 *//*
+    @Excel(name = "1待直播 2直播中 3已结束")
+    private Integer status;
+
+    *//** 开始时间 *//*
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date startTime;
+
+    *//** 结束时间 *//*
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date finishTime;
+
+    *//** 直播地址 *//*
+    @Excel(name = "直播地址")
+    private String rtmpUrl;*/
+
+    /** 浏览量 */
+    @Excel(name = "浏览量")
+    private Long pageViews;
+
+    /** 访客数 */
+    @Excel(name = "访客数")
+    private Long uniqueVisitors;
+
+    /** 累计观看人次 */
+    @Excel(name = "累计观看人次")
+    private Long totalViews;
+
+    /** 累计观看人数 */
+    @Excel(name = "累计观看人数")
+    private Long uniqueViewers;
+
+    /** 最高在线人数 */
+    @Excel(name = "最高在线人数")
+    private Long peakConcurrentViewers;
+
+
+}

+ 14 - 4
fs-service/src/main/java/com/fs/live/domain/LiveGoods.java

@@ -1,14 +1,14 @@
 package com.fs.live.domain;
 
-import java.math.BigDecimal;
-
-import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.BaseEntity;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.math.BigDecimal;
+
 /**
  * 直播商品对象 live_goods
  *
@@ -20,13 +20,23 @@ import lombok.EqualsAndHashCode;
 public class LiveGoods extends BaseEntity {
 
     /** ID */
-
+    @TableId(type = IdType.AUTO)
     private Long goodsId;
 
     /** 直播ID */
     @Excel(name = "直播ID")
     private Long liveId;
 
+    /**
+     * 企业ID
+     */
+    private Long companyId;
+
+    /**
+     * 企业用户ID
+     */
+    private Long companyUserId;
+
     /** 商品名称 */
     @Excel(name = "商品名称")
     private String goodsName;

+ 13 - 4
fs-service/src/main/java/com/fs/live/domain/LiveGoodsOrder.java

@@ -1,8 +1,5 @@
 package com.fs.live.domain;
 
-import java.math.BigDecimal;
-import java.util.Date;
-
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -11,6 +8,9 @@ import com.fs.common.core.domain.BaseEntity;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.math.BigDecimal;
+import java.util.Date;
+
 /**
  * 订单对象 live_goods_order
  *
@@ -22,10 +22,19 @@ import lombok.EqualsAndHashCode;
 public class LiveGoodsOrder extends BaseEntity {
 
     /** $column.columnComment */
-
     @TableId(type = IdType.AUTO)
     private Long orderId;
 
+    /**
+     * 企业ID
+     */
+    private Long companyId;
+
+    /**
+     * 企业用户ID
+     */
+    private Long companyUserId;
+
     /** 订单号 */
     @Excel(name = "订单号")
     private String orderSn;

+ 13 - 5
fs-service/src/main/java/com/fs/live/domain/LiveGoodsOrderItems.java

@@ -1,14 +1,12 @@
 package com.fs.live.domain;
 
-import java.math.BigDecimal;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
 import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.BaseEntity;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.math.BigDecimal;
+
 /**
  * 订单商品对象 live_goods_order_items
  *
@@ -20,7 +18,7 @@ import lombok.EqualsAndHashCode;
 public class LiveGoodsOrderItems extends BaseEntity {
 
     /** ID */
-    @TableId(type = IdType.AUTO)
+
     private Long id;
 
     /** 商品ID */
@@ -31,6 +29,16 @@ public class LiveGoodsOrderItems extends BaseEntity {
     @Excel(name = "订单ID")
     private Long orderId;
 
+    /**
+     * 企业ID
+     */
+    private Long companyId;
+
+    /**
+     * 企业用户ID
+     */
+    private Long companyUserId;
+
     /** 商品JSON */
     @Excel(name = "商品JSON")
     private String goodsJson;

+ 12 - 2
fs-service/src/main/java/com/fs/live/domain/LiveQuestion.java

@@ -1,7 +1,5 @@
 package com.fs.live.domain;
 
-import java.util.Date;
-
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -10,6 +8,8 @@ import com.fs.common.core.domain.BaseEntity;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.util.Date;
+
 /**
  * 问答对象 live_question
  *
@@ -24,6 +24,16 @@ public class LiveQuestion extends BaseEntity {
     @TableId(type = IdType.AUTO)
     private Long questionId;
 
+    /**
+     * 企业ID
+     */
+    private Long companyId;
+
+    /**
+     * 企业用户ID
+     */
+    private Long companyUserId;
+
     /** 用户ID */
     @Excel(name = "用户ID")
     private Long userId;

+ 55 - 0
fs-service/src/main/java/com/fs/live/domain/LiveQuestionBank.java

@@ -0,0 +1,55 @@
+package com.fs.live.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Data
+public class LiveQuestionBank {
+    /**
+     * 主键ID
+     */
+    @TableId(type = IdType.AUTO)
+    private Long id;
+    /**
+     * 标题
+     */
+    private String title;
+    /**
+     * 内容
+     */
+    private String content;
+    /**
+     * 题目类型 1单选 2多选
+     */
+    private Integer type;
+    /**
+     * 答案
+     */
+    private String answer;
+    /**
+     * sort
+     */
+    private Integer sort;
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime createTime;
+    /**
+     * 创建人
+     */
+    private String createBy;
+    /**
+     * 修改时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime updateTime;
+    /**
+     * 修改人
+     */
+    private String updateBy;
+}

+ 36 - 0
fs-service/src/main/java/com/fs/live/domain/LiveQuestionLive.java

@@ -0,0 +1,36 @@
+package com.fs.live.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Data
+public class LiveQuestionLive {
+    /**
+     * 主键ID
+     */
+    @TableId(type = IdType.AUTO)
+    private Long id;
+    /**
+     * 直播间ID
+     */
+    private Long liveId;
+    /**
+     * 题目ID
+     */
+    private Long questionId;
+    /**
+     * 序号
+     */
+    private Integer sort;
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+    /**
+     * 创建人
+     */
+    private String createBy;
+}

+ 57 - 0
fs-service/src/main/java/com/fs/live/domain/LiveQuestionUserLog.java

@@ -0,0 +1,57 @@
+package com.fs.live.domain;
+
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Data
+public class LiveQuestionUserLog {
+    /**
+     * 主键ID
+     */
+    private Long id;
+    /**
+     * 直播间ID
+     */
+    private Long liveId;
+    /**
+     * 直播间题库ID
+     */
+    private Long questionLiveId;
+    /**
+     * 用户ID
+     */
+    private Long userId;
+    /**
+     * 标题
+     */
+    private String title;
+    /**
+     * 内容
+     */
+    private String content;
+    /**
+     * 题目类型 1单选 2多选
+     */
+    private Integer type;
+    /**
+     * 答案
+     */
+    private String answer;
+    /**
+     * 回答
+     */
+    private String reply;
+    /**
+     * 是否正确
+     */
+    private Integer correct;
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+    /**
+     * 创建人
+     */
+    private String createBy;
+}

+ 71 - 0
fs-service/src/main/java/com/fs/live/domain/LiveStudentData.java

@@ -0,0 +1,71 @@
+package com.fs.live.domain;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 直播间学员数据对象 live_student_data
+ *
+ * @author fs
+ * @date 2025-03-11
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class LiveStudentData extends BaseEntity{
+
+    /** 直播间id */
+    @TableId
+    private Long liveId;
+
+    /** 直播间名称 */
+    @Excel(name = "直播间名称")
+    private String liveName;
+
+    /** 客户id */
+    @Excel(name = "客户id")
+    private Long userId;
+
+    /** 客户名 */
+    @Excel(name = "客户名")
+    private String userName;
+
+    /** 归属部门id */
+    @Excel(name = "归属部门id")
+    private Long deptId;
+
+    /** 客户电话 */
+    @Excel(name = "客户电话")
+    private String userPhone;
+
+    /** 客户创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm")
+    @Excel(name = "客户创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:ss:mm")
+    private Date userCreateTime;
+
+    /** 分享直播间次数 */
+    @Excel(name = "分享直播间次数")
+    private Long shareCount;
+
+    /** 归属部门名称 */
+    @Excel(name = "归属部门名称")
+    private String deptName;
+
+    /** 跟进人姓名 */
+    @Excel(name = "跟进人姓名")
+    private String companyUserName;
+
+    /** 跟进人id */
+    @Excel(name = "跟进人id")
+    private Long companyUserId;
+
+    private Long goodsCount;
+
+    private Long questionCount;
+
+}

+ 0 - 4
fs-service/src/main/java/com/fs/live/domain/LiveWatchUser.java

@@ -1,11 +1,8 @@
 package com.fs.live.domain;
 
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
 import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.BaseEntityTow;
 import lombok.Data;
-import com.fs.common.core.domain.BaseEntity;
 import lombok.EqualsAndHashCode;
 
 /**
@@ -20,7 +17,6 @@ public class LiveWatchUser extends BaseEntityTow {
 
 
     /** 直播ID */
-    @TableId(type = IdType.AUTO)
     @Excel(name = "直播ID")
     private Long liveId;
 

+ 19 - 9
fs-service/src/main/java/com/fs/live/mapper/LiveAnchorMapper.java

@@ -1,28 +1,38 @@
 package com.fs.live.mapper;
 
-import java.util.List;
-
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.live.domain.LiveAnchor;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * 主播Mapper接口
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */
 public interface LiveAnchorMapper extends BaseMapper<LiveAnchor> {
     /**
      * 查询主播
-     * 
+     *
      * @param anchorId 主播主键
      * @return 主播
      */
     public LiveAnchor selectLiveAnchorByAnchorId(Long anchorId);
 
+    /**
+     * 查询企业主播
+     * @param anchorId          主播ID
+     * @param companyId         企业ID
+     * @param companyUserId     企业用户ID
+     * @return liveAnchor
+     */
+    LiveAnchor selectLiveAnchorByAnchorIdAndCompanyIdAndCompanyUserId(@Param("anchorId") Long anchorId, @Param("companyId") Long companyId, @Param("companyUserId") Long companyUserId);
+
     /**
      * 查询主播列表
-     * 
+     *
      * @param liveAnchor 主播
      * @return 主播集合
      */
@@ -30,7 +40,7 @@ public interface LiveAnchorMapper extends BaseMapper<LiveAnchor> {
 
     /**
      * 新增主播
-     * 
+     *
      * @param liveAnchor 主播
      * @return 结果
      */
@@ -38,7 +48,7 @@ public interface LiveAnchorMapper extends BaseMapper<LiveAnchor> {
 
     /**
      * 修改主播
-     * 
+     *
      * @param liveAnchor 主播
      * @return 结果
      */
@@ -46,7 +56,7 @@ public interface LiveAnchorMapper extends BaseMapper<LiveAnchor> {
 
     /**
      * 删除主播
-     * 
+     *
      * @param anchorId 主播主键
      * @return 结果
      */
@@ -54,7 +64,7 @@ public interface LiveAnchorMapper extends BaseMapper<LiveAnchor> {
 
     /**
      * 批量删除主播
-     * 
+     *
      * @param anchorIds 需要删除的数据主键集合
      * @return 结果
      */

+ 113 - 0
fs-service/src/main/java/com/fs/live/mapper/LiveDataMapper.java

@@ -0,0 +1,113 @@
+package com.fs.live.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.live.domain.LiveData;
+import com.fs.live.vo.RecentLiveDataVo;
+import com.fs.live.vo.TrendDataVO;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 直播数据Mapper接口
+ *
+ * @author fs
+ * @date 2025-03-05
+ */
+@Repository
+public interface LiveDataMapper extends BaseMapper<LiveData>{
+    /**
+     * 查询直播数据
+     *
+     * @param liveId 直播数据主键
+     * @return 直播数据
+     */
+    LiveData selectLiveDataByLiveId(Long liveId);
+
+    /**
+     * 查询直播数据列表
+     *
+     * @param liveData 直播数据
+     * @return 直播数据集合
+     */
+    List<LiveData> selectLiveDataList(LiveData liveData);
+
+    /**
+     * 新增直播数据
+     *
+     * @param liveData 直播数据
+     * @return 结果
+     */
+    int insertLiveData(LiveData liveData);
+
+    /**
+     * 修改直播数据
+     *
+     * @param liveData 直播数据
+     * @return 结果
+     */
+    int updateLiveData(LiveData liveData);
+
+    /**
+     * 删除直播数据
+     *
+     * @param liveId 直播数据主键
+     * @return 结果
+     */
+    int deleteLiveDataByLiveId(Long liveId);
+
+    /**
+     * 批量删除直播数据
+     *
+     * @param liveIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteLiveDataByLiveIds(Long[] liveIds);
+
+    /**
+     * 查询所有正在直播的id
+     * @return
+     */
+    List<Long> getAllLiveIds();
+
+    /**
+     * 查询近期直播数据
+     * @return
+     */
+    List<RecentLiveDataVo> getRecentLive();
+
+    /**
+     * 查询直播数据top10
+     * @param rankType
+     * @return
+     */
+    List<RecentLiveDataVo> getLiveTop(@Param("rankType") String rankType);
+
+    /**
+     * 查询所选时间周期的直播数据
+     * @param startDate
+     * @param endDate
+     * @return
+     */
+    TrendDataVO getCurrentData(@Param("startDate") String startDate, @Param("endDate") String endDate);
+
+    /**
+     * 查询折线图展示的直播数据
+     * @param chartStartDate
+     * @param chartEndDate
+     * @param format
+     * @return
+     */
+    List<Map<String, Object>> getChartData(@Param("chartStartDate") String chartStartDate, @Param("chartEndDate") String chartEndDate, @Param("format") String format,@Param("category") String category);
+
+    /**
+     * 查询所选时间上一个周期的直播数据
+     * @param prevStartDate
+     * @param prevEndDate
+     * @return
+     */
+    TrendDataVO getPreviousData(@Param("prevStartDate") String prevStartDate, @Param("prevEndDate") String prevEndDate);
+
+}

+ 19 - 9
fs-service/src/main/java/com/fs/live/mapper/LiveGoodsMapper.java

@@ -1,13 +1,14 @@
 package com.fs.live.mapper;
 
-import java.util.List;
-
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.live.domain.LiveGoods;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * 直播商品Mapper接口
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */
@@ -15,15 +16,24 @@ public interface LiveGoodsMapper extends BaseMapper<LiveGoods>
 {
     /**
      * 查询直播商品
-     * 
+     *
      * @param goodsId 直播商品主键
      * @return 直播商品
      */
     public LiveGoods selectLiveGoodsByGoodsId(Long goodsId);
 
+    /**
+     * 查询企业直播商品
+     * @param goodsId       商品ID
+     * @param companyId     企业ID
+     * @param companyUserId 企业用户ID
+     * @return liveGoods
+     */
+    LiveGoods selectLiveGoodsByGoodsIdAndCompanyIdAndCompanyUserId(@Param("goodsId") Long goodsId, @Param("companyId") Long companyId, @Param("companyUserId") Long companyUserId);
+
     /**
      * 查询直播商品列表
-     * 
+     *
      * @param liveGoods 直播商品
      * @return 直播商品集合
      */
@@ -31,7 +41,7 @@ public interface LiveGoodsMapper extends BaseMapper<LiveGoods>
 
     /**
      * 新增直播商品
-     * 
+     *
      * @param liveGoods 直播商品
      * @return 结果
      */
@@ -39,7 +49,7 @@ public interface LiveGoodsMapper extends BaseMapper<LiveGoods>
 
     /**
      * 修改直播商品
-     * 
+     *
      * @param liveGoods 直播商品
      * @return 结果
      */
@@ -47,7 +57,7 @@ public interface LiveGoodsMapper extends BaseMapper<LiveGoods>
 
     /**
      * 删除直播商品
-     * 
+     *
      * @param goodsId 直播商品主键
      * @return 结果
      */
@@ -55,7 +65,7 @@ public interface LiveGoodsMapper extends BaseMapper<LiveGoods>
 
     /**
      * 批量删除直播商品
-     * 
+     *
      * @param goodsIds 需要删除的数据主键集合
      * @return 结果
      */

+ 19 - 9
fs-service/src/main/java/com/fs/live/mapper/LiveGoodsOrderItemsMapper.java

@@ -1,13 +1,14 @@
 package com.fs.live.mapper;
 
-import java.util.List;
-
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.live.domain.LiveGoodsOrderItems;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * 订单商品Mapper接口
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */
@@ -15,15 +16,24 @@ public interface LiveGoodsOrderItemsMapper extends BaseMapper<LiveGoodsOrderItem
 {
     /**
      * 查询订单商品
-     * 
+     *
      * @param id 订单商品主键
      * @return 订单商品
      */
     public LiveGoodsOrderItems selectLiveGoodsOrderItemsById(Long id);
 
+    /**
+     * 查询企业订单商品
+     * @param id            订单ID
+     * @param companyId     企业ID
+     * @param companyUserId 企业用户ID
+     * @return LiveGoodsOrderItems
+     */
+    LiveGoodsOrderItems selectLiveGoodsOrderItemsByIdAndCompanyIdAndCompanyUserId(@Param("id") Long id, @Param("companyId") Long companyId, @Param("companyUserId") Long companyUserId);
+
     /**
      * 查询订单商品列表
-     * 
+     *
      * @param liveGoodsOrderItems 订单商品
      * @return 订单商品集合
      */
@@ -31,7 +41,7 @@ public interface LiveGoodsOrderItemsMapper extends BaseMapper<LiveGoodsOrderItem
 
     /**
      * 新增订单商品
-     * 
+     *
      * @param liveGoodsOrderItems 订单商品
      * @return 结果
      */
@@ -39,7 +49,7 @@ public interface LiveGoodsOrderItemsMapper extends BaseMapper<LiveGoodsOrderItem
 
     /**
      * 修改订单商品
-     * 
+     *
      * @param liveGoodsOrderItems 订单商品
      * @return 结果
      */
@@ -47,7 +57,7 @@ public interface LiveGoodsOrderItemsMapper extends BaseMapper<LiveGoodsOrderItem
 
     /**
      * 删除订单商品
-     * 
+     *
      * @param id 订单商品主键
      * @return 结果
      */
@@ -55,7 +65,7 @@ public interface LiveGoodsOrderItemsMapper extends BaseMapper<LiveGoodsOrderItem
 
     /**
      * 批量删除订单商品
-     * 
+     *
      * @param ids 需要删除的数据主键集合
      * @return 结果
      */

+ 19 - 9
fs-service/src/main/java/com/fs/live/mapper/LiveGoodsOrderMapper.java

@@ -1,13 +1,14 @@
 package com.fs.live.mapper;
 
-import java.util.List;
-
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.live.domain.LiveGoodsOrder;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * 订单Mapper接口
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */
@@ -15,15 +16,24 @@ public interface LiveGoodsOrderMapper extends BaseMapper<LiveGoodsOrder>
 {
     /**
      * 查询订单
-     * 
+     *
      * @param orderId 订单主键
      * @return 订单
      */
     public LiveGoodsOrder selectLiveGoodsOrderByOrderId(Long orderId);
 
+    /**
+     * 查询企业订单
+     * @param orderId       订单ID
+     * @param companyId     企业ID
+     * @param companyUserId 企业用户ID
+     * @return LiveGoodsOrder
+     */
+    LiveGoodsOrder selectLiveGoodsOrderByOrderIdAndCompanyIdAndCompanyUserId(@Param("orderId") Long orderId, @Param("companyId") Long companyId, @Param("companyUserId") Long companyUserId);
+
     /**
      * 查询订单列表
-     * 
+     *
      * @param liveGoodsOrder 订单
      * @return 订单集合
      */
@@ -31,7 +41,7 @@ public interface LiveGoodsOrderMapper extends BaseMapper<LiveGoodsOrder>
 
     /**
      * 新增订单
-     * 
+     *
      * @param liveGoodsOrder 订单
      * @return 结果
      */
@@ -39,7 +49,7 @@ public interface LiveGoodsOrderMapper extends BaseMapper<LiveGoodsOrder>
 
     /**
      * 修改订单
-     * 
+     *
      * @param liveGoodsOrder 订单
      * @return 结果
      */
@@ -47,7 +57,7 @@ public interface LiveGoodsOrderMapper extends BaseMapper<LiveGoodsOrder>
 
     /**
      * 删除订单
-     * 
+     *
      * @param orderId 订单主键
      * @return 结果
      */
@@ -55,7 +65,7 @@ public interface LiveGoodsOrderMapper extends BaseMapper<LiveGoodsOrder>
 
     /**
      * 批量删除订单
-     * 
+     *
      * @param orderIds 需要删除的数据主键集合
      * @return 结果
      */

+ 22 - 9
fs-service/src/main/java/com/fs/live/mapper/LiveMapper.java

@@ -1,13 +1,14 @@
 package com.fs.live.mapper;
 
-import java.util.List;
-
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.live.domain.Live;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * 直播Mapper接口
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */
@@ -15,15 +16,27 @@ public interface LiveMapper extends BaseMapper<Live>
 {
     /**
      * 查询直播
-     * 
+     *
      * @param liveId 直播主键
      * @return 直播
      */
     public Live selectLiveByLiveId(Long liveId);
 
+    /**
+     * 查询企业直播
+     * @param liveId        直播间ID
+     * @param companyId     企业ID
+     * @param companyUserId 企业用户ID
+     * @return Live
+     */
+    Live selectLiveByLiveIdAndCompanyIdAndCompanyUserId(@Param("liveId") Long liveId, @Param("companyId") Long companyId, @Param("companyUserId") Long companyUserId);
+
+
+    List<Live> selectLiveToStudent( @Param("liveName") String liveName,@Param("status") String status,@Param("startTime") String startTime,@Param("finishTime") String finishTime);
+
     /**
      * 查询直播列表
-     * 
+     *
      * @param live 直播
      * @return 直播集合
      */
@@ -31,7 +44,7 @@ public interface LiveMapper extends BaseMapper<Live>
 
     /**
      * 新增直播
-     * 
+     *
      * @param live 直播
      * @return 结果
      */
@@ -39,7 +52,7 @@ public interface LiveMapper extends BaseMapper<Live>
 
     /**
      * 修改直播
-     * 
+     *
      * @param live 直播
      * @return 结果
      */
@@ -47,7 +60,7 @@ public interface LiveMapper extends BaseMapper<Live>
 
     /**
      * 删除直播
-     * 
+     *
      * @param liveId 直播主键
      * @return 结果
      */
@@ -55,7 +68,7 @@ public interface LiveMapper extends BaseMapper<Live>
 
     /**
      * 批量删除直播
-     * 
+     *
      * @param liveIds 需要删除的数据主键集合
      * @return 结果
      */

+ 19 - 10
fs-service/src/main/java/com/fs/live/mapper/LiveMsgMapper.java

@@ -1,14 +1,14 @@
 package com.fs.live.mapper;
 
-import java.util.List;
-
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.live.domain.LiveMsg;
-import org.springframework.data.repository.CrudRepository;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * 直播讨论Mapper接口
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */
@@ -16,15 +16,24 @@ public interface LiveMsgMapper extends BaseMapper<LiveMsg>
 {
     /**
      * 查询直播讨论
-     * 
+     *
      * @param msgId 直播讨论主键
      * @return 直播讨论
      */
     public LiveMsg selectLiveMsgByMsgId(Long msgId);
 
+    /**
+     * 查询企业直播讨论
+     * @param msgId             消息ID
+     * @param companyId         企业ID
+     * @param companyUserId     企业用户ID
+     * @return LiveMsg
+     */
+    LiveMsg selectLiveMsgByMsgIdAndCompanyIdAndCompanyUserId(@Param("msgId") Long msgId, @Param("companyId") Long companyId, @Param("companyUserId") Long companyUserId);
+
     /**
      * 查询直播讨论列表
-     * 
+     *
      * @param liveMsg 直播讨论
      * @return 直播讨论集合
      */
@@ -32,7 +41,7 @@ public interface LiveMsgMapper extends BaseMapper<LiveMsg>
 
     /**
      * 新增直播讨论
-     * 
+     *
      * @param liveMsg 直播讨论
      * @return 结果
      */
@@ -40,7 +49,7 @@ public interface LiveMsgMapper extends BaseMapper<LiveMsg>
 
     /**
      * 修改直播讨论
-     * 
+     *
      * @param liveMsg 直播讨论
      * @return 结果
      */
@@ -48,7 +57,7 @@ public interface LiveMsgMapper extends BaseMapper<LiveMsg>
 
     /**
      * 删除直播讨论
-     * 
+     *
      * @param msgId 直播讨论主键
      * @return 结果
      */
@@ -56,7 +65,7 @@ public interface LiveMsgMapper extends BaseMapper<LiveMsg>
 
     /**
      * 批量删除直播讨论
-     * 
+     *
      * @param msgIds 需要删除的数据主键集合
      * @return 结果
      */

+ 10 - 0
fs-service/src/main/java/com/fs/live/mapper/LiveQuestionBankMapper.java

@@ -0,0 +1,10 @@
+package com.fs.live.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.live.domain.LiveQuestionBank;
+
+/**
+ * 题库mapper
+ */
+public interface LiveQuestionBankMapper extends BaseMapper<LiveQuestionBank> {
+}

+ 26 - 0
fs-service/src/main/java/com/fs/live/mapper/LiveQuestionLiveMapper.java

@@ -0,0 +1,26 @@
+package com.fs.live.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.live.domain.LiveQuestionLive;
+import com.fs.live.vo.LiveQuestionLiveVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface LiveQuestionLiveMapper extends BaseMapper<LiveQuestionLive> {
+
+    /**
+     * 查询直播间题目列表
+     * @param liveId    直播间ID
+     * @return  list
+     */
+    List<LiveQuestionLiveVO> selectLiveQuestionLiveList(@Param("liveId") Long liveId);
+
+    /**
+     * 查询未被直播间选择的题目列表
+     * @param liveId    直播间ID
+     * @param title     标题
+     * @return  list
+     */
+    List<LiveQuestionLiveVO> selectLiveQuestionOptionList(@Param("liveId") Long liveId, @Param("title") String title);
+}

+ 19 - 9
fs-service/src/main/java/com/fs/live/mapper/LiveQuestionMapper.java

@@ -1,13 +1,14 @@
 package com.fs.live.mapper;
 
-import java.util.List;
-
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.live.domain.LiveQuestion;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * 问答Mapper接口
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */
@@ -15,15 +16,24 @@ public interface LiveQuestionMapper extends BaseMapper<LiveQuestion>
 {
     /**
      * 查询问答
-     * 
+     *
      * @param questionId 问答主键
      * @return 问答
      */
     public LiveQuestion selectLiveQuestionByQuestionId(Long questionId);
 
+    /**
+     * 查询企业问答
+     * @param questionId        问答ID
+     * @param companyId         企业ID
+     * @param companyUserId     企业用户ID
+     * @return LiveQuestion
+     */
+    LiveQuestion selectLiveQuestionByQuestionIdAndCompanyIdAndCompanyUserId(@Param("questionId") Long questionId, @Param("companyId") Long companyId, @Param("companyUserId") Long companyUserId);
+
     /**
      * 查询问答列表
-     * 
+     *
      * @param liveQuestion 问答
      * @return 问答集合
      */
@@ -31,7 +41,7 @@ public interface LiveQuestionMapper extends BaseMapper<LiveQuestion>
 
     /**
      * 新增问答
-     * 
+     *
      * @param liveQuestion 问答
      * @return 结果
      */
@@ -39,7 +49,7 @@ public interface LiveQuestionMapper extends BaseMapper<LiveQuestion>
 
     /**
      * 修改问答
-     * 
+     *
      * @param liveQuestion 问答
      * @return 结果
      */
@@ -47,7 +57,7 @@ public interface LiveQuestionMapper extends BaseMapper<LiveQuestion>
 
     /**
      * 删除问答
-     * 
+     *
      * @param questionId 问答主键
      * @return 结果
      */
@@ -55,7 +65,7 @@ public interface LiveQuestionMapper extends BaseMapper<LiveQuestion>
 
     /**
      * 批量删除问答
-     * 
+     *
      * @param questionIds 需要删除的数据主键集合
      * @return 结果
      */

+ 7 - 0
fs-service/src/main/java/com/fs/live/mapper/LiveQuestionUserLogMapper.java

@@ -0,0 +1,7 @@
+package com.fs.live.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.live.domain.LiveQuestionUserLog;
+
+public interface LiveQuestionUserLogMapper extends BaseMapper<LiveQuestionUserLog> {
+}

+ 68 - 0
fs-service/src/main/java/com/fs/live/mapper/LiveStudentDataMapper.java

@@ -0,0 +1,68 @@
+package com.fs.live.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.live.domain.LiveStudentData;
+import com.fs.live.param.LiveStudentDataQueryParam;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * 直播间学员数据Mapper接口
+ *
+ * @author fs
+ * @date 2025-03-11
+ */
+@Repository
+public interface LiveStudentDataMapper extends BaseMapper<LiveStudentData>{
+    /**
+     * 查询直播间学员数据
+     *
+     * @param liveId 直播间学员数据主键
+     * @return 直播间学员数据
+     */
+    LiveStudentData selectLiveStudentDataByLiveId(Long liveId);
+
+    /**
+     * 查询直播间学员数据列表
+     *
+     * @param liveStudentData 直播间学员数据
+     * @return 直播间学员数据集合
+     */
+    List<LiveStudentData> selectLiveStudentDataList(LiveStudentData liveStudentData);
+
+    /**
+     * 新增直播间学员数据
+     *
+     * @param liveStudentData 直播间学员数据
+     * @return 结果
+     */
+    int insertLiveStudentData(LiveStudentData liveStudentData);
+
+    /**
+     * 修改直播间学员数据
+     *
+     * @param liveStudentData 直播间学员数据
+     * @return 结果
+     */
+    int updateLiveStudentData(LiveStudentData liveStudentData);
+
+    /**
+     * 删除直播间学员数据
+     *
+     * @param liveId 直播间学员数据主键
+     * @return 结果
+     */
+    int deleteLiveStudentDataByLiveId(Long liveId);
+
+    /**
+     * 批量删除直播间学员数据
+     *
+     * @param liveIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteLiveStudentDataByLiveIds(Long[] liveIds);
+
+    List<LiveStudentData> queryStudentData(@Param("param") LiveStudentDataQueryParam param);
+}

+ 19 - 9
fs-service/src/main/java/com/fs/live/mapper/LiveVideoMapper.java

@@ -1,13 +1,14 @@
 package com.fs.live.mapper;
 
-import java.util.List;
-
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.live.domain.LiveVideo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * 直播视频Mapper接口
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */
@@ -15,15 +16,24 @@ public interface LiveVideoMapper extends BaseMapper<LiveVideo>
 {
     /**
      * 查询直播视频
-     * 
+     *
      * @param videoId 直播视频主键
      * @return 直播视频
      */
     public LiveVideo selectLiveVideoByVideoId(Long videoId);
 
+    /**
+     * 查询企业直播视频
+     * @param videoId           视频ID
+     * @param companyId         企业ID
+     * @param companyUserId     企业用户ID
+     * @return LiveVideo
+     */
+    LiveVideo selectLiveVideoByVideoIdAndCompanyIdAndCompanyUserId(@Param("videoId") Long videoId, @Param("companyId") Long companyId, @Param("companyUserId") Long companyUserId);
+
     /**
      * 查询直播视频列表
-     * 
+     *
      * @param liveVideo 直播视频
      * @return 直播视频集合
      */
@@ -31,7 +41,7 @@ public interface LiveVideoMapper extends BaseMapper<LiveVideo>
 
     /**
      * 新增直播视频
-     * 
+     *
      * @param liveVideo 直播视频
      * @return 结果
      */
@@ -39,7 +49,7 @@ public interface LiveVideoMapper extends BaseMapper<LiveVideo>
 
     /**
      * 修改直播视频
-     * 
+     *
      * @param liveVideo 直播视频
      * @return 结果
      */
@@ -47,7 +57,7 @@ public interface LiveVideoMapper extends BaseMapper<LiveVideo>
 
     /**
      * 删除直播视频
-     * 
+     *
      * @param videoId 直播视频主键
      * @return 结果
      */
@@ -55,7 +65,7 @@ public interface LiveVideoMapper extends BaseMapper<LiveVideo>
 
     /**
      * 批量删除直播视频
-     * 
+     *
      * @param videoIds 需要删除的数据主键集合
      * @return 结果
      */

+ 36 - 8
fs-service/src/main/java/com/fs/live/mapper/LiveWatchUserMapper.java

@@ -1,27 +1,40 @@
 package com.fs.live.mapper;
 
-import java.util.List;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.live.domain.LiveWatchUser;
+import com.fs.live.vo.LiveWatchUserVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
 
 /**
  * 直播间观看用户Mapper接口
- * 
+ *
  * @author fs
  * @date 2025-01-18
  */
 public interface LiveWatchUserMapper extends BaseMapper<LiveWatchUser>{
     /**
      * 查询直播间观看用户
-     * 
+     *
      * @param id 直播间观看用户主键
      * @return 直播间观看用户
      */
     LiveWatchUser selectLiveWatchUserById(Long id);
 
+    /**
+     * 查询企业直播间观看用户
+     * @param id                直播间用户ID
+     * @param companyId         企业ID
+     * @param companyUserId     企业用户ID
+     * @return LiveWatchUser
+     */
+    LiveWatchUser selectLiveWatchUserByIdAndCompanyIdAndCompanyUserId(@Param("id") Long id, @Param("companyId") Long companyId, @Param("companyUserId") Long companyUserId);
+
     /**
      * 查询直播间观看用户列表
-     * 
+     *
      * @param liveWatchUser 直播间观看用户
      * @return 直播间观看用户集合
      */
@@ -29,7 +42,7 @@ public interface LiveWatchUserMapper extends BaseMapper<LiveWatchUser>{
 
     /**
      * 新增直播间观看用户
-     * 
+     *
      * @param liveWatchUser 直播间观看用户
      * @return 结果
      */
@@ -37,7 +50,7 @@ public interface LiveWatchUserMapper extends BaseMapper<LiveWatchUser>{
 
     /**
      * 修改直播间观看用户
-     * 
+     *
      * @param liveWatchUser 直播间观看用户
      * @return 结果
      */
@@ -45,7 +58,7 @@ public interface LiveWatchUserMapper extends BaseMapper<LiveWatchUser>{
 
     /**
      * 删除直播间观看用户
-     * 
+     *
      * @param id 直播间观看用户主键
      * @return 结果
      */
@@ -53,9 +66,24 @@ public interface LiveWatchUserMapper extends BaseMapper<LiveWatchUser>{
 
     /**
      * 批量删除直播间观看用户
-     * 
+     *
      * @param ids 需要删除的数据主键集合
      * @return 结果
      */
     int deleteLiveWatchUserByIds(Long[] ids);
+
+    /**
+     * 根据直播间ID查询直播间在线观看用户列表
+     * @param params 参数
+     * @return list
+     */
+    List<LiveWatchUserVO> selectWatchUserListByLiveId(@Param("params") Map<String, Object> params);
+
+    /**
+     * 根据直播间ID和用户ID查询观看用户信息
+     * @param liveId    直播间ID
+     * @param userId    观看用户ID
+     * @return LiveWatchUserVO
+     */
+    LiveWatchUserVO selectWatchUserByLiveIdAndUserId(@Param("liveId") Long liveId, @Param("userId") Long userId);
 }

+ 62 - 0
fs-service/src/main/java/com/fs/live/param/LiveStudentDataQueryParam.java

@@ -0,0 +1,62 @@
+package com.fs.live.param;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import com.fs.crm.param.BaseQueryParam;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class LiveStudentDataQueryParam extends BaseQueryParam {
+    /** 直播间id数组 */
+    private String[] liveIds;
+    /** 直播间名称 */
+   /* @Excel(name = "直播间名称")
+    private String liveName;*/
+
+    /** 客户名 */
+    @Excel(name = "客户名")
+    private String userName;
+
+    /** 客户电话 */
+    @Excel(name = "客户电话")
+    private String userPhone;
+
+    /** 客户创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "客户创建时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date userCreateTime;
+
+
+
+    private String startTime;
+
+
+    private String finishTime;
+    /** 分享直播间次数 */
+    @Excel(name = "分享直播间次数")
+    private Long shareCount;
+
+    /** 归属部门名称 */
+    @Excel(name = "归属部门名称")
+    private String deptName;
+
+    /** 归属部门id */
+    @Excel(name = "归属部门id")
+    private String deptId;
+
+    /** 跟进人姓名 */
+    @Excel(name = "跟进人姓名")
+    private String companyUserName;
+
+    /** 购买实物商品 */
+    private Long goodsCount;
+
+    /** 答题次数 */
+    private Long questionCount;
+    //最小提问数
+    private long minQuestionCount;
+    //最大提问数
+    private long maxQuestionCount;
+    }

+ 19 - 9
fs-service/src/main/java/com/fs/live/service/ILiveAnchorService.java

@@ -1,13 +1,13 @@
 package com.fs.live.service;
 
-import java.util.List;
-
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fs.live.domain.LiveAnchor;
 
+import java.util.List;
+
 /**
  * 主播Service接口
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */
@@ -15,15 +15,25 @@ public interface ILiveAnchorService extends IService<LiveAnchor>
 {
     /**
      * 查询主播
-     * 
+     *
      * @param anchorId 主播主键
      * @return 主播
      */
     public LiveAnchor selectLiveAnchorByAnchorId(Long anchorId);
 
+    /**
+     * 查询企业主播
+     *
+     * @param anchorId 主播主键
+     * @param companyId 企业ID
+     * @param companyUserId 企业用户ID
+     * @return 主播
+     */
+    LiveAnchor selectLiveAnchorByAnchorIdAndCompanyIdAndCompanyUserId(Long anchorId, Long companyId, Long companyUserId);
+
     /**
      * 查询主播列表
-     * 
+     *
      * @param liveAnchor 主播
      * @return 主播集合
      */
@@ -31,7 +41,7 @@ public interface ILiveAnchorService extends IService<LiveAnchor>
 
     /**
      * 新增主播
-     * 
+     *
      * @param liveAnchor 主播
      * @return 结果
      */
@@ -39,7 +49,7 @@ public interface ILiveAnchorService extends IService<LiveAnchor>
 
     /**
      * 修改主播
-     * 
+     *
      * @param liveAnchor 主播
      * @return 结果
      */
@@ -47,7 +57,7 @@ public interface ILiveAnchorService extends IService<LiveAnchor>
 
     /**
      * 批量删除主播
-     * 
+     *
      * @param anchorIds 需要删除的主播主键集合
      * @return 结果
      */
@@ -55,7 +65,7 @@ public interface ILiveAnchorService extends IService<LiveAnchor>
 
     /**
      * 删除主播信息
-     * 
+     *
      * @param anchorId 主播主键
      * @return 结果
      */

+ 99 - 0
fs-service/src/main/java/com/fs/live/service/ILiveDataService.java

@@ -0,0 +1,99 @@
+package com.fs.live.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.live.domain.LiveData;
+import com.fs.live.vo.ColumnsConfigVo;
+import com.fs.live.vo.RecentLiveDataVo;
+import com.fs.live.vo.TrendDataVO;
+
+import java.util.List;
+
+/**
+ * 直播数据Service接口
+ *
+ * @author fs
+ * @date 2025-03-05
+ */
+public interface ILiveDataService extends IService<LiveData>{
+    /**
+     * 查询直播数据
+     *
+     * @param liveId 直播数据主键
+     * @return 直播数据
+     */
+    LiveData selectLiveDataByLiveId(Long liveId);
+
+    /**
+     * 查询直播数据列表
+     *
+     * @param liveData 直播数据
+     * @return 直播数据集合
+     */
+    List<LiveData> selectLiveDataList(LiveData liveData);
+
+    /**
+     * 新增直播数据
+     *
+     * @param liveData 直播数据
+     * @return 结果
+     */
+    int insertLiveData(LiveData liveData);
+
+    /**
+     * 修改直播数据
+     *
+     * @param liveData 直播数据
+     * @return 结果
+     */
+    int updateLiveData(LiveData liveData);
+
+    /**
+     * 批量删除直播数据
+     *
+     * @param liveIds 需要删除的直播数据主键集合
+     * @return 结果
+     */
+    int deleteLiveDataByLiveIds(Long[] liveIds);
+
+    /**
+     * 删除直播数据信息
+     *
+     * @param liveId 直播数据主键
+     * @return 结果
+     */
+    int deleteLiveDataByLiveId(Long liveId);
+
+    /**
+     * 查询所有正在直播的直播间iD
+     * @return
+     */
+    List<Long> getAllLiveIds();
+
+    /**
+     * 查询近期直播数据
+     */
+    List<RecentLiveDataVo> getRecentLive();
+
+    /**
+     * 查询直播top榜数据
+     * @return
+     */
+    List<RecentLiveDataVo> getLiveTop(String rankType);
+
+    /**
+     * 查询直播趋势数据
+     * @param type
+     * @param selectedDate
+     * @return
+     */
+    TrendDataVO getTrendData(String type, String selectedDate,String category);
+
+    /**
+     * @param  userId 当前登录用户id
+     * 查询表格字段配置
+     * @return
+     */
+    /*List<ColumnsConfigVo> getColumnsConfig(String userId);*/
+
+    void saveColumnsConfig(String userId, List<ColumnsConfigVo> columns);
+}

+ 18 - 9
fs-service/src/main/java/com/fs/live/service/ILiveGoodsOrderItemsService.java

@@ -1,13 +1,13 @@
 package com.fs.live.service;
 
-import java.util.List;
-
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fs.live.domain.LiveGoodsOrderItems;
 
+import java.util.List;
+
 /**
  * 订单商品Service接口
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */
@@ -15,15 +15,24 @@ public interface ILiveGoodsOrderItemsService extends IService<LiveGoodsOrderItem
 {
     /**
      * 查询订单商品
-     * 
+     *
      * @param id 订单商品主键
      * @return 订单商品
      */
     public LiveGoodsOrderItems selectLiveGoodsOrderItemsById(Long id);
 
+    /**
+     * 查询订单商品
+     * @param id            订单ID
+     * @param companyId     企业ID
+     * @param companyUserId 企业用户ID
+     * @return LiveGoodsOrderItems
+     */
+    LiveGoodsOrderItems selectLiveGoodsOrderItemsByIdAndCompanyIdAndCompanyUserId(Long id, Long companyId, Long companyUserId);
+
     /**
      * 查询订单商品列表
-     * 
+     *
      * @param liveGoodsOrderItems 订单商品
      * @return 订单商品集合
      */
@@ -31,7 +40,7 @@ public interface ILiveGoodsOrderItemsService extends IService<LiveGoodsOrderItem
 
     /**
      * 新增订单商品
-     * 
+     *
      * @param liveGoodsOrderItems 订单商品
      * @return 结果
      */
@@ -39,7 +48,7 @@ public interface ILiveGoodsOrderItemsService extends IService<LiveGoodsOrderItem
 
     /**
      * 修改订单商品
-     * 
+     *
      * @param liveGoodsOrderItems 订单商品
      * @return 结果
      */
@@ -47,7 +56,7 @@ public interface ILiveGoodsOrderItemsService extends IService<LiveGoodsOrderItem
 
     /**
      * 批量删除订单商品
-     * 
+     *
      * @param ids 需要删除的订单商品主键集合
      * @return 结果
      */
@@ -55,7 +64,7 @@ public interface ILiveGoodsOrderItemsService extends IService<LiveGoodsOrderItem
 
     /**
      * 删除订单商品信息
-     * 
+     *
      * @param id 订单商品主键
      * @return 结果
      */

+ 18 - 9
fs-service/src/main/java/com/fs/live/service/ILiveGoodsOrderService.java

@@ -1,13 +1,13 @@
 package com.fs.live.service;
 
-import java.util.List;
-
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fs.live.domain.LiveGoodsOrder;
 
+import java.util.List;
+
 /**
  * 订单Service接口
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */
@@ -15,15 +15,24 @@ public interface ILiveGoodsOrderService extends IService<LiveGoodsOrder>
 {
     /**
      * 查询订单
-     * 
+     *
      * @param orderId 订单主键
      * @return 订单
      */
     public LiveGoodsOrder selectLiveGoodsOrderByOrderId(Long orderId);
 
+    /**
+     * 查询企业订单
+     * @param orderId       订单ID
+     * @param companyId     企业ID
+     * @param companyUserId 企业用户ID
+     * @return  liveGoodsOrder
+     */
+    LiveGoodsOrder selectLiveGoodsOrderByOrderIdAndCompanyIdAndCompanyUserId(Long orderId, Long companyId, Long companyUserId);
+
     /**
      * 查询订单列表
-     * 
+     *
      * @param liveGoodsOrder 订单
      * @return 订单集合
      */
@@ -31,7 +40,7 @@ public interface ILiveGoodsOrderService extends IService<LiveGoodsOrder>
 
     /**
      * 新增订单
-     * 
+     *
      * @param liveGoodsOrder 订单
      * @return 结果
      */
@@ -39,7 +48,7 @@ public interface ILiveGoodsOrderService extends IService<LiveGoodsOrder>
 
     /**
      * 修改订单
-     * 
+     *
      * @param liveGoodsOrder 订单
      * @return 结果
      */
@@ -47,7 +56,7 @@ public interface ILiveGoodsOrderService extends IService<LiveGoodsOrder>
 
     /**
      * 批量删除订单
-     * 
+     *
      * @param orderIds 需要删除的订单主键集合
      * @return 结果
      */
@@ -55,7 +64,7 @@ public interface ILiveGoodsOrderService extends IService<LiveGoodsOrder>
 
     /**
      * 删除订单信息
-     * 
+     *
      * @param orderId 订单主键
      * @return 结果
      */

+ 19 - 9
fs-service/src/main/java/com/fs/live/service/ILiveGoodsService.java

@@ -1,13 +1,13 @@
 package com.fs.live.service;
 
-import java.util.List;
-
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fs.live.domain.LiveGoods;
 
+import java.util.List;
+
 /**
  * 直播商品Service接口
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */
@@ -15,15 +15,25 @@ public interface ILiveGoodsService extends IService<LiveGoods>
 {
     /**
      * 查询直播商品
-     * 
+     *
      * @param goodsId 直播商品主键
      * @return 直播商品
      */
     public LiveGoods selectLiveGoodsByGoodsId(Long goodsId);
 
+    /**
+     * 查询企业直播商品
+     *
+     * @param goodsId 直播商品主键
+     * @param companyId 企业ID
+     * @param companyUserId 企业用户ID
+     * @return 直播商品
+     */
+    LiveGoods selectLiveGoodsByGoodsIdAndCompanyIdAndCompanyUserId(Long goodsId, Long companyId, Long companyUserId);
+
     /**
      * 查询直播商品列表
-     * 
+     *
      * @param liveGoods 直播商品
      * @return 直播商品集合
      */
@@ -31,7 +41,7 @@ public interface ILiveGoodsService extends IService<LiveGoods>
 
     /**
      * 新增直播商品
-     * 
+     *
      * @param liveGoods 直播商品
      * @return 结果
      */
@@ -39,7 +49,7 @@ public interface ILiveGoodsService extends IService<LiveGoods>
 
     /**
      * 修改直播商品
-     * 
+     *
      * @param liveGoods 直播商品
      * @return 结果
      */
@@ -47,7 +57,7 @@ public interface ILiveGoodsService extends IService<LiveGoods>
 
     /**
      * 批量删除直播商品
-     * 
+     *
      * @param goodsIds 需要删除的直播商品主键集合
      * @return 结果
      */
@@ -55,7 +65,7 @@ public interface ILiveGoodsService extends IService<LiveGoods>
 
     /**
      * 删除直播商品信息
-     * 
+     *
      * @param goodsId 直播商品主键
      * @return 结果
      */

+ 9 - 9
fs-service/src/main/java/com/fs/live/service/ILiveMsgService.java

@@ -1,13 +1,13 @@
 package com.fs.live.service;
 
-import java.util.List;
-
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fs.live.domain.LiveMsg;
 
+import java.util.List;
+
 /**
  * 直播讨论Service接口
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */
@@ -15,7 +15,7 @@ public interface ILiveMsgService extends IService<LiveMsg>
 {
     /**
      * 查询直播讨论
-     * 
+     *
      * @param msgId 直播讨论主键
      * @return 直播讨论
      */
@@ -23,7 +23,7 @@ public interface ILiveMsgService extends IService<LiveMsg>
 
     /**
      * 查询直播讨论列表
-     * 
+     *
      * @param liveMsg 直播讨论
      * @return 直播讨论集合
      */
@@ -31,7 +31,7 @@ public interface ILiveMsgService extends IService<LiveMsg>
 
     /**
      * 新增直播讨论
-     * 
+     *
      * @param liveMsg 直播讨论
      * @return 结果
      */
@@ -39,7 +39,7 @@ public interface ILiveMsgService extends IService<LiveMsg>
 
     /**
      * 修改直播讨论
-     * 
+     *
      * @param liveMsg 直播讨论
      * @return 结果
      */
@@ -47,7 +47,7 @@ public interface ILiveMsgService extends IService<LiveMsg>
 
     /**
      * 批量删除直播讨论
-     * 
+     *
      * @param msgIds 需要删除的直播讨论主键集合
      * @return 结果
      */
@@ -55,7 +55,7 @@ public interface ILiveMsgService extends IService<LiveMsg>
 
     /**
      * 删除直播讨论信息
-     * 
+     *
      * @param msgId 直播讨论主键
      * @return 结果
      */

+ 40 - 0
fs-service/src/main/java/com/fs/live/service/ILiveQuestionBankService.java

@@ -0,0 +1,40 @@
+package com.fs.live.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.live.domain.LiveQuestionBank;
+
+import java.util.List;
+
+public interface ILiveQuestionBankService extends IService<LiveQuestionBank> {
+
+    /**
+     * 查询题库列表
+     * @param title 题
+     * @return 题库
+     */
+    List<LiveQuestionBank> selectLiveQuestionBankList(String title);
+
+    /**
+     * 新增题
+     *
+     * @param liveQuestionBank 题
+     * @param username         用户名
+     * @return 受影响行数
+     */
+    int insertLiveQuestionBank(LiveQuestionBank liveQuestionBank, String username);
+
+    /**
+     * 修改题目
+     * @param liveQuestionBank 题目
+     * @param username 用户名
+     * @return  受影响行数
+     */
+    int updateLiveQuestionBank(LiveQuestionBank liveQuestionBank, String username);
+
+    /**
+     * 删除题目
+     * @param ids ID集合
+     * @return 受影响行数
+     */
+    int deleteLiveQuestionBankByIds(Long[] ids);
+}

+ 42 - 0
fs-service/src/main/java/com/fs/live/service/ILiveQuestionLiveService.java

@@ -0,0 +1,42 @@
+package com.fs.live.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.live.domain.LiveQuestionLive;
+import com.fs.live.vo.LiveQuestionLiveVO;
+
+import java.util.List;
+
+public interface ILiveQuestionLiveService extends IService<LiveQuestionLive> {
+
+    /**
+     * 查询直播间题目列表
+     * @param liveId    直播间ID
+     * @return  list
+     */
+    List<LiveQuestionLiveVO> selectLiveQuestionLiveList(Long liveId);
+
+    /**
+     * 添加直播间题目
+     * @param liveId    直播间ID
+     * @param questionIds   题目ID集合
+     * @param username  用户名称
+     * @return  是否成功
+     */
+    boolean insertLiveQuestion(Long liveId, List<Long> questionIds, String username);
+
+    /**
+     * 删除直播间题目
+     * @param liveId 直播间ID
+     * @param ids   题目集合
+     * @return 受影响行数
+     */
+    int deleteLiveQuestionByIds(Long liveId, List<Long> ids);
+
+    /**
+     * 查询未被直播间选择的题目列表
+     * @param liveId    直播间ID
+     * @param title     标题
+     * @return  list
+     */
+    List<LiveQuestionLiveVO> selectLiveQuestionOptionList(Long liveId, String title);
+}

+ 18 - 9
fs-service/src/main/java/com/fs/live/service/ILiveQuestionService.java

@@ -1,13 +1,13 @@
 package com.fs.live.service;
 
-import java.util.List;
-
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fs.live.domain.LiveQuestion;
 
+import java.util.List;
+
 /**
  * 问答Service接口
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */
@@ -15,15 +15,24 @@ public interface ILiveQuestionService extends IService<LiveQuestion>
 {
     /**
      * 查询问答
-     * 
+     *
      * @param questionId 问答主键
      * @return 问答
      */
     public LiveQuestion selectLiveQuestionByQuestionId(Long questionId);
 
+    /**
+     * 查询企业问答
+     * @param questionId       问答ID
+     * @param companyId        企业ID
+     * @param companyUserId    企业用户ID
+     * @return LiveQuestion
+     */
+    LiveQuestion selectLiveQuestionByQuestionIdAndCompanyIdAndCompanyUserId(Long questionId, Long companyId, Long companyUserId);
+
     /**
      * 查询问答列表
-     * 
+     *
      * @param liveQuestion 问答
      * @return 问答集合
      */
@@ -31,7 +40,7 @@ public interface ILiveQuestionService extends IService<LiveQuestion>
 
     /**
      * 新增问答
-     * 
+     *
      * @param liveQuestion 问答
      * @return 结果
      */
@@ -39,7 +48,7 @@ public interface ILiveQuestionService extends IService<LiveQuestion>
 
     /**
      * 修改问答
-     * 
+     *
      * @param liveQuestion 问答
      * @return 结果
      */
@@ -47,7 +56,7 @@ public interface ILiveQuestionService extends IService<LiveQuestion>
 
     /**
      * 批量删除问答
-     * 
+     *
      * @param questionIds 需要删除的问答主键集合
      * @return 结果
      */
@@ -55,7 +64,7 @@ public interface ILiveQuestionService extends IService<LiveQuestion>
 
     /**
      * 删除问答信息
-     * 
+     *
      * @param questionId 问答主键
      * @return 结果
      */

+ 7 - 0
fs-service/src/main/java/com/fs/live/service/ILiveQuestionUserLogService.java

@@ -0,0 +1,7 @@
+package com.fs.live.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.live.domain.LiveQuestionUserLog;
+
+public interface ILiveQuestionUserLogService extends IService<LiveQuestionUserLog> {
+}

+ 26 - 9
fs-service/src/main/java/com/fs/live/service/ILiveService.java

@@ -1,13 +1,13 @@
 package com.fs.live.service;
 
-import java.util.List;
-
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fs.live.domain.Live;
 
+import java.util.List;
+
 /**
  * 直播Service接口
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */
@@ -15,23 +15,40 @@ public interface ILiveService extends IService<Live>
 {
     /**
      * 查询直播
-     * 
+     *
      * @param liveId 直播主键
      * @return 直播
      */
     public Live selectLiveByLiveId(Long liveId);
 
+    /**
+     * 查询企业直播
+     * @param liveId            直播ID
+     * @param companyId         企业ID
+     * @param companyUserId     企业用户ID
+     * @return Live
+     */
+    Live selectLiveByLiveIdAndCompanyIdAndCompanyUserId(Long liveId, Long companyId, Long companyUserId);
+
     /**
      * 查询直播列表
-     * 
+     *
      * @param live 直播
      * @return 直播集合
      */
     public List<Live> selectLiveList(Live live);
 
+    /**
+     * 直播间学员查询直播列表
+     *
+     * @param
+     * @return 直播集合
+     */
+    List<Live> selectLiveToStudent(String liveName,String status,String startTime,String finishTime);
+
     /**
      * 新增直播
-     * 
+     *
      * @param live 直播
      * @return 结果
      */
@@ -39,7 +56,7 @@ public interface ILiveService extends IService<Live>
 
     /**
      * 修改直播
-     * 
+     *
      * @param live 直播
      * @return 结果
      */
@@ -47,7 +64,7 @@ public interface ILiveService extends IService<Live>
 
     /**
      * 批量删除直播
-     * 
+     *
      * @param liveIds 需要删除的直播主键集合
      * @return 结果
      */
@@ -55,7 +72,7 @@ public interface ILiveService extends IService<Live>
 
     /**
      * 删除直播信息
-     * 
+     *
      * @param liveId 直播主键
      * @return 结果
      */

+ 70 - 0
fs-service/src/main/java/com/fs/live/service/ILiveStudentDataService.java

@@ -0,0 +1,70 @@
+package com.fs.live.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.live.domain.LiveStudentData;
+import com.fs.live.param.LiveStudentDataQueryParam;
+
+import java.util.List;
+
+/**
+ * 直播间学员数据Service接口
+ *
+ * @author fs
+ * @date 2025-03-11
+ */
+public interface ILiveStudentDataService extends IService<LiveStudentData>{
+    /**
+     * 查询直播间学员数据
+     *
+     * @param liveId 直播间学员数据主键
+     * @return 直播间学员数据
+     */
+    LiveStudentData selectLiveStudentDataByLiveId(Long liveId);
+
+    /**
+     * 查询直播间学员数据列表
+     *
+     * @param liveStudentData 直播间学员数据
+     * @return 直播间学员数据集合
+     */
+    List<LiveStudentData> selectLiveStudentDataList(LiveStudentData liveStudentData);
+
+    /**
+     * 新增直播间学员数据
+     *
+     * @param liveStudentData 直播间学员数据
+     * @return 结果
+     */
+    int insertLiveStudentData(LiveStudentData liveStudentData);
+
+    /**
+     * 修改直播间学员数据
+     *
+     * @param liveStudentData 直播间学员数据
+     * @return 结果
+     */
+    int updateLiveStudentData(LiveStudentData liveStudentData);
+
+    /**
+     * 批量删除直播间学员数据
+     *
+     * @param liveIds 需要删除的直播间学员数据主键集合
+     * @return 结果
+     */
+    int deleteLiveStudentDataByLiveIds(Long[] liveIds);
+
+    /**
+     * 删除直播间学员数据信息
+     *
+     * @param liveId 直播间学员数据主键
+     * @return 结果
+     */
+    int deleteLiveStudentDataByLiveId(Long liveId);
+
+    /**
+     * 查询直播数据统计页直播间学员模块数据
+     * @param param
+     * @return
+     */
+    List<LiveStudentData> queryStudentData(LiveStudentDataQueryParam param);
+}

+ 26 - 9
fs-service/src/main/java/com/fs/live/service/ILiveVideoService.java

@@ -1,13 +1,13 @@
 package com.fs.live.service;
 
-import java.util.List;
-
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fs.live.domain.LiveVideo;
 
+import java.util.List;
+
 /**
  * 直播视频Service接口
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */
@@ -15,15 +15,24 @@ public interface ILiveVideoService extends IService<LiveVideo>
 {
     /**
      * 查询直播视频
-     * 
+     *
      * @param videoId 直播视频主键
      * @return 直播视频
      */
     public LiveVideo selectLiveVideoByVideoId(Long videoId);
 
+    /**
+     * 查询企业直播视频
+     * @param videoId       视频ID
+     * @param companyId     企业ID
+     * @param companyUserId 企业用户ID
+     * @return LiveVideo
+     */
+    LiveVideo selectLiveVideoByVideoIdAndCompanyIdAndCompanyUserId(Long videoId, Long companyId, Long companyUserId);
+
     /**
      * 查询直播视频列表
-     * 
+     *
      * @param liveVideo 直播视频
      * @return 直播视频集合
      */
@@ -31,7 +40,7 @@ public interface ILiveVideoService extends IService<LiveVideo>
 
     /**
      * 新增直播视频
-     * 
+     *
      * @param liveVideo 直播视频
      * @return 结果
      */
@@ -39,7 +48,7 @@ public interface ILiveVideoService extends IService<LiveVideo>
 
     /**
      * 修改直播视频
-     * 
+     *
      * @param liveVideo 直播视频
      * @return 结果
      */
@@ -47,7 +56,7 @@ public interface ILiveVideoService extends IService<LiveVideo>
 
     /**
      * 批量删除直播视频
-     * 
+     *
      * @param videoIds 需要删除的直播视频主键集合
      * @return 结果
      */
@@ -55,11 +64,19 @@ public interface ILiveVideoService extends IService<LiveVideo>
 
     /**
      * 删除直播视频信息
-     * 
+     *
      * @param videoId 直播视频主键
      * @return 结果
      */
     public int deleteLiveVideoByVideoId(Long videoId);
 
     List<LiveVideo> listByLiveId(Long liveId, Integer type);
+
+    /**
+     * 根据直播ID查询视频
+     * @param liveId 直播ID
+     * @return liveVideo
+     */
+    LiveVideo selectLiveVideoByLiveId(Long liveId);
+
 }

+ 43 - 8
fs-service/src/main/java/com/fs/live/service/ILiveWatchUserService.java

@@ -1,27 +1,39 @@
 package com.fs.live.service;
 
-import java.util.List;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fs.live.domain.LiveWatchUser;
+import com.fs.live.vo.LiveWatchUserVO;
+
+import java.util.List;
+import java.util.Map;
 
 /**
  * 直播间观看用户Service接口
- * 
+ *
  * @author fs
  * @date 2025-01-18
  */
 public interface ILiveWatchUserService extends IService<LiveWatchUser>{
     /**
      * 查询直播间观看用户
-     * 
+     *
      * @param id 直播间观看用户主键
      * @return 直播间观看用户
      */
     LiveWatchUser selectLiveWatchUserById(Long id);
 
+    /**
+     * 查询企业直播间观看用户
+     * @param id                直播间用户ID
+     * @param companyId         企业ID
+     * @param companyUserId     企业用户ID
+     * @return LiveWatchUser
+     */
+    LiveWatchUser selectLiveWatchUserByIdAndCompanyIdAndCompanyUserId(Long id, Long companyId, Long companyUserId);
+
     /**
      * 查询直播间观看用户列表
-     * 
+     *
      * @param liveWatchUser 直播间观看用户
      * @return 直播间观看用户集合
      */
@@ -29,7 +41,7 @@ public interface ILiveWatchUserService extends IService<LiveWatchUser>{
 
     /**
      * 新增直播间观看用户
-     * 
+     *
      * @param liveWatchUser 直播间观看用户
      * @return 结果
      */
@@ -37,7 +49,7 @@ public interface ILiveWatchUserService extends IService<LiveWatchUser>{
 
     /**
      * 修改直播间观看用户
-     * 
+     *
      * @param liveWatchUser 直播间观看用户
      * @return 结果
      */
@@ -45,7 +57,7 @@ public interface ILiveWatchUserService extends IService<LiveWatchUser>{
 
     /**
      * 批量删除直播间观看用户
-     * 
+     *
      * @param ids 需要删除的直播间观看用户主键集合
      * @return 结果
      */
@@ -53,7 +65,7 @@ public interface ILiveWatchUserService extends IService<LiveWatchUser>{
 
     /**
      * 删除直播间观看用户信息
-     * 
+     *
      * @param id 直播间观看用户主键
      * @return 结果
      */
@@ -63,4 +75,27 @@ public interface ILiveWatchUserService extends IService<LiveWatchUser>{
 
     void join(long liveId, long userId);
     void close(long liveId, long userId);
+
+    /**
+     * 查询直播间在线用户列表
+     * @param params 参数
+     * @return list
+     */
+    List<LiveWatchUserVO> selectWatchUserList(Map<String, Object> params);
+
+    /**
+     * 修改直播间用户禁言状态
+     * @param liveId    直播间ID
+     * @param userId    用户ID
+     * @return  受影响条数
+     */
+    int changeUserState(Long liveId, Long userId);
+
+    /**
+     * 根据直播间ID和用户ID查询观看用户信息
+     * @param liveId    直播间ID
+     * @param userId    观看用户ID
+     * @return LiveWatchUserVO
+     */
+    LiveWatchUserVO selectWatchUserByLiveIdAndUserId(Long liveId, Long userId);
 }

+ 23 - 11
fs-service/src/main/java/com/fs/live/service/impl/LiveAnchorServiceImpl.java

@@ -1,17 +1,17 @@
 package com.fs.live.service.impl;
 
-import java.util.List;
-
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fs.common.utils.DateUtils;
-import org.springframework.stereotype.Service;
-import com.fs.live.mapper.LiveAnchorMapper;
 import com.fs.live.domain.LiveAnchor;
+import com.fs.live.mapper.LiveAnchorMapper;
 import com.fs.live.service.ILiveAnchorService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
 
 /**
  * 主播Service业务层处理
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */
@@ -21,7 +21,7 @@ public class LiveAnchorServiceImpl extends ServiceImpl<LiveAnchorMapper, LiveAnc
 
     /**
      * 查询主播
-     * 
+     *
      * @param anchorId 主播主键
      * @return 主播
      */
@@ -31,9 +31,21 @@ public class LiveAnchorServiceImpl extends ServiceImpl<LiveAnchorMapper, LiveAnc
         return baseMapper.selectLiveAnchorByAnchorId(anchorId);
     }
 
+    /**
+     * 查询企业主播
+     *
+     * @param anchorId 主播主键
+     * @return 主播
+     */
+    @Override
+    public LiveAnchor selectLiveAnchorByAnchorIdAndCompanyIdAndCompanyUserId(Long anchorId, Long companyId, Long companyUserId)
+    {
+        return baseMapper.selectLiveAnchorByAnchorIdAndCompanyIdAndCompanyUserId(anchorId, companyId, companyUserId);
+    }
+
     /**
      * 查询主播列表
-     * 
+     *
      * @param liveAnchor 主播
      * @return 主播
      */
@@ -45,7 +57,7 @@ public class LiveAnchorServiceImpl extends ServiceImpl<LiveAnchorMapper, LiveAnc
 
     /**
      * 新增主播
-     * 
+     *
      * @param liveAnchor 主播
      * @return 结果
      */
@@ -58,7 +70,7 @@ public class LiveAnchorServiceImpl extends ServiceImpl<LiveAnchorMapper, LiveAnc
 
     /**
      * 修改主播
-     * 
+     *
      * @param liveAnchor 主播
      * @return 结果
      */
@@ -71,7 +83,7 @@ public class LiveAnchorServiceImpl extends ServiceImpl<LiveAnchorMapper, LiveAnc
 
     /**
      * 批量删除主播
-     * 
+     *
      * @param anchorIds 需要删除的主播主键
      * @return 结果
      */
@@ -83,7 +95,7 @@ public class LiveAnchorServiceImpl extends ServiceImpl<LiveAnchorMapper, LiveAnc
 
     /**
      * 删除主播信息
-     * 
+     *
      * @param anchorId 主播主键
      * @return 结果
      */

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

@@ -0,0 +1,340 @@
+package com.fs.live.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.common.core.redis.RedisCache;
+import com.fs.common.utils.DateUtils;
+import com.fs.common.utils.spring.SpringUtils;
+import com.fs.live.domain.LiveData;
+import com.fs.live.mapper.LiveDataMapper;
+import com.fs.live.service.ILiveDataService;
+import com.fs.live.vo.ColumnsConfigVo;
+import com.fs.live.vo.DateRange;
+import com.fs.live.vo.RecentLiveDataVo;
+import com.fs.live.vo.TrendDataVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.time.DayOfWeek;
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 直播数据Service业务层处理
+ *
+ * @author fs
+ * @date 2025-03-05
+ */
+@Service
+public class LiveDataServiceImpl extends ServiceImpl<LiveDataMapper, LiveData> implements ILiveDataService {
+
+    @Autowired
+    private LiveDataMapper liveDataMapper;
+    private final RedisCache redisCache = SpringUtils.getBean(RedisCache.class);
+    private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+    private final String COLUMNS_CONFIG = "columnsConfigKey";
+
+    /**
+     * 查询直播数据
+     *
+     * @param liveId 直播数据主键
+     * @return 直播数据
+     */
+    @Override
+    public LiveData selectLiveDataByLiveId(Long liveId)
+    {
+        return baseMapper.selectLiveDataByLiveId(liveId);
+    }
+
+    /**
+     * 查询直播数据列表
+     *
+     * @param liveData 直播数据
+     * @return 直播数据
+     */
+    @Override
+    public List<LiveData> selectLiveDataList(LiveData liveData)
+    {
+        return baseMapper.selectLiveDataList(liveData);
+    }
+
+    /**
+     * 新增直播数据
+     *
+     * @param liveData 直播数据
+     * @return 结果
+     */
+    @Override
+    public int insertLiveData(LiveData liveData)
+    {
+        liveData.setCreateTime(DateUtils.getNowDate());
+        return baseMapper.insertLiveData(liveData);
+    }
+
+    /**
+     * 修改直播数据
+     *
+     * @param liveData 直播数据
+     * @return 结果
+     */
+    @Override
+    public int updateLiveData(LiveData liveData)
+    {
+        return baseMapper.updateLiveData(liveData);
+    }
+
+    /**
+     * 批量删除直播数据
+     *
+     * @param liveIds 需要删除的直播数据主键
+     * @return 结果
+     */
+    @Override
+    public int deleteLiveDataByLiveIds(Long[] liveIds)
+    {
+        return baseMapper.deleteLiveDataByLiveIds(liveIds);
+    }
+
+    /**
+     * 删除直播数据信息
+     *
+     * @param liveId 直播数据主键
+     * @return 结果
+     */
+    @Override
+    public int deleteLiveDataByLiveId(Long liveId)
+    {
+        return baseMapper.deleteLiveDataByLiveId(liveId);
+    }
+    /**
+     * 查询所有正在直播的直播间iD
+     * @return
+     */
+    @Override
+    public List<Long> getAllLiveIds() {
+        return baseMapper.getAllLiveIds();
+    }
+
+    @Override
+    public List<RecentLiveDataVo> getRecentLive() {
+        return liveDataMapper.getRecentLive();
+    }
+
+    @Override
+    public List<RecentLiveDataVo> getLiveTop(String rankType) {
+        return liveDataMapper.getLiveTop(rankType);
+    }
+    /**
+     * 查询直播趋势数据
+     * @param type
+     * @param selectedDate
+     * @return
+     */
+    @Override
+    public TrendDataVO getTrendData(String type, String selectedDate,String category) {
+        //DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+        LocalDate date = LocalDate.parse(selectedDate, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+        DateRange currentRange = getDateRange(type, date, 0);
+        DateRange previousRange = getDateRange(type, date, -1);
+        DateRange chartRange = getChartDateRange(type, date); // 天 / 10 周 / 12 月
+        // 查询当前周期数据
+        TrendDataVO currentData = liveDataMapper.getCurrentData(currentRange.getStart(), currentRange.getEnd());
+        if (currentData == null) {
+            currentData = new TrendDataVO();
+        }
+        // 查询上一周期数据
+        TrendDataVO prevData = liveDataMapper.getPreviousData(previousRange.getStart(), previousRange.getEnd());
+        if (prevData == null) {
+            prevData = new TrendDataVO();
+        }
+        List<Map<String, Object>> chartRawData = liveDataMapper.getChartData(chartRange.getStart(), chartRange.getEnd(), type,category.trim());
+        List<String> dates = new ArrayList<>();
+        List<Integer> data = new ArrayList<>();
+
+        for (Map<String, Object> row : chartRawData) {
+            String dateRange = (String) row.get("date_range");
+            Integer views = ((Number) row.get("views")).intValue();
+
+            dates.add(dateRange);
+            data.add(views);
+        }
+
+        currentData.setDates(dates);
+        currentData.setData(data);
+        //计算和上一个周期相比的变化百分比
+        currentData.setViewsChange(calcChange(
+                currentData.getViews() != null ? currentData.getViews() : 0,
+                prevData.getPrevViews() != null ? prevData.getPrevViews() : 0));
+
+        currentData.setVisitorsChange(calcChange(
+                currentData.getVisitors() != null ? currentData.getVisitors() : 0,
+                prevData.getPrevVisitors() != null ? prevData.getPrevVisitors() : 0));
+
+        currentData.setStreamsChange(calcChange(
+                currentData.getStreams() != null ? currentData.getStreams() : 0,
+                prevData.getPrevStreams() != null ? prevData.getPrevStreams() : 0));
+
+        currentData.setPvChange(calcChange(
+                currentData.getPv() != null ? currentData.getPv() : 0,
+                prevData.getPrevPv() != null ? prevData.getPrevPv() : 0));
+
+        currentData.setUvChange(calcChange(
+                currentData.getUv() != null ? currentData.getUv() : 0,
+                prevData.getPrevUv() != null ? prevData.getPrevUv() : 0));
+
+        return currentData;
+    }
+
+
+
+    /**
+     *
+     * @param current 当前周期
+     * @param previous 上一周期
+     * @return
+     */
+    private double calcChange(Integer current, Integer previous) {
+        if (current==previous){return 0.0;}
+        if (previous == null || previous == 0) {return 100.0;}
+        double change = ((double) (current - previous) / previous) * 100;
+        BigDecimal bd = new BigDecimal(change).setScale(2, RoundingMode.HALF_UP);
+        return bd.doubleValue();
+    }
+    /**
+     * 获取当前/上个周期的时间范围
+     */
+    private DateRange getDateRange(String type, LocalDate date, int offset) {
+        LocalDate start, end;
+        switch (type) {
+            case "week":
+                start = date.minusWeeks(-offset).with(DayOfWeek.MONDAY); // 该周的周一
+                end = start.plusDays(6); // 该周的周日
+                break;
+            case "month":
+                start = date.minusMonths(-offset).withDayOfMonth(1); // 该月第一天
+                end = start.plusMonths(1).minusDays(1); // 该月最后一天
+                break;
+            default: // "day"
+                start = date.minusDays(Math.abs(offset)); // 计算 start
+                end = date;
+                break;
+        }
+        return new DateRange(start.toString(), end.toString());
+    }
+
+
+    /**
+     * 获取折线图查询范围
+     */
+    private DateRange getChartDateRange(String type, LocalDate date) {
+        LocalDate start, end;
+        switch (type) {
+            case "week":
+                start = date.minusWeeks(9).with(DayOfWeek.MONDAY);
+                end = date.with(DayOfWeek.SUNDAY);
+                break;
+            case "month":
+                start = date.minusMonths(11).withDayOfMonth(1);
+                end = date.withDayOfMonth(date.lengthOfMonth());
+                break;
+            default: // day
+                start = date.minusDays(30);
+                end = date;
+                break;
+        }
+        return new DateRange(start.format(FORMATTER), end.format(FORMATTER));
+    }
+    /**
+     * @param  userId 当前登录用户id
+     * 查询表格字段配置
+     * @return
+     */
+    /*@Override
+    public List<ColumnsConfigVo> getColumnsConfig(String userId) {
+        List<Object> cacheList = redisCache.getCacheObject(COLUMNS_CONFIG + userId + ":");
+        if (cacheList == null){
+            List<ColumnsConfigVo> columns = new ArrayList<>();
+            *//*columns.add(new ColumnsConfigVo("customer_name", "客户名", "ENABLE"));
+            columns.add(new ColumnsConfigVo("live_room", "直播间", "ENABLE"));
+            columns.add(new ColumnsConfigVo("follower", "跟进人", "ENABLE"));*//*
+            columns.add(new ColumnsConfigVo("department", "归属部门", "ENABLE"));
+            columns.add(new ColumnsConfigVo("created_time", "客户创建时间", "ENABLE"));
+            columns.add(new ColumnsConfigVo("contact_method", "联系方式", "ENABLE"));
+            columns.add(new ColumnsConfigVo("order_goods", "去下单实物商品", "ENABLE"));
+            columns.add(new ColumnsConfigVo("share_live_count", "分享直播间次数", "ENABLE"));
+            columns.add(new ColumnsConfigVo("reply_count", "答题次数", "ENABLE"));
+            columns.add(new ColumnsConfigVo("correct_reply_count", "答题正确次数", "ENABLE"));
+            columns.add(new ColumnsConfigVo("reply_accuracy", "答题正确率", "ENABLE"));
+            columns.add(new ColumnsConfigVo("first_visit_time", "首次访问时间", "ENABLE"));
+            columns.add(new ColumnsConfigVo("first_visit_type", "首次访问类型", "ENABLE"));
+            columns.add(new ColumnsConfigVo("max_live_stay_time", "直播最长停留时间", "ENABLE"));
+            columns.add(new ColumnsConfigVo("total_live_watch_time", "直播累计观看时长", "ENABLE"));
+            columns.add(new ColumnsConfigVo("max_replay_stay_time", "回放最长停留时间", "ENABLE"));
+            columns.add(new ColumnsConfigVo("total_replay_watch_time", "回放累计观看时长", "ENABLE"));
+            columns.add(new ColumnsConfigVo("total_watch_time", "总累计观看时长", "ENABLE"));
+            columns.add(new ColumnsConfigVo("last_exit_time", "最后一次退出时间", "ENABLE"));
+            columns.add(new ColumnsConfigVo("speak_count", "发言次数", "ENABLE"));
+            columns.add(new ColumnsConfigVo("visit_form_name", "访问表单名称", "ENABLE"));
+            columns.add(new ColumnsConfigVo("submit_form_name", "提交表单名称", "ENABLE"));
+            columns.add(new ColumnsConfigVo("pending_payment_goods", "待支付商品", "ENABLE"));
+            columns.add(new ColumnsConfigVo("purchased_goods", "购买商品名称", "ENABLE"));
+            columns.add(new ColumnsConfigVo("last_purchase_time", "最近商品购买时间", "ENABLE"));
+            columns.add(new ColumnsConfigVo("spending_amount", "消费金额", "ENABLE"));
+            columns.add(new ColumnsConfigVo("coupon_name", "优惠券名称", "ENABLE"));
+            columns.add(new ColumnsConfigVo("is_participate_lottery", "是否参与抽奖", "ENABLE"));
+            columns.add(new ColumnsConfigVo("is_winner", "是否中奖", "ENABLE"));
+            columns.add(new ColumnsConfigVo("claimed_watch_reward", "领取观看奖励", "ENABLE"));
+            columns.add(new ColumnsConfigVo("reward_withdrawal_amount", "奖励提现金额", "ENABLE"));
+            columns.add(new ColumnsConfigVo("reward_type", "奖励类型", "ENABLE"));
+            columns.add(new ColumnsConfigVo("red_envelope_count", "红包领取次数", "ENABLE"));
+            columns.add(new ColumnsConfigVo("click_external_goods", "点击外链商品次数", "ENABLE"));
+            columns.add(new ColumnsConfigVo("is_request_mic", "是否申请连麦", "ENABLE"));
+            columns.add(new ColumnsConfigVo("is_on_mic", "是否连麦", "ENABLE"));
+            columns.add(new ColumnsConfigVo("advertiser", "广告商", "ENABLE"));
+            columns.add(new ColumnsConfigVo("promotion_account", "推广账户", "ENABLE"));
+            columns.add(new ColumnsConfigVo("promotion_level_1", "推广一级", "ENABLE"));
+            columns.add(new ColumnsConfigVo("promotion_level_2", "推广二级", "ENABLE"));
+            columns.add(new ColumnsConfigVo("site_placement", "站点投放", "ENABLE"));
+            columns.add(new ColumnsConfigVo("channel", "渠道", "ENABLE"));
+            columns.add(new ColumnsConfigVo("tags", "标签", "ENABLE"));
+            columns.add(new ColumnsConfigVo("follow_status", "跟进状态", "ENABLE"));
+            columns.add(new ColumnsConfigVo("sharer_name", "分享人名称", "ENABLE"));
+            columns.add(new ColumnsConfigVo("customer_id", "客户ID", "ENABLE"));
+            columns.add(new ColumnsConfigVo("union_id", "unionId", "ENABLE"));
+            columns.add(new ColumnsConfigVo("source", "来源", "ENABLE"));
+            columns.add(new ColumnsConfigVo("landing_page", "着陆页", "ENABLE"));
+            columns.add(new ColumnsConfigVo("live_room_url", "直播间访问地址", "ENABLE"));
+            columns.add(new ColumnsConfigVo("collaborator", "协作人", "ENABLE"));
+            columns.add(new ColumnsConfigVo("wechat_note", "微信备注", "ENABLE"));
+            redisCache.setCacheList(COLUMNS_CONFIG + userId + ":",columns);
+            return columns;
+        }
+        // 如果缓存中有数据,将其转换为 ColumnsConfigVo 对象并返回
+        List<ColumnsConfigVo> columnsConfigList = new ArrayList<>();
+        for (Object obj : cacheList) {
+            if (obj instanceof ColumnsConfigVo) {
+                columnsConfigList.add((ColumnsConfigVo) obj);
+            }
+        }
+        return columnsConfigList;
+    }
+*/
+    @Override
+    public void saveColumnsConfig(String userId, List<ColumnsConfigVo> columns) {
+        redisCache.deleteObject(COLUMNS_CONFIG + userId + ":");
+        redisCache.setCacheObject(COLUMNS_CONFIG + userId + ":", columns);
+    }
+    private Map<String, String> createColumn(String dataIndex, String status, String title) {
+        Map<String, String> column = new HashMap<>();
+        column.put("dataIndex", dataIndex);
+        column.put("status", status);
+        column.put("title", title);
+        return column;
+    }
+
+}

+ 25 - 14
fs-service/src/main/java/com/fs/live/service/impl/LiveGoodsOrderItemsServiceImpl.java

@@ -1,20 +1,18 @@
 package com.fs.live.service.impl;
 
-import java.util.List;
-
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fs.common.utils.DateUtils;
-import com.fs.live.domain.LiveAnchor;
-import com.fs.live.mapper.LiveAnchorMapper;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.fs.live.mapper.LiveGoodsOrderItemsMapper;
 import com.fs.live.domain.LiveGoodsOrderItems;
+import com.fs.live.mapper.LiveGoodsOrderItemsMapper;
 import com.fs.live.service.ILiveGoodsOrderItemsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
 
 /**
  * 订单商品Service业务层处理
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */
@@ -26,7 +24,7 @@ public class LiveGoodsOrderItemsServiceImpl extends ServiceImpl<LiveGoodsOrderIt
 
     /**
      * 查询订单商品
-     * 
+     *
      * @param id 订单商品主键
      * @return 订单商品
      */
@@ -36,9 +34,22 @@ public class LiveGoodsOrderItemsServiceImpl extends ServiceImpl<LiveGoodsOrderIt
         return liveGoodsOrderItemsMapper.selectLiveGoodsOrderItemsById(id);
     }
 
+    /**
+     * 查询企业订单商品
+     * @param id            订单ID
+     * @param companyId     企业ID
+     * @param companyUserId 企业用户ID
+     * @return LiveGoodsOrderItems
+     */
+    @Override
+    public LiveGoodsOrderItems selectLiveGoodsOrderItemsByIdAndCompanyIdAndCompanyUserId(Long id, Long companyId, Long companyUserId)
+    {
+        return liveGoodsOrderItemsMapper.selectLiveGoodsOrderItemsByIdAndCompanyIdAndCompanyUserId(id, companyId, companyUserId);
+    }
+
     /**
      * 查询订单商品列表
-     * 
+     *
      * @param liveGoodsOrderItems 订单商品
      * @return 订单商品
      */
@@ -50,7 +61,7 @@ public class LiveGoodsOrderItemsServiceImpl extends ServiceImpl<LiveGoodsOrderIt
 
     /**
      * 新增订单商品
-     * 
+     *
      * @param liveGoodsOrderItems 订单商品
      * @return 结果
      */
@@ -63,7 +74,7 @@ public class LiveGoodsOrderItemsServiceImpl extends ServiceImpl<LiveGoodsOrderIt
 
     /**
      * 修改订单商品
-     * 
+     *
      * @param liveGoodsOrderItems 订单商品
      * @return 结果
      */
@@ -76,7 +87,7 @@ public class LiveGoodsOrderItemsServiceImpl extends ServiceImpl<LiveGoodsOrderIt
 
     /**
      * 批量删除订单商品
-     * 
+     *
      * @param ids 需要删除的订单商品主键
      * @return 结果
      */
@@ -88,7 +99,7 @@ public class LiveGoodsOrderItemsServiceImpl extends ServiceImpl<LiveGoodsOrderIt
 
     /**
      * 删除订单商品信息
-     * 
+     *
      * @param id 订单商品主键
      * @return 结果
      */

+ 24 - 14
fs-service/src/main/java/com/fs/live/service/impl/LiveGoodsOrderServiceImpl.java

@@ -1,20 +1,18 @@
 package com.fs.live.service.impl;
 
-import java.util.List;
-
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fs.common.utils.DateUtils;
-import com.fs.live.domain.LiveAnchor;
-import com.fs.live.mapper.LiveAnchorMapper;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.fs.live.mapper.LiveGoodsOrderMapper;
 import com.fs.live.domain.LiveGoodsOrder;
+import com.fs.live.mapper.LiveGoodsOrderMapper;
 import com.fs.live.service.ILiveGoodsOrderService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
 
 /**
  * 订单Service业务层处理
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */
@@ -26,7 +24,7 @@ public class LiveGoodsOrderServiceImpl extends ServiceImpl<LiveGoodsOrderMapper,
 
     /**
      * 查询订单
-     * 
+     *
      * @param orderId 订单主键
      * @return 订单
      */
@@ -36,9 +34,21 @@ public class LiveGoodsOrderServiceImpl extends ServiceImpl<LiveGoodsOrderMapper,
         return liveGoodsOrderMapper.selectLiveGoodsOrderByOrderId(orderId);
     }
 
+    /**
+     * 查询企业订单
+     * @param orderId       订单ID
+     * @param companyId     企业ID
+     * @param companyUserId 企业用户ID
+     * @return LiveGoodsOrder
+     */
+    @Override
+    public LiveGoodsOrder selectLiveGoodsOrderByOrderIdAndCompanyIdAndCompanyUserId(Long orderId, Long companyId, Long companyUserId) {
+        return liveGoodsOrderMapper.selectLiveGoodsOrderByOrderIdAndCompanyIdAndCompanyUserId(orderId, companyId, companyUserId);
+    }
+
     /**
      * 查询订单列表
-     * 
+     *
      * @param liveGoodsOrder 订单
      * @return 订单
      */
@@ -50,7 +60,7 @@ public class LiveGoodsOrderServiceImpl extends ServiceImpl<LiveGoodsOrderMapper,
 
     /**
      * 新增订单
-     * 
+     *
      * @param liveGoodsOrder 订单
      * @return 结果
      */
@@ -63,7 +73,7 @@ public class LiveGoodsOrderServiceImpl extends ServiceImpl<LiveGoodsOrderMapper,
 
     /**
      * 修改订单
-     * 
+     *
      * @param liveGoodsOrder 订单
      * @return 结果
      */
@@ -76,7 +86,7 @@ public class LiveGoodsOrderServiceImpl extends ServiceImpl<LiveGoodsOrderMapper,
 
     /**
      * 批量删除订单
-     * 
+     *
      * @param orderIds 需要删除的订单主键
      * @return 结果
      */
@@ -88,7 +98,7 @@ public class LiveGoodsOrderServiceImpl extends ServiceImpl<LiveGoodsOrderMapper,
 
     /**
      * 删除订单信息
-     * 
+     *
      * @param orderId 订单主键
      * @return 结果
      */

+ 24 - 14
fs-service/src/main/java/com/fs/live/service/impl/LiveGoodsServiceImpl.java

@@ -1,20 +1,18 @@
 package com.fs.live.service.impl;
 
-import java.util.List;
-
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fs.common.utils.DateUtils;
-import com.fs.live.domain.LiveAnchor;
-import com.fs.live.mapper.LiveAnchorMapper;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.fs.live.mapper.LiveGoodsMapper;
 import com.fs.live.domain.LiveGoods;
+import com.fs.live.mapper.LiveGoodsMapper;
 import com.fs.live.service.ILiveGoodsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
 
 /**
  * 直播商品Service业务层处理
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */
@@ -26,7 +24,7 @@ public class LiveGoodsServiceImpl extends ServiceImpl<LiveGoodsMapper, LiveGoods
 
     /**
      * 查询直播商品
-     * 
+     *
      * @param goodsId 直播商品主键
      * @return 直播商品
      */
@@ -36,9 +34,21 @@ public class LiveGoodsServiceImpl extends ServiceImpl<LiveGoodsMapper, LiveGoods
         return liveGoodsMapper.selectLiveGoodsByGoodsId(goodsId);
     }
 
+    /**
+     * 查询企业直播商品
+     *
+     * @param goodsId 直播商品主键
+     * @return 直播商品
+     */
+    @Override
+    public LiveGoods selectLiveGoodsByGoodsIdAndCompanyIdAndCompanyUserId(Long goodsId, Long companyId, Long companyUserId)
+    {
+        return liveGoodsMapper.selectLiveGoodsByGoodsIdAndCompanyIdAndCompanyUserId(goodsId, companyId, companyUserId);
+    }
+
     /**
      * 查询直播商品列表
-     * 
+     *
      * @param liveGoods 直播商品
      * @return 直播商品
      */
@@ -50,7 +60,7 @@ public class LiveGoodsServiceImpl extends ServiceImpl<LiveGoodsMapper, LiveGoods
 
     /**
      * 新增直播商品
-     * 
+     *
      * @param liveGoods 直播商品
      * @return 结果
      */
@@ -63,7 +73,7 @@ public class LiveGoodsServiceImpl extends ServiceImpl<LiveGoodsMapper, LiveGoods
 
     /**
      * 修改直播商品
-     * 
+     *
      * @param liveGoods 直播商品
      * @return 结果
      */
@@ -76,7 +86,7 @@ public class LiveGoodsServiceImpl extends ServiceImpl<LiveGoodsMapper, LiveGoods
 
     /**
      * 批量删除直播商品
-     * 
+     *
      * @param goodsIds 需要删除的直播商品主键
      * @return 结果
      */
@@ -88,7 +98,7 @@ public class LiveGoodsServiceImpl extends ServiceImpl<LiveGoodsMapper, LiveGoods
 
     /**
      * 删除直播商品信息
-     * 
+     *
      * @param goodsId 直播商品主键
      * @return 结果
      */

+ 12 - 14
fs-service/src/main/java/com/fs/live/service/impl/LiveMsgServiceImpl.java

@@ -1,20 +1,18 @@
 package com.fs.live.service.impl;
 
-import java.util.List;
-
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fs.common.utils.DateUtils;
-import com.fs.live.domain.LiveAnchor;
-import com.fs.live.mapper.LiveAnchorMapper;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.fs.live.mapper.LiveMsgMapper;
 import com.fs.live.domain.LiveMsg;
+import com.fs.live.mapper.LiveMsgMapper;
 import com.fs.live.service.ILiveMsgService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
 
 /**
  * 直播讨论Service业务层处理
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */
@@ -26,7 +24,7 @@ public class LiveMsgServiceImpl extends ServiceImpl<LiveMsgMapper, LiveMsg> impl
 
     /**
      * 查询直播讨论
-     * 
+     *
      * @param msgId 直播讨论主键
      * @return 直播讨论
      */
@@ -38,7 +36,7 @@ public class LiveMsgServiceImpl extends ServiceImpl<LiveMsgMapper, LiveMsg> impl
 
     /**
      * 查询直播讨论列表
-     * 
+     *
      * @param liveMsg 直播讨论
      * @return 直播讨论
      */
@@ -50,7 +48,7 @@ public class LiveMsgServiceImpl extends ServiceImpl<LiveMsgMapper, LiveMsg> impl
 
     /**
      * 新增直播讨论
-     * 
+     *
      * @param liveMsg 直播讨论
      * @return 结果
      */
@@ -63,7 +61,7 @@ public class LiveMsgServiceImpl extends ServiceImpl<LiveMsgMapper, LiveMsg> impl
 
     /**
      * 修改直播讨论
-     * 
+     *
      * @param liveMsg 直播讨论
      * @return 结果
      */
@@ -76,7 +74,7 @@ public class LiveMsgServiceImpl extends ServiceImpl<LiveMsgMapper, LiveMsg> impl
 
     /**
      * 批量删除直播讨论
-     * 
+     *
      * @param msgIds 需要删除的直播讨论主键
      * @return 结果
      */
@@ -88,7 +86,7 @@ public class LiveMsgServiceImpl extends ServiceImpl<LiveMsgMapper, LiveMsg> impl
 
     /**
      * 删除直播讨论信息
-     * 
+     *
      * @param msgId 直播讨论主键
      * @return 结果
      */

+ 124 - 0
fs-service/src/main/java/com/fs/live/service/impl/LiveQuestionBankServiceImpl.java

@@ -0,0 +1,124 @@
+package com.fs.live.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.common.exception.ServiceException;
+import com.fs.common.exception.base.BaseException;
+import com.fs.common.utils.StringUtils;
+import com.fs.common.utils.bean.BeanUtils;
+import com.fs.live.domain.LiveQuestionBank;
+import com.fs.live.domain.LiveQuestionLive;
+import com.fs.live.mapper.LiveQuestionBankMapper;
+import com.fs.live.mapper.LiveQuestionLiveMapper;
+import com.fs.live.service.ILiveQuestionBankService;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDateTime;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Objects;
+
+@Service
+@AllArgsConstructor
+public class LiveQuestionBankServiceImpl extends ServiceImpl<LiveQuestionBankMapper, LiveQuestionBank> implements ILiveQuestionBankService {
+
+    private final LiveQuestionLiveMapper liveQuestionLiveMapper;
+
+    /**
+     * 查询题库列表
+     * @param title 题
+     * @return 题库
+     */
+    @Override
+    public List<LiveQuestionBank> selectLiveQuestionBankList(String title) {
+        LambdaQueryWrapper<LiveQuestionBank> wrapper = new LambdaQueryWrapper<>();
+
+        if (StringUtils.isNotBlank(title)) {
+            wrapper.like(LiveQuestionBank::getTitle, title);
+        }
+
+        return baseMapper.selectList(wrapper);
+    }
+
+    /**
+     * 新增题
+     *
+     * @param liveQuestionBank 题
+     * @param username  用户名称
+     * @return 受影响行数
+     */
+    @Override
+    public int insertLiveQuestionBank(LiveQuestionBank liveQuestionBank, String username) {
+        // 参数校验
+        verifyParams(liveQuestionBank);
+
+        liveQuestionBank.setCreateTime(LocalDateTime.now());
+        liveQuestionBank.setCreateBy(username);
+        liveQuestionBank.setUpdateTime(LocalDateTime.now());
+        liveQuestionBank.setUpdateBy(username);
+        return baseMapper.insert(liveQuestionBank);
+    }
+
+    /**
+     * 参数校验
+     * @param liveQuestionBank 题目
+     */
+    private void verifyParams(LiveQuestionBank liveQuestionBank) {
+        if (StringUtils.isBlank(liveQuestionBank.getTitle())) {
+            throw new BaseException("题干不能为空");
+        }
+        if (StringUtils.isBlank(liveQuestionBank.getContent())) {
+            throw new BaseException("内容不能为空");
+        }
+        if (Objects.isNull(liveQuestionBank.getType())) {
+            throw new BaseException("类型不能为空");
+        }
+        if (StringUtils.isBlank(liveQuestionBank.getAnswer())) {
+            throw new BaseException("答案不能为空");
+        }
+    }
+
+    /**
+     * 修改题目
+     * @param liveQuestionBank 题目
+     * @param username 用户名
+     * @return  受影响行数
+     */
+    @Override
+    public int updateLiveQuestionBank(LiveQuestionBank liveQuestionBank, String username) {
+        // 参数校验
+        verifyParams(liveQuestionBank);
+
+        if (Objects.isNull(liveQuestionBank.getId())) {
+            throw new BaseException("ID不能为空");
+        }
+
+        LiveQuestionBank questionBank = baseMapper.selectById(liveQuestionBank.getId());
+        if (Objects.isNull(questionBank)) {
+            throw new BaseException("题目不存在");
+        }
+
+        BeanUtils.copyProperties(liveQuestionBank, questionBank);
+        liveQuestionBank.setUpdateTime(LocalDateTime.now());
+        liveQuestionBank.setUpdateBy(username);
+        return baseMapper.updateById(liveQuestionBank);
+    }
+
+    /**
+     * 删除题目
+     * @param ids ID集合
+     * @return 受影响行数
+     */
+    @Override
+    public int deleteLiveQuestionBankByIds(Long[] ids) {
+        // 判断是否被使用
+        Wrapper<LiveQuestionLive> wrapper = new LambdaQueryWrapper<LiveQuestionLive>().in(LiveQuestionLive::getQuestionId, Arrays.asList(ids));
+        if (liveQuestionLiveMapper.selectCount(wrapper) > 0) {
+            throw new ServiceException("题目使用中,无法删除");
+        }
+
+        return baseMapper.deleteBatchIds(Arrays.asList(ids));
+    }
+}

+ 117 - 0
fs-service/src/main/java/com/fs/live/service/impl/LiveQuestionLiveServiceImpl.java

@@ -0,0 +1,117 @@
+package com.fs.live.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.common.exception.ServiceException;
+import com.fs.live.domain.Live;
+import com.fs.live.domain.LiveQuestionBank;
+import com.fs.live.domain.LiveQuestionLive;
+import com.fs.live.mapper.LiveMapper;
+import com.fs.live.mapper.LiveQuestionBankMapper;
+import com.fs.live.mapper.LiveQuestionLiveMapper;
+import com.fs.live.service.ILiveQuestionLiveService;
+import com.fs.live.vo.LiveQuestionLiveVO;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.time.LocalDateTime;
+import java.util.Collection;
+import java.util.List;
+import java.util.Objects;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+@Service
+@AllArgsConstructor
+public class LiveQuestionLiveServiceImpl extends ServiceImpl<LiveQuestionLiveMapper, LiveQuestionLive> implements ILiveQuestionLiveService {
+
+    private final LiveQuestionBankMapper liveQuestionBankMapper;
+    private final LiveMapper liveMapper;
+
+    /**
+     * 查询直播间题目列表
+     * @param liveId    直播间ID
+     * @return  list
+     */
+    @Override
+    public List<LiveQuestionLiveVO> selectLiveQuestionLiveList(Long liveId) {
+        return baseMapper.selectLiveQuestionLiveList(liveId);
+    }
+
+    /**
+     * 添加直播间题目
+     * @param liveId    直播间ID
+     * @param questionIds   题目ID集合
+     * @param username  用户名称
+     * @return  是否成功
+     */
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public boolean insertLiveQuestion(Long liveId, List<Long> questionIds, String username) {
+        Live live = liveMapper.selectById(liveId);
+        if (Objects.isNull(live)) {
+            throw new ServiceException("直播间不存在");
+        }
+
+        Collection<LiveQuestionBank> liveQuestionBanks = liveQuestionBankMapper.selectBatchIds(questionIds);
+        if (liveQuestionBanks.isEmpty()) {
+            throw new ServiceException("请选择有效的题目");
+        }
+
+        Set<Long> ids = liveQuestionBanks.stream().map(LiveQuestionBank::getId).collect(Collectors.toSet());
+
+        // 过滤已经存在的题目
+        Wrapper<LiveQuestionLive> wrapper = Wrappers.<LiveQuestionLive>lambdaQuery()
+                .eq(LiveQuestionLive::getLiveId, liveId)
+                .in(LiveQuestionLive::getQuestionId, ids);
+        Set<Long> hasQuestions = baseMapper.selectList(wrapper).stream().map(LiveQuestionLive::getQuestionId).collect(Collectors.toSet());
+
+        List<LiveQuestionLive> liveQuestionLives = ids.stream().filter(id -> !hasQuestions.contains(id))
+        .map(id -> {
+            LiveQuestionLive liveQuestionLive = new LiveQuestionLive();
+            liveQuestionLive.setLiveId(liveId);
+            liveQuestionLive.setQuestionId(id);
+            liveQuestionLive.setCreateTime(LocalDateTime.now());
+            liveQuestionLive.setCreateBy(username);
+            return liveQuestionLive;
+        }).collect(Collectors.toList());
+
+        if (!liveQuestionLives.isEmpty()) {
+            return saveBatch(liveQuestionLives);
+        }
+
+        return false;
+    }
+
+    /**
+     * 删除直播间题目
+     * @param liveId 直播间ID
+     * @param ids   题目集合
+     * @return 受影响行数
+     */
+    @Override
+    public int deleteLiveQuestionByIds(Long liveId, List<Long> ids) {
+        Live live = liveMapper.selectById(liveId);
+        if (Objects.isNull(live)) {
+            throw new ServiceException("直播间不存在");
+        }
+
+        // TODO:判断是否被使用
+
+        Wrapper<LiveQuestionLive> wrapper = Wrappers.<LiveQuestionLive>lambdaQuery().eq(LiveQuestionLive::getLiveId, liveId).in(LiveQuestionLive::getId, ids);
+        return baseMapper.delete(wrapper);
+    }
+
+    /**
+     * 查询未被直播间选择的题目列表
+     * @param liveId    直播间ID
+     * @param title     标题
+     * @return  list
+     */
+    @Override
+    public List<LiveQuestionLiveVO> selectLiveQuestionOptionList(Long liveId, String title) {
+        return baseMapper.selectLiveQuestionOptionList(liveId, title);
+    }
+}

+ 25 - 14
fs-service/src/main/java/com/fs/live/service/impl/LiveQuestionServiceImpl.java

@@ -1,20 +1,18 @@
 package com.fs.live.service.impl;
 
-import java.util.List;
-
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fs.common.utils.DateUtils;
-import com.fs.live.domain.LiveAnchor;
-import com.fs.live.mapper.LiveAnchorMapper;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.fs.live.mapper.LiveQuestionMapper;
 import com.fs.live.domain.LiveQuestion;
+import com.fs.live.mapper.LiveQuestionMapper;
 import com.fs.live.service.ILiveQuestionService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
 
 /**
  * 问答Service业务层处理
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */
@@ -26,7 +24,7 @@ public class LiveQuestionServiceImpl extends ServiceImpl<LiveQuestionMapper, Liv
 
     /**
      * 查询问答
-     * 
+     *
      * @param questionId 问答主键
      * @return 问答
      */
@@ -36,9 +34,22 @@ public class LiveQuestionServiceImpl extends ServiceImpl<LiveQuestionMapper, Liv
         return liveQuestionMapper.selectLiveQuestionByQuestionId(questionId);
     }
 
+    /**
+     * 查询企业问答
+     * @param questionId       问答ID
+     * @param companyId        企业ID
+     * @param companyUserId    企业用户ID
+     * @return LiveQuestion
+     */
+    @Override
+    public LiveQuestion selectLiveQuestionByQuestionIdAndCompanyIdAndCompanyUserId(Long questionId, Long companyId, Long companyUserId)
+    {
+        return liveQuestionMapper.selectLiveQuestionByQuestionIdAndCompanyIdAndCompanyUserId(questionId, companyId, companyUserId);
+    }
+
     /**
      * 查询问答列表
-     * 
+     *
      * @param liveQuestion 问答
      * @return 问答
      */
@@ -50,7 +61,7 @@ public class LiveQuestionServiceImpl extends ServiceImpl<LiveQuestionMapper, Liv
 
     /**
      * 新增问答
-     * 
+     *
      * @param liveQuestion 问答
      * @return 结果
      */
@@ -63,7 +74,7 @@ public class LiveQuestionServiceImpl extends ServiceImpl<LiveQuestionMapper, Liv
 
     /**
      * 修改问答
-     * 
+     *
      * @param liveQuestion 问答
      * @return 结果
      */
@@ -76,7 +87,7 @@ public class LiveQuestionServiceImpl extends ServiceImpl<LiveQuestionMapper, Liv
 
     /**
      * 批量删除问答
-     * 
+     *
      * @param questionIds 需要删除的问答主键
      * @return 结果
      */
@@ -88,7 +99,7 @@ public class LiveQuestionServiceImpl extends ServiceImpl<LiveQuestionMapper, Liv
 
     /**
      * 删除问答信息
-     * 
+     *
      * @param questionId 问答主键
      * @return 结果
      */

+ 11 - 0
fs-service/src/main/java/com/fs/live/service/impl/LiveQuestionUserLogServiceImpl.java

@@ -0,0 +1,11 @@
+package com.fs.live.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.live.domain.LiveQuestionUserLog;
+import com.fs.live.mapper.LiveQuestionUserLogMapper;
+import com.fs.live.service.ILiveQuestionUserLogService;
+import org.springframework.stereotype.Service;
+
+@Service
+public class LiveQuestionUserLogServiceImpl extends ServiceImpl<LiveQuestionUserLogMapper,LiveQuestionUserLog> implements ILiveQuestionUserLogService {
+}

+ 44 - 8
fs-service/src/main/java/com/fs/live/service/impl/LiveServiceImpl.java

@@ -1,21 +1,20 @@
 package com.fs.live.service.impl;
 
-import java.util.List;
-
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fs.common.exception.base.BaseException;
 import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.StringUtils;
-import com.fs.live.domain.LiveAnchor;
+import com.fs.live.domain.Live;
+import com.fs.live.domain.LiveData;
 import com.fs.live.domain.LiveVideo;
-import com.fs.live.mapper.LiveAnchorMapper;
+import com.fs.live.mapper.LiveMapper;
+import com.fs.live.service.ILiveDataService;
+import com.fs.live.service.ILiveService;
 import com.fs.live.service.ILiveVideoService;
 import lombok.AllArgsConstructor;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.fs.live.mapper.LiveMapper;
-import com.fs.live.domain.Live;
-import com.fs.live.service.ILiveService;
+
+import java.util.List;
 
 /**
  * 直播Service业务层处理
@@ -29,6 +28,7 @@ public class LiveServiceImpl extends ServiceImpl<LiveMapper, Live> implements IL
 {
     private final LiveMapper liveMapper;
     private final ILiveVideoService liveVideoService;
+    private final ILiveDataService liveDataService;
 
     /**
      * 查询直播
@@ -48,6 +48,25 @@ public class LiveServiceImpl extends ServiceImpl<LiveMapper, Live> implements IL
         return byId;
     }
 
+    /**
+     * 查询企业直播
+     * @param liveId            直播ID
+     * @param companyId         企业ID
+     * @param companyUserId     企业用户ID
+     * @return Live
+     */
+    @Override
+    public Live selectLiveByLiveIdAndCompanyIdAndCompanyUserId(Long liveId, Long companyId, Long companyUserId){
+        Live byId = liveMapper.selectLiveByLiveIdAndCompanyIdAndCompanyUserId(liveId, companyId, companyUserId);
+        List<LiveVideo> videos = liveVideoService.listByLiveId(liveId, 1);
+        if(!videos.isEmpty()){
+            LiveVideo liveVideo = videos.get(0);
+            byId.setVideoUrl(liveVideo.getVideoUrl());
+            byId.setDuration(liveVideo.getDuration());
+        }
+        return byId;
+    }
+
     /**
      * 查询直播列表
      *
@@ -60,6 +79,19 @@ public class LiveServiceImpl extends ServiceImpl<LiveMapper, Live> implements IL
         return liveMapper.selectLiveList(live);
     }
 
+
+    /**
+     * 查询直播列表
+     *
+     * @param
+     * @return 直播
+     */
+    @Override
+    public List<Live> selectLiveToStudent(String liveName,String status,String startTime,String finishTime)
+    {
+        return liveMapper.selectLiveToStudent(liveName,status,startTime,finishTime);
+    }
+
     /**
      * 新增直播
      *
@@ -79,6 +111,10 @@ public class LiveServiceImpl extends ServiceImpl<LiveMapper, Live> implements IL
         liveVideo.setVideoType(1);
         liveVideo.setDuration(live.getDuration());
         liveVideoService.save(liveVideo);
+        //新增直播数据表
+        LiveData liveData = new LiveData();
+        liveData.setLiveId(live.getLiveId());
+        liveDataService.insertLiveData(liveData);
         return save ? 1 : 0;
     }
 

+ 100 - 0
fs-service/src/main/java/com/fs/live/service/impl/LiveStudentDataServiceImpl.java

@@ -0,0 +1,100 @@
+package com.fs.live.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.live.domain.LiveStudentData;
+import com.fs.live.mapper.LiveStudentDataMapper;
+import com.fs.live.param.LiveStudentDataQueryParam;
+import com.fs.live.service.ILiveStudentDataService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 直播间学员数据Service业务层处理
+ *
+ * @author fs
+ * @date 2025-03-11
+ */
+@Service
+public class LiveStudentDataServiceImpl extends ServiceImpl<LiveStudentDataMapper, LiveStudentData> implements ILiveStudentDataService {
+    @Autowired
+    private LiveStudentDataMapper liveStudentDataMapper;
+    /**
+     * 查询直播间学员数据
+     *
+     * @param liveId 直播间学员数据主键
+     * @return 直播间学员数据
+     */
+    @Override
+    public LiveStudentData selectLiveStudentDataByLiveId(Long liveId)
+    {
+        return baseMapper.selectLiveStudentDataByLiveId(liveId);
+    }
+
+    /**
+     * 查询直播间学员数据列表
+     *
+     * @param liveStudentData 直播间学员数据
+     * @return 直播间学员数据
+     */
+    @Override
+    public List<LiveStudentData> selectLiveStudentDataList(LiveStudentData liveStudentData)
+    {
+        return baseMapper.selectLiveStudentDataList(liveStudentData);
+    }
+
+    /**
+     * 新增直播间学员数据
+     *
+     * @param liveStudentData 直播间学员数据
+     * @return 结果
+     */
+    @Override
+    public int insertLiveStudentData(LiveStudentData liveStudentData)
+    {
+        return baseMapper.insertLiveStudentData(liveStudentData);
+    }
+
+    /**
+     * 修改直播间学员数据
+     *
+     * @param liveStudentData 直播间学员数据
+     * @return 结果
+     */
+    @Override
+    public int updateLiveStudentData(LiveStudentData liveStudentData)
+    {
+        return baseMapper.updateLiveStudentData(liveStudentData);
+    }
+
+    /**
+     * 批量删除直播间学员数据
+     *
+     * @param liveIds 需要删除的直播间学员数据主键
+     * @return 结果
+     */
+    @Override
+    public int deleteLiveStudentDataByLiveIds(Long[] liveIds)
+    {
+        return baseMapper.deleteLiveStudentDataByLiveIds(liveIds);
+    }
+
+    /**
+     * 删除直播间学员数据信息
+     *
+     * @param liveId 直播间学员数据主键
+     * @return 结果
+     */
+    @Override
+    public int deleteLiveStudentDataByLiveId(Long liveId)
+    {
+        return baseMapper.deleteLiveStudentDataByLiveId(liveId);
+    }
+
+    @Override
+    public List<LiveStudentData> queryStudentData( LiveStudentDataQueryParam param) {
+
+        return liveStudentDataMapper.queryStudentData(param);
+    }
+}

+ 39 - 15
fs-service/src/main/java/com/fs/live/service/impl/LiveVideoServiceImpl.java

@@ -1,22 +1,21 @@
 package com.fs.live.service.impl;
 
-import java.util.Collections;
-import java.util.List;
-
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fs.common.utils.DateUtils;
-import com.fs.live.domain.LiveAnchor;
-import com.fs.live.mapper.LiveAnchorMapper;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.fs.live.mapper.LiveVideoMapper;
 import com.fs.live.domain.LiveVideo;
+import com.fs.live.mapper.LiveVideoMapper;
 import com.fs.live.service.ILiveVideoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
 
 /**
  * 直播视频Service业务层处理
- * 
+ *
  * @author fs
  * @date 2025-01-17
  */
@@ -28,7 +27,7 @@ public class LiveVideoServiceImpl extends ServiceImpl<LiveVideoMapper, LiveVideo
 
     /**
      * 查询直播视频
-     * 
+     *
      * @param videoId 直播视频主键
      * @return 直播视频
      */
@@ -38,9 +37,22 @@ public class LiveVideoServiceImpl extends ServiceImpl<LiveVideoMapper, LiveVideo
         return liveVideoMapper.selectLiveVideoByVideoId(videoId);
     }
 
+    /**
+     * 查询企业直播视频
+     * @param videoId       视频ID
+     * @param companyId     企业ID
+     * @param companyUserId 企业用户ID
+     * @return LiveVideo
+     */
+    @Override
+    public LiveVideo selectLiveVideoByVideoIdAndCompanyIdAndCompanyUserId(Long videoId, Long companyId, Long companyUserId)
+    {
+        return liveVideoMapper.selectLiveVideoByVideoIdAndCompanyIdAndCompanyUserId(videoId, companyId, companyUserId);
+    }
+
     /**
      * 查询直播视频列表
-     * 
+     *
      * @param liveVideo 直播视频
      * @return 直播视频
      */
@@ -52,7 +64,7 @@ public class LiveVideoServiceImpl extends ServiceImpl<LiveVideoMapper, LiveVideo
 
     /**
      * 新增直播视频
-     * 
+     *
      * @param liveVideo 直播视频
      * @return 结果
      */
@@ -65,7 +77,7 @@ public class LiveVideoServiceImpl extends ServiceImpl<LiveVideoMapper, LiveVideo
 
     /**
      * 修改直播视频
-     * 
+     *
      * @param liveVideo 直播视频
      * @return 结果
      */
@@ -78,7 +90,7 @@ public class LiveVideoServiceImpl extends ServiceImpl<LiveVideoMapper, LiveVideo
 
     /**
      * 批量删除直播视频
-     * 
+     *
      * @param videoIds 需要删除的直播视频主键
      * @return 结果
      */
@@ -90,7 +102,7 @@ public class LiveVideoServiceImpl extends ServiceImpl<LiveVideoMapper, LiveVideo
 
     /**
      * 删除直播视频信息
-     * 
+     *
      * @param videoId 直播视频主键
      * @return 结果
      */
@@ -104,4 +116,16 @@ public class LiveVideoServiceImpl extends ServiceImpl<LiveVideoMapper, LiveVideo
     public List<LiveVideo> listByLiveId(Long liveId, Integer type) {
         return list(new QueryWrapper<LiveVideo>().eq("live_id", liveId).eq("video_type", type));
     }
+
+    /**
+     * 根据直播ID查询视频
+     * @param liveId 直播ID
+     * @return liveVideo
+     */
+    @Override
+    public LiveVideo selectLiveVideoByLiveId(Long liveId) {
+        Wrapper<LiveVideo> wrapper = new LambdaQueryWrapper<LiveVideo>().eq(LiveVideo::getLiveId, liveId).last("limit 1");
+        return baseMapper.selectOne(wrapper);
+    }
+
 }

+ 62 - 7
fs-service/src/main/java/com/fs/live/service/impl/LiveWatchUserServiceImpl.java

@@ -6,13 +6,16 @@ import com.fs.common.utils.DateUtils;
 import com.fs.live.domain.LiveWatchUser;
 import com.fs.live.mapper.LiveWatchUserMapper;
 import com.fs.live.service.ILiveWatchUserService;
+import com.fs.live.vo.LiveWatchUserVO;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
+import java.util.Map;
+import java.util.Objects;
 
 /**
  * 直播间观看用户Service业务层处理
- * 
+ *
  * @author fs
  * @date 2025-01-18
  */
@@ -21,7 +24,7 @@ public class LiveWatchUserServiceImpl extends ServiceImpl<LiveWatchUserMapper, L
 
     /**
      * 查询直播间观看用户
-     * 
+     *
      * @param id 直播间观看用户主键
      * @return 直播间观看用户
      */
@@ -31,9 +34,22 @@ public class LiveWatchUserServiceImpl extends ServiceImpl<LiveWatchUserMapper, L
         return baseMapper.selectLiveWatchUserById(id);
     }
 
+    /**
+     * 查询企业直播间观看用户
+     * @param id                直播间用户ID
+     * @param companyId         企业ID
+     * @param companyUserId     企业用户ID
+     * @return LiveWatchUser
+     */
+    @Override
+    public LiveWatchUser selectLiveWatchUserByIdAndCompanyIdAndCompanyUserId(Long id, Long companyId, Long companyUserId)
+    {
+        return baseMapper.selectLiveWatchUserByIdAndCompanyIdAndCompanyUserId(id, companyId, companyUserId);
+    }
+
     /**
      * 查询直播间观看用户列表
-     * 
+     *
      * @param liveWatchUser 直播间观看用户
      * @return 直播间观看用户
      */
@@ -45,7 +61,7 @@ public class LiveWatchUserServiceImpl extends ServiceImpl<LiveWatchUserMapper, L
 
     /**
      * 新增直播间观看用户
-     * 
+     *
      * @param liveWatchUser 直播间观看用户
      * @return 结果
      */
@@ -58,7 +74,7 @@ public class LiveWatchUserServiceImpl extends ServiceImpl<LiveWatchUserMapper, L
 
     /**
      * 修改直播间观看用户
-     * 
+     *
      * @param liveWatchUser 直播间观看用户
      * @return 结果
      */
@@ -71,7 +87,7 @@ public class LiveWatchUserServiceImpl extends ServiceImpl<LiveWatchUserMapper, L
 
     /**
      * 批量删除直播间观看用户
-     * 
+     *
      * @param ids 需要删除的直播间观看用户主键
      * @return 结果
      */
@@ -83,7 +99,7 @@ public class LiveWatchUserServiceImpl extends ServiceImpl<LiveWatchUserMapper, L
 
     /**
      * 删除直播间观看用户信息
-     * 
+     *
      * @param id 直播间观看用户主键
      * @return 结果
      */
@@ -118,4 +134,43 @@ public class LiveWatchUserServiceImpl extends ServiceImpl<LiveWatchUserMapper, L
         liveWatchUser.setOnline(1);
         super.updateById(liveWatchUser);
     }
+
+    /**
+     * 查询直播间在线用户列表
+     * @param params 参数
+     * @return list
+     */
+    @Override
+    public List<LiveWatchUserVO> selectWatchUserList(Map<String, Object> params) {
+        return baseMapper.selectWatchUserListByLiveId(params);
+    }
+
+    /**
+     * 修改直播间用户禁言状态
+     * @param liveId    直播间ID
+     * @param userId    用户ID
+     * @return  受影响条数
+     */
+    @Override
+    public int changeUserState(Long liveId, Long userId) {
+        LiveWatchUser liveWatchUser = getByLiveIdAndUserId(liveId, userId);
+        if (Objects.nonNull(liveWatchUser)) {
+            liveWatchUser.setMsgStatus(Math.abs(1 - liveWatchUser.getMsgStatus()));
+            liveWatchUser.setUpdateTime(DateUtils.getNowDate());
+            return baseMapper.updateById(liveWatchUser);
+        }
+        return 0;
+    }
+
+    /**
+     * 根据直播间ID和用户ID查询观看用户信息
+     * @param liveId    直播间ID
+     * @param userId    观看用户ID
+     * @return LiveWatchUserVO
+     */
+    @Override
+    public LiveWatchUserVO selectWatchUserByLiveIdAndUserId(Long liveId, Long userId) {
+        return baseMapper.selectWatchUserByLiveIdAndUserId(liveId, userId);
+    }
+
 }

+ 24 - 0
fs-service/src/main/java/com/fs/live/vo/ColumnsConfigVo.java

@@ -0,0 +1,24 @@
+package com.fs.live.vo;
+
+import com.baidu.dev2.thirdparty.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+@Data
+public class ColumnsConfigVo {
+    //数据库字段名
+    @JsonProperty("dataIndex")
+    private String dataIndex;
+    //状态ENABLE启用DISABLE禁用
+    @JsonProperty("status")
+    private String status = "ENABLE";
+    //字段中文名
+    @JsonProperty("title")
+    private String title;
+    public ColumnsConfigVo() {}
+    // 构造函数
+    public ColumnsConfigVo(String dataIndex, String title, String status) {
+        this.dataIndex = dataIndex;
+        this.title = title;
+        this.status = status;
+    }
+}

+ 11 - 0
fs-service/src/main/java/com/fs/live/vo/DateRange.java

@@ -0,0 +1,11 @@
+package com.fs.live.vo;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+@Data
+@AllArgsConstructor
+public class DateRange {
+    private String start;
+    private String end;
+}

+ 38 - 0
fs-service/src/main/java/com/fs/live/vo/LiveQuestionLiveVO.java

@@ -0,0 +1,38 @@
+package com.fs.live.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Data
+public class LiveQuestionLiveVO {
+    /**
+     * 主键ID
+     */
+    @TableId(type = IdType.AUTO)
+    private Long id;
+    /**
+     * 标题
+     */
+    private String title;
+    /**
+     * 题目类型 1单选 2多选
+     */
+    private Integer type;
+    /**
+     * sort
+     */
+    private Integer sort;
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime createTime;
+    /**
+     * 创建人
+     */
+    private String createBy;
+}

+ 31 - 0
fs-service/src/main/java/com/fs/live/vo/LiveWatchUserVO.java

@@ -0,0 +1,31 @@
+package com.fs.live.vo;
+
+import lombok.Data;
+
+@Data
+public class LiveWatchUserVO {
+    /**
+     * 直播间ID
+     */
+    private Long liveId;
+    /**
+     * 用户ID
+     */
+    private Long userId;
+    /**
+     * 用户名称
+     */
+    private String nickName;
+    /**
+     * 头像
+     */
+    private String avatar;
+    /**
+     * 消息状态;0正常1禁言
+     */
+    private Integer msgStatus;
+    /**
+     * 用户状态 0在线 1离线
+     */
+    private Integer online;
+}

+ 52 - 0
fs-service/src/main/java/com/fs/live/vo/RecentLiveDataVo.java

@@ -0,0 +1,52 @@
+package com.fs.live.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class RecentLiveDataVo {
+    /** 直播id */
+    private Long liveId;
+     /** 直播名称 */
+    @Excel(name = "直播名称")
+    private String liveName;
+
+    /** 直播封面 */
+    @Excel(name = "直播封面")
+    private String liveImgUrl;
+
+    /** 1待直播 2直播中 3已结束 */
+    @Excel(name = "1待直播 2直播中 3已结束")
+    private Integer status;
+
+    /** 开始时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm")
+    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:ss:mm")
+    private Date startTime;
+
+    /** 浏览量 */
+    @Excel(name = "浏览量")
+    private Long pageViews;
+
+    /** 访客数 */
+    @Excel(name = "访客数")
+    private Long uniqueVisitors;
+
+    /** 累计观看人次 */
+    @Excel(name = "累计观看人次")
+    private Long totalViews;
+
+    /** 累计观看人数 */
+    @Excel(name = "累计观看人数")
+    private Long uniqueViewers;
+
+    /** 最高在线人数 */
+    @Excel(name = "最高在线人数")
+    private Long peakConcurrentViewers;
+    /** 排名 */
+    @Excel(name = "排名")
+    private Integer rank;
+}

+ 31 - 0
fs-service/src/main/java/com/fs/live/vo/TrendDataVO.java

@@ -0,0 +1,31 @@
+package com.fs.live.vo;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class TrendDataVO {
+    private Integer views;  // 浏览量
+    private Integer visitors;  // 访客数
+    private Integer streams;  // 创建直播数
+    private Integer pv;  // 累计观看人次
+    private Integer uv;  // 累计观看人数
+
+    private Double viewsChange;  // 浏览量变化百分比
+    private Double visitorsChange;  // 访客数变化百分比
+    private Double streamsChange;  // 创建直播数变化百分比
+    private Double pvChange;  // 累计观看人次变化百分比
+    private Double uvChange;  // 累计观看人数变化百分比
+
+    //上一周期的数据
+    private Integer prevViews;  // 浏览量
+    private Integer prevVisitors;  // 访客数
+    private Integer prevStreams;  // 创建直播数
+    private Integer prevPv;  // 累计观看人次
+    private Integer prevUv;  // 累计观看人数
+
+
+    private List<String> dates;  // 日期(天/周/月)
+    private List<Integer> data;  // 对应日期的数据
+}

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

@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fs.live.mapper.LiveDataMapper">
+
+    <resultMap type="LiveData" id="LiveDataResult">
+        <result property="liveId"    column="live_id"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="pageViews"    column="page_views"    />
+        <result property="uniqueVisitors"    column="unique_visitors"    />
+        <result property="totalViews"    column="total_views"    />
+        <result property="uniqueViewers"    column="unique_viewers"    />
+        <result property="peakConcurrentViewers"    column="peak_concurrent_viewers"    />
+    </resultMap>
+
+    <sql id="selectLiveDataVo">
+        select live_id, page_views, unique_visitors, total_views, unique_viewers, peak_concurrent_viewers from
+    </sql>
+
+    <select id="selectLiveDataList" parameterType="LiveData" resultMap="LiveDataResult">
+        <include refid="selectLiveDataVo"/>
+        <where>
+            <if test="pageViews != null "> and page_views = #{pageViews}</if>
+            <if test="uniqueVisitors != null "> and unique_visitors = #{uniqueVisitors}</if>
+            <if test="totalViews != null "> and total_views = #{totalViews}</if>
+            <if test="uniqueViewers != null "> and unique_viewers = #{uniqueViewers}</if>
+            <if test="peakConcurrentViewers != null "> and peak_concurrent_viewers = #{peakConcurrentViewers}</if>
+        </where>
+    </select>
+
+    <select id="selectLiveDataByLiveId" parameterType="Long" resultMap="LiveDataResult">
+        <include refid="selectLiveDataVo"/>
+        where live_id = #{liveId}
+    </select>
+    <select id="getAllLiveIds" resultType="java.lang.Long">
+        select B.live_id from  live_data A left join live B on A.live_id = B.live_id where B.status = '2'
+    </select>
+    <select id="getRecentLive" resultType="com.fs.live.vo.RecentLiveDataVo">
+        SELECT A.page_views AS pageViews,A.unique_visitors AS uniqueVisitors, B.live_id AS liveId,B.live_name AS liveName,B.`status` AS status,B.live_img_url AS liveImgUrl,B.start_time AS startTime
+        FROM live_data A LEFT JOIN live B ON A.live_id = B.live_id ORDER BY B.start_time LIMIT 4
+    </select>
+    <select id="getLiveTop" resultType="com.fs.live.vo.RecentLiveDataVo">
+        SELECT A.page_views AS pageViews,A.unique_visitors AS uniqueVisitors,A.total_views AS totalViews,A.unique_viewers AS uniqueViewers,A.peak_concurrent_viewers AS peakConcurrentViewers,
+        B.live_name AS liveName,B.live_img_url AS liveImgUrl
+        FROM live_data A LEFT JOIN live B ON A.live_id = B.live_id
+        <choose>
+            <when test="rankType == 'highFlow'">
+                ORDER BY A.page_views DESC
+            </when>
+            <when test="rankType == 'highView'">
+                ORDER BY A.total_views DESC
+            </when>
+            <when test="rankType == 'lowFlow'">
+                ORDER BY A.page_views ASC
+            </when>
+            <when test="rankType == 'lowView'">
+                ORDER BY A.total_views ASC
+            </when>
+            <otherwise>
+                ORDER BY A.page_views DESC
+            </otherwise>
+        </choose>
+        LIMIT 10
+    </select>
+    <select id="getCurrentData" resultType="com.fs.live.vo.TrendDataVO">
+        SELECT
+            SUM(ld.page_views) AS views,
+            SUM(ld.unique_visitors) AS visitors,
+            COUNT(l.live_id) AS streams,
+            SUM(ld.total_views) AS pv,
+            SUM(ld.unique_viewers) AS uv
+            FROM live_data ld
+            JOIN live l ON ld.live_id = l.live_id
+            WHERE DATE(l.start_time) BETWEEN #{startDate} AND #{endDate};
+
+    </select>
+    <select id="getChartData" resultType="java.util.Map">
+        SELECT
+            CASE
+                WHEN #{format} = 'day' THEN DATE(l.start_time)
+                WHEN #{format} = 'week' THEN
+                CONCAT(
+                DATE_FORMAT(DATE_SUB(l.start_time, INTERVAL WEEKDAY(l.start_time) DAY), '%m/%d'),
+                '-',
+                DATE_FORMAT(DATE_ADD(l.start_time, INTERVAL (6 - WEEKDAY(l.start_time)) DAY), '%m/%d')
+                )
+                WHEN #{format} = 'month' THEN DATE_FORMAT(l.start_time, '%Y-%m')
+                END AS date_range,
+        <choose>
+            <when test="category == 'streams'"> COUNT(l.live_id) </when>
+            <otherwise> SUM(ld.${category}) </otherwise>
+        </choose>
+         AS views
+            FROM live_data ld
+            LEFT JOIN live l ON ld.live_id = l.live_id
+            WHERE DATE(l.start_time) BETWEEN #{chartStartDate} AND #{chartEndDate}
+            GROUP BY date_range
+            ORDER BY date_range;
+    </select>
+    <select id="getPreviousData" resultType="com.fs.live.vo.TrendDataVO">
+        SELECT
+            SUM(ld.page_views) AS prevViews,
+            SUM(ld.unique_visitors) AS prevVisitors,
+            COUNT(l.live_id) AS prevStreams,
+            SUM(ld.total_views) AS prevPv,
+            SUM(ld.unique_viewers) AS prevUv
+            FROM live_data ld
+            LEFT JOIN live l ON ld.live_id = l.live_id
+            WHERE DATE(l.start_time) BETWEEN #{prevStartDate} AND #{prevStartDate};
+    </select>
+
+    <insert id="insertLiveData" parameterType="LiveData">
+        insert into live_data
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="liveId != null">live_id,</if>
+            <if test="pageViews != null">page_views,</if>
+            <if test="uniqueVisitors != null">unique_visitors,</if>
+            <if test="totalViews != null">total_views,</if>
+            <if test="uniqueViewers != null">unique_viewers,</if>
+            <if test="peakConcurrentViewers != null">peak_concurrent_viewers,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="liveId != null">#{liveId},</if>
+            <if test="pageViews != null">#{pageViews},</if>
+            <if test="uniqueVisitors != null">#{uniqueVisitors},</if>
+            <if test="totalViews != null">#{totalViews},</if>
+            <if test="uniqueViewers != null">#{uniqueViewers},</if>
+            <if test="peakConcurrentViewers != null">#{peakConcurrentViewers},</if>
+         </trim>
+    </insert>
+
+    <update id="updateLiveData" parameterType="LiveData">
+        update live_data
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="pageViews != null">page_views = #{pageViews},</if>
+            <if test="uniqueVisitors != null">unique_visitors = #{uniqueVisitors},</if>
+            <if test="totalViews != null">total_views = #{totalViews},</if>
+            <if test="uniqueViewers != null">unique_viewers = #{uniqueViewers},</if>
+            <if test="peakConcurrentViewers != null">peak_concurrent_viewers = #{peakConcurrentViewers},</if>
+        </trim>
+        where live_id = #{liveId}
+    </update>
+
+    <delete id="deleteLiveDataByLiveId" parameterType="Long">
+        delete from live_data where live_id = #{liveId}
+    </delete>
+
+    <delete id="deleteLiveDataByLiveIds" parameterType="String">
+        delete from live_data where live_id in
+        <foreach item="liveId" collection="array" open="(" separator="," close=")">
+            #{liveId}
+        </foreach>
+    </delete>
+</mapper>

+ 15 - 2
fs-service/src/main/resources/mapper/live/LiveGoodsMapper.xml

@@ -7,6 +7,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap type="LiveGoods" id="LiveGoodsResult">
         <result property="goodsId"    column="goods_id"    />
         <result property="liveId"    column="live_id"    />
+        <result property="companyId"    column="company_id"    />
+        <result property="companyUserId"    column="company_user_id"    />
         <result property="goodsName"    column="goods_name"    />
         <result property="goodsDesc"    column="goods_desc"    />
         <result property="imgUrl"    column="img_url"    />
@@ -24,13 +26,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectLiveGoodsVo">
-        select goods_id, live_id, goods_name, goods_desc, img_url, images, price, op_price, status, stock, sort, create_time, create_by, update_by, update_time, remark from live_goods
+        select goods_id, live_id, company_id, company_user_id, goods_name, goods_desc, img_url, images, price, op_price, status, stock, sort, create_time, create_by, update_by, update_time, remark from live_goods
     </sql>
 
     <select id="selectLiveGoodsList" parameterType="LiveGoods" resultMap="LiveGoodsResult">
         <include refid="selectLiveGoodsVo"/>
         <where>  
             <if test="liveId != null "> and live_id = #{liveId}</if>
+            <if test="companyId != null "> and company_id = #{companyId}</if>
+            <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
             <if test="goodsName != null  and goodsName != ''"> and goods_name like concat('%', #{goodsName}, '%')</if>
             <if test="goodsDesc != null  and goodsDesc != ''"> and goods_desc = #{goodsDesc}</if>
             <if test="imgUrl != null  and imgUrl != ''"> and img_url = #{imgUrl}</if>
@@ -47,11 +51,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectLiveGoodsVo"/>
         where goods_id = #{goodsId}
     </select>
-        
+
+    <select id="selectLiveGoodsByGoodsIdAndCompanyIdAndCompanyUserId" resultMap="LiveGoodsResult">
+        <include refid="selectLiveGoodsVo"/>
+        where goods_id = #{goodsId} and company_id = #{companyId} and company_user_id = #{companyUserId}
+    </select>
+
     <insert id="insertLiveGoods" parameterType="LiveGoods" useGeneratedKeys="true" keyProperty="goodsId">
         insert into live_goods
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="liveId != null">live_id,</if>
+            <if test="companyId != null">company_id,</if>
+            <if test="companyUserId != null">company_user_id,</if>
             <if test="goodsName != null">goods_name,</if>
             <if test="goodsDesc != null">goods_desc,</if>
             <if test="imgUrl != null">img_url,</if>
@@ -69,6 +80,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="liveId != null">#{liveId},</if>
+            <if test="companyId != null">#{companyId},</if>
+            <if test="companyUserId != null">#{companyUserId},</if>
             <if test="goodsName != null">#{goodsName},</if>
             <if test="goodsDesc != null">#{goodsDesc},</if>
             <if test="imgUrl != null">#{imgUrl},</if>

+ 15 - 2
fs-service/src/main/resources/mapper/live/LiveGoodsOrderItemsMapper.xml

@@ -8,6 +8,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="id"    column="id"    />
         <result property="goodsId"    column="goods_id"    />
         <result property="orderId"    column="order_id"    />
+        <result property="companyId"    column="company_id"    />
+        <result property="companyUserId"    column="company_user_id"    />
         <result property="goodsJson"    column="goods_json"    />
         <result property="goodsName"    column="goods_name"    />
         <result property="price"    column="price"    />
@@ -21,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectLiveGoodsOrderItemsVo">
-        select id, goods_id, order_id, goods_json, goods_name, price, num, status, create_time, create_by, update_by, update_time, remark from live_goods_order_items
+        select id, goods_id, order_id, company_id, company_user_id, goods_json, goods_name, price, num, status, create_time, create_by, update_by, update_time, remark from live_goods_order_items
     </sql>
 
     <select id="selectLiveGoodsOrderItemsList" parameterType="LiveGoodsOrderItems" resultMap="LiveGoodsOrderItemsResult">
@@ -29,6 +31,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>  
             <if test="goodsId != null "> and goods_id = #{goodsId}</if>
             <if test="orderId != null "> and order_id = #{orderId}</if>
+            <if test="companyId != null "> and company_id = #{companyId}</if>
+            <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
             <if test="goodsJson != null  and goodsJson != ''"> and goods_json = #{goodsJson}</if>
             <if test="goodsName != null  and goodsName != ''"> and goods_name like concat('%', #{goodsName}, '%')</if>
             <if test="price != null "> and price = #{price}</if>
@@ -41,12 +45,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectLiveGoodsOrderItemsVo"/>
         where id = #{id}
     </select>
-        
+
+    <select id="selectLiveGoodsOrderItemsByIdAndCompanyIdAndCompanyUserId" resultMap="LiveGoodsOrderItemsResult">
+        <include refid="selectLiveGoodsOrderItemsVo"/>
+        where id = #{id} and company_id = #{companyId} and company_user_id = #{companyUserId}
+    </select>
+
     <insert id="insertLiveGoodsOrderItems" parameterType="LiveGoodsOrderItems" useGeneratedKeys="true" keyProperty="id">
         insert into live_goods_order_items
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="goodsId != null">goods_id,</if>
             <if test="orderId != null">order_id,</if>
+            <if test="companyId != null">company_id,</if>
+            <if test="companyUserId != null">company_user_id,</if>
             <if test="goodsJson != null">goods_json,</if>
             <if test="goodsName != null">goods_name,</if>
             <if test="price != null">price,</if>
@@ -61,6 +72,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="goodsId != null">#{goodsId},</if>
             <if test="orderId != null">#{orderId},</if>
+            <if test="companyId != null">#{companyId},</if>
+            <if test="companyUserId != null">#{companyUserId},</if>
             <if test="goodsJson != null">#{goodsJson},</if>
             <if test="goodsName != null">#{goodsName},</if>
             <if test="price != null">#{price},</if>

+ 16 - 3
fs-service/src/main/resources/mapper/live/LiveGoodsOrderMapper.xml

@@ -6,6 +6,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     
     <resultMap type="LiveGoodsOrder" id="LiveGoodsOrderResult">
         <result property="orderId"    column="order_id"    />
+        <result property="companyId"    column="company_id"    />
+        <result property="companyUserId"    column="company_user_id"    />
         <result property="orderSn"    column="order_sn"    />
         <result property="userId"    column="user_id"    />
         <result property="userName"    column="user_name"    />
@@ -27,12 +29,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectLiveGoodsOrderVo">
-        select order_id, order_sn, user_id, user_name, mobile, address, pay_money, order_money, delivery_code, delivery_name, delivery_sn, pay_time, finish_time, status, create_time, create_by, update_by, update_time, remark from live_goods_order
+        select order_id, company_id, company_user_id, order_sn, user_id, user_name, mobile, address, pay_money, order_money, delivery_code, delivery_name, delivery_sn, pay_time, finish_time, status, create_time, create_by, update_by, update_time, remark from live_goods_order
     </sql>
 
     <select id="selectLiveGoodsOrderList" parameterType="LiveGoodsOrder" resultMap="LiveGoodsOrderResult">
         <include refid="selectLiveGoodsOrderVo"/>
-        <where>  
+        <where>
+            <if test="companyId != null "> and company_id = #{companyId}</if>
+            <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
             <if test="orderSn != null  and orderSn != ''"> and order_sn = #{orderSn}</if>
             <if test="userId != null "> and user_id = #{userId}</if>
             <if test="userName != null  and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
@@ -53,11 +57,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectLiveGoodsOrderVo"/>
         where order_id = #{orderId}
     </select>
-        
+
+    <select id="selectLiveGoodsOrderByOrderIdAndCompanyIdAndCompanyUserId" resultMap="LiveGoodsOrderResult">
+        <include refid="selectLiveGoodsOrderVo"/>
+        where order_id = #{orderId} and company_id = #{companyId} and company_user_id = #{companyUserId}
+    </select>
+
     <insert id="insertLiveGoodsOrder" parameterType="LiveGoodsOrder">
         insert into live_goods_order
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="orderId != null">order_id,</if>
+            <if test="companyId != null">company_id,</if>
+            <if test="companyUserId != null">company_user_id,</if>
             <if test="orderSn != null">order_sn,</if>
             <if test="userId != null">user_id,</if>
             <if test="userName != null">user_name,</if>
@@ -79,6 +90,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="orderId != null">#{orderId},</if>
+            <if test="companyId != null">#{companyId},</if>
+            <if test="companyUserId != null">#{companyUserId},</if>
             <if test="orderSn != null">#{orderSn},</if>
             <if test="userId != null">#{userId},</if>
             <if test="userName != null">#{userName},</if>

+ 29 - 3
fs-service/src/main/resources/mapper/live/LiveMapper.xml

@@ -6,6 +6,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     
     <resultMap type="Live" id="LiveResult">
         <result property="liveId"    column="live_id"    />
+        <result property="companyId"    column="company_id"    />
+        <result property="companyUserId"    column="company_user_id"    />
         <result property="liveName"    column="live_name"    />
         <result property="liveDesc"    column="live_desc"    />
         <result property="showType"    column="show_type"    />
@@ -28,12 +30,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectLiveVo">
-        select live_id, live_name, live_desc, show_type, status, anchor_id, live_type, start_time, finish_time, live_img_url, live_config, is_show, is_del, qw_qr_code, rtmp_url, create_time, create_by, update_by, update_time, remark from live
+        select live_id, company_id, company_user_id, live_name, live_desc, show_type, status, anchor_id, live_type, start_time, finish_time, live_img_url, live_config, is_show, is_del, qw_qr_code, rtmp_url, create_time, create_by, update_by, update_time, remark from live
     </sql>
 
     <select id="selectLiveList" parameterType="Live" resultMap="LiveResult">
         <include refid="selectLiveVo"/>
-        <where>  
+        <where>
+            <if test="companyId != null "> and company_id = #{companyId}</if>
+            <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
             <if test="liveName != null  and liveName != ''"> and live_name like concat('%', #{liveName}, '%')</if>
             <if test="liveDesc != null  and liveDesc != ''"> and live_desc = #{liveDesc}</if>
             <if test="showType != null "> and show_type = #{showType}</if>
@@ -55,10 +59,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectLiveVo"/>
         where live_id = #{liveId}
     </select>
-        
+
+    <select id="selectLiveByLiveIdAndCompanyIdAndCompanyUserId" resultMap="LiveResult">
+        <include refid="selectLiveVo"/>
+        where live_id = #{liveId} and company_id = #{companyId} and company_user_id = #{companyUserId}
+    </select>
+    <select id="selectLiveToStudent" resultType="com.fs.live.domain.Live">
+        <include refid="selectLiveVo"/>
+        where 1=1
+        <if test="status != null and status != ''">
+            AND status = #{status}
+        </if>
+        <if test="liveName != null and liveName != null">
+            AND live_name like concat('%', #{liveName}, '%')
+        </if>
+        <if test="startTime != null and startTime != '' and finishTime != null  and finishTime != ''">
+            AND start_time BETWEEN #{startTime} AND #{finishTime}
+        </if>
+    </select>
+
     <insert id="insertLive" parameterType="Live" useGeneratedKeys="true" keyProperty="liveId">
         insert into live
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="companyId != null">company_id,</if>
+            <if test="companyUserId != null">company_user_id,</if>
             <if test="liveName != null">live_name,</if>
             <if test="liveDesc != null">live_desc,</if>
             <if test="showType != null">show_type,</if>
@@ -80,6 +104,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="remark != null">remark,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="companyId != null">#{companyId},</if>
+            <if test="companyUserId != null">#{companyUserId},</if>
             <if test="liveName != null">#{liveName},</if>
             <if test="liveDesc != null">#{liveDesc},</if>
             <if test="showType != null">#{showType},</if>

+ 7 - 2
fs-service/src/main/resources/mapper/live/LiveMsgMapper.xml

@@ -17,7 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectLiveMsgVo">
-        select msg_id, live_id, user_id, msg, create_time, create_by, update_by, update_time, remark from live_msg
+        select msg_id, live_id,user_id, nick_name, avatar, msg, create_time, create_by, update_by, update_time, remark from live_msg
     </sql>
 
     <select id="selectLiveMsgList" parameterType="LiveMsg" resultMap="LiveMsgResult">
@@ -33,7 +33,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectLiveMsgVo"/>
         where msg_id = #{msgId}
     </select>
-        
+
+    <select id="selectLiveMsgByMsgIdAndCompanyIdAndCompanyUserId" resultMap="LiveMsgResult">
+        <include refid="selectLiveMsgVo"/>
+        where msg_id = #{msgId} and company_id = #{companyId} and company_user_id = #{companyUserId}
+    </select>
+
     <insert id="insertLiveMsg" parameterType="LiveMsg" useGeneratedKeys="true" keyProperty="msgId">
         insert into live_msg
         <trim prefix="(" suffix=")" suffixOverrides=",">

+ 7 - 0
fs-service/src/main/resources/mapper/live/LiveQuestionBankMapper.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fs.live.mapper.LiveQuestionBankMapper">
+
+</mapper>

+ 35 - 0
fs-service/src/main/resources/mapper/live/LiveQuestionLiveMapper.xml

@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fs.live.mapper.LiveQuestionLiveMapper">
+
+    <select id="selectLiveQuestionLiveList" resultType="com.fs.live.vo.LiveQuestionLiveVO">
+        select
+            ql.id,
+            qb.title,
+            qb.type,
+            ql.sort,
+            ql.create_time,
+            ql.create_by
+        from live_question_live ql
+        left join live_question_bank qb on ql.question_id = qb.id
+        where ql.live_id = #{liveId}
+    </select>
+
+    <select id="selectLiveQuestionOptionList" resultType="com.fs.live.vo.LiveQuestionLiveVO">
+        select
+            qb.id,
+            qb.title,
+            qb.type,
+            qb.sort,
+            qb.create_time,
+            qb.create_by
+        from live_question_bank qb
+        left join live_question_live ql on ql.question_id = qb.id and ql.live_id = #{liveId}
+        where ql.question_id is null
+        <if test="title != null and title != ''">
+            and qb.title like concat('%', #{title}, '%')
+        </if>
+    </select>
+</mapper>

+ 15 - 2
fs-service/src/main/resources/mapper/live/LiveQuestionMapper.xml

@@ -6,6 +6,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     
     <resultMap type="LiveQuestion" id="LiveQuestionResult">
         <result property="questionId"    column="question_id"    />
+        <result property="companyId"    column="company_id"    />
+        <result property="companyUserId"    column="company_user_id"    />
         <result property="userId"    column="user_id"    />
         <result property="question"    column="question"    />
         <result property="reply"    column="reply"    />
@@ -18,13 +20,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectLiveQuestionVo">
-        select question_id, user_id, question, reply, reply_time, create_time, create_by, update_by, update_time, remark from live_question
+        select question_id, company_id, company_user_id, user_id, question, reply, reply_time, create_time, create_by, update_by, update_time, remark from live_question
     </sql>
 
     <select id="selectLiveQuestionList" parameterType="LiveQuestion" resultMap="LiveQuestionResult">
         <include refid="selectLiveQuestionVo"/>
         <where>  
             <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="companyId != null "> and company_id = #{companyId}</if>
+            <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
             <if test="question != null  and question != ''"> and question = #{question}</if>
             <if test="reply != null  and reply != ''"> and reply = #{reply}</if>
             <if test="replyTime != null "> and reply_time = #{replyTime}</if>
@@ -35,10 +39,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectLiveQuestionVo"/>
         where question_id = #{questionId}
     </select>
-        
+
+    <select id="selectLiveQuestionByQuestionIdAndCompanyIdAndCompanyUserId" resultMap="LiveQuestionResult">
+        <include refid="selectLiveQuestionVo"/>
+        where question_id = #{questionId} and company_id = #{companyId} and company_user_id = #{companyUserId}
+    </select>
+
     <insert id="insertLiveQuestion" parameterType="LiveQuestion" useGeneratedKeys="true" keyProperty="questionId">
         insert into live_question
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="companyId != null">company_id,</if>
+            <if test="companyUserId != null">company_user_id,</if>
             <if test="userId != null">user_id,</if>
             <if test="question != null">question,</if>
             <if test="reply != null">reply,</if>
@@ -50,6 +61,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="remark != null">remark,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="companyId != null">#{companyId},</if>
+            <if test="companyUserId != null">#{companyUserId},</if>
             <if test="userId != null">#{userId},</if>
             <if test="question != null">#{question},</if>
             <if test="reply != null">#{reply},</if>

+ 7 - 0
fs-service/src/main/resources/mapper/live/LiveQuestionUserLogMapper.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fs.live.mapper.LiveQuestionUserLogMapper">
+
+</mapper>

+ 152 - 0
fs-service/src/main/resources/mapper/live/LiveStudentDataMapper.xml

@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fs.live.mapper.LiveStudentDataMapper">
+    
+    <resultMap type="LiveStudentData" id="LiveStudentDataResult">
+        <result property="liveId"    column="live_id"    />
+        <result property="liveName"    column="live_name"    />
+        <result property="userId"    column="user_id"    />
+        <result property="userName"    column="user_name"    />
+        <result property="deptId"    column="dept_id"    />
+        <result property="userPhone"    column="user_phone"    />
+        <result property="userCreateTime"    column="user_create_time"    />
+        <result property="shareCount"    column="share_count"    />
+        <result property="deptName"    column="dept_name"    />
+        <result property="companyUserName"    column="company_user_name"    />
+        <result property="companyUserId"    column="company_user_id"    />
+    </resultMap>
+
+    <sql id="selectLiveStudentDataVo">
+        select live_id, live_name, user_id, user_name, dept_id, user_phone, user_create_time, share_count, dept_name, company_user_name, company_user_id from live_student_data
+    </sql>
+
+    <select id="selectLiveStudentDataList" parameterType="LiveStudentData" resultMap="LiveStudentDataResult">
+        <include refid="selectLiveStudentDataVo"/>
+        <where>  
+            <if test="liveName != null  and liveName != ''"> and live_name like concat('%', #{liveName}, '%')</if>
+            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="userName != null  and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
+            <if test="deptId != null "> and dept_id = #{deptId}</if>
+            <if test="userPhone != null  and userPhone != ''"> and user_phone = #{userPhone}</if>
+            <if test="userCreateTime != null "> and user_create_time = #{userCreateTime}</if>
+            <if test="shareCount != null "> and share_count = #{shareCount}</if>
+            <if test="deptName != null  and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
+            <if test="compayUserName != null  and compayUserName != ''"> and company_user_name like concat('%', #{compayUserName}, '%')</if>
+            <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
+        </where>
+    </select>
+    
+    <select id="selectLiveStudentDataByLiveId" parameterType="Long" resultMap="LiveStudentDataResult">
+        <include refid="selectLiveStudentDataVo"/>
+        where live_id = #{liveId}
+    </select>
+    <select id="queryStudentData" resultType="com.fs.live.domain.LiveStudentData">
+        SELECT
+        A.user_name AS userName,
+        A.user_phone AS userPhone,
+        A.dept_name AS deptName,
+        A.live_name AS liveName,
+        A.company_user_name AS companyUserName,
+        A.share_count AS shareCount,
+        A.user_create_time AS userCreateTime,
+        COUNT(C.user_id) AS questionCount,
+        COUNT(B.user_id) AS goodsCount
+        FROM live_student_data A
+        LEFT JOIN live_goods_order B ON A.user_id = B.user_id
+        LEFT JOIN live_question C ON A.user_id = C.user_id
+        WHERE 1=1
+        <if test="param.liveIds != null and param.liveIds.length > 0">
+            AND A.live_id IN
+            <foreach collection="param.liveIds" item="id" open="(" separator="," close=")">
+                #{id}
+            </foreach>
+        </if>
+        <if test="param.userName != null and param.userName != ''">
+            AND A.user_name LIKE CONCAT('%', #{param.userName}, '%')
+        </if>
+        <if test="param.userPhone != null and param.userPhone != ''">
+            AND A.user_phone LIKE CONCAT('%', #{param.userPhone}, '%')
+        </if>
+        <if test="param.deptId != null and param.deptId != ''">
+            AND A.dept_id = #{param.deptId}
+        </if>
+        <if test="param.companyUserName != null and param.companyUserName != ''">
+            AND A.company_user_name LIKE CONCAT('%', #{param.companyUserName}, '%')
+        </if>
+        <if test="param.startTime != null and param.startTime != '' and param.finishTime != null and param.finishTime != ''">
+            AND A.user_create_time BETWEEN #{param.startTime} AND #{param.finishTime}
+        </if>
+        GROUP BY A.user_id
+        <if test="param.maxQuestionCount != null and param.maxQuestionCount > 0">
+            HAVING
+            <if test="param.minQuestionCount != null">
+                COUNT(C.user_id) >= #{param.minQuestionCount}
+            </if>
+            <if test="param.maxQuestionCount != null and param.maxQuestionCount > 0">
+                <if test="param.minQuestionCount != null">
+                    AND
+                </if>
+                COUNT(C.user_id) &lt; #{param.maxQuestionCount}
+            </if>
+        </if>
+    </select>
+    <insert id="insertLiveStudentData" parameterType="LiveStudentData">
+        insert into live_student_data
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="liveId != null">live_id,</if>
+            <if test="liveName != null">live_name,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="userName != null">user_name,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="userPhone != null">user_phone,</if>
+            <if test="userCreateTime != null">user_create_time,</if>
+            <if test="shareCount != null">share_count,</if>
+            <if test="deptName != null">dept_name,</if>
+            <if test="compayUserName != null">company_user_name,</if>
+            <if test="companyUserId != null">company_user_id,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="liveId != null">#{liveId},</if>
+            <if test="liveName != null">#{liveName},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="userName != null">#{userName},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="userPhone != null">#{userPhone},</if>
+            <if test="userCreateTime != null">#{userCreateTime},</if>
+            <if test="shareCount != null">#{shareCount},</if>
+            <if test="deptName != null">#{deptName},</if>
+            <if test="compayUserName != null">#{compayUserName},</if>
+            <if test="companyUserId != null">#{companyUserId},</if>
+         </trim>
+    </insert>
+
+    <update id="updateLiveStudentData" parameterType="LiveStudentData">
+        update live_student_data
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="liveName != null">live_name = #{liveName},</if>
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="userName != null">user_name = #{userName},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="userPhone != null">user_phone = #{userPhone},</if>
+            <if test="userCreateTime != null">user_create_time = #{userCreateTime},</if>
+            <if test="shareCount != null">share_count = #{shareCount},</if>
+            <if test="deptName != null">dept_name = #{deptName},</if>
+            <if test="compayUserName != null">company_user_name = #{compayUserName},</if>
+            <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
+        </trim>
+        where live_id = #{liveId}
+    </update>
+
+    <delete id="deleteLiveStudentDataByLiveId" parameterType="Long">
+        delete from live_student_data where live_id = #{liveId}
+    </delete>
+
+    <delete id="deleteLiveStudentDataByLiveIds" parameterType="String">
+        delete from live_student_data where live_id in 
+        <foreach item="liveId" collection="array" open="(" separator="," close=")">
+            #{liveId}
+        </foreach>
+    </delete>
+</mapper>

+ 5 - 1
fs-service/src/main/resources/mapper/live/LiveVideoMapper.xml

@@ -35,7 +35,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectLiveVideoVo"/>
         where video_id = #{videoId}
     </select>
-        
+    <select id="selectLiveVideoByVideoIdAndCompanyIdAndCompanyUserId" resultMap="LiveVideoResult">
+        <include refid="selectLiveVideoVo"/>
+        where video_id = #{videoId} and company_id = #{companyId} and company_user_id = #{companyUserId}
+    </select>
+
     <insert id="insertLiveVideo" parameterType="LiveVideo" useGeneratedKeys="true" keyProperty="videoId">
         insert into live_video
         <trim prefix="(" suffix=")" suffixOverrides=",">

+ 33 - 2
fs-service/src/main/resources/mapper/live/LiveWatchUserMapper.xml

@@ -18,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectLiveWatchUserVo">
-        select id, live_id, user_id, msg_status, online, create_time, create_by, update_by, update_time, remark from live_watch_user
+        select id, live_id,user_id, msg_status, online, create_time, create_by, update_by, update_time, remark from live_watch_user
     </sql>
 
     <select id="selectLiveWatchUserList" parameterType="LiveWatchUser" resultMap="LiveWatchUserResult">
@@ -35,7 +35,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectLiveWatchUserVo"/>
         where id = #{id}
     </select>
-        
+
+    <select id="selectWatchUserListByLiveId" resultType="com.fs.live.vo.LiveWatchUserVO">
+        select
+            lwu.live_id     liveId,
+            lwu.user_id     userId,
+            lwu.msg_status  msgStatus,
+            lwu.online      online,
+            fu.nick_name    nickName,
+            fu.avatar       avatar
+        from live_watch_user lwu
+        left join fs_user fu on lwu.user_id = fu.user_id
+        where lwu.live_id = #{params.liveId}
+    </select>
+
+    <select id="selectLiveWatchUserByIdAndCompanyIdAndCompanyUserId" resultMap="LiveWatchUserResult">
+        <include refid="selectLiveWatchUserVo"/>
+        where id = #{id} and company_id = #{companyId} and company_user_id = #{companyUserId}
+    </select>
+
+    <select id="selectWatchUserByLiveIdAndUserId" resultType="com.fs.live.vo.LiveWatchUserVO">
+        select
+            lwu.live_id     liveId,
+            lwu.user_id     userId,
+            lwu.msg_status  msgStatus,
+            lwu.online      online,
+            fu.nick_name    nickName,
+            fu.avatar       avatar
+        from live_watch_user lwu
+        left join fs_user fu on lwu.user_id = fu.user_id
+        where lwu.live_id = #{liveId} and lwu.user_id = #{userId}
+    </select>
+
     <insert id="insertLiveWatchUser" parameterType="LiveWatchUser" useGeneratedKeys="true" keyProperty="id">
         insert into live_watch_user
         <trim prefix="(" suffix=")" suffixOverrides=",">