Selaa lähdekoodia

新增播放方案

zmj 5 päivää sitten
vanhempi
sitoutus
d13abf87e0

+ 104 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/RobotOpsPlayPlanController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.web.controller.base;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.base.domain.RobotOpsPlayPlan;
+import com.ruoyi.base.service.IRobotOpsPlayPlanService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 播放方案Controller
+ *
+ * @author ruoyi
+ * @date 2026-05-11
+ */
+@RestController
+@RequestMapping("/base/plan")
+public class RobotOpsPlayPlanController extends BaseController
+{
+    @Autowired
+    private IRobotOpsPlayPlanService robotOpsPlayPlanService;
+
+    /**
+     * 查询播放方案列表
+     */
+    @PreAuthorize("@ss.hasPermi('base:plan:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(RobotOpsPlayPlan robotOpsPlayPlan)
+    {
+        startPage();
+        List<RobotOpsPlayPlan> list = robotOpsPlayPlanService.selectRobotOpsPlayPlanList(robotOpsPlayPlan);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出播放方案列表
+     */
+    @PreAuthorize("@ss.hasPermi('base:plan:export')")
+    @Log(title = "播放方案", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, RobotOpsPlayPlan robotOpsPlayPlan)
+    {
+        List<RobotOpsPlayPlan> list = robotOpsPlayPlanService.selectRobotOpsPlayPlanList(robotOpsPlayPlan);
+        ExcelUtil<RobotOpsPlayPlan> util = new ExcelUtil<RobotOpsPlayPlan>(RobotOpsPlayPlan.class);
+        util.exportExcel(response, list, "播放方案数据");
+    }
+
+    /**
+     * 获取播放方案详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('base:plan:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(robotOpsPlayPlanService.selectRobotOpsPlayPlanById(id));
+    }
+
+    /**
+     * 新增播放方案
+     */
+    @PreAuthorize("@ss.hasPermi('base:plan:add')")
+    @Log(title = "播放方案", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody RobotOpsPlayPlan robotOpsPlayPlan)
+    {
+        return toAjax(robotOpsPlayPlanService.insertRobotOpsPlayPlan(robotOpsPlayPlan));
+    }
+
+    /**
+     * 修改播放方案
+     */
+    @PreAuthorize("@ss.hasPermi('base:plan:edit')")
+    @Log(title = "播放方案", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody RobotOpsPlayPlan robotOpsPlayPlan)
+    {
+        return toAjax(robotOpsPlayPlanService.updateRobotOpsPlayPlan(robotOpsPlayPlan));
+    }
+
+    /**
+     * 删除播放方案
+     */
+    @PreAuthorize("@ss.hasPermi('base:plan:remove')")
+    @Log(title = "播放方案", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(robotOpsPlayPlanService.deleteRobotOpsPlayPlanByIds(ids));
+    }
+}

+ 120 - 0
ruoyi-system/src/main/java/com/ruoyi/base/domain/RobotOpsPlayPlan.java

@@ -0,0 +1,120 @@
+package com.ruoyi.base.domain;
+
+import java.util.List;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 播放方案对象 robot_ops_play_plan
+ *
+ * @author ruoyi
+ * @date 2026-05-11
+ */
+public class RobotOpsPlayPlan extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键ID */
+    private Long id;
+
+    /** 播放方案名称 */
+    @Excel(name = "播放方案名称")
+    private String planName;
+
+    /** 循环方式:loop循环播放,once播放一次 */
+    @Excel(name = "循环方式:loop循环播放,once播放一次")
+    private String loopMode;
+
+
+    /** 素材数量 */
+    @Excel(name = "素材数量")
+    private Long assetCount;
+
+    /** 启用状态:0备用/停用,1当前播放*/
+    @Excel(name = "0备用/停用,1当前播放")
+    private String status;
+
+    /** 播放方案素材明细信息 */
+    private List<RobotOpsPlayPlanItem> robotOpsPlayPlanItemList;
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+
+    public void setPlanName(String planName)
+    {
+        this.planName = planName;
+    }
+
+    public String getPlanName()
+    {
+        return planName;
+    }
+
+    public void setLoopMode(String loopMode)
+    {
+        this.loopMode = loopMode;
+    }
+
+    public String getLoopMode()
+    {
+        return loopMode;
+    }
+
+
+
+    public void setAssetCount(Long assetCount)
+    {
+        this.assetCount = assetCount;
+    }
+
+    public Long getAssetCount()
+    {
+        return assetCount;
+    }
+
+    public void setStatus(String status)
+    {
+        this.status = status;
+    }
+
+    public String getStatus()
+    {
+        return status;
+    }
+
+    public List<RobotOpsPlayPlanItem> getRobotOpsPlayPlanItemList()
+    {
+        return robotOpsPlayPlanItemList;
+    }
+
+    public void setRobotOpsPlayPlanItemList(List<RobotOpsPlayPlanItem> robotOpsPlayPlanItemList)
+    {
+        this.robotOpsPlayPlanItemList = robotOpsPlayPlanItemList;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("planName", getPlanName())
+            .append("loopMode", getLoopMode())
+            .append("assetCount", getAssetCount())
+            .append("status", getStatus())
+            .append("remark", getRemark())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("robotOpsPlayPlanItemList", getRobotOpsPlayPlanItemList())
+            .toString();
+    }
+}

+ 209 - 0
ruoyi-system/src/main/java/com/ruoyi/base/domain/RobotOpsPlayPlanItem.java

@@ -0,0 +1,209 @@
+package com.ruoyi.base.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 播放方案素材明细对象 robot_ops_play_plan_item
+ *
+ * @author ruoyi
+ * @date 2026-05-11
+ */
+public class RobotOpsPlayPlanItem extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键ID */
+    private Long id;
+
+    /** 播放方案ID,关联robot_ops_play_plan.id */
+    @Excel(name = "播放方案ID,关联robot_ops_play_plan.id")
+    private Long planId;
+
+    /** 素材ID,关联robot_ops_media_asset.id */
+    @Excel(name = "素材ID,关联robot_ops_media_asset.id")
+    private Long assetId;
+
+    /** 播放顺序,数字越小越靠前 */
+    @Excel(name = "播放顺序,数字越小越靠前")
+    private Long playOrder;
+
+    /** 停留时长,图片必填,视频可为空 */
+    @Excel(name = "停留时长,图片必填,视频可为空")
+    private Long staySeconds;
+
+    /** 转场方式,预留字段:none无转场,fade淡入淡出 */
+    @Excel(name = "转场方式,预留字段:none无转场,fade淡入淡出")
+    private String transitionType;
+
+
+    /** 素材文件地址 */
+    @Excel(name = "素材文件地址")
+    private String fileUrl;
+
+    /** 素材类型:image图片,video视频 */
+    @Excel(name = "素材类型")
+    private String assetType;
+
+
+    /** 分辨率,如1920x1080 */
+    @Excel(name = "分辨率")
+    private String resolution;
+
+    /** 视频时长,单位秒;图片为空 */
+    @Excel(name = "视频时长")
+    private Long durationSeconds;
+
+
+    /** 素材名称 */
+    @Excel(name = "素材名称")
+    private String assetName;
+
+
+    /** 缩略图地址 */
+    @Excel(name = "缩略图地址")
+    private String thumbnailUrl;
+
+
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setPlanId(Long planId)
+    {
+        this.planId = planId;
+    }
+
+    public Long getPlanId()
+    {
+        return planId;
+    }
+    public void setAssetId(Long assetId)
+    {
+        this.assetId = assetId;
+    }
+
+    public Long getAssetId()
+    {
+        return assetId;
+    }
+    public void setPlayOrder(Long playOrder)
+    {
+        this.playOrder = playOrder;
+    }
+
+    public Long getPlayOrder()
+    {
+        return playOrder;
+    }
+    public void setStaySeconds(Long staySeconds)
+    {
+        this.staySeconds = staySeconds;
+    }
+
+    public Long getStaySeconds()
+    {
+        return staySeconds;
+    }
+    public void setTransitionType(String transitionType)
+    {
+        this.transitionType = transitionType;
+    }
+
+    public String getTransitionType()
+    {
+        return transitionType;
+    }
+
+    public void setFileUrl(String fileUrl)
+    {
+        this.fileUrl = fileUrl;
+    }
+
+    public String getFileUrl()
+    {
+        return fileUrl;
+    }
+
+    public void setAssetType(String assetType)
+    {
+        this.assetType = assetType;
+    }
+
+    public String getAssetType()
+    {
+        return assetType;
+    }
+
+    public void setResolution(String resolution)
+    {
+        this.resolution = resolution;
+    }
+
+    public String getResolution()
+    {
+        return resolution;
+    }
+
+    public void setDurationSeconds(Long durationSeconds)
+    {
+        this.durationSeconds = durationSeconds;
+    }
+
+    public Long getDurationSeconds()
+    {
+        return durationSeconds;
+    }
+
+    public void setAssetName(String assetName)
+    {
+        this.assetName = assetName;
+    }
+
+    public String getAssetName()
+    {
+        return assetName;
+    }
+
+
+    public void setThumbnailUrl(String thumbnailUrl)
+    {
+        this.thumbnailUrl = thumbnailUrl;
+    }
+
+    public String getThumbnailUrl()
+    {
+        return thumbnailUrl;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("planId", getPlanId())
+                .append("assetId", getAssetId())
+                .append("playOrder", getPlayOrder())
+                .append("staySeconds", getStaySeconds())
+                .append("transitionType", getTransitionType())
+                .append("fileUrl", getFileUrl())
+                .append("assetType", getAssetType())
+                .append("assetName", getAssetName())
+                .append("thumbnailUrl", getThumbnailUrl())
+                .append("resolution", getResolution())
+                .append("durationSeconds", getDurationSeconds())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .toString();
+    }
+
+}

