3 小时以前 6d910029b6c81db0a2b66caa66952781397b153a
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
package cn.iocoder.yudao.module.mes.controller.pub.trace.vo;
 
import cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo.MesWmBatchProcessTraceRespVO;
import cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo.MesWmBatchPurchaseSourceRespVO;
import cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo.MesWmBatchSalesTargetRespVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
 
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
 
/**
 * H5 扫码溯源 - 全程溯源信息 Response VO
 * <p>
 * 以「信息区块」模块化组织,核心信息(品种/批次/人员/质检/入库)始终返回;
 * 采购来源、销售去向、加工流转为可选扩展区块(有数据才非空)。后续新增数据源按同一模式追加区块字段。
 */
@Schema(description = "H5 扫码溯源 - 全程溯源信息 Response VO")
@Data
public class MesProTracePublicRespVO {
 
    @Schema(description = "追溯入口类型:BAG-袋码 / PALLET-托盘码 / BATCH-批次码", example = "BAG")
    private String sourceType;
 
    @Schema(description = "请求的追溯码(原始扫码值)", example = "PC20260828twoITEM_001")
    private String requestCode;
 
    // ====== 品种信息区块 ======
    @Schema(description = "品种编码")
    private String itemCode;
 
    @Schema(description = "品种名称")
    private String itemName;
 
    @Schema(description = "品种规格")
    private String itemSpecification;
 
    // ====== 生产批次信息区块 ======
    @Schema(description = "批次号")
    private String batchCode;
 
    @Schema(description = "临时批次码")
    private String tempCode;
 
    @Schema(description = "批次状态", example = "20")
    private Integer batchStatus;
 
    @Schema(description = "批次状态名称", example = "生产中")
    private String batchStatusName;
 
    @Schema(description = "生产日期")
    private LocalDateTime produceDate;
 
    @Schema(description = "产线编码")
    private String lineCode;
 
    @Schema(description = "产线名称")
    private String lineName;
 
    @Schema(description = "责任人用户编号")
    private Long ownerUserId;
 
    @Schema(description = "责任人姓名")
    private String ownerUserName;
 
    @Schema(description = "计划数量")
    private BigDecimal planQuantity;
 
    @Schema(description = "已生成袋码数量")
    private Integer bagQuantity;
 
    @Schema(description = "已生成托盘数量")
    private Integer palletQuantity;
 
    @Schema(description = "入库时间")
    private LocalDateTime inboundTime;
 
    @Schema(description = "备注")
    private String remark;
 
    // ====== 生产人员区块 ======
    @Schema(description = "生产人员列表")
    private List<WorkerVO> workers;
 
    // ====== 托盘区块 ======
    @Schema(description = "托盘总数")
    private Integer palletCount;
 
    @Schema(description = "托盘列表")
    private List<PalletVO> pallets;
 
    // ====== 袋码区块 ======
    @Schema(description = "袋码总数")
    private Long bagTotal;
 
    @Schema(description = "袋码列表(最多 100 条)")
    private List<BagVO> bags;
 
    // ====== 入库事件区块 ======
    @Schema(description = "最新入库事件")
    private InboundVO inbound;
 
    // ====== 质检信息区块 ======
    @Schema(description = "种子质检信息")
    private QualityVO quality;
 
    // ====== 可选扩展区块(有数据才返回,空表返回空列表) ======
    @Schema(description = "采购来源(可选)")
    private List<MesWmBatchPurchaseSourceRespVO> purchaseSources;
 
    @Schema(description = "销售去向(可选)")
    private List<MesWmBatchSalesTargetRespVO> salesTargets;
 
    @Schema(description = "加工流转(可选)")
    private List<MesWmBatchProcessTraceRespVO> processTraces;
 
    @Schema(description = "生产人员")
    @Data
    public static class WorkerVO {
        @Schema(description = "岗位类型", example = "20")
        private Integer workerType;
        @Schema(description = "岗位类型名称", example = "操作工")
        private String workerTypeName;
        @Schema(description = "姓名")
        private String userName;
        @Schema(description = "备注")
        private String remark;
    }
 
    @Schema(description = "托盘信息")
    @Data
    public static class PalletVO {
        @Schema(description = "托盘码")
        private String code;
        @Schema(description = "托盘序号")
        private Integer palletNo;
        @Schema(description = "已装袋数")
        private Integer bagCount;
        @Schema(description = "可装袋数")
        private Integer capacity;
    }
 
    @Schema(description = "袋码信息")
    @Data
    public static class BagVO {
        @Schema(description = "袋码")
        private String code;
        @Schema(description = "袋序号")
        private Integer bagNo;
        @Schema(description = "绑定托盘码")
        private String palletCode;
        @Schema(description = "状态", example = "20")
        private Integer status;
        @Schema(description = "状态名称", example = "已导出印刷")
        private String statusName;
        @Schema(description = "入库时间")
        private LocalDateTime inboundTime;
    }
 
    @Schema(description = "入库事件")
    @Data
    public static class InboundVO {
        @Schema(description = "事件号")
        private String eventId;
        @Schema(description = "设备编码")
        private String deviceCode;
        @Schema(description = "产线编码")
        private String lineCode;
        @Schema(description = "入库数量")
        private BigDecimal quantity;
        @Schema(description = "状态", example = "1")
        private String status;
        @Schema(description = "事件时间")
        private LocalDateTime eventTime;
    }
 
    @Schema(description = "种子质检信息")
    @Data
    public static class QualityVO {
        @Schema(description = "质检结果", example = "1")
        private Integer result;
        @Schema(description = "质检结果名称", example = "合格")
        private String resultName;
        @Schema(description = "不合格原因")
        private String reason;
        @Schema(description = "检验员姓名")
        private String inspectorName;
        @Schema(description = "检验时间")
        private LocalDateTime inspectedAt;
        @Schema(description = "质检指标列表")
        private List<IndicatorVO> indicators;
    }
 
    @Schema(description = "质检指标")
    @Data
    public static class IndicatorVO {
        @Schema(description = "指标编码", example = "purity")
        private String indicatorCode;
        @Schema(description = "指标名称", example = "纯度")
        private String indicatorName;
        @Schema(description = "检测值")
        private BigDecimal value;
        @Schema(description = "下限")
        private BigDecimal minValue;
        @Schema(description = "上限")
        private BigDecimal maxValue;
        @Schema(description = "是否合格")
        private Boolean pass;
    }
 
}