liyong
2026-04-28 ac79dfd8d661dbe166553ff80fbdbfee64e8134e
src/main/java/com/ruoyi/production/pojo/ProductionPrintOrder.java
@@ -1,17 +1,25 @@
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;
/**
 * 印刷定印单
@@ -35,19 +43,23 @@
    /**
     * 对应的生产工单
     */
    @TableField(value = "product_order")
    private Long productOrder;
    @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;
    /**
@@ -108,19 +120,19 @@
     * 制版
     */
    @TableField(value = "plate_making",typeHandler = JacksonTypeHandler.class)
    private List<PlateMakingDto> plateMaking;
    private List<PlateMakingDto> plateMaking = new ArrayList<>();
    /**
     * 工序加工内容
     */
    @TableField(value = "process_content",typeHandler = JacksonTypeHandler.class)
    private List<ProcessContentDto> processContent;
    private List<ProcessContentDto> processContent = new ArrayList<>();
    /**
     * 材料信息
     */
    @TableField(value = "material_info",typeHandler = JacksonTypeHandler.class)
    private List<MaterialInfoDto> materialInfo;
    private List<MaterialInfoDto> materialInfo = new ArrayList<>();
    /**
     * 工艺要求
@@ -186,12 +198,16 @@
     * 
     */
    @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)
@@ -216,4 +232,57 @@
    @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;
    }
}