Subversion Repositories SmartDukaan

Rev

Rev 24081 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 24081 Rev 32390
Line 1... Line 1...
1
package com.spice.profitmandi.dao.entity.warehouse;
1
package com.spice.profitmandi.dao.entity.warehouse;
2
 
2
 
3
import java.time.LocalDateTime;
-
 
4
import java.util.Date;
-
 
5
 
-
 
6
import javax.persistence.Column;
3
import javax.persistence.Column;
7
import javax.persistence.Convert;
-
 
8
import javax.persistence.Converter;
-
 
9
import javax.persistence.Entity;
4
import javax.persistence.Entity;
10
import javax.persistence.EnumType;
-
 
11
import javax.persistence.Enumerated;
-
 
12
import javax.persistence.GeneratedValue;
-
 
13
import javax.persistence.GenerationType;
-
 
14
import javax.persistence.Id;
5
import javax.persistence.Id;
15
import javax.persistence.Table;
6
import javax.persistence.Table;
-
 
7
import java.time.LocalDateTime;
-
 
8
import java.util.Objects;
16
 
9
 
17
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
-
 
18
 
-
 
19
import in.shop2020.warehouse.TransferLotStatus;
-
 
20
/**
10
/**
21
 * This class basically contains scheme details
11
 * This class contains PO Approval info
22
 * 
-
 
23
 * @author Govind Kumar
-
 
24
 *
12
 *
-
 
13
 * @author Amit Gupta
25
 */
14
 */
