Subversion Repositories SmartDukaan

Rev

Rev 33518 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
33507 tejus.loha 1
package com.spice.profitmandi.web.controller;
2
 
3
import com.fasterxml.jackson.databind.ObjectMapper;
4
import com.spice.profitmandi.common.enumuration.BusinessType;
5
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
6
import com.spice.profitmandi.common.model.ProfitMandiConstants;
7
import com.spice.profitmandi.dao.entity.auth.AuthUser;
8
import com.spice.profitmandi.dao.entity.brandFee.BrandFee;
9
import com.spice.profitmandi.dao.entity.brandFee.BrandFeeCollection;
10
import com.spice.profitmandi.dao.entity.dtr.Otp;
11
import com.spice.profitmandi.dao.entity.fofo.PartnerOnBoardingPanel;
12
import com.spice.profitmandi.dao.entity.onBoarding.*;
13
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
14
import com.spice.profitmandi.dao.enumuration.dtr.OtpType;
15
import com.spice.profitmandi.dao.enumuration.onBorading.onBoardingFormEnums.FeePaymentStatus;
16
import com.spice.profitmandi.dao.enumuration.onBorading.onBoardingFormEnums.LoiStatus;
17
import com.spice.profitmandi.dao.enumuration.onBorading.onBoardingFormEnums.StoreType;
18
import com.spice.profitmandi.dao.model.LoiFormModel;
19
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
20
import com.spice.profitmandi.dao.repository.brandFee.BrandFeeCollectionRepository;
21
import com.spice.profitmandi.dao.repository.brandFee.BrandFeeRepository;
22
import com.spice.profitmandi.dao.repository.cs.CsService;
23
import com.spice.profitmandi.dao.repository.dtr.DistrictMasterRepository;
24
import com.spice.profitmandi.dao.repository.dtr.DocumentRepository;
25
import com.spice.profitmandi.dao.repository.dtr.OtpRepository;
26
import com.spice.profitmandi.dao.repository.inventory.PartnerOnboardingService;
27
import com.spice.profitmandi.dao.repository.inventory.StateRepository;
28
import com.spice.profitmandi.dao.repository.onboarding.LoiDocMasterRepository;
29
import com.spice.profitmandi.dao.repository.onboarding.LoiDocRepository;
30
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
31
import com.spice.profitmandi.dao.repository.user.LoiFormRepository;
32
import com.spice.profitmandi.dao.service.LoiDocModel;
33
import com.spice.profitmandi.dao.service.OTPResponse;
34
import com.spice.profitmandi.dao.service.OtpProcessor;
35
import com.spice.profitmandi.dao.service.loiForm.LoiFormService;
36
import com.spice.profitmandi.service.integrations.gstpro.GstProService;
37
import com.spice.profitmandi.service.integrations.gstpro.entity.GstDetails;
38
import com.spice.profitmandi.service.postoffice.PostOfficeService;
39
import com.spice.profitmandi.service.user.StoreTimelineTatService;
40
import com.spice.profitmandi.web.model.LoginDetails;
41
import com.spice.profitmandi.web.util.CookiesProcessor;
42
import com.spice.profitmandi.web.util.MVCResponseSender;
43
import org.apache.commons.lang3.tuple.Pair;
44
import org.apache.logging.log4j.LogManager;
45
import org.apache.logging.log4j.Logger;
46
import org.springframework.beans.factory.annotation.Autowired;
47
import org.springframework.http.HttpStatus;
48
import org.springframework.http.ResponseEntity;
49
import org.springframework.mail.javamail.JavaMailSender;
50
import org.springframework.stereotype.Controller;
51
import org.springframework.transaction.annotation.Transactional;
52
import org.springframework.ui.Model;
53
import org.springframework.web.bind.annotation.RequestBody;
54
import org.springframework.web.bind.annotation.RequestMapping;
55
import org.springframework.web.bind.annotation.RequestMethod;
56
import org.springframework.web.bind.annotation.RequestParam;
57
 
58
import javax.servlet.http.HttpServletRequest;
59
import java.time.LocalDateTime;
60
import java.util.*;
61
import java.util.stream.Collectors;
62
 
