Subversion Repositories SmartDukaan

Rev

Rev 32903 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
32163 tejbeer 1
package com.spice.profitmandi.dao.model;
2
 
3
import java.time.LocalDate;
33729 ranu 4
import java.util.Objects;
32163 tejbeer 5
 
6
public class VendorPriceCircularModel {
7
 
8
    private int id;;
9
    private int vendorId;
10
    private int catalogId;
11
    private float transferPrice;
12
    private float dealerPrice;
13
    private float mop;
14
    private LocalDate effectedOn;
15
    private String status;
33729 ranu 16
    private float marginPercent;
32163 tejbeer 17
 
18
 
19
    public VendorPriceCircularModel(int id, int vendorId, int catalogId, float transferPrice, float dealerPrice, float mop, LocalDate effectedOn, String status) {
20
        super();
21
        this.id = id;
22
        this.vendorId = vendorId;
23
        this.catalogId = catalogId;
24
        this.transferPrice = transferPrice;
25
        this.dealerPrice = dealerPrice;
26
        this.mop = mop;
27
        this.effectedOn = effectedOn;
28
        this.status = status;
33729 ranu 29
        this.marginPercent = Float.parseFloat((String.format("%.2f", ((dealerPrice - transferPrice) / transferPrice))));
32163 tejbeer 30
    }
31
 
32
 
33
    public int getId() {
34
        return id;
35
    }
36
 
37
 
38
    public void setId(int id) {
39
        this.id = id;
40
    }
41
 
42
 
43
    public int getVendorId() {
44
        return vendorId;
45
    }
46
 
47
 
48
    public void setVendorId(int vendorId) {
49
        this.vendorId = vendorId;
50
    }
51
 
52
 
53
    public int getCatalogId() {
54
        return catalogId;
55
    }
56
 
57
 
58
    public void setCatalogId(int catalogId) {
59
        this.catalogId = catalogId;
60
    }
61
 
62
 
63
    public float getTransferPrice() {
64
        return transferPrice;
65
    }
66
 
67
 
68
    public void setTransferPrice(float transferPrice) {
69
        this.transferPrice = transferPrice;
70
    }
71
 
72
 
73
    public float getDealerPrice() {
74
        return dealerPrice;
75
    }
76
 
77
 
78
    public void setDealerPrice(float dealerPrice) {
79
        this.dealerPrice = dealerPrice;
80
    }
81
 
82
 
83
    public float getMop() {
84
        return mop;
85
    }
86
 
87
 
88
    public void setMop(float mop) {
89
        this.mop = mop;
90
    }
91
 
92
 
93
    public LocalDate getEffectedOn() {
94
        return effectedOn;
95
    }
96
 
97
 
98
    public void setEffectedOn(LocalDate effectedOn) {
99
        this.effectedOn = effectedOn;
100
    }
101
 
102
 
103
    public String getStatus() {
104
        return status;
105
    }
106
 
107
 
108
    public void setStatus(String status) {
109
        this.status = status;
110
    }
111
 
33729 ranu 112
    public float getMarginPercent() {
113
        return marginPercent;
114
    }
32163 tejbeer 115
 
33729 ranu 116
    public void setMarginPercent(float marginPercent) {
117
        this.marginPercent = marginPercent;
118
    }
119
 
32163 tejbeer 120
    @Override
33729 ranu 121
    public boolean equals(Object o) {
122
        if (this == o) return true;
123
        if (o == null || getClass() != o.getClass()) return false;
124
        VendorPriceCircularModel that = (VendorPriceCircularModel) o;
125
        return id == that.id && vendorId == that.vendorId && catalogId == that.catalogId && Float.compare(transferPrice, that.transferPrice) == 0 && Float.compare(dealerPrice, that.dealerPrice) == 0 && Float.compare(mop, that.mop) == 0 && Float.compare(marginPercent, that.marginPercent) == 0 && Objects.equals(effectedOn, that.effectedOn) && Objects.equals(status, that.status);
32163 tejbeer 126
    }
127
 
128
    @Override
33729 ranu 129
    public int hashCode() {
130
        return Objects.hash(id, vendorId, catalogId, transferPrice, dealerPrice, mop, effectedOn, status, marginPercent);
32163 tejbeer 131
    }
132
 
32903 amit.gupta 133
    @Override
134
    public String toString() {
135
        return "VendorPriceCircularModel{" +
136
                "id=" + id +
137
                ", vendorId=" + vendorId +
138
                ", catalogId=" + catalogId +
139
                ", transferPrice=" + transferPrice +
140
                ", dealerPrice=" + dealerPrice +
141
                ", mop=" + mop +
142
                ", effectedOn=" + effectedOn +
143
                ", status='" + status + '\'' +
33729 ranu 144
                ", marginPercent=" + marginPercent +
32903 amit.gupta 145
                '}';
146
    }
32163 tejbeer 147
}