Преглед на файлове

Merge remote-tracking branch 'origin/master' into cqtyt_master

yfh преди 1 седмица
родител
ревизия
1e4327edd3
променени са 100 файла, в които са добавени 10632 реда и са изтрити 484 реда
  1. 139 0
      deploy.sh
  2. 1 1
      fs-admin/src/main/java/com/fs/api/controller/StatisticManageController.java
  3. 27 4
      fs-admin/src/main/java/com/fs/company/controller/CompanyController.java
  4. 30 0
      fs-admin/src/main/java/com/fs/course/controller/FsCourseTrafficLogController.java
  5. 2 1
      fs-admin/src/main/java/com/fs/course/controller/FsUserCourseCategoryController.java
  6. 24 0
      fs-admin/src/main/java/com/fs/his/controller/FsCompanyDivItemController.java
  7. 16 2
      fs-admin/src/main/java/com/fs/his/controller/FsUserController.java
  8. 247 0
      fs-admin/src/main/java/com/fs/his/param/FurtherConsultationParam.java
  9. 329 0
      fs-admin/src/main/java/com/fs/his/param/PrescriptionParam.java
  10. 480 0
      fs-admin/src/main/java/com/fs/his/task/NetMedicalService.java
  11. 46 0
      fs-admin/src/main/java/com/fs/live/aspectj/LiveControllerAspect.java
  12. 183 0
      fs-admin/src/main/java/com/fs/live/controller/LiveAfterSalesController.java
  13. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveAfterSalesItemController.java
  14. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveAfterSalesLogsController.java
  15. 8 14
      fs-admin/src/main/java/com/fs/live/controller/LiveAnchorController.java
  16. 227 0
      fs-admin/src/main/java/com/fs/live/controller/LiveAutoTaskController.java
  17. 98 0
      fs-admin/src/main/java/com/fs/live/controller/LiveCartController.java
  18. 97 29
      fs-admin/src/main/java/com/fs/live/controller/LiveController.java
  19. 223 0
      fs-admin/src/main/java/com/fs/live/controller/LiveCouponController.java
  20. 103 0
      fs-admin/src/main/java/com/fs/live/controller/LiveCouponIssueController.java
  21. 103 0
      fs-admin/src/main/java/com/fs/live/controller/LiveCouponIssueUserController.java
  22. 105 0
      fs-admin/src/main/java/com/fs/live/controller/LiveCouponUserController.java
  23. 100 0
      fs-admin/src/main/java/com/fs/live/controller/LiveDataController.java
  24. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveEventConfController.java
  25. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveGiftController.java
  26. 107 29
      fs-admin/src/main/java/com/fs/live/controller/LiveGoodsController.java
  27. 0 103
      fs-admin/src/main/java/com/fs/live/controller/LiveGoodsOrderController.java
  28. 0 103
      fs-admin/src/main/java/com/fs/live/controller/LiveGoodsOrderItemsController.java
  29. 326 0
      fs-admin/src/main/java/com/fs/live/controller/LiveHealthOrderController.java
  30. 143 0
      fs-admin/src/main/java/com/fs/live/controller/LiveLotteryConfController.java
  31. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveLotteryRecordController.java
  32. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveLotteryRegistrationController.java
  33. 22 20
      fs-admin/src/main/java/com/fs/live/controller/LiveMsgController.java
  34. 657 0
      fs-admin/src/main/java/com/fs/live/controller/LiveOrderController.java
  35. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveOrderItemController.java
  36. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveOrderLogsController.java
  37. 118 0
      fs-admin/src/main/java/com/fs/live/controller/LiveOrderPaymentController.java
  38. 0 103
      fs-admin/src/main/java/com/fs/live/controller/LiveQuestionController.java
  39. 125 0
      fs-admin/src/main/java/com/fs/live/controller/LiveRedConfController.java
  40. 4 0
      fs-admin/src/main/java/com/fs/live/controller/LiveRedController.java
  41. 125 0
      fs-admin/src/main/java/com/fs/live/controller/LiveRewardRecordController.java
  42. 98 0
      fs-admin/src/main/java/com/fs/live/controller/LiveSensitiveWordsController.java
  43. 122 0
      fs-admin/src/main/java/com/fs/live/controller/LiveTrafficLogController.java
  44. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveUserFavoriteController.java
  45. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveUserFollowController.java
  46. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveUserLikeController.java
  47. 108 0
      fs-admin/src/main/java/com/fs/live/controller/LiveUserLotteryRecordController.java
  48. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveUserRedRecordController.java
  49. 33 20
      fs-admin/src/main/java/com/fs/live/controller/LiveVideoController.java
  50. 102 0
      fs-admin/src/main/java/com/fs/live/controller/LiveWatchConfigController.java
  51. 63 20
      fs-admin/src/main/java/com/fs/live/controller/LiveWatchUserController.java
  52. 1 1
      fs-admin/src/main/java/com/fs/task/ComprehensiveStatisticsTask.java
  53. 183 0
      fs-admin/src/main/java/com/fs/task/LiveTask.java
  54. 16 2
      fs-admin/src/main/java/com/fs/task/SgTestController.java
  55. 1 1
      fs-admin/src/main/resources/application.yml
  56. 31 0
      fs-common/src/main/java/com/fs/common/constant/LiveKeysConstant.java
  57. 20 0
      fs-common/src/main/java/com/fs/common/core/page/PageRequest.java
  58. 150 0
      fs-common/src/main/java/com/fs/common/core/redis/RedisCache.java
  59. 64 0
      fs-common/src/main/java/com/fs/common/utils/DateUtils.java
  60. 101 9
      fs-common/src/main/java/com/fs/common/utils/http/HttpUtils.java
  61. 45 0
      fs-company/src/main/java/com/fs/company/aspectj/LiveControllerAspect.java
  62. 9 0
      fs-company/src/main/java/com/fs/company/controller/common/CommonController.java
  63. 84 3
      fs-company/src/main/java/com/fs/company/controller/company/CompanyUserController.java
  64. 2 2
      fs-company/src/main/java/com/fs/company/controller/course/FsCourseFinishTempParentController.java
  65. 2 1
      fs-company/src/main/java/com/fs/company/controller/course/FsUserCourseCategoryController.java
  66. 1 1
      fs-company/src/main/java/com/fs/company/controller/course/qw/FsQwCourseWatchLogController.java
  67. 135 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveAfterSalesController.java
  68. 121 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveAnchorController.java
  69. 227 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveAutoTaskController.java
  70. 97 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveCartController.java
  71. 361 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveController.java
  72. 209 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveCouponController.java
  73. 182 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveDataController.java
  74. 97 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveGiftController.java
  75. 183 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveGoodsController.java
  76. 143 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveLotteryConfController.java
  77. 97 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveLotteryRecordController.java
  78. 97 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveLotteryRegistrationController.java
  79. 108 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveMsgController.java
  80. 396 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveOrderController.java
  81. 97 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveOrderItemController.java
  82. 97 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveOrderLogsController.java
  83. 34 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveProfitController.java
  84. 125 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveRedConfController.java
  85. 126 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveRewardRecordController.java
  86. 98 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveSensitiveWordsController.java
  87. 97 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveUserFavoriteController.java
  88. 97 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveUserFirstEntryController.java
  89. 97 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveUserFollowController.java
  90. 97 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveUserLikeController.java
  91. 108 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveUserLotteryRecordController.java
  92. 116 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveVideoController.java
  93. 102 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveWatchConfigController.java
  94. 146 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveWatchUserController.java
  95. 3 2
      fs-company/src/main/java/com/fs/company/controller/qw/QwDeptController.java
  96. 92 10
      fs-company/src/main/java/com/fs/company/controller/qw/QwSopTempController.java
  97. 12 0
      fs-company/src/main/java/com/fs/company/controller/qw/QwUserController.java
  98. 2 2
      fs-company/src/main/java/com/fs/company/controller/qw/SopUserLogsController.java
  99. 17 0
      fs-company/src/main/java/com/fs/company/controller/qw/SopUserLogsInfoController.java
  100. 1 1
      fs-company/src/main/java/com/fs/framework/service/UserDetailsServiceImpl.java

+ 139 - 0
deploy.sh

@@ -0,0 +1,139 @@
+#!/bin/bash
+
+# 各服务对应的远程服务器配置 北京卓美
+declare -A SERVER_CONFIG=(
+    # 服务名:IP地址
+    ["fs-live-app"]="114.132.218.150"
+)
+
+# 通用配置(所有服务器相同)
+REMOTE_USER="root"
+REMOTE_BASE_DIR="/home/software"
+
+# 本地 JAR 包路径
+LOCAL_FS_LIVE_SOCKET_JAR="./fs-live-app/target/fs-live-app.jar"
+
+# 函数:检查本地文件是否存在
+check_local_file() {
+    if [ ! -f "$1" ]; then
+        echo "错误: 本地文件 $1 不存在。"
+        exit 1
+    fi
+}
+
+# 停止远程服务器上可能正在运行的旧版本
+stop_remote_app() {
+    local remote_user=$1
+    local remote_host=$2
+    local app_name=$3
+
+    echo "正在停止 $remote_host 上的 $app_name 服务..."
+    ssh "$remote_user@$remote_host" "pkill -f $app_name || echo '没有找到运行中的进程'"
+}
+
+# 检查服务器连通性
+check_server_connectivity() {
+    local remote_user=$1
+    local remote_host=$2
+
+    if ! ssh -o ConnectTimeout=5 "$remote_user@$remote_host" "echo '连接成功'" &>/dev/null; then
+        echo "错误: 无法连接到服务器 $remote_host"
+        return 1
+    fi
+    return 0
+}
+
+# 部署单个 JAR 包到指定服务器
+deploy_jar() {
+    local local_jar=$1
+    local service_name=$2  # 服务名,用于确定目标服务器
+    local remote_dir=$3     # 远程目录名
+
+    # 获取服务对应的服务器IP
+    local remote_host="${SERVER_CONFIG[$service_name]}"
+    if [ -z "$remote_host" ]; then
+        echo "错误: 未找到服务 $service_name 的服务器配置"
+        return 1
+    fi
+
+    local app_name=$(basename "$local_jar" .jar)
+
+    echo "========================================"
+    echo "开始部署 $service_name 到服务器 $remote_host"
+    echo "本地文件: $local_jar"
+    echo "远程目录: $REMOTE_BASE_DIR/$remote_dir"
+    echo "========================================"
+
+    # 检查本地文件
+    check_local_file "$local_jar"
+
+    # 检查服务器连通性
+    if ! check_server_connectivity "$REMOTE_USER" "$remote_host"; then
+        return 1
+    fi
+
+    # 创建远程目录(如果不存在)
+    echo "创建远程目录..."
+    ssh "$REMOTE_USER@$remote_host" "mkdir -p $REMOTE_BASE_DIR/$remote_dir"
+
+    # 停止旧版本
+    stop_remote_app "$REMOTE_USER" "$remote_host" "$app_name"
+
+    # 上传 JAR 包
+    echo "上传 JAR 包..."
+    scp "$local_jar" "$REMOTE_USER@$remote_host:$REMOTE_BASE_DIR/$remote_dir/"
+
+    # 在后台启动 JAR 包
+    echo "启动服务..."
+    ssh -f "$REMOTE_USER@$remote_host" \
+    "cd $REMOTE_BASE_DIR/$remote_dir && \
+     nohup java -jar  -Dfile.encoding=UTF-8 $app_name.jar --spring.profiles.active=druid-bjzm --server.port=7114  \
+     >> $app_name.log 2>&1 &"
+
+    # 检查进程是否启动成功
+    if ssh "$REMOTE_USER@$remote_host" "pgrep -f $app_name" &>/dev/null; then
+        echo "✓ $service_name 部署成功到 $remote_host"
+    else
+        echo "✗ $service_name 启动失败,请检查日志: $REMOTE_BASE_DIR/$remote_dir/$app_name.log"
+        return 1
+    fi
+
+    echo ""
+}
+
+# 主要部署流程
+echo "开始多服务器分布式部署..."
+echo "部署配置:"
+for service in "${!SERVER_CONFIG[@]}"; do
+    echo "  $service -> ${SERVER_CONFIG[$service]}"
+done
+echo ""
+
+# 部署 fs-live-app
+deploy_jar "$LOCAL_FS_LIVE_SOCKET_JAR" "fs-live-app" "fs-live-app"
+
+# 部署 fs-sync (注意:这里使用了不同的JAR命名方式)
+#deploy_jar "$LOCAL_FS_SYNC_APP_JAR" "fs-sync" "fs-sync"
+
+echo "========================================"
+echo "分布式部署完成!"
+echo "各服务部署状态:"
+for service in "${!SERVER_CONFIG[@]}"; do
+    remote_host="${SERVER_CONFIG[$service]}"
+    echo "  $service -> $remote_host"
+done
+echo "========================================"
+
+# 可选:显示各服务进程状态
+#echo "服务进程状态检查:"
+#for service in "${!SERVER_CONFIG[@]}"; do
+#    remote_host="${SERVER_CONFIG[$service]}"
+#    app_name="$service"  # 简化处理,实际可能需要根据JAR文件名调整
+#    if ssh "$REMOTE_USER@$remote_host" "pgrep -f $app_name" &>/dev/null; then
+#        echo "  ✓ $service 在 $remote_host 上运行正常"
+#    else
+#        echo "  ✗ $service 在 $remote_host 上未运行"
+#    fi
+#done
+
+# 251105 0953

+ 1 - 1
fs-admin/src/main/java/com/fs/api/controller/StatisticManageController.java

@@ -52,7 +52,7 @@ public class StatisticManageController {
     }
 
     /**
-     * 根据公司id获取部门下拉
+     * 根据部门id获取用户下拉信息
      * @return
      */
     @GetMapping("/getSearchUserInfo")

+ 27 - 4
fs-admin/src/main/java/com/fs/company/controller/CompanyController.java

@@ -10,16 +10,14 @@ 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.SecurityUtils;
 import com.fs.common.utils.ServletUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.common.utils.sign.Md5Utils;
 import com.fs.company.domain.*;
-import com.fs.company.param.CompanyDeductParam;
-import com.fs.company.param.CompanyParam;
-import com.fs.company.param.CompanyRechargeParam;
-import com.fs.company.param.CompanyVoiceCallerParam;
+import com.fs.company.param.*;
 import com.fs.company.service.*;
 import com.fs.company.vo.CompanyCrmVO;
 import com.fs.company.vo.CompanyVO;
