diff --git a/mhd_wms/src/main/java/com/mhd/wms/application/service/stockInOrder/StockInOrderApplicationService.java b/mhd_wms/src/main/java/com/mhd/wms/application/service/stockInOrder/StockInOrderApplicationService.java index 9d82a46bc..7af387146 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/application/service/stockInOrder/StockInOrderApplicationService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/application/service/stockInOrder/StockInOrderApplicationService.java @@ -255,9 +255,10 @@ public class StockInOrderApplicationService { if (receiptOrderAccountList != null && !receiptOrderAccountList.isEmpty()) { for (ReceiptOrderAccount receiptOrderAccount : receiptOrderAccountList) { receiptOrderAccount.setOrderId(inOrderId); + receiptOrderAccount.setInOrOut("in"); } r = receiptOrderAccountService.saveBatch(receiptOrderAccountList); - wholeRentSynchronizationZXF(inOrderId); + wholeRentSynchronizationZXF(inOrderId,"in"); } return r; } @@ -276,9 +277,10 @@ public class StockInOrderApplicationService { if (receiptOrderAccountList != null && !receiptOrderAccountList.isEmpty()) { for (ReceiptOrderAccount receiptOrderAccount : receiptOrderAccountList) { receiptOrderAccount.setOrderId(outOrderId); + receiptOrderAccount.setInOrOut("out"); } r = receiptOrderAccountService.saveBatch(receiptOrderAccountList); - wholeRentSynchronizationZXF(outOrderId); + wholeRentSynchronizationZXF(outOrderId,"out"); } return r; } @@ -286,10 +288,10 @@ public class StockInOrderApplicationService { /** * 定时任务整租推送到bms装卸费 */ - public void wholeRentSynchronizationZXF(Long busId) { - StockInOrder stockInOrder = stockInOrderService.getOne(new QueryWrapper().lambda().eq(StockInOrder::getInOrderId, busId),false); - StockOutOrder stockOutOrder = stockOutOrderService.getOne(new QueryWrapper().lambda().eq(StockOutOrder::getOutOrderId, busId),false); - if (stockInOrder != null) { + public void wholeRentSynchronizationZXF(Long busId,String inOrOut) { + StockInOrder stockInOrder = stockInOrderService.getOne(new QueryWrapper().lambda().eq(StockInOrder::getInOrderId, busId).eq(StockInOrder::getDelFlag, 1),false); + StockOutOrder stockOutOrder = stockOutOrderService.getOne(new QueryWrapper().lambda().eq(StockOutOrder::getOutOrderId, busId).eq(StockOutOrder::getDelFlag, 1),false); + if ("in".equals(inOrOut)) { Long shipperId = stockInOrder.getShipperId(); Long organizationId = stockInOrder.getOrganizationId(); String organizationName = stockInOrder.getOrganizationName(); @@ -297,7 +299,7 @@ public class StockInOrderApplicationService { String inOrderNumber = stockInOrder.getInOrderNumber(); String settlementCurrency = stockInOrder.getSettlementCurrency(); String salesmanId = stockInOrder.getSalesmanId(); - List accounts = receiptOrderAccountService.list(new QueryWrapper().lambda().eq(ReceiptOrderAccount::getOrderId, busId)); + List accounts = receiptOrderAccountService.list(new QueryWrapper().lambda().eq(ReceiptOrderAccount::getOrderId, busId).eq(ReceiptOrderAccount::getInOrOut, "in")); for (ReceiptOrderAccount account : accounts) { BigDecimal amount = account.getAmount(); String subjectCode = account.getSubjectCode(); @@ -355,7 +357,7 @@ public class StockInOrderApplicationService { bmsServiceFeign.wholeRentSynchronizationZXF(businessDataPushDTO); } } - } else if (stockOutOrder != null) { + } else if ("out".equals(inOrOut)) { Long shipperId = stockOutOrder.getShipperId(); Long organizationId = stockOutOrder.getOrganizationId(); String organizationName = stockOutOrder.getOrganizationName(); @@ -363,7 +365,7 @@ public class StockInOrderApplicationService { String inOrderNumber = stockOutOrder.getOutOrderNumber(); String settlementCurrency = stockOutOrder.getSettlementCurrency(); String salesmanId = stockOutOrder.getSalesmanId(); - List accounts = receiptOrderAccountService.list(new QueryWrapper().lambda().eq(ReceiptOrderAccount::getOrderId, busId)); + List accounts = receiptOrderAccountService.list(new QueryWrapper().lambda().eq(ReceiptOrderAccount::getOrderId, busId).eq(ReceiptOrderAccount::getInOrOut, "out")); for (ReceiptOrderAccount account : accounts) { String subjectCode = account.getSubjectCode(); String subjectName = account.getSubjectName(); diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/receiptOrderAccount/entity/ReceiptOrderAccount.java b/mhd_wms/src/main/java/com/mhd/wms/domain/receiptOrderAccount/entity/ReceiptOrderAccount.java index 3f7cadb60..04ee86b95 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/receiptOrderAccount/entity/ReceiptOrderAccount.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/receiptOrderAccount/entity/ReceiptOrderAccount.java @@ -115,4 +115,6 @@ public class ReceiptOrderAccount extends BaseVOEntity { @ApiModelProperty(value = "计算价格json") private String amountJson; + @ApiModelProperty(value = "出入库区别标识") + private String inOrOut; } \ No newline at end of file