Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/master'

Guos 1 settimana fa
parent
commit
dfce61e73d
100 ha cambiato i file con 10717 aggiunte e 554 eliminazioni
  1. 48 0
      fs-admin/src/main/java/com/fs/company/controller/CompanyConfigController.java
  2. 27 4
      fs-admin/src/main/java/com/fs/company/controller/CompanyController.java
  3. 572 0
      fs-admin/src/main/java/com/fs/company/controller/CompanyUserAllController.java
  4. 1 1
      fs-admin/src/main/java/com/fs/course/controller/FsCoursePlaySourceConfigController.java
  5. 5 1
      fs-admin/src/main/java/com/fs/course/controller/FsCourseTrafficLogController.java
  6. 2 1
      fs-admin/src/main/java/com/fs/course/controller/FsUserCourseCategoryController.java
  7. 16 0
      fs-admin/src/main/java/com/fs/course/controller/FsUserCourseController.java
  8. 4 0
      fs-admin/src/main/java/com/fs/course/controller/FsUserCoursePeriodController.java
  9. 21 0
      fs-admin/src/main/java/com/fs/course/params/FsUserCourseConfigParam.java
  10. 59 0
      fs-admin/src/main/java/com/fs/his/controller/FsCompanyController.java
  11. 18 13
      fs-admin/src/main/java/com/fs/his/controller/FsCompanyDeductController.java
  12. 24 0
      fs-admin/src/main/java/com/fs/his/controller/FsCompanyDivItemController.java
  13. 20 13
      fs-admin/src/main/java/com/fs/his/controller/FsCompanyRechargeController.java
  14. 23 0
      fs-admin/src/main/java/com/fs/his/controller/FsDoctorController.java
  15. 49 9
      fs-admin/src/main/java/com/fs/his/controller/FsIntegralOrderController.java
  16. 6 2
      fs-admin/src/main/java/com/fs/his/controller/FsUserController.java
  17. 247 0
      fs-admin/src/main/java/com/fs/his/param/FurtherConsultationParam.java
  18. 329 0
      fs-admin/src/main/java/com/fs/his/param/PrescriptionParam.java
  19. 31 4
      fs-admin/src/main/java/com/fs/his/task/CompanyBalanceTask.java
  20. 480 0
      fs-admin/src/main/java/com/fs/his/task/NetMedicalService.java
  21. 1 0
      fs-admin/src/main/java/com/fs/his/task/Task.java
  22. 10 1
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStorePaymentScrmController.java
  23. 46 0
      fs-admin/src/main/java/com/fs/live/aspectj/LiveControllerAspect.java
  24. 183 0
      fs-admin/src/main/java/com/fs/live/controller/LiveAfterSalesController.java
  25. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveAfterSalesItemController.java
  26. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveAfterSalesLogsController.java
  27. 8 14
      fs-admin/src/main/java/com/fs/live/controller/LiveAnchorController.java
  28. 227 0
      fs-admin/src/main/java/com/fs/live/controller/LiveAutoTaskController.java
  29. 98 0
      fs-admin/src/main/java/com/fs/live/controller/LiveCartController.java
  30. 97 29
      fs-admin/src/main/java/com/fs/live/controller/LiveController.java
  31. 223 0
      fs-admin/src/main/java/com/fs/live/controller/LiveCouponController.java
  32. 103 0
      fs-admin/src/main/java/com/fs/live/controller/LiveCouponIssueController.java
  33. 103 0
      fs-admin/src/main/java/com/fs/live/controller/LiveCouponIssueUserController.java
  34. 105 0
      fs-admin/src/main/java/com/fs/live/controller/LiveCouponUserController.java
  35. 100 0
      fs-admin/src/main/java/com/fs/live/controller/LiveDataController.java
  36. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveEventConfController.java
  37. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveGiftController.java
  38. 107 29
      fs-admin/src/main/java/com/fs/live/controller/LiveGoodsController.java
  39. 0 103
      fs-admin/src/main/java/com/fs/live/controller/LiveGoodsOrderController.java
  40. 0 103
      fs-admin/src/main/java/com/fs/live/controller/LiveGoodsOrderItemsController.java
  41. 326 0
      fs-admin/src/main/java/com/fs/live/controller/LiveHealthOrderController.java
  42. 143 0
      fs-admin/src/main/java/com/fs/live/controller/LiveLotteryConfController.java
  43. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveLotteryRecordController.java
  44. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveLotteryRegistrationController.java
  45. 22 20
      fs-admin/src/main/java/com/fs/live/controller/LiveMsgController.java
  46. 657 0
      fs-admin/src/main/java/com/fs/live/controller/LiveOrderController.java
  47. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveOrderItemController.java
  48. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveOrderLogsController.java
  49. 118 0
      fs-admin/src/main/java/com/fs/live/controller/LiveOrderPaymentController.java
  50. 0 103
      fs-admin/src/main/java/com/fs/live/controller/LiveQuestionController.java
  51. 125 0
      fs-admin/src/main/java/com/fs/live/controller/LiveRedConfController.java
  52. 4 0
      fs-admin/src/main/java/com/fs/live/controller/LiveRedController.java
  53. 125 0
      fs-admin/src/main/java/com/fs/live/controller/LiveRewardRecordController.java
  54. 98 0
      fs-admin/src/main/java/com/fs/live/controller/LiveSensitiveWordsController.java
  55. 122 0
      fs-admin/src/main/java/com/fs/live/controller/LiveTrafficLogController.java
  56. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveUserFavoriteController.java
  57. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveUserFollowController.java
  58. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveUserLikeController.java
  59. 108 0
      fs-admin/src/main/java/com/fs/live/controller/LiveUserLotteryRecordController.java
  60. 97 0
      fs-admin/src/main/java/com/fs/live/controller/LiveUserRedRecordController.java
  61. 33 20
      fs-admin/src/main/java/com/fs/live/controller/LiveVideoController.java
  62. 102 0
      fs-admin/src/main/java/com/fs/live/controller/LiveWatchConfigController.java
  63. 63 20
      fs-admin/src/main/java/com/fs/live/controller/LiveWatchUserController.java
  64. 138 0
      fs-admin/src/main/java/com/fs/qw/controller/QwDeptController.java
  65. 309 5
      fs-admin/src/main/java/com/fs/qw/controller/QwUserController.java
  66. 51 25
      fs-admin/src/main/java/com/fs/task/FsCompanyTask.java
  67. 183 0
      fs-admin/src/main/java/com/fs/task/LiveTask.java
  68. 2 2
      fs-admin/src/main/resources/application.yml
  69. 6 5
      fs-common/pom.xml
  70. 1 0
      fs-common/src/main/java/com/fs/common/constant/FsConstants.java
  71. 31 0
      fs-common/src/main/java/com/fs/common/constant/LiveKeysConstant.java
  72. 20 0
      fs-common/src/main/java/com/fs/common/core/page/PageRequest.java
  73. 150 0
      fs-common/src/main/java/com/fs/common/core/redis/RedisCache.java
  74. 64 0
      fs-common/src/main/java/com/fs/common/utils/DateUtils.java
  75. 101 9
      fs-common/src/main/java/com/fs/common/utils/http/HttpUtils.java
  76. 45 0
      fs-company/src/main/java/com/fs/company/aspectj/LiveControllerAspect.java
  77. 9 0
      fs-company/src/main/java/com/fs/company/controller/common/CommonController.java
  78. 121 3
      fs-company/src/main/java/com/fs/company/controller/company/CompanyUserController.java
  79. 43 0
      fs-company/src/main/java/com/fs/company/controller/company/FsRedPacketController.java
  80. 2 2
      fs-company/src/main/java/com/fs/company/controller/course/FsCourseFinishTempParentController.java
  81. 2 1
      fs-company/src/main/java/com/fs/company/controller/course/FsUserCourseCategoryController.java
  82. 30 12
      fs-company/src/main/java/com/fs/company/controller/course/qw/FsQwCourseWatchLogController.java
  83. 135 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveAfterSalesController.java
  84. 121 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveAnchorController.java
  85. 227 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveAutoTaskController.java
  86. 97 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveCartController.java
  87. 361 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveController.java
  88. 209 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveCouponController.java
  89. 182 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveDataController.java
  90. 97 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveGiftController.java
  91. 183 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveGoodsController.java
  92. 143 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveLotteryConfController.java
  93. 97 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveLotteryRecordController.java
  94. 97 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveLotteryRegistrationController.java
  95. 108 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveMsgController.java
  96. 396 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveOrderController.java
  97. 97 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveOrderItemController.java
  98. 97 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveOrderLogsController.java
  99. 34 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveProfitController.java
  100. 125 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveRedConfController.java

+ 48 - 0
fs-admin/src/main/java/com/fs/company/controller/CompanyConfigController.java

@@ -0,0 +1,48 @@
+package com.fs.company.controller;
+
+
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.company.service.ICompanyConfigService;
+import com.fs.system.domain.SysConfig;
+import com.fs.system.service.ISysConfigService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 系统配置
+ *
+
+ */
+@RestController
+@RequestMapping("/company/companyConfig")
+public class CompanyConfigController extends BaseController
+{
+
+    @Autowired
+    private ICompanyConfigService companyConfigService;
+
+
+    @Autowired
+    private ISysConfigService configService;
+
+
+
+    /**
+     * 根据参数键名查询总后台参数值
+     * @param configKey
+     * @return
+     */
+    @GetMapping(value = "/getConfigByKey/{configKey}")
+    public AjaxResult getConfigByKey(@PathVariable String configKey)
+    {
+        SysConfig config=configService.selectConfigByConfigKey(configKey);
+        return AjaxResult.success(config);
+    }
+
+
+
+}

+ 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();
+    }
+
     /**
      * 查询企业列表
      */

+ 572 - 0
fs-admin/src/main/java/com/fs/company/controller/CompanyUserAllController.java