@@ -34,6 +32,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
+import java.text.ParseException;
 import java.util.List;
 
 /**
@@ -60,6 +59,30 @@ public class CompanyController extends BaseController
     private ICompanyVoiceCallerService callerService;
     @Autowired
     private ISysConfigService configService;
+
+    /**
+     * 查询企业列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveMiniLives:list')")
+    @GetMapping("/liveShowList")
+    public TableDataInfo liveShowList(CompanyParam param) throws ParseException {
+        startPage();
+        List<CompanyVO> list = companyService.liveShowList(param);
+        for (CompanyVO vo : list){
+            vo.setCompanyMobile(ParseUtils.parsePhone(vo.getCompanyMobile()));
+        }
+        return getDataTable(list);
+    }
+
+    @PostMapping(value = "/batchUpdateLiveShow")
+    public R batchUpdateLiveShow(@RequestBody CompanyLiveShowParam param) {
+        if (param.getIds().isEmpty()) {
+            return R.error("请选择要操作的记录");
+        }
+        companyService.batchUpdateLiveShow(param);
+        return R.ok();
+    }
+
     /**
      * 查询企业列表
      */

+ 30 - 0
fs-admin/src/main/java/com/fs/course/controller/FsCourseTrafficLogController.java

@@ -9,7 +9,9 @@ import com.fs.common.core.domain.R;
 import com.fs.common.exception.CustomException;
 import com.fs.course.param.FsCourseTrafficLogParam;
 import com.fs.course.param.InternetTrafficParam;
+import com.fs.course.param.StatisticsSummaryParam;
 import com.fs.course.vo.FsCourseTrafficLogListVO;
+import com.fs.course.vo.StatisticsSummaryVO;
 import com.fs.qw.param.QwWatchLogStatisticsListParam;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -135,4 +137,32 @@ public class FsCourseTrafficLogController extends BaseController
         return R.ok().put("data", null);  // 返回计算结果
     }
 
+    /**
+     * 流量统计汇总
+     * @param param
+     * @return
+     */
+    @PreAuthorize("@ss.hasPermi('course:courseTrafficLog:statistics')")
+    @GetMapping("/statisticsSummaryList")
+    public TableDataInfo statisticsSummaryList(StatisticsSummaryParam param)
+    {
+        List<StatisticsSummaryVO> list = fsCourseTrafficLogService.getStatisticsSummaryList(param);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出汇总统计报表
+     * @param param
+     * @return
+     */
+    @PreAuthorize("@ss.hasPermi('course:courseTrafficLog:statisticsExport')")
+    @GetMapping("/exportStatisticsSummary")
+    public AjaxResult exportStatisticsSummary(StatisticsSummaryParam param)
+    {
+        List<StatisticsSummaryVO> list = fsCourseTrafficLogService.getStatisticsSummaryListNotPage(param);
+        ExcelUtil<StatisticsSummaryVO> util = new ExcelUtil<StatisticsSummaryVO>(StatisticsSummaryVO.class);
+        return util.exportExcel(list, "看课流量统计汇总");
+
+    }
+
 }

+ 2 - 1
fs-admin/src/main/java/com/fs/course/controller/FsUserCourseCategoryController.java

@@ -163,7 +163,8 @@ public class FsUserCourseCategoryController extends BaseController
             List<OptionsVO> list = fsUserCourseCategoryService.selectFsUserCourseCategoryPidList(userId);
             return R.ok().put("data", list);
         }
-        List<OptionsVO> list = fsUserCourseCategoryService.selectFsUserCourseCategoryPidList();
+        Integer isShow = null;
+        List<OptionsVO> list = fsUserCourseCategoryService.selectFsUserCourseCategoryPidList(isShow);
         return R.ok().put("data", list);
     }
 

+ 24 - 0
fs-admin/src/main/java/com/fs/his/controller/FsCompanyDivItemController.java

@@ -1,6 +1,8 @@
 package com.fs.his.controller;
 
 import java.util.List;
+
+import com.fs.common.core.domain.R;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -68,6 +70,28 @@ public class FsCompanyDivItemController extends BaseController
         return AjaxResult.success(companyDivItemService.selectCompanyDivItemById(id));
     }
 
+    /**
+     * 分账确认
+     */
+    @PreAuthorize("@ss.hasPermi('his:divItem:confirm')")
+    @Log(title = "延迟分账确认", businessType = BusinessType.UPDATE)
+    @PostMapping("/confirm")
+    public R confirm(@RequestBody List<String> payCodes)
+    {
+        return companyDivItemService.confirmByPayCodes(payCodes);
+    }
+
+    /**
+     * 分账确认Scrm
+     */
+    @PreAuthorize("@ss.hasPermi('his:divItem:confirm')")
+    @Log(title = "延迟分账确认", businessType = BusinessType.UPDATE)
+    @PostMapping("/confirmScrm")
+    public R confirmScrm(@RequestBody List<String> payCodes)
+    {
+        return companyDivItemService.confirmByPayCodesScrm(payCodes);
+    }
+
 //    /**
 //     * 新增分账明细
 //     */

+ 16 - 2
fs-admin/src/main/java/com/fs/his/controller/FsUserController.java

@@ -99,7 +99,7 @@ public class FsUserController extends BaseController
             fsUser.setPhone(encryptPhone(fsUser.getPhoneMk()));
         }
         if(StringUtils.isNotEmpty(fsUser.getPhone())){
-            fsUser.setPhone(encryptPhone(fsUser.getPhone()));
+            fsUser.setEncryptPhone(encryptPhone(fsUser.getPhone()));
         }
         List<FsUserVO> list = fsUserService.selectFsUserListVO(fsUser);
         SysRole sysRole = isCheckPermission();
@@ -190,7 +190,11 @@ public class FsUserController extends BaseController
         if(StringUtils.isNotEmpty(fsUser.getPhone())){
             fsUser.setPhone(encryptPhone(fsUser.getPhone()));
         }
-        List<FsUserVO> list = fsUserService.selectFsUserVOListByProject(fsUser);
+//        List<FsUserVO> list = fsUserService.selectFsUserVOListByProject(fsUser);
+
+        // xgb sql执行太慢,优化修改
+        List<FsUserVO> list = fsUserService.selectFsUserVOListByProjectNew(fsUser);
+
         SysRole sysRole = isCheckPermission();
         for (FsUserVO fsUserVO : list) {
             if(fsUserVO.getPhone() != null&&fsUserVO.getPhone()!=""){
@@ -399,5 +403,15 @@ public class FsUserController extends BaseController
         return userIntegralLogsService.addIntegralTemplate(integralTemplateParam);
     }
 
+    @PreAuthorize("@ss.hasPermi('his:user:unbind')")
+    @Log(title = "批量解绑会员(删除销售和会员的关系)", businessType = BusinessType.DELETE)
+    @DeleteMapping("/batchUnbind")
+    public AjaxResult batchUnbind(@RequestBody List<Long> userIds){
+        if(!userIds.isEmpty()){
+            return toAjax(userCompanyUserService.batchUnbind(userIds));
+        } else {
+            return error("请先选择会员");
+        }
+    }
 
 }

+ 247 - 0
fs-admin/src/main/java/com/fs/his/param/FurtherConsultationParam.java

@@ -0,0 +1,247 @@
+package com.fs.his.param;
+
+import lombok.Builder;
+import lombok.Data;
+
+/**
+ * 复诊信息实体请求参数
+ */
+@Data
+@Builder
+public class FurtherConsultationParam {
+
+    /**
+     * 接口调用凭证,可能不用传
+     */
+    private String accessToken;
+
+    /**
+     * 第三方厂商标识
+     */
+    private String clientId;
+
+    /**
+     * 唯一标识,用于唯一确定某条记录,避免重复上传,一般传该条数据的主键
+     */
+    private String thirdUniqueid;
+
+    /**
+     * 机构名称
+     */
+    private String orgName;
+
+    /**
+     * 机构编码,组织机构代码
+     */
+    private String orgCode;
+
+    /**
+     * 诊疗渠道,平台名称
+     */
+    private String channelName;
+
+    /**
+     * 复诊科室
+     */
+    private String section;
+
+    /**
+     * 科室编码,三医
+     */
+    private String sectionCode;
+
+    /**
+     * 复诊医师姓名
+     */
+    private String docName;
+
+    /**
+     * 执业资格证号
+     */
+    private String certificateNum;
+
+    /**
+     * 患者姓名
+     */
+    private String patientName;
+
+    /**
+     * 患者年龄,低于6岁为低龄儿童
+     */
+    private Integer patientAge;
+
+    /**
+     * 患者性别,1男/2女
+     */
+    private String patientSex;
+
+    /**
+     * 证件类型,1 身份证  2 护照
+     */
+    private Integer patientIdcardType;
+
+    /**
+     * 患者证件号码,18位
+     */
+    private String patientIdcardNum;
+
+    /**
+     * 网络复诊编号
+     */
+    private String furtherConsultNo;
+
+    /**
+     * 复诊类别,1、图文诊疗 2语音诊疗 3、视频诊疗
+     */
+    private Integer furtherConsulType;
+
+    /**
+     * 监护人姓名,患者年龄小于6岁,需填此项
+     */
+    private String guardianName;
+
+    /**
+     * 监护人身份证号,患者年龄小于6岁,需填此项
+     */
+    private String guardianIdcardNum;
+
+    /**
+     * 患者简要病史描述,病史摘要
+     */
+    private String medicalHistory;
+
+    /**
+     * 首诊诊断类型,1文字 2图片jpg格式 3图片png格式 4图片bmp格式
+     */
+    private Integer consultDiagnosisType;
+
+    /**
+     * 首诊诊断,复诊患者在首诊医院的诊断,如有多条,使用"|"进行分隔;当传图片时,需要传图片的base64字符串
+     */
+    private String consultDiagnosis;
+
+    /**
+     * 首诊时间,YYYY-MM-DD HH:mm:ss
+     */
+    private String consultTime;
+
+    /**
+     * 首诊机构
+     */
+    private String consultOrg;
+
+    /**
+     * 复诊申请时间,YYYY-MM-DD HH:mm:ss
+     */
+    private String furtherConsultApplyTime;
+
+    /**
+     * 复诊开始时间,YYYY-MM-DD HH:mm:ss
+     */
+    private String furtherConsulStartTime;
+
+    /**
+     * 复诊结束时间,YYYY-MM-DD HH:mm:ss
+     */
+    private String furtherConsulEndTime;
+
+    /**
+     * 复诊是否回复,0未回复 1已回复
+     */
+    private Integer furtherConsulIsReply;
+
+    /**
+     * 费别,1自费 2医保
+     */
+    private Integer feeType;
+
+    /**
+     * 复诊诊断,复诊患者在实体医院的诊断名称,如有多条,使用"|"进行分隔
+     */
+    private String furtherConsultDiagnosis;
+
+    /**
+     * 复诊icd诊断编码
+     */
+    private String furtherConsultDiagnosisNo;
+
+    /**
+     * 复诊价格,单位:元
+     */
+    private Double furtherConsultPrice;
+
+    /**
+     * 患者满意度,1-5,1代表非常满意,5代表非常不满意
+     */
+    private Integer patientEvaluate;
+
+    /**
+     * 投诉举报信息,文本信息
+     */
+    private String complainInfo;
+
+    /**
+     * 处理结果信息,文本信息
+     */
+    private String disposeResult;
+
+    /**
+     * 是否进行诊前风险提示,0否 1是
+     */
+    private Integer isRiskWarn;
+
+    /**
+     * 是否确认患者为签约对象,0否 1是
+     */
+    private Integer isPatientSign;
+
+    /**
+     * 是否开具处方,0否 1是
+     */
+    private Integer isPrescription;
+
+    /**
+     * 上传时间,YYYY-MM-DD HH:mm:ss
+     */
+    private String uploadTime;
+
+    /**
+     * 复诊拒绝时间
+     */
+    private String furtherConsultRefuseTime;
+
+    /**
+     * 复诊拒绝类别,1医生主动拒绝 2超时未回复系统自动拒绝
+     */
+    private Integer furtherConsultRefuseType;
+
+    /**
+     * 复诊拒绝、取消原因
+     */
+    private String furtherConsultRefuseReason;
+
+    /**
+     * ca登录值
+     */
+    private String caLoginSign;
+
+    /**
+     * ca登录时间,YYYY-MM-DD HH:mm:ss
+     */
+    private String caLoginTime;
+
+    /**
+     * 城市id(参考地区字段)
+     */
+    private String cityId;
+
+    /**
+     * 年
+     */
+    private String year;
+
+    /**
+     * 是否留痕,1:代表留痕;0代表未留痕
+     */
+    private String isMark;
+}

+ 329 - 0
fs-admin/src/main/java/com/fs/his/param/PrescriptionParam.java