+ 114 - 0
ruoyi-system/src/main/java/com/ruoyi/base/mapper/RobotOpsPlayPlanMapper.java

@@ -0,0 +1,114 @@
+package com.ruoyi.base.mapper;
+
+import java.util.List;
+import com.ruoyi.base.domain.RobotOpsPlayPlan;
+import com.ruoyi.base.domain.RobotOpsPlayPlanItem;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 播放方案Mapper接口
+ *
+ * @author ruoyi
+ * @date 2026-05-11
+ */
+public interface RobotOpsPlayPlanMapper
+{
+    /**
+     * 查询播放方案
+     *
+     * @param id 播放方案主键
+     * @return 播放方案
+     */
+    public RobotOpsPlayPlan selectRobotOpsPlayPlanById(Long id);
+
+    /**
+     * 查询播放方案列表
+     *
+     * @param robotOpsPlayPlan 播放方案
+     * @return 播放方案集合
+     */
+    public List<RobotOpsPlayPlan> selectRobotOpsPlayPlanList(RobotOpsPlayPlan robotOpsPlayPlan);
+
+    /**
+     * 新增播放方案
+     *
+     * @param robotOpsPlayPlan 播放方案
+     * @return 结果
+     */
+    public int insertRobotOpsPlayPlan(RobotOpsPlayPlan robotOpsPlayPlan);
+
+    /**
+     * 修改播放方案
+     *
+     * @param robotOpsPlayPlan 播放方案
+     * @return 结果
+     */
+    public int updateRobotOpsPlayPlan(RobotOpsPlayPlan robotOpsPlayPlan);
+
+    /**
+     * 删除播放方案
+     *
+     * @param id 播放方案主键
+     * @return 结果
+     */
+    public int deleteRobotOpsPlayPlanById(Long id);
+
+    /**
+     * 批量删除播放方案
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteRobotOpsPlayPlanByIds(Long[] ids);
+
+    /**
+     * 批量删除播放方案素材明细
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteRobotOpsPlayPlanItemByPlanIds(Long[] ids);
+
+    /**
+     * 批量新增播放方案素材明细
+     *
+     * @param robotOpsPlayPlanItemList 播放方案素材明细列表
+     * @return 结果
+     */
+    public int batchRobotOpsPlayPlanItem(List<RobotOpsPlayPlanItem> robotOpsPlayPlanItemList);
+
+
+    /**
+     * 通过播放方案主键删除播放方案素材明细信息
+     *
+     * @param id 播放方案ID
+     * @return 结果
+     */
+    public int deleteRobotOpsPlayPlanItemByPlanId(Long id);
+
+
+    /**
+     * 查询当前正在播放的方案
+     *
+     * @return 播放方案
+     */
+    public RobotOpsPlayPlan selectCurrentPlayingPlan();
+
+    /**
+     * 根据方案ID查询素材明细列表
+     *
+     * @param planId 播放方案ID
+     * @return 素材明细列表
+     */
+    public List<RobotOpsPlayPlanItem> selectRobotOpsPlayPlanItemListByPlanId(Long planId);
+
+    /**
+     * 更新播放方案状态
+     *
+     * @param id 播放方案ID
+     * @param status 状态
+     * @return 结果
+     */
+    public int updatePlayPlanStatus(@Param("id") Long id, @Param("status") String status);
+
+}

