| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.service.order;
|
1 |
package com.spice.profitmandi.service.order;
|
| 2 |
|
2 |
|
| 3 |
import java.time.LocalDate;
|
3 |
import java.time.LocalDate;
|
| 4 |
import java.time.LocalDateTime;
|
4 |
import java.time.LocalDateTime;
|
| 5 |
import java.time.LocalTime;
|
5 |
import java.time.LocalTime;
|
| - |
|
6 |
import java.util.AbstractMap.SimpleEntry;
|
| 6 |
import java.util.ArrayList;
|
7 |
import java.util.ArrayList;
|
| 7 |
import java.util.Arrays;
|
8 |
import java.util.Arrays;
|
| 8 |
import java.util.HashMap;
|
9 |
import java.util.HashMap;
|
| 9 |
import java.util.HashSet;
|
10 |
import java.util.HashSet;
|
| 10 |
import java.util.Iterator;
|
11 |
import java.util.Iterator;
|
| 11 |
import java.util.List;
|
12 |
import java.util.List;
|
| 12 |
import java.util.Map;
|
13 |
import java.util.Map;
|
| 13 |
import java.util.Optional;
|
14 |
import java.util.Optional;
|
| 14 |
import java.util.Random;
|
15 |
import java.util.Random;
|
| 15 |
import java.util.Set;
|
16 |
import java.util.Set;
|
| 16 |
import java.util.AbstractMap.SimpleEntry;
|
- |
|
| 17 |
import java.util.function.Function;
|
17 |
import java.util.function.Function;
|
| 18 |
import java.util.stream.Collectors;
|
18 |
import java.util.stream.Collectors;
|
| 19 |
|
19 |
|
| 20 |
import javax.persistence.criteria.CriteriaBuilder;
|
20 |
import javax.persistence.criteria.CriteriaBuilder;
|
| 21 |
import javax.persistence.criteria.CriteriaQuery;
|
21 |
import javax.persistence.criteria.CriteriaQuery;
|
| Line 30... |
Line 30... |
| 30 |
import org.springframework.beans.factory.annotation.Autowired;
|
30 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 31 |
import org.springframework.beans.factory.annotation.Qualifier;
|
31 |
import org.springframework.beans.factory.annotation.Qualifier;
|
| 32 |
import org.springframework.cache.annotation.Cacheable;
|
32 |
import org.springframework.cache.annotation.Cacheable;
|
| 33 |
import org.springframework.stereotype.Component;
|
33 |
import org.springframework.stereotype.Component;
|
| 34 |
|
34 |
|
| 35 |
import com.mongodb.MongoClient;
|
- |
|
| 36 |
import com.spice.profitmandi.common.enumuration.ItemType;
|
35 |
import com.spice.profitmandi.common.enumuration.ItemType;
|
| 37 |
import com.spice.profitmandi.common.enumuration.SearchType;
|
36 |
import com.spice.profitmandi.common.enumuration.SearchType;
|
| 38 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
37 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 39 |
import com.spice.profitmandi.common.model.BadReturnRequest;
|
38 |
import com.spice.profitmandi.common.model.BadReturnRequest;
|
| 40 |
import com.spice.profitmandi.common.model.CartFofo;
|
39 |
import com.spice.profitmandi.common.model.CartFofo;
|
| Line 42... |
Line 41... |
| 42 |
import com.spice.profitmandi.common.model.CreditNotePdfModel;
|
41 |
import com.spice.profitmandi.common.model.CreditNotePdfModel;
|
| 43 |
import com.spice.profitmandi.common.model.CustomAddress;
|
42 |
import com.spice.profitmandi.common.model.CustomAddress;
|
| 44 |
import com.spice.profitmandi.common.model.CustomCustomer;
|
43 |
import com.spice.profitmandi.common.model.CustomCustomer;
|
| 45 |
import com.spice.profitmandi.common.model.CustomFofoOrderItem;
|
44 |
import com.spice.profitmandi.common.model.CustomFofoOrderItem;
|
| 46 |
import com.spice.profitmandi.common.model.CustomInsurancePolicy;
|
45 |
import com.spice.profitmandi.common.model.CustomInsurancePolicy;
|
| 47 |
import com.spice.profitmandi.common.model.CustomLineItem;
|
- |
|
| 48 |
import com.spice.profitmandi.common.model.CustomOrderItem;
|
46 |
import com.spice.profitmandi.common.model.CustomOrderItem;
|
| 49 |
import com.spice.profitmandi.common.model.CustomPaymentOption;
|
47 |
import com.spice.profitmandi.common.model.CustomPaymentOption;
|
| 50 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
48 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
| 51 |
import com.spice.profitmandi.common.model.FoiBadReturnRequest;
|
49 |
import com.spice.profitmandi.common.model.FoiBadReturnRequest;
|
| 52 |
import com.spice.profitmandi.common.model.GstRate;
|
50 |
import com.spice.profitmandi.common.model.GstRate;
|
| Line 80... |
Line 78... |
| 80 |
import com.spice.profitmandi.dao.entity.fofo.InvoiceNumberGenerationSequence;
|
78 |
import com.spice.profitmandi.dao.entity.fofo.InvoiceNumberGenerationSequence;
|
| 81 |
import com.spice.profitmandi.dao.entity.fofo.LiveDemoSerialNumber;
|
79 |
import com.spice.profitmandi.dao.entity.fofo.LiveDemoSerialNumber;
|
| 82 |
import com.spice.profitmandi.dao.entity.fofo.PendingOrder;
|
80 |
import com.spice.profitmandi.dao.entity.fofo.PendingOrder;
|
| 83 |
import com.spice.profitmandi.dao.entity.fofo.PendingOrderItem;
|
81 |
import com.spice.profitmandi.dao.entity.fofo.PendingOrderItem;
|
| 84 |
import com.spice.profitmandi.dao.entity.fofo.ScanRecord;
|
82 |
import com.spice.profitmandi.dao.entity.fofo.ScanRecord;
|
| - |
|
83 |
import com.spice.profitmandi.dao.entity.inventory.State;
|
| 85 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
84 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
| 86 |
import com.spice.profitmandi.dao.entity.user.Address;
|
85 |
import com.spice.profitmandi.dao.entity.user.Address;
|
| 87 |
import com.spice.profitmandi.dao.entity.user.Counter;
|
86 |
import com.spice.profitmandi.dao.entity.user.Counter;
|
| 88 |
import com.spice.profitmandi.dao.entity.user.PrivateDealUser;
|
87 |
import com.spice.profitmandi.dao.entity.user.PrivateDealUser;
|
| 89 |
import com.spice.profitmandi.dao.entity.warehouse.WarehouseInventoryItem;
|
88 |
import com.spice.profitmandi.dao.entity.warehouse.WarehouseInventoryItem;
|
| Line 132... |
Line 131... |
| 132 |
import com.spice.profitmandi.service.integrations.zest.InsuranceService;
|
131 |
import com.spice.profitmandi.service.integrations.zest.InsuranceService;
|
| 133 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
132 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
| 134 |
import com.spice.profitmandi.service.inventory.PurchaseReturnService;
|
133 |
import com.spice.profitmandi.service.inventory.PurchaseReturnService;
|
| 135 |
import com.spice.profitmandi.service.inventory.SaholicInventoryService;
|
134 |
import com.spice.profitmandi.service.inventory.SaholicInventoryService;
|
| 136 |
import com.spice.profitmandi.service.offers.ItemCriteria;
|
135 |
import com.spice.profitmandi.service.offers.ItemCriteria;
|
| 137 |
import com.spice.profitmandi.service.offers.PartnerCriteria;
|
- |
|
| 138 |
import com.spice.profitmandi.service.pricing.PricingService;
|
136 |
import com.spice.profitmandi.service.pricing.PricingService;
|
| 139 |
import com.spice.profitmandi.service.scheme.SchemeService;
|
137 |
import com.spice.profitmandi.service.scheme.SchemeService;
|
| 140 |
import com.spice.profitmandi.service.user.RetailerService;
|
138 |
import com.spice.profitmandi.service.user.RetailerService;
|
| 141 |
import com.spice.profitmandi.service.wallet.WalletService;
|
139 |
import com.spice.profitmandi.service.wallet.WalletService;
|
| 142 |
|
140 |
|
| Line 519... |
Line 517... |
| 519 |
Address retailerAddress = addressRepository.selectById(retailerAddressId);
|
517 |
Address retailerAddress = addressRepository.selectById(retailerAddressId);
|
| 520 |
|
518 |
|
| 521 |
Integer stateId = null;
|
519 |
Integer stateId = null;
|
| 522 |
if (customerAddress.getState().equals(retailerAddress.getState())) {
|
520 |
if (customerAddress.getState().equals(retailerAddress.getState())) {
|
| 523 |
try {
|
521 |
try {
|
| - |
|
522 |
State state = stateRepository.selectByName(customerAddress.getState());
|
| 524 |
stateId = Long.valueOf(Utils.getStateInfo(customerAddress.getState()).getId()).intValue();
|
523 |
stateId = Long.valueOf(state.getId()).intValue();
|
| 525 |
} catch (Exception e) {
|
524 |
} catch (Exception e) {
|
| 526 |
LOGGER.error("Unable to get state rates");
|
525 |
LOGGER.error("Unable to get state rates");
|
| 527 |
}
|
526 |
}
|
| 528 |
}
|
527 |
}
|
| 529 |
|
528 |
|