Subversion Repositories SmartDukaan

Rev

Rev 30989 | Rev 31077 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 30989 Rev 31043
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.InputStream;
-
 
5
import java.time.LocalDate;
-
 
6
import java.time.LocalDateTime;
-
 
7
import java.time.format.DateTimeFormatter;
-
 
8
import java.util.ArrayList;
-
 
9
import java.util.Arrays;
-
 
10
import java.util.HashMap;
-
 
11
import java.util.HashSet;
-
 
12
import java.util.List;
-
 
13
import java.util.Map;
-
 
14
import java.util.Map.Entry;
-
 
15
import java.util.Set;
-
 
16
import java.util.stream.Collectors;
-
 
17
 
-
 
18
import javax.servlet.http.HttpServletRequest;
-
 
19
import javax.servlet.http.HttpServletResponse;
-
 
20
import javax.transaction.Transactional;
-
 
21
 
-
 
22
import org.apache.commons.csv.CSVRecord;
-
 
23
import org.apache.logging.log4j.LogManager;
-
 
24
import org.apache.logging.log4j.Logger;
-
 
25
import org.json.JSONArray;
-
 
26
import org.json.JSONObject;
-
 
27
import org.springframework.beans.factory.annotation.Autowired;
-
 
28
import org.springframework.core.io.InputStreamResource;
-
 
29
import org.springframework.http.HttpHeaders;
-
 
30
import org.springframework.http.HttpStatus;
-
 
31
import org.springframework.http.ResponseEntity;
-
 
32
import org.springframework.stereotype.Controller;
-
 
33
import org.springframework.ui.Model;
-
 
34
import org.springframework.web.bind.annotation.RequestBody;
-
 
35
import org.springframework.web.bind.annotation.RequestMapping;
-
 
36
import org.springframework.web.bind.annotation.RequestMethod;
-
 
37
import org.springframework.web.bind.annotation.RequestParam;
-
 
38
import org.springframework.web.bind.annotation.RequestPart;
-
 
39
import org.springframework.web.multipart.MultipartFile;
-
 
40
 
3
import com.google.gson.Gson;
41
import com.google.gson.Gson;
4
import com.spice.profitmandi.common.enumuration.MessageType;
42
import com.spice.profitmandi.common.enumuration.MessageType;
5
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
43
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
6
import com.spice.profitmandi.common.model.CustomRetailer;
44
import com.spice.profitmandi.common.model.CustomRetailer;
7
import com.spice.profitmandi.common.model.ProfitMandiConstants;
45
import com.spice.profitmandi.common.model.ProfitMandiConstants;
Line 13... Line 51...
13
import com.spice.profitmandi.dao.entity.logistics.ProviderDetails;
51
import com.spice.profitmandi.dao.entity.logistics.ProviderDetails;
14
import com.spice.profitmandi.dao.entity.logistics.ProviderTat;
52
import com.spice.profitmandi.dao.entity.logistics.ProviderTat;
15
import com.spice.profitmandi.dao.entity.logistics.PublicHolidays;
53
import com.spice.profitmandi.dao.entity.logistics.PublicHolidays;
16
import com.spice.profitmandi.dao.entity.transaction.Order;
54
import com.spice.profitmandi.dao.entity.transaction.Order;
17
import com.spice.profitmandi.dao.entity.user.Address;
55
import com.spice.profitmandi.dao.entity.user.Address;
-
 
56
import com.spice.profitmandi.dao.model.BilledOrderListModel;
-
 
57
import com.spice.profitmandi.dao.model.DelayBillingModel;
18
import com.spice.profitmandi.dao.model.*;
58
import com.spice.profitmandi.dao.model.DelayDayModel;
-
 
59
import com.spice.profitmandi.dao.model.DispatchNotificationModel;
-
 
60
import com.spice.profitmandi.dao.model.MarkDeliveredModel;
-
 
61
import com.spice.profitmandi.dao.model.ProviderDetailModel;
-
 
62
import com.spice.profitmandi.dao.model.ProviderTatModel;
19
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
63
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
20
import com.spice.profitmandi.dao.repository.cs.CsService;
64
import com.spice.profitmandi.dao.repository.cs.CsService;
21
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
65
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
22
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
66
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
23
import com.spice.profitmandi.dao.repository.logistics.ProviderDetailsRepository;
67
import com.spice.profitmandi.dao.repository.logistics.ProviderDetailsRepository;
Line 25... Line 69...
25
import com.spice.profitmandi.dao.repository.logistics.ProviderTatRepository;
69
import com.spice.profitmandi.dao.repository.logistics.ProviderTatRepository;
26
import com.spice.profitmandi.dao.repository.logistics.PublicHolidaysRepository;
70
import com.spice.profitmandi.dao.repository.logistics.PublicHolidaysRepository;
27
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
71
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
28
import com.spice.profitmandi.dao.repository.user.AddressRepository;
72
import com.spice.profitmandi.dao.repository.user.AddressRepository;
29
import com.spice.profitmandi.dao.repository.user.UserRepository;
73
import com.spice.profitmandi.dao.repository.user.UserRepository;
-
 
