| 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.apache.logging.log4j.Logger;
|
12 |
import org.slf4j.Logger;
|
| 13 |
import org.apache.logging.log4j.LogManager;
|
13 |
import org.slf4j.LoggerFactory;
|
| 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.stereotype.Controller;
|
16 |
import org.springframework.stereotype.Controller;
|
| 17 |
import org.springframework.transaction.annotation.Transactional;
|
17 |
import org.springframework.transaction.annotation.Transactional;
|
| 18 |
import org.springframework.ui.Model;
|
18 |
import org.springframework.ui.Model;
|
| Line 27... |
Line 27... |
| 27 |
import com.spice.profitmandi.common.model.RechargeCommissionRequest;
|
27 |
import com.spice.profitmandi.common.model.RechargeCommissionRequest;
|
| 28 |
import com.spice.profitmandi.common.model.RechargeCredential;
|
28 |
import com.spice.profitmandi.common.model.RechargeCredential;
|
| 29 |
import com.spice.profitmandi.common.model.RechargeRequest;
|
29 |
import com.spice.profitmandi.common.model.RechargeRequest;
|
| 30 |
import com.spice.profitmandi.dao.entity.dtr.RechargeCommission;
|
30 |
import com.spice.profitmandi.dao.entity.dtr.RechargeCommission;
|
| 31 |
import com.spice.profitmandi.dao.entity.dtr.RechargeOperator;
|
31 |
import com.spice.profitmandi.dao.entity.dtr.RechargeOperator;
|
| - |
|
32 |
import com.spice.profitmandi.dao.entity.dtr.RechargeProvider;
|
| 32 |
import com.spice.profitmandi.dao.entity.dtr.RechargeTransaction;
|
33 |
import com.spice.profitmandi.dao.entity.dtr.RechargeTransaction;
|
| 33 |
import com.spice.profitmandi.dao.entity.fofo.PaymentOption;
|
34 |
import com.spice.profitmandi.dao.entity.fofo.PaymentOption;
|
| 34 |
import com.spice.profitmandi.dao.enumuration.dtr.RechargeType;
|
35 |
import com.spice.profitmandi.dao.enumuration.dtr.RechargeType;
|
| 35 |
import com.spice.profitmandi.dao.repository.dtr.RechargeCommissionRepository;
|
36 |
import com.spice.profitmandi.dao.repository.dtr.RechargeCommissionRepository;
|
| 36 |
import com.spice.profitmandi.dao.repository.dtr.RechargeOperatorRepository;
|
37 |
import com.spice.profitmandi.dao.repository.dtr.RechargeOperatorRepository;
|
| - |
|
38 |
import com.spice.profitmandi.dao.repository.dtr.RechargeProviderRepository;
|
| 37 |
import com.spice.profitmandi.dao.repository.dtr.RechargeTransactionRepository;
|
39 |
import com.spice.profitmandi.dao.repository.dtr.RechargeTransactionRepository;
|
| 38 |
import com.spice.profitmandi.dao.repository.fofo.FofoPartnerPaymentOptionRepository;
|
40 |
import com.spice.profitmandi.dao.repository.fofo.FofoPartnerPaymentOptionRepository;
|
| 39 |
import com.spice.profitmandi.dao.repository.fofo.PaymentOptionRepository;
|
41 |
import com.spice.profitmandi.dao.repository.fofo.PaymentOptionRepository;
|
| 40 |
import com.spice.profitmandi.service.recharge.RechargeService;
|
42 |
import com.spice.profitmandi.service.recharge.RechargeService;
|
| 41 |
import com.spice.profitmandi.web.model.LoginDetails;
|
43 |
import com.spice.profitmandi.web.model.LoginDetails;
|
| Line 43... |
Line 45... |
| 43 |
|
45 |
|
| 44 |
@Controller
|
46 |
@Controller
|
| 45 |
@Transactional(rollbackFor=Throwable.class)
|
47 |
@Transactional(rollbackFor=Throwable.class)
|
| 46 |
public class RechargeController {
|
48 |
public class RechargeController {
|
| 47 |
|
49 |
|
| 48 |
private static final Logger LOGGER = LogManager.getLogger(RechargeController.class);
|
50 |
private static final Logger LOGGER = LoggerFactory.getLogger(RechargeController.class);
|
| 49 |
|
51 |
|
| 50 |
@Value("${recharge.transaction.mobile.url}")
|
52 |
@Value("${oxigen.recharge.transaction.url}")
|
| 51 |
private String rechargeMobileUrl;
|
53 |
private String oxigenRechargeTransactionUrl;
|
| 52 |
|
54 |
|
| 53 |
@Value("${recharge.transaction.mobile.username}")
|
55 |
@Value("${oxigen.recharge.enquiry.url}")
|
| 54 |
private String rechargeMobileUserName;
|
56 |
private String oxigenRechargeEnquiryUrl;
|
| 55 |
|
57 |
|
| 56 |
@Value("${recharge.transaction.mobile.password}")
|
58 |
@Value("${oxigen.recharge.auth.key}")
|
| 57 |
private String rechargeMobilePassword;
|
59 |
private String oxigenRechargeAuthKey;
|
| 58 |
|
60 |
|
| 59 |
@Value("${recharge.transaction.dth.url}")
|
61 |
@Value("${oxigen.recharge.validation.url}")
|
| 60 |
private String rechargeDthUrl;
|
62 |
private String oxigenRechargeValidationUrl;
|
| 61 |
|
63 |
|
| 62 |
@Value("${recharge.transaction.dth.username}")
|
64 |
@Value("${oxigen.recharge.validation.auth.key}")
|
| 63 |
private String rechargeDthUserName;
|
65 |
private String oxigenRechargeValidationAuthKey;
|
| 64 |
|
66 |
|
| 65 |
@Value("${recharge.transaction.dth.password}")
|
67 |
@Value("${think.walnut.digital.recharge.transaction.mobile.url}")
|
| 66 |
private String rechargeDthPassword;
|
68 |
private String thinkWalnutDigitalRechargeTransactionMobileUrl;
|
| 67 |
|
69 |
|
| 68 |
@Value("${recharge.enquiry.url}")
|
70 |
@Value("${think.walnut.digital.recharge.transaction.mobile.username}")
|
| 69 |
private String rechargeEnquiryUrl;
|
71 |
private String thinkWalnutDigitalRechargeTransactionMobileUserName;
|
| 70 |
|
72 |
|
| 71 |
@Value("${recharge.enquiry.username}")
|
73 |
@Value("${think.walnut.digital.recharge.transaction.mobile.password}")
|
| 72 |
private String rechargeEnquiryUserName;
|
74 |
private String thinkWalnutDigitalRechargeTransactionMobilePassword;
|
| 73 |
|
75 |
|
| 74 |
@Value("${recharge.enquiry.password}")
|
76 |
@Value("${think.walnut.digital.recharge.transaction.dth.url}")
|
| 75 |
private String rechargeEnquiryPassword;
|
77 |
private String thinkWalnutDigitalRechargeTransactionDthUrl;
|
| 76 |
|
78 |
|
| 77 |
@Value("${recharge.auth.key}")
|
79 |
@Value("${think.walnut.digital.recharge.transaction.dth.username}")
|
| 78 |
private String rechargeAuthKey;
|
80 |
private String thinkWalnutDigitalRechargeTransactionDthUserName;
|
| 79 |
|
81 |
|
| 80 |
@Value("${recharge.validation.url}")
|
82 |
@Value("${think.walnut.digital.recharge.transaction.dth.password}")
|
| 81 |
private String rechargeValidationUrl;
|
83 |
private String thinkWalnutDigitalRechargeTransactionDthPassword;
|
| 82 |
|
84 |
|
| - |
|
85 |
@Value("${think.walnut.digital.recharge.enquiry.url}")
|
| - |
|
86 |
private String thinkWalnutDigitalRechargeEnquiryUrl;
|
| - |
|
87 |
|
| - |
|
88 |
@Value("${think.walnut.digital.recharge.enquiry.username}")
|
| - |
|
89 |
private String thinkWalnutDigitalRechargeEnquiryUserName;
|
| - |
|
90 |
|
| - |
|
91 |
@Value("${think.walnut.digital.recharge.enquiry.password}")
|
| - |
|
92 |
private String thinkWalnutDigitalRechargeEnquiryPassword;
|
| - |
|
93 |
|
| 83 |
@Value("${recharge.validation.auth.key}")
|
94 |
@Value("${think.walnut.digital.recharge.auth.key}")
|
| 84 |
private String rechargeValidationAuthKey;
|
95 |
private String thinkWalnutDigitalRechargeAuthKey;
|
| 85 |
|
96 |
|
| 86 |
@Autowired
|
97 |
@Autowired
|
| 87 |
private RechargeService rechargeService;
|
98 |
private RechargeService rechargeService;
|
| 88 |
|
99 |
|
| 89 |
@Autowired
|
100 |
@Autowired
|
| 90 |
private RechargeOperatorRepository rechargeOperatorRepository;
|
101 |
private RechargeOperatorRepository rechargeOperatorRepository;
|
| 91 |
|
102 |
|
| 92 |
@Autowired
|
103 |
@Autowired
|
| - |
|
104 |
private RechargeProviderRepository rechargeProviderRepository;
|
| - |
|
105 |
|
| - |
|
106 |
@Autowired
|
| 93 |
private RechargeTransactionRepository rechargeTransactionRepository;
|
107 |
private RechargeTransactionRepository rechargeTransactionRepository;
|
| 94 |
|
108 |
|
| 95 |
@Autowired
|
109 |
@Autowired
|
| 96 |
private RechargeCommissionRepository rechargeCommissionRepository;
|
110 |
private RechargeCommissionRepository rechargeCommissionRepository;
|
| 97 |
|
111 |
|
| Line 157... |
Line 171... |
| 157 |
rechargeOperatorIdNameMap.put(rechargeOperator.getId(), rechargeOperator);
|
171 |
rechargeOperatorIdNameMap.put(rechargeOperator.getId(), rechargeOperator);
|
| 158 |
}
|
172 |
}
|
| 159 |
return rechargeOperatorIdNameMap;
|
173 |
return rechargeOperatorIdNameMap;
|
| 160 |
}
|
174 |
}
|
| 161 |
|
175 |
|
| - |
|
176 |
private Map<Integer, String> rechargeCommissionsProviderIdNameMap(List<RechargeCommission> rechargeCommissions){
|
| - |
|
177 |
Map<Integer, String> rechargeProviderIdNameMap = new HashMap<>();
|
| - |
|
178 |
if(rechargeCommissions.isEmpty()) {
|
| - |
|
179 |
return rechargeProviderIdNameMap;
|
| - |
|
180 |
}
|
| - |
|
181 |
Set<Integer> providerIds = new HashSet<>();
|
| - |
|
182 |
for(RechargeCommission rechargeCommission : rechargeCommissions) {
|
| - |
|
183 |
providerIds.add(rechargeCommission.getProviderId());
|
| - |
|
184 |
}
|
| - |
|
185 |
|
| - |
|
186 |
List<RechargeProvider> rechargeProviders = rechargeProviderRepository.selectAllByIds(providerIds);
|
| - |
|
187 |
for(RechargeProvider rechargeProvider : rechargeProviders) {
|
| - |
|
188 |
rechargeProviderIdNameMap.put(rechargeProvider.getId(), rechargeProvider.getName());
|
| - |
|
189 |
}
|
| - |
|
190 |
return rechargeProviderIdNameMap;
|
| - |
|
191 |
}
|
| - |
|
192 |
|
| 162 |
@RequestMapping(value = "/createRecharge", method = RequestMethod.POST)
|
193 |
@RequestMapping(value = "/createRecharge", method = RequestMethod.POST)
|
| 163 |
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{
|
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{
|
| 164 |
LOGGER.info("Recharge request body {}", rechargeRequest);
|
195 |
LOGGER.info("Recharge request body {}", rechargeRequest);
|
| 165 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
196 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| - |
|
197 |
|
| 166 |
RechargeCredential rechargeTransactionMobileCredential = new RechargeCredential();
|
198 |
RechargeCredential rechargeTransactionMobileCredential = new RechargeCredential();
|
| 167 |
rechargeTransactionMobileCredential.setRechargeUrl(rechargeMobileUrl);
|
199 |
rechargeTransactionMobileCredential.setRechargeUrl(thinkWalnutDigitalRechargeTransactionMobileUrl);
|
| 168 |
rechargeTransactionMobileCredential.setRechargeUserName(rechargeMobileUserName);
|
200 |
rechargeTransactionMobileCredential.setRechargeUserName(thinkWalnutDigitalRechargeTransactionMobileUserName);
|
| 169 |
rechargeTransactionMobileCredential.setRechargePassword(rechargeMobilePassword);
|
201 |
rechargeTransactionMobileCredential.setRechargePassword(thinkWalnutDigitalRechargeTransactionMobilePassword);
|
| 170 |
rechargeTransactionMobileCredential.setRechargeAuthKey(rechargeAuthKey);
|
202 |
rechargeTransactionMobileCredential.setRechargeAuthKey(thinkWalnutDigitalRechargeAuthKey);
|
| 171 |
|
203 |
|
| 172 |
RechargeCredential rechargeTransactionDthCredential = new RechargeCredential();
|
204 |
RechargeCredential rechargeTransactionDthCredential = new RechargeCredential();
|
| 173 |
rechargeTransactionDthCredential.setRechargeUrl(rechargeDthUrl);
|
205 |
rechargeTransactionDthCredential.setRechargeUrl(thinkWalnutDigitalRechargeTransactionDthUrl);
|
| 174 |
rechargeTransactionDthCredential.setRechargeUserName(rechargeDthUserName);
|
206 |
rechargeTransactionDthCredential.setRechargeUserName(thinkWalnutDigitalRechargeTransactionDthUserName);
|
| 175 |
rechargeTransactionDthCredential.setRechargePassword(rechargeDthPassword);
|
207 |
rechargeTransactionDthCredential.setRechargePassword(thinkWalnutDigitalRechargeTransactionDthPassword);
|
| 176 |
rechargeTransactionDthCredential.setRechargeAuthKey(rechargeAuthKey);
|
208 |
rechargeTransactionDthCredential.setRechargeAuthKey(thinkWalnutDigitalRechargeAuthKey);
|
| 177 |
|
209 |
|
| - |
|
210 |
rechargeService.doRecharge(oxigenRechargeTransactionUrl, oxigenRechargeAuthKey, oxigenRechargeValidationUrl,
|
| 178 |
rechargeService.doRecharge(rechargeTransactionMobileCredential, rechargeTransactionDthCredential, rechargeValidationUrl, rechargeValidationAuthKey, loginDetails.getFofoId(), rechargeRequest);
|
211 |
oxigenRechargeValidationAuthKey, rechargeTransactionMobileCredential, rechargeTransactionDthCredential, loginDetails.getFofoId(), rechargeRequest);
|
| 179 |
RechargeType rechargeType = RechargeType.valueOf(rechargeRequest.getRechargeType());
|
212 |
RechargeType rechargeType = RechargeType.valueOf(rechargeRequest.getRechargeType());
|
| 180 |
List<RechargeTransaction> rechargeTransactions = rechargeTransactionRepository.selectAllByRetailerIdAndType(loginDetails.getFofoId(), rechargeType, offset, limit);
|
213 |
List<RechargeTransaction> rechargeTransactions = rechargeTransactionRepository.selectAllByRetailerIdAndType(loginDetails.getFofoId(), rechargeType, offset, limit);
|
| 181 |
long size = rechargeTransactionRepository.selectCountByRetailerIdAndType(loginDetails.getFofoId(), rechargeType);
|
214 |
long size = rechargeTransactionRepository.selectCountByRetailerIdAndType(loginDetails.getFofoId(), rechargeType);
|
| 182 |
Map<Integer, String> rechargeOperatorIdRechargeOperatorNameMap = this.rechargeTransactionsToRechargeOperatorIdNameMap(rechargeTransactions);
|
215 |
Map<Integer, String> rechargeOperatorIdRechargeOperatorNameMap = this.rechargeTransactionsToRechargeOperatorIdNameMap(rechargeTransactions);
|
| 183 |
model.addAttribute("rechargeTransactions", rechargeTransactions);
|
216 |
model.addAttribute("rechargeTransactions", rechargeTransactions);
|
| Line 198... |
Line 231... |
| 198 |
|
231 |
|
| 199 |
@RequestMapping(value = "/checkStatus", method = RequestMethod.GET)
|
232 |
@RequestMapping(value = "/checkStatus", method = RequestMethod.GET)
|
| 200 |
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{
|
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{
|
| 201 |
LOGGER.info("RequestId [{}], rechargeType [{}]", requestId, rechargeTypeString);
|
234 |
LOGGER.info("RequestId [{}], rechargeType [{}]", requestId, rechargeTypeString);
|
| 202 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
235 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 203 |
RechargeCredential rechargeTransactionEnquiryCredential = new RechargeCredential();
|
236 |
RechargeCredential thinkWalnutDigitalRechargeEnquiryCredential = new RechargeCredential();
|
| 204 |
rechargeTransactionEnquiryCredential.setRechargeUrl(rechargeEnquiryUrl);
|
237 |
thinkWalnutDigitalRechargeEnquiryCredential.setRechargeUrl(thinkWalnutDigitalRechargeEnquiryUrl);
|
| 205 |
rechargeTransactionEnquiryCredential.setRechargeUserName(rechargeEnquiryUserName);
|
238 |
thinkWalnutDigitalRechargeEnquiryCredential.setRechargeUserName(thinkWalnutDigitalRechargeEnquiryUserName);
|
| 206 |
rechargeTransactionEnquiryCredential.setRechargePassword(rechargeEnquiryPassword);
|
239 |
thinkWalnutDigitalRechargeEnquiryCredential.setRechargePassword(thinkWalnutDigitalRechargeEnquiryPassword);
|
| 207 |
rechargeTransactionEnquiryCredential.setRechargeAuthKey(rechargeAuthKey);
|
240 |
thinkWalnutDigitalRechargeEnquiryCredential.setRechargeAuthKey(thinkWalnutDigitalRechargeAuthKey);
|
| 208 |
rechargeService.checkStatus(rechargeTransactionEnquiryCredential, loginDetails.getFofoId(), requestId);
|
241 |
rechargeService.checkStatus(oxigenRechargeEnquiryUrl, oxigenRechargeAuthKey, thinkWalnutDigitalRechargeEnquiryCredential, loginDetails.getFofoId(), requestId);
|
| 209 |
RechargeType rechargeType = RechargeType.valueOf(rechargeTypeString);
|
242 |
RechargeType rechargeType = RechargeType.valueOf(rechargeTypeString);
|
| 210 |
List<RechargeTransaction> rechargeTransactions = rechargeTransactionRepository.selectAllByRetailerIdAndType(loginDetails.getFofoId(), rechargeType, offset, limit);
|
243 |
List<RechargeTransaction> rechargeTransactions = rechargeTransactionRepository.selectAllByRetailerIdAndType(loginDetails.getFofoId(), rechargeType, offset, limit);
|
| 211 |
//long size = rechargeTransactionRepository.selectCountByRetailerId(loginDetails.getFofoId());
|
244 |
//long size = rechargeTransactionRepository.selectCountByRetailerId(loginDetails.getFofoId());
|
| 212 |
Map<Integer, String> rechargeOperatorIdRechargeOperatorNameMap = this.rechargeTransactionsToRechargeOperatorIdNameMap(rechargeTransactions);
|
245 |
Map<Integer, String> rechargeOperatorIdRechargeOperatorNameMap = this.rechargeTransactionsToRechargeOperatorIdNameMap(rechargeTransactions);
|
| 213 |
model.addAttribute("rechargeTransactions", rechargeTransactions);
|
246 |
model.addAttribute("rechargeTransactions", rechargeTransactions);
|
| Line 323... |
Line 356... |
| 323 |
public String createRechargeCommission(HttpServletRequest request, @RequestBody RechargeCommissionRequest rechargeCommissionRequest, @RequestParam(name = "offset", defaultValue = "0") int offset, @RequestParam(name = "limit", defaultValue = "10") int limit, Model model) throws ProfitMandiBusinessException{
|
356 |
public String createRechargeCommission(HttpServletRequest request, @RequestBody RechargeCommissionRequest rechargeCommissionRequest, @RequestParam(name = "offset", defaultValue = "0") int offset, @RequestParam(name = "limit", defaultValue = "10") int limit, Model model) throws ProfitMandiBusinessException{
|
| 324 |
rechargeService.createRechargeCommission(rechargeCommissionRequest);
|
357 |
rechargeService.createRechargeCommission(rechargeCommissionRequest);
|
| 325 |
List<RechargeCommission> rechargeCommissions = rechargeCommissionRepository.selectAllPaginated(offset, limit);
|
358 |
List<RechargeCommission> rechargeCommissions = rechargeCommissionRepository.selectAllPaginated(offset, limit);
|
| 326 |
long size = rechargeCommissionRepository.selectAllCount();
|
359 |
long size = rechargeCommissionRepository.selectAllCount();
|
| 327 |
Map<Integer, RechargeOperator> rechargeOperatorIdRechargeOperatorMap = this.rechargeCommissionsOperatorIdRechargeOperatorMap(rechargeCommissions);
|
360 |
Map<Integer, RechargeOperator> rechargeOperatorIdRechargeOperatorMap = this.rechargeCommissionsOperatorIdRechargeOperatorMap(rechargeCommissions);
|
| - |
|
361 |
Map<Integer, String> rechargeProviderIdNameMap = this.rechargeCommissionsProviderIdNameMap(rechargeCommissions);
|
| 328 |
model.addAttribute("rechargeCommissions", rechargeCommissions);
|
362 |
model.addAttribute("rechargeCommissions", rechargeCommissions);
|
| 329 |
model.addAttribute("rechargeOperatorIdRechargeOperatorMap", rechargeOperatorIdRechargeOperatorMap);
|
363 |
model.addAttribute("rechargeOperatorIdRechargeOperatorMap", rechargeOperatorIdRechargeOperatorMap);
|
| - |
|
364 |
model.addAttribute("rechargeProviderIdNameMap", rechargeProviderIdNameMap);
|
| 330 |
model.addAttribute("start", offset + 1);
|
365 |
model.addAttribute("start", offset + 1);
|
| 331 |
model.addAttribute("size", size);
|
366 |
model.addAttribute("size", size);
|
| 332 |
if (rechargeCommissions.size() < limit){
|
367 |
if (rechargeCommissions.size() < limit){
|
| 333 |
model.addAttribute("end", offset + rechargeCommissions.size());
|
368 |
model.addAttribute("end", offset + rechargeCommissions.size());
|
| 334 |
}else{
|
369 |
}else{
|
| Line 342... |
Line 377... |
| 342 |
//LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
377 |
//LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 343 |
//RechargeType rechargeType = RechargeType.valueOf(rechargeTypeString);
|
378 |
//RechargeType rechargeType = RechargeType.valueOf(rechargeTypeString);
|
| 344 |
List<RechargeCommission> rechargeCommissions = rechargeCommissionRepository.selectAllPaginated(offset, limit);
|
379 |
List<RechargeCommission> rechargeCommissions = rechargeCommissionRepository.selectAllPaginated(offset, limit);
|
| 345 |
long size = rechargeCommissionRepository.selectAllCount();
|
380 |
long size = rechargeCommissionRepository.selectAllCount();
|
| 346 |
Map<Integer, RechargeOperator> rechargeOperatorIdRechargeOperatorMap = this.rechargeCommissionsOperatorIdRechargeOperatorMap(rechargeCommissions);
|
381 |
Map<Integer, RechargeOperator> rechargeOperatorIdRechargeOperatorMap = this.rechargeCommissionsOperatorIdRechargeOperatorMap(rechargeCommissions);
|
| - |
|
382 |
Map<Integer, String> rechargeProviderIdNameMap = this.rechargeCommissionsProviderIdNameMap(rechargeCommissions);
|
| 347 |
model.addAttribute("rechargeCommissions", rechargeCommissions);
|
383 |
model.addAttribute("rechargeCommissions", rechargeCommissions);
|
| 348 |
model.addAttribute("rechargeOperatorIdRechargeOperatorMap", rechargeOperatorIdRechargeOperatorMap);
|
384 |
model.addAttribute("rechargeOperatorIdRechargeOperatorMap", rechargeOperatorIdRechargeOperatorMap);
|
| - |
|
385 |
model.addAttribute("rechargeProviderIdNameMap", rechargeProviderIdNameMap);
|
| 349 |
model.addAttribute("start", offset + 1);
|
386 |
model.addAttribute("start", offset + 1);
|
| 350 |
model.addAttribute("size", size);
|
387 |
model.addAttribute("size", size);
|
| 351 |
if (rechargeCommissions.size() < limit){
|
388 |
if (rechargeCommissions.size() < limit){
|
| 352 |
model.addAttribute("end", offset + rechargeCommissions.size());
|
389 |
model.addAttribute("end", offset + rechargeCommissions.size());
|
| 353 |
}else{
|
390 |
}else{
|
| Line 360... |
Line 397... |
| 360 |
public String getPaginatedRechargeCommissions(HttpServletRequest request, @RequestParam(name = "offset", defaultValue = "0") int offset, @RequestParam(name = "limit", defaultValue = "10") int limit, Model model) throws ProfitMandiBusinessException{
|
397 |
public String getPaginatedRechargeCommissions(HttpServletRequest request, @RequestParam(name = "offset", defaultValue = "0") int offset, @RequestParam(name = "limit", defaultValue = "10") int limit, Model model) throws ProfitMandiBusinessException{
|
| 361 |
//LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
398 |
//LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 362 |
//RechargeType rechargeType = RechargeType.valueOf(rechargeTypeString);
|
399 |
//RechargeType rechargeType = RechargeType.valueOf(rechargeTypeString);
|
| 363 |
List<RechargeCommission> rechargeCommissions = rechargeCommissionRepository.selectAllPaginated(offset, limit);
|
400 |
List<RechargeCommission> rechargeCommissions = rechargeCommissionRepository.selectAllPaginated(offset, limit);
|
| 364 |
Map<Integer, RechargeOperator> rechargeOperatorIdRechargeOperatorMap = this.rechargeCommissionsOperatorIdRechargeOperatorMap(rechargeCommissions);
|
401 |
Map<Integer, RechargeOperator> rechargeOperatorIdRechargeOperatorMap = this.rechargeCommissionsOperatorIdRechargeOperatorMap(rechargeCommissions);
|
| - |
|
402 |
Map<Integer, String> rechargeProviderIdNameMap = this.rechargeCommissionsProviderIdNameMap(rechargeCommissions);
|
| 365 |
model.addAttribute("rechargeCommissions", rechargeCommissions);
|
403 |
model.addAttribute("rechargeCommissions", rechargeCommissions);
|
| 366 |
model.addAttribute("rechargeOperatorIdRechargeOperatorMap", rechargeOperatorIdRechargeOperatorMap);
|
404 |
model.addAttribute("rechargeOperatorIdRechargeOperatorMap", rechargeOperatorIdRechargeOperatorMap);
|
| - |
|
405 |
model.addAttribute("rechargeProviderIdNameMap", rechargeProviderIdNameMap);
|
| 367 |
return "recharge-commissions-paginated";
|
406 |
return "recharge-commissions-paginated";
|
| 368 |
}
|
407 |
}
|
| 369 |
|
408 |
|
| 370 |
@RequestMapping(value = "/getRechargeCommissionByOperatorId", method = RequestMethod.GET)
|
409 |
@RequestMapping(value = "/getRechargeCommissionByOperatorId", method = RequestMethod.GET)
|
| 371 |
public String getRechargeCommissionByOperatorId(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.OPERATOR_ID) int operatorId, Model model) throws ProfitMandiBusinessException{
|
410 |
public String getRechargeCommissionByOperatorId(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.OPERATOR_ID) int operatorId, @RequestParam(name = ProfitMandiConstants.PROVIDER_ID) int providerId, Model model) throws ProfitMandiBusinessException{
|
| 372 |
RechargeOperator rechargeOperator = rechargeOperatorRepository.selectById(operatorId);
|
411 |
RechargeOperator rechargeOperator = rechargeOperatorRepository.selectById(operatorId);
|
| 373 |
RechargeCommission rechargeCommission = rechargeCommissionRepository.selectByOperatorId(operatorId);
|
412 |
RechargeCommission rechargeCommission = rechargeCommissionRepository.selectByOperatorIdAndProviderId(operatorId, providerId);
|
| 374 |
model.addAttribute("rechargeCommission", rechargeCommission);
|
413 |
model.addAttribute("rechargeCommission", rechargeCommission);
|
| 375 |
model.addAttribute("rechargeOperator", rechargeOperator);
|
414 |
model.addAttribute("rechargeOperator", rechargeOperator);
|
| 376 |
return "recharge-commission-details";
|
415 |
return "recharge-commission-details";
|
| 377 |
}
|
416 |
}
|
| 378 |
|
417 |
|
| 379 |
@RequestMapping(value = "/updateRechargeCommission", method = RequestMethod.PUT)
|
418 |
@RequestMapping(value = "/updateRechargeCommission", method = RequestMethod.PUT)
|
| 380 |
public String updateRechargeCommission(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.OPERATOR_ID) int operatorId, @RequestParam(name = ProfitMandiConstants.AMOUNT_TYPE) String amountTypeString, @RequestParam(name = ProfitMandiConstants.AMOUNT) float amount, @RequestParam(name = "offset", defaultValue = "0") int offset, @RequestParam(name = "limit", defaultValue = "10") int limit, Model model) throws ProfitMandiBusinessException{
|
419 |
public String updateRechargeCommission(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.OPERATOR_ID) int operatorId, @RequestParam(name = ProfitMandiConstants.PROVIDER_ID) int providerId, @RequestParam(name = ProfitMandiConstants.AMOUNT_TYPE) String amountTypeString, @RequestParam(name = ProfitMandiConstants.AMOUNT) float amount, @RequestParam(name = "offset", defaultValue = "0") int offset, @RequestParam(name = "limit", defaultValue = "10") int limit, Model model) throws ProfitMandiBusinessException{
|
| 381 |
rechargeService.updateRechargeCommission(operatorId, amountTypeString, amount);
|
420 |
rechargeService.updateRechargeCommission(operatorId, providerId, amountTypeString, amount);
|
| 382 |
List<RechargeCommission> rechargeCommissions = rechargeCommissionRepository.selectAllPaginated(offset, limit);
|
421 |
List<RechargeCommission> rechargeCommissions = rechargeCommissionRepository.selectAllPaginated(offset, limit);
|
| 383 |
Map<Integer, RechargeOperator> rechargeOperatorIdRechargeOperatorMap = this.rechargeCommissionsOperatorIdRechargeOperatorMap(rechargeCommissions);
|
422 |
Map<Integer, RechargeOperator> rechargeOperatorIdRechargeOperatorMap = this.rechargeCommissionsOperatorIdRechargeOperatorMap(rechargeCommissions);
|
| - |
|
423 |
Map<Integer, String> rechargeProviderIdNameMap = this.rechargeCommissionsProviderIdNameMap(rechargeCommissions);
|
| 384 |
model.addAttribute("rechargeCommissions", rechargeCommissions);
|
424 |
model.addAttribute("rechargeCommissions", rechargeCommissions);
|
| 385 |
model.addAttribute("rechargeOperatorIdRechargeOperatorMap", rechargeOperatorIdRechargeOperatorMap);
|
425 |
model.addAttribute("rechargeOperatorIdRechargeOperatorMap", rechargeOperatorIdRechargeOperatorMap);
|
| - |
|
426 |
model.addAttribute("rechargeProviderIdNameMap", rechargeProviderIdNameMap);
|
| 386 |
return "recharge-commissions-paginated";
|
427 |
return "recharge-commissions-paginated";
|
| 387 |
}
|
428 |
}
|
| 388 |
|
429 |
|
| 389 |
|
430 |
|
| 390 |
}
|
431 |
}
|
| 391 |
|
432 |
|