| 21612 |
ashik.ali |
1 |
package com.spice.profitmandi.web.controller;
|
|
|
2 |
|
| 21689 |
ashik.ali |
3 |
import java.io.ByteArrayInputStream;
|
|
|
4 |
import java.io.ByteArrayOutputStream;
|
|
|
5 |
import java.io.InputStream;
|
| 21680 |
ashik.ali |
6 |
import java.util.ArrayList;
|
|
|
7 |
import java.util.HashMap;
|
| 21612 |
ashik.ali |
8 |
import java.util.HashSet;
|
| 21883 |
kshitij.so |
9 |
import java.util.Iterator;
|
| 21680 |
ashik.ali |
10 |
import java.util.List;
|
|
|
11 |
import java.util.Map;
|
| 21612 |
ashik.ali |
12 |
import java.util.Set;
|
|
|
13 |
|
|
|
14 |
import javax.servlet.http.HttpServletRequest;
|
| 21689 |
ashik.ali |
15 |
import javax.servlet.http.HttpServletResponse;
|
| 21680 |
ashik.ali |
16 |
import javax.transaction.Transactional;
|
| 21612 |
ashik.ali |
17 |
|
| 21883 |
kshitij.so |
18 |
import org.json.JSONObject;
|
| 21612 |
ashik.ali |
19 |
import org.slf4j.Logger;
|
|
|
20 |
import org.slf4j.LoggerFactory;
|
|
|
21 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 21689 |
ashik.ali |
22 |
import org.springframework.core.io.InputStreamResource;
|
|
|
23 |
import org.springframework.http.HttpHeaders;
|
|
|
24 |
import org.springframework.http.HttpStatus;
|
|
|
25 |
import org.springframework.http.MediaType;
|
|
|
26 |
import org.springframework.http.ResponseEntity;
|
| 21612 |
ashik.ali |
27 |
import org.springframework.stereotype.Controller;
|
| 21883 |
kshitij.so |
28 |
import org.springframework.ui.Model;
|
| 21612 |
ashik.ali |
29 |
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
30 |
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
31 |
import org.springframework.web.bind.annotation.RequestMethod;
|
| 21689 |
ashik.ali |
32 |
import org.springframework.web.bind.annotation.RequestParam;
|
| 21612 |
ashik.ali |
33 |
|
|
|
34 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 21883 |
kshitij.so |
35 |
import com.spice.profitmandi.common.model.CartFofo;
|
| 21680 |
ashik.ali |
36 |
import com.spice.profitmandi.common.model.CustomAddress;
|
| 21689 |
ashik.ali |
37 |
import com.spice.profitmandi.common.model.CustomCustomer;
|
|
|
38 |
import com.spice.profitmandi.common.model.CustomFofoLineItem;
|
|
|
39 |
import com.spice.profitmandi.common.model.CustomFofoOrderItem;
|
|
|
40 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
|
|
41 |
import com.spice.profitmandi.common.model.PdfModel;
|
| 21612 |
ashik.ali |
42 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 21689 |
ashik.ali |
43 |
import com.spice.profitmandi.common.util.PdfUtils;
|
| 21680 |
ashik.ali |
44 |
import com.spice.profitmandi.common.util.StringUtils;
|
| 21728 |
ashik.ali |
45 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
|
|
46 |
import com.spice.profitmandi.dao.entity.dtr.Retailer;
|
|
|
47 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
|
|
48 |
import com.spice.profitmandi.dao.entity.fofo.CurrentInventorySnapshot;
|
|
|
49 |
import com.spice.profitmandi.dao.entity.fofo.Customer;
|
|
|
50 |
import com.spice.profitmandi.dao.entity.fofo.CustomerAddress;
|
|
|
51 |
import com.spice.profitmandi.dao.entity.fofo.FofoLineItem;
|
|
|
52 |
import com.spice.profitmandi.dao.entity.fofo.FofoLineItemSerialNumber;
|
|
|
53 |
import com.spice.profitmandi.dao.entity.fofo.FofoOrder;
|
|
|
54 |
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
|
|
|
55 |
import com.spice.profitmandi.dao.entity.fofo.InvoiceNumberGenerationSequence;
|
|
|
56 |
import com.spice.profitmandi.dao.entity.fofo.PaymentOption;
|
|
|
57 |
import com.spice.profitmandi.dao.entity.fofo.ScanRecord;
|
|
|
58 |
import com.spice.profitmandi.dao.entity.transaction.LineItem;
|
|
|
59 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
|
|
60 |
import com.spice.profitmandi.dao.entity.user.Address;
|
|
|
61 |
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
|
| 21883 |
kshitij.so |
62 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
| 21728 |
ashik.ali |
63 |
import com.spice.profitmandi.dao.repository.dtr.RetailerRegisteredAddressRepository;
|
|
|
64 |
import com.spice.profitmandi.dao.repository.dtr.RetailerRepository;
|
|
|
65 |
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
|
|
|
66 |
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
|
|
|
67 |
import com.spice.profitmandi.dao.repository.fofo.CurrentInventorySnapshotRepository;
|
|
|
68 |
import com.spice.profitmandi.dao.repository.fofo.CustomerAddressRepository;
|
|
|
69 |
import com.spice.profitmandi.dao.repository.fofo.CustomerRepository;
|
|
|
70 |
import com.spice.profitmandi.dao.repository.fofo.FofoLineItemRepository;
|
|
|
71 |
import com.spice.profitmandi.dao.repository.fofo.FofoLineItemSerialNumberRepository;
|
|
|
72 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderRepository;
|
|
|
73 |
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
|
|
|
74 |
import com.spice.profitmandi.dao.repository.fofo.InvoiceNumberGenerationSequenceRepository;
|
|
|
75 |
import com.spice.profitmandi.dao.repository.fofo.PaymentOptionRepository;
|
|
|
76 |
import com.spice.profitmandi.dao.repository.fofo.ScanRecordRepository;
|
|
|
77 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
|
|
78 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
| 21612 |
ashik.ali |
79 |
import com.spice.profitmandi.web.model.FofoDetails;
|
|
|
80 |
import com.spice.profitmandi.web.request.CreateOrderRequest;
|
|
|
81 |
import com.spice.profitmandi.web.request.CustomPaymentOption;
|
| 21680 |
ashik.ali |
82 |
import com.spice.profitmandi.web.response.ItemIdQuantityAvailability;
|
|
|
83 |
import com.spice.profitmandi.web.response.Quantity;
|
| 21612 |
ashik.ali |
84 |
import com.spice.profitmandi.web.util.CookiesFetcher;
|
|
|
85 |
import com.spice.profitmandi.web.util.MVCResponseSender;
|
|
|
86 |
|
|
|
87 |
@Controller
|
| 21680 |
ashik.ali |
88 |
@Transactional
|
| 21612 |
ashik.ali |
89 |
public class OrderController {
|
|
|
90 |
|
|
|
91 |
private static final Logger LOGGER = LoggerFactory.getLogger(OrderController.class);
|
| 21883 |
kshitij.so |
92 |
|
| 21612 |
ashik.ali |
93 |
@Autowired
|
|
|
94 |
OrderRepository orderRepository;
|
| 21883 |
kshitij.so |
95 |
|
| 21612 |
ashik.ali |
96 |
@Autowired
|
|
|
97 |
InventoryItemRepository inventoryItemRepository;
|
| 21883 |
kshitij.so |
98 |
|
| 21612 |
ashik.ali |
99 |
@Autowired
|
| 21680 |
ashik.ali |
100 |
CurrentInventorySnapshotRepository currentInventorySnapshotRepository;
|
| 21883 |
kshitij.so |
101 |
|
| 21680 |
ashik.ali |
102 |
@Autowired
|
|
|
103 |
InvoiceNumberGenerationSequenceRepository invoiceNumberGenerationSequenceRepository;
|
| 21883 |
kshitij.so |
104 |
|
| 21680 |
ashik.ali |
105 |
@Autowired
|
|
|
106 |
CustomerRepository customerRepository;
|
| 21883 |
kshitij.so |
107 |
|
| 21680 |
ashik.ali |
108 |
@Autowired
|
|
|
109 |
AddressRepository addressRepository;
|
| 21883 |
kshitij.so |
110 |
|
| 21680 |
ashik.ali |
111 |
@Autowired
|
|
|
112 |
FofoLineItemSerialNumberRepository fofoLineItemSerialNumberRepository;
|
| 21883 |
kshitij.so |
113 |
|
| 21680 |
ashik.ali |
114 |
@Autowired
|
|
|
115 |
FofoLineItemRepository fofoLineItemRepository;
|
| 21883 |
kshitij.so |
116 |
|
| 21680 |
ashik.ali |
117 |
@Autowired
|
|
|
118 |
PaymentOptionRepository paymentOptionRepository;
|
| 21883 |
kshitij.so |
119 |
|
| 21680 |
ashik.ali |
120 |
@Autowired
|
|
|
121 |
ScanRecordRepository scanRecordRepository;
|
| 21883 |
kshitij.so |
122 |
|
| 21680 |
ashik.ali |
123 |
@Autowired
|
|
|
124 |
FofoOrderRepository fofoOrderRepository;
|
| 21883 |
kshitij.so |
125 |
|
| 21680 |
ashik.ali |
126 |
@Autowired
|
| 21689 |
ashik.ali |
127 |
RetailerRepository retailerRepository;
|
| 21883 |
kshitij.so |
128 |
|
| 21689 |
ashik.ali |
129 |
@Autowired
|
|
|
130 |
UserRepository userRepository;
|
| 21883 |
kshitij.so |
131 |
|
| 21689 |
ashik.ali |
132 |
@Autowired
|
|
|
133 |
UserAccountRepository userAccountRepository;
|
| 21883 |
kshitij.so |
134 |
|
| 21689 |
ashik.ali |
135 |
@Autowired
|
| 21883 |
kshitij.so |
136 |
ItemRepository itemRepository;
|
|
|
137 |
|
|
|
138 |
@Autowired
|
| 21689 |
ashik.ali |
139 |
RetailerRegisteredAddressRepository retailerRegisteredAddressRepository;
|
| 21883 |
kshitij.so |
140 |
|
| 21689 |
ashik.ali |
141 |
@Autowired
|
| 21711 |
ashik.ali |
142 |
CustomerAddressRepository customerAddressRepository;
|
| 21883 |
kshitij.so |
143 |
|
| 21711 |
ashik.ali |
144 |
@Autowired
|
| 21612 |
ashik.ali |
145 |
MVCResponseSender mvcResponseSender;
|
| 21883 |
kshitij.so |
146 |
|
| 21612 |
ashik.ali |
147 |
@Autowired
|
|
|
148 |
CookiesFetcher cookiesFetcher;
|
| 21883 |
kshitij.so |
149 |
|
|
|
150 |
@RequestMapping(value = "/order")
|
|
|
151 |
public String orderIndex(HttpServletRequest request, @RequestParam(name = "cartData") String cartData, Model model) throws Exception{
|
|
|
152 |
FofoDetails fofoDetails;
|
|
|
153 |
try {
|
|
|
154 |
fofoDetails = cookiesFetcher.getCookiesObject(request);
|
|
|
155 |
} catch (ProfitMandiBusinessException e) {
|
|
|
156 |
model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
|
|
|
157 |
return "response";
|
|
|
158 |
}
|
|
|
159 |
JSONObject cartObject = new JSONObject(cartData);
|
|
|
160 |
Iterator<?> keys = cartObject.keys();
|
|
|
161 |
|
|
|
162 |
Set<Integer> itemIds = new HashSet<>();
|
|
|
163 |
List<CartFofo> cartItems = new ArrayList<CartFofo>();
|
|
|
164 |
|
|
|
165 |
while( keys.hasNext() ) {
|
|
|
166 |
String key = (String)keys.next();
|
|
|
167 |
if ( cartObject.get(key) instanceof JSONObject ) {
|
|
|
168 |
System.out.println(cartObject.get(key));
|
|
|
169 |
}
|
|
|
170 |
CartFofo cf = new CartFofo();
|
|
|
171 |
cf.setItemId(cartObject.getJSONObject(key).getInt("itemId"));
|
|
|
172 |
cf.setQuantity(cartObject.getJSONObject(key).getInt("quantity"));
|
|
|
173 |
cartItems.add(cf);
|
|
|
174 |
itemIds.add(cartObject.getJSONObject(key).getInt("itemId"));
|
|
|
175 |
}
|
|
|
176 |
Map<Integer, Item> itemMap = new HashMap<Integer, Item>();
|
|
|
177 |
if (itemIds.size() > 0){
|
|
|
178 |
List<Item> items = itemRepository.selectByIds(itemIds);
|
|
|
179 |
for (Item i : items){
|
|
|
180 |
itemMap.put(i.getId(), i);
|
|
|
181 |
}
|
|
|
182 |
}
|
|
|
183 |
for (CartFofo cf : cartItems){
|
|
|
184 |
Item i = itemMap.get(cf.getItemId());
|
|
|
185 |
if (i == null){
|
|
|
186 |
continue;
|
|
|
187 |
}
|
|
|
188 |
cf.setDisplayName(getValidName(i.getBrand())+" "+getValidName(i.getModelName())+" "+getValidName(i.getModelNumber())+" "+getValidName(i.getColor()).replaceAll("\\s+", " "));
|
|
|
189 |
cf.setItemType(i.getType());
|
|
|
190 |
}
|
|
|
191 |
model.addAttribute("cartObj", cartItems);
|
|
|
192 |
return "order-index";
|
|
|
193 |
}
|
| 21612 |
ashik.ali |
194 |
|
| 21883 |
kshitij.so |
195 |
private String getValidName(String name){
|
|
|
196 |
return name!=null?name:"";
|
|
|
197 |
}
|
|
|
198 |
|
|
|
199 |
@RequestMapping(value = "/create-order", method = RequestMethod.POST)
|
|
|
200 |
public String createOrder(HttpServletRequest request, @RequestBody CreateOrderRequest createOrderRequest, Model model) throws Throwable{
|
| 21680 |
ashik.ali |
201 |
//FofoDetails fofoDetails = cookiesFetcher.getCookiesObject(request);
|
|
|
202 |
LOGGER.info("/order request {}", createOrderRequest);
|
|
|
203 |
FofoDetails fofoDetails = new FofoDetails();
|
|
|
204 |
fofoDetails.setFofoId(963490);
|
|
|
205 |
Set<CustomFofoLineItem> fofoLineItems = createOrderRequest.getFofoLineItems();
|
|
|
206 |
Set<Integer> itemIds = new HashSet<>();
|
|
|
207 |
Set<Integer> nonSerializedItemIds = new HashSet<>();
|
|
|
208 |
Map<Integer, Integer> itemIdQuantity = new HashMap<>();
|
|
|
209 |
for(CustomFofoLineItem fofoLineItem : fofoLineItems){
|
|
|
210 |
itemIds.add(fofoLineItem.getItemId());
|
|
|
211 |
if(fofoLineItem.getSerialNumbers().size() > 0 && fofoLineItem.getQuantity() != fofoLineItem.getSerialNumbers().size()){
|
|
|
212 |
itemIdQuantity.put(fofoLineItem.getItemId(), fofoLineItem.getQuantity());
|
|
|
213 |
}
|
|
|
214 |
if(fofoLineItem.getSerialNumbers().isEmpty()){
|
|
|
215 |
nonSerializedItemIds.add(fofoLineItem.getItemId());
|
|
|
216 |
}
|
|
|
217 |
}
|
|
|
218 |
if(!itemIdQuantity.isEmpty()){
|
|
|
219 |
// if item quantity does not match with given serialnumbers size
|
|
|
220 |
LOGGER.error("itemId's quantity should be equal to given serialnumber size {} ", itemIdQuantity);
|
|
|
221 |
return "error";
|
|
|
222 |
}
|
|
|
223 |
float totalAmount = 0;
|
|
|
224 |
Map<Integer, Float> lineItemPrice = new HashMap<>();
|
|
|
225 |
List<CurrentInventorySnapshot> currentInventorySnapshots = currentInventorySnapshotRepository.selectByFofoItemIds(fofoDetails.getFofoId(), itemIds);
|
|
|
226 |
List<ItemIdQuantityAvailability> itemIdQuantityAvailabilities = new ArrayList<>();
|
|
|
227 |
for(CurrentInventorySnapshot currentInventorySnapshot : currentInventorySnapshots){
|
|
|
228 |
for(CustomFofoLineItem fofoLineItem : fofoLineItems){
|
|
|
229 |
if(currentInventorySnapshot.getId().getItemId() == fofoLineItem.getItemId()){
|
|
|
230 |
if(fofoLineItem.getQuantity() > currentInventorySnapshot.getAvailability()){
|
|
|
231 |
ItemIdQuantityAvailability itemIdQuantityAvailability = new ItemIdQuantityAvailability();
|
|
|
232 |
itemIdQuantityAvailability.setItemId(fofoLineItem.getItemId());
|
|
|
233 |
Quantity quantity = new Quantity();
|
|
|
234 |
quantity.setAvailable(currentInventorySnapshot.getAvailability());
|
|
|
235 |
quantity.setRequested(fofoLineItem.getQuantity());
|
|
|
236 |
itemIdQuantityAvailability.setQuantity(quantity);
|
|
|
237 |
itemIdQuantityAvailabilities.add(itemIdQuantityAvailability);
|
|
|
238 |
}
|
| 21883 |
kshitij.so |
239 |
if(!(fofoLineItem.getSellingPrice() > 0)){
|
|
|
240 |
lineItemPrice.put(fofoLineItem.getItemId(), fofoLineItem.getSellingPrice());
|
|
|
241 |
}else{
|
|
|
242 |
totalAmount = totalAmount + fofoLineItem.getSellingPrice() * fofoLineItem.getQuantity();
|
|
|
243 |
}
|
| 21680 |
ashik.ali |
244 |
}
|
|
|
245 |
}
|
|
|
246 |
}
|
| 21883 |
kshitij.so |
247 |
|
| 21680 |
ashik.ali |
248 |
try{
|
|
|
249 |
this.validatePaymentOptionsAndTotalAmount(createOrderRequest.getPaymentOptions(), totalAmount);
|
|
|
250 |
}catch(ProfitMandiBusinessException profitMandiBusinessException){
|
|
|
251 |
LOGGER.error("Error occured while validating payment options : ", profitMandiBusinessException);
|
|
|
252 |
return "error";
|
|
|
253 |
}
|
| 21883 |
kshitij.so |
254 |
|
| 21680 |
ashik.ali |
255 |
if(!itemIdQuantityAvailabilities.isEmpty()){
|
|
|
256 |
// itemIdQuantity request is not valid
|
|
|
257 |
LOGGER.error("Requested quantities should not be greater than currently available quantities {}", itemIdQuantityAvailabilities);
|
|
|
258 |
return "error";
|
|
|
259 |
}
|
| 21883 |
kshitij.so |
260 |
|
| 21680 |
ashik.ali |
261 |
if(!lineItemPrice.isEmpty()){
|
|
|
262 |
// given fofo line item price must be greater than zero
|
|
|
263 |
LOGGER.error("requested itemId's selling price must greater thant 0");
|
|
|
264 |
return "error";
|
|
|
265 |
}
|
| 21883 |
kshitij.so |
266 |
|
| 21680 |
ashik.ali |
267 |
Set<Integer> invalidItemIdSerialNumbers = new HashSet<>();
|
|
|
268 |
Map<Integer, Set<String>> itemIdSerialNumbers = new HashMap<>();
|
|
|
269 |
List<InventoryItem> inventoryItems = inventoryItemRepository.selectByFofoIdItemIds(fofoDetails.getFofoId(), itemIds);
|
|
|
270 |
if(inventoryItems.isEmpty()){
|
|
|
271 |
// invalid item ids
|
|
|
272 |
LOGGER.error("Requested itemId's are not available in inventoryItem");
|
|
|
273 |
return "error";
|
|
|
274 |
}
|
| 21883 |
kshitij.so |
275 |
|
| 21711 |
ashik.ali |
276 |
Map<Integer, Float> itemIdPriceDropAmount = new HashMap<>();
|
| 21883 |
kshitij.so |
277 |
|
| 21680 |
ashik.ali |
278 |
for(InventoryItem inventoryItem : inventoryItems){
|
|
|
279 |
for(CustomFofoLineItem fofoLineItem : fofoLineItems){
|
|
|
280 |
if(inventoryItem.getItemId() == fofoLineItem.getItemId()){
|
|
|
281 |
if(fofoLineItem.getSerialNumbers().isEmpty()){
|
|
|
282 |
if(!(inventoryItem.getSerialNumber() == null && inventoryItem.getSerialNumber().equals(""))){
|
|
|
283 |
invalidItemIdSerialNumbers.add(inventoryItem.getItemId());
|
|
|
284 |
}
|
|
|
285 |
}
|
|
|
286 |
if(!fofoLineItem.getSerialNumbers().isEmpty()){
|
|
|
287 |
if(!fofoLineItem.getSerialNumbers().contains(inventoryItem.getSerialNumber())){
|
|
|
288 |
if(!itemIdSerialNumbers.containsKey(fofoLineItem.getItemId())){
|
|
|
289 |
Set<String> serialNumbers = new HashSet<>();
|
|
|
290 |
serialNumbers.add(inventoryItem.getSerialNumber());
|
|
|
291 |
itemIdSerialNumbers.put(fofoLineItem.getItemId(), serialNumbers);
|
|
|
292 |
}else{
|
|
|
293 |
itemIdSerialNumbers.get(fofoLineItem.getItemId()).add(inventoryItem.getSerialNumber());
|
|
|
294 |
}
|
|
|
295 |
}
|
|
|
296 |
}
|
| 21711 |
ashik.ali |
297 |
itemIdPriceDropAmount.put(inventoryItem.getItemId(), inventoryItem.getUnitPrice() - inventoryItem.getPriceDropAmount());
|
| 21680 |
ashik.ali |
298 |
}
|
|
|
299 |
}
|
|
|
300 |
}
|
| 21883 |
kshitij.so |
301 |
|
| 21680 |
ashik.ali |
302 |
if(!invalidItemIdSerialNumbers.isEmpty()){
|
|
|
303 |
LOGGER.error("Invalid itemId's serialNumbers {}", invalidItemIdSerialNumbers);
|
|
|
304 |
// itemId's are serialized you are saying these are not serialized
|
|
|
305 |
return "error";
|
|
|
306 |
}
|
| 21883 |
kshitij.so |
307 |
|
| 21680 |
ashik.ali |
308 |
if(!itemIdSerialNumbers.isEmpty()){
|
|
|
309 |
LOGGER.error("Invalid itemId's serialNumbers {}", itemIdSerialNumbers);
|
|
|
310 |
// itemId's are non serialized you are saying these are serialized
|
|
|
311 |
return "error";
|
|
|
312 |
}
|
|
|
313 |
InvoiceNumberGenerationSequence invoiceNumberGenerationSequence = null;
|
|
|
314 |
try{
|
|
|
315 |
invoiceNumberGenerationSequence = invoiceNumberGenerationSequenceRepository.selectByFofoId(fofoDetails.getFofoId());
|
|
|
316 |
invoiceNumberGenerationSequence.setSequence(invoiceNumberGenerationSequence.getSequence() + 1);
|
|
|
317 |
invoiceNumberGenerationSequenceRepository.persist(invoiceNumberGenerationSequence);
|
|
|
318 |
}catch(ProfitMandiBusinessException profitMandiBusinessException){
|
|
|
319 |
invoiceNumberGenerationSequence = new InvoiceNumberGenerationSequence();
|
|
|
320 |
invoiceNumberGenerationSequence.setFofoId(fofoDetails.getFofoId());
|
|
|
321 |
invoiceNumberGenerationSequence.setPrefix("INVOICE");
|
|
|
322 |
invoiceNumberGenerationSequenceRepository.persist(invoiceNumberGenerationSequence);
|
|
|
323 |
}
|
| 21883 |
kshitij.so |
324 |
|
| 21680 |
ashik.ali |
325 |
CustomCustomer customCustomer = createOrderRequest.getCustomer();
|
| 21883 |
kshitij.so |
326 |
|
| 21680 |
ashik.ali |
327 |
if(!StringUtils.isValidEmailAddress(customCustomer.getEmailId())){
|
|
|
328 |
LOGGER.error("invalid customer emailId {} ", customCustomer.getEmailId());
|
|
|
329 |
return "error";
|
|
|
330 |
}
|
| 21883 |
kshitij.so |
331 |
|
| 21680 |
ashik.ali |
332 |
if(!StringUtils.isValidMobile(customCustomer.getMobileNumber())){
|
|
|
333 |
LOGGER.error("invalid customer mobileNumber {} ", customCustomer.getMobileNumber());
|
|
|
334 |
return "error";
|
|
|
335 |
}
|
| 21883 |
kshitij.so |
336 |
|
| 21680 |
ashik.ali |
337 |
Customer customer = null;
|
|
|
338 |
try{
|
|
|
339 |
customer = customerRepository.selectByEmailIdAndMobileNumber(customCustomer.getEmailId(), customCustomer.getMobileNumber());
|
|
|
340 |
}catch(ProfitMandiBusinessException profitMandiBusinessException){
|
|
|
341 |
LOGGER.error("Error : ", profitMandiBusinessException);
|
|
|
342 |
customer = new Customer();
|
| 21883 |
kshitij.so |
343 |
customer.setName(customCustomer.getName());
|
| 21680 |
ashik.ali |
344 |
customer.setEmailId(customCustomer.getEmailId());
|
|
|
345 |
customer.setMobileNumber(customCustomer.getMobileNumber());
|
|
|
346 |
customerRepository.persist(customer);
|
|
|
347 |
}
|
| 21711 |
ashik.ali |
348 |
CustomerAddress customerAddress = this.createCustomerAddress(customCustomer.getAddress());
|
|
|
349 |
customerAddress.setCustomerId(customer.getId());
|
|
|
350 |
customerAddressRepository.persist(customerAddress);
|
| 21883 |
kshitij.so |
351 |
|
|
|
352 |
/*InvoiceNumberGenerationSequence invoiceNumberGenerationSequence = */
|
|
|
353 |
|
|
|
354 |
|
| 21680 |
ashik.ali |
355 |
FofoOrder fofoOrder = new FofoOrder();
|
|
|
356 |
fofoOrder.setCustomerId(customer.getId());
|
|
|
357 |
fofoOrder.setFofoId(fofoDetails.getFofoId());
|
|
|
358 |
fofoOrder.setInvoiceNumber(invoiceNumberGenerationSequence.getPrefix() + invoiceNumberGenerationSequence.getSequence());
|
|
|
359 |
fofoOrder.setTotalAmount(totalAmount);
|
| 21886 |
kshitij.so |
360 |
fofoOrder.setCustomerAddressId(customerAddress.getId());
|
| 21680 |
ashik.ali |
361 |
fofoOrderRepository.persist(fofoOrder);
|
| 21883 |
kshitij.so |
362 |
|
| 21680 |
ashik.ali |
363 |
for(CustomPaymentOption customPaymentOption : createOrderRequest.getPaymentOptions()){
|
|
|
364 |
PaymentOption paymentOption = new PaymentOption();
|
|
|
365 |
paymentOption.setOrderId(fofoOrder.getId());
|
|
|
366 |
paymentOption.setAmount(customPaymentOption.getAmount());
|
|
|
367 |
paymentOption.setType(customPaymentOption.getType());
|
|
|
368 |
paymentOptionRepository.persist(paymentOption);
|
|
|
369 |
}
|
| 21883 |
kshitij.so |
370 |
|
|
|
371 |
// List<Order> orders = orderRepository.selectByRetailerIdItemIds(fofoDetails.getFofoId(), itemIds);
|
|
|
372 |
//
|
|
|
373 |
// Set<Item> items = new HashSet<>(itemIds.size());
|
|
|
374 |
// for(Order order : orders){
|
|
|
375 |
// LineItem lineItem = order.getLineItem();
|
|
|
376 |
// items.add(lineItem.getItem());
|
|
|
377 |
// }
|
|
|
378 |
//
|
|
|
379 |
// if(items.size() != itemIds.size()){
|
|
|
380 |
// LOGGER.error("Requested ItemIds not found in catalog");
|
|
|
381 |
// // invalid itemIds
|
|
|
382 |
// return "error";
|
|
|
383 |
// }
|
| 21680 |
ashik.ali |
384 |
|
| 21883 |
kshitij.so |
385 |
List<Item> items = itemRepository.selectByIds(itemIds);
|
|
|
386 |
|
| 21680 |
ashik.ali |
387 |
Map<Integer, Map<String, String>> itemIdDetails = this.toMap(items);
|
| 21883 |
kshitij.so |
388 |
|
| 21680 |
ashik.ali |
389 |
for(CustomFofoLineItem customFofoLineItem : createOrderRequest.getFofoLineItems()){
|
|
|
390 |
FofoLineItem fofoLineItem = new FofoLineItem();
|
|
|
391 |
fofoLineItem.setItemId(customFofoLineItem.getItemId());
|
|
|
392 |
fofoLineItem.setQuantity(customFofoLineItem.getQuantity());
|
| 21690 |
ashik.ali |
393 |
fofoLineItem.setSellingPrice(customFofoLineItem.getSellingPrice());
|
| 21680 |
ashik.ali |
394 |
fofoLineItem.setOrderId(fofoOrder.getId());
|
|
|
395 |
fofoLineItem.setDp(customFofoLineItem.getSellingPrice());
|
| 21689 |
ashik.ali |
396 |
fofoLineItem.setTax(0);
|
|
|
397 |
fofoLineItem.setTaxRate(0);
|
| 21711 |
ashik.ali |
398 |
fofoLineItem.setCost(itemIdPriceDropAmount.get(customFofoLineItem.getItemId()));
|
| 21680 |
ashik.ali |
399 |
Map<String, String> itemIdDetail = itemIdDetails.get(customFofoLineItem.getItemId());
|
|
|
400 |
fofoLineItem.setBrand(itemIdDetail.get(ProfitMandiConstants.BRAND));
|
|
|
401 |
fofoLineItem.setModelName(itemIdDetail.get(ProfitMandiConstants.MODEL_NAME));
|
|
|
402 |
fofoLineItem.setModelNumber(itemIdDetail.get(ProfitMandiConstants.MODEL_NUMBER));
|
|
|
403 |
fofoLineItem.setColor(itemIdDetail.get(ProfitMandiConstants.COLOR));
|
|
|
404 |
fofoLineItemRepository.persist(fofoLineItem);
|
|
|
405 |
LOGGER.info("\n\n");
|
|
|
406 |
if(!customFofoLineItem.getSerialNumbers().isEmpty()){
|
|
|
407 |
for(String serialNumber : customFofoLineItem.getSerialNumbers()){
|
|
|
408 |
FofoLineItemSerialNumber fofoLineItemSerialNumber = new FofoLineItemSerialNumber();
|
|
|
409 |
fofoLineItemSerialNumber.setFofoLineItemId(fofoLineItem.getId());
|
|
|
410 |
fofoLineItemSerialNumber.setSerialNumber(serialNumber);
|
|
|
411 |
fofoLineItemSerialNumberRepository.persist(fofoLineItemSerialNumber);
|
|
|
412 |
}
|
|
|
413 |
}
|
| 21883 |
kshitij.so |
414 |
|
|
|
415 |
|
|
|
416 |
|
|
|
417 |
|
| 21680 |
ashik.ali |
418 |
for(InventoryItem inventoryItem : inventoryItems){
|
|
|
419 |
if(inventoryItem.getItemId() == fofoLineItem.getItemId()){
|
|
|
420 |
if(inventoryItem.getSerialNumber() == null || inventoryItem.getSerialNumber().isEmpty()){
|
|
|
421 |
if(fofoLineItem.getQuantity() > 0)
|
| 21883 |
kshitij.so |
422 |
if(fofoLineItem.getQuantity() <= inventoryItem.getGoodQuantity()){
|
|
|
423 |
inventoryItem.setGoodQuantity(inventoryItem.getGoodQuantity() - fofoLineItem.getQuantity());
|
|
|
424 |
inventoryItem.setLastScanType(ScanType.SALE);
|
|
|
425 |
inventoryItemRepository.persist(inventoryItem);
|
|
|
426 |
ScanRecord scanRecord = new ScanRecord();
|
|
|
427 |
scanRecord.setInventoryItemId(inventoryItem.getId());
|
|
|
428 |
scanRecord.setFofoId(fofoDetails.getFofoId());
|
|
|
429 |
scanRecord.setQuantity(fofoLineItem.getQuantity());
|
|
|
430 |
scanRecord.setType(ScanType.SALE);
|
|
|
431 |
scanRecordRepository.persist(scanRecord);
|
|
|
432 |
}else{
|
|
|
433 |
int availableGoodQuantity = inventoryItem.getGoodQuantity();
|
|
|
434 |
inventoryItem.setGoodQuantity(0);
|
|
|
435 |
fofoLineItem.setQuantity(fofoLineItem.getQuantity() - availableGoodQuantity);
|
|
|
436 |
inventoryItem.setLastScanType(ScanType.SALE);
|
|
|
437 |
inventoryItemRepository.persist(inventoryItem);
|
|
|
438 |
ScanRecord scanRecord = new ScanRecord();
|
|
|
439 |
scanRecord.setInventoryItemId(inventoryItem.getId());
|
|
|
440 |
scanRecord.setFofoId(fofoDetails.getFofoId());
|
|
|
441 |
scanRecord.setQuantity(availableGoodQuantity);
|
|
|
442 |
scanRecord.setType(ScanType.SALE);
|
|
|
443 |
scanRecordRepository.persist(scanRecord);
|
|
|
444 |
}
|
| 21680 |
ashik.ali |
445 |
}else{
|
|
|
446 |
inventoryItem.setGoodQuantity(0);
|
|
|
447 |
inventoryItem.setLastScanType(ScanType.SALE);
|
|
|
448 |
inventoryItemRepository.persist(inventoryItem);
|
|
|
449 |
ScanRecord scanRecord = new ScanRecord();
|
|
|
450 |
scanRecord.setInventoryItemId(inventoryItem.getId());
|
|
|
451 |
scanRecord.setFofoId(fofoDetails.getFofoId());
|
|
|
452 |
scanRecord.setQuantity(1);
|
|
|
453 |
scanRecord.setType(ScanType.SALE);
|
|
|
454 |
scanRecordRepository.persist(scanRecord);
|
|
|
455 |
}
|
|
|
456 |
}
|
|
|
457 |
}
|
| 21883 |
kshitij.so |
458 |
|
|
|
459 |
//current inventory not updating
|
|
|
460 |
//logic is flawed - check flow and handle error properly without persisiting
|
|
|
461 |
//jugaad kaam @ ashik ali
|
|
|
462 |
|
| 21680 |
ashik.ali |
463 |
}
|
| 21612 |
ashik.ali |
464 |
return null;
|
|
|
465 |
}
|
| 21883 |
kshitij.so |
466 |
|
|
|
467 |
|
|
|
468 |
private Map<Integer, Map<String, String>> toMap(List<Item> items){
|
| 21680 |
ashik.ali |
469 |
Map<Integer, Map<String, String>> map = new HashMap<>();
|
|
|
470 |
for(Item item : items){
|
|
|
471 |
Map<String, String> detailMap = new HashMap<>();
|
|
|
472 |
detailMap.put(ProfitMandiConstants.BRAND, item.getBrand());
|
|
|
473 |
detailMap.put(ProfitMandiConstants.MODEL_NAME, item.getModelName());
|
|
|
474 |
detailMap.put(ProfitMandiConstants.MODEL_NUMBER, item.getModelNumber());
|
|
|
475 |
detailMap.put(ProfitMandiConstants.COLOR, item.getColor());
|
|
|
476 |
map.put(item.getId(), detailMap);
|
|
|
477 |
}
|
|
|
478 |
return map;
|
|
|
479 |
}
|
| 21883 |
kshitij.so |
480 |
|
| 21711 |
ashik.ali |
481 |
/*private Address createAddress(CustomAddress customAddress){
|
| 21680 |
ashik.ali |
482 |
Address address = new Address();
|
|
|
483 |
address.setName(customAddress.getName());
|
|
|
484 |
address.setLine1(customAddress.getLine1());
|
|
|
485 |
address.setLine2(customAddress.getLine2());
|
|
|
486 |
address.setLandmark(customAddress.getLandmark());
|
|
|
487 |
address.setCity(customAddress.getCity());
|
|
|
488 |
address.setPinCode(customAddress.getPinCode());
|
|
|
489 |
address.setState(customAddress.getState());
|
|
|
490 |
address.setCountry(customAddress.getCountry());
|
|
|
491 |
address.setPhoneNumber(customAddress.getPhoneNumber());
|
|
|
492 |
address.setEnabled(true);
|
|
|
493 |
return address;
|
| 21711 |
ashik.ali |
494 |
}*/
|
| 21883 |
kshitij.so |
495 |
|
| 21711 |
ashik.ali |
496 |
private CustomerAddress createCustomerAddress(CustomAddress customAddress){
|
|
|
497 |
CustomerAddress customerAddress = new CustomerAddress();
|
|
|
498 |
customerAddress.setName(customAddress.getName());
|
|
|
499 |
customerAddress.setLine1(customAddress.getLine1());
|
|
|
500 |
customerAddress.setLine2(customAddress.getLine2());
|
|
|
501 |
customerAddress.setLandmark(customAddress.getLandmark());
|
|
|
502 |
customerAddress.setCity(customAddress.getCity());
|
|
|
503 |
customerAddress.setPinCode(customAddress.getPinCode());
|
|
|
504 |
customerAddress.setState(customAddress.getState());
|
|
|
505 |
customerAddress.setCountry(customAddress.getCountry());
|
|
|
506 |
customerAddress.setPhoneNumber(customAddress.getPhoneNumber());
|
|
|
507 |
return customerAddress;
|
| 21680 |
ashik.ali |
508 |
}
|
| 21883 |
kshitij.so |
509 |
|
| 21689 |
ashik.ali |
510 |
private CustomAddress createCustomAddress(Address address){
|
|
|
511 |
CustomAddress customAddress = new CustomAddress();
|
|
|
512 |
customAddress.setName(address.getName());
|
|
|
513 |
customAddress.setLine1(address.getLine1());
|
|
|
514 |
customAddress.setLine2(address.getLine2());
|
|
|
515 |
customAddress.setLandmark(address.getLandmark());
|
|
|
516 |
customAddress.setCity(address.getCity());
|
|
|
517 |
customAddress.setPinCode(address.getPinCode());
|
|
|
518 |
customAddress.setState(address.getState());
|
|
|
519 |
customAddress.setCountry(address.getCountry());
|
|
|
520 |
customAddress.setPhoneNumber(address.getPhoneNumber());
|
|
|
521 |
return customAddress;
|
| 21680 |
ashik.ali |
522 |
}
|
| 21883 |
kshitij.so |
523 |
|
| 21711 |
ashik.ali |
524 |
private CustomAddress createCustomAddress(CustomerAddress customerAddress){
|
|
|
525 |
CustomAddress customAddress = new CustomAddress();
|
|
|
526 |
customAddress.setName(customerAddress.getName());
|
|
|
527 |
customAddress.setLine1(customerAddress.getLine1());
|
|
|
528 |
customAddress.setLine2(customerAddress.getLine2());
|
|
|
529 |
customAddress.setLandmark(customerAddress.getLandmark());
|
|
|
530 |
customAddress.setCity(customerAddress.getCity());
|
|
|
531 |
customAddress.setPinCode(customerAddress.getPinCode());
|
|
|
532 |
customAddress.setState(customerAddress.getState());
|
|
|
533 |
customAddress.setCountry(customerAddress.getCountry());
|
|
|
534 |
customAddress.setPhoneNumber(customerAddress.getPhoneNumber());
|
|
|
535 |
return customAddress;
|
|
|
536 |
}
|
| 21883 |
kshitij.so |
537 |
|
| 21680 |
ashik.ali |
538 |
private void validatePaymentOptionsAndTotalAmount(Set<CustomPaymentOption> customPaymentOptions, float totalAmount) throws ProfitMandiBusinessException
|
| 21612 |
ashik.ali |
539 |
{
|
|
|
540 |
float calculatedAmount = 0;
|
|
|
541 |
Set<String> paymentOptionTypes = new HashSet<>();
|
|
|
542 |
for(CustomPaymentOption customPaymentOption : customPaymentOptions){
|
| 21680 |
ashik.ali |
543 |
if(paymentOptionTypes.contains(customPaymentOption.getType().name())){
|
| 21612 |
ashik.ali |
544 |
throw new ProfitMandiBusinessException(ProfitMandiConstants.PAYMENT_OPTION_TYPE, customPaymentOption.getType().name(), "");
|
| 21680 |
ashik.ali |
545 |
}else{
|
|
|
546 |
paymentOptionTypes.add(customPaymentOption.getType().name());
|
|
|
547 |
calculatedAmount = calculatedAmount + customPaymentOption.getAmount();
|
| 21612 |
ashik.ali |
548 |
}
|
|
|
549 |
}
|
| 21883 |
kshitij.so |
550 |
|
|
|
551 |
LOGGER.info("calculatedAmount "+calculatedAmount);
|
|
|
552 |
LOGGER.info("totalAmount "+totalAmount);
|
|
|
553 |
|
| 21612 |
ashik.ali |
554 |
if(calculatedAmount != totalAmount){
|
|
|
555 |
throw new ProfitMandiBusinessException(ProfitMandiConstants.PAYMENT_OPTION_CALCULATED_AMOUNT, calculatedAmount, "");
|
|
|
556 |
}
|
|
|
557 |
}
|
| 21883 |
kshitij.so |
558 |
|
|
|
559 |
|
| 21689 |
ashik.ali |
560 |
@RequestMapping(value = "/generateInvoice")
|
| 21886 |
kshitij.so |
561 |
public ResponseEntity<?> generateInvoice(HttpServletRequest request, HttpServletResponse response, @RequestParam(name = ProfitMandiConstants.ORDER_ID) int orderId, Model model) throws Throwable{
|
| 21689 |
ashik.ali |
562 |
LOGGER.info("Request received at url {} with params {} ", request.getRequestURI(), request.getParameterMap());
|
|
|
563 |
//FofoDetails fofoDetails = cookiesFetcher.getCookiesObject(request);
|
| 21883 |
kshitij.so |
564 |
|
| 21689 |
ashik.ali |
565 |
FofoDetails fofoDetails = new FofoDetails();
|
|
|
566 |
fofoDetails.setFofoId(963490);
|
|
|
567 |
FofoOrder fofoOrder = fofoOrderRepository.selectByFofoIdAndOrderId(fofoDetails.getFofoId(), orderId);
|
|
|
568 |
PdfModel pdfModel = new PdfModel();
|
|
|
569 |
pdfModel.setAuther("profitmandi");
|
|
|
570 |
pdfModel.setTitle("Retailer Invoice");
|
|
|
571 |
Customer customer = customerRepository.selectById(fofoOrder.getCustomerId());
|
|
|
572 |
CustomCustomer customCustomer = new CustomCustomer();
|
|
|
573 |
customCustomer.setName(customer.getName());
|
|
|
574 |
customCustomer.setEmailId(customer.getEmailId());
|
|
|
575 |
customCustomer.setMobileNumber(customer.getMobileNumber());
|
| 21711 |
ashik.ali |
576 |
CustomerAddress customerAddress = customerAddressRepository.selectById(fofoOrder.getCustomerAddressId());
|
| 21689 |
ashik.ali |
577 |
customCustomer.setAddress(this.createCustomAddress(customerAddress));
|
|
|
578 |
pdfModel.setCustomer(customCustomer);
|
|
|
579 |
pdfModel.setInvoiceNumber(fofoOrder.getInvoiceNumber());
|
|
|
580 |
pdfModel.setTotalAmount(fofoOrder.getTotalAmount());
|
| 21883 |
kshitij.so |
581 |
|
| 21689 |
ashik.ali |
582 |
Retailer retailer = retailerRepository.selectById(fofoDetails.getFofoId());
|
|
|
583 |
User user = userRepository.selectById(userAccountRepository.selectUserIdByRetailerId(retailer.getId()));
|
|
|
584 |
CustomRetailer customRetailer = new CustomRetailer();
|
|
|
585 |
customRetailer.setBusinessName(retailer.getName());
|
|
|
586 |
customRetailer.setMobileNumber(user.getMobileNumber());
|
|
|
587 |
customRetailer.setTinNumber(retailer.getNumber());
|
|
|
588 |
Address retailerAddress = addressRepository.selectById(retailerRegisteredAddressRepository.selectAddressIdByRetailerId(retailer.getId()));
|
|
|
589 |
customRetailer.setAddress(this.createCustomAddress(retailerAddress));
|
|
|
590 |
pdfModel.setRetailer(customRetailer);
|
|
|
591 |
List<FofoLineItem> fofoLineItems = fofoLineItemRepository.selectByOrderId(fofoOrder.getId());
|
| 21883 |
kshitij.so |
592 |
|
| 21689 |
ashik.ali |
593 |
Set<CustomFofoOrderItem> customerFofoOrderItems = new HashSet<>();
|
|
|
594 |
for(FofoLineItem fofoLineItem : fofoLineItems){
|
|
|
595 |
CustomFofoOrderItem customFofoOrderItem = new CustomFofoOrderItem();
|
|
|
596 |
customFofoOrderItem.setAmount(fofoLineItem.getQuantity() * fofoLineItem.getSellingPrice());
|
|
|
597 |
customFofoOrderItem.setDescription(fofoLineItem.getBrand() + " " + fofoLineItem.getModelName() + " " + fofoLineItem.getModelNumber() + " " + fofoLineItem.getColor());
|
|
|
598 |
float itemTotal = customFofoOrderItem.getAmount() - fofoLineItem.getTax();
|
|
|
599 |
customFofoOrderItem.setRate(fofoLineItem.getSellingPrice());
|
|
|
600 |
customFofoOrderItem.setQuantity(fofoLineItem.getQuantity());
|
|
|
601 |
customFofoOrderItem.setTax(fofoLineItem.getTax());
|
|
|
602 |
customFofoOrderItem.setTaxRate(fofoLineItem.getTaxRate());
|
|
|
603 |
customFofoOrderItem.setItemTotal(itemTotal);
|
|
|
604 |
customFofoOrderItem.setSerialNumbers(String.join(", ",this.toSerialNumbers(fofoLineItem.getFofoLineItemSerialNumbers())));
|
|
|
605 |
customerFofoOrderItems.add(customFofoOrderItem);
|
|
|
606 |
}
|
|
|
607 |
pdfModel.setOrderItems(customerFofoOrderItems);
|
|
|
608 |
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
|
|
609 |
PdfUtils.generateAndWrite(pdfModel, byteArrayOutputStream);
|
|
|
610 |
//final MediaType mediaType=MediaType.parseMediaType(profilePhotoModel.getContentType().getValue());
|
|
|
611 |
LOGGER.info("Pdf Stream length {}", byteArrayOutputStream.toByteArray().length);
|
| 21883 |
kshitij.so |
612 |
final HttpHeaders headers=new HttpHeaders();
|
|
|
613 |
headers.setContentType(MediaType.APPLICATION_PDF);
|
|
|
614 |
//headers.set("Content-Disposition", "retailerInvoice.pdf");
|
|
|
615 |
headers.setContentLength(byteArrayOutputStream.toByteArray().length);
|
|
|
616 |
final InputStream inputStream=new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
|
|
|
617 |
final InputStreamResource inputStreamResource=new InputStreamResource(inputStream);
|
|
|
618 |
return new ResponseEntity<InputStreamResource>(inputStreamResource, headers, HttpStatus.OK);
|
| 21689 |
ashik.ali |
619 |
}
|
| 21883 |
kshitij.so |
620 |
|
| 21689 |
ashik.ali |
621 |
private Set<String> toSerialNumbers(Set<FofoLineItemSerialNumber> fofoLineItemSerialNumbers){
|
|
|
622 |
Set<String> serialNumbers = new HashSet<>(fofoLineItemSerialNumbers.size());
|
|
|
623 |
for(FofoLineItemSerialNumber fofoLineItemSerialNumber : fofoLineItemSerialNumbers){
|
|
|
624 |
serialNumbers.add(fofoLineItemSerialNumber.getSerialNumber());
|
|
|
625 |
}
|
|
|
626 |
return serialNumbers;
|
|
|
627 |
}
|
| 21612 |
ashik.ali |
628 |
}
|