| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.web.controller;
|
1 |
package com.spice.profitmandi.web.controller;
|
| 2 |
|
2 |
|
| 3 |
import java.io.ByteArrayInputStream;
|
- |
|
| 4 |
import java.io.IOException;
|
- |
|
| 5 |
import java.io.InputStream;
|
- |
|
| 6 |
import java.io.InputStreamReader;
|
- |
|
| 7 |
import java.time.LocalDate;
|
- |
|
| 8 |
import java.time.LocalDateTime;
|
- |
|
| 9 |
import java.time.format.DateTimeFormatter;
|
- |
|
| 10 |
import java.util.ArrayList;
|
- |
|
| 11 |
import java.util.Arrays;
|
- |
|
| 12 |
import java.util.HashMap;
|
- |
|
| 13 |
import java.util.HashSet;
|
- |
|
| 14 |
import java.util.List;
|
- |
|
| 15 |
import java.util.Map;
|
- |
|
| 16 |
import java.util.Map.Entry;
|
- |
|
| 17 |
import java.util.Set;
|
- |
|
| 18 |
import java.util.stream.Collectors;
|
- |
|
| 19 |
|
- |
|
| 20 |
import javax.servlet.http.HttpServletRequest;
|
- |
|
| 21 |
import javax.servlet.http.HttpServletResponse;
|
- |
|
| 22 |
import javax.transaction.Transactional;
|
- |
|
| 23 |
|
- |
|
| 24 |
import org.apache.commons.csv.CSVFormat;
|
- |
|
| 25 |
import org.apache.commons.csv.CSVParser;
|
- |
|
| 26 |
import org.apache.commons.csv.CSVRecord;
|
- |
|
| 27 |
import org.apache.logging.log4j.LogManager;
|
- |
|
| 28 |
import org.apache.logging.log4j.Logger;
|
- |
|
| 29 |
import org.json.JSONArray;
|
- |
|
| 30 |
import org.json.JSONObject;
|
- |
|
| 31 |
import org.springframework.beans.factory.annotation.Autowired;
|
- |
|
| 32 |
import org.springframework.core.io.InputStreamResource;
|
- |
|
| 33 |
import org.springframework.http.HttpHeaders;
|
- |
|
| 34 |
import org.springframework.http.HttpStatus;
|
- |
|
| 35 |
import org.springframework.http.ResponseEntity;
|
- |
|
| 36 |
import org.springframework.stereotype.Controller;
|
- |
|
| 37 |
import org.springframework.ui.Model;
|
- |
|
| 38 |
import org.springframework.web.bind.annotation.RequestBody;
|
- |
|
| 39 |
import org.springframework.web.bind.annotation.RequestMapping;
|
- |
|
| 40 |
import org.springframework.web.bind.annotation.RequestMethod;
|
- |
|
| 41 |
import org.springframework.web.bind.annotation.RequestParam;
|
- |
|
| 42 |
import org.springframework.web.bind.annotation.RequestPart;
|
- |
|
| 43 |
import org.springframework.web.multipart.MultipartFile;
|
- |
|
| 44 |
|
- |
|
| 45 |
import com.google.gson.Gson;
|
3 |
import com.google.gson.Gson;
|
| 46 |
import com.spice.profitmandi.common.enumuration.MessageType;
|
4 |
import com.spice.profitmandi.common.enumuration.MessageType;
|
| 47 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
5 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 48 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
6 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
| 49 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
7 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| Line 54... |
Line 12... |
| 54 |
import com.spice.profitmandi.dao.entity.logistics.Provider;
|
12 |
import com.spice.profitmandi.dao.entity.logistics.Provider;
|
| 55 |
import com.spice.profitmandi.dao.entity.logistics.ProviderDetails;
|
13 |
import com.spice.profitmandi.dao.entity.logistics.ProviderDetails;
|
| 56 |
import com.spice.profitmandi.dao.entity.logistics.ProviderTat;
|
14 |
import com.spice.profitmandi.dao.entity.logistics.ProviderTat;
|
| 57 |
import com.spice.profitmandi.dao.entity.logistics.PublicHolidays;
|
15 |
import com.spice.profitmandi.dao.entity.logistics.PublicHolidays;
|
| 58 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
16 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
| 59 |
import com.spice.profitmandi.dao.model.BilledOrderListModel;
|
- |
|
| 60 |
import com.spice.profitmandi.dao.model.DelayBillingModel;
|
- |
|
| 61 |
import com.spice.profitmandi.dao.model.DelayDayModel;
|
17 |
import com.spice.profitmandi.dao.model.*;
|
| 62 |
import com.spice.profitmandi.dao.model.DispatchNotificationModel;
|
- |
|
| 63 |
import com.spice.profitmandi.dao.model.MarkDeliveredModel;
|
- |
|
| 64 |
import com.spice.profitmandi.dao.model.ProviderDetailModel;
|
- |
|
| 65 |
import com.spice.profitmandi.dao.model.ProviderTatModel;
|
- |
|
| 66 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
18 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 67 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
19 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
| 68 |
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
|
20 |
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
|
| 69 |
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
|
21 |
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
|
| 70 |
import com.spice.profitmandi.dao.repository.logistics.ProviderDetailsRepository;
|
22 |
import com.spice.profitmandi.dao.repository.logistics.ProviderDetailsRepository;
|
| Line 75... |
Line 27... |
| 75 |
import com.spice.profitmandi.service.LogisticsService;
|
27 |
import com.spice.profitmandi.service.LogisticsService;
|
| 76 |
import com.spice.profitmandi.service.NotificationService;
|
28 |
import com.spice.profitmandi.service.NotificationService;
|
| 77 |
import com.spice.profitmandi.web.model.LoginDetails;
|
29 |
import com.spice.profitmandi.web.model.LoginDetails;
|
| 78 |
import com.spice.profitmandi.web.util.CookiesProcessor;
|
30 |
import com.spice.profitmandi.web.util.CookiesProcessor;
|
| 79 |
import com.spice.profitmandi.web.util.MVCResponseSender;
|
31 |
import com.spice.profitmandi.web.util.MVCResponseSender;
|
| 80 |
|
- |
|
| 81 |
import in.shop2020.logistics.DeliveryType;
|
32 |
import in.shop2020.logistics.DeliveryType;
|
| - |
|
33 |
import in.shop2020.logistics.PickUpType;
|
| 82 |
import in.shop2020.model.v1.order.OrderStatus;
|
34 |
import in.shop2020.model.v1.order.OrderStatus;
|
| - |
|
35 |
import org.apache.commons.csv.CSVRecord;
|
| - |
|
36 |
import org.apache.logging.log4j.LogManager;
|
| - |
|
37 |
import org.apache.logging.log4j.Logger;
|
| - |
|
38 |
import org.json.JSONArray;
|
| - |
|
39 |
import org.json.JSONObject;
|
| - |
|
40 |
import org.springframework.beans.factory.annotation.Autowired;
|
| - |
|
41 |
import org.springframework.core.io.InputStreamResource;
|
| - |
|
42 |
import org.springframework.http.HttpHeaders;
|
| - |
|
43 |
import org.springframework.http.HttpStatus;
|
| - |
|
44 |
import org.springframework.http.ResponseEntity;
|
| - |
|
45 |
import org.springframework.stereotype.Controller;
|
| - |
|
46 |
import org.springframework.ui.Model;
|
| - |
|
47 |
import org.springframework.web.bind.annotation.*;
|
| - |
|
48 |
import org.springframework.web.multipart.MultipartFile;
|
| - |
|
49 |
|
| - |
|
50 |
import javax.servlet.http.HttpServletRequest;
|
| - |
|
51 |
import javax.servlet.http.HttpServletResponse;
|
| - |
|
52 |
import javax.transaction.Transactional;
|
| - |
|
53 |
import java.io.ByteArrayInputStream;
|
| - |
|
54 |
import java.io.InputStream;
|
| - |
|
55 |
import java.time.LocalDate;
|
| - |
|
56 |
import java.time.LocalDateTime;
|
| - |
|
57 |
import java.time.format.DateTimeFormatter;
|
| - |
|
58 |
import java.util.*;
|
| - |
|
59 |
import java.util.Map.Entry;
|
| - |
|
60 |
import java.util.stream.Collectors;
|
| 83 |
|
61 |
|
| 84 |
@Controller
|
62 |
@Controller
|
| 85 |
@Transactional(rollbackOn = Throwable.class)
|
63 |
@Transactional(rollbackOn = Throwable.class)
|
| 86 |
public class LogisticsController {
|
64 |
public class LogisticsController {
|
| 87 |
|
65 |
|
| Line 346... |
Line 324... |
| 346 |
Provider provider = new Provider();
|
324 |
Provider provider = new Provider();
|
| 347 |
provider.setName(providerDetailModel.getName());
|
325 |
provider.setName(providerDetailModel.getName());
|
| 348 |
provider.setActive(providerDetailModel.isProvideractive());
|
326 |
provider.setActive(providerDetailModel.isProvideractive());
|
| 349 |
provider.setBundleWeightLimit(0);
|
327 |
provider.setBundleWeightLimit(0);
|
| 350 |
provider.setGroupShipmentAllowed(true);
|
328 |
provider.setGroupShipmentAllowed(true);
|
| 351 |
provider.setPickup(0);
|
329 |
provider.setPickupType(PickUpType.COURIER);
|
| 352 |
provider.setMaxCODLimit(0);
|
330 |
provider.setMaxCODLimit(0);
|
| 353 |
|
331 |
|
| 354 |
providerRepository.persist(provider);
|
332 |
providerRepository.persist(provider);
|
| 355 |
|
333 |
|
| 356 |
ProviderDetails pd = new ProviderDetails();
|
334 |
ProviderDetails pd = new ProviderDetails();
|