Browse Source

总后台直播抽奖控制台

chenguo 18 hours ago
parent
commit
6b57d07f23
27 changed files with 662 additions and 125 deletions
  1. 10 0
      fs-admin/src/main/java/com/fs/his/controller/FsStoreProductController.java
  2. 11 1
      fs-admin/src/main/java/com/fs/live/controller/LiveController.java
  3. 8 7
      fs-admin/src/main/java/com/fs/live/controller/LiveGoodsController.java
  4. 19 15
      fs-admin/src/main/java/com/fs/live/controller/LiveLotteryConfController.java
  5. 1 16
      fs-admin/src/main/java/com/fs/live/controller/LiveRedConfController.java
  6. 103 0
      fs-admin/src/main/java/com/fs/live/controller/LiveWatchConfigController.java
  7. 5 0
      fs-service/src/main/java/com/fs/live/domain/LiveGoods.java
  8. 0 20
      fs-service/src/main/java/com/fs/live/domain/LiveLotteryConf.java
  9. 53 0
      fs-service/src/main/java/com/fs/live/domain/LiveLotteryProductConf.java
  10. 3 5
      fs-service/src/main/java/com/fs/live/mapper/LiveLotteryConfMapper.java
  11. 75 0
      fs-service/src/main/java/com/fs/live/mapper/LiveLotteryProductConfMapper.java
  12. 32 0
      fs-service/src/main/java/com/fs/live/param/LiveLotteryProduct.java
  13. 32 0
      fs-service/src/main/java/com/fs/live/param/LiveLotteryProductSaveParam.java
  14. 3 0
      fs-service/src/main/java/com/fs/live/service/ILiveGoodsService.java
  15. 7 1
      fs-service/src/main/java/com/fs/live/service/ILiveLotteryConfService.java
  16. 34 0
      fs-service/src/main/java/com/fs/live/service/impl/LiveGoodsServiceImpl.java
  17. 36 2
      fs-service/src/main/java/com/fs/live/service/impl/LiveLotteryConfServiceImpl.java
  18. 32 0
      fs-service/src/main/java/com/fs/live/vo/LiveLotteryProductVO.java
  19. 4 4
      fs-service/src/main/resources/mapper/live/LiveEventConfMapper.xml
  20. 32 5
      fs-service/src/main/resources/mapper/live/LiveGoodsMapper.xml
  21. 10 27
      fs-service/src/main/resources/mapper/live/LiveLotteryConfMapper.xml
  22. 130 0
      fs-service/src/main/resources/mapper/live/LiveLotteryProductConfMapper.xml
  23. 5 5
      fs-service/src/main/resources/mapper/live/LiveLotteryRecordMapper.xml
  24. 4 4
      fs-service/src/main/resources/mapper/live/LiveLotteryRegistrationMapper.xml
  25. 5 5
      fs-service/src/main/resources/mapper/live/LiveRedConfMapper.xml
  26. 4 4
      fs-service/src/main/resources/mapper/live/LiveUserLotteryRecordMapper.xml
  27. 4 4
      fs-service/src/main/resources/mapper/live/LiveUserRedRecordMapper.xml

+ 10 - 0
fs-admin/src/main/java/com/fs/his/controller/FsStoreProductController.java

@@ -55,6 +55,16 @@ public class FsStoreProductController extends BaseController
         return getDataTable(list);
     }
 
+    @PreAuthorize("@ss.hasPermi('his:storeProduct:list')")
+    @GetMapping("/liveList")
+    public TableDataInfo livList(FsStoreProduct fsStoreProduct,@RequestParam Long liveId)
+    {
+        fsStoreProduct.setLiveId(liveId.toString());
+        startPage();
+        List<FsStoreProductVO> list = fsStoreProductService.selectFsStoreProductListVO(fsStoreProduct);
+        return getDataTable(list);
+    }
+
     /**
      * 导出商品列表
      */

+ 11 - 1
fs-admin/src/main/java/com/fs/live/controller/LiveController.java

@@ -3,6 +3,7 @@ package com.fs.live.controller.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;
@@ -13,6 +14,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 直播Controller
@@ -95,6 +97,14 @@ public class LiveController extends BaseController
         return toAjax(liveService.deleteLiveByLiveIds(liveIds));
     }
 
-
+    @GetMapping("/living/{liveId}")
+    public R getRoom(@PathVariable String liveId) {
+        Map<String, Object> resultMap = liveService.getLiveRoom(liveId);
+        if ("200".equals(resultMap.get("code"))) {
+            return R.ok().put("livingUrl", resultMap.get("livingUrl"));
+        } else {
+            return R.error((String) resultMap.get("msg"));
+        }
+    }
 
 }

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

@@ -4,6 +4,7 @@ import com.fs.common.annotation.Log;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
 import com.fs.common.core.domain.R;
+import com.fs.common.core.domain.entity.SysUser;
 import com.fs.common.core.domain.model.LoginUser;
 import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
@@ -89,9 +90,9 @@ public class LiveGoodsController extends BaseController
     public AjaxResult add(@RequestBody Map<String, Object> payload)
     {
         LoginUser loginUser = SecurityUtils.getLoginUser();
-        CompanyUser companyUser = companyUserService.selectCompanyUserById(loginUser.getUser().getUserId());
-        //CompanyUser user = loginUser.getUser();
-        return toAjax(liveGoodsService.insertLiveGoods(payload,companyUser));
+        //CompanyUser companyUser = companyUserService.selectCompanyUserById(loginUser.getUser().getUserId());
+        SysUser user = loginUser.getUser();
+        return toAjax(liveGoodsService.insertLiveGoodsAdmin(payload, user));
     }
 
     /**
@@ -122,10 +123,10 @@ public class LiveGoodsController extends BaseController
      */
     private void setCompanyId(LiveGoods liveGoods) {
         // 设置企业ID 企业用户ID
-        LoginUser loginUser = SecurityUtils.getLoginUser();
-        CompanyUser companyUser = companyUserService.selectCompanyUserById(loginUser.getUser().getUserId());
-        liveGoods.setCompanyId(companyUser.getCompanyId());
-        liveGoods.setCompanyUserId(companyUser.getUserId());
+        //LoginUser loginUser = SecurityUtils.getLoginUser();
+        //CompanyUser companyUser = companyUserService.selectCompanyUserById(loginUser.getUser().getUserId());
+        //liveGoods.setCompanyId(companyUser.getCompanyId());
+        //liveGoods.setCompanyUserId(companyUser.getUserId());
     }
 
 