@@ -0,0 +1,572 @@
+package com.fs.company.controller;
+
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.http.HttpRequest;
+import cn.hutool.json.JSONUtil;
+import com.baidu.dev2.thirdparty.jackson.databind.ObjectMapper;
+import com.fs.common.annotation.Log;
+import com.fs.common.constant.UserConstants;
+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.core.redis.RedisCache;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.PatternUtils;
+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.company.domain.*;
+import com.fs.company.param.CompanyUserAreaParam;
+import com.fs.company.param.CompanyUserCodeParam;
+import com.fs.company.param.CompanyUserQwParam;
+import com.fs.company.service.*;
+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.course.config.CourseConfig;
+import com.fs.framework.web.service.TokenService;
+import com.fs.his.utils.qrcode.QRCodeUtils;
+import com.fs.his.vo.OptionsVO;
+import com.fs.hisStore.vo.FsStoreProductExportVO;
+import com.fs.im.config.IMConfig;
+import com.fs.im.dto.OpenImResponseDTO;
+import com.fs.im.service.OpenIMService;
+import com.fs.qw.domain.QwCompany;
+import com.fs.qw.service.IQwCompanyService;
+import com.fs.qw.service.IQwUserService;
+import com.fs.qw.vo.CompanyUserQwVO;
+import com.fs.qw.vo.QwUserVO;
+import com.fs.system.service.ISysConfigService;
+import com.fs.utils.DomainUtil;
+import com.fs.utils.QwStatusEnum;
+import com.fs.voice.utils.StringUtil;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.ApiOperation;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.util.Assert;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.util.*;
+import java.util.concurrent.CompletableFuture;
+import java.util.stream.Collectors;
+
+
+/**
+ * 用户信息
+ */
+@RestController
+@RequestMapping("/company/CompanyUserAll")
+public class CompanyUserAllController extends BaseController {
+
+    @Autowired
+    private ICompanyRoleService roleService;
+
+    @Autowired
+    private ICompanyPostService postService;
+
+    @Autowired
+    private ICompanyUserService companyUserService;
+
+    @Autowired
+    private ICompanyService companyService;
+
+    @Autowired
+    private ICompanyUserDelayTimeService companyUserDelayTimeService;
+
+    @Autowired
+    private ISysConfigService configService;
+
+    @Autowired
+    private RedisCache redisCache;
+
+    @Autowired
+    private OpenIMService openIMService;
+
+    @Autowired
+    IQwCompanyService iQwCompanyService;
+
+    @Autowired
+    private IQwUserService qwUserService;
+
+    @Autowired
+    private TokenService tokenService;
+
+    private static final String appLink = "https://jump.ylrztop.com/jumpapp/pages/index/index?link=";
+
+
+    @GetMapping("/getList")
+    public TableDataInfo getList(CompanyUser user)
+    {
+        startPage();
+        List<CompanyUser> list = companyUserService.selectCompanyUserList(user);
+        return getDataTable(list);
+    }
+    @GetMapping("/qwList")
+    public TableDataInfo qwList(CompanyUserQwParam user) {
+        List<CompanyUserQwListVO> list = companyUserService.selectCompanyUserQwListVO(user);
+        if (!list.isEmpty()){
+            String json = configService.selectConfigByKey("course.config");
+            CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+            Long sendDelayTime = config.getSendDelayTime();
+            List<CompletableFuture<Void>> futures = new ArrayList<>();
+            for (CompanyUserQwListVO companyUserQwListVO : list) {
+                CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
+                    CompanyUserDelayTime companyUserDelayTime = companyUserDelayTimeService.selectCompanyUserDelayTimeByCompanyUser(companyUserQwListVO.getCompanyId(), companyUserQwListVO.getUserId());
+                    if (ObjectUtil.isEmpty(companyUserDelayTime)) {
+                        companyUserQwListVO.setSendDelayTime(sendDelayTime);
+                    } else {
+                        companyUserQwListVO.setSendDelayTime(companyUserDelayTime.getSendDelayTime());
+                    }
+                    //是否绑定
+                    if(QwStatusEnum.BOUND.getCode() == companyUserQwListVO.getQwStatus()){
+                        if(!companyUserQwListVO.getQwUserId().isEmpty()){
+                            Long[] ids = Arrays.stream(companyUserQwListVO.getQwUserId().split(","))
+                                    .map(Long::parseLong)
+                                    .toArray(Long[]::new);
+                            List<QwUserVO> qwUserVOS = qwUserService.selectQwUserVOByIds(ids);
+                            companyUserQwListVO.setQwUsers(qwUserVOS);
+                        }
+                    }
+                });
+                futures.add(future);
+            }
+            CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join();
+        }
+        return getDataTable(list);
+    }
+
+    @Log(title = "用户管理导出", businessType = BusinessType.EXPORT)
+    @PreAuthorize("@ss.hasPermi('company:user:export')")
+    @GetMapping("/export")
+    public AjaxResult export(CompanyUser user)
+    {
+        List<CompanyUser> list = companyUserService.selectCompanyUserList(user);
+        ExcelUtil<CompanyUser> util = new ExcelUtil<CompanyUser>(CompanyUser.class);
+        return util.exportExcel(list, "用户数据");
+    }
+
+
+    @Log(title = "销售信息导入", businessType = BusinessType.IMPORT,isStoreLog = true,logParam = {"销售","信息导入"})
+    @PreAuthorize("@ss.hasPermi('company:user:import')")
+    @PostMapping("/importCompanyUser")
+    public AjaxResult importData(@RequestParam("file") MultipartFile file, boolean updateSupport) throws Exception
+    {
+        ExcelUtil<CompanyUserImportVO> util = new ExcelUtil<>(CompanyUserImportVO.class);
+        List<CompanyUserImportVO> list = util.importExcel(file.getInputStream());
+        String message = companyUserService.importCompanyUser(list, updateSupport);
+        return AjaxResult.success(message);
+    }
+
+
+    @GetMapping("/importTemplate")
+    public AjaxResult importTemplate()
+    {
+        ExcelUtil<CompanyUserImportVO> util = new ExcelUtil<>(CompanyUserImportVO.class);
+        return util.importTemplateExcel("销售数据");
+    }
+
+
+
+    /**
+     * 根据用户编号获取详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('company:user:query')")
+    @GetMapping(value = { "/", "/{userId}" })
+    public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
+    {
+        AjaxResult ajax = AjaxResult.success();
+        CompanyRole companyRoleMap=new CompanyRole();
+
+        CompanyUser userById = companyUserService.selectCompanyUserById(userId);
+        companyRoleMap.setCompanyId(userById.getCompanyId());
+        List<CompanyRole> roles = roleService.selectCompanyRoleList(companyRoleMap);
+
+        ajax.put("roles", CompanyUser.isAdmin(userById.getUserType()) ? roles : roles.stream().filter(r -> r.getRoleKey()!="admin").collect(Collectors.toList()));
+
+        CompanyPost postMap=new CompanyPost();
+        postMap.setCompanyId(userById.getCompanyId());
+        ajax.put("posts", postService.selectCompanyPostList(postMap));
+        if (StringUtils.isNotNull(userId))
+        {
+            CompanyUser companyUser=companyUserService.selectCompanyUserById(userId);
+            ajax.put(AjaxResult.DATA_TAG, companyUser);
+            ajax.put("postIds", postService.selectPostListByUserId(userId));
+            ajax.put("roleIds", roleService.selectRoleListByUserId(userId));
+
+
+        }
+        return ajax;
+    }
+
+    /**
+     * 根据用户编号获取详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('company:user:query')")
+    @GetMapping("/addInfo/{companyId}")
+    public AjaxResult addInfo(@PathVariable(value = "companyId", required = true) Long companyId)
+    {
+        AjaxResult ajax = AjaxResult.success();
+
+        CompanyRole companyRoleMap=new CompanyRole();
+        companyRoleMap.setCompanyId(companyId);
+        List<CompanyRole> roles = roleService.selectCompanyRoleList(companyRoleMap);
+
+        ajax.put("roles", CompanyUser.isAdmin("01") ? roles : roles.stream().filter(r -> r.getRoleKey()!="admin").collect(Collectors.toList()));
+
+        CompanyPost postMap=new CompanyPost();
+        postMap.setCompanyId(companyId);
+        ajax.put("posts", postService.selectCompanyPostList(postMap));
+
+        return ajax;
+    }
+
+    /**
+     * 新增用户
+     */
+    @PreAuthorize("@ss.hasPermi('company:user:add')")
+    @Log(title = "用户管理", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@Validated @RequestBody CompanyUser user)
+    {
+        if (!PatternUtils.checkPassword(user.getPassword())) {
+            return AjaxResult.error("密码格式不正确,需包含字母、数字和特殊字符,长度为 8-20 位");
+        }
+
+        //判断用户数量是否已达到上线
+
+        Integer count=companyUserService.selectCompanyUserCountByCompanyId(user.getCompanyId());
+        Company company=companyService.selectCompanyById(user.getCompanyId());
+
+        if(count>company.getLimitUserCount()){
+            return AjaxResult.error("用户数量已达到上限");
+        }
+        user.setCompanyId(user.getCompanyId());
+        if (UserConstants.NOT_UNIQUE.equals(String.valueOf(companyUserService.checkUserName(user.getUserName()))))
+        {
+            return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
+        }
+        if (!StringUtil.strIsNullOrEmpty(user.getDomain())){
+            user.setDomain(user.getDomain().replaceAll("^[\\s\\u2005]+", ""));
+        }
+
+        user.setCreateBy(SecurityUtils.getUsername());
+        user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
+        user.setCreateTime(new Date());
+        user.setUserType("01");//一般用户
+        user.setIsAudit(1);
+        return toAjax(companyUserService.insertUser(user));
+    }
+
+    /**
+     * 生成创建销售的二维码
+     */
+
+    @PreAuthorize("@ss.hasPermi('company:user:addCodeUrl')")
+    @Log(title = "生成创建销售的二维码", businessType = BusinessType.INSERT)
+    @PostMapping("/addCodeUrl")
+    public R addCodeUrl( @RequestBody CompanyUserCodeParam user) throws Exception {
+
+        QwCompany qwCompany = iQwCompanyService.getQwCompanyByRedis(user.getCorpId());
+        if (qwCompany == null || qwCompany.getCorpId() == null){
+            return R.error("企业信息不存在");
+        }
+
+        //部门
+        Long deptId = user.getDeptId();
+
+        //角色组
+        Long[] roleIds = user.getRoleIds();
+
+        //区域
+        String addressId = user.getAddressId();
+
+
+        Map<String, Object> stateMap = new HashMap<>();
+        stateMap.put("companyId", user.getCompanyId());
+        stateMap.put("deptId", deptId);
+        stateMap.put("roleIds", roleIds); // 数组可以直接存放
+        stateMap.put("addressId", addressId);
+
+        // 使用JSON库将Map转换为字符串
+        ObjectMapper objectMapper = new ObjectMapper();
+        String status = objectMapper.writeValueAsString(stateMap);
+
+        // 如果要将status作为URL参数传递,记得进行URL编码!
+        String encodedStatus = URLEncoder.encode(status, StandardCharsets.UTF_8.toString());
+
+        String url="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+user.getCorpId()+"&redirect_uri=" +
+                "http://"+qwCompany.getRealmNameUrl()+"/loginqw/pages/companyLogin/index?corpId="+user.getCorpId() +
+                "&response_type=code&scope=snsapi_base&state="+encodedStatus+"&agentid="+qwCompany.getServerAgentId()+"#wechat_redirect";
+
+        R andUpload = QRCodeUtils.createAndUpload(url);
+        return  R.ok().put("data",andUpload);
+    }
+    /**
+     * 修改用户
+     */
+    @PreAuthorize("@ss.hasPermi('company:user:edit')")
+    @Log(title = "用户管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@Validated @RequestBody CompanyUser user)
+    {
+
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        user.setUpdateBy(SecurityUtils.getUsername());
+
+        if (!StringUtil.strIsNullOrEmpty(user.getDomain())){
+            user.setDomain(user.getDomain().replaceAll("^[\\s\\u2005]+", ""));
+        }
+
+        CompanyUser companyUser = companyUserService.selectCompanyUserById(user.getUserId());
+
+        if (!companyUser.getUserName().equals(user.getUserName())){
+            if (UserConstants.NOT_UNIQUE.equals(String.valueOf(companyUserService.checkUserName(user.getUserName()))))
+            {
+                return AjaxResult.error("修改员工账号'" + user.getUserName() + "'失败,员工账号已存在");
+            }
+        }
+
+
+        logger.info("用户管理-修改用户:"+user.getUserName()+"/登陆人:"+loginUser.getUser().getUserId()+"/名字:"+loginUser.getUser().getUserName()+"/修改的角色:"+ Arrays.toString(user.getRoleIds()));
+        return toAjax(companyUserService.updateUser(user));
+    }
+
+    /**
+     * 删除用户
+     */
+    @PreAuthorize("@ss.hasPermi('company:user:remove')")
+    @Log(title = "用户管理", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{userIds}")
+    public AjaxResult remove(@PathVariable Long[] userIds)
+    {
+        for (Long userId : userIds) {
+            CompanyUser companyUser = companyUserService.selectCompanyUserById(userId);
+            CompanyUserDelayTime companyUserDelayTime = companyUserDelayTimeService.selectCompanyUserDelayTimeByCompanyUser(companyUser.getCompanyId(),userId);
+            if (ObjectUtil.isNotEmpty(companyUserDelayTime)){
+                companyUserDelayTimeService.deleteCompanyUserDelayTimeById(companyUserDelayTime.getId());
+            }
+        }
+        return toAjax(companyUserService.deleteCompanyUserByIds(userIds));
+    }
+
+    /**
+     * 重置密码
+     */
+    @PreAuthorize("@ss.hasPermi('company:user:edit')")
+    @Log(title = "用户管理", businessType = BusinessType.UPDATE)
+    @PutMapping("/resetPwd")
+    public AjaxResult resetPwd(@RequestBody CompanyUser user)
+    {
+        if (!PatternUtils.checkPassword(user.getPassword())) {
+            return AjaxResult.error("密码格式不正确,需包含字母、数字和特殊字符,长度为 8-20 位");
+        }
+
+        String newPassword = SecurityUtils.encryptPassword(user.getPassword());
+        int i = companyUserService.resetUserPwdByUserId(user.getUserId(), newPassword);
+
+        if (i > 0) {
+            // 更新缓存用户密码
+            redisCache.deleteObject("newCompanyUser:" + user.getCompanyId() + ":" + user.getUserName());
+        }
+
+        return toAjax(i);
+    }
+
+    /**
+     * 状态修改
+     */
+    @PreAuthorize("@ss.hasPermi('company:user:edit')")
+    @Log(title = "用户管理", businessType = BusinessType.UPDATE)
+    @PutMapping("/changeStatus")
+    public AjaxResult changeStatus(@RequestBody CompanyUser user)
+    {
+        //管理员的状态不能修改
+        CompanyUser companyUser=companyUserService.selectCompanyUserById(user.getUserId());
+        if(companyUser.isAdmin()){
+            return AjaxResult.error("不能修改管理员状态");
+        }
+        user.setUpdateBy(SecurityUtils.getUsername());
+        return toAjax(companyUserService.updateCompanyUser(user));
+    }
+
+
+
+
+    /**
+     * 获取区域
+     */
+    @GetMapping("/getCitysAreaList")
+    public R getCitysAreaList(){
+        return R.ok().put("data",companyUserService.getCitysAreaList());
+    }
+
+    /**
+     * 批量修改 销售的所属区域(临时的)
+     */
+    @PostMapping("/updateCompanyUserAreaList")
+    public R updateCompanyUserAreaList(@RequestBody CompanyUserAreaParam param)
+    {
+        return companyUserService.updateCompanyUserAreaList(param);
+    }
+
+
+    @GetMapping("/generateSubDomain")
+    public R generateSubDomain(CompanyUser user){
+        //获取后台配置
+        String json= configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+        // 生成二级域名
+        String subDomain = "http://" + DomainUtil.generateSubDomain(config.getCourseDomainName(), 6, String.valueOf(SecurityUtils.getLoginUser().getUser().getUserId()));
+        return  R.ok().put("data",subDomain);
+    }
+
+    @Log(title = "设置是否需要单独注册会员", businessType = BusinessType.UPDATE)
+    @PutMapping("/setRegister")
+    public AjaxResult setIsRegisterMember(@RequestParam Boolean status, @RequestBody List<Long> userIds) {
+        Boolean r = companyUserService.setIsRegisterMember(status, userIds);
+        if (r) {
+            return AjaxResult.success();
+        } else {
+            return AjaxResult.error("操作失败");
+        }
+    }
+
+    @Log(title = "是否允许所有方式注册会员", businessType = BusinessType.UPDATE)
+    @PutMapping("/allowedAllRegister")
+    public AjaxResult isAllowedAllRegister(@RequestParam Boolean status, @RequestBody List<Long> userIds) {
+        Boolean r = companyUserService.isAllowedAllRegister(status, userIds);
+        if (r) {
+            return AjaxResult.success();
+        } else {
+            return AjaxResult.error("操作失败");
+        }
+    }
+    @PostMapping("/common/uploadOSS")
+    public R uploadOSS(@RequestParam("file") MultipartFile file,
+                       @RequestParam("userId") String userId) throws Exception {
+        String url = companyUserService.uploadQrCode(file, userId);
+        return R.ok().put("url", url);
+    }
+
+
+    /**
+     * 销售解除绑定医生
+     */
+    @PreAuthorize("@ss.hasPermi('qw:companyUser:unBindDoctorId')")
+    @Log(title = "销售解除绑定医生", businessType = BusinessType.UPDATE)
+    @GetMapping("/unBindDoctorId/{userId}")
+    public R bindDoctorId(@PathVariable("userId") Long userId){
+        return companyUserService.unBindDoctor(userId);
+    }
+
+    /**
+     * 销售绑定医生
+     */
+    @PreAuthorize("@ss.hasPermi('qw:companyUser:bindDoctorId')")
+    @Log(title = "销售绑定医生", businessType = BusinessType.UPDATE)
+    @PostMapping("/bindDoctorId")
+    public R unBindDoctorId(@RequestBody CompanyUser companyUser){
+        return companyUserService.bindDoctor(companyUser);
+    }
+
+    /**
+     * 批量修改角色
+     * @param batchUserRolesVO
+     */
+    @PreAuthorize("@ss.hasPermi('company:user:edit')")
+    @Log(title = "批量修改角色", businessType = BusinessType.UPDATE)
+    @PostMapping("/updateBatchUserRoles")
+    public R updateBatchUserRoles(@RequestBody BatchUserRolesVO batchUserRolesVO){
+        Assert.notEmpty(batchUserRolesVO.getRoleIds(), "角色不能为空");
+        Assert.notEmpty(batchUserRolesVO.getUserIds(), "用户不能为空");
+        return companyUserService.updateBatchUserRoles(batchUserRolesVO);
+    }
+
+
+    @ApiOperation("校验客服是否注册新的im")
+    @PostMapping("/accountCheck")
+    public R accountCheck(@RequestBody Map<String, String> userIdMap){
+        //获取管理员token
+        String userId = userIdMap.get("userId");
+        String adminToken = openIMService.getAdminToken();
+        JSONObject requestBody = new JSONObject();
+        // 解析响应
+        if (StringUtils.isNotEmpty(adminToken)) {
+            //查询用户是否注册
+            ArrayList<String> userIds = new ArrayList<>();
+            requestBody = new JSONObject();
+            userIds.add(userId);
+            requestBody.put("checkUserIDs", userIds);
+            String body = HttpRequest.post(IMConfig.URL+"/user/account_check")
+                    .header("operationID", String.valueOf(System.currentTimeMillis()))
+                    .header("token", adminToken)
+                    .body(requestBody.toString())
+                    .execute()
+                    .body();
+            JSONObject jsonObject = new JSONObject(body);
+            JSONArray results = jsonObject.getJSONObject("data").getJSONArray("results");
+            if (results != null && results.length() > 0) {
+                JSONObject resultObj = results.getJSONObject(0);
+                int accountStatus = resultObj.getInt("accountStatus");
+                //未注册自动注册
+                if (accountStatus==0){
+                    String s = userId.replaceFirst("^C", "");
+                    CompanyUser companyUser = companyUserService.selectCompanyUserById(Long.parseLong(s));
+                    if (null==companyUser){
+                        return R.error("用户不存在");
+                    }
+                    ArrayList<Object> users = new ArrayList<>();
+                    HashMap<String, String> map = new HashMap<>();
+                    map.put("userID",userId);
+                    map.put("nickname",companyUser.getNickName());
+                    map.put("faceURL",companyUser.getAvatar());
+                    users.add(map);
+                    requestBody = new JSONObject();
+                    //userIds.add(userId);
+                    requestBody.put("users", users);
+                    String registerBody = HttpRequest.post(IMConfig.URL+"/user/user_register")
+                            .header("operationID", String.valueOf(System.currentTimeMillis()))
+                            .header("token", adminToken).body(requestBody.toString()).execute().body();
+                }
+            } else {
+                return R.error("返回结果为空");
+            }
+           /* HashMap<String, String> tokenMap = new HashMap<>();
+            tokenMap.put("platformID","1");
+            tokenMap.put("userID",userId);*/
+            requestBody = new JSONObject();
+            requestBody.put("platformID",5);
+            requestBody.put("userID",userId);
+            String body1 = HttpRequest.post(IMConfig.URL+"/auth/get_user_token")
+                    .header("operationID", String.valueOf(System.currentTimeMillis()))
+                    .header("token", adminToken)
+                    .body(requestBody.toString()).execute().body();
+            JSONObject userJson = new JSONObject(body1);
+            JSONObject userData = userJson.getJSONObject("data");
+            String userToken = userData.getString("token");
+            return R.ok().put("token", userToken);
+        } else {
+            return R.error("获取管理员token失败");
+        }
+    }
+    @ApiOperation("添加好友")
+    @PostMapping("/importFriend")
+    public R importFriend(@RequestBody HashMap<String,Object> map){
+        String ownerUserID = (String) map.get("ownerUserID");
+        List<String> friendUserIDs = (List<String>)map.get("friendUserIDs");
+        OpenImResponseDTO openImResponseDTO = openIMService.importFriend(ownerUserID, friendUserIDs);
+        return R.ok().put("data",openImResponseDTO);
+    }
+}

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

@@ -42,7 +42,7 @@ public class FsCoursePlaySourceConfigController extends BaseController {
     private final TokenService tokenService;
     private final ISysConfigService configService;
 
-    @PreAuthorize("@ss.hasPermi('course:playSourceConfig:list')")
+//    @PreAuthorize("@ss.hasPermi('course:playSourceConfig:list')")
     @GetMapping("/list")
     public TableDataInfo list(@RequestParam(required = false) String name,
                               @RequestParam(required = false) String appid,

+ 5 - 1
fs-admin/src/main/java/com/fs/course/controller/FsCourseTrafficLogController.java

@@ -70,7 +70,11 @@ public class FsCourseTrafficLogController extends BaseController
             param.setYear(Integer.parseInt(parts[0]));
             param.setMonth(Integer.parseInt(parts[1]));
         }
-        List<FsCourseTrafficLogListVO> list = fsCourseTrafficLogService.selectTrafficByCompany(param);
+        List<FsCourseTrafficLogListVO> list = fsCourseTrafficLogService.selectTrafficNew(param);
+        //格式化每个记录的流量为 GB 字符串
+        for (FsCourseTrafficLogListVO vo : list) {
+            vo.formatTraffic();
+        }
         ExcelUtil<FsCourseTrafficLogListVO> util = new ExcelUtil<FsCourseTrafficLogListVO>(FsCourseTrafficLogListVO.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);
     }
 

+ 16 - 0
fs-admin/src/main/java/com/fs/course/controller/FsUserCourseController.java

@@ -8,6 +8,7 @@ import com.fs.common.core.domain.R;
 import com.fs.common.core.domain.model.LoginUser;
 import com.fs.common.utils.ServletUtils;
 import com.fs.course.config.CourseConfig;
+import com.fs.course.params.FsUserCourseConfigParam;
 import com.fs.course.service.IFsUserCourseVideoService;
 import com.fs.course.vo.FsUserCourseListPVO;
 import com.fs.framework.web.service.TokenService;
@@ -341,4 +342,19 @@ public class FsUserCourseController extends BaseController
         redisCacheUtil.delRedisKey("getCourseList");
         return toAjax(1);
     }