@@ -0,0 +1,329 @@
+package com.fs.his.param;
+
+import lombok.Builder;
+import lombok.Data;
+
+/**
+ * 电子处方信息上传请求参数
+ */
+@Data
+@Builder
+public class PrescriptionParam {
+
+    /**
+     * 接口调用凭证
+     */
+    private String accessToken;
+
+    /**
+     * 第三方厂商标识
+     */
+    private String clientId;
+
+    /**
+     * 唯一标识,用于唯一确定某条记录,避免重复上传,一般传该条数据的主键
+     */
+    private String thirdUniqueid;
+
+    /**
+     * 机构名称
+     */
+    private String orgName;
+
+    /**
+     * 机构编码
+     */
+    private String orgCode;
+
+    /**
+     * 科室名称
+     */
+    private String section;
+
+    /**
+     * 科室编码
+     */
+    private String sectionCode;
+
+    /**
+     * 医师姓名
+     */
+    private String docName;
+
+    /**
+     * 医师执业资格证号
+     */
+    private String docCertificateNum;
+
+    /**
+     * 药师姓名
+     */
+    private String pharmacistName;
+
+    /**
+     * 药师执业机构
+     */
+    private String pharmacistOrg;
+
+    /**
+     * 药师执业资格证号
+     */
+    private String pharmacistCertificateNum;
+
+    /**
+     * 网络复诊编号,对应接口二
+     */
+    private String furtherConsultNo;
+
+    /**
+     * 复诊诊断,复诊患者在实体医院的诊断名称,如有多条,使用"|"进行分隔
+     */
+    private String furtherConsultDiagnosis;
+
+    /**
+     * 患者姓名
+     */
+    private String patientName;
+
+    /**
+     * 患者性别,1男/2女
+     */
+    private String patientSex;
+
+    /**
+     * 患者年龄,示例:19
+     */
+    private Integer patientAge;
+
+    /**
+     * 证件类型,1 身份证  2 护照
+     */
+    private Integer patientIdcardType;
+
+    /**
+     * 患者证件号码
+     */
+    private String patientIdcardNum;
+
+    /**
+     * 监护人姓名,患者年龄小于6岁需填此项
+     */
+    private String guardianName;
+
+    /**
+     * 监护人身份证,患者年龄小于6岁需填此项
+     */
+    private String guardianIdcardNum;
+
+    /**
+     * 陪伴医师姓名,患者年龄小于6岁需填此项
+     */
+    private String accompanyDocName;
+
+    /**
+     * 陪伴医师执业证号码,患者年龄小于6岁需填此项
+     */
+    private String accompanyCertificateNum;
+
+    /**
+     * 费别,1自费 2医保
+     */
+    private Integer feeType;
+
+    /**
+     * 患者简要病史描述,病史摘要
+     */
+    private String medicalHistory;
+
+    /**
+     * 处方日期,格式:YYYY-MM-DD HH:mm:ss
+     */
+    private String recipeTime;
+
+    /**
+     * 处方类型,1中药 2西药 3成药(三医)
+     */
+    private Integer recipeType;
+
+    /**
+     * 审方日期,格式:YYYY-MM-DD HH:mm:ss
+     */
+    private String reviewTime;
+
+    /**
+     * 处方单价,单位:元
+     */
+    private Double recipeUnitPrice;
+
+    /**
+     * 药品名称商品名,以|作为分隔,相同index位置的为一组数据
+     * 示例:"快克|板蓝根颗粒|阿莫西林胶囊"
+     */
+    private String drugName;
+
+    /**
+     * 药品编码
+     */
+    private String drugCode;
+
+    /**
+     * 药品通用名
+     */
+    private String drugCommonName;
+
+    /**
+     * 规格
+     */
+    private String specification;
+
+    /**
+     * 使用频度
+     * 示例:"2次/天|3次/天|3次/天"
+     */
+    private String frequency;
+
+    /**
+     * 用法
+     */
+    private String usage;
+
+    /**
+     * 剂量单位
+     */
+    private String doseUnit;
+
+    /**
+     * 每次剂量
+     */
+    private String doseEachTime;
+
+    /**
+     * 用药天数
+     */
+    private Double medicationDays;
+
+    /**
+     * 帖数
+     */
+    private Double packetNum;
+
+    /**
+     * 数量
+     */
+    private Double quantity;
+
+    /**
+     * 药品包装
+     */
+    private String drugPackage;
+
+    /**
+     * 处方总价,单位:元
+     */
+    private Double recipeAllPrice;
+
+    /**
+     * 是否经过合理用药判断标志,0 否 1 是
+     */
+    private Integer isRationalDrugUse;
+
+    /**
+     * 合理用药审核结果
+     */
+    private String rationalDrugUseReason;
+
+    /**
+     * 配送单位,配送药企、医院药房发药或药店名称
+     */
+    private String deliveryOrg;
+
+    /**
+     * 核销方式,0 医院取药 1物流配送 2药店取药 3自动失效
+     */
+    private Integer cancelAfterVerifyWay;
+
+    /**
+     * 处方核销状态,0未核销 1已核销
+     */
+    private Integer cancelAfterVerifyStatus;
+
+    /**
+     * 处方核销时间,物流配送、医院药房发药或药店自购时间、自动失效时间
+     */
+    private String cancelAfterVerifyTime;
+
+    /**
+     * 配送金额
+     */
+    private Double deliveryPrice;
+
+    /**
+     * 上传时间,格式:YYYY-MM-DD HH:mm:ss
+     */
+    private String uploadTime;
+
+    /**
+     * 医师ca签名订单id
+     */
+    private String docCaSignOrderId;
+
+    /**
+     * 医师ca签名值
+     */
+    private String docCaSign;
+
+    /**
+     * 医师ca签名时间,格式:YYYY-MM-DD HH:mm:ss
+     */
+    private String docCaSignTime;
+
+    /**
+     * 医师ca登录值
+     */
+    private String docCaLoginSign;
+
+    /**
+     * 医师ca登录时间,格式:YYYY-MM-DD HH:mm:ss
+     */
+    private String docCaLoginTime;
+
+    /**
+     * 药师ca签名订单id
+     */
+    private String pharmacistCaSignOrderId;
+
+    /**
+     * 药师ca签名值
+     */
+    private String pharmacistCaSign;
+
+    /**
+     * 药师ca签名时间,格式:YYYY-MM-DD HH:mm:ss
+     */
+    private String pharmacistCaSignTime;
+
+    /**
+     * 药师ca登录值
+     */
+    private String pharmacistCaLoginSign;
+
+    /**
+     * 药师ca登录时间,格式:YYYY-MM-DD HH:mm:ss
+     */
+    private String pharmacistCaLoginTime;
+
+    /**
+     * 医院处方编号
+     */
+    private String recipeNo;
+
+    /**
+     * 所在城市id(参考地区字段)
+     */
+    private String cityId;
+
+    /**
+     * 职称
+     */
+    private String jobTitle;
+}

+ 480 - 0
fs-admin/src/main/java/com/fs/his/task/NetMedicalService.java

