package cn.iocoder.yudao.module.trade.controller.admin.foreign.vo; import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.module.trade.enums.foreign.TradeForeignDeliveryModeEnum; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @Schema(description = "管理后台 - 外贸订单创建/更新 Request VO") @Data public class TradeForeignOrderSaveReqVO { @Schema(description = "编号", example = "1024") private Long id; @Schema(description = "海外客户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "18336") @NotNull(message = "客户不能为空") private Long customerId; @Schema(description = "业务员用户编号", example = "17144") private Long saleUserId; @Schema(description = "订单日期") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime orderTime; @Schema(description = "国别", example = "美国") private String country; @Schema(description = "币种(字典 trade_currency)", example = "USD") @NotEmpty(message = "币种不能为空") private String currency; @Schema(description = "汇率", requiredMode = Schema.RequiredMode.REQUIRED, example = "7.20") @NotNull(message = "汇率不能为空") private BigDecimal exchangeRate; @Schema(description = "出货模式:1-厂区订单直发,2-港口前置备货", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotNull(message = "出货模式不能为空") @InEnum(TradeForeignDeliveryModeEnum.class) private Integer deliveryMode; @Schema(description = "港口(字典 trade_port)", example = "上海港") private String port; @Schema(description = "收汇账期(天)", example = "30") private Integer receiveTerm; @Schema(description = "引用的报价单编号", example = "1024") private Long quotationId; @Schema(description = "引用的报价单号", example = "QT001") private String quotationNo; @Schema(description = "港口前置备货:关联的港口入库批次号", example = "PGB20260916001") private String portBatchCode; @Schema(description = "备注", example = "备注") private String remark; @Schema(description = "附件 blobId 列表") private List blobIds; @Schema(description = "明细列表", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "明细不能为空") private List items; @Schema(description = "外贸订单明细") @Data public static class Item { @Schema(description = "编号", example = "888") private Long id; @Schema(description = "MDM 物料编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "20529") @NotNull(message = "物料编号不能为空") private Long itemId; @Schema(description = "外币单价", requiredMode = Schema.RequiredMode.REQUIRED, example = "10.00") @NotNull(message = "外币单价不能为空") private BigDecimal foreignPrice; @Schema(description = "数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") @NotNull(message = "数量不能为空") private BigDecimal count; @Schema(description = "批次号", example = "B20260916001") private String batchCode; @Schema(description = "备注", example = "备注") private String remark; } }