From d781c4307ea301646821ec386b0b748bd12bfce5 Mon Sep 17 00:00:00 2001 From: "han\\hanst" Date: Mon, 9 Feb 2026 11:58:35 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=9C=89=E6=95=88=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ProductionInboundServiceImpl.java | 17 +++++++++++++++-- 1 file changed, 15 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 1cf9fb3..09f7835 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 @@ -10,6 +10,9 @@ import com.gaotao.common.utils.ErrorLogUtils; import com.gaotao.common.utils.HttpUtils; import com.gaotao.common.utils.IfsErrorMessageUtils; import com.gaotao.modules.api.entity.IfsShopOrder; +import com.gaotao.modules.api.entity.issueAndReturnVo.AnInventoryPartInStockVo; +import com.gaotao.modules.api.entity.issueAndReturnVo.InventoryPartVo; +import com.gaotao.modules.api.service.IfsApiIssueAndReturnService; import com.gaotao.modules.api.service.IfsApiService; import com.gaotao.modules.factory.dao.PartAttributeMapper; import com.gaotao.modules.factory.entity.PartAttribute; @@ -62,7 +65,7 @@ public class ProductionInboundServiceImpl implements ProductionInboundService { private ProductionInboundMapper productionInboundMapper; @Autowired - private IssureNotifyService issureNotifyService; + private IfsApiIssueAndReturnService ifsApiIssueAndReturnService; @Autowired private HandlingUnitService handlingUnitService; @@ -566,7 +569,17 @@ public class ProductionInboundServiceImpl implements ProductionInboundService { public Map submitShopOrderInbound(ShopOrderInboundDto dto) { log.info("=== 开始生产订单入库 ==="); 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()) { + // 当前时间+365天作为过期日期 + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + calendar.add(Calendar.DAY_OF_YEAR, parts.getFirst().getDurabilityDays()); + dto.setIfsExpiryDate(calendar.getTime()); + } + } // 用于收集创建的HU unitIds List unitIds = new ArrayList<>();