From 8a44f2b5bd4805fde258a245fff0a5bb73228094 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Fri, 12 Jul 2024 15:37:52 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=20=E5=93=81=E8=B4=A8=20=E4=BF=AE=E6=94=B9=20=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E5=93=81=E8=B4=A8=E4=B8=8D=E5=90=88=E6=A0=BC=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E7=9A=84=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=8A=A0?= =?UTF-8?q?=E4=B8=8A=E6=9D=A1=E4=BB=B6=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E4=B8=8D=E5=90=88=E6=A0=BC=E6=95=B0=EF=BC=8C=E5=B0=B1=E4=B8=8D?= =?UTF-8?q?=E4=BC=9A=E8=AE=A1=E7=AE=97=E4=B8=8D=E5=90=88=E6=A0=BC=E6=95=B0?= =?UTF-8?q?=E9=87=8F=20=E5=8E=BB=E6=8E=89=E5=89=8D=E7=AB=AF=E5=BF=85?= =?UTF-8?q?=E9=A1=BB=E9=80=89=E6=8B=A9=E4=B8=80=E6=9D=A1=E4=B8=8D=E5=90=88?= =?UTF-8?q?=E6=A0=BC=E5=88=86=E7=B1=BB=E7=9A=84=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/QualityOrderReportServiceImpl.java | 6 +++++- .../quality/qualityOrder/qualityOrderReport.html | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderReportServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderReportServiceImpl.java index 5c49c6ee..ffae4fbb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderReportServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderReportServiceImpl.java @@ -162,7 +162,11 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService // } //计算不良数量的合计值 - int processBadNumTotal = unqualifiedDataList.stream().mapToInt(QualityOrderReportUnqualified::getProcessBadNum).sum(); + + int processBadNumTotal = 0; + if (!CollectionUtils.isEmpty(unqualifiedDataList)){ + processBadNumTotal = unqualifiedDataList.stream().mapToInt(QualityOrderReportUnqualified::getProcessBadNum).sum(); + } //后续处理本次到货数 // if (processBadNumTotal>thisArrivedNum){ diff --git a/ruoyi-admin/src/main/resources/templates/quality/qualityOrder/qualityOrderReport.html b/ruoyi-admin/src/main/resources/templates/quality/qualityOrder/qualityOrderReport.html index d5fe67da..af3206a2 100644 --- a/ruoyi-admin/src/main/resources/templates/quality/qualityOrder/qualityOrderReport.html +++ b/ruoyi-admin/src/main/resources/templates/quality/qualityOrder/qualityOrderReport.html @@ -120,10 +120,10 @@ // 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据 var table = $('#bootstrap-unqualified-table').bootstrapTable('getData'); // 检查表格数据是否为空 - if (table.length === 0) { - $.modal.alertWarning("请至少添加一条不合格数再保存!"); - return; - } + // if (table.length === 0) { + // $.modal.alertWarning("请至少添加一条不合格数再保存!"); + // return; + // } console.log(JSON.stringify(table)); // 将表数据转换成与qualityReportData格式一致的数组 var unqualifiedDataList = table.map(function (item) {