From 8f81f05e4346f12b209558fabb86d980f852946d Mon Sep 17 00:00:00 2001 From: sunjianxi <839419401@qq.com> Date: Thu, 5 Feb 2026 15:45:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../KgLowDurable/config/FileUploadConfig.java | 4 +-- .../config/WebMvcConfiguration.java | 2 +- .../pojo/entity/LdOnePutStorageDetail.java | 7 ++++ .../Impl/LdOnePutStorageServiceImpl.java | 36 +++++++++++++++++-- .../Impl/LdTwoOutStorageServiceImpl.java | 8 ++--- .../KgLowDurable/util/ImageUploadUtil.java | 15 ++++---- src/main/resources/application-dev.properties | 7 ++++ .../resources/application-prop.properties | 30 +++++++++------- .../resources/application-test.properties | 3 ++ src/main/resources/application.properties | 4 +-- 10 files changed, 84 insertions(+), 32 deletions(-) diff --git a/src/main/java/com/nov/KgLowDurable/config/FileUploadConfig.java b/src/main/java/com/nov/KgLowDurable/config/FileUploadConfig.java index d6cc5aa..1191eea 100644 --- a/src/main/java/com/nov/KgLowDurable/config/FileUploadConfig.java +++ b/src/main/java/com/nov/KgLowDurable/config/FileUploadConfig.java @@ -9,11 +9,11 @@ import org.springframework.stereotype.Component; public class FileUploadConfig { // 本地服务器地址 - @Value("${file.upload.server:http://localhost:8083}") + @Value(value = "${file.upload.server}") private String serverUrl; // 基础存储路径 - @Value("${file.upload.base-path:/opt/SmartParkFilesTest}") + @Value(value = "${file.upload.base-path}") private String basePath; // 允许的文件类型 diff --git a/src/main/java/com/nov/KgLowDurable/config/WebMvcConfiguration.java b/src/main/java/com/nov/KgLowDurable/config/WebMvcConfiguration.java index fd80127..7b2df4f 100644 --- a/src/main/java/com/nov/KgLowDurable/config/WebMvcConfiguration.java +++ b/src/main/java/com/nov/KgLowDurable/config/WebMvcConfiguration.java @@ -8,7 +8,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @Configuration public class WebMvcConfiguration implements WebMvcConfigurer { - @Value(value = "${path.upload}") + @Value(value = "${file.upload.base-path}") private String uploadpath; // @Value("${app.video-folder}") diff --git a/src/main/java/com/nov/KgLowDurable/pojo/entity/LdOnePutStorageDetail.java b/src/main/java/com/nov/KgLowDurable/pojo/entity/LdOnePutStorageDetail.java index 3040294..e7f6e69 100644 --- a/src/main/java/com/nov/KgLowDurable/pojo/entity/LdOnePutStorageDetail.java +++ b/src/main/java/com/nov/KgLowDurable/pojo/entity/LdOnePutStorageDetail.java @@ -1,6 +1,7 @@ package com.nov.KgLowDurable.pojo.entity; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; @@ -119,4 +120,10 @@ public class LdOnePutStorageDetail implements Serializable { */ private String remark; + /** + * 已入库数量 + */ + @TableField(exist = false) + private BigDecimal yetInboundQuantity; + } diff --git a/src/main/java/com/nov/KgLowDurable/service/Impl/LdOnePutStorageServiceImpl.java b/src/main/java/com/nov/KgLowDurable/service/Impl/LdOnePutStorageServiceImpl.java index f34fa28..a8d37c6 100644 --- a/src/main/java/com/nov/KgLowDurable/service/Impl/LdOnePutStorageServiceImpl.java +++ b/src/main/java/com/nov/KgLowDurable/service/Impl/LdOnePutStorageServiceImpl.java @@ -57,6 +57,7 @@ public class LdOnePutStorageServiceImpl extends ServiceImpl getOnePutStorageList(Date startTime, Date endTime, String inOperator, Integer pageNum, Integer pageSize) { @@ -111,6 +112,35 @@ public class LdOnePutStorageServiceImpl extends ServiceImpl ldOnePutStorageDetailList = onePutStorageDetailService.getByOnePutStorageId(ldOnePutStorage.getId()); + ldOnePutStorageDetailList.forEach(item ->item.setYetInboundQuantity(new BigDecimal(0))); + List idList = ldOnePutStorageDetailList.stream().map(LdOnePutStorageDetail::getLdPurchaseEndId).collect(Collectors.toList()); + + //查询一级入库是否有该采购单 + List onePutStoragePurchaseEndList = onePutStoragePurchaseEndService.selectByPurchaseEndId(idList); + if(!CollectionUtils.isEmpty(onePutStoragePurchaseEndList)){ + //获取一级库ID + List onePutStorageIds = onePutStoragePurchaseEndList.stream() + .map(LdOnePutStoragePurchaseEnd::getOnePutStorageId) + .distinct() + .collect(Collectors.toList()); + //查询是否审核通过 + List ldOnePutStorageList = this.getApprove(onePutStorageIds); + if(!CollectionUtils.isEmpty(ldOnePutStorageList)){ + //通过的话需要汇总入库数量 + List collect = ldOnePutStorageList.stream() + .map(LdOnePutStorage::getId) + .collect(Collectors.toList()); + + List ldOnePutStorageDetailOldList = onePutStorageDetailService.getSummaryData(collect); + for(LdOnePutStorageDetail detail : ldOnePutStorageDetailList){ + for(LdOnePutStorageDetail oldDtail : ldOnePutStorageDetailOldList){ + if(detail.getMaterialId() == oldDtail.getMaterialId() && detail.getMaterialCode().equals(oldDtail.getMaterialCode())){ + detail.setYetInboundQuantity(oldDtail.getInboundQuantity()); + } + } + } + } + } List approveList = ldApproveService.getByFromId(onePutStorageId,BatchConstant.PUT_STORAGE_TYPE); @@ -220,7 +250,7 @@ public class LdOnePutStorageServiceImpl extends ServiceImpl