@@ -0,0 +1,480 @@
+package com.fs.his.task;
+
+import cn.hutool.core.convert.Convert;
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.io.file.PathUtil;
+import cn.hutool.core.util.IdcardUtil;
+import cn.hutool.http.HttpRequest;
+import cn.hutool.http.HttpResponse;
+import cn.hutool.http.HttpUtil;
+import cn.hutool.json.JSONUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.fs.common.utils.file.ImageUtils;
+import com.fs.framework.interceptor.impl.SameUrlDataInterceptor;
+import com.fs.his.domain.FsInquiryOrderDTO;
+import com.fs.his.domain.FsPrescribeDrugDTO;
+import com.fs.his.dto.FsInquiryOrderPatientDTO;
+import com.fs.his.mapper.FsInquiryOrderMapper;
+import com.fs.his.mapper.FsPrescribeDrugMapper;
+import com.fs.his.param.FurtherConsultationParam;
+import com.fs.his.param.PrescriptionParam;
+import com.fs.his.service.IFsPrescribeService;
+import com.qiniu.util.Json;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.time.Instant;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.time.format.DateTimeFormatter;
+import java.util.*;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+
+/**
+ * 互联网医疗服务定时任务
+ * 润天推送参考:每天从中午12点到下午17点,每个小时的整点执行一次
+ */
+@Component("netMedicalService")
+@AllArgsConstructor
+@Slf4j
+public class NetMedicalService {
+
+    private final String prefix = "https://202.61.88.184:19200/";
+    private final String prescriptionPath = "wjw/upload/uploadRecipe";
+    private final String reconsultPath = "wjw/upload/uploadFurtherConsult";
+
+    private final IFsPrescribeService iFsPrescribeService;
+    private final FsPrescribeDrugMapper durgMapper;
+    private final FsInquiryOrderMapper inquiryOrderMapper;
+
+    public void uploadPrescription() {
+        log.info("互联网医疗服务定时任务启动,时间{}", LocalDateTime.now());
+
+        try {
+            // 1.抽取有生成电子处方and上传了首诊记录的数据
+            LocalDate today = LocalDate.now().minusDays(1);
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+            String date = today.format(formatter);
+
+            // 此任务准备在凌晨执行,上传前一天的电子处方。
+            List<Map<String, Object>> result = iFsPrescribeService.selectUploadDate("2025-09-21");//TODO:测试修改
+            log.info("查询到 {} 条待上传处方数据", result.size());
+
+            if (result.isEmpty()) {
+                log.info("没有需要上传的处方数据");
+                return;
+            }
+
+            List<PrescriptionParam> paramList = processPrescriptions(result);
+
+            uploadToRemoteService(paramList);
+
+        } catch (Exception e) {
+            log.error("上传处方任务执行失败", e);
+        }
+    }
+
+    /**
+     * 网络诊疗服务数据上传
+     * TODO:请求体太大,可能需要分批请求;
+     */
+    public void uploadReconsultDate() {
+        log.info("开始执行网络诊疗服务数据上传任务");
+
+        // 使用 DateTimeFormatter 替代 SimpleDateFormat
+        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
+        LocalDate today = LocalDate.now().minusDays(1);
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+        String date = today.format(formatter);
+
+        log.info("查询日期: {}", date);
+        List<FsInquiryOrderDTO> fsInquiryOrderDTOS = inquiryOrderMapper.selectNeedUploadData("2025-01-01");//TODO:测试修改
+        log.info("查询到需要上传的数据条数: {}", fsInquiryOrderDTOS.size());
+
+        ArrayList<FurtherConsultationParam> paramList = new ArrayList<>();
+        int successCount = 0;
+        int skipCount = 0;
+        int errorCount = 0;
+
+        for (int i = 0; i < fsInquiryOrderDTOS.size(); i++) {
+            FsInquiryOrderDTO fsInquiryOrder = fsInquiryOrderDTOS.get(i);
+            String orderSn = fsInquiryOrder.getOrderSn();
+
+            log.debug("正在处理第 {}/{} 条数据, 订单号: {}", i + 1, fsInquiryOrderDTOS.size(), orderSn);
+
+            try {
+                // 检查是否开具处方
+                int isPrescribe = iFsPrescribeService.selectPrescribeByinquiryOrderId(fsInquiryOrder.getOrderId());
+                log.debug("订单 {} 处方检查结果: {}", orderSn, isPrescribe > 0 ? "有处方" : "无处方");
+
+                String imageUrl = fsInquiryOrder.getReportImages();
+                if (imageUrl == null || imageUrl.trim().isEmpty()) {
+                    log.warn("订单 {} 报告图片URL为空,跳过处理", orderSn);
+                    skipCount++;
+                    continue;
+                }
+
+                log.debug("订单 {} 报告图片URL: {}", orderSn, imageUrl);
+
+                Integer supportedImageFormat = getSupportedImageFormat(imageUrl);
+                if (Objects.isNull(supportedImageFormat)) {
+                    log.warn("订单 {} 不支持的文件后缀,跳过处理,图片URL: {}", orderSn, imageUrl);
+                    skipCount++;
+                    continue;
+                }
+                log.debug("订单 {} 图片格式识别成功: {}", orderSn, supportedImageFormat);
+
+                byte[] image = ImageUtils.getImage(imageUrl);
+                if (image == null || image.length == 0) {
+                    log.warn("订单 {} 无法获取图片数据,图片URL: {}", orderSn, imageUrl);
+                    skipCount++;
+                    continue;
+                }
+                log.debug("订单 {} 成功获取图片数据,图片大小: {} bytes", orderSn, image.length);
+
+                String base64Image = Base64.getEncoder().encodeToString(image);
+                log.debug("订单 {} Base64编码完成,编码后长度: {}", orderSn, base64Image.length());
+
+                // 安全处理时间字段
+                String applyTime = formatDateTimeSafely(fsInquiryOrder.getCreateTime(), dateTimeFormatter);
+                String startTime = formatDateTimeSafely(fsInquiryOrder.getStartTime(), dateTimeFormatter);
+                String endTime = formatDateTimeSafely(fsInquiryOrder.getFinishTime(), dateTimeFormatter);
+                String uploadTime = LocalDateTime.now().format(dateTimeFormatter);//TODO:这个完成时间必须传,业务上判断是否需要未完结的复诊数据
+
+                if (applyTime == null || startTime == null || endTime == null) {
+                    log.warn("订单 {} 时间字段存在空值,跳过处理", orderSn);
+                    skipCount++;
+                    continue;
+                }
+
+                FurtherConsultationParam param = FurtherConsultationParam.builder()
+                        .thirdUniqueid(orderSn)
+                        .orgName(fsInquiryOrder.getHospitalName())
+                        .orgCode("组织结构代码")
+                        .channelName("平台名称")
+                        .section(fsInquiryOrder.getDeptName())
+                        .sectionCode(fsInquiryOrder.getDeptCode())
+                        .docName(fsInquiryOrder.getDoctorName())
+                        .certificateNum(fsInquiryOrder.getCertificateCode())
+                        .patientName(fsInquiryOrder.getPatientName())
+                        .patientAge(IdcardUtil.getAgeByIdCard(fsInquiryOrder.getIdCard()))
+                        .patientSex(fsInquiryOrder.getSex())
+                        .patientIdcardType(1)
+                        .patientIdcardNum(fsInquiryOrder.getIdCard())
+                        .furtherConsultNo(orderSn)
+                        .furtherConsulType(1)
+                        .medicalHistory(fsInquiryOrder.getSelfMedHistory())
+                        .furtherConsultApplyTime(applyTime)
+                        .furtherConsulStartTime(startTime)
+                        .furtherConsulEndTime(endTime)
+                        .furtherConsulIsReply(1)
+                        .feeType(1)
+                        .furtherConsultDiagnosis(fsInquiryOrder.getInquiryResult())
+                        .furtherConsultDiagnosisNo("复诊icd诊断编码")
+                        .furtherConsultPrice(fsInquiryOrder.getMoney().toBigInteger().doubleValue())
+                        .patientEvaluate(1)
+                        .complainInfo("")
+                        .disposeResult("")
+                        .isRiskWarn(1)
+                        .isPatientSign(1)
+                        .isPrescription(isPrescribe > 0 ? 1 : 0)
+                        .uploadTime(uploadTime)
+                        .consultDiagnosisType(supportedImageFormat)
+                        .consultOrg("首诊机构")
+                        .consultDiagnosis(base64Image)
+                        .cityId("")
+                        .isMark("1")
+                        .build();
+
+                paramList.add(param);
+                successCount++;
+                log.debug("订单 {} 参数构建完成,已添加到上传列表", orderSn);
+
+            } catch (Exception e) {
+                errorCount++;
+                log.error("处理订单 {} 时发生异常: {}", orderSn, e.getMessage(), e);
+            }
+        }
+
+        log.info("数据处理完成 - 成功: {}条, 跳过: {}条, 异常: {}条", successCount, skipCount, errorCount);
+
+        if (paramList.isEmpty()) {
+            log.info("没有需要上传的数据,任务结束");
+            return;
+        }
+
+        try {
+            String jsonParam = JSON.toJSONString(paramList);
+            log.info("准备上传数据,参数条数: {}", paramList.size());
+//            log.debug("请求参数JSON: {}", jsonParam);
+
+            String urlPath = prefix + reconsultPath;
+            log.info("请求URL: {}", urlPath);
+
+            HttpRequest post = HttpUtil.createPost(urlPath);
+            post.body(jsonParam, "application/json; charset=utf-8");
+
+            log.info("开始发送HTTP请求...");
+            long startTime = System.currentTimeMillis();
+            HttpResponse response = post.execute();
+            long endTime = System.currentTimeMillis();
+
+            log.info("HTTP请求完成,状态码: {}, 耗时: {}ms", response.getStatus(), endTime - startTime);
+
+            if (response.isOk()) {
+                String responseBody = response.body();
+                log.info("上传成功,响应内容: {}", responseBody);
+
+                // 可以在这里添加响应结果解析和业务逻辑判断
+                try {
+                    JSONObject responseJson = JSON.parseObject(responseBody);
+                    if (responseJson != null) {
+                        String code = responseJson.getString("status");
+                        String message = responseJson.getString("message");
+                        log.info("响应解析 - 状态码: {}, 消息: {}", code, message);
+                    }
+                } catch (Exception e) {
+                    log.warn("响应内容解析失败: {}", e.getMessage());
+                }
+            } else {
+                log.error("上传失败,状态码: {}, 响应内容: {}", response.getStatus(), response.body());
+            }
+
+        } catch (Exception e) {
+            log.error("数据上传过程中发生异常: {}", e.getMessage(), e);
+        }
+        log.info("网络诊疗服务数据上传任务执行完毕");
+    }
+
+    private List<PrescriptionParam> processPrescriptions(List<Map<String, Object>> prescriptions) {
+        List<PrescriptionParam> paramList = new ArrayList<>();
+
+        for (Map<String, Object> prescribe : prescriptions) {
+            try {
+                PrescriptionParam param = processSinglePrescription(prescribe);
+                if (param != null) {
+                    paramList.add(param);
+                }
+            } catch (Exception e) {
+                log.error("处理处方失败, prescribe_id: {}", prescribe.get("prescribe_id"), e);
+            }
+        }
+
+        log.info("成功处理 {} 个处方", paramList.size());
+        return paramList;
+    }
+
+    private PrescriptionParam processSinglePrescription(Map<String, Object> prescribe) {
+        Long prescribeId = Convert.toLong(prescribe.get("prescribe_id"));
+        if (prescribeId == null) {
+            log.warn("处方ID为空,跳过处理");
+            return null;
+        }
+
+        // 药品信息查询
+        List<FsPrescribeDrugDTO> drugs = durgMapper.selectDrugList(prescribeId);
+        if (drugs == null || drugs.isEmpty()) {
+            log.warn("处方 {} 没有药品信息,跳过处理", prescribeId);
+            return null;
+        }
+
+        // 计算总量
+        Double quantity = calculateTotalQuantity(drugs);
+        Double days = calculateTotalDays(drugs);
+
+        // 组装药品信息
+        Map<String, String> drugInfoMap = buildDrugInfoMap(drugs);
+
+        // 构建处方参数
+        return buildPrescriptionParam(prescribe, drugInfoMap, quantity, days);
+    }
+
+    private Double calculateTotalQuantity(List<FsPrescribeDrugDTO> drugs) {
+        return drugs.stream().map(FsPrescribeDrugDTO::getDrugNum).filter(Objects::nonNull).mapToDouble(Convert::toDouble).sum();
+    }
+
+    private Double calculateTotalDays(List<FsPrescribeDrugDTO> drugs) {
+        return drugs.stream().map(FsPrescribeDrugDTO::getUsageDays).filter(Objects::nonNull).mapToDouble(Convert::toDouble).sum();
+    }
+
+    private Map<String, String> buildDrugInfoMap(List<FsPrescribeDrugDTO> drugs) {
+        Map<String, String> resultMap = new HashMap<>();
+        resultMap.put("drugName", join(drugs, FsPrescribeDrugDTO::getDrugName));
+        resultMap.put("specification", join(drugs, FsPrescribeDrugDTO::getDrugSpec));
+        resultMap.put("frequency", join(drugs, FsPrescribeDrugDTO::getUsageFrequencyUnit));
+        resultMap.put("useMethod", join(drugs, FsPrescribeDrugDTO::getUsageMethod));
+        resultMap.put("usagePerUseUnit", join(drugs, FsPrescribeDrugDTO::getUsagePerUseUnit));
+        resultMap.put("drugCode", join(drugs, FsPrescribeDrugDTO::getBarCode));
+        resultMap.put("doseEachTime", join(drugs, FsPrescribeDrugDTO::getUsagePerUseCount)); // 修复类型
+        return resultMap;
+    }
+
+    private PrescriptionParam buildPrescriptionParam(Map<String, Object> prescribe, Map<String, String> drugInfoMap, Double quantity, Double days) {
+        return PrescriptionParam.builder()
+                .thirdUniqueid(getString(prescribe, "prescribe_code"))
+                .orgName(getString(prescribe, "hospital_name"))
+                .orgCode("机构编码") // TODO: 不晓得从哪取
+                .section(getString(prescribe, "dept_name"))
+                .sectionCode(getString(prescribe, "dept_code"))
+                .docName(getString(prescribe, "doctor_name"))
+                .docCertificateNum(getString(prescribe, "certificate_code"))
+                .pharmacistName(getString(prescribe, "doctor_drug_name"))
+                .pharmacistCertificateNum(getString(prescribe, "doctor_drug_code"))
+                .patientName(getString(prescribe, "patient_name"))
+                .patientSex(getString(prescribe, "patient_gender"))
+                .patientAge(getInteger(prescribe, "patient_age"))
+                .patientIdcardType(1)
+                .feeType(1)
+                .patientIdcardNum(getString(prescribe, "id_card"))
+                .recipeTime(getString(prescribe, "create_time"))
+                .reviewTime(getString(prescribe, "create_time"))
+                .recipeUnitPrice(getDouble(prescribe, "total_price"))
+                .drugName(drugInfoMap.get("drugName"))
+                .drugCode(drugInfoMap.get("drugCode"))
+                .drugCommonName(drugInfoMap.get("drugName"))
+                .specification(drugInfoMap.get("specification"))
+                .frequency(drugInfoMap.get("frequency"))
+                .usage(drugInfoMap.get("useMethod"))
+                .doseUnit(drugInfoMap.get("usagePerUseUnit"))
+                .doseEachTime(drugInfoMap.get("doseEachTime"))
+                .medicationDays(days)
+                .quantity(quantity)
+                .drugPackage("药品包装") // TODO: 不晓得去哪取
+                .recipeAllPrice(getDouble(prescribe, "total_price"))
+                .uploadTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")))
+                .recipeNo(getString(prescribe, "prescribe_code"))
+                .cityId("") // TODO: 没有对应字典
+                .build();
+    }
+
+    private void uploadToRemoteService(List<PrescriptionParam> paramList) {
+        if (paramList.isEmpty()) {
+            log.info("没有需要上传的数据");
+            return;
+        }
+
+        try {
+            String url = prefix + prescriptionPath;
+            log.info("开始上传 {} 个处方到: {}", paramList.size(), url);
+
+            HttpRequest post = HttpUtil.createPost(url);
+            String requestBody = JSON.toJSONString(paramList);
+            log.debug("上传数据: {}", requestBody);//很大一坨
+
+            post.body(requestBody);
+            HttpResponse response = post.execute();
+
+//            log.info("上传完成,响应状态: {}", response.getStatus());
+            log.info("响应内容: {}", JSON.toJSONString(response));
+
+        } catch (Exception e) {
+            log.error("上传处方数据到远程服务失败", e);
+            throw new RuntimeException("上传失败", e);
+        }
+    }
+
+    // 工具方法
+    private String getString(Map<String, Object> map, String key) {
+        Object value = map.get(key);
+        return value != null ? value.toString() : "";
+    }
+
+    private Integer getInteger(Map<String, Object> map, String key) {
+        try {
+            Object value = map.get(key);
+            return value != null ? Integer.valueOf(value.toString()) : 0;
+        } catch (NumberFormatException e) {
+            log.warn("字段 {} 转换整数失败, 使用默认值0", key);
+            return 0;
+        }
+    }
+
+    private Double getDouble(Map<String, Object> map, String key) {
+        try {
+            Object value = map.get(key);
+            return value != null ? Double.valueOf(value.toString()) : 0.0;
+        } catch (NumberFormatException e) {
+            log.warn("字段 {} 转换浮点数失败, 使用默认值0.0", key);
+            return 0.0;
+        }
+    }
+
+    private String join(List<FsPrescribeDrugDTO> drugs, Function<FsPrescribeDrugDTO, String> fieldExtractor) {
+        return drugs.stream().map(fieldExtractor).filter(Objects::nonNull).filter(str -> !str.trim().isEmpty()).collect(Collectors.joining("|"));
+    }
+
+    /**
+     * 获取图片格式(只支持jpg、png、bmp)
+     *
+     * @param imagePath 图片路径
+     * @return 图片格式(jpeg, png, bmp),如果不支持则返回null
+     */
+    public static Integer getSupportedImageFormat(String imagePath) {
+        if (imagePath == null || imagePath.trim().isEmpty()) {
+            return null;
+        }
+
+        // 处理URL参数
+        String cleanPath = imagePath.split("[?#]")[0];
+
+        // 获取扩展名
+        String extension = "";
+        int lastDotIndex = cleanPath.lastIndexOf('.');
+        if (lastDotIndex > 0 && lastDotIndex < cleanPath.length() - 1) {
+            extension = cleanPath.substring(lastDotIndex + 1).toLowerCase();
+        }
+
+        // 只支持三种格式
+        switch (extension) {
+            case "jpg":
+            case "jpeg":
+                return 2;
+            case "png":
+                return 3;
+            case "bmp":
+                return 4;
+            default:
+                return null; // 不支持的格式返回null
+        }
+    }
+
+    /**
+     * 安全格式化时间方法,处理各种时间类型
+     */
+    private String formatDateTimeSafely(Object dateTime, DateTimeFormatter formatter) {
+        if (dateTime == null) {
+            log.warn("时间字段为null");
+            return null;
+        }
+
+        try {
+            if (dateTime instanceof java.util.Date) {
+                // 转换 java.util.Date 到 LocalDateTime
+                Instant instant = ((java.util.Date) dateTime).toInstant();
+                return LocalDateTime.ofInstant(instant, ZoneId.systemDefault()).format(formatter);
+            } else if (dateTime instanceof java.sql.Timestamp) {
+                // 转换 java.sql.Timestamp 到 LocalDateTime
+                return ((java.sql.Timestamp) dateTime).toLocalDateTime().format(formatter);
+            } else if (dateTime instanceof LocalDateTime) {
+                // 直接格式化 LocalDateTime
+                return ((LocalDateTime) dateTime).format(formatter);
+            } else if (dateTime instanceof LocalDate) {
+                // 处理 LocalDate,添加时间部分
+                return ((LocalDate) dateTime).atStartOfDay().format(formatter);
+            } else {
+                log.warn("不支持的时间类型: {}", dateTime.getClass().getName());
+                return null;
+            }
+        } catch (Exception e) {
+            log.error("时间格式化失败: {}, 原始值: {}", e.getMessage(), dateTime);
+            return null;
+        }
+    }
+}

+ 46 - 0
fs-admin/src/main/java/com/fs/live/aspectj/LiveControllerAspect.java

@@ -0,0 +1,46 @@
+package com.fs.live.aspectj;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.fs.live.domain.Live;
+import com.fs.live.service.ILiveService;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.AfterReturning;
+import org.aspectj.lang.annotation.Aspect;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Aspect
+@Component
+public class LiveControllerAspect {
+
+    private static final Logger logger = LoggerFactory.getLogger(LiveControllerAspect.class);
+
+    @Autowired
+    private ILiveService liveService;
+
+    @AfterReturning(pointcut = "execution(* com.fs.live.controller.LiveController.add(..)) || " +
+            "execution(* com.fs.live.controller.LiveController.finishLive(..)) || " +
+            "execution(* com.fs.live.controller.LiveController.handleDeleteSelected(..)) || " +
+            "execution(* com.fs.live.controller.LiveController.handleShelfOrUn(..)) || " +
+            "execution(* com.fs.live.controller.LiveController.edit(..)) || " +
+            "execution(* com.fs.live.controller.LiveController.copyLive(..)) || " +
+            "execution(* com.fs.live.controller.LiveController.startLive(..)) || " +
+            "execution(* com.fs.live.controller.LiveController.updateLiveIsAudit(..)) || " +
+            "execution(* com.fs.live.controller.LiveController.remove(..)) " ,
+            returning = "result")
+    public void afterLiveControllerMethodExecution(JoinPoint joinPoint,Object result) {
+        String methodName = joinPoint.getSignature().getName();
+        Object[] args = joinPoint.getArgs();
+        liveService.asyncToCache();
+        if (args[0] instanceof Live) {
+            Live live = (Live) args[0];
+            if (ObjectUtil.isNotEmpty(live) && ObjectUtil.isNotEmpty(live.getLiveId())){
+                liveService.asyncToCacheLiveDetail(live.getLiveId());
+            }
+        }
+        logger.info("后台直播间列表变更");
+
+    }
+}

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