+ 19 - 15
fs-admin/src/main/java/com/fs/live/controller/LiveLotteryConfController.java

@@ -1,6 +1,10 @@
 package com.fs.live.controller;
 
 import java.util.List;
+
+import com.fs.common.core.domain.R;
+import com.fs.live.param.LiveLotteryProductSaveParam;
+import com.fs.live.vo.LiveLotteryProductVO;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -85,9 +89,9 @@ public class LiveLotteryConfController extends BaseController
     @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:edit')")
     @Log(title = "直播抽奖配置", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody LiveLotteryConf liveLotteryConf)
+    public R edit(@RequestBody LiveLotteryConf liveLotteryConf)
     {
-        return toAjax(liveLotteryConfService.updateLiveLotteryConf(liveLotteryConf));
+        return R.ok(liveLotteryConfService.updateLiveLotteryConf(liveLotteryConf));
     }
 
     /**
@@ -101,25 +105,12 @@ public class LiveLotteryConfController extends BaseController
         return toAjax(liveLotteryConfService.deleteLiveLotteryConfByLotteryIds(lotteryIds));
     }
 
-    @GetMapping("/{id}")
-    public LiveLotteryConf getById(@PathVariable Long id) {
-        return liveLotteryConfService.getById(id);
-    }
 
     @GetMapping("/live/{liveId}")
     public List<LiveLotteryConf> getByLiveId(@PathVariable Long liveId) {
         return liveLotteryConfService.getByLiveId(liveId);
     }
 
-    @PostMapping
-    public void create(@RequestBody LiveLotteryConf conf) {
-        liveLotteryConfService.create(conf);
-    }
-
-    @PutMapping
-    public void update(@RequestBody LiveLotteryConf conf) {
-        liveLotteryConfService.update(conf);
-    }
 
     @DeleteMapping("/{id}")
     public void delete(@PathVariable Long id) {
@@ -134,4 +125,17 @@ public class LiveLotteryConfController extends BaseController
        return liveLotteryConfService.startLottery(lotteryId,getUserId());
     }
 
+    /** 查询抽奖配置的所有商品信息*/
+    @GetMapping("/getGoods/{lotteryId}")
+    public R getGoods(@PathVariable Long lotteryId) {
+        return R.ok().put("data",liveLotteryConfService.getGoods(lotteryId));
+    }
+
+    /** 抽奖商品配置保存*/
+    @PostMapping("/product")
+    public void saveGoods(@RequestBody LiveLotteryProductSaveParam liveLotteryProducts) {
+        //liveLotteryProducts.setCreateBy(getUsername());
+        liveLotteryConfService.saveProducts(liveLotteryProducts);
+    }
+
 }

+ 1 - 16
fs-admin/src/main/java/com/fs/live/controller/LiveRedConfController.java

@@ -22,7 +22,7 @@ import com.fs.common.core.page.TableDataInfo;
  * @date 2025-07-17
  */
 @RestController
-@RequestMapping("/app/live/liveRedConf")
+@RequestMapping("/live/liveRedConf")
 public class LiveRedConfController extends BaseController
 {
     @Autowired
@@ -106,21 +106,6 @@ public class LiveRedConfController extends BaseController
         return liveRedConfService.getByLiveId(liveId);
     }
 
-    @PostMapping
-    public void create(@RequestBody LiveRedConf conf) {
-        liveRedConfService.create(conf);
-    }
-
-    @PutMapping
-    public void update(@RequestBody LiveRedConf conf) {
-        liveRedConfService.update(conf);
-    }
-
-    @DeleteMapping("/{id}")
-    public void delete(@PathVariable Long id) {
-        liveRedConfService.delete(id);
-    }
-
     /**
      * 点击发放红包
      * */

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

