Subversion Repositories SmartDukaan

Rev

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