+ 68 - 0
ruoyi-system/src/main/java/com/ruoyi/base/service/IRobotOpsPlayPlanService.java

@@ -0,0 +1,68 @@
+package com.ruoyi.base.service;
+
+import java.util.List;
+import com.ruoyi.base.domain.RobotOpsPlayPlan;
+
+/**
+ * 播放方案Service接口
+ * 
+ * @author ruoyi
+ * @date 2026-05-11
+ */
+public interface IRobotOpsPlayPlanService 
+{
+    /**
+     * 查询播放方案
+     * 
+     * @param id 播放方案主键
+     * @return 播放方案
+     */
+    public RobotOpsPlayPlan selectRobotOpsPlayPlanById(Long id);
+
+    /**
+     * 查询播放方案列表
+     * 
+     * @param robotOpsPlayPlan 播放方案
+     * @return 播放方案集合
+     */
+    public List<RobotOpsPlayPlan> selectRobotOpsPlayPlanList(RobotOpsPlayPlan robotOpsPlayPlan);
+
+    /**
+     * 新增播放方案
+     * 
+     * @param robotOpsPlayPlan 播放方案
+     * @return 结果
+     */
+    public int insertRobotOpsPlayPlan(RobotOpsPlayPlan robotOpsPlayPlan);
+
+    /**
+     * 修改播放方案
+     * 
+     * @param robotOpsPlayPlan 播放方案
+     * @return 结果
+     */
+    public int updateRobotOpsPlayPlan(RobotOpsPlayPlan robotOpsPlayPlan);
+
+    /**
+     * 批量删除播放方案
+     * 
+     * @param ids 需要删除的播放方案主键集合
+     * @return 结果
+     */
+    public int deleteRobotOpsPlayPlanByIds(Long[] ids);
+
+    /**
+     * 删除播放方案信息
+     * 
+     * @param id 播放方案主键
+     * @return 结果
+     */
+    public int deleteRobotOpsPlayPlanById(Long id);
+
+    /**
+     * 查询当前正在播放的方案(包含素材项)
+     * 
+     * @return 播放方案
+     */
+    public RobotOpsPlayPlan selectCurrentPlayingPlanWithItems();
+}

