| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.dao.service.dtdc;
|
1 |
package com.spice.profitmandi.dao.service.dtdc;
|
| 2 |
|
2 |
|
| 3 |
import java.util.ArrayList;
|
- |
|
| 4 |
import java.util.Arrays;
|
- |
|
| 5 |
import java.util.Base64;
|
- |
|
| 6 |
import java.util.HashMap;
|
- |
|
| 7 |
import java.util.List;
|
- |
|
| 8 |
import java.util.Map;
|
- |
|
| 9 |
import java.util.Map.Entry;
|
- |
|
| 10 |
import java.util.stream.Collectors;
|
- |
|
| 11 |
|
- |
|
| 12 |
import org.apache.logging.log4j.LogManager;
|
- |
|
| 13 |
import org.apache.logging.log4j.Logger;
|
- |
|
| 14 |
import org.json.JSONArray;
|
- |
|
| 15 |
import org.json.JSONObject;
|
- |
|
| 16 |
import org.springframework.beans.factory.annotation.Autowired;
|
- |
|
| 17 |
import org.springframework.beans.factory.annotation.Value;
|
- |
|
| 18 |
import org.springframework.core.io.ByteArrayResource;
|
- |
|
| 19 |
import org.springframework.mail.javamail.JavaMailSender;
|
- |
|
| 20 |
import org.springframework.stereotype.Component;
|
- |
|
| 21 |
|
- |
|
| 22 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
3 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 23 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
4 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
| 24 |
import com.spice.profitmandi.common.util.FileUtil;
|
5 |
import com.spice.profitmandi.common.util.FileUtil;
|
| 25 |
import com.spice.profitmandi.common.util.Utils;
|
6 |
import com.spice.profitmandi.common.util.Utils;
|
| 26 |
import com.spice.profitmandi.common.util.Utils.Attachment;
|
7 |
import com.spice.profitmandi.common.util.Utils.Attachment;
|
| Line 28... |
Line 9... |
| 28 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
9 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
| 29 |
import com.spice.profitmandi.dao.entity.transaction.WarehouseAddressMapping;
|
10 |
import com.spice.profitmandi.dao.entity.transaction.WarehouseAddressMapping;
|
| 30 |
import com.spice.profitmandi.dao.entity.transaction.WarehouseAddressMaster;
|
11 |
import com.spice.profitmandi.dao.entity.transaction.WarehouseAddressMaster;
|
| 31 |
import com.spice.profitmandi.dao.model.BilledOrderListModel;
|
12 |
import com.spice.profitmandi.dao.model.BilledOrderListModel;
|
| 32 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
13 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
| 33 |
import com.spice.profitmandi.dao.repository.transaction.WareHouseAddressMappingRepository;
|
14 |
import com.spice.profitmandi.dao.repository.transaction.WarehouseAddressMappingRepository;
|
| 34 |
import com.spice.profitmandi.dao.repository.transaction.WareHouseAddressMasterRepository;
|
15 |
import com.spice.profitmandi.dao.repository.transaction.WarehouseAddressMasterRepository;
|
| 35 |
import com.spice.profitmandi.service.user.RetailerService;
|
16 |
import com.spice.profitmandi.service.user.RetailerService;
|
| 36 |
|
- |
|
| 37 |
import in.shop2020.model.v1.order.OrderStatus;
|
17 |
import in.shop2020.model.v1.order.OrderStatus;
|
| - |
|
18 |
import org.apache.logging.log4j.LogManager;
|
| - |
|
19 |
import org.apache.logging.log4j.Logger;
|
| - |
|
20 |
import org.json.JSONArray;
|
| - |
|
21 |
import org.json.JSONObject;
|
| - |
|
22 |
import org.springframework.beans.factory.annotation.Autowired;
|
| - |
|
23 |
import org.springframework.beans.factory.annotation.Value;
|
| - |
|
24 |
import org.springframework.core.io.ByteArrayResource;
|
| - |
|
25 |
import org.springframework.mail.javamail.JavaMailSender;
|
| - |
|
26 |
import org.springframework.stereotype.Component;
|
| - |
|
27 |
|
| - |
|
28 |
import java.util.*;
|
| - |
|
29 |
import java.util.Map.Entry;
|
| - |
|
30 |
import java.util.stream.Collectors;
|
| 38 |
|
31 |
|
| 39 |
@Component
|
32 |
@Component
|
| 40 |
public class DTDCServiceImpl implements DTDCService {
|
33 |
public class DTDCServiceImpl implements DTDCService {
|
| 41 |
|
34 |
|
| 42 |
@Autowired
|
35 |
@Autowired
|
| 43 |
private RetailerService retailerService;
|
36 |
private RetailerService retailerService;
|
| 44 |
|
37 |
|
| 45 |
@Autowired
|
38 |
@Autowired
|
| 46 |
private WareHouseAddressMappingRepository wareHouseAddressMappingRepository;
|
39 |
private WarehouseAddressMappingRepository warehouseAddressMappingRepository;
|
| 47 |
|
40 |
|
| 48 |
@Autowired
|
41 |
@Autowired
|
| 49 |
private WareHouseAddressMasterRepository wareHouseAddressMasterRepository;
|
42 |
private WarehouseAddressMasterRepository warehouseAddressMasterRepository;
|
| 50 |
|
43 |
|
| 51 |
@Autowired
|
44 |
@Autowired
|
| 52 |
private OrderRepository orderRepository;
|
45 |
private OrderRepository orderRepository;
|
| 53 |
|
46 |
|
| 54 |
@Autowired
|
47 |
@Autowired
|
| Line 102... |
Line 95... |
| 102 |
|
95 |
|
| 103 |
int warehouseId = order.getWarehouseId();
|
96 |
int warehouseId = order.getWarehouseId();
|
| 104 |
|
97 |
|
| 105 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(order.getRetailerId());
|
98 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(order.getRetailerId());
|
| 106 |
|
99 |
|
| 107 |
WarehouseAddressMapping warehouseAddressMapping = wareHouseAddressMappingRepository
|
100 |
WarehouseAddressMapping warehouseAddressMapping = warehouseAddressMappingRepository
|
| 108 |
.selectByWarehouseId(warehouseId);
|
101 |
.selectByWarehouseId(warehouseId);
|
| 109 |
|
102 |
|
| 110 |
WarehouseAddressMaster warehouseAddressMaster = wareHouseAddressMasterRepository
|
103 |
WarehouseAddressMaster warehouseAddressMaster = warehouseAddressMasterRepository
|
| 111 |
.selectById(warehouseAddressMapping.getAddressId());
|
104 |
.selectById(warehouseAddressMapping.getAddressId());
|
| 112 |
|
105 |
|
| 113 |
Consignment consignment = new Consignment();
|
106 |
Consignment consignment = new Consignment();
|
| 114 |
consignment.setCustomerCode(customerCode);
|
107 |
consignment.setCustomerCode(customerCode);
|
| 115 |
consignment.setServiceTypeId("PRIORITY");
|
108 |
consignment.setServiceTypeId("PRIORITY");
|