| Line 3... |
Line 3... |
| 3 |
import java.io.ByteArrayInputStream;
|
3 |
import java.io.ByteArrayInputStream;
|
| 4 |
import java.io.ByteArrayOutputStream;
|
4 |
import java.io.ByteArrayOutputStream;
|
| 5 |
import java.io.InputStream;
|
5 |
import java.io.InputStream;
|
| 6 |
import java.time.LocalDate;
|
6 |
import java.time.LocalDate;
|
| 7 |
import java.time.LocalDateTime;
|
7 |
import java.time.LocalDateTime;
|
| - |
|
8 |
import java.time.YearMonth;
|
| 8 |
import java.util.Arrays;
|
9 |
import java.util.Arrays;
|
| 9 |
import java.util.HashMap;
|
10 |
import java.util.HashMap;
|
| 10 |
import java.util.HashSet;
|
11 |
import java.util.HashSet;
|
| 11 |
import java.util.List;
|
12 |
import java.util.List;
|
| 12 |
import java.util.Map;
|
13 |
import java.util.Map;
|
| 13 |
import java.util.Set;
|
14 |
import java.util.Set;
|
| 14 |
import java.util.stream.Collectors;
|
- |
|
| 15 |
|
15 |
|
| 16 |
import javax.servlet.http.HttpServletRequest;
|
16 |
import javax.servlet.http.HttpServletRequest;
|
| 17 |
import javax.transaction.Transactional;
|
17 |
import javax.transaction.Transactional;
|
| 18 |
|
18 |
|
| 19 |
import org.apache.logging.log4j.LogManager;
|
19 |
import org.apache.logging.log4j.LogManager;
|
| Line 29... |
Line 29... |
| 29 |
import org.springframework.web.bind.annotation.RequestBody;
|
29 |
import org.springframework.web.bind.annotation.RequestBody;
|
| 30 |
import org.springframework.web.bind.annotation.RequestMapping;
|
30 |
import org.springframework.web.bind.annotation.RequestMapping;
|
| 31 |
import org.springframework.web.bind.annotation.RequestMethod;
|
31 |
import org.springframework.web.bind.annotation.RequestMethod;
|
| 32 |
import org.springframework.web.bind.annotation.RequestParam;
|
32 |
import org.springframework.web.bind.annotation.RequestParam;
|
| 33 |
|
33 |
|
| 34 |
import com.google.gson.Gson;
|
- |
|
| 35 |
import com.spice.profitmandi.common.enumuration.DateTimePattern;
|
34 |
import com.spice.profitmandi.common.enumuration.DateTimePattern;
|
| 36 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
35 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 37 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
- |
|
| 38 |
import com.spice.profitmandi.common.model.MapWrapper;
|
36 |
import com.spice.profitmandi.common.model.MapWrapper;
|
| 39 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
37 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 40 |
import com.spice.profitmandi.common.model.SchemeItems;
|
38 |
import com.spice.profitmandi.common.model.SchemeItems;
|
| 41 |
import com.spice.profitmandi.common.model.SchemeModel;
|
39 |
import com.spice.profitmandi.common.model.SchemeModel;
|
| 42 |
import com.spice.profitmandi.common.util.ExcelUtils;
|
40 |
import com.spice.profitmandi.common.util.ExcelUtils;
|
| 43 |
import com.spice.profitmandi.common.util.FormattingUtils;
|
41 |
import com.spice.profitmandi.common.util.FormattingUtils;
|
| 44 |
import com.spice.profitmandi.common.util.StringUtils;
|
42 |
import com.spice.profitmandi.common.util.StringUtils;
|
| 45 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
43 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
| 46 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
- |
|
| 47 |
import com.spice.profitmandi.dao.entity.catalog.Offer;
|
- |
|
| 48 |
import com.spice.profitmandi.dao.entity.catalog.Scheme;
|
44 |
import com.spice.profitmandi.dao.entity.catalog.Scheme;
|
| 49 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
45 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
| 50 |
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
|
46 |
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
|
| 51 |
import com.spice.profitmandi.dao.entity.fofo.SchemeItem;
|
47 |
import com.spice.profitmandi.dao.entity.fofo.SchemeItem;
|
| 52 |
import com.spice.profitmandi.dao.enumuration.catalog.AmountType;
|
48 |
import com.spice.profitmandi.dao.enumuration.catalog.AmountType;
|
| 53 |
import com.spice.profitmandi.dao.enumuration.catalog.ItemCriteriaType;
|
49 |
import com.spice.profitmandi.dao.model.CreateOfferRequest;
|
| 54 |
import com.spice.profitmandi.dao.model.CreateSchemeRequest;
|
50 |
import com.spice.profitmandi.dao.model.CreateSchemeRequest;
|
| 55 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
51 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
| 56 |
import com.spice.profitmandi.dao.repository.catalog.SchemeRepository;
|
52 |
import com.spice.profitmandi.dao.repository.catalog.SchemeRepository;
|
| 57 |
import com.spice.profitmandi.dao.repository.catalog.StateGstRateRepository;
|
53 |
import com.spice.profitmandi.dao.repository.catalog.StateGstRateRepository;
|
| 58 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
54 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
| 59 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
55 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| 60 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
56 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
| 61 |
import com.spice.profitmandi.dao.repository.dtr.RoleRepository;
|
- |
|
| 62 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
57 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
| 63 |
import com.spice.profitmandi.dao.repository.fofo.PurchaseRepository;
|
- |
|
| 64 |
import com.spice.profitmandi.dao.repository.fofo.SchemeItemRepository;
|
58 |
import com.spice.profitmandi.dao.repository.fofo.SchemeItemRepository;
|
| 65 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
59 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
| 66 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
60 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
| - |
|
61 |
import com.spice.profitmandi.service.offers.OfferService;
|
| 67 |
import com.spice.profitmandi.service.scheme.SchemeService;
|
62 |
import com.spice.profitmandi.service.scheme.SchemeService;
|
| 68 |
import com.spice.profitmandi.service.user.RetailerService;
|
63 |
import com.spice.profitmandi.service.user.RetailerService;
|
| 69 |
import com.spice.profitmandi.web.model.LoginDetails;
|
64 |
import com.spice.profitmandi.web.model.LoginDetails;
|
| 70 |
import com.spice.profitmandi.web.util.CookiesProcessor;
|
65 |
import com.spice.profitmandi.web.util.CookiesProcessor;
|
| 71 |
import com.spice.profitmandi.web.util.MVCResponseSender;
|
66 |
import com.spice.profitmandi.web.util.MVCResponseSender;
|
| Line 76... |
Line 71... |
| 76 |
|
71 |
|
| 77 |
private static final Logger LOGGER = LogManager.getLogger(SchemeController.class);
|
72 |
private static final Logger LOGGER = LogManager.getLogger(SchemeController.class);
|
| 78 |
|
73 |
|
| 79 |
@Autowired
|
74 |
@Autowired
|
| 80 |
private SchemeService schemeService;
|
75 |
private SchemeService schemeService;
|
| - |
|
76 |
|
| - |
|
77 |
@Autowired
|
| - |
|
78 |
private OfferService offerService;
|
| 81 |
|
79 |
|
| 82 |
@Autowired
|
80 |
@Autowired
|
| 83 |
private StateGstRateRepository stateGstRateRepository;
|
81 |
private StateGstRateRepository stateGstRateRepository;
|
| 84 |
|
82 |
|
| 85 |
@Autowired
|
83 |
@Autowired
|
| Line 294... |
Line 292... |
| 294 |
|
292 |
|
| 295 |
}
|
293 |
}
|
| 296 |
|
294 |
|
| 297 |
@RequestMapping(value = "/getSchemes", method = RequestMethod.GET)
|
295 |
@RequestMapping(value = "/getSchemes", method = RequestMethod.GET)
|
| 298 |
public String getSchemes(HttpServletRequest request, @RequestParam(name = "offset", defaultValue = "0") int offset,
|
296 |
public String getSchemes(HttpServletRequest request, @RequestParam(name = "offset", defaultValue = "0") int offset,
|
| - |
|
297 |
@RequestParam(required = false) LocalDate date,
|
| 299 |
@RequestParam(name = "limit", defaultValue = "10") int limit,
|
298 |
@RequestParam(name = "limit", defaultValue = "10") int limit,
|
| 300 |
@RequestParam(name = "searchItem", required = false, defaultValue = "") String searchItem,
|
299 |
@RequestParam(name = "searchItem", required = false, defaultValue = "") String searchItem,
|
| 301 |
@RequestParam(name = "searchTerm", required = false, defaultValue = "") String searchTerm,
|
300 |
@RequestParam(name = "searchTerm", required = false, defaultValue = "") String searchTerm,
|
| 302 |
@RequestParam(name = "partnerType", required = false, defaultValue = "") PartnerType partnerType,
|
301 |
@RequestParam(name = "partnerType", required = false, defaultValue = "") PartnerType partnerType,
|
| 303 |
Model model) throws ProfitMandiBusinessException {
|
302 |
Model model) throws ProfitMandiBusinessException {
|
| 304 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
303 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 305 |
boolean isAdmin = roleManager.isAdmin(loginDetails.getRoleIds());
|
304 |
boolean isAdmin = roleManager.isAdmin(loginDetails.getRoleIds());
|
| - |
|
305 |
if (date == null) {
|
| - |
|
306 |
date = LocalDate.now();
|
| - |
|
307 |
}
|
| - |
|
308 |
model.addAttribute("date", date);
|
| 306 |
|
309 |
|
| 307 |
model.addAttribute("searchItem", searchItem);
|
- |
|
| 308 |
model.addAttribute("searchTerm", searchTerm);
|
- |
|
| 309 |
model.addAttribute("partnerType", partnerType);
|
- |
|
| 310 |
model.addAttribute("roleType", isAdmin);
|
- |
|
| 311 |
|
- |
|
| 312 |
LOGGER.info("isAdmin" + isAdmin);
|
- |
|
| 313 |
List<Scheme> schemes = null;
|
310 |
List<Scheme> schemes = null;
|
| 314 |
long size = 0;
|
311 |
long size = 0;
|
| 315 |
LOGGER.info("partnerType" + partnerType);
|
- |
|
| - |
|
312 |
|
| 316 |
if (partnerType == null) {
|
313 |
if (partnerType == null) {
|
| 317 |
partnerType = partnerTypeChangeService.getTypeOnDate(loginDetails.getFofoId(), LocalDate.now());
|
314 |
partnerType = partnerTypeChangeService.getTypeOnDate(loginDetails.getFofoId(),
|
| - |
|
315 |
date.isAfter(LocalDate.now()) ? LocalDate.now() : date);
|
| 318 |
}
|
316 |
}
|
| 319 |
if (!(searchTerm.equals(""))) {
|
317 |
if (!(searchTerm.equals(""))) {
|
| 320 |
schemes = schemeRepository.selectBySearchTerm(searchTerm, offset, limit);
|
318 |
schemes = schemeRepository.selectBySearchTerm(searchTerm, offset, limit);
|
| 321 |
for (Scheme scheme : schemes) {
|
319 |
for (Scheme scheme : schemes) {
|
| 322 |
if (scheme.getAmountType().equals(AmountType.PERCENTAGE)) {
|
320 |
if (scheme.getAmountType().equals(AmountType.PERCENTAGE)) {
|
| 323 |
scheme.setAmountModel(scheme.getAmount() + "%");
|
321 |
scheme.setAmountModel(scheme.getAmount() + "%");
|
| 324 |
} else {
|
322 |
} else {
|
| 325 |
scheme.setAmountModel(scheme.getAmount() + "");
|
323 |
scheme.setAmountModel(scheme.getAmount() + "");
|
| 326 |
}
|
324 |
}
|
| 327 |
}
|
325 |
}
|
| 328 |
if (!(schemes.size() == 0)) {
|
326 |
if (schemes.size() > 0) {
|
| 329 |
size = schemeRepository.selectAllCount();
|
327 |
size = schemeRepository.selectAllCount();
|
| 330 |
LOGGER.info("schemes" + schemes);
|
328 |
LOGGER.info("schemes" + schemes);
|
| 331 |
model.addAttribute("schemes", schemes);
|
329 |
model.addAttribute("schemes", schemes);
|
| 332 |
model.addAttribute("start", offset + 1);
|
330 |
model.addAttribute("start", offset + 1);
|
| 333 |
model.addAttribute("size", size);
|
331 |
model.addAttribute("size", size);
|
| 334 |
if (schemes.size() < limit) {
|
332 |
if (schemes.size() < limit) {
|
| 335 |
model.addAttribute("end", offset + schemes.size());
|
333 |
model.addAttribute("end", offset + schemes.size());
|
| 336 |
}
|
- |
|
| 337 |
|
- |
|
| 338 |
else {
|
334 |
} else {
|
| 339 |
model.addAttribute("end", offset + limit);
|
335 |
model.addAttribute("end", offset + limit);
|
| 340 |
}
|
336 |
}
|
| 341 |
}
|
337 |
}
|
| 342 |
|
338 |
|
| 343 |
else {
|
339 |
else {
|
| Line 354... |
Line 350... |
| 354 |
if (tagListing != null) {
|
350 |
if (tagListing != null) {
|
| 355 |
model.addAttribute("dp", tagListing.getSellingPrice());
|
351 |
model.addAttribute("dp", tagListing.getSellingPrice());
|
| 356 |
model.addAttribute("mop", tagListing.getMop());
|
352 |
model.addAttribute("mop", tagListing.getMop());
|
| 357 |
}
|
353 |
}
|
| 358 |
}
|
354 |
}
|
| 359 |
schemes = schemeService.selectSchemeByPartnerType(partnerType, itemId, isAdmin, offset, limit);
|
355 |
schemes = schemeService.selectSchemeByPartnerType(partnerType, date, itemId, isAdmin, offset, limit);
|
| 360 |
model.addAttribute("schemes", schemes);
|
356 |
model.addAttribute("schemes", schemes);
|
| 361 |
if (schemes.size() == 0) {
|
357 |
if (schemes.size() == 0) {
|
| 362 |
return "schemes";
|
358 |
return "schemes";
|
| 363 |
}
|
359 |
}
|
| 364 |
|
360 |
|
| Line 376... |
Line 372... |
| 376 |
scheme.setAmountModel(scheme.getAmount() + "%");
|
372 |
scheme.setAmountModel(scheme.getAmount() + "%");
|
| 377 |
}
|
373 |
}
|
| 378 |
} else {
|
374 |
} else {
|
| 379 |
scheme.setAmountModel(scheme.getAmount() + "");
|
375 |
scheme.setAmountModel(scheme.getAmount() + "");
|
| 380 |
}
|
376 |
}
|
| 381 |
|
- |
|
| 382 |
}
|
377 |
}
|
| 383 |
size = schemeService.selectSchemeCount(partnerType, itemId, isAdmin);
|
378 |
size = schemeService.selectSchemeCount(partnerType, date, itemId, isAdmin);
|
| 384 |
model.addAttribute("start", offset + 1);
|
379 |
model.addAttribute("start", offset + 1);
|
| 385 |
model.addAttribute("size", size);
|
380 |
model.addAttribute("size", size);
|
| 386 |
if (schemes.size() < limit) {
|
381 |
if (schemes.size() < limit) {
|
| 387 |
model.addAttribute("end", offset + schemes.size());
|
382 |
model.addAttribute("end", offset + schemes.size());
|
| 388 |
} else {
|
383 |
} else {
|
| 389 |
model.addAttribute("end", offset + limit);
|
384 |
model.addAttribute("end", offset + limit);
|
| 390 |
}
|
385 |
}
|
| 391 |
}
|
386 |
}
|
| - |
|
387 |
model.addAttribute("searchItem", searchItem);
|
| - |
|
388 |
model.addAttribute("searchTerm", searchTerm);
|
| - |
|
389 |
model.addAttribute("partnerType", partnerType);
|
| - |
|
390 |
model.addAttribute("isAdmin", isAdmin);
|
| 392 |
model.addAttribute("schemes", schemes);
|
391 |
model.addAttribute("schemes", schemes);
|
| 393 |
LOGGER.info("schemes"+schemes);
|
392 |
LOGGER.info("schemes" + schemes);
|
| 394 |
// model.addAttribute("roleTypes", loginDetails.getRoleTypes());
|
393 |
// model.addAttribute("roleTypes", loginDetails.getRoleTypes());
|
| - |
|
394 |
if (isAdmin)
|
| 395 |
return "schemes";
|
395 |
return "schemes";
|
| - |
|
396 |
else {
|
| - |
|
397 |
List<CreateOfferRequest> offers = offerService.getPublishedOffers(date, loginDetails.getFofoId(), Integer.parseInt(searchItem));
|
| - |
|
398 |
model.addAttribute("offers", offers);
|
| - |
|
399 |
return "schemes-partner";
|
| - |
|
400 |
}
|
| 396 |
}
|
401 |
}
|
| 397 |
|
402 |
|
| 398 |
@RequestMapping(value = "/getPaginatedSchemes", method = RequestMethod.GET)
|
403 |
@RequestMapping(value = "/getPaginatedSchemes", method = RequestMethod.GET)
|
| 399 |
public String getPaginatedSchemes(HttpServletRequest request,
|
404 |
public String getPaginatedSchemes(HttpServletRequest request, @RequestParam(required = false) LocalDate date,
|
| 400 |
@RequestParam(name = "offset", defaultValue = "0") int offset,
|
405 |
@RequestParam(name = "offset", defaultValue = "0") int offset,
|
| 401 |
@RequestParam(name = "limit", defaultValue = "10") int limit,
|
406 |
@RequestParam(name = "limit", defaultValue = "10") int limit,
|
| 402 |
@RequestParam(name = "searchItem", required = false, defaultValue = "") String searchItem,
|
- |
|
| 403 |
@RequestParam(name = "searchTerm", required = false, defaultValue = "") String searchTerm,
|
- |
|
| 404 |
@RequestParam(name = "partnerType", required = false, defaultValue = "") PartnerType partnerType,
|
407 |
@RequestParam(name = "partnerType", required = false, defaultValue = "ALL") PartnerType partnerType,
|
| 405 |
Model model) throws ProfitMandiBusinessException {
|
408 |
Model model) throws ProfitMandiBusinessException {
|
| 406 |
|
409 |
|
| 407 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
410 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 408 |
boolean isAdmin = roleManager.isAdmin(loginDetails.getRoleIds());
|
411 |
boolean isAdmin = roleManager.isAdmin(loginDetails.getRoleIds());
|
| 409 |
|
- |
|
| 410 |
LOGGER.info("requested offset=[{}], limit = [{}]", offset, limit);
|
- |
|
| 411 |
List<Scheme> schemes = null;
|
- |
|
| 412 |
/*
|
- |
|
| 413 |
* if (roleManager.isAdmin(loginDetails.getRoleIds())) { schemes =
|
- |
|
| 414 |
* schemeRepository.selectAll(offset, limit); } else { schemes =
|
- |
|
| 415 |
* schemeRepository.selectActiveAll(offset, limit); }
|
- |
|
| 416 |
*/
|
- |
|
| 417 |
if (partnerType == null) {
|
412 |
if (date == null) {
|
| 418 |
partnerType = partnerTypeChangeService.getTypeOnDate(loginDetails.getFofoId(), LocalDate.now());
|
413 |
date = LocalDate.now();
|
| 419 |
}
|
414 |
}
|
| 420 |
LOGGER.info("partnerType" + partnerType);
|
415 |
LOGGER.info("requested offset=[{}], limit = [{}]", offset, limit);
|
| - |
|
416 |
List<Scheme> schemes = schemeRepository.selectAll();
|
| 421 |
int itemId = 0;
|
417 |
int itemId = 0;
|
| 422 |
TagListing tagListing = null;
|
418 |
TagListing tagListing = null;
|
| 423 |
if (!(searchItem.equals(""))) {
|
- |
|
| 424 |
itemId = Integer.parseInt(searchItem);
|
- |
|
| 425 |
tagListing = tagListingRepository.selectByItemId(itemId);
|
- |
|
| 426 |
}
|
419 |
|
| 427 |
|
- |
|
| 428 |
schemes = schemeService.selectSchemeByPartnerType(partnerType, itemId, isAdmin, offset, limit);
|
- |
|
| 429 |
for (Scheme scheme : schemes) {
|
420 |
for (Scheme scheme : schemes) {
|
| 430 |
if (scheme.getAmountType().equals(AmountType.PERCENTAGE)) {
|
421 |
if (scheme.getAmountType().equals(AmountType.PERCENTAGE)) {
|
| 431 |
if (itemId > 0) {
|
422 |
if (itemId > 0) {
|
| 432 |
float taxRate = stateGstRateRepository.getIgstTaxRate(Arrays.asList(itemId)).get(itemId);
|
423 |
float taxRate = stateGstRateRepository.getIgstTaxRate(Arrays.asList(itemId)).get(itemId);
|
| 433 |
float taxableSellingPrice = tagListing.getSellingPrice() / (1 + taxRate / 100);
|
424 |
float taxableSellingPrice = tagListing.getSellingPrice() / (1 + taxRate / 100);
|
| Line 436... |
Line 427... |
| 436 |
FormattingUtils.formatDecimalTwoDigits(amount) + " (" + scheme.getAmount() + "%)");
|
427 |
FormattingUtils.formatDecimalTwoDigits(amount) + " (" + scheme.getAmount() + "%)");
|
| 437 |
} else {
|
428 |
} else {
|
| 438 |
scheme.setAmountModel(scheme.getAmount() + "%");
|
429 |
scheme.setAmountModel(scheme.getAmount() + "%");
|
| 439 |
}
|
430 |
}
|
| 440 |
} else {
|
431 |
} else {
|
| 441 |
scheme.setAmountModel("₹" + scheme.getAmount());
|
432 |
scheme.setAmountModel("" + scheme.getAmount());
|
| 442 |
}
|
433 |
}
|
| 443 |
}
|
434 |
}
|
| 444 |
|
435 |
|
| 445 |
model.addAttribute("schemes", schemes);
|
436 |
model.addAttribute("schemes", schemes);
|
| 446 |
model.addAttribute("partnerType", partnerType);
|
437 |
model.addAttribute("partnerType", partnerType);
|
| Line 472... |
Line 463... |
| 472 |
headers.set("Content-disposition", "inline; filename=SchemesReport.xlsx");
|
463 |
headers.set("Content-disposition", "inline; filename=SchemesReport.xlsx");
|
| 473 |
headers.setContentLength(byteArrayOutputStream.toByteArray().length);
|
464 |
headers.setContentLength(byteArrayOutputStream.toByteArray().length);
|
| 474 |
final InputStream inputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
|
465 |
final InputStream inputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
|
| 475 |
final InputStreamResource inputStreamResource = new InputStreamResource(inputStream);
|
466 |
final InputStreamResource inputStreamResource = new InputStreamResource(inputStream);
|
| 476 |
return new ResponseEntity<InputStreamResource>(inputStreamResource, headers, HttpStatus.OK);
|
467 |
return new ResponseEntity<InputStreamResource>(inputStreamResource, headers, HttpStatus.OK);
|
| 477 |
|
- |
|
| 478 |
// return responseSender.ok(ResponseCodeHolder.getMessage("ITM_AGNG_OK_1000"));
|
- |
|
| 479 |
}
|
468 |
}
|
| 480 |
|
469 |
|
| 481 |
@RequestMapping(value = "/getSchemeById", method = RequestMethod.GET)
|
470 |
@RequestMapping(value = "/getSchemeById", method = RequestMethod.GET)
|
| 482 |
public String getSchemeById(HttpServletRequest request,
|
471 |
public String getSchemeById(HttpServletRequest request,
|
| 483 |
@RequestParam(name = ProfitMandiConstants.SCHEME_ID) int schemeId, Model model)
|
472 |
@RequestParam(name = ProfitMandiConstants.SCHEME_ID) int schemeId, Model model)
|