Subversion Repositories SmartDukaan

Rev

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

Rev 28854 Rev 28900
Line 1... Line 1...
1
package com.spice.profitmandi.dao.model;
1
package com.spice.profitmandi.dao.model;
2
 
2
 
3
import java.time.LocalDate;
3
import java.time.LocalDate;
4
import java.time.LocalDateTime;
4
import java.time.LocalDateTime;
-
 
5
import java.util.Arrays;
-
 
6
import java.util.List;
5
 
7
 
6
import org.apache.logging.log4j.LogManager;
8
import org.apache.logging.log4j.LogManager;
7
import org.apache.logging.log4j.Logger;
9
import org.apache.logging.log4j.Logger;
8
 
10
 
9
import com.spice.profitmandi.dao.enumuration.fofo.ApplicableServiceType;
11
import com.spice.profitmandi.dao.enumuration.fofo.ApplicableServiceType;
Line 26... Line 28...
26
	private LocalDateTime deploymentDate;
28
	private LocalDateTime deploymentDate;
27
	private LocalDateTime payDate;
29
	private LocalDateTime payDate;
28
 
30
 
29
	private static final Logger LOGGER = LogManager.getLogger(FinanceServicesModel.class);
31
	private static final Logger LOGGER = LogManager.getLogger(FinanceServicesModel.class);
30
 
32
 
-
 
33
	static final List<String> paperFinanceServices = Arrays.asList("SAMSUNG SURE", "BAJAJ FINSERV", "HOME CREDIT",
-
 
34
			"HDB", "CAPITAL FIRST");
-
 
35
 
31
	public boolean getServiceStatusByCodeTimeStamp() throws NullPointerException {
36
	public boolean getServiceStatusByCodeTimeStamp() throws NullPointerException {
32
 
37
 
33
		LOGGER.info("thisName" + this.getName());
38
		LOGGER.info("thisName" + this.getName());
34
		LOGGER.info("fofoThis" + this.getFofoId());
39
		LOGGER.info("fofoThis" + this.getFofoId());
35
 
40
 
Line 74... Line 79...
74
				LOGGER.info("MONEYTrue");
79
				LOGGER.info("MONEYTrue");
75
				return true;
80
				return true;
76
			}
81
			}
77
 
82
 
78
			else {
83
			else {
79
				
-
 
80
				return false;
-
 
81
			}
-
 
82
 
84
 
83
		}
-
 
84
 
-
 
85
		else if (this.getName().equals("SAMSUNG SURE")) {
-
 
86
			LocalDateTime minDate = null;
-
 
87
			LocalDateTime currDate = LocalDate.now().atStartOfDay();
-
 
88
			if (this.getDeploymentDate() != null && this.getPayDate() != null) {
-
 
89
				minDate = this.getDeploymentDate().isBefore(this.getPayDate()) ? this.getDeploymentDate() : this.getPayDate();
-
 
90
				
-
 
91
				
-
 
92
				if (currDate.isBefore(minDate)) {
-
 
93
					LOGGER.info("MONEYTrue");
-
 
94
					return true;
-
 
95
				}
-
 
96
 
-
 
97
				else {
-
 
98
					
-
 
99
					return false;
-
 
100
				}
-
 
101
			
-
 
102
			}
-
 
103
			else if (this.getPayDate() == null  && this.getPayDate() == null) {
-
 
104
				
-
 
105
				return false;
85
				return false;
106
			}
86
			}
107
			
-
 
108
			
-
 
109
			else if (this.getPayDate() == null) {
-
 
110
				minDate = this.getDeploymentDate();
-
 
111
				if (currDate.isBefore(minDate)) {
-
 
112
					LOGGER.info("MONEYTrue");
-
 
113
					return true;
-
 
114
				}
-
 
115
 
-
 
116
				else {
-
 
117
					
-
 
118
					return false;
-
 
119
				}
-
 
120
			}
-
 
121
			else {
-
 
122
				minDate = this.getPayDate();
-
 
123
				if (currDate.isBefore(minDate)) {
-
 
124
					LOGGER.info("MONEYTrue");
-
 
125
					return true;
-
 
126
				}
-
 
127
 
87
 
128
				else {
-
 
129
					
-
 
130
					return false;
-
 
131
				}
-
 
132
			}
-
 
133
		}
88
		}
