Browse Source

直播代码

yuhongqi 3 weeks ago
parent
commit
988aab4a29
42 changed files with 1576 additions and 122 deletions
  1. 7 5
      fs-admin/src/main/java/com/fs/live/controller/LiveCartController.java
  2. 2 2
      fs-company/src/main/java/com/fs/company/controller/live/LiveCartController.java
  3. 75 0
      fs-live-app/src/main/java/com/fs/app/controller/AppBaseController.java
  4. 47 0
      fs-live-app/src/main/java/com/fs/app/controller/FsStoreController.java
  5. 22 0
      fs-live-app/src/main/java/com/fs/app/controller/HuifuPayController.java
  6. 136 0
      fs-live-app/src/main/java/com/fs/app/controller/LiveCartController.java
  7. 1 1
      fs-live-app/src/main/java/com/fs/app/controller/LiveDataController.java
  8. 28 1
      fs-live-app/src/main/java/com/fs/app/controller/LiveOrderController.java
  9. 97 0
      fs-live-app/src/main/java/com/fs/app/controller/LiveOrderLogsController.java
  10. 27 1
      fs-live-app/src/main/java/com/fs/app/controller/TzPayController.java
  11. 27 2
      fs-live-app/src/main/java/com/fs/app/controller/WxPayController.java
  12. 25 0
      fs-live-app/src/main/java/com/fs/app/controller/YbPayController.java
  13. 1 1
      fs-live-app/src/main/java/com/fs/app/task/Task.java
  14. 2 0
      fs-live-app/src/main/java/com/fs/app/vo/LiveVo.java
  15. 10 0
      fs-service/src/main/java/com/fs/his/param/LiveOrderCancelParam.java
  16. 2 0
      fs-service/src/main/java/com/fs/his/service/IFsStoreProductService.java
  17. 6 0
      fs-service/src/main/java/com/fs/his/service/impl/FsStoreProductServiceImpl.java
  18. 114 0
      fs-service/src/main/java/com/fs/his/vo/FsStoreWithProduct.java
  19. 8 2
      fs-service/src/main/java/com/fs/live/domain/LiveCart.java
  20. 26 13
      fs-service/src/main/java/com/fs/live/mapper/LiveCartMapper.java
  21. 9 0
      fs-service/src/main/java/com/fs/live/mapper/LiveOrderItemMapper.java
  22. 15 0
      fs-service/src/main/java/com/fs/live/mapper/LiveOrderMapper.java
  23. 18 10
      fs-service/src/main/java/com/fs/live/service/ILiveCartService.java
  24. 2 1
      fs-service/src/main/java/com/fs/live/service/ILiveDataService.java
  25. 11 7
      fs-service/src/main/java/com/fs/live/service/ILiveOrderItemService.java
  26. 9 7
      fs-service/src/main/java/com/fs/live/service/ILiveOrderLogsService.java
  27. 7 0
      fs-service/src/main/java/com/fs/live/service/ILiveOrderService.java
  28. 73 13
      fs-service/src/main/java/com/fs/live/service/impl/LiveCartServiceImpl.java
  29. 5 4
      fs-service/src/main/java/com/fs/live/service/impl/LiveDataServiceImpl.java
  30. 9 9
      fs-service/src/main/java/com/fs/live/service/impl/LiveGiftServiceImpl.java
  31. 15 7
      fs-service/src/main/java/com/fs/live/service/impl/LiveOrderItemServiceImpl.java
  32. 18 7
      fs-service/src/main/java/com/fs/live/service/impl/LiveOrderLogsServiceImpl.java
  33. 140 6
      fs-service/src/main/java/com/fs/live/service/impl/LiveOrderServiceImpl.java
  34. 2 7
      fs-service/src/main/java/com/fs/live/service/impl/LiveServiceImpl.java
  35. 103 0
      fs-service/src/main/java/com/fs/live/vo/LiveCartVo.java
  36. 1 1
      fs-service/src/main/java/com/fs/live/vo/LiveGoodsVo.java
  37. 79 0
      fs-service/src/main/java/com/fs/live/vo/LiveOrderItemVo.java
  38. 321 0
      fs-service/src/main/java/com/fs/live/vo/LiveOrderListVo.java
  39. 1 0
      fs-service/src/main/resources/mapper/his/FsStoreProductMapper.xml
  40. 44 12
      fs-service/src/main/resources/mapper/live/LiveCartMapper.xml
  41. 3 3
      fs-service/src/main/resources/mapper/live/LiveGoodsMapper.xml
  42. 28 0
      fs-service/src/main/resources/mapper/live/LiveOrderItemMapper.xml

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

@@ -1,6 +1,8 @@
 package com.fs.live.controller;
 
 import java.util.List;
+
+import com.fs.live.vo.LiveCartVo;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -22,7 +24,7 @@ import com.fs.common.core.page.TableDataInfo;
 
 /**
  * 购物车Controller
- * 
+ *
  * @author fs
  * @date 2025-07-08
  */
@@ -41,7 +43,7 @@ public class LiveCartController extends BaseController
     public TableDataInfo list(LiveCart liveCart)
     {
         startPage();
-        List<LiveCart> list = liveCartService.selectLiveCartList(liveCart);
+        List<LiveCartVo> list = liveCartService.selectLiveCartListVo(liveCart);
         return getDataTable(list);
     }
 
@@ -65,7 +67,7 @@ public class LiveCartController extends BaseController
     @GetMapping(value = "/{cardId}")
     public AjaxResult getInfo(@PathVariable("cardId") Long cardId)
     {
-        return AjaxResult.success(liveCartService.selectLiveCartByCardId(cardId));
+        return AjaxResult.success(liveCartService.selectLiveCartByCartId(cardId));
     }
 
     /**
@@ -84,7 +86,7 @@ public class LiveCartController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('live:liveCart:edit')")
     @Log(title = "购物车", businessType = BusinessType.UPDATE)
-    @PutMapping
+    @PostMapping("/update")
     public AjaxResult edit(@RequestBody LiveCart liveCart)
     {
         return toAjax(liveCartService.updateLiveCart(liveCart));
@@ -98,6 +100,6 @@ public class LiveCartController extends BaseController
 	@DeleteMapping("/{cardIds}")
     public AjaxResult remove(@PathVariable Long[] cardIds)
     {
-        return toAjax(liveCartService.deleteLiveCartByCardIds(cardIds));
+        return toAjax(liveCartService.deleteLiveCartByCartIds(cardIds));
     }
 }

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

@@ -59,7 +59,7 @@ public class LiveCartController extends BaseController
     @GetMapping(value = "/{cardId}")
     public AjaxResult getInfo(@PathVariable("cardId") Long cardId)
     {
-        return AjaxResult.success(liveCartService.selectLiveCartByCardId(cardId));
+        return AjaxResult.success(liveCartService.selectLiveCartByCartId(cardId));
     }
 
     /**
@@ -92,6 +92,6 @@ public class LiveCartController extends BaseController
 	@DeleteMapping("/{cardIds}")
     public AjaxResult remove(@PathVariable Long[] cardIds)
     {
-        return toAjax(liveCartService.deleteLiveCartByCardIds(cardIds));
+        return toAjax(liveCartService.deleteLiveCartByCartIds(cardIds));
     }
 }

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

@@ -3,10 +3,15 @@ package com.fs.app.controller;
 
 import com.fs.app.utils.JwtUtils;
 import com.fs.common.constant.HttpStatus;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.PageDomain;
 import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.core.page.TableSupport;
 import com.fs.common.core.redis.RedisCache;
 import com.fs.common.utils.ServletUtils;
 import com.fs.common.utils.StringUtils;
+import com.fs.common.utils.sql.SqlUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import io.jsonwebtoken.Claims;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -41,4 +46,74 @@ public class AppBaseController {
 		rspData.setTotal(new PageInfo(list).getTotal());
 		return rspData;
 	}
+
+	/**
+	 * 设置请求分页数据
+	 */
+	protected void startPage()
+	{
+		PageDomain pageDomain = TableSupport.buildPageRequest();
+		Integer pageNum = pageDomain.getPageNum();
+		Integer pageSize = pageDomain.getPageSize();
+		if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize))
+		{
+			String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
+			Boolean reasonable = pageDomain.getReasonable();
+			PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable);
+		}
+	}
+
+	/**
+	 * 响应返回结果
+	 *
+	 * @param rows 影响行数
+	 * @return 操作结果
+	 */
+	protected AjaxResult toAjax(int rows)
+	{
+		return rows > 0 ? AjaxResult.success() : AjaxResult.error();
+	}
+
+	/**
+	 * 响应返回结果
+	 *
+	 * @param result 结果
+	 * @return 操作结果
+	 */
+	protected AjaxResult toAjax(boolean result)
+	{
+		return result ? success() : error();
+	}
+
+	/**
+	 * 返回成功
+	 */
+	public AjaxResult success()
+	{
+		return AjaxResult.success();
+	}
+
+	/**
+	 * 返回失败消息
+	 */
+	public AjaxResult error()
+	{
+		return AjaxResult.error();
+	}
+
+	/**
+	 * 返回成功消息
+	 */
+	public AjaxResult success(String message)
+	{
+		return AjaxResult.success(message);
+	}
+
+	/**
+	 * 返回失败消息
+	 */
+	public AjaxResult error(String message)
+	{
+		return AjaxResult.error(message);
+	}
 }

+ 47 - 0
fs-live-app/src/main/java/com/fs/app/controller/FsStoreController.java

@@ -0,0 +1,47 @@
+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.ParseUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.his.domain.FsStore;
+import com.fs.his.param.FsStoreAuditParam;
+import com.fs.his.service.IFsStoreService;
+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 2023-06-15
+ */
+@RestController
+@RequestMapping("/app/live/store")
+public class FsStoreController extends BaseController
+{
+    @Autowired
+    private IFsStoreService fsStoreService;
+
+
+    /**
+     * 获取店铺管理详细信息
+     */
+//    @PreAuthorize("@ss.hasPermi('his:store:query')")
+    @GetMapping(value = "/{storeId}")
+    public AjaxResult getInfo(@PathVariable("storeId") Long storeId)
+    {
+        FsStore fsStore = fsStoreService.selectFsStoreByStoreId(storeId);
+        fsStore.setPhone(ParseUtils.parsePhone(fsStore.getPhone()));
+        return AjaxResult.success(fsStore);
+    }
+
+
+
+}

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

