Subversion Repositories SmartDukaan

Rev

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

Rev 33474 Rev 34196
Line 9... Line 9...
9
import java.util.Set;
9
import java.util.Set;
10
import java.util.stream.Collectors;
10
import java.util.stream.Collectors;
11
 
11
 
12
import javax.servlet.http.HttpServletRequest;
12
import javax.servlet.http.HttpServletRequest;
13
 
13
 
-
 
14
import com.spice.profitmandi.common.enumuration.SchemeType;
-
 
15
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
-
 
16
import com.spice.profitmandi.common.model.UserInfo;
-
 
17
import com.spice.profitmandi.common.web.client.RestClient;
-
 
18
import com.spice.profitmandi.dao.model.*;
-
 
19
import com.spice.profitmandi.dao.repository.fofo.FofoOpeningStockRepository;
-
 
20
import com.spice.profitmandi.service.inventory.*;
-
 
21
import org.apache.commons.lang3.StringUtils;
-
 
22
import org.apache.http.conn.HttpHostConnectException;
14
import org.apache.logging.log4j.LogManager;
23
import org.apache.logging.log4j.LogManager;
15
import org.apache.logging.log4j.Logger;
24
import org.apache.logging.log4j.Logger;
-
 
25
import org.json.JSONArray;
16
import org.json.JSONObject;
26
import org.json.JSONObject;
17
import org.springframework.beans.factory.annotation.Autowired;
27
import org.springframework.beans.factory.annotation.Autowired;
18
import org.springframework.http.MediaType;
28
import org.springframework.http.MediaType;
19
import org.springframework.http.ResponseEntity;
29
import org.springframework.http.ResponseEntity;
20
import org.springframework.stereotype.Controller;
30
import org.springframework.stereotype.Controller;
21
import org.springframework.transaction.annotation.Transactional;
31
import org.springframework.transaction.annotation.Transactional;
22
import org.springframework.ui.Model;
32
import org.springframework.ui.Model;
23
import org.springframework.web.bind.annotation.RequestBody;
33
import org.springframework.web.bind.annotation.*;
24
import org.springframework.web.bind.annotation.RequestMapping;
-
 
25
import org.springframework.web.bind.annotation.RequestMethod;
-
 
26
import org.springframework.web.bind.annotation.RequestParam;
-
 
27
 
34
 
28
import com.spice.profitmandi.common.enumuration.MessageType;
35
import com.spice.profitmandi.common.enumuration.MessageType;
29
import com.spice.profitmandi.common.model.CustomRetailer;
36
import com.spice.profitmandi.common.model.CustomRetailer;
30
import com.spice.profitmandi.common.model.ProfitMandiConstants;
37
import com.spice.profitmandi.common.model.ProfitMandiConstants;
31
import com.spice.profitmandi.common.model.SendNotificationModel;
38
import com.spice.profitmandi.common.model.SendNotificationModel;
Line 42... Line 49...
42
import com.spice.profitmandi.dao.entity.transaction.UserWalletHistory;
49
import com.spice.profitmandi.dao.entity.transaction.UserWalletHistory;
43
import com.spice.profitmandi.dao.enumuration.catalog.ByPassRequestStatus;
50
import com.spice.profitmandi.dao.enumuration.catalog.ByPassRequestStatus;
44
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
51
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
45
import com.spice.profitmandi.dao.enumuration.dtr.AccountType;
52
import com.spice.profitmandi.dao.enumuration.dtr.AccountType;
46
import com.spice.profitmandi.dao.enumuration.fofo.PaymentStatus;
53
import com.spice.profitmandi.dao.enumuration.fofo.PaymentStatus;
47
import com.spice.profitmandi.dao.model.AddCartRequest;
-
 
48
import com.spice.profitmandi.dao.model.CartItem;
-
 
49
import com.spice.profitmandi.dao.model.CartItemResponseModel;
-
 
50
import com.spice.profitmandi.dao.model.CartResponse;
-
 
51
import com.spice.profitmandi.dao.model.ProductPojo;
-
 
52
import com.spice.profitmandi.dao.model.UserCart;
-
 