134
		else if (this.getName().equals("BAJAJ FINSERV")) {
-
 
135
			LocalDateTime minDate = null;
-
 
136
			LocalDateTime currDate = LocalDate.now().atStartOfDay();
-
 
137
			if (this.getDeploymentDate() != null && this.getPayDate() != null) {
-
 
138
				minDate = this.getDeploymentDate().isBefore(this.getPayDate()) ? this.getDeploymentDate() : this.getPayDate();
-
 
139
				
-
 
140
				
-
 
141
				if (currDate.isBefore(minDate)) {
-
 
142
					LOGGER.info("MONEYTrue");
-
 
143
					return true;
-
 
144
				}
-
 
145
 
89
 
146
				else {
-
 
147
					
-
 
148
					return false;
90
		for (String paperFinanceServices : paperFinanceServices) {
149
				}
-
 
150
			
-
 
151
			}
-
 
152
			else if (this.getPayDate() == null  && this.getPayDate() == null) {
91
			if (this.getName().equals(paperFinanceServices)) {
153
				
-
 
154
				return false;
92
				LocalDateTime minDate = null;
155
			}
-
 
156
			
-
 
157
			
-
 
158
			else if (this.getPayDate() == null) {
93
				LocalDateTime currDate = LocalDate.now().atStartOfDay();
159
				minDate = this.getDeploymentDate();
94
				if (this.getDeploymentDate() != null && this.getPayDate() != null) {
160
				if (currDate.isBefore(minDate)) {
95
					minDate = this.getDeploymentDate().isBefore(this.getPayDate()) ? this.getDeploymentDate()
161
					LOGGER.info("MONEYTrue");
96
							: this.getPayDate();
162
					return true;
-
 
163
				}
-
 
164
 
97
 
165
				else {
-
 
166
					
-
 
167
					return false;
-
 
168
				}
-
 
169
			}
-
 
170
			else {
-
 
171
				minDate = this.getPayDate();
-
 
172
				if (currDate.isBefore(minDate)) {
98
					if (currDate.isBefore(minDate)) {
173
					LOGGER.info("MONEYTrue");
99
						LOGGER.info("MONEYTrue");
174
					return true;
100
						return true;
175
				}
101
					}
176
 
102
 
177
				else {
103
					else {
178
					
-
 
179
					return false;
-
 
180
				}
-
 
181
			}
-
 
182
		}
-
 
183
		else if (this.getName().equals("HOME CREDIT")) {
-
 
184
			LocalDateTime minDate = null;
-
 
185
			LocalDateTime currDate = LocalDate.now().atStartOfDay();
-
 
186
			if (this.getDeploymentDate() != null && this.getPayDate() != null) {
-
 
187
				minDate = this.getDeploymentDate().isBefore(this.getPayDate()) ? this.getDeploymentDate() : this.getPayDate();
-
 
188
				
-
 
189
				
-
 
190
				if (currDate.isBefore(minDate)) {
-
 
191
					LOGGER.info("MONEYTrue");
-
 
192
					return true;
-
 
193
				}
-
 
194
 
104
 
195
				else {
-
 
196
					
-
 
197
					return false;
105
						return false;
198
				}
106
					}
199
			
-
 
200
			}
-
 
201
			else if (this.getPayDate() == null  && this.getPayDate() == null) {
-
 
202
				
-
 
203
				return false;
-
 
204
			}
-
 
205
			
-
 
206
			
-
 
207
			else if (this.getPayDate() == null) {
-
 
208
				minDate = this.getDeploymentDate();
-
 
209
				if (currDate.isBefore(minDate)) {
-
 
210
					LOGGER.info("MONEYTrue");
-
 
211
					return true;
-
 
212
				}
-
 
213
 
107
 
214
				else {
-
 
215
					
-
 
216
					return false;
-
 
217
				}
-
 
218
			}
-
 
219
			else {
-
 
220
				minDate = this.getPayDate();
-
 
221
				if (currDate.isBefore(minDate)) {
-
 
222
					LOGGER.info("MONEYTrue");
-
 
223
					return true;
-
 
224
				}
108
				}
225
 
109
 
226
				else {
-
 
227
					
-
 
228
					return false;
-
 
229
				}
-
 
230
			}
-
 
231
		}
-
 
232
		
-
 
233
		else if (this.getName().equals("HDB")) {
-
 
234
			LocalDateTime minDate = null;
-
 
235
			LocalDateTime currDate = LocalDate.now().atStartOfDay();
-
 
236
			if (this.getDeploymentDate() != null && this.getPayDate() != null) {
110
				else if (this.getPayDate() == null && this.getPayDate() == null) {
237
				minDate = this.getDeploymentDate().isBefore(this.getPayDate()) ? this.getDeploymentDate() : this.getPayDate();
-
 
238
				
-
 
239
				
-
 
240
				if (currDate.isBefore(minDate)) {
-
 
241
					LOGGER.info("MONEYTrue");
-
 
242
					return true;
-
 
243
				}
-
 
244
 
111
 
245
				else {
-
 
246
					
-
 
247
					return false;
112
					return false;
248
				}
113
				}
249
			
-
 
250
			}
-
 
251
			else if (this.getPayDate() == null  && this.getPayDate() == null) {
-
 
252
				
-
 
253
				return true;
-
 
254
			}
-
 
255
			
-
 
256
			
-
 
257
			else if (this.getPayDate() == null) {
-
 
258
				minDate = this.getDeploymentDate();
-
 
259
				if (currDate.isBefore(minDate)) {
-
 
260
					LOGGER.info("MONEYTrue");
-
 
261
					return true;
-
 
262
				}
-
 
263
 
114
 
264
				else {
-
 
265
					
-
 
266
					return false;
115
				else if (this.getPayDate() == null) {
267
				}
-
 
268
			}
-
 
269
			else {
-
 
270
				minDate = this.getPayDate();
116
					minDate = this.getDeploymentDate();
271
				if (currDate.isBefore(minDate)) {
117
					if (currDate.isBefore(minDate)) {
272
					LOGGER.info("MONEYTrue");
118
						LOGGER.info("MONEYTrue");
273
					return true;
119
						return true;
274
				}
120
					}
275
 
121
 
276
				else {
122
					else {
277
					
-
 
278
					return false;
-
 
279
				}
-
 
280
			}
-
 
281
		}
-
 
282
		
-
 
283
		else if (this.getName().equals("CAPITAL FIRST")) {
-
 
284
			LocalDateTime minDate = null;
-
 
285
			LocalDateTime currDate = LocalDate.now().atStartOfDay();
-
 
286
			if (this.getDeploymentDate() != null && this.getPayDate() != null) {
-
 
287
				minDate = this.getDeploymentDate().isBefore(this.getPayDate()) ? this.getDeploymentDate() : this.getPayDate();
-
 
288
				
-
 
289
				
-
 
290
				if (currDate.isBefore(minDate)) {
-
 
291
					LOGGER.info("MONEYTrue");
-
 
292
					return true;
-
 
293
				}
-
 
294
 
123
 
295
				else {
-
 
296
					
-
 
297
					return false;
124
						return false;
298
				}
125
					}
299
			
-
 
300
			}
-
 
301
			else if (this.getPayDate() == null  && this.getPayDate() == null) {
-
 
302
				
-
 
303
				return false;
126
				} else {
304
			}
-
 
305
			
-
 
306
			
-
 
307
			else if (this.getPayDate() == null) {
-
 
308
				minDate = this.getDeploymentDate();
127
					minDate = this.getPayDate();
309
				if (currDate.isBefore(minDate)) {
128
					if (currDate.isBefore(minDate)) {
310
					LOGGER.info("MONEYTrue");
129
						LOGGER.info("MONEYTrue");
311
					return true;
130
						return true;
312
				}
131
					}
313
 
132
 
314
				else {
133
					else {
315
					
-
 
316
					return false;
-
 
317
				}
-
 
318
			}
-
 
319
			else {
-
 
320
				minDate = this.getPayDate();
-
 
321
				if (currDate.isBefore(minDate)) {
-
 
322
					LOGGER.info("MONEYTrue");
-
 
323
					return true;
-
 
324
				}
-
 
325
 
134
 
326
				else {
135
						return false;
327
					
136
					}
328
					return false;
-
 
329
				}
137
				}
330
			}
138
			}
-
 
139
 
331
		}
140
		}
332
 
141
 
333
		
-
 
334
		return true;
142
		return true;
335
	}
143
	}
336
 
144
 
337
	public int getFofoId() {
145
	public int getFofoId() {
338
		return fofoId;
146
		return fofoId;
Line 475... Line 283...
475
		this.serviceApplicableType = serviceApplicableType;
283
		this.serviceApplicableType = serviceApplicableType;
476
		this.fofoCode = fofoCode;
284
		this.fofoCode = fofoCode;
477
		this.createTimestamp = createTimestamp;
285
		this.createTimestamp = createTimestamp;
478
	}
286
	}
479
 
287
 
480
	
-
 
481
	
-
 
482
	
-
 
483
	
-
 
484
	
-
 
485
	
-
 
486
	}
-
 
487
288
}
-
 
289
488
290