Subversion Repositories SmartDukaan

Rev

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

Rev 30565 Rev 30596
Line 10... Line 10...
10
import com.spice.profitmandi.common.util.Utils;
10
import com.spice.profitmandi.common.util.Utils;
11
import com.spice.profitmandi.common.util.Utils.Attachment;
11
import com.spice.profitmandi.common.util.Utils.Attachment;
12
import com.spice.profitmandi.dao.entity.auth.AuthUser;
12
import com.spice.profitmandi.dao.entity.auth.AuthUser;
13
import com.spice.profitmandi.dao.entity.catalog.*;
13
import com.spice.profitmandi.dao.entity.catalog.*;
14
import com.spice.profitmandi.dao.entity.cs.Position;
14
import com.spice.profitmandi.dao.entity.cs.Position;
-
 
15
import com.spice.profitmandi.dao.entity.dtr.WebOffer;
15
import com.spice.profitmandi.dao.entity.fofo.FofoOrder;
16
import com.spice.profitmandi.dao.entity.fofo.FofoOrder;
16
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
17
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
17
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
18
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
18
import com.spice.profitmandi.dao.entity.fofo.LiveDemoSerialNumber;
19
import com.spice.profitmandi.dao.entity.fofo.LiveDemoSerialNumber;
19
import com.spice.profitmandi.dao.entity.transaction.*;
20
import com.spice.profitmandi.dao.entity.transaction.*;
Line 25... Line 26...
25
import com.spice.profitmandi.dao.repository.cs.CsService;
26
import com.spice.profitmandi.dao.repository.cs.CsService;
26
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
27
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
27
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
28
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
28
import com.spice.profitmandi.dao.repository.dtr.Mongo;
29
import com.spice.profitmandi.dao.repository.dtr.Mongo;
29
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
30
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
-
 
31
import com.spice.profitmandi.dao.repository.dtr.WebOfferRepository;
30
import com.spice.profitmandi.dao.repository.fofo.*;
32
import com.spice.profitmandi.dao.repository.fofo.*;
31
import com.spice.profitmandi.dao.repository.inventory.NotifyStatus;
33
import com.spice.profitmandi.dao.repository.inventory.NotifyStatus;
32
import com.spice.profitmandi.dao.repository.transaction.*;
34
import com.spice.profitmandi.dao.repository.transaction.*;
33
import com.spice.profitmandi.dao.repository.warehouse.WarehousePurchaseOrderRepository;
35
import com.spice.profitmandi.dao.repository.warehouse.WarehousePurchaseOrderRepository;
34
import com.spice.profitmandi.dao.repository.warehouse.WarehouseScanRepository;
36
import com.spice.profitmandi.dao.repository.warehouse.WarehouseScanRepository;
Line 199... Line 201...
199
	ActivatedImeiRepository activatedImeiRepository;
201
	ActivatedImeiRepository activatedImeiRepository;
200
 
202
 
201
	@Autowired
203
	@Autowired
202
	HighDemandItemsRepository highDemandItemsRepository;
204
	HighDemandItemsRepository highDemandItemsRepository;
203
 
205
 
-
 
206
	@Autowired
-
 
207
	WebOfferRepository webOfferRepository;
-
 
208
 
204
	@RequestMapping(value = "/getCurrentInventorySnapshot")
209
	@RequestMapping(value = "/getCurrentInventorySnapshot")
205
	public String getCurrentAvailability(HttpServletRequest request,
210
	public String getCurrentAvailability(HttpServletRequest request,
206
			@RequestParam(name = "offset", defaultValue = "0") int offset,
211
			@RequestParam(name = "offset", defaultValue = "0") int offset,
207
			@RequestParam(name = "limit", defaultValue = "10") int limit,
212
			@RequestParam(name = "limit", defaultValue = "10") int limit,
208
			@RequestParam(name = "searchTerm", required = false, defaultValue = "") String searchTerm, Model model)
213
			@RequestParam(name = "searchTerm", required = false, defaultValue = "") String searchTerm, Model model)
Line 267... Line 272...
267
		model.addAttribute("hasGift", hasGift(loginDetails.getFofoId()));
272
		model.addAttribute("hasGift", hasGift(loginDetails.getFofoId()));
268
 
273
 
269
		return "catalog";
274
		return "catalog";
270
	}
275
	}
271
 
276
 
-
 
277
	@RequestMapping(value = "/getWebOfferByCatalogId")
-
 
278
	public String getCatalog(HttpServletRequest request, @RequestParam int catalogItemId, Model model)
-
 
279
 
-
 
280
			throws ProfitMandiBusinessException {
-
 
281
 
-
 
282
		List<WebOffer> webOffers = webOfferRepository.selectAllActiveOffers().get(catalogItemId);
-
 
283
 
-
 
284
		model.addAttribute("webOffers", webOffers);
-
 
285
 
-
 
286
		return "web-offer-model";
-
 
287
	}
-
 
288
 
272
	// This method is currently hardcoded to faciliate watches sold as gift.
289
	// This method is currently hardcoded to faciliate watches sold as gift.
273
	private boolean hasGift(int fofoId) {
290
	private boolean hasGift(int fofoId) {
274
		try {
291
		try {
275
			return currentInventorySnapshotRepository.selectByItemIdAndFofoId(ProfitMandiConstants.GIFT_ID, fofoId)
292
			return currentInventorySnapshotRepository.selectByItemIdAndFofoId(ProfitMandiConstants.GIFT_ID, fofoId)
276
					.getAvailability() > 0;
293
					.getAvailability() > 0;