diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/service/ReservationStockInOrderApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/service/ReservationStockInOrderApplicationService.java index 4b1082ec2..73b5de223 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/service/ReservationStockInOrderApplicationService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/service/ReservationStockInOrderApplicationService.java @@ -284,17 +284,21 @@ public class ReservationStockInOrderApplicationService { */ public Boolean auditState(ReservationStockInOrderDO stockInOrderDO){ Boolean b = stockInOrderDomainService.auditState(stockInOrderDO); - Integer needCustomsDeclaration = stockInOrderDO.getNeedCustomsDeclaration(); - Integer auditStatus = stockInOrderDO.getIssueStatus(); - try { - if (needCustomsDeclaration != null && needCustomsDeclaration == 1 && auditStatus != null && auditStatus == 2) { - Long inOrderId = stockInOrderDO.getInOrderId(); - List idList = new ArrayList<>(); - idList.add(inOrderId); - batchPush(idList); + List inOrderIds = stockInOrderDO.getInOrderIds(); + if (inOrderIds != null && !inOrderIds.isEmpty()) { + ReservationStockInOrder stockInOrder = reservationStockInOrderMapper.selectById(inOrderIds.get(0)); + Integer needCustomsDeclaration = stockInOrder.getNeedCustomsDeclaration(); + Integer auditStatus = stockInOrder.getIssueStatus(); + try { + if (needCustomsDeclaration != null && needCustomsDeclaration == 1 && auditStatus != null && auditStatus == 2) { + Long inOrderId = stockInOrder.getInOrderId(); + List idList = new ArrayList<>(); + idList.add(inOrderId); + batchPush(idList); + } + } catch (Exception e) { + throw new ServiceException("推送关务系统失败!"); } - } catch (Exception e) { - throw new ServiceException("推送关务系统失败!"); } return b; } 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 eee0422b5..582fdffe0 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 @@ -495,18 +495,23 @@ public class StockInOrderApplicationService { */ public Boolean auditState(StockInOrderDO stockInOrderDO){ Boolean b = stockInOrderDomainService.auditState(stockInOrderDO); - Integer needCustomsDeclaration = stockInOrderDO.getNeedCustomsDeclaration(); - Integer auditStatus = stockInOrderDO.getAuditStatus(); - try { - if (needCustomsDeclaration != null && needCustomsDeclaration == 1 && auditStatus != null && auditStatus == 3) { - Long inOrderId = stockInOrderDO.getInOrderId(); - List idList = new ArrayList<>(); - idList.add(inOrderId); - batchPush(idList); + List inOrderIds = stockInOrderDO.getInOrderIds(); + if (inOrderIds != null && !inOrderIds.isEmpty()) { + StockInOrder stockInOrder = stockInOrderService.getById(inOrderIds.get(0)); + Integer needCustomsDeclaration = stockInOrder.getNeedCustomsDeclaration(); + Integer auditStatus = stockInOrder.getAuditStatus(); + try { + if (needCustomsDeclaration != null && needCustomsDeclaration == 1 && auditStatus != null && auditStatus == 3) { + Long inOrderId = stockInOrder.getInOrderId(); + List idList = new ArrayList<>(); + idList.add(inOrderId); + batchPush(idList); + } + } catch (Exception e) { + throw new ServiceException("推送关务系统失败!"); } - } catch (Exception e) { - throw new ServiceException("推送关务系统失败!"); } + return b; } diff --git a/mhd_wms/src/main/java/com/mhd/wms/application/service/stockOutOrder/StockOutOrderApplicationService.java b/mhd_wms/src/main/java/com/mhd/wms/application/service/stockOutOrder/StockOutOrderApplicationService.java index 05c04d890..31de0792c 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/application/service/stockOutOrder/StockOutOrderApplicationService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/application/service/stockOutOrder/StockOutOrderApplicationService.java @@ -1001,24 +1001,28 @@ public class StockOutOrderApplicationService { */ public Boolean genPickingOrder(StockOutOrderDO stockOutOrderDO){ Boolean b = stockOutOrderDomainService.genPickingOrder(stockOutOrderDO); - String needDeclareFlag = stockOutOrderDO.getNeedDeclareFlag(); - Long organizationId = stockOutOrderDO.getOrganizationId(); - try { - if (needDeclareFlag != null && "1".equals(needDeclareFlag) && organizationId != null) { - if (organizationId == 2830) { - Long outOrderId = stockOutOrderDO.getOutOrderId(); - List ids = new ArrayList<>(); - ids.add(outOrderId); - batchPush(ids); - } else { - String outOrderId = stockOutOrderDO.getOutOrderNumber(); - List ids = new ArrayList<>(); - ids.add(outOrderId); - omsServiceFeign.batchPushByNumber(ids); + List outOrderIds = stockOutOrderDO.getOutOrderIds(); + if (outOrderIds != null && !outOrderIds.isEmpty()) { + StockOutOrder order = stockOutOrderService.getById(outOrderIds.get(0)); + String needDeclareFlag = order.getNeedDeclareFlag(); + Long organizationId = order.getOrganizationId(); + try { + if (needDeclareFlag != null && "1".equals(needDeclareFlag) && organizationId != null) { + if (organizationId == 2830) { + Long outOrderId = order.getOutOrderId(); + List ids = new ArrayList<>(); + ids.add(outOrderId); + batchPush(ids); + } else { + String outOrderId = order.getOutOrderNumber(); + List ids = new ArrayList<>(); + ids.add(outOrderId); + omsServiceFeign.batchPushByNumber(ids); + } } + } catch (Exception e) { + throw new ServiceException("生成报关单失败"); } - } catch (Exception e) { - throw new ServiceException("生成报关单失败"); } return b; }