| Line 44... |
Line 44... |
| 44 |
import com.spice.profitmandi.web.util.MVCResponseSender;
|
44 |
import com.spice.profitmandi.web.util.MVCResponseSender;
|
| 45 |
import org.apache.commons.lang3.tuple.Pair;
|
45 |
import org.apache.commons.lang3.tuple.Pair;
|
| 46 |
import org.apache.logging.log4j.LogManager;
|
46 |
import org.apache.logging.log4j.LogManager;
|
| 47 |
import org.apache.logging.log4j.Logger;
|
47 |
import org.apache.logging.log4j.Logger;
|
| 48 |
import org.springframework.beans.factory.annotation.Autowired;
|
48 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 49 |
import org.springframework.http.HttpStatus;
|
- |
|
| 50 |
import org.springframework.http.ResponseEntity;
|
49 |
import org.springframework.http.ResponseEntity;
|
| 51 |
import org.springframework.mail.javamail.JavaMailSender;
|
50 |
import org.springframework.mail.javamail.JavaMailSender;
|
| 52 |
import org.springframework.stereotype.Controller;
|
51 |
import org.springframework.stereotype.Controller;
|
| 53 |
import org.springframework.transaction.annotation.Transactional;
|
52 |
import org.springframework.transaction.annotation.Transactional;
|
| 54 |
import org.springframework.ui.Model;
|
53 |
import org.springframework.ui.Model;
|
| Line 152... |
Line 151... |
| 152 |
LOGGER.info("gstDetails -" + gstDetails);
|
151 |
LOGGER.info("gstDetails -" + gstDetails);
|
| 153 |
List<GstDetails.Pradr> adadr = gstDetails.getAdadr();
|
152 |
List<GstDetails.Pradr> adadr = gstDetails.getAdadr();
|
| 154 |
adadr.add(gstDetails.getPradr());
|
153 |
adadr.add(gstDetails.getPradr());
|
| 155 |
Collections.reverse(adadr);
|
154 |
Collections.reverse(adadr);
|
| 156 |
LOGGER.info("list_of_adadr-" + adadr);
|
155 |
LOGGER.info("list_of_adadr-" + adadr);
|
| 157 |
String status = gstDetails.getSts();
|
- |
|
| 158 |
if (status.equals("Active")) {
|
- |
|
| 159 |
return ResponseEntity.ok(gstDetails);
|
156 |
return ResponseEntity.ok(gstDetails);
|
| 160 |
} else {
|
- |
|
| 161 |
String errorMsg = "GSTIN - " + gstNo + " Not Active";
|
- |
|
| 162 |
return new ResponseEntity(errorMsg, HttpStatus.INTERNAL_SERVER_ERROR);
|
- |
|
| 163 |
}
|
- |
|
| 164 |
}
|
157 |
}
|
| 165 |
|
158 |
|
| 166 |
// bind the form data and save in fofo.Onboarding_form table
|
159 |
// Save Loi data in fofo.loi_form table
|
| 167 |
@RequestMapping(value = "/submitLoiForm", method = RequestMethod.POST)
|
160 |
@RequestMapping(value = "/submitLoiForm", method = RequestMethod.POST)
|
| 168 |
public String submitLoiForm(HttpServletRequest request, @RequestBody LoiFormData loiFormData, Model model) throws Exception {
|
161 |
public String submitLoiForm(HttpServletRequest request, @RequestBody LoiFormData loiFormData, Model model) throws Exception {
|
| 169 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
162 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 170 |
LOGGER.info("filledBy - " + loginDetails.getEmailId());
|
163 |
LOGGER.info("filledBy - " + loginDetails.getEmailId());
|
| 171 |
boolean isDataCreated = loiFormService.createLoiForm(loiFormData, loginDetails.getEmailId());
|
164 |
boolean isDataCreated = loiFormService.createLoiForm(loiFormData, loginDetails.getEmailId());
|
| Line 176... |
Line 169... |
| 176 |
model.addAttribute("response1", mvcResponseSender.createResponseString(false));
|
169 |
model.addAttribute("response1", mvcResponseSender.createResponseString(false));
|
| 177 |
return "response";
|
170 |
return "response";
|
| 178 |
}
|
171 |
}
|
| 179 |
}
|
172 |
}
|
| 180 |
|
173 |
|
| 181 |
// show all pending Form to specific auth user who have filled the form(type based)
|
174 |
// show all pending loi form to specific auth user who have filled the form(type based)
|
| 182 |
@RequestMapping(value = "/pendingLoiForm", method = RequestMethod.GET)
|
175 |
@RequestMapping(value = "/pendingLoiForm", method = RequestMethod.GET)
|
| 183 |
public String pendingLoiForm(HttpServletRequest request, Model model) throws Exception {
|
176 |
public String pendingLoiForm(HttpServletRequest request, Model model) throws Exception {
|
| 184 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
177 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 185 |
String email = loginDetails.getEmailId();
|
178 |
String email = loginDetails.getEmailId();
|
| 186 |
boolean isDocApprover = false;
|
179 |
boolean isDocApprover = false;
|