| Line 150... |
Line 150... |
| 150 |
//1 is road, 2 is rail, 3 is air, 4 is ship
|
150 |
//1 is road, 2 is rail, 3 is air, 4 is ship
|
| 151 |
|
151 |
|
| 152 |
if (order.getLogisticsProviderId() == ProfitMandiConstants.LOGISTICS_PROVIDER_SELF_PICKUP
|
152 |
if (order.getLogisticsProviderId() == ProfitMandiConstants.LOGISTICS_PROVIDER_SELF_PICKUP
|
| 153 |
|| order.getLogisticsProviderId() == ProfitMandiConstants.LOGISTICS_PROVIDER_RUNNER) {
|
153 |
|| order.getLogisticsProviderId() == ProfitMandiConstants.LOGISTICS_PROVIDER_RUNNER) {
|
| 154 |
TransactionShipmentSequence transactionShipmentSequence = transactionShipmentSequenceRepository.selectByTransactionShipmentSequence(order.getLogisticsTransactionId());
|
154 |
TransactionShipmentSequence transactionShipmentSequence = transactionShipmentSequenceRepository.selectByTransactionShipmentSequence(order.getLogisticsTransactionId());
|
| - |
|
155 |
if (transactionShipmentSequence != null) {
|
| 155 |
ewbDetails.VehNo = transactionShipmentSequence.getVehicleNumber();
|
156 |
ewbDetails.VehNo = transactionShipmentSequence.getVehicleNumber();
|
| 156 |
ewbDetails.VehType = "R";
|
157 |
ewbDetails.VehType = "R";
|
| 157 |
ewbDetails.TransMode = "1";
|
158 |
ewbDetails.TransMode = "1";
|
| 158 |
ewbDetails.TransDocDt = com.spice.profitmandi.common.util.StringUtils.toString(order.getBillingTimestamp().toLocalDate());
|
159 |
ewbDetails.TransDocDt = com.spice.profitmandi.common.util.StringUtils.toString(order.getBillingTimestamp().toLocalDate());
|
| 159 |
ewbDetails.TransDocNo = order.getAirwayBillNumber();
|
160 |
ewbDetails.TransDocNo = order.getAirwayBillNumber();
|
| - |
|
161 |
} else {
|
| - |
|
162 |
LOGGER.warn("No shipment sequence found for logistics transaction: {}, order will get EWB Part A only", order.getLogisticsTransactionId());
|
| - |
|
163 |
}
|
| 160 |
} else {
|
164 |
} else {
|
| 161 |
WarehouseProvider warehouseProvider = warehouseProviderRepository.selectByProviderWarehouse(order.getLogisticsProviderId(), order.getWarehouseId());
|
165 |
WarehouseProvider warehouseProvider = warehouseProviderRepository.selectByProviderWarehouse(order.getLogisticsProviderId(), order.getWarehouseId());
|
| 162 |
Provider provider = providerRepository.selectById(order.getLogisticsProviderId());
|
166 |
Provider provider = providerRepository.selectById(order.getLogisticsProviderId());
|
| 163 |
//Get logistics Provider Detail here
|
167 |
if (warehouseProvider != null && provider != null) {
|
| 164 |
ewbDetails.TransId = warehouseProvider.getGstin();
|
168 |
ewbDetails.TransId = warehouseProvider.getGstin();
|
| 165 |
ewbDetails.TransName = provider.getName();
|
169 |
ewbDetails.TransName = provider.getName();
|
| - |
|
170 |
} else {
|
| - |
|
171 |
LOGGER.warn("No provider details for logistics provider: {}, warehouse: {}", order.getLogisticsProviderId(), order.getWarehouseId());
|
| - |
|
172 |
}
|
| 166 |
}
|
173 |
}
|
| 167 |
|
174 |
|
| 168 |
String distance = "0";
|
175 |
String distance = "0";
|
| 169 |
WarehousePartnerDistanceMapping distanceMapping = warehousePartnerDistanceMappingRepository.selectByWarehouseIdAndFofoId(order.getWarehouseId(), order.getRetailerId());
|
176 |
WarehousePartnerDistanceMapping distanceMapping = warehousePartnerDistanceMappingRepository.selectByWarehouseIdAndFofoId(order.getWarehouseId(), order.getRetailerId());
|
| 170 |
if (distanceMapping != null) {
|
177 |
if (distanceMapping != null) {
|