+
+    /**
+     * 修改配置
+     **/
+    @PreAuthorize("@ss.hasPermi('course:userCourse:editConfig')")
+    @Log(title = "课程配置", businessType = BusinessType.UPDATE)
+    @PostMapping("/editConfig")
+    public R editConfig(@RequestBody FsUserCourseConfigParam params){
+        fsUserCourseService.editConfig(params.getId(), params.getConfigJson());
+        redisCacheUtil.delRedisKey("getCourseList");
+        redisCacheUtil.delRedisKey("h5user:course:video:list:all");
+        redisCacheUtil.delRedisKey("h5user:course:list:all");
+        redisCacheUtil.delRedisKey("cache:video");
+        return R.ok();
+    }
 }

+ 4 - 0
fs-admin/src/main/java/com/fs/course/controller/FsUserCoursePeriodController.java

@@ -161,14 +161,17 @@ public class FsUserCoursePeriodController extends BaseController {
 
     @PreAuthorize("@ss.hasPermi('course:period:updateCourseTime')")
     @PostMapping("/updateCourseTime")
+    @Log(title = "会员营期修改课程时间", businessType = BusinessType.UPDATE)
     public R updateCourseTime(@RequestBody UpdateCourseTimeVo vo){
         return fsUserCoursePeriodDaysService.updateCourseTime(vo);
     }
     @PostMapping("/updateCourseDate")
+    @Log(title = "会员营期修改CourseDate", businessType = BusinessType.UPDATE)
     public R updateCourseDate(@RequestBody UpdateCourseTimeVo vo){
         return fsUserCoursePeriodDaysService.updateCourseDate(vo);
     }
     @PostMapping("/updateListCourseData")
+    @Log(title = "会员营期修改ListCourseData", businessType = BusinessType.UPDATE)
     public R updateListCourseData(@RequestBody List<FsUserCoursePeriodDays> entity){
         return fsUserCoursePeriodDaysService.updateListCourseData(entity);
     }
@@ -275,6 +278,7 @@ public class FsUserCoursePeriodController extends BaseController {
 
     @PreAuthorize("@ss.hasPermi('course:period:setCompanyRedPacket')")
     @ApiOperation("按公司批量保存设置红包金额")
+    @Log(title = "按公司批量保存设置红包金额", businessType = BusinessType.UPDATE)
     @PostMapping("/batchRedPacket/byCompany")
     public R batchRedPacketByCompany(@Validated @RequestBody BatchCompanyRedPackageParam param) {
         try {

+ 21 - 0
fs-admin/src/main/java/com/fs/course/params/FsUserCourseConfigParam.java

@@ -0,0 +1,21 @@
+package com.fs.course.params;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+@ApiModel("过程页配置参数实体")
+@Data
+public class FsUserCourseConfigParam {
+
+    @NotNull(message = "课程ID不能为空")
+    @ApiModelProperty("课程ID")
+    private Long id;
+
+    @NotBlank(message = "配置信息不能为空")
+    @ApiModelProperty("配置信息")
+    private String configJson;
+}

+ 59 - 0
fs-admin/src/main/java/com/fs/his/controller/FsCompanyController.java

@@ -217,6 +217,65 @@ public class FsCompanyController extends BaseController {
 
     }
 
+
+    /**
+     * @Description: 红包充值功能 因公司余额的变动关联的地方太多,现在把充值红包的金额单独提出来 不合计到公司余额中
+     * @Param:
+     * @Return:
+     * @Author xgb
+     * @Date 2025/11/3 11:08
+     */
+    @PreAuthorize("@ss.hasPermi('his:company:redRecharge')")
+    @Log(title = "红包充值", businessType = BusinessType.INSERT)
+    @PostMapping(value = "/redRecharge")
+    @Transactional
+    @RepeatSubmit
+    public R redRecharge(@RequestBody CompanyRechargeParam param)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        CompanyRecharge redRecharge=new CompanyRecharge();
+        String orderSn =  OrderCodeUtils.getOrderSn();
+        if(StringUtils.isEmpty(orderSn)){
+            return R.error("订单生成失败,请重试");
+        }
+        redRecharge.setRechargeNo(orderSn);
+        redRecharge.setCompanyId(param.getCompanyId());
+        redRecharge.setMoney(param.getMoney());
+        redRecharge.setCreateUserId(loginUser.getUser().getUserId());
+        redRecharge.setIsAudit(0);
+        redRecharge.setStatus(0);
+        redRecharge.setRemark(param.getRemark());
+        redRecharge.setPayType(3);
+        redRecharge.setBusinessType(1);// 红包充值
+        rechargeService.insertCompanyRecharge(redRecharge);
+        return R.ok("提交成功,等待审核");
+
+    }
+
+    @PreAuthorize("@ss.hasPermi('his:company:redDeduct')")
+    @Log(title = "企业扣款", businessType = BusinessType.INSERT)
+    @PostMapping(value = "/redDeduct")
+    @Transactional
+    @RepeatSubmit
+    public R redDeduct(@RequestBody CompanyDeductParam param)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        CompanyDeduct deduct=new CompanyDeduct();
+        String orderSn =  OrderCodeUtils.getOrderSn();
+        if(StringUtils.isEmpty(orderSn)){
+            return R.error("订单生成失败,请重试");
+        }
+        deduct.setDeductNo(orderSn);
+        deduct.setCompanyId(param.getCompanyId());
+        deduct.setMoney(param.getMoney());
+        deduct.setCreateUserId(loginUser.getUser().getUserId());
+        deduct.setIsAudit(0);
+        deduct.setRemark(param.getRemark());
+        deduct.setBusinessType(1); // 红包扣款
+        deductService.insertCompanyDeduct(deduct);
+        return R.ok("提交成功,等待审核");
+    }
+
     @PreAuthorize("@ss.hasPermi('his:company:deduct')")
     @Log(title = "企业扣款", businessType = BusinessType.INSERT)
     @PostMapping(value = "/deduct")

+ 18 - 13
fs-admin/src/main/java/com/fs/his/controller/FsCompanyDeductController.java

@@ -139,19 +139,24 @@ public class FsCompanyDeductController extends BaseController
         deduct.setRemark(param.getRemark());
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         if(deduct.getIsAudit()==1){
-            Company company=companyService.selectCompanyByIdForUpdate(deduct.getCompanyId());
-            company.setMoney(company.getMoney().subtract(deduct.getMoney()));
-            deduct.setBalance(company.getMoney());
-            companyService.updateCompany(company);
-            //生成流水
-            CompanyMoneyLogs log=new CompanyMoneyLogs();
-            log.setCompanyId(deduct.getCompanyId());
-            log.setMoney(deduct.getMoney().multiply(new BigDecimal(-1)));
-            log.setRemark(deduct.getRemark());
-            log.setLogsType(2);
-            log.setBalance(company.getMoney());
-            log.setCreateTime(new Date());
-            moneyLogsService.insertCompanyMoneyLogs(log);
+            if(1==param.getBusinessType()){// 红包充值
+                // 更新红包充值余额redis字段
+                companyService.redPacketTopUpCompany(deduct.getCompanyId(),deduct.getMoney(),"2");
+            }else {
+                Company company=companyService.selectCompanyByIdForUpdate(deduct.getCompanyId());
+                company.setMoney(company.getMoney().subtract(deduct.getMoney()));
+                deduct.setBalance(company.getMoney());
+                companyService.updateCompany(company);
+                //生成流水
+                CompanyMoneyLogs log=new CompanyMoneyLogs();
+                log.setCompanyId(deduct.getCompanyId());
+                log.setMoney(deduct.getMoney().multiply(new BigDecimal(-1)));
+                log.setRemark(deduct.getRemark());
+                log.setLogsType(2);
+                log.setBalance(company.getMoney());
+                log.setCreateTime(new Date());
+                moneyLogsService.insertCompanyMoneyLogs(log);
+            }
         }
         deduct.setAuditTime(new Date());
         deduct.setAuditUserId(loginUser.getUser().getUserId());

+ 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);
+    }
+
 //    /**
 //     * 新增分账明细
 //     */

