Subversion Repositories SmartDukaan

Rev

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

Rev 23556 Rev 23574
Line 17... Line 17...
17
import com.spice.profitmandi.common.util.FormattingUtils;
17
import com.spice.profitmandi.common.util.FormattingUtils;
18
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
18
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
19
import com.spice.profitmandi.dao.enumuration.catalog.AmountType;
19
import com.spice.profitmandi.dao.enumuration.catalog.AmountType;
20
 
20
 
21
/**
21
/**
22
 * This class basically contains recharge operator details
22
 * This class basically contains recharge commission details
23
 * 
23
 * 
24
 * @author ashikali
24
 * @author ashikali
25
 *
25
 *
26
 */
26
 */
27
 
27
 
Line 33... Line 33...
33
	
33
	
34
	public RechargeCommission() {
34
	public RechargeCommission() {
35
	}
35
	}
36
	
36
	
37
	@Id
37
	@Id
38
	@Column(name="operator_id", unique=true, updatable=false)
38
	@Column(name="operator_id")
39
	//@GeneratedValue(strategy = GenerationType.IDENTITY)
-
 
40
	private int operatorId;
39
	private int operatorId;
41
	
40
	
-
 
41
	@Id
-
 
42
	@Column(name = "provider_id")
-
 
43
	private int providerId;
-
 
44
	
-
 
45
	@Column(name="amount")
-
 
46
	private float amount;
-
 
47
	
-
 
48
	@Column(name = "amount_type")
-
 
49
	@Enumerated(EnumType.STRING)
-
 
50
	private AmountType amountType;
-
 
51
	
42
	@Column(name="our_commission")
52
	@Column(name="our_commission")
43
	private float ourCommission;
53
	private float ourCommission;
44
	
54
	
45
	@Column(name="our_commission_type")
55
	@Column(name="our_commission_type")
46
	@Enumerated(EnumType.STRING)
56
	@Enumerated(EnumType.STRING)
47
	private AmountType ourCommissionType;
57
	private AmountType ourCommissionType;
48
	
58
	
-
 
59
	@Convert(converter = LocalDateTimeAttributeConverter.class)
-
 
60
	@Column(name="create_timestamp", updatable = false)
-
 
61
	private LocalDateTime createTimestamp = LocalDateTime.now();
-
 
62
	
-
 
63
	@Convert(converter = LocalDateTimeAttributeConverter.class)
-
 
64
	@Column(name="update_timestamp", updatable = false)
-
 
65
	@UpdateTimestamp
-
 
66
	private LocalDateTime updateTimestamp = LocalDateTime.now();
-
 
67
	
49
	public float getOurCommission() {
68
	public float getOurCommission() {
50
		return ourCommission;
69
		return ourCommission;
51
	}
70
	}
52
 
71
 
53
	public void setOurCommission(float ourCommission) {
72
	public void setOurCommission(float ourCommission) {
Line 59... Line 78...
59
	}
78
	}
60
 
79
 
61
	public void setOurCommissionType(AmountType ourCommissionType) {
80
	public void setOurCommissionType(AmountType ourCommissionType) {
62
		this.ourCommissionType = ourCommissionType;
81
		this.ourCommissionType = ourCommissionType;
63
	}
82
	}
64
 
-
 
65
	@Column(name="amount")
-
 
66
	private float amount;
-
 
67
	
-
 
68
	@Column(name = "amount_type")
-
 
69
	@Enumerated(EnumType.STRING)
-
 
70
	private AmountType amountType;
-
 
71
	
83
	
72
	public String getFormattedAmount() {
84
	public String getFormattedAmount() {
73
		return FormattingUtils.formatDecimalTwoDigits(this.getAmount());
85
		return FormattingUtils.formatDecimalTwoDigits(this.getAmount());
74
	}
86
	}
75
	
-
 
76
	@Convert(converter = LocalDateTimeAttributeConverter.class)
-
 
77
	@Column(name="create_timestamp", updatable = false)
-
 
78
	private LocalDateTime createTimestamp = LocalDateTime.now();
-
 
79
	
-
 
80
	@Convert(converter = LocalDateTimeAttributeConverter.class)
-
 
81
	@Column(name="update_timestamp", updatable = false)
-
 
82
	@UpdateTimestamp
-
 
83
	private LocalDateTime updateTimestamp = LocalDateTime.now();
-
 
84
 
87
 
