Browse Source

直播订单及点赞、收藏相关修改

chenguo 5 days ago
parent
commit
8df985e4eb
23 changed files with 1021 additions and 37 deletions
  1. 4 1
      fs-live-app/src/main/java/com/fs/app/controller/AppBaseController.java
  2. 89 0
      fs-live-app/src/main/java/com/fs/app/controller/LiveDataController.java
  3. 107 0
      fs-live-app/src/main/java/com/fs/app/controller/LiveGoodsController.java
  4. 166 0
      fs-live-app/src/main/java/com/fs/app/controller/LiveOrderController.java
  5. 97 0
      fs-live-app/src/main/java/com/fs/app/controller/LiveUserFavoriteController.java
  6. 97 0
      fs-live-app/src/main/java/com/fs/app/controller/LiveUserFollowController.java
  7. 97 0
      fs-live-app/src/main/java/com/fs/app/controller/LiveUserLikeController.java
  8. 6 3
      fs-live-app/src/main/java/com/fs/app/task/Task.java
  9. 4 0
      fs-service/src/main/java/com/fs/his/param/BaseParam.java
  10. 3 0
      fs-service/src/main/java/com/fs/live/domain/Live.java
  11. 12 1
      fs-service/src/main/java/com/fs/live/domain/LiveOrder.java
  12. 7 7
      fs-service/src/main/java/com/fs/live/mapper/LiveOrderMapper.java
  13. 5 4
      fs-service/src/main/java/com/fs/live/mapper/LiveUserFavoriteMapper.java
  14. 3 2
      fs-service/src/main/java/com/fs/live/mapper/LiveUserFollowMapper.java
  15. 2 1
      fs-service/src/main/java/com/fs/live/mapper/LiveUserLikeMapper.java
  16. 288 0
      fs-service/src/main/java/com/fs/live/param/LiveOrderSearchParam.java
  17. 1 1
      fs-service/src/main/java/com/fs/live/service/ILiveUserFavoriteService.java
  18. 19 12
      fs-service/src/main/java/com/fs/live/service/impl/LiveDataServiceImpl.java
  19. 3 2
      fs-service/src/main/java/com/fs/live/service/impl/LiveOrderServiceImpl.java
  20. 1 1
      fs-service/src/main/java/com/fs/live/service/impl/LiveUserFavoriteServiceImpl.java
  21. 5 1
      fs-service/src/main/resources/mapper/live/LiveDataMapper.xml
  22. 4 0
      fs-service/src/main/resources/mapper/live/LiveUserFavoriteMapper.xml
  23. 1 1
      fs-service/src/main/resources/mapper/live/LiveUserLikeMapper.xml

+ 4 - 1
fs-live-app/src/main/java/com/fs/app/controller/AppBaseController.java

