Browse Source

[feat] 采购订单 品质

修改 计算品质不合格数量的后端接口,加上条件如果没有不合格数,就不会计算不合格数量
去掉前端必须选择一条不合格分类的条件
dev
liuxiaoxu 4 months ago
parent
commit
8a44f2b5bd
  1. 6
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderReportServiceImpl.java
  2. 8
      ruoyi-admin/src/main/resources/templates/quality/qualityOrder/qualityOrderReport.html

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

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

Loading…
Cancel
Save