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 plateMaking = new ArrayList<>(); /** * 工序加工内容 */ @TableField(value = "process_content",typeHandler = JacksonTypeHandler.class) private List processContent = new ArrayList<>(); /** * 材料信息 */ @TableField(value = "material_info",typeHandler = JacksonTypeHandler.class) private List 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; } }