| Line 42... |
Line 42... |
| 42 |
import com.smartdukaan.cron.scheduled.SamsungIMEIActivationService;
|
42 |
import com.smartdukaan.cron.scheduled.SamsungIMEIActivationService;
|
| 43 |
import com.smartdukaan.cron.scheduled.ScheduledTasks;
|
43 |
import com.smartdukaan.cron.scheduled.ScheduledTasks;
|
| 44 |
import com.spice.profitmandi.common.enumuration.ItemType;
|
44 |
import com.spice.profitmandi.common.enumuration.ItemType;
|
| 45 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
45 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 46 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
46 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
| 47 |
import com.spice.profitmandi.common.model.ItemCompleteLedgerModel;
|
- |
|
| 48 |
import com.spice.profitmandi.common.util.FileUtil;
|
47 |
import com.spice.profitmandi.common.util.FileUtil;
|
| 49 |
import com.spice.profitmandi.common.util.FormattingUtils;
|
48 |
import com.spice.profitmandi.common.util.FormattingUtils;
|
| 50 |
import com.spice.profitmandi.common.util.Utils;
|
49 |
import com.spice.profitmandi.common.util.Utils;
|
| 51 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
50 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
| 52 |
import com.spice.profitmandi.dao.entity.catalog.ItemCriteria;
|
- |
|
| 53 |
import com.spice.profitmandi.dao.entity.catalog.Offer;
|
51 |
import com.spice.profitmandi.dao.entity.catalog.Offer;
|
| 54 |
import com.spice.profitmandi.dao.entity.catalog.Scheme;
|
52 |
import com.spice.profitmandi.dao.entity.catalog.Scheme;
|
| 55 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
53 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
| 56 |
import com.spice.profitmandi.dao.entity.dtr.PaymentOptionTransaction;
|
54 |
import com.spice.profitmandi.dao.entity.dtr.PaymentOptionTransaction;
|
| 57 |
import com.spice.profitmandi.dao.entity.fofo.CurrentInventorySnapshot;
|
55 |
import com.spice.profitmandi.dao.entity.fofo.CurrentInventorySnapshot;
|
| Line 67... |
Line 65... |
| 67 |
import com.spice.profitmandi.dao.entity.fofo.PurchaseReturnItem;
|
65 |
import com.spice.profitmandi.dao.entity.fofo.PurchaseReturnItem;
|
| 68 |
import com.spice.profitmandi.dao.entity.fofo.ScanRecord;
|
66 |
import com.spice.profitmandi.dao.entity.fofo.ScanRecord;
|
| 69 |
import com.spice.profitmandi.dao.entity.fofo.SchemeInOut;
|
67 |
import com.spice.profitmandi.dao.entity.fofo.SchemeInOut;
|
| 70 |
import com.spice.profitmandi.dao.entity.fofo.SchemeItem;
|
68 |
import com.spice.profitmandi.dao.entity.fofo.SchemeItem;
|
| 71 |
import com.spice.profitmandi.dao.entity.inventory.SaholicInventorySnapshot;
|
69 |
import com.spice.profitmandi.dao.entity.inventory.SaholicInventorySnapshot;
|
| 72 |
import com.spice.profitmandi.dao.entity.inventory.VendorItemPricing;
|
70 |
import com.spice.profitmandi.dao.entity.inventory.Warehouse;
|
| 73 |
import com.spice.profitmandi.dao.entity.transaction.HdfcPayment;
|
71 |
import com.spice.profitmandi.dao.entity.transaction.HdfcPayment;
|
| 74 |
import com.spice.profitmandi.dao.entity.transaction.LineItem;
|
72 |
import com.spice.profitmandi.dao.entity.transaction.LineItem;
|
| 75 |
import com.spice.profitmandi.dao.entity.transaction.LineItemImei;
|
73 |
import com.spice.profitmandi.dao.entity.transaction.LineItemImei;
|
| 76 |
import com.spice.profitmandi.dao.entity.transaction.ManualPaymentType;
|
74 |
import com.spice.profitmandi.dao.entity.transaction.ManualPaymentType;
|
| 77 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
75 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
| Line 84... |
Line 82... |
| 84 |
import com.spice.profitmandi.dao.entity.warehouse.WarehouseScan;
|
82 |
import com.spice.profitmandi.dao.entity.warehouse.WarehouseScan;
|
| 85 |
import com.spice.profitmandi.dao.enumuration.catalog.AmountType;
|
83 |
import com.spice.profitmandi.dao.enumuration.catalog.AmountType;
|
| 86 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
84 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
| 87 |
import com.spice.profitmandi.dao.enumuration.dtr.PaymentOptionReferenceType;
|
85 |
import com.spice.profitmandi.dao.enumuration.dtr.PaymentOptionReferenceType;
|
| 88 |
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
|
86 |
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
|
| 89 |
import com.spice.profitmandi.dao.enumuration.transaction.SchemePayoutStatus;
|
- |
|
| 90 |
import com.spice.profitmandi.dao.model.ContentPojo;
|
87 |
import com.spice.profitmandi.dao.model.ContentPojo;
|
| 91 |
import com.spice.profitmandi.dao.model.CreateOfferRequest;
|
88 |
import com.spice.profitmandi.dao.model.CreateOfferRequest;
|
| 92 |
import com.spice.profitmandi.dao.model.MediaPojo;
|
89 |
import com.spice.profitmandi.dao.model.MediaPojo;
|
| 93 |
import com.spice.profitmandi.dao.repository.GenericRepository;
|
90 |
import com.spice.profitmandi.dao.repository.GenericRepository;
|
| 94 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
91 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
| Line 116... |
Line 113... |
| 116 |
import com.spice.profitmandi.dao.repository.fofo.SchemeInOutRepository;
|
113 |
import com.spice.profitmandi.dao.repository.fofo.SchemeInOutRepository;
|
| 117 |
import com.spice.profitmandi.dao.repository.fofo.SchemeItemRepository;
|
114 |
import com.spice.profitmandi.dao.repository.fofo.SchemeItemRepository;
|
| 118 |
import com.spice.profitmandi.dao.repository.inventory.SaholicInventorySnapshotRepository;
|
115 |
import com.spice.profitmandi.dao.repository.inventory.SaholicInventorySnapshotRepository;
|
| 119 |
import com.spice.profitmandi.dao.repository.inventory.SaholicReservationSnapshotRepository;
|
116 |
import com.spice.profitmandi.dao.repository.inventory.SaholicReservationSnapshotRepository;
|
| 120 |
import com.spice.profitmandi.dao.repository.inventory.VendorItemPricingRepository;
|
117 |
import com.spice.profitmandi.dao.repository.inventory.VendorItemPricingRepository;
|
| - |
|
118 |
import com.spice.profitmandi.dao.repository.inventory.WarehouseRepository;
|
| 121 |
import com.spice.profitmandi.dao.repository.transaction.HdfcPaymentRepository;
|
119 |
import com.spice.profitmandi.dao.repository.transaction.HdfcPaymentRepository;
|
| 122 |
import com.spice.profitmandi.dao.repository.transaction.LineItemImeisRepository;
|
120 |
import com.spice.profitmandi.dao.repository.transaction.LineItemImeisRepository;
|
| 123 |
import com.spice.profitmandi.dao.repository.transaction.LineItemRepository;
|
121 |
import com.spice.profitmandi.dao.repository.transaction.LineItemRepository;
|
| 124 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
122 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
| 125 |
import com.spice.profitmandi.dao.repository.transaction.ReturnOrderRepository;
|
123 |
import com.spice.profitmandi.dao.repository.transaction.ReturnOrderRepository;
|
| Line 159... |
Line 157... |
| 159 |
@Autowired
|
157 |
@Autowired
|
| 160 |
private LeadRepository leadRepository;
|
158 |
private LeadRepository leadRepository;
|
| 161 |
|
159 |
|
| 162 |
@Autowired
|
160 |
@Autowired
|
| 163 |
private VendorItemPricingRepository vendorItemPricingRepository;
|
161 |
private VendorItemPricingRepository vendorItemPricingRepository;
|
| - |
|
162 |
|
| - |
|
163 |
@Autowired
|
| - |
|
164 |
private WarehouseRepository warehouseRepository;
|
| 164 |
|
165 |
|
| 165 |
@Autowired
|
166 |
@Autowired
|
| 166 |
private PurchaseReturnItemRepository purchaseReturnItemRepository;
|
167 |
private PurchaseReturnItemRepository purchaseReturnItemRepository;
|
| 167 |
|
168 |
|
| 168 |
@Autowired
|
169 |
@Autowired
|
| Line 1384... |
Line 1385... |
| 1384 |
}
|
1385 |
}
|
| 1385 |
|
1386 |
|
| 1386 |
public void fixOrders() throws Exception {
|
1387 |
public void fixOrders() throws Exception {
|
| 1387 |
List<Order> orders = orderRepository.selectAllOrderDatesBetweenByStatus(LocalDate.now().atStartOfDay(), LocalDateTime.now(), OrderStatus.SUBMITTED_FOR_PROCESSING);
|
1388 |
List<Order> orders = orderRepository.selectAllOrderDatesBetweenByStatus(LocalDate.now().atStartOfDay(), LocalDateTime.now(), OrderStatus.SUBMITTED_FOR_PROCESSING);
|
| 1388 |
for(Order order : orders) {
|
1389 |
for(Order order : orders) {
|
| - |
|
1390 |
/*
|
| - |
|
1391 |
* LineItem lineItem =
|
| 1389 |
LineItem lineItem = lineItemRepository.selectById(order.getLineItem().getId());
|
1392 |
* lineItemRepository.selectById(order.getLineItem().getId());
|
| 1390 |
if(order.getProductCondition()==null) {
|
- |
|
| 1391 |
order.setProductCondition(0);
|
1393 |
* if(order.getOrderType()==null) { order.setProductCondition(0);
|
| 1392 |
int itemId = order.getLineItem().getItemId();
|
1394 |
* order.setOrderType(0); int itemId = order.getLineItem().getItemId(); int
|
| 1393 |
int fulfillmentWarehouseId = order.getFulfilmentWarehouseId();
|
1395 |
* fulfillmentWarehouseId = order.getFulfilmentWarehouseId();
|
| 1394 |
System.out.println("Item id " + itemId);
|
1396 |
* System.out.println("Item id " + itemId); Item item =
|
| 1395 |
Item item = itemRepository.selectById(itemId);
|
1397 |
* itemRepository.selectById(itemId);
|
| 1396 |
|
1398 |
*
|
| - |
|
1399 |
* VendorItemPricing vendorItemPricing =
|
| 1397 |
VendorItemPricing vendorItemPricing = vendorItemPricingRepository.selectByItemIdAndVendorId(itemId, fulfillmentWarehouseId);
|
1400 |
* vendorItemPricingRepository.selectByItemIdAndVendorId(itemId,
|
| 1398 |
if(vendorItemPricing==null) {
|
1401 |
* fulfillmentWarehouseId); if(vendorItemPricing==null) { vendorItemPricing =
|
| 1399 |
vendorItemPricing = vendorItemPricingRepository.selectAll(itemId).get(0);
|
1402 |
* vendorItemPricingRepository.selectAll(itemId).get(0); }
|
| 1400 |
}
|
- |
|
| 1401 |
System.out.println("vendorItemPricing " + vendorItemPricing);
|
1403 |
* System.out.println("vendorItemPricing " + vendorItemPricing);
|
| 1402 |
lineItem.setProductGoup(item.getProductGroup());
|
1404 |
* lineItem.setProductGoup(item.getProductGroup());
|
| 1403 |
lineItem.setColor(item.getColor());
|
1405 |
* lineItem.setColor(item.getColor());
|
| 1404 |
lineItem.setNlc(vendorItemPricing.getNlc());
|
1406 |
* lineItem.setNlc(vendorItemPricing.getNlc());
|
| 1405 |
lineItem.setTransferPrice(vendorItemPricing.getTp());
|
1407 |
* lineItem.setTransferPrice(vendorItemPricing.getTp());
|
| 1406 |
lineItem.setLogisticsCost(0f);
|
- |
|
| 1407 |
lineItem.setCodCollectionCharges(0f);
|
1408 |
* lineItem.setLogisticsCost(0f); lineItem.setCodCollectionCharges(0f);
|
| 1408 |
|
1409 |
*
|
| 1409 |
}
|
1410 |
* }
|
| - |
|
1411 |
*/
|
| - |
|
1412 |
Warehouse warehouse = warehouseRepository.selectWarehouse(Arrays.asList(order.getFulfilmentWarehouseId())).get(0);
|
| - |
|
1413 |
order.setWarehouseId(warehouse.getBillingWarehouseId());
|
| 1410 |
}
|
1414 |
}
|
| 1411 |
|
1415 |
|
| 1412 |
}
|
1416 |
}
|
| 1413 |
|
1417 |
|
| 1414 |
}
|
1418 |
}
|