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) {