@@ -6,6 +6,7 @@ import com.fs.common.constant.HttpStatus;
 import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.core.redis.RedisCache;
 import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.StringUtils;
 import com.github.pagehelper.PageInfo;
 import io.jsonwebtoken.Claims;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -19,7 +20,9 @@ public class AppBaseController {
 
 	public String getUserId()
 	{
-		String headValue =  ServletUtils.getRequest().getHeader("APPToken");
+		String headValue =  ServletUtils.getRequest().getHeader("AppToken");
+		if (StringUtils.isEmpty(headValue))
+			headValue = ServletUtils.getRequest().getParameter("APPToken");
 		Claims claims=jwtUtils.getClaimByToken(headValue);
 		String userId = claims.getSubject().toString();
 		return userId;

+ 89 - 0
fs-live-app/src/main/java/com/fs/app/controller/LiveDataController.java

@@ -0,0 +1,89 @@
+package com.fs.app.controller;
+
+import com.fs.app.annotation.Login;
+import com.fs.common.core.domain.R;
+import com.fs.live.domain.LiveData;
+import com.fs.live.service.ILiveDataService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Map;
+
+import static com.fs.common.utils.SecurityUtils.getUserId;
+
+@RestController
+@RequestMapping("/app/live/liveData")
+public class LiveDataController extends AppBaseController{
+
+    @Autowired
+    private ILiveDataService liveDataService;
+
+    /**
+     * 查询直播数据列表
+     * */
+    @Login
+    @GetMapping("/list")
+    public List<LiveData> list(LiveData liveData) {
+        return liveDataService.selectLiveDataList(liveData);
+    }
+
+    /**
+     * 查询直播数据详情
+     * */
+    @Login
+    @GetMapping("/get/{liveId}")
+    public R getLiveData(@PathVariable("liveId") Long liveId) {
+        return R.ok().put("liveData", liveDataService.selectLiveDataByLiveId(liveId));
+    }
+
+    /**
+     * 点赞
+     * */
+    @Login
+    @GetMapping("/like/{liveId}")
+    public R like(@PathVariable("liveId") Long liveId) {
+        return R.ok(liveDataService.updateLikeByLiveId(liveId, Long.parseLong(getUserId())));
+    }
+
+    /**
+     * 收藏
+     * */
+    @Login
+    @GetMapping("/collect/{liveId}")
+    public R collect(@PathVariable("liveId") Long liveId) {
+        return R.ok(liveDataService.collect(liveId,  Long.parseLong(getUserId())));
+    }
+
+    /**
+     * 关注
+     * */
+    @Login
+    @GetMapping("/follow/{liveId}")
+    public R follow(@PathVariable("liveId") Long liveId) {
+        return R.ok(liveDataService.follow(liveId,  Long.parseLong(getUserId())));
+    }
+
+    /**
+     * 收藏店铺/店铺商品
+     * */
+    @Login
+    @GetMapping("/collectStore")
+    public R collectStore(Long storeId, Long productId, Long liveId) {
+        return R.ok(liveDataService.collectStore(storeId, productId, liveId,  Long.parseLong(getUserId())));
+    }
+
+    /**
+     * 获取直播内数据
+     * */
+    @GetMapping("/getLiveViewData")
+    public R getLiveViewData(Long liveId) {
+        Map<String,Object> liveViewData =liveDataService.getLiveViewData(liveId);
+        return R.ok(liveViewData);
+    }
+
+
+}

+ 107 - 0
fs-live-app/src/main/java/com/fs/app/controller/LiveGoodsController.java

@@ -0,0 +1,107 @@
+package com.fs.app.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.live.domain.LiveGoods;
+import com.fs.live.service.ILiveGoodsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 直播商品Controller
+ *
+ * @author fs
+ * @date 2025-07-08
+ */
+@RestController
+@RequestMapping("/app/live/liveGoods")
+public class LiveGoodsController extends BaseController
+{
+    @Autowired
+    private ILiveGoodsService liveGoodsService;
+
+    /**
+     * 查询直播商品列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveGoods:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveGoods liveGoods)
+    {
+        startPage();
+        List<LiveGoods> list = liveGoodsService.selectLiveGoodsList(liveGoods);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播商品列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveGoods:export')")
+    @Log(title = "直播商品", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveGoods liveGoods)
+    {
+        List<LiveGoods> list = liveGoodsService.selectLiveGoodsList(liveGoods);
+        ExcelUtil<LiveGoods> util = new ExcelUtil<LiveGoods>(LiveGoods.class);
+        return util.exportExcel(list, "直播商品数据");
+    }
+
+    /**
+     * 获取直播商品详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveGoods:query')")
+    @GetMapping(value = "/{goodsId}")
+    public AjaxResult getInfo(@PathVariable("goodsId") Long goodsId)
+    {
+        return AjaxResult.success(liveGoodsService.selectLiveGoodsByGoodsId(goodsId));
+    }
+
+    /**
+     * 新增直播商品
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveGoods:add')")
+    @Log(title = "直播商品", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveGoods liveGoods)
+    {
+        return toAjax(liveGoodsService.insertLiveGoods(liveGoods));
+    }
+
+    /**
+     * 修改直播商品
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveGoods:edit')")
+    @Log(title = "直播商品", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveGoods liveGoods)
+    {
+        return toAjax(liveGoodsService.updateLiveGoods(liveGoods));
+    }
+
+    /**
+     * 删除直播商品
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveGoods:remove')")
+    @Log(title = "直播商品", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{goodsIds}")
+    public AjaxResult remove(@PathVariable Long[] goodsIds)
+    {
+        return toAjax(liveGoodsService.deleteLiveGoodsByGoodsIds(goodsIds));
+    }
+
+    /**
+     * 获取直播店铺
+     * */
+    @GetMapping("/liveStore/{liveId}")
+    public R liveGoodsStore(@PathVariable Long liveId)
+    {
+        return R.ok().put("store", liveGoodsService.getStoreByLiveId(liveId));
+    }
+}

+ 166 - 0
fs-live-app/src/main/java/com/fs/app/controller/LiveOrderController.java

@@ -0,0 +1,166 @@
+package com.fs.app.controller;
+
+import cn.hutool.core.util.StrUtil;
+import com.fs.app.annotation.Login;
+import com.fs.app.utils.JwtUtils;
+import com.fs.common.annotation.Log;
+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.StringUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.his.dto.ExpressInfoDTO;
+import com.fs.his.enums.ShipperCodeEnum;
+import com.fs.his.service.IFsExpressService;
+import com.fs.live.domain.LiveOrder;
+import com.fs.live.enums.LiveOrderCancleReason;
+import com.fs.live.service.ILiveOrderService;
+import com.github.pagehelper.PageHelper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+import static com.fs.his.utils.PhoneUtil.decryptPhone;
+import static com.github.pagehelper.page.PageMethod.startPage;
+
+/**
+ * 订单Controller
+ *
+ * @author fs
+ * @date 2025-07-08
+ */
+@RestController
+@RequestMapping("/app/live/liveOrder")
+public class LiveOrderController extends AppBaseController
+{
+    @Autowired
+    private ILiveOrderService liveOrderService;
+
+
+    @Autowired
+    private IFsExpressService expressService;
+    @Autowired
+    private JwtUtils jwtUtils;
+
+    /**
+     * 查询订单列表
+     */
+    @Login
+    @GetMapping("/list")
+    public TableDataInfo list(LiveOrder liveOrder)
+    {
+        PageHelper.startPage(liveOrder.getPageNum(), liveOrder.getPageSize());
+        liveOrder.setUserId(getUserId());
+        List<LiveOrder> list = liveOrderService.selectLiveOrderList(liveOrder);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出订单列表
+     */
+    @Log(title = "订单", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveOrder liveOrder)
+    {
+        List<LiveOrder> list = liveOrderService.selectLiveOrderList(liveOrder);
+        ExcelUtil<LiveOrder> util = new ExcelUtil<LiveOrder>(LiveOrder.class);
+        return util.exportExcel(list, "订单数据");
+    }
+
+    /**
+     * 获取订单详细信息
+     */
+    @Login
+    @GetMapping(value = "/info/{orderId}")
+    public AjaxResult getInfo(@PathVariable("orderId") String orderId)
+    {
+        return AjaxResult.success(liveOrderService.selectLiveOrderByOrderId(orderId));
+    }
+
+    /**
+     * 新增订单
+     */
+    @Login
+    @Log(title = "订单", businessType = BusinessType.INSERT)
+    @PostMapping("/create")
+    public R add(@RequestBody LiveOrder liveOrder)
+    {
+        return R.ok().put("orderId", liveOrderService.insertLiveOrder(liveOrder));
+    }
+
+    /**
+     * 修改订单
+     */
+    @Login
+    @Log(title = "订单", businessType = BusinessType.UPDATE)
+    @PutMapping("/update")
+    public R edit(@RequestBody LiveOrder liveOrder)
+    {
+        return R.ok().put("orderId",liveOrder.getOrderId());
+    }
+
+
+    /**
+     * 查看物流状态
+     * */
+    @Login
+    @GetMapping(value = "/getExpress/{id}")
+    public R getExpress(@PathVariable("id") String id)
+    {
+        LiveOrder order=liveOrderService.selectLiveOrderByOrderId(id);
+        ExpressInfoDTO expressInfoDTO=null;
+        if(StringUtils.isNotEmpty(order.getDeliverySn())){
+            String lastFourNumber = "";
+            if (order.getDeliveryCode().equals(ShipperCodeEnum.SF.getValue())) {
+
+                lastFourNumber = order.getUserPhone();
+                if (lastFourNumber.length() == 11) {
+                    lastFourNumber = StrUtil.sub(lastFourNumber, lastFourNumber.length(), -4);
+                }else if (lastFourNumber.length()>11){
+                    String jm = decryptPhone(lastFourNumber);
+                    lastFourNumber = StrUtil.sub(jm, jm.length(), -4);
+                }
+            }
+            expressInfoDTO=expressService.getExpressInfo(order.getOrderCode(),order.getDeliveryCode(),order.getDeliverySn(),lastFourNumber);
+
+            if((expressInfoDTO.getStateEx()!=null&&expressInfoDTO.getStateEx().equals("0"))&&(expressInfoDTO.getState()!=null&&expressInfoDTO.getState().equals("0"))){
+                lastFourNumber = "19923690275";
+                if (order.getDeliveryCode().equals(ShipperCodeEnum.SF.getValue())) {
+                    if (lastFourNumber.length() == 11) {
+                        lastFourNumber = StrUtil.sub(lastFourNumber, lastFourNumber.length(), -4);
+                    }
+                }
+
+                expressInfoDTO=expressService.getExpressInfo(order.getOrderCode(),order.getDeliveryCode(),order.getDeliverySn(),lastFourNumber);
+
+            }
+        }
+        return R.ok().put("data",expressInfoDTO);
+    }
+
+    /**
+     * 支付订单
+     * */
+    @PostMapping(value = "/pay")
+    public void pay(LiveOrder liveOrder)
+    {
+       liveOrderService.handlePay(liveOrder);
+    }
+
+    /**
+     * 取消订单确认
+     * */
+    @Login
+    @GetMapping(value = "/cancelConfirm/{orderId}")
+    public R cancelConfirm(@PathVariable String orderId)
+    {
+        LiveOrder byId = liveOrderService.getById(orderId);
+        List<Map<String, String>> allCodeDescMap = LiveOrderCancleReason.getAllCodeDescMap();
+        return R.ok().put("reason",allCodeDescMap).put("data",byId);
+    }
+
+
+}

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

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

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

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

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

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

+ 6 - 3
fs-live-app/src/main/java/com/fs/app/task/Task.java

@@ -24,7 +24,7 @@ public class Task {
 
     private final RedisCache redisCache;
 
-    @Scheduled(cron = "0 0/1 * * * ?")
+    //@Scheduled(cron = "0 0/1 * * * ?")
     public void selectSopUserLogsListByTime() {
         LocalDateTime now = LocalDateTime.now();
         List<Live> list = liveService.list(new QueryWrapper<Live>().ne("status", 3));
@@ -47,8 +47,11 @@ public class Task {
     @Scheduled(cron = "0 0/1 * * * ?")
     public void syncLikeData() {
         List<LiveData>  liveDatas = liveDataService.selectLiveDataList(new LiveData());
-        liveDatas.forEach(liveData ->
-                liveData.setLikes(redisCache.getCacheObject("live:like:" + liveData.getLiveId())));
+        liveDatas.forEach(liveData ->{
+            Integer like_num = redisCache.getCacheObject("live:like:" + liveData.getLiveId());
+            if (like_num != null)
+                liveData.setLikes(((Number)like_num).longValue());
+        });
         if(!liveDatas.isEmpty())
             liveDataService.updateBatchById(liveDatas);
     }

+ 4 - 0
fs-service/src/main/java/com/fs/his/param/BaseParam.java

@@ -1,5 +1,6 @@
 package com.fs.his.param;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -8,8 +9,11 @@ import java.io.Serializable;
 @Data
 public class BaseParam implements Serializable {
     @ApiModelProperty(value = "页码,默认为1")
+    @TableField(exist = false)
     private Integer pageNum =1;
     @ApiModelProperty(value = "页大小,默认为10")
+    @TableField(exist = false)
     private Integer pageSize = 10;
+    @TableField(exist = false)
     private String keyword;
 }

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

@@ -105,4 +105,7 @@ public class Live extends BaseEntity {
 
     /** 直播配置 */
     private String configJson;
+
+    /** 直播审核状态,销售端修改后需要总后台审核 0未审核 1已审核*/
+    private String is_audit;
 }

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

@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.fs.common.annotation.Excel;
+import com.fs.his.param.BaseParam;
 import lombok.Data;
 import com.fs.common.core.domain.BaseEntity;
 import lombok.EqualsAndHashCode;
@@ -20,7 +21,7 @@ import lombok.EqualsAndHashCode;
  */
 @Data
 @TableName("live_order")
-public class LiveOrder{
+public class LiveOrder extends BaseParam {
 
     /** 订单ID */
     @TableId(type= IdType.AUTO)
@@ -287,5 +288,15 @@ public class LiveOrder{
     @Excel(name = "是否改价")
     private Integer isEditMoney;
 
+    /** 创建时间*/
+    @Excel(name = "创建时间")
+    private Date createTime;
 
+    /** 更新时间*/
+    @Excel(name = "更新时间")
+    private Date updateTime;
+
+    /** 备注*/
+    @Excel(name = "备注")
+    private String remark;
 }

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

@@ -6,14 +6,14 @@ import com.fs.live.domain.LiveOrder;
 
 /**
  * 订单Mapper接口
- * 
+ *
  * @author fs
  * @date 2025-07-08
  */
 public interface LiveOrderMapper extends BaseMapper<LiveOrder>{
     /**
      * 查询订单
-     * 
+     *
      * @param orderId 订单主键
      * @return 订单
      */
@@ -21,7 +21,7 @@ public interface LiveOrderMapper extends BaseMapper<LiveOrder>{
 
     /**
      * 查询订单列表
-     * 
+     *
      * @param liveOrder 订单
      * @return 订单集合
      */
@@ -29,7 +29,7 @@ public interface LiveOrderMapper extends BaseMapper<LiveOrder>{
 
     /**
      * 新增订单
-     * 
+     *
      * @param liveOrder 订单
      * @return 结果
      */
@@ -37,7 +37,7 @@ public interface LiveOrderMapper extends BaseMapper<LiveOrder>{
 
     /**
      * 修改订单
-     * 
+     *
      * @param liveOrder 订单
      * @return 结果
      */
@@ -45,7 +45,7 @@ public interface LiveOrderMapper extends BaseMapper<LiveOrder>{
 
     /**
      * 删除订单
-     * 
+     *
      * @param orderId 订单主键
      * @return 结果
      */
@@ -53,7 +53,7 @@ public interface LiveOrderMapper extends BaseMapper<LiveOrder>{
 
     /**
      * 批量删除订单
-     * 
+     *
      * @param orderIds 需要删除的数据主键集合
      * @return 结果
      */

+ 5 - 4
fs-service/src/main/java/com/fs/live/mapper/LiveUserFavoriteMapper.java

@@ -3,6 +3,7 @@ package com.fs.live.mapper;
 import java.util.List;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.live.domain.LiveUserFavorite;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 用户直播收藏Mapper接口
@@ -59,11 +60,11 @@ public interface LiveUserFavoriteMapper extends BaseMapper<LiveUserFavorite>{
      */
     int deleteLiveUserFavoriteByFavoriteIds(Long[] favoriteIds);
 
-    LiveUserFavorite selectLiveUserFavoriteByLiveIdAndUserId(Long liveId, Long userId);
+    LiveUserFavorite selectLiveUserFavoriteByLiveIdAndUserId(@Param("liveId")Long liveId, @Param("userId")Long userId);
 
-    void deleteLiveUserFavoriteByLiveIdAndUserId(Long liveId, Long userId);
+    void deleteLiveUserFavoriteByLiveIdAndUserId(@Param("liveId")Long liveId, @Param("userId")Long userId);
 
-    LiveUserFavorite selectByIds(Long productId, Long storeId, Long liveId, Long userId);
+    List<LiveUserFavorite> selectByIds(@Param("productId") Long productId, @Param("storeId")Long storeId, @Param("liveId")Long liveId, @Param("userId")Long userId);
 
-    void deleteLiveUserFavoriteByIds(Long productId, Long storeId, Long liveId, Long userId);
+    void deleteLiveUserFavoriteByIds(@Param("productId") Long productId, @Param("storeId")Long storeId, @Param("liveId")Long liveId, @Param("userId")Long userId);
 }

+ 3 - 2
fs-service/src/main/java/com/fs/live/mapper/LiveUserFollowMapper.java

@@ -3,6 +3,7 @@ package com.fs.live.mapper;
 import java.util.List;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.live.domain.LiveUserFollow;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 用户直播关注Mapper接口
@@ -59,7 +60,7 @@ public interface LiveUserFollowMapper extends BaseMapper<LiveUserFollow>{
      */
     int deleteLiveUserFollowByIds(Long[] ids);
 
-    LiveUserFollow selectLiveUserFollowByLiveIdAndUserId(Long liveId, Long userId);
+    LiveUserFollow selectLiveUserFollowByLiveIdAndUserId(@Param("liveId")Long liveId, @Param("userId")Long userId);
 
-    void deleteLiveUserFollowByLiveIdAndUserId(Long liveId, Long userId);
+    void deleteLiveUserFollowByLiveIdAndUserId(@Param("liveId")Long liveId, @Param("userId")Long userId);
 }

+ 2 - 1
fs-service/src/main/java/com/fs/live/mapper/LiveUserLikeMapper.java

@@ -3,6 +3,7 @@ package com.fs.live.mapper;
 import java.util.List;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.live.domain.LiveUserLike;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 用户直播赞Mapper接口
@@ -59,5 +60,5 @@ public interface LiveUserLikeMapper extends BaseMapper<LiveUserLike>{
      */
     int deleteLiveUserLikeByIds(Long[] ids);
 
-    LiveUserLike selectLiveUserLikeByIds(Long liveId, Long userId);
+    LiveUserLike selectLiveUserLikeByIds(@Param("liveId")Long liveId, @Param("userId") Long userId);
 }

+ 288 - 0
fs-service/src/main/java/com/fs/live/param/LiveOrderSearchParam.java

@@ -0,0 +1,288 @@
+package com.fs.live.param;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import com.fs.his.param.BaseParam;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 订单对象 live_order
+ *
+ * @author fs
+ * @date 2025-07-08
+ */
+@Data
+public class LiveOrderSearchParam extends BaseParam {
+
+    /** 订单ID */
+    private Long orderId;
+
+    /** 直播ID */
+    @Excel(name = "直播ID")
+    private Long liveId;
+
+    /** $column.columnComment */
+    @Excel(name = "店铺ID")
+    private Long storeId;
+
+    /** 订单号 */
+    @Excel(name = "订单号")
+    private String orderCode;
+
+    /** 用户id */
+    @Excel(name = "用户id")
+    private String userId;
+
+    /** 收货人 */
+    @Excel(name = "收货人")
+    private String userName;
+
+    /** 收货人电话 */
+    @Excel(name = "收货人电话")
+    private String userPhone;
+
+    /** 详细地址 */
+    @Excel(name = "详细地址")
+    private String userAddress;
+
+    /** 购物车id */
+    @Excel(name = "购物车id")
+    private String cartId;
+
+    /** 订单商品总数 */
+    @Excel(name = "订单商品总数")
+    private String totalNum;
+
+    /** 订单总价 */
+    @Excel(name = "订单总价")
+    private BigDecimal totalPrice;
+
+    /** 实际支付金额 */
+    @Excel(name = "实际支付金额")
+    private BigDecimal payPrice;
+
+    /** 支付金额 */
+    @Excel(name = "支付金额")
+    private BigDecimal payMoney;
+
+    /** 支付状态 待支付 1已支付 */
+    @Excel(name = "支付状态 待支付 1已支付")
+    private String isPay;
+
+    /** 取消理由*/
+    @Excel(name = "取消理由")
+    private String cancelReason;
+
+    /** 支付时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date payTime;
+
+    /** 支付方式 1微信 */
+    @Excel(name = "支付方式 1微信")
+    private String payType;
+
+    /** 订单状态(-1 : 申请退款 -2 : 退货成功 0:已取消 1:待支付 2:待发货;3:待收货;4:待评价;5:已完成) */
+    @Excel(name = "订单状态", readConverterExp = "-=1,:=,申=请退款,-=2,:=,退=货成功,1=:待支付,2=:待发货;3:待收货;4:待评价;5:已完成")
+    private Integer status;
+
+    /** 0 未退款 1 申请中 2 已退款 */
+    @Excel(name = "0 未退款 1 申请中 2 已退款")
+    private String refundStatus;
+
+    /** 退款图片 */
+    @Excel(name = "退款图片")
+    private String refundImg;
+
+    /** 退款用户说明 */
+    @Excel(name = "退款用户说明")
+    private String refundExplain;
+
+    /** 退款时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "退款时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date refundTime;
+
+    /** 不退款的理由 */
+    @Excel(name = "不退款的理由")
+    private String refundReason;
+
+    /** 退款金额 */
+    @Excel(name = "退款金额")
+    private BigDecimal refundMoney;
+
+    /** 快递公司编号 */
+    @Excel(name = "快递公司编号")
+    private String deliveryCode;
+
+    /** 快递名称 */
+    @Excel(name = "快递名称")
+    private String deliveryName;
+
+    /** 快递单号 */
+    @Excel(name = "快递单号")
+    private String deliverySn;
+
+    /** 是否删除 */
+    @Excel(name = "是否删除")
+    private String isDel;
+
+    /** 成本价 */
+    @Excel(name = "成本价")
+    private BigDecimal costPrice;
+
+    /** 核销码 */
+    @Excel(name = "核销码")
+    private String verifyCode;
+
+    /** 配送方式 1=快递 ,2=门店自提 */
+    @Excel(name = "配送方式 1=快递 ,2=门店自提")
+    private Integer shippingType;
+
+    /** 支付渠道(1微信小程序) */
+    @Excel(name = "支付渠道(1微信小程序)")
+    private String isChannel;
+
+    /** $column.columnComment */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "支付渠道(1微信小程序)", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date finishTime;
+
+    /** 发货时间 */
+    @Excel(name = "发货时间")
+    private String deliveryTime;
+
+    /** 推广佣金 */
+    @Excel(name = "推广佣金")
+    private BigDecimal tuiMoney;
+
+    /** 推广佣金状态 1已发放 0待发放 */
+    @Excel(name = "推广佣金状态 1已发放 0待发放")
+    private Integer tuiMoneyStatus;
+
+    /** 上级推荐人ID */
+    @Excel(name = "上级推荐人ID")
+    private Long tuiUserId;
+
+    /** orderItem字符串 */
+    @Excel(name = "orderItem字符串")
+    private String itemJson;
+
+    /** 优惠金额 */
+    @Excel(name = "优惠金额")
+    private BigDecimal discountMoney;
+
+    /** $column.columnComment */
+    @Excel(name = "优惠金额")
+    private Long userCouponId;
+
+    /** 公司id */
+    @Excel(name = "公司id")
+    private Long companyId;
+
+    /** 公司员工id */
+    @Excel(name = "公司员工id")
+    private Long companyUserId;
+
+    /** 仓库代码 */
+    @Excel(name = "仓库代码")
+    private String storeHouseCode;
+
+    /** 扩展订单ID */
+    @Excel(name = "扩展订单ID")
+    private String extendOrderId;
+
+    /** 支付运费 */
+    @Excel(name = "支付运费")
+    private BigDecimal payDelivery;
+
+    /** 剩余金额 */
+    @Excel(name = "剩余金额")
+    private BigDecimal payRemain;
+
+    /** 物流状态 */
+    @Excel(name = "物流状态")
+    private Integer deliveryStatus;
+
+    /** 物流结算状态 */
+    @Excel(name = "物流结算状态")
+    private Integer deliveryPayStatus;
+
+    /** $column.columnComment */
+    @Excel(name = "物流结算状态")
+    private String deliveryPayTime;
+
+    /** 物流跟踪状态 */
+    @Excel(name = "物流跟踪状态")
+    private String deliveryType;
+
+    /** 物流结算金额 */
+    @Excel(name = "物流结算金额")
+    private BigDecimal deliveryPayMoney;
+
+    /** 回单导入时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "回单导入时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date deliveryImportTime;
+
+    /** 发货时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "发货时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date deliverySendTime;
+
+    /** 是否可售后 */
+    @Excel(name = "是否可售后")
+    private Integer isAfterSales;
+
+    /** 部门id */
+    @Excel(name = "部门id")
+    private Long deptId;
+
+    /** 渠道 */
+    @Excel(name = "渠道")
+    private String channel;
+
+    /** 订单来源 */
+    @Excel(name = "订单来源")
+    private Long source;
+
+    /** 开票金额 */
+    @Excel(name = "开票金额")
+    private BigDecimal billPrice;
+
+    /** 邮费 */
+    @Excel(name = "邮费")
+    private BigDecimal totalPostage;
+
+    /** 支付邮费 */
+    @Excel(name = "支付邮费")
+    private BigDecimal payPostage;
+
+    /** 消费赚取积分 */
+    @Excel(name = "消费赚取积分")
+    private BigDecimal gainIntegral;
+
+    /** 使用积分 */
+    @Excel(name = "使用积分")
+    private BigDecimal useIntegral;
+
+    /** 实际支付积分 */
+    @Excel(name = "实际支付积分")
+    private BigDecimal payIntegral;
+
+    /** 给用户退了多少积分 */
+    @Excel(name = "给用户退了多少积分")
+    private BigDecimal backIntegral;
+
+    /** 是否改价 */
+    @Excel(name = "是否改价")
+    private Integer isEditMoney;
+
+
+}

+ 1 - 1
fs-service/src/main/java/com/fs/live/service/ILiveUserFavoriteService.java

@@ -63,7 +63,7 @@ public interface ILiveUserFavoriteService extends IService<LiveUserFavorite>{
 
     void deleteLiveUserFavoriteByLiveIdAndUserId(Long liveId, Long userId);
 
-    LiveUserFavorite selectByIds(Long productId, Long storeId, Long liveId, Long userId);
+    List<LiveUserFavorite> selectByIds(Long productId, Long storeId, Long liveId, Long userId);
 
     void deleteLiveUserFavoriteByIds(Long productId, Long storeId, Long liveId, Long userId);
 }

+ 19 - 12
fs-service/src/main/java/com/fs/live/service/impl/LiveDataServiceImpl.java

@@ -19,6 +19,7 @@ import com.fs.live.vo.RecentLiveDataVo;
 import com.fs.live.vo.TrendDataVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
 import java.math.RoundingMode;
@@ -90,7 +91,6 @@ public class LiveDataServiceImpl extends ServiceImpl<LiveDataMapper, LiveData> i
     @Override
     public int insertLiveData(LiveData liveData)
     {
-        liveData.setCreateTime(DateUtils.getNowDate());
         return baseMapper.insertLiveData(liveData);
     }
 
@@ -349,11 +349,15 @@ public class LiveDataServiceImpl extends ServiceImpl<LiveDataMapper, LiveData> i
     }
 
     @Override
+    @Transactional
     public String updateLikeByLiveId(Long liveId, Long userId) {
         //一个用户一天只能点赞十次
-        String key = "live:like" + liveId + ":user:" + userId+":date:"+ DateUtils.getDate();
+        String key = "live:like:" + liveId + ":user:" + userId+":date:"+ DateUtils.getDate();
         LiveUserLike liveUserLike;
-        if(!redisCache.redisTemplate.hasKey(key)) {
+        //用户直播间第一次点赞
+        if(redisCache.setIfAbsent( key,1, 1, TimeUnit.DAYS)) {
+            //直播间总点赞数
+            redisCache.increment("live:like:" + liveId,1);
             liveUserLike = liveUserLikeService.selectLiveUserLikeByIds(liveId, userId);
             if (liveUserLike == null) {
                 liveUserLike = new LiveUserLike();
@@ -361,10 +365,11 @@ public class LiveDataServiceImpl extends ServiceImpl<LiveDataMapper, LiveData> i
                 liveUserLike.setLiveId(liveId);
                 liveUserLike.setCreateTime(new Date());
                 liveUserLikeService.insertLiveUserLike(liveUserLike);
+                return "点赞成功";
             }
         }
-        int count =redisCache.getCacheObject(key);
-        if(count>=10) {
+        Integer count =redisCache.getCacheObject(key);
+        if((count==null?0: count)>=10) {
             //当前时间
             LocalDateTime now = LocalDateTime.now();
             //明天0点
@@ -425,29 +430,31 @@ public class LiveDataServiceImpl extends ServiceImpl<LiveDataMapper, LiveData> i
         //判断是收藏店铺还是收藏产品
         if (productId != null) {
             //查询用户是否收藏过该产品
-            LiveUserFavorite liveUserFavorite = liveUserFavoriteService.selectByIds(productId,storeId,liveId,userId);
-            if (liveUserFavorite != null) {
+            List<LiveUserFavorite> liveUserFavorites = liveUserFavoriteService.selectByIds(productId, storeId, liveId, userId);
+            if (liveUserFavorites != null) {
                 liveUserFavoriteService.deleteLiveUserFavoriteByIds(productId,storeId,liveId,userId);
                 return "取消收藏成功";
             }
-            liveUserFavorite = new LiveUserFavorite();
+            LiveUserFavorite liveUserFavorite = new LiveUserFavorite();
             liveUserFavorite.setProductId(productId);
             liveUserFavorite.setStoreId(storeId);
             liveUserFavorite.setLiveId(liveId);
             liveUserFavorite.setCreateTime(new Date());
+            liveUserFavorite.setUserId(userId);
             liveUserFavoriteService.insertLiveUserFavorite(liveUserFavorite);
             return "收藏成功";
         }
         //查询用户是否收藏过该店铺
-        LiveUserFavorite liveUserFavorite = liveUserFavoriteService.selectByIds(null,storeId,liveId,userId);
-        if (liveUserFavorite != null) {
+        List<LiveUserFavorite> liveUserFavorites = liveUserFavoriteService.selectByIds(null, storeId, liveId, userId);
+        if (liveUserFavorites != null) {
             liveUserFavoriteService.deleteLiveUserFavoriteByIds(null,storeId,liveId,userId);
             return "取消收藏成功";
         }
-        liveUserFavorite = new LiveUserFavorite();
+        LiveUserFavorite liveUserFavorite = new LiveUserFavorite();
         liveUserFavorite.setStoreId(storeId);
         liveUserFavorite.setLiveId(liveId);
         liveUserFavorite.setCreateTime(new Date());
+        liveUserFavorite.setUserId(userId);
         liveUserFavoriteService.insertLiveUserFavorite(liveUserFavorite);
         return "收藏成功";
     }
@@ -460,7 +467,7 @@ public class LiveDataServiceImpl extends ServiceImpl<LiveDataMapper, LiveData> i
         //关注数
         liveViewData.put("follow", baseMapper.selectLiveDataByLiveId(liveId).getFollow_num());
         //点赞数
-        liveViewData.put("like", redisCache.getCacheObject("live:like"+liveId));
+        liveViewData.put("like", redisCache.getCacheObject("live:like:"+liveId));
         return liveViewData;
     }
 

+ 3 - 2
fs-service/src/main/java/com/fs/live/service/impl/LiveOrderServiceImpl.java

@@ -2,6 +2,7 @@ package com.fs.live.service.impl;
 
 import java.util.List;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.common.utils.DateUtils;
 import org.springframework.stereotype.Service;
 import com.fs.live.mapper.LiveOrderMapper;
 import com.fs.live.domain.LiveOrder;
@@ -51,7 +52,7 @@ public class LiveOrderServiceImpl extends ServiceImpl<LiveOrderMapper, LiveOrder
     @Transactional
     public Long insertLiveOrder(LiveOrder liveOrder)
     {
-        //liveOrder.setCreateTime(DateUtils.getNowDate());
+        liveOrder.setCreateTime(DateUtils.getNowDate());
         baseMapper.insertLiveOrder(liveOrder);
         return liveOrder.getOrderId();
     }
@@ -66,7 +67,7 @@ public class LiveOrderServiceImpl extends ServiceImpl<LiveOrderMapper, LiveOrder
     @Transactional
     public int updateLiveOrder(LiveOrder liveOrder)
     {
-        //liveOrder.setUpdateTime(DateUtils.getNowDate());
+        liveOrder.setUpdateTime(DateUtils.getNowDate());
         return baseMapper.updateLiveOrder(liveOrder);
     }
 

+ 1 - 1
fs-service/src/main/java/com/fs/live/service/impl/LiveUserFavoriteServiceImpl.java

@@ -102,7 +102,7 @@ public class LiveUserFavoriteServiceImpl extends ServiceImpl<LiveUserFavoriteMap
     }
 
     @Override
-    public LiveUserFavorite selectByIds(Long productId, Long storeId, Long liveId, Long userId) {
+    public List<LiveUserFavorite> selectByIds(Long productId, Long storeId, Long liveId, Long userId) {
         return baseMapper.selectByIds(productId,storeId,liveId,userId);
     }
 

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

@@ -15,7 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectLiveDataVo">
-        select live_id, page_views, unique_visitors, total_views, unique_viewers, peak_concurrent_viewers from
+        SELECT favourite_num,follow_num,likes,live_id,page_views,peak_concurrent_viewers,unique_viewers,unique_visitors,total_views FROM live_data
     </sql>
 
     <select id="selectLiveDataList" parameterType="LiveData" resultMap="LiveDataResult">
@@ -26,6 +26,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="totalViews != null "> and total_views = #{totalViews}</if>
             <if test="uniqueViewers != null "> and unique_viewers = #{uniqueViewers}</if>
             <if test="peakConcurrentViewers != null "> and peak_concurrent_viewers = #{peakConcurrentViewers}</if>
+            <if test="favourite_num != null "> and favourite_num = #{favourite_num}</if>
+            <if test="follow_num != null "> and follow_num = #{follow_num}</if>
+            <if test="likes != null "> and likes = #{likes}</if>
+            <if test="liveId != null "> and live_id = #{live_id}</if>
         </where>
     </select>
 

+ 4 - 0
fs-service/src/main/resources/mapper/live/LiveUserFavoriteMapper.xml

@@ -34,12 +34,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="userId != null">user_id,</if>
             <if test="liveId != null">live_id,</if>
+            <if test="storeId != null">store_id,</if>
+            <if test="productId != null">product_id,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateTime != null">update_time,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="userId != null">#{userId},</if>
             <if test="liveId != null">#{liveId},</if>
+            <if test="storeId != null">#{storeId},</if>
+            <if test="productId != null">#{productId},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
          </trim>

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

@@ -66,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </delete>
-    <select id="selectLiveUserLikeByIds" parameterType="Long" resultType="LiveUserLike">
+    <select id="selectLiveUserLikeByIds" resultType="LiveUserLike">
         <include refid="selectLiveUserLikeVo"/>
         where live_id = #{liveId} and user_id = #{userId}
     </select>