diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/inout/WareHouseController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/inout/WareHouseController.java index 76e7d7f1..2fca92bd 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/inout/WareHouseController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/inout/WareHouseController.java @@ -674,6 +674,15 @@ public class WareHouseController { if (invProductDetailEntity == null) { return ResultVOUtils.error(500, "预验收库存未存在此产品!"); } else { + + + if (StrUtil.isNotEmpty(invProductDetailEntity.getBatchNo()) && StrUtil.isNotEmpty(addOrderRequest.getBatchNo()) + && !invProductDetailEntity.getBatchNo().equals(addOrderRequest.getBatchNo())) { + return ResultVOUtils.error(500, "当前批次号与预验收录入批次号不匹配!"); + + } + + if (StrUtil.isNotEmpty(orderId)) {//非首次添加 if (StrUtil.isEmpty(udiEntity.getSerialNo())) {//该单据已有该产品 WarehouseQueryRequest warehouseQueryRequest = new WarehouseQueryRequest(); diff --git a/api-admin/src/main/java/com/glxp/api/admin/entity/business/StockOrderPrintEntity.java b/api-admin/src/main/java/com/glxp/api/admin/entity/business/StockOrderPrintEntity.java index 85331dff..7f17d023 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/entity/business/StockOrderPrintEntity.java +++ b/api-admin/src/main/java/com/glxp/api/admin/entity/business/StockOrderPrintEntity.java @@ -46,4 +46,5 @@ public class StockOrderPrintEntity extends StockOrderDetailEntity { private String remark2; private String remark3; private String manufactory; + private String spmc; } diff --git a/api-admin/src/main/java/com/glxp/api/admin/thread/InvProductsTrService.java b/api-admin/src/main/java/com/glxp/api/admin/thread/InvProductsTrService.java index b6bec184..f0555f53 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/thread/InvProductsTrService.java +++ b/api-admin/src/main/java/com/glxp/api/admin/thread/InvProductsTrService.java @@ -159,12 +159,15 @@ public class InvProductsTrService { int count = actCount * warehouseEntity.getCount(); InvProductEntity preInvEntity = invPreInProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(), warehouseEntity.getSupId(), null, null); - if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { - preInvEntity.setOutCount(preInvEntity.getOutCount() + count); - } - if (erpOrderEntity.getPrice() != null) { - preInvEntity.setPrice(erpOrderEntity.getPrice() + ""); + if (preInvEntity != null) { + if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { + preInvEntity.setOutCount(preInvEntity.getOutCount() + count); + } + if (erpOrderEntity.getPrice() != null) { + preInvEntity.setPrice(erpOrderEntity.getPrice() + ""); + } } + invPreInProductService.updateInvProduct(preInvEntity); } 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 6fcc5c1c..649058a8 100644 --- a/api-admin/src/main/resources/mybatis/mapper/business/StockOrderDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/business/StockOrderDao.xml @@ -267,13 +267,18 @@ stock_order_detail.batchNo, stock_order_detail.productDate, stock_order_detail.expireDate, stock_order_detail.count, stock_order_detail.sweepCount, stock_order_detail.ylqxzcrbarmc,stock_order_detail.manufactory, - stock_order_detail.zczbhhzbapzbh,stock_order_detail.price,inv_warehouse.name locInv FROM stock_order INNER JOIN + stock_order_detail.zczbhhzbapzbh,stock_order_detail.price,inv_warehouse.name locInv + ,productinfo.spmc + FROM stock_order INNER JOIN stock_order_detail on stock_order.id = stock_order_detail.orderIdFk LEFT JOIN inv_warehouse ON stock_order.locStorageCode = inv_warehouse.`code` LEFT JOIN inv_warehouse_sub ON inv_warehouse_sub.parentId = inv_warehouse.`code` LEFT JOIN inv_warehouse_user on inv_warehouse_sub.code = inv_warehouse_user.`code` + left join basic_udirel on stock_order_detail.productId = basic_udirel.id + INNER JOIN basic_products on basic_products.uuid = basic_udirel.uuid + INNER JOIN productinfo on productinfo.uuid = basic_products.originUuid and stock_order.id =#{id} diff --git a/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreInProductDao.xml b/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreInProductDao.xml index e242ee91..7204ffcf 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreInProductDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreInProductDao.xml @@ -119,7 +119,7 @@ ,inv_prein_product.reCount,inv_prein_product.customerId, basic_corp.name companyName,inv_prein_product.supId,inv_prein_product.unitFk ,inv_warehouse.name invStorageName,inv_prein_product.invStorageCode,inv_prein_product.price,inv_warehouse_sub.name invSubStorageName - ,inv_product.invWarehouseCode + ,inv_prein_product.invWarehouseCode FROM inv_prein_product inner join basic_udirel on inv_prein_product.relIdFk = basic_udirel.id inner join basic_products on basic_udirel.uuid = basic_products.uuid