Subversion Repositories SmartDukaan

Rev

Rev 28436 | Rev 28566 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 28436 Rev 28467
Line 253... Line 253...
253
			}
253
			}
254
			JSONObject solrResponseJSONObj = new JSONObject(response).getJSONObject("response");
254
			JSONObject solrResponseJSONObj = new JSONObject(response).getJSONObject("response");
255
			JSONArray docs = solrResponseJSONObj.getJSONArray("docs");
255
			JSONArray docs = solrResponseJSONObj.getJSONArray("docs");
256
			dealResponses = getCatalogResponse(docs, false, userInfo.getRetailerId());
256
			dealResponses = getCatalogResponse(docs, false, userInfo.getRetailerId());
257
			fofoCatalogResponse = dealResponses.get(0);
257
			fofoCatalogResponse = dealResponses.get(0);
-
 
258
			fofoCatalogResponse
258
			fofoCatalogResponse.setWebOffers(webOfferRepository.selectAllActiveOffers().get(fofoCatalogResponse.getCatalogId()));
259
					.setWebOffers(webOfferRepository.selectAllActiveOffers().get(fofoCatalogResponse.getCatalogId()));
259
			
260
 
260
		} else {
261
		} else {
261
			return responseSender.badRequest(
262
			return responseSender.badRequest(
262
					new ProfitMandiBusinessException("Retailer id", userInfo.getUserId(), "NOT_FOFO_RETAILER"));
263
					new ProfitMandiBusinessException("Retailer id", userInfo.getUserId(), "NOT_FOFO_RETAILER"));
263
		}
264
		}
264
		return responseSender.ok(dealResponses.get(0));
265
		return responseSender.ok(dealResponses.get(0));
Line 384... Line 385...
384
			if (Utils.validateEmail(customer.getEmailId())) {
385
			if (Utils.validateEmail(customer.getEmailId())) {
385
				customerEmail = new String[] { customer.getEmailId() };
386
				customerEmail = new String[] { customer.getEmailId() };
386
			}
387
			}
387
 
388
 
388
			List<String> bccTo = Arrays.asList("kamini.sharma@smartdukaan.com", "tarun.verma@smartdukaan.com",
389
			List<String> bccTo = Arrays.asList("kamini.sharma@smartdukaan.com", "tarun.verma@smartdukaan.com",
389
					"hemant.kaura@smartdukaan.com", "niranjan.kala@smartdukaan.com", "sm@smartdukaan.com",
390
					"niranjan.kala@smartdukaan.com", "sm@smartdukaan.com", "tejbeer.kaur@shop2020.in",
390
					"tejbeer.kaur@shop2020.in","devkinandan.lal@smartdukaan.com", customRetailer.getEmail());
391
					"devkinandan.lal@smartdukaan.com", customRetailer.getEmail());
391
 
392
 
392
			List<String> authUserEmails = csService.getAuthUserByPartnerId(customRetailer.getPartnerId());
393
			List<String> authUserEmails = csService.getAuthUserByPartnerId(customRetailer.getPartnerId());
393
			if (authUserEmails != null) {
394
			if (authUserEmails != null) {
394
				authUserEmails = new ArrayList<>();
395
				authUserEmails = new ArrayList<>();
395
			}
396
			}
Line 797... Line 798...
797
						int partnerAvailability = partnerStockAvailabilityMap.get(itemId) == null ? 0
798
						int partnerAvailability = partnerStockAvailabilityMap.get(itemId) == null ? 0
798
								: partnerStockAvailabilityMap.get(itemId);
799
								: partnerStockAvailabilityMap.get(itemId);
799
						int ourStockAvailability = ourItemAvailabilityMap.get(itemId) == null ? 0
800
						int ourStockAvailability = ourItemAvailabilityMap.get(itemId) == null ? 0
800
								: Math.max(0, ourItemAvailabilityMap.get(itemId));
801
								: Math.max(0, ourItemAvailabilityMap.get(itemId));
801
						fdi.setActive(partnerAvailability > 0);
802
						fdi.setActive(partnerAvailability > 0);
802
						//fdi.setActive(true);
803
						// fdi.setActive(true);
803
						fdi.setAvailability(Math.min(5, ourStockAvailability + partnerAvailability));
804
						fdi.setAvailability(Math.min(5, ourStockAvailability + partnerAvailability));
804
						fdi.setQuantityStep(1);
805
						fdi.setQuantityStep(1);
805
						fdi.setMaxQuantity(fdi.getAvailability());
806
						fdi.setMaxQuantity(fdi.getAvailability());
806
						fofoAvailabilityInfoMap.put(itemId, fdi);
807
						fofoAvailabilityInfoMap.put(itemId, fdi);
807
					}
808
					}