+ 169 - 0
ruoyi-system/src/main/java/com/ruoyi/base/service/impl/RobotOpsPlayPlanServiceImpl.java

@@ -0,0 +1,169 @@
+package com.ruoyi.base.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import java.util.ArrayList;
+import com.ruoyi.common.utils.StringUtils;
+import org.springframework.transaction.annotation.Transactional;
+import com.ruoyi.base.domain.RobotOpsPlayPlanItem;
+import com.ruoyi.base.mapper.RobotOpsPlayPlanMapper;
+import com.ruoyi.base.domain.RobotOpsPlayPlan;
+import com.ruoyi.base.service.IRobotOpsPlayPlanService;
+
+/**
+ * 播放方案Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2026-05-11
+ */
+@Service
+public class RobotOpsPlayPlanServiceImpl implements IRobotOpsPlayPlanService
+{
+    @Autowired
+    private RobotOpsPlayPlanMapper robotOpsPlayPlanMapper;
+
+    /**
+     * 查询播放方案
+     *
+     * @param id 播放方案主键
+     * @return 播放方案
+     */
+    @Override
+    public RobotOpsPlayPlan selectRobotOpsPlayPlanById(Long id)
+    {
+        return robotOpsPlayPlanMapper.selectRobotOpsPlayPlanById(id);
+    }
+
+    /**
+     * 查询播放方案列表
+     *
+     * @param robotOpsPlayPlan 播放方案
+     * @return 播放方案
+     */
+    @Override
+    public List<RobotOpsPlayPlan> selectRobotOpsPlayPlanList(RobotOpsPlayPlan robotOpsPlayPlan)
+    {
+        return robotOpsPlayPlanMapper.selectRobotOpsPlayPlanList(robotOpsPlayPlan);
+    }
+
+    /**
+     * 新增播放方案
+     *
+     * @param robotOpsPlayPlan 播放方案
+     * @return 结果
+     */
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public int insertRobotOpsPlayPlan(RobotOpsPlayPlan robotOpsPlayPlan)
+    {
+        robotOpsPlayPlan.setCreateTime(DateUtils.getNowDate());
+        if ("1".equals(robotOpsPlayPlan.getStatus()))
+        {
+            RobotOpsPlayPlan currentPlayingPlan = robotOpsPlayPlanMapper.selectCurrentPlayingPlan();
+            if (currentPlayingPlan != null)
+            {
+                robotOpsPlayPlanMapper.updatePlayPlanStatus(currentPlayingPlan.getId(), "0");
+            }
+        }
+        int rows = robotOpsPlayPlanMapper.insertRobotOpsPlayPlan(robotOpsPlayPlan);
+        insertRobotOpsPlayPlanItem(robotOpsPlayPlan);
+        return rows;
+    }
+
+    /**
+     * 修改播放方案
+     *
+     * @param robotOpsPlayPlan 播放方案
+     * @return 结果
+     */
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public int updateRobotOpsPlayPlan(RobotOpsPlayPlan robotOpsPlayPlan)
+    {
+        robotOpsPlayPlan.setUpdateTime(DateUtils.getNowDate());
+
+        if ("1".equals(robotOpsPlayPlan.getStatus()))
+        {
+            RobotOpsPlayPlan currentPlayingPlan = robotOpsPlayPlanMapper.selectCurrentPlayingPlan();
+            if (currentPlayingPlan != null && !currentPlayingPlan.getId().equals(robotOpsPlayPlan.getId()))
+            {
+                robotOpsPlayPlanMapper.updatePlayPlanStatus(currentPlayingPlan.getId(), "0");
+            }
+        }
+
+        robotOpsPlayPlanMapper.deleteRobotOpsPlayPlanItemByPlanId(robotOpsPlayPlan.getId());
+        insertRobotOpsPlayPlanItem(robotOpsPlayPlan);
+        return robotOpsPlayPlanMapper.updateRobotOpsPlayPlan(robotOpsPlayPlan);
+    }
+
+
+    /**
+     * 批量删除播放方案
+     *
+     * @param ids 需要删除的播放方案主键
+     * @return 结果
+     */
+    @Transactional
+    @Override
+    public int deleteRobotOpsPlayPlanByIds(Long[] ids)
+    {
+        robotOpsPlayPlanMapper.deleteRobotOpsPlayPlanItemByPlanIds(ids);
+        return robotOpsPlayPlanMapper.deleteRobotOpsPlayPlanByIds(ids);
+    }
+
+    /**
+     * 删除播放方案信息
+     *
+     * @param id 播放方案主键
+     * @return 结果
+     */
+    @Transactional
+    @Override
+    public int deleteRobotOpsPlayPlanById(Long id)
+    {
+        robotOpsPlayPlanMapper.deleteRobotOpsPlayPlanItemByPlanId(id);
+        return robotOpsPlayPlanMapper.deleteRobotOpsPlayPlanById(id);
+    }
+
+    /**
+     * 查询当前正在播放的方案(包含素材项)
+     *
+     * @return 播放方案
+     */
+    @Override
+    public RobotOpsPlayPlan selectCurrentPlayingPlanWithItems()
+    {
+        RobotOpsPlayPlan plan = robotOpsPlayPlanMapper.selectCurrentPlayingPlan();
+        if (plan != null) {
+            List<RobotOpsPlayPlanItem> items = robotOpsPlayPlanMapper.selectRobotOpsPlayPlanItemListByPlanId(plan.getId());
+            plan.setRobotOpsPlayPlanItemList(items);
+        }
+        return plan;
+    }
+
+    /**
+     * 新增播放方案素材明细信息
+     *
+     * @param robotOpsPlayPlan 播放方案对象
+     */
+    public void insertRobotOpsPlayPlanItem(RobotOpsPlayPlan robotOpsPlayPlan)
+    {
+        List<RobotOpsPlayPlanItem> robotOpsPlayPlanItemList = robotOpsPlayPlan.getRobotOpsPlayPlanItemList();
+        Long id = robotOpsPlayPlan.getId();
+        if (StringUtils.isNotNull(robotOpsPlayPlanItemList))
+        {
+            List<RobotOpsPlayPlanItem> list = new ArrayList<RobotOpsPlayPlanItem>();
+            for (RobotOpsPlayPlanItem robotOpsPlayPlanItem : robotOpsPlayPlanItemList)
+            {
+                robotOpsPlayPlanItem.setPlanId(id);
+                list.add(robotOpsPlayPlanItem);
+            }
+            if (list.size() > 0)
+            {
+                robotOpsPlayPlanMapper.batchRobotOpsPlayPlanItem(list);
+            }
+        }
+    }
+}

