package cn.iocoder.yudao.module.qcreport.service.template;
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.module.qcreport.controller.admin.template.vo.QcReportTemplatePageReqVO;
|
import cn.iocoder.yudao.module.qcreport.controller.admin.template.vo.QcReportTemplateSaveReqVO;
|
import cn.iocoder.yudao.module.qcreport.dal.dataobject.template.QcReportTemplateDO;
|
|
import java.util.Collection;
|
import java.util.List;
|
|
/**
|
* 智能质检报告模板 Service 接口
|
*/
|
public interface QcReportTemplateService {
|
|
/**
|
* 创建报告模板
|
*
|
* @param createReqVO 创建信息
|
* @return 模板编号
|
*/
|
Long createTemplate(QcReportTemplateSaveReqVO createReqVO);
|
|
/**
|
* 更新报告模板
|
*
|
* @param updateReqVO 更新信息
|
*/
|
void updateTemplate(QcReportTemplateSaveReqVO updateReqVO);
|
|
/**
|
* 删除报告模板(同时删除其下所有版本)
|
*
|
* @param id 模板编号
|
*/
|
void deleteTemplate(Long id);
|
|
/**
|
* 复制报告模板:复制模板元数据,并把当前最新版本的 Schema 复制为副本的 v1.0 草稿
|
*
|
* @param id 被复制的模板编号
|
* @return 新模板编号
|
*/
|
Long copyTemplate(Long id);
|
|
/**
|
* 校验模板存在,并返回
|
*
|
* @param id 模板编号
|
* @return 模板
|
*/
|
QcReportTemplateDO validateTemplateExists(Long id);
|
|
/**
|
* 获得报告模板
|
*
|
* @param id 模板编号
|
* @return 模板
|
*/
|
QcReportTemplateDO getTemplate(Long id);
|
|
/**
|
* 获得报告模板分页
|
*
|
* @param pageReqVO 分页查询
|
* @return 模板分页
|
*/
|
PageResult<QcReportTemplateDO> getTemplatePage(QcReportTemplatePageReqVO pageReqVO);
|
|
/**
|
* 获得模板列表
|
*
|
* @param ids 模板编号集合
|
* @return 模板列表
|
*/
|
List<QcReportTemplateDO> getTemplateList(Collection<Long> ids);
|
|
/**
|
* 获得「可用于出件」的模板列表:指定报告类型、模板已启用、且当前版本处于已发布状态。
|
* <p>
|
* 供质检单「出报告」弹窗选模板用。多查这一层版本状态,是为了不把
|
* 「选出来必然被拒」的模板摆到用户面前——模板的 current_version 可能指向一个已停用的版本,
|
* 停用版本不会清空 current_version,这种模板一旦被选,出件必报 1_070_101_003。
|
*
|
* @param reportType 报告类型,即 mes_qc_type 的数值字符串,如 "1"
|
* @return 可用模板列表
|
*/
|
List<QcReportTemplateDO> getSelectableTemplates(String reportType);
|
|
/**
|
* 更新模板的当前版本号
|
*
|
* @param id 模板编号
|
* @param version 版本号
|
*/
|
void updateCurrentVersion(Long id, String version);
|
|
}
|