| Line 50... |
Line 50... |
| 50 |
import com.spice.profitmandi.common.util.FormattingUtils;
|
50 |
import com.spice.profitmandi.common.util.FormattingUtils;
|
| 51 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
51 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
| 52 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
52 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
| 53 |
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
|
53 |
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
|
| 54 |
import com.spice.profitmandi.dao.entity.inventory.VendorItemPricing;
|
54 |
import com.spice.profitmandi.dao.entity.inventory.VendorItemPricing;
|
| - |
|
55 |
import com.spice.profitmandi.dao.entity.transaction.LineItemImei;
|
| 55 |
import com.spice.profitmandi.dao.entity.transaction.PriceDrop;
|
56 |
import com.spice.profitmandi.dao.entity.transaction.PriceDrop;
|
| 56 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
57 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
| 57 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
58 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
| 58 |
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
|
- |
|
| 59 |
import com.spice.profitmandi.dao.repository.inventory.VendorItemPricingRepository;
|
59 |
import com.spice.profitmandi.dao.repository.inventory.VendorItemPricingRepository;
|
| - |
|
60 |
import com.spice.profitmandi.dao.repository.transaction.LineItemImeisRepository;
|
| 60 |
import com.spice.profitmandi.dao.repository.transaction.PriceDropRepository;
|
61 |
import com.spice.profitmandi.dao.repository.transaction.PriceDropRepository;
|
| 61 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
62 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
| - |
|
63 |
import com.spice.profitmandi.service.pricing.PriceDropService;
|
| 62 |
import com.spice.profitmandi.service.scheme.SchemeService;
|
64 |
import com.spice.profitmandi.service.scheme.SchemeService;
|
| 63 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
65 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
| 64 |
import com.spice.profitmandi.service.wallet.WalletService;
|
66 |
import com.spice.profitmandi.service.wallet.WalletService;
|
| 65 |
import com.spice.profitmandi.web.util.MVCResponseSender;
|
67 |
import com.spice.profitmandi.web.util.MVCResponseSender;
|
| 66 |
|
68 |
|
| Line 84... |
Line 86... |
| 84 |
@Autowired
|
86 |
@Autowired
|
| 85 |
@Qualifier("fofoInventoryService")
|
87 |
@Qualifier("fofoInventoryService")
|
| 86 |
private InventoryService inventoryService;
|
88 |
private InventoryService inventoryService;
|
| 87 |
|
89 |
|
| 88 |
@Autowired
|
90 |
@Autowired
|
| 89 |
private InventoryItemRepository inventoryItemRepository;
|
- |
|
| 90 |
|
- |
|
| 91 |
@Autowired
|
- |
|
| 92 |
private MVCResponseSender mvcResponseSender;
|
91 |
private MVCResponseSender mvcResponseSender;
|
| 93 |
|
92 |
|
| 94 |
@Autowired
|
93 |
@Autowired
|
| - |
|
94 |
private PriceDropService priceDropService;
|
| - |
|
95 |
|
| - |
|
96 |
@Autowired
|
| 95 |
private WalletService walletService;
|
97 |
private WalletService walletService;
|
| 96 |
|
98 |
|
| 97 |
@Autowired
|
99 |
@Autowired
|
| 98 |
private TagListingRepository tagListingRepository;
|
100 |
private TagListingRepository tagListingRepository;
|
| 99 |
|
101 |
|
| Line 107... |
Line 109... |
| 107 |
@Autowired
|
109 |
@Autowired
|
| 108 |
private SchemeService schemeService;
|
110 |
private SchemeService schemeService;
|
| 109 |
|
111 |
|
| 110 |
@Autowired
|
112 |
@Autowired
|
| 111 |
ReporticoService reporticoService;
|
113 |
ReporticoService reporticoService;
|
| - |
|
114 |
|
| - |
|
115 |
@Autowired
|
| - |
|
116 |
LineItemImeisRepository lineItemImeisRepository;
|
| 112 |
|
117 |
|
| 113 |
@RequestMapping(value = "/getItemDescription", method = RequestMethod.GET)
|
118 |
@RequestMapping(value = "/getItemDescription", method = RequestMethod.GET)
|
| 114 |
public String getItemDescription(HttpServletRequest request, Model model) throws Throwable {
|
119 |
public String getItemDescription(HttpServletRequest request, Model model) throws Throwable {
|
| 115 |
|
120 |
|
| 116 |
List<TagListing> tagListings = tagListingRepository.selectAll(false);
|
121 |
List<TagListing> tagListings = tagListingRepository.selectAll(false);
|
| Line 136... |
Line 141... |
| 136 |
model.addAttribute("catalogDescription", catalogDescription);
|
141 |
model.addAttribute("catalogDescription", catalogDescription);
|
| 137 |
return "price-drop";
|
142 |
return "price-drop";
|
| 138 |
|
143 |
|
| 139 |
}
|
144 |
}
|
| 140 |
|
145 |
|
| 141 |
/*
|
- |
|
| 142 |
* @RequestMapping(value = "/downloadtotalPriceDropIMEI/{priceDropId}", method =
|
- |
|
| 143 |
* RequestMethod.GET) public ResponseEntity<?>
|
- |
|
| 144 |
* downloadPriceDropIMEI(HttpServletRequest request, @PathVariable int
|
- |
|
| 145 |
* priceDropId, Model model) throws ProfitMandiBusinessException {
|
- |
|
| 146 |
*
|
- |
|
| 147 |
* PriceDrop priceDrop = priceDropRepository.selectById(priceDropId);
|
- |
|
| 148 |
* List<PriceDropIMEI> priceDropIMEIs =
|
- |
|
| 149 |
* priceDropIMEIRepository.selectByPriceDropId(priceDrop.getId()); List<String>
|
- |
|
| 150 |
* imeis = priceDropIMEIs.stream().map(x ->
|
- |
|
| 151 |
* x.getImei()).collect(Collectors.toList()); List<LineItemImei> lineItemImeis =
|
- |
|
| 152 |
* lineItemImeisRepository.selectByIMEI(imeis); Map<String, String>
|
- |
|
| 153 |
* priceDropIMEIfofoId = priceDropService.getIMEIandRetailerName(lineItemImeis,
|
- |
|
| 154 |
* priceDrop); if (priceDropIMEIfofoId.size() > 0) { ByteArrayOutputStream
|
- |
|
| 155 |
* byteArrayOutputStream = new ByteArrayOutputStream();
|
- |
|
| 156 |
* ExcelUtils.writePriceDrop(priceDropIMEIfofoId, priceDrop.getItemId(),
|
- |
|
| 157 |
* byteArrayOutputStream); final HttpHeaders headers = new HttpHeaders(); //
|
- |
|
| 158 |
* private static final String CONTENT_TYPE_XLSX = //
|
- |
|
| 159 |
* "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
- |
|
| 160 |
* headers.set("Content-Type",
|
- |
|
| 161 |
* "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); //
|
- |
|
| 162 |
* headers.set("Content-Type", "application/vnd.ms-excel");
|
- |
|
| 163 |
* headers.set("Content-disposition", "inline; filename=priceDrop" +
|
- |
|
| 164 |
* priceDrop.getId() + ".xlsx");
|
- |
|
| 165 |
* headers.setContentLength(byteArrayOutputStream.toByteArray().length); final
|
- |
|
| 166 |
* InputStream inputStream = new
|
- |
|
| 167 |
* ByteArrayInputStream(byteArrayOutputStream.toByteArray()); final
|
- |
|
| 168 |
* InputStreamResource inputStreamResource = new
|
- |
|
| 169 |
* InputStreamResource(inputStream); return new
|
- |
|
| 170 |
* ResponseEntity<InputStreamResource>(inputStreamResource, headers,
|
- |
|
| 171 |
* HttpStatus.OK); } else { throw new
|
- |
|
| 172 |
* ProfitMandiBusinessException("priceDropId", priceDropId,
|
- |
|
| 173 |
* "No IMEI is Eligible For PriceDrop"); }
|
- |
|
| 174 |
*
|
- |
|
| 175 |
* }
|
- |
|
| 176 |
*/
|
- |
|
| 177 |
|
- |
|
| 178 |
@RequestMapping(value = "/price-drop/imes/download")
|
146 |
@RequestMapping(value = "/price-drop/imes/download")
|
| 179 |
public ResponseEntity<ByteArrayResource> downloadPriceDropImeis(HttpServletRequest request,
|
147 |
public ResponseEntity<ByteArrayResource> downloadPriceDropImeis(HttpServletRequest request,
|
| 180 |
@RequestParam LocalDateTime affectedDate, @RequestParam int itemId) throws Exception {
|
148 |
@RequestParam LocalDateTime affectedDate, @RequestParam int itemId) throws Exception {
|
| 181 |
Item item = itemRepository.selectById(itemId);
|
149 |
Item item = itemRepository.selectById(itemId);
|
| 182 |
ByteArrayOutputStream baos = getByteArrayOutputStream(affectedDate, item.getCatalogItemId());
|
150 |
ByteArrayOutputStream baos = getByteArrayOutputStream(affectedDate, item.getCatalogItemId());
|
| Line 196... |
Line 164... |
| 196 |
if (priceDrop.getProcessTimestamp() == null) {
|
164 |
if (priceDrop.getProcessTimestamp() == null) {
|
| 197 |
priceDrop.setPartnerPayout(priceDropProcess.getPartnerPayout());
|
165 |
priceDrop.setPartnerPayout(priceDropProcess.getPartnerPayout());
|
| 198 |
priceDrop.setPriceDropIn(priceDropProcess.getPriceDropIn());
|
166 |
priceDrop.setPriceDropIn(priceDropProcess.getPriceDropIn());
|
| 199 |
priceDrop.setProcessTimestamp(LocalDateTime.now());
|
167 |
priceDrop.setProcessTimestamp(LocalDateTime.now());
|
| 200 |
priceDropRepository.persist(priceDrop);
|
168 |
priceDropRepository.persist(priceDrop);
|
| 201 |
String description = itemRepository.selectAllByCatalogItemId(priceDrop.getCatalogItemId()).get(0).getItemDescriptionNoColor();
|
169 |
String description = itemRepository.selectAllByCatalogItemId(priceDrop.getCatalogItemId()).get(0)
|
| - |
|
170 |
.getItemDescriptionNoColor();
|
| 202 |
List<ImeiDropSummaryModel> partnerPendingImeis = getPartnerPendingImeis(priceDrop.getAffectedOn(),
|
171 |
List<ImeiDropSummaryModel> imeiDropSummaryModels = this.getAllSerialNumbersByAffectedDate(priceDrop.getAffectedOn(),
|
| 203 |
priceDrop.getCatalogItemId());
|
172 |
priceDrop.getCatalogItemId());
|
| - |
|
173 |
|
| - |
|
174 |
|
| 204 |
if (partnerPendingImeis.size() > 0) {
|
175 |
if (imeiDropSummaryModels.size() > 0) {
|
| 205 |
Map<Integer, List<ImeiDropSummaryModel>> partnerImeiMap = new HashMap<>();
|
176 |
List<String> serialNumbers = imeiDropSummaryModels.stream().map(x->x.getSerialNumber()).collect(Collectors.toList());
|
| 206 |
for (ImeiDropSummaryModel pendingImei : partnerPendingImeis) {
|
- |
|
| 207 |
if (!partnerImeiMap.containsKey(pendingImei.getRetailerId())) {
|
177 |
List<LineItemImei> lineItemImeis = lineItemImeisRepository.selectByIMEI(serialNumbers);
|
| 208 |
partnerImeiMap.put(pendingImei.getRetailerId(), new ArrayList<>());
|
178 |
Map<Integer, List<InventoryItem>> pendingPartnerInventoryMap = priceDropService.getInventoryForPriceDrop(lineItemImeis, priceDrop).
|
| 209 |
}
|
- |
|
| 210 |
partnerImeiMap.get(pendingImei.getRetailerId()).add(pendingImei);
|
179 |
stream().collect(Collectors.groupingBy(InventoryItem::getFofoId));
|
| 211 |
}
|
- |
|
| 212 |
|
180 |
|
| 213 |
for (Map.Entry<Integer, List<ImeiDropSummaryModel>> pendingPartnerImei : partnerImeiMap.entrySet()) {
|
181 |
for (Map.Entry<Integer, List<InventoryItem>> pendingPartnerInventory : pendingPartnerInventoryMap.entrySet()) {
|
| 214 |
List<ImeiDropSummaryModel> retailerImeiList = pendingPartnerImei.getValue();
|
182 |
List<InventoryItem> fofoInventoryList = pendingPartnerInventory.getValue();
|
| 215 |
int fofoId = pendingPartnerImei.getKey();
|
183 |
int fofoId = pendingPartnerInventory.getKey();
|
| 216 |
List<InventoryItem> inventoryItems = inventoryItemRepository.selectByFofoIdSerialNumbers(fofoId,
|
- |
|
| 217 |
retailerImeiList.stream().map(x -> x.getSerialNumber()).collect(Collectors.toSet()), false);
|
- |
|
| - |
|
184 |
|
| 218 |
String reversalReason = MessageFormat.format(
|
185 |
String reversalReason = MessageFormat.format(
|
| 219 |
"Scheme amount reversal due to Price Drop of Rs.{0} on {1}. Affected on {3}, Total {2} item(s)",
|
186 |
"Scheme differential for Price Drop of Rs.{0} on {1}, on {3}. Total {2} item(s)",
|
| 220 |
priceDrop.getAmount(), description, pendingPartnerImei.getValue().size(),
|
187 |
priceDrop.getAmount(), description, fofoInventoryList.size(),
|
| 221 |
FormattingUtils.formatDate(priceDrop.getAffectedOn()));
|
188 |
FormattingUtils.formatDate(priceDrop.getAffectedOn()));
|
| 222 |
String aReason = MessageFormat.format(
|
189 |
String aReason = MessageFormat.format(
|
| 223 |
"Per unit payout of Rs.{4} Price Drop of Rs.{0} on {1} affected on {3}. Total {2} item(s)",
|
190 |
"Payout of Rs.{4} per unit for Price Drop of Rs.{0} on {1}, on {3}. Total {2} item(s)",
|
| 224 |
priceDrop.getAmount(), description, pendingPartnerImei.getValue().size(),
|
191 |
priceDrop.getAmount(), description, fofoInventoryList.size(),
|
| 225 |
FormattingUtils.formatDate(priceDrop.getAffectedOn()), priceDropProcess.getPartnerPayout());
|
192 |
FormattingUtils.formatDate(priceDrop.getAffectedOn()), priceDropProcess.getPartnerPayout());
|
| 226 |
inventoryService.updatePriceDrop(inventoryItems, priceDrop.getAmount());
|
193 |
inventoryService.updatePriceDrop(fofoInventoryList, priceDrop.getAmount());
|
| 227 |
schemeService.reverseSchemes(inventoryItems, priceDropProcess.getPriceDropId(), reversalReason);
|
194 |
schemeService.reverseSchemes(fofoInventoryList, priceDropProcess.getPriceDropId(), reversalReason);
|
| 228 |
walletService.addAmountToWallet(fofoId, priceDrop.getId(), WalletReferenceType.PRICE_DROP,
|
195 |
walletService.addAmountToWallet(fofoId, priceDrop.getId(), WalletReferenceType.PRICE_DROP, aReason,
|
| 229 |
aReason, priceDropProcess.getPartnerPayout()*pendingPartnerImei.getValue().size());
|
196 |
priceDropProcess.getPartnerPayout() * fofoInventoryList.size());
|
| 230 |
}
|
197 |
}
|
| 231 |
|
198 |
|
| 232 |
}
|
199 |
}
|
| 233 |
response = true;
|
200 |
response = true;
|
| 234 |
}
|
201 |
}
|
| Line 297... |
Line 264... |
| 297 |
PriceDrop priceDrop = priceDropRepository.selectById(priceDropId);
|
264 |
PriceDrop priceDrop = priceDropRepository.selectById(priceDropId);
|
| 298 |
Item item = itemRepository.selectAllByCatalogItemId(priceDrop.getCatalogItemId()).get(0);
|
265 |
Item item = itemRepository.selectAllByCatalogItemId(priceDrop.getCatalogItemId()).get(0);
|
| 299 |
ByteArrayOutputStream baos = getByteArrayOutputStream(priceDrop.getAffectedOn(), priceDrop.getCatalogItemId());
|
266 |
ByteArrayOutputStream baos = getByteArrayOutputStream(priceDrop.getAffectedOn(), priceDrop.getCatalogItemId());
|
| 300 |
final HttpHeaders headers = new HttpHeaders();
|
267 |
final HttpHeaders headers = new HttpHeaders();
|
| 301 |
headers.set("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
268 |
headers.set("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
| - |
|
269 |
headers.set("Content-disposition",
|
| 302 |
headers.set("Content-disposition", "inline; filename=pricedrop-" + item.getItemDescriptionNoColor().replaceAll("\\s?,\\s?", " ") + "-"
|
270 |
"inline; filename=pricedrop-" + item.getItemDescriptionNoColor().replaceAll("\\s?,\\s?", " ") + "-"
|
| 303 |
+ FormattingUtils.formatDate(priceDrop.getAffectedOn()) + ".csv");
|
271 |
+ FormattingUtils.formatDate(priceDrop.getAffectedOn()) + ".csv");
|
| 304 |
byte[] byteArray = baos.toByteArray();
|
272 |
byte[] byteArray = baos.toByteArray();
|
| 305 |
headers.setContentLength(byteArray.length);
|
273 |
headers.setContentLength(byteArray.length);
|
| 306 |
return new ResponseEntity<ByteArrayResource>(new ByteArrayResource(byteArray), headers, HttpStatus.OK);
|
274 |
return new ResponseEntity<ByteArrayResource>(new ByteArrayResource(byteArray), headers, HttpStatus.OK);
|
| 307 |
|
275 |
|
| 308 |
}
|
276 |
}
|
| 309 |
|
277 |
|
| 310 |
private List<ImeiDropSummaryModel> getPartnerPendingImeis(LocalDateTime affectedOn, Integer catalogItemId)
|
278 |
private List<ImeiDropSummaryModel> getAllSerialNumbersByAffectedDate(LocalDateTime affectedOn,
|
| 311 |
throws Exception {
|
279 |
Integer catalogItemId) throws Exception {
|
| 312 |
Map<String, String> params = new HashMap<>();
|
- |
|
| 313 |
params.put("MANUAL_criteria1_FROMDATE", FormattingUtils.formatReporitcoDate(affectedOn));
|
- |
|
| 314 |
List<Item> items = itemRepository.selectAllByCatalogItemId(catalogItemId);
|
- |
|
| 315 |
List<String> itemIds = items.stream().map(x -> String.valueOf(x.getId())).collect(Collectors.toList());
|
- |
|
| 316 |
params.put("MANUAL_itemId", StringUtils.join(itemIds, ","));
|
- |
|
| 317 |
Map<String, String> params1 = new HashMap<>();
|
- |
|
| 318 |
params1.put("MANUAL_criteriaDate_FROMDATE", FormattingUtils.formatReporitcoDate(affectedOn));
|
- |
|
| 319 |
params1.put("MANUAL_criteriaItemId", StringUtils.join(itemIds, ","));
|
- |
|
| 320 |
|
- |
|
| 321 |
List<? extends ImeiDropSummaryModel> grnPendingList = getReports(GrnPendingDataModel.class,
|
- |
|
| 322 |
ReporticoProject.FOCO, "imeispendinggrn.xml", params);
|
- |
|
| 323 |
List<? extends ImeiDropSummaryModel> partnerImeiNotSoldList = getReports(PartnerImeiNotSold.class,
|
- |
|
| 324 |
ReporticoProject.FOCO, "PartnerIMEINotSold.xml", params1);
|
- |
|
| 325 |
|
- |
|
| 326 |
List<ImeiDropSummaryModel> mergedImeis = new ArrayList<>();
|
- |
|
| 327 |
mergedImeis.addAll(grnPendingList);
|
- |
|
| 328 |
mergedImeis.addAll(partnerImeiNotSoldList);
|
- |
|
| 329 |
|
- |
|
| 330 |
return mergedImeis;
|
- |
|
| 331 |
}
|
- |
|
| 332 |
|
- |
|
| 333 |
private ByteArrayOutputStream getByteArrayOutputStream(LocalDateTime affectedOn, Integer catalogItemId)
|
- |
|
| 334 |
throws Exception {
|
- |
|
| 335 |
|
- |
|
| 336 |
List<Item> items = itemRepository.selectAllByCatalogItemId(catalogItemId);
|
280 |
List<Item> items = itemRepository.selectAllByCatalogItemId(catalogItemId);
|
| 337 |
List<String> itemIds = items.stream().map(x -> String.valueOf(x.getId())).collect(Collectors.toList());
|
281 |
List<String> itemIds = items.stream().map(x -> String.valueOf(x.getId())).collect(Collectors.toList());
|
| 338 |
|
282 |
|
| 339 |
Map<String, String> params = new HashMap<>();
|
283 |
Map<String, String> params = new HashMap<>();
|
| 340 |
params.put("MANUAL_criteria1_FROMDATE", FormattingUtils.formatReporitcoDate(affectedOn));
|
284 |
params.put("MANUAL_criteria1_FROMDATE", FormattingUtils.formatReporitcoDate(affectedOn));
|
| 341 |
params.put("MANUAL_itemId", StringUtils.join(itemIds, ","));
|
285 |
params.put("MANUAL_itemId", StringUtils.join(itemIds, ","));
|
| 342 |
|
286 |
|
| 343 |
Map<String, String> params1 = new HashMap<>();
|
287 |
Map<String, String> params1 = new HashMap<>();
|
| 344 |
params1.put("MANUAL_criteriaDate_FROMDATE", FormattingUtils.formatReporitcoDate(affectedOn.minusDays(1)));
|
288 |
params1.put("MANUAL_criteriaDate_FROMDATE", FormattingUtils.formatReporitcoDate(affectedOn.minusDays(1)));
|
| 345 |
params1.put("MANUAL_criteriaItemId", StringUtils.join(itemIds, ","));
|
289 |
params1.put("MANUAL_criteriaItemId", StringUtils.join(itemIds, ","));
|
| 346 |
|
- |
|
| 347 |
|
290 |
|
| 348 |
Map<String, String> params2 = new HashMap<>();
|
291 |
Map<String, String> params2 = new HashMap<>();
|
| 349 |
params2.put("MANUAL_Criteria2_FROMDATE", FormattingUtils.formatReporitcoDate(affectedOn.minusDays(1)));
|
292 |
params2.put("MANUAL_Criteria2_FROMDATE", FormattingUtils.formatReporitcoDate(affectedOn.minusDays(1)));
|
| 350 |
params2.put("MANUAL_Criteria1", StringUtils.join(itemIds, ","));
|
293 |
params2.put("MANUAL_Criteria1", StringUtils.join(itemIds, ","));
|
| 351 |
|
294 |
|
| 352 |
|
- |
|
| 353 |
List<? extends ImeiDropSummaryModel> grnPendingList = getReports(GrnPendingDataModel.class,
|
295 |
List<? extends ImeiDropSummaryModel> grnPendingList = getReports(GrnPendingDataModel.class,
|
| 354 |
ReporticoProject.FOCO, "imeispendinggrn.xml", params);
|
296 |
ReporticoProject.FOCO, "imeispendinggrn.xml", params);
|
| 355 |
List<? extends ImeiDropSummaryModel> partnerImeiNotSoldList = getReports(PartnerImeiNotSold.class,
|
297 |
List<? extends ImeiDropSummaryModel> partnerImeiNotSoldList = getReports(PartnerImeiNotSold.class,
|
| 356 |
ReporticoProject.FOCO, "PartnerIMEINotSold.xml", params1);
|
298 |
ReporticoProject.FOCO, "PartnerIMEINotSold.xml", params1);
|
| 357 |
List<? extends ImeiDropSummaryModel> itemStockOnDateList = getReports(ClosingStockOnDate.class,
|
299 |
List<? extends ImeiDropSummaryModel> itemStockOnDateList = getReports(ClosingStockOnDate.class,
|
| 358 |
ReporticoProject.WAREHOUSENEW, "itemstockondate.xml", params2);
|
300 |
ReporticoProject.WAREHOUSENEW, "itemstockondate.xml", params2);
|
| 359 |
|
301 |
|
| 360 |
List<ImeiDropSummaryModel> mergedImeis = new ArrayList<>();
|
302 |
List<ImeiDropSummaryModel> mergedImeis = new ArrayList<>();
|
| 361 |
mergedImeis.addAll(grnPendingList);
|
303 |
mergedImeis.addAll(grnPendingList);
|
| 362 |
mergedImeis.addAll(partnerImeiNotSoldList);
|
304 |
mergedImeis.addAll(partnerImeiNotSoldList);
|
| 363 |
mergedImeis.addAll(itemStockOnDateList);
|
305 |
mergedImeis.addAll(itemStockOnDateList);
|
| - |
|
306 |
return mergedImeis;
|
| - |
|
307 |
}
|
| 364 |
|
308 |
|
| - |
|
309 |
private ByteArrayOutputStream getByteArrayOutputStream(LocalDateTime affectedOn, Integer catalogItemId)
|
| - |
|
310 |
throws Exception {
|
| - |
|
311 |
List<ImeiDropSummaryModel> imeiDropSummaryModelList = this.getAllSerialNumbersByAffectedDate(affectedOn, catalogItemId);
|
| 365 |
List<List<Object>> rows = new ArrayList<>();
|
312 |
List<List<Object>> rows = new ArrayList<>();
|
| 366 |
for (ImeiDropSummaryModel imeiDropSummaryModel : mergedImeis) {
|
313 |
for (ImeiDropSummaryModel imeiDropSummaryModel : imeiDropSummaryModelList) {
|
| 367 |
List<Object> row = new ArrayList<>();
|
314 |
List<Object> row = new ArrayList<>();
|
| 368 |
row.add(imeiDropSummaryModel.getSerialNumber());
|
315 |
row.add(imeiDropSummaryModel.getSerialNumber());
|
| 369 |
row.add(imeiDropSummaryModel.getStoreName());
|
316 |
row.add(imeiDropSummaryModel.getStoreName());
|
| 370 |
row.add(imeiDropSummaryModel.getPartnerCode());
|
317 |
row.add(imeiDropSummaryModel.getPartnerCode());
|
| 371 |
row.add(imeiDropSummaryModel.getItemId());
|
318 |
row.add(imeiDropSummaryModel.getItemId());
|