26
@Entity
15
@Entity
27
@Table(name = "warehouse.transferLot", schema = "warehouse")
16
@Table(name = "warehouse.poapproval", schema = "warehouse")
28
public class TransferLot {
17
public class POApproval {
29
 
18
 
30
	@Id
19
    @Id
31
	@Column(name = "id", unique = true, updatable = false)
20
    @Column(name = "poId", unique = true, updatable = false)
32
	@GeneratedValue(strategy = GenerationType.IDENTITY)
21
    private int poId;
33
	private int id;
22
 
34
 
23
    @Column(name = "approvalCode", unique = true, updatable = false)
35
	@Column(name = "originWarehouseId")
24
    private String approvalCode;
36
	private int originWarehouseId;
25
 
37
 
26
 
38
	@Column(name = "destinationWarehouseId")
27
    @Column(name = "createdOn")
39
	private int destinationWarehouseId;
28
    private LocalDateTime createdOn;
40
 
29
 
41
	@Column(name = "status")
30
    @Column(name = "approvedBy")
42
	@Enumerated(EnumType.STRING)
31
    private String approvedBy;
43
	private TransferLotStatus status;
32
 
44
 
33
 
45
	@Convert(converter = LocalDateTimeAttributeConverter.class)
34
    @Column(name = "approvedOn")
46
	@Column(name = "transferDate")
35
    private LocalDateTime approvedOn;
47
	private LocalDateTime transferDate;
36
 
48
 
37
    @Override
49
	@Column(name = "transitCompletionReferenceNumber")
38
    public String toString() {
50
	private String transitCompletionReferenceNumber;
39
        return "POApproval{" +
51
 
40
                "poId=" + poId +
52
	@Convert(converter = LocalDateTimeAttributeConverter.class)
41
                ", approvalCode='" + approvalCode + '\'' +
53
	@Column(name = "referenceUpdationDate")
42
                ", createdOn=" + createdOn +
54
	private LocalDateTime referenceUpdationDate;
43
                ", approvedBy='" + approvedBy + '\'' +
55
 
44
                ", approvedOn=" + approvedOn +
56
	@Column(name = "remarks")
45
                '}';
57
	private String remarks;
46
    }
58
 
47
 
59
	@Column(name = "shipmentReference")
48
    @Override
60
	private int shipmentReference;
49
    public boolean equals(Object o) {
61
 
50
        if (this == o) return true;
62
	public int getId() {
51
        if (o == null || getClass() != o.getClass()) return false;
63
		return id;
52
        POApproval that = (POApproval) o;
64
	}
53
        return poId == that.poId && Objects.equals(approvalCode, that.approvalCode) && Objects.equals(createdOn, that.createdOn) && Objects.equals(approvedBy, that.approvedBy) && Objects.equals(approvedOn, that.approvedOn);
65
 
54
    }
66
	public void setId(int id) {
55
 
67
		this.id = id;
56
    @Override
68
	}
57
    public int hashCode() {
69
 
58
        return Objects.hash(poId, approvalCode, createdOn, approvedBy, approvedOn);
70
	public int getOriginWarehouseId() {
59
    }
71
		return originWarehouseId;
60
 
72
	}
61
    public int getPoId() {
73
 
62
        return poId;
74
	public void setOriginWarehouseId(int originWarehouseId) {
63
    }
75
		this.originWarehouseId = originWarehouseId;
64
 
76
	}
65
    public void setPoId(int poId) {
77
 
66
        this.poId = poId;
78
	public int getDestinationWarehouseId() {
67
    }
79
		return destinationWarehouseId;
68
 
80
	}
69
    public String getApprovalCode() {
81
 
70
        return approvalCode;
82
	public void setDestinationWarehouseId(int destinationWarehouseId) {
71
    }
83
		this.destinationWarehouseId = destinationWarehouseId;
72
 
84
	}
73
    public void setApprovalCode(String approvalCode) {
85
 
74
        this.approvalCode = approvalCode;
86
	public TransferLotStatus getStatus() {
75
    }
87
		return status;
76
 
88
	}
77
    public LocalDateTime getCreatedOn() {
89
 
78
        return createdOn;
90
	public void setStatus(TransferLotStatus status) {
79
    }
91
		this.status = status;
80
 
92
	}
81
    public void setCreatedOn(LocalDateTime createdOn) {
93
 
82
        this.createdOn = createdOn;
94
	public LocalDateTime getTransferDate() {
83
    }
95
		return transferDate;
84
 
96
	}
85
    public String getApprovedBy() {
97
 
86
        return approvedBy;
98
	public void setTransferDate(LocalDateTime transferDate) {
87
    }
99
		this.transferDate = transferDate;
88
 
100
	}
89
    public void setApprovedBy(String approvedBy) {
101
 
90
        this.approvedBy = approvedBy;
102
	public String getTransitCompletionReferenceNumber() {
91
    }
103
		return transitCompletionReferenceNumber;
92
 
104
	}
93
    public LocalDateTime getApprovedOn() {
105
 
94
        return approvedOn;
106
	public void setTransitCompletionReferenceNumber(String transitCompletionReferenceNumber) {
95
    }
107
		this.transitCompletionReferenceNumber = transitCompletionReferenceNumber;
96
 
108
	}
97
    public void setApprovedOn(LocalDateTime approvedOn) {
109
 
98
        this.approvedOn = approvedOn;
110
	public LocalDateTime getReferenceUpdationDate() {
99
    }
111
		return referenceUpdationDate;
-
 
112
	}
-
 
113
 
-
 
114
	public void setReferenceUpdationDate(LocalDateTime referenceUpdationDate) {
-
 
115
		this.referenceUpdationDate = referenceUpdationDate;
-
 
116
	}
-
 
117
 
-
 
118
	public String getRemarks() {
-
 
119
		return remarks;
-
 
120
	}
-
 
121
 
-
 
122
	public void setRemarks(String remarks) {
-
 
123
		this.remarks = remarks;
-
 
124
	}
-
 
125
 
-
 
126
	public int getShipmentReference() {
-
 
127
		return shipmentReference;
-
 
128
	}
-
 
129
 
-
 
130
	public void setShipmentReference(int shipmentReference) {
-
 
131
		this.shipmentReference = shipmentReference;
-
 
132
	}
-
 
133
 
-
 
134
	@Override
-
 
135
	public int hashCode() {
-
 
136
		final int prime = 31;
-
 
137
		int result = 1;
-
 
138
		result = prime * result + destinationWarehouseId;
-
 
139
		result = prime * result + id;
-
 
140
		result = prime * result + originWarehouseId;
-
 
141
		result = prime * result + ((referenceUpdationDate == null) ? 0 : referenceUpdationDate.hashCode());
-
 
142
		result = prime * result + ((remarks == null) ? 0 : remarks.hashCode());
-
 
143
		result = prime * result + shipmentReference;
-
 
144
		result = prime * result + ((status == null) ? 0 : status.hashCode());
-
 
145
		result = prime * result + ((transferDate == null) ? 0 : transferDate.hashCode());
-
 
146
		result = prime * result
-
 
147
				+ ((transitCompletionReferenceNumber == null) ? 0 : transitCompletionReferenceNumber.hashCode());
-
 
148
		return result;
-
 
149
	}
-
 
150
 
-
 
151
	@Override
-
 
152
	public boolean equals(Object obj) {
-
 
153
		if (this == obj)
-
 
154
			return true;
-
 
155
		if (obj == null)
-
 
156
			return false;
-
 
157
		if (getClass() != obj.getClass())
-
 
158
			return false;
-
 
159
		TransferLot other = (TransferLot) obj;
-
 
160
		if (destinationWarehouseId != other.destinationWarehouseId)
-
 
161
			return false;
-
 
162
		if (id != other.id)
-
 
163
			return false;
-
 
164
		if (originWarehouseId != other.originWarehouseId)
-
 
165
			return false;
-
 
166
		if (referenceUpdationDate == null) {
-
 
167
			if (other.referenceUpdationDate != null)
-
 
168
				return false;
-
 
169
		} else if (!referenceUpdationDate.equals(other.referenceUpdationDate))
-
 
170
			return false;
-
 
171
		if (remarks == null) {
-
 
172
			if (other.remarks != null)
-
 
173
				return false;
-
 
174
		} else if (!remarks.equals(other.remarks))
-
 
175
			return false;
-
 
176
		if (shipmentReference != other.shipmentReference)
-
 
177
			return false;
-
 
178
		if (status != other.status)
-
 
179
			return false;
-
 
180
		if (transferDate == null) {
-
 
181
			if (other.transferDate != null)
-
 
182
				return false;
-
 
183
		} else if (!transferDate.equals(other.transferDate))
-
 
184
			return false;
-
 
185
		if (transitCompletionReferenceNumber == null) {
-
 
186
			if (other.transitCompletionReferenceNumber != null)
-
 
187
				return false;
-
 
188
		} else if (!transitCompletionReferenceNumber.equals(other.transitCompletionReferenceNumber))
-
 
189
			return false;
-
 
190
		return true;
-
 
191
	}
-
 
192
 
-
 
193
	@Override
-
 
194
	public String toString() {
-
 
195
		return "TransferLot [id=" + id + ", originWarehouseId=" + originWarehouseId + ", destinationWarehouseId="
-
 
196
				+ destinationWarehouseId + ", status=" + status + ", transferDate=" + transferDate
-
 
197
				+ ", transitCompletionReferenceNumber=" + transitCompletionReferenceNumber + ", referenceUpdationDate="
-
 
198
				+ referenceUpdationDate + ", remarks=" + remarks + ", shipmentReference=" + shipmentReference + "]";
-
 
199
	}
-
 
200
	
-
 
201
	
-
 
202
}
100
}