Bläddra i källkod

直播代码提交

yuhongqi 20 timmar sedan
förälder
incheckning
0d15c7421d
100 ändrade filer med 8620 tillägg och 1262 borttagningar
  1. 176 0
      fs-admin/src/main/java/com/fs/live/controller/LiveAfterSalesController.java
  2. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveAfterSalesItemController.java
  3. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveAfterSalesLogsController.java
  4. 8 14
      fs-admin/src/main/java/com/fs/live/controller/LiveAnchorController.java
  5. 217 0
      fs-admin/src/main/java/com/fs/live/controller/LiveAutoTaskController.java
  6. 98 0
      fs-admin/src/main/java/com/fs/live/controller/LiveCartController.java
  7. 97 29
      fs-admin/src/main/java/com/fs/live/controller/LiveController.java
  8. 211 0
      fs-admin/src/main/java/com/fs/live/controller/LiveCouponController.java
  9. 103 0
      fs-admin/src/main/java/com/fs/live/controller/LiveCouponIssueController.java
  10. 103 0
      fs-admin/src/main/java/com/fs/live/controller/LiveCouponIssueUserController.java
  11. 105 0
      fs-admin/src/main/java/com/fs/live/controller/LiveCouponUserController.java
  12. 81 0
      fs-admin/src/main/java/com/fs/live/controller/LiveDataController.java
  13. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveEventConfController.java
  14. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveGiftController.java
  15. 91 29
      fs-admin/src/main/java/com/fs/live/controller/LiveGoodsController.java
  16. 0 103
      fs-admin/src/main/java/com/fs/live/controller/LiveGoodsOrderController.java
  17. 0 103
      fs-admin/src/main/java/com/fs/live/controller/LiveGoodsOrderItemsController.java
  18. 143 0
      fs-admin/src/main/java/com/fs/live/controller/LiveLotteryConfController.java
  19. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveLotteryRecordController.java
  20. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveLotteryRegistrationController.java
  21. 14 20
      fs-admin/src/main/java/com/fs/live/controller/LiveMsgController.java
  22. 434 0
      fs-admin/src/main/java/com/fs/live/controller/LiveOrderController.java
  23. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveOrderItemController.java
  24. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveOrderLogsController.java
  25. 113 0
      fs-admin/src/main/java/com/fs/live/controller/LiveOrderPaymentController.java
  26. 0 103
      fs-admin/src/main/java/com/fs/live/controller/LiveQuestionController.java
  27. 125 0
      fs-admin/src/main/java/com/fs/live/controller/LiveRedConfController.java
  28. 4 0
      fs-admin/src/main/java/com/fs/live/controller/LiveRedController.java
  29. 125 0
      fs-admin/src/main/java/com/fs/live/controller/LiveRewardRecordController.java
  30. 98 0
      fs-admin/src/main/java/com/fs/live/controller/LiveSensitiveWordsController.java
  31. 122 0
      fs-admin/src/main/java/com/fs/live/controller/LiveTrafficLogController.java
  32. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveUserFavoriteController.java
  33. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveUserFollowController.java
  34. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveUserLikeController.java
  35. 108 0
      fs-admin/src/main/java/com/fs/live/controller/LiveUserLotteryRecordController.java
  36. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveUserRedRecordController.java
  37. 33 20
      fs-admin/src/main/java/com/fs/live/controller/LiveVideoController.java
  38. 102 0
      fs-admin/src/main/java/com/fs/live/controller/LiveWatchConfigController.java
  39. 48 20
      fs-admin/src/main/java/com/fs/live/controller/LiveWatchUserController.java
  40. 183 0
      fs-admin/src/main/java/com/fs/task/LiveTask.java
  41. 29 0
      fs-common/src/main/java/com/fs/common/constant/LiveKeysConstant.java
  42. 20 0
      fs-common/src/main/java/com/fs/common/core/page/PageRequest.java
  43. 150 0
      fs-common/src/main/java/com/fs/common/core/redis/RedisCache.java
  44. 64 0
      fs-common/src/main/java/com/fs/common/utils/DateUtils.java
  45. 101 9
      fs-common/src/main/java/com/fs/common/utils/http/HttpUtils.java
  46. 9 0
      fs-company/src/main/java/com/fs/company/controller/common/CommonController.java
  47. 129 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveAfterSalesController.java
  48. 121 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveAnchorController.java
  49. 217 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveAutoTaskController.java
  50. 97 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveCartController.java
  51. 361 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveController.java
  52. 209 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveCouponController.java
  53. 158 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveDataController.java
  54. 97 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveGiftController.java
  55. 164 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveGoodsController.java
  56. 143 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveLotteryConfController.java
  57. 97 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveLotteryRecordController.java
  58. 97 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveLotteryRegistrationController.java
  59. 100 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveMsgController.java
  60. 395 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveOrderController.java
  61. 97 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveOrderItemController.java
  62. 97 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveOrderLogsController.java
  63. 34 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveProfitController.java
  64. 125 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveRedConfController.java
  65. 126 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveRewardRecordController.java
  66. 98 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveSensitiveWordsController.java
  67. 97 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveUserFavoriteController.java
  68. 97 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveUserFirstEntryController.java
  69. 97 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveUserFollowController.java
  70. 97 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveUserLikeController.java
  71. 108 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveUserLotteryRecordController.java
  72. 116 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveVideoController.java
  73. 102 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveWatchConfigController.java
  74. 132 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveWatchUserController.java
  75. 1 1
      fs-company/src/main/resources/application.yml
  76. 1 1
      fs-live-app/src/main/java/com/fs/FsLiveAppApplication.java
  77. 0 22
      fs-live-app/src/main/java/com/fs/app/controller/AppBaseController.java
  78. 0 43
      fs-live-app/src/main/java/com/fs/app/controller/CommonController.java
  79. 0 85
      fs-live-app/src/main/java/com/fs/app/controller/LiveController.java
  80. 0 168
      fs-live-app/src/main/java/com/fs/app/controller/UserController.java
  81. 0 63
      fs-live-app/src/main/java/com/fs/app/interceptor/AuthorizationInterceptor.java
  82. 0 13
      fs-live-app/src/main/java/com/fs/app/param/CompanyWxListParam.java
  83. 0 13
      fs-live-app/src/main/java/com/fs/app/param/LoginParam.java
  84. 0 19
      fs-live-app/src/main/java/com/fs/app/param/SendSopParam.java
  85. 0 29
      fs-live-app/src/main/java/com/fs/app/param/SopLogsEditParam.java
  86. 0 31
      fs-live-app/src/main/java/com/fs/app/resolver/LoginUserHandlerMethodArgumentResolver.java
  87. 0 36
      fs-live-app/src/main/java/com/fs/app/task/Task.java
  88. 0 47
      fs-live-app/src/main/java/com/fs/app/vo/LiveVo.java
  89. 0 29
      fs-live-app/src/main/java/com/fs/app/vo/UserListVO.java
  90. 0 49
      fs-live-app/src/main/java/com/fs/app/vo/UserVO.java
  91. 0 141
      fs-live-app/src/main/java/com/fs/app/websocket/service/WebSocketServer.java
  92. 89 0
      fs-live-app/src/main/java/com/fs/framework/aspectj/LiveWatchUserAspect.java
  93. 58 0
      fs-live-app/src/main/java/com/fs/framework/aspectj/lock/DistributeLock.java
  94. 113 0
      fs-live-app/src/main/java/com/fs/framework/aspectj/lock/DistributeLockAspect.java
  95. 13 0
      fs-live-app/src/main/java/com/fs/framework/aspectj/lock/DistributeLockConstant.java
  96. 24 0
      fs-live-app/src/main/java/com/fs/framework/aspectj/lock/DistributeLockException.java
  97. 0 20
      fs-live-app/src/main/java/com/fs/framework/config/WebSocketConfig.java
  98. 1 1
      fs-live-app/src/main/java/com/fs/live/annotation/Login.java
  99. 1 1
      fs-live-app/src/main/java/com/fs/live/annotation/LoginUser.java
  100. 32 0
      fs-live-app/src/main/java/com/fs/live/config/LiveWebSocketConfig.java

+ 176 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveAfterSalesController.java

