Subversion Repositories SmartDukaan

Rev

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

Rev 32417 Rev 32438
Line 1... Line 1...
1
package com.spice.profitmandi.dao.model;
1
package com.spice.profitmandi.dao.model;
2
 
2
 
-
 
3
import com.spice.profitmandi.dao.enumuration.fofo.Milestone;
-
 
4
 
3
import java.time.YearMonth;
5
import java.time.YearMonth;
4
import java.time.format.DateTimeFormatter;
6
import java.time.format.DateTimeFormatter;
5
import java.util.Objects;
7
import java.util.Objects;
6
 
8
 
7
public class PartnerMonthlySaleModel {
9
public class PartnerMonthlySaleModel {
8
 
10
 
9
	private int fofoId;
11
	private int fofoId;
10
	private String yearMonth;
12
	private String yearMonth;
11
	private long amount;
13
	private long amount;
12
    private static final DateTimeFormatter yearMonthFormatter = DateTimeFormatter.ofPattern("%m-%Y");
14
	private static final DateTimeFormatter yearMonthFormatter = DateTimeFormatter.ofPattern("MM-yyyy");
-
 
15
	private long pendingAmount;
-
 
16
	private Milestone billedMilestone;
-
 
17
	private String state;
-
 
18
	private String rbms;
13
 
19
 
14
	public PartnerMonthlySaleModel(int fofoId, String yearMonth, long amount) {
20
	public PartnerMonthlySaleModel(int fofoId, String yearMonth, long amount) {
15
		super();
21
		super();
16
		this.fofoId = fofoId;
22
		this.fofoId = fofoId;
17
		this.yearMonth = yearMonth;
23
		this.yearMonth = yearMonth;
Line 20... Line 26...
20
 
26
 
21
    public YearMonth getYearMonthObj() {
27
    public YearMonth getYearMonthObj() {
22
        return YearMonth.parse(this.yearMonth, yearMonthFormatter);
28
        return YearMonth.parse(this.yearMonth, yearMonthFormatter);
23
    }
29
    }
24
 
30
 
-
 
31
	public void setYearMonthObj(YearMonth yearMonth) {
-
 
32
		this.yearMonth = yearMonthFormatter.format(yearMonth);
-
 
33
	}
-
 
34
 
25
	public int getFofoId() {
35
	public int getFofoId() {
26
		return fofoId;
36
		return fofoId;
27
	}
37
	}
28
 
38
 
29
	public void setFofoId(int fofoId) {
39
	public void setFofoId(int fofoId) {
Line 44... Line 54...
44
 
54
 
45
	public void setAmount(long amount) {
55
	public void setAmount(long amount) {
46
		this.amount = amount;
56
		this.amount = amount;
47
	}
57
	}
48
 
58
 
-
 
59
	public long getPendingAmount() {
-
 
60
		return pendingAmount;
-
 
61
	}
-
 
62
 
-
 
63
	public void setPendingAmount(long pendingAmount) {
-
 
64
		this.pendingAmount = pendingAmount;
-
 
65
	}
-
 
66
 
-
 
67
	public String getRbms() {
-
 
68
		return rbms;
-
 
69
	}
-
 
70
 
-
 
71
	public void setRbms(String rbms) {
-
 
72
		this.rbms = rbms;
-
 
73
	}
-
 
74
 
49
	@Override
75
	@Override
50
	public int hashCode() {
76
	public boolean equals(Object o) {
-
 
77
		if (this == o) return true;
-
 
78
		if (o == null || getClass() != o.getClass()) return false;
-
 
79
		PartnerMonthlySaleModel that = (PartnerMonthlySaleModel) o;
51
		return Objects.hash(amount, fofoId, yearMonth);
80
		return fofoId == that.fofoId && amount == that.amount && pendingAmount == that.pendingAmount && Objects.equals(yearMonth, that.yearMonth) && billedMilestone == that.billedMilestone && Objects.equals(state, that.state) && Objects.equals(rbms, that.rbms);
52
	}
81
	}
53
 
82
 
54
	@Override
83
	@Override
55
	public boolean equals(Object obj) {
84
	public int hashCode() {
-
 
85
		return Objects.hash(fofoId, yearMonth, amount, pendingAmount, billedMilestone, state, rbms);
-
 
86
	}
-
 
87
 
56
		if (this == obj)
88
	public Milestone getBilledMilestone() {
57
			return true;
89
		return billedMilestone;
-
 
90
	}
-
 
91
 
58
		if (obj == null)
92
	public void setBilledMilestone(Milestone billedMilestone) {
59
			return false;
93
		this.billedMilestone = billedMilestone;
-
 
94
	}
-
 
95
 
60
		if (getClass() != obj.getClass())
96
	public String getState() {
61
			return false;
97
		return state;
-
 
98
	}
-
 
99
 
62
		PartnerMonthlySaleModel other = (PartnerMonthlySaleModel) obj;
100
	public void setState(String state) {
63
		return amount == other.amount && fofoId == other.fofoId && Objects.equals(yearMonth, other.yearMonth);
101
		this.state = state;
64
	}
102
	}
65
 
103
 
66
	@Override
104
	@Override
67
	public String toString() {
105
	public String toString() {
68
		return "PartnerMonthlySaleModel [fofoId=" + fofoId + ", yearMonth=" + yearMonth + ", amount=" + amount + "]";
106
		return "PartnerMonthlySaleModel{" +
-
 
107
				"fofoId=" + fofoId +
-
 
108
				", yearMonth='" + yearMonth + '\'' +
-
 
109
				", amount=" + amount +
-
 
110
				", pendingAmount=" + pendingAmount +
-
 
111
				", billedMilestone=" + billedMilestone +
-
 
112
				", state='" + state + '\'' +
-
 
113
				'}';
69
	}
114
	}
70
 
-
 
71
}
115
}