From d7001b28850f98c06a077d59d637103b2100dba5 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期二, 17 三月 2026 11:13:40 +0800
Subject: [PATCH] fix: 调整定时任务时间、移除反射获取同步日期、物料类型同步数据存在类型不对应问题、新增更新修改为批次保存
---
src/main/java/com/ruoyi/production/service/impl/ProductOrderServiceImpl.java | 36 +++++++++++++++++++++++++++++++++++-
1 files changed, 35 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/ruoyi/production/service/impl/ProductOrderServiceImpl.java b/src/main/java/com/ruoyi/production/service/impl/ProductOrderServiceImpl.java
index 8a1099c..57800e6 100644
--- a/src/main/java/com/ruoyi/production/service/impl/ProductOrderServiceImpl.java
+++ b/src/main/java/com/ruoyi/production/service/impl/ProductOrderServiceImpl.java
@@ -15,10 +15,15 @@
import com.ruoyi.production.mapper.*;
import com.ruoyi.production.pojo.*;
import com.ruoyi.production.service.ProductOrderService;
+import com.ruoyi.productionPlan.mapper.ProductOrderPlanMapper;
+import com.ruoyi.productionPlan.mapper.ProductionPlanMapper;
+import com.ruoyi.productionPlan.pojo.ProductOrderPlan;
+import com.ruoyi.productionPlan.pojo.ProductionPlan;
import com.ruoyi.quality.mapper.QualityInspectMapper;
import com.ruoyi.quality.pojo.QualityInspect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.time.LocalDate;
@@ -51,6 +56,12 @@
private ProductionProductMainMapper productionProductMainMapper;
@Autowired
+ private ProductOrderPlanMapper productOrderPlanMapper;
+
+ @Autowired
+ private ProductionPlanMapper productionPlanMapper;
+
+ @Autowired
private ProductionProductOutputMapper productionProductOutputMapper;
@Autowired
@@ -66,7 +77,7 @@
private StockUtils stockUtils;
@Override
- public IPage<ProductOrderDto> pageProductOrder(Page page, ProductOrderDto productOrder) {
+ public IPage<ProductOrderDto> pageProductOrder(Page<ProductOrder> page, ProductOrderDto productOrder) {
return productOrderMapper.pageProductOrder(page, productOrder);
}
@@ -123,6 +134,29 @@
}
@Override
+ @Transactional(rollbackFor = Exception.class)
+ public Boolean revoke(ProductOrder productOrder) {
+ // todo 鍒ゆ柇鏄惁浜х敓鎶ュ伐淇℃伅
+
+ // 鏌ヨ鍚堝苟鐨勭敓浜ц鍒�
+ List<ProductOrderPlan> productOrderPlans = productOrderPlanMapper.selectList(Wrappers.<ProductOrderPlan>lambdaQuery().in(ProductOrderPlan::getProductOrderId, productOrder.getId()));
+ if (productOrderPlans.isEmpty()) {
+ throw new RuntimeException("鍚堝苟鐨勭敓浜ц鍒掍笉瀛樺湪");
+ }
+ for (ProductOrderPlan productOrderPlan : productOrderPlans) {
+ ProductionPlan productionPlan = productionPlanMapper.selectById(productOrderPlan.getProductionPlanId());
+ productionPlan.setAssignedQuantity(productionPlan.getAssignedQuantity().subtract(productOrderPlan.getAssignedQuantity()));
+ productionPlanMapper.updateById(productionPlan);
+ }
+ // 鍒犻櫎鍏宠仈鍏崇郴
+ productOrderPlanMapper.delete(Wrappers.<ProductOrderPlan>lambdaQuery().in(ProductOrderPlan::getProductOrderId, productOrder.getId()));
+ // 鍒犻櫎璁㈠崟
+ productOrderMapper.deleteById(productOrder.getId());
+ // todo 鍒犻櫎璁㈠崟涓嬬殑宸ヨ壓璺嚎瀛愯〃
+ return null;
+ }
+
+ @Override
public List<ProcessRoute> listProcessRoute(Long productModelId) {
return productOrderMapper.listProcessRoute(productModelId);
}
--
Gitblit v1.9.3