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

直播订单优惠券 权限添加

yuhongqi преди 2 седмици
родител
ревизия
9114dd1aaf
променени са 65 файла, в които са добавени 1128 реда и са изтрити 234 реда
  1. 6 6
      fs-admin/src/main/java/com/fs/live/controller/LiveAutoTaskController.java
  2. 4 0
      fs-admin/src/main/java/com/fs/live/controller/LiveController.java
  3. 78 18
      fs-admin/src/main/java/com/fs/live/controller/LiveCouponController.java
  4. 6 6
      fs-admin/src/main/java/com/fs/live/controller/LiveCouponIssueController.java
  5. 6 6
      fs-admin/src/main/java/com/fs/live/controller/LiveCouponIssueUserController.java
  6. 6 6
      fs-admin/src/main/java/com/fs/live/controller/LiveCouponUserController.java
  7. 7 0
      fs-admin/src/main/java/com/fs/live/controller/LiveDataController.java
  8. 9 6
      fs-admin/src/main/java/com/fs/live/controller/LiveGoodsController.java
  9. 11 8
      fs-admin/src/main/java/com/fs/live/controller/LiveLotteryConfController.java
  10. 0 4
      fs-admin/src/main/java/com/fs/live/controller/LiveLotteryController.java
  11. 6 6
      fs-admin/src/main/java/com/fs/live/controller/LiveLotteryRecordController.java
  12. 6 6
      fs-admin/src/main/java/com/fs/live/controller/LiveLotteryRegistrationController.java
  13. 6 6
      fs-admin/src/main/java/com/fs/live/controller/LiveMsgController.java
  14. 20 17
      fs-admin/src/main/java/com/fs/live/controller/LiveOrderController.java
  15. 8 0
      fs-admin/src/main/java/com/fs/live/controller/LiveOrderPaymentController.java
  16. 8 6
      fs-admin/src/main/java/com/fs/live/controller/LiveRedConfController.java
  17. 7 7
      fs-admin/src/main/java/com/fs/live/controller/LiveVideoController.java
  18. 6 6
      fs-admin/src/main/java/com/fs/live/controller/LiveWatchConfigController.java
  19. 9 9
      fs-admin/src/main/java/com/fs/live/controller/LiveWatchUserController.java
  20. 2 0
      fs-common/src/main/java/com/fs/common/constant/LiveKeysConstant.java
  21. 10 0
      fs-common/src/main/java/com/fs/common/core/redis/RedisUtil.java
  22. 10 1
      fs-company/src/main/java/com/fs/company/controller/live/LiveController.java
  23. 210 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveCouponController.java
  24. 8 8
      fs-company/src/main/java/com/fs/company/controller/live/LiveDataController.java
  25. 9 6
      fs-company/src/main/java/com/fs/company/controller/live/LiveGoodsController.java
  26. 10 8
      fs-company/src/main/java/com/fs/company/controller/live/LiveLotteryConfController.java
  27. 6 6
      fs-company/src/main/java/com/fs/company/controller/live/LiveLotteryRecordController.java
  28. 6 6
      fs-company/src/main/java/com/fs/company/controller/live/LiveLotteryRegistrationController.java
  29. 6 6
      fs-company/src/main/java/com/fs/company/controller/live/LiveMsgController.java
  30. 8 6
      fs-company/src/main/java/com/fs/company/controller/live/LiveOrderController.java
  31. 8 6
      fs-company/src/main/java/com/fs/company/controller/live/LiveRedConfController.java
  32. 6 6
      fs-company/src/main/java/com/fs/company/controller/live/LiveRewardRecordController.java
  33. 7 7
      fs-company/src/main/java/com/fs/company/controller/live/LiveUserLotteryRecordController.java
  34. 6 6
      fs-company/src/main/java/com/fs/company/controller/live/LiveVideoController.java
  35. 6 6
      fs-company/src/main/java/com/fs/company/controller/live/LiveWatchConfigController.java
  36. 9 9
      fs-company/src/main/java/com/fs/company/controller/live/LiveWatchUserController.java
  37. 46 3
      fs-live-socket/src/main/java/com/fs/live/websocket/service/WebSocketServer.java
  38. 6 0
      fs-service-system/src/main/java/com/fs/live/domain/LiveCoupon.java
  39. 5 0
      fs-service-system/src/main/java/com/fs/live/domain/LiveCouponIssue.java
  40. 27 0
      fs-service-system/src/main/java/com/fs/live/domain/LiveCouponIssueRelation.java
  41. 4 0
      fs-service-system/src/main/java/com/fs/live/domain/LiveCouponIssueUser.java
  42. 4 0
      fs-service-system/src/main/java/com/fs/live/domain/LiveCouponUser.java
  43. 1 0
      fs-service-system/src/main/java/com/fs/live/domain/LiveOrder.java
  44. 9 0
      fs-service-system/src/main/java/com/fs/live/mapper/LiveCouponIssueMapper.java
  45. 5 0
      fs-service-system/src/main/java/com/fs/live/mapper/LiveCouponIssueUserMapper.java
  46. 45 0
      fs-service-system/src/main/java/com/fs/live/mapper/LiveCouponMapper.java
  47. 14 0
      fs-service-system/src/main/java/com/fs/live/mapper/LiveCouponUserMapper.java
  48. 26 0
      fs-service-system/src/main/java/com/fs/live/param/CouponPO.java
  49. 5 0
      fs-service-system/src/main/java/com/fs/live/service/ILiveCouponIssueService.java
  50. 5 0
      fs-service-system/src/main/java/com/fs/live/service/ILiveCouponIssueUserService.java
  51. 25 0
      fs-service-system/src/main/java/com/fs/live/service/ILiveCouponService.java
  52. 5 0
      fs-service-system/src/main/java/com/fs/live/service/ILiveCouponUserService.java
  53. 12 0
      fs-service-system/src/main/java/com/fs/live/service/impl/LiveCouponIssueServiceImpl.java
  54. 8 0
      fs-service-system/src/main/java/com/fs/live/service/impl/LiveCouponIssueUserServiceImpl.java
  55. 163 3
      fs-service-system/src/main/java/com/fs/live/service/impl/LiveCouponServiceImpl.java
  56. 12 0
      fs-service-system/src/main/java/com/fs/live/service/impl/LiveCouponUserServiceImpl.java
  57. 31 5
      fs-service-system/src/main/java/com/fs/live/service/impl/LiveOrderServiceImpl.java
  58. 27 0
      fs-service-system/src/main/java/com/fs/live/vo/LiveCouponListVo.java
  59. 16 11
      fs-service-system/src/main/resources/mapper/live/LiveCouponIssueMapper.xml
  60. 6 1
      fs-service-system/src/main/resources/mapper/live/LiveCouponIssueUserMapper.xml
  61. 12 0
      fs-service-system/src/main/resources/mapper/live/LiveCouponMapper.xml
  62. 6 1
      fs-service-system/src/main/resources/mapper/live/LiveCouponUserMapper.xml
  63. 55 0
      fs-user-app/src/main/java/com/fs/app/controller/LiveCouponController.java
  64. 2 0
      fs-user-app/src/main/java/com/fs/app/facade/LiveFacadeService.java
  65. 10 0
      fs-user-app/src/main/java/com/fs/app/facade/impl/LiveFacadeServiceImpl.java

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

@@ -31,7 +31,7 @@ public class LiveAutoTaskController extends BaseController
     /**
      * 查询直播间自动化任务配置列表
      */
