Subversion Repositories SmartDukaan

Rev

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

Rev 26846 Rev 26847
Line 47... Line 47...
47
import com.spice.profitmandi.common.web.client.RestClient;
47
import com.spice.profitmandi.common.web.client.RestClient;
48
import com.spice.profitmandi.common.web.util.ResponseSender;
48
import com.spice.profitmandi.common.web.util.ResponseSender;
49
import com.spice.profitmandi.dao.entity.catalog.Category;
49
import com.spice.profitmandi.dao.entity.catalog.Category;
50
import com.spice.profitmandi.dao.entity.catalog.Item;
50
import com.spice.profitmandi.dao.entity.catalog.Item;
51
import com.spice.profitmandi.dao.entity.catalog.TagListing;
51
import com.spice.profitmandi.dao.entity.catalog.TagListing;
-
 
52
import com.spice.profitmandi.dao.entity.fofo.SuggestedPo;
52
import com.spice.profitmandi.dao.entity.fofo.SuggestedPoDetail;
53
import com.spice.profitmandi.dao.entity.fofo.SuggestedPoDetail;
53
import com.spice.profitmandi.dao.entity.inventory.ItemAvailabilityCache;
54
import com.spice.profitmandi.dao.entity.inventory.ItemAvailabilityCache;
54
import com.spice.profitmandi.dao.model.UserCart;
55
import com.spice.profitmandi.dao.model.UserCart;
55
import com.spice.profitmandi.dao.repository.catalog.CategoryRepository;
56
import com.spice.profitmandi.dao.repository.catalog.CategoryRepository;
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.dtr.Mongo;
59
import com.spice.profitmandi.dao.repository.dtr.Mongo;
59
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
60
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
60
import com.spice.profitmandi.dao.repository.fofo.SuggestedPoDetailRepository;
61
import com.spice.profitmandi.dao.repository.fofo.SuggestedPoDetailRepository;
-
 
62
import com.spice.profitmandi.dao.repository.fofo.SuggestedPoRepository;
61
import com.spice.profitmandi.dao.repository.inventory.ItemAvailabilityCacheRepository;
63
import com.spice.profitmandi.dao.repository.inventory.ItemAvailabilityCacheRepository;
62
import com.spice.profitmandi.service.authentication.RoleManager;
64
import com.spice.profitmandi.service.authentication.RoleManager;
63
import com.spice.profitmandi.service.inventory.AvailabilityInfo;
65
import com.spice.profitmandi.service.inventory.AvailabilityInfo;
64
import com.spice.profitmandi.service.inventory.Bucket;
66
import com.spice.profitmandi.service.inventory.Bucket;
65
import com.spice.profitmandi.service.inventory.FofoAvailabilityInfo;
67
import com.spice.profitmandi.service.inventory.FofoAvailabilityInfo;
Line 129... Line 131...
129
	private RoleManager roleManagerService;
131
	private RoleManager roleManagerService;
130
 
132
 
131
	@Autowired
133
	@Autowired
132
	private SuggestedPoDetailRepository monthlyPoDetailRepository;
134
	private SuggestedPoDetailRepository monthlyPoDetailRepository;
133
 
135
 
-
 
136
	@Autowired
-
 
137
	private SuggestedPoRepository suggestedPoRepository;
-
 
138
 
134
	List<String> filterableParams = Arrays.asList("brand");
139
	List<String> filterableParams = Arrays.asList("brand");
135
 
140
 
136
	@RequestMapping(value = "/fofo/buckets", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
141
	@RequestMapping(value = "/fofo/buckets", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
137
	public ResponseEntity<?> getBuckets(HttpServletRequest request) throws ProfitMandiBusinessException {
142
	public ResponseEntity<?> getBuckets(HttpServletRequest request) throws ProfitMandiBusinessException {
138
		logger.info("Request " + request.getParameterMap());
143
		logger.info("Request " + request.getParameterMap());
Line 206... Line 211...
206
		List<FofoCatalogResponse> dealResponse = getCatalogSingleSkuResponse(docs, itemIdsQtyMap, false);
211
		List<FofoCatalogResponse> dealResponse = getCatalogSingleSkuResponse(docs, itemIdsQtyMap, false);
207
 
212
 
208
		return responseSender.ok(dealResponse);
213
		return responseSender.ok(dealResponse);
209
	}
214
	}
210
 
215
 
-
 
216
	@RequestMapping(value = "/suggestedPo/status", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
-
 
217
	public ResponseEntity<?> changeSuggestedPoStatus(HttpServletRequest request, @RequestParam int id)
-
 
218
			throws ProfitMandiBusinessException {
-
 
219
		SuggestedPo suggestedPo = suggestedPoRepository.selectById(id);
-
 
220
		suggestedPo.setStatus("closed");
-
 
221
 
-
 
222
		return responseSender.ok(true);
-
 
223
	}
-
 
224
 
211
	private String getCommaSeparateTags(int userId) {
225
	private String getCommaSeparateTags(int userId) {
212
		UserCart uc = userAccountRepository.getUserCart(userId);
226
		UserCart uc = userAccountRepository.getUserCart(userId);
213
		List<Integer> tagIds = pricingService.getTagsIdsByRetailerId(uc.getUserId());
227
		List<Integer> tagIds = pricingService.getTagsIdsByRetailerId(uc.getUserId());
214
		List<String> strTagIds = new ArrayList<>();
228
		List<String> strTagIds = new ArrayList<>();
215
		for (Integer tagId : tagIds) {
229
		for (Integer tagId : tagIds) {