@@ -0,0 +1,183 @@
+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 com.github.pagehelper.PageHelper;
+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(LiveAfterSalesVo liveAfterSales)
+    {
+        PageHelper.clearPage();
+        PageHelper.startPage(1, 10000, "");
+        List<LiveAfterSalesVo> list = liveAfterSalesService.selectLiveAfterSalesVoList(liveAfterSales);
+        for (LiveAfterSalesVo liveAfterSalesVo : list) {
+            liveAfterSalesVo.setUserPhone(liveAfterSalesVo.getUserPhone() == null ? "" : liveAfterSalesVo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+            liveAfterSalesVo.setPhoneNumber(liveAfterSalesVo.getPhoneNumber() == null ? "" : liveAfterSalesVo.getPhoneNumber().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+        }
+        ExcelUtil<LiveAfterSalesVo> util = new ExcelUtil<LiveAfterSalesVo>(LiveAfterSalesVo.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
  */

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

@@ -0,0 +1,227 @@
+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('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:list')")
+    @GetMapping("/consoleList")
+    public TableDataInfo consoleList(LiveAutoTask liveAutoTask)
+    {
+        startPage();
+        // 大屏查询后面20条数据
+        List<LiveAutoTask> list = liveAutoTaskService.consoleList(liveAutoTask.getLiveId());
+        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('live:task:list')")
+    @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);
+    }
+
+
 }

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

@@ -0,0 +1,223 @@
+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:list')")
+    @GetMapping("/listOn")
+    public TableDataInfo listOn(@RequestParam("liveId") Long liveId)
+    {
+        startPage();
+        List<LiveCoupon> list = liveCouponService.listOn(liveId);
+        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:issue:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveCouponIssueUser liveCouponIssueUser)
+    {
+        startPage();
+        List<LiveCouponIssueUser> list = liveCouponIssueUserService.selectLiveCouponIssueUserList(liveCouponIssueUser);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出优惠券用户领取记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:issue: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:issue:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(liveCouponIssueUserService.selectLiveCouponIssueUserById(id));
+    }
+
+    /**
+     * 新增优惠券用户领取记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:issue:add')")
+    @Log(title = "优惠券用户领取记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveCouponIssueUser liveCouponIssueUser)
+    {
+        return toAjax(liveCouponIssueUserService.insertLiveCouponIssueUser(liveCouponIssueUser));
+    }
+
+    /**
+     * 修改优惠券用户领取记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:issue:edit')")
+    @Log(title = "优惠券用户领取记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveCouponIssueUser liveCouponIssueUser)
+    {
+        return toAjax(liveCouponIssueUserService.updateLiveCouponIssueUser(liveCouponIssueUser));
+    }
+
+    /**
+     * 删除优惠券用户领取记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:issue: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:issue:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveCouponUser liveCouponUser)
+    {
+        startPage();
+        List<LiveCouponUser> list = liveCouponUserService.selectLiveCouponUserList(liveCouponUser);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出优惠券发放记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:issue: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:issue:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(liveCouponUserService.selectLiveCouponUserById(id));
+    }
+
+    /**
+     * 新增优惠券发放记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:issue:add')")
+    @Log(title = "优惠券发放记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveCouponUser liveCouponUser)
+    {
+        return toAjax(liveCouponUserService.insertLiveCouponUser(liveCouponUser));
+    }
+
+    /**
+     * 修改优惠券发放记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:issue:edit')")
+    @Log(title = "优惠券发放记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveCouponUser liveCouponUser)
+    {
+        return toAjax(liveCouponUserService.updateLiveCouponUser(liveCouponUser));
+    }
+
+    /**
+     * 删除优惠券发放记录
+     */
+    @PreAuthorize("@ss.hasPermi('live:issue:remove')")
+    @Log(title = "优惠券发放记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(liveCouponUserService.deleteLiveCouponUserByIds(ids));
+    }
+}

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

@@ -0,0 +1,100 @@
+package com.fs.live.controller;
+
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.utils.SecurityUtils;
+import com.fs.live.domain.LiveData;
+import com.fs.live.service.ILiveDataService;
+import com.fs.live.vo.LiveUserFirstVo;
+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;
+
+
+@RestController
+@RequestMapping("/live/liveData")
+public class LiveDataController extends BaseController {
+
+    @Autowired
+    private ILiveDataService liveDataService;
+
+    /**
+     * 直播数据页面卡片数据
+     */
+    @GetMapping("/dashboardData")
+    public R dashboardData(@RequestParam Long liveId, HttpServletRequest request) {
+        return liveDataService.dashboardData(liveId);
+    }
+
+    /**
+     * 直播数据页面 分页查询邀请榜单
+     */
+    @GetMapping("/dashboardInviteList")
+    public TableDataInfo inviteList(@RequestParam Long liveId, HttpServletRequest request) {
+        startPage();
+        List<LiveUserFirstVo> list = liveDataService.inviteList(liveId);
+        return getDataTable(list);
+    }
+
+    /**
+     * 查询直播数据列表
+     * */
+    @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));
+    }
+}

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

@@ -1,30 +1,33 @@
 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.hisStore.service.IFsStoreProductScrmService;
+import com.fs.hisStore.vo.FsStoreProductListVO;
 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.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
+ * @date 2025-07-08
  */
 @RestController
 @RequestMapping("/live/liveGoods")
@@ -33,26 +36,37 @@ public class LiveGoodsController extends BaseController
     @Autowired
     private ILiveGoodsService liveGoodsService;
 
+    @Autowired
+    private IFsStoreProductScrmService fsStoreProductService;
+
+
     /**
      * 查询直播商品列表
      */
-    @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 +75,107 @@ 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('store:storeProduct:list')")
+    @GetMapping("/liveList")
+    public TableDataInfo liveList(LiveGoods liveGoods)
+    {
+        startPage();
+        List<FsStoreProductListVO> list = fsStoreProductService.liveList(liveGoods);
+        return getDataTable(list);
+    }
+
+    /**
+     * 获取直播店铺
+     * */
+//    @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));
-    }
-}

+ 326 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveHealthOrderController.java