-    @PreAuthorize("@ss.hasPermi('shop:task:list')")
+//    @PreAuthorize("@ss.hasPermi('shop:task:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveAutoTask liveAutoTask)
     {
@@ -43,7 +43,7 @@ public class LiveAutoTaskController extends BaseController
     /**
      * 导出直播间自动化任务配置列表
      */
-    @PreAuthorize("@ss.hasPermi('shop:task:export')")
+//    @PreAuthorize("@ss.hasPermi('shop:task:export')")
     @Log(title = "直播间自动化任务配置", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveAutoTask liveAutoTask)
@@ -56,7 +56,7 @@ public class LiveAutoTaskController extends BaseController
     /**
      * 获取直播间自动化任务配置详细信息
      */
-    @PreAuthorize("@ss.hasPermi('shop:task:query')")
+//    @PreAuthorize("@ss.hasPermi('shop:task:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {
@@ -66,7 +66,7 @@ public class LiveAutoTaskController extends BaseController
     /**
      * 新增直播间自动化任务配置
      */
-    @PreAuthorize("@ss.hasPermi('shop:task:add')")
+//    @PreAuthorize("@ss.hasPermi('shop:task:add')")
     @Log(title = "直播间自动化任务配置", businessType = BusinessType.INSERT)
     @PostMapping
     public R add(@RequestBody LiveAutoTask liveAutoTask)
@@ -77,7 +77,7 @@ public class LiveAutoTaskController extends BaseController
     /**
      * 修改直播间自动化任务配置
      */
-    @PreAuthorize("@ss.hasPermi('shop:task:edit')")
+//    @PreAuthorize("@ss.hasPermi('shop:task:edit')")
     @Log(title = "直播间自动化任务配置", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody LiveAutoTask liveAutoTask)
@@ -88,7 +88,7 @@ public class LiveAutoTaskController extends BaseController
     /**
      * 删除直播间自动化任务配置
      */
-    @PreAuthorize("@ss.hasPermi('shop:task:remove')")
+//    @PreAuthorize("@ss.hasPermi('shop:task:remove')")
     @Log(title = "直播间自动化任务配置", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)

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

@@ -97,11 +97,13 @@ public class LiveController extends BaseController {
         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.updateLive(live);
@@ -110,6 +112,7 @@ public class LiveController extends BaseController {
     /**
      * 批量上下架视频
      */
+    @PreAuthorize("@ss.hasPermi('live:live:edit')")
     @PostMapping("/handleShelfOrUn")
     public R handleShelfOrUn(@RequestBody LiveListVo listVo) {
         return liveService.handleShelfOrUnAdmin(listVo);
@@ -118,6 +121,7 @@ public class LiveController extends BaseController {
     /**
      * 批量删除视频
      */
+    @PreAuthorize("@ss.hasPermi('live:live:edit')")
     @PostMapping("/handleDeleteSelected")
     public R handleDeleteSelected(@RequestBody LiveListVo listVo) {
         return liveService.handleDeleteSelectedAdmin(listVo);

+ 78 - 18
fs-admin/src/main/java/com/fs/live/controller/LiveCouponController.java

@@ -2,24 +2,23 @@ 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.common.core.domain.entity.SysUser;
+import com.fs.core.security.LoginUser;
+import com.fs.core.security.SecurityUtils;
 import com.fs.live.domain.LiveCouponIssue;
 import com.fs.live.service.ILiveCouponIssueService;
+import com.fs.live.vo.LiveCouponListVo;
+import com.fs.live.vo.LiveGoodsListVo;
 import com.fs.store.domain.FsStoreCoupon;
 import com.fs.store.domain.FsStoreCouponIssue;
 import com.fs.store.param.FsStoreCouponPublishParam;
 import com.fs.store.param.LiveCouponPublishParam;
 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 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;
@@ -48,7 +47,7 @@ public class LiveCouponController extends BaseController
     /**
      * 查询优惠券列表
      */
-//    @PreAuthorize("@ss.hasPermi('system:coupon:list')")
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveCoupon liveCoupon)
     {
@@ -61,7 +60,7 @@ public class LiveCouponController extends BaseController
     /**
      * 导出优惠券列表
      */
-//    @PreAuthorize("@ss.hasPermi('system:coupon:export')")
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:export')")
     @Log(title = "优惠券", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveCoupon liveCoupon)
@@ -74,7 +73,7 @@ public class LiveCouponController extends BaseController
     /**
      * 获取优惠券详细信息
      */
-//    @PreAuthorize("@ss.hasPermi('system:coupon:query')")
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:query')")
     @GetMapping(value = "/{couponId}")
     public AjaxResult getInfo(@PathVariable("couponId") Long couponId)
     {
@@ -84,7 +83,7 @@ public class LiveCouponController extends BaseController
     /**
      * 新增优惠券
      */
-//    @PreAuthorize("@ss.hasPermi('system:coupon:add')")
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:add')")
     @Log(title = "优惠券", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody LiveCoupon liveCoupon)
@@ -95,7 +94,7 @@ public class LiveCouponController extends BaseController
     /**
      * 修改优惠券
      */
-//    @PreAuthorize("@ss.hasPermi('system:coupon:edit')")
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:edit')")
     @Log(title = "优惠券", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody LiveCoupon liveCoupon)
@@ -106,7 +105,7 @@ public class LiveCouponController extends BaseController
     /**
      * 删除优惠券
      */
-//    @PreAuthorize("@ss.hasPermi('system:coupon:remove')")
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:remove')")
     @Log(title = "优惠券", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{couponIds}")
     public AjaxResult remove(@PathVariable Long[] couponIds)
@@ -114,7 +113,7 @@ public class LiveCouponController extends BaseController
         return toAjax(liveCouponService.deleteLiveCouponByIds(couponIds));
     }
 
-//    @PreAuthorize("@ss.hasPermi('store:storeCoupon:publish')")
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:publish')")
     @PostMapping("/publish")
     public AjaxResult publish(@RequestBody LiveCouponPublishParam publishParam)
     {
@@ -126,14 +125,14 @@ public class LiveCouponController extends BaseController
         issue.setStartTime(publishParam.getStartTime());
         issue.setLimitTime(publishParam.getLimitTime());
         issue.setTotalCount(Long.valueOf(publishParam.getTotalCount()));
-        issue.setRemainCount(0L);
+        issue.setRemainCount(Long.valueOf(publishParam.getTotalCount()));
         issue.setIsPermanent(0);
         issue.setStatus(1);
         issue.setCreateTime(new Date());
         return toAjax( liveCouponIssueService.insertLiveCouponIssue(issue));
     }
 
-//    @PreAuthorize("@ss.hasPermi('store:storeCoupon:batchPublish')")
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:batchPublish')")
     @PostMapping("/batchPublish")
     public R batchPublish(@RequestBody FsStoreCouponPublishParam publishParam)
     {
@@ -147,7 +146,7 @@ public class LiveCouponController extends BaseController
             issue.setStartTime(publishParam.getStartTime());
             issue.setLimitTime(publishParam.getLimitTime());
             issue.setTotalCount(Long.valueOf(publishParam.getTotalCount()));
-            issue.setRemainCount(0L);
+            issue.setRemainCount(Long.valueOf(publishParam.getTotalCount()));
             issue.setIsPermanent(0);
             issue.setStatus(1);
             issue.setCreateTime(new Date());
@@ -155,4 +154,65 @@ public class LiveCouponController extends BaseController
         }
         return R.ok();
     }
+
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:query')")
+    @GetMapping(value = "/listLiveCoupon")
+    public TableDataInfo listLiveCoupon(@RequestParam("liveId") Long liveId)
+    {
+        startPage();
+        List<LiveCoupon> list = liveCouponService.selectLiveCouponByLiveId(liveId);
+        return getDataTable(list);
+    }
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:query')")
+    @GetMapping(value = "/listCoupon")
+    public TableDataInfo listCoupon(@RequestParam("liveId") Long liveId,@RequestParam("couponName") String couponName)
+    {
+        startPage();
+        List<LiveCoupon> list = liveCouponService.listCoupon(liveId,couponName);
+        return getDataTable(list);
+    }
+
+
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:add')")
+    @Log(title = "直播优惠券", businessType = BusinessType.INSERT)
+    @PostMapping("/delLiveCoupon")
+    public AjaxResult delLiveCoupon(@RequestBody LiveCouponListVo vo)
+    {
+        return toAjax(liveCouponService.delLiveCoupon(vo));
+    }
+
+    /**
+     * 新增直播商品
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:add')")
+    @Log(title = "直播优惠券", businessType = BusinessType.INSERT)
+    @PostMapping("/addLiveCoupon")
+    public AjaxResult addLiveCoupon(@RequestBody Map<String, Object> payload)
+    {
+
+        return toAjax(liveCouponService.insertLiveCouponEntity(payload));
+    }
+
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:edit')")
+    @PostMapping("/handleIsShowChange")
+    public R handleIsShowChange(@RequestBody Map<String, Object> payload) {
+        return liveCouponService.handleIsShowChange(payload);
+    }
+
+    /**
+     * 批量删除视频
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:edit')")
+    @PostMapping("/handleDeleteSelected")
+    public R handleDeleteSelected(@RequestBody LiveCouponListVo listVo) {
+        return liveCouponService.handleDeleteSelectedAdmin(listVo);
+    }
+    /**
+     * 批量删除视频
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:edit')")
+    @PostMapping("/updateLiveCouponBind")
+    public R updateLiveCouponBind(@RequestBody LiveCouponListVo listVo) {
+        return liveCouponService.updateLiveCouponBind(listVo);
+    }
 }

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

@@ -36,7 +36,7 @@ public class LiveCouponIssueController extends BaseController
     /**
      * 查询优惠券领取列表
      */
-//    @PreAuthorize("@ss.hasPermi('system:issue:list')")
+    @PreAuthorize("@ss.hasPermi('live:issue:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveCouponIssue liveCouponIssue)
     {
@@ -48,7 +48,7 @@ public class LiveCouponIssueController extends BaseController
     /**
      * 导出优惠券领取列表
      */
-//    @PreAuthorize("@ss.hasPermi('system:issue:export')")
+    @PreAuthorize("@ss.hasPermi('live:issue:export')")
     @Log(title = "优惠券领取", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveCouponIssue liveCouponIssue)
@@ -61,7 +61,7 @@ public class LiveCouponIssueController extends BaseController
     /**
      * 获取优惠券领取详细信息
      */
-//    @PreAuthorize("@ss.hasPermi('system:issue:query')")
+    @PreAuthorize("@ss.hasPermi('live:issue:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {
@@ -71,7 +71,7 @@ public class LiveCouponIssueController extends BaseController
     /**
      * 新增优惠券领取
      */
-//    @PreAuthorize("@ss.hasPermi('system:issue:add')")
+    @PreAuthorize("@ss.hasPermi('live:issue:add')")
     @Log(title = "优惠券领取", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody LiveCouponIssue liveCouponIssue)
@@ -82,7 +82,7 @@ public class LiveCouponIssueController extends BaseController
     /**
      * 修改优惠券领取
      */
-//    @PreAuthorize("@ss.hasPermi('system:issue:edit')")
+    @PreAuthorize("@ss.hasPermi('live:issue:edit')")
     @Log(title = "优惠券领取", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody LiveCouponIssue liveCouponIssue)
@@ -93,7 +93,7 @@ public class LiveCouponIssueController extends BaseController
     /**
      * 删除优惠券领取
      */
-//    @PreAuthorize("@ss.hasPermi('system:issue:remove')")
+    @PreAuthorize("@ss.hasPermi('live:issue:remove')")
     @Log(title = "优惠券领取", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)

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

@@ -36,7 +36,7 @@ public class LiveCouponIssueUserController extends BaseController
     /**
      * 查询优惠券用户领取记录列表
      */
-//    @PreAuthorize("@ss.hasPermi('system:user:list')")
+    @PreAuthorize("@ss.hasPermi('live:user:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveCouponIssueUser liveCouponIssueUser)
     {
@@ -48,7 +48,7 @@ public class LiveCouponIssueUserController extends BaseController
     /**
      * 导出优惠券用户领取记录列表
      */
-//    @PreAuthorize("@ss.hasPermi('system:user:export')")
+    @PreAuthorize("@ss.hasPermi('live:user:export')")
     @Log(title = "优惠券用户领取记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveCouponIssueUser liveCouponIssueUser)
@@ -61,7 +61,7 @@ public class LiveCouponIssueUserController extends BaseController
     /**
      * 获取优惠券用户领取记录详细信息
      */
-//    @PreAuthorize("@ss.hasPermi('system:user:query')")
+    @PreAuthorize("@ss.hasPermi('live:user:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {
@@ -71,7 +71,7 @@ public class LiveCouponIssueUserController extends BaseController
     /**
      * 新增优惠券用户领取记录
      */
-//    @PreAuthorize("@ss.hasPermi('system:user:add')")
+    @PreAuthorize("@ss.hasPermi('live:user:add')")
     @Log(title = "优惠券用户领取记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody LiveCouponIssueUser liveCouponIssueUser)
@@ -82,7 +82,7 @@ public class LiveCouponIssueUserController extends BaseController
     /**
      * 修改优惠券用户领取记录
      */
-//    @PreAuthorize("@ss.hasPermi('system:user:edit')")
+    @PreAuthorize("@ss.hasPermi('live:user:edit')")
     @Log(title = "优惠券用户领取记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody LiveCouponIssueUser liveCouponIssueUser)
@@ -93,7 +93,7 @@ public class LiveCouponIssueUserController extends BaseController
     /**
      * 删除优惠券用户领取记录
      */
-//    @PreAuthorize("@ss.hasPermi('system:user:remove')")
+    @PreAuthorize("@ss.hasPermi('live:user:remove')")
     @Log(title = "优惠券用户领取记录", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)

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

@@ -39,7 +39,7 @@ public class LiveCouponUserController extends BaseController
     /**
      * 查询优惠券发放记录列表
      */
-//    @PreAuthorize("@ss.hasPermi('system:user:list')")
+    @PreAuthorize("@ss.hasPermi('live:user:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveCouponUser liveCouponUser)
     {
@@ -51,7 +51,7 @@ public class LiveCouponUserController extends BaseController
     /**
      * 导出优惠券发放记录列表
      */
-//    @PreAuthorize("@ss.hasPermi('system:user:export')")
+    @PreAuthorize("@ss.hasPermi('live:user:export')")
     @Log(title = "优惠券发放记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveCouponUser liveCouponUser)
@@ -64,7 +64,7 @@ public class LiveCouponUserController extends BaseController
     /**
      * 获取优惠券发放记录详细信息
      */
-//    @PreAuthorize("@ss.hasPermi('system:user:query')")
+    @PreAuthorize("@ss.hasPermi('live:user:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {
@@ -74,7 +74,7 @@ public class LiveCouponUserController extends BaseController
     /**
      * 新增优惠券发放记录
      */
-//    @PreAuthorize("@ss.hasPermi('system:user:add')")
+    @PreAuthorize("@ss.hasPermi('live:user:add')")
     @Log(title = "优惠券发放记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody LiveCouponUser liveCouponUser)
@@ -85,7 +85,7 @@ public class LiveCouponUserController extends BaseController
     /**
      * 修改优惠券发放记录
      */
-//    @PreAuthorize("@ss.hasPermi('system:user:edit')")
+    @PreAuthorize("@ss.hasPermi('live:user:edit')")
     @Log(title = "优惠券发放记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody LiveCouponUser liveCouponUser)
@@ -96,7 +96,7 @@ public class LiveCouponUserController extends BaseController
     /**
      * 删除优惠券发放记录
      */
-//    @PreAuthorize("@ss.hasPermi('system:user:remove')")
+    @PreAuthorize("@ss.hasPermi('live:user:remove')")
     @Log(title = "优惠券发放记录", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)

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

@@ -5,6 +5,7 @@ import com.fs.core.security.SecurityUtils;
 import com.fs.live.domain.LiveData;
 import com.fs.live.service.ILiveDataService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -24,6 +25,7 @@ public class LiveDataController {
     /**
      * 查询直播数据列表
      * */
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:query')")
     @GetMapping("/list")
     public List<LiveData> list(LiveData liveData) {
         return liveDataService.selectLiveDataList(liveData);
@@ -32,6 +34,7 @@ public class LiveDataController {
     /**
      * 查询直播数据详情
      * */
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:query')")
     @GetMapping("/get/{liveId}")
     public R getLiveData(@PathVariable Long liveId) {
         return R.ok().put("liveData", liveDataService.selectLiveDataByLiveId(liveId));
@@ -40,6 +43,7 @@ public class LiveDataController {
     /**
      * 点赞
      * */
+    @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()));
@@ -48,6 +52,7 @@ public class LiveDataController {
     /**
      * 收藏
      * */
+    @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()));
@@ -56,6 +61,7 @@ public class LiveDataController {
     /**
      * 关注
      * */
+    @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()));
@@ -64,6 +70,7 @@ public class LiveDataController {
     /**
      * 获取直播内数据
      * */
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:query')")
     @GetMapping("/getLiveViewData")
     public R getLiveViewData(Long liveId) {
         Map<String,Object> liveViewData =liveDataService.getLiveViewData(liveId);

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

@@ -41,7 +41,7 @@ public class LiveGoodsController extends BaseController
     /**
      * 查询直播商品列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveGoods:list')")
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveGoods liveGoods, @RequestParam(value = "liveId", required = true) Long liveId)
     {
@@ -57,7 +57,7 @@ public class LiveGoodsController extends BaseController
     /**
      * 导出直播商品列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveGoods:export')")
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:export')")
     @Log(title = "直播商品", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveGoods liveGoods)
@@ -73,7 +73,7 @@ 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)
     {
@@ -84,7 +84,7 @@ public class LiveGoodsController extends BaseController
     /**
      * 新增直播商品
      */
-    @PreAuthorize("@ss.hasPermi('live:liveGoods:add')")
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:add')")
     @Log(title = "直播商品", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody Map<String, Object> payload)
@@ -98,7 +98,7 @@ public class LiveGoodsController extends BaseController
     /**
      * 修改直播商品
      */
-    @PreAuthorize("@ss.hasPermi('live:liveGoods:edit')")
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:edit')")
     @Log(title = "直播商品", businessType = BusinessType.UPDATE)
     @PutMapping
     public R edit(@RequestBody LiveGoods liveGoods)
@@ -109,7 +109,7 @@ public class LiveGoodsController extends BaseController
     /**
      * 删除直播商品
      */
-    @PreAuthorize("@ss.hasPermi('live:liveGoods:remove')")
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:remove')")
     @Log(title = "直播商品", businessType = BusinessType.DELETE)
     @DeleteMapping("/{goodsIds}")
     public AjaxResult remove(@PathVariable Long[] goodsIds)
@@ -134,6 +134,7 @@ public class LiveGoodsController extends BaseController
     /**
      * 获取直播店铺
      * */
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:query')")
     @GetMapping("/liveStore/{liveId}")
     public R liveGoodsStore(@PathVariable Long liveId,@RequestParam String key)
     {
@@ -143,6 +144,7 @@ public class LiveGoodsController extends BaseController
     /**
      * 批量上下架视频
      */
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:edit')")
     @PostMapping("/handleShelfOrUn")
     public R handleShelfOrUn(@RequestBody LiveGoodsListVo listVo) {
         return liveGoodsService.handleShelfOrUnAdmin(listVo);
@@ -159,6 +161,7 @@ public class LiveGoodsController extends BaseController
     /**
      * 更新展示状态
      */
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:edit')")
     @PostMapping("/handleIsShowChange")
     public R handleIsShowChange(@RequestBody LiveGoodsListVo listVo) {
         return liveGoodsService.handleIsShowChange(listVo);

+ 11 - 8
fs-admin/src/main/java/com/fs/live/controller/LiveLotteryConfController.java

@@ -33,7 +33,7 @@ public class LiveLotteryConfController extends BaseController
     /**
      * 查询直播抽奖配置列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:list')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveLotteryConf liveLotteryConf)
     {
@@ -45,7 +45,7 @@ public class LiveLotteryConfController extends BaseController
     /**
      * 导出直播抽奖配置列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:export')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:export')")
     @Log(title = "直播抽奖配置", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveLotteryConf liveLotteryConf)
@@ -58,7 +58,7 @@ public class LiveLotteryConfController extends BaseController
     /**
      * 获取直播抽奖配置详细信息
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:query')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:query')")
     @GetMapping(value = "/{lotteryId}")
     public AjaxResult getInfo(@PathVariable("lotteryId") Long lotteryId)
     {
@@ -68,7 +68,7 @@ public class LiveLotteryConfController extends BaseController
     /**
      * 新增直播抽奖配置
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:add')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:add')")
     @Log(title = "直播抽奖配置", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody LiveLotteryConf liveLotteryConf)
@@ -79,7 +79,7 @@ public class LiveLotteryConfController extends BaseController
     /**
      * 修改直播抽奖配置
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:edit')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:edit')")
     @Log(title = "直播抽奖配置", businessType = BusinessType.UPDATE)
     @PutMapping
     public R edit(@RequestBody LiveLotteryConf liveLotteryConf)
@@ -90,7 +90,7 @@ public class LiveLotteryConfController extends BaseController
     /**
      * 删除直播抽奖配置
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:remove')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:remove')")
     @Log(title = "直播抽奖配置", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{lotteryIds}")
     public AjaxResult remove(@PathVariable Long[] lotteryIds)
@@ -98,13 +98,13 @@ public class LiveLotteryConfController extends BaseController
         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);
@@ -113,18 +113,21 @@ public class LiveLotteryConfController extends BaseController
     /**
      * 发起抽奖
      * */
+//    @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());

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

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

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

@@ -30,7 +30,7 @@ public class LiveLotteryRecordController extends BaseController
     /**
      * 查询直播抽奖记录列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:list')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveLotteryRecord liveLotteryRecord)
     {
@@ -42,7 +42,7 @@ public class LiveLotteryRecordController extends BaseController
     /**
      * 导出直播抽奖记录列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:export')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:export')")
     @Log(title = "直播抽奖记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveLotteryRecord liveLotteryRecord)
@@ -55,7 +55,7 @@ public class LiveLotteryRecordController extends BaseController
     /**
      * 获取直播抽奖记录详细信息
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:query')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:query')")
     @GetMapping(value = "/{lotteryId}")
     public AjaxResult getInfo(@PathVariable("lotteryId") Long lotteryId)
     {
@@ -65,7 +65,7 @@ public class LiveLotteryRecordController extends BaseController
     /**
      * 新增直播抽奖记录
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:add')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:add')")
     @Log(title = "直播抽奖记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody LiveLotteryRecord liveLotteryRecord)
@@ -76,7 +76,7 @@ public class LiveLotteryRecordController extends BaseController
     /**
      * 修改直播抽奖记录
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:edit')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:edit')")
     @Log(title = "直播抽奖记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody LiveLotteryRecord liveLotteryRecord)
@@ -87,7 +87,7 @@ public class LiveLotteryRecordController extends BaseController
     /**
      * 删除直播抽奖记录
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:remove')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:remove')")
     @Log(title = "直播抽奖记录", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{lotteryIds}")
     public AjaxResult remove(@PathVariable Long[] lotteryIds)

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

@@ -30,7 +30,7 @@ public class LiveLotteryRegistrationController extends BaseController
     /**
      * 查询直播抽奖登记列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:list')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveLotteryRegistration liveLotteryRegistration)
     {
@@ -42,7 +42,7 @@ public class LiveLotteryRegistrationController extends BaseController
     /**
      * 导出直播抽奖登记列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:export')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:export')")
     @Log(title = "直播抽奖登记", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveLotteryRegistration liveLotteryRegistration)
@@ -55,7 +55,7 @@ public class LiveLotteryRegistrationController extends BaseController
     /**
      * 获取直播抽奖登记详细信息
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:query')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:query')")
     @GetMapping(value = "/{registrationId}")
     public AjaxResult getInfo(@PathVariable("registrationId") Long registrationId)
     {
@@ -65,7 +65,7 @@ public class LiveLotteryRegistrationController extends BaseController
     /**
      * 新增直播抽奖登记
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:add')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:add')")
     @Log(title = "直播抽奖登记", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody LiveLotteryRegistration liveLotteryRegistration)
@@ -76,7 +76,7 @@ public class LiveLotteryRegistrationController extends BaseController
     /**
      * 修改直播抽奖登记
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:edit')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:edit')")
     @Log(title = "直播抽奖登记", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody LiveLotteryRegistration liveLotteryRegistration)
@@ -87,7 +87,7 @@ public class LiveLotteryRegistrationController extends BaseController
     /**
      * 删除直播抽奖登记
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:remove')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:remove')")
     @Log(title = "直播抽奖登记", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{registrationIds}")
     public AjaxResult remove(@PathVariable Long[] registrationIds)

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

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

+ 20 - 17
fs-admin/src/main/java/com/fs/live/controller/LiveOrderController.java

@@ -220,6 +220,7 @@ public class LiveOrderController extends BaseController
     /**
      * 取消订单确认
      * */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:edit')")
     @GetMapping(value = "/cancelConfirm/{orderId}")
     public R cancelConfirm(@PathVariable String orderId)
     {
@@ -236,6 +237,7 @@ public class LiveOrderController extends BaseController
         return liveOrderService.getLiveOrderTimeGranularity(liveOrder);
     }
 
+
     @Log(title = "同步物流", businessType = BusinessType.UPDATE)
     @GetMapping(value = "/syncExpress/{id}")
     public R syncExpress(@PathVariable("id") Long id) {
@@ -243,7 +245,7 @@ public class LiveOrderController extends BaseController
     }
 
 //    @Log(title = "同步管易物流单号", businessType = BusinessType.UPDATE)
-//    @PreAuthorize("@ss.hasPermi('store:storeOrder:updateErpOrder')")
+//    @PreAuthorize("@ss.hasPermi('live:liveOrder:updateErpOrder')")
 //    @PostMapping("/updateErpOrder")
 //    public R updateErpOrder( @RequestBody LiveOrder param) {
 //        LiveOrder order = liveOrderService.selectLiveOrderByOrderId(String.valueOf(param.getOrderId()));
@@ -293,7 +295,7 @@ public class LiveOrderController extends BaseController
     /**
      * 查询订单商品列表
      */
-
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:query')")
     @GetMapping("/ltemlist/{orderId}")
     public TableDataInfo ltemlist(@PathVariable("orderId") String orderId)
     {
@@ -307,9 +309,9 @@ public class LiveOrderController extends BaseController
         liveTask.updateExpress();
         return R.ok();
     }
-
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:refundOrderMoney')")
     @Log(title = "退款", businessType = BusinessType.UPDATE)
-//    @PreAuthorize("@ss.hasPermi('store:storeOrder:refundOrderMoney')")
+//    @PreAuthorize("@ss.hasPermi('live:liveOrder:refundOrderMoney')")
     @PostMapping("/refundOrderMoney")
     public synchronized R refundOrderMoney(@Validated @RequestBody FsStoreOrderRefundParam param, HttpServletRequest request) {
         return liveOrderService.refundOrderMoney(param.getOrderId());
@@ -318,7 +320,7 @@ public class LiveOrderController extends BaseController
     /**
      * 获取订单详细信息
      */
-    @PreAuthorize("@ss.hasPermi('store:storeOrder:query')")
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:query')")
     @GetMapping(value = "/{id}")
     public R getInfo(@PathVariable("id") Long id)
     {
@@ -341,7 +343,7 @@ public class LiveOrderController extends BaseController
     }
 
     @GetMapping(value = "/queryAddress/{id}")
-//    @PreAuthorize("@ss.hasPermi('store:storeOrder:queryAddress')")
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:queryAddress')")
     public R getAddress(@PathVariable("id") Long id)
     {
         LiveOrder order = liveOrderService.selectLiveOrderByOrderId(String.valueOf(id));
@@ -349,7 +351,7 @@ public class LiveOrderController extends BaseController
         return R.ok().put("address",address);
     }
     @GetMapping(value = "/queryPhone/{id}")
-//    @PreAuthorize("@ss.hasPermi('store:storeOrder:queryPhone')")
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:queryPhone')")
     @Log(title = "查看电话", businessType = BusinessType.GRANT)
     public R getPhone(@PathVariable("id") Long id)
     {
@@ -361,6 +363,7 @@ public class LiveOrderController extends BaseController
     /**
      * 根据orderId查询
      */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:query')")
     @GetMapping("/getByOrderId/{orderId}")
     public R getByOrderId(@PathVariable Long orderId) {
         LiveOrder liveOrder = liveOrderService.selectLiveOrderByOrderId(String.valueOf(orderId));
@@ -373,33 +376,33 @@ public class LiveOrderController extends BaseController
         return expressService.getLiveExpressByDeliverId(param);
     }
 
-//    @PreAuthorize("@ss.hasPermi('store:storeOrder:auditPayRemain')")
+    @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('store:storeOrder:addTuiMoney')")
+    @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('store:storeOrder:syncExpress')")
+    @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('store:storeOrder:updateExpress')")
+    @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('store:storeOrder:getEroOrder')")
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:getEroOrder')")
     @GetMapping("/getEroOrder")
     public R getEroOrder(@RequestParam("extendOrderId") String extendOrderId) {
         ErpOrderQueryRequert request = new ErpOrderQueryRequert();
@@ -419,14 +422,14 @@ public class LiveOrderController extends BaseController
     }
 
     @Log(title = "冻结、解冻佣金", businessType = BusinessType.UPDATE)
-//    @PreAuthorize("@ss.hasPermi('store:storeOrder:editTuiMoney')")
+    @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('store:storeOrder:finishOrder')")
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:finishOrder')")
     @PostMapping("/finishOrder")
     public R finishOrder(@Validated @RequestBody FsStoreOrderFinishParam param, HttpServletRequest request) {
         return liveOrderService.finishOrder(param.getOrderId());
@@ -438,7 +441,7 @@ public class LiveOrderController extends BaseController
      * @return AjaxResult
      */
     @Log(title = "修改物流", businessType = BusinessType.UPDATE)
-    @PreAuthorize("@ss.hasPermi('store:storeOrder:editDeliveryId')")
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:editDeliveryId')")
     @PutMapping("/editDeliveryId")
     public AjaxResult editDeliveryId(@RequestBody FsStoreDelivers deliveryDTO) {
         LiveOrder liveOrder = liveOrderService.selectLiveOrderByOrderId(String.valueOf(deliveryDTO.getOrderId()));
@@ -460,7 +463,7 @@ public class LiveOrderController extends BaseController
 
     @Log(title = "手动推管易", businessType = BusinessType.INSERT)
     @ApiOperation("创建ERP订单")
-//    @PreAuthorize("@ss.hasPermi('store:storeOrder:createErpOrder')")
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:createErpOrder')")
     @GetMapping("/createErpOrder")
     public R createErpOrder(@RequestParam("orderCode") String orderCode) throws Exception
     {
@@ -470,7 +473,7 @@ public class LiveOrderController extends BaseController
     }
 
     @Log(title = "同步管易物流单号", businessType = BusinessType.UPDATE)
-    @PreAuthorize("@ss.hasPermi('store:storeOrder:updateErpOrder')")
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:updateErpOrder')")
     @PostMapping("/updateErpOrder")
     public R updateErpOrder(@Validated @RequestBody FsStoreOrderExpressEditParam param) {
         LiveOrder order = liveOrderService.selectLiveOrderByOrderId(String.valueOf(param.getOrderId()));

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

@@ -12,6 +12,7 @@ import com.fs.live.service.ILiveOrderPaymentService;
 import com.fs.live.vo.LiveOrderPaymentVo;
 import com.fs.store.vo.FsStorePaymentVO;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
@@ -32,6 +33,7 @@ public class LiveOrderPaymentController extends BaseController
     /**
      * 查询支付明细列表
      */
+    @PreAuthorize("@ss.hasPermi('live:order:payment:query')")
     @GetMapping("/list")
     public TableDataInfo list(LiveOrderPayment liveOrderPayment)
     {
@@ -42,6 +44,7 @@ public class LiveOrderPaymentController extends BaseController
     /**
      * 查询支付明细列表
      */
+    @PreAuthorize("@ss.hasPermi('live:order:payment:query')")
     @GetMapping
     public TableDataInfo listNew(LiveOrderPaymentVo liveOrderPayment)
     {
@@ -56,6 +59,7 @@ public class LiveOrderPaymentController extends BaseController
     /**
      * 导出支付明细列表
      */
+    @PreAuthorize("@ss.hasPermi('live:order:payment:export')")
     @Log(title = "支付明细", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveOrderPayment liveOrderPayment)
@@ -68,6 +72,7 @@ public class LiveOrderPaymentController extends BaseController
     /**
      * 获取支付明细详细信息
      */
+    @PreAuthorize("@ss.hasPermi('live:order:payment:query')")
     @GetMapping(value = "/{paymentId}")
     public AjaxResult getInfo(@PathVariable("paymentId") Long paymentId)
     {
@@ -77,6 +82,7 @@ public class LiveOrderPaymentController extends BaseController
     /**
      * 新增支付明细
      */
+    @PreAuthorize("@ss.hasPermi('live:order:payment:edit')")
     @Log(title = "支付明细", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody LiveOrderPayment liveOrderPayment)
@@ -87,6 +93,7 @@ public class LiveOrderPaymentController extends BaseController
     /**
      * 修改支付明细
      */
+    @PreAuthorize("@ss.hasPermi('live:order:payment:edit')")
     @Log(title = "支付明细", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody LiveOrderPayment liveOrderPayment)
@@ -97,6 +104,7 @@ public class LiveOrderPaymentController extends BaseController
     /**
      * 删除支付明细
      */
+    @PreAuthorize("@ss.hasPermi('live:order:payment:remove')")
     @Log(title = "支付明细", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{paymentIds}")
     public AjaxResult remove(@PathVariable Long[] paymentIds)

+ 8 - 6
fs-admin/src/main/java/com/fs/live/controller/LiveRedConfController.java

@@ -32,7 +32,7 @@ public class LiveRedConfController extends BaseController
     /**
      * 查询直播红包记录配置列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveRedConf:list')")
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveRedConf liveRedConf)
     {
@@ -44,7 +44,7 @@ public class LiveRedConfController extends BaseController
     /**
      * 导出直播红包记录配置列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveRedConf:export')")
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:export')")
     @Log(title = "直播红包记录配置", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveRedConf liveRedConf)
@@ -57,7 +57,7 @@ public class LiveRedConfController extends BaseController
     /**
      * 获取直播红包记录配置详细信息
      */
-    @PreAuthorize("@ss.hasPermi('live:liveRedConf:query')")
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:query')")
     @GetMapping(value = "/{redId}")
     public AjaxResult getInfo(@PathVariable("redId") Long redId)
     {
@@ -67,7 +67,7 @@ public class LiveRedConfController extends BaseController
     /**
      * 新增直播红包记录配置
      */
-    @PreAuthorize("@ss.hasPermi('live:liveRedConf:add')")
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:add')")
     @Log(title = "直播红包记录配置", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody LiveRedConf liveRedConf)
@@ -78,7 +78,7 @@ public class LiveRedConfController extends BaseController
     /**
      * 修改直播红包记录配置
      */
-    @PreAuthorize("@ss.hasPermi('live:liveRedConf:edit')")
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:edit')")
     @Log(title = "直播红包记录配置", businessType = BusinessType.UPDATE)
     @PutMapping
     public R edit(@RequestBody LiveRedConf liveRedConf)
@@ -90,7 +90,7 @@ public class LiveRedConfController extends BaseController
     /**
      * 删除直播红包记录配置
      */
-    @PreAuthorize("@ss.hasPermi('live:liveRedConf:remove')")
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:remove')")
     @Log(title = "直播红包记录配置", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{redIds}")
     public AjaxResult remove(@PathVariable Long[] redIds)
@@ -98,6 +98,7 @@ public class LiveRedConfController extends BaseController
         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);
@@ -106,6 +107,7 @@ public class LiveRedConfController extends BaseController
     /**
      * 点击发放红包
      * */
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:edit')")
     @PostMapping("/start/{redId}")
     public String start(@PathVariable String redId) {
         return liveRedConfService.start(redId, SecurityUtils.getLoginUser().getUser().getUserId());

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

@@ -30,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)
     {
@@ -42,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)
@@ -55,7 +55,7 @@ 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)
     {
@@ -65,7 +65,7 @@ public class LiveVideoController extends BaseController
     /**
      * 获取直播视频详细信息
      */
-    @PreAuthorize("@ss.hasPermi('live:liveVideo:query')")
+//    @PreAuthorize("@ss.hasPermi('live:liveVideo:query')")
     @GetMapping(value = "/liveVideoByLiveId/{liveId}")
     public AjaxResult getLiveVideoByLiveId(@PathVariable("liveId") Long liveId)
     {
@@ -84,7 +84,7 @@ public class LiveVideoController extends BaseController
     /**
      * 新增直播视频
      */
-    @PreAuthorize("@ss.hasPermi('live:liveVideo:add')")
+//    @PreAuthorize("@ss.hasPermi('live:liveVideo:add')")
     @Log(title = "直播视频", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody LiveVideo liveVideo)
@@ -95,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)
@@ -106,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)

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

@@ -34,7 +34,7 @@ public class LiveWatchConfigController extends BaseController
     /**
      * 查询直播观看奖励设置列表
      */
-    @PreAuthorize("@ss.hasPermi('live:config:list')")
+//    @PreAuthorize("@ss.hasPermi('live:config:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveWatchConfig liveWatchConfig)
     {
@@ -46,7 +46,7 @@ public class LiveWatchConfigController extends BaseController
     /**
      * 导出直播观看奖励设置列表
      */
-    @PreAuthorize("@ss.hasPermi('live:config:export')")
+//    @PreAuthorize("@ss.hasPermi('live:config:export')")
     @Log(title = "直播观看奖励设置", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveWatchConfig liveWatchConfig)
@@ -59,7 +59,7 @@ public class LiveWatchConfigController extends BaseController
     /**
      * 获取直播观看奖励设置详细信息
      */
-    @PreAuthorize("@ss.hasPermi('live:config:query')")
+//    @PreAuthorize("@ss.hasPermi('live:config:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {
@@ -69,7 +69,7 @@ public class LiveWatchConfigController extends BaseController
     /**
      * 新增直播观看奖励设置
      */
-    @PreAuthorize("@ss.hasPermi('live:config:add')")
+//    @PreAuthorize("@ss.hasPermi('live:config:add')")
     @Log(title = "直播观看奖励设置", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody String jsonConfig)
@@ -81,7 +81,7 @@ public class LiveWatchConfigController extends BaseController
     /**
      * 修改直播观看奖励设置
      */
-    @PreAuthorize("@ss.hasPermi('live:config:edit')")
+//    @PreAuthorize("@ss.hasPermi('live:config:edit')")
     @Log(title = "直播观看奖励设置", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody String jsonConfig)
@@ -92,7 +92,7 @@ public class LiveWatchConfigController extends BaseController
     /**
      * 删除直播观看奖励设置
      */
-    @PreAuthorize("@ss.hasPermi('live:config:remove')")
+//    @PreAuthorize("@ss.hasPermi('live:config:remove')")
     @Log(title = "直播观看奖励设置", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)

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

@@ -33,7 +33,7 @@ public class LiveWatchUserController extends BaseController
     /**
      * 查询直播间观看用户列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:list')")
+//    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveWatchUser liveWatchUser)
     {
@@ -42,7 +42,7 @@ public class LiveWatchUserController extends BaseController
         return getDataTable(list);
     }
 
-    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:list')")
+//    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:list')")
     @GetMapping("/watchUserList")
     public TableDataInfo watchUserList(@RequestParam Long liveId) {
         Map<String, Object> params = new HashMap<>();
@@ -55,7 +55,7 @@ public class LiveWatchUserController extends BaseController
     /**
      * 导出直播间观看用户列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:export')")
+//    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:export')")
     @Log(title = "直播间观看用户", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveWatchUser liveWatchUser)
@@ -68,7 +68,7 @@ public class LiveWatchUserController extends BaseController
     /**
      * 获取直播间观看用户详细信息
      */
-    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:query')")
+//    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {
@@ -78,7 +78,7 @@ public class LiveWatchUserController extends BaseController
     /**
      * 新增直播间观看用户
      */
-    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:add')")
+//    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:add')")
     @Log(title = "直播间观看用户", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody LiveWatchUser liveWatchUser)
@@ -89,7 +89,7 @@ public class LiveWatchUserController extends BaseController
     /**
      * 修改直播间观看用户
      */
-    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:edit')")
+//    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:edit')")
     @Log(title = "直播间观看用户", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody LiveWatchUser liveWatchUser)
@@ -100,7 +100,7 @@ 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)
@@ -111,7 +111,7 @@ public class LiveWatchUserController extends BaseController
     /**
      * 修改直播间用户禁言状态
      */
-    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:edit')")
+//    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:edit')")
     @Log(title = "直播间观看用户", businessType = BusinessType.UPDATE)
     @PutMapping("/changeUserState")
     public AjaxResult changeUserState(@RequestParam Long liveId, @RequestParam Long userId) {
@@ -121,7 +121,7 @@ public class LiveWatchUserController extends BaseController
     /**
      * 封禁用户账号
      */
-    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:edit')")
+//    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:edit')")
     @Log(title = "直播间观看用户", businessType = BusinessType.UPDATE)
     @GetMapping("/blockUser/{userId}")
     public AjaxResult blockUser(@PathVariable Long userId) {

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

@@ -13,6 +13,7 @@ public class LiveKeysConstant {
     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; //直播间详情过期时间
@@ -20,6 +21,7 @@ public class LiveKeysConstant {
     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"; //抽奖记录
 
 

+ 10 - 0
fs-common/src/main/java/com/fs/common/core/redis/RedisUtil.java

@@ -315,6 +315,16 @@ public class RedisUtil {
         return stringRedisTemplate.opsForValue().get(key);
     }
 
+    /**
+     * 获取字符串值
+     *
+     * @param key 键
+     * @return 字符串值
+     */
+    public Long decrement(String key) {
+        return stringRedisTemplate.opsForValue().decrement(key);
+    }
+
     // ======================== 布隆过滤器 ========================
 
     // 获取布隆过滤器

+ 10 - 1
fs-company/src/main/java/com/fs/company/controller/live/LiveController.java

@@ -183,17 +183,19 @@ public class LiveController extends BaseController
         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());
@@ -201,6 +203,7 @@ public class LiveController extends BaseController
         return liveService.closeLiving(payload);
     }
 
+    @PreAuthorize("@ss.hasPermi('live:live:insert')")
     @PostMapping("/create")
     public R createRoom(@RequestBody Map<String, Object> payload) {
         if (!payload.containsKey("liveId")) {
@@ -213,6 +216,7 @@ public class LiveController extends BaseController
     /**
      * 校验上传的身份证信息
      */
+    @PreAuthorize("@ss.hasPermi('live:live:insert')")
     @PostMapping("/verifyIdInfo")
     public R verifyIdInfo(@RequestBody Map<String, String> payload) {
         return liveService.verifyIdInfo(payload);
@@ -221,6 +225,7 @@ public class LiveController extends BaseController
     /**
      * 开始循环播放视频
      */
+    @PreAuthorize("@ss.hasPermi('live:live:edit')")
     @PostMapping("/startLoopPlay")
     public R startLoopPlay(@RequestBody Live live) {
         return liveService.startLoopPlay(live);
@@ -229,6 +234,7 @@ public class LiveController extends BaseController
     /**
      * 停止循环播放
      */
+    @PreAuthorize("@ss.hasPermi('live:live:edit')")
     @PostMapping("/stopLoopPlay")
     public R stopLoopPlay(@RequestBody Live live) {
         return liveService.stopLoopPlay(live);
@@ -237,6 +243,7 @@ public class LiveController extends BaseController
     /**
      * 批量上下架视频
      */
+    @PreAuthorize("@ss.hasPermi('live:live:edit')")
     @PostMapping("/handleShelfOrUn")
     public R handleShelfOrUn(@RequestBody LiveListVo listVo) {
         setListCompanyId(listVo);
@@ -246,6 +253,7 @@ public class LiveController extends BaseController
     /**
      * 批量删除视频
      */
+    @PreAuthorize("@ss.hasPermi('live:live:edit')")
     @PostMapping("/handleDeleteSelected")
     public R handleDeleteSelected(@RequestBody LiveListVo listVo) {
         setListCompanyId(listVo);
@@ -301,6 +309,7 @@ public class LiveController extends BaseController
 
     @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<>();

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

@@ -0,0 +1,210 @@
+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.service.ILiveCouponIssueService;
+import com.fs.live.service.ILiveCouponService;
+import com.fs.live.vo.LiveCouponListVo;
+import com.fs.store.param.FsStoreCouponPublishParam;
+import com.fs.store.param.LiveCouponPublishParam;
+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 FsStoreCouponPublishParam 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);
+    }
+}

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

@@ -38,7 +38,7 @@ public class LiveDataController extends BaseController
     /**
      * 查询直播数据列表
      */
-//    @PreAuthorize("@ss.hasPermi('liveData:liveData:list')")
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveData liveData)
     {
@@ -50,7 +50,7 @@ public class LiveDataController extends BaseController
     /**
      * 导出直播数据列表
      */
-//    @PreAuthorize("@ss.hasPermi('liveData:liveData:export')")
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:export')")
     @Log(title = "直播数据", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveData liveData)
@@ -63,7 +63,7 @@ public class LiveDataController extends BaseController
     /**
      * 获取直播数据详细信息
      */
-//    @PreAuthorize("@ss.hasPermi('liveData:liveData:query')")
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:query')")
     @GetMapping(value = "/{liveId}")
     public AjaxResult getInfo(@PathVariable("liveId") Long liveId)
     {
@@ -73,7 +73,7 @@ public class LiveDataController extends BaseController
     /**
      * 新增直播数据
      */
-//    @PreAuthorize("@ss.hasPermi('liveData:liveData:add')")
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:add')")
     @Log(title = "直播数据", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody LiveData liveData)
@@ -84,7 +84,7 @@ public class LiveDataController extends BaseController
     /**
      * 修改直播数据
      */
-//    @PreAuthorize("@ss.hasPermi('liveData:liveData:edit')")
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:edit')")
     @Log(title = "直播数据", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody LiveData liveData)
@@ -95,7 +95,7 @@ public class LiveDataController extends BaseController
     /**
      * 删除直播数据
      */
-//    @PreAuthorize("@ss.hasPermi('liveData:liveData:remove')")
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:remove')")
     @Log(title = "直播数据", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{liveIds}")
     public AjaxResult remove(@PathVariable Long[] liveIds)
@@ -106,7 +106,7 @@ public class LiveDataController extends BaseController
     /**
      * 直播数据页面近期直播卡片数据
      */
-//    @PreAuthorize("@ss.hasPermi('liveData:liveData:recentLive')")
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:recentLive')")
     @GetMapping("/recentLive")
     public AjaxResult recentLive(){
         return AjaxResult.success(liveDataService.getCompanyRecentLive(SecurityUtils.getLoginUser().getCompany().getCompanyId()));
@@ -115,7 +115,7 @@ public class LiveDataController extends BaseController
     /**
      * 查询直播top榜数据
      */
-//    @PreAuthorize("@ss.hasPermi('liveData:liveData:getLiveTop')")
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:getLiveTop')")
     @GetMapping("/getLiveTop")
     public AjaxResult getLiveTop(String rankType){
         System.out.println(rankType);

+ 9 - 6
fs-company/src/main/java/com/fs/company/controller/live/LiveGoodsController.java

@@ -37,7 +37,7 @@ public class LiveGoodsController extends BaseController
     /**
      * 查询直播商品列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveGoods:list')")
+////    @PreAuthorize("@ss.hasPermi('live:liveGoods:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveGoods liveGoods, @RequestParam(value = "liveId", required = true) Long liveId)
     {
@@ -53,7 +53,7 @@ public class LiveGoodsController extends BaseController
     /**
      * 导出直播商品列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveGoods:export')")
+////    @PreAuthorize("@ss.hasPermi('live:liveGoods:export')")
     @Log(title = "直播商品", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveGoods liveGoods)
@@ -69,7 +69,7 @@ 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)
     {
@@ -80,7 +80,7 @@ public class LiveGoodsController extends BaseController
     /**
      * 新增直播商品
      */
-    @PreAuthorize("@ss.hasPermi('live:liveGoods:add')")
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:add')")
     @Log(title = "直播商品", businessType = BusinessType.INSERT)
     @PostMapping
     public R add(@RequestBody Map<String, Object> payload)
@@ -93,7 +93,7 @@ public class LiveGoodsController extends BaseController
     /**
      * 修改直播商品
      */
-    @PreAuthorize("@ss.hasPermi('live:liveGoods:edit')")
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:edit')")
     @Log(title = "直播商品", businessType = BusinessType.UPDATE)
     @PutMapping
     public R edit(@RequestBody LiveGoods liveGoods)
@@ -104,7 +104,7 @@ public class LiveGoodsController extends BaseController
     /**
      * 删除直播商品
      */
-    @PreAuthorize("@ss.hasPermi('live:liveGoods:remove')")
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:remove')")
     @Log(title = "直播商品", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{goodsIds}")
     public AjaxResult remove(@PathVariable Long[] goodsIds)
@@ -127,6 +127,7 @@ public class LiveGoodsController extends BaseController
     /**
      * 批量上下架视频
      */
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:edit')")
     @PostMapping("/handleShelfOrUn")
     public R handleShelfOrUn(@RequestBody LiveGoodsListVo listVo) {
         setListCompanyId(listVo);
@@ -136,6 +137,7 @@ public class LiveGoodsController extends BaseController
     /**
      * 批量删除视频
      */
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:remove')")
     @PostMapping("/handleDeleteSelected")
     public R handleDeleteSelected(@RequestBody LiveGoodsListVo listVo) {
         setListCompanyId(listVo);
@@ -145,6 +147,7 @@ public class LiveGoodsController extends BaseController
     /**
      * 更新展示状态
      */
+//    @PreAuthorize("@ss.hasPermi('live:liveGoods:edit')")
     @PostMapping("/handleIsShowChange")
     public R handleIsShowChange(@RequestBody LiveGoodsListVo listVo) {
         setListCompanyId(listVo);

+ 10 - 8
fs-company/src/main/java/com/fs/company/controller/live/LiveLotteryConfController.java

@@ -33,7 +33,7 @@ public class LiveLotteryConfController extends BaseController
     /**
      * 查询直播抽奖配置列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:list')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveLotteryConf liveLotteryConf)
     {
@@ -45,7 +45,7 @@ public class LiveLotteryConfController extends BaseController
     /**
      * 导出直播抽奖配置列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:export')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:export')")
     @Log(title = "直播抽奖配置", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveLotteryConf liveLotteryConf)
@@ -58,7 +58,7 @@ public class LiveLotteryConfController extends BaseController
     /**
      * 获取直播抽奖配置详细信息
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:query')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:query')")
     @GetMapping(value = "/{lotteryId}")
     public AjaxResult getInfo(@PathVariable("lotteryId") Long lotteryId)
     {
@@ -68,7 +68,7 @@ public class LiveLotteryConfController extends BaseController
     /**
      * 新增直播抽奖配置
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:add')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:add')")
     @Log(title = "直播抽奖配置", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody LiveLotteryConf liveLotteryConf)
@@ -79,7 +79,7 @@ public class LiveLotteryConfController extends BaseController
     /**
      * 修改直播抽奖配置
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:edit')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:edit')")
     @Log(title = "直播抽奖配置", businessType = BusinessType.UPDATE)
     @PutMapping
     public R edit(@RequestBody LiveLotteryConf liveLotteryConf)
@@ -90,7 +90,7 @@ public class LiveLotteryConfController extends BaseController
     /**
      * 删除直播抽奖配置
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:remove')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:remove')")
     @Log(title = "直播抽奖配置", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{lotteryIds}")
     public AjaxResult remove(@PathVariable Long[] lotteryIds)
@@ -98,13 +98,13 @@ public class LiveLotteryConfController extends BaseController
         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);
@@ -113,12 +113,14 @@ public class LiveLotteryConfController extends BaseController
     /**
      * 发起抽奖
      * */
+//    @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));

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

@@ -30,7 +30,7 @@ public class LiveLotteryRecordController extends BaseController
     /**
      * 查询直播抽奖记录列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:list')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveLotteryRecord liveLotteryRecord)
     {
@@ -42,7 +42,7 @@ public class LiveLotteryRecordController extends BaseController
     /**
      * 导出直播抽奖记录列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:export')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:export')")
     @Log(title = "直播抽奖记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveLotteryRecord liveLotteryRecord)
@@ -55,7 +55,7 @@ public class LiveLotteryRecordController extends BaseController
     /**
      * 获取直播抽奖记录详细信息
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:query')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:query')")
     @GetMapping(value = "/{lotteryId}")
     public AjaxResult getInfo(@PathVariable("lotteryId") Long lotteryId)
     {
@@ -65,7 +65,7 @@ public class LiveLotteryRecordController extends BaseController
     /**
      * 新增直播抽奖记录
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:add')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:add')")
     @Log(title = "直播抽奖记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody LiveLotteryRecord liveLotteryRecord)
@@ -76,7 +76,7 @@ public class LiveLotteryRecordController extends BaseController
     /**
      * 修改直播抽奖记录
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:edit')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:edit')")
     @Log(title = "直播抽奖记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody LiveLotteryRecord liveLotteryRecord)
@@ -87,7 +87,7 @@ public class LiveLotteryRecordController extends BaseController
     /**
      * 删除直播抽奖记录
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:remove')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRecord:remove')")
     @Log(title = "直播抽奖记录", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{lotteryIds}")
     public AjaxResult remove(@PathVariable Long[] lotteryIds)

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

@@ -30,7 +30,7 @@ public class LiveLotteryRegistrationController extends BaseController
     /**
      * 查询直播抽奖登记列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:list')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveLotteryRegistration liveLotteryRegistration)
     {
@@ -42,7 +42,7 @@ public class LiveLotteryRegistrationController extends BaseController
     /**
      * 导出直播抽奖登记列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:export')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:export')")
     @Log(title = "直播抽奖登记", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveLotteryRegistration liveLotteryRegistration)
@@ -55,7 +55,7 @@ public class LiveLotteryRegistrationController extends BaseController
     /**
      * 获取直播抽奖登记详细信息
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:query')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:query')")
     @GetMapping(value = "/{registrationId}")
     public AjaxResult getInfo(@PathVariable("registrationId") Long registrationId)
     {
@@ -65,7 +65,7 @@ public class LiveLotteryRegistrationController extends BaseController
     /**
      * 新增直播抽奖登记
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:add')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:add')")
     @Log(title = "直播抽奖登记", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody LiveLotteryRegistration liveLotteryRegistration)
@@ -76,7 +76,7 @@ public class LiveLotteryRegistrationController extends BaseController
     /**
      * 修改直播抽奖登记
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:edit')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:edit')")
     @Log(title = "直播抽奖登记", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody LiveLotteryRegistration liveLotteryRegistration)
@@ -87,7 +87,7 @@ public class LiveLotteryRegistrationController extends BaseController
     /**
      * 删除直播抽奖登记
      */
-    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:remove')")
+//    @PreAuthorize("@ss.hasPermi('live:liveLotteryRegistration:remove')")
     @Log(title = "直播抽奖登记", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{registrationIds}")
     public AjaxResult remove(@PathVariable Long[] registrationIds)

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

@@ -32,7 +32,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)
     {
@@ -44,7 +44,7 @@ public class LiveMsgController extends BaseController
     /**
      * 导出直播讨论列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveMsg:export')")
+//    @PreAuthorize("@ss.hasPermi('live:liveMsg:export')")
     @Log(title = "直播讨论", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveMsg liveMsg)
@@ -57,7 +57,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)
     {
@@ -68,7 +68,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)
@@ -79,7 +79,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)
@@ -90,7 +90,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)

+ 8 - 6
fs-company/src/main/java/com/fs/company/controller/live/LiveOrderController.java

@@ -88,7 +88,7 @@ public class LiveOrderController extends BaseController
     /**
      * 获取订单详细信息
      */
-    @PreAuthorize("@ss.hasPermi('store:storeOrder:query')")
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:query')")
     @GetMapping(value = "/{id}")
     public R getInfo(@PathVariable("id") Long id)
     {
@@ -111,7 +111,7 @@ public class LiveOrderController extends BaseController
     }
 
 //    @Log(title = "订单凭证上传", businessType = BusinessType.UPDATE)
-////    @PreAuthorize("@ss.hasPermi('store:storeOrder:uploadCredentials')")
+////    @PreAuthorize("@ss.hasPermi('live:liveOrder:uploadCredentials')")
 //    @PostMapping("/uploadCredentials")
 //    public R UploadCredentials(@RequestBody LiveOrder order)
 //    {
@@ -124,7 +124,7 @@ public class LiveOrderController extends BaseController
 //    }
 
     @GetMapping(value = "/queryAddress/{id}")
-//    @PreAuthorize("@ss.hasPermi('store:storeOrder:queryAddress')")
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:queryAddress')")
     public R getAddress(@PathVariable("id") Long id)
     {
         LiveOrder order = liveOrderService.selectLiveOrderByOrderId(String.valueOf(id));
@@ -132,7 +132,7 @@ public class LiveOrderController extends BaseController
         return R.ok().put("address",address);
     }
     @GetMapping(value = "/queryPhone/{id}")
-//    @PreAuthorize("@ss.hasPermi('store:storeOrder:queryPhone')")
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:queryPhone')")
     @Log(title = "查看电话", businessType = BusinessType.GRANT)
     public R getPhone(@PathVariable("id") Long id)
     {
@@ -148,6 +148,7 @@ public class LiveOrderController extends BaseController
     /**
      * 根据orderId查询
      */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:query')")
     @GetMapping("/getByOrderId/{orderId}")
     public R getByOrderId(@PathVariable Long orderId) {
         LiveOrder liveOrder = liveOrderService.selectLiveOrderByOrderId(String.valueOf(orderId));
@@ -287,6 +288,7 @@ public class LiveOrderController extends BaseController
     /**
      * 取消订单确认
      * */
+
     @GetMapping(value = "/cancelConfirm/{orderId}")
     public R cancelConfirm(@PathVariable String orderId)
     {
@@ -311,7 +313,7 @@ public class LiveOrderController extends BaseController
     }
 
 //    @Log(title = "同步管易物流单号", businessType = BusinessType.UPDATE)
-//    @PreAuthorize("@ss.hasPermi('store:storeOrder:updateErpOrder')")
+//    @PreAuthorize("@ss.hasPermi('live:liveOrder:updateErpOrder')")
 //    @PostMapping("/updateErpOrder")
 //    public R updateErpOrder( @RequestBody LiveOrder param) {
 //        LiveOrder order = liveOrderService.selectLiveOrderByOrderId(String.valueOf(param.getOrderId()));
@@ -369,7 +371,7 @@ public class LiveOrderController extends BaseController
         return getDataTable(list);
     }
 
-//    @PreAuthorize("@ss.hasPermi('store:storeOrder:bindCustomer')")
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:bindCustomer')")
     @PostMapping("/bindCustomer")
     public R bindCustomer(@RequestBody FsStoreOrderBindCustomerParam param)
     {

+ 8 - 6
fs-company/src/main/java/com/fs/company/controller/live/LiveRedConfController.java

@@ -32,7 +32,7 @@ public class LiveRedConfController extends BaseController
     /**
      * 查询直播红包记录配置列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveRedConf:list')")
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveRedConf liveRedConf)
     {
@@ -44,7 +44,7 @@ public class LiveRedConfController extends BaseController
     /**
      * 导出直播红包记录配置列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveRedConf:export')")
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:export')")
     @Log(title = "直播红包记录配置", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveRedConf liveRedConf)
@@ -57,7 +57,7 @@ public class LiveRedConfController extends BaseController
     /**
      * 获取直播红包记录配置详细信息
      */
-    @PreAuthorize("@ss.hasPermi('live:liveRedConf:query')")
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:query')")
     @GetMapping(value = "/{redId}")
     public AjaxResult getInfo(@PathVariable("redId") Long redId)
     {
@@ -67,7 +67,7 @@ public class LiveRedConfController extends BaseController
     /**
      * 新增直播红包记录配置
      */
-    @PreAuthorize("@ss.hasPermi('live:liveRedConf:add')")
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:add')")
     @Log(title = "直播红包记录配置", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody LiveRedConf liveRedConf)
@@ -78,7 +78,7 @@ public class LiveRedConfController extends BaseController
     /**
      * 修改直播红包记录配置
      */
-    @PreAuthorize("@ss.hasPermi('live:liveRedConf:edit')")
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:edit')")
     @Log(title = "直播红包记录配置", businessType = BusinessType.UPDATE)
     @PutMapping
     public R edit(@RequestBody LiveRedConf liveRedConf)
@@ -90,7 +90,7 @@ public class LiveRedConfController extends BaseController
     /**
      * 删除直播红包记录配置
      */
-    @PreAuthorize("@ss.hasPermi('live:liveRedConf:remove')")
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:remove')")
     @Log(title = "直播红包记录配置", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{redIds}")
     public AjaxResult remove(@PathVariable Long[] redIds)
@@ -98,6 +98,7 @@ public class LiveRedConfController extends BaseController
         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);
@@ -106,6 +107,7 @@ public class LiveRedConfController extends BaseController
     /**
      * 点击发放红包
      * */
+//    @PreAuthorize("@ss.hasPermi('live:liveRedConf:edit')")
     @PostMapping("/start/{redId}")
     public String start(@PathVariable String redId) {
         return liveRedConfService.start(redId, SecurityUtils.getLoginUser().getUser().getUserId());

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

@@ -30,7 +30,7 @@ public class LiveRewardRecordController extends BaseController
     /**
      * 查询用户直播间奖励记录列表
      */
-    @PreAuthorize("@ss.hasPermi('live:record:list')")
+//    @PreAuthorize("@ss.hasPermi('live:record:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveRewardRecord liveRewardRecord)
     {
@@ -42,7 +42,7 @@ public class LiveRewardRecordController extends BaseController
     /**
      * 导出用户直播间奖励记录列表
      */
-    @PreAuthorize("@ss.hasPermi('live:record:export')")
+//    @PreAuthorize("@ss.hasPermi('live:record:export')")
     @Log(title = "用户直播间奖励记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveRewardRecord liveRewardRecord)
@@ -55,7 +55,7 @@ public class LiveRewardRecordController extends BaseController
     /**
      * 获取用户直播间奖励记录详细信息
      */
-    @PreAuthorize("@ss.hasPermi('live:record:query')")
+//    @PreAuthorize("@ss.hasPermi('live:record:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {
@@ -65,7 +65,7 @@ public class LiveRewardRecordController extends BaseController
     /**
      * 新增用户直播间奖励记录
      */
-    @PreAuthorize("@ss.hasPermi('live:record:add')")
+//    @PreAuthorize("@ss.hasPermi('live:record:add')")
     @Log(title = "用户直播间奖励记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody LiveRewardRecord liveRewardRecord)
@@ -76,7 +76,7 @@ public class LiveRewardRecordController extends BaseController
     /**
      * 修改用户直播间奖励记录
      */
-    @PreAuthorize("@ss.hasPermi('live:record:edit')")
+//    @PreAuthorize("@ss.hasPermi('live:record:edit')")
     @Log(title = "用户直播间奖励记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody LiveRewardRecord liveRewardRecord)
@@ -87,7 +87,7 @@ public class LiveRewardRecordController extends BaseController
     /**
      * 删除用户直播间奖励记录
      */
-    @PreAuthorize("@ss.hasPermi('live:record:remove')")
+//    @PreAuthorize("@ss.hasPermi('live:record:remove')")
     @Log(title = "用户直播间奖励记录", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)

+ 7 - 7
fs-company/src/main/java/com/fs/company/controller/live/LiveUserLotteryRecordController.java

@@ -31,7 +31,7 @@ public class LiveUserLotteryRecordController extends BaseController
     /**
      * 查询直播用户中奖记录列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:list')")
+//    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveUserLotteryRecord liveUserLotteryRecord)
     {
@@ -43,7 +43,7 @@ public class LiveUserLotteryRecordController extends BaseController
     /**
      * 导出直播用户中奖记录列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:export')")
+//    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:export')")
     @Log(title = "直播用户中奖记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveUserLotteryRecord liveUserLotteryRecord)
@@ -56,7 +56,7 @@ public class LiveUserLotteryRecordController extends BaseController
     /**
      * 获取直播用户中奖记录详细信息
      */
-    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:query')")
+//    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {
@@ -66,7 +66,7 @@ public class LiveUserLotteryRecordController extends BaseController
     /**
      * 新增直播用户中奖记录
      */
-    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:add')")
+//    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:add')")
     @Log(title = "直播用户中奖记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody LiveUserLotteryRecord liveUserLotteryRecord)
@@ -77,7 +77,7 @@ public class LiveUserLotteryRecordController extends BaseController
     /**
      * 修改直播用户中奖记录
      */
-    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:edit')")
+//    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:edit')")
     @Log(title = "直播用户中奖记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody LiveUserLotteryRecord liveUserLotteryRecord)
@@ -88,7 +88,7 @@ public class LiveUserLotteryRecordController extends BaseController
     /**
      * 删除直播用户中奖记录
      */
-    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:remove')")
+//    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:remove')")
     @Log(title = "直播用户中奖记录", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)
@@ -99,7 +99,7 @@ public class LiveUserLotteryRecordController extends BaseController
     /**
      * 查询直播用户中奖记录列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:list')")
+//    @PreAuthorize("@ss.hasPermi('live:liveUserLotteryRecord:list')")
     @PostMapping("/info")
     public R info(@RequestBody LiveUserLotteryRecord liveUserLotteryRecord)
     {

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

@@ -30,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)
     {
@@ -42,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)
@@ -55,7 +55,7 @@ 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)
     {
@@ -83,7 +83,7 @@ public class LiveVideoController extends BaseController
     /**
      * 新增直播视频
      */
-    @PreAuthorize("@ss.hasPermi('live:liveVideo:add')")
+//    @PreAuthorize("@ss.hasPermi('live:liveVideo:add')")
     @Log(title = "直播视频", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody LiveVideo liveVideo)
@@ -94,7 +94,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)
@@ -105,7 +105,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)

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

@@ -34,7 +34,7 @@ public class LiveWatchConfigController extends BaseController
     /**
      * 查询直播观看奖励设置列表
      */
-    @PreAuthorize("@ss.hasPermi('live:config:list')")
+//    @PreAuthorize("@ss.hasPermi('live:config:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveWatchConfig liveWatchConfig)
     {
@@ -46,7 +46,7 @@ public class LiveWatchConfigController extends BaseController
     /**
      * 导出直播观看奖励设置列表
      */
-    @PreAuthorize("@ss.hasPermi('live:config:export')")
+//    @PreAuthorize("@ss.hasPermi('live:config:export')")
     @Log(title = "直播观看奖励设置", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveWatchConfig liveWatchConfig)
@@ -59,7 +59,7 @@ public class LiveWatchConfigController extends BaseController
     /**
      * 获取直播观看奖励设置详细信息
      */
-    @PreAuthorize("@ss.hasPermi('live:config:query')")
+//    @PreAuthorize("@ss.hasPermi('live:config:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {
@@ -69,7 +69,7 @@ public class LiveWatchConfigController extends BaseController
     /**
      * 新增直播观看奖励设置
      */
-    @PreAuthorize("@ss.hasPermi('live:config:add')")
+//    @PreAuthorize("@ss.hasPermi('live:config:add')")
     @Log(title = "直播观看奖励设置", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody String jsonConfig)
@@ -81,7 +81,7 @@ public class LiveWatchConfigController extends BaseController
     /**
      * 修改直播观看奖励设置
      */
-    @PreAuthorize("@ss.hasPermi('live:config:edit')")
+//    @PreAuthorize("@ss.hasPermi('live:config:edit')")
     @Log(title = "直播观看奖励设置", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody String jsonConfig)
@@ -92,7 +92,7 @@ public class LiveWatchConfigController extends BaseController
     /**
      * 删除直播观看奖励设置
      */
-    @PreAuthorize("@ss.hasPermi('live:config:remove')")
+//    @PreAuthorize("@ss.hasPermi('live:config:remove')")
     @Log(title = "直播观看奖励设置", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)

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

@@ -33,7 +33,7 @@ public class LiveWatchUserController extends BaseController
     /**
      * 查询直播间观看用户列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:list')")
+//    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveWatchUser liveWatchUser)
     {
@@ -42,7 +42,7 @@ public class LiveWatchUserController extends BaseController
         return getDataTable(list);
     }
 
-    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:list')")
+//    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:list')")
     @GetMapping("/watchUserList")
     public TableDataInfo watchUserList(@RequestParam Long liveId) {
         Map<String, Object> params = new HashMap<>();
@@ -56,7 +56,7 @@ public class LiveWatchUserController extends BaseController
     /**
      * 导出直播间观看用户列表
      */
-    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:export')")
+//    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:export')")
     @Log(title = "直播间观看用户", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveWatchUser liveWatchUser)
@@ -69,7 +69,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)
     {
@@ -79,7 +79,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)
@@ -90,7 +90,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)
@@ -101,7 +101,7 @@ 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)
@@ -112,7 +112,7 @@ public class LiveWatchUserController extends BaseController
     /**
      * 修改直播间用户禁言状态
      */
-    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:edit')")
+//    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:edit')")
     @Log(title = "直播间观看用户", businessType = BusinessType.UPDATE)
     @PutMapping("/changeUserState")
     public AjaxResult changeUserState(@RequestParam Long liveId, @RequestParam Long userId) {
@@ -122,7 +122,7 @@ public class LiveWatchUserController extends BaseController
     /**
      * 封禁用户账号
      */
-    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:edit')")
+//    @PreAuthorize("@ss.hasPermi('live:liveWatchUser:edit')")
     @Log(title = "直播间观看用户", businessType = BusinessType.UPDATE)
     @GetMapping("/blockUser/{userId}")
     public AjaxResult blockUser(@PathVariable Long userId) {

+ 46 - 3
fs-live-socket/src/main/java/com/fs/live/websocket/service/WebSocketServer.java

@@ -3,6 +3,7 @@ package com.fs.live.websocket.service;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.fs.common.constant.LiveKeysConstant;
 import com.fs.live.config.ProductionWordFilter;
 import com.fs.live.websocket.auth.WebSocketConfigurator;
 import com.fs.live.websocket.bean.SendMsgVo;
@@ -51,6 +52,7 @@ public class WebSocketServer {
     private final ILiveLotteryConfService liveLotteryConfService =  SpringUtils.getBean(ILiveLotteryConfService.class);
     private final ILiveGoodsService liveGoodsService =  SpringUtils.getBean(ILiveGoodsService.class);
     private final ILiveUserFirstEntryService liveUserFirstEntryService =  SpringUtils.getBean(ILiveUserFirstEntryService.class);
+    private final ILiveCouponIssueService liveCouponIssueService =  SpringUtils.getBean(ILiveCouponIssueService.class);
     // 直播间在线用户缓存
 //    private static final ConcurrentHashMap<Long, Integer> liveOnlineUsers = new ConcurrentHashMap<>();
 
@@ -267,6 +269,9 @@ public class WebSocketServer {
                 case "lottery":
                     processLottery(liveId, msg);
                     break;
+                case "coupon":
+                    processCoupon(liveId, msg);
+                    break;
                 case "delAutoTask":
                     if (userType == 1) {
                         delAutoTask(liveId, DateUtils.parseDate(msg.getData(),"yyyy-MM-dd'T'HH:mm:ss.SSSZ").getTime());
@@ -278,6 +283,25 @@ public class WebSocketServer {
         }
     }
 
+    private void processCoupon(long liveId, SendMsgVo msg) {
+        JSONObject jsonObject = JSON.parseObject(msg.getData());
+        Integer status = jsonObject.getInteger("status");
+        msg.setStatus(status);
+        Long couponIssueId = jsonObject.getLong("couponIssueId");
+        // ①  检查  缓存是否存在  ② 如果是发布 放入缓存 ③ 删除缓存
+        if (status == 1) {
+            Object cacheObject = redisCache.getCacheObject(String.format(LiveKeysConstant.LIVE_COUPON_NUM , couponIssueId));
+            if (cacheObject == null) {
+                LiveCouponIssue liveCoupon = liveCouponIssueService.selectLiveCouponIssueById(couponIssueId);
+                if (liveCoupon != null) {
+                    redisCache.setCacheObject(String.format(LiveKeysConstant.LIVE_COUPON_NUM , couponIssueId), liveCoupon.getRemainCount().intValue(), 30, TimeUnit.MINUTES);
+                }
+            }
+        } else {
+            redisCache.deleteObject(String.format(LiveKeysConstant.LIVE_COUPON_NUM , couponIssueId));
+        }
+        broadcastMessage(liveId, JSONObject.toJSONString(R.ok().put("data", msg)));
+    }
 
 
     private void sendGoodsMessage(SendMsgVo msg) {
@@ -389,8 +413,16 @@ public class WebSocketServer {
         ConcurrentHashMap<Long, Session> room = getRoom(liveId);
         List<Session> adminRoom = getAdminRoom(liveId);
 
-        room.forEach((k, v) -> v.getAsyncRemote().sendText(message));
-        adminRoom.forEach(v -> v.getAsyncRemote().sendText(message));
+        room.forEach((k, v) -> {
+            if (v.isOpen()) {
+                v.getAsyncRemote().sendText(message);
+            }
+        });
+        adminRoom.forEach(v -> {
+            if (v.isOpen()) {
+                v.getAsyncRemote().sendText(message);
+            }
+        });
     }
 
     /**
@@ -442,9 +474,20 @@ public class WebSocketServer {
             for (LiveData liveData : liveDatas) {
                 liveDataService.updateLiveData(liveData);
             }
-
             /*// 更新数据库
             liveDataService.updateLiveData(liveData);*/
+        Set<String> keys = redisCache.redisTemplate.keys(String.format(LIVE_COUPON_NUM, "*"));
+        if (keys != null && !keys.isEmpty()) {
+            for (String key : keys) {
+                Object o = redisCache.redisTemplate.opsForValue().get(String.format(LIVE_COUPON_NUM, key));
+                if (o != null) {
+                    LiveCouponIssue updateEntity = new LiveCouponIssue();
+                    updateEntity.setId(Long.valueOf(key));
+                    updateEntity.setRemainCount(Long.parseLong(o.toString()));
+                    liveCouponIssueService.updateLiveCouponIssue(updateEntity);
+                }
+            }
+        }
     }
 
 

+ 6 - 0
fs-service-system/src/main/java/com/fs/live/domain/LiveCoupon.java

@@ -67,4 +67,10 @@ public class LiveCoupon extends BaseEntity
     @Excel(name = "是否删除")
     private Integer isDel;
 
+    private Long id;
+    private Integer isShow;
+    private Long goodsId;
+    private String productName;
+    private String image;
+
 }

+ 5 - 0
fs-service-system/src/main/java/com/fs/live/domain/LiveCouponIssue.java

@@ -1,5 +1,6 @@
 package com.fs.live.domain;
 
+import java.math.BigDecimal;
 import java.util.Date;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fs.common.annotation.Excel;
@@ -64,4 +65,8 @@ public class LiveCouponIssue extends BaseEntity
     @Excel(name = "1 正常 0 未开启 -1 已无效")
     private Integer isDel;
 
+    private BigDecimal couponPrice;
+    private BigDecimal useMinPrice;
+    private Long couponTime;
+
 }

+ 27 - 0
fs-service-system/src/main/java/com/fs/live/domain/LiveCouponIssueRelation.java

@@ -0,0 +1,27 @@
+package com.fs.live.domain;
+
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.math.BigDecimal;
+
+/**
+ * 优惠券对象 live_coupon
+ *
+ * @author fs
+ * @date 2025-09-30
+ */
+@Data
+public class LiveCouponIssueRelation
+{
+
+
+    /** 优惠券表ID */
+    private Long couponIssueId;
+    private Long liveId;
+    private Integer isShow;
+    private Long goodsId;
+
+}

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

@@ -32,4 +32,8 @@ public class LiveCouponIssueUser extends BaseEntity
     @Excel(name = "优惠券领取ID")
     private Integer isDel;
 
+    /** $column.columnComment */
+    @Excel(name = "商品ID")
+    private Long goodsId;
+
 }

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

@@ -69,5 +69,9 @@ public class LiveCouponUser extends BaseEntity
     @Excel(name = "是否有效")
     private Integer isDel;
 
+    /** $column.columnComment */
+    @Excel(name = "商品ID")
+    private Long goodsId;
+
 
 }

+ 1 - 0
fs-service-system/src/main/java/com/fs/live/domain/LiveOrder.java

@@ -316,6 +316,7 @@ public class LiveOrder extends BaseEntity {
     private String companyUserName;
 
     private Long customerId;
+    private Long couponUserId;
 
 
 }

+ 9 - 0
fs-service-system/src/main/java/com/fs/live/mapper/LiveCouponIssueMapper.java

@@ -2,6 +2,9 @@ package com.fs.live.mapper;
 
 import java.util.List;
 import com.fs.live.domain.LiveCouponIssue;
+import com.fs.live.param.CouponPO;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
 
 /**
  * 优惠券领取Mapper接口
@@ -58,4 +61,10 @@ public interface LiveCouponIssueMapper
      * @return 结果
      */
     public int deleteLiveCouponIssueByIds(Long[] ids);
+
+    @Select("select lci.* from live_coupon_issue_user lciu left join live_coupon_issue lci on lci.id=lciu.issue_id where lciu.user_id = #{coupon.userId} ")
+    List<LiveCouponIssue> selectLiveCouponIssueUserByCouponPO(@Param("coupon") CouponPO coupon);
+
+    @Select("select lci.* from live_coupon_issue_user lciu where lciu.user_id=#{coupon.userId} and lciu.goods_id=#{coupon.goodsId}")
+    List<LiveCouponIssue> curCoupon(@Param("coupon") CouponPO coupon);
 }

+ 5 - 0
fs-service-system/src/main/java/com/fs/live/mapper/LiveCouponIssueUserMapper.java

@@ -2,6 +2,8 @@ package com.fs.live.mapper;
 
 import java.util.List;
 import com.fs.live.domain.LiveCouponIssueUser;
+import com.fs.live.domain.LiveCouponUser;
+import com.fs.live.param.CouponPO;
 
 /**
  * 优惠券用户领取记录Mapper接口
@@ -58,4 +60,7 @@ public interface LiveCouponIssueUserMapper
      * @return 结果
      */
     public int deleteLiveCouponIssueUserByIds(Long[] ids);
+
+
+    List<LiveCouponUser> selectLiveCouponUserByCouponPO(CouponPO coupon);
 }

+ 45 - 0
fs-service-system/src/main/java/com/fs/live/mapper/LiveCouponMapper.java

@@ -2,8 +2,14 @@ package com.fs.live.mapper;
 
 import java.util.List;
 import com.fs.live.domain.LiveCoupon;
+import com.fs.live.domain.LiveCouponIssue;
+import com.fs.live.domain.LiveCouponIssueRelation;
+import com.fs.live.vo.LiveCouponListVo;
 import com.fs.store.domain.FsStoreCoupon;
+import org.apache.ibatis.annotations.Insert;
+import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
 
 /**
  * 优惠券Mapper接口
@@ -63,4 +69,43 @@ public interface LiveCouponMapper
 
     @Select("select * from live_coupon where find_in_set(coupon_id,#{ids})")
     List<LiveCoupon> selectLiveCouponByIds(String ids);
+
+    @Select("select lc.*,lci.id,lcir.is_show,lcir.goods_id,fsp.product_name,fsp.image " +
+            "from live_coupon_issue_relation lcir left join live_coupon_issue lci " +
+            "left join live_coupon lc on lc.coupon_id=lci.coupon_id on lci.id = lcir.coupon_issue_id  " +
+            "left join live_goods lg on lg.goods_id = lcir.goods_id " +
+            "left join fs_store_product fsp on lg.product_id = fsp.product_id " +
+            "where lcir.live_id = #{liveId}")
+    List<LiveCoupon> selectLiveCouponByLiveId(@Param("liveId") Long liveId);
+
+    @Select("<script>" +
+            "select lc.*,lci.id from live_coupon_issue lci left join live_coupon lc on lc.coupon_id=lci.coupon_id " +
+            "where lci.status=1" +
+            " and lc.title like concat('%', #{couponName}, '%')" +
+            " and id not in (select coupon_issue_id as id from live_coupon_issue_relation where live_id = #{liveId})" +
+            "</script>"
+    )
+    List<LiveCoupon> listCoupon(@Param("liveId") Long liveId, @Param("couponName") String couponName);
+
+    @Insert("insert into live_coupon_issue_relation(live_id,coupon_issue_id,is_show) values(#{liveId},#{couponId},0)")
+    void insertLiveCouponEntity(@Param("liveId")Long liveId,@Param("couponId") Long couponId);
+
+    @Select("select coupon_issue_id as id from live_coupon_issue_relation where live_id = #{liveId}")
+    List<Long> selectLiveCouponIssueByLiveId(Long liveId);
+
+    void handleDeleteSelectedAdmin(@Param("listVo") LiveCouponListVo listVo);
+
+    @Select("select count(1) from live_coupon_issue_relation where live_id = #{liveId} and is_show = 1")
+    int selectShowByLiveId(@Param("liveId") Long liveId);
+
+    @Update("update live_coupon_issue_relation set is_show = #{isShow} where live_id = #{liveId} and coupon_issue_id = #{couponId}")
+    void updateShow(@Param("liveId")Long liveId,@Param("couponId") Long couponId ,@Param("isShow") int isShow);
+
+    int updateLiveCouponBind(@Param("listVo") LiveCouponListVo listVo);
+
+    @Select("select * from live_coupon_issue_relation where live_id = #{liveId} and coupon_issue_id = #{couponId}")
+    LiveCouponIssueRelation selectRelation(@Param("liveId")Long liveId,@Param("couponId") Long couponId);
+
+    @Select("select lci.* from live_coupon_issue lci left join live_coupon_issue_relation lcir on lci.id=lcir.coupon_issue_id where lcir.live_id = #{liveId} and lci.id = #{couponId}")
+    LiveCouponIssue selectLiveCouponIssueByLiveIdAndCouponId(@Param("liveId")Long liveId,@Param("couponId") Long couponId);
 }

+ 14 - 0
fs-service-system/src/main/java/com/fs/live/mapper/LiveCouponUserMapper.java

@@ -2,6 +2,9 @@ package com.fs.live.mapper;
 
 import java.util.List;
 import com.fs.live.domain.LiveCouponUser;
+import com.fs.live.param.CouponPO;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
 
 /**
  * 优惠券发放记录Mapper接口
@@ -58,4 +61,15 @@ public interface LiveCouponUserMapper
      * @return 结果
      */
     public int deleteLiveCouponUserByIds(Long[] ids);
+
+    @Select("select lcu.* from live_coupon_user lcu  where lcu.user_id = #{coupon.userId}")
+    List<LiveCouponUser> selectLiveCouponUserByCouponPO(@Param("coupon") CouponPO coupon);
+
+    @Select("<script>" +
+            "select lcu.* from live_coupon_user lcu where lcu.user_id= #{coupon.userId} " +
+            " <if test='coupon.goodsId != null'>" +
+            " and lcu.goods_id= #{coupon.goodsId}" +
+            " </if>" +
+            "</script>")
+    List<LiveCouponUser> curCoupon(@Param("coupon") CouponPO coupon);
 }

+ 26 - 0
fs-service-system/src/main/java/com/fs/live/param/CouponPO.java

@@ -0,0 +1,26 @@
+package com.fs.live.param;
+
+import lombok.Data;
+
+@Data
+public class CouponPO {
+
+    /**
+     * 直播间id
+     * */
+    private Long liveId;
+
+    /**
+     * 优惠券id
+     * */
+    private Long couponIssueId;
+
+
+    /**
+     * 用户Id
+     * */
+    private Long userId;
+    private Long goodsId;
+
+
+}

+ 5 - 0
fs-service-system/src/main/java/com/fs/live/service/ILiveCouponIssueService.java

@@ -2,6 +2,7 @@ package com.fs.live.service;
 
 import java.util.List;
 import com.fs.live.domain.LiveCouponIssue;
+import com.fs.live.param.CouponPO;
 
 /**
  * 优惠券领取Service接口
@@ -58,4 +59,8 @@ public interface ILiveCouponIssueService
      * @return 结果
      */
     public int deleteLiveCouponIssueById(Long id);
+
+    List<LiveCouponIssue> selectLiveCouponIssueUserByCouponPO(CouponPO coupon);
+
+    List<LiveCouponIssue> curCoupon(CouponPO coupon);
 }

+ 5 - 0
fs-service-system/src/main/java/com/fs/live/service/ILiveCouponIssueUserService.java

@@ -2,6 +2,8 @@ package com.fs.live.service;
 
 import java.util.List;
 import com.fs.live.domain.LiveCouponIssueUser;
+import com.fs.live.domain.LiveCouponUser;
+import com.fs.live.param.CouponPO;
 
 /**
  * 优惠券用户领取记录Service接口
@@ -58,4 +60,7 @@ public interface ILiveCouponIssueUserService
      * @return 结果
      */
     public int deleteLiveCouponIssueUserById(Long id);
+
+
+    List<LiveCouponUser> selectLiveCouponUserByCouponPO(CouponPO coupon);
 }

+ 25 - 0
fs-service-system/src/main/java/com/fs/live/service/ILiveCouponService.java

@@ -1,7 +1,12 @@
 package com.fs.live.service;
 
 import java.util.List;
+import java.util.Map;
+
+import com.fs.common.core.domain.R;
 import com.fs.live.domain.LiveCoupon;
+import com.fs.live.param.CouponPO;
+import com.fs.live.vo.LiveCouponListVo;
 import com.fs.store.domain.FsStoreCoupon;
 
 /**
@@ -61,4 +66,24 @@ public interface ILiveCouponService
     public int deleteLiveCouponById(Long couponId);
 
     List<LiveCoupon> selectLiveCouponByIds(String ids);
+
+    List<LiveCoupon> selectLiveCouponByLiveId(Long liveId);
+
+    List<LiveCoupon> listCoupon(Long liveId, String couponName);
+
+    int insertLiveCouponEntity(Map<String, Object> payload);
+
+    R handleIsShowChange(Map<String, Object> payload);
+
+    R handleDeleteSelectedAdmin(LiveCouponListVo listVo);
+
+    int delLiveCoupon(LiveCouponListVo vo);
+
+    R updateLiveCouponBind(LiveCouponListVo listVo);
+
+    R claimCoupon(CouponPO coupon);
+
+    R userCouponList(CouponPO coupon);
+
+    R curCoupon(CouponPO coupon);
 }

+ 5 - 0
fs-service-system/src/main/java/com/fs/live/service/ILiveCouponUserService.java

@@ -2,6 +2,7 @@ package com.fs.live.service;
 
 import java.util.List;
 import com.fs.live.domain.LiveCouponUser;
+import com.fs.live.param.CouponPO;
 
 /**
  * 优惠券发放记录Service接口
@@ -58,4 +59,8 @@ public interface ILiveCouponUserService
      * @return 结果
      */
     public int deleteLiveCouponUserById(Long id);
+
+    List<LiveCouponUser> selectLiveCouponUserByCouponPO(CouponPO coupon);
+
+    List<LiveCouponUser> curCoupon(CouponPO coupon);
 }

+ 12 - 0
fs-service-system/src/main/java/com/fs/live/service/impl/LiveCouponIssueServiceImpl.java

@@ -1,7 +1,9 @@
 package com.fs.live.service.impl;
 
+import java.util.Collections;
 import java.util.List;
 import com.fs.common.utils.DateUtils;
+import com.fs.live.param.CouponPO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.fs.live.mapper.LiveCouponIssueMapper;
@@ -93,4 +95,14 @@ public class LiveCouponIssueServiceImpl implements ILiveCouponIssueService
     {
         return liveCouponIssueMapper.deleteLiveCouponIssueById(id);
     }
+
+    @Override
+    public List<LiveCouponIssue> selectLiveCouponIssueUserByCouponPO(CouponPO coupon) {
+        return liveCouponIssueMapper.selectLiveCouponIssueUserByCouponPO(coupon);
+    }
+
+    @Override
+    public List<LiveCouponIssue> curCoupon(CouponPO coupon) {
+        return liveCouponIssueMapper.curCoupon(coupon);
+    }
 }

+ 8 - 0
fs-service-system/src/main/java/com/fs/live/service/impl/LiveCouponIssueUserServiceImpl.java

@@ -1,7 +1,10 @@
 package com.fs.live.service.impl;
 
+import java.util.Collections;
 import java.util.List;
 import com.fs.common.utils.DateUtils;
+import com.fs.live.domain.LiveCouponUser;
+import com.fs.live.param.CouponPO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.fs.live.mapper.LiveCouponIssueUserMapper;
@@ -93,4 +96,9 @@ public class LiveCouponIssueUserServiceImpl implements ILiveCouponIssueUserServi
     {
         return liveCouponIssueUserMapper.deleteLiveCouponIssueUserById(id);
     }
+
+    @Override
+    public List<LiveCouponUser> selectLiveCouponUserByCouponPO(CouponPO coupon) {
+        return liveCouponIssueUserMapper.selectLiveCouponUserByCouponPO(coupon);
+    }
 }

+ 163 - 3
fs-service-system/src/main/java/com/fs/live/service/impl/LiveCouponServiceImpl.java

@@ -1,14 +1,29 @@
 package com.fs.live.service.impl;
 
-import java.util.Collections;
-import java.util.List;
+import java.util.*;
+import java.util.stream.Collectors;
+
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.json.JSONUtil;
+import com.fs.common.constant.LiveKeysConstant;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.redis.RedisUtil;
 import com.fs.common.utils.DateUtils;
+import com.fs.common.utils.StringUtils;
+import com.fs.live.domain.*;
+import com.fs.live.mapper.LiveMapper;
+import com.fs.live.param.CouponPO;
+import com.fs.live.service.ILiveCouponIssueService;
+import com.fs.live.service.ILiveCouponIssueUserService;
+import com.fs.live.service.ILiveCouponUserService;
+import com.fs.live.vo.LiveCouponListVo;
 import com.fs.store.domain.FsStoreCoupon;
+import org.checkerframework.checker.units.qual.A;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.fs.live.mapper.LiveCouponMapper;
-import com.fs.live.domain.LiveCoupon;
 import com.fs.live.service.ILiveCouponService;
+import org.springframework.transaction.annotation.Transactional;
 
 /**
  * 优惠券Service业务层处理
@@ -22,6 +37,18 @@ public class LiveCouponServiceImpl implements ILiveCouponService
     @Autowired
     private LiveCouponMapper liveCouponMapper;
 
+    @Autowired
+    private LiveMapper liveMapper;
+
+    @Autowired
+    private RedisUtil redisUtil;
+    @Autowired
+    private ILiveCouponIssueUserService liveCouponIssueUserService;
+    @Autowired
+    private ILiveCouponUserService liveCouponUserService;
+    @Autowired
+    private ILiveCouponIssueService liveCouponIssueService;
+
     /**
      * 查询优惠券
      *
@@ -100,4 +127,137 @@ public class LiveCouponServiceImpl implements ILiveCouponService
     public List<LiveCoupon> selectLiveCouponByIds(String ids) {
         return liveCouponMapper.selectLiveCouponByIds(ids);
     }
+
+    @Override
+    public List<LiveCoupon> selectLiveCouponByLiveId(Long liveId) {
+        return liveCouponMapper.selectLiveCouponByLiveId(liveId);
+    }
+
+    @Override
+    public List<LiveCoupon> listCoupon(Long liveId, String couponName) {
+        return liveCouponMapper.listCoupon(liveId, couponName);
+    }
+
+    @Override
+    public int insertLiveCouponEntity(Map<String, Object> payload) {
+        Long liveId = Long.valueOf((String) payload.get("liveId"));
+        Live live = liveMapper.selectLiveByLiveId(liveId);
+        if(live == null) return -1;
+        String s = String.valueOf(payload.get("couponIds"));
+        if(StringUtils.isEmpty(s)) return -1;
+        Set<Long> collect = liveCouponMapper.selectLiveCouponIssueByLiveId(liveId).stream().collect(Collectors.toSet());
+
+        String[] split = s.split(",");
+        for (String couponId : split) {
+            if(collect.contains(Long.valueOf(couponId))) continue;
+            liveCouponMapper.insertLiveCouponEntity(liveId, Long.valueOf(couponId));
+        }
+        return 1;
+    }
+
+    @Override
+    public R handleIsShowChange(Map<String, Object> payload) {
+        Long liveId = Long.valueOf((String) payload.get("liveId"));
+        Live live = liveMapper.selectLiveByLiveId(liveId);
+        if(live == null) return R.error("直播间不存在");
+        boolean isShow = Boolean.parseBoolean(payload.get("isShow").toString());
+        if (isShow) {
+            int i = liveCouponMapper.selectShowByLiveId(liveId);
+            if (i > 0) return R.error("直播间已存在优惠券");
+        }
+        Long couponId = Long.valueOf(payload.get("couponId").toString());
+        LiveCouponIssueRelation liveCouponIssueRelation = liveCouponMapper.selectRelation(liveId,couponId);
+        if(ObjectUtil.isEmpty(liveCouponIssueRelation.getGoodsId())) return R.error("未绑定商品,无法发布!");
+        liveCouponMapper.updateShow(liveId, couponId, isShow ? 1 : 0);
+        return R.ok("操作成功");
+    }
+
+    @Override
+    public R handleDeleteSelectedAdmin(LiveCouponListVo listVo) {
+        liveCouponMapper.handleDeleteSelectedAdmin(listVo);
+        return R.ok();
+    }
+
+    @Override
+    public int delLiveCoupon(LiveCouponListVo vo) {
+        liveCouponMapper.handleDeleteSelectedAdmin(vo);
+        return 1;
+    }
+
+    @Override
+    public R updateLiveCouponBind(LiveCouponListVo listVo) {
+        Live live = liveMapper.selectLiveByLiveId(Long.valueOf(listVo.getLiveId()));
+        if(live == null) return R.error("直播间不存在");
+        int i = liveCouponMapper.updateLiveCouponBind(listVo);
+        if(i > 0) return R.ok("操作成功");
+        return R.error("操作失败");
+    }
+
+    @Override
+    @Transactional
+    public R claimCoupon(CouponPO coupon) {
+        Object o = redisUtil.hashGet(String.format(LiveKeysConstant.LIVE_HOME_PAGE_CONFIG_COUPON, coupon.getLiveId(), coupon.getCouponIssueId()), String.valueOf(coupon.getUserId()));
+        if (ObjectUtil.isNotEmpty(o)) {
+            return R.error("您已经领取过优惠券了!");
+        }
+        LiveCouponIssue issue = liveCouponMapper.selectLiveCouponIssueByLiveIdAndCouponId(coupon.getLiveId(), coupon.getCouponIssueId());
+        if (coupon == null || issue.getStatus() != 1) {
+            return R.error("优惠券不存在或者已下架!");
+        }
+        Long decrement = redisUtil.decrement(String.format(LiveKeysConstant.LIVE_COUPON_NUM , coupon.getCouponIssueId()));
+
+        LiveCoupon liveCoupon = liveCouponMapper.selectLiveCouponById(issue.getCouponId());
+
+
+        if (decrement < 0L) {
+            issue.setStatus(-1);
+            issue.setRemainCount(0L);
+            redisUtil.delete(String.valueOf(issue.getId()));
+            liveCouponIssueService.updateLiveCouponIssue(issue);
+            return R.error("此优惠券已领完");
+        }
+        Date now = DateUtils.getNowDate();
+        LiveCouponIssueUser record = new LiveCouponIssueUser();
+        record.setUserId(coupon.getUserId());
+        record.setIssueId(issue.getId());
+        record.setCreateTime(now);
+        record.setUpdateTime(now);
+        record.setIsDel(0);
+        record.setGoodsId(coupon.getGoodsId());
+
+
+        LiveCouponUser userRecord = new LiveCouponUser();
+        userRecord.setCouponId(liveCoupon.getCouponId());
+        userRecord.setUserId(Math.toIntExact(coupon.getUserId()));
+        userRecord.setCouponTitle(liveCoupon.getTitle());
+        userRecord.setCouponPrice(liveCoupon.getCouponPrice());
+        userRecord.setUseMinPrice(liveCoupon.getUseMinPrice());
+        userRecord.setCreateTime(now);
+        userRecord.setUpdateTime(now);
+        userRecord.setStatus(0);
+        userRecord.setLimitTime(DateUtils.addDays(now, Math.toIntExact(liveCoupon.getCouponTime())));
+        userRecord.setIsFail(1);
+        userRecord.setIsDel(0);
+        userRecord.setIsDel(0);
+        userRecord.setGoodsId(coupon.getGoodsId());
+        userRecord.setType("live-"+coupon.getLiveId());
+        liveCouponUserService.insertLiveCouponUser(userRecord);
+        liveCouponIssueUserService.insertLiveCouponIssueUser(record);
+        redisUtil.hashPut(String.format(LiveKeysConstant.LIVE_HOME_PAGE_CONFIG_COUPON, coupon.getLiveId(), coupon.getCouponIssueId()), String.valueOf(coupon.getUserId()), JSONUtil.toJsonStr(record));
+        return R.ok("恭喜您抢到优惠券");
+    }
+
+    @Override
+    public R userCouponList(CouponPO coupon) {
+        List<LiveCouponUser> list = liveCouponUserService.selectLiveCouponUserByCouponPO(coupon);
+        return R.ok().put("data", list);
+    }
+
+    @Override
+    public R curCoupon(CouponPO coupon) {
+        List<LiveCouponUser> list = liveCouponUserService.curCoupon(coupon);
+        return R.ok().put("data", list);
+    }
+
+
 }

+ 12 - 0
fs-service-system/src/main/java/com/fs/live/service/impl/LiveCouponUserServiceImpl.java

@@ -1,7 +1,9 @@
 package com.fs.live.service.impl;
 
+import java.util.Collections;
 import java.util.List;
 import com.fs.common.utils.DateUtils;
+import com.fs.live.param.CouponPO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.fs.live.mapper.LiveCouponUserMapper;
@@ -93,4 +95,14 @@ public class LiveCouponUserServiceImpl implements ILiveCouponUserService
     {
         return liveCouponUserMapper.deleteLiveCouponUserById(id);
     }
+
+    @Override
+    public List<LiveCouponUser> selectLiveCouponUserByCouponPO(CouponPO coupon) {
+        return liveCouponUserMapper.selectLiveCouponUserByCouponPO(coupon);
+    }
+
+    @Override
+    public List<LiveCouponUser> curCoupon(CouponPO coupon) {
+        return liveCouponUserMapper.curCoupon(coupon);
+    }
 }

+ 31 - 5
fs-service-system/src/main/java/com/fs/live/service/impl/LiveOrderServiceImpl.java

@@ -55,8 +55,7 @@ import com.fs.live.mapper.*;
 import com.fs.live.param.FsUserLiveOrderPayUParam;
 import com.fs.live.param.LiveOrderConfirmParam;
 import com.fs.live.param.LiveOrderFinishParam;
-import com.fs.live.service.ILiveOrderLogsService;
-import com.fs.live.service.ILiveUserFirstEntryService;
+import com.fs.live.service.*;
 import com.fs.live.vo.LiveGoodsVo;
 import com.fs.live.vo.LiveOrderItemVo;
 import com.fs.live.vo.LiveOrderListVo;
@@ -105,7 +104,6 @@ import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.ApplicationEventPublisher;
 import org.springframework.stereotype.Service;
-import com.fs.live.service.ILiveOrderService;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
@@ -222,6 +220,8 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
 
     @Autowired
     private CompanyMoneyLogsMapper moneyLogsMapper;
+    @Autowired
+    private ILiveCouponUserService liveCouponUserService;
 
 
     public LiveOrderServiceImpl(RedisCache redisCache) {
@@ -1358,7 +1358,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
     }
 
     @Override
-    public LiveOrderComputeDTO computedOrder(long l, LiveOrderComputedParam param) {
+    public LiveOrderComputeDTO computedOrder(long userId, LiveOrderComputedParam param) {
         String orderKey= redisCache.getCacheObject("orderKey:"+param.getOrderKey());
         if (StringUtils.isEmpty(orderKey)) {
             return null;
@@ -1370,6 +1370,15 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
             payDelivery = handleDeliveryMoney(param.getCityId(), fsStoreProduct, param.getTotalNum());
         }
 
+        if(param.getCouponUserId()!=null){
+            LiveCouponUser couponUser=liveCouponUserService.selectLiveCouponUserById(param.getCouponUserId());
+            if(couponUser!=null&&couponUser.getStatus()==0){
+                if(couponUser.getUseMinPrice().compareTo(payPrice)==-1){
+                    payPrice=payPrice.subtract(couponUser.getCouponPrice());
+                }
+            }
+        }
+
 
         return LiveOrderComputeDTO.builder().payPrice(payPrice)
                 .payDelivery(payDelivery)
@@ -1950,6 +1959,23 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
         // 生成
         BigDecimal deliveryMoney = handleDeliveryMoney(liveOrder);
         payPrice = payPrice.add(deliveryMoney);
+        liveOrder.setDiscountMoney(BigDecimal.ZERO);
+
+        //优惠券处理
+        if(liveOrder.getCouponUserId()!=null){
+            LiveCouponUser couponUser=liveCouponUserService.selectLiveCouponUserById(liveOrder.getCouponUserId());
+            if(couponUser!=null&&couponUser.getStatus()==0){
+                if (!couponUser.getUserId().toString().equals(liveOrder.getUserId())){
+                    return R.error("非法操作");
+                }
+                liveOrder.setUserCouponId(couponUser.getId());
+                liveOrder.setDiscountMoney(couponUser.getCouponPrice());
+                //更新优惠券状态
+                couponUser.setStatus(1);
+                couponUser.setUseTime(new Date());
+                liveCouponUserService.updateLiveCouponUser(couponUser);
+            }
+        }
 
         liveOrder.setItemJson(JSON.toJSONString(fsStoreProduct));
         liveOrder.setCreateTime(new Date());
@@ -1959,7 +1985,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
         liveOrder.setStatus(OrderInfoEnum.STATUS_1.getValue());
         liveOrder.setPayType("1");
         liveOrder.setTotalPrice(payPrice);
-        liveOrder.setPayMoney(liveOrder.getTotalPrice());
+        liveOrder.setPayMoney(liveOrder.getTotalPrice().subtract(liveOrder.getDiscountMoney()));
         try {
             if (baseMapper.insertLiveOrder(liveOrder) > 0) {
                 LiveOrderItemDTO dto=new LiveOrderItemDTO();

+ 27 - 0
fs-service-system/src/main/java/com/fs/live/vo/LiveCouponListVo.java

@@ -0,0 +1,27 @@
+package com.fs.live.vo;
+
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class LiveCouponListVo {
+    List<Long> couponIds;
+    Integer status;
+    Integer liveId;
+    Boolean isShow;
+    Long couponId;
+    Long goodsId;
+
+
+    /**
+     * 企业ID
+     */
+    private Long companyId;
+
+    /**
+     * 企业用户ID
+     */
+    private Long companyUserId;
+}

+ 16 - 11
fs-service-system/src/main/resources/mapper/live/LiveCouponIssueMapper.xml

@@ -18,6 +18,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="isDel"    column="is_del"    />
         <result property="createTime"    column="create_time"    />
         <result property="updateTime"    column="update_time"    />
+        <result property="couponPrice"    column="coupon_price"    />
+        <result property="useMinPrice"    column="use_min_price"    />
+        <result property="couponTime"    column="coupon_time"    />
     </resultMap>
 
     <sql id="selectLiveCouponIssueVo">
@@ -25,18 +28,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </sql>
 
     <select id="selectLiveCouponIssueList" parameterType="LiveCouponIssue" resultMap="LiveCouponIssueResult">
-        <include refid="selectLiveCouponIssueVo"/>
+        select lci.id, lci.coupon_name, lci.coupon_id, lci.coupon_type, lci.start_time, lci.limit_time, lci.total_count,
+        lci.remain_count, lci.is_permanent, lci.status, lci.is_del, lci.create_time, lci.update_time,lc.coupon_price,lc.use_min_price,lc.coupon_time from live_coupon_issue lci
+        left join live_coupon lc on lci.coupon_id = lc.coupon_id
         <where>
-            <if test="couponName != null  and couponName != ''"> and coupon_name like concat('%', #{couponName}, '%')</if>
-            <if test="couponId != null "> and coupon_id = #{couponId}</if>
-            <if test="couponType != null "> and coupon_type = #{couponType}</if>
-            <if test="startTime != null "> and start_time = #{startTime}</if>
-            <if test="limitTime != null "> and limit_time = #{limitTime}</if>
-            <if test="totalCount != null "> and total_count = #{totalCount}</if>
-            <if test="remainCount != null "> and remain_count = #{remainCount}</if>
-            <if test="isPermanent != null "> and is_permanent = #{isPermanent}</if>
-            <if test="status != null "> and status = #{status}</if>
-            <if test="isDel != null "> and is_del = #{isDel}</if>
+            <if test="couponName != null  and couponName != ''"> and lci.coupon_name like concat('%', #{couponName}, '%')</if>
+            <if test="couponId != null "> and lci.coupon_id = #{couponId}</if>
+            <if test="couponType != null "> and lci.coupon_type = #{couponType}</if>
+            <if test="startTime != null "> and lci.start_time = #{startTime}</if>
+            <if test="limitTime != null "> and lci.limit_time = #{limitTime}</if>
+            <if test="totalCount != null "> and lci.total_count = #{totalCount}</if>
+            <if test="remainCount != null "> and lci.remain_count = #{remainCount}</if>
+            <if test="isPermanent != null "> and lci.is_permanent = #{isPermanent}</if>
+            <if test="status != null "> and lci.status = #{status}</if>
+            <if test="isDel != null "> and lci.is_del = #{isDel}</if>
         </where>
     </select>
 

+ 6 - 1
fs-service-system/src/main/resources/mapper/live/LiveCouponIssueUserMapper.xml

@@ -11,10 +11,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="createTime"    column="create_time"    />
         <result property="updateTime"    column="update_time"    />
         <result property="isDel"    column="is_del"    />
+        <result property="goodsId"    column="goods_id"    />
     </resultMap>
 
     <sql id="selectLiveCouponIssueUserVo">
-        select id, user_id, issue_id, create_time, update_time, is_del from live_coupon_issue_user
+        select id, user_id, issue_id, create_time, update_time, is_del,goods_id from live_coupon_issue_user
     </sql>
 
     <select id="selectLiveCouponIssueUserList" parameterType="LiveCouponIssueUser" resultMap="LiveCouponIssueUserResult">
@@ -23,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="userId != null "> and user_id = #{userId}</if>
             <if test="issueId != null "> and issue_id = #{issueId}</if>
             <if test="isDel != null "> and is_del = #{isDel}</if>
+            <if test="goodsId != null "> and goods_id = #{goodsId}</if>
         </where>
     </select>
 
@@ -39,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">create_time,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="isDel != null">is_del,</if>
+            <if test="goodsId != null">goods_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="userId != null">#{userId},</if>
@@ -46,6 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">#{createTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="isDel != null">#{isDel},</if>
+            <if test="goodsId != null">#{goodsId},</if>
          </trim>
     </insert>
 
@@ -57,6 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="isDel != null">is_del = #{isDel},</if>
+            <if test="goodsId != null">goods_id = #{goodsId},</if>
         </trim>
         where id = #{id}
     </update>

+ 12 - 0
fs-service-system/src/main/resources/mapper/live/LiveCouponMapper.xml

@@ -112,4 +112,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </foreach>
     </delete>
 
+    <delete id="handleDeleteSelectedAdmin" parameterType="com.fs.live.vo.LiveCouponListVo">
+        delete from live_coupon_issue_relation
+        WHERE live_id = #{listVo.liveId} AND coupon_issue_id IN
+        <foreach item="couponId" collection="listVo.couponIds" open="(" separator="," close=")">
+            #{couponId}
+        </foreach>
+    </delete>
+    <update id="updateLiveCouponBind" parameterType="com.fs.live.vo.LiveCouponListVo">
+        update live_coupon_issue_relation set goods_id = #{listVo.goodsId}
+        WHERE live_id = #{listVo.liveId} AND coupon_issue_id = #{listVo.couponId}
+    </update>
+
 </mapper>

+ 6 - 1
fs-service-system/src/main/resources/mapper/live/LiveCouponUserMapper.xml

@@ -19,10 +19,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="status"    column="status"    />
         <result property="isFail"    column="is_fail"    />
         <result property="isDel"    column="is_del"    />
+        <result property="goodsId"    column="goods_id"    />
     </resultMap>
 
     <sql id="selectLiveCouponUserVo">
-        select id, coupon_id, user_id, coupon_title, coupon_price, use_min_price, create_time, update_time, limit_time, use_time, type, status, is_fail, is_del from live_coupon_user
+        select id, coupon_id, user_id, coupon_title, coupon_price, use_min_price, create_time, update_time, limit_time, use_time, type, status, is_fail, is_del,goods_id from live_coupon_user
     </sql>
 
     <select id="selectLiveCouponUserList" parameterType="LiveCouponUser" resultMap="LiveCouponUserResult">
@@ -39,6 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="status != null "> and status = #{status}</if>
             <if test="isFail != null "> and is_fail = #{isFail}</if>
             <if test="isDel != null "> and is_del = #{isDel}</if>
+            <if test="goodsId != null "> and goods_id = #{goodsId}</if>
         </where>
     </select>
 
@@ -63,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="status != null">status,</if>
             <if test="isFail != null">is_fail,</if>
             <if test="isDel != null">is_del,</if>
+            <if test="goodsId != null">goods_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="couponId != null">#{couponId},</if>
@@ -78,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="status != null">#{status},</if>
             <if test="isFail != null">#{isFail},</if>
             <if test="isDel != null">#{isDel},</if>
+            <if test="goodsId != null">#{goodsId},</if>
          </trim>
     </insert>
 
@@ -97,6 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="status != null">status = #{status},</if>
             <if test="isFail != null">is_fail = #{isFail},</if>
             <if test="isDel != null">is_del = #{isDel},</if>
+            <if test="goodsId != null">goods_id = #{goodsId},</if>
         </trim>
         where id = #{id}
     </update>

+ 55 - 0
fs-user-app/src/main/java/com/fs/app/controller/LiveCouponController.java

@@ -0,0 +1,55 @@
+package com.fs.app.controller;
+
+import com.fs.app.annotation.Login;
+import com.fs.app.facade.LiveFacadeService;
+import com.fs.common.core.domain.R;
+import com.fs.live.param.CouponPO;
+import com.fs.live.param.RedPO;
+import com.fs.live.service.ILiveCouponService;
+import com.fs.live.service.ILiveRedConfService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/app/live/coupon")
+public class LiveCouponController extends AppBaseController {
+
+    @Autowired
+    private ILiveCouponService liveCouponService;
+    @Autowired
+    private LiveFacadeService liveFacadeService;
+
+    /**
+     * 领取优惠券
+     */
+    @Login
+    @PostMapping("/claim")
+    public R claim(@RequestBody CouponPO coupon) {
+        coupon.setUserId(Long.parseLong(getUserId()));
+        return liveFacadeService.couponClaim(coupon);
+    }
+
+    /**
+     * 用户优惠券列表
+     */
+    @Login
+    @PostMapping("/list")
+    public R list(@RequestBody CouponPO coupon) {
+        coupon.setUserId(Long.parseLong(getUserId()));
+        return liveCouponService.userCouponList(coupon);
+    }
+
+    /**
+     * 当前商品优惠券
+     */
+    @Login
+    @PostMapping("/curCoupon")
+    public R curCoupon(@RequestBody CouponPO coupon) {
+        coupon.setUserId(Long.parseLong(getUserId()));
+        return liveCouponService.curCoupon(coupon);
+    }
+
+}

+ 2 - 0
fs-user-app/src/main/java/com/fs/app/facade/LiveFacadeService.java

@@ -4,6 +4,7 @@ import com.fs.common.core.domain.R;
 import com.fs.common.core.page.PageRequest;
 import com.fs.common.core.page.TableDataInfo;
 import com.fs.live.domain.LiveWatchUser;
+import com.fs.live.param.CouponPO;
 import com.fs.live.param.LotteryPO;
 import com.fs.live.param.RedPO;
 
@@ -20,4 +21,5 @@ public interface LiveFacadeService {
 
     R redClaim(RedPO red);
 
+    R couponClaim(CouponPO coupon);
 }

+ 10 - 0
fs-user-app/src/main/java/com/fs/app/facade/impl/LiveFacadeServiceImpl.java

@@ -17,6 +17,7 @@ import com.fs.live.domain.Live;
 import com.fs.live.domain.LiveLotteryRegistration;
 import com.fs.live.domain.LiveRedConf;
 import com.fs.live.domain.LiveWatchUser;
+import com.fs.live.param.CouponPO;
 import com.fs.live.param.LotteryPO;
 import com.fs.live.param.RedPO;
 import com.fs.live.service.*;
@@ -52,6 +53,8 @@ public class LiveFacadeServiceImpl extends BaseController implements LiveFacadeS
     private ILiveLotteryRegistrationService liveLotteryRegistrationService;
     @Autowired
     private ILiveRedConfService iLiveRedConfService;
+    @Autowired
+    private ILiveCouponService iLiveCouponService;
 
     @Autowired
     private ILiveLotteryConfService liveLotteryConfService;
@@ -161,6 +164,13 @@ public class LiveFacadeServiceImpl extends BaseController implements LiveFacadeS
     public R redClaim(RedPO red) {
         return iLiveRedConfService.claimRedPacket(red);
     }
+
+    @Override
+    @DistributeLock(keyExpression = "#coupon.couponIssueId +'_'+#coupon.userId", scene = "coupon_claim", waitTime = 1000, errorMsg = "优惠券领取失败")
+    public R couponClaim(CouponPO coupon) {
+        return iLiveCouponService.claimCoupon(coupon);
+    }
+
     @Override
     @DistributeLock(keyExpression = "#lottery.liveId +'_'+#lottery.userId", scene = "draw_claim")
     public R drawClaim(LotteryPO lottery) {