From 30ca7a8dc82a7cfadadb37d8e9e6b8e68be06f27 Mon Sep 17 00:00:00 2001
From: zhuo <2089219845@qq.com>
Date: 星期四, 08 五月 2025 13:06:51 +0800
Subject: [PATCH] 检验项添加抽样类型绑定
---
inspect-server/src/main/java/com/ruoyi/inspect/service/impl/RawMaterialOrderServiceImpl.java | 49 +++++++++++++++++++------------------------------
1 files changed, 19 insertions(+), 30 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 d3acb91..fb5bfdc 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
@@ -18,8 +18,9 @@
import com.ruoyi.basic.dto.*;
import com.ruoyi.basic.pojo.IfsInventoryQuantity;
import com.ruoyi.common.constant.InsOrderTypeConstants;
+import com.ruoyi.common.core.domain.Result;
import com.ruoyi.common.core.domain.entity.User;
-import com.ruoyi.common.properties.WechatProperty;
+import com.ruoyi.common.config.WechatProperty;
import com.ruoyi.common.utils.LimsDateUtil;
import com.ruoyi.common.utils.QueryWrappers;
import com.ruoyi.common.utils.SecurityUtils;
@@ -57,7 +58,6 @@
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
-import java.util.stream.Collectors;
/**
* @Author zhuo
@@ -82,35 +82,17 @@
@Override
- public RawMaterialStandardTreeDto selectStandardTreeListByPartNo(String partNo) {
- if (StringUtils.isBlank(partNo)) {
- throw new ErrorException("闆朵欢鍙蜂涪澶�");
- }
+ public Result selectStandardTreeListByPartNo(String partNo) {
List<FactoryDto> factoryDtos = standardTreeMapper.selectStandardTreeListByPartNo(partNo);
if (CollectionUtil.isEmpty(factoryDtos)) {
- throw new ErrorException("闆朵欢鍙蜂负" + partNo + "鐨勫師鏉愭枡娌℃湁瀵瑰簲鐨勬爣鍑嗗簱閰嶇疆");
+ return Result.success(null, "闆朵欢鍙蜂负" + partNo + "鐨勫師鏉愭枡娌℃湁瀵瑰簲鐨勬爣鍑嗗簱閰嶇疆");
}
RawMaterialStandardTreeDto rawMaterialStandardTreeDto = new RawMaterialStandardTreeDto();
- Set<String> sampleTypeValues = new HashSet<>();
for (FactoryDto factoryDto : factoryDtos) {
for (LaboratoryDto laboratoryDto : factoryDto.getChildren()) {
for (SampleTypeDto sampleTypeDto : laboratoryDto.getChildren()) {
if (sampleTypeDto.getChildren().size() == 0) {
- sampleTypeValues.add(sampleTypeDto.getValue());
- }
- }
- }
- }
- // 鎵归噺鏌ヨ鎵�鏈� sampleTypeDto 鐨勬暟鎹�
- List<SampleDto> standardList = standardTreeMapper.getStandardTree3Batch(sampleTypeValues);
- Map<String, List<SampleDto>> standardTreeMap = standardList.stream().collect(Collectors.groupingBy(SampleDto::getValue));
-
- for (FactoryDto factoryDto : factoryDtos) {
- for (LaboratoryDto laboratoryDto : factoryDto.getChildren()) {
- for (SampleTypeDto sampleTypeDto : laboratoryDto.getChildren()) {
- List<SampleDto> standardTreeList = standardTreeMap.get(sampleTypeDto.getValue());
- if (sampleTypeDto.getChildren().size() == 0) {
- sampleTypeDto.getChildren().addAll(standardTreeList);
+ sampleTypeDto.setChildren(standardTreeMapper.getStandardTree3(sampleTypeDto.getValue()));
}
// 鍒ゆ柇缁戝畾鐨勬槸鍚︽槸褰撳墠闆朵欢鍙�
if (sampleTypeDto.getPartNo() != null && sampleTypeDto.getPartNo().equals(partNo)) {
@@ -140,7 +122,7 @@
}
}
}
- return rawMaterialStandardTreeDto;
+ return Result.success(rawMaterialStandardTreeDto);
}
@Override
@@ -691,12 +673,19 @@
*/
@Override
public void rawAllExport(IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto, HttpServletResponse response) throws UnsupportedEncodingException {
- //鏌ヨ瀵煎嚭鐨勮垂鐢ㄧ粺璁℃暟鎹�
- String beginDeclareDate = ifsInventoryQuantityDto.getBeginDeclareDate();
- String endDeclareDate = ifsInventoryQuantityDto.getEndDeclareDate();
- ifsInventoryQuantityDto.setBeginDeclareDate(null);
- ifsInventoryQuantityDto.setEndDeclareDate(null);
- List<IfsInventoryQuantitySupplierDto> ifsByOverList = standardTreeMapper.getIfsByOverList(QueryWrappers.queryWrappers(ifsInventoryQuantityDto), beginDeclareDate, endDeclareDate);
+ // 鍒ゆ柇鏄惁鏄牴鎹�夋嫨鐨勫鍑�
+ List<IfsInventoryQuantitySupplierDto> ifsByOverList = new ArrayList<>();
+ if (StringUtils.isNotBlank(ifsInventoryQuantityDto.getIds())) {
+ List<String> ifsIds = StrUtil.split(ifsInventoryQuantityDto.getIds(), ",");
+ ifsByOverList = standardTreeMapper.getIfsByIds(ifsIds);
+ } else {
+ String beginDeclareDate = ifsInventoryQuantityDto.getBeginDeclareDate();
+ String endDeclareDate = ifsInventoryQuantityDto.getEndDeclareDate();
+ ifsInventoryQuantityDto.setBeginDeclareDate(null);
+ ifsInventoryQuantityDto.setEndDeclareDate(null);
+ ifsInventoryQuantityDto.setIds(null);
+ ifsByOverList = standardTreeMapper.getIfsByOverList(QueryWrappers.queryWrappers(ifsInventoryQuantityDto), beginDeclareDate, endDeclareDate);
+ }
for (IfsInventoryQuantitySupplierDto dto : ifsByOverList) {
dto.setSendTimeString(dto.getSendTime() == null ? "" : dto.getSendTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
--
Gitblit v1.9.3