package cn.iocoder.yudao.module.mes.service.trace.consumer;
|
|
import cn.iocoder.yudao.module.mes.dal.dataobject.trace.consumer.MesTraceConsumerScanEventDO;
|
|
/**
|
* 消费者扫码访问事件 Service 接口
|
* <p>
|
* 记录公众溯源扫码访问情况。记录失败不得影响溯源查询主流程,故实现层需保证不抛异常。
|
*
|
* @author 超级管理员
|
*/
|
public interface MesTraceConsumerScanEventService {
|
|
/**
|
* 记录一次消费者扫码访问事件
|
*
|
* @param traceCode 扫码原始内容
|
* @param normalizedCode 解析后的追溯码
|
* @param sourceType 入口类型:BAG/PALLET/BATCH
|
* @param batchId 生产批次编号,可空
|
* @param success 是否查询成功
|
* @param errorCode 失败编码,成功传 null
|
* @return 事件记录(含主键与扫码地区);记录失败返回 null
|
*/
|
MesTraceConsumerScanEventDO recordScan(String traceCode, String normalizedCode, String sourceType, Long batchId,
|
boolean success, String errorCode);
|
|
/**
|
* 根据 ID 查询事件(供校验/调试使用)
|
*
|
* @param id 主键
|
* @return 事件
|
*/
|
MesTraceConsumerScanEventDO getEvent(Long id);
|
|
}
|