package cn.iocoder.yudao.module.qcreport.service.version;
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.module.qcreport.controller.admin.version.vo.QcReportTemplateVersionPageReqVO;
|
import cn.iocoder.yudao.module.qcreport.controller.admin.version.vo.QcReportTemplateVersionSaveReqVO;
|
import cn.iocoder.yudao.module.qcreport.controller.admin.version.vo.QcReportTemplateVersionUpdateReqVO;
|
import cn.iocoder.yudao.module.qcreport.dal.dataobject.version.QcReportTemplateVersionDO;
|
|
import java.util.List;
|
|
/**
|
* 智能质检报告模板版本 Service 接口
|
*/
|
public interface QcReportTemplateVersionService {
|
|
/**
|
* 创建模板版本
|
*
|
* @param createReqVO 创建信息
|
* @return 版本编号
|
*/
|
Long createVersion(QcReportTemplateVersionSaveReqVO createReqVO);
|
|
/**
|
* 更新模板版本(已发布的版本不允许修改)
|
*
|
* @param updateReqVO 更新信息
|
*/
|
void updateVersion(QcReportTemplateVersionUpdateReqVO updateReqVO);
|
|
/**
|
* 删除模板版本(仅草稿可删除)
|
*
|
* @param id 版本编号
|
*/
|
void deleteVersion(Long id);
|
|
/**
|
* 发布模板版本,并把模板的当前版本号指向它
|
*
|
* @param id 版本编号
|
*/
|
void publishVersion(Long id);
|
|
/**
|
* 回滚:把模板的当前版本号切回指定的历史版本(版本内容不会被修改)
|
*
|
* @param id 版本编号
|
*/
|
void rollbackVersion(Long id);
|
|
/**
|
* 停用模板版本
|
*
|
* @param id 版本编号
|
*/
|
void disableVersion(Long id);
|
|
/**
|
* 校验版本存在,并返回
|
*
|
* @param id 版本编号
|
* @return 版本
|
*/
|
QcReportTemplateVersionDO validateVersionExists(Long id);
|
|
/**
|
* 获得模板版本
|
*
|
* @param id 版本编号
|
* @return 版本
|
*/
|
QcReportTemplateVersionDO getVersion(Long id);
|
|
/**
|
* 获得指定模板的指定版本(要求已发布),供渲染使用
|
*
|
* @param templateId 模板编号
|
* @param version 版本号
|
* @return 版本
|
*/
|
QcReportTemplateVersionDO getPublishedVersion(Long templateId, String version);
|
|
/**
|
* 按「模板编号 + 版本号」取版本,**不要求已发布**,不存在时返回 null。
|
* <p>
|
* 与 {@link #getPublishedVersion} 的分工:那个用于「第一次出件」,必须是已发布版本;
|
* 这个用于「重新生成历史报告」——已发布版本的内容不可改,但状态可能被停用,
|
* 不该因此让一份已经出过的报告变成打不开。
|
*
|
* @param templateId 模板编号
|
* @param version 版本号
|
* @return 版本,不存在时返回 null
|
*/
|
QcReportTemplateVersionDO getVersionByTemplateIdAndVersion(Long templateId, String version);
|
|
/**
|
* 获得模板版本分页
|
*
|
* @param pageReqVO 分页查询
|
* @return 版本分页
|
*/
|
PageResult<QcReportTemplateVersionDO> getVersionPage(QcReportTemplateVersionPageReqVO pageReqVO);
|
|
/**
|
* 获得模板的所有版本
|
*
|
* @param templateId 模板编号
|
* @return 版本列表
|
*/
|
List<QcReportTemplateVersionDO> getVersionListByTemplateId(Long templateId);
|
|
}
|