| Line 7... |
Line 7... |
| 7 |
import java.util.Map;
|
7 |
import java.util.Map;
|
| 8 |
import java.util.Set;
|
8 |
import java.util.Set;
|
| 9 |
|
9 |
|
| 10 |
import javax.servlet.http.HttpServletRequest;
|
10 |
import javax.servlet.http.HttpServletRequest;
|
| 11 |
|
11 |
|
| 12 |
import org.slf4j.Logger;
|
12 |
import org.apache.logging.log4j.LogManager;
|
| 13 |
import org.slf4j.LoggerFactory;
|
13 |
import org.apache.logging.log4j.Logger;
|
| 14 |
import org.springframework.beans.factory.annotation.Autowired;
|
14 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 15 |
import org.springframework.beans.factory.annotation.Value;
|
15 |
import org.springframework.beans.factory.annotation.Value;
|
| - |
|
16 |
import org.springframework.http.ResponseEntity;
|
| 16 |
import org.springframework.stereotype.Controller;
|
17 |
import org.springframework.stereotype.Controller;
|
| 17 |
import org.springframework.transaction.annotation.Transactional;
|
18 |
import org.springframework.transaction.annotation.Transactional;
|
| 18 |
import org.springframework.ui.Model;
|
19 |
import org.springframework.ui.Model;
|
| 19 |
import org.springframework.web.bind.annotation.RequestBody;
|
20 |
import org.springframework.web.bind.annotation.RequestBody;
|
| 20 |
import org.springframework.web.bind.annotation.RequestMapping;
|
21 |
import org.springframework.web.bind.annotation.RequestMapping;
|
| 21 |
import org.springframework.web.bind.annotation.RequestMethod;
|
22 |
import org.springframework.web.bind.annotation.RequestMethod;
|
| 22 |
import org.springframework.web.bind.annotation.RequestParam;
|
23 |
import org.springframework.web.bind.annotation.RequestParam;
|
| 23 |
|
24 |
|
| - |
|
25 |
import com.spice.profitmandi.common.enumuration.ProviderBalanceFrom;
|
| 24 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
26 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 25 |
import com.spice.profitmandi.common.model.OperatorType;
|
27 |
import com.spice.profitmandi.common.model.OperatorType;
|
| 26 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
28 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 27 |
import com.spice.profitmandi.common.model.RechargeCommissionRequest;
|
29 |
import com.spice.profitmandi.common.model.RechargeCommissionRequest;
|
| 28 |
import com.spice.profitmandi.common.model.RechargeCredential;
|
30 |
import com.spice.profitmandi.common.model.RechargeCredential;
|
| 29 |
import com.spice.profitmandi.common.model.RechargeRequest;
|
31 |
import com.spice.profitmandi.common.model.RechargeRequest;
|
| - |
|
32 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
| - |
|
33 |
import com.spice.profitmandi.dao.entity.dtr.DailyRecharge;
|
| 30 |
import com.spice.profitmandi.dao.entity.dtr.RechargeCommission;
|
34 |
import com.spice.profitmandi.dao.entity.dtr.RechargeCommission;
|
| 31 |
import com.spice.profitmandi.dao.entity.dtr.RechargeOperator;
|
35 |
import com.spice.profitmandi.dao.entity.dtr.RechargeOperator;
|
| 32 |
import com.spice.profitmandi.dao.entity.dtr.RechargeProvider;
|
36 |
import com.spice.profitmandi.dao.entity.dtr.RechargeProvider;
|
| - |
|
37 |
import com.spice.profitmandi.dao.entity.dtr.RechargeProviderCreditWalletHistory;
|
| 33 |
import com.spice.profitmandi.dao.entity.dtr.RechargeTransaction;
|
38 |
import com.spice.profitmandi.dao.entity.dtr.RechargeTransaction;
|
| 34 |
import com.spice.profitmandi.dao.entity.fofo.PaymentOption;
|
39 |
import com.spice.profitmandi.dao.entity.fofo.PaymentOption;
|
| 35 |
import com.spice.profitmandi.dao.enumuration.dtr.RechargeType;
|
40 |
import com.spice.profitmandi.dao.enumuration.dtr.RechargeType;
|
| - |
|
41 |
import com.spice.profitmandi.dao.repository.dtr.DailyRechargeRepository;
|
| 36 |
import com.spice.profitmandi.dao.repository.dtr.RechargeCommissionRepository;
|
42 |
import com.spice.profitmandi.dao.repository.dtr.RechargeCommissionRepository;
|
| 37 |
import com.spice.profitmandi.dao.repository.dtr.RechargeOperatorRepository;
|
43 |
import com.spice.profitmandi.dao.repository.dtr.RechargeOperatorRepository;
|
| - |
|
44 |
import com.spice.profitmandi.dao.repository.dtr.RechargeProviderCreditWalletHistoryRepository;
|
| 38 |
import com.spice.profitmandi.dao.repository.dtr.RechargeProviderRepository;
|
45 |
import com.spice.profitmandi.dao.repository.dtr.RechargeProviderRepository;
|
| 39 |
import com.spice.profitmandi.dao.repository.dtr.RechargeTransactionRepository;
|
46 |
import com.spice.profitmandi.dao.repository.dtr.RechargeTransactionRepository;
|
| 40 |
import com.spice.profitmandi.dao.repository.fofo.FofoPartnerPaymentOptionRepository;
|
47 |
import com.spice.profitmandi.dao.repository.fofo.FofoPartnerPaymentOptionRepository;
|
| 41 |
import com.spice.profitmandi.dao.repository.fofo.PaymentOptionRepository;
|
48 |
import com.spice.profitmandi.dao.repository.fofo.PaymentOptionRepository;
|
| 42 |
import com.spice.profitmandi.service.recharge.RechargeService;
|
49 |
import com.spice.profitmandi.service.recharge.RechargeService;
|
| Line 45... |
Line 52... |
| 45 |
|
52 |
|
| 46 |
@Controller
|
53 |
@Controller
|
| 47 |
@Transactional(rollbackFor=Throwable.class)
|
54 |
@Transactional(rollbackFor=Throwable.class)
|
| 48 |
public class RechargeController {
|
55 |
public class RechargeController {
|
| 49 |
|
56 |
|
| 50 |
private static final Logger LOGGER = LoggerFactory.getLogger(RechargeController.class);
|
57 |
private static final Logger LOGGER = LogManager.getLogger(RechargeController.class);
|
| 51 |
|
58 |
|
| 52 |
@Value("${oxigen.recharge.transaction.url}")
|
59 |
@Value("${oxigen.recharge.transaction.url}")
|
| 53 |
private String oxigenRechargeTransactionUrl;
|
60 |
private String oxigenRechargeTransactionUrl;
|
| 54 |
|
61 |
|
| 55 |
@Value("${oxigen.recharge.enquiry.url}")
|
62 |
@Value("${oxigen.recharge.enquiry.url}")
|
| Line 65... |
Line 72... |
| 65 |
private String oxigenRechargeValidationAuthKey;
|
72 |
private String oxigenRechargeValidationAuthKey;
|
| 66 |
|
73 |
|
| 67 |
@Value("${think.walnut.digital.recharge.transaction.mobile.url}")
|
74 |
@Value("${think.walnut.digital.recharge.transaction.mobile.url}")
|
| 68 |
private String thinkWalnutDigitalRechargeTransactionMobileUrl;
|
75 |
private String thinkWalnutDigitalRechargeTransactionMobileUrl;
|
| 69 |
|
76 |
|
| 70 |
@Value("${think.walnut.digital.recharge.transaction.mobile.username}")
|
- |
|
| 71 |
private String thinkWalnutDigitalRechargeTransactionMobileUserName;
|
- |
|
| 72 |
|
- |
|
| 73 |
@Value("${think.walnut.digital.recharge.transaction.mobile.password}")
|
- |
|
| 74 |
private String thinkWalnutDigitalRechargeTransactionMobilePassword;
|
- |
|
| 75 |
|
- |
|
| 76 |
@Value("${think.walnut.digital.recharge.transaction.dth.url}")
|
77 |
@Value("${think.walnut.digital.recharge.transaction.dth.url}")
|
| 77 |
private String thinkWalnutDigitalRechargeTransactionDthUrl;
|
78 |
private String thinkWalnutDigitalRechargeTransactionDthUrl;
|
| 78 |
|
79 |
|
| 79 |
@Value("${think.walnut.digital.recharge.transaction.dth.username}")
|
- |
|
| 80 |
private String thinkWalnutDigitalRechargeTransactionDthUserName;
|
- |
|
| 81 |
|
- |
|
| 82 |
@Value("${think.walnut.digital.recharge.transaction.dth.password}")
|
- |
|
| 83 |
private String thinkWalnutDigitalRechargeTransactionDthPassword;
|
- |
|
| 84 |
|
- |
|
| 85 |
@Value("${think.walnut.digital.recharge.enquiry.url}")
|
80 |
@Value("${think.walnut.digital.recharge.enquiry.url}")
|
| 86 |
private String thinkWalnutDigitalRechargeEnquiryUrl;
|
81 |
private String thinkWalnutDigitalRechargeEnquiryUrl;
|
| 87 |
|
82 |
|
| 88 |
@Value("${think.walnut.digital.recharge.enquiry.username}")
|
83 |
@Value("${think.walnut.digital.recharge.balance.url}")
|
| 89 |
private String thinkWalnutDigitalRechargeEnquiryUserName;
|
84 |
private String thinkWalnutDigitalRechargeBalanceUrl;
|
| 90 |
|
85 |
|
| - |
|
86 |
@Value("${think.walnut.digital.recharge.username}")
|
| - |
|
87 |
private String thinkWalnutDigitalRechargeUserName;
|
| - |
|
88 |
|
| 91 |
@Value("${think.walnut.digital.recharge.enquiry.password}")
|
89 |
@Value("${think.walnut.digital.recharge.password}")
|
| 92 |
private String thinkWalnutDigitalRechargeEnquiryPassword;
|
90 |
private String thinkWalnutDigitalRechargePassword;
|
| 93 |
|
91 |
|
| 94 |
@Value("${think.walnut.digital.recharge.auth.key}")
|
92 |
@Value("${think.walnut.digital.recharge.auth.key}")
|
| 95 |
private String thinkWalnutDigitalRechargeAuthKey;
|
93 |
private String thinkWalnutDigitalRechargeAuthKey;
|
| 96 |
|
94 |
|
| 97 |
@Autowired
|
95 |
@Autowired
|
| Line 114... |
Line 112... |
| 114 |
|
112 |
|
| 115 |
@Autowired
|
113 |
@Autowired
|
| 116 |
private FofoPartnerPaymentOptionRepository fofoPartnerPaymentOptionRepository;
|
114 |
private FofoPartnerPaymentOptionRepository fofoPartnerPaymentOptionRepository;
|
| 117 |
|
115 |
|
| 118 |
@Autowired
|
116 |
@Autowired
|
| - |
|
117 |
private RechargeProviderCreditWalletHistoryRepository rechargeProviderCreditWalletHistoryRepository;
|
| - |
|
118 |
|
| - |
|
119 |
@Autowired
|
| - |
|
120 |
private DailyRechargeRepository dailyRechargeRepository;
|
| - |
|
121 |
|
| - |
|
122 |
@Autowired
|
| 119 |
private CookiesProcessor cookiesProcessor;
|
123 |
private CookiesProcessor cookiesProcessor;
|
| 120 |
|
124 |
|
| - |
|
125 |
@Autowired
|
| - |
|
126 |
private ResponseSender<?> responseSender;
|
| - |
|
127 |
|
| 121 |
@RequestMapping(value = "/createRecharge", method = RequestMethod.GET)
|
128 |
@RequestMapping(value = "/createRecharge", method = RequestMethod.GET)
|
| 122 |
public String createRecharge(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.RECHARGE_TYPE) String rechargeTypeString, Model model) throws ProfitMandiBusinessException{
|
129 |
public String createRecharge(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.RECHARGE_TYPE) String rechargeTypeString, Model model) throws ProfitMandiBusinessException{
|
| 123 |
//model.addAttribute("rechargeOperators", rechargeOperatorRepository.selectAllByRechargeType(RechargeType.MOBILE));
|
130 |
//model.addAttribute("rechargeOperators", rechargeOperatorRepository.selectAllByRechargeType(RechargeType.MOBILE));
|
| 124 |
//model.addAttribute("rechargeTypes", RechargeType.values());
|
131 |
//model.addAttribute("rechargeTypes", RechargeType.values());
|
| 125 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
132 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| Line 172... |
Line 179... |
| 172 |
}
|
179 |
}
|
| 173 |
return rechargeOperatorIdNameMap;
|
180 |
return rechargeOperatorIdNameMap;
|
| 174 |
}
|
181 |
}
|
| 175 |
|
182 |
|
| 176 |
private Map<Integer, String> rechargeCommissionsProviderIdNameMap(List<RechargeCommission> rechargeCommissions){
|
183 |
private Map<Integer, String> rechargeCommissionsProviderIdNameMap(List<RechargeCommission> rechargeCommissions){
|
| 177 |
Map<Integer, String> rechargeProviderIdNameMap = new HashMap<>();
|
- |
|
| 178 |
if(rechargeCommissions.isEmpty()) {
|
184 |
if(rechargeCommissions.isEmpty()) {
|
| 179 |
return rechargeProviderIdNameMap;
|
185 |
return new HashMap<>();
|
| 180 |
}
|
186 |
}
|
| 181 |
Set<Integer> providerIds = new HashSet<>();
|
187 |
Set<Integer> providerIds = new HashSet<>();
|
| 182 |
for(RechargeCommission rechargeCommission : rechargeCommissions) {
|
188 |
for(RechargeCommission rechargeCommission : rechargeCommissions) {
|
| 183 |
providerIds.add(rechargeCommission.getProviderId());
|
189 |
providerIds.add(rechargeCommission.getProviderId());
|
| 184 |
}
|
190 |
}
|
| - |
|
191 |
return providerIdNameMap(providerIds);
|
| 185 |
|
192 |
}
|
| - |
|
193 |
|
| - |
|
194 |
private Map<Integer, String> providerIdNameMap(Set<Integer> providerIds){
|
| - |
|
195 |
Map<Integer, String> rechargeProviderIdNameMap = new HashMap<>();
|
| 186 |
List<RechargeProvider> rechargeProviders = rechargeProviderRepository.selectAllByIds(providerIds);
|
196 |
List<RechargeProvider> rechargeProviders = rechargeProviderRepository.selectAllByIds(providerIds);
|
| 187 |
for(RechargeProvider rechargeProvider : rechargeProviders) {
|
197 |
for(RechargeProvider rechargeProvider : rechargeProviders) {
|
| 188 |
rechargeProviderIdNameMap.put(rechargeProvider.getId(), rechargeProvider.getName());
|
198 |
rechargeProviderIdNameMap.put(rechargeProvider.getId(), rechargeProvider.getName());
|
| 189 |
}
|
199 |
}
|
| 190 |
return rechargeProviderIdNameMap;
|
200 |
return rechargeProviderIdNameMap;
|
| 191 |
}
|
201 |
}
|
| 192 |
|
202 |
|
| - |
|
203 |
private Map<Integer, String> rechargeProviderCreditWalletHistoriesProviderIdNameMap(List<RechargeProviderCreditWalletHistory> rechargeProviderCreditWalletHistories){
|
| - |
|
204 |
if(rechargeProviderCreditWalletHistories.isEmpty()) {
|
| - |
|
205 |
return new HashMap<>();
|
| - |
|
206 |
}
|
| - |
|
207 |
Set<Integer> providerIds = new HashSet<>();
|
| - |
|
208 |
for(RechargeProviderCreditWalletHistory rechargeProviderCreditWalletHistory : rechargeProviderCreditWalletHistories) {
|
| - |
|
209 |
providerIds.add(rechargeProviderCreditWalletHistory.getProviderId());
|
| - |
|
210 |
}
|
| - |
|
211 |
return this.providerIdNameMap(providerIds);
|
| - |
|
212 |
}
|
| - |
|
213 |
|
| - |
|
214 |
private Map<Integer, String> dailyRechargesProviderIdNameMap(List<DailyRecharge> dailyRecharges){
|
| - |
|
215 |
if(dailyRecharges.isEmpty()) {
|
| - |
|
216 |
return new HashMap<>();
|
| - |
|
217 |
}
|
| - |
|
218 |
Set<Integer> providerIds = new HashSet<>();
|
| - |
|
219 |
for(DailyRecharge dailyRecharge : dailyRecharges) {
|
| - |
|
220 |
providerIds.add(dailyRecharge.getProviderId());
|
| - |
|
221 |
}
|
| - |
|
222 |
return this.providerIdNameMap(providerIds);
|
| - |
|
223 |
}
|
| - |
|
224 |
|
| 193 |
@RequestMapping(value = "/createRecharge", method = RequestMethod.POST)
|
225 |
@RequestMapping(value = "/createRecharge", method = RequestMethod.POST)
|
| 194 |
public String createRecharge(HttpServletRequest request, @RequestBody RechargeRequest rechargeRequest, @RequestParam(name = "offset", defaultValue = "0") int offset, @RequestParam(name = "limit", defaultValue = "10") int limit, Model model) throws ProfitMandiBusinessException{
|
226 |
public String createRecharge(HttpServletRequest request, @RequestBody RechargeRequest rechargeRequest, @RequestParam(name = "offset", defaultValue = "0") int offset, @RequestParam(name = "limit", defaultValue = "10") int limit, Model model) throws ProfitMandiBusinessException{
|
| 195 |
LOGGER.info("Recharge request body {}", rechargeRequest);
|
227 |
LOGGER.info("Recharge request body {}", rechargeRequest);
|
| 196 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
228 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 197 |
|
229 |
|
| 198 |
RechargeCredential rechargeTransactionMobileCredential = new RechargeCredential();
|
230 |
RechargeCredential rechargeTransactionMobileCredential = new RechargeCredential();
|
| 199 |
rechargeTransactionMobileCredential.setRechargeUrl(thinkWalnutDigitalRechargeTransactionMobileUrl);
|
231 |
rechargeTransactionMobileCredential.setRechargeUrl(thinkWalnutDigitalRechargeTransactionMobileUrl);
|
| 200 |
rechargeTransactionMobileCredential.setRechargeUserName(thinkWalnutDigitalRechargeTransactionMobileUserName);
|
232 |
rechargeTransactionMobileCredential.setRechargeUserName(thinkWalnutDigitalRechargeUserName);
|
| 201 |
rechargeTransactionMobileCredential.setRechargePassword(thinkWalnutDigitalRechargeTransactionMobilePassword);
|
233 |
rechargeTransactionMobileCredential.setRechargePassword(thinkWalnutDigitalRechargePassword);
|
| 202 |
rechargeTransactionMobileCredential.setRechargeAuthKey(thinkWalnutDigitalRechargeAuthKey);
|
234 |
rechargeTransactionMobileCredential.setRechargeAuthKey(thinkWalnutDigitalRechargeAuthKey);
|
| 203 |
|
235 |
|
| 204 |
RechargeCredential rechargeTransactionDthCredential = new RechargeCredential();
|
236 |
RechargeCredential rechargeTransactionDthCredential = new RechargeCredential();
|
| 205 |
rechargeTransactionDthCredential.setRechargeUrl(thinkWalnutDigitalRechargeTransactionDthUrl);
|
237 |
rechargeTransactionDthCredential.setRechargeUrl(thinkWalnutDigitalRechargeTransactionDthUrl);
|
| 206 |
rechargeTransactionDthCredential.setRechargeUserName(thinkWalnutDigitalRechargeTransactionDthUserName);
|
238 |
rechargeTransactionDthCredential.setRechargeUserName(thinkWalnutDigitalRechargeUserName);
|
| 207 |
rechargeTransactionDthCredential.setRechargePassword(thinkWalnutDigitalRechargeTransactionDthPassword);
|
239 |
rechargeTransactionDthCredential.setRechargePassword(thinkWalnutDigitalRechargePassword);
|
| 208 |
rechargeTransactionDthCredential.setRechargeAuthKey(thinkWalnutDigitalRechargeAuthKey);
|
240 |
rechargeTransactionDthCredential.setRechargeAuthKey(thinkWalnutDigitalRechargeAuthKey);
|
| 209 |
|
241 |
|
| 210 |
rechargeService.doRecharge(oxigenRechargeTransactionUrl, oxigenRechargeAuthKey, oxigenRechargeValidationUrl,
|
242 |
rechargeService.doRecharge(oxigenRechargeTransactionUrl, oxigenRechargeAuthKey, oxigenRechargeValidationUrl,
|
| 211 |
oxigenRechargeValidationAuthKey, rechargeTransactionMobileCredential, rechargeTransactionDthCredential, loginDetails.getFofoId(), rechargeRequest);
|
243 |
oxigenRechargeValidationAuthKey, rechargeTransactionMobileCredential, rechargeTransactionDthCredential, loginDetails.getFofoId(), rechargeRequest);
|
| 212 |
RechargeType rechargeType = RechargeType.valueOf(rechargeRequest.getRechargeType());
|
244 |
RechargeType rechargeType = RechargeType.valueOf(rechargeRequest.getRechargeType());
|
| Line 233... |
Line 265... |
| 233 |
public String checkStatus(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.REQUEST_ID) String requestId, @RequestParam(name = ProfitMandiConstants.RECHARGE_TYPE) String rechargeTypeString, @RequestParam(name = "offset", defaultValue = "0") int offset, @RequestParam(name = "limit", defaultValue = "10") int limit, Model model) throws ProfitMandiBusinessException{
|
265 |
public String checkStatus(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.REQUEST_ID) String requestId, @RequestParam(name = ProfitMandiConstants.RECHARGE_TYPE) String rechargeTypeString, @RequestParam(name = "offset", defaultValue = "0") int offset, @RequestParam(name = "limit", defaultValue = "10") int limit, Model model) throws ProfitMandiBusinessException{
|
| 234 |
LOGGER.info("RequestId [{}], rechargeType [{}]", requestId, rechargeTypeString);
|
266 |
LOGGER.info("RequestId [{}], rechargeType [{}]", requestId, rechargeTypeString);
|
| 235 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
267 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 236 |
RechargeCredential thinkWalnutDigitalRechargeEnquiryCredential = new RechargeCredential();
|
268 |
RechargeCredential thinkWalnutDigitalRechargeEnquiryCredential = new RechargeCredential();
|
| 237 |
thinkWalnutDigitalRechargeEnquiryCredential.setRechargeUrl(thinkWalnutDigitalRechargeEnquiryUrl);
|
269 |
thinkWalnutDigitalRechargeEnquiryCredential.setRechargeUrl(thinkWalnutDigitalRechargeEnquiryUrl);
|
| 238 |
thinkWalnutDigitalRechargeEnquiryCredential.setRechargeUserName(thinkWalnutDigitalRechargeEnquiryUserName);
|
270 |
thinkWalnutDigitalRechargeEnquiryCredential.setRechargeUserName(thinkWalnutDigitalRechargeUserName);
|
| 239 |
thinkWalnutDigitalRechargeEnquiryCredential.setRechargePassword(thinkWalnutDigitalRechargeEnquiryPassword);
|
271 |
thinkWalnutDigitalRechargeEnquiryCredential.setRechargePassword(thinkWalnutDigitalRechargePassword);
|
| 240 |
thinkWalnutDigitalRechargeEnquiryCredential.setRechargeAuthKey(thinkWalnutDigitalRechargeAuthKey);
|
272 |
thinkWalnutDigitalRechargeEnquiryCredential.setRechargeAuthKey(thinkWalnutDigitalRechargeAuthKey);
|
| 241 |
rechargeService.checkStatus(oxigenRechargeEnquiryUrl, oxigenRechargeAuthKey, thinkWalnutDigitalRechargeEnquiryCredential, loginDetails.getFofoId(), requestId);
|
273 |
rechargeService.checkStatus(oxigenRechargeEnquiryUrl, oxigenRechargeAuthKey, thinkWalnutDigitalRechargeEnquiryCredential, loginDetails.getFofoId(), requestId);
|
| 242 |
RechargeType rechargeType = RechargeType.valueOf(rechargeTypeString);
|
274 |
RechargeType rechargeType = RechargeType.valueOf(rechargeTypeString);
|
| 243 |
List<RechargeTransaction> rechargeTransactions = rechargeTransactionRepository.selectAllByRetailerIdAndType(loginDetails.getFofoId(), rechargeType, offset, limit);
|
275 |
List<RechargeTransaction> rechargeTransactions = rechargeTransactionRepository.selectAllByRetailerIdAndType(loginDetails.getFofoId(), rechargeType, offset, limit);
|
| 244 |
//long size = rechargeTransactionRepository.selectCountByRetailerId(loginDetails.getFofoId());
|
276 |
//long size = rechargeTransactionRepository.selectCountByRetailerId(loginDetails.getFofoId());
|
| Line 425... |
Line 457... |
| 425 |
model.addAttribute("rechargeOperatorIdRechargeOperatorMap", rechargeOperatorIdRechargeOperatorMap);
|
457 |
model.addAttribute("rechargeOperatorIdRechargeOperatorMap", rechargeOperatorIdRechargeOperatorMap);
|
| 426 |
model.addAttribute("rechargeProviderIdNameMap", rechargeProviderIdNameMap);
|
458 |
model.addAttribute("rechargeProviderIdNameMap", rechargeProviderIdNameMap);
|
| 427 |
return "recharge-commissions-paginated";
|
459 |
return "recharge-commissions-paginated";
|
| 428 |
}
|
460 |
}
|
| 429 |
|
461 |
|
| - |
|
462 |
@RequestMapping(value = "/getRechargeProviderBalance", method = RequestMethod.GET)
|
| - |
|
463 |
public String getRechargeProviderBalance(HttpServletRequest request, Model model) throws ProfitMandiBusinessException{
|
| - |
|
464 |
List<RechargeProvider> rechargeProviders = rechargeProviderRepository.selectAll();
|
| - |
|
465 |
model.addAttribute("rechargeProviders", rechargeProviders);
|
| - |
|
466 |
model.addAttribute("providerBalanceFroms", ProviderBalanceFrom.values());
|
| - |
|
467 |
RechargeCredential thinkWalnutDigitalRechargeCredential = new RechargeCredential();
|
| - |
|
468 |
thinkWalnutDigitalRechargeCredential.setRechargeUrl(thinkWalnutDigitalRechargeBalanceUrl);
|
| - |
|
469 |
thinkWalnutDigitalRechargeCredential.setRechargeUserName(thinkWalnutDigitalRechargeUserName);
|
| - |
|
470 |
thinkWalnutDigitalRechargeCredential.setRechargePassword(thinkWalnutDigitalRechargePassword);
|
| - |
|
471 |
thinkWalnutDigitalRechargeCredential.setRechargeAuthKey(thinkWalnutDigitalRechargeAuthKey);
|
| - |
|
472 |
model.addAttribute("rechargeProviderBalanceMaps", rechargeService.getRechargeProvidersBalance(oxigenRechargeTransactionUrl, oxigenRechargeAuthKey, thinkWalnutDigitalRechargeCredential));
|
| - |
|
473 |
return "recharge-provider-balance";
|
| - |
|
474 |
}
|
| - |
|
475 |
|
| - |
|
476 |
@RequestMapping(value = "/getRechargeProviderWalletAddMoney", method = RequestMethod.GET)
|
| - |
|
477 |
public String getRechargeProviderWalletAddMoney(HttpServletRequest request, Model model) throws ProfitMandiBusinessException{
|
| - |
|
478 |
List<RechargeProvider> rechargeProviders = rechargeProviderRepository.selectAll();
|
| - |
|
479 |
model.addAttribute("rechargeProviders", rechargeProviders);
|
| - |
|
480 |
return "recharge-provider-wallet-add-money";
|
| - |
|
481 |
}
|
| - |
|
482 |
|
| - |
|
483 |
@RequestMapping(value = "/addMoneyToRechargeProviderWallet", method = RequestMethod.POST)
|
| - |
|
484 |
public String createRechargeProviderWalletAddMoney(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.PROVIDER_ID) int providerId, @RequestParam(name = ProfitMandiConstants.AMOUNT) float amount, @RequestParam(name = ProfitMandiConstants.RECEIVE_DATE_TIME) String receiveDateTimeString, @RequestParam(name = "offset", defaultValue = "0") int offset, @RequestParam(name = "limit", defaultValue = "10") int limit, Model model) throws ProfitMandiBusinessException{
|
| - |
|
485 |
rechargeService.createRechargeProviderCreditWallet(providerId, amount, receiveDateTimeString);
|
| - |
|
486 |
List<RechargeProviderCreditWalletHistory> rechargeProviderCreditWalletHistories = rechargeProviderCreditWalletHistoryRepository.selectAll(offset, limit);
|
| - |
|
487 |
long size = rechargeProviderCreditWalletHistoryRepository.selectAllCount();
|
| - |
|
488 |
Map<Integer, String> rechargeProviderIdNameMap = this.rechargeProviderCreditWalletHistoriesProviderIdNameMap(rechargeProviderCreditWalletHistories);
|
| - |
|
489 |
model.addAttribute("rechargeProviderCreditWalletHistories", rechargeProviderCreditWalletHistories);
|
| - |
|
490 |
model.addAttribute("rechargeProviderIdNameMap", rechargeProviderIdNameMap);
|
| - |
|
491 |
model.addAttribute("start", offset + 1);
|
| - |
|
492 |
model.addAttribute("size", size);
|
| - |
|
493 |
if (rechargeProviderCreditWalletHistories.size() < limit){
|
| - |
|
494 |
model.addAttribute("end", offset + rechargeProviderCreditWalletHistories.size());
|
| - |
|
495 |
}else{
|
| - |
|
496 |
model.addAttribute("end", offset + limit);
|
| - |
|
497 |
}
|
| - |
|
498 |
return "recharge-provider-wallet-add-moneys";
|
| - |
|
499 |
}
|
| - |
|
500 |
|
| - |
|
501 |
@RequestMapping(value = "/getRechargeProviderWalletAddMoneys", method = RequestMethod.GET)
|
| - |
|
502 |
public String getRechargeProviderWalletAddMoney(HttpServletRequest request, @RequestParam(name = "offset", defaultValue = "0") int offset, @RequestParam(name = "limit", defaultValue = "10") int limit, Model model) throws ProfitMandiBusinessException{
|
| - |
|
503 |
List<RechargeProviderCreditWalletHistory> rechargeProviderCreditWalletHistories = rechargeProviderCreditWalletHistoryRepository.selectAll(offset, limit);
|
| - |
|
504 |
long size = rechargeProviderCreditWalletHistoryRepository.selectAllCount();
|
| - |
|
505 |
Map<Integer, String> rechargeProviderIdNameMap = this.rechargeProviderCreditWalletHistoriesProviderIdNameMap(rechargeProviderCreditWalletHistories);
|
| - |
|
506 |
model.addAttribute("rechargeProviderCreditWalletHistories", rechargeProviderCreditWalletHistories);
|
| - |
|
507 |
model.addAttribute("rechargeProviderIdNameMap", rechargeProviderIdNameMap);
|
| - |
|
508 |
model.addAttribute("start", offset + 1);
|
| - |
|
509 |
model.addAttribute("size", size);
|
| - |
|
510 |
if (rechargeProviderCreditWalletHistories.size() < limit){
|
| - |
|
511 |
model.addAttribute("end", offset + rechargeProviderCreditWalletHistories.size());
|
| - |
|
512 |
}else{
|
| - |
|
513 |
model.addAttribute("end", offset + limit);
|
| - |
|
514 |
}
|
| - |
|
515 |
return "recharge-provider-wallet-add-moneys";
|
| - |
|
516 |
}
|
| - |
|
517 |
|
| - |
|
518 |
@RequestMapping(value = "/getPaginatedRechargeProviderWalletAddMoneys", method = RequestMethod.GET)
|
| - |
|
519 |
public String getPaginatedRechargeProviderWalletAddMoney(HttpServletRequest request, @RequestParam(name = "offset", defaultValue = "0") int offset, @RequestParam(name = "limit", defaultValue = "10") int limit, Model model) throws ProfitMandiBusinessException{
|
| - |
|
520 |
List<RechargeProviderCreditWalletHistory> rechargeProviderCreditWalletHistories = rechargeProviderCreditWalletHistoryRepository.selectAll(offset, limit);
|
| - |
|
521 |
Map<Integer, String> rechargeProviderIdNameMap = this.rechargeProviderCreditWalletHistoriesProviderIdNameMap(rechargeProviderCreditWalletHistories);
|
| - |
|
522 |
model.addAttribute("rechargeProviderCreditWalletHistories", rechargeProviderCreditWalletHistories);
|
| - |
|
523 |
model.addAttribute("rechargeProviderIdNameMap", rechargeProviderIdNameMap);
|
| - |
|
524 |
return "recharge-provider-wallet-add-moneys-paginated";
|
| - |
|
525 |
}
|
| - |
|
526 |
|
| - |
|
527 |
|
| - |
|
528 |
@RequestMapping(value = "/getDailyRecharges", method = RequestMethod.GET)
|
| - |
|
529 |
public String getDailyRecharges(HttpServletRequest request, @RequestParam(name = "offset", defaultValue = "0") int offset, @RequestParam(name = "limit", defaultValue = "10") int limit, Model model) throws ProfitMandiBusinessException{
|
| - |
|
530 |
List<DailyRecharge> dailyRecharges = dailyRechargeRepository.selectAll(offset, limit);
|
| - |
|
531 |
long size = dailyRechargeRepository.selectAllCount();
|
| - |
|
532 |
Map<Integer, String> rechargeProviderIdNameMap = this.dailyRechargesProviderIdNameMap(dailyRecharges);
|
| - |
|
533 |
model.addAttribute("dailyRecharges", dailyRecharges);
|
| - |
|
534 |
model.addAttribute("rechargeProviderIdNameMap", rechargeProviderIdNameMap);
|
| - |
|
535 |
model.addAttribute("start", offset + 1);
|
| - |
|
536 |
model.addAttribute("size", size);
|
| - |
|
537 |
if (dailyRecharges.size() < limit){
|
| - |
|
538 |
model.addAttribute("end", offset + dailyRecharges.size());
|
| - |
|
539 |
}else{
|
| - |
|
540 |
model.addAttribute("end", offset + limit);
|
| - |
|
541 |
}
|
| - |
|
542 |
return "daily-recharges";
|
| - |
|
543 |
}
|
| 430 |
|
544 |
|
| - |
|
545 |
@RequestMapping(value = "/getPaginatedDailyRecharges", method = RequestMethod.GET)
|
| - |
|
546 |
public String getPaginatedDailyRecharges(HttpServletRequest request, @RequestParam(name = "offset", defaultValue = "0") int offset, @RequestParam(name = "limit", defaultValue = "10") int limit, Model model) throws ProfitMandiBusinessException{
|
| - |
|
547 |
List<DailyRecharge> dailyRecharges = dailyRechargeRepository.selectAll(offset, limit);
|
| - |
|
548 |
Map<Integer, String> rechargeProviderIdNameMap = this.dailyRechargesProviderIdNameMap(dailyRecharges);
|
| - |
|
549 |
model.addAttribute("dailyRecharges", dailyRecharges);
|
| - |
|
550 |
model.addAttribute("rechargeProviderIdNameMap", rechargeProviderIdNameMap);
|
| - |
|
551 |
return "daily-recharges-paginated";
|
| - |
|
552 |
}
|
| - |
|
553 |
|
| - |
|
554 |
@RequestMapping(value = "/getBalanceByProviderId", method = RequestMethod.GET)
|
| - |
|
555 |
public ResponseEntity<?> getBalanceByProviderId(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.PROVIDER_ID) int providerId, @RequestParam(name = ProfitMandiConstants.PROVIDER_BALANCE_FROM) ProviderBalanceFrom providerBalanceFrom) throws ProfitMandiBusinessException{
|
| - |
|
556 |
RechargeCredential thinkWalnutDigitalRechargeCredential = new RechargeCredential();
|
| - |
|
557 |
thinkWalnutDigitalRechargeCredential.setRechargeUrl(thinkWalnutDigitalRechargeBalanceUrl);
|
| - |
|
558 |
thinkWalnutDigitalRechargeCredential.setRechargeUserName(thinkWalnutDigitalRechargeUserName);
|
| - |
|
559 |
thinkWalnutDigitalRechargeCredential.setRechargePassword(thinkWalnutDigitalRechargePassword);
|
| - |
|
560 |
thinkWalnutDigitalRechargeCredential.setRechargeAuthKey(thinkWalnutDigitalRechargeAuthKey);
|
| - |
|
561 |
return responseSender.ok(rechargeService.checkBalance(oxigenRechargeTransactionUrl, oxigenRechargeAuthKey, thinkWalnutDigitalRechargeCredential, providerId, providerBalanceFrom));
|
| - |
|
562 |
}
|
| 431 |
}
|
563 |
}
|
| 432 |
|
564 |
|