| Line 22... |
Line 22... |
| 22 |
import com.spice.profitmandi.common.ResponseCodeHolder;
|
22 |
import com.spice.profitmandi.common.ResponseCodeHolder;
|
| 23 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
23 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 24 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
24 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 25 |
import com.spice.profitmandi.common.model.UserInfo;
|
25 |
import com.spice.profitmandi.common.model.UserInfo;
|
| 26 |
import com.spice.profitmandi.common.util.StringUtils;
|
26 |
import com.spice.profitmandi.common.util.StringUtils;
|
| 27 |
import com.spice.profitmandi.common.util.Utils;
|
- |
|
| 28 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
27 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
| 29 |
import com.spice.profitmandi.dao.entity.dtr.Brand;
|
28 |
import com.spice.profitmandi.dao.entity.dtr.Brand;
|
| 30 |
import com.spice.profitmandi.dao.entity.dtr.DistrictMaster;
|
29 |
import com.spice.profitmandi.dao.entity.dtr.DistrictMaster;
|
| 31 |
import com.spice.profitmandi.dao.entity.dtr.Document;
|
30 |
import com.spice.profitmandi.dao.entity.dtr.Document;
|
| 32 |
import com.spice.profitmandi.dao.entity.dtr.Retailer;
|
31 |
import com.spice.profitmandi.dao.entity.dtr.Retailer;
|
| Line 70... |
Line 69... |
| 70 |
import com.spice.profitmandi.web.req.Category;
|
69 |
import com.spice.profitmandi.web.req.Category;
|
| 71 |
import com.spice.profitmandi.web.req.CreateRetailerAddressRequest;
|
70 |
import com.spice.profitmandi.web.req.CreateRetailerAddressRequest;
|
| 72 |
import com.spice.profitmandi.web.req.CreateRetailerRequest;
|
71 |
import com.spice.profitmandi.web.req.CreateRetailerRequest;
|
| 73 |
import com.spice.profitmandi.web.req.RetailerAddBrandRequest;
|
72 |
import com.spice.profitmandi.web.req.RetailerAddBrandRequest;
|
| 74 |
|
73 |
|
| 75 |
import in.shop2020.model.v1.inventory.StateInfo;
|
74 |
import com.spice.profitmandi.dao.entity.inventory.State;
|
| - |
|
75 |
import com.spice.profitmandi.dao.repository.inventory.StateRepository;
|
| 76 |
import in.shop2020.model.v1.user.CartStatus;
|
76 |
import in.shop2020.model.v1.user.CartStatus;
|
| 77 |
import io.swagger.annotations.ApiImplicitParam;
|
77 |
import io.swagger.annotations.ApiImplicitParam;
|
| 78 |
import io.swagger.annotations.ApiImplicitParams;
|
78 |
import io.swagger.annotations.ApiImplicitParams;
|
| 79 |
import io.swagger.annotations.ApiOperation;
|
79 |
import io.swagger.annotations.ApiOperation;
|
| 80 |
|
80 |
|
| Line 149... |
Line 149... |
| 149 |
@Autowired
|
149 |
@Autowired
|
| 150 |
private DistrictMasterRepository districtMasterRepository;
|
150 |
private DistrictMasterRepository districtMasterRepository;
|
| 151 |
|
151 |
|
| 152 |
@Autowired
|
152 |
@Autowired
|
| 153 |
private FofoStoreRepository fofoStoreRepository;
|
153 |
private FofoStoreRepository fofoStoreRepository;
|
| - |
|
154 |
|
| - |
|
155 |
@Autowired
|
| - |
|
156 |
private StateRepository stateRepository;
|
| 154 |
|
157 |
|
| 155 |
@Autowired
|
158 |
@Autowired
|
| 156 |
private Mongo mongoClient;
|
159 |
private Mongo mongoClient;
|
| 157 |
|
160 |
|
| 158 |
@ApiImplicitParams({
|
161 |
@ApiImplicitParams({
|
| Line 410... |
Line 413... |
| 410 |
}
|
413 |
}
|
| 411 |
|
414 |
|
| 412 |
int retailerAddressId = retailerRegisteredAddressRepository.selectAddressIdByRetailerId(retailer.getId());
|
415 |
int retailerAddressId = retailerRegisteredAddressRepository.selectAddressIdByRetailerId(retailer.getId());
|
| 413 |
Address retailerAddress = addressRepository.selectById(retailerAddressId);
|
416 |
Address retailerAddress = addressRepository.selectById(retailerAddressId);
|
| 414 |
|
417 |
|
| 415 |
StateInfo stateInfo = Utils.getStateInfo(retailerAddress.getState());
|
418 |
State state = stateRepository.selectByName(retailerAddress.getState());
|
| 416 |
DistrictMaster districtMaster = districtMasterRepository.selectByNameAndStateShortName(districtName, stateInfo.getShortName());
|
419 |
DistrictMaster districtMaster = districtMasterRepository.selectByNameAndStateShortName(districtName, state.getShortName());
|
| 417 |
|
420 |
|
| 418 |
FofoStore fofoStore = new FofoStore();
|
421 |
FofoStore fofoStore = new FofoStore();
|
| 419 |
String latestStoreCode = fofoStoreRepository.selectLatestStore().getCode();
|
422 |
String latestStoreCode = fofoStoreRepository.selectLatestStore().getCode();
|
| 420 |
int latestCodeCounter = Integer.parseInt(latestStoreCode.replaceAll("[A-Z]", ""));
|
423 |
int latestCodeCounter = Integer.parseInt(latestStoreCode.replaceAll("[A-Z]", ""));
|
| 421 |
fofoStore.setId(retailer.getId());
|
424 |
fofoStore.setId(retailer.getId());
|