+ 168 - 0
ruoyi-system/src/main/resources/mapper/base/RobotOpsPlayPlanMapper.xml

@@ -0,0 +1,168 @@
+<?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.ruoyi.base.mapper.RobotOpsPlayPlanMapper">
+
+    <resultMap type="RobotOpsPlayPlan" id="RobotOpsPlayPlanResult">
+        <result property="id"    column="id"    />
+        <result property="planName"    column="plan_name"    />
+        <result property="loopMode"    column="loop_mode"    />
+        <result property="assetCount"    column="asset_count"    />
+        <result property="status"    column="status"    />
+        <result property="remark"    column="remark"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <resultMap id="RobotOpsPlayPlanRobotOpsPlayPlanItemResult" type="RobotOpsPlayPlan" extends="RobotOpsPlayPlanResult">
+        <collection property="robotOpsPlayPlanItemList" ofType="RobotOpsPlayPlanItem" column="id" select="selectRobotOpsPlayPlanItemList" />
+    </resultMap>
+
+    <resultMap type="RobotOpsPlayPlanItem" id="RobotOpsPlayPlanItemResult">
+        <result property="id"    column="id"    />
+        <result property="planId"    column="plan_id"    />
+        <result property="assetId"    column="asset_id"    />
+        <result property="playOrder"    column="play_order"    />
+        <result property="staySeconds"    column="stay_seconds"    />
+        <result property="transitionType"    column="transition_type"    />
+        <result property="fileUrl"    column="file_url"    />
+        <result property="assetType"    column="asset_type"    />
+        <result property="assetName"    column="asset_name"    />
+        <result property="thumbnailUrl"    column="thumbnail_url"    />
+        <result property="resolution"    column="resolution"    />
+        <result property="durationSeconds"    column="duration_seconds"/>
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectRobotOpsPlayPlanVo">
+        select p.id, p.plan_name, p.loop_mode, p.asset_count, p.status, p.remark, p.create_by, p.create_time, p.update_by, p.update_time, count(i.id) as asset_count
+        from robot_ops_play_plan p
+                 left join robot_ops_play_plan_item i on p.id = i.plan_id
+        group by p.id
+    </sql>
+
+    <select id="selectRobotOpsPlayPlanList" parameterType="RobotOpsPlayPlan" resultMap="RobotOpsPlayPlanResult">
+        select p.id, p.plan_name, p.loop_mode, p.status, p.remark, p.create_by, p.create_time, p.update_by, p.update_time, count(i.id) as asset_count
+        from robot_ops_play_plan p
+        left join robot_ops_play_plan_item i on p.id = i.plan_id
+        <where>
+            <if test="planName != null  and planName != ''"> and p.plan_name like concat('%', #{planName}, '%')</if>
+            <if test="loopMode != null  and loopMode != ''"> and p.loop_mode = #{loopMode}</if>
+            <if test="status != null  and status != ''"> and p.status = #{status}</if>
+        </where>
+        group by p.id, p.plan_name, p.loop_mode, p.status, p.remark, p.create_by, p.create_time, p.update_by, p.update_time
+    </select>
+
+    <select id="selectRobotOpsPlayPlanById" parameterType="Long" resultMap="RobotOpsPlayPlanRobotOpsPlayPlanItemResult">
+        select id, plan_name, loop_mode, asset_count, status, remark, create_by, create_time, update_by, update_time
+        from robot_ops_play_plan
+        where id = #{id}
+    </select>
+
+    <select id="selectRobotOpsPlayPlanItemList" resultMap="RobotOpsPlayPlanItemResult">
+        select i.id, i.plan_id, i.asset_id, i.play_order, i.stay_seconds, i.transition_type, a.file_url, a.asset_type, a.asset_name, a.thumbnail_url, a.resolution, a.duration_seconds, i.create_by, i.create_time, i.update_by, i.update_time
+        from robot_ops_play_plan_item i
+                 left join robot_ops_media_asset a on i.asset_id = a.id
+        where i.plan_id = #{plan_id}
+    </select>
+
+    <insert id="insertRobotOpsPlayPlan" parameterType="RobotOpsPlayPlan" useGeneratedKeys="true" keyProperty="id">
+        insert into robot_ops_play_plan
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="planName != null and planName != ''">plan_name,</if>
+            <if test="loopMode != null and loopMode != ''">loop_mode,</if>
+            <if test="assetCount != null">asset_count,</if>
+            <if test="status != null and status != ''">status,</if>
+            <if test="remark != null">remark,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="planName != null and planName != ''">#{planName},</if>
+            <if test="loopMode != null and loopMode != ''">#{loopMode},</if>
+            <if test="assetCount != null">#{assetCount},</if>
+            <if test="status != null and status != ''">#{status},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateRobotOpsPlayPlan" parameterType="RobotOpsPlayPlan">
+        update robot_ops_play_plan
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="planName != null and planName != ''">plan_name = #{planName},</if>
+            <if test="loopMode != null and loopMode != ''">loop_mode = #{loopMode},</if>
+            <if test="assetCount != null">asset_count = #{assetCount},</if>
+            <if test="status != null and status != ''">status = #{status},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteRobotOpsPlayPlanById" parameterType="Long">
+        delete from robot_ops_play_plan where id = #{id}
+    </delete>
+
+    <delete id="deleteRobotOpsPlayPlanByIds" parameterType="String">
+        delete from robot_ops_play_plan where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <delete id="deleteRobotOpsPlayPlanItemByPlanIds" parameterType="String">
+        delete from robot_ops_play_plan_item where plan_id in
+        <foreach item="planId" collection="array" open="(" separator="," close=")">
+            #{planId}
+        </foreach>
+    </delete>
+
+    <delete id="deleteRobotOpsPlayPlanItemByPlanId" parameterType="Long">
+        delete from robot_ops_play_plan_item where plan_id = #{planId}
+    </delete>
+
+
+    <select id="selectCurrentPlayingPlan" resultMap="RobotOpsPlayPlanResult">
+        select id, plan_name, loop_mode, asset_count, status, remark, create_by, create_time, update_by, update_time
+        from robot_ops_play_plan
+        where status = '1'
+            limit 1
+    </select>
+
+    <select id="selectRobotOpsPlayPlanItemListByPlanId" parameterType="Long" resultMap="RobotOpsPlayPlanItemResult">
+        select i.id, i.plan_id, i.asset_id, i.play_order, i.stay_seconds, i.transition_type,
+               a.file_url, a.asset_type, a.asset_name, a.thumbnail_url, a.resolution, a.duration_seconds,
+               i.create_by, i.create_time, i.update_by, i.update_time
+        from robot_ops_play_plan_item i
+        left join robot_ops_media_asset a on i.asset_id = a.id
+        where i.plan_id = #{planId}
+    </select>
+
+    <update id="updatePlayPlanStatus">
+        update robot_ops_play_plan
+        set status = #{status}, update_time = sysdate()
+        where id = #{id}
+    </update>
+
+    <insert id="batchRobotOpsPlayPlanItem">
+        insert into robot_ops_play_plan_item( id, plan_id, asset_id, play_order, stay_seconds, transition_type, create_by, create_time, update_by, update_time) values
+        <foreach item="item" index="index" collection="list" separator=",">
+            ( #{item.id}, #{item.planId}, #{item.assetId}, #{item.playOrder}, #{item.staySeconds}, #{item.transitionType}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime})
+        </foreach>
+    </insert>
+</mapper>