Subversion Repositories SmartDukaan

Rev

Rev 30278 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 30278 Rev 31238
Line 1... Line 1...
1
package com.spice.profitmandi.web.controller;
1
package com.spice.profitmandi.web.controller;
2
 
2
 
3
import java.sql.Timestamp;
-
 
4
import java.time.DayOfWeek;
-
 
5
import java.time.LocalDate;
-
 
6
import java.time.LocalDateTime;
-
 
7
import java.time.Month;
-
 
8
import java.time.YearMonth;
-
 
9
import java.time.format.DateTimeFormatter;
-
 
10
import java.util.ArrayList;
-
 
11
import java.util.List;
-
 
12
import java.util.Map;
-
 
13
import java.util.Map.Entry;
-
 
14
import java.util.stream.Collectors;
-
 
15
 
-
 
16
import javax.servlet.http.HttpServletRequest;
-
 
17
 
-
 
18
import org.apache.logging.log4j.LogManager;
-
 
19
import org.apache.logging.log4j.Logger;
-
 
20
import org.springframework.beans.factory.annotation.Autowired;
-
 
21
import org.springframework.stereotype.Controller;
-
 
22
import org.springframework.transaction.annotation.Transactional;
-
 
23
import org.springframework.ui.Model;
-
 
24
import org.springframework.web.bind.annotation.PathVariable;
-
 
25
import org.springframework.web.bind.annotation.RequestBody;
-
 
26
import org.springframework.web.bind.annotation.RequestMapping;
-
 
27
import org.springframework.web.bind.annotation.RequestMethod;
-
 
28
 
-
 
29
import com.spice.profitmandi.common.enumuration.FofoType;
3
import com.spice.profitmandi.common.enumuration.FofoType;
30
import com.spice.profitmandi.common.model.CustomRetailer;
4
import com.spice.profitmandi.common.model.CustomRetailer;
31
import com.spice.profitmandi.common.services.fundfina.PartnerUserData;
-
 
32
import com.spice.profitmandi.common.services.fundfina.PreApprovalRequest;
-
 
33
import com.spice.profitmandi.common.services.fundfina.PreApprovalResponse;
-
 
34
import com.spice.profitmandi.common.services.fundfina.PreApprovals;
5
import com.spice.profitmandi.common.services.fundfina.*;
35
import com.spice.profitmandi.common.services.fundfina.PreApprovalsResponse;
-
 
36
import com.spice.profitmandi.common.services.fundfina.PushNotificationRequest;
-
 
37
import com.spice.profitmandi.common.services.fundfina.PushNotificationResponse;
-
 
38
import com.spice.profitmandi.common.services.fundfina.TransactionRequest;
-
 
39
import com.spice.profitmandi.common.services.fundfina.TransactionResponse;
-
 
40
import com.spice.profitmandi.common.services.fundfina.TransactionSummary;
-
 
41
import com.spice.profitmandi.common.services.fundfina.TransactionalData;
-
 
42
import com.spice.profitmandi.dao.entity.dtr.CreditAccount;
6
import com.spice.profitmandi.dao.entity.dtr.CreditAccount;
43
import com.spice.profitmandi.dao.entity.dtr.CreditStatus;
7
import com.spice.profitmandi.dao.entity.dtr.CreditStatus;
44
import com.spice.profitmandi.dao.entity.dtr.Document;
8
import com.spice.profitmandi.dao.entity.dtr.Document;
45
import com.spice.profitmandi.dao.entity.dtr.FundFinaPreApproval;
9
import com.spice.profitmandi.dao.entity.dtr.FundFinaPreApproval;
46
import com.spice.profitmandi.dao.entity.fofo.FofoKyc;
10
import com.spice.profitmandi.dao.entity.fofo.FofoKyc;
Line 48... Line 12...
48
import com.spice.profitmandi.dao.entity.fofo.PartnerOnBoardingPanel;
12
import com.spice.profitmandi.dao.entity.fofo.PartnerOnBoardingPanel;
49
import com.spice.profitmandi.dao.entity.user.User;
13
import com.spice.profitmandi.dao.entity.user.User;
50
import com.spice.profitmandi.dao.enumuration.fofo.Gateway;
14
import com.spice.profitmandi.dao.enumuration.fofo.Gateway;
51
import com.spice.profitmandi.dao.model.UserWalletCountVolumeModel;
15
import com.spice.profitmandi.dao.model.UserWalletCountVolumeModel;
52
import com.spice.profitmandi.dao.model.WalletMinMaxAmountModel;
16
import com.spice.profitmandi.dao.model.WalletMinMaxAmountModel;
53
import com.spice.profitmandi.dao.repository.dtr.CreditAccountRepository;
-
 
54
import com.spice.profitmandi.dao.repository.dtr.DocumentRepository;
17
import com.spice.profitmandi.dao.repository.dtr.*;
55
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
-
 
56
import com.spice.profitmandi.dao.repository.dtr.FundFinaPreApprovalRepository;
-
 
57
import com.spice.profitmandi.dao.repository.dtr.PartnerOnBoardingPanelRepository;
-
 
