From e275e91030a13f5627e21e7e44d308cee78fb31c Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期五, 28 十一月 2025 11:04:40 +0800
Subject: [PATCH] 原材料报检:同一批次号不是第一次报检,企业微信通知格式调整 原材料下单:待下单的订单批次号重复的高亮显示
---
inspect-server/src/main/java/com/ruoyi/inspect/service/impl/RawMaterialOrderServiceImpl.java | 45 ++++++++++++++++++++++++++++++++++++---------
1 files changed, 36 insertions(+), 9 deletions(-)
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/RawMaterialOrderServiceImpl.java b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/RawMaterialOrderServiceImpl.java
index 50a5633..f95862f 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/RawMaterialOrderServiceImpl.java
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/RawMaterialOrderServiceImpl.java
@@ -50,6 +50,7 @@
import com.ruoyi.inspect.service.RawMaterialOrderService;
import com.ruoyi.common.numgen.NumberGenerator;
import com.ruoyi.framework.exception.ErrorException;
+import com.ruoyi.basic.vo.IfsInventoryQuantityVO;
import com.ruoyi.performance.mapper.AuxiliaryOutputWorkingHoursMapper;
import com.ruoyi.performance.pojo.AuxiliaryOutputWorkingHours;
import com.ruoyi.system.mapper.UserMapper;
@@ -146,8 +147,15 @@
}
@Override
- public IPage<IfsInventoryQuantity> getWarehouseSubmit(IPage<IfsInventoryQuantity> page, IfsInventoryQuantity ifsInventoryQuantity) {
- return standardTreeMapper.selectIfsPage(page, QueryWrappers.queryWrappers(ifsInventoryQuantity));
+ public IPage<IfsInventoryQuantityVO> getWarehouseSubmit(IPage<IfsInventoryQuantity> page, IfsInventoryQuantity ifsInventoryQuantity) {
+ IPage<IfsInventoryQuantityVO> ifsInventoryQuantityIPage = standardTreeMapper.selectIfsPage(page, QueryWrappers.queryWrappers(ifsInventoryQuantity));
+ ifsInventoryQuantityIPage.getRecords().forEach(f->{
+ Long count = ifsInventoryQuantityMapper.selectCount(Wrappers.<IfsInventoryQuantity>lambdaQuery()
+ .ne(IfsInventoryQuantity::getId,f.getId())
+ .eq(IfsInventoryQuantity::getUpdateBatchNo, f.getUpdateBatchNo()));
+ f.setLotBatchNoHasRepeat(count>0);
+ });
+ return ifsInventoryQuantityIPage;
}
@Override
@@ -241,13 +249,32 @@
threadPoolTaskExecutor.execute(() -> {
IfsInventoryQuantity inventoryQuantity = ifsInventoryQuantityMapper.selectById(ifsInventoryQuantity.getId());
- // 浼佷笟寰俊閫氱煡
- String message = "";
- message += "鏂板鎶ユ閫氱煡";
- message += "\n鎵规鍙�: " + inventoryQuantity.getUpdateBatchNo();
- message += "\n闆朵欢鎻忚堪: " + inventoryQuantity.getPartDesc();
- message += "\n鎶佃揪鏁伴噺: " + inventoryQuantity.getQtyArrived().stripTrailingZeros().toPlainString() + inventoryQuantity.getBuyUnitMeas();
- WxCpUtils.informWebHook(wechatProperty.getExaminingUrl(), message);
+ //鏌ヨ鐩稿悓鎵瑰彿鐨勫巻鍙瞚fs璁㈠崟
+ List<IfsInventoryQuantity> historyRecords = ifsInventoryQuantityMapper.selectList(Wrappers.<IfsInventoryQuantity>lambdaQuery()
+ .ne(IfsInventoryQuantity::getId, ifsInventoryQuantity.getId())
+ .eq(IfsInventoryQuantity::getIsInspect, 1)
+ .eq(IfsInventoryQuantity::getUpdateBatchNo, ifsInventoryQuantity.getUpdateBatchNo())
+ );
+ if(CollUtil.isEmpty(historyRecords)){
+ // 浼佷笟寰俊閫氱煡
+ String message = "";
+ message += "鏂板鎶ユ閫氱煡";
+ message += "\n鎵规鍙�: " + inventoryQuantity.getUpdateBatchNo();
+ message += "\n闆朵欢鎻忚堪: " + inventoryQuantity.getPartDesc();
+ message += "\n鎶佃揪鏁伴噺: " + inventoryQuantity.getQtyArrived().stripTrailingZeros().toPlainString() + inventoryQuantity.getBuyUnitMeas();
+ WxCpUtils.informWebHook(wechatProperty.getExaminingUrl(), message);
+ }else{
+ //鑾峰彇鍘嗗彶鎶佃揪鏁伴噺
+ double sum = historyRecords.stream().map(IfsInventoryQuantity::getQtyArrived).mapToDouble(BigDecimal::doubleValue).sum();
+ String historyQuantity = sum + inventoryQuantity.getBuyUnitMeas();
+ String messageMarkdown = "";
+ messageMarkdown += "鏂板鎶ユ閫氱煡";
+ messageMarkdown += "\n鎵规鍙�: <font color='warning'>" + inventoryQuantity.getUpdateBatchNo() + "</font>";
+ messageMarkdown += "\n闆朵欢鎻忚堪: "+ inventoryQuantity.getPartDesc();
+ messageMarkdown += "\n鎶佃揪鏁伴噺: " + inventoryQuantity.getQtyArrived().stripTrailingZeros().toPlainString() + inventoryQuantity.getBuyUnitMeas();
+ messageMarkdown += "\n鍘嗗彶鎶佃揪鏁伴噺: " + historyQuantity;
+ WxCpUtils.informWebHook(wechatProperty.getExaminingUrl(), messageMarkdown,"markdown");
+ }
});
return 1;
}
--
Gitblit v1.9.3