From 16711d6bba26307e9ecad5b583cf838e968b0179 Mon Sep 17 00:00:00 2001 From: "han\\hanst" Date: Wed, 11 Feb 2026 10:16:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A6=82=E6=9E=9C=E7=94=A8=E6=88=B7=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E9=80=89=E6=8B=A9=E8=BF=87=E6=9C=9F=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=EF=BC=8C=E5=88=99=E4=B8=BA=E5=BD=93=E5=89=8D=E6=97=B6=E9=97=B4?= =?UTF-8?q?+=E6=96=99=E5=8F=B7=E7=9A=84=E9=BB=98=E8=AE=A4=E4=BF=9D?= =?UTF-8?q?=E8=B4=A8=E6=9C=9F=EF=BC=88=E5=A6=82=E6=9E=9C=E6=9C=89=E7=9A=84?= =?UTF-8?q?=E8=AF=9D=EF=BC=89=E8=AE=BE=E7=BD=AE=E8=BF=87=E6=9C=9F=E6=97=A5?= =?UTF-8?q?=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ProductionInboundServiceImpl.java | 4 ++-- .../service/impl/SalesReturnServiceImpl.java | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gaotao/modules/production/service/impl/ProductionInboundServiceImpl.java b/src/main/java/com/gaotao/modules/production/service/impl/ProductionInboundServiceImpl.java index 09f7835..27f3ceb 100644 --- a/src/main/java/com/gaotao/modules/production/service/impl/ProductionInboundServiceImpl.java +++ b/src/main/java/com/gaotao/modules/production/service/impl/ProductionInboundServiceImpl.java @@ -571,8 +571,8 @@ public class ProductionInboundServiceImpl implements ProductionInboundService { log.info("工单号: {}, 料号: {}, 入库数量: {}", dto.getOrderNo(), dto.getPartNo(), dto.getTransQty()); if (dto.getIfsExpiryDate() == null) { List parts = ifsApiIssueAndReturnService.getInventoryPart(dto.getPartNo(),dto.getSite()); - // 如果用户没有选择过期日期,则分切物料尝试从IFS获取过期日期、成品物料直接设置为当前时间+365天 - if (!parts.isEmpty()) { + // 如果用户没有选择过期日期,则为当前时间+料号的默认保质期(如果有的话)设置过期日期 + if (!parts.isEmpty() && parts.getFirst().getDurabilityDays() > 0) { // 当前时间+365天作为过期日期 Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); diff --git a/src/main/java/com/gaotao/modules/salesreturn/service/impl/SalesReturnServiceImpl.java b/src/main/java/com/gaotao/modules/salesreturn/service/impl/SalesReturnServiceImpl.java index b4b82ae..bfa7235 100644 --- a/src/main/java/com/gaotao/modules/salesreturn/service/impl/SalesReturnServiceImpl.java +++ b/src/main/java/com/gaotao/modules/salesreturn/service/impl/SalesReturnServiceImpl.java @@ -7,6 +7,8 @@ import com.gaotao.common.exception.XJException; import com.gaotao.common.utils.DateUtils; import com.gaotao.common.utils.ErrorLogUtils; import com.gaotao.common.utils.HttpUtils; +import com.gaotao.modules.api.entity.issueAndReturnVo.InventoryPartVo; +import com.gaotao.modules.api.service.IfsApiIssueAndReturnService; import com.gaotao.modules.handlingunit.entity.HandlingUnit; import com.gaotao.modules.handlingunit.service.HandlingUnitIdGeneratorService; import com.gaotao.modules.handlingunit.service.HandlingUnitService; @@ -56,6 +58,9 @@ public class SalesReturnServiceImpl implements SalesReturnService { @Autowired private TransNoControlService transNoService; + @Autowired + private IfsApiIssueAndReturnService ifsApiIssueAndReturnService; + @Autowired private HandlingUnitService handlingUnitService; @@ -158,6 +163,17 @@ public class SalesReturnServiceImpl implements SalesReturnService { List unitIds = new ArrayList<>(); try { + if (dto.getExpiryDate() == null) { + List parts = ifsApiIssueAndReturnService.getInventoryPart(dto.getPartNo(),dto.getSite()); + // 如果用户没有选择过期日期,则为当前时间+料号的默认保质期(如果有的话)设置过期日期 + if (!parts.isEmpty() && parts.getFirst().getDurabilityDays() > 0) { + // 当前时间+365天作为过期日期 + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + calendar.add(Calendar.DAY_OF_YEAR, parts.getFirst().getDurabilityDays()); + dto.setExpiryDate(calendar.getTime()); + } + } SysUserEntity currentUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); // 1. 生成事务号 TransNoControl transTrans = transNoService.getTransNo(dto.getSite(), "SRI", 10);