58
import com.spice.profitmandi.dao.repository.fofo.PartnerDailyInvestmentRepository;
18
import com.spice.profitmandi.dao.repository.fofo.PartnerDailyInvestmentRepository;
59
import com.spice.profitmandi.dao.repository.transaction.UserWalletHistoryRepository;
19
import com.spice.profitmandi.dao.repository.transaction.UserWalletHistoryRepository;
60
import com.spice.profitmandi.dao.repository.user.AddressRepository;
20
import com.spice.profitmandi.dao.repository.user.AddressRepository;
61
import com.spice.profitmandi.dao.repository.user.FofoKycRepository;
21
import com.spice.profitmandi.dao.repository.user.FofoKycRepository;
62
import com.spice.profitmandi.dao.repository.user.UserRepository;
22
import com.spice.profitmandi.dao.repository.user.UserRepository;
63
import com.spice.profitmandi.service.user.RetailerService;
23
import com.spice.profitmandi.service.user.RetailerService;
64
import com.spice.profitmandi.web.util.MVCResponseSender;
24
import com.spice.profitmandi.web.util.MVCResponseSender;
-
 
25
import org.apache.logging.log4j.LogManager;
-
 
26
import org.apache.logging.log4j.Logger;
-
 
27
import org.springframework.beans.factory.annotation.Autowired;
-
 
28
import org.springframework.stereotype.Controller;
-
 
29
import org.springframework.transaction.annotation.Transactional;
-
 
30
import org.springframework.ui.Model;
-
 
31
import org.springframework.web.bind.annotation.PathVariable;
-
 
32
import org.springframework.web.bind.annotation.RequestBody;
-
 
33
import org.springframework.web.bind.annotation.RequestMapping;
-
 
34
import org.springframework.web.bind.annotation.RequestMethod;
-
 
35
 
-
 
36
import javax.servlet.http.HttpServletRequest;
-
 
37
import java.sql.Timestamp;
-
 
38
import java.time.*;
-
 
39
import java.time.format.DateTimeFormatter;
-
 
40
import java.util.ArrayList;
-
 
41
import java.util.List;
-
 
42
import java.util.Map;
-
 
43
import java.util.Map.Entry;
-
 
44
import java.util.stream.Collectors;
65
 
45
 
66
@Controller
46
@Controller
67
@Transactional(rollbackFor = Throwable.class)
47
@Transactional(rollbackFor = Throwable.class)
68
public class FundFinaController {
48
public class FundFinaController {
69
 
49
 
Line 213... Line 193...
213
			tr.setErrCode("401");
193
			tr.setErrCode("401");
214
			tr.setDesc("auth key is not valid");
194
			tr.setDesc("auth key is not valid");
215
 
195
 
216
		}
196
		}
217
 
197
 
218
		model.addAttribute("response", mvcResponseSender.createResponseString(tr));
198
		model.addAttribute("response1", mvcResponseSender.createResponseString(tr));
219
		return "response";
199
		return "response";
220
	}
200
	}
221
 
201
 
222
	@RequestMapping(value = "/fundfina/getUserData/{userId}", method = RequestMethod.GET)
202
	@RequestMapping(value = "/fundfina/getUserData/{userId}", method = RequestMethod.GET)
223
	public String getUserData(HttpServletRequest request, @PathVariable int userId, Model model) throws Exception {
203
	public String getUserData(HttpServletRequest request, @PathVariable int userId, Model model) throws Exception {
Line 262... Line 242...
262
		} else {
242
		} else {
263
			pud.setErrCode("401");
243
			pud.setErrCode("401");
264
			pud.setDesc("auth key is not valid");
244
			pud.setDesc("auth key is not valid");
265
 
245
 
266
		}
246
		}
267
		model.addAttribute("response", mvcResponseSender.createResponseString(pud));
247
		model.addAttribute("response1", mvcResponseSender.createResponseString(pud));
268
 
248
 
269
		return "response";
249
		return "response";
270
 
250
 
271
	}
251
	}
272
 
252
 
Line 349... Line 329...
349
				}
329
				}
350
			}
330
			}
351
 
331
 
352
			par.setPreApprvalsRes(pars);
332
			par.setPreApprvalsRes(pars);
353
 
333
 
354
			model.addAttribute("response", mvcResponseSender.createResponseString(par));
334
			model.addAttribute("response1", mvcResponseSender.createResponseString(par));
355
		} else {
335
		} else {
356
			par.setErrCode("401");
336
			par.setErrCode("401");
357
			par.setDesc("auth key is not valid");
337
			par.setDesc("auth key is not valid");
358
		}
338
		}
359
		return "response";
339
		return "response";
Line 367... Line 347...
367
		logger.info("pushNotificationRequest {}", pushNotificationRequest);
347
		logger.info("pushNotificationRequest {}", pushNotificationRequest);
368
		PushNotificationResponse pnr = new PushNotificationResponse();
348
		PushNotificationResponse pnr = new PushNotificationResponse();
369
		pnr.setRequestRef(String.valueOf(Timestamp.valueOf(LocalDateTime.now()).getTime()));
349
		pnr.setRequestRef(String.valueOf(Timestamp.valueOf(LocalDateTime.now()).getTime()));
370
		pnr.setStatus("success");
350
		pnr.setStatus("success");
371
 
351
 
372
		model.addAttribute("response", mvcResponseSender.createResponseString(pnr));
352
		model.addAttribute("response1", mvcResponseSender.createResponseString(pnr));
373
 
353
 
374
		return "response";
354
		return "response";
375
	}
355
	}
376
 
356
 
377
}
357
}
378
358