From fc24827d4eb7b15c28a184123376eb758d93a9ad Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期五, 10 四月 2026 17:25:30 +0800
Subject: [PATCH] feat: 生产计划导入验证产品是否存在、申请单编号重复、强度是否正确
---
src/main/java/com/ruoyi/production/service/impl/ProductionRecordServiceImpl.java | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/ruoyi/production/service/impl/ProductionRecordServiceImpl.java b/src/main/java/com/ruoyi/production/service/impl/ProductionRecordServiceImpl.java
index 0289e84..bdb6596 100644
--- a/src/main/java/com/ruoyi/production/service/impl/ProductionRecordServiceImpl.java
+++ b/src/main/java/com/ruoyi/production/service/impl/ProductionRecordServiceImpl.java
@@ -202,8 +202,18 @@
throw new ServiceException("鎶ュ伐澶辫触,鐢熶骇璁㈠崟涓嶅瓨鍦�");
}
- // 褰撳墠鎶ュ伐鍚堟牸鏁伴噺锛堝墠绔凡淇濊瘉 = 鎶曞叆鏁伴噺 - 涓嶅悎鏍兼暟閲忥紝鐩存帴浣跨敤锛�
+ // 褰撳墠鎶ュ伐鍚堟牸鏁伴噺
BigDecimal qualifiedQty = dto.getQualifiedQuantity() == null ? BigDecimal.ZERO : dto.getQualifiedQuantity();
+ BigDecimal unqualifiedQty = dto.getUnqualifiedQuantity() == null ? BigDecimal.ZERO : dto.getUnqualifiedQuantity();
+ BigDecimal totalReportQty = dto.getQuantity() == null ? BigDecimal.ZERO : dto.getQuantity();
+
+ if (qualifiedQty.compareTo(BigDecimal.ZERO) < 0 || unqualifiedQty.compareTo(BigDecimal.ZERO) < 0 || totalReportQty.compareTo(BigDecimal.ZERO) < 0) {
+ throw new ServiceException("鎶ュ伐澶辫触锛氬悎鏍兼暟閲忋�佷笉鍚堟牸鏁伴噺鎴栨�绘暟閲忎笉鑳戒负璐熸暟");
+ }
+
+ if (qualifiedQty.add(unqualifiedQty).compareTo(totalReportQty) != 0) {
+ throw new ServiceException("鎶ュ伐澶辫触锛氬悎鏍兼暟閲忎笌涓嶅悎鏍兼暟閲忎箣鍜屽繀椤荤瓑浜庢�绘姤宸ユ暟閲�");
+ }
// 璁㈠崟宸插畬鎴愭暟閲忥紙鍘嗗彶绱锛�
BigDecimal completeQty = productOrder.getCompleteQuantity() == null ? BigDecimal.ZERO : productOrder.getCompleteQuantity();
// 闇�姹傛暟閲�
@@ -307,6 +317,8 @@
paramEntity.setValueMode(orderParam.getValueMode());
paramEntity.setUnit(orderParam.getUnit());
paramEntity.setStandardValue(orderParam.getStandardValue());
+ paramEntity.setMinValue(orderParam.getMinValue());
+ paramEntity.setMaxValue(orderParam.getMaxValue());
}
}
productionProductRouteItemParamService.save(paramEntity);
@@ -752,6 +764,9 @@
paramEntity.setParamFormat(orderParam.getParamFormat());
paramEntity.setValueMode(orderParam.getValueMode());
paramEntity.setUnit(orderParam.getUnit());
+ paramEntity.setStandardValue(orderParam.getStandardValue());
+ paramEntity.setMinValue(orderParam.getMinValue());
+ paramEntity.setMaxValue(orderParam.getMaxValue());
}
}
productionProductRouteItemParamService.save(paramEntity);
--
Gitblit v1.9.3