85
	public int getOperatorId() {
88
	public int getOperatorId() {
86
		return operatorId;
89
		return operatorId;
87
	}
90
	}
88
	
91
	
89
	public void setOperatorId(int operatorId) {
92
	public void setOperatorId(int operatorId) {
90
		this.operatorId = operatorId;
93
		this.operatorId = operatorId;
91
	}
94
	}
92
	
95
	
-
 
96
	public int getProviderId() {
-
 
97
		return providerId;
-
 
98
	}
-
 
99
	
-
 
100
	public void setProviderId(int providerId) {
-
 
101
		this.providerId = providerId;
-
 
102
	}
-
 
103
	
93
	public float getAmount() {
104
	public float getAmount() {
94
		return amount;
105
		return amount;
95
	}
106
	}
96
	
107
	
97
	public void setAmount(float amount) {
108
	public void setAmount(float amount) {
Line 140... Line 151...
140
 
151
 
141
	@Override
152
	@Override
142
	public int hashCode() {
153
	public int hashCode() {
143
		final int prime = 31;
154
		final int prime = 31;
144
		int result = 1;
155
		int result = 1;
145
		result = prime * result + Float.floatToIntBits(amount);
-
 
146
		result = prime * result + ((amountType == null) ? 0 : amountType.hashCode());
-
 
147
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
-
 
148
		result = prime * result + operatorId;
156
		result = prime * result + operatorId;
149
		result = prime * result + Float.floatToIntBits(ourCommission);
157
		result = prime * result + providerId;
150
		result = prime * result + ((ourCommissionType == null) ? 0 : ourCommissionType.hashCode());
-
 
151
		result = prime * result + ((updateTimestamp == null) ? 0 : updateTimestamp.hashCode());
-
 
152
		return result;
158
		return result;
153
	}
159
	}
154
 
160
 
155
	@Override
161
	@Override
156
	public boolean equals(Object obj) {
162
	public boolean equals(Object obj) {
Line 159... Line 165...
159
		if (obj == null)
165
		if (obj == null)
160
			return false;
166
			return false;
161
		if (getClass() != obj.getClass())
167
		if (getClass() != obj.getClass())
162
			return false;
168
			return false;
163
		RechargeCommission other = (RechargeCommission) obj;
169
		RechargeCommission other = (RechargeCommission) obj;
164
		if (Float.floatToIntBits(amount) != Float.floatToIntBits(other.amount))
-
 
165
			return false;
-
 
166
		if (amountType != other.amountType)
-
 
167
			return false;
-
 
168
		if (createTimestamp == null) {
-
 
169
			if (other.createTimestamp != null)
-
 
170
				return false;
-
 
171
		} else if (!createTimestamp.equals(other.createTimestamp))
-
 
172
			return false;
-
 
173
		if (operatorId != other.operatorId)
170
		if (operatorId != other.operatorId)
174
			return false;
171
			return false;
175
		if (Float.floatToIntBits(ourCommission) != Float.floatToIntBits(other.ourCommission))
-
 
176
			return false;
-
 
177
		if (ourCommissionType != other.ourCommissionType)
172
		if (providerId != other.providerId)
178
			return false;
-
 
179
		if (updateTimestamp == null) {
-
 
180
			if (other.updateTimestamp != null)
-
 
181
				return false;
-
 
182
		} else if (!updateTimestamp.equals(other.updateTimestamp))
-
 
183
			return false;
173
			return false;
184
		return true;
174
		return true;
185
	}
175
	}
186
 
176
 
187
	@Override
177
	@Override
188
	public String toString() {
178
	public String toString() {
189
		return "RechargeCommission [operatorId=" + operatorId + ", ourCommission=" + ourCommission
179
		return "RechargeCommission [operatorId=" + operatorId + ", providerId=" + providerId + ", amount=" + amount
190
				+ ", ourCommissionType=" + ourCommissionType + ", amount=" + amount + ", amountType=" + amountType
180
				+ ", amountType=" + amountType + ", ourCommission=" + ourCommission + ", ourCommissionType="
191
				+ ", createTimestamp=" + createTimestamp + ", updateTimestamp=" + updateTimestamp + "]";
181
				+ ourCommissionType + ", createTimestamp=" + createTimestamp + ", updateTimestamp=" + updateTimestamp
-
 
182
				+ "]";
192
	}
183
	}
193
        
184
        
194
}
185
}
195
186