@@ -0,0 +1,176 @@
+package com.fs.live.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.domain.model.LoginUser;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.ParseUtils;
+import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.framework.web.service.TokenService;
+import com.fs.his.domain.FsUser;
+import com.fs.his.service.IFsUserService;
+import com.fs.live.domain.LiveAfterSales;
+import com.fs.live.domain.LiveAfterSalesItem;
+import com.fs.live.domain.LiveAfterSalesLogs;
+import com.fs.live.domain.LiveOrder;
+import com.fs.live.param.LiveAfterSalesAudit1Param;
+import com.fs.live.param.LiveAfterSalesAudit2Param;
+import com.fs.live.param.LiveAfterSalesCancelParam;
+import com.fs.live.param.LiveAfterSalesRefundParam;
+import com.fs.live.service.ILiveAfterSalesItemService;
+import com.fs.live.service.ILiveAfterSalesLogsService;
+import com.fs.live.service.ILiveAfterSalesService;
+import com.fs.live.service.ILiveOrderService;
+import com.fs.live.vo.LiveAfterSalesVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.text.ParseException;
+import java.util.List;
+
+/**
+ * 售后记录Controller
+ *
+ * @author fs
+ * @date 2025-07-08
+ */
+@RestController
+@RequestMapping("/live/liveAfterSales")
+public class LiveAfterSalesController extends BaseController
+{
+    @Autowired
+    private ILiveAfterSalesService liveAfterSalesService;
+
+    @Autowired
+    private TokenService tokenService;
+    @Autowired
+    private ILiveAfterSalesItemService liveAfterSalesItemService;
+    @Autowired
+    private ILiveAfterSalesLogsService liveAfterSalesLogsService;
+    @Autowired
+    private IFsUserService userService;
+    @Autowired
+    private ILiveOrderService orderService;
+
+    /**
+     * 获取售后记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAfteraSales:query')")
+    @GetMapping(value = "/{id}")
+    public R getInfo(@PathVariable("id") Long id)
+    {
+        LiveAfterSales liveAfterSales = liveAfterSalesService.selectLiveAfterSalesById(id);
+        if(liveAfterSales==null) return R.error("售后记录不存在");
+        List<LiveAfterSalesItem> list = liveAfterSalesItemService.selectLiveAfterSalesItemByAfterId(id);
+        List<LiveAfterSalesLogs> logList = liveAfterSalesLogsService.selectLiveAfterSalesLogsByAfterId(id);
+        FsUser user=userService.selectFsUserById(liveAfterSales.getUserId());
+        user.setPhone(ParseUtils.parsePhone(user.getPhone()));
+        LiveOrder liveOrder = orderService.selectLiveOrderByOrderId(String.valueOf(liveAfterSales.getOrderId()));
+        return R.ok().put("afterSales",liveAfterSales).put("items",list).put("logs",logList).put("user",user).put("order",liveOrder);
+
+    }
+
+    /**
+     * 查询售后记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAfteraSales:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveAfterSalesVo liveAfterSales)
+    {
+        startPage();
+        List<LiveAfterSalesVo> list = liveAfterSalesService.selectLiveAfterSalesVoList(liveAfterSales);
+        for (LiveAfterSalesVo liveAfterSalesVo : list) {
+            liveAfterSalesVo.setUserPhone(ParseUtils.parsePhone(liveAfterSalesVo.getUserPhone()));
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出售后记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAfteraSales:export')")
+    @Log(title = "售后记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveAfterSales liveAfterSales)
+    {
+        List<LiveAfterSales> list = liveAfterSalesService.selectLiveAfterSalesList(liveAfterSales);
+        ExcelUtil<LiveAfterSales> util = new ExcelUtil<LiveAfterSales>(LiveAfterSales.class);
+        return util.exportExcel(list, "售后记录数据");
+    }
+
+
+    /**
+     * 新增售后记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAfteraSales:add')")
+    @Log(title = "售后记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveAfterSales liveAfterSales)
+    {
+        return toAjax(liveAfterSalesService.insertLiveAfterSales(liveAfterSales));
+    }
+
+    /**
+     * 修改售后记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAfteraSales:edit')")
+    @Log(title = "售后记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveAfterSales liveAfterSales)
+    {
+        return toAjax(liveAfterSalesService.updateLiveAfterSales(liveAfterSales));
+    }
+
+    /**
+     * 删除售后记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAfteraSales:remove')")
+    @Log(title = "售后记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(liveAfterSalesService.deleteLiveAfterSalesByIds(ids));
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSales:audit1')")
+    @PostMapping("/audit1")
+    //平台审核
+    public R audit1(@RequestBody LiveAfterSalesAudit1Param param)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        param.setOperator(loginUser.getUser().getNickName());
+        return liveAfterSalesService.audit1(param);
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSales:audit2')")
+    @PostMapping("/audit2")
+    //仓库审核
+    public R audit2(@RequestBody LiveAfterSalesAudit2Param param)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        param.setOperator(loginUser.getUser().getNickName());
+        return liveAfterSalesService.audit2(param);
+    }
+    //财务审核
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSales:refund')")
+    @PostMapping("/refund")
+    public R refund(@RequestBody LiveAfterSalesRefundParam param)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        param.setOperator(loginUser.getUser().getNickName());
+        return liveAfterSalesService.refundMoney(param);
+    }
+    //平台撤销
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSales:cancel')")
+    @PostMapping("/cancel")
+    public R cancel(@RequestBody LiveAfterSalesCancelParam param) throws ParseException {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        param.setOperator(loginUser.getUser().getNickName());
+        return liveAfterSalesService.cancel(param);
+    }
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveAfterSalesItemController.java

@@ -0,0 +1,97 @@
+package com.fs.live.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.live.domain.LiveAfterSalesItem;
+import com.fs.live.service.ILiveAfterSalesItemService;
+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-07-08
+ */
+@RestController
+@RequestMapping("/live/liveAfterSalesItem")
+public class LiveAfterSalesItemController extends BaseController
+{
+    @Autowired
+    private ILiveAfterSalesItemService liveAfterSalesItemService;
+
+    /**
+     * 查询售后子列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAfterSalesItem:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveAfterSalesItem liveAfterSalesItem)
+    {
+        startPage();
+        List<LiveAfterSalesItem> list = liveAfterSalesItemService.selectLiveAfterSalesItemList(liveAfterSalesItem);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出售后子列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAfterSalesItem:export')")
+    @Log(title = "售后子", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveAfterSalesItem liveAfterSalesItem)
+    {
+        List<LiveAfterSalesItem> list = liveAfterSalesItemService.selectLiveAfterSalesItemList(liveAfterSalesItem);
+        ExcelUtil<LiveAfterSalesItem> util = new ExcelUtil<LiveAfterSalesItem>(LiveAfterSalesItem.class);
+        return util.exportExcel(list, "售后子数据");
+    }
+
+    /**
+     * 获取售后子详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAfterSalesItem:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(liveAfterSalesItemService.selectLiveAfterSalesItemById(id));
+    }
+
+    /**
+     * 新增售后子
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAfterSalesItem:add')")
+    @Log(title = "售后子", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveAfterSalesItem liveAfterSalesItem)
+    {
+        return toAjax(liveAfterSalesItemService.insertLiveAfterSalesItem(liveAfterSalesItem));
+    }
+
+    /**
+     * 修改售后子
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAfterSalesItem:edit')")
+    @Log(title = "售后子", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveAfterSalesItem liveAfterSalesItem)
+    {
+        return toAjax(liveAfterSalesItemService.updateLiveAfterSalesItem(liveAfterSalesItem));
+    }
+
+    /**
+     * 删除售后子
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAfterSalesItem:remove')")
+    @Log(title = "售后子", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(liveAfterSalesItemService.deleteLiveAfterSalesItemByIds(ids));
+    }
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveAfterSalesLogsController.java

@@ -0,0 +1,97 @@
+package com.fs.live.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.live.domain.LiveAfterSalesLogs;
+import com.fs.live.service.ILiveAfterSalesLogsService;
+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-07-08
+ */
+@RestController
+@RequestMapping("/live/liveAfterSalesLogs")
+public class LiveAfterSalesLogsController extends BaseController
+{
+    @Autowired
+    private ILiveAfterSalesLogsService liveAfterSalesLogsService;
+
+    /**
+     * 查询售后订单操作列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAfterSalesLogs:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveAfterSalesLogs liveAfterSalesLogs)
+    {
+        startPage();
+        List<LiveAfterSalesLogs> list = liveAfterSalesLogsService.selectLiveAfterSalesLogsList(liveAfterSalesLogs);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出售后订单操作列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAfterSalesLogs:export')")
+    @Log(title = "售后订单操作", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveAfterSalesLogs liveAfterSalesLogs)
+    {
+        List<LiveAfterSalesLogs> list = liveAfterSalesLogsService.selectLiveAfterSalesLogsList(liveAfterSalesLogs);
+        ExcelUtil<LiveAfterSalesLogs> util = new ExcelUtil<LiveAfterSalesLogs>(LiveAfterSalesLogs.class);
+        return util.exportExcel(list, "售后订单操作数据");
+    }
+
+    /**
+     * 获取售后订单操作详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAfterSalesLogs:query')")
+    @GetMapping(value = "/{logsId}")
+    public AjaxResult getInfo(@PathVariable("logsId") Long logsId)
+    {
+        return AjaxResult.success(liveAfterSalesLogsService.selectLiveAfterSalesLogsByLogsId(logsId));
+    }
+
+    /**
+     * 新增售后订单操作
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAfterSalesLogs:add')")
+    @Log(title = "售后订单操作", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveAfterSalesLogs liveAfterSalesLogs)
+    {
+        return toAjax(liveAfterSalesLogsService.insertLiveAfterSalesLogs(liveAfterSalesLogs));
+    }
+
+    /**
+     * 修改售后订单操作
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAfterSalesLogs:edit')")
+    @Log(title = "售后订单操作", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveAfterSalesLogs liveAfterSalesLogs)
+    {
+        return toAjax(liveAfterSalesLogsService.updateLiveAfterSalesLogs(liveAfterSalesLogs));
+    }
+
+    /**
+     * 删除售后订单操作
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAfterSalesLogs:remove')")
+    @Log(title = "售后订单操作", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{logsIds}")
+    public AjaxResult remove(@PathVariable Long[] logsIds)
+    {
+        return toAjax(liveAfterSalesLogsService.deleteLiveAfterSalesLogsByLogsIds(logsIds));
+    }
+}

+ 8 - 14
fs-admin/src/main/java/com/fs/live/controller/LiveAnchorController.java

@@ -1,28 +1,22 @@
 package com.fs.live.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
  */

+ 217 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveAutoTaskController.java

@@ -0,0 +1,217 @@
+package com.fs.live.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.DateUtils;
+import com.fs.common.utils.StringUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.live.domain.Live;
+import com.fs.live.domain.LiveAutoTask;
+import com.fs.live.mapper.LiveMapper;
+import com.fs.live.param.LiveAutoTaskExportParam;
+import com.fs.live.param.LiveAutoTaskImportParam;
+import com.fs.live.service.ILiveAutoTaskService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.ZoneId;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 直播间自动化任务配置Controller
+ *
+ * @author fs
+ * @date 2025-08-29
+ */
+@RestController
+@RequestMapping("/live/task")
+public class LiveAutoTaskController extends BaseController
+{
+    @Autowired
+    private ILiveAutoTaskService liveAutoTaskService;
+    @Autowired
+    private LiveMapper liveMapper;
+
+    /**
+     * 查询直播间自动化任务配置列表
+     */
+//    @PreAuthorize("@ss.hasPermi('shop:task:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveAutoTask liveAutoTask)
+    {
+        startPage();
+        List<LiveAutoTask> list = liveAutoTaskService.selectLiveAutoTaskList(liveAutoTask);
+        return getDataTable(list);
+    }
+    /**
+     * 查询直播间自动化任务配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:task:list')")
+    @GetMapping("/listBarrage")
+    public TableDataInfo listBarrage(LiveAutoTask liveAutoTask)
+    {
+        startPage();
+        List<LiveAutoTask> list = liveAutoTaskService.selectLiveAutoTaskBarrageList(liveAutoTask);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播间自动化任务配置列表
+     */
+//    @PreAuthorize("@ss.hasPermi('shop:task:export')")
+    @Log(title = "直播间自动化任务配置", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveAutoTask liveAutoTask)
+    {
+        List<LiveAutoTask> list = liveAutoTaskService.selectLiveAutoTaskList(liveAutoTask);
+        ExcelUtil<LiveAutoTask> util = new ExcelUtil<LiveAutoTask>(LiveAutoTask.class);
+        return util.exportExcel(list, "直播间自动化任务配置数据");
+    }
+
+    /**
+     * 获取直播间自动化任务配置详细信息
+     */
+//    @PreAuthorize("@ss.hasPermi('shop:task:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(liveAutoTaskService.selectLiveAutoTaskById(id));
+    }
+
+    /**
+     * 新增直播间自动化任务配置
+     */
+//    @PreAuthorize("@ss.hasPermi('shop:task:add')")
+    @Log(title = "直播间自动化任务配置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public R add(@RequestBody LiveAutoTask liveAutoTask)
+    {
+        return liveAutoTaskService.insertLiveAutoTask(liveAutoTask);
+    }
+
+    /**
+     * 修改直播间自动化任务配置
+     */
+//    @PreAuthorize("@ss.hasPermi('shop:task:edit')")
+    @Log(title = "直播间自动化任务配置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveAutoTask liveAutoTask)
+    {
+        return toAjax(liveAutoTaskService.updateLiveAutoTask(liveAutoTask));
+    }
+
+    /**
+     * 删除直播间自动化任务配置
+     */
+//    @PreAuthorize("@ss.hasPermi('shop:task:remove')")
+    @Log(title = "直播间自动化任务配置", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(liveAutoTaskService.deleteLiveAutoTaskByIds(ids));
+    }
+
+    /**
+     * 导出直播间自动化任务配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:task:export')")
+    @Log(title = "直播间自动化任务配置", businessType = BusinessType.EXPORT)
+    @GetMapping("/exportData")
+    public AjaxResult exportData(LiveAutoTask liveAutoTask)
+    {
+        List<LiveAutoTask> list = liveAutoTaskService.selectLiveAutoTaskBarrageList(liveAutoTask);
+        ExcelUtil<LiveAutoTaskExportParam> util = new ExcelUtil<LiveAutoTaskExportParam>(LiveAutoTaskExportParam.class);
+        ArrayList<LiveAutoTaskExportParam> barrageList = new ArrayList<>();
+        for (LiveAutoTask autoTask : list) {
+            LiveAutoTaskExportParam liveAutoTaskImportParam = new LiveAutoTaskExportParam();
+            liveAutoTaskImportParam.setTaskName(autoTask.getTaskName());
+            liveAutoTaskImportParam.setContent(autoTask.getContent());
+            liveAutoTaskImportParam.setRegisterDate(autoTask.getTriggerValue());
+            barrageList.add(liveAutoTaskImportParam);
+        }
+
+        return util.exportExcel(barrageList, "直播间弹幕脚本数据");
+    }
+
+    @GetMapping("/importTemplate")
+    public AjaxResult importTemplate()
+    {
+        ExcelUtil<LiveAutoTaskImportParam> util = new ExcelUtil<>(LiveAutoTaskImportParam.class);
+        return util.importTemplateExcel("导入模板");
+    }
+
+    @PreAuthorize("@ss.hasPermi('live:task:export')")
+    @PostMapping("/importData")
+    public AjaxResult importLineData(@RequestParam("liveId") String liveId, MultipartFile file) throws Exception
+    {
+        ExcelUtil<LiveAutoTaskImportParam> util = new ExcelUtil<LiveAutoTaskImportParam>(LiveAutoTaskImportParam.class);
+        List<LiveAutoTaskImportParam> list = util.importExcel(file.getInputStream());
+        if(list.size()>12000){
+            return new AjaxResult(500,"导入数据超出范围,最大12000条");
+        }
+        LiveAutoTask liveAutoTask;
+        Date nowDate = DateUtils.getNowDate();
+        Live live = liveMapper.selectLiveByLiveId(Long.parseLong(liveId));
+        for (LiveAutoTaskImportParam liveAutoTaskImportParam : list) {
+            if(StringUtils.isEmpty(liveAutoTaskImportParam.getTaskName()) || StringUtils.isEmpty(liveAutoTaskImportParam.getRegisterDate()) || StringUtils.isEmpty(liveAutoTaskImportParam.getContent())) continue;
+            liveAutoTask = new LiveAutoTask();
+            liveAutoTask.setLiveId(Long.parseLong(liveId));
+            liveAutoTask.setTaskName(liveAutoTaskImportParam.getTaskName());
+            liveAutoTask.setTaskType(3L);
+            liveAutoTask.setTriggerType(2L);
+            liveAutoTask.setTriggerValue(formatTime(liveAutoTaskImportParam.getRegisterDate()));
+            liveAutoTask.setContent(liveAutoTaskImportParam.getContent());
+            liveAutoTask.setAbsValue(getTriggerValue(liveAutoTask.getTriggerValue(),live.getStartTime()));
+            liveAutoTask.setCreateTime(nowDate);
+            liveAutoTask.setUpdateTime(nowDate);
+            liveAutoTask.setStatus(1L);
+            liveAutoTask.setFinishStatus(0L);
+            liveAutoTaskService.directInsertLiveAutoTask(liveAutoTask);
+        }
+        return AjaxResult.success();
+    }
+
+    public static Date formatTime(String duration) {
+        String[] parts = duration.split(":");
+        if (parts.length != 3) {
+            throw new IllegalArgumentException("时间格式不正确,应为 hh:mm:ss");
+        }
+        int hours = Integer.parseInt(parts[0]);
+        int minutes = Integer.parseInt(parts[1]);
+        int seconds = Integer.parseInt(parts[2]);
+
+        // 获取当前日期的Calendar实例
+        Calendar calendar = Calendar.getInstance();
+        // 设置时分秒
+        calendar.set(Calendar.HOUR_OF_DAY, hours); // 24小时制
+        calendar.set(Calendar.MINUTE, minutes);
+        calendar.set(Calendar.SECOND, seconds);
+        calendar.set(Calendar.MILLISECOND, 0); // 毫秒设为0
+
+        return calendar.getTime();
+    }
+
+    private Date getTriggerValue(Date triggerValue, LocalDateTime liveStartTime) {
+        LocalDateTime triggerDateTime = LocalDateTime.ofInstant(
+                triggerValue.toInstant(),
+                ZoneId.systemDefault()
+        );
+        LocalTime triggerTime = triggerDateTime.toLocalTime();
+        LocalDateTime combinedTime = liveStartTime
+                .plusHours(triggerTime.getHour())
+                .plusMinutes(triggerTime.getMinute())
+                .plusSeconds(triggerTime.getSecond());
+        return Date.from(combinedTime.atZone(ZoneId.systemDefault()).toInstant());
+    }
+}

+ 98 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveCartController.java

@@ -0,0 +1,98 @@
+package com.fs.live.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.live.domain.LiveCart;
+import com.fs.live.service.ILiveCartService;
+import com.fs.live.vo.LiveCartVo;
+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-07-08
+ */
+@RestController
+@RequestMapping("/live/liveCart")
+public class LiveCartController extends BaseController
+{
+    @Autowired
+    private ILiveCartService liveCartService;
+
+    /**
+     * 查询购物车列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveCart:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveCart liveCart)
+    {
+        startPage();
+        List<LiveCartVo> list = liveCartService.selectLiveCartListVo(liveCart);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出购物车列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveCart:export')")
+    @Log(title = "购物车", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveCart liveCart)
+    {
+        List<LiveCart> list = liveCartService.selectLiveCartList(liveCart);
+        ExcelUtil<LiveCart> util = new ExcelUtil<LiveCart>(LiveCart.class);
+        return util.exportExcel(list, "购物车数据");
+    }
+
+    /**
+     * 获取购物车详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveCart:query')")
+    @GetMapping(value = "/{cardId}")
+    public AjaxResult getInfo(@PathVariable("cardId") Long cardId)
+    {
+        return AjaxResult.success(liveCartService.selectLiveCartByCartId(cardId));
+    }
+
+    /**
+     * 新增购物车
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveCart:add')")
+    @Log(title = "购物车", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveCart liveCart)
+    {
+        return toAjax(liveCartService.insertLiveCart(liveCart));
+    }
+
+    /**
+     * 修改购物车
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveCart:edit')")
+    @Log(title = "购物车", businessType = BusinessType.UPDATE)
+    @PostMapping("/update")
+    public AjaxResult edit(@RequestBody LiveCart liveCart)
+    {
+        return toAjax(liveCartService.updateLiveCart(liveCart));
+    }
+
+    /**
+     * 删除购物车
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveCart:remove')")
+    @Log(title = "购物车", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{cardIds}")
+    public AjaxResult remove(@PathVariable Long[] cardIds)
+    {
+        return toAjax(liveCartService.deleteLiveCartByCartIds(cardIds));
+    }
+}

+ 97 - 29
fs-admin/src/main/java/com/fs/live/controller/LiveController.java

@@ -1,45 +1,43 @@
 package com.fs.live.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.domain.R;
+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 com.fs.live.vo.LiveListVo;
+import com.fs.task.LiveTask;
+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
-{
+public class LiveController extends BaseController {
     @Autowired
     private ILiveService liveService;
+    @Autowired
+    private LiveTask liveTask;
 
     /**
      * 查询直播列表
      */
     @PreAuthorize("@ss.hasPermi('live:live:list')")
     @GetMapping("/list")
-    public TableDataInfo list(Live live)
-    {
+    public TableDataInfo list(Live live) {
         startPage();
         List<Live> list = liveService.selectLiveList(live);
         return getDataTable(list);
@@ -51,20 +49,19 @@ public class LiveController extends BaseController
     @PreAuthorize("@ss.hasPermi('live:live:export')")
     @Log(title = "直播", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
-    public AjaxResult export(Live live)
-    {
+    public AjaxResult export(Live 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)
-    {
+    public AjaxResult getInfo(@PathVariable("liveId") Long liveId) {
         return AjaxResult.success(liveService.selectLiveByLiveId(liveId));
     }
 
@@ -74,8 +71,7 @@ public class LiveController extends BaseController
     @PreAuthorize("@ss.hasPermi('live:live:add')")
     @Log(title = "直播", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody Live live)
-    {
+    public AjaxResult add(@RequestBody Live live) {
         return toAjax(liveService.insertLive(live));
     }
 
@@ -85,8 +81,7 @@ public class LiveController extends BaseController
     @PreAuthorize("@ss.hasPermi('live:live:edit')")
     @Log(title = "直播", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody Live live)
-    {
+    public AjaxResult edit(@RequestBody Live live) {
         return toAjax(liveService.updateLive(live));
     }
 
@@ -95,9 +90,82 @@ public class LiveController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('live:live:remove')")
     @Log(title = "直播", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{liveIds}")
-    public AjaxResult remove(@PathVariable Long[] liveIds)
-    {
+    @DeleteMapping("/{liveIds}")
+    public AjaxResult remove(@PathVariable Long[] liveIds) {
         return toAjax(liveService.deleteLiveByLiveIds(liveIds));
     }
+
+    @PreAuthorize("@ss.hasPermi('live:live:query')")
+    @GetMapping("/living/{liveId}")
+    public R getRoom(@PathVariable String liveId) {
+        return liveService.getLiveRoom(liveId);
+    }
+
+    @PreAuthorize("@ss.hasPermi('live:live:edit')")
+    @PostMapping("/updateLiveIsAudit")
+    public Integer updateLiveIsAudit(@RequestBody Live live) {
+        return liveService.updateLiveIsAudit(live);
+    }
+
+
+
+    /**
+     * 批量上下架视频
+     */
+    @PreAuthorize("@ss.hasPermi('live:live:edit')")
+    @PostMapping("/handleShelfOrUn")
+    public R handleShelfOrUn(@RequestBody LiveListVo listVo) {
+        return liveService.handleShelfOrUnAdmin(listVo);
+    }
+
+    /**
+     * 批量删除视频
+     */
+    @PreAuthorize("@ss.hasPermi('live:live:edit')")
+    @PostMapping("/handleDeleteSelected")
+    public R handleDeleteSelected(@RequestBody LiveListVo listVo) {
+        return liveService.handleDeleteSelectedAdmin(listVo);
+    }
+    /**
+     * 校验上传的身份证信息
+     */
+    @PostMapping("/verifyIdInfo")
+    public R verifyIdInfo(@RequestBody Map<String, String> payload) {
+        return liveService.verifyIdInfo(payload);
+    }
+
+    /**
+     * 结束直播
+     */
+    @PreAuthorize("@ss.hasPermi('live:live:edit')")
+    @GetMapping("/finishLive")
+    public R finishLive(Live live) {
+        return liveService.finishLive(live);
+    }
+//    @GetMapping("/test/test")
+//    public R test() {
+//         liveTask.updateExpress();
+//        return R.ok();
+//    }
+
+    /**
+     * 复制直播
+     */
+    @PreAuthorize("@ss.hasPermi('live:live:edit')")
+    @GetMapping("/copyLive")
+    public R copyLive(Live live) {
+
+        return liveService.copyLive(live);
+    }
+
+    /**
+     * 开启直播
+     */
+    @PreAuthorize("@ss.hasPermi('live:live:edit')")
+    @GetMapping("/startLive")
+    public R startLive(Live live) {
+        return liveService.startLive(live);
+    }
+
+
 }

+ 211 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveCouponController.java

@@ -0,0 +1,211 @@
+package com.fs.live.controller;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import com.fs.common.core.domain.R;
+import com.fs.live.domain.LiveCouponIssue;
+import com.fs.live.param.LiveCouponPublishParam;
+import com.fs.live.service.ILiveCouponIssueService;
+import com.fs.live.vo.LiveCouponListVo;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.enums.BusinessType;
+import com.fs.live.domain.LiveCoupon;
+import com.fs.live.service.ILiveCouponService;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.core.page.TableDataInfo;
+
+/**
+ * 优惠券Controller
+ *
+ * @author fs
+ * @date 2025-09-30
+ */
+@RestController
+@RequestMapping("/live/coupon")
+public class LiveCouponController extends BaseController
+{
+    @Autowired
+    private ILiveCouponService liveCouponService;
+    @Autowired
+    private ILiveCouponIssueService liveCouponIssueService;
+
+
+    /**
+     * 查询优惠券列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveCoupon liveCoupon)
+    {
+        startPage();
+        liveCoupon.setIsDel(0);
+        List<LiveCoupon> list = liveCouponService.selectLiveCouponList(liveCoupon);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出优惠券列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:export')")
+    @Log(title = "优惠券", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveCoupon liveCoupon)
+    {
+        List<LiveCoupon> list = liveCouponService.selectLiveCouponList(liveCoupon);
+        ExcelUtil<LiveCoupon> util = new ExcelUtil<LiveCoupon>(LiveCoupon.class);
+        return util.exportExcel(list, "coupon");
+    }
+
+    /**
+     * 获取优惠券详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:query')")
+    @GetMapping(value = "/{couponId}")
+    public AjaxResult getInfo(@PathVariable("couponId") Long couponId)
+    {
+        return AjaxResult.success(liveCouponService.selectLiveCouponById(couponId));
+    }
+
+    /**
+     * 新增优惠券
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:add')")
+    @Log(title = "优惠券", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveCoupon liveCoupon)
+    {
+        return toAjax(liveCouponService.insertLiveCoupon(liveCoupon));
+    }
+
+    /**
+     * 修改优惠券
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:edit')")
+    @Log(title = "优惠券", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveCoupon liveCoupon)
+    {
+        return toAjax(liveCouponService.updateLiveCoupon(liveCoupon));
+    }
+
+    /**
+     * 删除优惠券
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:remove')")
+    @Log(title = "优惠券", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{couponIds}")
+    public AjaxResult remove(@PathVariable Long[] couponIds)
+    {
+        return toAjax(liveCouponService.deleteLiveCouponByIds(couponIds));
+    }
+
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:publish')")
+    @PostMapping("/publish")
+    public AjaxResult publish(@RequestBody LiveCouponPublishParam publishParam)
+    {
+        LiveCoupon coupon=liveCouponService.selectLiveCouponById(publishParam.getCouponId());
+        LiveCouponIssue issue=new LiveCouponIssue();
+        issue.setCouponId(publishParam.getCouponId());
+        issue.setCouponName(coupon.getTitle());
+        issue.setCouponType(Math.toIntExact(coupon.getType()));
+        issue.setStartTime(publishParam.getStartTime());
+        issue.setLimitTime(publishParam.getLimitTime());
+        issue.setTotalCount(Long.valueOf(publishParam.getTotalCount()));
+        issue.setRemainCount(Long.valueOf(publishParam.getTotalCount()));
+        issue.setIsPermanent(0);
+        issue.setStatus(1);
+        issue.setCreateTime(new Date());
+        return toAjax( liveCouponIssueService.insertLiveCouponIssue(issue));
+    }
+
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:batchPublish')")
+    @PostMapping("/batchPublish")
+    public R batchPublish(@RequestBody LiveCouponPublishParam publishParam)
+    {
+
+        List<LiveCoupon> list=liveCouponService.selectLiveCouponByIds(publishParam.getIds());
+        for (LiveCoupon coupon :list ){
+            LiveCouponIssue issue=new LiveCouponIssue();
+            issue.setCouponId(coupon.getCouponId());
+            issue.setCouponName(coupon.getTitle());
+            issue.setCouponType(Math.toIntExact(coupon.getType()));
+            issue.setStartTime(publishParam.getStartTime());
+            issue.setLimitTime(publishParam.getLimitTime());
+            issue.setTotalCount(Long.valueOf(publishParam.getTotalCount()));
+            issue.setRemainCount(Long.valueOf(publishParam.getTotalCount()));
+            issue.setIsPermanent(0);
+            issue.setStatus(1);
+            issue.setCreateTime(new Date());
+            liveCouponIssueService.insertLiveCouponIssue(issue);
+        }
+        return R.ok();
+    }
+
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:query')")
+    @GetMapping(value = "/listLiveCoupon")
+    public TableDataInfo listLiveCoupon(@RequestParam("liveId") Long liveId)
+    {
+        startPage();
+        List<LiveCoupon> list = liveCouponService.selectLiveCouponByLiveId(liveId);
+        return getDataTable(list);
+    }
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:query')")
+    @GetMapping(value = "/listCoupon")
+    public TableDataInfo listCoupon(@RequestParam("liveId") Long liveId,@RequestParam("couponName") String couponName)
+    {
+        startPage();
+        List<LiveCoupon> list = liveCouponService.listCoupon(liveId,couponName);
+        return getDataTable(list);
+    }
+
+
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:add')")
+    @Log(title = "直播优惠券", businessType = BusinessType.INSERT)
+    @PostMapping("/delLiveCoupon")
+    public AjaxResult delLiveCoupon(@RequestBody LiveCouponListVo vo)
+    {
+        return toAjax(liveCouponService.delLiveCoupon(vo));
+    }
+
+    /**
+     * 新增直播商品
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:add')")
+    @Log(title = "直播优惠券", businessType = BusinessType.INSERT)
+    @PostMapping("/addLiveCoupon")
+    public AjaxResult addLiveCoupon(@RequestBody Map<String, Object> payload)
+    {
+
+        return toAjax(liveCouponService.insertLiveCouponEntity(payload));
+    }
+
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:edit')")
+    @PostMapping("/handleIsShowChange")
+    public R handleIsShowChange(@RequestBody Map<String, Object> payload) {
+        return liveCouponService.handleIsShowChange(payload);
+    }
+
+    /**
+     * 批量删除视频
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:edit')")
+    @PostMapping("/handleDeleteSelected")
+    public R handleDeleteSelected(@RequestBody LiveCouponListVo listVo) {
+        return liveCouponService.handleDeleteSelectedAdmin(listVo);
+    }
+    /**
+     * 批量删除视频
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:edit')")
+    @PostMapping("/updateLiveCouponBind")
+    public R updateLiveCouponBind(@RequestBody LiveCouponListVo listVo) {
+        return liveCouponService.updateLiveCouponBind(listVo);
+    }
+}

+ 103 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveCouponIssueController.java

@@ -0,0 +1,103 @@
+package com.fs.live.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.enums.BusinessType;
+import com.fs.live.domain.LiveCouponIssue;
+import com.fs.live.service.ILiveCouponIssueService;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.core.page.TableDataInfo;
+
+/**
+ * 优惠券领取Controller
+ *
+ * @author fs
+ * @date 2025-09-30
+ */
+@RestController
+@RequestMapping("/live/coupon/issue")
+public class LiveCouponIssueController extends BaseController
+{
+    @Autowired
+    private ILiveCouponIssueService liveCouponIssueService;
+
+    /**
+     * 查询优惠券领取列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:issue:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveCouponIssue liveCouponIssue)
+    {
+        startPage();
+        List<LiveCouponIssue> list = liveCouponIssueService.selectLiveCouponIssueList(liveCouponIssue);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出优惠券领取列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:issue:export')")
+    @Log(title = "优惠券领取", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveCouponIssue liveCouponIssue)
+    {
+        List<LiveCouponIssue> list = liveCouponIssueService.selectLiveCouponIssueList(liveCouponIssue);
+        ExcelUtil<LiveCouponIssue> util = new ExcelUtil<LiveCouponIssue>(LiveCouponIssue.class);
+        return util.exportExcel(list, "issue");
+    }
+
+    /**
+     * 获取优惠券领取详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:issue:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(liveCouponIssueService.selectLiveCouponIssueById(id));
+    }
+
+    /**
+     * 新增优惠券领取
+     */
+    @PreAuthorize("@ss.hasPermi('live:issue:add')")
+    @Log(title = "优惠券领取", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveCouponIssue liveCouponIssue)
+    {
+        return toAjax(liveCouponIssueService.insertLiveCouponIssue(liveCouponIssue));
+    }
+
+    /**
+     * 修改优惠券领取
+     */
+    @PreAuthorize("@ss.hasPermi('live:issue:edit')")
+    @Log(title = "优惠券领取", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveCouponIssue liveCouponIssue)
+    {
+        return toAjax(liveCouponIssueService.updateLiveCouponIssue(liveCouponIssue));
+    }
+
+    /**
+     * 删除优惠券领取
+     */
+    @PreAuthorize("@ss.hasPermi('live:issue:remove')")
+    @Log(title = "优惠券领取", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(liveCouponIssueService.deleteLiveCouponIssueByIds(ids));
+    }
+}

+ 103 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveCouponIssueUserController.java

@@ -0,0 +1,103 @@
+package com.fs.live.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.enums.BusinessType;
+import com.fs.live.domain.LiveCouponIssueUser;
+import com.fs.live.service.ILiveCouponIssueUserService;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.core.page.TableDataInfo;
+
+/**
+ * 优惠券用户领取记录Controller
+ *
+ * @author fs
+ * @date 2025-09-30
+ */
+@RestController
+@RequestMapping("/live/coupon/issue/user")
+public class LiveCouponIssueUserController extends BaseController
+{
+    @Autowired
+    private ILiveCouponIssueUserService liveCouponIssueUserService;
+
+    /**
+     * 查询优惠券用户领取记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:user:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveCouponIssueUser liveCouponIssueUser)
+    {
+        startPage();
+        List<LiveCouponIssueUser> list = liveCouponIssueUserService.selectLiveCouponIssueUserList(liveCouponIssueUser);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出优惠券用户领取记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:user:export')")
+    @Log(title = "优惠券用户领取记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveCouponIssueUser liveCouponIssueUser)
+    {
+        List<LiveCouponIssueUser> list = liveCouponIssueUserService.selectLiveCouponIssueUserList(liveCouponIssueUser);
+        ExcelUtil<LiveCouponIssueUser> util = new ExcelUtil<LiveCouponIssueUser>(LiveCouponIssueUser.class);
+        return util.exportExcel(list, "user");
+    }
+
+    /**
+     * 获取优惠券用户领取记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:user:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(liveCouponIssueUserService.selectLiveCouponIssueUserById(id));
+    }
+
+    /**
+     * 新增优惠券用户领取记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:user:add')")
+    @Log(title = "优惠券用户领取记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveCouponIssueUser liveCouponIssueUser)
+    {
+        return toAjax(liveCouponIssueUserService.insertLiveCouponIssueUser(liveCouponIssueUser));
+    }
+
+    /**
+     * 修改优惠券用户领取记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:user:edit')")
+    @Log(title = "优惠券用户领取记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveCouponIssueUser liveCouponIssueUser)
+    {
+        return toAjax(liveCouponIssueUserService.updateLiveCouponIssueUser(liveCouponIssueUser));
+    }
+
+    /**
+     * 删除优惠券用户领取记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:user:remove')")
+    @Log(title = "优惠券用户领取记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(liveCouponIssueUserService.deleteLiveCouponIssueUserByIds(ids));
+    }
+}

+ 105 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveCouponUserController.java

@@ -0,0 +1,105 @@
+package com.fs.live.controller;
+
+import java.util.List;
+
+import com.fs.common.utils.ParseUtils;
+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.enums.BusinessType;
+import com.fs.live.domain.LiveCouponUser;
+import com.fs.live.service.ILiveCouponUserService;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.core.page.TableDataInfo;
+
+/**
+ * 优惠券发放记录Controller
+ *
+ * @author fs
+ * @date 2025-09-30
+ */
+@RestController
+@RequestMapping("/live/coupon/user")
+public class LiveCouponUserController extends BaseController
+{
+    @Autowired
+    private ILiveCouponUserService liveCouponUserService;
+
+    /**
+     * 查询优惠券发放记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:user:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveCouponUser liveCouponUser)
+    {
+        startPage();
+        List<LiveCouponUser> list = liveCouponUserService.selectLiveCouponUserList(liveCouponUser);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出优惠券发放记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:user:export')")
+    @Log(title = "优惠券发放记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveCouponUser liveCouponUser)
+    {
+        List<LiveCouponUser> list = liveCouponUserService.selectLiveCouponUserList(liveCouponUser);
+        ExcelUtil<LiveCouponUser> util = new ExcelUtil<LiveCouponUser>(LiveCouponUser.class);
+        return util.exportExcel(list, "user");
+    }
+
+    /**
+     * 获取优惠券发放记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:user:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(liveCouponUserService.selectLiveCouponUserById(id));
+    }
+
+    /**
+     * 新增优惠券发放记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:user:add')")
+    @Log(title = "优惠券发放记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveCouponUser liveCouponUser)
+    {
+        return toAjax(liveCouponUserService.insertLiveCouponUser(liveCouponUser));
+    }
+
+    /**
+     * 修改优惠券发放记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:user:edit')")
+    @Log(title = "优惠券发放记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveCouponUser liveCouponUser)
+    {
+        return toAjax(liveCouponUserService.updateLiveCouponUser(liveCouponUser));
+    }
+
+    /**
+     * 删除优惠券发放记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:user:remove')")
+    @Log(title = "优惠券发放记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(liveCouponUserService.deleteLiveCouponUserByIds(ids));
+    }
+}

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

@@ -0,0 +1,81 @@
+package com.fs.live.controller;
+
+import com.fs.common.core.domain.R;
+import com.fs.common.utils.SecurityUtils;
+import com.fs.live.domain.LiveData;
+import com.fs.live.service.ILiveDataService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Map;
+
+
+@RestController
+@RequestMapping("/live/liveData")
+public class LiveDataController {
+
+    @Autowired
+    private ILiveDataService liveDataService;
+
+    /**
+     * 查询直播数据列表
+     * */
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:query')")
+    @GetMapping("/list")
+    public List<LiveData> list(LiveData liveData) {
+        return liveDataService.selectLiveDataList(liveData);
+    }
+
+    /**
+     * 查询直播数据详情
+     * */
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:query')")
+    @GetMapping("/get/{liveId}")
+    public R getLiveData(@PathVariable Long liveId) {
+        return R.ok().put("liveData", liveDataService.selectLiveDataByLiveId(liveId));
+    }
+
+    /**
+     * 点赞
+     * */
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:edit')")
+    @GetMapping("/like/{liveId}")
+    public R like(@PathVariable Long liveId) {
+        return R.ok(liveDataService.updateLikeByLiveId(liveId, SecurityUtils.getLoginUser().getUser().getUserId()));
+    }
+
+    /**
+     * 收藏
+     * */
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:edit')")
+    @GetMapping("/collect/{liveId}")
+    public R collect(@PathVariable Long liveId) {
+        return R.ok(liveDataService.collect(liveId, SecurityUtils.getLoginUser().getUser().getUserId()));
+    }
+
+    /**
+     * 关注
+     * */
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:edit')")
+    @GetMapping("/follow/{liveId}")
+    public R follow(@PathVariable Long liveId) {
+        return R.ok(liveDataService.follow(liveId, SecurityUtils.getLoginUser().getUser().getUserId()));
+    }
+
+    /**
+     * 获取直播内数据
+     * */
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:query')")
+    @GetMapping("/getLiveViewData")
+    public R getLiveViewData(Long liveId) {
+        Map<String,Object> liveViewData =liveDataService.getLiveViewData(liveId);
+        return R.ok(liveViewData);
+    }
+
+
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveEventConfController.java

@@ -0,0 +1,97 @@
+package com.fs.live.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.live.domain.LiveEventConf;
+import com.fs.live.service.ILiveEventConfService;
+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-07-17
+ */
+@RestController
+@RequestMapping("/live/liveEventConf")
+public class LiveEventConfController extends BaseController
+{
+    @Autowired
+    private ILiveEventConfService liveEventConfService;
+
+    /**
+     * 查询直播触发事件配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveEventConf:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveEventConf liveEventConf)
+    {
+        startPage();
+        List<LiveEventConf> list = liveEventConfService.selectLiveEventConfList(liveEventConf);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播触发事件配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveEventConf:export')")
+    @Log(title = "直播触发事件配置", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveEventConf liveEventConf)
+    {
+        List<LiveEventConf> list = liveEventConfService.selectLiveEventConfList(liveEventConf);
+        ExcelUtil<LiveEventConf> util = new ExcelUtil<LiveEventConf>(LiveEventConf.class);
+        return util.exportExcel(list, "直播触发事件配置数据");
+    }
+
+    /**
+     * 获取直播触发事件配置详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveEventConf:query')")
+    @GetMapping(value = "/{eventId}")
+    public AjaxResult getInfo(@PathVariable("eventId") Long eventId)
+    {
+        return AjaxResult.success(liveEventConfService.selectLiveEventConfByEventId(eventId));
+    }
+
+    /**
+     * 新增直播触发事件配置
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveEventConf:add')")
+    @Log(title = "直播触发事件配置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveEventConf liveEventConf)
+    {
+        return toAjax(liveEventConfService.insertLiveEventConf(liveEventConf));
+    }
+
+    /**
+     * 修改直播触发事件配置
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveEventConf:edit')")
+    @Log(title = "直播触发事件配置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveEventConf liveEventConf)
+    {
+        return toAjax(liveEventConfService.updateLiveEventConf(liveEventConf));
+    }
+
+    /**
+     * 删除直播触发事件配置
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveEventConf:remove')")
+    @Log(title = "直播触发事件配置", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{eventIds}")
+    public AjaxResult remove(@PathVariable Long[] eventIds)
+    {
+        return toAjax(liveEventConfService.deleteLiveEventConfByEventIds(eventIds));
+    }
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveGiftController.java

@@ -0,0 +1,97 @@
+package com.fs.live.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.live.domain.LiveGift;
+import com.fs.live.service.ILiveGiftService;
+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-07-08
+ */
+@RestController
+@RequestMapping("/live/gift")
+public class LiveGiftController extends BaseController
+{
+    @Autowired
+    private ILiveGiftService liveGiftService;
+
+    /**
+     * 查询直播间礼物配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:gift:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveGift liveGift)
+    {
+        startPage();
+        List<LiveGift> list = liveGiftService.selectLiveGiftList(liveGift);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播间礼物配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:gift:export')")
+    @Log(title = "直播间礼物配置", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveGift liveGift)
+    {
+        List<LiveGift> list = liveGiftService.selectLiveGiftList(liveGift);
+        ExcelUtil<LiveGift> util = new ExcelUtil<LiveGift>(LiveGift.class);
+        return util.exportExcel(list, "直播间礼物配置数据");
+    }
+
+    /**
+     * 获取直播间礼物配置详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:gift:query')")
+    @GetMapping(value = "/{giftId}")
+    public AjaxResult getInfo(@PathVariable("giftId") Long giftId)
+    {
+        return AjaxResult.success(liveGiftService.selectLiveGiftByGiftId(giftId));
+    }
+
+    /**
+     * 新增直播间礼物配置
+     */
+    @PreAuthorize("@ss.hasPermi('live:gift:add')")
+    @Log(title = "直播间礼物配置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveGift liveGift)
+    {
+        return toAjax(liveGiftService.insertLiveGift(liveGift));
+    }
+
+    /**
+     * 修改直播间礼物配置
+     */
+    @PreAuthorize("@ss.hasPermi('live:gift:edit')")
+    @Log(title = "直播间礼物配置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveGift liveGift)
+    {
+        return toAjax(liveGiftService.updateLiveGift(liveGift));
+    }
+
+    /**
+     * 删除直播间礼物配置
+     */
+    @PreAuthorize("@ss.hasPermi('live:gift:remove')")
+    @Log(title = "直播间礼物配置", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{giftIds}")
+    public AjaxResult remove(@PathVariable Long[] giftIds)
+    {
+        return toAjax(liveGiftService.deleteLiveGiftByGiftIds(giftIds));
+    }
+}

+ 91 - 29
fs-admin/src/main/java/com/fs/live/controller/LiveGoodsController.java

@@ -1,30 +1,30 @@
 package com.fs.live.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.domain.R;
+import com.fs.common.core.domain.entity.SysUser;
+import com.fs.common.core.domain.model.LoginUser;
+import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.SecurityUtils;
+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 com.fs.live.vo.LiveGoodsListVo;
+import com.fs.live.vo.LiveGoodsVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
 
 /**
  * 直播商品Controller
- * 
+ *
  * @author fs
- * @date 2025-01-17
+ * @date 2025-07-08
  */
 @RestController
 @RequestMapping("/live/liveGoods")
@@ -33,26 +33,34 @@ public class LiveGoodsController extends BaseController
     @Autowired
     private ILiveGoodsService liveGoodsService;
 
+
     /**
      * 查询直播商品列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveGoods:list')")
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:list')")
     @GetMapping("/list")
-    public TableDataInfo list(LiveGoods liveGoods)
+    public TableDataInfo list(LiveGoods liveGoods, @RequestParam(value = "liveId", required = true) Long liveId)
     {
+        // 设置企业ID和企业用户ID
+        setCompanyId(liveGoods);
+        liveGoods.setLiveId(liveId);
+
         startPage();
-        List<LiveGoods> list = liveGoodsService.selectLiveGoodsList(liveGoods);
+        List<LiveGoodsVo> list = liveGoodsService.selectProductListByLiveId(liveGoods);
         return getDataTable(list);
     }
 
     /**
      * 导出直播商品列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveGoods:export')")
+//    @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, "直播商品数据");
@@ -61,43 +69,97 @@ public class LiveGoodsController extends BaseController
     /**
      * 获取直播商品详细信息
      */
-    @PreAuthorize("@ss.hasPermi('live:liveGoods:query')")
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:query')")
     @GetMapping(value = "/{goodsId}")
     public AjaxResult getInfo(@PathVariable("goodsId") Long goodsId)
     {
-        return AjaxResult.success(liveGoodsService.selectLiveGoodsByGoodsId(goodsId));
+        //CompanyUser user = SecurityUtils.getLoginUser().getUser();
+        return AjaxResult.success();
     }
 
     /**
      * 新增直播商品
      */
-    @PreAuthorize("@ss.hasPermi('live:liveGoods:add')")
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:add')")
     @Log(title = "直播商品", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody LiveGoods liveGoods)
+    public AjaxResult add(@RequestBody Map<String, Object> payload)
     {
-        return toAjax(liveGoodsService.insertLiveGoods(liveGoods));
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        //CompanyUser companyUser = companyUserService.selectCompanyUserById(loginUser.getUser().getUserId());
+        SysUser user = loginUser.getUser();
+        return toAjax(liveGoodsService.insertLiveGoodsAdmin(payload, user));
     }
 
     /**
      * 修改直播商品
      */
-    @PreAuthorize("@ss.hasPermi('live:liveGoods:edit')")
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:edit')")
     @Log(title = "直播商品", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody LiveGoods liveGoods)
+    public R edit(@RequestBody LiveGoods liveGoods)
     {
-        return toAjax(liveGoodsService.updateLiveGoods(liveGoods));
+        return liveGoodsService.updateLiveGoods(liveGoods);
     }
 
     /**
      * 删除直播商品
      */
-    @PreAuthorize("@ss.hasPermi('live:liveGoods:remove')")
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:remove')")
     @Log(title = "直播商品", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{goodsIds}")
+    @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 companyUser = companyUserService.selectCompanyUserById(loginUser.getUser().getUserId());
+        //liveGoods.setCompanyId(companyUser.getCompanyId());
+        //liveGoods.setCompanyUserId(companyUser.getUserId());
+    }
+
+
+
+    /**
+     * 获取直播店铺
+     * */
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:query')")
+    @GetMapping("/liveStore/{liveId}")
+    public R liveGoodsStore(@PathVariable Long liveId,@RequestParam String key)
+    {
+        return liveGoodsService.getStoreByLiveId(liveId, key);
+    }
+
+    /**
+     * 批量上下架视频
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:edit')")
+    @PostMapping("/handleShelfOrUn")
+    public R handleShelfOrUn(@RequestBody LiveGoodsListVo listVo) {
+        return liveGoodsService.handleShelfOrUnAdmin(listVo);
+    }
+
+    /**
+     * 批量删除视频
+     */
+    @PostMapping("/handleDeleteSelected")
+    public R handleDeleteSelected(@RequestBody LiveGoodsListVo listVo) {
+        return liveGoodsService.handleDeleteSelectedAdmin(listVo);
+    }
+
+    /**
+     * 更新展示状态
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:edit')")
+    @PostMapping("/handleIsShowChange")
+    public R handleIsShowChange(@RequestBody LiveGoodsListVo listVo) {
+        return liveGoodsService.handleIsShowChange(listVo);
+    }
 }

+ 0 - 103
fs-admin/src/main/java/com/fs/live/controller/LiveGoodsOrderController.java

@@ -1,103 +0,0 @@
-package com.fs.live.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.enums.BusinessType;
-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;
-
-/**
- * 订单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)
-    {
-        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)
-    {
-        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)
-    {
-        return AjaxResult.success(liveGoodsOrderService.selectLiveGoodsOrderByOrderId(orderId));
-    }
-
-    /**
-     * 新增订单
-     */
-    @PreAuthorize("@ss.hasPermi('live:liveOrder:add')")
-    @Log(title = "订单", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody LiveGoodsOrder 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));
-    }
-}

+ 0 - 103
fs-admin/src/main/java/com/fs/live/controller/LiveGoodsOrderItemsController.java

@@ -1,103 +0,0 @@
-package com.fs.live.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.enums.BusinessType;
-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;
-
-/**
- * 订单商品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)
-    {
-        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)
-    {
-        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)
-    {
-        return AjaxResult.success(liveGoodsOrderItemsService.selectLiveGoodsOrderItemsById(id));
-    }
-
-    /**
-     * 新增订单商品
-     */
-    @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));
-    }
-}

+ 143 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveLotteryConfController.java

@@ -0,0 +1,143 @@
+package com.fs.live.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.SecurityUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.live.domain.LiveLotteryConf;
+import com.fs.live.param.LiveLotteryProductSaveParam;
+import com.fs.live.service.ILiveLotteryConfService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 直播抽奖配置Controller
+ *
+ * @author fs
+ * @date 2025-07-17
+ */
+@RestController
+@RequestMapping("/live/liveLotteryConf")
+public class LiveLotteryConfController extends BaseController
+{
+    @Autowired
+    private ILiveLotteryConfService liveLotteryConfService;
+
+    /**
+     * 查询直播抽奖配置列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveLotteryConf liveLotteryConf)
+    {
+        startPage();
+        List<LiveLotteryConf> list = liveLotteryConfService.selectLiveLotteryConfList(liveLotteryConf);
+        return getDataTable(list);
+    }
+
+    @GetMapping("/listOn")
+    public TableDataInfo listOn(LiveLotteryConf liveLotteryConf)
+    {
+        startPage();
+        List<LiveLotteryConf> list = liveLotteryConfService.selectLiveLotteryConfListOn(liveLotteryConf);
+        return getDataTable(list);
+    }
+    /**
+     * 导出直播抽奖配置列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:export')")
+    @Log(title = "直播抽奖配置", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveLotteryConf liveLotteryConf)
+    {
+        List<LiveLotteryConf> list = liveLotteryConfService.selectLiveLotteryConfList(liveLotteryConf);
+        ExcelUtil<LiveLotteryConf> util = new ExcelUtil<LiveLotteryConf>(LiveLotteryConf.class);
+        return util.exportExcel(list, "直播抽奖配置数据");
+    }
+
+    /**
+     * 获取直播抽奖配置详细信息
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:query')")
+    @GetMapping(value = "/{lotteryId}")
+    public AjaxResult getInfo(@PathVariable("lotteryId") Long lotteryId)
+    {
+        return AjaxResult.success(liveLotteryConfService.selectLiveLotteryConfByLotteryId(lotteryId));
+    }
+
+    /**
+     * 新增直播抽奖配置
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:add')")
+    @Log(title = "直播抽奖配置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveLotteryConf liveLotteryConf)
+    {
+        return toAjax(liveLotteryConfService.insertLiveLotteryConf(liveLotteryConf));
+    }
+
+    /**
+     * 修改直播抽奖配置
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:edit')")
+    @Log(title = "直播抽奖配置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public R edit(@RequestBody LiveLotteryConf liveLotteryConf)
+    {
+        return liveLotteryConfService.updateLiveLotteryConf(liveLotteryConf);
+    }
+
+    /**
+     * 删除直播抽奖配置
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:remove')")
+    @Log(title = "直播抽奖配置", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{lotteryIds}")
+    public AjaxResult remove(@PathVariable Long[] lotteryIds)
+    {
+        return toAjax(liveLotteryConfService.deleteLiveLotteryConfByLotteryIds(lotteryIds));
+    }
+
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:query')")
+    @GetMapping("/live/{liveId}")
+    public List<LiveLotteryConf> getByLiveId(@PathVariable Long liveId) {
+        return liveLotteryConfService.getByLiveId(liveId);
+    }
+
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:remove')")
+    @DeleteMapping("/{id}")
+    public void delete(@PathVariable Long id) {
+        liveLotteryConfService.delete(id);
+    }
+
+    /**
+     * 发起抽奖
+     * */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:edit')")
+    @GetMapping("/start/{lotteryId}")
+    public String  start(@PathVariable Long lotteryId) {
+       return liveLotteryConfService.startLottery(lotteryId, SecurityUtils.getLoginUser().getUser().getUserId());
+    }
+
+    /** 查询抽奖配置的所有商品信息*/
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:query')")
+    @GetMapping("/getGoods/{lotteryId}")
+    public R getGoods(@PathVariable Long lotteryId) {
+        return R.ok().put("data",liveLotteryConfService.getGoods(lotteryId));
+    }
+
+    /** 抽奖商品配置保存*/
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:edit')")
+    @PostMapping("/product")
+    public void saveGoods(@RequestBody LiveLotteryProductSaveParam liveLotteryProducts) {
+        //liveLotteryProducts.setCreateBy(getUsername());
+        liveLotteryConfService.saveProducts(liveLotteryProducts);
+    }
+
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveLotteryRecordController.java

@@ -0,0 +1,97 @@
+package com.fs.live.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.live.domain.LiveLotteryRecord;
+import com.fs.live.service.ILiveLotteryRecordService;
+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-07-17
+ */
+@RestController
+@RequestMapping("/live/liveLotteryRecord")
+public class LiveLotteryRecordController extends BaseController
+{
+    @Autowired
+    private ILiveLotteryRecordService liveLotteryRecordService;
+
+    /**
+     * 查询直播抽奖记录列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveLotteryRecord liveLotteryRecord)
+    {
+        startPage();
+        List<LiveLotteryRecord> list = liveLotteryRecordService.selectLiveLotteryRecordList(liveLotteryRecord);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播抽奖记录列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:export')")
+    @Log(title = "直播抽奖记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveLotteryRecord liveLotteryRecord)
+    {
+        List<LiveLotteryRecord> list = liveLotteryRecordService.selectLiveLotteryRecordList(liveLotteryRecord);
+        ExcelUtil<LiveLotteryRecord> util = new ExcelUtil<LiveLotteryRecord>(LiveLotteryRecord.class);
+        return util.exportExcel(list, "直播抽奖记录数据");
+    }
+
+    /**
+     * 获取直播抽奖记录详细信息
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:query')")
+    @GetMapping(value = "/{lotteryId}")
+    public AjaxResult getInfo(@PathVariable("lotteryId") Long lotteryId)
+    {
+        return AjaxResult.success(liveLotteryRecordService.selectLiveLotteryRecordByLotteryId(lotteryId));
+    }
+
+    /**
+     * 新增直播抽奖记录
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:add')")
+    @Log(title = "直播抽奖记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveLotteryRecord liveLotteryRecord)
+    {
+        return toAjax(liveLotteryRecordService.insertLiveLotteryRecord(liveLotteryRecord));
+    }
+
+    /**
+     * 修改直播抽奖记录
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:edit')")
+    @Log(title = "直播抽奖记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveLotteryRecord liveLotteryRecord)
+    {
+        return toAjax(liveLotteryRecordService.updateLiveLotteryRecord(liveLotteryRecord));
+    }
+
+    /**
+     * 删除直播抽奖记录
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:remove')")
+    @Log(title = "直播抽奖记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{lotteryIds}")
+    public AjaxResult remove(@PathVariable Long[] lotteryIds)
+    {
+        return toAjax(liveLotteryRecordService.deleteLiveLotteryRecordByLotteryIds(lotteryIds));
+    }
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveLotteryRegistrationController.java

@@ -0,0 +1,97 @@
+package com.fs.live.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.live.domain.LiveLotteryRegistration;
+import com.fs.live.service.ILiveLotteryRegistrationService;
+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-07-17
+ */
+@RestController
+@RequestMapping("/live/liveLotteryRegistration")
+public class LiveLotteryRegistrationController extends BaseController
+{
+    @Autowired
+    private ILiveLotteryRegistrationService liveLotteryRegistrationService;
+
+    /**
+     * 查询直播抽奖登记列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveLotteryRegistration liveLotteryRegistration)
+    {
+        startPage();
+        List<LiveLotteryRegistration> list = liveLotteryRegistrationService.selectLiveLotteryRegistrationList(liveLotteryRegistration);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播抽奖登记列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:export')")
+    @Log(title = "直播抽奖登记", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveLotteryRegistration liveLotteryRegistration)
+    {
+        List<LiveLotteryRegistration> list = liveLotteryRegistrationService.selectLiveLotteryRegistrationList(liveLotteryRegistration);
+        ExcelUtil<LiveLotteryRegistration> util = new ExcelUtil<LiveLotteryRegistration>(LiveLotteryRegistration.class);
+        return util.exportExcel(list, "直播抽奖登记数据");
+    }
+
+    /**
+     * 获取直播抽奖登记详细信息
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:query')")
+    @GetMapping(value = "/{registrationId}")
+    public AjaxResult getInfo(@PathVariable("registrationId") Long registrationId)
+    {
+        return AjaxResult.success(liveLotteryRegistrationService.selectLiveLotteryRegistrationByRegistrationId(registrationId));
+    }
+
+    /**
+     * 新增直播抽奖登记
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:add')")
+    @Log(title = "直播抽奖登记", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveLotteryRegistration liveLotteryRegistration)
+    {
+        return toAjax(liveLotteryRegistrationService.insertLiveLotteryRegistration(liveLotteryRegistration));
+    }
+
+    /**
+     * 修改直播抽奖登记
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:edit')")
+    @Log(title = "直播抽奖登记", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveLotteryRegistration liveLotteryRegistration)
+    {
+        return toAjax(liveLotteryRegistrationService.updateLiveLotteryRegistration(liveLotteryRegistration));
+    }
+
+    /**
+     * 删除直播抽奖登记
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:remove')")
+    @Log(title = "直播抽奖登记", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{registrationIds}")
+    public AjaxResult remove(@PathVariable Long[] registrationIds)
+    {
+        return toAjax(liveLotteryRegistrationService.deleteLiveLotteryRegistrationByRegistrationIds(registrationIds));
+    }
+}

+ 14 - 20
fs-admin/src/main/java/com/fs/live/controller/LiveMsgController.java

@@ -1,28 +1,22 @@
 package com.fs.live.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
  */
@@ -36,7 +30,7 @@ public class LiveMsgController extends BaseController
     /**
      * 查询直播讨论列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveMsg:list')")
+//    @PreAuthorize("@ss.hasPermi('live:liveMsg:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveMsg liveMsg)
     {
@@ -48,7 +42,7 @@ public class LiveMsgController extends BaseController
     /**
      * 导出直播讨论列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveMsg:export')")
+//    @PreAuthorize("@ss.hasPermi('live:liveMsg:export')")
     @Log(title = "直播讨论", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveMsg liveMsg)
@@ -61,7 +55,7 @@ public class LiveMsgController extends BaseController
     /**
      * 获取直播讨论详细信息
      */
-    @PreAuthorize("@ss.hasPermi('live:liveMsg:query')")
+//    @PreAuthorize("@ss.hasPermi('live:liveMsg:query')")
     @GetMapping(value = "/{msgId}")
     public AjaxResult getInfo(@PathVariable("msgId") Long msgId)
     {
@@ -71,7 +65,7 @@ public class LiveMsgController extends BaseController
     /**
      * 新增直播讨论
      */
-    @PreAuthorize("@ss.hasPermi('live:liveMsg:add')")
+//    @PreAuthorize("@ss.hasPermi('live:liveMsg:add')")
     @Log(title = "直播讨论", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody LiveMsg liveMsg)
@@ -82,7 +76,7 @@ public class LiveMsgController extends BaseController
     /**
      * 修改直播讨论
      */
-    @PreAuthorize("@ss.hasPermi('live:liveMsg:edit')")
+//    @PreAuthorize("@ss.hasPermi('live:liveMsg:edit')")
     @Log(title = "直播讨论", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody LiveMsg liveMsg)
@@ -93,7 +87,7 @@ public class LiveMsgController extends BaseController
     /**
      * 删除直播讨论
      */
-    @PreAuthorize("@ss.hasPermi('live:liveMsg:remove')")
+//    @PreAuthorize("@ss.hasPermi('live:liveMsg:remove')")
     @Log(title = "直播讨论", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{msgIds}")
     public AjaxResult remove(@PathVariable Long[] msgIds)

+ 434 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveOrderController.java

@@ -0,0 +1,434 @@
+package com.fs.live.controller;
+
+import cn.hutool.core.util.StrUtil;
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.ParseUtils;
+import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.StringUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.company.param.CompanyStoreOrderMoneyLogsListParam;
+import com.fs.company.service.ICompanyMoneyLogsService;
+import com.fs.company.vo.CompanyStoreOrderMoneyLogsVO;
+import com.fs.crm.domain.CrmCustomer;
+import com.fs.crm.service.ICrmCustomerService;
+import com.fs.erp.domain.ErpDeliverys;
+import com.fs.erp.domain.ErpOrderQuery;
+import com.fs.erp.dto.ErpOrderQueryRequert;
+import com.fs.erp.dto.ErpOrderQueryResponse;
+import com.fs.erp.service.IErpOrderService;
+import com.fs.framework.web.service.TokenService;
+import com.fs.his.domain.FsUser;
+import com.fs.his.service.IFsExpressService;
+import com.fs.his.service.IFsUserService;
+import com.fs.hisStore.param.*;
+import com.fs.live.domain.LiveOrder;
+import com.fs.live.domain.LiveOrderItem;
+import com.fs.live.domain.LiveOrderLogs;
+import com.fs.live.domain.LiveOrderPayment;
+import com.fs.live.enums.LiveOrderCancleReason;
+import com.fs.live.service.ILiveOrderItemService;
+import com.fs.live.service.ILiveOrderLogsService;
+import com.fs.live.service.ILiveOrderPaymentService;
+import com.fs.live.service.ILiveOrderService;
+import com.fs.live.vo.LiveGoodsVo;
+import com.fs.live.vo.LiveOrderPaymentVo;
+import com.fs.live.vo.LiveOrderVo;
+import com.fs.store.domain.FsStoreDelivers;
+import com.fs.task.LiveTask;
+import io.swagger.annotations.ApiOperation;
+import org.apache.http.util.Asserts;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+
+/**`
+ * 订单Controller
+ *
+ * @author fs
+ * @date 2025-07-08
+ */
+@RestController
+@RequestMapping("/live/liveOrder")
+public class LiveOrderController extends BaseController
+{
+    @Autowired
+    private ILiveOrderService liveOrderService;
+    @Autowired
+    private ICrmCustomerService crmCustomerService;
+    @Autowired
+    private IFsUserService userService;
+    @Autowired
+    private ILiveOrderItemService orderItemService;
+    @Autowired
+    private ILiveOrderLogsService orderLogsService;
+    @Autowired
+    private ILiveOrderPaymentService orderPaymentService;
+    @Autowired
+    private TokenService tokenService;
+    @Autowired
+    private IFsExpressService expressService;
+//    @Autowired
+//    private FsWarehousesMapper fsWarehousesMapper;
+    @Autowired
+    IErpOrderService erpOrderService;
+    @Autowired
+    private LiveTask liveTask;
+
+    /**
+     * 查询订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveOrder liveOrder)
+    {
+        startPage();
+        List<LiveOrder> list = liveOrderService.selectLiveOrderList(liveOrder);
+        for (LiveOrder vo : list){
+            vo.setUserPhone(ParseUtils.parsePhone(vo.getUserPhone()));
+        }
+        return getDataTable(list);
+    }
+
+
+    /**
+     * 导出订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:export')")
+    @Log(title = "订单", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveOrder liveOrder)
+    {
+        List<LiveOrder> list = liveOrderService.selectLiveOrderList(liveOrder);
+        ExcelUtil<LiveOrder> util = new ExcelUtil<LiveOrder>(LiveOrder.class);
+        return util.exportExcel(list, "订单数据");
+    }
+
+    /**
+     * 获取订单详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:query')")
+    @GetMapping(value = "/info/{orderId}")
+    public AjaxResult getInfo(@PathVariable("orderId") String orderId)
+    {
+        return AjaxResult.success(liveOrderService.selectLiveOrderByOrderId(orderId));
+    }
+
+
+    /**
+     * 新增订单
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:add')")
+    @Log(title = "订单", businessType = BusinessType.INSERT)
+    @PostMapping("/create")
+    public R add(@RequestBody LiveOrder liveOrder)
+    {
+        return R.ok().put("data", liveOrderService.insertLiveOrder(liveOrder));
+    }
+
+    /**
+     * 修改订单
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:edit')")
+    @Log(title = "订单", businessType = BusinessType.UPDATE)
+    @PutMapping("/update")
+    public AjaxResult edit(@RequestBody LiveOrder liveOrder)
+    {
+        return toAjax(liveOrderService.updateLiveOrder(liveOrder));
+    }
+
+    /**
+     * 支付订单
+     * */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:pay')")
+    @PostMapping(value = "/pay")
+    public void pay(LiveOrder liveOrder)
+    {
+       liveOrderService.handlePay(liveOrder);
+    }
+
+    /**
+     * 取消订单确认
+     * */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:edit')")
+    @GetMapping(value = "/cancelConfirm/{orderId}")
+    public R cancelConfirm(@PathVariable String orderId)
+    {
+        LiveOrder byId = liveOrderService.getById(orderId);
+        List<Map<String, String>> allCodeDescMap = LiveOrderCancleReason.getAllCodeDescMap();
+        return R.ok().put("reason",allCodeDescMap).put("data",byId);
+    }
+
+    /**
+     * 按照时间粒度返回订单
+     * */
+    @GetMapping(value = "/getLiveOrderTimeGranularity")
+    public R getLiveOrderTimeGranularity(LiveOrderVo liveOrder){
+        return liveOrderService.getLiveOrderTimeGranularity(liveOrder);
+    }
+
+
+    @Log(title = "同步物流", businessType = BusinessType.UPDATE)
+    @GetMapping(value = "/syncExpress/{id}")
+    public R syncExpress(@PathVariable("id") Long id) {
+        return liveOrderService.syncExpress(id);
+    }
+
+
+    /**
+     * 查询订单商品列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:query')")
+    @GetMapping("/ltemlist/{orderId}")
+    public TableDataInfo ltemlist(@PathVariable("orderId") String orderId)
+    {
+        List<LiveGoodsVo> list = liveOrderService.selectLiveOrderItemList(orderId);
+        return getDataTable(list);
+    }
+
+    @GetMapping("/test")
+    public R test()
+    {
+        liveTask.updateExpress();
+        return R.ok();
+    }
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:refundOrderMoney')")
+    @Log(title = "退款", businessType = BusinessType.UPDATE)
+//    @PreAuthorize("@ss.hasPermi('live:liveOrder:refundOrderMoney')")
+    @PostMapping("/refundOrderMoney")
+    public synchronized R refundOrderMoney(@Validated @RequestBody FsStoreOrderRefundParam param, HttpServletRequest request) {
+        return liveOrderService.refundOrderMoney(param.getOrderId());
+    }
+
+    /**
+     * 获取订单详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:query')")
+    @GetMapping(value = "/{id}")
+    public R getInfo(@PathVariable("id") Long id)
+    {
+        LiveOrder order=liveOrderService.selectLiveOrderByOrderId(String.valueOf(id));
+        order.setUserPhone(ParseUtils.parsePhone(order.getUserPhone()));
+        order.setUserAddress(ParseUtils.parseAddress(order.getUserAddress()));
+        FsUser user=userService.selectFsUserById(Long.valueOf(order.getUserId()));
+        user.setPhone(ParseUtils.parsePhone(user.getPhone()));
+        List<LiveOrderItem> items=orderItemService.selectCheckedByOrderId(id);
+//        FsStoreOrderStatus statusMap=new FsStoreOrderStatus();
+
+        List<LiveOrderLogs> logs=orderLogsService.selectLiveOrderLogsByOrderId(id);
+        List<LiveOrderPayment> payments=orderPaymentService.selectLiveOrderPaymentByOrderId(id);
+
+        CrmCustomer customer=null;
+        if(order.getCustomerId()!=null&&order.getCustomerId()>0){
+            customer=crmCustomerService.selectCrmCustomerById(order.getCustomerId());
+        }
+        return R.ok().put("order", order).put("items", items).put("logs",logs).put("user",user).put("customer",customer).put("payments",payments) ;
+    }
+
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:query')")
+    @GetMapping(value = "/payments/{id}")
+    public R getOrderPayments(@PathVariable("id") Long id){
+        List<LiveOrderPayment> payments=orderPaymentService.selectLiveOrderPaymentByOrderId(id);
+        return R.ok().put("payments",payments);
+    }
+//    @Autowired
+//    private FsStoreDeliversMapper fsStoreDeliversMapper;
+    @GetMapping(value = "/express/{id}")
+    public R getExpress(@PathVariable("id") Long id){
+//        List<FsStoreDelivers> data = fsStoreDeliversMapper.findByOrderIdWithType(id, 1);
+        return R.ok().put("data","123");
+    }
+
+    @Autowired
+    private ICompanyMoneyLogsService moneyLogsService;
+
+    @GetMapping(value = "/tuiMoneyLogs")
+    public R tuiMoneyLogs(@RequestParam("orderId") String orderId){
+        LiveOrder liveOrder = liveOrderService.selectLiveOrderByOrderId(orderId);
+        List<CompanyStoreOrderMoneyLogsVO> tuiMoneyLogs=new ArrayList<>();
+        if(liveOrder.getCompanyId()!=null){
+            CompanyStoreOrderMoneyLogsListParam moneyLogsMap=new CompanyStoreOrderMoneyLogsListParam();
+            moneyLogsMap.setCompanyId(liveOrder.getCompanyId());
+            moneyLogsMap.setBusinessId(liveOrder.getOrderId().toString());
+//            moneyLogsMap.setType(1);
+            tuiMoneyLogs=moneyLogsService.selectCompanyStoreOrderMoneyLogsList(moneyLogsMap);
+        }
+        return R.ok().put("data",tuiMoneyLogs);
+    }
+
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:query')")
+    @GetMapping(value = "/logs/{id}")
+    public R getOrderLogs(@PathVariable("id") Long id){
+        List<LiveOrderLogs> logs=orderLogsService.selectLiveOrderLogsByOrderId(id);
+        return R.ok().put("logs",logs);
+    }
+
+    @GetMapping(value = "/queryAddress/{id}")
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:queryAddress')")
+    public R getAddress(@PathVariable("id") Long id)
+    {
+        LiveOrder order = liveOrderService.selectLiveOrderByOrderId(String.valueOf(id));
+        String address = order.getUserAddress();
+        return R.ok().put("address",address);
+    }
+    @GetMapping(value = "/queryPhone/{id}")
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:queryPhone')")
+    @Log(title = "查看电话", businessType = BusinessType.GRANT)
+    public R getPhone(@PathVariable("id") Long id)
+    {
+        LiveOrder order = liveOrderService.selectLiveOrderByOrderId(String.valueOf(id));
+        String userPhone = order.getUserPhone();
+        return R.ok().put("userPhone",userPhone);
+    }
+
+    /**
+     * 根据orderId查询
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:query')")
+    @GetMapping("/getByOrderId/{orderId}")
+    public R getByOrderId(@PathVariable Long orderId) {
+        LiveOrder liveOrder = liveOrderService.selectLiveOrderByOrderId(String.valueOf(orderId));
+        return R.ok().put("data",liveOrder);
+    }
+
+    @ApiOperation("物流查询")
+    @PostMapping("/getExpressByDeliverId")
+    public R getExpressByDeliverId(@Validated @RequestBody FsStoreOrderExpressParam param, HttpServletRequest request){
+//        return expressService.getLiveExpressByDeliverId(param);
+        return R.ok();
+    }
+
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:auditPayRemain')")
+    @PostMapping("/auditPayRemain")
+    public R auditPayRemain(@Validated @RequestBody FsStoreOrderAuditPayRemainParam param, HttpServletRequest request) {
+        return liveOrderService.auditPayRemain(param.getOrderId());
+    }
+
+    @Log(title = "分佣", businessType = BusinessType.UPDATE)
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:addTuiMoney')")
+    @PostMapping("/addTuiMoney")
+    public R addTuiMoney(@Validated @RequestBody FsStoreOrderAddTuiMoneyParam param, HttpServletRequest request) {
+        return liveOrderService.addTuiMoney(param);
+    }
+
+    @Log(title = "同步物流", businessType = BusinessType.UPDATE)
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:syncExpress')")
+    @PostMapping("/syncExpress")
+    public R syncExpress(@Validated @RequestBody FsStoreOrderExpressEditParam param, HttpServletRequest request) {
+        return liveOrderService.syncExpress(param.getOrderId());
+    }
+
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:updateExpress')")
+    @PostMapping("/updateExpress")
+    public R updateExpress(@Validated @RequestBody FsStoreOrderExpressEditParam param, HttpServletRequest request) {
+        return liveOrderService.updateExpress(param.getOrderId());
+    }
+
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:getEroOrder')")
+    @GetMapping("/getEroOrder")
+    public R getEroOrder(@RequestParam("extendOrderId") String extendOrderId) {
+        ErpOrderQueryRequert request = new ErpOrderQueryRequert();
+        request.setCode(extendOrderId);
+        if(StringUtils.isEmpty(extendOrderId)) return R.error("物流订单ID为空!");
+
+        LiveOrder order = liveOrderService.selectLiveOrderByExtendId(extendOrderId);
+
+        // 根据仓库code找erp
+//        if(com.fs.common.utils.StringUtils.isNotBlank(order.getStoreHouseCode())){
+//            String erp = fsWarehousesMapper.selectErpByCode(order.getStoreHouseCode());
+//            ErpContextHolder.setErpType(erp);
+//        }
+
+//        ErpOrderQueryResponse response = erpOrderService.getOrderLive(request);
+        return R.ok().put("data","123");
+    }
+
+    @Log(title = "冻结、解冻佣金", businessType = BusinessType.UPDATE)
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:editTuiMoney')")
+    @PostMapping("/editTuiMoney")
+    public R editTuiMoney(@Validated @RequestBody FsStoreOrderEditTuiMoneyParam param, HttpServletRequest request) {
+        return liveOrderService.editTuiMoney(param.getOrderId());
+    }
+
+    @Log(title = "确认订单", businessType = BusinessType.UPDATE)
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:finishOrder')")
+    @PostMapping("/finishOrder")
+    public R finishOrder(@Validated @RequestBody FsStoreOrderFinishParam param, HttpServletRequest request) {
+        return liveOrderService.finishOrder(param.getOrderId());
+    }
+
+    /**
+     * 修改物流
+     * @param deliveryDTO
+     * @return AjaxResult
+     */
+    @Log(title = "修改物流", businessType = BusinessType.UPDATE)
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:editDeliveryId')")
+    @PutMapping("/editDeliveryId")
+    public AjaxResult editDeliveryId(@RequestBody FsStoreDelivers deliveryDTO) {
+        liveOrderService.editLiveOrderDeliveryId(deliveryDTO);
+        return AjaxResult.success();
+    }
+
+
+    @Log(title = "手动推管易", businessType = BusinessType.INSERT)
+    @ApiOperation("创建ERP订单")
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:createErpOrder')")
+    @GetMapping("/createErpOrder")
+    public R createErpOrder(@RequestParam("orderCode") String orderCode) throws Exception
+    {
+        logger.info("手动推管易 订单号: {}",orderCode);
+        LiveOrder order=liveOrderService.selectOrderIdByOrderCode(orderCode);
+        liveOrderService.createOmsOrder(order.getOrderId());
+        return R.ok();
+    }
+
+    @Log(title = "同步管易物流单号", businessType = BusinessType.UPDATE)
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:updateErpOrder')")
+    @PostMapping("/updateErpOrder")
+    public R updateErpOrder(@Validated @RequestBody FsStoreOrderExpressEditParam param) {
+//        LiveOrder order = liveOrderService.selectLiveOrderByOrderId(String.valueOf(param.getOrderId()));
+//        ErpOrderQueryRequert request = new ErpOrderQueryRequert();
+//        request.setCode(order.getExtendOrderId());
+//
+//        // 根据仓库code找erp
+//        if(com.fs.common.utils.StringUtils.isNotBlank(order.getStoreHouseCode())){
+//            String erp = fsWarehousesMapper.selectErpByCode(order.getStoreHouseCode());
+//            ErpContextHolder.setErpType(erp);
+//        }
+//
+//        ErpOrderQueryResponse response = erpOrderService.getOrderLive(request);
+//        if(response.getOrders()!=null&&response.getOrders().size()>0){
+//            for(ErpOrderQuery orderQuery : response.getOrders()){
+//                if(orderQuery.getDeliverys()!=null&&orderQuery.getDeliverys().size()>0){
+//                    for(ErpDeliverys delivery:orderQuery.getDeliverys()){
+//                        if(delivery.getDelivery()&& StringUtils.isNotEmpty(delivery.getMail_no())){
+//                            //更新商订单状态
+//                            liveOrderService.updateDeliveryOrder(param.getOrderId(), delivery.getMail_no(),delivery.getExpress_code(),delivery.getExpress_name());
+//                            return R.ok();
+//                        }
+//                    }
+//
+//                }
+//            }
+//        }
+        return R.error("未查询到快递信息");
+    }
+
+
+
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveOrderItemController.java

@@ -0,0 +1,97 @@
+package com.fs.live.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.live.domain.LiveOrderItem;
+import com.fs.live.service.ILiveOrderItemService;
+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-07-08
+ */
+@RestController
+@RequestMapping("/live/liveOrderItem")
+public class LiveOrderItemController extends BaseController
+{
+    @Autowired
+    private ILiveOrderItemService liveOrderItemService;
+
+    /**
+     * 查询订单详情列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderItem:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveOrderItem liveOrderItem)
+    {
+        startPage();
+        List<LiveOrderItem> list = liveOrderItemService.selectLiveOrderItemList(liveOrderItem);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出订单详情列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderItem:export')")
+    @Log(title = "订单详情", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveOrderItem liveOrderItem)
+    {
+        List<LiveOrderItem> list = liveOrderItemService.selectLiveOrderItemList(liveOrderItem);
+        ExcelUtil<LiveOrderItem> util = new ExcelUtil<LiveOrderItem>(LiveOrderItem.class);
+        return util.exportExcel(list, "订单详情数据");
+    }
+
+    /**
+     * 获取订单详情详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderItem:query')")
+    @GetMapping(value = "/{itemId}")
+    public AjaxResult getInfo(@PathVariable("itemId") String itemId)
+    {
+        return AjaxResult.success(liveOrderItemService.selectLiveOrderItemByItemId(itemId));
+    }
+
+    /**
+     * 新增订单详情
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderItem:add')")
+    @Log(title = "订单详情", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveOrderItem liveOrderItem)
+    {
+        return toAjax(liveOrderItemService.insertLiveOrderItem(liveOrderItem));
+    }
+
+    /**
+     * 修改订单详情
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderItem:edit')")
+    @Log(title = "订单详情", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveOrderItem liveOrderItem)
+    {
+        return toAjax(liveOrderItemService.updateLiveOrderItem(liveOrderItem));
+    }
+
+    /**
+     * 删除订单详情
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderItem:remove')")
+    @Log(title = "订单详情", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{itemIds}")
+    public AjaxResult remove(@PathVariable String[] itemIds)
+    {
+        return toAjax(liveOrderItemService.deleteLiveOrderItemByItemIds(itemIds));
+    }
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveOrderLogsController.java

@@ -0,0 +1,97 @@
+package com.fs.live.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.live.domain.LiveOrderLogs;
+import com.fs.live.service.ILiveOrderLogsService;
+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-07-08
+ */
+@RestController
+@RequestMapping("/live/liveOrderLogs")
+public class LiveOrderLogsController extends BaseController
+{
+    @Autowired
+    private ILiveOrderLogsService liveOrderLogsService;
+
+    /**
+     * 查询订单操作记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderLogs:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveOrderLogs liveOrderLogs)
+    {
+        startPage();
+        List<LiveOrderLogs> list = liveOrderLogsService.selectLiveOrderLogsList(liveOrderLogs);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出订单操作记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderLogs:export')")
+    @Log(title = "订单操作记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveOrderLogs liveOrderLogs)
+    {
+        List<LiveOrderLogs> list = liveOrderLogsService.selectLiveOrderLogsList(liveOrderLogs);
+        ExcelUtil<LiveOrderLogs> util = new ExcelUtil<LiveOrderLogs>(LiveOrderLogs.class);
+        return util.exportExcel(list, "订单操作记录数据");
+    }
+
+    /**
+     * 获取订单操作记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderLogs:query')")
+    @GetMapping(value = "/{logsId}")
+    public AjaxResult getInfo(@PathVariable("logsId") String logsId)
+    {
+        return AjaxResult.success(liveOrderLogsService.selectLiveOrderLogsByLogsId(logsId));
+    }
+
+    /**
+     * 新增订单操作记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderLogs:add')")
+    @Log(title = "订单操作记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveOrderLogs liveOrderLogs)
+    {
+        return toAjax(liveOrderLogsService.insertLiveOrderLogs(liveOrderLogs));
+    }
+
+    /**
+     * 修改订单操作记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderLogs:edit')")
+    @Log(title = "订单操作记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveOrderLogs liveOrderLogs)
+    {
+        return toAjax(liveOrderLogsService.updateLiveOrderLogs(liveOrderLogs));
+    }
+
+    /**
+     * 删除订单操作记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderLogs:remove')")
+    @Log(title = "订单操作记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{logsIds}")
+    public AjaxResult remove(@PathVariable String[] logsIds)
+    {
+        return toAjax(liveOrderLogsService.deleteLiveOrderLogsByLogsIds(logsIds));
+    }
+}

+ 113 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveOrderPaymentController.java

@@ -0,0 +1,113 @@
+package com.fs.live.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.ParseUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.live.domain.LiveOrderPayment;
+import com.fs.live.service.ILiveOrderPaymentService;
+import com.fs.live.vo.LiveOrderPaymentVo;
+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-08-07
+ */
+@RestController
+@RequestMapping("/live/order/payment")
+public class LiveOrderPaymentController extends BaseController
+{
+    @Autowired
+    private ILiveOrderPaymentService liveOrderPaymentService;
+
+    /**
+     * 查询支付明细列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:order:payment:query')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveOrderPayment liveOrderPayment)
+    {
+        startPage();
+        List<LiveOrderPayment> list = liveOrderPaymentService.selectLiveOrderPaymentList(liveOrderPayment);
+        return getDataTable(list);
+    }
+    /**
+     * 查询支付明细列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:order:payment:query')")
+    @GetMapping
+    public TableDataInfo listNew(LiveOrderPaymentVo liveOrderPayment)
+    {
+        startPage();
+        List<LiveOrderPaymentVo> list = liveOrderPaymentService.selectLiveOrderPaymentVoList(liveOrderPayment);
+        for (LiveOrderPaymentVo vo : list){
+            vo.setUserPhone(ParseUtils.parsePhone(vo.getUserPhone()));
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出支付明细列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:order:payment:export')")
+    @Log(title = "支付明细", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveOrderPayment liveOrderPayment)
+    {
+        List<LiveOrderPayment> list = liveOrderPaymentService.selectLiveOrderPaymentList(liveOrderPayment);
+        ExcelUtil<LiveOrderPayment> util = new ExcelUtil<LiveOrderPayment>(LiveOrderPayment.class);
+        return util.exportExcel(list, "支付明细数据");
+    }
+
+    /**
+     * 获取支付明细详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:order:payment:query')")
+    @GetMapping(value = "/{paymentId}")
+    public AjaxResult getInfo(@PathVariable("paymentId") Long paymentId)
+    {
+        return AjaxResult.success(liveOrderPaymentService.selectLiveOrderPaymentByPaymentIdNew(paymentId));
+    }
+
+    /**
+     * 新增支付明细
+     */
+    @PreAuthorize("@ss.hasPermi('live:order:payment:edit')")
+    @Log(title = "支付明细", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveOrderPayment liveOrderPayment)
+    {
+        return toAjax(liveOrderPaymentService.insertLiveOrderPayment(liveOrderPayment));
+    }
+
+    /**
+     * 修改支付明细
+     */
+    @PreAuthorize("@ss.hasPermi('live:order:payment:edit')")
+    @Log(title = "支付明细", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveOrderPayment liveOrderPayment)
+    {
+        return toAjax(liveOrderPaymentService.updateLiveOrderPayment(liveOrderPayment));
+    }
+
+    /**
+     * 删除支付明细
+     */
+    @PreAuthorize("@ss.hasPermi('live:order:payment:remove')")
+    @Log(title = "支付明细", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{paymentIds}")
+    public AjaxResult remove(@PathVariable Long[] paymentIds)
+    {
+        return toAjax(liveOrderPaymentService.deleteLiveOrderPaymentByPaymentIds(paymentIds));
+    }
+}

+ 0 - 103
fs-admin/src/main/java/com/fs/live/controller/LiveQuestionController.java

@@ -1,103 +0,0 @@
-package com.fs.live.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.enums.BusinessType;
-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;
-
-/**
- * 问答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)
-    {
-        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)
-    {
-        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)
-    {
-        return AjaxResult.success(liveQuestionService.selectLiveQuestionByQuestionId(questionId));
-    }
-
-    /**
-     * 新增问答
-     */
-    @PreAuthorize("@ss.hasPermi('live:liveQuestion:add')")
-    @Log(title = "问答", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody LiveQuestion 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));
-    }
-}

+ 125 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveRedConfController.java

@@ -0,0 +1,125 @@
+package com.fs.live.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.SecurityUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.live.domain.LiveRedConf;
+import com.fs.live.service.ILiveRedConfService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 直播红包记录配置Controller
+ *
+ * @author fs
+ * @date 2025-07-17
+ */
+@RestController
+@RequestMapping("/live/liveRedConf")
+public class LiveRedConfController extends BaseController
+{
+    @Autowired
+    private ILiveRedConfService liveRedConfService;
+
+    /**
+     * 查询直播红包记录配置列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveRedConf liveRedConf)
+    {
+        startPage();
+        List<LiveRedConf> list = liveRedConfService.selectLiveRedConfList(liveRedConf);
+        return getDataTable(list);
+    }
+
+    @GetMapping("/listOn")
+    public TableDataInfo listOn(LiveRedConf liveRedConf)
+    {
+        startPage();
+        List<LiveRedConf> list = liveRedConfService.selectLiveRedConfListOn(liveRedConf);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播红包记录配置列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:export')")
+    @Log(title = "直播红包记录配置", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveRedConf liveRedConf)
+    {
+        List<LiveRedConf> list = liveRedConfService.selectLiveRedConfList(liveRedConf);
+        ExcelUtil<LiveRedConf> util = new ExcelUtil<LiveRedConf>(LiveRedConf.class);
+        return util.exportExcel(list, "直播红包记录配置数据");
+    }
+
+    /**
+     * 获取直播红包记录配置详细信息
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:query')")
+    @GetMapping(value = "/{redId}")
+    public AjaxResult getInfo(@PathVariable("redId") Long redId)
+    {
+        return AjaxResult.success(liveRedConfService.selectLiveRedConfByRedId(redId));
+    }
+
+    /**
+     * 新增直播红包记录配置
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:add')")
+    @Log(title = "直播红包记录配置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveRedConf liveRedConf)
+    {
+        return toAjax(liveRedConfService.insertLiveRedConf(liveRedConf));
+    }
+
+    /**
+     * 修改直播红包记录配置
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:edit')")
+    @Log(title = "直播红包记录配置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public R edit(@RequestBody LiveRedConf liveRedConf)
+    {
+        liveRedConfService.updateLiveRedConf(liveRedConf);
+        return R.ok(liveRedConf.getRedStatus().toString());
+    }
+
+    /**
+     * 删除直播红包记录配置
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:remove')")
+    @Log(title = "直播红包记录配置", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{redIds}")
+    public AjaxResult remove(@PathVariable Long[] redIds)
+    {
+        return toAjax(liveRedConfService.deleteLiveRedConfByRedIds(redIds));
+    }
+
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:query')")
+    @GetMapping("/live/{liveId}")
+    public List<LiveRedConf> getByLiveId(@PathVariable Long liveId) {
+        return liveRedConfService.getByLiveId(liveId);
+    }
+
+    /**
+     * 点击发放红包
+     * */
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:edit')")
+    @PostMapping("/start/{redId}")
+    public String start(@PathVariable String redId) {
+        return liveRedConfService.start(redId, SecurityUtils.getLoginUser().getUser().getUserId());
+    }
+
+
+
+}

+ 4 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveRedController.java

@@ -0,0 +1,4 @@
+package com.fs.live.controller;
+
+public class LiveRedController {
+}

+ 125 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveRewardRecordController.java

@@ -0,0 +1,125 @@
+package com.fs.live.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.live.domain.LiveRewardRecord;
+import com.fs.live.service.ILiveRewardRecordService;
+import com.fs.live.vo.LiveRewardRecordStatisticsVo;
+import com.fs.live.vo.LiveRewardRecordVo;
+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-08-27
+ */
+@RestController
+@RequestMapping("/live/record")
+public class LiveRewardRecordController extends BaseController
+{
+    @Autowired
+    private ILiveRewardRecordService liveRewardRecordService;
+
+    /**
+     * 查询用户直播间奖励记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:record:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveRewardRecord liveRewardRecord)
+    {
+        startPage();
+        List<LiveRewardRecord> list = liveRewardRecordService.selectLiveRewardRecordList(liveRewardRecord);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出用户直播间奖励记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:record:export')")
+    @Log(title = "用户直播间奖励记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveRewardRecord liveRewardRecord)
+    {
+        List<LiveRewardRecord> list = liveRewardRecordService.selectLiveRewardRecordList(liveRewardRecord);
+        ExcelUtil<LiveRewardRecord> util = new ExcelUtil<LiveRewardRecord>(LiveRewardRecord.class);
+        return util.exportExcel(list, "用户直播间奖励记录数据");
+    }
+
+    /**
+     * 获取用户直播间奖励记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:record:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(liveRewardRecordService.selectLiveRewardRecordById(id));
+    }
+
+    /**
+     * 新增用户直播间奖励记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:record:add')")
+    @Log(title = "用户直播间奖励记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveRewardRecord liveRewardRecord)
+    {
+        return toAjax(liveRewardRecordService.insertLiveRewardRecord(liveRewardRecord));
+    }
+
+    /**
+     * 修改用户直播间奖励记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:record:edit')")
+    @Log(title = "用户直播间奖励记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveRewardRecord liveRewardRecord)
+    {
+        return toAjax(liveRewardRecordService.updateLiveRewardRecord(liveRewardRecord));
+    }
+
+    /**
+     * 删除用户直播间奖励记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:record:remove')")
+    @Log(title = "用户直播间奖励记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(liveRewardRecordService.deleteLiveRewardRecordByIds(ids));
+    }
+
+    /**
+     * 删除用户直播间奖励记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:record:query')")
+    @PostMapping("/statistics")
+    public R statistics(@RequestBody LiveRewardRecordVo param)
+    {
+        return liveRewardRecordService.statistics(param);
+        // 可惜了 我华丽的实现
+        //        return liveRewardRecordService.count(step,companyId);
+    }
+
+    @PreAuthorize("@ss.hasPermi('live:record:export')")
+    @PostMapping("/export")
+    public AjaxResult export(@RequestBody LiveRewardRecordVo param)
+    {
+        List<LiveRewardRecordStatisticsVo> list = liveRewardRecordService.selectRewardSummary(param);
+
+        ExcelUtil<LiveRewardRecordStatisticsVo> util = new ExcelUtil<LiveRewardRecordStatisticsVo>(LiveRewardRecordStatisticsVo.class);
+        return util.exportExcel(list, "liveIntegralLogs");
+
+//        return liveRewardRecordService.export(param);
+//        return R.ok();
+    }
+}

+ 98 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveSensitiveWordsController.java

@@ -0,0 +1,98 @@
+package com.fs.live.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.live.domain.LiveSensitiveWords;
+import com.fs.live.service.ILiveSensitiveWordsService;
+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-07-08
+ */
+@RestController
+@RequestMapping("/live/words")
+public class LiveSensitiveWordsController extends BaseController
+{
+    @Autowired
+    private ILiveSensitiveWordsService liveSensitiveWordsService;
+
+    /**
+     * 查询直播间敏感词过滤列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:words:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveSensitiveWords liveSensitiveWords)
+    {
+        startPage();
+        List<LiveSensitiveWords> list = liveSensitiveWordsService.selectLiveSensitiveWordsList(liveSensitiveWords);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播间敏感词过滤列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:words:export')")
+    @Log(title = "直播间敏感词过滤", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveSensitiveWords liveSensitiveWords)
+    {
+        List<LiveSensitiveWords> list = liveSensitiveWordsService.selectLiveSensitiveWordsList(liveSensitiveWords);
+        ExcelUtil<LiveSensitiveWords> util = new ExcelUtil<LiveSensitiveWords>(LiveSensitiveWords.class);
+        return util.exportExcel(list, "直播间敏感词过滤数据");
+    }
+
+    /**
+     * 获取直播间敏感词过滤详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:words:query')")
+    @GetMapping(value = "/{wordId}")
+    public AjaxResult getInfo(@PathVariable("wordId") Long wordId)
+    {
+        return AjaxResult.success(liveSensitiveWordsService.selectLiveSensitiveWordsByWordId(wordId));
+    }
+
+    /**
+     * 新增直播间敏感词过滤
+     */
+    @PreAuthorize("@ss.hasPermi('live:words:add')")
+    @Log(title = "直播间敏感词过滤", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveSensitiveWords liveSensitiveWords)
+    {
+
+        return toAjax(liveSensitiveWordsService.insertLiveSensitiveWords(liveSensitiveWords));
+    }
+
+    /**
+     * 修改直播间敏感词过滤
+     */
+    @PreAuthorize("@ss.hasPermi('live:words:edit')")
+    @Log(title = "直播间敏感词过滤", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveSensitiveWords liveSensitiveWords)
+    {
+        return toAjax(liveSensitiveWordsService.updateLiveSensitiveWords(liveSensitiveWords));
+    }
+
+    /**
+     * 删除直播间敏感词过滤
+     */
+    @PreAuthorize("@ss.hasPermi('live:words:remove')")
+    @Log(title = "直播间敏感词过滤", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{wordIds}")
+    public AjaxResult remove(@PathVariable Long[] wordIds)
+    {
+        return toAjax(liveSensitiveWordsService.deleteLiveSensitiveWordsByWordIds(wordIds));
+    }
+}

+ 122 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveTrafficLogController.java

@@ -0,0 +1,122 @@
+package com.fs.live.controller;
+
+import java.text.SimpleDateFormat;
+import java.util.List;
+
+import com.fs.live.param.LiveTrafficLogParam;
+import com.fs.live.vo.LiveTrafficLogListVO;
+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.enums.BusinessType;
+import com.fs.live.domain.LiveTrafficLog;
+import com.fs.live.service.ILiveTrafficLogService;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.core.page.TableDataInfo;
+
+/**
+ * 直播流量记录Controller
+ *
+ * @author fs
+ * @date 2025-10-13
+ */
+@RestController
+@RequestMapping("/live/trafficLog")
+public class LiveTrafficLogController extends BaseController
+{
+    @Autowired
+    private ILiveTrafficLogService liveTrafficLogService;
+
+    /**
+     * 查询直播流量记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:trafficLog:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveTrafficLogParam param)
+    {
+        startPage();
+        if (param.getTime() != null) {
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
+            String formattedDate = sdf.format(param.getTime());
+            String[] parts = formattedDate.split("-");
+            param.setYear(Integer.parseInt(parts[0]));
+            param.setMonth(Integer.parseInt(parts[1]));
+        }
+        List<LiveTrafficLogListVO> list = liveTrafficLogService.selectTrafficByCompany(param);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播流量记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:trafficLog:export')")
+    @Log(title = "直播流量记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveTrafficLogParam param)
+    {
+        if (param.getTime() != null) {
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
+            String formattedDate = sdf.format(param.getTime());
+            String[] parts = formattedDate.split("-");
+            param.setYear(Integer.parseInt(parts[0]));
+            param.setMonth(Integer.parseInt(parts[1]));
+        }
+
+        List<LiveTrafficLogListVO> list = liveTrafficLogService.selectTrafficByCompany(param);
+        ExcelUtil<LiveTrafficLogListVO> util = new ExcelUtil<LiveTrafficLogListVO>(LiveTrafficLogListVO.class);
+        return util.exportExcel(list, "直播流量记录数据");
+    }
+
+    /**
+     * 获取直播流量记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:trafficLog:query')")
+    @GetMapping(value = "/{logId}")
+    public AjaxResult getInfo(@PathVariable("logId") Long logId)
+    {
+        return AjaxResult.success(liveTrafficLogService.selectLiveTrafficLogById(logId));
+    }
+
+    /**
+     * 新增直播流量记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:trafficLog:add')")
+    @Log(title = "直播流量记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveTrafficLog liveTrafficLog)
+    {
+        return toAjax(liveTrafficLogService.insertLiveTrafficLog(liveTrafficLog));
+    }
+
+    /**
+     * 修改直播流量记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:trafficLog:edit')")
+    @Log(title = "直播流量记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveTrafficLog liveTrafficLog)
+    {
+        return toAjax(liveTrafficLogService.updateLiveTrafficLog(liveTrafficLog));
+    }
+
+    /**
+     * 删除直播流量记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:trafficLog:remove')")
+    @Log(title = "直播流量记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{logIds}")
+    public AjaxResult remove(@PathVariable Long[] logIds)
+    {
+        return toAjax(liveTrafficLogService.deleteLiveTrafficLogByIds(logIds));
+    }
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveUserFavoriteController.java

@@ -0,0 +1,97 @@
+package com.fs.live.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.live.domain.LiveUserFavorite;
+import com.fs.live.service.ILiveUserFavoriteService;
+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-07-11
+ */
+@RestController
+@RequestMapping("/live/liveUserFavorite")
+public class LiveUserFavoriteController extends BaseController
+{
+    @Autowired
+    private ILiveUserFavoriteService liveUserFavoriteService;
+
+    /**
+     * 查询用户直播收藏列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFavorite:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveUserFavorite liveUserFavorite)
+    {
+        startPage();
+        List<LiveUserFavorite> list = liveUserFavoriteService.selectLiveUserFavoriteList(liveUserFavorite);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出用户直播收藏列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFavorite:export')")
+    @Log(title = "用户直播收藏", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveUserFavorite liveUserFavorite)
+    {
+        List<LiveUserFavorite> list = liveUserFavoriteService.selectLiveUserFavoriteList(liveUserFavorite);
+        ExcelUtil<LiveUserFavorite> util = new ExcelUtil<LiveUserFavorite>(LiveUserFavorite.class);
+        return util.exportExcel(list, "用户直播收藏数据");
+    }
+
+    /**
+     * 获取用户直播收藏详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFavorite:query')")
+    @GetMapping(value = "/{favoriteId}")
+    public AjaxResult getInfo(@PathVariable("favoriteId") Long favoriteId)
+    {
+        return AjaxResult.success(liveUserFavoriteService.selectLiveUserFavoriteByFavoriteId(favoriteId));
+    }
+
+    /**
+     * 新增用户直播收藏
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFavorite:add')")
+    @Log(title = "用户直播收藏", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveUserFavorite liveUserFavorite)
+    {
+        return toAjax(liveUserFavoriteService.insertLiveUserFavorite(liveUserFavorite));
+    }
+
+    /**
+     * 修改用户直播收藏
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFavorite:edit')")
+    @Log(title = "用户直播收藏", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveUserFavorite liveUserFavorite)
+    {
+        return toAjax(liveUserFavoriteService.updateLiveUserFavorite(liveUserFavorite));
+    }
+
+    /**
+     * 删除用户直播收藏
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFavorite:remove')")
+    @Log(title = "用户直播收藏", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{favoriteIds}")
+    public AjaxResult remove(@PathVariable Long[] favoriteIds)
+    {
+        return toAjax(liveUserFavoriteService.deleteLiveUserFavoriteByFavoriteIds(favoriteIds));
+    }
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveUserFollowController.java

@@ -0,0 +1,97 @@
+package com.fs.live.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.live.domain.LiveUserFollow;
+import com.fs.live.service.ILiveUserFollowService;
+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-07-11
+ */
+@RestController
+@RequestMapping("/live/liveUserFollow")
+public class LiveUserFollowController extends BaseController
+{
+    @Autowired
+    private ILiveUserFollowService liveUserFollowService;
+
+    /**
+     * 查询用户直播关注列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFollow:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveUserFollow liveUserFollow)
+    {
+        startPage();
+        List<LiveUserFollow> list = liveUserFollowService.selectLiveUserFollowList(liveUserFollow);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出用户直播关注列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFollow:export')")
+    @Log(title = "用户直播关注", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveUserFollow liveUserFollow)
+    {
+        List<LiveUserFollow> list = liveUserFollowService.selectLiveUserFollowList(liveUserFollow);
+        ExcelUtil<LiveUserFollow> util = new ExcelUtil<LiveUserFollow>(LiveUserFollow.class);
+        return util.exportExcel(list, "用户直播关注数据");
+    }
+
+    /**
+     * 获取用户直播关注详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFollow:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(liveUserFollowService.selectLiveUserFollowById(id));
+    }
+
+    /**
+     * 新增用户直播关注
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFollow:add')")
+    @Log(title = "用户直播关注", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveUserFollow liveUserFollow)
+    {
+        return toAjax(liveUserFollowService.insertLiveUserFollow(liveUserFollow));
+    }
+
+    /**
+     * 修改用户直播关注
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFollow:edit')")
+    @Log(title = "用户直播关注", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveUserFollow liveUserFollow)
+    {
+        return toAjax(liveUserFollowService.updateLiveUserFollow(liveUserFollow));
+    }
+
+    /**
+     * 删除用户直播关注
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFollow:remove')")
+    @Log(title = "用户直播关注", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(liveUserFollowService.deleteLiveUserFollowByIds(ids));
+    }
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveUserLikeController.java

@@ -0,0 +1,97 @@
+package com.fs.live.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.live.domain.LiveUserLike;
+import com.fs.live.service.ILiveUserLikeService;
+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-07-11
+ */
+@RestController
+@RequestMapping("/live/liveUserLike")
+public class LiveUserLikeController extends BaseController
+{
+    @Autowired
+    private ILiveUserLikeService liveUserLikeService;
+
+    /**
+     * 查询用户直播赞列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserLike:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveUserLike liveUserLike)
+    {
+        startPage();
+        List<LiveUserLike> list = liveUserLikeService.selectLiveUserLikeList(liveUserLike);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出用户直播赞列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserLike:export')")
+    @Log(title = "用户直播赞", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveUserLike liveUserLike)
+    {
+        List<LiveUserLike> list = liveUserLikeService.selectLiveUserLikeList(liveUserLike);
+        ExcelUtil<LiveUserLike> util = new ExcelUtil<LiveUserLike>(LiveUserLike.class);
+        return util.exportExcel(list, "用户直播赞数据");
+    }
+
+    /**
+     * 获取用户直播赞详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserLike:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(liveUserLikeService.selectLiveUserLikeById(id));
+    }
+
+    /**
+     * 新增用户直播赞
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserLike:add')")
+    @Log(title = "用户直播赞", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveUserLike liveUserLike)
+    {
+        return toAjax(liveUserLikeService.insertLiveUserLike(liveUserLike));
+    }
+
+    /**
+     * 修改用户直播赞
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserLike:edit')")
+    @Log(title = "用户直播赞", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveUserLike liveUserLike)
+    {
+        return toAjax(liveUserLikeService.updateLiveUserLike(liveUserLike));
+    }
+
+    /**
+     * 删除用户直播赞
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserLike:remove')")
+    @Log(title = "用户直播赞", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(liveUserLikeService.deleteLiveUserLikeByIds(ids));
+    }
+}

+ 108 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveUserLotteryRecordController.java

@@ -0,0 +1,108 @@
+package com.fs.live.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.live.domain.LiveUserLotteryRecord;
+import com.fs.live.service.ILiveUserLotteryRecordService;
+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-07-17
+ */
+@RestController
+@RequestMapping("/live/liveUserLotteryRecord")
+public class LiveUserLotteryRecordController extends BaseController
+{
+    @Autowired
+    private ILiveUserLotteryRecordService liveUserLotteryRecordService;
+
+    /**
+     * 查询直播用户中奖记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveUserLotteryRecord liveUserLotteryRecord)
+    {
+        startPage();
+        List<LiveUserLotteryRecord> list = liveUserLotteryRecordService.selectLiveUserLotteryRecordList(liveUserLotteryRecord);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播用户中奖记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:export')")
+    @Log(title = "直播用户中奖记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveUserLotteryRecord liveUserLotteryRecord)
+    {
+        List<LiveUserLotteryRecord> list = liveUserLotteryRecordService.selectLiveUserLotteryRecordList(liveUserLotteryRecord);
+        ExcelUtil<LiveUserLotteryRecord> util = new ExcelUtil<LiveUserLotteryRecord>(LiveUserLotteryRecord.class);
+        return util.exportExcel(list, "直播用户中奖记录数据");
+    }
+
+    /**
+     * 获取直播用户中奖记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(liveUserLotteryRecordService.selectLiveUserLotteryRecordById(id));
+    }
+
+    /**
+     * 新增直播用户中奖记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:add')")
+    @Log(title = "直播用户中奖记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveUserLotteryRecord liveUserLotteryRecord)
+    {
+        return toAjax(liveUserLotteryRecordService.insertLiveUserLotteryRecord(liveUserLotteryRecord));
+    }
+
+    /**
+     * 修改直播用户中奖记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:edit')")
+    @Log(title = "直播用户中奖记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveUserLotteryRecord liveUserLotteryRecord)
+    {
+        return toAjax(liveUserLotteryRecordService.updateLiveUserLotteryRecord(liveUserLotteryRecord));
+    }
+
+    /**
+     * 删除直播用户中奖记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:remove')")
+    @Log(title = "直播用户中奖记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(liveUserLotteryRecordService.deleteLiveUserLotteryRecordByIds(ids));
+    }
+
+    /**
+     * 查询直播用户中奖记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:list')")
+    @PostMapping("/info")
+    public R info(@RequestBody LiveUserLotteryRecord liveUserLotteryRecord)
+    {
+        return liveUserLotteryRecordService.selectRecordByLiveIdAndLotteryId(liveUserLotteryRecord);
+    }
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveUserRedRecordController.java

@@ -0,0 +1,97 @@
+package com.fs.live.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.live.domain.LiveUserRedRecord;
+import com.fs.live.service.ILiveUserRedRecordService;
+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-07-17
+ */
+@RestController
+@RequestMapping("/live/liveUserRedRecord")
+public class LiveUserRedRecordController extends BaseController
+{
+    @Autowired
+    private ILiveUserRedRecordService liveUserRedRecordService;
+
+    /**
+     * 查询直播用户红包记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserRedRecord:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveUserRedRecord liveUserRedRecord)
+    {
+        startPage();
+        List<LiveUserRedRecord> list = liveUserRedRecordService.selectLiveUserRedRecordList(liveUserRedRecord);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播用户红包记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserRedRecord:export')")
+    @Log(title = "直播用户红包记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveUserRedRecord liveUserRedRecord)
+    {
+        List<LiveUserRedRecord> list = liveUserRedRecordService.selectLiveUserRedRecordList(liveUserRedRecord);
+        ExcelUtil<LiveUserRedRecord> util = new ExcelUtil<LiveUserRedRecord>(LiveUserRedRecord.class);
+        return util.exportExcel(list, "直播用户红包记录数据");
+    }
+
+    /**
+     * 获取直播用户红包记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserRedRecord:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(liveUserRedRecordService.selectLiveUserRedRecordById(id));
+    }
+
+    /**
+     * 新增直播用户红包记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserRedRecord:add')")
+    @Log(title = "直播用户红包记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveUserRedRecord liveUserRedRecord)
+    {
+        return toAjax(liveUserRedRecordService.insertLiveUserRedRecord(liveUserRedRecord));
+    }
+
+    /**
+     * 修改直播用户红包记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserRedRecord:edit')")
+    @Log(title = "直播用户红包记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveUserRedRecord liveUserRedRecord)
+    {
+        return toAjax(liveUserRedRecordService.updateLiveUserRedRecord(liveUserRedRecord));
+    }
+
+    /**
+     * 删除直播用户红包记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserRedRecord:remove')")
+    @Log(title = "直播用户红包记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(liveUserRedRecordService.deleteLiveUserRedRecordByIds(ids));
+    }
+}

+ 33 - 20
fs-admin/src/main/java/com/fs/live/controller/LiveVideoController.java

@@ -1,28 +1,22 @@
 package com.fs.live.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
  */
@@ -36,7 +30,7 @@ public class LiveVideoController extends BaseController
     /**
      * 查询直播视频列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveVideo:list')")
+//    @PreAuthorize("@ss.hasPermi('live:liveVideo:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveVideo liveVideo)
     {
@@ -48,7 +42,7 @@ public class LiveVideoController extends BaseController
     /**
      * 导出直播视频列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveVideo:export')")
+//    @PreAuthorize("@ss.hasPermi('live:liveVideo:export')")
     @Log(title = "直播视频", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveVideo liveVideo)
@@ -61,17 +55,36 @@ public class LiveVideoController extends BaseController
     /**
      * 获取直播视频详细信息
      */
-    @PreAuthorize("@ss.hasPermi('live:liveVideo:query')")
+//    @PreAuthorize("@ss.hasPermi('live:liveVideo:query')")
     @GetMapping(value = "/{videoId}")
     public AjaxResult getInfo(@PathVariable("videoId") Long videoId)
     {
         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));
+    }
+
+    /**
+     * 获取直播视频详细信息
+     */
+    @GetMapping(value = "/preview/{liveId}")
+    public AjaxResult getLiveVideoByLiveIdAndType(@PathVariable("liveId") Long liveId)
+    {
+        return AjaxResult.success(liveVideoService.selectLiveVideoByLiveIdAndType(liveId,3));
+    }
+
     /**
      * 新增直播视频
      */
-    @PreAuthorize("@ss.hasPermi('live:liveVideo:add')")
+//    @PreAuthorize("@ss.hasPermi('live:liveVideo:add')")
     @Log(title = "直播视频", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody LiveVideo liveVideo)
@@ -82,7 +95,7 @@ public class LiveVideoController extends BaseController
     /**
      * 修改直播视频
      */
-    @PreAuthorize("@ss.hasPermi('live:liveVideo:edit')")
+//    @PreAuthorize("@ss.hasPermi('live:liveVideo:edit')")
     @Log(title = "直播视频", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody LiveVideo liveVideo)
@@ -93,7 +106,7 @@ public class LiveVideoController extends BaseController
     /**
      * 删除直播视频
      */
-    @PreAuthorize("@ss.hasPermi('live:liveVideo:remove')")
+//    @PreAuthorize("@ss.hasPermi('live:liveVideo:remove')")
     @Log(title = "直播视频", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{videoIds}")
     public AjaxResult remove(@PathVariable Long[] videoIds)

+ 102 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveWatchConfigController.java

@@ -0,0 +1,102 @@
+package com.fs.live.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.framework.web.service.TokenService;
+import com.fs.live.domain.LiveWatchConfig;
+import com.fs.live.service.ILiveWatchConfigService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 直播观看奖励设置Controller
+ *
+ * @author fs
+ * @date 2025-07-08
+ */
+@RestController
+@RequestMapping("/live/config")
+public class LiveWatchConfigController extends BaseController
+{
+    @Autowired
+    private ILiveWatchConfigService liveWatchConfigService;
+    @Autowired
+    private TokenService tokenService;
+
+    /**
+     * 查询直播观看奖励设置列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:config:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveWatchConfig liveWatchConfig)
+    {
+        startPage();
+        List<LiveWatchConfig> list = liveWatchConfigService.selectLiveWatchConfigList(liveWatchConfig);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播观看奖励设置列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:config:export')")
+    @Log(title = "直播观看奖励设置", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveWatchConfig liveWatchConfig)
+    {
+        List<LiveWatchConfig> list = liveWatchConfigService.selectLiveWatchConfigList(liveWatchConfig);
+        ExcelUtil<LiveWatchConfig> util = new ExcelUtil<LiveWatchConfig>(LiveWatchConfig.class);
+        return util.exportExcel(list, "直播观看奖励设置数据");
+    }
+
+    /**
+     * 获取直播观看奖励设置详细信息
+     */
+//    @PreAuthorize("@ss.hasPermi('live:config:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success("",liveWatchConfigService.selectLiveWatchConfigByLiveId(id));
+    }
+
+    /**
+     * 新增直播观看奖励设置
+     */
+//    @PreAuthorize("@ss.hasPermi('live:config:add')")
+    @Log(title = "直播观看奖励设置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody String jsonConfig)
+    {
+        String userId = tokenService.getLoginUser(ServletUtils.getRequest()).getUser().getUserId().toString();
+        return toAjax(liveWatchConfigService.insertLiveWatchConfig(userId, jsonConfig));
+    }
+
+    /**
+     * 修改直播观看奖励设置
+     */
+//    @PreAuthorize("@ss.hasPermi('live:config:edit')")
+    @Log(title = "直播观看奖励设置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody String jsonConfig)
+    {
+        return toAjax(liveWatchConfigService.updateLiveWatchConfig(jsonConfig));
+    }
+
+    /**
+     * 删除直播观看奖励设置
+     */
+//    @PreAuthorize("@ss.hasPermi('live:config:remove')")
+    @Log(title = "直播观看奖励设置", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+
+        return toAjax(liveWatchConfigService.deleteLiveWatchConfigByIds(ids));
+    }
+}

+ 48 - 20
fs-admin/src/main/java/com/fs/live/controller/LiveWatchUserController.java

@@ -1,28 +1,25 @@
 package com.fs.live.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
  */
@@ -36,7 +33,7 @@ public class LiveWatchUserController extends BaseController
     /**
      * 查询直播间观看用户列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:list')")
+//    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveWatchUser liveWatchUser)
     {
@@ -45,10 +42,20 @@ 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);
+    }
+
     /**
      * 导出直播间观看用户列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:export')")
+//    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:export')")
     @Log(title = "直播间观看用户", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveWatchUser liveWatchUser)
@@ -61,7 +68,7 @@ public class LiveWatchUserController extends BaseController
     /**
      * 获取直播间观看用户详细信息
      */
-    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:query')")
+//    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {
@@ -71,7 +78,7 @@ public class LiveWatchUserController extends BaseController
     /**
      * 新增直播间观看用户
      */
-    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:add')")
+//    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:add')")
     @Log(title = "直播间观看用户", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody LiveWatchUser liveWatchUser)
@@ -82,7 +89,7 @@ public class LiveWatchUserController extends BaseController
     /**
      * 修改直播间观看用户
      */
-    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:edit')")
+//    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:edit')")
     @Log(title = "直播间观看用户", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody LiveWatchUser liveWatchUser)
@@ -93,11 +100,32 @@ public class LiveWatchUserController extends BaseController
     /**
      * 删除直播间观看用户
      */
-    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:remove')")
+//    @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));
+    }
+
+    /**
+     * 封禁用户账号
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:edit')")
+    @Log(title = "直播间观看用户", businessType = BusinessType.UPDATE)
+    @GetMapping("/blockUser/{userId}")
+    public AjaxResult blockUser(@PathVariable Long userId) {
+        return toAjax(liveWatchUserService.blockUser(userId));
+    }
+
 }

+ 183 - 0
fs-admin/src/main/java/com/fs/task/LiveTask.java

@@ -0,0 +1,183 @@
+package com.fs.task;
+
+
+import com.fs.erp.domain.ErpDeliverys;
+import com.fs.erp.domain.ErpOrderQuery;
+import com.fs.erp.dto.ErpOrderQueryRequert;
+import com.fs.erp.dto.ErpOrderQueryResponse;
+import com.fs.erp.service.FsJstAftersalePushService;
+import com.fs.erp.service.IErpOrderService;
+import com.fs.his.service.IFsExpressService;
+import com.fs.live.domain.LiveAfterSales;
+import com.fs.live.domain.LiveOrder;
+import com.fs.live.param.LiveAfterSalesAudit1Param;
+import com.fs.live.service.ILiveAfterSalesService;
+import com.fs.live.service.ILiveOrderLogsService;
+import com.fs.live.service.ILiveOrderService;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang.ObjectUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.text.ParseException;
+import java.util.List;
+
+/**
+ * 定时任务调度
+ * @author fs
+ */
+@Component("liveTask")
+public class LiveTask {
+    Logger logger = LoggerFactory.getLogger(LiveTask.class);
+
+
+    @Autowired
+    private ILiveOrderService liveOrderService;
+
+    @Autowired
+    private ILiveAfterSalesService afterSalesService;
+
+
+    @Autowired
+    private IErpOrderService erpOrderService;
+
+
+    @Autowired
+    private IFsExpressService expressService;
+
+
+    @Autowired
+    private ILiveOrderLogsService orderLogsService;
+
+
+//    @Autowired
+//    private FsWarehousesMapper fsWarehousesMapper;
+
+    @Autowired
+    public FsJstAftersalePushService fsJstAftersalePushService;
+
+    /**
+     * 超时订单自动取消
+     */
+    public void orderCancel(){
+        liveOrderService.orderCancel();
+    }
+
+
+    /**
+     * 发货任务
+     */
+    public void deliveryOp() {
+//        List<LiveOrder> list = liveOrderService.selectDeliverPenddingData();
+//
+//        for (LiveOrder order : list) {
+//            String orderCode = order.getOrderCode();
+//            ErpOrderQueryRequert request = new ErpOrderQueryRequert();
+//            request.setCode(order.getExtendOrderId());
+//
+//            try {
+//                // 根据仓库code找erp
+//                if (com.fs.common.utils.StringUtils.isNotBlank(order.getStoreHouseCode())) {
+//                    String erp = fsWarehousesMapper.selectErpByCode(order.getStoreHouseCode());
+//                    ErpContextHolder.setErpType(erp);
+//                }
+//                ErpOrderQueryResponse response = erpOrderService.getOrderLive(request);
+//                if (CollectionUtils.isNotEmpty(response.getOrders())) {
+//                    for (ErpOrderQuery orderQuery : response.getOrders()) {
+//                        if (CollectionUtils.isNotEmpty(orderQuery.getDeliverys())) {
+//                            // 部分发货或者全部发货
+//                            if (ObjectUtils.equals(orderQuery.getDelivery_state(), 1) || ObjectUtils.equals(orderQuery.getDelivery_state(), 2)) {
+//
+//                                orderLogsService.create(order.getOrderId(), OrderLogEnum.DELIVERY_GOODS.getValue(),
+//                                        OrderLogEnum.DELIVERY_GOODS.getDesc());
+//
+//                                for (ErpDeliverys delivery : orderQuery.getDeliverys()) {
+//
+//                                    FsExpress express = expressService.selectFsExpressByOmsCode(delivery.getExpress_code());
+//                                    if (express == null) {
+//                                        logger.warn("当前express_code: {} 不存在!", delivery.getExpress_code());
+//                                        continue;
+//                                    }
+//
+//                                    if (delivery.getDelivery()) {
+//                                        liveOrderService.deliveryOrder(orderCode, delivery.getMail_no(),
+//                                                delivery.getExpress_code(), delivery.getExpress_name());
+//                                    }
+//                                }
+//
+//                                logger.info("订单 {} 发货信息同步成功", order.getOrderCode());
+//                            }
+//                        }
+//                    }
+//                }
+//            } catch (Exception e) {
+//                logger.error(String.format("[发货任务]调用erp查询接口失败!原因: %s", e));
+//            }
+//
+//        }
+    }
+
+
+        /**
+         * 退款自动处理 24小时未审核自动审核通过 每小时执行一次
+         */
+    public void refundOp() {
+        //获取所有退款申请
+        List<LiveAfterSales> list = afterSalesService.selectLiveAfterSalesByDoAudit();
+        if (list != null) {
+            for (LiveAfterSales afterSales : list) {
+                //仅退款
+//                if (afterSales.getServiceType().equals(0)) {
+                LiveAfterSalesAudit1Param audit1Param = new LiveAfterSalesAudit1Param();
+                audit1Param.setSalesId(afterSales.getId());
+                audit1Param.setOperator("平台");
+                afterSalesService.audit1(audit1Param);
+//                }
+            }
+        }
+    }
+
+    /**
+     * 批量推管易
+     * @throws ParseException 解析异常
+     */
+    public void updateOrderItem() throws ParseException {
+        List<Long> ids = liveOrderService.selectOrderIdByNoErp();
+        for (Long id : ids) {
+            try{
+                liveOrderService.createOmsOrder(id);
+            }catch (Exception e){
+                logger.error("推送管易失败 {}",id,e);
+            }
+        }
+    }
+
+
+    /**
+     * 同步物流状态
+     */
+    public void syncExpress() {
+        List<Long> ids = liveOrderService.selectSyncExpressIds();
+        for (Long id : ids) {
+            liveOrderService.syncExpress(id);
+        }
+    }
+
+    /**
+     * 更新发货状态
+     */
+    public void updateExpress() {
+        List<LiveOrder> list = liveOrderService.selectUpdateExpress();
+
+        for (LiveOrder order : list) {
+            try{
+                liveOrderService.syncDeliveryOrder(order);
+            }catch (Exception e) {
+                logger.error("获取订单是否发货失败!原因: ",e);
+            }
+        }
+
+    }
+}

+ 29 - 0
fs-common/src/main/java/com/fs/common/constant/LiveKeysConstant.java

@@ -0,0 +1,29 @@
+package com.fs.common.constant;
+
+public class LiveKeysConstant {
+
+    public static final String USER_VISIT_KEY = "live:user:visit:";  // 用户访问标识用于判断是否是首次访问
+    public static final String UNIQUE_VISITORS_KEY = "live:unique:visitors:";  //访客数
+    public static final String UNIQUE_VIEWERS_KEY = "live:unique:viewers:";  //累计观看人数
+    public static final String PAGE_VIEWS_KEY = "live:page:views:";  //浏览量
+    public static final String TOTAL_VIEWS_KEY = "live:total:views:";  //累计观看人次
+    public static final String MAX_ONLINE_USERS_KEY = "live:max:online:"; //最大在线人数
+    public static final String ONLINE_USERS_KEY = "live:online:users:";  //当前在线人数
+
+    public static final String LIVE_HOME_PAGE_LIST = "live:homePage:list"; //直播列表数据
+    public static final Integer LIVE_HOME_PAGE_LIST_EXPIRE = 300; //首页缓存过期时间
+    public static final String LIVE_WATCH_USERS = "live:watch:users:%s"; //在线人数
+    public static final String LIVE_COUPON_NUM = "live:coupon:num:%s"; //直播间优惠券数量
+
+    public static final String LIVE_HOME_PAGE_DETAIL = "live:detail:%s"; //直播间详情
+    public static final Integer LIVE_HOME_PAGE_DETAIL_EXPIRE = 300; //直播间详情过期时间
+
+    public static final String LIVE_HOME_PAGE_CONFIG = "live:config:%s:%s"; //直播间配置信息
+    public static final Integer LIVE_HOME_PAGE_CONFIG_EXPIRE = 300; //直播间配置信息过期时间
+    public static final String LIVE_HOME_PAGE_CONFIG_RED = "live:config:%s:red:%s"; //红包记录
+    public static final String LIVE_HOME_PAGE_CONFIG_COUPON = "live:config:%s:coupon:%s"; //优惠券记录
+    public static final String LIVE_HOME_PAGE_CONFIG_DRAW = "live:config:%s:draw:%s"; //抽奖记录
+
+
+
+}

+ 20 - 0
fs-common/src/main/java/com/fs/common/core/page/PageRequest.java

@@ -0,0 +1,20 @@
+package com.fs.common.core.page;
+
+import lombok.Getter;
+import lombok.Setter;
+
+
+@Setter
+@Getter
+public class PageRequest {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 当前页
+     */
+    private int currentPage = 1;
+    /**
+     * 每页结果数
+     */
+    private int pageSize = 10;
+}

+ 150 - 0
fs-common/src/main/java/com/fs/common/core/redis/RedisCache.java

@@ -232,6 +232,18 @@ public class RedisCache
     public Boolean setIfAbsent(String key, String value, long timeout, TimeUnit unit) {
         return redisTemplate.opsForValue().setIfAbsent(key, value, timeout, unit);
     }
+    /**
+     * 当 key 不存在时设置值
+     *
+     * @param key   缓存键
+     * @param value 缓存值
+     * @param timeout 过期时间
+     * @param unit 时间单位
+     * @return true: 设置成功,false: key 已存在
+     */
+    public boolean setIfAbsent(final String key, final Object value, long timeout, TimeUnit unit) {
+        return Boolean.TRUE.equals(redisTemplate.opsForValue().setIfAbsent(key, value, timeout, unit));
+    }
 
     public Long decr(final String key,final Long delta) {
         return redisTemplate.opsForValue().decrement(key, delta);
@@ -241,6 +253,79 @@ public class RedisCache
         return redisTemplate.opsForValue().increment(key, delta);
     }
 
+    /**
+     * 获取字符串值
+     *
+     * @param key 键
+     * @return 字符串值
+     */
+    public Long decrement(String key) {
+        return redisTemplate.opsForValue().decrement(key);
+    }
+
+    public Long incr(final String key,final long delta) {
+        return redisTemplate.opsForValue().increment(key, delta);
+    }
+
+    /**
+     * 向有序集合删除元素
+     *
+     * @param key   有序集合键
+     * @param value 数值
+     * @return 是否添加成功
+     */
+    public void zSetRemove(String key,  Object value) {
+        redisTemplate.opsForZSet().remove(key, value);
+    }
+
+    /**
+     * 向有序集合添加元素
+     *
+     * @param key   有序集合键
+     * @param value 元素值
+     * @param score 分数
+     * @return 是否添加成功
+     */
+    public boolean zSetAdd(String key, Object value, double score) {
+        return Boolean.TRUE.equals(redisTemplate.opsForZSet().add(key, value, score));
+    }
+
+    /**
+     * 升序获取有序集合指定范围的元素
+     *
+     * @param key   有序集合键
+     * @param start 起始位置
+     * @param end   结束位置
+     * @return 元素集合
+     */
+    public Set<Object> zSetRange(String key, long start, long end) {
+        return redisTemplate.opsForZSet().range(key, start, end);
+    }
+
+    /**
+     * 降序获取有序集合指定范围的元素
+     *
+     * @param key   有序集合键
+     * @param start 起始位置
+     * @param end   结束位置
+     * @return 元素集合
+     */
+    public Set<Object> zSetReverseRange(String key, long start, long end) {
+        return redisTemplate.opsForZSet().reverseRange(key, start, end);
+    }
+
+    /**
+     * 获取有序集合元素数量
+     *
+     * @param key 有序集合键
+     * @return 元素集合数量
+     */
+    public Long zSetSize(String key) {
+        return redisTemplate.opsForZSet().size(key);
+    }
+
+
+
     /**
      * 获得list对象的value
      *
@@ -301,4 +386,69 @@ public class RedisCache
     {
         redisTemplate.opsForList().rightPush(key, value);
     }
+
+    // ======================== Hash 操作 ========================
+
+    /**
+     * 获取哈希表中所有键值对
+     *
+     * @param key 哈希表键
+     * @return 键值对映射
+     */
+    public Map<Object, Object> hashEntries(String key) {
+        return redisTemplate.opsForHash().entries(key);
+    }
+
+    /**
+     * 向哈希表中添加键值对
+     *
+     * @param key     哈希表键
+     * @param hashKey 哈希键
+     * @param value   哈希值
+     */
+    public void hashPut(String key, String hashKey, Object value) {
+        redisTemplate.opsForHash().put(key, hashKey, value);
+    }
+
+    /**
+     * 向哈希表中添加键值对
+     *
+     * @param key     哈希表键
+     * @param hashKey 哈希键
+     */
+    public void hashDelete(String key, String hashKey) {
+        redisTemplate.opsForHash().delete(key, hashKey);
+    }
+
+    /**
+     * 向哈希表中添加键值对批量
+     *
+     * @param key 哈希表键
+     */
+    public void hashPut(String key, Map<String, String> var2) {
+        redisTemplate.opsForHash().putAll(key, var2);
+    }
+
+    /**
+     * 获取哈希表中的值
+     *
+     * @param key     哈希表键
+     * @param hashKey 哈希键
+     * @return 哈希值
+     */
+    public Object hashGet(String key, String hashKey) {
+        return redisTemplate.opsForHash().get(key, hashKey);
+    }
+
+
+
+    /**
+     * 获取哈希表中数量
+     *
+     * @param key 哈希表键
+     * @return 键值对映射
+     */
+    public Long size(String key) {
+        return redisTemplate.opsForHash().size(key);
+    }
 }

+ 64 - 0
fs-common/src/main/java/com/fs/common/utils/DateUtils.java

@@ -8,6 +8,8 @@ import java.time.format.DateTimeFormatter;
 import java.time.temporal.ChronoUnit;
 import java.util.Calendar;
 import java.util.Date;
+import java.util.LinkedList;
+
 import org.apache.commons.lang3.time.DateFormatUtils;
 
 /**
@@ -296,4 +298,66 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
         return calendar.getTimeInMillis();
     }
 
+    /**
+     * 返回时间最近步长 向下(向前)取整
+     * @param startTime 开始时间
+     * @param step 步长
+     * @return 开始时间最近步长
+     */
+    public static LocalDateTime getLiveOrderStartTime(LocalDateTime startTime, int step) {
+
+        // 将startTime按照最近30分钟来取值 比如17:35 就改为17:30
+        int minute = startTime.getMinute();
+        int truncatedMinute = (minute / step) * step;
+        startTime = startTime.withMinute(truncatedMinute).withSecond(0).withNano(0);
+        return startTime;
+    }
+
+    /**
+     * 根据开始时间、结束时间和步长拆分时间
+     *
+     * @param startTime 开始时间
+     * @param endTime 结束时间
+     * @param unit 时间单位 (ChronoUnit.HOURS, ChronoUnit.DAYS等)
+     * @param step 步长
+     * @return 时间点列表
+     */
+    public static LinkedList<LocalDateTime> splitTimeByStep(LocalDateTime startTime,
+                                                            LocalDateTime endTime,
+                                                            ChronoUnit unit,
+                                                            int step) {
+        LinkedList<LocalDateTime> timeSlots = new LinkedList<>();
+        LocalDateTime currentTime = startTime;
+
+        while (!currentTime.isAfter(endTime)) {
+            timeSlots.add(currentTime);
+            currentTime = currentTime.plus(step, unit);
+        }
+
+        return timeSlots;
+    }
+
+    /**
+     * 检查两个时间是否跨天
+     * @param startTime 开始时间
+     * @param finishTime 结束时间
+     * @return true表示跨天,false表示未跨天
+     */
+    public static boolean isCrossDay(LocalDateTime startTime, LocalDateTime finishTime) {
+        if (startTime == null || finishTime == null) {
+            throw new IllegalArgumentException("时间参数不能为空");
+        }
+
+        // 如果结束时间早于开始时间,说明参数有误
+        if (finishTime.isBefore(startTime)) {
+            throw new IllegalArgumentException("结束时间不能早于开始时间");
+        }
+
+        LocalDate startDate = startTime.toLocalDate();
+        LocalDate finishDate = finishTime.toLocalDate();
+
+        // 比较日期部分是否相等
+        return !startDate.isEqual(finishDate);
+    }
+
 }

+ 101 - 9
fs-common/src/main/java/com/fs/common/utils/http/HttpUtils.java

@@ -1,15 +1,12 @@
 package com.fs.common.utils.http;
 
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.net.ConnectException;
-import java.net.SocketTimeoutException;
-import java.net.URL;
-import java.net.URLConnection;
+import java.io.*;
+import java.net.*;
+import java.nio.charset.StandardCharsets;
 import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
 import javax.net.ssl.HostnameVerifier;
 import javax.net.ssl.HttpsURLConnection;
 import javax.net.ssl.SSLContext;
@@ -17,12 +14,20 @@ import javax.net.ssl.SSLSession;
 import javax.net.ssl.TrustManager;
 import javax.net.ssl.X509TrustManager;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpStatus;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.utils.URLEncodedUtils;
 import org.apache.http.entity.StringEntity;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicNameValuePair;
 import org.apache.http.util.EntityUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -294,4 +299,91 @@ public class HttpUtils
             return true;
         }
     }
+
+    public static String endApi(String url , Map<String, String> param, Map<String, String> map){
+
+        HttpPost httpPost = new HttpPost(url);
+        httpPost.setHeader("Content-Type", "application/json; charset=utf-8");
+        // 设置请求参数
+
+        if (param!=null){
+            List<NameValuePair> params = new ArrayList<>();
+            for (Map.Entry<String, String> entry : param.entrySet()) {
+                String value = entry.getValue();
+                params.add(new BasicNameValuePair(entry.getKey(), value));
+            }
+            // 将参数编码为URL格式
+            String paramString = URLEncodedUtils.format(params, StandardCharsets.UTF_8);
+            try {
+                httpPost.setEntity(new StringEntity(paramString,"UTF-8"));
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+
+        String json = JSON.toJSONString(map);
+        StringEntity requestEntity = new StringEntity(json, "UTF-8");
+        httpPost.setEntity(requestEntity);
+        return  sendHttp(httpPost);
+    }
+    public static String sendHttp( HttpPost httpPost){
+        String responseText=null;
+        // 创建HttpClient对象
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        // 发送请求,获取响应
+        try {
+            CloseableHttpResponse response = httpClient.execute(httpPost);
+            // 获取响应实体
+            HttpEntity entity = response.getEntity();
+            if (entity != null) {
+                responseText = EntityUtils.toString(entity, "UTF-8");
+            }
+            // 关闭响应
+            response.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            // 关闭HttpClient
+            try {
+                httpClient.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return responseText;
+    }
+
+    public static byte[] getWechatQrcodeByHttpURL(String url, Map<String, String> body) {
+        HttpURLConnection httpURLConnection = null;
+        try {
+            httpURLConnection = (HttpURLConnection) new URL(url).openConnection();
+            httpURLConnection.setRequestMethod("POST");
+            // 发送POST请求必须设置如下两行
+            httpURLConnection.setDoOutput(true);
+            httpURLConnection.setDoInput(true);
+            // 获取URLConnection对象对应的输出流
+            PrintWriter printWriter = new PrintWriter(httpURLConnection.getOutputStream());
+            // 发送请求参数
+            printWriter.write(JSONObject.toJSONString(body));
+            // flush输出流的缓冲
+            printWriter.flush();
+            //开始获取数据
+            try (InputStream inputStream = httpURLConnection.getInputStream();
+                 ByteArrayOutputStream out = new ByteArrayOutputStream()) {
+                byte[] buffer = new byte[1024];
+                int len = -1;
+                while ((len = inputStream.read(buffer)) != -1) {
+                    out.write(buffer, 0, len);
+                }
+                return out.toByteArray();
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            if (httpURLConnection != null) {
+                httpURLConnection.disconnect();
+            }
+        }
+        return null;
+    }
 }

+ 9 - 0
fs-company/src/main/java/com/fs/company/controller/common/CommonController.java

@@ -10,6 +10,7 @@ import com.fs.common.utils.file.FileUploadUtils;
 import com.fs.common.utils.file.FileUtils;
 import com.fs.company.utils.AudioUtils;
 import com.fs.company.vo.WangUploadVO;
+import com.fs.course.service.ITencentCloudCosService;
 import com.fs.framework.config.ServerConfig;
 import com.fs.his.domain.FsExportTask;
 import com.fs.his.service.IFsExportTaskService;
@@ -51,6 +52,8 @@ public class CommonController
 
     @Autowired
     private QwApiService qwApiService;
+    @Autowired
+    private ITencentCloudCosService tencentCloudCosService;
 
 
 
@@ -276,6 +279,12 @@ public class CommonController
         }
     }
 
+    @GetMapping("/common/getTmpSecretKey")
+    public R getTmpSecretKey()
+    {
+        return tencentCloudCosService.getKeyAndCredentials();
+    }
+
 
 
 }

+ 129 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveAfterSalesController.java

@@ -0,0 +1,129 @@
+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.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.ParseUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.his.domain.FsUser;
+import com.fs.his.service.IFsUserService;
+import com.fs.live.domain.LiveAfterSales;
+import com.fs.live.domain.LiveAfterSalesItem;
+import com.fs.live.domain.LiveAfterSalesLogs;
+import com.fs.live.domain.LiveOrder;
+import com.fs.live.service.ILiveAfterSalesItemService;
+import com.fs.live.service.ILiveAfterSalesLogsService;
+import com.fs.live.service.ILiveAfterSalesService;
+import com.fs.live.service.ILiveOrderService;
+import com.fs.live.vo.LiveAfterSalesVo;
+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-07-08
+ */
+@RestController
+@RequestMapping("/live/liveAfterSales")
+public class LiveAfterSalesController extends BaseController
+{
+    @Autowired
+    private ILiveAfterSalesService liveAfterSalesService;
+    @Autowired
+    private ILiveAfterSalesItemService liveAfterSalesItemService;
+    @Autowired
+    private ILiveAfterSalesLogsService liveAfterSalesLogsService;
+    @Autowired
+    private IFsUserService userService;
+    @Autowired
+    private ILiveOrderService orderService;
+
+    /**
+     * 查询售后记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAfteraSales:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveAfterSalesVo liveAfterSales)
+    {
+        startPage();
+        List<LiveAfterSalesVo> list = liveAfterSalesService.selectLiveAfterSalesVoList(liveAfterSales);
+        for (LiveAfterSalesVo liveAfterSalesVo : list) {
+            liveAfterSalesVo.setUserPhone(ParseUtils.parsePhone(liveAfterSalesVo.getUserPhone()));
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出售后记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAfteraSales:export')")
+    @Log(title = "售后记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveAfterSales liveAfterSales)
+    {
+        List<LiveAfterSales> list = liveAfterSalesService.selectLiveAfterSalesList(liveAfterSales);
+        ExcelUtil<LiveAfterSales> util = new ExcelUtil<LiveAfterSales>(LiveAfterSales.class);
+        return util.exportExcel(list, "售后记录数据");
+    }
+
+    /**
+     * 获取售后记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAfteraSales:query')")
+    @GetMapping(value = "/{id}")
+    public R getInfo(@PathVariable("id") Long id)
+    {
+        LiveAfterSales liveAfterSales = liveAfterSalesService.selectLiveAfterSalesById(id);
+        if(liveAfterSales==null) return R.error("售后记录不存在");
+        List<LiveAfterSalesItem> list = liveAfterSalesItemService.selectLiveAfterSalesItemByAfterId(id);
+        List<LiveAfterSalesLogs> logList = liveAfterSalesLogsService.selectLiveAfterSalesLogsByAfterId(id);
+        FsUser user=userService.selectFsUserById(liveAfterSales.getUserId());
+        user.setPhone(ParseUtils.parsePhone(user.getPhone()));
+        LiveOrder liveOrder = orderService.selectLiveOrderByOrderId(String.valueOf(liveAfterSales.getOrderId()));
+        return R.ok().put("afterSales",liveAfterSales).put("items",list).put("logs",logList).put("user",user).put("order",liveOrder);
+
+    }
+
+    /**
+     * 新增售后记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAfteraSales:add')")
+    @Log(title = "售后记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveAfterSales liveAfterSales)
+    {
+        return toAjax(liveAfterSalesService.insertLiveAfterSales(liveAfterSales));
+    }
+
+    /**
+     * 修改售后记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAfteraSales:edit')")
+    @Log(title = "售后记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveAfterSales liveAfterSales)
+    {
+        return toAjax(liveAfterSalesService.updateLiveAfterSales(liveAfterSales));
+    }
+
+    /**
+     * 删除售后记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveAfteraSales:remove')")
+    @Log(title = "售后记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(liveAfterSalesService.deleteLiveAfterSalesByIds(ids));
+    }
+
+
+}

+ 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());
+    }
+}

+ 217 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveAutoTaskController.java

@@ -0,0 +1,217 @@
+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.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.DateUtils;
+import com.fs.common.utils.StringUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.live.domain.Live;
+import com.fs.live.domain.LiveAutoTask;
+import com.fs.live.mapper.LiveMapper;
+import com.fs.live.param.LiveAutoTaskExportParam;
+import com.fs.live.param.LiveAutoTaskImportParam;
+import com.fs.live.service.ILiveAutoTaskService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.ZoneId;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 直播间自动化任务配置Controller
+ *
+ * @author fs
+ * @date 2025-08-29
+ */
+@RestController
+@RequestMapping("/live/task")
+public class LiveAutoTaskController extends BaseController
+{
+    @Autowired
+    private ILiveAutoTaskService liveAutoTaskService;
+    @Autowired
+    private LiveMapper liveMapper;
+
+    /**
+     * 查询直播间自动化任务配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:task:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveAutoTask liveAutoTask)
+    {
+        startPage();
+        List<LiveAutoTask> list = liveAutoTaskService.selectLiveAutoTaskList(liveAutoTask);
+        return getDataTable(list);
+    }
+    /**
+     * 查询直播间自动化任务配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:task:list')")
+    @GetMapping("/listBarrage")
+    public TableDataInfo listBarrage(LiveAutoTask liveAutoTask)
+    {
+        startPage();
+        List<LiveAutoTask> list = liveAutoTaskService.selectLiveAutoTaskBarrageList(liveAutoTask);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播间自动化任务配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:task:export')")
+    @Log(title = "直播间自动化任务配置", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveAutoTask liveAutoTask)
+    {
+        List<LiveAutoTask> list = liveAutoTaskService.selectLiveAutoTaskList(liveAutoTask);
+        ExcelUtil<LiveAutoTask> util = new ExcelUtil<LiveAutoTask>(LiveAutoTask.class);
+        return util.exportExcel(list, "直播间自动化任务配置数据");
+    }
+
+    /**
+     * 获取直播间自动化任务配置详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:task:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(liveAutoTaskService.selectLiveAutoTaskById(id));
+    }
+
+    /**
+     * 新增直播间自动化任务配置
+     */
+    @PreAuthorize("@ss.hasPermi('live:task:add')")
+    @Log(title = "直播间自动化任务配置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public R add(@RequestBody LiveAutoTask liveAutoTask)
+    {
+        return liveAutoTaskService.insertLiveAutoTask(liveAutoTask);
+    }
+
+    /**
+     * 修改直播间自动化任务配置
+     */
+    @PreAuthorize("@ss.hasPermi('live:task:edit')")
+    @Log(title = "直播间自动化任务配置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveAutoTask liveAutoTask)
+    {
+        return toAjax(liveAutoTaskService.updateLiveAutoTask(liveAutoTask));
+    }
+
+    /**
+     * 删除直播间自动化任务配置
+     */
+    @PreAuthorize("@ss.hasPermi('live:task:remove')")
+    @Log(title = "直播间自动化任务配置", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(liveAutoTaskService.deleteLiveAutoTaskByIds(ids));
+    }
+
+    /**
+     * 导出直播间自动化任务配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:task:export')")
+    @Log(title = "直播间自动化任务配置", businessType = BusinessType.EXPORT)
+    @GetMapping("/exportData")
+    public AjaxResult exportData(LiveAutoTask liveAutoTask)
+    {
+        List<LiveAutoTask> list = liveAutoTaskService.selectLiveAutoTaskBarrageList(liveAutoTask);
+        ExcelUtil<LiveAutoTaskExportParam> util = new ExcelUtil<LiveAutoTaskExportParam>(LiveAutoTaskExportParam.class);
+        ArrayList<LiveAutoTaskExportParam> barrageList = new ArrayList<>();
+        for (LiveAutoTask autoTask : list) {
+            LiveAutoTaskExportParam liveAutoTaskImportParam = new LiveAutoTaskExportParam();
+            liveAutoTaskImportParam.setTaskName(autoTask.getTaskName());
+            liveAutoTaskImportParam.setContent(autoTask.getContent());
+            liveAutoTaskImportParam.setRegisterDate(autoTask.getTriggerValue());
+            barrageList.add(liveAutoTaskImportParam);
+        }
+
+        return util.exportExcel(barrageList, "直播间弹幕脚本数据");
+    }
+
+    @GetMapping("/importTemplate")
+    public AjaxResult importTemplate()
+    {
+        ExcelUtil<LiveAutoTaskImportParam> util = new ExcelUtil<>(LiveAutoTaskImportParam.class);
+        return util.importTemplateExcel("导入模板");
+    }
+
+    @PreAuthorize("@ss.hasPermi('live:task:export')")
+    @PostMapping("/importData")
+    public AjaxResult importLineData(@RequestParam("liveId") String liveId,MultipartFile file) throws Exception
+    {
+        ExcelUtil<LiveAutoTaskImportParam> util = new ExcelUtil<LiveAutoTaskImportParam>(LiveAutoTaskImportParam.class);
+        List<LiveAutoTaskImportParam> list = util.importExcel(file.getInputStream());
+        if(list.size()>12000){
+            return new AjaxResult(500,"导入数据超出范围,最大12000条");
+        }
+        LiveAutoTask liveAutoTask;
+        Date nowDate = DateUtils.getNowDate();
+        Live live = liveMapper.selectLiveByLiveId(Long.parseLong(liveId));
+        for (LiveAutoTaskImportParam liveAutoTaskImportParam : list) {
+            if(StringUtils.isEmpty(liveAutoTaskImportParam.getTaskName()) || StringUtils.isEmpty(liveAutoTaskImportParam.getRegisterDate()) || StringUtils.isEmpty(liveAutoTaskImportParam.getContent())) continue;
+            liveAutoTask = new LiveAutoTask();
+            liveAutoTask.setLiveId(Long.parseLong(liveId));
+            liveAutoTask.setTaskName(liveAutoTaskImportParam.getTaskName());
+            liveAutoTask.setTaskType(3L);
+            liveAutoTask.setTriggerType(2L);
+            liveAutoTask.setTriggerValue(formatTime(liveAutoTaskImportParam.getRegisterDate()));
+            liveAutoTask.setContent(liveAutoTaskImportParam.getContent());
+            liveAutoTask.setAbsValue(getTriggerValue(liveAutoTask.getTriggerValue(),live.getStartTime()));
+            liveAutoTask.setCreateTime(nowDate);
+            liveAutoTask.setUpdateTime(nowDate);
+            liveAutoTask.setStatus(1L);
+            liveAutoTask.setFinishStatus(0L);
+            liveAutoTaskService.directInsertLiveAutoTask(liveAutoTask);
+        }
+        return AjaxResult.success();
+    }
+
+    public static Date formatTime(String duration) {
+        String[] parts = duration.split(":");
+        if (parts.length != 3) {
+            throw new IllegalArgumentException("时间格式不正确,应为 hh:mm:ss");
+        }
+        int hours = Integer.parseInt(parts[0]);
+        int minutes = Integer.parseInt(parts[1]);
+        int seconds = Integer.parseInt(parts[2]);
+
+        // 获取当前日期的Calendar实例
+        Calendar calendar = Calendar.getInstance();
+        // 设置时分秒
+        calendar.set(Calendar.HOUR_OF_DAY, hours); // 24小时制
+        calendar.set(Calendar.MINUTE, minutes);
+        calendar.set(Calendar.SECOND, seconds);
+        calendar.set(Calendar.MILLISECOND, 0); // 毫秒设为0
+
+        return calendar.getTime();
+    }
+
+    private Date getTriggerValue(Date triggerValue, LocalDateTime liveStartTime) {
+        LocalDateTime triggerDateTime = LocalDateTime.ofInstant(
+                triggerValue.toInstant(),
+                ZoneId.systemDefault()
+        );
+        LocalTime triggerTime = triggerDateTime.toLocalTime();
+        LocalDateTime combinedTime = liveStartTime
+                .plusHours(triggerTime.getHour())
+                .plusMinutes(triggerTime.getMinute())
+                .plusSeconds(triggerTime.getSecond());
+        return Date.from(combinedTime.atZone(ZoneId.systemDefault()).toInstant());
+    }
+}

+ 97 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveCartController.java

@@ -0,0 +1,97 @@
+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.LiveCart;
+import com.fs.live.service.ILiveCartService;
+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-07-08
+ */
+@RestController
+@RequestMapping("/live/liveCart")
+public class LiveCartController extends BaseController
+{
+    @Autowired
+    private ILiveCartService liveCartService;
+
+    /**
+     * 查询购物车列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveCart:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveCart liveCart)
+    {
+        startPage();
+        List<LiveCart> list = liveCartService.selectLiveCartList(liveCart);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出购物车列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveCart:export')")
+    @Log(title = "购物车", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveCart liveCart)
+    {
+        List<LiveCart> list = liveCartService.selectLiveCartList(liveCart);
+        ExcelUtil<LiveCart> util = new ExcelUtil<LiveCart>(LiveCart.class);
+        return util.exportExcel(list, "购物车数据");
+    }
+
+    /**
+     * 获取购物车详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveCart:query')")
+    @GetMapping(value = "/{cardId}")
+    public AjaxResult getInfo(@PathVariable("cardId") Long cardId)
+    {
+        return AjaxResult.success(liveCartService.selectLiveCartByCartId(cardId));
+    }
+
+    /**
+     * 新增购物车
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveCart:add')")
+    @Log(title = "购物车", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveCart liveCart)
+    {
+        return toAjax(liveCartService.insertLiveCart(liveCart));
+    }
+
+    /**
+     * 修改购物车
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveCart:edit')")
+    @Log(title = "购物车", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveCart liveCart)
+    {
+        return toAjax(liveCartService.updateLiveCart(liveCart));
+    }
+
+    /**
+     * 删除购物车
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveCart:remove')")
+    @Log(title = "购物车", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{cardIds}")
+    public AjaxResult remove(@PathVariable Long[] cardIds)
+    {
+        return toAjax(liveCartService.deleteLiveCartByCartIds(cardIds));
+    }
+}

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

@@ -0,0 +1,361 @@
+package com.fs.company.controller.live;
+
+import com.alibaba.fastjson.JSONObject;
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.DateUtils;
+import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.http.HttpUtils;
+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.framework.service.TokenService;
+import com.fs.live.domain.Live;
+import com.fs.live.domain.LiveCompanyCode;
+import com.fs.live.service.ILiveCompanyCodeService;
+import com.fs.live.service.ILiveService;
+import com.fs.live.vo.LiveListVo;
+import com.fs.system.oss.OSSFactory;
+import com.google.common.reflect.TypeToken;
+import com.google.gson.Gson;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.nio.charset.StandardCharsets;
+import java.util.Date;
+import java.util.HashMap;
+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;
+    @Autowired
+    private TokenService tokenService;
+    @Autowired
+    private ILiveCompanyCodeService liveCompanyCodeService;
+
+    /**
+     * 查询直播列表
+     */
+    @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')")
+    @GetMapping("/finishLive")
+    public R finishLive(Live live) {
+        CompanyUser user = SecurityUtils.getLoginUser().getUser();
+        live.setCompanyUserId(user.getUserId());
+        live.setCompanyId(user.getCompanyId());
+        return liveService.finishLive(live);
+    }
+
+    /**
+     * 复制直播
+     */
+    @PreAuthorize("@ss.hasPermi('live:live:edit')")
+    @GetMapping("/copyLive")
+    public R copyLive(Live live) {
+        CompanyUser user = SecurityUtils.getLoginUser().getUser();
+        live.setCompanyUserId(user.getUserId());
+        live.setCompanyId(user.getCompanyId());
+        return liveService.copyLive(live);
+    }
+
+    /**
+     * 开启直播
+     */
+    @PreAuthorize("@ss.hasPermi('live:live:edit')")
+    @GetMapping("/startLive")
+    public R startLive(Live live) {
+        CompanyUser user = SecurityUtils.getLoginUser().getUser();
+        live.setCompanyUserId(user.getUserId());
+        live.setCompanyId(user.getCompanyId());
+        return liveService.startLive(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));
+    }
+
+    @PreAuthorize("@ss.hasPermi('live:live:query')")
+    @GetMapping("/living/{liveId}")
+    public R getRoom(@PathVariable String liveId) {
+        return liveService.getLiveRoom(liveId);
+    }
+
+    @PreAuthorize("@ss.hasPermi('live:live:query')")
+    @PostMapping("/checkLive")
+    public R checkLiving(@RequestBody Map<String, String> payload) {
+        return liveService.checkLiving(payload);
+    }
+
+    @PreAuthorize("@ss.hasPermi('live:live:edit')")
+    @PostMapping("/closeLiving")
+    public R closeLiving(@RequestBody Map<String, String> payload) {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        payload.put("userId", loginUser.getUser().getUserId().toString());
+        return liveService.closeLiving(payload);
+    }
+
+    @PreAuthorize("@ss.hasPermi('live:live:insert')")
+    @PostMapping("/create")
+    public R createRoom(@RequestBody Map<String, Object> payload) {
+        if (!payload.containsKey("liveId")) {
+            return R.error("直播间id缺失");
+        }
+        Long liveId = Long.valueOf(payload.get("liveId").toString());
+        return liveService.createLiveRoom(liveId);
+    }
+
+    /**
+     * 校验上传的身份证信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:live:insert')")
+    @PostMapping("/verifyIdInfo")
+    public R verifyIdInfo(@RequestBody Map<String, String> payload) {
+        return liveService.verifyIdInfo(payload);
+    }
+
+    /**
+     * 开始循环播放视频
+     */
+    @PreAuthorize("@ss.hasPermi('live:live:edit')")
+    @PostMapping("/startLoopPlay")
+    public R startLoopPlay(@RequestBody Live live) {
+        return liveService.startLoopPlay(live);
+    }
+
+    /**
+     * 停止循环播放
+     */
+    @PreAuthorize("@ss.hasPermi('live:live:edit')")
+    @PostMapping("/stopLoopPlay")
+    public R stopLoopPlay(@RequestBody Live live) {
+        return liveService.stopLoopPlay(live);
+    }
+
+    /**
+     * 批量上下架视频
+     */
+    @PreAuthorize("@ss.hasPermi('live:live:edit')")
+    @PostMapping("/handleShelfOrUn")
+    public R handleShelfOrUn(@RequestBody LiveListVo listVo) {
+        setListCompanyId(listVo);
+        return liveService.handleShelfOrUn(listVo);
+    }
+
+    /**
+     * 批量删除视频
+     */
+    @PreAuthorize("@ss.hasPermi('live:live:edit')")
+    @PostMapping("/handleDeleteSelected")
+    public R handleDeleteSelected(@RequestBody LiveListVo listVo) {
+        setListCompanyId(listVo);
+        return liveService.handleDeleteSelected(listVo);
+    }
+
+
+
+    /**
+     * 设置企业ID和企业用户ID
+     * @param live 直播间
+     */
+    private void setCompanyId(Live live) {
+        CompanyUser user = SecurityUtils.getLoginUser().getUser();
+        live.setCompanyId(user.getCompanyId());
+        live.setCompanyUserId(user.getUserId());
+    }
+
+    /**
+     * 设置企业ID和企业用户ID
+     * @param live 直播间
+     */
+    private void setListCompanyId(LiveListVo live) {
+        CompanyUser user = SecurityUtils.getLoginUser().getUser();
+        live.setCompanyId(user.getCompanyId());
+        live.setCompanyUserId(user.getUserId());
+    }
+
+    @ApiOperation("查询微信urlScheme")
+    @GetMapping("/getAppletScheme")
+    public R getAppletScheme(@RequestParam(value = "cardId") Long cardId) {
+        try {
+            String appId = "123";
+            String secret = "123";
+            String rspStr = HttpUtils.sendGet("https://api.weixin.qq.com/cgi-bin/token", "grant_type=client_credential&" + "appid=" + appId + "&secret=" + secret);
+            JSONObject obj = JSONObject.parseObject(rspStr);
+            String access_token = obj.getString("access_token");
+            JSONObject jsonObject = new JSONObject();
+            JSONObject jump_wxaObj = new JSONObject();
+            jump_wxaObj.put("path", "/pages_company/card");
+            jump_wxaObj.put("query", "id=" + cardId);
+            jsonObject.put("jump_wxa", jump_wxaObj);
+            jsonObject.put("is_expire", false);
+            String paramStr = jsonObject.toJSONString();
+            String postStr = HttpUtils.sendPost("https://api.weixin.qq.com/wxa/generatescheme?access_token=" + access_token, paramStr);
+            obj = JSONObject.parseObject(postStr);
+            //response.addHeader("Access-Control-Allow-Origin", "*");
+            return R.ok().put("result", obj);
+        } catch (Exception e) {
+            return R.error("操作失败");
+        }
+    }
+
+    @ApiOperation("生成微信小程序码")
+    @GetMapping("/getWxaCodeUnLimit")
+    @PreAuthorize("@ss.hasPermi('live:live:edit')")
+    public R getWxaCodeUnLimit(@RequestParam(value = "liveId") Long liveId) {
+        String url="https://api.weixin.qq.com/cgi-bin/stable_token";
+        HashMap<String, String> map = new HashMap<>();
+        map.put("grant_type","client_credential");
+        // 芳华惠选
+        map.put("appid","wx503cf8ab31f83dd4");
+        map.put("secret","1ba1972363889dcb4a37ecb685744435");
+        String accessToken = HttpUtils.endApi(url, null, map);
+        // 创建Gson对象
+        Gson gson = new Gson();
+        // 将JSON字符串解析为Java对象
+        Map<String, String> accessTokenMap  = gson.fromJson(accessToken, new TypeToken<Map<String, Object>>(){}.getType());
+        String codeUrl="https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token="+accessTokenMap.get("access_token");
+        HashMap<String, String> jsonMap = new HashMap<>();
+        jsonMap.put("page","pages_course/living");
+        CompanyUser user = SecurityUtils.getLoginUser().getUser();
+        String scene = "a="+ liveId+"&b="+user.getCompanyId()+"&c="+user.getUserId();
+        jsonMap.put("scene",scene);
+        //正式版为 "release",体验版为 "trial",开发版为 "develop"
+        jsonMap.put("env_version","release");
+        byte[] bytes = HttpUtils.getWechatQrcodeByHttpURL(codeUrl, jsonMap);
+        if(bytes.length == 0) return R.error("生成二维码失败");
+        if (bytes.length > 0 && bytes.length < 500) {
+            String errorCode = new String(bytes, StandardCharsets.UTF_8);
+            logger.error(errorCode);
+            return R.error("生成二维码失败");
+        }
+        // 保存
+        String saveUrl = OSSFactory.build().uploadSuffix(bytes, ".png");
+        Date nowDate = DateUtils.getNowDate();
+        LiveCompanyCode exist = liveCompanyCodeService.selectByLiveIdAndUser(liveId, user.getCompanyId(), user.getUserId());
+        if (exist == null) {
+            exist = new LiveCompanyCode();
+            exist.setUpdateTime(nowDate);
+            exist.setLiveCodeUrl(saveUrl);
+            exist.setLiveId(liveId);
+            exist.setCompanyId(user.getCompanyId());
+            exist.setCompanyUserId(user.getUserId());
+            exist.setCreateTime(nowDate);
+            liveCompanyCodeService.insertLiveCompanyCode(exist);
+        } else {
+            exist.setUpdateTime(nowDate);
+            exist.setLiveCodeUrl(saveUrl);
+            liveCompanyCodeService.updateLiveCompanyCode(exist);
+        }
+
+        return R.ok().put("data", exist);
+    }
+}

+ 209 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveCouponController.java

@@ -0,0 +1,209 @@
+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.domain.R;
+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.LiveCoupon;
+import com.fs.live.domain.LiveCouponIssue;
+import com.fs.live.param.LiveCouponPublishParam;
+import com.fs.live.service.ILiveCouponIssueService;
+import com.fs.live.service.ILiveCouponService;
+import com.fs.live.vo.LiveCouponListVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 优惠券Controller
+ *
+ * @author fs
+ * @date 2025-09-30
+ */
+@RestController
+@RequestMapping("/live/coupon")
+public class LiveCouponController extends BaseController
+{
+    @Autowired
+    private ILiveCouponService liveCouponService;
+    @Autowired
+    private ILiveCouponIssueService liveCouponIssueService;
+
+
+    /**
+     * 查询优惠券列表
+     */
+//    @PreAuthorize("@ss.hasPermi('system:coupon:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveCoupon liveCoupon)
+    {
+        startPage();
+        liveCoupon.setIsDel(0);
+        List<LiveCoupon> list = liveCouponService.selectLiveCouponList(liveCoupon);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出优惠券列表
+     */
+//    @PreAuthorize("@ss.hasPermi('system:coupon:export')")
+    @Log(title = "优惠券", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveCoupon liveCoupon)
+    {
+        List<LiveCoupon> list = liveCouponService.selectLiveCouponList(liveCoupon);
+        ExcelUtil<LiveCoupon> util = new ExcelUtil<LiveCoupon>(LiveCoupon.class);
+        return util.exportExcel(list, "coupon");
+    }
+
+    /**
+     * 获取优惠券详细信息
+     */
+//    @PreAuthorize("@ss.hasPermi('system:coupon:query')")
+    @GetMapping(value = "/{couponId}")
+    public AjaxResult getInfo(@PathVariable("couponId") Long couponId)
+    {
+        return AjaxResult.success(liveCouponService.selectLiveCouponById(couponId));
+    }
+
+    /**
+     * 新增优惠券
+     */
+//    @PreAuthorize("@ss.hasPermi('system:coupon:add')")
+    @Log(title = "优惠券", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveCoupon liveCoupon)
+    {
+        return toAjax(liveCouponService.insertLiveCoupon(liveCoupon));
+    }
+
+    /**
+     * 修改优惠券
+     */
+//    @PreAuthorize("@ss.hasPermi('system:coupon:edit')")
+    @Log(title = "优惠券", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveCoupon liveCoupon)
+    {
+        return toAjax(liveCouponService.updateLiveCoupon(liveCoupon));
+    }
+
+    /**
+     * 删除优惠券
+     */
+//    @PreAuthorize("@ss.hasPermi('system:coupon:remove')")
+    @Log(title = "优惠券", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{couponIds}")
+    public AjaxResult remove(@PathVariable Long[] couponIds)
+    {
+        return toAjax(liveCouponService.deleteLiveCouponByIds(couponIds));
+    }
+
+//    @PreAuthorize("@ss.hasPermi('live:liveCoupon:publish')")
+    @PostMapping("/publish")
+    public AjaxResult publish(@RequestBody LiveCouponPublishParam publishParam)
+    {
+        LiveCoupon coupon=liveCouponService.selectLiveCouponById(publishParam.getCouponId());
+        LiveCouponIssue issue=new LiveCouponIssue();
+        issue.setCouponId(publishParam.getCouponId());
+        issue.setCouponName(coupon.getTitle());
+        issue.setCouponType(Math.toIntExact(coupon.getType()));
+        issue.setStartTime(publishParam.getStartTime());
+        issue.setLimitTime(publishParam.getLimitTime());
+        issue.setTotalCount(Long.valueOf(publishParam.getTotalCount()));
+        issue.setRemainCount(0L);
+        issue.setIsPermanent(0);
+        issue.setStatus(1);
+        issue.setCreateTime(new Date());
+        return toAjax( liveCouponIssueService.insertLiveCouponIssue(issue));
+    }
+
+//    @PreAuthorize("@ss.hasPermi('live:liveCoupon:batchPublish')")
+    @PostMapping("/batchPublish")
+    public R batchPublish(@RequestBody LiveCouponPublishParam publishParam)
+    {
+
+        List<LiveCoupon> list=liveCouponService.selectLiveCouponByIds(publishParam.getIds());
+        for (LiveCoupon coupon :list ){
+            LiveCouponIssue issue=new LiveCouponIssue();
+            issue.setCouponId(coupon.getCouponId());
+            issue.setCouponName(coupon.getTitle());
+            issue.setCouponType(Math.toIntExact(coupon.getType()));
+            issue.setStartTime(publishParam.getStartTime());
+            issue.setLimitTime(publishParam.getLimitTime());
+            issue.setTotalCount(Long.valueOf(publishParam.getTotalCount()));
+            issue.setRemainCount(0L);
+            issue.setIsPermanent(0);
+            issue.setStatus(1);
+            issue.setCreateTime(new Date());
+            liveCouponIssueService.insertLiveCouponIssue(issue);
+        }
+        return R.ok();
+    }
+
+//    @PreAuthorize("@ss.hasPermi('live:liveCoupon:query')")
+    @GetMapping(value = "/listLiveCoupon")
+    public TableDataInfo listLiveCoupon(@RequestParam("liveId") Long liveId)
+    {
+        startPage();
+        List<LiveCoupon> list = liveCouponService.selectLiveCouponByLiveId(liveId);
+        return getDataTable(list);
+    }
+//    @PreAuthorize("@ss.hasPermi('live:liveCoupon:query')")
+    @GetMapping(value = "/listCoupon")
+    public TableDataInfo listCoupon(@RequestParam("liveId") Long liveId,@RequestParam("couponName") String couponName)
+    {
+        startPage();
+        List<LiveCoupon> list = liveCouponService.listCoupon(liveId,couponName);
+        return getDataTable(list);
+    }
+
+
+//    @PreAuthorize("@ss.hasPermi('live:liveCoupon:add')")
+    @Log(title = "直播优惠券", businessType = BusinessType.INSERT)
+    @PostMapping("/delLiveCoupon")
+    public AjaxResult delLiveCoupon(@RequestBody LiveCouponListVo vo)
+    {
+        return toAjax(liveCouponService.delLiveCoupon(vo));
+    }
+
+    /**
+     * 新增直播商品
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveCoupon:add')")
+    @Log(title = "直播优惠券", businessType = BusinessType.INSERT)
+    @PostMapping("/addLiveCoupon")
+    public AjaxResult addLiveCoupon(@RequestBody Map<String, Object> payload)
+    {
+
+        return toAjax(liveCouponService.insertLiveCouponEntity(payload));
+    }
+
+//    @PreAuthorize("@ss.hasPermi('live:liveCoupon:edit')")
+    @PostMapping("/handleIsShowChange")
+    public R handleIsShowChange(@RequestBody Map<String, Object> payload) {
+        return liveCouponService.handleIsShowChange(payload);
+    }
+
+    /**
+     * 批量删除视频
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveCoupon:remove')")
+    @PostMapping("/handleDeleteSelected")
+    public R handleDeleteSelected(@RequestBody LiveCouponListVo listVo) {
+        return liveCouponService.handleDeleteSelectedAdmin(listVo);
+    }
+
+//    @PreAuthorize("@ss.hasPermi('live:liveCoupon:edit')")
+    @PostMapping("/updateLiveCouponBind")
+    public R updateLiveCouponBind(@RequestBody LiveCouponListVo listVo) {
+        return liveCouponService.updateLiveCouponBind(listVo);
+    }
+}

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

@@ -0,0 +1,158 @@
+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.security.SecurityUtils;
+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.getCompanyRecentLive(SecurityUtils.getLoginUser().getCompany().getCompanyId()));
+    }
+
+    /**
+     * 查询直播top榜数据
+     */
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:getLiveTop')")
+    @GetMapping("/getLiveTop")
+    public AjaxResult getLiveTop(String rankType){
+        System.out.println(rankType);
+        return AjaxResult.success(liveDataService.getCompanyLiveTop(rankType, SecurityUtils.getLoginUser().getCompany().getCompanyId()));
+    }
+    /**
+     * 查询直播趋势数据
+     * @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.getCompanyTrendData(type, date,category, SecurityUtils.getLoginUser().getCompany().getCompanyId()));
+    }
+    /*@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("列配置已保存");
+    }
+
+
+
+}

+ 97 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveGiftController.java

@@ -0,0 +1,97 @@
+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.LiveGift;
+import com.fs.live.service.ILiveGiftService;
+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-07-08
+ */
+@RestController
+@RequestMapping("/live/gift")
+public class LiveGiftController extends BaseController
+{
+    @Autowired
+    private ILiveGiftService liveGiftService;
+
+    /**
+     * 查询直播间礼物配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:gift:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveGift liveGift)
+    {
+        startPage();
+        List<LiveGift> list = liveGiftService.selectLiveGiftList(liveGift);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播间礼物配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:gift:export')")
+    @Log(title = "直播间礼物配置", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveGift liveGift)
+    {
+        List<LiveGift> list = liveGiftService.selectLiveGiftList(liveGift);
+        ExcelUtil<LiveGift> util = new ExcelUtil<LiveGift>(LiveGift.class);
+        return util.exportExcel(list, "直播间礼物配置数据");
+    }
+
+    /**
+     * 获取直播间礼物配置详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:gift:query')")
+    @GetMapping(value = "/{giftId}")
+    public AjaxResult getInfo(@PathVariable("giftId") Long giftId)
+    {
+        return AjaxResult.success(liveGiftService.selectLiveGiftByGiftId(giftId));
+    }
+
+    /**
+     * 新增直播间礼物配置
+     */
+    @PreAuthorize("@ss.hasPermi('live:gift:add')")
+    @Log(title = "直播间礼物配置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveGift liveGift)
+    {
+        return toAjax(liveGiftService.insertLiveGift(liveGift));
+    }
+
+    /**
+     * 修改直播间礼物配置
+     */
+    @PreAuthorize("@ss.hasPermi('live:gift:edit')")
+    @Log(title = "直播间礼物配置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveGift liveGift)
+    {
+        return toAjax(liveGiftService.updateLiveGift(liveGift));
+    }
+
+    /**
+     * 删除直播间礼物配置
+     */
+    @PreAuthorize("@ss.hasPermi('live:gift:remove')")
+    @Log(title = "直播间礼物配置", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{giftIds}")
+    public AjaxResult remove(@PathVariable Long[] giftIds)
+    {
+        return toAjax(liveGiftService.deleteLiveGiftByGiftIds(giftIds));
+    }
+}

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

@@ -0,0 +1,164 @@
+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.domain.R;
+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 com.fs.live.vo.LiveGoodsListVo;
+import com.fs.live.vo.LiveGoodsVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 直播商品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, @RequestParam(value = "liveId", required = true) Long liveId)
+    {
+        // 设置企业ID和企业用户ID
+        setCompanyId(liveGoods);
+        liveGoods.setLiveId(liveId);
+
+        startPage();
+        List<LiveGoodsVo> list = liveGoodsService.selectProductListByLiveId(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();
+    }
+
+    /**
+     * 新增直播商品
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:add')")
+    @Log(title = "直播商品", businessType = BusinessType.INSERT)
+    @PostMapping
+    public R add(@RequestBody Map<String, Object> payload)
+    {
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        CompanyUser user = loginUser.getUser();
+        return liveGoodsService.insertLiveGoods(payload,user);
+    }
+
+    /**
+     * 修改直播商品
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:edit')")
+    @Log(title = "直播商品", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public R edit(@RequestBody LiveGoods liveGoods)
+    {
+        return 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());
+    }
+
+    /**
+     * 批量上下架视频
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:edit')")
+    @PostMapping("/handleShelfOrUn")
+    public R handleShelfOrUn(@RequestBody LiveGoodsListVo listVo) {
+        setListCompanyId(listVo);
+        return liveGoodsService.handleShelfOrUn(listVo);
+    }
+
+    /**
+     * 批量删除视频
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:remove')")
+    @PostMapping("/handleDeleteSelected")
+    public R handleDeleteSelected(@RequestBody LiveGoodsListVo listVo) {
+        setListCompanyId(listVo);
+        return liveGoodsService.handleDeleteSelected(listVo);
+    }
+
+    /**
+     * 更新展示状态
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:edit')")
+    @PostMapping("/handleIsShowChange")
+    public R handleIsShowChange(@RequestBody LiveGoodsListVo listVo) {
+        setListCompanyId(listVo);
+        return liveGoodsService.handleIsShowChange(listVo);
+    }
+
+    /**
+     * 设置企业ID和企业用户ID
+     */
+    private void setListCompanyId(LiveGoodsListVo live) {
+        CompanyUser user = SecurityUtils.getLoginUser().getUser();
+        live.setCompanyId(user.getCompanyId());
+        live.setCompanyUserId(user.getUserId());
+    }
+}

+ 143 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveLotteryConfController.java

@@ -0,0 +1,143 @@
+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.domain.R;
+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.SecurityUtils;
+import com.fs.live.domain.LiveLotteryConf;
+import com.fs.live.param.LiveLotteryProductSaveParam;
+import com.fs.live.service.ILiveLotteryConfService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 直播抽奖配置Controller
+ *
+ * @author fs
+ * @date 2025-07-17
+ */
+@RestController
+@RequestMapping("/live/liveLotteryConf")
+public class LiveLotteryConfController extends BaseController
+{
+    @Autowired
+    private ILiveLotteryConfService liveLotteryConfService;
+
+    /**
+     * 查询直播抽奖配置列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveLotteryConf liveLotteryConf)
+    {
+        startPage();
+        List<LiveLotteryConf> list = liveLotteryConfService.selectLiveLotteryConfList(liveLotteryConf);
+        return getDataTable(list);
+    }
+
+    @GetMapping("/listOn")
+    public TableDataInfo listOn(LiveLotteryConf liveLotteryConf)
+    {
+        startPage();
+        List<LiveLotteryConf> list = liveLotteryConfService.selectLiveLotteryConfListOn(liveLotteryConf);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播抽奖配置列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:export')")
+    @Log(title = "直播抽奖配置", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveLotteryConf liveLotteryConf)
+    {
+        List<LiveLotteryConf> list = liveLotteryConfService.selectLiveLotteryConfList(liveLotteryConf);
+        ExcelUtil<LiveLotteryConf> util = new ExcelUtil<LiveLotteryConf>(LiveLotteryConf.class);
+        return util.exportExcel(list, "直播抽奖配置数据");
+    }
+
+    /**
+     * 获取直播抽奖配置详细信息
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:query')")
+    @GetMapping(value = "/{lotteryId}")
+    public AjaxResult getInfo(@PathVariable("lotteryId") Long lotteryId)
+    {
+        return AjaxResult.success(liveLotteryConfService.selectLiveLotteryConfByLotteryId(lotteryId));
+    }
+
+    /**
+     * 新增直播抽奖配置
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:add')")
+    @Log(title = "直播抽奖配置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveLotteryConf liveLotteryConf)
+    {
+        return toAjax(liveLotteryConfService.insertLiveLotteryConf(liveLotteryConf));
+    }
+
+    /**
+     * 修改直播抽奖配置
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:edit')")
+    @Log(title = "直播抽奖配置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public R edit(@RequestBody LiveLotteryConf liveLotteryConf)
+    {
+        return liveLotteryConfService.updateLiveLotteryConf(liveLotteryConf);
+    }
+
+    /**
+     * 删除直播抽奖配置
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:remove')")
+    @Log(title = "直播抽奖配置", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{lotteryIds}")
+    public AjaxResult remove(@PathVariable Long[] lotteryIds)
+    {
+        return toAjax(liveLotteryConfService.deleteLiveLotteryConfByLotteryIds(lotteryIds));
+    }
+
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:query')")
+    @GetMapping("/live/{liveId}")
+    public List<LiveLotteryConf> getByLiveId(@PathVariable Long liveId) {
+        return liveLotteryConfService.getByLiveId(liveId);
+    }
+
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:remove')")
+    @DeleteMapping("/{id}")
+    public void delete(@PathVariable Long id) {
+        liveLotteryConfService.delete(id);
+    }
+
+    /**
+     * 发起抽奖
+     * */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:edit')")
+    @GetMapping("/start/{lotteryId}")
+    public String  start(@PathVariable Long lotteryId) {
+       return liveLotteryConfService.startLottery(lotteryId, SecurityUtils.getLoginUser().getUser().getUserId());
+    }
+
+    /** 查询抽奖配置的所有商品信息*/
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:query')")
+    @GetMapping("/getGoods/{lotteryId}")
+    public R getGoods(@PathVariable Long lotteryId) {
+        return R.ok().put("data",liveLotteryConfService.getGoods(lotteryId));
+    }
+
+    /** 抽奖商品配置保存*/
+    @PostMapping("/product")
+    public void saveGoods(@RequestBody LiveLotteryProductSaveParam liveLotteryProducts) {
+        //liveLotteryProducts.setCreateBy(getUsername());
+        liveLotteryConfService.saveProducts(liveLotteryProducts);
+    }
+
+}

+ 97 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveLotteryRecordController.java

@@ -0,0 +1,97 @@
+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.LiveLotteryRecord;
+import com.fs.live.service.ILiveLotteryRecordService;
+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-07-17
+ */
+@RestController
+@RequestMapping("/live/liveLotteryRecord")
+public class LiveLotteryRecordController extends BaseController
+{
+    @Autowired
+    private ILiveLotteryRecordService liveLotteryRecordService;
+
+    /**
+     * 查询直播抽奖记录列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveLotteryRecord liveLotteryRecord)
+    {
+        startPage();
+        List<LiveLotteryRecord> list = liveLotteryRecordService.selectLiveLotteryRecordList(liveLotteryRecord);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播抽奖记录列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:export')")
+    @Log(title = "直播抽奖记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveLotteryRecord liveLotteryRecord)
+    {
+        List<LiveLotteryRecord> list = liveLotteryRecordService.selectLiveLotteryRecordList(liveLotteryRecord);
+        ExcelUtil<LiveLotteryRecord> util = new ExcelUtil<LiveLotteryRecord>(LiveLotteryRecord.class);
+        return util.exportExcel(list, "直播抽奖记录数据");
+    }
+
+    /**
+     * 获取直播抽奖记录详细信息
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:query')")
+    @GetMapping(value = "/{lotteryId}")
+    public AjaxResult getInfo(@PathVariable("lotteryId") Long lotteryId)
+    {
+        return AjaxResult.success(liveLotteryRecordService.selectLiveLotteryRecordByLotteryId(lotteryId));
+    }
+
+    /**
+     * 新增直播抽奖记录
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:add')")
+    @Log(title = "直播抽奖记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveLotteryRecord liveLotteryRecord)
+    {
+        return toAjax(liveLotteryRecordService.insertLiveLotteryRecord(liveLotteryRecord));
+    }
+
+    /**
+     * 修改直播抽奖记录
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:edit')")
+    @Log(title = "直播抽奖记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveLotteryRecord liveLotteryRecord)
+    {
+        return toAjax(liveLotteryRecordService.updateLiveLotteryRecord(liveLotteryRecord));
+    }
+
+    /**
+     * 删除直播抽奖记录
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:remove')")
+    @Log(title = "直播抽奖记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{lotteryIds}")
+    public AjaxResult remove(@PathVariable Long[] lotteryIds)
+    {
+        return toAjax(liveLotteryRecordService.deleteLiveLotteryRecordByLotteryIds(lotteryIds));
+    }
+}

+ 97 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveLotteryRegistrationController.java

@@ -0,0 +1,97 @@
+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.LiveLotteryRegistration;
+import com.fs.live.service.ILiveLotteryRegistrationService;
+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-07-17
+ */
+@RestController
+@RequestMapping("/live/liveLotteryRegistration")
+public class LiveLotteryRegistrationController extends BaseController
+{
+    @Autowired
+    private ILiveLotteryRegistrationService liveLotteryRegistrationService;
+
+    /**
+     * 查询直播抽奖登记列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveLotteryRegistration liveLotteryRegistration)
+    {
+        startPage();
+        List<LiveLotteryRegistration> list = liveLotteryRegistrationService.selectLiveLotteryRegistrationList(liveLotteryRegistration);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播抽奖登记列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:export')")
+    @Log(title = "直播抽奖登记", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveLotteryRegistration liveLotteryRegistration)
+    {
+        List<LiveLotteryRegistration> list = liveLotteryRegistrationService.selectLiveLotteryRegistrationList(liveLotteryRegistration);
+        ExcelUtil<LiveLotteryRegistration> util = new ExcelUtil<LiveLotteryRegistration>(LiveLotteryRegistration.class);
+        return util.exportExcel(list, "直播抽奖登记数据");
+    }
+
+    /**
+     * 获取直播抽奖登记详细信息
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:query')")
+    @GetMapping(value = "/{registrationId}")
+    public AjaxResult getInfo(@PathVariable("registrationId") Long registrationId)
+    {
+        return AjaxResult.success(liveLotteryRegistrationService.selectLiveLotteryRegistrationByRegistrationId(registrationId));
+    }
+
+    /**
+     * 新增直播抽奖登记
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:add')")
+    @Log(title = "直播抽奖登记", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveLotteryRegistration liveLotteryRegistration)
+    {
+        return toAjax(liveLotteryRegistrationService.insertLiveLotteryRegistration(liveLotteryRegistration));
+    }
+
+    /**
+     * 修改直播抽奖登记
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:edit')")
+    @Log(title = "直播抽奖登记", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveLotteryRegistration liveLotteryRegistration)
+    {
+        return toAjax(liveLotteryRegistrationService.updateLiveLotteryRegistration(liveLotteryRegistration));
+    }
+
+    /**
+     * 删除直播抽奖登记
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:remove')")
+    @Log(title = "直播抽奖登记", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{registrationIds}")
+    public AjaxResult remove(@PathVariable Long[] registrationIds)
+    {
+        return toAjax(liveLotteryRegistrationService.deleteLiveLotteryRegistrationByRegistrationIds(registrationIds));
+    }
+}

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

@@ -0,0 +1,100 @@
+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.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));
+    }
+
+}

+ 395 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveOrderController.java

@@ -0,0 +1,395 @@
+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.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.ParseUtils;
+import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.framework.security.LoginUser;
+import com.fs.framework.security.SecurityUtils;
+import com.fs.crm.domain.CrmCustomer;
+import com.fs.crm.service.ICrmCustomerService;
+import com.fs.framework.service.TokenService;
+import com.fs.his.domain.FsUser;
+import com.fs.his.param.FsStoreOrderBindCustomerParam;
+import com.fs.his.service.IFsExpressService;
+import com.fs.his.service.IFsUserService;
+import com.fs.hisStore.param.FsStoreOrderExpressParam;
+import com.fs.live.domain.*;
+import com.fs.live.enums.LiveOrderCancleReason;
+import com.fs.live.service.ILiveOrderItemService;
+import com.fs.live.service.ILiveOrderLogsService;
+import com.fs.live.service.ILiveOrderPaymentService;
+import com.fs.live.service.ILiveOrderService;
+import com.fs.live.vo.LiveGoodsVo;
+import com.fs.live.vo.LiveOrderVo;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 订单Controller
+ *
+ * @author fs
+ * @date 2025-07-08
+ */
+@RestController
+@RequestMapping("/live/liveOrder")
+public class LiveOrderController extends BaseController
+{
+    @Autowired
+    private ILiveOrderService liveOrderService;
+
+    @Autowired
+    private ICrmCustomerService crmCustomerService;
+    @Autowired
+    private IFsUserService userService;
+    @Autowired
+    private ILiveOrderItemService orderItemService;
+    @Autowired
+    private ILiveOrderLogsService orderLogsService;
+    @Autowired
+    private ILiveOrderPaymentService orderPaymentService;
+    @Autowired
+    private TokenService tokenService;
+    @Autowired
+    private IFsExpressService expressService;
+
+
+//    @Autowired
+//    private IFsExpressService expressService;
+//
+//    @Autowired
+//    private ConfigUtil configUtil;
+
+//    @Autowired
+//    @Qualifier("wdtErpOrderServiceImpl")
+//    private IErpOrderService wdtOrderService;
+
+    /**
+     * 获取订单详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:query')")
+    @GetMapping(value = "/{id}")
+    public R getInfo(@PathVariable("id") Long id)
+    {
+        LiveOrder order=liveOrderService.selectLiveOrderByOrderId(String.valueOf(id));
+        order.setUserPhone(ParseUtils.parsePhone(order.getUserPhone()));
+        order.setUserAddress(ParseUtils.parseAddress(order.getUserAddress()));
+        FsUser user=userService.selectFsUserById(Long.valueOf(order.getUserId()));
+        user.setPhone(ParseUtils.parsePhone(user.getPhone()));
+        List<LiveOrderItem> items=orderItemService.selectCheckedByOrderId(id);
+
+        List<LiveOrderLogs> logs=orderLogsService.selectLiveOrderLogsByOrderId(id);
+        List<LiveOrderPayment> payments=orderPaymentService.selectLiveOrderPaymentByOrderId(id);
+
+        CrmCustomer customer=null;
+        if(order.getCustomerId()!=null&&order.getCustomerId()>0){
+            customer=crmCustomerService.selectCrmCustomerById(order.getCustomerId());
+        }
+        return R.ok().put("order", order).put("items", items).put("logs",logs).put("user",user).put("customer",customer).put("payments",payments) ;
+    }
+
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:query')")
+    @GetMapping(value = "/payments/{id}")
+    public R getOrderPayments(@PathVariable("id") Long id){
+        List<LiveOrderPayment> payments=orderPaymentService.selectLiveOrderPaymentByOrderId(id);
+        return R.ok().put("payments",payments);
+    }
+
+
+//    @Log(title = "订单凭证上传", businessType = BusinessType.UPDATE)
+////    @PreAuthorize("@ss.hasPermi('live:liveOrder:uploadCredentials')")
+//    @PostMapping("/uploadCredentials")
+//    public R UploadCredentials(@RequestBody LiveOrder order)
+//    {
+////        String[] imageUrls = order.getCredentials().split(",");
+//        if (order.getCertificates() == null ){
+//            return R.error("请选择图片上传");
+//        }
+//        liveOrderService.uploadCredentials(order);
+//        return R.ok();
+//    }
+
+    @GetMapping(value = "/queryAddress/{id}")
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:queryAddress')")
+    public R getAddress(@PathVariable("id") Long id)
+    {
+        LiveOrder order = liveOrderService.selectLiveOrderByOrderId(String.valueOf(id));
+        String address = order.getUserAddress();
+        return R.ok().put("address",address);
+    }
+    @GetMapping(value = "/queryPhone/{id}")
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:queryPhone')")
+    @Log(title = "查看电话", businessType = BusinessType.GRANT)
+    public R getPhone(@PathVariable("id") Long id)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        if (loginUser.getUser().getUserType().equals("00")){
+            LiveOrder order = liveOrderService.selectLiveOrderByOrderId(String.valueOf(id));
+            String userPhone = order.getUserPhone();
+            return R.ok().put("userPhone",userPhone);
+        }
+        return R.error("无权查看");
+    }
+
+    /**
+     * 根据orderId查询
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:query')")
+    @GetMapping("/getByOrderId/{orderId}")
+    public R getByOrderId(@PathVariable Long orderId) {
+        LiveOrder liveOrder = liveOrderService.selectLiveOrderByOrderId(String.valueOf(orderId));
+        return R.ok().put("data",liveOrder);
+    }
+
+    @ApiOperation("物流查询")
+    @PostMapping("/getExpressByDeliverId")
+    public R getExpressByDeliverId(@Validated @RequestBody FsStoreOrderExpressParam param, HttpServletRequest request){
+        // todo yhq
+//        return expressService.getLiveExpressByDeliverId(param);
+        return R.ok();
+    }
+
+    /**
+     * 推送到智慧药房
+     */
+    @Log(title = "推药房", businessType = BusinessType.INSERT)
+    @PreAuthorize("@ss.hasPermi('his:storeOrder:sendHisGoods')")
+    @PutMapping("/tuiOrder")
+    public AjaxResult tuiOrder(@RequestBody LiveOrder liveOrder)
+    {
+        return toAjax(liveOrderService.tuiOrder(liveOrder.getOrderId()));
+    }
+
+    /**
+     * 查询订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveOrder liveOrder)
+    {
+        startPage();
+        Long companyId = SecurityUtils.getLoginUser().getCompany().getCompanyId();
+        liveOrder.setCompanyId(companyId);
+        List<LiveOrder> list = liveOrderService.selectLiveOrderList(liveOrder);
+        for (LiveOrder vo : list){
+            vo.setUserPhone(ParseUtils.parsePhone(vo.getUserPhone()));
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:export')")
+    @Log(title = "订单", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveOrder liveOrder)
+    {
+        List<LiveOrder> list = liveOrderService.selectLiveOrderList(liveOrder);
+        ExcelUtil<LiveOrder> util = new ExcelUtil<LiveOrder>(LiveOrder.class);
+        return util.exportExcel(list, "订单数据");
+    }
+
+    /**
+     * 获取订单详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:query')")
+    @GetMapping(value = "/info/{orderId}")
+    public AjaxResult getInfo(@PathVariable("orderId") String orderId)
+    {
+        return AjaxResult.success(liveOrderService.selectLiveOrderByOrderId(orderId));
+    }
+
+    /**
+     * 新增订单
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:add')")
+    @Log(title = "订单", businessType = BusinessType.INSERT)
+    @PostMapping("/create")
+    public R add(@RequestBody LiveOrder liveOrder)
+    {
+        Long userId = SecurityUtils.getLoginUser().getUser().getUserId();
+        liveOrder.setUserId(String.valueOf(userId));
+        return liveOrderService.createLiveOrder(liveOrder);
+    }
+
+    /**
+     * 修改订单
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:edit')")
+    @Log(title = "订单", businessType = BusinessType.UPDATE)
+    @PutMapping("/update")
+    public AjaxResult edit(@RequestBody LiveOrder liveOrder)
+    {
+        return toAjax(liveOrderService.updateLiveOrder(liveOrder));
+    }
+
+
+    /**
+     * 查看物流状态
+     * */
+//    @PreAuthorize("@ss.hasPermi('live:liveOrder:express')")
+//    @GetMapping(value = "/getExpress/{id}")
+//    public R getExpress(@PathVariable("id") String id)
+//    {
+//        LiveOrder order=liveOrderService.selectLiveOrderByOrderId(id);
+//        ExpressInfoDTO expressInfoDTO=null;
+//        if(StringUtils.isNotEmpty(order.getDeliverySn())){
+//            String lastFourNumber = "";
+//            if (order.getDeliveryCode().equals(ShipperCodeEnum.SF.getValue())) {
+//
+//                lastFourNumber = order.getUserPhone();
+//                if (lastFourNumber.length() == 11) {
+//                    lastFourNumber = StrUtil.sub(lastFourNumber, lastFourNumber.length(), -4);
+//                }else if (lastFourNumber.length()>11){
+//                    String jm = decryptPhone(lastFourNumber);
+//                    lastFourNumber = StrUtil.sub(jm, jm.length(), -4);
+//                }
+//            }
+//            expressInfoDTO=expressService.getExpressInfo(order.getOrderCode(),order.getDeliveryCode(),order.getDeliverySn(),lastFourNumber);
+//
+//            if((expressInfoDTO.getStateEx()!=null&&expressInfoDTO.getStateEx().equals("0"))&&(expressInfoDTO.getState()!=null&&expressInfoDTO.getState().equals("0"))){
+//                lastFourNumber = "19923690275";
+//                if (order.getDeliveryCode().equals(ShipperCodeEnum.SF.getValue())) {
+//                    if (lastFourNumber.length() == 11) {
+//                        lastFourNumber = StrUtil.sub(lastFourNumber, lastFourNumber.length(), -4);
+//                    }
+//                }
+//
+//                expressInfoDTO=expressService.getExpressInfo(order.getOrderCode(),order.getDeliveryCode(),order.getDeliverySn(),lastFourNumber);
+//
+//            }
+//        }
+//        return R.ok().put("data",expressInfoDTO);
+//    }
+
+    /**
+     * 支付订单
+     * */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:pay')")
+    @PostMapping(value = "/pay")
+    public void pay(LiveOrder liveOrder)
+    {
+       liveOrderService.handlePay(liveOrder);
+    }
+
+    /**
+     * 取消订单确认
+     * */
+
+    @GetMapping(value = "/cancelConfirm/{orderId}")
+    public R cancelConfirm(@PathVariable String orderId)
+    {
+        LiveOrder byId = liveOrderService.getById(orderId);
+        List<Map<String, String>> allCodeDescMap = LiveOrderCancleReason.getAllCodeDescMap();
+        return R.ok().put("reason",allCodeDescMap).put("data",byId);
+    }
+
+    /**
+     * 按照时间粒度返回订单
+     * */
+    @GetMapping(value = "/getLiveOrderTimeGranularity")
+    public R getLiveOrderTimeGranularity(LiveOrderVo liveOrder){
+        return liveOrderService.getLiveOrderTimeGranularity(liveOrder);
+    }
+
+
+    @Log(title = "同步物流", businessType = BusinessType.UPDATE)
+    @GetMapping(value = "/syncExpress/{id}")
+    public R syncExpress(@PathVariable("id") Long id) {
+        return liveOrderService.syncExpress(id);
+    }
+
+//    @Log(title = "同步管易物流单号", businessType = BusinessType.UPDATE)
+//    @PreAuthorize("@ss.hasPermi('live:liveOrder:updateErpOrder')")
+//    @PostMapping("/updateErpOrder")
+//    public R updateErpOrder( @RequestBody LiveOrder param) {
+//        LiveOrder order = liveOrderService.selectLiveOrderByOrderId(String.valueOf(param.getOrderId()));
+//        ErpOrderQueryRequert request = new ErpOrderQueryRequert();
+//        IErpOrderService erpOrderService = getErpService();
+//        request.setCode(order.getExtendOrderId());
+//        ErpOrderQueryResponse response = erpOrderService.getOrder(request);
+//        if(response.getOrders()!=null&&response.getOrders().size()>0){
+//            for(ErpOrderQuery orderQuery : response.getOrders()){
+//                if(orderQuery.getDeliverys()!=null&&orderQuery.getDeliverys().size()>0){
+//                    for(ErpDeliverys delivery:orderQuery.getDeliverys()){
+//                        if(delivery.getDelivery()&& StringUtils.isNotEmpty(delivery.getMail_no())){
+//                            //更新商订单状态
+//                            liveOrderService.updateDeliveryOrder(param.getOrderId(), delivery.getMail_no(),delivery.getExpress_code(),delivery.getExpress_name());
+//                            return R.ok();
+//                        }
+//                    }
+//
+//                }
+//            }
+//        }
+//        return R.error("未查询到快递信息");
+//    }
+//    private IErpOrderService getErpService() {
+//        FsSysConfig sysConfig = configUtil.getSysConfig();
+//        Integer erpOpen = sysConfig.getErpOpen();
+//        if (erpOpen != null && erpOpen == 1){
+//            //判断erp类型
+//            Integer erpType = sysConfig.getErpType();
+//            if (erpType != null){
+//                IErpOrderService erpOrderService = null;
+//                if (erpType == 1){
+//                    //管易
+//                    erpOrderService =  gyOrderService;
+//                } else if (erpType == 2){
+//                    //旺店通
+//                    erpOrderService =  wdtOrderService;
+//                }
+//                return erpOrderService;
+//
+//
+//            }
+//        }
+//        return null;
+//    }
+
+    /**
+     * 查询订单商品列表
+     */
+
+    @GetMapping("/ltemlist/{orderId}")
+    public TableDataInfo ltemlist(@PathVariable("orderId") String orderId)
+    {
+        List<LiveGoodsVo> list = liveOrderService.selectLiveOrderItemList(orderId);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:bindCustomer')")
+    @PostMapping("/bindCustomer")
+    public R bindCustomer(@RequestBody FsStoreOrderBindCustomerParam param)
+    {
+        if(param.getCustomerIds().length>1){
+            return R.error("只能关联一个客户");
+        }
+        for(Long customerId:param.getCustomerIds()){
+            LiveOrder order=new LiveOrder();
+            order.setOrderId(param.getOrderId());
+            order.setCustomerId(customerId);
+            liveOrderService.updateLiveOrder(order);
+            //更新CRM客户订单数
+            crmCustomerService.updateBuyCount(customerId);
+        }
+        return R.ok("操作成功");
+
+    }
+
+
+}

+ 97 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveOrderItemController.java

@@ -0,0 +1,97 @@
+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.LiveOrderItem;
+import com.fs.live.service.ILiveOrderItemService;
+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-07-08
+ */
+@RestController
+@RequestMapping("/live/liveOrderItem")
+public class LiveOrderItemController extends BaseController
+{
+    @Autowired
+    private ILiveOrderItemService liveOrderItemService;
+
+    /**
+     * 查询订单详情列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderItem:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveOrderItem liveOrderItem)
+    {
+        startPage();
+        List<LiveOrderItem> list = liveOrderItemService.selectLiveOrderItemList(liveOrderItem);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出订单详情列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderItem:export')")
+    @Log(title = "订单详情", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveOrderItem liveOrderItem)
+    {
+        List<LiveOrderItem> list = liveOrderItemService.selectLiveOrderItemList(liveOrderItem);
+        ExcelUtil<LiveOrderItem> util = new ExcelUtil<LiveOrderItem>(LiveOrderItem.class);
+        return util.exportExcel(list, "订单详情数据");
+    }
+
+    /**
+     * 获取订单详情详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderItem:query')")
+    @GetMapping(value = "/{itemId}")
+    public AjaxResult getInfo(@PathVariable("itemId") String itemId)
+    {
+        return AjaxResult.success(liveOrderItemService.selectLiveOrderItemByItemId(itemId));
+    }
+
+    /**
+     * 新增订单详情
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderItem:add')")
+    @Log(title = "订单详情", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveOrderItem liveOrderItem)
+    {
+        return toAjax(liveOrderItemService.insertLiveOrderItem(liveOrderItem));
+    }
+
+    /**
+     * 修改订单详情
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderItem:edit')")
+    @Log(title = "订单详情", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveOrderItem liveOrderItem)
+    {
+        return toAjax(liveOrderItemService.updateLiveOrderItem(liveOrderItem));
+    }
+
+    /**
+     * 删除订单详情
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderItem:remove')")
+    @Log(title = "订单详情", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{itemIds}")
+    public AjaxResult remove(@PathVariable String[] itemIds)
+    {
+        return toAjax(liveOrderItemService.deleteLiveOrderItemByItemIds(itemIds));
+    }
+}

+ 97 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveOrderLogsController.java

@@ -0,0 +1,97 @@
+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.LiveOrderLogs;
+import com.fs.live.service.ILiveOrderLogsService;
+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-07-08
+ */
+@RestController
+@RequestMapping("/live/liveOrderLogs")
+public class LiveOrderLogsController extends BaseController
+{
+    @Autowired
+    private ILiveOrderLogsService liveOrderLogsService;
+
+    /**
+     * 查询订单操作记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderLogs:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveOrderLogs liveOrderLogs)
+    {
+        startPage();
+        List<LiveOrderLogs> list = liveOrderLogsService.selectLiveOrderLogsList(liveOrderLogs);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出订单操作记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderLogs:export')")
+    @Log(title = "订单操作记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveOrderLogs liveOrderLogs)
+    {
+        List<LiveOrderLogs> list = liveOrderLogsService.selectLiveOrderLogsList(liveOrderLogs);
+        ExcelUtil<LiveOrderLogs> util = new ExcelUtil<LiveOrderLogs>(LiveOrderLogs.class);
+        return util.exportExcel(list, "订单操作记录数据");
+    }
+
+    /**
+     * 获取订单操作记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderLogs:query')")
+    @GetMapping(value = "/{logsId}")
+    public AjaxResult getInfo(@PathVariable("logsId") String logsId)
+    {
+        return AjaxResult.success(liveOrderLogsService.selectLiveOrderLogsByLogsId(logsId));
+    }
+
+    /**
+     * 新增订单操作记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderLogs:add')")
+    @Log(title = "订单操作记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveOrderLogs liveOrderLogs)
+    {
+        return toAjax(liveOrderLogsService.insertLiveOrderLogs(liveOrderLogs));
+    }
+
+    /**
+     * 修改订单操作记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderLogs:edit')")
+    @Log(title = "订单操作记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveOrderLogs liveOrderLogs)
+    {
+        return toAjax(liveOrderLogsService.updateLiveOrderLogs(liveOrderLogs));
+    }
+
+    /**
+     * 删除订单操作记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrderLogs:remove')")
+    @Log(title = "订单操作记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{logsIds}")
+    public AjaxResult remove(@PathVariable String[] logsIds)
+    {
+        return toAjax(liveOrderLogsService.deleteLiveOrderLogsByLogsIds(logsIds));
+    }
+}

+ 34 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveProfitController.java

@@ -0,0 +1,34 @@
+package com.fs.company.controller.live;
+
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.live.service.ILiveUserFirstEntryService;
+import com.fs.live.vo.LiveUserFirstProfit;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 业绩归属控制类Controller
+ *
+ * @author fs
+ * @date 2025-09-08
+ */
+@RestController
+@RequestMapping("/live/liveProfit")
+public class LiveProfitController extends BaseController {
+
+    @Autowired
+    private ILiveUserFirstEntryService liveUserFirstEntryService;
+
+    @GetMapping("/list")
+    public TableDataInfo list() {
+        startPage();
+        List<LiveUserFirstProfit> list = liveUserFirstEntryService.selectLiveProfitList();
+        return getDataTable(list);
+    }
+
+}

+ 125 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveRedConfController.java

@@ -0,0 +1,125 @@
+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.domain.R;
+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.SecurityUtils;
+import com.fs.live.domain.LiveRedConf;
+import com.fs.live.service.ILiveRedConfService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 直播红包记录配置Controller
+ *
+ * @author fs
+ * @date 2025-07-17
+ */
+@RestController
+@RequestMapping("/live/liveRedConf")
+public class LiveRedConfController extends BaseController
+{
+    @Autowired
+    private ILiveRedConfService liveRedConfService;
+
+    /**
+     * 查询直播红包记录配置列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveRedConf liveRedConf)
+    {
+        startPage();
+        List<LiveRedConf> list = liveRedConfService.selectLiveRedConfList(liveRedConf);
+        return getDataTable(list);
+    }
+
+    @GetMapping("/listOn")
+    public TableDataInfo listOn(LiveRedConf liveRedConf)
+    {
+        startPage();
+        List<LiveRedConf> list = liveRedConfService.selectLiveRedConfListOn(liveRedConf);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播红包记录配置列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:export')")
+    @Log(title = "直播红包记录配置", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveRedConf liveRedConf)
+    {
+        List<LiveRedConf> list = liveRedConfService.selectLiveRedConfList(liveRedConf);
+        ExcelUtil<LiveRedConf> util = new ExcelUtil<LiveRedConf>(LiveRedConf.class);
+        return util.exportExcel(list, "直播红包记录配置数据");
+    }
+
+    /**
+     * 获取直播红包记录配置详细信息
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:query')")
+    @GetMapping(value = "/{redId}")
+    public AjaxResult getInfo(@PathVariable("redId") Long redId)
+    {
+        return AjaxResult.success(liveRedConfService.selectLiveRedConfByRedId(redId));
+    }
+
+    /**
+     * 新增直播红包记录配置
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:add')")
+    @Log(title = "直播红包记录配置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveRedConf liveRedConf)
+    {
+        return toAjax(liveRedConfService.insertLiveRedConf(liveRedConf));
+    }
+
+    /**
+     * 修改直播红包记录配置
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:edit')")
+    @Log(title = "直播红包记录配置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public R edit(@RequestBody LiveRedConf liveRedConf)
+    {
+        liveRedConfService.updateLiveRedConf(liveRedConf);
+        return R.ok(liveRedConf.getRedStatus().toString());
+    }
+
+    /**
+     * 删除直播红包记录配置
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:remove')")
+    @Log(title = "直播红包记录配置", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{redIds}")
+    public AjaxResult remove(@PathVariable Long[] redIds)
+    {
+        return toAjax(liveRedConfService.deleteLiveRedConfByRedIds(redIds));
+    }
+
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:query')")
+    @GetMapping("/live/{liveId}")
+    public List<LiveRedConf> getByLiveId(@PathVariable Long liveId) {
+        return liveRedConfService.getByLiveId(liveId);
+    }
+
+    /**
+     * 点击发放红包
+     * */
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:edit')")
+    @PostMapping("/start/{redId}")
+    public String start(@PathVariable String redId) {
+        return liveRedConfService.start(redId, SecurityUtils.getLoginUser().getUser().getUserId());
+    }
+
+
+
+}

+ 126 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveRewardRecordController.java

@@ -0,0 +1,126 @@
+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.domain.R;
+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.SecurityUtils;
+import com.fs.live.domain.LiveRewardRecord;
+import com.fs.live.service.ILiveRewardRecordService;
+import com.fs.live.vo.LiveRewardRecordStatisticsVo;
+import com.fs.live.vo.LiveRewardRecordVo;
+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-08-27
+ */
+@RestController
+@RequestMapping("/live/record")
+public class LiveRewardRecordController extends BaseController
+{
+    @Autowired
+    private ILiveRewardRecordService liveRewardRecordService;
+
+    /**
+     * 查询用户直播间奖励记录列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:record:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveRewardRecord liveRewardRecord)
+    {
+        startPage();
+        List<LiveRewardRecord> list = liveRewardRecordService.selectLiveRewardRecordList(liveRewardRecord);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出用户直播间奖励记录列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:record:export')")
+    @Log(title = "用户直播间奖励记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveRewardRecord liveRewardRecord)
+    {
+        List<LiveRewardRecord> list = liveRewardRecordService.selectLiveRewardRecordList(liveRewardRecord);
+        ExcelUtil<LiveRewardRecord> util = new ExcelUtil<LiveRewardRecord>(LiveRewardRecord.class);
+        return util.exportExcel(list, "用户直播间奖励记录数据");
+    }
+
+    /**
+     * 获取用户直播间奖励记录详细信息
+     */
+//    @PreAuthorize("@ss.hasPermi('live:record:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(liveRewardRecordService.selectLiveRewardRecordById(id));
+    }
+
+    /**
+     * 新增用户直播间奖励记录
+     */
+//    @PreAuthorize("@ss.hasPermi('live:record:add')")
+    @Log(title = "用户直播间奖励记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveRewardRecord liveRewardRecord)
+    {
+        return toAjax(liveRewardRecordService.insertLiveRewardRecord(liveRewardRecord));
+    }
+
+    /**
+     * 修改用户直播间奖励记录
+     */
+//    @PreAuthorize("@ss.hasPermi('live:record:edit')")
+    @Log(title = "用户直播间奖励记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveRewardRecord liveRewardRecord)
+    {
+        return toAjax(liveRewardRecordService.updateLiveRewardRecord(liveRewardRecord));
+    }
+
+    /**
+     * 删除用户直播间奖励记录
+     */
+//    @PreAuthorize("@ss.hasPermi('live:record:remove')")
+    @Log(title = "用户直播间奖励记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(liveRewardRecordService.deleteLiveRewardRecordByIds(ids));
+    }
+
+
+    @PreAuthorize("@ss.hasPermi('live:record:query')")
+    @PostMapping("/statistics")
+    public R statistics(@RequestBody LiveRewardRecordVo param)
+    {
+        Long companyId = SecurityUtils.getLoginUser().getUser().getCompanyId();
+        param.setCompanyId(companyId);
+        return liveRewardRecordService.statistics(param);
+    }
+
+    @PreAuthorize("@ss.hasPermi('live:record:export')")
+    @PostMapping("/export")
+    public AjaxResult export(@RequestBody LiveRewardRecordVo param)
+    {
+        Long companyId = SecurityUtils.getLoginUser().getUser().getCompanyId();
+        param.setCompanyId(companyId);
+        List<LiveRewardRecordStatisticsVo> list = liveRewardRecordService.selectRewardSummary(param);
+
+        ExcelUtil<LiveRewardRecordStatisticsVo> util = new ExcelUtil<LiveRewardRecordStatisticsVo>(LiveRewardRecordStatisticsVo.class);
+        return util.exportExcel(list, "liveIntegralLogs");
+
+//        return liveRewardRecordService.export(param);
+//        return R.ok();
+    }
+}

+ 98 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveSensitiveWordsController.java

@@ -0,0 +1,98 @@
+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.LiveSensitiveWords;
+import com.fs.live.service.ILiveSensitiveWordsService;
+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-07-08
+ */
+@RestController
+@RequestMapping("/live/words")
+public class LiveSensitiveWordsController extends BaseController
+{
+    @Autowired
+    private ILiveSensitiveWordsService liveSensitiveWordsService;
+
+    /**
+     * 查询直播间敏感词过滤列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:words:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveSensitiveWords liveSensitiveWords)
+    {
+        startPage();
+        List<LiveSensitiveWords> list = liveSensitiveWordsService.selectLiveSensitiveWordsList(liveSensitiveWords);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播间敏感词过滤列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:words:export')")
+    @Log(title = "直播间敏感词过滤", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveSensitiveWords liveSensitiveWords)
+    {
+        List<LiveSensitiveWords> list = liveSensitiveWordsService.selectLiveSensitiveWordsList(liveSensitiveWords);
+        ExcelUtil<LiveSensitiveWords> util = new ExcelUtil<LiveSensitiveWords>(LiveSensitiveWords.class);
+        return util.exportExcel(list, "直播间敏感词过滤数据");
+    }
+
+    /**
+     * 获取直播间敏感词过滤详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:words:query')")
+    @GetMapping(value = "/{wordId}")
+    public AjaxResult getInfo(@PathVariable("wordId") Long wordId)
+    {
+        return AjaxResult.success(liveSensitiveWordsService.selectLiveSensitiveWordsByWordId(wordId));
+    }
+
+    /**
+     * 新增直播间敏感词过滤
+     */
+    @PreAuthorize("@ss.hasPermi('live:words:add')")
+    @Log(title = "直播间敏感词过滤", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveSensitiveWords liveSensitiveWords)
+    {
+
+        return toAjax(liveSensitiveWordsService.insertLiveSensitiveWords(liveSensitiveWords));
+    }
+
+    /**
+     * 修改直播间敏感词过滤
+     */
+    @PreAuthorize("@ss.hasPermi('live:words:edit')")
+    @Log(title = "直播间敏感词过滤", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveSensitiveWords liveSensitiveWords)
+    {
+        return toAjax(liveSensitiveWordsService.updateLiveSensitiveWords(liveSensitiveWords));
+    }
+
+    /**
+     * 删除直播间敏感词过滤
+     */
+    @PreAuthorize("@ss.hasPermi('live:words:remove')")
+    @Log(title = "直播间敏感词过滤", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{wordIds}")
+    public AjaxResult remove(@PathVariable Long[] wordIds)
+    {
+        return toAjax(liveSensitiveWordsService.deleteLiveSensitiveWordsByWordIds(wordIds));
+    }
+}

+ 97 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveUserFavoriteController.java

@@ -0,0 +1,97 @@
+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.LiveUserFavorite;
+import com.fs.live.service.ILiveUserFavoriteService;
+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-07-11
+ */
+@RestController
+@RequestMapping("/live/liveUserFavorite")
+public class LiveUserFavoriteController extends BaseController
+{
+    @Autowired
+    private ILiveUserFavoriteService liveUserFavoriteService;
+
+    /**
+     * 查询用户直播收藏列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFavorite:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveUserFavorite liveUserFavorite)
+    {
+        startPage();
+        List<LiveUserFavorite> list = liveUserFavoriteService.selectLiveUserFavoriteList(liveUserFavorite);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出用户直播收藏列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFavorite:export')")
+    @Log(title = "用户直播收藏", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveUserFavorite liveUserFavorite)
+    {
+        List<LiveUserFavorite> list = liveUserFavoriteService.selectLiveUserFavoriteList(liveUserFavorite);
+        ExcelUtil<LiveUserFavorite> util = new ExcelUtil<LiveUserFavorite>(LiveUserFavorite.class);
+        return util.exportExcel(list, "用户直播收藏数据");
+    }
+
+    /**
+     * 获取用户直播收藏详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFavorite:query')")
+    @GetMapping(value = "/{favoriteId}")
+    public AjaxResult getInfo(@PathVariable("favoriteId") Long favoriteId)
+    {
+        return AjaxResult.success(liveUserFavoriteService.selectLiveUserFavoriteByFavoriteId(favoriteId));
+    }
+
+    /**
+     * 新增用户直播收藏
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFavorite:add')")
+    @Log(title = "用户直播收藏", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveUserFavorite liveUserFavorite)
+    {
+        return toAjax(liveUserFavoriteService.insertLiveUserFavorite(liveUserFavorite));
+    }
+
+    /**
+     * 修改用户直播收藏
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFavorite:edit')")
+    @Log(title = "用户直播收藏", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveUserFavorite liveUserFavorite)
+    {
+        return toAjax(liveUserFavoriteService.updateLiveUserFavorite(liveUserFavorite));
+    }
+
+    /**
+     * 删除用户直播收藏
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFavorite:remove')")
+    @Log(title = "用户直播收藏", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{favoriteIds}")
+    public AjaxResult remove(@PathVariable Long[] favoriteIds)
+    {
+        return toAjax(liveUserFavoriteService.deleteLiveUserFavoriteByFavoriteIds(favoriteIds));
+    }
+}

+ 97 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveUserFirstEntryController.java

@@ -0,0 +1,97 @@
+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.LiveUserFirstEntry;
+import com.fs.live.service.ILiveUserFirstEntryService;
+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-09-04
+ */
+@RestController
+@RequestMapping("/live/entry")
+public class LiveUserFirstEntryController extends BaseController
+{
+    @Autowired
+    private ILiveUserFirstEntryService liveUserFirstEntryService;
+
+    /**
+     * 查询用户每日首次进入直播间记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:entry:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveUserFirstEntry liveUserFirstEntry)
+    {
+        startPage();
+        List<LiveUserFirstEntry> list = liveUserFirstEntryService.selectLiveUserFirstEntryList(liveUserFirstEntry);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出用户每日首次进入直播间记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:entry:export')")
+    @Log(title = "用户每日首次进入直播间记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveUserFirstEntry liveUserFirstEntry)
+    {
+        List<LiveUserFirstEntry> list = liveUserFirstEntryService.selectLiveUserFirstEntryList(liveUserFirstEntry);
+        ExcelUtil<LiveUserFirstEntry> util = new ExcelUtil<LiveUserFirstEntry>(LiveUserFirstEntry.class);
+        return util.exportExcel(list, "用户每日首次进入直播间记录数据");
+    }
+
+    /**
+     * 获取用户每日首次进入直播间记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:entry:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(liveUserFirstEntryService.selectLiveUserFirstEntryById(id));
+    }
+
+    /**
+     * 新增用户每日首次进入直播间记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:entry:add')")
+    @Log(title = "用户每日首次进入直播间记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveUserFirstEntry liveUserFirstEntry)
+    {
+        return toAjax(liveUserFirstEntryService.insertLiveUserFirstEntry(liveUserFirstEntry));
+    }
+
+    /**
+     * 修改用户每日首次进入直播间记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:entry:edit')")
+    @Log(title = "用户每日首次进入直播间记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveUserFirstEntry liveUserFirstEntry)
+    {
+        return toAjax(liveUserFirstEntryService.updateLiveUserFirstEntry(liveUserFirstEntry));
+    }
+
+    /**
+     * 删除用户每日首次进入直播间记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:entry:remove')")
+    @Log(title = "用户每日首次进入直播间记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(liveUserFirstEntryService.deleteLiveUserFirstEntryByIds(ids));
+    }
+}

+ 97 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveUserFollowController.java

@@ -0,0 +1,97 @@
+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.LiveUserFollow;
+import com.fs.live.service.ILiveUserFollowService;
+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-07-11
+ */
+@RestController
+@RequestMapping("/live/liveUserFollow")
+public class LiveUserFollowController extends BaseController
+{
+    @Autowired
+    private ILiveUserFollowService liveUserFollowService;
+
+    /**
+     * 查询用户直播关注列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFollow:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveUserFollow liveUserFollow)
+    {
+        startPage();
+        List<LiveUserFollow> list = liveUserFollowService.selectLiveUserFollowList(liveUserFollow);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出用户直播关注列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFollow:export')")
+    @Log(title = "用户直播关注", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveUserFollow liveUserFollow)
+    {
+        List<LiveUserFollow> list = liveUserFollowService.selectLiveUserFollowList(liveUserFollow);
+        ExcelUtil<LiveUserFollow> util = new ExcelUtil<LiveUserFollow>(LiveUserFollow.class);
+        return util.exportExcel(list, "用户直播关注数据");
+    }
+
+    /**
+     * 获取用户直播关注详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFollow:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(liveUserFollowService.selectLiveUserFollowById(id));
+    }
+
+    /**
+     * 新增用户直播关注
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFollow:add')")
+    @Log(title = "用户直播关注", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveUserFollow liveUserFollow)
+    {
+        return toAjax(liveUserFollowService.insertLiveUserFollow(liveUserFollow));
+    }
+
+    /**
+     * 修改用户直播关注
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFollow:edit')")
+    @Log(title = "用户直播关注", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveUserFollow liveUserFollow)
+    {
+        return toAjax(liveUserFollowService.updateLiveUserFollow(liveUserFollow));
+    }
+
+    /**
+     * 删除用户直播关注
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFollow:remove')")
+    @Log(title = "用户直播关注", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(liveUserFollowService.deleteLiveUserFollowByIds(ids));
+    }
+}

+ 97 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveUserLikeController.java

@@ -0,0 +1,97 @@
+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.LiveUserLike;
+import com.fs.live.service.ILiveUserLikeService;
+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-07-11
+ */
+@RestController
+@RequestMapping("/live/liveUserLike")
+public class LiveUserLikeController extends BaseController
+{
+    @Autowired
+    private ILiveUserLikeService liveUserLikeService;
+
+    /**
+     * 查询用户直播赞列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserLike:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveUserLike liveUserLike)
+    {
+        startPage();
+        List<LiveUserLike> list = liveUserLikeService.selectLiveUserLikeList(liveUserLike);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出用户直播赞列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserLike:export')")
+    @Log(title = "用户直播赞", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveUserLike liveUserLike)
+    {
+        List<LiveUserLike> list = liveUserLikeService.selectLiveUserLikeList(liveUserLike);
+        ExcelUtil<LiveUserLike> util = new ExcelUtil<LiveUserLike>(LiveUserLike.class);
+        return util.exportExcel(list, "用户直播赞数据");
+    }
+
+    /**
+     * 获取用户直播赞详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserLike:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(liveUserLikeService.selectLiveUserLikeById(id));
+    }
+
+    /**
+     * 新增用户直播赞
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserLike:add')")
+    @Log(title = "用户直播赞", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveUserLike liveUserLike)
+    {
+        return toAjax(liveUserLikeService.insertLiveUserLike(liveUserLike));
+    }
+
+    /**
+     * 修改用户直播赞
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserLike:edit')")
+    @Log(title = "用户直播赞", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveUserLike liveUserLike)
+    {
+        return toAjax(liveUserLikeService.updateLiveUserLike(liveUserLike));
+    }
+
+    /**
+     * 删除用户直播赞
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserLike:remove')")
+    @Log(title = "用户直播赞", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(liveUserLikeService.deleteLiveUserLikeByIds(ids));
+    }
+}

+ 108 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveUserLotteryRecordController.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.domain.R;
+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.LiveUserLotteryRecord;
+import com.fs.live.service.ILiveUserLotteryRecordService;
+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-07-17
+ */
+@RestController
+@RequestMapping("/live/liveUserLotteryRecord")
+public class LiveUserLotteryRecordController extends BaseController
+{
+    @Autowired
+    private ILiveUserLotteryRecordService liveUserLotteryRecordService;
+
+    /**
+     * 查询直播用户中奖记录列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveUserLotteryRecord liveUserLotteryRecord)
+    {
+        startPage();
+        List<LiveUserLotteryRecord> list = liveUserLotteryRecordService.selectLiveUserLotteryRecordList(liveUserLotteryRecord);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播用户中奖记录列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:export')")
+    @Log(title = "直播用户中奖记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveUserLotteryRecord liveUserLotteryRecord)
+    {
+        List<LiveUserLotteryRecord> list = liveUserLotteryRecordService.selectLiveUserLotteryRecordList(liveUserLotteryRecord);
+        ExcelUtil<LiveUserLotteryRecord> util = new ExcelUtil<LiveUserLotteryRecord>(LiveUserLotteryRecord.class);
+        return util.exportExcel(list, "直播用户中奖记录数据");
+    }
+
+    /**
+     * 获取直播用户中奖记录详细信息
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(liveUserLotteryRecordService.selectLiveUserLotteryRecordById(id));
+    }
+
+    /**
+     * 新增直播用户中奖记录
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:add')")
+    @Log(title = "直播用户中奖记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveUserLotteryRecord liveUserLotteryRecord)
+    {
+        return toAjax(liveUserLotteryRecordService.insertLiveUserLotteryRecord(liveUserLotteryRecord));
+    }
+
+    /**
+     * 修改直播用户中奖记录
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:edit')")
+    @Log(title = "直播用户中奖记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveUserLotteryRecord liveUserLotteryRecord)
+    {
+        return toAjax(liveUserLotteryRecordService.updateLiveUserLotteryRecord(liveUserLotteryRecord));
+    }
+
+    /**
+     * 删除直播用户中奖记录
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:remove')")
+    @Log(title = "直播用户中奖记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(liveUserLotteryRecordService.deleteLiveUserLotteryRecordByIds(ids));
+    }
+
+    /**
+     * 查询直播用户中奖记录列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:list')")
+    @PostMapping("/info")
+    public R info(@RequestBody LiveUserLotteryRecord liveUserLotteryRecord)
+    {
+        return liveUserLotteryRecordService.selectRecordByLiveIdAndLotteryId(liveUserLotteryRecord);
+    }
+}

+ 116 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveVideoController.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.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));
+    }
+
+    /**
+     * 获取直播视频详细信息
+     */
+    @GetMapping(value = "/liveVideoByLiveId/{liveId}")
+    public AjaxResult getLiveVideoByLiveId(@PathVariable("liveId") Long liveId)
+    {
+        return AjaxResult.success(liveVideoService.selectLiveVideoByLiveId(liveId));
+    }
+
+    /**
+     * 获取直播视频详细信息
+     */
+    @GetMapping(value = "/preview/{liveId}")
+    public AjaxResult getLiveVideoByLiveIdAndType(@PathVariable("liveId") Long liveId)
+    {
+        return AjaxResult.success(liveVideoService.selectLiveVideoByLiveIdAndType(liveId,3));
+    }
+
+    /**
+     * 新增直播视频
+     */
+//    @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));
+    }
+
+}

+ 102 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveWatchConfigController.java

@@ -0,0 +1,102 @@
+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.ServletUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.framework.service.TokenService;
+import com.fs.live.domain.LiveWatchConfig;
+import com.fs.live.service.ILiveWatchConfigService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 直播观看奖励设置Controller
+ *
+ * @author fs
+ * @date 2025-07-08
+ */
+@RestController
+@RequestMapping("/live/config")
+public class LiveWatchConfigController extends BaseController
+{
+    @Autowired
+    private ILiveWatchConfigService liveWatchConfigService;
+    @Autowired
+    private TokenService tokenService;
+
+    /**
+     * 查询直播观看奖励设置列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:config:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveWatchConfig liveWatchConfig)
+    {
+        startPage();
+        List<LiveWatchConfig> list = liveWatchConfigService.selectLiveWatchConfigList(liveWatchConfig);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播观看奖励设置列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:config:export')")
+    @Log(title = "直播观看奖励设置", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveWatchConfig liveWatchConfig)
+    {
+        List<LiveWatchConfig> list = liveWatchConfigService.selectLiveWatchConfigList(liveWatchConfig);
+        ExcelUtil<LiveWatchConfig> util = new ExcelUtil<LiveWatchConfig>(LiveWatchConfig.class);
+        return util.exportExcel(list, "直播观看奖励设置数据");
+    }
+
+    /**
+     * 获取直播观看奖励设置详细信息
+     */
+//    @PreAuthorize("@ss.hasPermi('live:config:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success("",liveWatchConfigService.selectLiveWatchConfigByLiveId(id));
+    }
+
+    /**
+     * 新增直播观看奖励设置
+     */
+//    @PreAuthorize("@ss.hasPermi('live:config:add')")
+    @Log(title = "直播观看奖励设置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody String jsonConfig)
+    {
+        String userId = tokenService.getLoginUser(ServletUtils.getRequest()).getUser().getUserId().toString();
+        return toAjax(liveWatchConfigService.insertLiveWatchConfig(userId, jsonConfig));
+    }
+
+    /**
+     * 修改直播观看奖励设置
+     */
+//    @PreAuthorize("@ss.hasPermi('live:config:edit')")
+    @Log(title = "直播观看奖励设置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody String jsonConfig)
+    {
+        return toAjax(liveWatchConfigService.updateLiveWatchConfig(jsonConfig));
+    }
+
+    /**
+     * 删除直播观看奖励设置
+     */
+//    @PreAuthorize("@ss.hasPermi('live:config:remove')")
+    @Log(title = "直播观看奖励设置", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+
+        return toAjax(liveWatchConfigService.deleteLiveWatchConfigByIds(ids));
+    }
+}

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

@@ -0,0 +1,132 @@
+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));
+    }
+
+    /**
+     * 封禁用户账号
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:edit')")
+    @Log(title = "直播间观看用户", businessType = BusinessType.UPDATE)
+    @GetMapping("/blockUser/{userId}")
+    public AjaxResult blockUser(@PathVariable Long userId) {
+        return toAjax(liveWatchUserService.blockUser(userId));
+    }
+
+}

+ 1 - 1
fs-company/src/main/resources/application.yml

@@ -11,5 +11,5 @@ spring:
 #    active: druid-yzt
 #    active: druid-myhk
 #    active: druid-sft
-    active: dev-jnlzjk
+    active: dev
 #    active: dev-yjb

+ 1 - 1
fs-live-app/src/main/java/com/fs/FsLiveAppApplication.java

@@ -20,6 +20,6 @@ public class FsLiveAppApplication
     {
         // System.setProperty("spring.devtools.restart.enabled", "false");
         SpringApplication.run(FsLiveAppApplication.class, args);
-        System.out.println("WXAPI启动成功");
+        System.out.println("FsLiveApp启动成功");
     }
 }

+ 0 - 22
fs-live-app/src/main/java/com/fs/app/controller/AppBaseController.java

@@ -1,22 +0,0 @@
-package com.fs.app.controller;
-
-
-import com.fs.app.utils.JwtUtils;
-import com.fs.common.core.redis.RedisCache;
-import com.fs.common.utils.ServletUtils;
-import io.jsonwebtoken.Claims;
-import org.springframework.beans.factory.annotation.Autowired;
-
-
-public class AppBaseController {
-	@Autowired
-	JwtUtils jwtUtils;
-
-	public String getUserId()
-	{
-		String headValue =  ServletUtils.getRequest().getHeader("APPToken");
-		Claims claims=jwtUtils.getClaimByToken(headValue);
-		String userId = claims.getSubject().toString();
-		return userId;
-	}
-}

+ 0 - 43
fs-live-app/src/main/java/com/fs/app/controller/CommonController.java

@@ -1,43 +0,0 @@
-package com.fs.app.controller;
-
-
-import com.alibaba.fastjson.JSON;
-import com.fs.app.websocket.bean.SendMsgVo;
-import com.fs.app.websocket.service.WebSocketServer;
-import com.fs.common.core.domain.R;
-import com.fs.company.service.ICompanyWxChatService;
-import com.fs.wxUser.domain.CompanyWxUser;
-import com.fs.wxUser.service.ICompanyWxUserService;
-import io.swagger.annotations.Api;
-import jdk.nashorn.internal.ir.annotations.Ignore;
-import lombok.AllArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.Arrays;
-
-
-@Slf4j
-@Api("公共接口")
-@RestController
-@AllArgsConstructor
-@Ignore
-@RequestMapping(value="/app/common")
-public class CommonController {
-
-    private final WebSocketServer webSocketServer;
-    private final ICompanyWxUserService companyWxUserService;
-    private final ICompanyWxChatService companyWxChatService;
-
-    @GetMapping("/testSend")
-    public R testSend(Long userId, String msg) throws Exception{
-        return R.ok();
-    }
-
-    @GetMapping("/testGet")
-    public R testGet( ) throws Exception{
-        return R.ok();
-    }
-
-
-}

+ 0 - 85
fs-live-app/src/main/java/com/fs/app/controller/LiveController.java

@@ -1,85 +0,0 @@
-package com.fs.app.controller;
-
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.fs.app.annotation.Login;
-import com.fs.app.vo.LiveInfoVo;
-import com.fs.app.vo.LiveVo;
-import com.fs.common.core.domain.BaseEntity;
-import com.fs.common.core.domain.R;
-import com.fs.common.utils.bean.BeanUtils;
-import com.fs.live.domain.Live;
-import com.fs.live.domain.LiveMsg;
-import com.fs.live.service.ILiveMsgService;
-import com.fs.live.service.ILiveService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import lombok.AllArgsConstructor;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.math.BigDecimal;
-import java.math.RoundingMode;
-import java.time.LocalDateTime;
-import java.time.temporal.ChronoUnit;
-import java.util.Comparator;
-import java.util.List;
-
-
-@Api("直播信息接口")
-@RestController
-@AllArgsConstructor
-@RequestMapping(value="/app/live")
-public class LiveController extends AppBaseController {
-
-	private final ILiveService liveService;
-	private final ILiveMsgService liveMsgService;
-
-	@ApiOperation("直播封面信息")
-	@GetMapping("/liveInfo")
-	@ApiResponse(code = 200, message = "", response = LiveInfoVo.class)
-	public R liveInfo(Long id) {
-		LocalDateTime now = LocalDateTime.now();
-		Live live = liveService.selectLiveByLiveId(id);
-		if(live == null) return R.error("未找到直播");
-		if(live.getIsShow() == 2) return R.error("直播未开放");
-		LiveInfoVo vo = new LiveInfoVo();
-		BeanUtils.copyProperties(live, vo);
-		vo.setId(live.getLiveId());
-		return R.ok().put("data", vo);
-	}
-
-	@Login
-	@ApiOperation("直播间")
-	@GetMapping("/live")
-	@ApiResponse(code = 200, message = "", response = LiveVo.class)
-	public R live(Long id) {
-		LocalDateTime now = LocalDateTime.now();
-		Live live = liveService.selectLiveByLiveId(id);
-		if(live == null) return R.error("未找到直播");
-		if(live.getIsShow() == 2) return R.error("直播未开放");
-		LiveVo liveVo = new LiveVo();
-		BeanUtils.copyProperties(live, liveVo);
-		liveVo.setNowDuration(200L);
-		if(live.getStatus() == 2){
-			long seconds = live.getStartTime().until(now, ChronoUnit.SECONDS);
-			liveVo.setNowDuration(seconds);
-		}
-		if(liveVo.getNowDuration() != null){
-			liveVo.setNowPri(BigDecimal.valueOf(liveVo.getDuration()).divide(BigDecimal.valueOf(liveVo.getNowDuration()), 20, RoundingMode.UP));
-		}
-		return R.ok().put("data", liveVo);
-	}
-	@Login
-	@ApiOperation("聊天记录(最新30条)")
-	@GetMapping("/msgList")
-	@ApiResponse(code = 200, message = "", response = LiveInfoVo.class)
-	public R msgList(Long id) {
-		List<LiveMsg> list = liveMsgService.list(new QueryWrapper<LiveMsg>().eq("live_id", id).orderByDesc("create_time").last(" limit 30"));
-		list.sort(Comparator.comparing(BaseEntity::getCreateTime));
-		return R.ok().put("data", list);
-	}
-
-}

+ 0 - 168
fs-live-app/src/main/java/com/fs/app/controller/UserController.java

@@ -1,168 +0,0 @@
-package com.fs.app.controller;
-
-
-import cn.hutool.core.date.DateTime;
-import com.fs.app.annotation.Login;
-import com.fs.app.param.LoginParam;
-import com.fs.app.vo.UserListVO;
-import com.fs.app.vo.UserVO;
-import com.fs.chat.service.IChatRoleService;
-import com.fs.common.core.domain.R;
-import com.fs.common.core.redis.RedisCache;
-import com.fs.common.utils.PinYinUtil;
-import com.fs.common.utils.SecurityUtils;
-import com.fs.common.utils.StringUtils;
-import com.fs.company.domain.CompanyUser;
-import com.fs.company.domain.CompanyWxAccount;
-import com.fs.company.service.ICompanyPostService;
-import com.fs.company.service.ICompanyUserService;
-import com.fs.company.service.ICompanyWxAccountService;
-import com.fs.company.vo.CompanyUserVO;
-import com.fs.his.domain.FsUser;
-import com.fs.his.service.IFsUserService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import lombok.AllArgsConstructor;
-import me.chanjar.weixin.common.bean.WxOAuth2UserInfo;
-import me.chanjar.weixin.common.bean.oauth2.WxOAuth2AccessToken;
-import me.chanjar.weixin.common.error.WxErrorException;
-import me.chanjar.weixin.mp.api.WxMpService;
-import me.chanjar.weixin.mp.api.WxMpUserService;
-import me.chanjar.weixin.mp.bean.result.WxMpUser;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.*;
-import java.util.concurrent.TimeUnit;
-import java.util.stream.Collectors;
-
-
-@Api("用户接口")
-@RestController
-@AllArgsConstructor
-@RequestMapping(value="/app/user")
-public class UserController extends AppBaseController {
-	private final ICompanyPostService postService;
-	private final ICompanyUserService companyUserService;
-	private final RedisCache redisCache;
-	private final WxMpService wxMpService;
-	private final IFsUserService userService;
-
-
-	@ApiOperation("课程短链公众号登录")
-	@PostMapping("/loginByMp")
-	public R loginByMp( @RequestBody LoginParam param) {
-//		if (org.apache.commons.lang3.StringUtils.isBlank(param.getCode())) {
-//			return R.error("code不存在");
-//		}
-//		try{
-//			WxOAuth2AccessToken wxMpOAuth2AccessToken = wxMpService.getOAuth2Service().getAccessToken(param.getCode());
-//			WxOAuth2UserInfo wxMpUser = wxMpService.getOAuth2Service().getUserInfo(wxMpOAuth2AccessToken, null);
-//			WxMpUserService wxMpUserService = wxMpService.getUserService();
-//			WxMpUser userInfo = wxMpUserService.userInfo(wxMpUser.getOpenid());
-//      if (!userInfo.getSubscribe()){
-//        return R.error("请关注公众号进行登录");
-//      }
-			FsUser user=userService.selectFsUserByUnionid(param.getUnionId());
-//			if(user!=null){
-//				FsUser userMap=new FsUser();
-//				userMap.setUserId(user.getUserId());
-//				userMap.setNickName(wxMpUser.getNickname());
-//				userMap.setAvatar(wxMpUser.getHeadImgUrl());
-//				userMap.setMpOpenId(wxMpUser.getOpenid());
-//				userMap.setUpdateTime(new DateTime());
-//				userService.updateFsUser(userMap);
-//			}
-//			else{
-//				//写入
-//				user=new FsUser();
-//				user.setNickName(wxMpUser.getNickname());
-//				user.setAvatar(wxMpUser.getHeadImgUrl());
-//				user.setStatus(1);
-//				user.setSex(wxMpUser.getSex());
-//				user.setMpOpenId(wxMpUser.getOpenid());
-//				user.setUnionId(wxMpUser.getUnionId());
-//				user.setCreateTime(new Date());
-//				userService.insertFsUser(user);
-//			}
-			String token = jwtUtils.generateToken(user.getUserId());
-			redisCache.setCacheObject("token:"+user.getUserId(),token,604800, TimeUnit.SECONDS);
-			Map<String,Object> map=new HashMap<>();
-			map.put("token",token);
-			map.put("user",user);
-			return R.ok(map);
-//		}
-//		catch (WxErrorException e){
-//			if(e.getError().getErrorCode()==40163){
-//				return R.error(40163,e.getError().getErrorMsg());
-//			}
-//			else{
-//				return R.error("授权失败,"+e.getMessage());
-//			}
-//		}
-
-	}
-
-	@ApiOperation("检测是否登录")
-	@GetMapping("/checkLogin")
-	public R checkLogin(){
-		if(StringUtils.isEmpty(getUserId())){
-			//未登录
-			return R.error("未登录");
-		}
-		else{
-			//登录
-			String token = jwtUtils.generateToken(Long.parseLong(getUserId()));
-			Map<String,Object> map=new HashMap<>();
-			map.put("token",token);
-			return R.ok("认证成功").put("userId",getUserId()).put("token",token);
-		}
-	}
-
-	/**
-	 * 获取用户信息
-	 */
-	@Login
-	@ApiOperation("获取用户信息")
-	@GetMapping("/getUserInfo")
-	public R getUserInfo(){
-		try {
-			CompanyUser companyUser=companyUserService.selectCompanyUserById(Long.parseLong(getUserId()));
-			List<String> postList=postService.selectPostNameListByUserId(Long.parseLong(getUserId()));
-			if(companyUser==null){
-				return R.error(40001,"用户不存在");
-			}
-			if(companyUser.getStatus().equals("1")){
-				return R.error(40002,"用户已停用");
-			}
-			return R.ok().put("user",companyUser).put("post",postList);
-		} catch (Exception e){
-
-			return R.error("操作异常");
-		}
-	}
-	@Login
-	@ApiOperation("获取用户信息ByUserId")
-	@GetMapping("/getUserInfoByUserId")
-	public R getUserInfoByUserId(
-			@ApiParam(required = true, name = "userId", value = "用户ID") @RequestParam(value = "userId", required = false) Long userId,
-			HttpServletRequest request){
-		try {
-			CompanyUser user=companyUserService.selectCompanyUserById(userId);
-			List<String> postList=postService.selectPostNameListByUserId(userId);
-			if(user==null){
-				return R.error(40001,"用户不存在");
-			}
-			if(user.getStatus().equals("1")){
-				return R.error(40002,"用户已停用");
-			}
-			return R.ok().put("user",user).put("post",postList);
-		} catch (Exception e){
-
-			return R.error("操作异常");
-		}
-	}
-
-}

+ 0 - 63
fs-live-app/src/main/java/com/fs/app/interceptor/AuthorizationInterceptor.java

@@ -1,63 +0,0 @@
-package com.fs.app.interceptor;
-
-
-import com.fs.app.annotation.Login;
-import com.fs.app.exception.FSException;
-import com.fs.app.utils.JwtUtils;
-import com.fs.common.core.redis.RedisCache;
-import com.fs.common.utils.StringUtils;
-import io.jsonwebtoken.Claims;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.stereotype.Component;
-import org.springframework.web.method.HandlerMethod;
-import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * 权限(Token)验证
- */
-@Component
-public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
-    @Autowired
-    private JwtUtils jwtUtils;
-    @Autowired
-    RedisCache redisCache;
-    public static final String USER_KEY = "userId";
-
-    @Override
-    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
-        Login annotation;
-        if(handler instanceof HandlerMethod) {
-            annotation = ((HandlerMethod) handler).getMethodAnnotation(Login.class);
-        }else{
-            return true;
-        }
-
-        if(annotation == null){
-            return true;
-        }
-
-        //获取用户凭证
-        String token = request.getHeader(jwtUtils.getHeader());
-        if(StringUtils.isBlank(token)){
-            token = request.getParameter(jwtUtils.getHeader());
-        }
-
-        //凭证为空
-        if(StringUtils.isBlank(token)){
-            throw new FSException(jwtUtils.getHeader() + "不能为空", HttpStatus.UNAUTHORIZED.value());
-        }
-
-        Claims claims = jwtUtils.getClaimByToken(token);
-        if(claims == null || jwtUtils.isTokenExpired(claims.getExpiration())){
-            throw new FSException(jwtUtils.getHeader() + "失效,请重新登录", HttpStatus.UNAUTHORIZED.value());
-        }
-        //设置userId到request里,后续根据userId,获取用户信息
-        request.setAttribute(USER_KEY, Long.parseLong(claims.getSubject()));
-
-        return true;
-    }
-}

+ 0 - 13
fs-live-app/src/main/java/com/fs/app/param/CompanyWxListParam.java

@@ -1,13 +0,0 @@
-package com.fs.app.param;
-
-import com.fs.wxUser.domain.CompanyWxUser;
-import lombok.Data;
-
-@Data
-public class CompanyWxListParam {
-
-    private int pageNum;
-    private int pageSize;
-    private String keyword;
-
-}

+ 0 - 13
fs-live-app/src/main/java/com/fs/app/param/LoginParam.java

@@ -1,13 +0,0 @@
-package com.fs.app.param;
-
-import lombok.Data;
-
-import javax.validation.constraints.NotBlank;
-
-
-@Data
-public class LoginParam {
-    @NotBlank(message = "code参数缺失")
-    private String code;
-    private String unionId;
-}

+ 0 - 19
fs-live-app/src/main/java/com/fs/app/param/SendSopParam.java

@@ -1,19 +0,0 @@
-package com.fs.app.param;
-
-import lombok.Data;
-
-@Data
-public class SendSopParam {
-    /**
-    * 固定SendSop
-    */
-    private String cmd;
-    /**
-    * sopLogs记录
-    */
-    private String data;
-    /**
-    * companyUserid
-    */
-    private String userId;
-}

+ 0 - 29
fs-live-app/src/main/java/com/fs/app/param/SopLogsEditParam.java

@@ -1,29 +0,0 @@
-package com.fs.app.param;
-
-import lombok.Data;
-
-@Data
-public class SopLogsEditParam {
-
-    /**
-     * qw_sop_Logs的主键(修改时参数)
-     */
-    private Long id;
-
-    /**
-     * 发送(给成员)状态 0发送失败 1发送成功 3待发送
-     */
-    private Long sendStatus;
-
-    /**
-     *  接收(客户的)状态:0-未发送 1-已发送 2-因客户不是好友导致发送失败 3-因客户已经收到其他群发消息导致发送失败
-     */
-    private Long receivingStatus;
-
-    /**
-    * 备注
-    */
-    private String remark;
-
-    private Long companyUserId;
-}

+ 0 - 31
fs-live-app/src/main/java/com/fs/app/resolver/LoginUserHandlerMethodArgumentResolver.java

@@ -1,31 +0,0 @@
-package com.fs.app.resolver;
-
-
-/**
- * @LoginUser注解的方法参数,注入当前登录用户
- */
-//@Component
-//public class LoginUserHandlerMethodArgumentResolver implements HandlerMethodArgumentResolver {
-//    @Autowired
-//    private UserService userService;
-//
-//    @Override
-//    public boolean supportsParameter(MethodParameter parameter) {
-//        return parameter.getParameterType().isAssignableFrom(UserEntity.class) && parameter.hasParameterAnnotation(LoginUser.class);
-//    }
-//
-//    @Override
-//    public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer container,
-//                                  NativeWebRequest request, WebDataBinderFactory factory) throws Exception {
-//        //获取用户ID
-//        Object object = request.getAttribute(AuthorizationInterceptor.USER_KEY, RequestAttributes.SCOPE_REQUEST);
-//        if(object == null){
-//            return null;
-//        }
-//
-//        //获取用户信息
-//        UserEntity user = userService.getById((Long)object);
-//
-//        return user;
-//    }
-//}

+ 0 - 36
fs-live-app/src/main/java/com/fs/app/task/Task.java

@@ -1,36 +0,0 @@
-package com.fs.app.task;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.fs.live.domain.Live;
-import com.fs.live.service.ILiveService;
-import lombok.AllArgsConstructor;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-
-import java.time.LocalDateTime;
-import java.util.List;
-
-@Component
-@AllArgsConstructor
-public class Task {
-
-    private final ILiveService liveService;
-
-    @Scheduled(cron = "0 0/1 * * * ?")
-    public void selectSopUserLogsListByTime() {
-        LocalDateTime now = LocalDateTime.now();
-        List<Live> list = liveService.list(new QueryWrapper<Live>().ne("status", 3));
-        list.forEach(live -> {
-            if (now.isAfter(live.getStartTime()) && now.isBefore(live.getFinishTime())) {
-                live.setStatus(2);
-            } else if (now.isBefore(live.getStartTime())) {
-                live.setStatus(1);
-            } else if (now.isAfter(live.getFinishTime())) {
-                live.setStatus(3);
-            }
-        });
-        if(!list.isEmpty()){
-            liveService.updateBatchById(list);
-        }
-    }
-}

+ 0 - 47
fs-live-app/src/main/java/com/fs/app/vo/LiveVo.java

@@ -1,47 +0,0 @@
-package com.fs.app.vo;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.fs.common.annotation.Excel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-import java.math.BigDecimal;
-import java.time.LocalDateTime;
-
-@Data
-public class LiveVo {
-    private Long liveId;
-    @ApiModelProperty("直播名称")
-    private String liveName;
-    @ApiModelProperty("直播描述")
-    private String liveDesc;
-    @ApiModelProperty("显示类型 1横屏 2竖屏")
-    private Integer showType;
-    @ApiModelProperty("1待支付 2直播中 3已结束")
-    private Integer status;
-    @ApiModelProperty("直播ID")
-    private Long anchorId;
-    @ApiModelProperty("直播类型 1直播,2录播")
-    private Integer liveType;
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @ApiModelProperty("开始时间")
-    private LocalDateTime startTime;
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @ApiModelProperty("结束时间")
-    private LocalDateTime finishTime;
-    @ApiModelProperty("直播封面")
-    private String liveImgUrl;
-    @ApiModelProperty("直播配置 JOSN")
-    private String liveConfig;
-    @ApiModelProperty("视屏地址")
-    private String videoUrl;
-    @ApiModelProperty("当前跳转秒速")
-    private Long duration;
-    @ApiModelProperty("企微二维码")
-    private String qwQrCode;
-    private Long nowDuration;
-    private BigDecimal nowPri;
-}

+ 0 - 29
fs-live-app/src/main/java/com/fs/app/vo/UserListVO.java

@@ -1,29 +0,0 @@
-package com.fs.app.vo;
-
-import java.util.List;
-
-public class UserListVO {
-    String firstLetter;
-    List<UserVO> list;
-
-    public UserListVO(String firstLetter, List<UserVO> list) {
-        this.firstLetter = firstLetter;
-        this.list = list;
-    }
-
-    public String getFirstLetter() {
-        return firstLetter;
-    }
-
-    public void setFirstLetter(String firstLetter) {
-        this.firstLetter = firstLetter;
-    }
-
-    public List<UserVO> getList() {
-        return list;
-    }
-
-    public void setList(List<UserVO> list) {
-        this.list = list;
-    }
-}

+ 0 - 49
fs-live-app/src/main/java/com/fs/app/vo/UserVO.java

@@ -1,49 +0,0 @@
-package com.fs.app.vo;
-
-public class UserVO {
-    String nickName;
-    String firstLetter;
-    String deptName;
-    Long userId;
-    String avatar;
-
-    public String getAvatar() {
-        return avatar;
-    }
-
-    public void setAvatar(String avatar) {
-        this.avatar = avatar;
-    }
-
-    public String getNickName() {
-        return nickName;
-    }
-
-    public void setNickName(String nickName) {
-        this.nickName = nickName;
-    }
-
-    public String getFirstLetter() {
-        return firstLetter;
-    }
-
-    public void setFirstLetter(String firstLetter) {
-        this.firstLetter = firstLetter;
-    }
-
-    public String getDeptName() {
-        return deptName;
-    }
-
-    public void setDeptName(String deptName) {
-        this.deptName = deptName;
-    }
-
-    public Long getUserId() {
-        return userId;
-    }
-
-    public void setUserId(Long userId) {
-        this.userId = userId;
-    }
-}

+ 0 - 141
fs-live-app/src/main/java/com/fs/app/websocket/service/WebSocketServer.java

@@ -1,141 +0,0 @@
-package com.fs.app.websocket.service;
-
-
-import com.alibaba.fastjson.JSONObject;
-import com.fs.app.websocket.bean.SendMsgVo;
-import com.fs.common.core.domain.R;
-import com.fs.common.core.redis.RedisCache;
-import com.fs.common.exception.base.BaseException;
-import com.fs.common.utils.StringUtils;
-import com.fs.common.utils.spring.SpringUtils;
-import com.fs.his.domain.FsUser;
-import com.fs.his.service.IFsUserService;
-import com.fs.live.domain.LiveMsg;
-import com.fs.live.domain.LiveWatchUser;
-import com.fs.live.service.ILiveMsgService;
-import com.fs.live.service.ILiveService;
-import com.fs.live.service.ILiveWatchUserService;
-import org.springframework.stereotype.Component;
-
-import javax.websocket.*;
-import javax.websocket.server.ServerEndpoint;
-import java.io.IOException;
-import java.util.Date;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.stream.Collectors;
-
-@ServerEndpoint("/app/webSocket")
-@Component
-public class WebSocketServer {
-
-
-    //concurrent包的线程安全Set,用来存放每个客户端对应的WebSocketServer对象。
-    private static ConcurrentHashMap<Long, Session> sessionPools = new ConcurrentHashMap<>();
-    private final RedisCache redisCache = SpringUtils.getBean(RedisCache.class);
-    private final ILiveMsgService liveMsgService = SpringUtils.getBean(ILiveMsgService.class);
-    private final ILiveService liveService = SpringUtils.getBean(ILiveService.class);
-    private final ILiveWatchUserService liveWatchUserService = SpringUtils.getBean(ILiveWatchUserService.class);
-    private final IFsUserService fsUserService = SpringUtils.getBean(IFsUserService.class);
-
-    //发送消息
-    public void sendMessage(Session session, String message) throws IOException {
-        if (session != null) {
-            synchronized (session) {
-                System.out.println("发送数据:" + message);
-                session.getBasicRemote().sendText(message);
-            }
-        }
-    }
-
-    //给指定用户发送信息
-    public void sendInfo(String id, String message) {
-        Session session = sessionPools.get(id);
-        try {
-            if (session != null) {
-
-                sendMessage(session, message);
-            }
-
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    //建立连接成功调用
-    @OnOpen
-    public void onOpen(Session session) {
-        Map<String, String> params = getParams(session);
-        if(!params.containsKey("liveId")) throw new BaseException("未找到直播间");
-        if(!params.containsKey("userId")) throw new BaseException("用户信息错误");
-        long liveId = Long.parseLong(params.get("liveId"));
-        long userId = Long.parseLong(params.get("userId"));
-        liveWatchUserService.join(liveId, userId);
-        if (liveService.getById(liveId) == null) throw new BaseException("未找到直播间");
-        sessionPools.put(liveId, session);
-        System.out.println(liveId + "加入webSocket!当前人数为" + sessionPools.size());
-
-    }
-
-    //关闭连接时调用
-    @OnClose
-    public void onClose(Session session) {
-        Map<String, String> params = getParams(session);
-        long liveId = Long.parseLong(params.get("liveId"));
-        long userId = Long.parseLong(params.get("userId"));
-        sessionPools.remove(liveId);
-        liveWatchUserService.close(liveId, userId);
-        System.out.println(liveId + "断开webSocket连接!当前人数为" + sessionPools.size());
-    }
-
-    //收到客户端信息
-    @OnMessage
-    public void onMessage(String message) throws IOException {
-        SendMsgVo msg = JSONObject.parseObject(message, SendMsgVo.class);
-        if(msg.isOn()) return;
-        Session session;
-        System.out.println("收到数据" + msg.getCmd());
-        try {
-            switch (msg.getCmd()) {
-                case "heartbeat":
-                    session = sessionPools.get(msg.getUserId());
-                    sendMessage(session, JSONObject.toJSONString(msg));
-                    break;
-                case "sendMsg":
-                    session = sessionPools.get(msg.getLiveId());
-                    if (session == null) return;
-                    LiveWatchUser liveWatchUser = liveWatchUserService.getByLiveIdAndUserId(msg.getLiveId(), msg.getUserId());
-                    if(liveWatchUser.getMsgStatus() == 1){
-                        sendMessage(session, JSONObject.toJSONString(R.error("你以被禁言")));
-                        return;
-                    }
-                    LiveMsg liveMsg = new LiveMsg();
-                    liveMsg.setLiveId(msg.getLiveId());
-                    liveMsg.setUserId(msg.getUserId());
-                    liveMsg.setNickName(msg.getNickName());
-                    liveMsg.setAvatar(msg.getAvatar());
-                    liveMsg.setMsg(msg.getMsg());
-                    liveMsg.setCreateTime(new Date());
-                    liveMsgService.save(liveMsg);
-                    msg.setOn(true);
-                    sendMessage(session, JSONObject.toJSONString(R.ok().put("data", msg)));
-                    break;
-
-            }
-        } catch (Exception e) {
-            System.out.println("收到数据" + e.getMessage());
-        }
-
-    }
-
-    //错误时调用
-    @OnError
-    public void onError(Session session, Throwable throwable) {
-        System.out.println("发生错误" + throwable.getMessage());
-        throwable.printStackTrace();
-    }
-
-    private Map<String, String> getParams(Session session){
-        return session.getRequestParameterMap().entrySet().stream().filter(e -> e.getValue() != null && !e.getValue().isEmpty() && StringUtils.isNotEmpty(e.getValue().get(0))).collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().get(0)));
-    }
-}

+ 89 - 0
fs-live-app/src/main/java/com/fs/framework/aspectj/LiveWatchUserAspect.java

@@ -0,0 +1,89 @@
+package com.fs.framework.aspectj;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.fs.live.domain.LiveWatchUser;
+import com.fs.live.service.ILiveWatchUserService;
+import lombok.extern.slf4j.Slf4j;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.AfterReturning;
+import org.aspectj.lang.annotation.Aspect;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+@Aspect
+@Component
+@Slf4j
+public class LiveWatchUserAspect {
+
+
+
+    @Autowired
+    private ILiveWatchUserService liveWatchUserService;
+
+    @AfterReturning(pointcut = "execution(* com.fs.live.service.impl.LiveWatchUserServiceImpl.insertLiveWatchUser(..)) || " +
+            "execution(* com.fs.live.service.impl.LiveWatchUserServiceImpl.updateLiveWatchUser(..)) || " +
+            "execution(* com.fs.live.service.impl.LiveWatchUserServiceImpl.deleteLiveWatchUserById(..)) || " +
+            "execution(* com.fs.live.service.impl.LiveWatchUserServiceImpl.deleteLiveWatchUserByIds(..))",
+            returning = "result")
+    public void afterLiveWatchUserOperation(JoinPoint joinPoint, Object result) {
+        try {
+            String methodName = joinPoint.getSignature().getName();
+            Object[] args = joinPoint.getArgs();
+            log.info("直播观看用户数据发生变化,方法: {}, 参数: {}", methodName, Arrays.toString(args));
+            // 提取liveId并处理缓存更新
+            Set<Long> liveIds = extractLiveIds(methodName, args);
+            for (Long liveId : liveIds) {
+                liveWatchUserService.asyncToCache(liveId);
+            }
+        } catch (Exception e) {
+            log.error("执行直播观看用户变更后逻辑失败", e);
+        }
+    }
+
+    private Set<Long> extractLiveIds(String methodName, Object[] args) {
+        Set<Long> liveIds = new HashSet<>();
+        if (args == null || args.length == 0) {
+            return liveIds;
+        }
+        switch (methodName) {
+            case "insertLiveWatchUser":
+            case "updateLiveWatchUser":
+                // 参数是LiveWatchUser对象
+                if (args[0] instanceof LiveWatchUser) {
+                    LiveWatchUser liveWatchUser = (LiveWatchUser) args[0];
+                    if (liveWatchUser.getLiveId() != null) {
+                        liveIds.add(liveWatchUser.getLiveId());
+                    }
+                }
+                break;
+            case "deleteLiveWatchUserById":
+                // 参数是Long类型的id,需要先查询获取liveId
+                if (args[0] instanceof Long) {
+                    LiveWatchUser liveWatchUser = liveWatchUserService.selectLiveWatchUserById((Long) args[0]);
+                    if (ObjectUtil.isNotEmpty(liveWatchUser)) {
+                        liveIds.add(liveWatchUser.getLiveId());
+                    }
+                }
+                break;
+            case "deleteLiveWatchUserByIds":
+                // 参数是Long[]数组
+                if (args[0] instanceof Long[]) {
+                    Long[] ids = (Long[]) args[0];
+                    LiveWatchUser liveWatchUser = liveWatchUserService.selectLiveWatchUserById(ids[0]);
+                    if (ObjectUtil.isNotEmpty(liveWatchUser)) {
+                        liveIds.add(liveWatchUser.getLiveId());
+                    }
+                }
+                break;
+            default:
+                log.warn("未处理的方法: {}", methodName);
+        }
+        return liveIds;
+    }
+
+
+}

+ 58 - 0
fs-live-app/src/main/java/com/fs/framework/aspectj/lock/DistributeLock.java

@@ -0,0 +1,58 @@
+package com.fs.framework.aspectj.lock;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 分布式锁注解
+ *
+ * @author Hollis
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface DistributeLock {
+
+    /**
+     * 锁的场景
+     *
+     * @return
+     */
+    public String scene();
+
+    /**
+     * 加锁的key,优先取key(),如果没有,则取keyExpression()
+     *
+     * @return
+     */
+    public String key() default DistributeLockConstant.NONE_KEY;
+
+    /**
+     * SPEL表达式:
+     * <pre>
+     *     #id
+     *     #insertResult.id
+     * </pre>
+     *
+     * @return
+     */
+    public String keyExpression() default DistributeLockConstant.NONE_KEY;
+
+    /**
+     * 超时时间,毫秒
+     * 默认情况下不设置超时时间,会自动续期
+     *
+     * @return
+     */
+    public int expireTime() default DistributeLockConstant.DEFAULT_EXPIRE_TIME;
+
+    public String errorMsg() default DistributeLockConstant.ERROR_MSG;
+
+    /**
+     * 加锁等待时长,毫秒
+     * 默认情况下不设置等待时长,会一直等待直到获取到锁
+     * @return
+     */
+    public int waitTime() default DistributeLockConstant.DEFAULT_WAIT_TIME;
+}

+ 113 - 0
fs-live-app/src/main/java/com/fs/framework/aspectj/lock/DistributeLockAspect.java

@@ -0,0 +1,113 @@
+package com.fs.framework.aspectj.lock;
+
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.redisson.api.RLock;
+import org.redisson.api.RedissonClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.core.StandardReflectionParameterNameDiscoverer;
+import org.springframework.core.annotation.Order;
+import org.springframework.expression.EvaluationContext;
+import org.springframework.expression.Expression;
+import org.springframework.expression.spel.standard.SpelExpressionParser;
+import org.springframework.expression.spel.support.StandardEvaluationContext;
+import org.springframework.stereotype.Component;
+
+import java.lang.reflect.Method;
+import java.util.concurrent.TimeUnit;
+
+@Aspect
+@Component
+@Order(Integer.MIN_VALUE + 1)
+public class DistributeLockAspect {
+
+    private RedissonClient redissonClient;
+
+    public DistributeLockAspect(RedissonClient redissonClient) {
+        this.redissonClient = redissonClient;
+    }
+
+    private static final Logger LOG = LoggerFactory.getLogger(DistributeLockAspect.class);
+
+    @Around("@annotation(com.fs.framework.aspectj.lock.DistributeLock)")
+    public Object process(ProceedingJoinPoint pjp) throws Throwable {
+        Object response = null;
+        Method method = ((MethodSignature) pjp.getSignature()).getMethod();
+        DistributeLock distributeLock = method.getAnnotation(DistributeLock.class);
+
+        String key = distributeLock.key();
+        if (DistributeLockConstant.NONE_KEY.equals(key)) {
+            if (DistributeLockConstant.NONE_KEY.equals(distributeLock.keyExpression())) {
+                throw new DistributeLockException("no lock key found...");
+            }
+            SpelExpressionParser parser = new SpelExpressionParser();
+            Expression expression = parser.parseExpression(distributeLock.keyExpression());
+
+            EvaluationContext context = new StandardEvaluationContext();
+            // 获取参数值
+            Object[] args = pjp.getArgs();
+
+            // 获取运行时参数的名称
+            StandardReflectionParameterNameDiscoverer discoverer
+                    = new StandardReflectionParameterNameDiscoverer();
+            String[] parameterNames = discoverer.getParameterNames(method);
+
+            // 将参数绑定到context中
+            if (parameterNames != null) {
+                for (int i = 0; i < parameterNames.length; i++) {
+                    context.setVariable(parameterNames[i], args[i]);
+                }
+            }
+
+            // 解析表达式,获取结果
+            key = String.valueOf(expression.getValue(context));
+        }
+
+        String scene = distributeLock.scene();
+
+        String lockKey = scene + "#" + key;
+
+        int expireTime = distributeLock.expireTime();
+        int waitTime = distributeLock.waitTime();
+        RLock rLock= redissonClient.getLock(lockKey);
+        try {
+            boolean lockResult = false;
+            if (waitTime == DistributeLockConstant.DEFAULT_WAIT_TIME) {
+                if (expireTime == DistributeLockConstant.DEFAULT_EXPIRE_TIME) {
+//                    LOG.info(String.format("lock for key : %s", lockKey));
+                    rLock.lock();
+                } else {
+//                    LOG.info(String.format("lock for key : %s , expire : %s", lockKey, expireTime));
+                    rLock.lock(expireTime, TimeUnit.MILLISECONDS);
+                }
+                lockResult = true;
+            } else {
+                if (expireTime == DistributeLockConstant.DEFAULT_EXPIRE_TIME) {
+//                    LOG.info(String.format("try lock for key : %s , wait : %s", lockKey, waitTime));
+                    lockResult = rLock.tryLock(waitTime, TimeUnit.MILLISECONDS);
+                } else {
+//                    LOG.info(String.format("try lock for key : %s , expire : %s , wait : %s", lockKey, expireTime, waitTime));
+                    lockResult = rLock.tryLock(waitTime, expireTime, TimeUnit.MILLISECONDS);
+                }
+            }
+
+            if (!lockResult) {
+//                LOG.warn(String.format("lock failed for key : %s , expire : %s", lockKey, expireTime));
+                throw new DistributeLockException(distributeLock.errorMsg());
+            }
+
+
+//            LOG.info(String.format("lock success for key : %s , expire : %s", lockKey, expireTime));
+            response = pjp.proceed();
+        }  finally {
+            if (rLock.isHeldByCurrentThread()) {
+                rLock.unlock();
+//                LOG.info(String.format("unlock for key : %s , expire : %s", lockKey, expireTime));
+            }
+        }
+        return response;
+    }
+}

+ 13 - 0
fs-live-app/src/main/java/com/fs/framework/aspectj/lock/DistributeLockConstant.java

@@ -0,0 +1,13 @@
+package com.fs.framework.aspectj.lock;
+
+public class DistributeLockConstant {
+
+    public static final String NONE_KEY = "NONE";
+
+    public static final String DEFAULT_OWNER = "DEFAULT";
+
+    public static final int DEFAULT_EXPIRE_TIME = -1;
+
+    public static final int DEFAULT_WAIT_TIME = Integer.MAX_VALUE;
+    public static final String ERROR_MSG  = "请勿重复操作";
+}

+ 24 - 0
fs-live-app/src/main/java/com/fs/framework/aspectj/lock/DistributeLockException.java

@@ -0,0 +1,24 @@
+package com.fs.framework.aspectj.lock;
+
+
+public class DistributeLockException extends RuntimeException {
+
+    public DistributeLockException() {
+    }
+
+    public DistributeLockException(String message) {
+        super(message);
+    }
+
+    public DistributeLockException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public DistributeLockException(Throwable cause) {
+        super(cause);
+    }
+
+    public DistributeLockException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
+        super(message, cause, enableSuppression, writableStackTrace);
+    }
+}

+ 0 - 20
fs-live-app/src/main/java/com/fs/framework/config/WebSocketConfig.java

@@ -1,20 +0,0 @@
-package com.fs.framework.config;
-
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.socket.server.standard.ServerEndpointExporter;
-
-@Configuration
-public class WebSocketConfig {
-    /**
-     * ServerEndpointExporter 作用
-     *
-     * 这个Bean会自动注册使用@ServerEndpoint注解声明的websocket endpoint
-     *
-     * @return
-     */
-    @Bean
-    public ServerEndpointExporter serverEndpointExporter() {
-        return new ServerEndpointExporter();
-    }
-}

+ 1 - 1
fs-live-app/src/main/java/com/fs/app/annotation/Login.java → fs-live-app/src/main/java/com/fs/live/annotation/Login.java

@@ -1,4 +1,4 @@
-package com.fs.app.annotation;
+package com.fs.live.annotation;
 
 import java.lang.annotation.*;
 

+ 1 - 1
fs-live-app/src/main/java/com/fs/app/annotation/LoginUser.java → fs-live-app/src/main/java/com/fs/live/annotation/LoginUser.java

@@ -1,4 +1,4 @@
-package com.fs.app.annotation;
+package com.fs.live.annotation;
 
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;

+ 32 - 0
fs-live-app/src/main/java/com/fs/live/config/LiveWebSocketConfig.java

@@ -0,0 +1,32 @@
+package com.fs.live.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.TaskScheduler;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
+import org.springframework.web.socket.server.standard.ServerEndpointExporter;
+
+@Configuration
+public class LiveWebSocketConfig {
+    /**
+     * ServerEndpointExporter 作用
+     *
+     * 这个Bean会自动注册使用@ServerEndpoint注解声明的websocket endpoint
+     *
+     * @return
+     */
+    @Bean
+    public ServerEndpointExporter serverEndpointExporter() {
+        return new ServerEndpointExporter();
+    }
+
+    @Bean
+    public TaskScheduler taskScheduler() {
+        ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
+        scheduler.setPoolSize(10); // 线程池大小
+        scheduler.setThreadNamePrefix("live-scheduler-"); // 线程名前缀
+        scheduler.setAwaitTerminationSeconds(60); // 等待终止时间
+        scheduler.setWaitForTasksToCompleteOnShutdown(true); // 关闭时等待任务完成
+        return scheduler;
+    }
+}

Vissa filer visades inte eftersom för många filer har ändrats