+ 20 - 13
fs-admin/src/main/java/com/fs/his/controller/FsCompanyRechargeController.java

@@ -137,21 +137,28 @@ public class FsCompanyRechargeController extends BaseController
         companyRecharge.setRemark(param.getRemark());
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         if(companyRecharge.getIsAudit()==1){
-            Company company=companyService.selectCompanyByIdForUpdate(companyRecharge.getCompanyId());
-            company.setMoney(company.getMoney().add(companyRecharge.getMoney()));
-            companyRecharge.setBalance(company.getMoney());
-            companyService.updateCompany(company);
-            //生成流水
-            CompanyMoneyLogs log=new CompanyMoneyLogs();
-            log.setCompanyId(companyRecharge.getCompanyId());
-            log.setMoney(companyRecharge.getMoney());
-            log.setRemark(companyRecharge.getRemark());
-            log.setLogsType(1);
-            log.setBalance(company.getMoney());
-            log.setCreateTime(new Date());
-            moneyLogsService.insertCompanyMoneyLogs(log);
+            if(1==companyRecharge.getBusinessType()){// 红包充值
+                // 更新红包充值余额redis字段
+                companyService.redPacketTopUpCompany(companyRecharge.getCompanyId(),companyRecharge.getMoney(),"1");
+            }else {
+                Company company=companyService.selectCompanyByIdForUpdate(companyRecharge.getCompanyId());
+                company.setMoney(company.getMoney().add(companyRecharge.getMoney()));
+                companyRecharge.setBalance(company.getMoney());
+                companyService.updateCompany(company);
+                //生成流水
+                CompanyMoneyLogs log=new CompanyMoneyLogs();
+                log.setCompanyId(companyRecharge.getCompanyId());
+                log.setMoney(companyRecharge.getMoney());
+                log.setRemark(companyRecharge.getRemark());
+                log.setLogsType(1);
+                log.setBalance(company.getMoney());
+                log.setCreateTime(new Date());
+                moneyLogsService.insertCompanyMoneyLogs(log);
+
+            }
             companyRecharge.setPayTime(new Date());
             companyRecharge.setStatus(1);
+
         }
 
         companyRecharge.setAuditTime(new Date());

