From 83271be11e2b0c0f09254aacc70cf4e99578d92d Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期三, 17 十二月 2025 15:07:07 +0800
Subject: [PATCH] 巡检管理-定时任务记录返回dataStr 登记日期
---
src/main/java/com/ruoyi/production/service/impl/SalesLedgerSchedulingServiceImpl.java | 39 ++++++++++++++++++++++++++++++---------
1 files changed, 30 insertions(+), 9 deletions(-)
diff --git a/src/main/java/com/ruoyi/production/service/impl/SalesLedgerSchedulingServiceImpl.java b/src/main/java/com/ruoyi/production/service/impl/SalesLedgerSchedulingServiceImpl.java
index 873bd1d..11cfafa 100644
--- a/src/main/java/com/ruoyi/production/service/impl/SalesLedgerSchedulingServiceImpl.java
+++ b/src/main/java/com/ruoyi/production/service/impl/SalesLedgerSchedulingServiceImpl.java
@@ -25,6 +25,7 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@@ -65,6 +66,7 @@
salesLedgerWorkLambdaQueryWrapper.in(SalesLedgerWork::getSalesLedgerProductId, collect)
.ne(SalesLedgerWork::getStatus, 1);
List<SalesLedgerWork> salesLedgerWorks = salesLedgerWorkMapper.selectList(salesLedgerWorkLambdaQueryWrapper);
+ List<SalesLedgerSchedulingDto> list1 = new ArrayList<>();
list.getRecords().forEach(i -> {
// 鑾峰彇瀹屾垚鏁伴噺
i.setSuccessNum(salesLedgerWorks
@@ -72,14 +74,7 @@
.filter(j -> j.getSalesLedgerProductId().equals(i.getSalesLedgerProductId()))
.map(SalesLedgerWork::getFinishedNum)
.reduce(BigDecimal.ZERO, BigDecimal::add));
- // 鐘舵�� = 鏁伴噺鍜屽畬宸ユ暟閲忔瘮杈�
- if(i.getSchedulingNum().compareTo(new BigDecimal(0)) == 0){
- i.setStatus("鏈畬鎴�");
- } else if(i.getSchedulingNum().compareTo(i.getSuccessNum()) == 0){
- i.setStatus("宸插畬鎴�");
- }else{
- i.setStatus("鐢熶骇涓�");
- }
+
// 璁$畻鐢熶骇鎬婚噺 = 瑙勬牸 * 鏁伴噺 / 1000
String[] split = i.getSpecificationModel().split("\\*");
if(split.length == 2 && isNumeric(split[0]) && isNumeric(split[1])){
@@ -87,6 +82,15 @@
.multiply(new BigDecimal(split[1])
.multiply(i.getQuantity()).divide(new BigDecimal(1000),2, RoundingMode.CEILING));
i.setTotalProduction(multiply);
+ }
+
+ // 鐘舵�� = 鏁伴噺鍜屽畬宸ユ暟閲忔瘮杈�
+ if(i.getSchedulingNum().compareTo(new BigDecimal(0)) == 0){
+ i.setStatus("鏈畬鎴�");
+ } else if(i.getQuantity().compareTo(i.getSchedulingNum()) <= 0){
+ i.setStatus("宸插畬鎴�");
+ }else{
+ i.setStatus("鐢熶骇涓�");
}
});
@@ -186,10 +190,26 @@
i++;
continue;
}
+ String productionLine = "";
+ switch (name.get()){
+ case "鐐掓満1":
+ productionLine = "浜х嚎1";
+ break;
+ case "鐐掓満2":
+ productionLine = "浜х嚎2";
+ break;
+ case "鐐掓満3":
+ productionLine = "浜х嚎3";
+ break;
+ case "鐐掓満4":
+ productionLine = "浜х嚎4";
+ break;
+ }
SalesLedgerScheduling salesLedgerScheduling = SalesLedgerScheduling.builder()
.salesLedgerId(productionDispatchAddDto.getSalesLedgerId())
.salesLedgerProductId(productionDispatchAddDto.getSalesLedgerProductId())
.speculativeTradingName(name.get())
+ .productionLine(productionLine)
.schedulingUserId(sysUser.getUserId())
.schedulingUserName(sysUser.getNickName())
.schedulingNum(productionDispatchAddDto.getSchedulingNum())
@@ -242,7 +262,7 @@
return new BigDecimal(totalNum.get()).multiply(new BigDecimal(100)).divide(lossNum, 2,RoundingMode.HALF_UP);
}
- private LossMapper lossMapper;
+ private final LossMapper lossMapper;
/**
@@ -338,6 +358,7 @@
.salesLedgerSchedulingId(salesLedgerScheduling.getId())
.salesLedgerId(salesLedgerScheduling.getSalesLedgerId())
.remark(processSchedulingDto.getRemark())
+ .productionLine(processSchedulingDto.getProductionLine())
.type(processSchedulingDto.getType())
.loss(processSchedulingDto.getLoss())
.receive(processSchedulingDto.getReceive())
--
Gitblit v1.9.3