| Line 1... |
Line 1... |
| 1 |
package com.smartdukaan.cron.migrations;
|
1 |
package com.smartdukaan.cron.migrations;
|
| 2 |
|
2 |
|
| 3 |
import com.spice.profitmandi.dao.entity.warehouse.WarehousePurchaseOrder;
|
3 |
import com.spice.profitmandi.dao.entity.warehouse.WarehousePurchaseOrder;
|
| 4 |
import com.spice.profitmandi.dao.repository.warehouse.WarehousePurchaseOrderRepository;
|
- |
|
| 5 |
import org.apache.logging.log4j.LogManager;
|
4 |
import org.apache.logging.log4j.LogManager;
|
| 6 |
import org.apache.logging.log4j.Logger;
|
5 |
import org.apache.logging.log4j.Logger;
|
| 7 |
import org.springframework.beans.factory.annotation.Autowired;
|
6 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 8 |
import org.springframework.stereotype.Component;
|
7 |
import org.springframework.stereotype.Component;
|
| 9 |
|
8 |
|
| Line 22... |
Line 21... |
| 22 |
private static final Logger LOGGER = LogManager.getLogger(MovementBillingTask.class);
|
21 |
private static final Logger LOGGER = LogManager.getLogger(MovementBillingTask.class);
|
| 23 |
|
22 |
|
| 24 |
@Autowired
|
23 |
@Autowired
|
| 25 |
private MovementBiller movementBiller;
|
24 |
private MovementBiller movementBiller;
|
| 26 |
|
25 |
|
| 27 |
@Autowired
|
- |
|
| 28 |
private WarehousePurchaseOrderRepository warehousePurchaseOrderRepository;
|
- |
|
| 29 |
|
- |
|
| 30 |
public void billMovements(List<String> poNumbers, String operatorEmail,
|
26 |
public void billMovements(List<String> poNumbers, String operatorEmail,
|
| 31 |
int logisticsProviderId, boolean live) {
|
27 |
int logisticsProviderId, boolean live) {
|
| 32 |
Set<Integer> transactions = new LinkedHashSet<>();
|
28 |
Set<Integer> transactions = new LinkedHashSet<>();
|
| 33 |
for (WarehousePurchaseOrder po : warehousePurchaseOrderRepository.selectAllByPONumbers(poNumbers)) {
|
29 |
for (WarehousePurchaseOrder po : movementBiller.purchaseOrders(poNumbers)) {
|
| 34 |
if (po.getTransactionId() == null) {
|
30 |
if (po.getTransactionId() == null) {
|
| 35 |
LOGGER.warn("SKIPPED PO {} raised no internal order (no transaction)", po.getPoNumber());
|
31 |
LOGGER.warn("SKIPPED PO {} raised no internal order (no transaction)", po.getPoNumber());
|
| 36 |
} else {
|
32 |
} else {
|
| 37 |
transactions.add(po.getTransactionId());
|
33 |
transactions.add(po.getTransactionId());
|
| 38 |
}
|
34 |
}
|