@@ -0,0 +1,326 @@
+package com.fs.live.controller;
+
+import cn.hutool.core.bean.BeanUtil;
+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.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.CloudHostUtils;
+import com.fs.common.utils.StringUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.his.domain.FsStoreOrderDf;
+import com.fs.his.vo.FsStoreOrderListAndStatisticsVo;
+import com.fs.hisStore.dto.StoreOrderProductDTO;
+import com.fs.hisStore.param.FsStoreOrderParam;
+import com.fs.hisStore.vo.FsStoreOrderErpExportVO;
+import com.fs.hisStore.vo.FsStoreOrderExportVO;
+import com.fs.hisStore.vo.FsStoreOrderItemExportVO;
+import com.fs.live.domain.LiveOrderDf;
+import com.fs.live.dto.LiveOrderDeliveryNoteDTO;
+import com.fs.live.param.LiveOrderParam;
+import com.fs.live.service.ILiveOrderDfService;
+import com.fs.live.service.ILiveOrderItemService;
+import com.fs.live.service.ILiveOrderService;
+import com.fs.live.vo.LiveOrderErpExportVO;
+import com.fs.live.vo.LiveOrderItemExportVO;
+import com.fs.live.vo.LiveOrderListAndStatisticsVo;
+import com.fs.live.vo.LiveOrderVO;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**`
+ * 订单Controller
+ *
+ * @author fs
+ * @date 2025-07-08
+ */
+@RestController
+@RequestMapping("/live/liveOrder")
+public class LiveHealthOrderController extends BaseController {
+
+    @Autowired
+    private ILiveOrderService liveOrderService;
+    @Autowired
+    private ILiveOrderItemService orderItemService;
+
+    @Autowired
+    private ILiveOrderDfService liveOrderDfService;
+
+    @PreAuthorize("@ss.hasPermi('store:healthStoreOrder:exportItems:details')")
+    @Log(title = "商城订单明细导出", businessType = BusinessType.EXPORT)
+    @GetMapping("/healthExportItemsDetails")
+    public AjaxResult healthExportItemsDetails(LiveOrderParam param) {
+        if ("".equals(param.getBeginTime()) && "".equals(param.getEndTime())){
+            param.setBeginTime(null);
+            param.setEndTime(null);
+        }
+        if (liveOrderService.isEntityNull(param)){
+            return AjaxResult.error("请筛选数据导出");
+        }
+        if(!StringUtils.isEmpty(param.getCreateTimeRange())){
+            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getPayTimeRange())){
+            param.setPayTimeList(param.getPayTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliverySendTimeRange())){
+            param.setDeliverySendTimeList(param.getDeliverySendTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
+            param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
+        }
+        param.setIsHealth("1");
+        List<LiveOrderItemExportVO> list = orderItemService.selectLiveOrderItemListExportVO(param);
+        //对手机号脱敏
+        if (list != null) {
+            for (LiveOrderItemExportVO vo : list) {
+                if (!StringUtils.isEmpty(vo.getJsonInfo())) {
+                    try {
+                        StoreOrderProductDTO orderProductDTO = JSONObject.parseObject(vo.getJsonInfo(), StoreOrderProductDTO.class);
+                        BeanUtil.copyProperties(orderProductDTO, vo);
+                    } catch (Exception e) {
+                    }
+                }
+            }
+        }
+        ExcelUtil<LiveOrderItemExportVO> util = new ExcelUtil<LiveOrderItemExportVO>(LiveOrderItemExportVO.class);
+        return util.exportExcel(list, "订单明细数据");
+    }
+
+
+    /**
+     * 导出健康商城列表(明文)
+     */
+    @PreAuthorize("@ss.hasPermi('store:healthStoreOrder:export:details')")
+    @Log(title = "健康商城订单", businessType = BusinessType.EXPORT)
+    @PostMapping("/healthExportDetails")
+    public AjaxResult healthExportDetails(@RequestBody LiveOrderParam param) {
+        if ("".equals(param.getBeginTime()) && "".equals(param.getEndTime())){
+            param.setBeginTime(null);
+            param.setEndTime(null);
+        }
+        if (liveOrderService.isEntityNull(param)){
+            return AjaxResult.error("请筛选数据导出");
+        }
+        if(!StringUtils.isEmpty(param.getCreateTimeRange())){
+            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getPayTimeRange())){
+            param.setPayTimeList(param.getPayTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliverySendTimeRange())){
+            param.setDeliverySendTimeList(param.getDeliverySendTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
+            param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
+        }
+        param.setIsHealth("1");
+        List<LiveOrderErpExportVO> list = liveOrderService.selectLiveOrderListVOByExport(param);
+        String filter = param.getFilter();
+        // 1. 处理filter参数:将逗号分隔的字符串拆分为ArrayList<String>
+        ArrayList<String> filterList = new ArrayList<>();
+        if (StringUtils.isNotBlank(filter)) {
+            // 按逗号拆分,同时去除可能的空格(如filter传"orderId, orderCode"时兼容)
+            String[] filterArr = filter.split("\\s*,\\s*");
+            filterList.addAll(Arrays.asList(filterArr));
+        }
+        // 动态导出:根据选中的字段生成Excel
+        ExcelUtil<LiveOrderErpExportVO> util = new ExcelUtil<LiveOrderErpExportVO>(LiveOrderErpExportVO.class);
+        AjaxResult result;
+        // 如果有选中的字段,只导出这些字段
+        if (filter != null && !filter.isEmpty()) {
+            return util.exportExcelSelectedColumns(list, "订单数据", filterList);
+        } else {
+            // 导出所有字段
+            return util.exportExcel(list, "订单数据");
+        }
+    }
+
+    /**
+     * 导出健康商城列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:healthLiveOrder:export')")
+    @Log(title = "健康商城订单", businessType = BusinessType.EXPORT)
+    @PostMapping("/healthExport")
+    public AjaxResult export1(@RequestBody LiveOrderParam param) {
+        if ("".equals(param.getBeginTime()) && "".equals(param.getEndTime())){
+            param.setBeginTime(null);
+            param.setEndTime(null);
+        }
+        if (liveOrderService.isEntityNull(param)){
+            return AjaxResult.error("请筛选数据导出");
+        }
+        if(!StringUtils.isEmpty(param.getCreateTimeRange())){
+            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getPayTimeRange())){
+            param.setPayTimeList(param.getPayTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliverySendTimeRange())){
+            param.setDeliverySendTimeList(param.getDeliverySendTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
+            param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
+        }
+        param.setIsHealth("1");
+        List<LiveOrderErpExportVO> list = liveOrderService.selectLiveOrderListVOByExport(param);
+        //对手机号脱敏
+        if (list != null) {
+            for (LiveOrderErpExportVO vo : list) {
+                if (vo.getPhone() != null) {
+                    vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+                if (vo.getUserPhone() != null) {
+                    vo.setUserPhone(vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+
+            }
+        }
+        String filter = param.getFilter();
+        // 1. 处理filter参数:将逗号分隔的字符串拆分为ArrayList<String>
+        ArrayList<String> filterList = new ArrayList<>();
+        if (StringUtils.isNotBlank(filter)) {
+            // 按逗号拆分,同时去除可能的空格(如filter传"orderId, orderCode"时兼容)
+            String[] filterArr = filter.split("\\s*,\\s*");
+            filterList.addAll(Arrays.asList(filterArr));
+        }
+        // 动态导出:根据选中的字段生成Excel
+        ExcelUtil<LiveOrderErpExportVO> util = new ExcelUtil<LiveOrderErpExportVO>(LiveOrderErpExportVO.class);
+        AjaxResult result;
+        // 如果有选中的字段,只导出这些字段
+        if (filter != null && !filter.isEmpty()) {
+            return util.exportExcelSelectedColumns(list, "订单数据", filterList);
+        } else {
+            // 导出所有字段
+            return util.exportExcel(list, "订单数据");
+        }
+    }
+
+    /**
+     * 查询健康商城订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:healthLiveOrder:list')")
+    @PostMapping("/healthList")
+    public TableDataInfo healthStoreList(@RequestBody LiveOrderParam param) {
+        startPage();
+        if(!StringUtils.isEmpty(param.getCreateTimeRange())){
+            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getPayTimeRange())){
+            param.setPayTimeList(param.getPayTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
+            param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliverySendTimeRange())){
+            param.setDeliverySendTimeList(param.getDeliverySendTimeRange().split("--"));
+        }
+        param.setIsHealth("1");
+        List<LiveOrderVO> list = liveOrderService.selectLiveOrderListVO(param);
+        //金牛需求 区别其他项目 status = 6 (金牛代服管家) ,其他项目请避免使用订单状态status = 6
+        TableDataInfo dataTable = getDataTable(list);
+        if (CloudHostUtils.hasCloudHostName("康年堂")){
+            dataTable.setMsg("knt");
+        }
+        if (list != null) {
+            for (LiveOrderVO vo : list) {
+                if(vo.getPhone()!=null){
+                    vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                    vo.setUserPhone(vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+                if (CloudHostUtils.hasCloudHostName("康年堂")){
+                    //查询顺丰代服账号
+                    LiveOrderDf df = liveOrderDfService.selectLiveOrderDfByOrderId(vo.getId());
+                    if (df != null){
+                        vo.setErpAccount(df.getLoginAccount());
+                    }
+                }
+
+            }
+        }
+        LiveOrderListAndStatisticsVo vo = new LiveOrderListAndStatisticsVo();
+        BeanUtils.copyProperties(dataTable, vo);
+        if (dataTable.getTotal()>0){
+            Map<String, BigDecimal> statistics= liveOrderService.selectLiveOrderStatistics(param);
+            if (statistics != null && statistics.size() >= 3){
+                vo.setPayPriceTotal(statistics.get("pay_price").toString());
+                vo.setPayMoneyTotal(statistics.get("pay_money").toString());
+                vo.setPayRemainTotal(statistics.get("pay_remain").toString());
+            }else {
+                vo.setPayPriceTotal("0");
+                vo.setPayMoneyTotal("0");
+                vo.setPayRemainTotal("0");
+            }
+            //商品数量合计
+            String productStatistics= liveOrderService.selectLiveOrderProductStatistics(param);
+            if (StringUtils.isNotBlank(productStatistics)){
+                vo.setProductInfo(productStatistics);
+            } else {
+                vo.setProductInfo("");
+            }
+
+        }
+        return vo;
+    }
+
+    @PreAuthorize("@ss.hasPermi('live:healthLiveOrder:exportItems')")
+    @Log(title = "直播订单明细导出", businessType = BusinessType.EXPORT)
+    @GetMapping("/healthExportItems")
+    public AjaxResult exportItems1(LiveOrderParam param) {
+        if ("".equals(param.getBeginTime()) && "".equals(param.getEndTime())){
+            param.setBeginTime(null);
+            param.setEndTime(null);
+        }
+        if (liveOrderService.isEntityNull(param)){
+            return AjaxResult.error("请筛选数据导出");
+        }
+        if(!StringUtils.isEmpty(param.getCreateTimeRange())){
+            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getPayTimeRange())){
+            param.setPayTimeList(param.getPayTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliverySendTimeRange())){
+            param.setDeliverySendTimeList(param.getDeliverySendTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
+            param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
+        }
+        param.setIsHealth("1");
+        List<LiveOrderItemExportVO> list = orderItemService.selectLiveOrderItemListExportVO(param);
+        //对手机号脱敏
+        if (list != null) {
+            for (LiveOrderItemExportVO vo : list) {
+                if (vo.getUserPhone() != null) {
+                    String phone = vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{1})", "$1****$2");
+                    vo.setUserPhone(phone);
+                }
+                if (!StringUtils.isEmpty(vo.getJsonInfo())) {
+                    try {
+                        StoreOrderProductDTO orderProductDTO = JSONObject.parseObject(vo.getJsonInfo(), StoreOrderProductDTO.class);
+                        BeanUtil.copyProperties(orderProductDTO, vo);
+                    } catch (Exception e) {
+                    }
+                }
+            }
+        }
+        ExcelUtil<LiveOrderItemExportVO> util = new ExcelUtil<LiveOrderItemExportVO>(LiveOrderItemExportVO.class);
+        return util.exportExcel(list, "订单明细数据");
+    }
+
+    @GetMapping("/importDeliveryNoteExpressTemplate")
+    public AjaxResult importTemplate() {
+        ExcelUtil<LiveOrderDeliveryNoteDTO> util = new ExcelUtil<>(LiveOrderDeliveryNoteDTO.class);
+        return util.importTemplateExcel("订单发货导入模板");
+    }
+}

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

+ 22 - 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)
     {
@@ -45,10 +39,18 @@ public class LiveMsgController extends BaseController
         return getDataTable(list);
     }
 
+    @GetMapping("/singleList")
+    public TableDataInfo singleList(LiveMsg liveMsg)
+    {
+        startPage();
+        List<LiveMsg> list = liveMsgService.selectLiveMsgSingleList(liveMsg);
+        return getDataTable(list);
+    }
+
     /**
      * 导出直播讨论列表
      */
-    @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 +63,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 +73,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 +84,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 +95,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)

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

@@ -0,0 +1,657 @@
+package com.fs.live.controller;
+
+import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.JSON;
+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.FsDfAccount;
+import com.fs.his.domain.FsStoreOrderDf;
+import com.fs.his.domain.FsUser;
+import com.fs.his.enums.FsStoreOrderLogEnum;
+import com.fs.his.service.IFsDfAccountService;
+import com.fs.his.service.IFsExpressService;
+import com.fs.his.service.IFsUserService;
+import com.fs.hisStore.dto.StoreOrderExpressExportDTO;
+import com.fs.hisStore.param.*;
+import com.fs.hisStore.vo.FsStoreOrderVO;
+import com.fs.live.domain.*;
+import com.fs.live.dto.LiveOrderExpressExportDTO;
+import com.fs.live.enums.LiveOrderCancleReason;
+import com.fs.live.param.LiveOrderScrmSetErpPhoneParam;
+import com.fs.live.service.*;
+import com.fs.live.vo.LiveGoodsVo;
+import com.fs.live.vo.LiveOrderPaymentVo;
+import com.fs.live.vo.LiveOrderTimeVo;
+import com.fs.live.vo.LiveOrderVO;
+import com.fs.store.domain.FsStoreDelivers;
+import com.fs.system.domain.SysConfig;
+import com.fs.system.mapper.SysConfigMapper;
+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.text.ParseException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+
+/**`
+ * 订单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;
+
+
+    @Autowired
+    private IFsDfAccountService fsDfAccountService;
+
+    @Autowired
+    SysConfigMapper sysConfigMapper;
+
+    @Autowired
+    private ILiveOrderDfService liveOrderDfService;
+
+
+    @GetMapping("/importTemplate")
+    public AjaxResult importTemplate() {
+        ExcelUtil<LiveOrderExpressExportDTO> util = new ExcelUtil<LiveOrderExpressExportDTO>(LiveOrderExpressExportDTO.class);
+        return util.importTemplateExcel("物流回单数据");
+    }
+
+    /**
+     * 查询订单列表
+     */
+    @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(LiveOrderTimeVo 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("未查询到快递信息");
+    }
+
+    /**
+     * 删除订单
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:remove')")
+    @Log(title = "订单", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(liveOrderService.deleteLiveOrderByIds(ids));
+    }
+
+    /**
+     * 获取erp账户
+     */
+    @GetMapping("/getErpAccount")
+    public R getErpAccount()
+    {
+        List<FsDfAccount> erpAccounts = fsDfAccountService.selectFsDfAccountList(null);
+        List<String> list = erpAccounts.stream().map(FsDfAccount::getLoginAccount).collect(Collectors.toList());
+        return R.ok().put("data", list);
+    }
+
+    /**
+     * 查询erp默认手机号
+     * @return
+     */
+    @GetMapping(value = "/queryErpPhone")
+    public AjaxResult queryErpPhone()
+    {
+        SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("erp.phone");
+        List<String> list = new ArrayList<>();
+        if(sysConfig!=null){
+            String configValue = sysConfig.getConfigValue();
+            if(StringUtils.isNotEmpty(configValue)){
+                list = JSON.parseArray(configValue, String.class);
+            }
+        }
+        return AjaxResult.success(list);
+    }
+
+    /**
+     * 设置erp默认手机号
+     * @param phoneList
+     * @return
+     */
+    @PostMapping(value = "/saveErpPhone")
+    public AjaxResult saveErpPhone(@RequestBody List<String> phoneList)
+    {
+        //去重
+        phoneList = phoneList.stream().distinct().collect(Collectors.toList());
+        SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("erp.phone");
+        sysConfig.setConfigValue(JSON.toJSONString(phoneList));
+        return AjaxResult.success(sysConfigMapper.updateConfig(sysConfig));
+    }
+
+    /**
+     * 批量设置erp手机号
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:createErpOrder')")
+    @Log(title = "订单", businessType = BusinessType.UPDATE)
+    @PostMapping("/editErpPhone")
+    public AjaxResult editErpPhone(@RequestBody LiveOrderScrmSetErpPhoneParam param)
+    {
+        param.setOpeName(getLoginUser().getUser().getNickName());
+        List<String> erpPhone = param.getErpPhone();
+        if (erpPhone == null || erpPhone.isEmpty()) {
+            return AjaxResult.error("请选择手机号");
+        }
+        return toAjax(liveOrderService.batchUpdateErpByOrderIds(param));
+    }
+
+    @Log(title = "手动推管易", businessType = BusinessType.INSERT)
+    @ApiOperation("批量创建ERP订单")
+    @PreAuthorize("@ss.hasPermi('his:storeOrder:createErpOrder')")
+    @PostMapping(value = "/batchCreateErpOrder")
+    public R batchCreateErpOrder(@RequestBody LiveOrderScrmSetErpPhoneParam param)
+    {
+        String nickName = getLoginUser().getUser().getNickName();
+        String loginAccount = param.getLoginAccount();
+        if (StringUtils.isBlank(loginAccount)){
+            return R.error("未选择推送erp账户");
+        }
+        LiveOrderDf df = getDFInfo(loginAccount);
+        if (df.getLoginAccount() == null){
+            return R.error("未查询到所选erp账户");
+        }
+        List<Long> orderIds = param.getOrderIds();
+        if (orderIds  == null || orderIds.isEmpty()) {
+            if(!StringUtils.isEmpty(param.getCreateTimeRange())){
+                param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+            }
+            if(!StringUtils.isEmpty(param.getPayTimeRange())){
+                param.setPayTimeList(param.getPayTimeRange().split("--"));
+            }
+            if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
+                param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
+            }
+            if(!StringUtils.isEmpty(param.getDeliverySendTimeRange())){
+                param.setDeliverySendTimeList(param.getDeliverySendTimeRange().split("--"));
+            }
+            param.setNotHealth(1);
+            List<LiveOrderVO> list = liveOrderService.selectLiveOrderListVO(param);
+            orderIds = list.stream().map(LiveOrderVO::getId).collect(Collectors.toList());
+        }
+        if (orderIds.isEmpty()){
+            return R.ok();
+        }
+        orderIds.forEach(orderId->{
+            try {
+                df.setOrderId(orderId);
+                LiveOrderDf temp = liveOrderDfService.selectLiveOrderDfByOrderId(df.getOrderId());
+                if (temp == null){
+                    df.setParcelQuantity(param.getParcelQuantity()); //设置包裹数量
+                    liveOrderDfService.insertLiveOrderDf(df);
+                    orderLogsService.create(orderId, FsStoreOrderLogEnum.SET_PUSH_ACCOUNT.getValue(),
+                            nickName + " " +FsStoreOrderLogEnum.SET_PUSH_ACCOUNT.getDesc() + ":" + df.getLoginAccount());
+                }
+                liveOrderService.createOmsOrder(orderId);
+                orderLogsService.create(orderId, FsStoreOrderLogEnum.PUSH_ORDER_ERP.getValue(),
+                        nickName + " " +FsStoreOrderLogEnum.PUSH_ORDER_ERP.getDesc() + ":" + df.getLoginAccount());
+            } catch (ParseException e) {
+                throw new RuntimeException(e);
+            }
+
+        });
+        return R.ok();
+    }
+
+    @ApiOperation("批量设置订单账户")
+    @PreAuthorize("@ss.hasPermi('his:storeOrder:createErpOrder')")
+    @PostMapping(value = "/batchSetErpOrder")
+    public R batchSetErpOrder(@RequestBody LiveOrderScrmSetErpPhoneParam param)
+    {
+        String nickName = getLoginUser().getUser().getNickName();
+        String loginAccount = param.getLoginAccount();
+        if (StringUtils.isBlank(loginAccount)){
+            return R.error("未选择erp账户");
+        }
+        LiveOrderDf df = getDFInfo(loginAccount);
+        if (df.getLoginAccount() == null){
+            return R.error("未查询到所选erp账户");
+        }
+        List<Long> orderIds = param.getOrderIds();
+        if (orderIds  == null || orderIds.isEmpty()) {
+            if(!StringUtils.isEmpty(param.getCreateTimeRange())){
+                param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+            }
+            if(!StringUtils.isEmpty(param.getPayTimeRange())){
+                param.setPayTimeList(param.getPayTimeRange().split("--"));
+            }
+            if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
+                param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
+            }
+            if(!StringUtils.isEmpty(param.getDeliverySendTimeRange())){
+                param.setDeliverySendTimeList(param.getDeliverySendTimeRange().split("--"));
+            }
+            param.setNotHealth(1);
+            List<LiveOrderVO> list = liveOrderService.selectLiveOrderListVO(param);
+            orderIds = list.stream().map(LiveOrderVO::getId).collect(Collectors.toList());
+        }
+        if (orderIds.isEmpty()){
+            return R.ok();
+        }
+        orderIds.forEach(orderId->{
+            df.setOrderId(orderId);
+            LiveOrderDf temp = liveOrderDfService.selectLiveOrderDfByOrderId(df.getOrderId());
+            df.setParcelQuantity(param.getParcelQuantity());
+            if (temp != null){
+                df.setUpdateTime(new Date());
+                liveOrderDfService.updateLiveOrderDf(df);
+            } else {
+                liveOrderDfService.insertLiveOrderDf(df);
+            }
+            orderLogsService.create(orderId, FsStoreOrderLogEnum.SET_PUSH_ACCOUNT.getValue(),
+                    nickName + " " +FsStoreOrderLogEnum.SET_PUSH_ACCOUNT.getDesc() + ":" + df.getLoginAccount());
+        });
+        return R.ok();
+    }
+
+    private LiveOrderDf getDFInfo(String loginAccount) {
+        //查询订单账户 判断是否存在该订单账户
+        List<FsDfAccount> erpAccounts = fsDfAccountService.selectFsDfAccountList(null);
+        LiveOrderDf df = new LiveOrderDf();
+        for (FsDfAccount erpAccount : erpAccounts) {
+            if (loginAccount.equals(erpAccount.getLoginAccount())){
+                //添加df记录
+                df.setAppKey(erpAccount.getDfAppKey());
+                df.setAppSecret(erpAccount.getDfAppsecret());
+                df.setLoginAccount(loginAccount);
+                df.setMonthlyCard(erpAccount.getMonthlyCard());
+                df.setExpressProductCode(erpAccount.getExpressProductCode());
+                df.setStatus(0);
+                break;
+            }
+        }
+        return df;
+    }
+
+
+
+}

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

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

@@ -0,0 +1,118 @@
+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 com.github.pagehelper.PageHelper;
+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(LiveOrderPaymentVo liveOrderPayment)
+    {
+        PageHelper.startPage(1, 10000, "");
+        List<LiveOrderPaymentVo> list = liveOrderPaymentService.selectLiveOrderPaymentVoList(liveOrderPayment);
+        for (LiveOrderPaymentVo vo : list){
+            vo.setUserPhone(vo.getUserPhone() == null ? "" : vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+        }
+        ExcelUtil<LiveOrderPaymentVo> util = new ExcelUtil<LiveOrderPaymentVo>(LiveOrderPaymentVo.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,@RequestParam(value = "liveId") Long liveId)
+    {
+        String userId = tokenService.getLoginUser(ServletUtils.getRequest()).getUser().getUserId().toString();
+        return toAjax(liveWatchConfigService.insertLiveWatchConfig(userId, jsonConfig, liveId));
+    }
+
+    /**
+     * 修改直播观看奖励设置
+     */
+//    @PreAuthorize("@ss.hasPermi('live:config:edit')")
+    @Log(title = "直播观看奖励设置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody String jsonConfig,@RequestParam(value = "liveId") Long liveId)
+    {
+        return toAjax(liveWatchConfigService.updateLiveWatchConfig(jsonConfig,liveId));
+    }
+
+    /**
+     * 删除直播观看奖励设置
+     */
+//    @PreAuthorize("@ss.hasPermi('live:config:remove')")
+    @Log(title = "直播观看奖励设置", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+
+        return toAjax(liveWatchConfigService.deleteLiveWatchConfigByIds(ids));
+    }
+}

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

@@ -1,28 +1,26 @@
 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.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 +34,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 +43,34 @@ public class LiveWatchUserController extends BaseController
         return getDataTable(list);
     }
 
