@Entity @ApiModel(value = "ClearOrder", description = "清关单据对象") @Table(name = "orde_clear_order") @DynamicInsert @DynamicUpdate @Data public class ClearOrder extends BaseEntity { public static final String TABLE_NAME = "orde_clear_order"; @ApiModelProperty(name = "insideNo", value = "订单号") @Column(name = "inside_no", nullable = true, length = 50) private String insideNo; @ApiModelProperty(name = "deliveryNo", value = "国外派送单号") @Column(name = "delivery_no", nullable = true, length = 50) private String deliveryNo; @ApiModelProperty(name = "shipper", value = "发货人信息(地址/姓名/电话)") @Column(name = "shipper", nullable = true, length = 200) private String shipper; @ApiModelProperty(name = "consignee", value = "收件人信息(地址/姓名/电话)") @Column(name = "consignee", nullable = true, length = 200) private String consignee; @ApiModelProperty(name = "originName", value = "出发地名称") @Column(name = "origin_name", nullable = true, length = 255) private String originName; @ApiModelProperty(name = "originNo", value = "出发地编码") @Column(name = "origin_no", nullable = true, length = 50) private String originNo; @ApiModelProperty(name = "destinationName", value = "目的国名称") @Column(name = "destination_name", nullable = true, length = 255) private String destinationName; @ApiModelProperty(name = "destinationNo", value = "目的国编码") @Column(name = "destination_no", nullable = true, length = 50) private String destinationNo; @ApiModelProperty(name = "invoiceDate", value = "发票日期") @Column(name = "invoice_date", nullable = true, length = 50) @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date invoiceDate; @ApiModelProperty(name = "invoiceNumber", value = "发票号码") @Column(name = "invoice_number", nullable = true, length = 50) private String invoiceNumber; @ApiModelProperty(name = "remarks", value = "订单备注") @Column(name = "remarks", nullable = true, length = 255) private String remarks; @ApiModelProperty(name = "totalCbm", value = "体积总计(立方米)") @Column(name = "total_cbm", nullable = true, length = 10) private Float totalCbm; @ApiModelProperty(name = "status", value = "订单状态") @Column(name = "status", nullable = true, length = 10) @Enumerated(value = EnumType.STRING) private ClearOrderStatusEnum status; @ApiModelProperty(name = "boxList", value = "箱子集合") @OneToMany(cascade = CascadeType.ALL,fetch = FetchType.LAZY) @JoinColumn(name="clear_order_id",referencedColumnName = "id") private List<ClearBox> boxList; @ApiModelProperty(name = "goodsList", value = "货物集合") @OneToMany(cascade = CascadeType.ALL,fetch = FetchType.LAZY) @JoinColumn(name="clear_order_id",referencedColumnName = "id") @FieldSerializer.Optional("ignore") private List<ClearGoods> goodsList; }
2.
@Entity @ApiModel(value = "ClearGoods", description = "物品对象") @Table(name = "orde_clear_goods") @DynamicInsert @DynamicUpdate @Data public class ClearGoods extends BaseEntity { public static final String TABLE_NAME = "orde_clear_goods"; /*@ApiModelProperty(name = "clearOrderId", value = "清关单据ID") @Column(name = "clear_order_id", nullable = true, length = 32) private String clearOrderId;*/ @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "clear_order_id", nullable = false) @FieldSerializer.Optional("ignore") private ClearOrder clearOrder; @ApiModelProperty(name = "markNumbers", value = "编号(一般为空)") @Column(name = "mark_numbers", nullable = true, length = 32) private String markNumbers; @ApiModelProperty(name = "description", value = "描述") @Column(name = "description", nullable = true, length = 255) private String description; @ApiModelProperty(name = "quantity", value = "货物数量") @Column(name = "quantity", nullable = true, length = 10) private Integer quantity; @ApiModelProperty(name = "unitPrice", value = "货物单价") @Column(name = "unit_price", nullable = true, columnDefinition = "decimal(17,2) default '0.00'") private BigDecimal unitPrice; @ApiModelProperty(name = "amount", value = "货物总价") @Column(name = "amount", nullable = true, columnDefinition = "decimal(17,2) default '0.00'") private BigDecimal amount; }