63
@Controller
64
@Transactional(rollbackFor = Throwable.class)
65
public class LoiFormController {
66
    private static final Logger LOGGER = LogManager.getLogger(PartnerOnBoardingPanelController.class);
67
    @Autowired
68
    DocumentRepository documentRepository;
69
    @Autowired
70
    AuthRepository authRepository;
71
    @Autowired
72
    StateRepository stateRepository;
73
    @Autowired
74
    DistrictMasterRepository districtMasterRepository;
75
    @Autowired
76
    LoiFormRepository loiFormRepository;
77
    @Autowired
78
    GstProService gstProService;
79
    @Autowired
80
    ObjectMapper objectMapper;
81
    @Autowired
82
    OrderRepository orderRepository;
83
    @Autowired
84
    PostOfficeService postOfficeService;
85
    @Autowired
86
    LoiFormService loiFormService;
87
    @Autowired
88
    BrandFeeCollectionRepository brandFeeCollectionRepository;
89
    @Autowired
90
    BrandFeeRepository brandFeeRepository;
91
    @Autowired
92
    OtpProcessor otpProcessor;
93
    @Autowired
94
    OtpRepository otpRepository;
95
    @Autowired
96
    JavaMailSender mailSender;
97
    @Autowired
98
    LoiDocMasterRepository loiDocMasterList;
99
    @Autowired
100
    CsService csService;
101
    @Autowired
102
    PartnerOnboardingService partnerOnboardingService;
103
    @Autowired
104
    StoreTimelineTatService storeTimelineTatService;
105
    @Autowired
106
    LoiDocRepository loiDocRepository;
107
    @Autowired
108
    MVCResponseSender mvcResponseSender;
109
    @Autowired
110
    private CookiesProcessor cookiesProcessor;
111
 
112
    // OnBoarding Form
113
    @RequestMapping(value = "/onboardingForm", method = RequestMethod.GET)
114
    public String loiForm(HttpServletRequest request, Model model) throws ProfitMandiBusinessException {
115
        LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
116
        AuthUser selfAuth = authRepository.selectByEmailOrMobile(loginDetails.getEmailId());
117
        List<AuthUser> authUsersList = loiFormService.getSalesAuthList();
118
        List<BrandFee> brandFee = brandFeeRepository.selectFeeOnDate(LocalDateTime.now());
119
        LOGGER.info("brandFee - " + brandFee);
120
        Set<Pair<StoreType, BrandFee>> storeTypeFeePairs = new HashSet<>();
121
        for (BrandFee fee : brandFee) {
122
            for (StoreType storeType : StoreType.values()) {
123
                storeTypeFeePairs.add(Pair.of(storeType, fee));
124
            }
125
        }
126
        List<BusinessType> businessTypes = Arrays.asList(BusinessType.Proprietorship, BusinessType.Partnership, BusinessType.Company);
127
        model.addAttribute("businessTypes", businessTypes);
128
        model.addAttribute("storeTypeFeePairs", storeTypeFeePairs);
129
        model.addAttribute("authUsersList", authUsersList);
130
        model.addAttribute("selfAuth", selfAuth);
131
        return "partner-onboarding-form";
132
    }
133
 
134
    // use to validate GSTIN
135
    @RequestMapping(value = "/gstValidate", method = RequestMethod.GET)
136
    public ResponseEntity<?> gstValidate(HttpServletRequest request, @RequestParam String gstNo) throws Exception {
137
        LOGGER.info("gstNo -" + gstNo);
138
        GstDetails gstDetails = gstProService.getGstDetails(gstNo);
139
        LOGGER.info("gstDetails -" + gstDetails);
140
        List<GstDetails.Pradr> adadr = gstDetails.getAdadr();
141
        adadr.add(gstDetails.getPradr());
142
        Collections.reverse(adadr);
143
        LOGGER.info("list_of_adadr-" + adadr);
144
        String status = gstDetails.getSts();
145
        if (status.equals("Active")) {
146
            return ResponseEntity.ok(gstDetails);
147
        } else {
148
            String errorMsg = "GSTIN - " + gstNo + " Not Active";
149
            return new ResponseEntity(errorMsg, HttpStatus.INTERNAL_SERVER_ERROR);
150
        }
151
    }
152
 
153
    // bind the form data and save in fofo.Onboarding_form table
154
    @RequestMapping(value = "/submitOnboardingForm", method = RequestMethod.POST)
155
    public String submitLoiForm(HttpServletRequest request, @RequestBody LoiFormData formData, Model model) throws Exception {
156
        LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
157
        boolean isDataCreated = loiFormService.createLoiForm(formData);
158
        List<LoiFormModel> formList = loiFormService.pendingFormList(loginDetails.getEmailId());
159
        model.addAttribute("formList", formList);
160
        if (isDataCreated) {
161
            model.addAttribute("response1", mvcResponseSender.createResponseString(true));
162
            return "response";
163
        } else {
164
            model.addAttribute("response1", mvcResponseSender.createResponseString(false));
165
            return "response";
166
        }
167
    }
168
 
169
    // show all pending Form to specific auth user who have filled the form(type based)
170
    @RequestMapping("/pendingOnboardingForm")
171
    public String pendingLoiForm(HttpServletRequest request, Model model) throws Exception {
172
        LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
173
        String email = loginDetails.getEmailId();
174
        boolean isDocApprover = false;
175
        //todo:replace
176
        String approverEmail = "gaurav.sharma@smartdukaan.com";
177
        if (email.equals(approverEmail)) {
178
            isDocApprover = true;
179
        }
180
        List<LoiFormModel> pendingFormList = loiFormService.pendingFormList(email);
181
        LOGGER.info("pendingFormList {}", pendingFormList);
182
        model.addAttribute("isDocApprover", isDocApprover);
183
        model.addAttribute("pendingFormList", pendingFormList);
184
        return "pendingForm";
185
    }
186
 
187
    // generate LOI for specific Form data
188
    @RequestMapping(value = "/generateLoi", method = RequestMethod.GET)
189
    public String generateLoi(HttpServletRequest request, @RequestParam int loiId, Model model) throws ProfitMandiBusinessException {
190
        LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
191
        int authId = authRepository.selectByEmailOrMobile(loginDetails.getEmailId()).getId();
192
        LoiForm loiForm = loiFormRepository.selectById(loiId);
193
        loiForm.setLoiGeneratedBy(authId);
194
        loiForm.setLoiGeneratedOn(LocalDateTime.now());
195
        loiForm.setStatus(LoiStatus.LOI_GENERATED);
196
        BrandFee brandFee = brandFeeRepository.selectById(1);
197
        BrandFee givenFee = brandFeeRepository.selectById(loiForm.getBrandFeeId());
198
        BillingAddress address = loiForm.getBillingAddress();
199
        double brandFeeAmount = loiForm.getBrandFeeCollection().stream().filter(x -> x.getPaymentStatus().equals(FeePaymentStatus.CONFIRM)).mapToDouble(x -> x.getCollectedAmount()).sum();
200
        BrandFeeCollection brandFeeCollection = loiForm.getBrandFeeCollection().get(0);
201
        model.addAttribute("brandFeeAmount", brandFeeAmount);
202
        model.addAttribute("brandFee", brandFee);
203
        model.addAttribute("givenFee", givenFee);
204
        model.addAttribute("brandFeeCollection", brandFeeCollection);
205
        model.addAttribute("address", address);
206
        model.addAttribute("pod", loiForm);
207
        return "auto-Loi";
208
 
209
    }
210
 
211
    @RequestMapping("saveLoiDoc")
212
    public String saveLoiDoc(@RequestParam int loiId, @RequestParam int loiDocId, Model model) throws Exception {
213
        LOGGER.info("loi_docId-" + loiDocId);
214
        LoiForm loiForm = loiFormRepository.selectById(loiId);
215
        LOGGER.info("loiForm - " + loiForm);
216
        int loiDoc = loiForm.getLoiDoc();
217
        if (loiDoc == 0) {
218
            loiForm.setLoiDoc(loiDocId);
219
            loiFormService.sendSignedLoiPdfToPartner(loiForm);
220
            model.addAttribute("response1", mvcResponseSender.createResponseString(true));
221
            return "response";
222
        } else {
223
            model.addAttribute("response1", mvcResponseSender.createResponseString(true));
224
            return "response";
225
        }
226
 
227
    }
228
 
229
    // send Filled form for update purpose
230
    @RequestMapping("/updateOnboardingForm")
231
    public String UpdateLoiForm(HttpServletRequest request,
232
                                @RequestParam int loiId,
233
                                Model model) throws ProfitMandiBusinessException {
234
        LoiForm loiForm = loiFormRepository.selectById(loiId);
235
        List<AuthUser> salesAuthList = loiFormService.getSalesAuthList();
236
        List<BrandFee> brandFee = brandFeeRepository.selectFeeOnDate(LocalDateTime.now());
237
        Set<Pair<StoreType, BrandFee>> storeTypeFeePairs = new HashSet<>();
238
        for (BrandFee fee : brandFee) {
239
            for (StoreType storeType : StoreType.values()) {
240
                storeTypeFeePairs.add(Pair.of(storeType, fee));
241
            }
242
        }
243
        model.addAttribute("storeTypeFeePairs", storeTypeFeePairs);
244
        model.addAttribute("authUsersList", salesAuthList);
245
        model.addAttribute("onBoardingData", loiForm);
246
        return "partner-onboarding-form";
247
    }
248
 
249
    @RequestMapping(value = "/updateOnboardingFormData", method = RequestMethod.POST)
250
    public String UpdateLoiFormDetail(HttpServletRequest request,
251
                                      @RequestParam int loiId,
252
                                      @RequestBody LoiFormData partnerOnBoardingFormData,
253
                                      Model model) throws Exception {
254
        LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
255
        String email = loginDetails.getEmailId();
256
        loiFormService.updateLoiForm(partnerOnBoardingFormData, loiId);
257
        List<LoiFormModel> pendingFormList = loiFormService.pendingFormList(email);
258
        model.addAttribute("formList", pendingFormList);
259
        model.addAttribute("response1", mvcResponseSender.createResponseString(true));
260
        return "response";
261
    }
262
 
263
    // TODO , add paymnet if brand fee due
264
    @RequestMapping(value = "/brandfeeCollection", method = RequestMethod.POST)
265
    public String addBrandFee(HttpServletRequest request, @RequestBody BrandFeeCollection brandFeeCollection, @RequestParam int loiId, Model model) throws Exception {
266
        LoiForm loiForm = loiFormRepository.selectById(loiId);
267
        List<BrandFeeCollection> brandFeeCollections = loiForm.getBrandFeeCollection();
268
        double totatcollectedfee = brandFeeCollections.stream().mapToDouble(x -> x.getCollectedAmount()).sum();
269
        double brandFee = loiForm.getAgreedBrandFees();
270
        double differanceAmount = brandFee - totatcollectedfee;
271
        if (totatcollectedfee + brandFeeCollection.getCollectedAmount() <= brandFee) {
272
            brandFeeCollection.setTimeStamp(LocalDateTime.now());
273
            brandFeeCollection.setPaymentStatus(FeePaymentStatus.PENDING);
274
            brandFeeCollection.setLoiData(loiForm);
275
            brandFeeCollections.add(brandFeeCollection);
276
            loiForm.setBrandFeeCollection(brandFeeCollections);
277
            loiFormService.sentMailToPaymentApprover(brandFeeCollection);
278
            model.addAttribute("response1", mvcResponseSender.createResponseString(true));
279
            return "response";
280
        } else {
281
            throw new ProfitMandiBusinessException("You need to add only due brand fee that is Only, " + differanceAmount + " INR", null, "Pay differance amount or less then differance amount");
282
        }
283
    }
284
 
285
 
286
    @RequestMapping("/paymentsDetail")
287
    public String paymentsDetails(HttpServletRequest request, @RequestParam int loiId, Model model) throws ProfitMandiBusinessException {
288
        LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
289
        String email = loginDetails.getEmailId();
290
        boolean isNiraj = false;
291
        if (email.equals("neeraj.gupta@smartdukaan.com")) {
292
            isNiraj = true;
293
        }
294
        LoiForm loiForm = loiFormRepository.selectById(loiId);
295
        List<BrandFeeCollection> brandFeeCollections = loiForm.getBrandFeeCollection();
296
        model.addAttribute("brandFeeCollections", brandFeeCollections);
297
        model.addAttribute("confirm", FeePaymentStatus.CONFIRM);
298
        model.addAttribute("isNiraj", isNiraj);
299
        return "payment-collection-details";
300
    }
301
 
302
    // bfcId - Brand Fee Collection Id
303
    @RequestMapping("/feePaymentApproval")
304
    public String feePaymentApproval(HttpServletRequest request, @RequestParam int bfcId, @RequestParam FeePaymentStatus feePaymentStatus, Model model) throws Exception {
305
        LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
306
        String authEmail = loginDetails.getEmailId();
307
        BrandFeeCollection brandFeeCollection = brandFeeCollectionRepository.selectById(bfcId);
308
        LoiForm loiForm = brandFeeCollection.getLoiData();
309
        List<BrandFeeCollection> brandFeeCollections = brandFeeCollectionRepository.selectAllConfirmPaymetByLoiAuth(loiForm);
310
        brandFeeCollection.setApproverEmail(authEmail);
311
        brandFeeCollection.setPaymentStatus(feePaymentStatus);
312
        double agreedBrandFee = loiForm.getAgreedBrandFees();
313
        double totalBrandFeeCollection = brandFeeCollections.stream().mapToDouble(x -> x.getCollectedAmount()).sum() + brandFeeCollection.getCollectedAmount();
314
        LOGGER.info("agreedBrandeFee -" + agreedBrandFee);
315
        LOGGER.info("totalBrandFeeCollection -" + totalBrandFeeCollection);
316
        boolean b = agreedBrandFee == totalBrandFeeCollection && loiForm.getLoiSignOtp() != null;
317
        LOGGER.info("b -" + b);
318
        if (agreedBrandFee == totalBrandFeeCollection && loiForm.getLoiSignOtp() != null) {
319
            loiForm.setStatus(LoiStatus.PRE_ONBOARDING_DONE);
320
            // loiFormService.sendFinalMail(loiForm);
321
        }
322
        String msg = "Payment is confirmed";
323
        model.addAttribute("response1", mvcResponseSender.createResponseString(msg));
324
        return "response";
325
 
326
    }
327
 
328
    @RequestMapping("/uploadDocumentForm")
329
    public String uploadDocumentForm(HttpServletRequest request, @RequestParam int loiId, Model model) throws ProfitMandiBusinessException {
330
        List<LoiDocMaster> activeDocMasterList = loiDocMasterList.getAllActiveDoc();
331
        LoiForm loiForm = loiFormRepository.selectById(loiId);
332
        //TODO:replace
333
        LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
334
        String authEmail = authRepository.selectByEmailOrMobile(loginDetails.getEmailId()).getEmailId();
335
        String approverEmail = "gaurav.sharma@smartdukaan.com";
336
        boolean isApprover = false;
337
        if (authEmail.equals(approverEmail)) {
338
            isApprover = true;
339
        }
340
        Map<Integer, LoiDoc> masterDocIdLoiDocMap = loiForm.getLoiDocs().stream().collect(Collectors.toMap(x -> x.getMasterDocId(), x -> x));
341
        model.addAttribute("isApprover", isApprover);
342
        model.addAttribute("loiId", loiId);
343
        model.addAttribute("activeDocMasterList", activeDocMasterList);
344
        model.addAttribute("masterDocIdLoiDocMap", masterDocIdLoiDocMap);
345
        return "loiForm/document-upload";
346
    }
347
 
348
    @RequestMapping(value = "/uploadOnboardingDocument", method = RequestMethod.POST)
349
    public String uploadDocument(HttpServletRequest request, @RequestParam int loiId, @RequestBody List<LoiDocModel> loiDocModels, Model model) throws Exception {
350
        LoiForm loiForm = loiFormRepository.selectById(loiId);
351
        LOGGER.info("loiForm - " + loiForm);
352
        LOGGER.info("loiDocModels - " + loiDocModels);
353
        loiFormService.setDocs(loiForm, loiDocModels);
354
        model.addAttribute("response1", mvcResponseSender.createResponseString("Document uploaded successfully"));
355
        return "response";
356
 
357
    }
358
 
359
 
360
    @RequestMapping("/documentVerify")
361
    public String docApproval(HttpServletRequest request, @RequestParam int loiId, @RequestParam int docMasterId, @RequestParam boolean flag, Model model) throws Exception {
362
        LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
363
        AuthUser auth = authRepository.selectByEmailOrMobile(loginDetails.getEmailId());
364
        LoiDoc loiDoc = loiDocRepository.selectByLoiIdAndMasterDocId(loiId, docMasterId);
365
        if (flag) {
366
            loiDoc.setOk(true);
367
            loiDoc.setVerifyBy(auth.getId());
368
            model.addAttribute("response1", mvcResponseSender.createResponseString(loiDoc.getDocType() + " is Accepted "));
369
            return "response";
370
        } else {
371
            loiDoc.setOk(false);
372
            loiDoc.setVerifyBy(auth.getId());
373
            model.addAttribute("response1", mvcResponseSender.createResponseString(loiDoc.getDocType() + " is Rejected"));
374
            return "response";
375
        }
376
    }
377
 
378
    @RequestMapping(value = "/loiAcceptanceOtp", method = RequestMethod.POST)
379
    public String sentLoiAcceptanceOtp(@RequestParam int loiId, Model model) throws Exception {
380
        LoiForm pod = loiFormRepository.selectById(loiId);
381
        String mobile = String.valueOf(pod.getMobile());
382
        otpProcessor.generateOtp(mobile, OtpType.LOI_ACCEPTANCE);
383
        String message = "OTP send to your register mobile number -";
384
        model.addAttribute("response1", mvcResponseSender.createResponseString(message + mobile));
385
        return "response";
386
    }
387
 
388
    @RequestMapping(value = "/validateLoiOtp", method = RequestMethod.PUT)
389
    public String validateLoiAcceptanceOtp(@RequestParam int loiId, @RequestParam String provideOtp, Model model) throws Exception {
390
        LOGGER.info("loiId -" + loiId);
391
        LOGGER.info("provideOtp -" + provideOtp);
392
        LoiForm pod = loiFormRepository.selectById(loiId);
393
        double brandFee = pod.getAgreedBrandFees();
394
        double totalCollectfee = pod.getBrandFeeCollection().stream().filter(x -> x.getPaymentStatus().equals(FeePaymentStatus.CONFIRM)).mapToDouble(x -> x.getCollectedAmount()).sum();
395
        String mobile = String.valueOf(pod.getMobile());
396
        Otp otp = otpRepository.selectAllByMobileWithTime(mobile).get(0);
397
        LOGGER.info("otp-" + otp);
398
        OTPResponse otpResponse = otpProcessor.validateOtp(otp.getId(), mobile, provideOtp);
399
        if (!otpResponse.isResult()) {
400
            model.addAttribute("response1", mvcResponseSender.createResponseString(false));
401
            throw new ProfitMandiBusinessException("Your given OTP ", provideOtp, " is wrong.");
402
        }
403
        if (otpResponse.isResult()) {
404
            pod.setLoiSignOtp(provideOtp);
405
            pod.setLoiSignedOn(LocalDateTime.now());
406
            if (brandFee == totalCollectfee && pod.getLoiSignOtp() != null) {
407
                pod.setStatus(LoiStatus.PRE_ONBOARDING_DONE);
408
            } else {
409
                pod.setStatus(LoiStatus.LOI_SIGNED);
410
            }
411
            model.addAttribute("response1", mvcResponseSender.createResponseString(true));
412
        }
413
        return "response";
414
    }
415
 
416
    @RequestMapping(value = "/completedLoiForms")
417
    public String completeLoiFormList(Model model) {
418
        List<LoiForm> loiForms = loiFormRepository.selectAllCompleteForm();
419
        List<EscalationType> EscalationTypeList = new ArrayList<>();
420
        EscalationTypeList.add(EscalationType.L2);
421
        EscalationTypeList.add(EscalationType.L1);
422
        EscalationTypeList.add(EscalationType.L4);
423
        List<AuthUser> authUsers = csService.getAuthUserIds(ProfitMandiConstants.TICKET_CATEGORY_RBM,
424
                EscalationTypeList);
425
        model.addAttribute("loiForms", loiForms);
426
        model.addAttribute("authUsers", authUsers);
427
        return "loiForm/completed-loi-form";
428
    }
429
 
430
    @RequestMapping(value = "/createNewOnboardingPanel")
431
    public String CreateNewOnboardingPanel(@RequestParam int loiId, @RequestParam int authId, Model model) throws Exception {
432
        PartnerOnBoardingPanel partnerOnboardingPanel = loiFormService.createPartnerOnboardingPanel(loiId, authId);
433
        loiFormRepository.selectById(loiId).setStatus(LoiStatus.IN_ONBOARDING_PROCESS);
434
        if (partnerOnboardingPanel.getId() != 0)
435
            model.addAttribute("response1", mvcResponseSender.createResponseString(true));
436
        else
437
            model.addAttribute("response1", mvcResponseSender.createResponseString(false));
438
        return "response";
439
    }
440
}