From c1bd7b21e4db732374f0fbcb2e5e5f8c7bc02039 Mon Sep 17 00:00:00 2001 From: anthonyywj2 <353682448@qq.com> Date: Wed, 29 Jun 2022 12:30:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A7=94=E6=89=98=E9=AA=8C=E6=94=B6=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E5=A4=9A=E4=B8=AA=E4=BC=9A=E8=A6=86=E7=9B=96=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=8F=AF=E4=BB=A5=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=A4=9A=E4=B8=AA=E5=A7=94=E6=89=98=E9=AA=8C=E6=94=B6?= =?UTF-8?q?=EF=BC=8C=E9=80=89=E6=8B=A9=E4=B8=9A=E5=8A=A1=E5=8D=95=E6=8D=AE?= =?UTF-8?q?=E6=A3=80=E9=AA=8C=E5=8A=A0=E5=BD=93=E5=89=8D=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E5=88=86=E5=BA=93=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/inout/OrderController.java | 2 ++ .../inout/OrderDetailController.java | 17 +++++++++-- .../admin/entity/inout/ErpOrderEntity.java | 3 ++ .../req/basic/BasicEntrustRecRequest.java | 2 ++ .../api/admin/res/inout/ErpOrderResponse.java | 28 +++++++++++++++++++ .../mybatis/mapper/basic/EntrustReceDao.xml | 6 ++++ 6 files changed, 55 insertions(+), 3 deletions(-) diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/inout/OrderController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/inout/OrderController.java index 176bdba3..c9306021 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/inout/OrderController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/inout/OrderController.java @@ -285,6 +285,8 @@ public class OrderController { basicEntrustRecRequest.setAction(stockOrderEntity.getBillType()); basicEntrustRecRequest.setEntrustUser(userId + ""); basicEntrustRecRequest.setCurInv(stockOrderEntity.getLocStorageCode()); + basicEntrustRecRequest.setInvWarehouseCode(stockOrderEntity.getInvWarehouseCode()); + entrustReceEntities = entrustReceService.filterEntrustRec(basicEntrustRecRequest); } else { return ResultVOUtils.error(500, "单据已委托验收完成!"); diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/inout/OrderDetailController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/inout/OrderDetailController.java index f33ca4e0..f44977e5 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/inout/OrderDetailController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/inout/OrderDetailController.java @@ -550,6 +550,8 @@ public class OrderDetailController { erpOrderEntity.setBatchNo(subPurchase.getBatchNo()); erpOrderEntity.setErpCount(subPurchase.getCount()); erpOrderEntity.setReCount(subPurchase.getReCount()); + erpOrderEntity.setInvWarehouseCode(purchaseinResponse.getInvWarehouseCode()); + erpOrderEntity.setLocStorageCode(purchaseinResponse.getLocStorageCode()); erpOrderEntity.setGoodsunit(subPurchase.getSpec()); erpOrderEntity.setBindRlFk(subPurchase.getRelId()); erpOrderEntities.add(erpOrderEntity); @@ -562,7 +564,16 @@ public class OrderDetailController { ErpOrderEntity temp = erpOrderEntities.get(0); for (int i = 0; i < erpOrderEntities.size(); i++) { if (!temp.getCompanyname().equals(erpOrderEntities.get(i).getCompanyname())) { - return ResultVOUtils.error(500, "选择Erp订单往来单位不一致!"); + return ResultVOUtils.error(500, "所选业务单据往来单位不一致!"); + } + + if (!temp.getLocStorageCode().equals(erpOrderEntities.get(i).getLocStorageCode())) { + return ResultVOUtils.error(500, "所选业务单据当前仓库不一致!"); + } + + + if (!temp.getInvWarehouseCode().equals(erpOrderEntities.get(i).getInvWarehouseCode())) { + return ResultVOUtils.error(500, "所选业务单据当前分库不一致!"); } } @@ -572,7 +583,7 @@ public class OrderDetailController { orderEntity.setReviewUser(authAdmin.getId().intValue()); ErpOrderEntity exitErp = new ContrastErpUtil().vailErpExit(orderDetailService, erpOrderEntities, importErpOrderRequest.getOrderId()); if (exitErp != null) { - String errMsg = "所选ERP单" + exitErp.getErpOrderId() + "已被其他出入库单" + exitErp.getOrderIdFk() + "绑定"; + String errMsg = "所选业务单据" + exitErp.getErpOrderId() + "已被其他出入库单" + exitErp.getOrderIdFk() + "绑定"; orderEntity.setRemark(errMsg); orderEntity.setUpdateTime(new Date()); orderService.updateOrder(orderEntity); @@ -586,7 +597,7 @@ public class OrderDetailController { transInoutService.genOrderDetail(warehouseEntityList); checkOrderUtils.check(orderEntity.getId(), erpOrderEntities); } else { - return ResultVOUtils.error(500, "ERP订单不能为空"); + return ResultVOUtils.error(500, "业务单据不能为空"); } return ResultVOUtils.success("导入成功"); diff --git a/api-admin/src/main/java/com/glxp/api/admin/entity/inout/ErpOrderEntity.java b/api-admin/src/main/java/com/glxp/api/admin/entity/inout/ErpOrderEntity.java index 61ee9623..eb2ed96c 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/entity/inout/ErpOrderEntity.java +++ b/api-admin/src/main/java/com/glxp/api/admin/entity/inout/ErpOrderEntity.java @@ -57,6 +57,9 @@ public class ErpOrderEntity { private BigDecimal price; private boolean checkSuccess; + private String locStorageCode; + private String invWarehouseCode;//当前分库 + private String fromSubInvCode; //往来分库 public Integer getBindStatus() { diff --git a/api-admin/src/main/java/com/glxp/api/admin/req/basic/BasicEntrustRecRequest.java b/api-admin/src/main/java/com/glxp/api/admin/req/basic/BasicEntrustRecRequest.java index 92f4722a..c2e1b55a 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/req/basic/BasicEntrustRecRequest.java +++ b/api-admin/src/main/java/com/glxp/api/admin/req/basic/BasicEntrustRecRequest.java @@ -16,5 +16,7 @@ public class BasicEntrustRecRequest extends ListPageRequest { private Date updateTime; private String curInv; private Date lastUpdateTime; + private String entrustSubInv; + private String invWarehouseCode; } diff --git a/api-admin/src/main/java/com/glxp/api/admin/res/inout/ErpOrderResponse.java b/api-admin/src/main/java/com/glxp/api/admin/res/inout/ErpOrderResponse.java index 42ac550d..b07312ae 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/res/inout/ErpOrderResponse.java +++ b/api-admin/src/main/java/com/glxp/api/admin/res/inout/ErpOrderResponse.java @@ -12,6 +12,10 @@ public class ErpOrderResponse { private String billType; private String billFlag; private String originType; + private String locStorageCode; + private String invWarehouseCode;//当前分库 + private String fromSubInvCode; //往来分库 + private String thirdSysFk; private List subErpOrders; @@ -198,6 +202,30 @@ public class ErpOrderResponse { this.remark3 = remark3; } + public String getLocStorageCode() { + return locStorageCode; + } + + public void setLocStorageCode(String locStorageCode) { + this.locStorageCode = locStorageCode; + } + + public String getInvWarehouseCode() { + return invWarehouseCode; + } + + public void setInvWarehouseCode(String invWarehouseCode) { + this.invWarehouseCode = invWarehouseCode; + } + + public String getFromSubInvCode() { + return fromSubInvCode; + } + + public void setFromSubInvCode(String fromSubInvCode) { + this.fromSubInvCode = fromSubInvCode; + } + public static class SubErpOrder { private Integer id; private String productId; diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/EntrustReceDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/EntrustReceDao.xml index b9dc040a..7e810ab5 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/EntrustReceDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/EntrustReceDao.xml @@ -25,6 +25,12 @@ and curInv = #{curInv} + + and entrustSubInv = #{entrustSubInv} + + + and invWarehouseCode = #{invWarehouseCode} + = DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>