+ 23 - 0
fs-admin/src/main/java/com/fs/his/controller/FsDoctorController.java

@@ -26,6 +26,9 @@ import com.fs.his.service.IFsDoctorService;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.common.core.page.TableDataInfo;
 
+import static com.fs.his.utils.PhoneUtil.decryptAutoPhoneMk;
+import static com.fs.his.utils.PhoneUtil.encryptPhone;
+
 /**
  * 医生管理Controller
  *
@@ -291,4 +294,24 @@ public class FsDoctorController extends BaseController
         return R.ok().put("data", new PageInfo<>(list));
     }
 
+
+    @GetMapping("/getDocVoList")
+    public TableDataInfo getDocVoList(FsDoctorParam param) {
+        startPage();
+        List<FsDoctorVO> list = fsDoctorService.selectDocVOByNameAndPhone(param);
+        if (list == null || list.isEmpty()) {
+            param.setMobile(encryptPhone(param.getMobile()));
+            list = fsDoctorService.selectDocVOByNameAndPhone(param);
+        }
+
+        if (list != null) {
+            list.forEach( item -> {
+                if (item.getMobile() != null)
+                    item.setMobile(decryptAutoPhoneMk(item.getMobile()));
+            });
+        }
+        return getDataTable(list);
+    }
+
+
 }

+ 49 - 9
fs-admin/src/main/java/com/fs/his/controller/FsIntegralOrderController.java

@@ -1,13 +1,13 @@
 package com.fs.his.controller;
 
 import cn.hutool.core.util.StrUtil;
-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.CloudHostUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.his.domain.FsIntegralOrder;
@@ -17,7 +17,8 @@ import com.fs.his.enums.ShipperCodeEnum;
 import com.fs.his.param.FsIntegralOrderParam;
 import com.fs.his.service.IFsExpressService;
 import com.fs.his.service.IFsIntegralOrderService;
-import com.fs.his.utils.PhoneUtil;
+import com.fs.his.service.IFsStoreOrderService;
+import com.fs.utils.OrderContextHolder;
 import com.fs.his.vo.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -44,6 +45,9 @@ public class FsIntegralOrderController extends BaseController
     private IFsIntegralOrderService fsIntegralOrderService;
     @Autowired
     private IFsExpressService expressService;
+
+    @Autowired
+    private IFsStoreOrderService fsStoreOrderService;
     /**
      * 查询积分商品订单列表
      */
@@ -98,18 +102,33 @@ public class FsIntegralOrderController extends BaseController
     @GetMapping(value = "/getExpress/{id}")
     public R getExpress(@PathVariable("id") Long id)
     {
+        /**
+         * selectFsIntegralOrderByOrderId查询的数据表:fs_integral_order
+         * 需要执行添加字段的DDL语句
+         * ALTER TABLE `fs_integral_order`
+         * ADD COLUMN `login_account` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '代服物流查询账号';
+         * */
         FsIntegralOrder fsIntegralOrder = fsIntegralOrderService.selectFsIntegralOrderByOrderId(id);
         ExpressInfoDTO expressInfoDTO=null;
-        if(StringUtils.isNotEmpty(fsIntegralOrder.getDeliverySn())){
-            String lastFourNumber = "";
-            if (fsIntegralOrder.getDeliveryCode().equals(ShipperCodeEnum.SF.getValue())) {
+        //代服管家 查询自己的物流
+        if (CloudHostUtils.hasCloudHostName("金牛明医")) {
+            FsStoreOrder fsStoreOrder = new FsStoreOrder();
+            fsStoreOrder.setOrderCode(fsIntegralOrder.getOrderCode());
+            //线程携带订单信息
+            OrderContextHolder.setIntegralOrder(fsIntegralOrder);
+            expressInfoDTO = fsStoreOrderService.getDfExpressInfoDTO(fsStoreOrder);
+        }else {
+            if (StringUtils.isNotEmpty(fsIntegralOrder.getDeliverySn())) {
+                String lastFourNumber = "";
+                if (fsIntegralOrder.getDeliveryCode().equals(ShipperCodeEnum.SF.getValue())) {
 
-                lastFourNumber = fsIntegralOrder.getUserPhone();
-                if (lastFourNumber.length() == 11) {
-                    lastFourNumber = StrUtil.sub(lastFourNumber, lastFourNumber.length(), -4);
+                    lastFourNumber = fsIntegralOrder.getUserPhone();
+                    if (lastFourNumber.length() == 11) {
+                        lastFourNumber = StrUtil.sub(lastFourNumber, lastFourNumber.length(), -4);
+                    }
                 }
+                expressInfoDTO = expressService.getExpressInfo(fsIntegralOrder.getOrderCode(), fsIntegralOrder.getDeliveryCode(), fsIntegralOrder.getDeliverySn(), lastFourNumber);
             }
-            expressInfoDTO=expressService.getExpressInfo(fsIntegralOrder.getOrderCode(),fsIntegralOrder.getDeliveryCode(),fsIntegralOrder.getDeliverySn(),lastFourNumber);
         }
         return R.ok().put("data",expressInfoDTO);
     }
@@ -178,4 +197,25 @@ public class FsIntegralOrderController extends BaseController
         String orderCode = requestBody.get("orderCode");
         return toAjax(fsIntegralOrderService.cancelOrder(orderCode));
     }
+    /**
+     * 申请退款
+     * 接口不校验是否发货
+     * */
+    @PreAuthorize("@ss.hasPermi('his:integralOrder:cancel')")
+    @Log(title = "积分商品订单", businessType = BusinessType.UPDATE)
+    @PostMapping("/mandatoryRefunds")
+    public AjaxResult mandatoryRefunds(@RequestBody Map<String, String> requestBody){
+        String orderCode = requestBody.get("orderCode");
+        return toAjax(fsIntegralOrderService.mandatoryRefunds(orderCode));
+    }
+
+    /**
+     * 确认收货
+     * todo:权限标识符待定
+     */
+    @Log(title = "积分商品订单", businessType = BusinessType.UPDATE)
+    @GetMapping("/finishOrder/{orderCode}")
+    public AjaxResult finishOrder(@PathVariable("orderCode") String orderCode) {
+        return toAjax(fsIntegralOrderService.finishOrder(orderCode));
+    }
 }

+ 6 - 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()!=""){

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

+ 31 - 4
fs-admin/src/main/java/com/fs/course/task/CompanyBalanceTask.java → fs-admin/src/main/java/com/fs/his/task/CompanyBalanceTask.java

@@ -1,14 +1,16 @@
-package com.fs.course.task;
+package com.fs.his.task;
 
 import com.fs.company.service.ICompanyService;
+import com.fs.company.vo.RedPacketMoneyVO;
 import com.fs.course.service.BalanceRollbackErrorService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.context.event.ApplicationReadyEvent;
-import org.springframework.context.event.EventListener;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
+import java.util.List;
+
 /**
- * @description: 公司余额同步定时任务
+ * @description: 公司余额同步定时任务 (红包余额)
  * @author: Xgb
  * @createDate: 2025/10/22
  * @version: 1.0
@@ -59,6 +61,31 @@ public class CompanyBalanceTask {
 
     }
 
+    /**
+     * @Description: 红包余额回滚(回滚的是客户没领取的红包),红包记录表中,两天没领取的记录不会再发送
+     * @Param: 每天0点执行一次
+     * @Return:
+     * @Author xgb
+     * @Date 2025/11/7 9:48
+     */
+    public void rollbackRedPacketMoney() throws Exception {
+        // 这个地方真加的是company money字段 xgb 红包余额独立后这个方法弃用
+        companyService.rollbackRedPacketMoney();
+    }
+
+    /**
+     * @Description: 每天晚上0点定时获取获取公司余额,记录到数据库中
+     * @Param:
+     * @Return:
+     * @Author xgb
+     * @Date 2025/11/4 10:43
+     */
+    public void recordRedPacketBalance() {
+        companyService.recordRedPacketBalance();
+    }
+
+
+
 
 
 }

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

+ 1 - 0
fs-admin/src/main/java/com/fs/his/task/Task.java