+    @GetMapping("/liveUserTotals")
+    public R liveUserTotals(LiveWatchUser liveWatchUser)
+    {
+
+        return liveWatchUserService.liveUserTotals(liveWatchUser);
+    }
+
+    //    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:list')")
+    @GetMapping("/watchUserList")
+    public TableDataInfo watchUserList(@RequestParam Map<String,Object> param) {
+
+        startPage();
+        List<LiveWatchUserVO> onLineUserList = liveWatchUserService.selectWatchUserList(param);
+        return getDataTable(onLineUserList);
+    }
+
+    @GetMapping("/dashBoardWatchUserList")
+    public TableDataInfo dashBoardWatchUserList(@RequestParam Map<String,Object> param) {
+
+        startPage();
+        List<LiveWatchUserVO> onLineUserList = liveWatchUserService.dashBoardWatchUserList(param);
+        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 +83,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 +93,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 +104,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 +115,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));
+    }
+
 }

+ 1 - 1
fs-admin/src/main/java/com/fs/task/ComprehensiveStatisticsTask.java

@@ -22,7 +22,7 @@ public class ComprehensiveStatisticsTask {
      * 每隔一小时执行一次
      */
     public void execute() {
-        iStatisticManageService.executeTask();
+        iStatisticManageService.executeTask(null);
     }
 
 }

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

+ 16 - 2
fs-admin/src/main/java/com/fs/task/SgTestController.java

@@ -1,11 +1,15 @@
 package com.fs.task;
 
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
  import com.fs.company.service.IStatisticManageService;
 
 import javax.annotation.Resource;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 
 /**
  * @description:
@@ -29,8 +33,18 @@ public class SgTestController {
     }
 
     @RequestMapping("/statistic")
-    public void executeTask(){
-        iStatisticManageService.executeTask();
+    public void executeTask(@RequestParam(required = false) String dateTime){
+        Date date = null;
+        if (dateTime != null && !dateTime.isEmpty()) {
+            try {
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+                date = sdf.parse(dateTime);
+            } catch (ParseException e) {
+                // 处理日期解析异常
+                e.printStackTrace();
+            }
+        }
+        iStatisticManageService.executeTask(date);
     }
 
 }

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

@@ -4,7 +4,7 @@ server:
 # Spring配置
 spring:
   profiles:
-    active: dev
+    active: druid-bjzm-test
 #    active: druid-hdt
 #    active: druid-yzt
 #    active: druid-sxjz-test

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

@@ -0,0 +1,31 @@
+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 ONLINE_USERS_SET_KEY = "live:online:users:set:";  //在线用户Set(用于统计最大同时在线人数)
+
+
+    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

@@ -12,6 +12,8 @@ import java.util.Date;
 import java.util.Map;
 
 import com.fs.common.utils.model.DateTimeEntity;
+import java.util.LinkedList;
+
 import org.apache.commons.lang3.time.DateFormatUtils;
 
 /**
@@ -355,4 +357,66 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
         return new DateTimeEntity(startDate, endDate);
     }
 
+    /**
+     * 返回时间最近步长 向下(向前)取整
+     * @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;
+    }
 }

+ 45 - 0
fs-company/src/main/java/com/fs/company/aspectj/LiveControllerAspect.java

@@ -0,0 +1,45 @@
+package com.fs.company.aspectj;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.fs.live.domain.Live;
+import com.fs.live.service.ILiveService;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.AfterReturning;
+import org.aspectj.lang.annotation.Aspect;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Aspect
+@Component
+public class LiveControllerAspect {
+
+    private static final Logger logger = LoggerFactory.getLogger(LiveControllerAspect.class);
+
+    @Autowired
+    private ILiveService liveService;
+
+    @AfterReturning(pointcut = "execution(* com.fs.company.controller.live.LiveController.add(..)) || " +
+            "execution(* com.fs.company.controller.live.LiveController.finishLive(..)) || " +
+            "execution(* com.fs.company.controller.live.LiveController.copyLive(..)) || " +
+            "execution(* com.fs.company.controller.live.LiveController.handleShelfOrUn(..)) || " +
+            "execution(* com.fs.company.controller.live.LiveController.handleDeleteSelected(..)) || " +
+            "execution(* com.fs.company.controller.live.LiveController.edit(..)) || " +
+            "execution(* com.fs.company.controller.live.LiveController.remove(..)) || " +
+            "execution(* com.fs.company.controller.live.LiveController.startLive(..))",
+            returning = "result")
+    public void afterLiveControllerMethodExecution(JoinPoint joinPoint,Object result) {
+        String methodName = joinPoint.getSignature().getName();
+        Object[] args = joinPoint.getArgs();
+        liveService.asyncToCache();
+        if (args[0] instanceof Live) {
+            Live live = (Live) args[0];
+            if (ObjectUtil.isNotEmpty(live) && ObjectUtil.isNotEmpty(live.getLiveId())){
+                liveService.asyncToCacheLiveDetail(live.getLiveId());
+            }
+        }
+        logger.info("后台直播间列表变更");
+
+    }
+}

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

@@ -12,6 +12,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.framework.security.LoginUser;
 import com.fs.framework.service.TokenService;
@@ -60,6 +61,8 @@ public class CommonController
 
     @Autowired
     private QwApiService qwApiService;
+    @Autowired
+    private ITencentCloudCosService tencentCloudCosService;
 
 
     @Autowired
@@ -292,6 +295,12 @@ public class CommonController
         }
     }
 
+    @GetMapping("/common/getTmpSecretKey")
+    public R getTmpSecretKey()
+    {
+        return tencentCloudCosService.getKeyAndCredentials();
+    }
+
     @GetMapping(value = "/common/getInquiryConfig")
     public AjaxResult getInquiryConfig()
     {

+ 84 - 3
fs-company/src/main/java/com/fs/company/controller/company/CompanyUserController.java

@@ -28,6 +28,7 @@ import com.fs.company.vo.BatchUserRolesVO;
 import com.fs.company.vo.CompanyUserImportVO;
 import com.fs.company.vo.CompanyUserQwListVO;
 import com.fs.company.vo.CompanyUserVO;
+import com.fs.config.cloud.CloudHostProper;
 import com.fs.course.config.CourseConfig;
 import com.fs.framework.security.LoginUser;
 import com.fs.framework.security.SecurityUtils;
@@ -108,6 +109,9 @@ public class CompanyUserController extends BaseController {
     @Autowired
     private IQwUserService qwUserService;
 
+    @Autowired
+    private CloudHostProper cloudHostProper;
+
     private static final String appLink = "https://jump.ylrztop.com/jumpapp/pages/index/index?link=";
 
     /**
@@ -122,6 +126,37 @@ public class CompanyUserController extends BaseController {
         List<CompanyUser> list = companyUserService.selectCompanyUserList(user);
         return getDataTable(list);
     }
+
+
+    /**
+     * 获取用户列表
+     */
+    @GetMapping("/deptList")
+    public TableDataInfo deptList(CompanyUser user)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        user.setCompanyId(loginUser.getCompany().getCompanyId());
+
+        List<Long> combinedDpetList = new ArrayList<>();
+        //本部门
+        Long deptId = loginUser.getUser().getDeptId();
+        if (deptId!=null){
+            combinedDpetList.add(deptId);
+        }
+        //本部门的下级部门
+        List<Long> deptList = companyDeptService.selectCompanyDeptByParentId(deptId);
+        if (!deptList.isEmpty()){
+            combinedDpetList.addAll(deptList);
+        }
+
+        user.setDeptList(combinedDpetList);
+
+        startPage();
+        List<CompanyUser> list = companyUserService.selectCompanyUserList(user);
+        return getDataTable(list);
+    }
+
+
     @GetMapping("/getUserList")
     public R getUserList()
     {
@@ -554,10 +589,56 @@ public class CompanyUserController extends BaseController {
         Map<String,Object> params = new HashMap<>();
         params.put("nickName", name);
         //查询多条数据传入公司
-        if (pageSize>=200){
-            LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-            params.put("companyId", loginUser.getCompany().getCompanyId());
+//        if (pageSize>=200){
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        params.put("companyId", loginUser.getCompany().getCompanyId());
+//        }
+        PageHelper.startPage(pageNum, pageSize);
+        List<OptionsVO> companyUserList = companyUserService.selectCompanyUserListByMap(params);
+        return R.ok().put("data", new PageInfo<>(companyUserList));
+    }
+
+    /**
+     * 根据销售名称模糊查询+部门
+     * @param name  名称
+     * @return  list
+     */
+    @GetMapping("/getCompanyUserListLikeNameDept")
+    public R getCompanyUserListLikeNameDept(@RequestParam(required = false) String name,
+                                        @RequestParam(required = false, defaultValue = "1") Integer pageNum,
+                                        @RequestParam(required = false, defaultValue = "10") Integer pageSize) {
+        Map<String,Object> params = new HashMap<>();
+        params.put("nickName", name);
+
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+
+        //查询多条数据传入公司
+//        if (pageSize>=200){
+
+        params.put("companyId", loginUser.getCompany().getCompanyId());
+//        }
+        List<Long> combinedDeptList = new ArrayList<>();
+        //本部门
+        Long deptId = loginUser.getUser().getDeptId();
+        if (deptId!=null){
+            combinedDeptList.add(deptId);
+
+                //本部门的上级部门
+                List<Long> deptList = companyDeptService.selectCompanyDeptByDeptId(deptId);
+                if (!deptList.isEmpty()){
+                    combinedDeptList.addAll(deptList);
+                }
+            }
+
+        //本部门的下级部门
+        List<Long> deptList = companyDeptService.selectCompanyDeptByParentId(deptId);
+        if (!deptList.isEmpty()){
+            combinedDeptList.addAll(deptList);
         }
+
+        params.put("combinedDeptList",combinedDeptList);
+
+
         PageHelper.startPage(pageNum, pageSize);
         List<OptionsVO> companyUserList = companyUserService.selectCompanyUserListByMap(params);
         return R.ok().put("data", new PageInfo<>(companyUserList));

+ 2 - 2
fs-company/src/main/java/com/fs/company/controller/course/FsCourseFinishTempParentController.java

@@ -97,7 +97,7 @@ public class FsCourseFinishTempParentController extends BaseController
             combinedList.addAll(deptList);
         }
 
-        List<Long> userIds = companyUserService.selectCompanyQwUserByDept(deptList, loginUser.getUser().getUserType());
+        List<Long> userIds = companyUserService.selectCompanyQwUserByDept(combinedList, loginUser.getUser().getUserType());
         if (userIds.isEmpty()){
             return getDataTable(new ArrayList<>());
         }
@@ -162,7 +162,7 @@ public class FsCourseFinishTempParentController extends BaseController
             combinedList.addAll(deptList);
         }
 
-        List<Long> userIds = companyUserService.selectCompanyQwUserByDept(deptList, loginUser.getUser().getUserType());
+        List<Long> userIds = companyUserService.selectCompanyQwUserByDept(combinedList, loginUser.getUser().getUserType());
         if (userIds.isEmpty()){
             return AjaxResult.error();
         }

+ 2 - 1
fs-company/src/main/java/com/fs/company/controller/course/FsUserCourseCategoryController.java

@@ -109,7 +109,8 @@ public class FsUserCourseCategoryController extends BaseController
     @GetMapping("/getCatePidList")
     public R getCatePidList()
     {
-        List<OptionsVO> list = fsUserCourseCategoryService.selectFsUserCourseCategoryPidList();
+        Integer isShow = null;
+        List<OptionsVO> list = fsUserCourseCategoryService.selectFsUserCourseCategoryPidList(isShow);
         return R.ok().put("data", list);
     }
 

+ 1 - 1
fs-company/src/main/java/com/fs/company/controller/course/qw/FsQwCourseWatchLogController.java

@@ -86,7 +86,7 @@ public class FsQwCourseWatchLogController extends BaseController
         List<FsCourseWatchLogStatisticsListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogStatisticsListVO(param);
         return getDataTable(list);
     }
-    @PreAuthorize("@ss.hasPermi('course:courseWatchLog:statisticsList')")
+    @PreAuthorize("@ss.hasPermi('qw:user:export')")
     @GetMapping("/statisticsExport")
     public AjaxResult statisticsExport(FsCourseWatchLogStatisticsListParam param)
     {

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

@@ -0,0 +1,135 @@
+package com.fs.company.controller.live;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.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 com.github.pagehelper.PageHelper;
+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(LiveAfterSalesVo liveAfterSales)
+    {
+        PageHelper.startPage(1, 10000, "");
+        List<LiveAfterSalesVo> list = liveAfterSalesService.selectLiveAfterSalesVoList(liveAfterSales);
+        for (LiveAfterSalesVo liveAfterSalesVo : list) {
+            liveAfterSalesVo.setUserPhone(liveAfterSalesVo.getUserPhone() == null ? "" : liveAfterSalesVo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+            liveAfterSalesVo.setPhoneNumber(liveAfterSalesVo.getPhoneNumber() == null ? "" : liveAfterSalesVo.getPhoneNumber().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+        }
+        ExcelUtil<LiveAfterSalesVo> util = new ExcelUtil<LiveAfterSalesVo>(LiveAfterSalesVo.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());
+    }
+}

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

@@ -0,0 +1,227 @@
+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("/consoleList")
+    public TableDataInfo consoleList(LiveAutoTask liveAutoTask)
+    {
+        startPage();
+        // 大屏查询后面20条数据
+        List<LiveAutoTask> list = liveAutoTaskService.consoleList(liveAutoTask.getLiveId());
+        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:list')")
+    @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);
+    }
+}

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

@@ -0,0 +1,182 @@
+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.LoginUser;
+import com.fs.framework.security.SecurityUtils;
+import com.fs.framework.service.TokenService;
+import com.fs.live.domain.LiveData;
+import com.fs.live.param.LiveDataParam;
+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;
+
+    /**
+     * 直播数据页面卡片数据
+     */
+    @GetMapping("/dashboardData")
+    public R dashboardData(@RequestParam Long liveId, HttpServletRequest request) {
+        LoginUser loginUser = tokenService.getLoginUser(request);
+        Long userId = loginUser.getUser().getUserId();
+        return liveDataService.dashboardData(liveId);
+    }
+
+    /**
+     * 查询直播数据列表
+     */
+    @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:list')")
+    @PostMapping("/listLiveData")
+    public R listLiveData(@RequestBody LiveDataParam param, HttpServletRequest request)
+    {
+        param.setCompanyId(tokenService.getLoginUser(request).getUser().getCompanyId());
+        startPage();
+        return liveDataService.listLiveData(param);
+    }
+
+    /**
+     * 导出直播数据列表
+     */
+    @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));
+    }
+}

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