74
import com.spice.profitmandi.dao.service.biuedart.BluedartService;
30
import com.spice.profitmandi.service.LogisticsService;
75
import com.spice.profitmandi.service.LogisticsService;
31
import com.spice.profitmandi.service.NotificationService;
76
import com.spice.profitmandi.service.NotificationService;
32
import com.spice.profitmandi.web.model.LoginDetails;
77
import com.spice.profitmandi.web.model.LoginDetails;
33
import com.spice.profitmandi.web.util.CookiesProcessor;
78
import com.spice.profitmandi.web.util.CookiesProcessor;
34
import com.spice.profitmandi.web.util.MVCResponseSender;
79
import com.spice.profitmandi.web.util.MVCResponseSender;
-
 
80
 
35
import in.shop2020.logistics.DeliveryType;
81
import in.shop2020.logistics.DeliveryType;
36
import in.shop2020.logistics.PickUpType;
82
import in.shop2020.logistics.PickUpType;
37
import in.shop2020.model.v1.order.OrderStatus;
83
import in.shop2020.model.v1.order.OrderStatus;
38
import org.apache.commons.csv.CSVRecord;
-
 
39
import org.apache.logging.log4j.LogManager;
-
 
40
import org.apache.logging.log4j.Logger;
-
 
41
import org.json.JSONArray;
-
 
42
import org.json.JSONObject;
-
 
43
import org.springframework.beans.factory.annotation.Autowired;
-
 
44
import org.springframework.core.io.InputStreamResource;
-
 
45
import org.springframework.http.HttpHeaders;
-
 
46
import org.springframework.http.HttpStatus;
-
 
47
import org.springframework.http.ResponseEntity;
-
 
48
import org.springframework.stereotype.Controller;
-
 
49
import org.springframework.ui.Model;
-
 
50
import org.springframework.web.bind.annotation.*;
-
 
51
import org.springframework.web.multipart.MultipartFile;
-
 
52
 
-
 
53
import javax.servlet.http.HttpServletRequest;
-
 
54
import javax.servlet.http.HttpServletResponse;
-
 
55
import javax.transaction.Transactional;
-
 
56
import java.io.ByteArrayInputStream;
-
 
57
import java.io.InputStream;
-
 
58
import java.time.LocalDate;
-
 
59
import java.time.LocalDateTime;
-
 
60
import java.time.format.DateTimeFormatter;
-
 
61
import java.util.*;
-
 
62
import java.util.Map.Entry;
-
 
63
import java.util.stream.Collectors;
-
 
64
 
84
 
65
@Controller
85
@Controller
66
@Transactional(rollbackOn = Throwable.class)
86
@Transactional(rollbackOn = Throwable.class)
67
public class LogisticsController {
87
public class LogisticsController {
68
 
88
 
Line 112... Line 132...
112
	private AddressRepository addressRepository;
132
	private AddressRepository addressRepository;
113
 
133
 
114
	@Autowired
134
	@Autowired
115
	private UserRepository userUserRepository;
135
	private UserRepository userUserRepository;
116
 
136
 
-
 
137
	@Autowired
-
 
138
	private BluedartService blueDartService;
-
 
139
 
117
	private static final Logger LOGGER = LogManager.getLogger(LogisticsController.class);
140
	private static final Logger LOGGER = LogManager.getLogger(LogisticsController.class);
118
 
141
 
119
	@RequestMapping(value = "/logistics", method = RequestMethod.GET)
142
	@RequestMapping(value = "/logistics", method = RequestMethod.GET)
120
	public String logistics(HttpServletRequest request, Model model) throws Exception {
143
	public String logistics(HttpServletRequest request, Model model) throws Exception {
121
		ProviderTat pt = providerTatRepository.selectByProviderId(1, 7678, "110018");
144
		ProviderTat pt = providerTatRepository.selectByProviderId(1, 7678, "110018");
Line 860... Line 883...
860
		model.addAttribute("response", mvcResponseSender.createResponseString(true));
883
		model.addAttribute("response", mvcResponseSender.createResponseString(true));
861
 
884
 
862
		return "response";
885
		return "response";
863
	}
886
	}
864
 
887
 
-
 
888
	@RequestMapping(value = "/getAwbNumber", method = RequestMethod.GET)
-
 
889
	public String getAwbNumber(HttpServletRequest request, Model model) throws Exception {
-
 
890
 
-
 
891
		List<Order> orders = orderRepository.selectByInvoiceNumber("NSLCK7931");
-
 
892
 
-
 
893
		blueDartService.getAirwayBillNo(orders);
-
 
894
		model.addAttribute("response", mvcResponseSender.createResponseString(true));
-
 
895
 
-
 
896
		return "response";
-
 
897
	}
865
}
898
}