@@ -0,0 +1,103 @@
+package com.fs.live.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.framework.web.service.TokenService;
+import com.fs.live.domain.LiveWatchConfig;
+import com.fs.live.service.ILiveWatchConfigService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 直播观看奖励设置Controller
+ *
+ * @author fs
+ * @date 2025-07-08
+ */
+@RestController
+@RequestMapping("/live/config")
+public class LiveWatchConfigController extends BaseController
+{
+    @Autowired
+    private ILiveWatchConfigService liveWatchConfigService;
+    @Autowired
+    private TokenService tokenService;
+
+    /**
+     * 查询直播观看奖励设置列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:config:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveWatchConfig liveWatchConfig)
+    {
+        startPage();
+        List<LiveWatchConfig> list = liveWatchConfigService.selectLiveWatchConfigList(liveWatchConfig);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出直播观看奖励设置列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:config:export')")
+    @Log(title = "直播观看奖励设置", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveWatchConfig liveWatchConfig)
+    {
+        List<LiveWatchConfig> list = liveWatchConfigService.selectLiveWatchConfigList(liveWatchConfig);
+        ExcelUtil<LiveWatchConfig> util = new ExcelUtil<LiveWatchConfig>(LiveWatchConfig.class);
+        return util.exportExcel(list, "直播观看奖励设置数据");
+    }
+
+    /**
+     * 获取直播观看奖励设置详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:config:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success("",liveWatchConfigService.selectLiveWatchConfigByLiveId(id));
+    }
+
+    /**
+     * 新增直播观看奖励设置
+     */
+    @PreAuthorize("@ss.hasPermi('live:config:add')")
+    @Log(title = "直播观看奖励设置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody String jsonConfig)
+    {
+        String userId = tokenService.getLoginUser(ServletUtils.getRequest()).getUser().getUserId().toString();
+        return toAjax(liveWatchConfigService.insertLiveWatchConfig(userId, jsonConfig));
+    }
+
+    /**
+     * 修改直播观看奖励设置
+     */
+    @PreAuthorize("@ss.hasPermi('live:config:edit')")
+    @Log(title = "直播观看奖励设置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody String jsonConfig)
+    {
+        return toAjax(liveWatchConfigService.updateLiveWatchConfig(jsonConfig));
+    }
+
+    /**
+     * 删除直播观看奖励设置
+     */
+    @PreAuthorize("@ss.hasPermi('live:config:remove')")
+    @Log(title = "直播观看奖励设置", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+
+        return toAjax(liveWatchConfigService.deleteLiveWatchConfigByIds(ids));
+    }
+}

+ 5 - 0
fs-service/src/main/java/com/fs/live/domain/LiveGoods.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;
@@ -51,5 +52,9 @@ public class LiveGoods extends BaseEntity{
     @Excel(name = "排序号")
     private Long sort;
 
+    /** 商品名称搜索关键字*/
+    @TableField(exist = false)
+    private String keywords;
+
 
 }

+ 0 - 20
fs-service/src/main/java/com/fs/live/domain/LiveLotteryConf.java

@@ -25,30 +25,10 @@ public class LiveLotteryConf extends BaseEntity{
     @Excel(name = "直播间ID")
     private Long liveId;
 
-    /** 商品ID */
-    @Excel(name = "商品ID")
-    private Long productId;
-
     /** 抽奖状态*/
     @Excel(name = "抽奖状态 0:未开始 1:进行中 2:已结束")
     private String lotteryStatus;
 
-    /** 奖品等级 */
-    @Excel(name = "奖品等级")
-    private Long prizeLevel;
-
-    /** 单次中奖商品数量 */
-    @Excel(name = "单次中奖商品数量")
-    private Long perLotteryNum;
-
-    /** 可中奖份量 */
-    @Excel(name = "可中奖份量")
-    private Long totalLots;
-
-    /** 实际发放奖励份量 */
-    @Excel(name = "实际发放奖励份量")
-    private Long totalSend;
-
     /** 参与抽奖方式 0:在线观众参与 1:关注参与 2:送礼参与 3:下单参与 */
     @Excel(name = "参与抽奖方式 0:在线观众参与 1:关注参与 2:送礼参与 3:下单参与")
     private Long require;

+ 53 - 0
fs-service/src/main/java/com/fs/live/domain/LiveLotteryProductConf.java

@@ -0,0 +1,53 @@
+package com.fs.live.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 直播抽奖记录对象 live_lottery_product_conf
+ *
+ * @author fs
+ * @date 2025-07-21
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class LiveLotteryProductConf extends BaseEntity{
+
+    /** ID */
+    private Long id;
+
+    /** 抽奖ID */
+    @Excel(name = "抽奖ID")
+    private Long lotteryId;
+
+    /** 直播间ID */
+    @Excel(name = "直播间ID")
+    private Long liveId;
+
+    /** 商品ID */
+    @Excel(name = "商品ID")
+    private Long productId;
+
+    /** 奖品等级 */
+    @Excel(name = "奖品等级")
+    private Long prizeLevel;
+
+    /** 单次中奖商品数量 */
+    @Excel(name = "单次中奖商品数量")
+    private Long perLotteryNum;
+
+    /** 奖励总份数 */
+    @Excel(name = "奖励总份数")
+    private Long totalLots;
+
+    /** 实际发放奖励份数 */
+    @Excel(name = "实际发放奖励份数")
+    private Long totalSend;
+
+
+}

+ 3 - 5
fs-service/src/main/java/com/fs/live/mapper/LiveLotteryConfMapper.java

@@ -68,17 +68,15 @@ public interface LiveLotteryConfMapper extends BaseMapper<LiveLotteryConf>{
     List<LiveLotteryConf> selectByLiveId(Long liveId);
 
     @Insert({
-            "INSERT INTO live_lottery_conf (live_id, product_id, prize_level, per_lottery_num,total_lots, total_send, `require`, " +
+            "INSERT INTO live_lottery_conf (live_id,  `require`, " +
                     "require_conf, duration, `desc`, create_time)"+
-            "VALUES (#{liveId}, #{productId}, #{prizeLevel}, #{perLotteryNum},#{totalLots}, #{totalSend}, #{require}, " +
+            "VALUES (#{liveId}, #{require}, " +
                     "#{requireConf}, #{duration}, #{desc},NOW())"})
     @Options(useGeneratedKeys = true, keyProperty = "lotteryId")
     int insert(LiveLotteryConf conf);
 
     @Update({
-            "UPDATE live_lottery_conf SET live_id = #{liveId}, product_id = #{productId},"+
-            "prize_level = #{prizeLevel}, per_lottery_num = #{perLotteryNum},"+
-            "total_lots = #{totalLots}, total_send = #{totalSend}, `require` = #{require},"+
+            "UPDATE live_lottery_conf SET live_id = #{liveId},`require` = #{require},"+
             "require_conf = #{requireConf}, duration = #{duration}, `desc` = #{desc},"+
             "update_time = NOW() ,lottery_status = #{lotteryStatus}"+
             "WHERE lottery_id = #{lotteryId}"

+ 75 - 0
fs-service/src/main/java/com/fs/live/mapper/LiveLotteryProductConfMapper.java

@@ -0,0 +1,75 @@
+package com.fs.live.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.live.domain.LiveLotteryProductConf;
+import com.fs.live.param.LiveLotteryProduct;
+import com.fs.live.param.LiveLotteryProductSaveParam;
+
+/**
+ * 直播抽奖记录Mapper接口
+ *
+ * @author fs
+ * @date 2025-07-21
+ */
+public interface LiveLotteryProductConfMapper extends BaseMapper<LiveLotteryProductConf>{
+    /**
+     * 查询直播抽奖记录
+     *
+     * @param id 直播抽奖记录主键
+     * @return 直播抽奖记录
+     */
+    LiveLotteryProductConf selectLiveLotteryProductConfById(Long id);
+
+    /**
+     * 查询直播抽奖记录列表
+     *
+     * @param liveLotteryProductConf 直播抽奖记录
+     * @return 直播抽奖记录集合
+     */
+    List<LiveLotteryProduct> selectLiveLotteryProductConfByLotteryId(Long lotteryId);
+
+    /**
+     * 查询直播抽奖记录列表
+     *
+     * @param liveLotteryProductConf 直播抽奖记录
+     * @return 直播抽奖记录集合
+     */
+    List<LiveLotteryProductConf> selectLiveLotteryProductConfList(LiveLotteryProductConf liveLotteryProductConf);
+
+    /**
+     * 新增直播抽奖记录
+     *
+     * @param liveLotteryProductConf 直播抽奖记录
+     * @return 结果
+     */
+    int insertLiveLotteryProductConf(LiveLotteryProductConf liveLotteryProductConf);
+
+    /**
+     * 修改直播抽奖记录
+     *
+     * @param liveLotteryProductConf 直播抽奖记录
+     * @return 结果
+     */
+    int updateLiveLotteryProductConf(LiveLotteryProductConf liveLotteryProductConf);
+
+    /**
+     * 删除直播抽奖记录
+     *
+     * @param id 直播抽奖记录主键
+     * @return 结果
+     */
+    int deleteLiveLotteryProductConfById(Long id);
+
+    /**
+     * 批量删除直播抽奖记录
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteLiveLotteryProductConfByIds(Long[] ids);
+
+    void saveProducts(LiveLotteryProductSaveParam saveParam);
+
+    void deleteLiveLotteryProductConfByLotteryId(Long lotteryId);
+}

+ 32 - 0
fs-service/src/main/java/com/fs/live/param/LiveLotteryProduct.java

@@ -0,0 +1,32 @@
+package com.fs.live.param;
+
+import com.fs.common.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 直播抽奖配置对象 live_lottery_conf
+ *
+ * @author fs
+ * @date 2025-07-17
+ */
+@Data
+public class LiveLotteryProduct{
+    /** 商品ID */
+    private Long productId;
+
+    /** 奖品等级 */
+    private Long prizeLevel;
+
+    /** 单次中奖商品数量 */
+    private Long perLotteryNum;
+
+    /** 奖励总份数 */
+    private Long totalLots;
+
+    /** 实际发放奖励份数 */
+    private Long totalSend;
+
+
+
+}

+ 32 - 0
fs-service/src/main/java/com/fs/live/param/LiveLotteryProductSaveParam.java

@@ -0,0 +1,32 @@
+package com.fs.live.param;
+
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.List;
+
+/**
+ * 直播抽奖配置对象 live_lottery_conf
+ *
+ * @author fs
+ * @date 2025-07-17
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class LiveLotteryProductSaveParam extends BaseEntity{
+
+    /** ID */
+    private Long id;
+
+    /** 抽奖ID */
+    private Long lotteryId;
+
+    /** 直播间ID */
+    private Long liveId;
+
+    /** 商品列表 */
+    List<LiveLotteryProduct> prizes;
+
+}

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

@@ -4,6 +4,7 @@ import java.util.List;
 import java.util.Map;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.common.core.domain.entity.SysUser;
 import com.fs.company.domain.CompanyUser;
 import com.fs.his.domain.FsStore;
 import com.fs.his.domain.FsStoreProduct;
@@ -83,4 +84,6 @@ public interface ILiveGoodsService extends IService<LiveGoods>{
      */
     List<LiveGoodsVo> selectProductListByLiveId(LiveGoods liveGoods);
     Map<String, Object> getStoreByLiveId(Long liveId);
+
+    int insertLiveGoodsAdmin(Map<String, Object> payload, SysUser user);
 }

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

@@ -3,6 +3,8 @@ package com.fs.live.service;
 import java.util.List;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fs.live.domain.LiveLotteryConf;
+import com.fs.live.param.LiveLotteryProductSaveParam;
+import com.fs.live.vo.LiveLotteryProductVO;
 
 /**
  * 直播抽奖配置Service接口
@@ -41,7 +43,7 @@ public interface ILiveLotteryConfService extends IService<LiveLotteryConf>{
      * @param liveLotteryConf 直播抽奖配置
      * @return 结果
      */
-    int updateLiveLotteryConf(LiveLotteryConf liveLotteryConf);
+    String updateLiveLotteryConf(LiveLotteryConf liveLotteryConf);
 
     /**
      * 批量删除直播抽奖配置
@@ -70,4 +72,8 @@ public interface ILiveLotteryConfService extends IService<LiveLotteryConf>{
     void delete(Long lotteryId);
 
     String startLottery(Long lotteryId, Long userId);
+
+    void saveProducts(LiveLotteryProductSaveParam liveLotteryProducts);
+
+    LiveLotteryProductVO getGoods(Long lotteryId);
 }

+ 34 - 0
fs-service/src/main/java/com/fs/live/service/impl/LiveGoodsServiceImpl.java

@@ -6,6 +6,7 @@ import java.util.Map;
 import java.util.*;
 import java.util.stream.Collectors;
 
+import com.fs.common.core.domain.entity.SysUser;
 import com.fs.common.utils.DateUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fs.company.domain.CompanyUser;
@@ -132,6 +133,8 @@ public class LiveGoodsServiceImpl extends ServiceImpl<LiveGoodsMapper, LiveGoods
         return map;
     }
 
+
+
     @Override
     public List<LiveGoodsVo> selectProductListByLiveId(LiveGoods liveGoods) {
         return baseMapper.selectProductListByLiveId(liveGoods);
@@ -172,6 +175,37 @@ public class LiveGoodsServiceImpl extends ServiceImpl<LiveGoodsMapper, LiveGoods
                 })
                 .collect(Collectors.toList());
 //
+//        // 批量插入
+        return baseMapper.insertLiveGoodsList(liveGoodsList);
+    }
+
+    @Override
+    public int insertLiveGoodsAdmin(Map<String, Object> payload, SysUser user) {
+        Long liveId = Long.valueOf((String) payload.get("liveId"));
+        String productsId = (String) payload.get("productsId");
+        List<String> productIdList = new ArrayList<>(Arrays.asList(productsId.split(",")));
+        if (productIdList.isEmpty()) {
+            return 0;
+        }
+        //  查询商品信息列表(假设返回 List<StoreProduct>)
+        List<FsStoreProduct> productInfoList = fsStoreProductMapper.selectFsStoreProductByProductIds(productIdList);
+
+        //  转换为 LiveGoods 并批量插入
+        List<LiveGoods> liveGoodsList = productInfoList.stream()
+                .map(product -> {
+                    LiveGoods liveGoods = new LiveGoods();
+                    liveGoods.setLiveId(liveId);
+                    liveGoods.setStoreId(product.getStoreId());
+                    liveGoods.setProductId(product.getProductId());
+                    liveGoods.setStatus(1);
+                    liveGoods.setStock(Long.valueOf(product.getStock()));
+                    liveGoods.setSort(product.getSort());
+                    liveGoods.setCreateTime(DateUtils.getNowDate());
+                    liveGoods.setCreateBy(String.valueOf(user.getUserId()));
+                    return liveGoods;
+                })
+                .collect(Collectors.toList());
+//
 //        // 批量插入
         return baseMapper.insertLiveGoodsList(liveGoodsList);
     }

+ 36 - 2
fs-service/src/main/java/com/fs/live/service/impl/LiveLotteryConfServiceImpl.java

@@ -4,6 +4,10 @@ import java.util.Date;
 import java.util.List;
 import com.fs.common.utils.DateUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.live.mapper.LiveLotteryProductConfMapper;
+import com.fs.live.param.LiveLotteryProduct;
+import com.fs.live.param.LiveLotteryProductSaveParam;
+import com.fs.live.vo.LiveLotteryProductVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.fs.live.mapper.LiveLotteryConfMapper;
@@ -23,6 +27,8 @@ public class LiveLotteryConfServiceImpl extends ServiceImpl<LiveLotteryConfMappe
     @Autowired
     private LiveLotteryConfMapper mapper;
 
+    @Autowired
+    private LiveLotteryProductConfMapper productMapper;
     /**
      * 查询直播抽奖配置
      *
@@ -57,6 +63,7 @@ public class LiveLotteryConfServiceImpl extends ServiceImpl<LiveLotteryConfMappe
     public int insertLiveLotteryConf(LiveLotteryConf liveLotteryConf)
     {
         liveLotteryConf.setCreateTime(DateUtils.getNowDate());
+        liveLotteryConf.setLotteryStatus("0");
         return baseMapper.insertLiveLotteryConf(liveLotteryConf);
     }
 
@@ -67,9 +74,18 @@ public class LiveLotteryConfServiceImpl extends ServiceImpl<LiveLotteryConfMappe
      * @return 结果
      */
     @Override
-    public int updateLiveLotteryConf(LiveLotteryConf liveLotteryConf)
+    public String updateLiveLotteryConf(LiveLotteryConf liveLotteryConf)
     {
-        return baseMapper.updateLiveLotteryConf(liveLotteryConf);
+        if("1".equals(liveLotteryConf.getLotteryStatus())){
+            List<LiveLotteryProduct> prizes = productMapper.selectLiveLotteryProductConfByLotteryId(liveLotteryConf.getLotteryId());
+            if (prizes != null && !prizes.isEmpty()){
+                return baseMapper.updateLiveLotteryConf(liveLotteryConf)+"";
+            }else{
+                return "请先添加奖品";
+            }
+        }
+        return "1";
+
     }
 
     /**
@@ -143,4 +159,22 @@ public class LiveLotteryConfServiceImpl extends ServiceImpl<LiveLotteryConfMappe
         mapper.updateAll(conf);
         return "开始抽奖成功";
     }
+
+    @Override
+    public void saveProducts(LiveLotteryProductSaveParam liveLotteryProducts) {
+        //先删除
+        productMapper.deleteLiveLotteryProductConfByLotteryId(liveLotteryProducts.getLotteryId());
+        liveLotteryProducts.setCreateTime(DateUtils.getNowDate());
+        productMapper.saveProducts(liveLotteryProducts);
+    }
+
+    @Override
+    public LiveLotteryProductVO getGoods(Long lotteryId) {
+        LiveLotteryProductVO liveLotteryProductVO = new LiveLotteryProductVO();
+        liveLotteryProductVO.setLotteryId(lotteryId);
+        liveLotteryProductVO.setPrizes(
+                productMapper.selectLiveLotteryProductConfByLotteryId(lotteryId)
+        );
+        return liveLotteryProductVO;
+    }
 }

+ 32 - 0
fs-service/src/main/java/com/fs/live/vo/LiveLotteryProductVO.java

@@ -0,0 +1,32 @@
+package com.fs.live.vo;
+
+import com.fs.common.core.domain.BaseEntity;
+import com.fs.live.param.LiveLotteryProduct;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.List;
+
+/**
+ * 直播抽奖配置对象 live_lottery_conf
+ *
+ * @author fs
+ * @date 2025-07-17
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class LiveLotteryProductVO extends BaseEntity{
+
+    /** ID */
+    private Long id;
+
+    /** 抽奖ID */
+    private Long lotteryId;
+
+    /** 直播间ID */
+    private Long liveId;
+
+    /** 商品列表 */
+    List<LiveLotteryProduct> prizes;
+
+}

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

@@ -11,7 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="triggerCount"    column="trigger_count"    />
         <result property="redId"    column="red_id"    />
         <result property="createTime"    column="create_time"    />
-        <result property="udpateTime"    column="update_time"    />
+        <result property="updateTime"    column="update_time"    />
         <result property="createBy"    column="create_by"    />
         <result property="updateBy"    column="update_by"    />
     </resultMap>
@@ -42,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="triggerCount != null">trigger_count,</if>
             <if test="redId != null">red_id,</if>
             <if test="createTime != null">create_time,</if>
-            <if test="udpateTime != null">update_time,</if>
+            <if test="updateTime != null">update_time,</if>
             <if test="createBy != null">create_by,</if>
             <if test="updateBy != null">update_by,</if>
          </trim>
@@ -52,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="triggerCount != null">#{triggerCount},</if>
             <if test="redId != null">#{redId},</if>
             <if test="createTime != null">#{createTime},</if>
-            <if test="udpateTime != null">#{udpateTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
          </trim>
@@ -66,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="triggerCount != null">trigger_count = #{triggerCount},</if>
             <if test="redId != null">red_id = #{redId},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="udpateTime != null">update_time = #{udpateTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
         </trim>

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

@@ -120,9 +120,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ) VALUES
         <foreach collection="liveGoodsList" item="item" separator=",">
             (
-            #{item.liveId}, #{item.companyId}, #{item.companyUserId}, #{item.storeId},
-            #{item.productId}, #{item.createTime}, #{item.createBy}, #{item.updateBy},
-            #{item.updateTime}, #{item.remark}, #{item.status}, #{item.stock}, #{item.sort}
+            #{item.liveId},
+            <choose>
+                <when test="item.companyId != null">
+                    #{item.companyId},
+                </when>
+                <otherwise>
+                    null,
+                </otherwise>
+            </choose>
+            <choose>
+                <when test="item.companyUserId != null">
+                    #{item.companyUserId},
+                </when>
+                <otherwise>
+                    null,
+                </otherwise>
+            </choose>
+            #{item.storeId},
+            #{item.productId},
+            #{item.createTime},
+            #{item.createBy},
+            #{item.updateBy},
+            #{item.updateTime},
+            #{item.remark},
+            #{item.status},
+            #{item.stock},
+            #{item.sort}
             )
         </foreach>
     </insert>
@@ -136,11 +160,11 @@ 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 from live_goods lg
-        LEFT JOIN fs_store_product sp
+        INNER JOIN fs_store_product sp
         ON lg.store_id = sp.store_id AND lg.product_id = sp.product_id
 
         <where>
-            <if test="liveId != null "> and live_id = #{liveId}</if>
+            live_id = #{liveId}
             <if test="companyId != null "> and company_id = #{companyId}</if>
             <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
             <if test="storeId != null "> and store_id = #{storeId}</if>
@@ -148,6 +172,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="status != null "> and status = #{status}</if>
             <if test="stock != null "> and stock = #{stock}</if>
             <if test="sort != null "> and sort = #{sort}</if>
+            <if test="keywords != null and keywords != ''">
+                and sp.product_name like concat('%',#{keywords},'%')
+            </if>
         </where>
     </select>
 

+ 10 - 27
fs-service/src/main/resources/mapper/live/LiveLotteryConfMapper.xml

@@ -7,34 +7,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap type="LiveLotteryConf" id="LiveLotteryConfResult">
         <result property="lotteryId"    column="lottery_id"    />
         <result property="liveId"    column="live_id"    />
-        <result property="productId"    column="product_id"    />
-        <result property="prizeLevel"    column="prize_level"    />
-        <result property="perLotteryNum"    column="per_lottery_num"    />
-        <result property="totalLots"    column="total_lots"    />
-        <result property="totalSend"    column="total_send"    />
         <result property="require"    column="require"    />
         <result property="requireConf"    column="require_conf"    />
         <result property="duration"    column="duration"    />
         <result property="desc"    column="desc"    />
         <result property="createTime"    column="create_time"    />
-        <result property="udpateTime"    column="update_time"    />
+        <result property="updateTime"    column="update_time"    />
         <result property="createBy"    column="create_by"    />
         <result property="updateBy"    column="update_by"    />
+        <result property="lotteryStatus"    column="lottery_status"    />
     </resultMap>
 
     <sql id="selectLiveLotteryConfVo">
-        select lottery_id, live_id, product_id, prize_level, per_lottery_num, total_lots, total_send, `require`, require_conf, duration, `desc`, create_time, update_time, create_by, update_by from live_lottery_conf
+        select lottery_id, live_id, `require`, require_conf, duration, `desc`, create_time, update_time, create_by, update_by, lottery_status from live_lottery_conf
     </sql>
 
     <select id="selectLiveLotteryConfList" parameterType="LiveLotteryConf" resultMap="LiveLotteryConfResult">
         <include refid="selectLiveLotteryConfVo"/>
         <where>
             <if test="liveId != null "> and live_id = #{liveId}</if>
-            <if test="productId != null "> and product_id = #{productId}</if>
-            <if test="prizeLevel != null "> and prize_level = #{prizeLevel}</if>
             <if test="require != null "> and `require` = #{require}</if>
             <if test="desc != null  and desc != ''"> and `desc` = #{desc}</if>
             <if test="createTime != null "> and create_time = #{createTime}</if>
+            <if test="lotteryStatus != null "> and lottery_status = #{lotteryStatus}</if>
         </where>
     </select>
 
@@ -47,35 +42,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         insert into live_lottery_conf
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="liveId != null">live_id,</if>
-            <if test="productId != null">product_id,</if>
-            <if test="prizeLevel != null">prize_level,</if>
-            <if test="perLotteryNum != null">per_lottery_num,</if>
-            <if test="totalLots != null">total_lots,</if>
-            <if test="totalSend != null">total_send,</if>
             <if test="require != null">`require`,</if>
             <if test="requireConf != null">require_conf,</if>
             <if test="duration != null">duration,</if>
             <if test="desc != null and desc != ''">`desc`,</if>
             <if test="createTime != null">create_time,</if>
-            <if test="udpateTime != null">update_time,</if>
+            <if test="updateTime != null">update_time,</if>
             <if test="createBy != null">create_by,</if>
             <if test="updateBy != null">update_by,</if>
+            <if test="lotteryStatus != null">lottery_status,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="liveId != null">#{liveId},</if>
-            <if test="productId != null">#{productId},</if>
-            <if test="prizeLevel != null">#{prizeLevel},</if>
-            <if test="perLotteryNum != null">#{perLotteryNum},</if>
-            <if test="totalLots != null">#{totalLots},</if>
-            <if test="totalSend != null">#{totalSend},</if>
             <if test="require != null">#{require},</if>
             <if test="requireConf != null">#{requireConf},</if>
             <if test="duration != null">#{duration},</if>
             <if test="desc != null and desc != ''">#{desc},</if>
             <if test="createTime != null">#{createTime},</if>
-            <if test="udpateTime != null">#{udpateTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
+            <if test="lotteryStatus != null">#{lotteryStatus},</if>
          </trim>
     </insert>
 
@@ -83,19 +70,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         update live_lottery_conf
         <trim prefix="SET" suffixOverrides=",">
             <if test="liveId != null">live_id = #{liveId},</if>
-            <if test="productId != null">product_id = #{productId},</if>
-            <if test="prizeLevel != null">prize_level = #{prizeLevel},</if>
-            <if test="perLotteryNum != null">per_lottery_num = #{perLotteryNum},</if>
-            <if test="totalLots != null">total_lots = #{totalLots},</if>
-            <if test="totalSend != null">total_send = #{totalSend},</if>
             <if test="require != null">`require` = #{require},</if>
             <if test="requireConf != null">require_conf = #{requireConf},</if>
             <if test="duration != null">duration = #{duration},</if>
             <if test="desc != null and desc != ''">`desc` = #{desc},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="udpateTime != null">update_time = #{udpateTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="lotteryStatus != null">lottery_status = #{lotteryStatus},</if>
         </trim>
         where lottery_id = #{lotteryId}
     </update>

+ 130 - 0
fs-service/src/main/resources/mapper/live/LiveLotteryProductConfMapper.xml

@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fs.live.mapper.LiveLotteryProductConfMapper">
+
+    <resultMap type="LiveLotteryProductConf" id="LiveLotteryProductConfResult">
+        <result property="id"    column="id"    />
+        <result property="lotteryId"    column="lottery_id"    />
+        <result property="liveId"    column="live_id"    />
+        <result property="productId"    column="product_id"    />
+        <result property="prizeLevel"    column="prize_level"    />
+        <result property="perLotteryNum"    column="per_lottery_num"    />
+        <result property="totalLots"    column="total_lots"    />
+        <result property="totalSend"    column="total_send"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="udpate_time"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="updateBy"    column="update_by"    />
+    </resultMap>
+
+    <sql id="selectLiveLotteryProductConfVo">
+        select id, lottery_id, live_id, product_id, prize_level, per_lottery_num, total_lots, total_send, create_time, update_time, create_by, update_by from live_lottery_product_conf
+    </sql>
+
+    <select id="selectLiveLotteryProductConfList" parameterType="LiveLotteryProductConf" resultMap="LiveLotteryProductConfResult">
+        <include refid="selectLiveLotteryProductConfVo"/>
+        <where>
+            <if test="lotteryId != null "> and lottery_id = #{lotteryId}</if>
+            <if test="liveId != null "> and live_id = #{liveId}</if>
+            <if test="productId != null "> and product_id = #{productId}</if>
+            <if test="prizeLevel != null "> and prize_level = #{prizeLevel}</if>
+            <if test="perLotteryNum != null "> and per_lottery_num = #{perLotteryNum}</if>
+            <if test="totalLots != null "> and total_lots = #{totalLots}</if>
+            <if test="totalSend != null "> and total_send = #{totalSend}</if>
+            <if test="createTime != null "> and create_time = #{createTime}</if>
+        </where>
+    </select>
+
+    <select id="selectLiveLotteryProductConfById" parameterType="Long" resultMap="LiveLotteryProductConfResult">
+        <include refid="selectLiveLotteryProductConfVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertLiveLotteryProductConf" parameterType="LiveLotteryProductConf" useGeneratedKeys="true" keyProperty="id">
+        insert into live_lottery_product_conf
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="lotteryId != null">lottery_id,</if>
+            <if test="liveId != null">live_id,</if>
+            <if test="productId != null">product_id,</if>
+            <if test="prizeLevel != null">prize_level,</if>
+            <if test="perLotteryNum != null">per_lottery_num,</if>
+            <if test="totalLots != null">total_lots,</if>
+            <if test="totalSend != null">total_send,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">udpate_time,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="updateBy != null">update_by,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="lotteryId != null">#{lotteryId},</if>
+            <if test="liveId != null">#{liveId},</if>
+            <if test="productId != null">#{productId},</if>
+            <if test="prizeLevel != null">#{prizeLevel},</if>
+            <if test="perLotteryNum != null">#{perLotteryNum},</if>
+            <if test="totalLots != null">#{totalLots},</if>
+            <if test="totalSend != null">#{totalSend},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+         </trim>
+    </insert>
+
+    <update id="updateLiveLotteryProductConf" parameterType="LiveLotteryProductConf">
+        update live_lottery_product_conf
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="lotteryId != null">lottery_id = #{lotteryId},</if>
+            <if test="liveId != null">live_id = #{liveId},</if>
+            <if test="productId != null">product_id = #{productId},</if>
+            <if test="prizeLevel != null">prize_level = #{prizeLevel},</if>
+            <if test="perLotteryNum != null">per_lottery_num = #{perLotteryNum},</if>
+            <if test="totalLots != null">total_lots = #{totalLots},</if>
+            <if test="totalSend != null">total_send = #{totalSend},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">udpate_time = #{updateTime},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteLiveLotteryProductConfByIds" parameterType="String">
+        delete from live_lottery_product_conf where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <insert id="saveProducts" parameterType="com.fs.live.param.LiveLotteryProductSaveParam">
+        insert into live_lottery_product_conf
+        (lottery_id,live_id,product_id,prize_level,per_lottery_num
+        ,total_lots,total_send,create_time,create_by)
+        values
+        <foreach item="liveLotteryProduct" collection="prizes" separator="," >
+            <trim prefix="(" suffix=")" suffixOverrides=",">
+                #{lotteryId},
+                #{liveId},
+                #{liveLotteryProduct.productId},
+                #{liveLotteryProduct.prizeLevel},
+                #{liveLotteryProduct.perLotteryNum},
+                #{liveLotteryProduct.totalLots},
+                #{liveLotteryProduct.totalSend},
+                #{createTime},
+                #{createBy},
+            </trim>
+        </foreach>
+    </insert>
+
+    <select id="selectLiveLotteryProductConfByLotteryId" parameterType="Long" resultType="com.fs.live.param.LiveLotteryProduct">
+        select product_id,prize_level,per_lottery_num,total_lots,total_send
+        from live_lottery_product_conf
+        where lottery_id = #{lotteryId}
+        order by prize_level
+    </select>
+
+    <delete id="deleteLiveLotteryProductConfByLotteryId" parameterType="Long" >
+        delete from live_lottery_product_conf where lottery_id = #{lotteryId}
+    </delete>
+</mapper>

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

@@ -9,7 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="liveId"    column="live_id"    />
         <result property="lotteryStauts"    column="lottery_stauts"    />
         <result property="createTime"    column="create_time"    />
-        <result property="udpateTime"    column="update_time"    />
+        <result property="updateTime"    column="update_time"    />
         <result property="createBy"    column="create_by"    />
         <result property="updateBy"    column="update_by"    />
     </resultMap>
@@ -23,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>
             <if test="liveId != null "> and live_id = #{liveId}</if>
             <if test="lotteryStauts != null "> and lottery_stauts = #{lotteryStauts}</if>
-            <if test="udpateTime != null "> and update_time = #{udpateTime}</if>
+            <if test="updateTime != null "> and update_time = #{updateTime}</if>
         </where>
     </select>
 
@@ -38,7 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="liveId != null">live_id,</if>
             <if test="lotteryStauts != null">lottery_stauts,</if>
             <if test="createTime != null">create_time,</if>
-            <if test="udpateTime != null">update_time,</if>
+            <if test="updateTime != null">update_time,</if>
             <if test="createBy != null">create_by,</if>
             <if test="updateBy != null">update_by,</if>
          </trim>
@@ -46,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="liveId != null">#{liveId},</if>
             <if test="lotteryStauts != null">#{lotteryStauts},</if>
             <if test="createTime != null">#{createTime},</if>
-            <if test="udpateTime != null">#{udpateTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
          </trim>
@@ -58,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="liveId != null">live_id = #{liveId},</if>
             <if test="lotteryStauts != null">lottery_stauts = #{lotteryStauts},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="udpateTime != null">update_time = #{udpateTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
         </trim>

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

@@ -11,7 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="isWin"    column="is_win"    />
         <result property="rizeLevel"    column="rize_level"    />
         <result property="createTime"    column="create_time"    />
-        <result property="udpateTime"    column="update_time"    />
+        <result property="updateTime"    column="update_time"    />
         <result property="createBy"    column="create_by"    />
         <result property="updateBy"    column="update_by"    />
     </resultMap>
@@ -39,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isWin != null">is_win,</if>
             <if test="rizeLevel != null">rize_level,</if>
             <if test="createTime != null">create_time,</if>
-            <if test="udpateTime != null">update_time,</if>
+            <if test="updateTime != null">update_time,</if>
             <if test="createBy != null">create_by,</if>
             <if test="updateBy != null">update_by,</if>
          </trim>
@@ -49,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isWin != null">#{isWin},</if>
             <if test="rizeLevel != null">#{rizeLevel},</if>
             <if test="createTime != null">#{createTime},</if>
-            <if test="udpateTime != null">#{udpateTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
          </trim>
@@ -63,7 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isWin != null">is_win = #{isWin},</if>
             <if test="rizeLevel != null">rize_level = #{rizeLevel},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="udpateTime != null">update_time = #{udpateTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
         </trim>

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

@@ -15,7 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="totalSend"    column="total_send"    />
         <result property="desc"    column="desc"    />
         <result property="createTime"    column="create_time"    />
-        <result property="udpateTime"    column="update_time"    />
+        <result property="updateTime"    column="update_time"    />
         <result property="createBy"    column="create_by"    />
         <result property="updateBy"    column="update_by"    />
     </resultMap>
@@ -32,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="liveId != null "> and live_id = #{liveId}</if>
             <if test="desc != null  and desc != ''"> and `desc` = #{desc}</if>
             <if test="createTime != null "> and create_time = #{createTime}</if>
-            <if test="udpateTime != null "> and update_time = #{udpateTime}</if>
+            <if test="updateTime != null "> and update_time = #{updateTime}</if>
         </where>
     </select>
 
@@ -53,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="totalSend != null">total_send,</if>
             <if test="desc != null and desc != ''">`desc`,</if>
             <if test="createTime != null">create_time,</if>
-            <if test="udpateTime != null">update_time,</if>
+            <if test="updateTime != null">update_time,</if>
             <if test="createBy != null">create_by,</if>
             <if test="updateBy != null">update_by,</if>
          </trim>
@@ -67,7 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="totalSend != null">#{totalSend},</if>
             <if test="desc != null and desc != ''">#{desc},</if>
             <if test="createTime != null">#{createTime},</if>
-            <if test="udpateTime != null">#{udpateTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
          </trim>
@@ -85,7 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="totalSend != null">total_send = #{totalSend},</if>
             <if test="desc != null and desc != ''">`desc` = #{desc},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="udpateTime != null">update_time = #{udpateTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
         </trim>

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

@@ -11,7 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="userId"    column="user_id"    />
         <result property="productId"    column="product_id"    />
         <result property="createTime"    column="create_time"    />
-        <result property="udpateTime"    column="update_time"    />
+        <result property="updateTime"    column="update_time"    />
         <result property="createBy"    column="create_by"    />
         <result property="updateBy"    column="update_by"    />
     </resultMap>
@@ -43,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="userId != null">user_id,</if>
             <if test="productId != null">product_id,</if>
             <if test="createTime != null">create_time,</if>
-            <if test="udpateTime != null">update_time,</if>
+            <if test="updateTime != null">update_time,</if>
             <if test="createBy != null">create_by,</if>
             <if test="updateBy != null">update_by,</if>
          </trim>
@@ -53,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="userId != null">#{userId},</if>
             <if test="productId != null">#{productId},</if>
             <if test="createTime != null">#{createTime},</if>
-            <if test="udpateTime != null">#{udpateTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
          </trim>
@@ -67,7 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="userId != null">user_id = #{userId},</if>
             <if test="productId != null">product_id = #{productId},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="udpateTime != null">update_time = #{udpateTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
         </trim>

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

@@ -11,7 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="userId"    column="user_id"    />
         <result property="integral"    column="integral"    />
         <result property="createTime"    column="create_time"    />
-        <result property="udpateTime"    column="update_time"    />
+        <result property="updateTime"    column="update_time"    />
         <result property="createBy"    column="create_by"    />
         <result property="updateBy"    column="update_by"    />
     </resultMap>
@@ -42,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="userId != null">user_id,</if>
             <if test="integral != null">integral,</if>
             <if test="createTime != null">create_time,</if>
-            <if test="udpateTime != null">update_time,</if>
+            <if test="updateTime != null">update_time,</if>
             <if test="createBy != null">create_by,</if>
             <if test="updateBy != null">update_by,</if>
          </trim>
@@ -52,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="userId != null">#{userId},</if>
             <if test="integral != null">#{integral},</if>
             <if test="createTime != null">#{createTime},</if>
-            <if test="udpateTime != null">#{udpateTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
          </trim>
@@ -66,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="userId != null">user_id = #{userId},</if>
             <if test="integral != null">integral = #{integral},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="udpateTime != null">update_time = #{udpateTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
         </trim>