16 小时以前 b29d86d9ed34fd890eb14cb7a75f6ae4f7148865
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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);
 
}