| Line 4... |
Line 4... |
| 4 |
import java.io.ByteArrayOutputStream;
|
4 |
import java.io.ByteArrayOutputStream;
|
| 5 |
import java.io.IOException;
|
5 |
import java.io.IOException;
|
| 6 |
import java.io.InputStream;
|
6 |
import java.io.InputStream;
|
| 7 |
import java.io.InputStreamReader;
|
7 |
import java.io.InputStreamReader;
|
| 8 |
import java.net.URISyntaxException;
|
8 |
import java.net.URISyntaxException;
|
| 9 |
import java.text.MessageFormat;
|
- |
|
| 10 |
import java.time.LocalDate;
|
9 |
import java.time.LocalDate;
|
| 11 |
import java.time.LocalDateTime;
|
10 |
import java.time.LocalDateTime;
|
| 12 |
import java.time.YearMonth;
|
11 |
import java.time.YearMonth;
|
| 13 |
import java.time.format.DateTimeFormatter;
|
12 |
import java.time.format.DateTimeFormatter;
|
| 14 |
import java.time.temporal.ChronoUnit;
|
13 |
import java.time.temporal.ChronoUnit;
|
| Line 59... |
Line 58... |
| 59 |
import org.springframework.web.bind.annotation.RequestMethod;
|
58 |
import org.springframework.web.bind.annotation.RequestMethod;
|
| 60 |
import org.springframework.web.bind.annotation.RequestParam;
|
59 |
import org.springframework.web.bind.annotation.RequestParam;
|
| 61 |
import org.springframework.web.bind.annotation.RequestPart;
|
60 |
import org.springframework.web.bind.annotation.RequestPart;
|
| 62 |
import org.springframework.web.multipart.MultipartFile;
|
61 |
import org.springframework.web.multipart.MultipartFile;
|
| 63 |
|
62 |
|
| - |
|
63 |
import com.fasterxml.jackson.databind.ObjectMapper;
|
| 64 |
import com.google.gson.Gson;
|
64 |
import com.google.gson.Gson;
|
| 65 |
import com.spice.profitmandi.common.enumuration.MessageType;
|
65 |
import com.spice.profitmandi.common.enumuration.MessageType;
|
| 66 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
66 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 67 |
import com.spice.profitmandi.common.model.CustomCurrentInventorySnapshot;
|
67 |
import com.spice.profitmandi.common.model.CustomCurrentInventorySnapshot;
|
| 68 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
68 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
| Line 78... |
Line 78... |
| 78 |
import com.spice.profitmandi.common.util.ExcelUtils;
|
78 |
import com.spice.profitmandi.common.util.ExcelUtils;
|
| 79 |
import com.spice.profitmandi.common.util.PdfUtils;
|
79 |
import com.spice.profitmandi.common.util.PdfUtils;
|
| 80 |
import com.spice.profitmandi.common.util.Utils;
|
80 |
import com.spice.profitmandi.common.util.Utils;
|
| 81 |
import com.spice.profitmandi.common.util.Utils.Attachment;
|
81 |
import com.spice.profitmandi.common.util.Utils.Attachment;
|
| 82 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
82 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
| 83 |
import com.spice.profitmandi.dao.entity.catalog.FocusedModel;
|
- |
|
| 84 |
import com.spice.profitmandi.dao.entity.catalog.FocusedModelByPassRequest;
|
83 |
import com.spice.profitmandi.dao.entity.catalog.FocusedModelByPassRequest;
|
| 85 |
import com.spice.profitmandi.dao.entity.catalog.HighDemandItem;
|
84 |
import com.spice.profitmandi.dao.entity.catalog.HighDemandItem;
|
| 86 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
85 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
| 87 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
86 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
| 88 |
import com.spice.profitmandi.dao.entity.catalog.TagRanking;
|
87 |
import com.spice.profitmandi.dao.entity.catalog.TagRanking;
|
| 89 |
import com.spice.profitmandi.dao.entity.cs.Position;
|
88 |
import com.spice.profitmandi.dao.entity.cs.Position;
|
| 90 |
import com.spice.profitmandi.dao.entity.fofo.CurrentInventorySnapshot;
|
- |
|
| 91 |
import com.spice.profitmandi.dao.entity.fofo.FofoOrder;
|
89 |
import com.spice.profitmandi.dao.entity.fofo.FofoOrder;
|
| - |
|
90 |
import com.spice.profitmandi.dao.entity.fofo.FofoOrderItem;
|
| 92 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
91 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
| 93 |
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
|
92 |
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
|
| 94 |
import com.spice.profitmandi.dao.entity.fofo.LiveDemoSerialNumber;
|
93 |
import com.spice.profitmandi.dao.entity.fofo.LiveDemoSerialNumber;
|
| 95 |
import com.spice.profitmandi.dao.entity.transaction.AddWalletRequest;
|
94 |
import com.spice.profitmandi.dao.entity.fofo.ScanRecord;
|
| 96 |
import com.spice.profitmandi.dao.entity.transaction.NotifyCancel;
|
95 |
import com.spice.profitmandi.dao.entity.transaction.NotifyCancel;
|
| 97 |
import com.spice.profitmandi.dao.entity.transaction.NotifyColorChange;
|
96 |
import com.spice.profitmandi.dao.entity.transaction.NotifyColorChange;
|
| 98 |
import com.spice.profitmandi.dao.entity.transaction.NotifyMessage;
|
97 |
import com.spice.profitmandi.dao.entity.transaction.NotifyMessage;
|
| 99 |
import com.spice.profitmandi.dao.entity.transaction.NotifyOrder;
|
98 |
import com.spice.profitmandi.dao.entity.transaction.NotifyOrder;
|
| 100 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
99 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
| 101 |
import com.spice.profitmandi.dao.enumuration.catalog.ByPassRequestStatus;
|
100 |
import com.spice.profitmandi.dao.enumuration.catalog.ByPassRequestStatus;
|
| 102 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
101 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
| 103 |
import com.spice.profitmandi.dao.enumuration.transaction.AddWalletRequestStatus;
|
- |
|
| 104 |
import com.spice.profitmandi.dao.model.BrandItemWiseTertiaryModel;
|
102 |
import com.spice.profitmandi.dao.model.BrandItemWiseTertiaryModel;
|
| 105 |
import com.spice.profitmandi.dao.model.BrandRegionModel;
|
103 |
import com.spice.profitmandi.dao.model.BrandRegionModel;
|
| 106 |
import com.spice.profitmandi.dao.model.BrandWiseTertiaryModel;
|
104 |
import com.spice.profitmandi.dao.model.BrandWiseTertiaryModel;
|
| 107 |
import com.spice.profitmandi.dao.model.ContentPojo;
|
105 |
import com.spice.profitmandi.dao.model.ContentPojo;
|
| 108 |
import com.spice.profitmandi.dao.model.OpenPoItemModel;
|
106 |
import com.spice.profitmandi.dao.model.OpenPoItemModel;
|
| Line 113... |
Line 111... |
| 113 |
import com.spice.profitmandi.dao.model.SecondaryOrderBillingModel;
|
111 |
import com.spice.profitmandi.dao.model.SecondaryOrderBillingModel;
|
| 114 |
import com.spice.profitmandi.dao.model.SecondaryOrderItemBillingModel;
|
112 |
import com.spice.profitmandi.dao.model.SecondaryOrderItemBillingModel;
|
| 115 |
import com.spice.profitmandi.dao.model.SecondaryWarehouseWiseOrderBilllingModel;
|
113 |
import com.spice.profitmandi.dao.model.SecondaryWarehouseWiseOrderBilllingModel;
|
| 116 |
import com.spice.profitmandi.dao.model.Specification;
|
114 |
import com.spice.profitmandi.dao.model.Specification;
|
| 117 |
import com.spice.profitmandi.dao.model.SpecificationGroup;
|
115 |
import com.spice.profitmandi.dao.model.SpecificationGroup;
|
| 118 |
import com.spice.profitmandi.dao.model.UserCart;
|
- |
|
| 119 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
116 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 120 |
import com.spice.profitmandi.dao.repository.catalog.FocusedModelByPassRepository;
|
117 |
import com.spice.profitmandi.dao.repository.catalog.FocusedModelByPassRepository;
|
| 121 |
import com.spice.profitmandi.dao.repository.catalog.HighDemandItemsRepository;
|
118 |
import com.spice.profitmandi.dao.repository.catalog.HighDemandItemsRepository;
|
| 122 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
119 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
| 123 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
120 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
| Line 126... |
Line 123... |
| 126 |
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
|
123 |
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
|
| 127 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
124 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| 128 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
125 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
| 129 |
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
|
126 |
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
|
| 130 |
import com.spice.profitmandi.dao.repository.fofo.CurrentInventorySnapshotRepository;
|
127 |
import com.spice.profitmandi.dao.repository.fofo.CurrentInventorySnapshotRepository;
|
| - |
|
128 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderItemRepository;
|
| 131 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderRepository;
|
129 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderRepository;
|
| 132 |
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
|
130 |
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
|
| 133 |
import com.spice.profitmandi.dao.repository.fofo.LiveDemoBillingRespository;
|
131 |
import com.spice.profitmandi.dao.repository.fofo.LiveDemoBillingRespository;
|
| - |
|
132 |
import com.spice.profitmandi.dao.repository.fofo.ScanRecordRepository;
|
| 134 |
import com.spice.profitmandi.dao.repository.inventory.NotifyStatus;
|
133 |
import com.spice.profitmandi.dao.repository.inventory.NotifyStatus;
|
| 135 |
import com.spice.profitmandi.dao.repository.transaction.NotifyCancelOrderRepository;
|
134 |
import com.spice.profitmandi.dao.repository.transaction.NotifyCancelOrderRepository;
|
| 136 |
import com.spice.profitmandi.dao.repository.transaction.NotifyColorChangeRepository;
|
135 |
import com.spice.profitmandi.dao.repository.transaction.NotifyColorChangeRepository;
|
| 137 |
import com.spice.profitmandi.dao.repository.transaction.NotifyItemRepository;
|
136 |
import com.spice.profitmandi.dao.repository.transaction.NotifyItemRepository;
|
| 138 |
import com.spice.profitmandi.dao.repository.transaction.NotifyMessageRepository;
|
137 |
import com.spice.profitmandi.dao.repository.transaction.NotifyMessageRepository;
|
| Line 1910... |
Line 1909... |
| 1910 |
model.addAttribute("response", mvcResponseSender.createResponseString(serialNumber));
|
1909 |
model.addAttribute("response", mvcResponseSender.createResponseString(serialNumber));
|
| 1911 |
|
1910 |
|
| 1912 |
return "response";
|
1911 |
return "response";
|
| 1913 |
}
|
1912 |
}
|
| 1914 |
|
1913 |
|
| - |
|
1914 |
@Autowired
|
| - |
|
1915 |
private ObjectMapper objectMapper;
|
| - |
|
1916 |
|
| - |
|
1917 |
@Autowired
|
| - |
|
1918 |
private ScanRecordRepository scanRecordRepository;
|
| - |
|
1919 |
|
| - |
|
1920 |
@RequestMapping(value = "/imei/validate", method = RequestMethod.GET)
|
| - |
|
1921 |
public String validateImei(HttpServletRequest request, @RequestParam String imei,
|
| - |
|
1922 |
@RequestParam String invoiceNumber, Model model) throws Exception {
|
| - |
|
1923 |
boolean isImei = false;
|
| - |
|
1924 |
FofoOrder fo = fofoOrderRepository.selectByInvoiceNumber(invoiceNumber);
|
| - |
|
1925 |
|
| - |
|
1926 |
List<ScanRecord> scanRecords = scanRecordRepository.selectAllByOrderId(fo.getId());
|
| - |
|
1927 |
|
| - |
|
1928 |
for (ScanRecord sr : scanRecords) {
|
| - |
|
1929 |
|
| - |
|
1930 |
InventoryItem inventoryItem = inventoryItemRepository.selectById(sr.getInventoryItemId());
|
| - |
|
1931 |
|
| - |
|
1932 |
if (inventoryItem != null) {
|
| - |
|
1933 |
|
| - |
|
1934 |
if (inventoryItem.getSerialNumber().equals(imei)) {
|
| - |
|
1935 |
|
| - |
|
1936 |
isImei = true;
|
| - |
|
1937 |
|
| - |
|
1938 |
}
|
| - |
|
1939 |
}
|
| - |
|
1940 |
|
| - |
|
1941 |
}
|
| - |
|
1942 |
|
| - |
|
1943 |
LOGGER.info("scanRecord" + scanRecords);
|
| - |
|
1944 |
|
| - |
|
1945 |
model.addAttribute("response", objectMapper.writeValueAsString(isImei));
|
| - |
|
1946 |
return "response";
|
| - |
|
1947 |
}
|
| - |
|
1948 |
|
| 1915 |
}
|
1949 |
}
|