| 30859 |
tejbeer |
1 |
package com.spice.profitmandi.web.controller;
|
|
|
2 |
|
|
|
3 |
import java.math.BigDecimal;
|
|
|
4 |
import java.math.RoundingMode;
|
|
|
5 |
import java.time.LocalDate;
|
|
|
6 |
import java.time.LocalDateTime;
|
|
|
7 |
import java.util.Arrays;
|
|
|
8 |
import java.util.HashMap;
|
|
|
9 |
import java.util.List;
|
|
|
10 |
import java.util.Map;
|
|
|
11 |
import java.util.Map.Entry;
|
|
|
12 |
import java.util.stream.Collectors;
|
|
|
13 |
|
|
|
14 |
import javax.servlet.http.HttpServletRequest;
|
|
|
15 |
import javax.transaction.Transactional;
|
|
|
16 |
|
|
|
17 |
import org.apache.logging.log4j.LogManager;
|
|
|
18 |
import org.apache.logging.log4j.Logger;
|
|
|
19 |
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
20 |
import org.springframework.stereotype.Controller;
|
|
|
21 |
import org.springframework.ui.Model;
|
|
|
22 |
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
23 |
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
24 |
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
25 |
|
|
|
26 |
import com.spice.profitmandi.common.enumuration.MessageType;
|
|
|
27 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
|
|
28 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
|
|
29 |
import com.spice.profitmandi.common.model.SendNotificationModel;
|
|
|
30 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
|
|
31 |
import com.spice.profitmandi.dao.entity.dtr.CreditAccount;
|
|
|
32 |
import com.spice.profitmandi.dao.entity.dtr.CreditStatus;
|
| 30913 |
tejbeer |
33 |
import com.spice.profitmandi.dao.entity.fofo.CurrentPartnerDailyInvestment;
|
| 30859 |
tejbeer |
34 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
|
|
35 |
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
|
|
|
36 |
import com.spice.profitmandi.dao.entity.transaction.SDCreditRequirement;
|
|
|
37 |
import com.spice.profitmandi.dao.entity.transaction.SanctionRequest;
|
|
|
38 |
import com.spice.profitmandi.dao.enumuration.fofo.Gateway;
|
|
|
39 |
import com.spice.profitmandi.dao.enumuration.transaction.CreditRisk;
|
|
|
40 |
import com.spice.profitmandi.dao.enumuration.transaction.SanctionStatus;
|
|
|
41 |
import com.spice.profitmandi.dao.model.SanctionRequestModel;
|
|
|
42 |
import com.spice.profitmandi.dao.model.SdCreditRequirementModel;
|
|
|
43 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
|
|
44 |
import com.spice.profitmandi.dao.repository.dtr.CreditAccountRepository;
|
|
|
45 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
|
|
46 |
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
|
| 30913 |
tejbeer |
47 |
import com.spice.profitmandi.dao.repository.fofo.CurrentPartnerDailyInvestmentRepository;
|
| 30859 |
tejbeer |
48 |
import com.spice.profitmandi.dao.repository.fofo.PartnerDailyInvestmentRepository;
|
|
|
49 |
import com.spice.profitmandi.dao.repository.transaction.SDCreditRequirementRepository;
|
|
|
50 |
import com.spice.profitmandi.dao.repository.transaction.SanctionRequestRepository;
|
|
|
51 |
import com.spice.profitmandi.service.NotificationService;
|
|
|
52 |
import com.spice.profitmandi.service.transaction.SDCreditService;
|
|
|
53 |
import com.spice.profitmandi.service.user.RetailerService;
|
|
|
54 |
|
|
|
55 |
@Controller
|
|
|
56 |
@Transactional(rollbackOn = Throwable.class)
|
|
|
57 |
public class SDCreditController {
|
|
|
58 |
|
|
|
59 |
@Autowired
|
|
|
60 |
private RetailerService retailerService;
|
|
|
61 |
|
|
|
62 |
@Autowired
|
|
|
63 |
SDCreditRequirementRepository sdCreditRequirementRepository;
|
|
|
64 |
|
|
|
65 |
@Autowired
|
|
|
66 |
SanctionRequestRepository sanctionRequestRepository;
|
|
|
67 |
|
|
|
68 |
@Autowired
|
|
|
69 |
PartnerDailyInvestmentRepository partnerDailyInvestmentRepository;
|
|
|
70 |
|
|
|
71 |
@Autowired
|
|
|
72 |
private FofoStoreRepository fofoStoreRepository;
|
|
|
73 |
|
|
|
74 |
@Autowired
|
|
|
75 |
private CreditAccountRepository creditAccountRepository;
|
|
|
76 |
|
|
|
77 |
@Autowired
|
|
|
78 |
private SDCreditService sdCreditService;
|
|
|
79 |
|
|
|
80 |
@Autowired
|
|
|
81 |
private NotificationService notificationService;
|
|
|
82 |
|
|
|
83 |
@Autowired
|
|
|
84 |
private AuthRepository authRepository;
|
|
|
85 |
|
|
|
86 |
@Autowired
|
|
|
87 |
private UserRepository userRepository;
|
|
|
88 |
|
| 30913 |
tejbeer |
89 |
@Autowired
|
|
|
90 |
private CurrentPartnerDailyInvestmentRepository currentPartnerDailyInvestmentRepository;
|
|
|
91 |
|
| 30859 |
tejbeer |
92 |
private static final Logger LOGGER = LogManager.getLogger(SDCreditController.class);
|
|
|
93 |
|
|
|
94 |
@RequestMapping(value = "/getSDCreditReq", method = RequestMethod.GET)
|
|
|
95 |
public String getSDCreditReq(HttpServletRequest request, Model model) throws ProfitMandiBusinessException {
|
|
|
96 |
|
|
|
97 |
Map<Integer, CustomRetailer> customRetailerMap = retailerService.getFofoRetailers(true);
|
|
|
98 |
|
|
|
99 |
Map<Integer, SDCreditRequirement> sdCreditRequirementMap = sdCreditRequirementRepository.selectAll().stream()
|
|
|
100 |
.collect(Collectors.toMap(x -> x.getFofoId(), x -> x));
|
| 30913 |
tejbeer |
101 |
Map<Integer, CurrentPartnerDailyInvestment> currentPartnerDailyInvestmentMap = currentPartnerDailyInvestmentRepository
|
|
|
102 |
.selectAll().stream().collect(Collectors.toMap(x -> x.getFofoId(), x -> x));
|
| 30859 |
tejbeer |
103 |
|
|
|
104 |
for (Entry<Integer, CustomRetailer> customRetailerEntry : customRetailerMap.entrySet()) {
|
|
|
105 |
int fofoId = customRetailerEntry.getKey();
|
|
|
106 |
|
|
|
107 |
SDCreditRequirement sdCreditRequirement = sdCreditRequirementMap.get(customRetailerEntry.getKey());
|
|
|
108 |
|
| 30921 |
tejbeer |
109 |
CurrentPartnerDailyInvestment currentPartnerDailyInvestment = currentPartnerDailyInvestmentMap.get(fofoId);
|
|
|
110 |
BigDecimal suggestedAmount = BigDecimal.ZERO;
|
|
|
111 |
if (currentPartnerDailyInvestment != null) {
|
|
|
112 |
suggestedAmount = BigDecimal.valueOf(currentPartnerDailyInvestment.getTotalInvestment() * 0.1);
|
|
|
113 |
}
|
| 30913 |
tejbeer |
114 |
|
| 30921 |
tejbeer |
115 |
if (suggestedAmount.doubleValue() > 200000) {
|
| 30910 |
tejbeer |
116 |
|
| 30921 |
tejbeer |
117 |
suggestedAmount = BigDecimal.valueOf(200000);
|
| 30910 |
tejbeer |
118 |
|
| 30921 |
tejbeer |
119 |
}
|
| 30910 |
tejbeer |
120 |
|
| 30921 |
tejbeer |
121 |
if (suggestedAmount.doubleValue() < 0) {
|
|
|
122 |
suggestedAmount = BigDecimal.ZERO;
|
|
|
123 |
}
|
| 30910 |
tejbeer |
124 |
|
| 30921 |
tejbeer |
125 |
LOGGER.info("suggestedAmount {} ", suggestedAmount);
|
| 30910 |
tejbeer |
126 |
|
| 30921 |
tejbeer |
127 |
if (sdCreditRequirement == null) {
|
|
|
128 |
sdCreditRequirement = new SDCreditRequirement();
|
|
|
129 |
sdCreditRequirement.setFofoId(fofoId);
|
|
|
130 |
sdCreditRequirement.setCreditDays(15);
|
| 30922 |
tejbeer |
131 |
sdCreditRequirement.setRisk(CreditRisk.NO_RISK);
|
| 30921 |
tejbeer |
132 |
sdCreditRequirement.setInterestRate(BigDecimal.valueOf(0.05));
|
|
|
133 |
sdCreditRequirement.setSuggestedLimit(suggestedAmount);
|
|
|
134 |
sdCreditRequirement.setLimit(suggestedAmount);
|
|
|
135 |
sdCreditRequirement.setUtilizedAmount(BigDecimal.ZERO);
|
|
|
136 |
sdCreditRequirement.setAvailableLimit(suggestedAmount);
|
|
|
137 |
sdCreditRequirement.setCreateTimestamp(LocalDateTime.now());
|
| 30859 |
tejbeer |
138 |
sdCreditRequirement.setUpdateTimestamp(LocalDateTime.now());
|
| 30921 |
tejbeer |
139 |
sdCreditRequirementRepository.persist(sdCreditRequirement);
|
| 30859 |
tejbeer |
140 |
}
|
|
|
141 |
|
| 30921 |
tejbeer |
142 |
sdCreditRequirement.setSuggestedLimit(suggestedAmount);
|
|
|
143 |
sdCreditRequirement.setLimit(suggestedAmount);
|
|
|
144 |
BigDecimal utilizedLimit = new BigDecimal(sdCreditService.getUtilizationAmount(fofoId));
|
|
|
145 |
|
|
|
146 |
BigDecimal availableLimit = sdCreditRequirement.getLimit().subtract(utilizedLimit);
|
|
|
147 |
|
|
|
148 |
LOGGER.info("utilizedLimit {} ", utilizedLimit);
|
|
|
149 |
|
|
|
150 |
LOGGER.info("availableLimit {} ", availableLimit);
|
|
|
151 |
|
|
|
152 |
sdCreditRequirement.setUtilizedAmount(utilizedLimit);
|
|
|
153 |
|
|
|
154 |
sdCreditRequirement.setAvailableLimit(availableLimit);
|
|
|
155 |
|
|
|
156 |
sdCreditRequirement.setUpdateTimestamp(LocalDateTime.now());
|
|
|
157 |
|
| 30859 |
tejbeer |
158 |
}
|
|
|
159 |
|
| 30922 |
tejbeer |
160 |
model.addAttribute("customRetailerMap", customRetailerMap);
|
|
|
161 |
model.addAttribute("sdCreditRequirementMap", sdCreditRequirementMap);
|
|
|
162 |
return "sd-credit";
|
| 30859 |
tejbeer |
163 |
|
| 30921 |
tejbeer |
164 |
}
|
|
|
165 |
|
| 30859 |
tejbeer |
166 |
@RequestMapping(value = "/creditRequirement", method = RequestMethod.POST)
|
|
|
167 |
public String sdCredit(HttpServletRequest request, @RequestBody SdCreditRequirementModel sdCreditRequirementModel,
|
|
|
168 |
Model model) throws Exception {
|
|
|
169 |
|
|
|
170 |
LOGGER.info("sdCreditRequirementModel {} ", sdCreditRequirementModel);
|
|
|
171 |
|
|
|
172 |
int fofoId = sdCreditRequirementModel.getFofoId();
|
|
|
173 |
|
|
|
174 |
SDCreditRequirement sdCreditRequirement = sdCreditRequirementRepository
|
|
|
175 |
.selectByFofoId(sdCreditRequirementModel.getFofoId());
|
|
|
176 |
|
|
|
177 |
FofoStore fofoStore = fofoStoreRepository.selectByRetailerId(sdCreditRequirementModel.getFofoId());
|
|
|
178 |
BigDecimal suggestedAmount = new BigDecimal((fofoStore.getMinimumInvestment() * 0.1));
|
|
|
179 |
|
|
|
180 |
LOGGER.info("sdCreditRequirement {} ", sdCreditRequirement);
|
|
|
181 |
|
|
|
182 |
sdCreditRequirement.setSecurityCheck(sdCreditRequirementModel.getSecurityCheck());
|
|
|
183 |
// sdCreditRequirement.setSecurityCheck(2);
|
|
|
184 |
|
|
|
185 |
sdCreditRequirement.setInterestRate(sdCreditRequirementModel.getInterest());
|
|
|
186 |
sdCreditRequirement.setFreeDays(sdCreditRequirementModel.getFreeDays());
|
|
|
187 |
sdCreditRequirement.setLimit(sdCreditRequirementModel.getLimit());
|
|
|
188 |
sdCreditRequirement.setSuggestedLimit(suggestedAmount);
|
| 30865 |
tejbeer |
189 |
BigDecimal utilizedLimit = new BigDecimal(sdCreditService.getUtilizationAmount(fofoId));
|
|
|
190 |
|
|
|
191 |
BigDecimal availableLimit = sdCreditRequirement.getLimit().subtract(utilizedLimit);
|
|
|
192 |
|
| 30909 |
tejbeer |
193 |
LOGGER.info("utilizedLimit {} ", utilizedLimit);
|
|
|
194 |
|
|
|
195 |
LOGGER.info("availableLimit {} ", availableLimit);
|
|
|
196 |
|
| 30859 |
tejbeer |
197 |
sdCreditRequirement.setUtilizedAmount(utilizedLimit);
|
|
|
198 |
|
|
|
199 |
sdCreditRequirement.setAvailableLimit(availableLimit);
|
|
|
200 |
sdCreditRequirement.setCreditDays(15);
|
|
|
201 |
sdCreditRequirement.setRisk(CreditRisk.NO_RISK);
|
|
|
202 |
|
|
|
203 |
sdCreditRequirement.setUpdateTimestamp(LocalDateTime.now());
|
|
|
204 |
|
|
|
205 |
if (sdCreditRequirement.getSecurityCheck() > 0) {
|
|
|
206 |
|
|
|
207 |
CreditAccount creditAccount = creditAccountRepository
|
|
|
208 |
.selectByFofoIdAndGateway(sdCreditRequirementModel.getFofoId(), Gateway.SDDIRECT);
|
|
|
209 |
if (creditAccount == null) {
|
|
|
210 |
creditAccount = new CreditAccount();
|
|
|
211 |
creditAccount.setFofoId(sdCreditRequirementModel.getFofoId());
|
|
|
212 |
creditAccount.setGateway(Gateway.SDDIRECT);
|
|
|
213 |
creditAccount.setCreditStatus(CreditStatus.SANCTIONED);
|
|
|
214 |
creditAccount.setActive(false);
|
|
|
215 |
|
|
|
216 |
creditAccount.setUpdatedOn(LocalDateTime.now());
|
|
|
217 |
|
|
|
218 |
creditAccountRepository.persist(creditAccount);
|
|
|
219 |
}
|
|
|
220 |
|
|
|
221 |
creditAccount.setInterestRate(sdCreditRequirement.getInterestRate().floatValue());
|
|
|
222 |
creditAccount.setSanctionedAmount(sdCreditRequirement.getLimit().floatValue());
|
|
|
223 |
creditAccount.setAvailableAmount(availableLimit.floatValue());
|
|
|
224 |
creditAccount.setFreeDays(sdCreditRequirement.getFreeDays());
|
|
|
225 |
creditAccount.setUpdatedOn(LocalDateTime.now());
|
|
|
226 |
|
|
|
227 |
}
|
|
|
228 |
LOGGER.info("sdCreditRequirement {} ", sdCreditRequirement);
|
|
|
229 |
|
|
|
230 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(sdCreditRequirementModel.getFofoId());
|
|
|
231 |
|
| 30865 |
tejbeer |
232 |
sdCreditRequirement = sdCreditRequirementRepository.selectByFofoId(sdCreditRequirementModel.getFofoId());
|
|
|
233 |
|
| 30859 |
tejbeer |
234 |
Map<Integer, SDCreditRequirement> sdCreditRequirementMap = new HashMap<>();
|
|
|
235 |
sdCreditRequirementMap.put(sdCreditRequirement.getFofoId(), sdCreditRequirement);
|
|
|
236 |
model.addAttribute("sdCreditRequirementMap", sdCreditRequirementMap);
|
|
|
237 |
model.addAttribute("customRetailer", customRetailer);
|
|
|
238 |
|
|
|
239 |
return "sd-credit-requirement-row";
|
|
|
240 |
|
|
|
241 |
}
|
|
|
242 |
|
|
|
243 |
@RequestMapping(value = "/getSanctionRequest", method = RequestMethod.GET)
|
|
|
244 |
public String getSanctionRequest(HttpServletRequest request, Model model) throws ProfitMandiBusinessException {
|
|
|
245 |
|
|
|
246 |
List<SanctionRequest> sanctionRequests = sanctionRequestRepository.selectByDate(LocalDate.now());
|
|
|
247 |
|
|
|
248 |
List<Integer> fofoIds = sanctionRequests.stream().map(x -> x.getFofoId()).collect(Collectors.toList());
|
|
|
249 |
|
|
|
250 |
Map<Integer, SDCreditRequirement> sdCreditRequirementMap = sdCreditRequirementRepository.selectAll().stream()
|
|
|
251 |
.collect(Collectors.toMap(x -> x.getFofoId(), x -> x));
|
|
|
252 |
|
|
|
253 |
if (!sanctionRequests.isEmpty()) {
|
|
|
254 |
|
|
|
255 |
Map<Integer, CustomRetailer> customRetailerMap = retailerService.getFofoRetailers(fofoIds);
|
|
|
256 |
Map<Integer, PartnerDailyInvestment> partnerDailyInvestmentMap = partnerDailyInvestmentRepository
|
|
|
257 |
.selectAll(fofoIds, LocalDate.now().minusDays(90)).stream()
|
|
|
258 |
.collect(Collectors.toMap(x -> x.getFofoId(), x -> x));
|
|
|
259 |
|
|
|
260 |
model.addAttribute("customRetailerMap", customRetailerMap);
|
|
|
261 |
|
|
|
262 |
model.addAttribute("partnerDailyInvestmentMap", partnerDailyInvestmentMap);
|
|
|
263 |
|
|
|
264 |
}
|
|
|
265 |
|
|
|
266 |
model.addAttribute("sanctionRequests", sanctionRequests);
|
|
|
267 |
|
|
|
268 |
model.addAttribute("sdCreditRequirementMap", sdCreditRequirementMap);
|
|
|
269 |
|
|
|
270 |
model.addAttribute("sanctionStatus", SanctionStatus.values());
|
|
|
271 |
return "sanction-request";
|
|
|
272 |
|
|
|
273 |
}
|
|
|
274 |
|
|
|
275 |
@RequestMapping(value = "/sanctionRequest", method = RequestMethod.POST)
|
|
|
276 |
public String sanctionRequest(HttpServletRequest request, @RequestBody SanctionRequestModel sanctionRequestModel,
|
|
|
277 |
Model model) throws Exception {
|
|
|
278 |
|
|
|
279 |
LOGGER.info("sanctionRequestModel {} ", sanctionRequestModel);
|
|
|
280 |
Map<Integer, SDCreditRequirement> sdCreditRequirementMap = sdCreditRequirementRepository.selectAll().stream()
|
|
|
281 |
.collect(Collectors.toMap(x -> x.getFofoId(), x -> x));
|
|
|
282 |
|
|
|
283 |
SanctionRequest sanctionRequest = sanctionRequestRepository.selectById(sanctionRequestModel.getId());
|
|
|
284 |
List<Integer> fofoIds = sanctionRequestRepository.selectByDate(LocalDate.now()).stream().map(x -> x.getFofoId())
|
|
|
285 |
.collect(Collectors.toList());
|
|
|
286 |
|
|
|
287 |
Map<Integer, CustomRetailer> customRetailerMap = retailerService.getFofoRetailers(fofoIds);
|
|
|
288 |
|
|
|
289 |
LOGGER.info("freeDays {} ", sdCreditRequirementMap.get(sanctionRequest.getFofoId()).getFreeDays());
|
|
|
290 |
|
|
|
291 |
if (sanctionRequestModel.getStatus().equals(SanctionStatus.APPROVED)) {
|
|
|
292 |
CustomRetailer customRetailer = customRetailerMap.get(sanctionRequest.getFofoId());
|
|
|
293 |
sanctionRequest.setApprovalTimestamp(LocalDateTime.now());
|
|
|
294 |
BigDecimal availableAmount = sdCreditService.getAvailableAmount(sanctionRequest.getFofoId());
|
|
|
295 |
|
|
|
296 |
String title = "Sanction Request Approved";
|
|
|
297 |
String url = "http://app.smartdukaan.com/pages/home/credit";
|
|
|
298 |
String message = "congratulations! Your credit limit is increased for today Rs."
|
|
|
299 |
+ sanctionRequest.getApprovalAmount().setScale(2, RoundingMode.HALF_UP)
|
|
|
300 |
+ " your total available limit is Rs." + availableAmount.setScale(2, RoundingMode.HALF_UP);
|
|
|
301 |
notificationService.sendNotification(sanctionRequest.getFofoId(), title, MessageType.notification, title,
|
|
|
302 |
message, url);
|
|
|
303 |
|
|
|
304 |
AuthUser authUser = authRepository.selectById(sanctionRequest.getAuthId());
|
|
|
305 |
|
|
|
306 |
SendNotificationModel sendNotificationModel = new SendNotificationModel();
|
|
|
307 |
sendNotificationModel.setCampaignName("Loan");
|
|
|
308 |
sendNotificationModel.setTitle("Sanction Request Approved");
|
|
|
309 |
sendNotificationModel.setMessage("congratulations! Your Partner " + customRetailer.getBusinessName()
|
|
|
310 |
+ "credit limit is increased for today Rs."
|
|
|
311 |
+ sanctionRequest.getApprovalAmount().setScale(2, RoundingMode.HALF_UP)
|
|
|
312 |
+ " your total available limit is Rs." + availableAmount.setScale(2, RoundingMode.HALF_UP));
|
|
|
313 |
sendNotificationModel.setType("url");
|
|
|
314 |
sendNotificationModel.setUrl("https://app.smartdukaan.com/pages/home/credit");
|
|
|
315 |
sendNotificationModel.setExpiresat(LocalDateTime.now().plusDays(2));
|
|
|
316 |
sendNotificationModel.setMessageType(MessageType.notification);
|
|
|
317 |
sendNotificationModel
|
|
|
318 |
.setUserIds(Arrays.asList(userRepository.selectByEmailId(authUser.getEmailId()).getId()));
|
|
|
319 |
System.out.println(sendNotificationModel);
|
|
|
320 |
notificationService.sendNotification(sendNotificationModel);
|
|
|
321 |
|
|
|
322 |
}
|
|
|
323 |
|
|
|
324 |
if (sdCreditRequirementMap.get(sanctionRequest.getFofoId()).getFreeDays() >= sanctionRequestModel
|
|
|
325 |
.getFreeDays()) {
|
|
|
326 |
sanctionRequest.setFreeDays(sanctionRequestModel.getFreeDays());
|
|
|
327 |
} else {
|
|
|
328 |
throw new ProfitMandiBusinessException("Free Days", "Free Days", "Free Days is not more than "
|
|
|
329 |
+ sdCreditRequirementMap.get(sanctionRequest.getFofoId()).getFreeDays() + " days ");
|
|
|
330 |
}
|
|
|
331 |
|
|
|
332 |
sanctionRequest.setApprovalAmount(sanctionRequestModel.getApprovalAmount());
|
|
|
333 |
sanctionRequest.setStatus(sanctionRequestModel.getStatus());
|
|
|
334 |
|
|
|
335 |
Map<Integer, PartnerDailyInvestment> partnerDailyInvestmentMap = partnerDailyInvestmentRepository
|
|
|
336 |
.selectAll(fofoIds, LocalDate.now().minusDays(90)).stream()
|
|
|
337 |
.collect(Collectors.toMap(x -> x.getFofoId(), x -> x));
|
|
|
338 |
sanctionRequest = sanctionRequestRepository.selectById(sanctionRequestModel.getId());
|
|
|
339 |
model.addAttribute("customRetailerMap", customRetailerMap);
|
|
|
340 |
model.addAttribute("sanctionRequest", sanctionRequest);
|
|
|
341 |
model.addAttribute("partnerDailyInvestmentMap", partnerDailyInvestmentMap);
|
|
|
342 |
model.addAttribute("sdCreditRequirementMap", sdCreditRequirementMap);
|
|
|
343 |
|
|
|
344 |
model.addAttribute("sanctionStatus", SanctionStatus.values());
|
|
|
345 |
|
|
|
346 |
return "sanction-request-row";
|
|
|
347 |
|
|
|
348 |
}
|
|
|
349 |
|
|
|
350 |
}
|