From 539ca9d539f40d7bf373ca72d449baff8b4fc1cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=99=93=E8=BF=AA?= <2596750866@qq.com> Date: Fri, 22 Nov 2024 09:01:49 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E5=93=81=E8=B4=A8=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E5=93=81=E8=B4=A8=E5=8D=95=20=E5=8E=BB=E9=99=A4=E5=93=81?= =?UTF-8?q?=E8=B4=A8=E5=8D=95service=E6=96=B9=E6=B3=95=E4=B8=AD=E6=9C=89?= =?UTF-8?q?=E5=85=B3=E5=AD=97=E6=AE=B5=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/QualityOrderServiceImpl.java | 44 ++++--------------- 1 file changed, 8 insertions(+), 36 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderServiceImpl.java index 5f46bac4..41627e35 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderServiceImpl.java @@ -11,6 +11,7 @@ import com.ruoyi.common.utils.StringUtils; import com.ruoyi.erp.domain.ErpDevelopModifyorder; import com.ruoyi.erp.mapper.ErpDevelopModifyorderMapper; import com.ruoyi.quality.domain.*; +import com.ruoyi.quality.domain.VO.QualityOrderReportVO; import com.ruoyi.quality.mapper.*; import com.ruoyi.quality.service.IQualityOrderReportService; import com.ruoyi.warehouse.domain.WarehouseStorageOrder; @@ -167,8 +168,6 @@ public class QualityOrderServiceImpl implements IQualityOrderService Integer qualityUnqualifiedNumSum = 0; // 检查thisArrivedNum是否含有null值 - boolean hasThisArrivedNumNull = qualityOrderDetailList.stream() - .anyMatch(item -> item.getThisArrivedNum() == null); // 检查qualityQualifiedNum是否含有null值 boolean hasQualityQualifiedNumNull = qualityOrderDetailList.stream() @@ -178,9 +177,6 @@ public class QualityOrderServiceImpl implements IQualityOrderService boolean hasQualityUnqualifiedNumNull = qualityOrderDetailList.stream() .anyMatch(item -> item.getQualityUnqualifiedNum() == null); - if (hasThisArrivedNumNull) { - throw new BusinessException("存在本次到货数为空,请检查!"); - } if (hasQualityQualifiedNumNull) { throw new BusinessException("存在品质合格数为空,请检查!"); } @@ -188,9 +184,7 @@ public class QualityOrderServiceImpl implements IQualityOrderService throw new BusinessException("存在品质不合格数为空,请检查!"); } // 计算各个字段的总和 - thisArrivedNumSum = qualityOrderDetailList.stream() - .mapToInt(QualityOrderDetail::getThisArrivedNum) - .sum(); + qualityQualifiedNumSum = qualityOrderDetailList.stream() .mapToInt(QualityOrderDetail::getQualityQualifiedNum) @@ -410,7 +404,7 @@ public class QualityOrderServiceImpl implements IQualityOrderService storageOrderDetail.setMaterialProcessMethod(detail.getMaterialProcessMethod()); storageOrderDetail.setMaterialUnit(detail.getMaterialUnit()); storageOrderDetail.setMakeTotal(detail.getMakeTotal()); - storageOrderDetail.setActualArriveNum(detail.getActualArriveNum()); + storageOrderDetail.setActualArriveNum(detail.getQualityQualifiedNum()); storageOrderDetail.setQualityQualifiedNum(detail.getQualityQualifiedNum()); storageOrderDetail.setQualityHasQualifiedNum(detail.getQualityHasqualifiedNum()); storageOrderDetail.setRefundsExchangesNum(detail.getQualityUnqualifiedNum()); @@ -616,8 +610,7 @@ public class QualityOrderServiceImpl implements IQualityOrderService Integer qualityUnqualifiedNumSum = 0; // 检查thisArrivedNum是否含有null值 - boolean hasThisArrivedNumNull = qualityOrderDetailList.stream() - .anyMatch(item -> item.getThisArrivedNum() == null); + // 检查qualityQualifiedNum是否含有null值 boolean hasQualityQualifiedNumNull = qualityOrderDetailList.stream() @@ -627,9 +620,7 @@ public class QualityOrderServiceImpl implements IQualityOrderService boolean hasQualityUnqualifiedNumNull = qualityOrderDetailList.stream() .anyMatch(item -> item.getQualityUnqualifiedNum() == null); - if (hasThisArrivedNumNull) { - throw new BusinessException("存在本次到货数为空,请检查!"); - } + if (hasQualityQualifiedNumNull) { throw new BusinessException("存在品质已合格数为空,请检查!"); } @@ -637,9 +628,6 @@ public class QualityOrderServiceImpl implements IQualityOrderService throw new BusinessException("存在品质不合格数为空,请检查!"); } // 计算各个字段的总和 - thisArrivedNumSum = qualityOrderDetailList.stream() - .mapToInt(QualityOrderDetail::getThisArrivedNum) - .sum(); qualityQualifiedNumSum = qualityOrderDetailList.stream() .mapToInt(QualityOrderDetail::getQualityQualifiedNum) @@ -730,8 +718,6 @@ public class QualityOrderServiceImpl implements IQualityOrderService Integer qualityUnqualifiedNumSum = 0; // 检查thisArrivedNum是否含有null值 - boolean hasThisArrivedNumNull = qualityOrderDetailList.stream() - .anyMatch(item -> item.getThisArrivedNum() == null); // 检查qualityQualifiedNum是否含有null值 boolean hasQualityQualifiedNumNull = qualityOrderDetailList.stream() @@ -741,9 +727,6 @@ public class QualityOrderServiceImpl implements IQualityOrderService boolean hasQualityUnqualifiedNumNull = qualityOrderDetailList.stream() .anyMatch(item -> item.getQualityUnqualifiedNum() == null); - if (hasThisArrivedNumNull) { - throw new BusinessException("存在本次到货数为空,请检查!"); - } if (hasQualityQualifiedNumNull) { throw new BusinessException("存在品质已合格数为空,请检查!"); } @@ -751,9 +734,6 @@ public class QualityOrderServiceImpl implements IQualityOrderService throw new BusinessException("存在品质不合格数为空,请检查!"); } // 计算各个字段的总和 - thisArrivedNumSum = qualityOrderDetailList.stream() - .mapToInt(QualityOrderDetail::getThisArrivedNum) - .sum(); qualityQualifiedNumSum = qualityOrderDetailList.stream() .mapToInt(QualityOrderDetail::getQualityQualifiedNum) @@ -880,8 +860,6 @@ public class QualityOrderServiceImpl implements IQualityOrderService Integer qualityUnqualifiedNumSum = 0; // 检查thisArrivedNum是否含有null值 - boolean hasThisArrivedNumNull = qualityOrderDetailList.stream() - .anyMatch(item -> item.getThisArrivedNum() == null); // 检查qualityQualifiedNum是否含有null值 boolean hasQualityQualifiedNumNull = qualityOrderDetailList.stream() @@ -891,9 +869,6 @@ public class QualityOrderServiceImpl implements IQualityOrderService boolean hasQualityUnqualifiedNumNull = qualityOrderDetailList.stream() .anyMatch(item -> item.getQualityUnqualifiedNum() == null); - if (hasThisArrivedNumNull) { - throw new BusinessException("存在本次到货数为空,请检查!"); - } if (hasQualityQualifiedNumNull) { throw new BusinessException("存在品质已合格数为空,请检查!"); } @@ -901,9 +876,6 @@ public class QualityOrderServiceImpl implements IQualityOrderService throw new BusinessException("存在品质不合格数为空,请检查!"); } // 计算各个字段的总和 - thisArrivedNumSum = qualityOrderDetailList.stream() - .mapToInt(QualityOrderDetail::getThisArrivedNum) - .sum(); qualityQualifiedNumSum = qualityOrderDetailList.stream() .mapToInt(QualityOrderDetail::getQualityQualifiedNum) @@ -969,12 +941,12 @@ public class QualityOrderServiceImpl implements IQualityOrderService //品质单报告表 private void insertQualityOrderReportByWarehouseStorageOrder(WarehouseStorageOrderDetail warehouseStorageOrderDetail,String qualityOrderCode) { - QualityOrderReport qualityOrderReport = new QualityOrderReport(); + QualityOrderReportVO qualityOrderReport = new QualityOrderReportVO(); //插入品质单报告开始品质单 qualityOrderReport.setSupplierCode(warehouseStorageOrderDetail.getSupplierCode()); qualityOrderReport.setQualityOrderCode(qualityOrderCode); //暂时生成品质单本来应该是实际到货数 prd有误暂时这样处理 - qualityOrderReport.setActualArriveNum(warehouseStorageOrderDetail.getActualArriveNum()); + qualityOrderReport.setCheckNum(warehouseStorageOrderDetail.getActualArriveNum()); qualityOrderReport.setSupplierName(warehouseStorageOrderDetail.getSupplierName()); qualityOrderReport.setMaterialNo(warehouseStorageOrderDetail.getMaterialNo()); qualityOrderReport.setMaterialName(warehouseStorageOrderDetail.getMaterialName()); @@ -1009,7 +981,7 @@ public class QualityOrderServiceImpl implements IQualityOrderService qualityOrderDetail.setMaterialUnit(warehouseStorageOrderDetail.getMaterialUnit()); qualityOrderDetail.setMaterialType(warehouseStorageOrderDetail.getMaterialType()); //暂时生成品质单本来应该是实际到货数 prd有误暂时这样处理 - qualityOrderDetail.setActualArriveNum(warehouseStorageOrderDetail.getActualArriveNum()); + qualityOrderDetail.setCheckNum(warehouseStorageOrderDetail.getActualArriveNum()); qualityOrderDetail.setSupplierCode(warehouseStorageOrderDetail.getSupplierCode()); qualityOrderDetail.setSupplierName(warehouseStorageOrderDetail.getSupplierName()); qualityOrderDetail.setSupplierAddress(warehouseStorageOrderDetail.getSupplierAddress());