| @@ -51,6 +51,9 @@ public class TBCode implements Serializable { | |||
| @Column(name = "expired_date") | |||
| private Instant expiredDate; | |||
| @Column(name = "tb_example_stamp_id", insertable = false, updatable = false) | |||
| private Long tbExampleStampId; | |||
| @Column(name = "created_date") | |||
| private Instant createdDate; | |||
| @@ -79,11 +82,12 @@ public class TBCode implements Serializable { | |||
| @OrderBy("id ASC") | |||
| private Set<TBCodeDetails> tbCodeDetails = new HashSet<>(); | |||
| // @ManyToOne(fetch = FetchType.EAGER) | |||
| // @JsonIgnoreProperties("") | |||
| // @JoinColumn(name = "tb_product_label_id") | |||
| // private TBProductLabel tbProductLabel; | |||
| // @ManyToMany | |||
| // @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||
| // @JoinTable(name = "tb_code_stamp", | |||
| // joinColumns = @JoinColumn(name = "tb_code_id"/*, referencedColumnName = "id"*/), | |||
| // inverseJoinColumns = @JoinColumn(name = "tb_example_stamp_id"/*, referencedColumnName = "id"*/)) | |||
| // private Set<TBExampleStamp> tbExampleStamps = new HashSet<>(); | |||
| public Long getId() { | |||
| return id; | |||
| @@ -213,11 +217,20 @@ public class TBCode implements Serializable { | |||
| this.tbCropId = tbCropId; | |||
| } | |||
| // public TBProductLabel getTbProductLabel() { | |||
| // public TBProductLabel getTbProductLabel() { | |||
| // return tbProductLabel; | |||
| // } | |||
| // | |||
| // public void setTbProductLabel(TBProductLabel tbProductLabel) { | |||
| // this.tbProductLabel = tbProductLabel; | |||
| // } | |||
| public Long getTbExampleStampId() { | |||
| return tbExampleStampId; | |||
| } | |||
| public void setTbExampleStampId(Long tbExampleStampId) { | |||
| this.tbExampleStampId = tbExampleStampId; | |||
| } | |||
| } | |||
| @@ -7,7 +7,7 @@ public class TBCodeCreationDTO implements Serializable { | |||
| private Long tBCropId; | |||
| private Long tbProductLabelId; | |||
| private Long tbExampleStampId; | |||
| private String pathImage; | |||
| @@ -57,11 +57,11 @@ public class TBCodeCreationDTO implements Serializable { | |||
| this.expiredDate = expiredDate; | |||
| } | |||
| public Long getTbProductLabelId() { | |||
| return tbProductLabelId; | |||
| public Long getTbExampleStampId() { | |||
| return tbExampleStampId; | |||
| } | |||
| public void setTbProductLabelId(Long tbProductLabelId) { | |||
| this.tbProductLabelId = tbProductLabelId; | |||
| public void setTbExampleStampId(Long tbExampleStampId) { | |||
| this.tbExampleStampId = tbExampleStampId; | |||
| } | |||
| } | |||
| @@ -3,6 +3,7 @@ package vn.azteam.tpf.service.dto; | |||
| import vn.azteam.tpf.domain.TBCodeDetails; | |||
| import vn.azteam.tpf.domain.TBCodeStatusEnum; | |||
| import vn.azteam.tpf.domain.TBCrop; | |||
| import vn.azteam.tpf.domain.TBExampleStamp; | |||
| import java.io.Serializable; | |||
| import java.time.Instant; | |||
| @@ -39,7 +40,7 @@ public class TBCodeDTO implements Serializable { | |||
| private Long deletedById; | |||
| private Long tbProductLabelId; | |||
| private Long tbExampleStampId; | |||
| private Set<TBCodeDetailsDTO> tbCodeDetails = new HashSet<>(); | |||
| @@ -163,11 +164,11 @@ public class TBCodeDTO implements Serializable { | |||
| this.tbCodeDetails = tbCodeDetails; | |||
| } | |||
| public Long getTbProductLabelId() { | |||
| return tbProductLabelId; | |||
| public Long getTbExampleStampId() { | |||
| return tbExampleStampId; | |||
| } | |||
| public void setTbProductLabelId(Long tbProductLabelId) { | |||
| this.tbProductLabelId = tbProductLabelId; | |||
| public void setTbExampleStampId(Long tbExampleStampId) { | |||
| this.tbExampleStampId = tbExampleStampId; | |||
| } | |||
| } | |||
| @@ -151,8 +151,8 @@ public class TBCodeResource { | |||
| tBCodeDTO.setCreatedDate(Instant.now()); | |||
| tBCodeDTO.setCreatedById(currentUser.getUserId()); | |||
| tBCodeDTO.setStatus(TBCodeStatusEnum.NEW); | |||
| if (tBCodeCreationDTO.getTbProductLabelId() != null) { | |||
| tBCodeDTO.setTbProductLabelId(tBCodeCreationDTO.getTbProductLabelId()); | |||
| if (tBCodeCreationDTO.getTbExampleStampId() != null) { | |||
| tBCodeDTO.setTbExampleStampId(tBCodeCreationDTO.getTbExampleStampId()); | |||
| } | |||
| TBCodeDTO result = null; | |||