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') ]]>