From e5ab6c9d978b2cc1f11c80b92581b48807be4a7a Mon Sep 17 00:00:00 2001 From: anthonyywj2 <353682448@qq.com> Date: Thu, 30 Jun 2022 09:21:14 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/StockQRCodeTextController.java | 9 ++++++++- .../inout/OrderDetailController.java | 19 ++++++++++++++----- .../admin/entity/inout/ErpOrderEntity.java | 2 +- .../req/business/StockOrderFilterRequest.java | 1 + .../mybatis/mapper/auth/AuthAdminDao.xml | 2 +- .../mybatis/mapper/business/StockOrderDao.xml | 6 +++++- 6 files changed, 30 insertions(+), 9 deletions(-) diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockQRCodeTextController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockQRCodeTextController.java index 1607387f..a772e0bb 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockQRCodeTextController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockQRCodeTextController.java @@ -37,6 +37,7 @@ import com.glxp.api.admin.service.inventory.StockPrintTempService; import com.glxp.api.admin.thread.IoTransInoutService; import com.glxp.api.admin.thread.JaspaperService; import com.glxp.api.admin.util.CustomUtil; +import com.glxp.api.admin.util.FileUtils; import com.glxp.api.admin.util.JasperUtils; import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; @@ -52,6 +53,7 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -170,6 +172,9 @@ public class StockQRCodeTextController { if (printEntities.size() > 1000) { //如果标签打印数据大于1000,则切割生成多个文件 + if (!FileUtils.isFileExist(dirPath + "/pdfprint")) { + new File(dirPath + "/pdfprint").mkdirs(); + } List> splits = CustomUtil.splitList(printEntities, 100); int index = 0; List stockPrintTempEntities = new ArrayList<>(); @@ -257,7 +262,9 @@ public class StockQRCodeTextController { printEntities.add(stockPrintEntity); } } - + if (!FileUtils.isFileExist(dirPath + "/pdfprint")) { + new File(dirPath + "/pdfprint").mkdirs(); + } List> splits = CustomUtil.splitList(printEntities, 100); int index = 0; List stockPrintTempEntities = new ArrayList<>(); 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 f44977e5..b0475f73 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 @@ -553,14 +553,20 @@ public class OrderDetailController { erpOrderEntity.setInvWarehouseCode(purchaseinResponse.getInvWarehouseCode()); erpOrderEntity.setLocStorageCode(purchaseinResponse.getLocStorageCode()); erpOrderEntity.setGoodsunit(subPurchase.getSpec()); + erpOrderEntity.setBillType(purchaseinResponse.getBillType()); erpOrderEntity.setBindRlFk(subPurchase.getRelId()); erpOrderEntities.add(erpOrderEntity); } } } if (erpOrderEntities != null && erpOrderEntities.size() > 0) { - AuthAdmin authAdmin = customerService.getUserBean(); + OrderFilterRequest orderFilterRequest = new OrderFilterRequest(); + orderFilterRequest.setId(importErpOrderRequest.getOrderId()); + OrderEntity orderEntity = orderService.findOne(orderFilterRequest); + orderEntity.setReviewUser(authAdmin.getId().intValue()); + BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(orderEntity.getAction()); + ErpOrderEntity temp = erpOrderEntities.get(0); for (int i = 0; i < erpOrderEntities.size(); i++) { if (!temp.getCompanyname().equals(erpOrderEntities.get(i).getCompanyname())) { @@ -575,12 +581,15 @@ public class OrderDetailController { if (!temp.getInvWarehouseCode().equals(erpOrderEntities.get(i).getInvWarehouseCode())) { return ResultVOUtils.error(500, "所选业务单据当前分库不一致!"); } + + if (!bussinessTypeEntity.getLocalAction().equals(erpOrderEntities.get(i).getBillType())) { + return ResultVOUtils.error(500, "所选单据类型不一致!"); + } + + } - OrderFilterRequest orderFilterRequest = new OrderFilterRequest(); - orderFilterRequest.setId(importErpOrderRequest.getOrderId()); - OrderEntity orderEntity = orderService.findOne(orderFilterRequest); - orderEntity.setReviewUser(authAdmin.getId().intValue()); + ErpOrderEntity exitErp = new ContrastErpUtil().vailErpExit(orderDetailService, erpOrderEntities, importErpOrderRequest.getOrderId()); if (exitErp != null) { String errMsg = "所选业务单据" + exitErp.getErpOrderId() + "已被其他出入库单" + exitErp.getOrderIdFk() + "绑定"; 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 eb2ed96c..8f09be01 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 @@ -60,7 +60,7 @@ public class ErpOrderEntity { private String locStorageCode; private String invWarehouseCode;//当前分库 private String fromSubInvCode; //往来分库 - + private String billType; public Integer getBindStatus() { if (bindStatus == null) diff --git a/api-admin/src/main/java/com/glxp/api/admin/req/business/StockOrderFilterRequest.java b/api-admin/src/main/java/com/glxp/api/admin/req/business/StockOrderFilterRequest.java index 7a832a8a..667e484b 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/req/business/StockOrderFilterRequest.java +++ b/api-admin/src/main/java/com/glxp/api/admin/req/business/StockOrderFilterRequest.java @@ -37,5 +37,6 @@ public class StockOrderFilterRequest extends ListPageRequest { private Integer unionUser; private String entrustUser; private boolean entrustEnd; + private String localAction; } diff --git a/api-admin/src/main/resources/mybatis/mapper/auth/AuthAdminDao.xml b/api-admin/src/main/resources/mybatis/mapper/auth/AuthAdminDao.xml index 4c00dc44..e995405a 100644 --- a/api-admin/src/main/resources/mybatis/mapper/auth/AuthAdminDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/auth/AuthAdminDao.xml @@ -89,7 +89,7 @@ #{createTime}, #{userFlag,jdbcType=INTEGER}, #{lastModifyTime}, - #{employeeName},#{locInvCode},#{locSubInvCode})) + #{employeeName},#{locInvCode},#{locSubInvCode}) diff --git a/api-admin/src/main/resources/mybatis/mapper/business/StockOrderDao.xml b/api-admin/src/main/resources/mybatis/mapper/business/StockOrderDao.xml index ec4c4f1e..6fcc5c1c 100644 --- a/api-admin/src/main/resources/mybatis/mapper/business/StockOrderDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/business/StockOrderDao.xml @@ -141,7 +141,7 @@ and statusInfo = #{statusInfo} - and type = #{type} + and `type` = #{type} and sourceType = #{sourceType} @@ -149,10 +149,14 @@ and printStatus = #{printStatus} + + and billType = #{localAction} + and unitIdFk = #{unitIdFk} + and (invWarehouseCode in (select code from inv_warehouse_user WHERE userId =#{userId}) or invWarehouseCode is null or