@@ -603,6 +603,7 @@ public class Task {
 
 
     public void redPacketAddMoney() throws Exception {
+        // 这个地方真加的是company money字段 xgb 红包余额独立后这个方法弃用
         List<RedPacketMoneyVO> redPacketMoneyVOS = fsCourseRedPacketLogMapper.selectFsCourseAddRedPacketLogByCompany();
         for (RedPacketMoneyVO redPacketMoneyVO : redPacketMoneyVOS) {
             companyService.addRedPacketCompanyMoney(redPacketMoneyVO.getMoney(), redPacketMoneyVO.getCompanyId());

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

@@ -11,6 +11,7 @@ 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.CloudHostUtils;
 import com.fs.common.utils.ParseUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.common.utils.poi.ExcelUtil;
@@ -192,7 +193,15 @@ public class FsStorePaymentScrmController extends BaseController
         }
 
         if(payment.getPayTypeCode().equals("weixin")){
-            String json = configService.selectConfigByKey("store.pay");
+            String json;
+            if (CloudHostUtils.hasCloudHostName("康年堂")){
+                json = configService.selectConfigByKey("his.pay");
+            } else {
+                json = configService.selectConfigByKey("store.pay");
+            }
+            if (StringUtils.isBlank(json)) {
+                return R.error("缺少支付相关配置");
+            }
             FsPayConfigScrm fsPayConfig = JSON.parseObject(json, FsPayConfigScrm.class);
             if (payment.getPayMode()!=null&&payment.getPayMode().equals("hf")){
                 String huifuId="";

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

+ 138 - 0
fs-admin/src/main/java/com/fs/qw/controller/QwDeptController.java

@@ -0,0 +1,138 @@
+package com.fs.qw.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.ServletUtils;
+import com.fs.common.utils.StringUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.qw.domain.QwDept;
+import com.fs.qw.mapper.QwCompanyMapper;
+import com.fs.qw.service.IQwDeptService;
+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 2024-08-27
+ */
+@RestController
+@RequestMapping("/qw/qwDept")
+public class QwDeptController extends BaseController
+{
+    @Autowired
+    private IQwDeptService qwDeptService;
+
+
+    /**
+     * 查询企业微信部门列表
+     */
+    @PreAuthorize("@ss.hasPermi('qw:qwDept:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(QwDept qwDept)
+    {
+        startPage();
+        List<QwDept> list = qwDeptService.selectQwDeptList(qwDept);
+        return getDataTable(list);
+    }
+    @Autowired
+    QwCompanyMapper qwCompanyMapper;
+
+    /**
+     * 同步企业微信 部门信息
+     */
+    @PreAuthorize("@ss.hasPermi('qw:qwDept:list')")
+    @GetMapping("/syncDept/{companyId}")
+    public R syncDept(@PathVariable("companyId") Long companyId){
+
+        List<String> strings = qwCompanyMapper.selectQwCompanyCorpIdListByCompanyId(companyId);
+        for (String string : strings) {
+            qwDeptService.insertOrUpdateQwDept(string);
+        }
+
+        return  R.ok();
+    }
+
+    /**
+     * 导出企业微信部门列表
+     */
+    @PreAuthorize("@ss.hasPermi('qw:qwDept:export')")
+    @Log(title = "企业微信部门", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(QwDept qwDept)
+    {
+        List<QwDept> list = qwDeptService.selectQwDeptList(qwDept);
+        ExcelUtil<QwDept> util = new ExcelUtil<QwDept>(QwDept.class);
+        return util.exportExcel(list, "企业微信部门数据");
+    }
+
+    /**
+     * 获取企业微信部门详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('qw:qwDept:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(qwDeptService.selectQwDeptById(id));
+    }
+
+    /**
+     * 新增企业微信部门
+     */
+    @PreAuthorize("@ss.hasPermi('qw:qwDept:add')")
+    @Log(title = "企业微信部门", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody QwDept qwDept)
+    {
+        return toAjax(qwDeptService.insertQwDept(qwDept));
+    }
+
+    /**
+     * 修改企业微信部门
+     */
+    @PreAuthorize("@ss.hasPermi('qw:qwDept:edit')")
+    @Log(title = "企业微信部门", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody QwDept qwDept)
+    {
+        return toAjax(qwDeptService.updateQwDept(qwDept));
+    }
+
+    /**
+     * 删除企业微信部门
+     */
+    @PreAuthorize("@ss.hasPermi('qw:qwDept:remove')")
+    @Log(title = "企业微信部门", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(qwDeptService.deleteQwDeptByIds(ids));
+    }
+
+    /**
+     * @Description: 获取企微部门 按Treeselect返回 每一个企微主体有自己的部门,按企微主体查询
+     * @Param:
+     * @Return:
+     * @Author xgb
+     * @Date 2025/10/30 9:33
+     */
+    @GetMapping("/treeselect")
+    public AjaxResult treeselect(QwDept qwDept)
+    {
+        if(StringUtils.isEmpty(qwDept.getCorpId())){
+            return AjaxResult.error("请选择企微主体");
+        }
+        List<QwDept> depts = qwDeptService.selectQwDeptList(qwDept);
+        return AjaxResult.success(qwDeptService.buildDeptTreeSelect(depts));
+    }
+
+}

+ 309 - 5
fs-admin/src/main/java/com/fs/qw/controller/QwUserController.java

@@ -1,22 +1,48 @@
 package com.fs.qw.controller;
 
+import com.alibaba.fastjson.JSON;
+import com.fs.common.annotation.Log;
+import com.fs.common.annotation.RepeatSubmit;
 import com.fs.common.core.domain.R;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
 import com.fs.common.core.domain.model.LoginUser;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
 import com.fs.common.utils.ServletUtils;
+import com.fs.company.domain.Company;
+import com.fs.company.domain.CompanyUser;
+import com.fs.company.mapper.CompanyUserMapper;
+import com.fs.company.service.ICompanyUserService;
+import com.fs.qw.domain.QwExternalContact;
 import com.fs.qw.domain.QwExternalContactTransferCompanyAudit;
+import com.fs.qw.domain.QwUser;
+import com.fs.qw.mapper.QwCompanyMapper;
+import com.fs.qw.mapper.QwExternalContactMapper;
 import com.fs.qw.param.QwFsUserParam;
+import com.fs.qw.param.QwUserBingParam;
+import com.fs.qw.param.QwUserListParam;
+import com.fs.qw.service.IQwDeptService;
 import com.fs.qw.service.IQwExternalContactTransferCompanyAuditService;
 import com.fs.qw.service.IQwUserService;
 import com.fs.qw.vo.QwOptionsVO;
+import com.fs.qw.vo.QwUserVO;
+import com.fs.qwApi.domain.QwExternalContactAllListResult;
+import com.fs.qwApi.domain.inner.ExternalContact;
+import com.fs.qwApi.domain.inner.ExternalContactInfo;
+import com.fs.qwApi.domain.inner.FollowInfo;
+import com.fs.qwApi.param.QwExternalListParam;
+import com.fs.qwApi.service.QwApiService;
+import com.fs.voice.utils.StringUtil;
 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.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
 
+import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
 
 /**
  * 企微用户Controller
@@ -29,8 +55,28 @@ import java.util.List;
 public class QwUserController extends BaseController {
     @Autowired
     private IQwUserService qwUserService;
+
     @Autowired
     private IQwExternalContactTransferCompanyAuditService auditService;
+
+    @Autowired
+    private ICompanyUserService companyUserService;
+
+    @Autowired
+    private CompanyUserMapper companyUserMapper;
+
+    @Autowired
+    private QwApiService qwApiService;
+
+    @Autowired
+    private QwCompanyMapper qwCompanyMapper;
+
+    @Autowired
+    private IQwDeptService qwDeptService;
+
+    @Autowired
+    private QwExternalContactMapper qwExternalContactMapper;
+
     @GetMapping("/getQwUserAll")
     public AjaxResult getQwUserAll(){
         return AjaxResult.success(qwUserService.getQwUserAll());
@@ -47,7 +93,265 @@ public class QwUserController extends BaseController {
    @GetMapping("/getMyQwCompanyList")
     public R getMyQwCompanyList()
     {
-        List<QwOptionsVO> list = qwUserService.selectQwCompanyListOptionsVOBySys();
+        List<QwOptionsVO> list = qwUserService.selectQwCompanyListOptionsVOAll();
         return  R.ok().put("data",list);
     }
+
+    /**
+     * 绑定企微用户
+     */
+    @PreAuthorize("@ss.hasPermi('qw:user:bind')")
+    @Log(title = "企微用户", businessType = BusinessType.UPDATE)
+    @PutMapping("/bindQwUser")
+    @RepeatSubmit
+    public R bindQwUser(@RequestBody QwUserBingParam qwUserParam)
+    {
+        CompanyUser companyUser = companyUserService.selectCompanyUserById(qwUserParam.getCompanyUserId());
+
+        String qwUserIdCompanyStr = companyUser.getQwUserId();
+        Set<String> qwUserIdCompanySet = new HashSet<>();
+        if (!StringUtil.strIsNullOrEmpty(qwUserIdCompanyStr)) {
+            String[] qwUserId = qwUserIdCompanyStr.split(",");
+            qwUserIdCompanySet = Arrays.stream(qwUserId)
+                    .filter(id -> !id.isEmpty())
+                    .collect(Collectors.toSet());
+        }
+
+        if (companyUser!=null){
+
+            //选择的企业微信账号为“”
+            if (StringUtil.strIsNullOrEmpty(qwUserParam.getId())&&qwUserParam.getCompanyUserId()!=null){
+                //制空企业微信的绑定
+                qwUserService.updateUserByUserId(qwUserParam.getCompanyUserId());
+
+                //制空销售的绑定
+                companyUserMapper.updateCompanyUserByNullQwUserID(companyUser.getUserId());
+
+            }else {
+                String idParam = qwUserParam.getId();
+                String[] splitParam = idParam.split(",");
+                Set<String> splitParamSet = Arrays.stream(splitParam)
+                        .filter(s -> !s.isEmpty())
+                        .collect(Collectors.toSet());
+
+                // 找出在 qwUserIdCompanySet 中存在但在 splitParamSet 中不存在的元素
+                Set<String> difference = new HashSet<>(qwUserIdCompanySet);
+                difference.removeAll(splitParamSet);
+
+                //制空绑定
+                if (!difference.isEmpty()){
+                    difference.forEach(id->{
+                        qwUserService.updateUnBindUserById(id);
+                    });
+
+                }
+
+
+                for (String paramId : splitParamSet) {
+                    QwUser qu= qwUserService.selectQwUserById(Long.parseLong(paramId));
+                    if (qu.getCompanyUserId()!=null&&!qu.getCompanyUserId().equals(qwUserParam.getCompanyUserId())){
+                        return R.error( qu.getQwUserName()+"已经被其他人绑定,请先解绑");
+                    }
+
+
+                    CompanyUser user = new CompanyUser();
+                    user.setQwUserId(qwUserParam.getId());
+                    user.setUserId(companyUser.getUserId());
+                    user.setQwStatus(1);
+                    companyUserMapper.updateCompanyUser(user);
+
+
+
+                    qu.setCompanyUserId(qwUserParam.getCompanyUserId());
+                    qu.setStatus(1);
+                    qu.setCompanyId(companyUser.getCompanyId());
+                    qwUserService.updateQwUser(qu);
+
+                }
+
+                //同步最后单独跑/先不异步了pp
+                for (String paramId : splitParamSet){
+
+                    //如果销售没绑定过,全刷,否则只同步新的增加的
+                    if (StringUtil.strIsNullOrEmpty(qwUserIdCompanyStr)){
+                        updateAndSyncQwUser(paramId, companyUser);
+
+                    }
+                    else if (!StringUtil.strIsNullOrEmpty(qwUserIdCompanyStr) && !qwUserIdCompanySet.contains(paramId)){
+                        updateAndSyncQwUser(paramId, companyUser);
+                    }
+                }
+            }
+
+
+            return R.ok();
+        }
+        return R.error("绑定失败");
+
+    }
+
+
+    private void updateAndSyncQwUser(String paramId, CompanyUser companyUser) {
+
+        QwUser qu= qwUserService.selectQwUserById(Long.parseLong(paramId));
+
+        qwExternalContactMapper.updateBindUserByQwUser(qu.getCorpId(),qu.getQwUserId(),companyUser.getCompanyId(),companyUser.getUserId());
+
+        //根据企微账号和公司id 同步企业微信账号(游标初始为空)
+        syncMyQwExternalContact(qu,null);
+    }
+
+    public R  syncMyQwExternalContact(QwUser qwUser,String getNextCursor )  {
+
+        String qwUserId = qwUser.getQwUserId();
+        String corpId = qwUser.getCorpId();
+        Long companyId = qwUser.getCompanyId();
+
+        QwExternalListParam param = new QwExternalListParam();
+        param.setLimit(100);
+        param.setUserid_list(Arrays.asList(qwUserId));
+        param.setCursor(getNextCursor);
+
+        QwExternalContactAllListResult list = qwApiService.getAllExternalcontactList(param, corpId);
+
+        logger.info("批量获取客户详情" + list);
+
+        if (list.getErrcode() == 0) {
+            List<ExternalContactInfo> externalContactList = list.getExternal_contact_list();
+            for (ExternalContactInfo externalContactInfo : externalContactList) {
+
+                ExternalContact externalContact = externalContactInfo.getExternal_contact();
+                FollowInfo followInfo = externalContactInfo.getFollow_info();
+                QwExternalContact qwExternalContact = qwExternalContactMapper.selectQwExternalContactUserIdAndExternalIdAndCompanyId(externalContact.getExternal_userid(), qwUserId, corpId);
+                logger.info("客户详情" + qwExternalContact);
+
+                if (qwExternalContact == null) {
+                    qwExternalContact = new QwExternalContact();
+                    qwExternalContact.setUserId(qwUserId); // 设置属于用户ID
+                    qwExternalContact.setExternalUserId(externalContact.getExternal_userid()); // 设置外部联系人ID
+
+
+                    qwExternalContact.setCorpId(corpId); // 设置企业ID
+                    qwExternalContact.setCompanyId(companyId); // 设置公司ID
+                }
+
+
+                // 设置公共属性
+                qwExternalContact.setCompanyUserId(qwUser.getCompanyUserId());
+                qwExternalContact.setQwUserId(qwUser.getId());
+                qwExternalContact.setName(externalContact.getName()); // 设置名称
+                qwExternalContact.setAvatar(externalContact.getAvatar()); // 设置头像
+                qwExternalContact.setType(externalContact.getType()); // 设置外部联系人类型(1微信用户,2企业微信用户)
+                qwExternalContact.setGender(externalContact.getGender()); // 设置性别 (0-未知, 1-男性, 2-女性)
+                qwExternalContact.setDescription(followInfo.getDescription()); // 设置描述信息
+                qwExternalContact.setRemark(followInfo.getRemark());
+
+//                        if (followInfo.getTag_id() != null && !followInfo.getTag_id().isEmpty()) {
+                qwExternalContact.setTagIds(JSON.toJSONString(followInfo.getTag_id())); // 设置标签ID
+//                        }
+
+//                        if (followInfo.getRemark_mobiles() != null && !followInfo.getRemark_mobiles().isEmpty()) {
+                qwExternalContact.setRemarkMobiles(JSON.toJSONString(followInfo.getRemark_mobiles())); // 设置备注电话号码
+//                        }
+
+                qwExternalContact.setState(followInfo.getState());
+
+                if (followInfo.getState() != null && !followInfo.getState().isEmpty()) {
+                    String s = "way:" + corpId + ":";
+                    if (followInfo.getState().contains(s)) {
+                        String wayId = followInfo.getState().substring(followInfo.getState().indexOf(s) + s.length());
+                        qwExternalContact.setWayId(Long.parseLong(wayId));
+                    }
+                }
+
+                qwExternalContact.setRemarkCorpName(followInfo.getRemark_corp_name()); // 设置备注企业名称
+                qwExternalContact.setAddWay(followInfo.getAdd_way()); // 设置来源
+                qwExternalContact.setOperUserid(followInfo.getOper_userid()); // 设置oper用户ID
+
+                // 根据是否存在记录进行更新或插入
+                if (qwExternalContact.getId() != null) {
+                    qwExternalContactMapper.updateQwExternalContact(qwExternalContact);
+                } else {
+                    qwExternalContactMapper.insertQwExternalContact(qwExternalContact);
+                }
+            }
+
+        }else {
+            return R.error("同步失败:"+list.getErrmsg());
+        }
+
+        if (!StringUtil.strIsNullOrEmpty(list.getNext_cursor())){
+            syncMyQwExternalContact(qwUser,list.getNext_cursor());
+        }
+        return R.ok();
+    }
+
+
+    /**
+     * 同步企微用户
+     */
+    @RepeatSubmit
+    @PreAuthorize("@ss.hasPermi('qw:user:sync')")
+    @Log(title = "企微用户", businessType = BusinessType.INSERT)
+    @PostMapping("sync/{corpId}")
+    public R sync(@PathVariable("corpId") String corpId)
+    {
+
+        List<String> strings = qwCompanyMapper.selectQwCompanyCorpIdListByAll();
+        for (String string : strings) {
+
+            if (string.equals(corpId)){
+                qwUserService.syncQwUser(string);
+                qwDeptService.insertOrUpdateQwDept(string);
+                logger.info("同步完成");
+            }
+        }
+        return R.ok();
+    }
+
+    /**
+     * 获取企微用户详细信息
+     */
+
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(qwUserService.selectQwUserVOById(id));
+    }
+    /**
+     * 批量查询 企微用户详细信息
+     */
+    @GetMapping(value = "/getInfo/{ids}")
+    public AjaxResult getInfoByIds(@PathVariable("ids") Long[] ids)
+    {
+        return AjaxResult.success(qwUserService.selectQwUserVOByIds(ids));
+    }
+
+    @RepeatSubmit
+    @PreAuthorize("@ss.hasPermi('qw:user:sync')")
+    @Log(title = "同步企微用户名称", businessType = BusinessType.INSERT)
+    @PostMapping("syncName/{corpId}")
+    public R syncName(@PathVariable("corpId") String corpId)
+    {
+        List<String> strings = qwCompanyMapper.selectQwCompanyCorpIdListByAll();
+        for (String string : strings) {
+            if (string.equals(corpId)){
+                qwUserService.syncQwUserName(string);
+            }
+        }
+        return R.ok();
+    }
+
+
+    /**
+     * 查询企微用户列表
+     */
+
+    @GetMapping("/userList")
+    public TableDataInfo userList(QwUserListParam qwUser)
+    {
+        startPage();
+        List<QwUserVO> list = qwUserService.selectAllQwUserListVO(qwUser);
+        return getDataTable(list);
+    }
 }

+ 51 - 25
fs-admin/src/main/java/com/fs/task/FsCompanyTask.java

@@ -3,6 +3,8 @@ package com.fs.task;
 import com.fs.common.constant.FsConstants;
 import com.fs.common.core.redis.RedisCache;
 import com.fs.company.domain.Company;
+import com.fs.company.domain.CompanyMoneyLogs;
+import com.fs.company.mapper.CompanyMoneyLogsMapper;
 import com.fs.company.service.ICompanyService;
 import com.fs.company.vo.RedPacketMoneyVO;
 import com.fs.course.mapper.FsCourseRedPacketLogMapper;
@@ -29,6 +31,9 @@ public class FsCompanyTask {
     @Autowired
     private RedisTemplate<String, Object> redisTemplate;
 
+    @Autowired
+    private CompanyMoneyLogsMapper moneyLogsMapper;
+
     public void refreshCompanyMoney() {
         LocalDateTime now = LocalDateTime.now();
         // 获取上一个小时的开始时间
@@ -49,38 +54,59 @@ public class FsCompanyTask {
      * 同步公司缓存余额到公司数据表
      */
     public void syncRedisCompanyMoneyToDB(){
-            // 获取所有的公司余额key
-            String companyMoneyKeyAll = FsConstants.COMPANY_MONEY_KEY + "*";
-            Collection<String> keys = redisCache.keys(companyMoneyKeyAll);
+        // 获取所有的公司余额key
+        String companyMoneyKeyAll = FsConstants.COMPANY_MONEY_KEY + "*";
+        Collection<String> keys = redisCache.keys(companyMoneyKeyAll);
 
-            if (keys != null && !keys.isEmpty()) {
-                log.info("同步缓存余额到公司表,keys:{}", keys);
-                List<Object> values = redisTemplate.opsForValue().multiGet(keys);
-                Iterator<String> keyIterator = keys.iterator();
-                if(values != null && !values.isEmpty()){
-                    Iterator<Object> valueIterator = values.iterator();
-                    List<Company> companies = companyService.selectCompanyList(new Company());
+        if (keys != null && !keys.isEmpty()) {
+            log.info("同步缓存余额到公司表,keys:{}", keys);
+            List<Object> values = redisTemplate.opsForValue().multiGet(keys);
+            Iterator<String> keyIterator = keys.iterator();
+            if(values != null && !values.isEmpty()){
+                Iterator<Object> valueIterator = values.iterator();
+                List<Company> companies = companyService.selectCompanyList(new Company());
+
+                Map<Long, BigDecimal> moneyMap = new HashMap<>();
+                while (keyIterator.hasNext() && valueIterator.hasNext()) {
+                    String next = keyIterator.next();
+                    String[] keySplit = next.split(":");
+                    Long companyId = Long.parseLong(keySplit[2]);
+                    String value = valueIterator.next().toString();
+                    moneyMap.put(companyId, new BigDecimal(value));
+                }
 
-                    Map<Long, BigDecimal> moneyMap = new HashMap<>();
-                    while (keyIterator.hasNext() && valueIterator.hasNext()) {
-                        String next = keyIterator.next();
-                        String[] keySplit = next.split(":");
-                        Long companyId = Long.parseLong(keySplit[2]);
-                        String value = valueIterator.next().toString();
-                        moneyMap.put(companyId, new BigDecimal(value));
+                // 新增账户流水
+                // 直接循环保存,由于是定时任务执行,暂时不优化
+                for (Company company : companies) {
+                    if(moneyMap.containsKey(company.getCompanyId()) && !(moneyMap.get(company.getCompanyId()).compareTo(company.getMoney()) == 0)){
+                        CompanyMoneyLogs log = new CompanyMoneyLogs();
+                        log.setCompanyId(company.getCompanyId());
+                        log.setRemark("扣除红包金额-同步");
+                        // 让减出来的金额为负数
+                        if(moneyMap.get(company.getCompanyId()).compareTo(company.getMoney()) <= 0 ){
+                            log.setMoney(moneyMap.get(company.getCompanyId()).subtract(company.getMoney()));
+                        } else {
+                            log.setMoney(company.getMoney().subtract(moneyMap.get(company.getCompanyId())));
+                        }
+                        log.setLogsType(15);
+                        log.setBalance(moneyMap.get(company.getCompanyId()));
+                        log.setCreateTime(new Date());
+                        moneyLogsMapper.insertCompanyMoneyLogs(log);
                     }
+                }
 
-                    // 使用Stream进行匹配赋值
-                    List<Company> collect = companies.stream()
-                            .filter(company -> moneyMap.containsKey(company.getCompanyId()))
-                            .peek(company -> company.setMoney(moneyMap.get(company.getCompanyId()))).collect(Collectors.toList());
+                // 使用Stream进行匹配赋值
+                List<Company> collect = companies.stream()
+                        .filter(company -> moneyMap.containsKey(company.getCompanyId()))
+                        .peek(company -> company.setMoney(moneyMap.get(company.getCompanyId()))).collect(Collectors.toList());
 
-                    // 保存公司余额
-                    if(!collect.isEmpty()){
-                        companyService.batchUpdateCompany(collect);
-                    }
+                // 保存公司余额
+                if(!collect.isEmpty()){
+                    companyService.batchUpdateCompany(collect);
                 }
+
             }
+        }
 
     }
 }

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

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

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

+ 6 - 5
fs-common/pom.xml

@@ -138,23 +138,24 @@
             <artifactId>spring-expression</artifactId>
             <version>6.2.0</version>
         </dependency>
-
-
         <!-- https://mvnrepository.com/artifact/com.baidu.dev2/baiduads-sdk -->
         <dependency>
             <groupId>com.baidu.dev2</groupId>
             <artifactId>baiduads-sdk</artifactId>
             <version>2023.1.0</version>
         </dependency>
-
-
         <dependency>
             <groupId>com.nuonuo</groupId>
             <artifactId>open-sdk</artifactId>
             <version>1.0.5.2</version>
         </dependency>
 
-
+        <!-- Apache Commons Lang 2.x 版本(包含 org.apache.commons.lang.exception 包) -->
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+            <version>2.6</version> <!-- 稳定版本,兼容大部分场景 -->
+        </dependency>
     </dependencies>
 
 </project>

+ 1 - 0
fs-common/src/main/java/com/fs/common/constant/FsConstants.java

@@ -14,6 +14,7 @@ public interface FsConstants {
 
     // 公司余额redis key "company:money:" + company.getCompanyId()
     String COMPANY_MONEY_KEY = "company:money:";
+    String COMPANY_MONEY_DATE_KEY = "company:money:date:";
     // 公司余额redis 锁
     String COMPANY_MONEY_LOCK = "company_money_lock:";
     // 看客统计  按公司分组 按TimeType 0-今天,1-昨天,2-本周,3-本月,4-上月;

+ 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()
     {

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

@@ -21,12 +21,14 @@ import com.fs.company.param.CompanyUserAreaParam;
 import com.fs.company.param.CompanyUserCodeParam;
 import com.fs.company.param.CompanyUserQwParam;
 import com.fs.company.service.*;
+import com.fs.company.service.impl.CompanyDeptServiceImpl;
 import com.fs.company.utils.DomainUtil;
 import com.fs.company.utils.QwStatusEnum;
 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;
@@ -100,9 +102,16 @@ public class CompanyUserController extends BaseController {
     @Autowired
     IQwCompanyService iQwCompanyService;
 
+    @Autowired
+    private CompanyDeptServiceImpl companyDeptService;
+
+
     @Autowired
     private IQwUserService qwUserService;
 
+    @Autowired
+    private CloudHostProper cloudHostProper;
+
     private static final String appLink = "https://jump.ylrztop.com/jumpapp/pages/index/index?link=";
 
     /**
@@ -117,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()
     {
@@ -475,6 +515,38 @@ public class CompanyUserController extends BaseController {
         return  R.ok().put("data",list);
     }
 
+    @GetMapping("/getQwMyUserList/{id}")
+    public R getQwMyUserList(@PathVariable("id") String corpId)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        List<QwUserVO> list = companyUserService.selectCompanyQwUserListByMy(corpId,loginUser.getCompany().getCompanyId(),loginUser.getUser().getUserId());
+        return  R.ok().put("data",list);
+    }
+
+    @GetMapping("/getQwDeptUserList/{id}")
+    public R getQwDeptUserList(@PathVariable("id") String corpId)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+
+        List<Long> combinedList = new ArrayList<>();
+        //本部门
+        Long deptId = loginUser.getUser().getDeptId();
+        if (deptId!=null){
+            combinedList.add(deptId);
+        }
+        //本部门的下级部门
+        List<Long> deptList = companyDeptService.selectCompanyDeptByParentId(deptId);
+        if (!deptList.isEmpty()){
+            combinedList.addAll(deptList);
+        }
+        String userType = loginUser.getUser().getUserType();
+
+        List<QwUserVO> list = companyUserService.selectCompanyQwUserListByDept(corpId,loginUser.getCompany().getCompanyId(),combinedList,userType);
+        return  R.ok().put("data",list);
+    }
+
+
+
     /**
      * 根据部门的id获取到企业微信的qwuserid
      */
@@ -517,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));

+ 43 - 0
fs-company/src/main/java/com/fs/company/controller/company/FsRedPacketController.java

@@ -0,0 +1,43 @@
+package com.fs.company.controller.company;
+
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.R;
+import com.fs.common.utils.ServletUtils;
+import com.fs.company.domain.Company;
+import com.fs.framework.security.LoginUser;
+import com.fs.framework.service.TokenService;
+import com.fs.his.domain.FsRedPacket;
+import com.fs.his.service.IFsRedPacketService;
+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;
+
+/**
+ * @description: 红包信息
+ * @author: Xgb
+ * @createDate: 2025/11/4
+ * @version: 1.0
+ */
+@RestController
+@RequestMapping("/his/redPacket")
+public class FsRedPacketController extends BaseController {
+
+    @Autowired
+    private IFsRedPacketService fsRedPacketService;
+
+    @Autowired
+    private TokenService tokenService;
+
+    @GetMapping("/info")
+    public R info() {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+
+        Company company = loginUser.getCompany();
+        FsRedPacket redPacket=fsRedPacketService.getInfo(company.getCompanyId());
+        return  R.ok().put("data",redPacket);
+    }
+
+
+
+}

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

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

@@ -22,6 +22,7 @@ import com.fs.qw.vo.QwWatchLogAllStatisticsListVO;
 import com.fs.qw.vo.QwWatchLogStatisticsListVO;
 import com.fs.sop.mapper.SopUserLogsMapper;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
@@ -46,6 +47,9 @@ public class FsQwCourseWatchLogController extends BaseController
     private SopUserLogsMapper sopUserLogsMapper;
     @Autowired
     private IQwWatchLogService qwWatchLogService;
+
+    @Value("${cloud_host.company_name}")
+    private String signProjectName;
     /**
      * 查询短链课程看课记录列表
      */
@@ -82,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)
     {
@@ -99,25 +103,34 @@ public class FsQwCourseWatchLogController extends BaseController
     }
 
     @GetMapping("/qwWatchLogStatisticsList")
-    public TableDataInfo qwWatchLogStatisticsList(QwWatchLogStatisticsListParam param)
-    {
+    public TableDataInfo qwWatchLogStatisticsList(QwWatchLogStatisticsListParam param) {
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        param.setCompanyId( loginUser.getCompany().getCompanyId());
-        if (param.getSTime()==null||param.getETime()==null){
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        if (param.getSTime() == null || param.getETime() == null) {
             return getDataTable(new ArrayList<>());
         }
-        return qwWatchLogService.selectQwWatchLogStatisticsListVO(param);
+        //济南联志健康 数据排除转接用户
+        if ("济南联志健康".equals(signProjectName)) {
+            return qwWatchLogService.selectQwWatchLogStatisticsListVOExcludeTransfer(param);
+        } else {
+            return qwWatchLogService.selectQwWatchLogStatisticsListVO(param);
+        }
     }
+
     @GetMapping("/myQwWatchLogStatisticsList")
-    public TableDataInfo myQwWatchLogStatisticsList(QwWatchLogStatisticsListParam param)
-    {
+    public TableDataInfo myQwWatchLogStatisticsList(QwWatchLogStatisticsListParam param) {
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        param.setCompanyId( loginUser.getCompany().getCompanyId());
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
         param.setCompanyUserId(loginUser.getUser().getUserId());
-        if (param.getSTime()==null||param.getETime()==null){
+        if (param.getSTime() == null || param.getETime() == null) {
             return getDataTable(new ArrayList<>());
         }
-        return qwWatchLogService.selectQwWatchLogStatisticsListVO(param);
+        //济南联志健康 数据排除转接用户
+        if ("济南联志健康".equals(signProjectName)) {
+            return qwWatchLogService.selectQwWatchLogStatisticsListVOExcludeTransfer(param);
+        } else {
+            return qwWatchLogService.selectQwWatchLogStatisticsListVO(param);
+        }
     }
 
 
@@ -212,8 +225,13 @@ public class FsQwCourseWatchLogController extends BaseController
     {
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         param.setCompanyId( loginUser.getCompany().getCompanyId());
+        List<QwWatchLogStatisticsListVO> list = new ArrayList<>();
 
-        List<QwWatchLogStatisticsListVO> list = qwWatchLogService.selectQwWatchLogStatisticsListVOExport(param);
+        if ("济南联志健康".equals(signProjectName)) {
+            list = qwWatchLogService.selectQwWatchLogStatisticsListVOExportExcludeTransfer(param);
+        }else{
+            list = qwWatchLogService.selectQwWatchLogStatisticsListVOExport(param);
+        }
 
         ExcelUtil<QwWatchLogStatisticsListVO> util = new ExcelUtil<QwWatchLogStatisticsListVO>(QwWatchLogStatisticsListVO.class);
         return util.exportExcel(list, "短链课程看课记录数据");

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

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