| Line 40... |
Line 40... |
| 40 |
import com.spice.profitmandi.common.model.AddLocationModel;
|
40 |
import com.spice.profitmandi.common.model.AddLocationModel;
|
| 41 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
41 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
| 42 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
42 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 43 |
import com.spice.profitmandi.common.model.PromoterDetailModel;
|
43 |
import com.spice.profitmandi.common.model.PromoterDetailModel;
|
| 44 |
import com.spice.profitmandi.common.model.UpdateRetailerRequest;
|
44 |
import com.spice.profitmandi.common.model.UpdateRetailerRequest;
|
| - |
|
45 |
import com.spice.profitmandi.common.util.Utils;
|
| 45 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
46 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
| 46 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
47 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
| 47 |
import com.spice.profitmandi.dao.entity.cs.PartnerPosition;
|
48 |
import com.spice.profitmandi.dao.entity.cs.PartnerPosition;
|
| 48 |
import com.spice.profitmandi.dao.entity.cs.Position;
|
49 |
import com.spice.profitmandi.dao.entity.cs.Position;
|
| 49 |
import com.spice.profitmandi.dao.entity.dtr.Document;
|
50 |
import com.spice.profitmandi.dao.entity.dtr.Document;
|
| 50 |
import com.spice.profitmandi.dao.entity.dtr.Retailer;
|
51 |
import com.spice.profitmandi.dao.entity.dtr.Retailer;
|
| - |
|
52 |
import com.spice.profitmandi.dao.entity.dtr.RetailerBlockBrands;
|
| 51 |
import com.spice.profitmandi.dao.entity.dtr.Shop;
|
53 |
import com.spice.profitmandi.dao.entity.dtr.Shop;
|
| 52 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
54 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
| 53 |
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
|
55 |
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
|
| 54 |
import com.spice.profitmandi.dao.entity.fofo.PartnerTypeChange;
|
56 |
import com.spice.profitmandi.dao.entity.fofo.PartnerTypeChange;
|
| 55 |
import com.spice.profitmandi.dao.entity.user.Location;
|
57 |
import com.spice.profitmandi.dao.entity.user.Location;
|
| Line 58... |
Line 60... |
| 58 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
60 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 59 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
61 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
| 60 |
import com.spice.profitmandi.dao.repository.dtr.DocumentRepository;
|
62 |
import com.spice.profitmandi.dao.repository.dtr.DocumentRepository;
|
| 61 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
63 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| 62 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
64 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
| - |
|
65 |
import com.spice.profitmandi.dao.repository.dtr.RetailerBlockBrandsRepository;
|
| 63 |
import com.spice.profitmandi.dao.repository.dtr.RetailerRepository;
|
66 |
import com.spice.profitmandi.dao.repository.dtr.RetailerRepository;
|
| 64 |
import com.spice.profitmandi.dao.repository.dtr.ShopRepository;
|
67 |
import com.spice.profitmandi.dao.repository.dtr.ShopRepository;
|
| 65 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeRepository;
|
68 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeRepository;
|
| 66 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
69 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
| 67 |
import com.spice.profitmandi.dao.repository.user.LocationRepository;
|
70 |
import com.spice.profitmandi.dao.repository.user.LocationRepository;
|
| Line 88... |
Line 91... |
| 88 |
|
91 |
|
| 89 |
@Autowired
|
92 |
@Autowired
|
| 90 |
private ShopRepository shopRepository;
|
93 |
private ShopRepository shopRepository;
|
| 91 |
|
94 |
|
| 92 |
@Autowired
|
95 |
@Autowired
|
| - |
|
96 |
private RetailerBlockBrandsRepository retailerBlockBrandsRepository;
|
| - |
|
97 |
|
| - |
|
98 |
@Autowired
|
| 93 |
private FofoStoreRepository fofoStoreRepository;
|
99 |
private FofoStoreRepository fofoStoreRepository;
|
| 94 |
|
100 |
|
| 95 |
@Autowired
|
101 |
@Autowired
|
| 96 |
private DocumentRepository documentRepository;
|
102 |
private DocumentRepository documentRepository;
|
| 97 |
|
103 |
|
| Line 139... |
Line 145... |
| 139 |
public String retailerInfoByEmailIdOrMobileNumber(HttpServletRequest request,
|
145 |
public String retailerInfoByEmailIdOrMobileNumber(HttpServletRequest request,
|
| 140 |
@RequestParam(name = ProfitMandiConstants.EMAIL_ID_OR_MOBILE_NUMBER) String emailIdOrMobileNumber,
|
146 |
@RequestParam(name = ProfitMandiConstants.EMAIL_ID_OR_MOBILE_NUMBER) String emailIdOrMobileNumber,
|
| 141 |
Model model) throws ProfitMandiBusinessException {
|
147 |
Model model) throws ProfitMandiBusinessException {
|
| 142 |
LOGGER.info("Request Received at url {} with emailIdOrMobileNumber {}", request.getRequestURI(),
|
148 |
LOGGER.info("Request Received at url {} with emailIdOrMobileNumber {}", request.getRequestURI(),
|
| 143 |
emailIdOrMobileNumber);
|
149 |
emailIdOrMobileNumber);
|
| - |
|
150 |
|
| 144 |
Map<String, Object> map = retailerService.getByEmailIdOrMobileNumber(emailIdOrMobileNumber);
|
151 |
Map<String, Object> map = retailerService.getByEmailIdOrMobileNumber(emailIdOrMobileNumber);
|
| - |
|
152 |
|
| 145 |
model.addAllAttributes(map);
|
153 |
model.addAllAttributes(map);
|
| - |
|
154 |
|
| - |
|
155 |
|
| 146 |
model.addAttribute("counterSizes", CounterSize.values());
|
156 |
model.addAttribute("counterSizes", CounterSize.values());
|
| 147 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
157 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
| 148 |
LOGGER.info("warehouseMap", warehouseMap);
|
158 |
LOGGER.info("warehouseMap", warehouseMap);
|
| 149 |
model.addAttribute("warehouses", warehouseMap);
|
159 |
model.addAttribute("warehouses", warehouseMap);
|
| 150 |
if (map.containsKey("retailer")) {
|
160 |
if (map.containsKey("retailer")) {
|
| Line 162... |
Line 172... |
| 162 |
@RequestMapping(value = "/retailerDetails", method = RequestMethod.PUT)
|
172 |
@RequestMapping(value = "/retailerDetails", method = RequestMethod.PUT)
|
| 163 |
public String updateRetailerDetails(HttpServletRequest request,
|
173 |
public String updateRetailerDetails(HttpServletRequest request,
|
| 164 |
@RequestBody UpdateRetailerRequest updateRetailerRequest, Model model) throws ProfitMandiBusinessException {
|
174 |
@RequestBody UpdateRetailerRequest updateRetailerRequest, Model model) throws ProfitMandiBusinessException {
|
| 165 |
LOGGER.info("Request Received at url {} with body {}", request.getRequestURI(), updateRetailerRequest);
|
175 |
LOGGER.info("Request Received at url {} with body {}", request.getRequestURI(), updateRetailerRequest);
|
| 166 |
Map<String, Object> map = retailerService.updateRetailerDetails(updateRetailerRequest);
|
176 |
Map<String, Object> map = retailerService.updateRetailerDetails(updateRetailerRequest);
|
| - |
|
177 |
|
| - |
|
178 |
|
| 167 |
model.addAllAttributes(map);
|
179 |
model.addAllAttributes(map);
|
| 168 |
model.addAttribute("counterSizes", CounterSize.values());
|
180 |
model.addAttribute("counterSizes", CounterSize.values());
|
| 169 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
181 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
| 170 |
LOGGER.info("warehouseMap", warehouseMap);
|
182 |
LOGGER.info("warehouseMap", warehouseMap);
|
| 171 |
model.addAttribute("warehouses", warehouseMap);
|
183 |
model.addAttribute("warehouses", warehouseMap);
|