@@ -21,6 +21,16 @@ import org.springframework.web.bind.annotation.RestController;
 public class HuifuPayController {
     @Autowired
     private ILiveOrderService liveOrderService;
+    @Autowired
+    private IFsInquiryOrderService inquiryOrderService;
+    @Autowired
+    private IFsStoreOrderService storeOrderService;
+    @Autowired
+    private IFsPackageOrderService packageOrderService;
+    @Autowired
+    private IFsUserCourseOrderService courseOrderService;
+    @Autowired
+    private IFsUserVipOrderService vipOrderService;
 
     org.slf4j.Logger logger= LoggerFactory.getLogger(getClass());
     @RequestMapping("/payNotifyUrl")
@@ -30,6 +40,18 @@ public class HuifuPayController {
         if(huiFuResult.getResp_code().equals("00000000") && huiFuResult.getNotify_type().equals("1")){
             String[] orderId=huiFuResult.getReq_seq_id().split("-");
             switch (orderId[0]){
+                case "inquiry":
+                    inquiryOrderService.payConfirm("",orderId[1],huiFuResult.getHf_seq_id(),"",1);
+                    break;
+                case "store":
+                    storeOrderService.payConfirm("",orderId[1],huiFuResult.getHf_seq_id(),"",1);
+                    break;
+                case "package":
+                    packageOrderService.payConfirm("",orderId[1],huiFuResult.getHf_seq_id(),"",1);
+                    break;
+                case "course":
+                    courseOrderService.payConfirm("",orderId[1],huiFuResult.getHf_seq_id(),"",1);
+                    break;
                 case "appLive":
                     liveOrderService.payConfirm("",orderId[1],huiFuResult.getHf_seq_id(),"",1);
                     break;

+ 136 - 0
fs-live-app/src/main/java/com/fs/app/controller/LiveCartController.java

@@ -0,0 +1,136 @@
+package com.fs.app.controller;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fs.app.annotation.Login;
+import com.fs.common.annotation.Excel;
+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.LiveCart;
+import com.fs.live.service.ILiveCartService;
+import com.fs.live.vo.LiveCartVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 购物车Controller
+ *
+ * @author fs
+ * @date 2025-07-08
+ */
+@RestController
+@RequestMapping("/live/liveCart")
+@Api(tags = "购物车管理")
+public class LiveCartController extends AppBaseController
+{
+    @Autowired
+    private ILiveCartService liveCartService;
+
+    /**
+     * 查询购物车列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveCart:list')")
+    @GetMapping("/list")
+    @ApiOperation("查询购物车列表")
+    @Login
+    public TableDataInfo list(LiveCart liveCart)
+    {
+        liveCart.setUserId(String.valueOf(getUserId()));
+        startPage();
+        List<LiveCartVo> list = liveCartService.selectLiveCartListVo(liveCart);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出购物车列表
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveCart:export')")
+    @Log(title = "购物车", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    @ApiOperation("导出购物车列表")
+    @Login
+    public AjaxResult export(LiveCart liveCart)
+    {
+        List<LiveCart> list = liveCartService.selectLiveCartList(liveCart);
+        ExcelUtil<LiveCart> util = new ExcelUtil<LiveCart>(LiveCart.class);
+        return util.exportExcel(list, "购物车数据");
+    }
+
+    /**
+     * 获取购物车详细信息
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveCart:query')")
+    @GetMapping(value = "/{cardId}")
+    @ApiOperation("获取购物车详细信息")
+    @ApiImplicitParam(name = "cardId", value = "购物车ID", required = true, dataType = "Long", paramType = "path")
+    @Login
+    public AjaxResult getInfo(@PathVariable("cardId") Long cardId)
+    {
+        return AjaxResult.success(liveCartService.selectLiveCartByCartId(cardId));
+    }
+
+    /**
+     * 新增购物车
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveCart:add')")
+    @PostMapping
+    @ApiOperation("新增购物车")
+    @Login
+    public AjaxResult add(@RequestBody @ApiParam("购物车信息") LiveCart liveCart)
+    {
+        liveCart.setUserId(String.valueOf(getUserId()));
+        return toAjax(liveCartService.insertLiveCart(liveCart));
+    }
+
+    /**
+     * 修改购物车
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveCart:edit')")
+    @PostMapping("/update")
+    @ApiOperation("修改购物车")
+    @Login
+    public AjaxResult edit(@RequestBody @ApiParam("购物车信息") LiveCart liveCart)
+    {
+        liveCart.setUserId(String.valueOf(getUserId()));
+        return toAjax(liveCartService.updateLiveCart(liveCart));
+    }
+
+    /**
+     * 删除购物车
+     */
+//    @PreAuthorize("@ss.hasPermi('live:liveCart:remove')")
+	@PostMapping("/delete")
+    @ApiOperation("删除购物车")
+    @ApiImplicitParam(name = "cardIds", value = "购物车ID数组", required = true, dataType = "Long", paramType = "path")
+    @Login
+    public AjaxResult remove(@RequestBody Long[] cardIds)
+    {
+        return toAjax(liveCartService.deleteByCartIds(cardIds, Long.valueOf(getUserId())));
+    }
+
+    @GetMapping("/checked")
+    @ApiOperation("查询购物车列表")
+    @Login
+    public TableDataInfo getChecked(LiveCart liveCart)
+    {
+        liveCart.setUserId(String.valueOf(getUserId()));
+        startPage();
+        List<LiveCartVo> list = liveCartService.getChecked(liveCart);
+        return getDataTable(list);
+    }
+
+
+
+}

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

@@ -46,7 +46,7 @@ public class LiveDataController extends AppBaseController{
     @Login
     @GetMapping("/like/{liveId}")
     public R like(@PathVariable("liveId") Long liveId) {
-        return R.ok(liveDataService.updateLikeByLiveId(liveId, Long.parseLong(getUserId())));
+        return liveDataService.updateLikeByLiveId(liveId,  Long.parseLong(getUserId()));
     }
 
     /**

+ 28 - 1
fs-live-app/src/main/java/com/fs/app/controller/LiveOrderController.java

@@ -1,5 +1,6 @@
 package com.fs.app.controller;
 
+import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import com.fs.app.annotation.Login;
 import com.fs.app.utils.JwtUtils;
@@ -8,16 +9,21 @@ 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.exception.CustomException;
 import com.fs.common.utils.StringUtils;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.course.param.FsUserLiveOrderPayUParam;
+import com.fs.his.domain.FsStoreOrder;
 import com.fs.his.dto.ExpressInfoDTO;
 import com.fs.his.enums.ShipperCodeEnum;
+import com.fs.his.param.FsStoreOrderCancelParam;
+import com.fs.his.param.LiveOrderCancelParam;
 import com.fs.his.service.IFsExpressService;
 import com.fs.live.domain.LiveOrder;
 import com.fs.live.enums.LiveOrderCancleReason;
 import com.fs.live.param.LiveOrderConfirmParam;
 import com.fs.live.service.ILiveOrderService;
+import com.fs.live.vo.LiveOrderListVo;
 import com.github.pagehelper.PageHelper;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -59,7 +65,7 @@ public class LiveOrderController extends AppBaseController
     {
         PageHelper.startPage(liveOrder.getPageNum(), liveOrder.getPageSize());
         liveOrder.setUserId(getUserId());
-        List<LiveOrder> list = liveOrderService.selectLiveOrderList(liveOrder);
+        List<LiveOrderListVo> list = liveOrderService.selectLiveOrderListVo(liveOrder);
         return getDataTable(list);
     }
 
@@ -92,6 +98,15 @@ public class LiveOrderController extends AppBaseController
         return liveOrderService.confirmOrder(param);
     }
 
+    @PostMapping("/buy")
+    @ApiOperation("购物车购买")
+    @Login
+    public R buy(@RequestBody LiveOrder liveOrder)
+    {
+        liveOrder.setUserId(getUserId());
+        return liveOrderService.buy(liveOrder);
+    }
+
     /**
      * 新增订单
      */
@@ -204,6 +219,18 @@ public class LiveOrderController extends AppBaseController
         return liveOrderService.liveOrderUser(liveId);
     }
 
+    @Login
+    @ApiOperation("取消订单")
+    @PostMapping("/cancelOrder")
+    public R cancelOrder(@Validated @RequestBody LiveOrderCancelParam param, HttpServletRequest request){
+        LiveOrder order=liveOrderService.selectLiveOrderByOrderId(String.valueOf(param.getOrderId()));
+        if (ObjectUtil.isNull(order)) {
+            throw new CustomException("订单不存在");
+        }
+        return liveOrderService.cancelOrder(order);
+
+    }
+
 
 
 }

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

+ 27 - 1
fs-live-app/src/main/java/com/fs/app/controller/TzPayController.java

@@ -28,6 +28,17 @@ public class TzPayController extends BaseController
 {
     @Autowired
     private ILiveOrderService liveOrderService;
+    @Autowired
+    private IFsInquiryOrderService inquiryOrderService;
+    @Autowired
+    private IFsStoreOrderService storeOrderService;
+    @Autowired
+    private IFsPackageOrderService packageOrderService;
+    @Autowired
+    private IFsUserCourseOrderService courseOrderService;
+
+    @Autowired
+    private IFsUserVipOrderService userVipOrderService;
     @RequestMapping(value = "/payNotify",method = RequestMethod.POST)
     public String payNotify(@RequestBody String  decryptForm) throws Exception {
         SysConfigMapper sysConfigMapper= SpringUtils.getBean(SysConfigMapper.class);
@@ -39,7 +50,22 @@ public class TzPayController extends BaseController
         TzBankOrderDecrypt tzBankOrderDecrypt = gson.fromJson(filteredString, TzBankOrderDecrypt.class);
         logger.info("台州银行支付回调:"+tzBankOrderDecrypt.getOrderFlowNo()+":"+tzBankOrderDecrypt);
         if(tzBankOrderDecrypt.getStatus().equals("90")){
-            if(tzBankOrderDecrypt.getOrderNo().indexOf("appLive")>-1){
+            if(tzBankOrderDecrypt.getOrderNo().indexOf("inquiry")>-1){
+                inquiryOrderService.payConfirm("",tzBankOrderDecrypt.getOrderNo().substring(7),tzBankOrderDecrypt.getOrderFlowNo(),tzBankOrderDecrypt.getPayType(),1);
+            }
+            else if(tzBankOrderDecrypt.getOrderNo().indexOf("store")>-1){
+                storeOrderService.payConfirm("",tzBankOrderDecrypt.getOrderNo().substring(5),tzBankOrderDecrypt.getOrderFlowNo(),tzBankOrderDecrypt.getPayType(),1);
+            }
+            else if(tzBankOrderDecrypt.getOrderNo().indexOf("package")>-1){
+                packageOrderService.payConfirm("",tzBankOrderDecrypt.getOrderNo().substring(7),tzBankOrderDecrypt.getOrderFlowNo(),tzBankOrderDecrypt.getPayType(),1);
+            }
+            else if(tzBankOrderDecrypt.getOrderNo().indexOf("course")>-1){
+                courseOrderService.payConfirm("",tzBankOrderDecrypt.getOrderNo().substring(6),tzBankOrderDecrypt.getOrderFlowNo(),tzBankOrderDecrypt.getPayType(),1);
+            }
+            else if(tzBankOrderDecrypt.getOrderNo().indexOf("appvip")>-1){
+                userVipOrderService.payConfirm("",tzBankOrderDecrypt.getOrderNo().substring(6),tzBankOrderDecrypt.getOrderFlowNo(),tzBankOrderDecrypt.getPayType(),1);
+            }
+            else if(tzBankOrderDecrypt.getOrderNo().indexOf("appLive")>-1){
                 liveOrderService.payConfirm("",tzBankOrderDecrypt.getOrderNo().substring(6),tzBankOrderDecrypt.getOrderFlowNo(),tzBankOrderDecrypt.getPayType(),1);
             }
         }

+ 27 - 2
fs-live-app/src/main/java/com/fs/app/controller/WxPayController.java

@@ -36,7 +36,23 @@ public class WxPayController {
     @Autowired
     private WxPayService wxPayService;
     @Autowired
+    private IFsInquiryOrderService inquiryOrderService;
+    @Autowired
+    private IFsStoreOrderService storeOrderService;
+    @Autowired
+    private IFsPackageOrderService packageOrderService;
+
+    @Autowired
+    private IFsUserCourseOrderService courseOrderService;
+
+    @Autowired
+    private IFsUserVipOrderService userVipOrderService;
+    @Autowired
     private IFsStorePaymentService  paymentService;
+    @Autowired
+    private IFsCourseRedPacketLogService redPacketLogService;
+    @Autowired
+    private ISysConfigService configService;
 
     @Autowired
     private ISopUserLogsInfoService iSopUserLogsInfoService;
@@ -68,6 +84,16 @@ public class WxPayController {
                 System.out.println(tradeNo);
                 String[] orderId=outtradeno.split("-");
                 switch (orderId[0]){
+                    case "inquiry":
+                        inquiryOrderService.payConfirm("",orderId[1],tradeNo,"",1);
+                    case "store":
+                        storeOrderService.payConfirm("",orderId[1],tradeNo,"",1);
+                    case "package":
+                        packageOrderService.payConfirm("",orderId[1],tradeNo,"",1);
+                    case "course":
+                        courseOrderService.payConfirm("",orderId[1],tradeNo,"",1);
+                    case "appvip":
+                        userVipOrderService.payConfirm("",orderId[1],tradeNo,"",1);
                     case "appLive":
                         liveOrderService.payConfirm("",orderId[1],tradeNo,"",1);
                 }
@@ -84,7 +110,7 @@ public class WxPayController {
 
     @PostMapping("/sendRedPacket")
     public R sendRedPacket(@RequestBody WxSendRedPacketParam param){
-       return paymentService.sendRedPacketTest(param);
+        return paymentService.sendRedPacketTest(param);
     }
 
     @PostMapping( "/TransferNotify")
@@ -106,5 +132,4 @@ public class WxPayController {
     }
 
 
-
 }

+ 25 - 0
fs-live-app/src/main/java/com/fs/app/controller/YbPayController.java

@@ -33,6 +33,16 @@ import java.util.Map;
 @RequestMapping("/app/pay")
 public class YbPayController extends BaseController
 {
+    @Autowired
+    private IFsInquiryOrderService inquiryOrderService;
+    @Autowired
+    private IFsStoreOrderService storeOrderService;
+    @Autowired
+    private IFsPackageOrderService packageOrderService;
+    @Autowired
+    private IFsUserCourseOrderService courseOrderService;
+    @Autowired
+    private IFsUserVipOrderService userVipOrderService;
     @Autowired
     private ILiveOrderService liveOrderService;
     @PostMapping("/payNotify")
@@ -49,6 +59,21 @@ public class YbPayController extends BaseController
         }
         String[] orderId=o.getLowOrderId().split("-");
         switch (orderId[0]){
+            case "inquiry":
+                inquiryOrderService.payConfirm("",orderId[1],o.getUpOrderId(),"",1);
+                break;
+            case "store":
+                storeOrderService.payConfirm("",orderId[1],o.getUpOrderId(),"",1);
+                break;
+            case "package":
+                packageOrderService.payConfirm("",orderId[1],o.getUpOrderId(),"",1);
+                break;
+            case "course":
+                courseOrderService.payConfirm("",orderId[1],o.getUpOrderId(),"",1);
+                break;
+            case "appvip":
+                userVipOrderService.payConfirm("",orderId[1],o.getUpOrderId(),"",1);
+                break;
             case "appLive":
                 liveOrderService.payConfirm("",orderId[1],o.getUpOrderId(),"",1);
                 break;

+ 1 - 1
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() {
     public void updateLiveStatusByTime() {
         LocalDateTime now = LocalDateTime.now();

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

@@ -38,6 +38,8 @@ public class LiveVo {
     private String liveConfig;
     @ApiModelProperty("视屏地址")
     private String videoUrl;
+    @ApiModelProperty("直播地址")
+    private String flvHlsUrl;
     @ApiModelProperty("当前跳转秒速")
     private Long duration;
     @ApiModelProperty("企微二维码")

+ 10 - 0
fs-service/src/main/java/com/fs/his/param/LiveOrderCancelParam.java

@@ -0,0 +1,10 @@
+package com.fs.his.param;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class LiveOrderCancelParam extends BaseParam implements Serializable {
+    Long orderId;
+}

+ 2 - 0
fs-service/src/main/java/com/fs/his/service/IFsStoreProductService.java

@@ -97,4 +97,6 @@ public interface IFsStoreProductService
     FsStoreProduct getStoreProductByProductIdAndStoreId(Long productId, Long storeId);
 
     int updateStoreProductStock(Long productId, Integer num);
+
+    List<FsStoreProduct> selectFsStoreProductByProductIds(List<String> productIds);
 }

+ 6 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsStoreProductServiceImpl.java

@@ -835,4 +835,10 @@ public class FsStoreProductServiceImpl implements IFsStoreProductService {
         return fsStoreProductMapper.updateStoreProductStock(productId, num);
     }
 
+    @Override
+    public List<FsStoreProduct> selectFsStoreProductByProductIds(List<String> productIds) {
+        return fsStoreProductMapper.selectFsStoreProductByProductIds(productIds);
+    }
+
+
 }

+ 114 - 0
fs-service/src/main/java/com/fs/his/vo/FsStoreWithProduct.java

@@ -0,0 +1,114 @@
+package com.fs.his.vo;
+
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+import com.fs.his.domain.FsStoreProduct;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * 店铺管理对象 fs_store
+ *
+ * @author fs
+ * @date 2023-06-15
+ */
+@Data
+public class FsStoreWithProduct extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** ID */
+    private Long storeId;
+
+    /** 所属城市ids */
+    private String cityIds;
+
+    /** 店铺名称 */
+    @Excel(name = "店铺名称")
+    private String storeName;
+
+    /** 店铺介绍 */
+    @Excel(name = "店铺介绍")
+    private String descs;
+
+    /** 店铺LOGO */
+    @Excel(name = "店铺LOGO")
+    private String logoUrl;
+
+    /** 地址 */
+    @Excel(name = "地址")
+    private String address;
+
+    /** 经度 */
+    private String lng;
+
+    /** 维度 */
+    private String lat;
+
+    /** 店铺电话 */
+    @Excel(name = "店铺电话")
+    private String phone;
+
+    /** 资质证书 */
+    @Excel(name = "资质证书")
+    private String licenseImages;
+
+    /** 商品总数 */
+    @Excel(name = "商品总数")
+    private Long productCount;
+
+    /** 状态 */
+    @Excel(name = "状态")
+    private Integer status;
+
+    /** 销量 */
+    @Excel(name = "销量")
+    private Long salesCount;
+
+    /** 余额 */
+    @Excel(name = "余额")
+    private BigDecimal balance;
+
+    /** 累计金额 */
+    @Excel(name = "累计金额")
+    private BigDecimal totalMoney;
+
+    /** 审核状态 */
+    @Excel(name = "审核状态")
+    private Integer isAudit;
+
+    /** 登录帐号 */
+    @Excel(name = "登录帐号")
+    private String account;
+
+    /** 登录密码 */
+    @Excel(name = "登录密码")
+    private String password;
+
+    /** 配送方式 1=配送 ,2=到店自提 */
+    private String shippingType;
+
+
+    private Integer brokerageType;
+
+    private Integer brokerageRate;
+
+
+    private String fullName;
+
+
+    private String refundPhone;
+    private String refundAddress;
+    private String refundConsignee;
+
+    private Integer deliveryType;
+
+    private String sendPhone;
+
+    List<FsStoreProduct> productList;
+
+    private Integer isFavorite;
+
+}

+ 8 - 2
fs-service/src/main/java/com/fs/live/domain/LiveCart.java

@@ -1,5 +1,6 @@
 package com.fs.live.domain;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.fs.common.annotation.Excel;
 import lombok.Data;
@@ -18,7 +19,7 @@ import java.util.Date;
 public class LiveCart{
 
     /** 购物车表ID */
-    private Long cardId;
+    private Long cartId;
 
     /** 直播间ID */
     @Excel(name = "直播间ID")
@@ -42,7 +43,7 @@ public class LiveCart{
 
     /** 商品数量 */
     @Excel(name = "商品数量")
-    private String cartNum;
+    private Integer cartNum;
 
     /** 0 = 未购买 1 = 已购买 */
     @Excel(name = "0 = 未购买 1 = 已购买")
@@ -56,6 +57,10 @@ public class LiveCart{
     @Excel(name = "是否为立即购买")
     private Integer isBuy;
 
+    /** 是否选中*/
+    @Excel(name = "是否选中")
+    private Integer checked;
+
     /** 创建时间*/
     @Excel(name = "创建时间")
     private Date createTime;
@@ -64,4 +69,5 @@ public class LiveCart{
     @Excel(name = "更新时间")
     private Date updateTime;
 
+
 }

+ 26 - 13
fs-service/src/main/java/com/fs/live/mapper/LiveCartMapper.java

@@ -3,25 +3,28 @@ package com.fs.live.mapper;
 import java.util.List;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.live.domain.LiveCart;
+import com.fs.live.vo.LiveCartVo;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
 
 /**
  * 购物车Mapper接口
- * 
+ *
  * @author fs
  * @date 2025-07-08
  */
 public interface LiveCartMapper extends BaseMapper<LiveCart>{
     /**
      * 查询购物车
-     * 
-     * @param cardId 购物车主键
+     *
+     * @param cartId 购物车主键
      * @return 购物车
      */
-    LiveCart selectLiveCartByCardId(Long cardId);
+    LiveCart selectLiveCartByCartId(Long cartId);
 
     /**
      * 查询购物车列表
-     * 
+     *
      * @param liveCart 购物车
      * @return 购物车集合
      */
@@ -29,7 +32,7 @@ public interface LiveCartMapper extends BaseMapper<LiveCart>{
 
     /**
      * 新增购物车
-     * 
+     *
      * @param liveCart 购物车
      * @return 结果
      */
@@ -37,7 +40,7 @@ public interface LiveCartMapper extends BaseMapper<LiveCart>{
 
     /**
      * 修改购物车
-     * 
+     *
      * @param liveCart 购物车
      * @return 结果
      */
@@ -45,17 +48,27 @@ public interface LiveCartMapper extends BaseMapper<LiveCart>{
 
     /**
      * 删除购物车
-     * 
-     * @param cardId 购物车主键
+     *
+     * @param cartId 购物车主键
      * @return 结果
      */
-    int deleteLiveCartByCardId(Long cardId);
+    int deleteLiveCartByCartId(Long cartId);
 
     /**
      * 批量删除购物车
-     * 
-     * @param cardIds 需要删除的数据主键集合
+     *
+     * @param cartIds 需要删除的数据主键集合
      * @return 结果
      */
-    int deleteLiveCartByCardIds(Long[] cardIds);
+    int deleteLiveCartByCartIds(Long[] cartIds);
+
+    int deleteByCartIdsAndUserId(@Param("cartIds") Long[] cartIds,@Param("userId")  Long userId);
+
+    List<LiveCartVo> selectLiveCartListVo(LiveCart liveCart);
+
+    @Select("select * from live_cart where checked = 1 and user_id = #{userId}")
+    List<LiveCart> selectCheckedLiveCartByUserId(Long userId);
+
+    @Select("select * from live_cart where user_id = #{userId} and product_id = #{productId}")
+    LiveCart selectLiveCartByUserAndProductId(@Param("userId") String userId,@Param("productId") String productId);
 }

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

@@ -3,6 +3,8 @@ package com.fs.live.mapper;
 import java.util.List;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.live.domain.LiveOrderItem;
+import com.fs.live.vo.LiveOrderItemVo;
+import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
 /**
@@ -62,4 +64,11 @@ public interface LiveOrderItemMapper extends BaseMapper<LiveOrderItem>{
 
     @Select("select * from live_order_item where order_id = #{orderId}")
     List<LiveOrderItem> selectLiveOrderItemByOrderId(Long orderId);
+
+    List<LiveOrderItemVo> selectLiveOrderItemByOrderIds(@Param("orderIds") List<Long> orderIds);
+
+    int insertBatchList(@Param("liveOrderItemList") List<LiveOrderItem> liveOrderItemList);
+
+
+    List<LiveOrderItemVo> selectCheckedByUserId(@Param("userId") String userId);
 }

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

@@ -4,9 +4,11 @@ import java.util.List;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.live.domain.LiveOrder;
 import com.fs.live.vo.LiveGoodsVo;
+import com.fs.live.vo.LiveOrderListVo;
 import com.fs.live.vo.LiveOrderVo;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
 
 /**
  * 订单Mapper接口
@@ -76,4 +78,17 @@ public interface LiveOrderMapper extends BaseMapper<LiveOrder>{
 
     @Select("select * from live_order where order_code = #{orderCode}")
     LiveOrder selectFsUserVipOrderByOrderCode(String orderSn);
+
+    @Update("update live_order set status=-3 where order_id=#{orderId}")
+    int cancelOrder(Long orderId);
+
+    @Select({"<script> " +
+            "select * from live_order " +
+            "<where>" +
+            "       <if test=\"userId != null  and userId != ''\"> and user_id = #{userId}</if>\n" +
+            "       <if test=\"status != null \"> and status = #{status}</if>\n" +
+            "</where> " +
+            "order by create_time desc" +
+            "</script>"})
+    List<LiveOrderListVo> selectLiveOrderListVo(@Param("userId") String userId,@Param("status") Integer status);
 }

+ 18 - 10
fs-service/src/main/java/com/fs/live/service/ILiveCartService.java

@@ -2,26 +2,28 @@ package com.fs.live.service;
 
 import java.util.List;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.common.core.domain.R;
 import com.fs.live.domain.LiveCart;
+import com.fs.live.vo.LiveCartVo;
 
 /**
  * 购物车Service接口
- * 
+ *
  * @author fs
  * @date 2025-07-08
  */
 public interface ILiveCartService extends IService<LiveCart>{
     /**
      * 查询购物车
-     * 
+     *
      * @param cardId 购物车主键
      * @return 购物车
      */
-    LiveCart selectLiveCartByCardId(Long cardId);
+    LiveCart selectLiveCartByCartId(Long cardId);
 
     /**
      * 查询购物车列表
-     * 
+     *
      * @param liveCart 购物车
      * @return 购物车集合
      */
@@ -29,7 +31,7 @@ public interface ILiveCartService extends IService<LiveCart>{
 
     /**
      * 新增购物车
-     * 
+     *
      * @param liveCart 购物车
      * @return 结果
      */
@@ -37,7 +39,7 @@ public interface ILiveCartService extends IService<LiveCart>{
 
     /**
      * 修改购物车
-     * 
+     *
      * @param liveCart 购物车
      * @return 结果
      */
@@ -45,17 +47,23 @@ public interface ILiveCartService extends IService<LiveCart>{
 
     /**
      * 批量删除购物车
-     * 
+     *
      * @param cardIds 需要删除的购物车主键集合
      * @return 结果
      */
-    int deleteLiveCartByCardIds(Long[] cardIds);
+    int deleteLiveCartByCartIds(Long[] cardIds);
 
     /**
      * 删除购物车信息
-     * 
+     *
      * @param cardId 购物车主键
      * @return 结果
      */
-    int deleteLiveCartByCardId(Long cardId);
+    int deleteLiveCartByCartId(Long cardId);
+
+    int deleteByCartIds(Long[] cardIds, Long userId);
+
+    List<LiveCartVo> selectLiveCartListVo(LiveCart liveCart);
+
+    List<LiveCartVo> getChecked(LiveCart liveCart);
 }

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

@@ -1,6 +1,7 @@
 package com.fs.live.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.common.core.domain.R;
 import com.fs.live.domain.LiveData;
 import com.fs.live.vo.ColumnsConfigVo;
 import com.fs.live.vo.RecentLiveDataVo;
@@ -99,7 +100,7 @@ public interface ILiveDataService extends IService<LiveData>{
 
     void saveColumnsConfig(String userId, List<ColumnsConfigVo> columns);
 
-    String updateLikeByLiveId(Long liveId, Long userId);
+    R updateLikeByLiveId(Long liveId, Long userId);
 
     String collect(Long liveId, Long userId);
 

+ 11 - 7
fs-service/src/main/java/com/fs/live/service/ILiveOrderItemService.java

@@ -2,18 +2,20 @@ package com.fs.live.service;
 
 import java.util.List;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.live.domain.LiveOrder;
 import com.fs.live.domain.LiveOrderItem;
+import com.fs.live.vo.LiveOrderItemVo;
 
 /**
  * 订单详情Service接口
- * 
+ *
  * @author fs
  * @date 2025-07-08
  */
 public interface ILiveOrderItemService extends IService<LiveOrderItem>{
     /**
      * 查询订单详情
-     * 
+     *
      * @param itemId 订单详情主键
      * @return 订单详情
      */
@@ -21,7 +23,7 @@ public interface ILiveOrderItemService extends IService<LiveOrderItem>{
 
     /**
      * 查询订单详情列表
-     * 
+     *
      * @param liveOrderItem 订单详情
      * @return 订单详情集合
      */
@@ -29,7 +31,7 @@ public interface ILiveOrderItemService extends IService<LiveOrderItem>{
 
     /**
      * 新增订单详情
-     * 
+     *
      * @param liveOrderItem 订单详情
      * @return 结果
      */
@@ -37,7 +39,7 @@ public interface ILiveOrderItemService extends IService<LiveOrderItem>{
 
     /**
      * 修改订单详情
-     * 
+     *
      * @param liveOrderItem 订单详情
      * @return 结果
      */
@@ -45,7 +47,7 @@ public interface ILiveOrderItemService extends IService<LiveOrderItem>{
 
     /**
      * 批量删除订单详情
-     * 
+     *
      * @param itemIds 需要删除的订单详情主键集合
      * @return 结果
      */
@@ -53,9 +55,11 @@ public interface ILiveOrderItemService extends IService<LiveOrderItem>{
 
     /**
      * 删除订单详情信息
-     * 
+     *
      * @param itemId 订单详情主键
      * @return 结果
      */
     int deleteLiveOrderItemByItemId(String itemId);
+
+    List<LiveOrderItemVo> selectCheckedByUserId(LiveOrder liveOrder);
 }

+ 9 - 7
fs-service/src/main/java/com/fs/live/service/ILiveOrderLogsService.java

@@ -6,14 +6,14 @@ import com.fs.live.domain.LiveOrderLogs;
 
 /**
  * 订单操作记录Service接口
- * 
+ *
  * @author fs
  * @date 2025-07-08
  */
 public interface ILiveOrderLogsService extends IService<LiveOrderLogs>{
     /**
      * 查询订单操作记录
-     * 
+     *
      * @param logsId 订单操作记录主键
      * @return 订单操作记录
      */
@@ -21,7 +21,7 @@ public interface ILiveOrderLogsService extends IService<LiveOrderLogs>{
 
     /**
      * 查询订单操作记录列表
-     * 
+     *
      * @param liveOrderLogs 订单操作记录
      * @return 订单操作记录集合
      */
@@ -29,7 +29,7 @@ public interface ILiveOrderLogsService extends IService<LiveOrderLogs>{
 
     /**
      * 新增订单操作记录
-     * 
+     *
      * @param liveOrderLogs 订单操作记录
      * @return 结果
      */
@@ -37,7 +37,7 @@ public interface ILiveOrderLogsService extends IService<LiveOrderLogs>{
 
     /**
      * 修改订单操作记录
-     * 
+     *
      * @param liveOrderLogs 订单操作记录
      * @return 结果
      */
@@ -45,7 +45,7 @@ public interface ILiveOrderLogsService extends IService<LiveOrderLogs>{
 
     /**
      * 批量删除订单操作记录
-     * 
+     *
      * @param logsIds 需要删除的订单操作记录主键集合
      * @return 结果
      */
@@ -53,9 +53,11 @@ public interface ILiveOrderLogsService extends IService<LiveOrderLogs>{
 
     /**
      * 删除订单操作记录信息
-     * 
+     *
      * @param logsId 订单操作记录主键
      * @return 结果
      */
     int deleteLiveOrderLogsByLogsId(String logsId);
+
+    int create(Long orderId, String value, String desc);
 }

+ 7 - 0
fs-service/src/main/java/com/fs/live/service/ILiveOrderService.java

@@ -9,6 +9,7 @@ import com.fs.live.domain.LiveGoods;
 import com.fs.live.domain.LiveOrder;
 import com.fs.live.param.LiveOrderConfirmParam;
 import com.fs.live.vo.LiveGoodsVo;
+import com.fs.live.vo.LiveOrderListVo;
 import com.fs.live.vo.LiveOrderVo;
 
 /**
@@ -140,4 +141,10 @@ public interface ILiveOrderService extends IService<LiveOrder>{
 
 
     int tuiOrder(Long orderId);
+
+    R cancelOrder(LiveOrder order);
+
+    List<LiveOrderListVo> selectLiveOrderListVo(LiveOrder liveOrder);
+
+    R buy(LiveOrder liveOrder);
 }

+ 73 - 13
fs-service/src/main/java/com/fs/live/service/impl/LiveCartServiceImpl.java

@@ -1,94 +1,154 @@
 package com.fs.live.service.impl;
 
+import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
+import java.util.stream.Collectors;
+
+import com.fs.common.core.domain.R;
+import com.fs.common.core.redis.RedisCache;
 import com.fs.common.utils.DateUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.common.utils.StringUtils;
+import com.fs.his.domain.FsStoreProduct;
+import com.fs.his.mapper.FsStoreProductMapper;
+import com.fs.live.mapper.LiveOrderItemMapper;
+import com.fs.live.mapper.LiveOrderMapper;
+import com.fs.live.vo.LiveCartVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.fs.live.mapper.LiveCartMapper;
 import com.fs.live.domain.LiveCart;
 import com.fs.live.service.ILiveCartService;
+import org.springframework.transaction.annotation.Transactional;
 
 /**
  * 购物车Service业务层处理
- * 
+ *
  * @author fs
  * @date 2025-07-08
  */
 @Service
 public class LiveCartServiceImpl extends ServiceImpl<LiveCartMapper, LiveCart> implements ILiveCartService {
 
+    @Autowired
+    private RedisCache redisCache;
+    @Autowired
+    private LiveOrderMapper liveOrderMapper;
+    @Autowired
+    private LiveOrderItemMapper liveOrderItemMapper;
+    @Autowired
+    private FsStoreProductMapper fsStoreProductMapper;
+
+
     /**
      * 查询购物车
-     * 
+     *
      * @param cardId 购物车主键
      * @return 购物车
      */
     @Override
-    public LiveCart selectLiveCartByCardId(Long cardId)
+    public LiveCart selectLiveCartByCartId(Long cardId)
     {
-        return baseMapper.selectLiveCartByCardId(cardId);
+        return baseMapper.selectLiveCartByCartId(cardId);
     }
 
     /**
      * 查询购物车列表
-     * 
+     *
      * @param liveCart 购物车
      * @return 购物车
      */
     @Override
     public List<LiveCart> selectLiveCartList(LiveCart liveCart)
     {
+        ArrayList<LiveCart> liveCarts = new ArrayList<>();
+        if (liveCart.getUserId() == null) {
+            return liveCarts;
+        }
         return baseMapper.selectLiveCartList(liveCart);
     }
 
     /**
      * 新增购物车
-     * 
+     *
      * @param liveCart 购物车
      * @return 结果
      */
     @Override
     public int insertLiveCart(LiveCart liveCart)
     {
+        LiveCart liveCart1 = baseMapper.selectLiveCartByUserAndProductId(liveCart.getUserId(), liveCart.getProductId());
+        if (liveCart1 != null) {
+            liveCart.setCartId(liveCart1.getCartId());
+            liveCart.setCartNum(liveCart.getCartNum() + liveCart1.getCartNum());
+            return updateLiveCart(liveCart);
+        }
         liveCart.setCreateTime(DateUtils.getNowDate());
+        liveCart.setUpdateTime(DateUtils.getNowDate());
+        liveCart.setIsPay(0);
+        liveCart.setChecked(0);
+        liveCart.setIsDel(0);
+        liveCart.setIsBuy(0);
         return baseMapper.insertLiveCart(liveCart);
     }
 
     /**
      * 修改购物车
-     * 
+     *
      * @param liveCart 购物车
      * @return 结果
      */
     @Override
     public int updateLiveCart(LiveCart liveCart)
     {
+        LiveCart exist = baseMapper.selectLiveCartByCartId(liveCart.getCartId());
+        if (exist == null || !exist.getUserId().equals(liveCart.getUserId())) {
+            return 0;
+        }
         liveCart.setUpdateTime(DateUtils.getNowDate());
         return baseMapper.updateLiveCart(liveCart);
     }
 
     /**
      * 批量删除购物车
-     * 
+     *
      * @param cardIds 需要删除的购物车主键
      * @return 结果
      */
     @Override
-    public int deleteLiveCartByCardIds(Long[] cardIds)
+    public int deleteLiveCartByCartIds(Long[] cardIds)
     {
-        return baseMapper.deleteLiveCartByCardIds(cardIds);
+        return baseMapper.deleteLiveCartByCartIds(cardIds);
     }
 
     /**
      * 删除购物车信息
-     * 
+     *
      * @param cardId 购物车主键
      * @return 结果
      */
     @Override
-    public int deleteLiveCartByCardId(Long cardId)
+    public int deleteLiveCartByCartId(Long cardId)
     {
-        return baseMapper.deleteLiveCartByCardId(cardId);
+        return baseMapper.deleteLiveCartByCartId(cardId);
     }
+
+    @Override
+    public int deleteByCartIds(Long[] cardIds, Long userId) {
+        return baseMapper.deleteByCartIdsAndUserId(cardIds, userId);
+    }
+
+    @Override
+    public List<LiveCartVo> selectLiveCartListVo(LiveCart liveCart) {
+        return baseMapper.selectLiveCartListVo(liveCart);
+    }
+
+    @Override
+    public List<LiveCartVo> getChecked(LiveCart liveCart) {
+        liveCart.setChecked(1);
+        return baseMapper.selectLiveCartListVo(liveCart);
+    }
+
+
 }

+ 5 - 4
fs-service/src/main/java/com/fs/live/service/impl/LiveDataServiceImpl.java

@@ -1,6 +1,7 @@
 package com.fs.live.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.common.core.domain.R;
 import com.fs.common.core.redis.RedisCache;
 import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.spring.SpringUtils;
@@ -357,7 +358,7 @@ public class LiveDataServiceImpl extends ServiceImpl<LiveDataMapper, LiveData> i
 
     @Override
     @Transactional
-    public String updateLikeByLiveId(Long liveId, Long userId) {
+    public R updateLikeByLiveId(Long liveId, Long userId) {
         //一个用户一天只能点赞十次
         String key = "live:like:" + liveId + ":user:" + userId+":date:"+ DateUtils.getDate();
         LiveUserLike liveUserLike;
@@ -372,7 +373,7 @@ public class LiveDataServiceImpl extends ServiceImpl<LiveDataMapper, LiveData> i
                 liveUserLike.setLiveId(liveId);
                 liveUserLike.setCreateTime(new Date());
                 liveUserLikeService.insertLiveUserLike(liveUserLike);
-                return redisCache.getCacheObject(key).toString();
+                return R.ok().put("like",redisCache.getCacheObject(key));
             }
         }
         Integer count =redisCache.getCacheObject(key);
@@ -384,13 +385,13 @@ public class LiveDataServiceImpl extends ServiceImpl<LiveDataMapper, LiveData> i
             //间隔秒
             long seconds = ChronoUnit.SECONDS.between(now, tomorrow);
             redisCache.expire(key, (int)seconds, TimeUnit.SECONDS);
-            return "每天最多为直播间点赞10次哟";
+            return R.ok("每天最多为直播间点赞10次哟");
         }
         //用户直播间点赞数
         redisCache.increment(key,1);
         //直播间总点赞数
         redisCache.increment("live:like:" + liveId,1);
-        return redisCache.getCacheObject(key).toString();
+        return R.ok().put("like",redisCache.getCacheObject(key));
     }
 
     @Override

+ 9 - 9
fs-service/src/main/java/com/fs/live/service/impl/LiveGiftServiceImpl.java

@@ -23,15 +23,15 @@ public class LiveGiftServiceImpl extends ServiceImpl<LiveGiftMapper, LiveGift> i
     @Autowired
     private RedisCache redisCache;
 
-    @PostConstruct
-    public void init() {
-        loadGifts();
-    }
-
-    private void loadGifts() {
-        List<LiveGift> liveGifts = baseMapper.selectList(null);
-        redisCache.setCacheList("liveGift", liveGifts);
-    }
+//    @PostConstruct
+//    public void init() {
+//        loadGifts();
+//    }
+//
+//    private void loadGifts() {
+//        List<LiveGift> liveGifts = baseMapper.selectList(null);
+//        redisCache.setCacheList("liveGift", liveGifts);
+//    }
 
     /**
      * 查询直播间礼物配置

+ 15 - 7
fs-service/src/main/java/com/fs/live/service/impl/LiveOrderItemServiceImpl.java

@@ -1,7 +1,10 @@
 package com.fs.live.service.impl;
 
+import java.util.Collections;
 import java.util.List;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.live.domain.LiveOrder;
+import com.fs.live.vo.LiveOrderItemVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.fs.live.mapper.LiveOrderItemMapper;
@@ -10,7 +13,7 @@ import com.fs.live.service.ILiveOrderItemService;
 
 /**
  * 订单详情Service业务层处理
- * 
+ *
  * @author fs
  * @date 2025-07-08
  */
@@ -19,7 +22,7 @@ public class LiveOrderItemServiceImpl extends ServiceImpl<LiveOrderItemMapper, L
 
     /**
      * 查询订单详情
-     * 
+     *
      * @param itemId 订单详情主键
      * @return 订单详情
      */
@@ -31,7 +34,7 @@ public class LiveOrderItemServiceImpl extends ServiceImpl<LiveOrderItemMapper, L
 
     /**
      * 查询订单详情列表
-     * 
+     *
      * @param liveOrderItem 订单详情
      * @return 订单详情
      */
@@ -43,7 +46,7 @@ public class LiveOrderItemServiceImpl extends ServiceImpl<LiveOrderItemMapper, L
 
     /**
      * 新增订单详情
-     * 
+     *
      * @param liveOrderItem 订单详情
      * @return 结果
      */
@@ -55,7 +58,7 @@ public class LiveOrderItemServiceImpl extends ServiceImpl<LiveOrderItemMapper, L
 
     /**
      * 修改订单详情
-     * 
+     *
      * @param liveOrderItem 订单详情
      * @return 结果
      */
@@ -67,7 +70,7 @@ public class LiveOrderItemServiceImpl extends ServiceImpl<LiveOrderItemMapper, L
 
     /**
      * 批量删除订单详情
-     * 
+     *
      * @param itemIds 需要删除的订单详情主键
      * @return 结果
      */
@@ -79,7 +82,7 @@ public class LiveOrderItemServiceImpl extends ServiceImpl<LiveOrderItemMapper, L
 
     /**
      * 删除订单详情信息
-     * 
+     *
      * @param itemId 订单详情主键
      * @return 结果
      */
@@ -88,4 +91,9 @@ public class LiveOrderItemServiceImpl extends ServiceImpl<LiveOrderItemMapper, L
     {
         return baseMapper.deleteLiveOrderItemByItemId(itemId);
     }
+
+    @Override
+    public List<LiveOrderItemVo> selectCheckedByUserId(LiveOrder liveOrder) {
+        return baseMapper.selectCheckedByUserId(liveOrder.getUserId());
+    }
 }

+ 18 - 7
fs-service/src/main/java/com/fs/live/service/impl/LiveOrderLogsServiceImpl.java

@@ -1,5 +1,6 @@
 package com.fs.live.service.impl;
 
+import java.util.Date;
 import java.util.List;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -10,7 +11,7 @@ import com.fs.live.service.ILiveOrderLogsService;
 
 /**
  * 订单操作记录Service业务层处理
- * 
+ *
  * @author fs
  * @date 2025-07-08
  */
@@ -19,7 +20,7 @@ public class LiveOrderLogsServiceImpl extends ServiceImpl<LiveOrderLogsMapper, L
 
     /**
      * 查询订单操作记录
-     * 
+     *
      * @param logsId 订单操作记录主键
      * @return 订单操作记录
      */
@@ -31,7 +32,7 @@ public class LiveOrderLogsServiceImpl extends ServiceImpl<LiveOrderLogsMapper, L
 
     /**
      * 查询订单操作记录列表
-     * 
+     *
      * @param liveOrderLogs 订单操作记录
      * @return 订单操作记录
      */
@@ -43,7 +44,7 @@ public class LiveOrderLogsServiceImpl extends ServiceImpl<LiveOrderLogsMapper, L
 
     /**
      * 新增订单操作记录
-     * 
+     *
      * @param liveOrderLogs 订单操作记录
      * @return 结果
      */
@@ -55,7 +56,7 @@ public class LiveOrderLogsServiceImpl extends ServiceImpl<LiveOrderLogsMapper, L
 
     /**
      * 修改订单操作记录
-     * 
+     *
      * @param liveOrderLogs 订单操作记录
      * @return 结果
      */
@@ -67,7 +68,7 @@ public class LiveOrderLogsServiceImpl extends ServiceImpl<LiveOrderLogsMapper, L
 
     /**
      * 批量删除订单操作记录
-     * 
+     *
      * @param logsIds 需要删除的订单操作记录主键
      * @return 结果
      */
@@ -79,7 +80,7 @@ public class LiveOrderLogsServiceImpl extends ServiceImpl<LiveOrderLogsMapper, L
 
     /**
      * 删除订单操作记录信息
-     * 
+     *
      * @param logsId 订单操作记录主键
      * @return 结果
      */
@@ -88,4 +89,14 @@ public class LiveOrderLogsServiceImpl extends ServiceImpl<LiveOrderLogsMapper, L
     {
         return baseMapper.deleteLiveOrderLogsByLogsId(logsId);
     }
+
+    @Override
+    public int create(Long orderId, String value, String desc) {
+        LiveOrderLogs liveOrderLogs = new LiveOrderLogs();
+        liveOrderLogs.setOrderId(String.valueOf(orderId));
+        liveOrderLogs.setChangeType(value);
+        liveOrderLogs.setChangeMessage(desc);
+        liveOrderLogs.setChangeTime(new Date());
+        return baseMapper.insertLiveOrderLogs(liveOrderLogs);
+    }
 }

+ 140 - 6
fs-service/src/main/java/com/fs/live/service/impl/LiveOrderServiceImpl.java

@@ -11,6 +11,7 @@ import java.time.format.DateTimeFormatter;
 import java.time.temporal.ChronoUnit;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
 
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.util.IdUtil;
@@ -62,7 +63,10 @@ import com.fs.huifuPay.service.HuiFuService;
 import com.fs.live.domain.*;
 import com.fs.live.mapper.*;
 import com.fs.live.param.LiveOrderConfirmParam;
+import com.fs.live.service.ILiveOrderLogsService;
 import com.fs.live.vo.LiveGoodsVo;
+import com.fs.live.vo.LiveOrderItemVo;
+import com.fs.live.vo.LiveOrderListVo;
 import com.fs.live.vo.LiveOrderVo;
 import com.fs.qw.service.IQwExternalContactService;
 import com.fs.system.domain.SysConfig;
@@ -179,6 +183,12 @@ public class LiveOrderServiceImpl extends ServiceImpl<LiveOrderMapper, LiveOrder
     @Autowired
     private SysConfigMapper sysConfigMapper;
 
+    @Autowired
+    private ILiveOrderLogsService liveOrderLogsService;
+
+    @Autowired
+    private LiveCartMapper liveCartMapper;
+
 
     public LiveOrderServiceImpl(RedisCache redisCache) {
         this.redisCache = redisCache;
@@ -483,7 +493,7 @@ public class LiveOrderServiceImpl extends ServiceImpl<LiveOrderMapper, LiveOrder
                             paymentMap.setPayTypeCode(PayType.支付宝条码支付.name());
                         }
                         liveOrderPaymentMapper.updateLiveOrderPayment(paymentMap);
-                        order=baseMapper.selectFsUserVipOrderByOrderCode(storePayment.getBusinessId());
+                        order=baseMapper.selectFsUserVipOrderByOrderCode(storePayment.getPayCode());
                     }
                 }
                 else{
@@ -531,13 +541,11 @@ public class LiveOrderServiceImpl extends ServiceImpl<LiveOrderMapper, LiveOrder
                 this.payConfirm(order.getOrderCode(), "", "", "", 2);
                 return R.ok().put("isPay", 1);
             } else {
-                String json = configService.selectConfigByKey("his.pay");
+                // todo yhq 没有走缓存
+                String json = configService.selectConfigByConfigKey("his.pay").getConfigValue();
                 PayConfigDTO payConfigDTO = JSONUtil.toBean(json, PayConfigDTO.class);
-                payConfigDTO.setType("wx");
                 // todo yhq
                 String payCode =  OrderCodeUtils.getOrderSn();
-//                String payCode = String.valueOf(UUID.randomUUID());
-                payCode = payCode.substring(0, payCode.lastIndexOf('-'));
                 if(StringUtils.isEmpty(payCode)){
                     return R.error("订单生成失败,请重试");
                 }
@@ -685,6 +693,109 @@ public class LiveOrderServiceImpl extends ServiceImpl<LiveOrderMapper, LiveOrder
         return baseMapper.selectLiveOrderList(liveOrder);
     }
 
+    @Override
+    public List<LiveOrderListVo> selectLiveOrderListVo(LiveOrder liveOrder) {
+        List<LiveOrderListVo> liveOrders = baseMapper.selectLiveOrderListVo(liveOrder.getUserId(),liveOrder.getStatus());
+        if (liveOrders.isEmpty()) {
+            return liveOrders;
+        }
+        List<Long> orderIds = liveOrders.stream().map(LiveOrderListVo::getOrderId).collect(Collectors.toList());
+        List<LiveOrderItemVo> liveOrderItems = liveOrderItemMapper.selectLiveOrderItemByOrderIds(orderIds);
+
+        liveOrders.forEach(item -> {
+            item.setOrderItemList(liveOrderItems.stream().filter(liveOrderItem -> liveOrderItem.getOrderId().equals(item.getOrderId())).collect(Collectors.toList()));
+        });
+        return liveOrders;
+    }
+
+    @Override
+    @Transactional
+    public R buy(LiveOrder liveOrder) {
+        String orderKey= redisCache.getCacheObject("orderKey:"+liveOrder.getOrderKey());
+        if (StringUtils.isEmpty(orderKey)) {
+            return R.error("订单已过期");
+        }
+        List<LiveCart> itemList = liveCartMapper.selectCheckedLiveCartByUserId(Long.valueOf(liveOrder.getUserId()));
+        if (itemList == null || itemList.isEmpty()) {
+            return R.error("请选择商品");
+        }
+        List<String> productIds = itemList.stream().map(LiveCart::getProductId).collect(Collectors.toList());
+        List<FsStoreProduct> productList = fsStoreProductService.selectFsStoreProductByProductIds(productIds);
+        if (productList == null || productList.isEmpty()) {
+            return R.error("商品不存在");
+        }
+        BigDecimal totalPrice = new BigDecimal("0");
+        List<LiveOrderItem> liveOrderItemList = new ArrayList<>();
+//        String orderSn = OrderCodeUtils.getOrderSn();
+        String orderSn = UUID.randomUUID().toString();
+        log.info("订单生成:"+orderSn);
+        // 检查数据库存
+        for (LiveCart item : itemList) {
+            FsStoreProduct product = productList.stream().filter(p -> {
+                        if (item.getProductId() != null) {
+                            return p.getProductId() != null && p.getProductId().toString().equals(item.getProductId());
+                        }
+                        return false;}
+            ).findFirst().orElse(null);
+            if (product == null) {
+                return R.error("商品不存在");
+            }
+            if (product.getStock() < item.getCartNum()) {
+                return R.error("商品库存不足");
+            }
+            if (product.getIsShow() == 0) {
+                return R.error("商品已下架");
+            }
+            product.setStock(product.getStock() - item.getCartNum());
+            totalPrice = totalPrice.add(product.getPrice().multiply(new BigDecimal(item.getCartNum())));
+
+            // 订单商品详情
+            FsStoreOrderItemDTO dto=new FsStoreOrderItemDTO();
+            dto.setImage(product.getImgUrl());
+            dto.setSku(String.valueOf(product.getStoreId()));
+            dto.setBarCode(product.getBarCode());
+            dto.setPrice(product.getPrice());
+            dto.setNum(Long.valueOf(item.getCartNum()));
+
+            LiveOrderItem liveOrderItem = new LiveOrderItem();
+            liveOrderItem.setOrderCode(orderSn);
+            liveOrderItem.setOrderId(liveOrder.getOrderId());
+            liveOrderItem.setCartId(item.getCartId());
+            liveOrderItem.setProductId(product.getProductId());
+            liveOrderItem.setNum(Long.valueOf(item.getCartNum()));
+            liveOrderItem.setJsonInfo(JSON.toJSONString(dto));
+            liveOrderItemList.add(liveOrderItem);
+
+        }
+        productList.forEach(product -> {fsStoreProductService.updateStoreProductStock(product.getProductId(), product.getStock());});
+
+
+
+
+        liveOrder.setOrderCode(orderSn);
+
+        liveOrder.setCreateTime(new Date());
+        liveOrder.setUpdateTime(new Date());
+        liveOrder.setStatus(FsStoreOrderStatusEnum.STATUS_1.getValue());
+        liveOrder.setPayType("1");
+        liveOrder.setTotalPrice(totalPrice);
+        liveOrder.setPayMoney(liveOrder.getTotalPrice());
+
+
+        if (baseMapper.insertLiveOrder(liveOrder) > 0) {
+            for (LiveOrderItem liveOrderItem : liveOrderItemList) {
+                liveOrderItem.setOrderId(liveOrder.getOrderId());
+            }
+            liveOrderItemMapper.insertBatchList(liveOrderItemList);
+            // list Long  转为Long数组
+
+            liveCartMapper.deleteLiveCartByCartIds(liveOrderItemList.stream().map(LiveOrderItem::getCartId).toArray(Long[]::new));
+            return R.ok("下单成功").put("order",liveOrder);
+        } else {
+            return R.error("订单创建失败");
+        }
+    }
+
     /**
      * 新增订单
      *
@@ -910,6 +1021,8 @@ public class LiveOrderServiceImpl extends ServiceImpl<LiveOrderMapper, LiveOrder
         return liveGoodsMapper.selectProductListByOrder(liveOrder);
     }
 
+
+
     @Override
     @Transactional
     public R createLiveOrder(LiveOrder liveOrder) {
@@ -934,12 +1047,19 @@ public class LiveOrderServiceImpl extends ServiceImpl<LiveOrderMapper, LiveOrder
         LiveGoods goods = liveGoodsMapper.selectLiveGoodsByProductId(liveOrder.getLiveId(), liveOrder.getProductId());
         if(fsStoreProduct == null || goods == null) return R.error("商品不存在");
         if(fsStoreProduct.getIsShow() == 0 || goods.getStatus() == 0) return R.error("商品已下架");
+        if(fsStoreProduct.getStock() < Integer.parseInt(liveOrder.getTotalNum())) return R.error("库存不足");
+
+        // 更改库存
+        fsStoreProduct.setStock(fsStoreProduct.getStock()-Integer.parseInt(liveOrder.getTotalNum()));
+        fsStoreProductService.updateFsStoreProduct(fsStoreProduct);
 
 //        liveOrderItemMapper
 
 
         //todo yhq
-        liveOrder.setOrderCode(OrderCodeUtils.getOrderSn());
+        String orderSn = OrderCodeUtils.getOrderSn();
+        log.info("订单生成:"+orderSn);
+        liveOrder.setOrderCode(orderSn);
 
 //        liveOrder.setOrderCode(String.valueOf(UUID.randomUUID()));
         liveOrder.setCreateTime(new Date());
@@ -987,6 +1107,20 @@ public class LiveOrderServiceImpl extends ServiceImpl<LiveOrderMapper, LiveOrder
     }
 
 
+    @Override
+    public R cancelOrder(LiveOrder order) {
+        if(order.getStatus() == FsStoreOrderStatusEnum.STATUS_1.getValue()){
+            baseMapper.cancelOrder(order.getOrderId());
+            liveOrderLogsService.create(order.getOrderId(), FsStoreOrderLogEnum.CANCEL_ORDER.getValue(),
+                    FsStoreOrderLogEnum.CANCEL_ORDER.getDesc());
+            return R.ok("操作成功");
+        }else {
+            return R.error("非法操作");
+        }
+    }
+
+
+
 
     /**
      * 订单操作记录

+ 2 - 7
fs-service/src/main/java/com/fs/live/service/impl/LiveServiceImpl.java

@@ -403,13 +403,8 @@ public class LiveServiceImpl extends ServiceImpl<LiveMapper, Live> implements IL
         if (exist.getIsShow() != 1) {
             return R.error("您未拥有直播权限");
         }
-        SysConfig sysConfig = sysConfigService.selectConfigByConfigKey("living.config");
-        Map<String, String> livingConfigMap = JSON.parseObject(sysConfig.getConfigValue(), Map.class);
-        if (livingConfigMap == null || livingConfigMap.isEmpty()) {
-            return R.error("缺失直播配置");
-        }
-        String rtmpPushUrl = generateRtmpPushUrl(livingConfigMap.get("domain"), livingConfigMap.get("app"), exist.getLiveId().toString());
-        String hlvPlayUrl = generateHlvPlayUrl(livingConfigMap.get("http"), livingConfigMap.get("app"), exist.getLiveId().toString());
+        String rtmpPushUrl = generateRtmpPushUrl("rtmp://200149.push.tlivecloud.com", "live", exist.getLiveId().toString());
+        String hlvPlayUrl = generateHlvPlayUrl("http://live.test.ifeiyu100.com", "live", exist.getLiveId().toString());
         exist.setRtmpUrl(rtmpPushUrl);
         exist.setFlvHlsUrl(hlvPlayUrl);
 

+ 103 - 0
fs-service/src/main/java/com/fs/live/vo/LiveCartVo.java

@@ -0,0 +1,103 @@
+package com.fs.live.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 购物车对象 live_cart
+ *
+ * @author fs
+ * @date 2025-07-08
+ */
+@Data
+public class LiveCartVo {
+
+    /**
+     * 购物车表ID
+     */
+    private Long cartId;
+
+    /**
+     * 直播间ID
+     */
+    @Excel(name = "直播间ID")
+    private Long liveId;
+
+    /**
+     * 用户ID
+     */
+    @Excel(name = "用户ID")
+    private String userId;
+
+    /**
+     * 直播商品ID
+     */
+    @Excel(name = "直播商品ID")
+    private Long goodsId;
+
+    /**
+     * 商品ID
+     */
+    @Excel(name = "商品ID")
+    private String productId;
+
+    /**
+     * $column.columnComment
+     */
+    @Excel(name = "商品ID")
+    private Long productAttrValueId;
+
+    /**
+     * 商品数量
+     */
+    @Excel(name = "商品数量")
+    private Integer cartNum;
+
+    /**
+     * 0 = 未购买 1 = 已购买
+     */
+    @Excel(name = "0 = 未购买 1 = 已购买")
+    private Integer isPay;
+
+    /**
+     * 是否删除
+     */
+    @Excel(name = "是否删除")
+    private Integer isDel;
+
+    /**
+     * 是否为立即购买
+     */
+    @Excel(name = "是否为立即购买")
+    private Integer isBuy;
+
+    /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间")
+    private Date createTime;
+
+
+    /** 是否选中*/
+    @Excel(name = "是否选中")
+    private Integer checked;
+
+    /**
+     * 更新时间
+     */
+    @Excel(name = "更新时间")
+    private Date updateTime;
+
+
+
+    private String imgUrl;
+    private String productName;
+    private BigDecimal price;
+    private BigDecimal otPrice;
+    private Integer sales;
+    private Integer stock;
+}

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

@@ -8,7 +8,6 @@ import lombok.Data;
 import java.math.BigDecimal;
 
 @Data
-@AllArgsConstructor
 public class LiveGoodsVo {
     private Long goodsId;
     private String imgUrl;
@@ -19,4 +18,5 @@ public class LiveGoodsVo {
     private Integer sales;
     private Long productId;
     private BigDecimal otPrice;
+    private Long storeId;
 }

+ 79 - 0
fs-service/src/main/java/com/fs/live/vo/LiveOrderItemVo.java

@@ -0,0 +1,79 @@
+package com.fs.live.vo;
+
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * 订单详情对象 live_order_item
+ *
+ * @author fs
+ * @date 2025-07-08
+ */
+@Data
+public class LiveOrderItemVo {
+
+    /** $column.columnComment */
+    private Long itemId;
+
+    /** 订单id */
+    @Excel(name = "订单id")
+    private Long orderId;
+
+    /** 订单号 */
+    @Excel(name = "订单号")
+    private String orderCode;
+
+    /** 购物车ID */
+    @Excel(name = "购物车ID")
+    private Long cartId;
+
+    /** 直播商品ID */
+    @Excel(name = "直播商品ID")
+    private Long goodsId;
+
+    /** 商品ID */
+    @Excel(name = "商品ID")
+    private Long productId;
+
+    /** 商品规格ID */
+    @Excel(name = "商品规格ID")
+    private Long productAttrValueId;
+
+    /** JSON */
+    @Excel(name = "JSON")
+    private String jsonInfo;
+
+    /** 数量 */
+    @Excel(name = "数量")
+    private Long num;
+
+    /** 是否申请售后 0否1是 */
+    @Excel(name = "是否申请售后 0否1是")
+    private Integer isAfterSales;
+
+    /** 是否为处方药 */
+    @Excel(name = "是否为处方药")
+    private Integer isPrescribe;
+
+    /** 店铺ID */
+    @Excel(name = "店铺ID")
+    private Long storeId;
+
+    /** 是否赠品 */
+    @Excel(name = "是否赠品")
+    private Integer isGift;
+
+    private String productName;
+
+    private String imgUrl;
+
+    private BigDecimal price;
+    private BigDecimal otPrice;
+
+    private Integer sales;
+
+    private String productIntroduce;
+
+}

+ 321 - 0
fs-service/src/main/java/com/fs/live/vo/LiveOrderListVo.java

@@ -0,0 +1,321 @@
+package com.fs.live.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+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 com.fs.live.domain.LiveOrderItem;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 订单对象 live_order
+ *
+ * @author fs
+ * @date 2025-07-08
+ */
+@Data
+public class LiveOrderListVo extends BaseParam {
+
+    /** 订单ID */
+    @TableId(type= IdType.AUTO)
+    private Long orderId;
+
+    /** 直播ID */
+    @Excel(name = "直播ID")
+    private Long liveId;
+
+    /** $column.columnComment */
+    @Excel(name = "店铺ID")
+    private Long storeId;
+
+    @Excel(name = "商品id")
+    private Long productId;
+
+    /** 订单号 */
+    @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;
+
+    /** 创建时间*/
+    @Excel(name = "创建时间")
+    private Date createTime;
+
+    /** 更新时间*/
+    @Excel(name = "更新时间")
+    private Date updateTime;
+
+    /** 备注*/
+    @Excel(name = "备注")
+    private String remark;
+
+    /** 备注*/
+    @Excel(name = "订单名称")
+    private String orderName;
+
+    /** 备注*/
+    @Excel(name = "订单名称")
+    @TableField(exist = false)
+    private String productIntroduce;
+
+    /** 备注*/
+    @Excel(name = "订单key")
+    @TableField(exist = false)
+    private String orderKey;
+
+    private List<LiveOrderItemVo> orderItemList;
+}

+ 1 - 0
fs-service/src/main/resources/mapper/his/FsStoreProductMapper.xml

@@ -228,6 +228,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where product_id = #{productId}
     </update>
 
+
     <delete id="deleteFsStoreProductByProductId" parameterType="Long">
         delete from fs_store_product where product_id = #{productId}
     </delete>

+ 44 - 12
fs-service/src/main/resources/mapper/live/LiveCartMapper.xml

@@ -5,7 +5,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 <mapper namespace="com.fs.live.mapper.LiveCartMapper">
 
     <resultMap type="LiveCart" id="LiveCartResult">
-        <result property="cardId"    column="card_id"    />
+        <result property="cartId"    column="cart_id"    />
         <result property="liveId"    column="live_id"    />
         <result property="userId"    column="user_id"    />
         <result property="goodsId"    column="goods_id"    />
@@ -17,10 +17,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="isPay"    column="is_pay"    />
         <result property="isDel"    column="is_del"    />
         <result property="isBuy"    column="is_buy"    />
+        <result property="checked"    column="checked"    />
     </resultMap>
 
     <sql id="selectLiveCartVo">
-        select card_id, live_id, user_id, goods_id, product_id, product_attr_value_id, cart_num, create_time, update_time, is_pay, is_del, is_buy from live_cart
+        select cart_id, live_id, user_id, goods_id, product_id, product_attr_value_id, cart_num, create_time, update_time, is_pay, is_del, is_buy, checked from live_cart
     </sql>
 
     <select id="selectLiveCartList" parameterType="LiveCart" resultMap="LiveCartResult">
@@ -35,15 +36,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isPay != null "> and is_pay = #{isPay}</if>
             <if test="isDel != null "> and is_del = #{isDel}</if>
             <if test="isBuy != null "> and is_buy = #{isBuy}</if>
+            <if test="checked != null "> and checked = #{checked}</if>
         </where>
     </select>
 
-    <select id="selectLiveCartByCardId" parameterType="Long" resultMap="LiveCartResult">
+    <select id="selectLiveCartListVo" parameterType="LiveCart" resultType="com.fs.live.vo.LiveCartVo">
+        select a.cart_id, a.live_id, a.user_id, a.goods_id, a.product_id, a.product_attr_value_id, a.cart_num, a.create_time, a.update_time, a.is_pay, a.is_del, a.is_buy,a.checked,
+        b.product_name, b.img_url,b.price, b.ot_price, b.stock,b.sales
+        from live_cart a
+        left join fs_store_product b on a.product_id = b.product_id
+        <where>
+            <if test="liveId != null "> and live_id = #{liveId}</if>
+            <if test="userId != null  and userId != ''"> and user_id = #{userId}</if>
+            <if test="goodsId != null "> and goods_id = #{goodsId}</if>
+            <if test="productId != null  and productId != ''"> and product_id = #{productId}</if>
+            <if test="productAttrValueId != null "> and product_attr_value_id = #{productAttrValueId}</if>
+            <if test="cartNum != null  and cartNum != ''"> and cart_num = #{cartNum}</if>
+            <if test="isPay != null "> and is_pay = #{isPay}</if>
+            <if test="isDel != null "> and is_del = #{isDel}</if>
+            <if test="isBuy != null "> and is_buy = #{isBuy}</if>
+            <if test="checked != null "> and checked = #{checked}</if>
+        </where>
+    </select>
+
+
+    <select id="selectLiveCartByCartId" parameterType="Long" resultMap="LiveCartResult">
         <include refid="selectLiveCartVo"/>
-        where card_id = #{cardId}
+        where cart_id = #{cartId}
     </select>
 
-    <insert id="insertLiveCart" parameterType="LiveCart" useGeneratedKeys="true" keyProperty="cardId">
+    <insert id="insertLiveCart" parameterType="LiveCart" useGeneratedKeys="true" keyProperty="cartId">
         insert into live_cart
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="liveId != null">live_id,</if>
@@ -57,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isPay != null">is_pay,</if>
             <if test="isDel != null">is_del,</if>
             <if test="isBuy != null">is_buy,</if>
+            <if test="checked != null">checked,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="liveId != null">#{liveId},</if>
@@ -70,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isPay != null">#{isPay},</if>
             <if test="isDel != null">#{isDel},</if>
             <if test="isBuy != null">#{isBuy},</if>
+            <if test="checked != null">#{checked},</if>
          </trim>
     </insert>
 
@@ -87,18 +111,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isPay != null">is_pay = #{isPay},</if>
             <if test="isDel != null">is_del = #{isDel},</if>
             <if test="isBuy != null">is_buy = #{isBuy},</if>
+            <if test="checked != null">checked = #{checked},</if>
         </trim>
-        where card_id = #{cardId}
+        where cart_id = #{cartId}
     </update>
 
-    <delete id="deleteLiveCartByCardId" parameterType="Long">
-        delete from live_cart where card_id = #{cardId}
+    <delete id="deleteLiveCartByCartId" parameterType="Long">
+        delete from live_cart where cart_id = #{cartId}
+    </delete>
+
+    <delete id="deleteLiveCartByCartIds" parameterType="String">
+        delete from live_cart where cart_id in
+        <foreach item="cartId" collection="array" open="(" separator="," close=")">
+            #{cartId}
+        </foreach>
     </delete>
 
-    <delete id="deleteLiveCartByCardIds" parameterType="String">
-        delete from live_cart where card_id in
-        <foreach item="cardId" collection="array" open="(" separator="," close=")">
-            #{cardId}
+    <delete id="deleteByCartIdsAndUserId" parameterType="String">
+        delete from live_cart where user_id = #{userId} and cart_id in
+        <foreach item="cartId" collection="cartIds" open="(" separator="," close=")">
+            #{cartId}
         </foreach>
     </delete>
 </mapper>

+ 3 - 3
fs-service/src/main/resources/mapper/live/LiveGoodsMapper.xml

@@ -159,9 +159,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectProductListByLiveId" parameterType="LiveGoods" resultType="com.fs.live.vo.LiveGoodsVo">
 
-        select lg.goods_id,sp.img_url,sp.product_name,sp.price,sp.stock,sp.sales,lg.status,sp.product_id,sp.ot_price
+        select lg.goods_id,sp.img_url,sp.product_name,sp.price,sp.stock,sp.sales,lg.status,sp.product_id,sp.ot_price,sp.store_id
         from live_goods lg
-        INNER JOIN fs_store_product sp
+        left join fs_store_product sp
         ON lg.store_id = sp.store_id AND lg.product_id = sp.product_id
 
         <where>
@@ -196,7 +196,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectProductListByOrder" parameterType="com.fs.live.domain.LiveOrder" resultType="com.fs.live.vo.LiveGoodsVo">
 
-        select lg.goods_id,sp.img_url,sp.product_name,sp.price,sp.stock,sp.sales,lg.status,sp.product_id,sp.ot_price
+        select lg.goods_id,sp.img_url,sp.product_name,sp.price,sp.stock,sp.sales,lg.status,sp.product_id,sp.ot_price, sp.store_id
         from live_goods lg
         INNER JOIN fs_store_product sp
         ON lg.store_id = sp.store_id AND lg.product_id = sp.product_id

+ 28 - 0
fs-service/src/main/resources/mapper/live/LiveOrderItemMapper.xml

@@ -42,6 +42,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
     </select>
 
+    <select id="selectLiveOrderItemByOrderIds" parameterType="java.util.List" resultType="com.fs.live.vo.LiveOrderItemVo">
+        select a.item_id, a.order_id, a.order_code, a.cart_id, a.goods_id, a.product_id,a. product_attr_value_id, a.json_info, a.num, a.is_after_sales, a.is_prescribe, a.store_id, a.is_gift
+        , b.product_name, b.img_url, b.price, b.ot_price, b.sales, b.product_introduce
+        from live_order_item a
+        left join fs_store_product b on a.product_id = b.product_id
+        where order_id in
+        <foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
+            #{orderId}
+        </foreach>
+    </select>
+
+    <select id="selectCheckedByUserId" parameterType="java.util.List" resultType="com.fs.live.vo.LiveOrderItemVo">
+        select a.item_id, a.order_id, a.order_code, a.cart_id, a.goods_id, a.product_id,a. product_attr_value_id, a.json_info, a.num, a.is_after_sales, a.is_prescribe, a.store_id, a.is_gift
+        , b.product_name, b.img_url, b.price, b.ot_price, b.sales, b.product_introduce
+        from live_order_item a
+        left join fs_store_product b on a.product_id = b.product_id
+        where a.user_id=#{userId}
+    </select>
+
     <select id="selectLiveOrderItemByItemId" parameterType="String" resultMap="LiveOrderItemResult">
         <include refid="selectLiveOrderItemVo"/>
         where item_id = #{itemId}
@@ -79,6 +98,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          </trim>
     </insert>
 
+    <insert id="insertBatchList" parameterType="java.util.List">
+        insert into live_order_item
+        ( order_id, order_code, cart_id, goods_id, product_id, product_attr_value_id, json_info, num, is_after_sales, is_prescribe, store_id, is_gift)
+        values
+        <foreach collection="liveOrderItemList" item="item" separator=",">
+            ( #{item.orderId}, #{item.orderCode}, #{item.cartId}, #{item.goodsId}, #{item.productId}, #{item.productAttrValueId}, #{item.jsonInfo}, #{item.num}, #{item.isAfterSales}, #{item.isPrescribe}, #{item.storeId}, #{item.isGift})
+        </foreach>
+    </insert>
+
     <update id="updateLiveOrderItem" parameterType="LiveOrderItem">
         update live_order_item
         <trim prefix="SET" suffixOverrides=",">