Subversion Repositories SmartDukaan

Rev

Rev 35360 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35360 Rev 35499
Line 2... Line 2...
2
 
2
 
3
import com.spice.profitmandi.common.model.ProfitMandiConstants;
3
import com.spice.profitmandi.common.model.ProfitMandiConstants;
4
 
4
 
5
import javax.persistence.*;
5
import javax.persistence.*;
6
import java.time.LocalDateTime;
6
import java.time.LocalDateTime;
-
 
7
import java.util.List;
7
import java.util.Objects;
8
import java.util.Objects;
-
 
9
import java.util.stream.Collectors;
8
 
10
 
9
@Entity
11
@Entity
10
@Table(name = "fofo.trial_form")
12
@Table(name = "fofo.trial_form")
11
public class TrialForm {
13
public class TrialForm {
12
 
14
 
Line 31... Line 33...
31
    private Integer panDocumentId;
33
    private Integer panDocumentId;
32
 
34
 
33
    @Column(name = "aadhaar_document_id", nullable = false)
35
    @Column(name = "aadhaar_document_id", nullable = false)
34
    private Integer aadhaarDocumentId;
36
    private Integer aadhaarDocumentId;
35
 
37
 
-
 
38
    @Transient
-
 
39
    private List<Integer> shopImageDocumentIds;
-
 
40
 
-
 
41
    @Column(name = "shop_image_document_ids")
-
 
42
    private String shopImageDocumentIdsStr;
-
 
43
 
-
 
44
 
36
    @Column(name = "gst_number", nullable = false, length = 15)
45
    @Column(name = "gst_number", nullable = false, length = 15)
37
    private String gstNumber;
46
    private String gstNumber;
38
 
47
 
39
    @Column(name = "business_name", nullable = false, length = 200)
48
    @Column(name = "business_name", nullable = false, length = 200)
40
    private String businessName;
49
    private String businessName;
Line 65... Line 74...
65
 
74
 
66
    @Column(name = "status", length = 20)
75
    @Column(name = "status", length = 20)
67
    @Enumerated(EnumType.STRING)
76
    @Enumerated(EnumType.STRING)
68
    private ProfitMandiConstants.Status status;
77
    private ProfitMandiConstants.Status status;
69
 
78
 
-
 
79
    @Column(name = "remark")
-
 
80
    private String remark;
-
 
81
 
-
 
82
 
70
    @Column(name = "created_on")
83
    @Column(name = "created_on")
71
    private LocalDateTime createdOn;
84
    private LocalDateTime createdOn;
72
 
85
 
73
    @Column(name = "updated_on")
86
    @Column(name = "updated_on")
74
    private LocalDateTime updatedOn;
87
    private LocalDateTime updatedOn;
75
 
88
 
76
    public TrialForm() {
89
    public TrialForm() {
77
    }
90
    }
78
 
91
 
79
    public TrialForm(int id, String firstName, String lastName, String email, String mobile, Integer panDocumentId, Integer aadhaarDocumentId, String gstNumber, String businessName, String addressLine1, String addressLine2, String city, String state, String pincode, Integer asmId, Integer bmId, String referByEmail, ProfitMandiConstants.Status status, LocalDateTime createdOn, LocalDateTime updatedOn) {
92
    public TrialForm(int id, String firstName, String lastName, String email, String mobile, Integer panDocumentId, Integer aadhaarDocumentId, String shopImageDocumentIdsStr, String gstNumber, String businessName, String addressLine1, String addressLine2, String city, String state, String pincode, Integer asmId, Integer bmId, String referByEmail, ProfitMandiConstants.Status status, String remark, LocalDateTime createdOn, LocalDateTime updatedOn) {
80
        this.id = id;
93
        this.id = id;
81
        this.firstName = firstName;
94
        this.firstName = firstName;
82
        this.lastName = lastName;
95
        this.lastName = lastName;
83
        this.email = email;
96
        this.email = email;
84
        this.mobile = mobile;
97
        this.mobile = mobile;
85
        this.panDocumentId = panDocumentId;
98
        this.panDocumentId = panDocumentId;
86
        this.aadhaarDocumentId = aadhaarDocumentId;
99
        this.aadhaarDocumentId = aadhaarDocumentId;
-
 
100
        this.shopImageDocumentIdsStr = shopImageDocumentIdsStr;
87
        this.gstNumber = gstNumber;
101
        this.gstNumber = gstNumber;
88
        this.businessName = businessName;
102
        this.businessName = businessName;
89
        this.addressLine1 = addressLine1;
103
        this.addressLine1 = addressLine1;
90
        this.addressLine2 = addressLine2;
104
        this.addressLine2 = addressLine2;
91
        this.city = city;
105
        this.city = city;
Line 93... Line 107...
93
        this.pincode = pincode;
107
        this.pincode = pincode;
94
        this.asmId = asmId;
108
        this.asmId = asmId;
95
        this.bmId = bmId;
109
        this.bmId = bmId;
96
        this.referByEmail = referByEmail;
110
        this.referByEmail = referByEmail;
97
        this.status = status;
111
        this.status = status;
-
 
112
        this.remark = remark;
98
        this.createdOn = createdOn;
113
        this.createdOn = createdOn;
99
        this.updatedOn = updatedOn;
114
        this.updatedOn = updatedOn;
100
    }
115
    }
101
 
116
 
102
    public int getId() {
117
    public int getId() {
Line 257... Line 272...
257
 
272
 
258
    public void setReferByEmail(String referByEmail) {
273
    public void setReferByEmail(String referByEmail) {
259
        this.referByEmail = referByEmail;
274
        this.referByEmail = referByEmail;
260
    }
275
    }
261
 
276
 
-
 
277
 
-
 
278
    public String getRemark() {
-
 
279
        return remark;
-
 
280
    }
-
 
281
 
-
 
282
    public void setRemark(String remark) {
-
 
283
        this.remark = remark;
-
 
284
    }
-
 
285
 
-
 
286
    public List<Integer> getShopImageDocumentIds() {
-
 
287
        if (shopImageDocumentIds != null) {
-
 
288
            return shopImageDocumentIds;
-
 
289
        }
-
 
290
 
-
 
291
        if (shopImageDocumentIdsStr == null || shopImageDocumentIdsStr.isEmpty()) {
-
 
292
            return null;
-
 
293
        }
-
 
294
 
-
 
295
        return java.util.Arrays.stream(shopImageDocumentIdsStr.split(","))
-
 
296
                .map(Integer::parseInt)
-
 
297
                .collect(Collectors.toList());
-
 
298
    }
-
 
299
 
-
 
300
 
-
 
301
    public void setShopImageDocumentIds(List<Integer> shopImageDocumentIds) {
-
 
302
        this.shopImageDocumentIds = shopImageDocumentIds;
-
 
303
        this.shopImageDocumentIdsStr = shopImageDocumentIds == null
-
 
304
                ? null
-
 
305
                : shopImageDocumentIds.stream()
-
 
306
                .map(String::valueOf)
-
 
307
                .collect(Collectors.joining(","));
-
 
308
    }
-
 
309
 
-
 
310
    public String getShopImageDocumentIdsStr() {
-
 
311
        return shopImageDocumentIdsStr;
-
 
312
    }
-
 
313
 
-
 
314
 
262
    @Override
315
    @Override
263
    public String toString() {
316
    public String toString() {
264
        return "TrialForm{" +
317
        return "TrialForm{" +
265
                "id=" + id +
318
                "id=" + id +
266
                ", firstName='" + firstName + '\'' +
319
                ", firstName='" + firstName + '\'' +
267
                ", lastName='" + lastName + '\'' +
320
                ", lastName='" + lastName + '\'' +
268
                ", email='" + email + '\'' +
321
                ", email='" + email + '\'' +
269
                ", mobile='" + mobile + '\'' +
322
                ", mobile='" + mobile + '\'' +
270
                ", panDocumentId=" + panDocumentId +
323
                ", panDocumentId=" + panDocumentId +
271
                ", aadhaarDocumentId=" + aadhaarDocumentId +
324
                ", aadhaarDocumentId=" + aadhaarDocumentId +
-
 
325
                ", shopImageDocumentIdsStr='" + shopImageDocumentIdsStr + '\'' +
272
                ", gstNumber='" + gstNumber + '\'' +
326
                ", gstNumber='" + gstNumber + '\'' +
273
                ", businessName='" + businessName + '\'' +
327
                ", businessName='" + businessName + '\'' +
274
                ", addressLine1='" + addressLine1 + '\'' +
328
                ", addressLine1='" + addressLine1 + '\'' +
275
                ", addressLine2='" + addressLine2 + '\'' +
329
                ", addressLine2='" + addressLine2 + '\'' +
276
                ", city='" + city + '\'' +
330
                ", city='" + city + '\'' +
Line 278... Line 332...
278
                ", pincode='" + pincode + '\'' +
332
                ", pincode='" + pincode + '\'' +
279
                ", asmId=" + asmId +
333
                ", asmId=" + asmId +
280
                ", bmId=" + bmId +
334
                ", bmId=" + bmId +
281
                ", referByEmail='" + referByEmail + '\'' +
335
                ", referByEmail='" + referByEmail + '\'' +
282
                ", status=" + status +
336
                ", status=" + status +
-
 
337
                ", remark='" + remark + '\'' +
283
                ", createdOn=" + createdOn +
338
                ", createdOn=" + createdOn +
284
                ", updatedOn=" + updatedOn +
339
                ", updatedOn=" + updatedOn +
285
                '}';
340
                '}';
286
    }
341
    }
287
 
342
 
288
    @Override
343
    @Override
289
    public boolean equals(Object o) {
344
    public boolean equals(Object o) {
290
        if (o == null || getClass() != o.getClass()) return false;
345
        if (o == null || getClass() != o.getClass()) return false;
291
        TrialForm trialForm = (TrialForm) o;
346
        TrialForm trialForm = (TrialForm) o;
292
        return id == trialForm.id && Objects.equals(firstName, trialForm.firstName) && Objects.equals(lastName, trialForm.lastName) && Objects.equals(email, trialForm.email) && Objects.equals(mobile, trialForm.mobile) && Objects.equals(panDocumentId, trialForm.panDocumentId) && Objects.equals(aadhaarDocumentId, trialForm.aadhaarDocumentId) && Objects.equals(gstNumber, trialForm.gstNumber) && Objects.equals(businessName, trialForm.businessName) && Objects.equals(addressLine1, trialForm.addressLine1) && Objects.equals(addressLine2, trialForm.addressLine2) && Objects.equals(city, trialForm.city) && Objects.equals(state, trialForm.state) && Objects.equals(pincode, trialForm.pincode) && Objects.equals(asmId, trialForm.asmId) && Objects.equals(bmId, trialForm.bmId) && Objects.equals(referByEmail, trialForm.referByEmail) && status == trialForm.status && Objects.equals(createdOn, trialForm.createdOn) && Objects.equals(updatedOn, trialForm.updatedOn);
347
        return id == trialForm.id && Objects.equals(firstName, trialForm.firstName) && Objects.equals(lastName, trialForm.lastName) && Objects.equals(email, trialForm.email) && Objects.equals(mobile, trialForm.mobile) && Objects.equals(panDocumentId, trialForm.panDocumentId) && Objects.equals(aadhaarDocumentId, trialForm.aadhaarDocumentId) && Objects.equals(shopImageDocumentIdsStr, trialForm.shopImageDocumentIdsStr) && Objects.equals(gstNumber, trialForm.gstNumber) && Objects.equals(businessName, trialForm.businessName) && Objects.equals(addressLine1, trialForm.addressLine1) && Objects.equals(addressLine2, trialForm.addressLine2) && Objects.equals(city, trialForm.city) && Objects.equals(state, trialForm.state) && Objects.equals(pincode, trialForm.pincode) && Objects.equals(asmId, trialForm.asmId) && Objects.equals(bmId, trialForm.bmId) && Objects.equals(referByEmail, trialForm.referByEmail) && status == trialForm.status && Objects.equals(remark, trialForm.remark) && Objects.equals(createdOn, trialForm.createdOn) && Objects.equals(updatedOn, trialForm.updatedOn);
293
    }
348
    }
294
 
349
 
295
    @Override
350
    @Override
296
    public int hashCode() {
351
    public int hashCode() {
297
        return Objects.hash(id, firstName, lastName, email, mobile, panDocumentId, aadhaarDocumentId, gstNumber, businessName, addressLine1, addressLine2, city, state, pincode, asmId, bmId, referByEmail, status, createdOn, updatedOn);
352
        return Objects.hash(id, firstName, lastName, email, mobile, panDocumentId, aadhaarDocumentId, shopImageDocumentIdsStr, gstNumber, businessName, addressLine1, addressLine2, city, state, pincode, asmId, bmId, referByEmail, status, remark, createdOn, updatedOn);
298
    }
353
    }
299
}
354
}