@@ -0,0 +1,183 @@
+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.his.service.IFsStoreProductService;
+import com.fs.hisStore.service.IFsStoreProductScrmService;
+import com.fs.hisStore.vo.FsStoreProductListVO;
+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.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/liveGoods")
+public class LiveGoodsController extends BaseController
+{
+    @Autowired
+    private ILiveGoodsService liveGoodsService;
+
+    @Autowired
+    private IFsStoreProductScrmService fsStoreProductService;
+
+    /**
+     * 查询直播商品列表
+     */
+////    @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('store:storeProduct:list')")
+    @GetMapping("/liveList")
+    public TableDataInfo liveList(LiveGoods liveGoods)
+    {
+        startPage();
+        List<FsStoreProductListVO> list = fsStoreProductService.liveList(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));
+    }
+}

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

@@ -0,0 +1,108 @@
+package com.fs.company.controller.live;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.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);
+    }
+
+    @GetMapping("/singleList")
+    public TableDataInfo singleList(LiveMsg liveMsg)
+    {
+        startPage();
+        List<LiveMsg> list = liveMsgService.selectLiveMsgSingleList(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));
+    }
+
+}

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

@@ -0,0 +1,396 @@
+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.param.LiveOrderExpressParam;
+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.LiveOrderTimeVo;
+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){
+
+//        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(LiveOrderTimeVo 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,@RequestParam(value = "liveId") Long liveId)
+    {
+        String userId = tokenService.getLoginUser(ServletUtils.getRequest()).getUser().getUserId().toString();
+        return toAjax(liveWatchConfigService.insertLiveWatchConfig(userId, jsonConfig,liveId));
+    }
+
+    /**
+     * 修改直播观看奖励设置
+     */
+//    @PreAuthorize("@ss.hasPermi('live:config:edit')")
+    @Log(title = "直播观看奖励设置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody String jsonConfig,@RequestParam(value = "liveId") Long liveId)
+    {
+        return toAjax(liveWatchConfigService.updateLiveWatchConfig(jsonConfig, liveId));
+    }
+
+    /**
+     * 删除直播观看奖励设置
+     */
+//    @PreAuthorize("@ss.hasPermi('live:config:remove')")
+    @Log(title = "直播观看奖励设置", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+
+        return toAjax(liveWatchConfigService.deleteLiveWatchConfigByIds(ids));
+    }
+}

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

@@ -0,0 +1,146 @@
+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.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);
+    }
+
+    @GetMapping("/liveUserTotals")
+    public R liveUserTotals(LiveWatchUser liveWatchUser)
+    {
+
+        return liveWatchUserService.liveUserTotals(liveWatchUser);
+    }
+
+    //    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:list')")
+    @GetMapping("/watchUserList")
+    public TableDataInfo watchUserList(@RequestParam Map<String,Object> param) {
+
+        startPage();
+        List<LiveWatchUserVO> onLineUserList = liveWatchUserService.selectWatchUserList(param);
+        return getDataTable(onLineUserList);
+    }
+
+    @GetMapping("/dashBoardWatchUserList")
+    public TableDataInfo dashBoardWatchUserList(@RequestParam Map<String,Object> param) {
+
+        startPage();
+        List<LiveWatchUserVO> onLineUserList = liveWatchUserService.dashBoardWatchUserList(param);
+        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));
+    }
+
+}

+ 3 - 2
fs-company/src/main/java/com/fs/company/controller/qw/QwDeptController.java

@@ -36,6 +36,9 @@ public class QwDeptController extends BaseController
     @Autowired
     private TokenService tokenService;
 
+    @Autowired
+    QwCompanyMapper qwCompanyMapper;
+
     /**
      * 查询企业微信部门列表
      */
@@ -47,8 +50,6 @@ public class QwDeptController extends BaseController
         List<QwDept> list = qwDeptService.selectQwDeptList(qwDept);
         return getDataTable(list);
     }
-    @Autowired
-    QwCompanyMapper qwCompanyMapper;
 
     /**
     * 同步企业微信 部门信息

+ 92 - 10
fs-company/src/main/java/com/fs/company/controller/qw/QwSopTempController.java

@@ -10,22 +10,26 @@ import com.fs.common.enums.BusinessType;
 import com.fs.common.utils.ServletUtils;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.company.service.impl.CompanyDeptServiceImpl;
+import com.fs.company.service.impl.CompanyUserServiceImpl;
+import com.fs.company.vo.DocCompanyUserVO;
 import com.fs.framework.security.LoginUser;
 import com.fs.framework.service.TokenService;
+import com.fs.qw.service.IQwUserService;
 import com.fs.qw.vo.SortDayVo;
+import com.fs.sop.domain.QwSop;
 import com.fs.sop.domain.QwSopTemp;
 import com.fs.sop.domain.QwSopTempDay;
 import com.fs.sop.params.QwSopShareTempParam;
 import com.fs.sop.service.IQwSopTempService;
 import com.fs.sop.vo.UpdateRedVo;
+import com.fs.voice.utils.StringUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
+import java.util.function.Function;
 import java.util.stream.Collectors;
 
 /**
@@ -43,14 +47,19 @@ public class QwSopTempController extends BaseController
     @Autowired
     private TokenService tokenService;
 
+    @Autowired
+    private IQwUserService iQwUserService;
+
 
     @Autowired
     private CompanyDeptServiceImpl companyDeptService;
 
+    @Autowired
+    private CompanyUserServiceImpl companyUserService;
+
     /**
      * 查询sop模板列表
      */
-    @PreAuthorize("@ss.hasPermi('qw:sopTemp:list')")
     @GetMapping("/list")
     public TableDataInfo list(QwSopTemp qwSopTemp)
     {
@@ -58,8 +67,37 @@ public class QwSopTempController extends BaseController
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         qwSopTemp.setCompanyId(loginUser.getCompany().getCompanyId());
 
-//        List<QwSopTemp> list = qwSopTempService.selectQwSopTempList(qwSopTemp);
         List<QwSopTemp> list = qwSopTempService.selectQwSopTempListNew(qwSopTemp);
+
+        // 收集所有需要查询的用户ID
+        Set<Long> userIds = list.stream()
+                .map(QwSopTemp::getCreateBy)
+                .filter(str -> !StringUtil.strIsNullOrEmpty(str)) // 取反,保留非空值
+                .map(Long::valueOf)
+                .collect(Collectors.toSet());
+
+        if (!userIds.isEmpty()){
+            // 批量查询用户信息
+            Map<Long, DocCompanyUserVO> userMap = companyUserService
+                    .selectDocCompanyUserListByUserIds(userIds)
+                    .stream()
+                    .collect(Collectors.toMap(DocCompanyUserVO::getUserId, Function.identity()));
+
+
+            list.forEach(item->{
+
+                if (!StringUtil.strIsNullOrEmpty(item.getCreateBy())) {
+                    DocCompanyUserVO user = userMap.get(Long.valueOf(item.getCreateBy()));
+                    if (user != null) {
+                        item.setCreateByName(user.getNickName());
+                        item.setCreateByDeptName(user.getDeptName());
+                    }
+                }
+
+            });
+        }
+
+
         return getDataTable(list);
     }
 
@@ -90,7 +128,6 @@ public class QwSopTempController extends BaseController
         qwSopTemp.setCompanyId(loginUser.getCompany().getCompanyId());
         qwSopTemp.setCreateBy(String.valueOf(loginUser.getUser().getUserId()));
         startPage();
-//        List<QwSopTemp> list = qwSopTempService.selectQwSopTempList(qwSopTemp);
         List<QwSopTemp> list = qwSopTempService.selectQwSopTempListNew(qwSopTemp);
         return getDataTable(list);
     }
@@ -112,17 +149,60 @@ public class QwSopTempController extends BaseController
         Long deptId = loginUser.getUser().getDeptId();
         if (deptId!=null){
             combinedDpetList.add(deptId);
+
+            //本部门的上级部门
+            List<Long> deptList = companyDeptService.selectCompanyDeptByDeptId(deptId);
+            if (!deptList.isEmpty()){
+                combinedDpetList.addAll(deptList);
+            }
         }
+
+
+
         //本部门的下级部门
-        List<Long> deptList = companyDeptService.selectCompanyDeptByParentId(deptId);
-        if (!deptList.isEmpty()){
-            combinedDpetList.addAll(deptList);
+        List<Long> parentList = companyDeptService.selectCompanyDeptByParentId(deptId);
+        if (!parentList.isEmpty()){
+            combinedDpetList.addAll(parentList);
         }
-        qwSopTemp.setCuDeptIdList(combinedDpetList);
+
+        List<Long> userIds = companyUserService.selectCompanyQwUserByDept(combinedDpetList, loginUser.getUser().getUserType());
+        if (userIds.isEmpty()){
+            return getDataTable(new ArrayList<>());
+        }
+
+        qwSopTemp.setUserIds(userIds);
 
         startPage();
 //        List<QwSopTemp> list = qwSopTempService.selectQwSopTempList(qwSopTemp);
         List<QwSopTemp> list = qwSopTempService.selectQwSopTempListNew(qwSopTemp);
+
+        // 收集所有需要查询的用户ID
+        Set<Long> createBys = list.stream()
+                .map(QwSopTemp::getCreateBy)
+                .filter(str -> !StringUtil.strIsNullOrEmpty(str)) // 取反,保留非空值
+                .map(Long::valueOf)
+                .collect(Collectors.toSet());
+
+        if (!userIds.isEmpty()){
+            // 批量查询用户信息
+            Map<Long, DocCompanyUserVO> userMap = companyUserService
+                    .selectDocCompanyUserListByUserIds(createBys)
+                    .stream()
+                    .collect(Collectors.toMap(DocCompanyUserVO::getUserId, Function.identity()));
+
+
+            list.forEach(item->{
+
+                if (!StringUtil.strIsNullOrEmpty(item.getCreateBy())) {
+                    DocCompanyUserVO user = userMap.get(Long.valueOf(item.getCreateBy()));
+                    if (user != null) {
+                        item.setCreateByName(user.getNickName());
+                        item.setCreateByDeptName(user.getDeptName());
+                    }
+                }
+
+            });
+        }
         return getDataTable(list);
     }
 
@@ -236,6 +316,8 @@ public class QwSopTempController extends BaseController
     @PreAuthorize("@ss.hasPermi('qw:sopTemp:edit') or @ss.hasPermi('qw:sopTemp:myEdit') or @ss.hasPermi('qw:sopTemp:deptEdit')")
     @PostMapping("/copyTemplate")
     public AjaxResult copyTemplate(@RequestBody QwSopTemp qwSopTemp){
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        qwSopTemp.setCreateBy(loginUser.getUser().getUserId().toString());
         qwSopTempService.copyTemplate(qwSopTemp);
         return toAjax(1);
     }

+ 12 - 0
fs-company/src/main/java/com/fs/company/controller/qw/QwUserController.java

@@ -235,6 +235,18 @@ public class QwUserController extends BaseController
     }
 
 
+    /**
+    * 查询部门下的 企业微信账号
+    */
+    @PostMapping("/getQwUserByDept")
+    public R getQwUserByDept(@RequestBody QwUserByDeptParam deptParam){
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        deptParam.setCompanyId(loginUser.getCompany().getCompanyId());
+        return R.ok().put("data",qwUserService.getQwUserByDept(deptParam)) ;
+    }
+
+
+
 
     @PreAuthorize("@ss.hasPermi('qw:user:login')")
     @PostMapping("/getQwIpad")

+ 2 - 2
fs-company/src/main/java/com/fs/company/controller/qw/SopUserLogsController.java

@@ -179,8 +179,8 @@ public class SopUserLogsController extends BaseController
     @Log(title = "修改群营期时间", businessType = BusinessType.UPDATE)
     @PostMapping("/updateLogDate")
     public R updateLogDate(@RequestBody UpdateSopUserLogDateVo vo){
-        sopUserLogsService.updateLogDate(vo);
-        return R.ok();
+
+        return sopUserLogsService.updateLogDate(vo);
     }
     @Log(title = "追加SOP群聊", businessType = BusinessType.UPDATE)
     @PostMapping("/addGroupChat")

+ 17 - 0
fs-company/src/main/java/com/fs/company/controller/qw/SopUserLogsInfoController.java

@@ -10,7 +10,10 @@ 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.PubFun;
+import com.fs.common.utils.ServletUtils;
 import com.fs.common.utils.StringUtils;
+import com.fs.framework.security.LoginUser;
+import com.fs.framework.service.TokenService;
 import com.fs.qw.domain.QwGroupChatUser;
 import com.fs.qw.domain.QwTag;
 import com.fs.qw.mapper.QwTagMapper;
@@ -20,6 +23,7 @@ import com.fs.qw.param.SopExternalContactInfo;
 import com.fs.qw.service.IQwExternalContactService;
 import com.fs.qw.service.IQwGroupChatUserService;
 import com.fs.qw.service.IQwTagService;
+import com.fs.qw.service.IQwUserService;
 import com.fs.sop.domain.SopUserLogsInfo;
 import com.fs.sop.params.BatchSopUserLogsInfoParam;
 import com.fs.sop.params.SendUserLogsInfoMsgParam;
@@ -62,6 +66,10 @@ public class SopUserLogsInfoController extends BaseController
     private IQwGroupChatUserService qwGroupChatUserService;
 
     private static final Gson GSON = new Gson();
+    @Autowired
+    private IQwUserService qwUserService;
+    @Autowired
+    private TokenService tokenService;
 
     /**
      * 查询sopUserLogsInfo列表
@@ -528,6 +536,15 @@ public class SopUserLogsInfoController extends BaseController
     @RepeatSubmit
     public R sendUserLogsInfoMsgSop(@RequestBody SendUserLogsInfoMsgParam param)
     {
+        if (param.getIsMine() != null && param.getIsMine() == 1) {
+            //我的sop
+            LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+            //查询qwUserId
+            List<String> qwUserIds = qwUserService.selectQwUserListByCompanyUserId(loginUser.getUser().getUserId(), param.getCorpId());
+            if (qwUserIds != null && !qwUserIds.isEmpty()) {
+                param.setQwUserIds(qwUserIds);
+            }
+        }
         return sopUserLogsInfoService.sendUserLogsInfoMsgSop(param);
     }
 

+ 1 - 1
fs-company/src/main/java/com/fs/framework/service/UserDetailsServiceImpl.java

@@ -3,13 +3,13 @@ package com.fs.framework.service;
 
 import com.fs.common.enums.UserStatus;
 import com.fs.common.exception.CustomException;
+import com.fs.common.utils.SecurityUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.company.domain.Company;
 import com.fs.company.domain.CompanyUser;
 import com.fs.company.service.ICompanyService;
 import com.fs.company.service.ICompanyUserService;
 import com.fs.framework.security.LoginUser;
-import com.fs.framework.security.SecurityUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;

Някои файлове не бяха показани, защото твърде много файлове са промени