| Line 144... |
Line 144... |
| 144 |
@Autowired
|
144 |
@Autowired
|
| 145 |
private CategoryRepository categoryRepository;
|
145 |
private CategoryRepository categoryRepository;
|
| 146 |
|
146 |
|
| 147 |
@Autowired
|
147 |
@Autowired
|
| 148 |
PriceCircularService priceCircularService;
|
148 |
PriceCircularService priceCircularService;
|
| - |
|
149 |
@Autowired
|
| - |
|
150 |
private FofoOrderRepository fofoOrderRepository;
|
| - |
|
151 |
@Autowired
|
| - |
|
152 |
private PurchaseRepository purchaseRepository;
|
| - |
|
153 |
|
| 149 |
|
154 |
|
| 150 |
|
155 |
|
| 151 |
@Autowired
|
156 |
@Autowired
|
| 152 |
private Gson gson;
|
157 |
private Gson gson;
|
| 153 |
|
158 |
|
| Line 190... |
Line 195... |
| 190 |
if (!roleManager.isAdmin(loginDetails.getRoleIds())) {
|
195 |
if (!roleManager.isAdmin(loginDetails.getRoleIds())) {
|
| 191 |
throw new ProfitMandiBusinessException("User", loginDetails.getEmailId(), "Unauthorised access");
|
196 |
throw new ProfitMandiBusinessException("User", loginDetails.getEmailId(), "Unauthorised access");
|
| 192 |
}
|
197 |
}
|
| 193 |
return "update-schemes-page";
|
198 |
return "update-schemes-page";
|
| 194 |
}
|
199 |
}
|
| - |
|
200 |
@RequestMapping(value = "/schemes/process-sellout", method = RequestMethod.POST)
|
| - |
|
201 |
public String processSellout(HttpServletRequest request, Model model, @RequestBody List<String> invoiceNumbers) throws Exception {
|
| - |
|
202 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| - |
|
203 |
if (!roleManager.isAdmin(loginDetails.getRoleIds())) {
|
| - |
|
204 |
throw new ProfitMandiBusinessException("User", loginDetails.getEmailId(), "Unauthorised access");
|
| - |
|
205 |
}
|
| - |
|
206 |
for (String invoiceNumber : invoiceNumbers) {
|
| - |
|
207 |
FofoOrder fofoOrder = fofoOrderRepository.selectByInvoiceNumber(invoiceNumber);
|
| - |
|
208 |
schemeService.processSchemeOut(fofoOrder.getId(), fofoOrder.getFofoId());
|
| - |
|
209 |
}
|
| - |
|
210 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
| - |
|
211 |
return "response";
|
| - |
|
212 |
}
|
| - |
|
213 |
|
| - |
|
214 |
@RequestMapping(value = "/schemes/process-sellin", method = RequestMethod.POST)
|
| - |
|
215 |
public String processSellin(HttpServletRequest request, Model model, @RequestBody List<String> invoiceNumbers) throws Exception {
|
| - |
|
216 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| - |
|
217 |
if (!roleManager.isAdmin(loginDetails.getRoleIds())) {
|
| - |
|
218 |
throw new ProfitMandiBusinessException("User", loginDetails.getEmailId(), "Unauthorised access");
|
| - |
|
219 |
}
|
| - |
|
220 |
for (String invoiceNumber : invoiceNumbers) {
|
| - |
|
221 |
Purchase purchase = purchaseRepository.selectByPurchaseReference(invoiceNumber);
|
| - |
|
222 |
schemeService.processSchemeIn(purchase.getId(), purchase.getFofoId());
|
| - |
|
223 |
}
|
| - |
|
224 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
| - |
|
225 |
return "response";
|
| - |
|
226 |
}
|
| 195 |
|
227 |
|
| 196 |
@RequestMapping(value = "/payMonthlyInvestment", method = RequestMethod.POST)
|
228 |
@RequestMapping(value = "/payMonthlyInvestment", method = RequestMethod.POST)
|
| 197 |
public void payMonthlyInvestment(HttpServletRequest request, Model model) throws ProfitMandiBusinessException {
|
229 |
public void payMonthlyInvestment(HttpServletRequest request, Model model) throws ProfitMandiBusinessException {
|
| 198 |
|
230 |
|
| 199 |
LocalDate firstDateOfCurrentMonth = LocalDateTime.now().withDayOfMonth(1).toLocalDate();
|
231 |
LocalDate firstDateOfCurrentMonth = LocalDateTime.now().withDayOfMonth(1).toLocalDate();
|