From 86d777aff8412b49fa83f51a1d9e0524e58f6059 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期三, 18 三月 2026 14:31:13 +0800
Subject: [PATCH] fix: 删除生产订单未回退下发数量与更新下发状态
---
src/main/java/com/ruoyi/productionPlan/service/impl/ProductionPlanServiceImpl.java | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/ruoyi/productionPlan/service/impl/ProductionPlanServiceImpl.java b/src/main/java/com/ruoyi/productionPlan/service/impl/ProductionPlanServiceImpl.java
index 698199c..1444f36 100644
--- a/src/main/java/com/ruoyi/productionPlan/service/impl/ProductionPlanServiceImpl.java
+++ b/src/main/java/com/ruoyi/productionPlan/service/impl/ProductionPlanServiceImpl.java
@@ -14,6 +14,7 @@
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.config.AliDingConfig;
import com.ruoyi.framework.util.AliDingUtils;
+import com.ruoyi.production.enums.ProductOrderStatusEnum;
import com.ruoyi.production.pojo.ProductMaterialSku;
import com.ruoyi.production.pojo.ProductOrder;
import com.ruoyi.production.service.ProductMaterialService;
@@ -122,8 +123,8 @@
}
// 鏍¢獙鏄惁瀛樺湪涓嶅悓鐨勪骇鍝佽鏍�
- String firstProductSpec = plans.get(0).getSpecification();
- if (plans.stream().anyMatch(p -> p.getSpecification() == null || !p.getSpecification().equals(firstProductSpec))) {
+ String firstProductSpec = plans.get(0).getModel();
+ if (plans.stream().anyMatch(p -> p.getModel() == null || !p.getModel().equals(firstProductSpec))) {
throw new BaseException("鍚堝苟澶辫触锛屽瓨鍦ㄤ笉鍚岀殑浜у搧瑙勬牸");
}
@@ -141,6 +142,7 @@
ProductOrder productOrder = new ProductOrder();
productOrder.setQuantity(productionPlanDto.getTotalAssignedQuantity());
productOrder.setPlanCompleteTime(productionPlanDto.getPlanCompleteTime());
+ productOrder.setStatus(ProductOrderStatusEnum.WAIT.getCode());
productOrderService.addProductOrder(productOrder);
// 鏍规嵁涓嬪彂鏁伴噺锛屼粠绗竴涓敓浜ц鍒掑紑濮嬪垎閰嶆柟鏁�
@@ -164,10 +166,10 @@
// 鏈�鍚庝竴涓鍒掞紝鍒嗛厤鍓╀綑鏂规暟
BigDecimal lastRemainingVolume = productionPlanDto.getTotalAssignedQuantity().subtract(assignedVolume);
plan.setStatus(1);
- if (lastRemainingVolume.compareTo(BigDecimal.ZERO) <= 0) {
+ plan.setAssignedQuantity(plan.getAssignedQuantity().add(lastRemainingVolume));
+ if (plan.getAssignedQuantity().compareTo(plan.getVolume()) >= 0) {
plan.setStatus(2);
}
- plan.setAssignedQuantity(plan.getAssignedQuantity().add(lastRemainingVolume));
productOrderPlan.setAssignedQuantity(lastRemainingVolume);
productionPlanMapper.updateById(plan);
productOrderPlanMapper.insert(productOrderPlan);
--
Gitblit v1.9.3