liyong
2026-05-20 b0bbbf71d1e6ecdbe4abbcc39127f5aac6502f1e
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
package com.ruoyi.production.pojo;
 
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.annotation.*;
 
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
 
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.production.dto.MaterialInfoDto;
import com.ruoyi.production.dto.PlateMakingDto;
import com.ruoyi.production.dto.ProcessContentDto;
import com.ruoyi.production.dto.ProductOrderDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
 
import javax.validation.constraints.NotNull;
 
/**
 * 印刷定印单
 * @TableName production_print_order
 */
@TableName(value ="production_print_order",autoResultMap = true)
@Data
public class ProductionPrintOrder implements Serializable {
    /**
     * 
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
 
    /**
     * 对应的销售订单
     */
    @TableField(value = "sales_ledger_id")
    private Long salesLedgerId;
 
    /**
     * 对应的生产工单
     */
    @TableField(value = "product_order_id")
    private Long productOrderId;
 
    /**
     * 制单日期
     */
    @TableField(value = "print_order_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime printOrderTime;
 
    /**
     * 完成日期
     */
    @TableField(value = "finish_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime finishTime;
 
    /**
     * 编号 应该为sale的合同号
     */
    @TableField(value = "no")
    private String no;
 
    /**
     * 成品尺寸
     */
    @TableField(value = "finished_size")
    private String finishedSize;
 
    /**
     * 介绍信 存在 , 表示多个
     */
    @TableField(value = "introduction_letter")
    private String introductionLetter;
 
    /**
     * 产品名称
     */
    @TableField(value = "product_name")
    private String productName;
 
    /**
     * 产品说明
     */
    @TableField(value = "product_description")
    private String productDescription;
 
    /**
     * 切料尺寸
     */
    @TableField(value = "cut_size")
    private String cutSize;
 
    /**
     * 切料尺寸数量
     */
    @TableField(value = "cut_num")
    private String cutNum;
 
    /**
     * 正数
     */
    @TableField(value = "positive_qty")
    private String positiveQty;
 
    /**
     * 加放数
     */
    @TableField(value = "allowance_qty")
    private String allowanceQty;
 
    /**
     * 制版
     */
    @TableField(value = "plate_making",typeHandler = JacksonTypeHandler.class)
    private List<PlateMakingDto> plateMaking = new ArrayList<>();
 
    /**
     * 工序加工内容
     */
    @TableField(value = "process_content",typeHandler = JacksonTypeHandler.class)
    private List<ProcessContentDto> processContent = new ArrayList<>();
 
    /**
     * 材料信息
     */
    @TableField(value = "material_info",typeHandler = JacksonTypeHandler.class)
    private List<MaterialInfoDto> materialInfo = new ArrayList<>();
 
    /**
     * 工艺要求
     */
    @TableField(value = "process_requirement")
    private String processRequirement;
 
    /**
     * 送货地点
     */
    @TableField(value = "delivery_address")
    private String deliveryAddress;
 
    /**
     * 联系人
     */
    @TableField(value = "contact_name")
    private String contactName;
 
    /**
     * 包装要求
     */
    @TableField(value = "packaging_requirement")
    private String packagingRequirement;
 
    /**
     * 加工后尺寸
     */
    @TableField(value = "post_process_size")
    private String postProcessSize;
 
    /**
     * 订货数量
     */
    @TableField(value = "order_qty")
    private String orderQty;
 
    /**
     * 实际交付数量
     */
    @TableField(value = "actual_delivery_qty")
    private String actualDeliveryQty;
 
    /**
     * 生产部门
     */
    @TableField(value = "production_dept")
    private String productionDept;
 
    /**
     * 技术部
     */
    @TableField(value = "technical_dept")
    private String technicalDept;
 
    /**
     * 库房
     */
    @TableField(value = "warehouse_dept")
    private String warehouseDept;
 
    /**
     * 
     */
    @TableField(value = "create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
 
    /**
     * 
     */
    @TableField(value = "update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
 
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
 
    /**
     *
     */
    @TableField(value = "create_user",fill = FieldFill.INSERT)
    @ApiModelProperty(value="创建人")
    private Integer createUser;
 
    /**
     *
     */
    @TableField(value = "update_user",fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value="更新人")
    private Integer updateUser;
 
    @TableField(value = "create_user_name", fill = FieldFill.INSERT)
    private String createUserName;
 
    @TableField(value = "update_user_name", fill = FieldFill.INSERT_UPDATE)
    private String updateUserName;
 
    /**
     * 小盒数量
     */
    @TableField(value = "small_box_qty")
    private String smallBoxQty;
 
    /**
     * 中盒数量
     */
    @TableField(value = "medium_box_qty")
    private String mediumBoxQty;
 
    /**
     * 成品id
     */
    @TableField(value = "product_model_id")
    private Long productModelId;
 
    /**
     * 切料图示文件id
     */
    @TableField(value = "cutting_file_id")
    private Long cuttingFileId;
 
    /**
     * 客户单位
     */
    @TableField(value = "client_name")
    private String clientName;
 
    /**
     * 切料图示选择 单选
     */
    @TableField(value = "cutting_diagram_checkout")
    private String cuttingDiagramCheckout;
 
 
    public ProductOrderDto convertProductOrderDto(@NotNull ProductOrderDto dto) {
        dto.setCutSize(this.getCutSize());
        dto.setSmallBoxQty(this.getSmallBoxQty());
        dto.setMediumBoxQty(this.getMediumBoxQty());
        // 色数 为工序开数第一个
        if(CollUtil.isNotEmpty(this.processContent)){
            ProcessContentDto processContentDto = BeanUtil.toBean(
                    processContent.get(0),
                    ProcessContentDto.class
            );
            dto.setPrintColorCount(processContentDto.getOpenCount());
        }
        // 备注已经填充到了 ProductOrderDto中无需关心
        return dto;
    }
}