53
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
54
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
54
import com.spice.profitmandi.dao.repository.catalog.FocusedModelByPassRepository;
55
import com.spice.profitmandi.dao.repository.catalog.FocusedModelByPassRepository;
55
import com.spice.profitmandi.dao.repository.catalog.FocusedModelRepository;
56
import com.spice.profitmandi.dao.repository.catalog.FocusedModelRepository;
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;
Line 68... Line 69...
68
import com.spice.profitmandi.dao.repository.transaction.UserWalletHistoryRepository;
69
import com.spice.profitmandi.dao.repository.transaction.UserWalletHistoryRepository;
69
import com.spice.profitmandi.dao.util.ContentPojoPopulator;
70
import com.spice.profitmandi.dao.util.ContentPojoPopulator;
70
import com.spice.profitmandi.service.FofoUser;
71
import com.spice.profitmandi.service.FofoUser;
71
import com.spice.profitmandi.service.NotificationService;
72
import com.spice.profitmandi.service.NotificationService;
72
import com.spice.profitmandi.service.PartnerInvestmentService;
73
import com.spice.profitmandi.service.PartnerInvestmentService;
73
import com.spice.profitmandi.service.inventory.ByPassRequestModel;
-
 
74
import com.spice.profitmandi.service.inventory.FocusedShortageModel;
-
 
75
import com.spice.profitmandi.service.inventory.ItemBucketService;
-
 
76
import com.spice.profitmandi.service.inventory.SaholicInventoryService;
-
 
77
import com.spice.profitmandi.service.transaction.TransactionService;
74
import com.spice.profitmandi.service.transaction.TransactionService;
78
import com.spice.profitmandi.service.user.RetailerService;
75
import com.spice.profitmandi.service.user.RetailerService;
79
import com.spice.profitmandi.service.wallet.WalletService;
76
import com.spice.profitmandi.service.wallet.WalletService;
80
import com.spice.profitmandi.web.res.ValidateCartResponse;
77
import com.spice.profitmandi.web.res.ValidateCartResponse;
81
 
78
 
Line 161... Line 158...
161
 
158
 
162
	@Autowired
159
	@Autowired
163
	private NotificationService notificationService;
160
	private NotificationService notificationService;
164
 
161
 
165
	@Autowired
162
	@Autowired
-
 
163
	private FofoOpeningStockRepository fofoOpeningStockRepository;
-
 
164
 
-
 
165
	@Autowired
166
	private CurrentInventorySnapshotRepository currentInventorySnapshotRepository;
166
	private CurrentInventorySnapshotRepository currentInventorySnapshotRepository;
167
 
167
 
168
	public static final Map<String, Integer> MIN_BRAND_QTY_LIMIT = new HashMap<>();
168
	public static final Map<String, Integer> MIN_BRAND_QTY_LIMIT = new HashMap<>();
169
 
169
 
170
	private static final Logger log = LogManager.getLogger(CartController.class);
170
	private static final Logger log = LogManager.getLogger(CartController.class);
Line 409... Line 409...
409
				}
409
				}
410
			}
410
			}
411
		}
411
		}
412
		return responseSender.ok(false);
412
		return responseSender.ok(false);
413
	}
413
	}
-
 
414
 
-
 
415
	@RequestMapping(value = "/partner/hidAllocation", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
-
 
416
	@ApiImplicitParams({@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header")})
-
 
417
	public ResponseEntity<?> getItemHidAllocation(HttpServletRequest request) throws
-
 
418
			Exception {
-
 
419
		List<HidAllocationModel> hidAllocationModels = new ArrayList<>();
-
 
420
 
-
 
421
		int userId = (int) request.getAttribute(ProfitMandiConstants.USER_ID);
-
 
422
		int retailerId = userAccountRepository.selectRetailerIdByUserId(userId);
-
 
423
 
-
 
424
		hidAllocationModels = fofoOpeningStockRepository.getPartnerHidAllocation(retailerId);
-
 
425
 
-
 
426
		return responseSender.ok(hidAllocationModels);
-
 
427
	}
-
 
428
 
-
 
429
 
414
}
430
}
415
431