From 422ed8a3af83348cb9cca9e8336b3e3a0c34e81d Mon Sep 17 00:00:00 2001 From: "han\\hanst" Date: Mon, 9 Feb 2026 11:54:02 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=BA=93=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/api/service/IfsApiService.java | 4 ++- .../api/service/impl/IfsApiServiceImpl.java | 25 +++++++++++++++++++ .../controller/PartAttributeController.java | 10 +++++++- 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gaotao/modules/api/service/IfsApiService.java b/src/main/java/com/gaotao/modules/api/service/IfsApiService.java index 8fb506f..bdf2de3 100644 --- a/src/main/java/com/gaotao/modules/api/service/IfsApiService.java +++ b/src/main/java/com/gaotao/modules/api/service/IfsApiService.java @@ -13,6 +13,7 @@ import com.gaotao.modules.notify.entity.vo.ShopOrderMaterialVo; import org.springframework.stereotype.Service; import java.util.List; +import java.util.Map; public interface IfsApiService { @@ -42,7 +43,7 @@ public interface IfsApiService { * @return BoxLabel数据列表 * @throws JsonProcessingException JSON处理异常 */ - List getBoxLabel(String site, Integer consignmentId, String jobNo, + List getBoxLabel(String site, Integer consignmentId, String jobNo, String lineNo, String relNo, Integer lineItemNo) throws JsonProcessingException; // ==================== IFS库存属性变更接口 - rqrq ==================== @@ -74,4 +75,5 @@ public interface IfsApiService { */ String changeAvailabilityControlId(IfsChangeAvailabilityControlIdDto data); + List> InventoryPartDefLoc(String site, String partNo); } diff --git a/src/main/java/com/gaotao/modules/api/service/impl/IfsApiServiceImpl.java b/src/main/java/com/gaotao/modules/api/service/impl/IfsApiServiceImpl.java index 6485be7..abe9693 100644 --- a/src/main/java/com/gaotao/modules/api/service/impl/IfsApiServiceImpl.java +++ b/src/main/java/com/gaotao/modules/api/service/impl/IfsApiServiceImpl.java @@ -353,4 +353,29 @@ public class IfsApiServiceImpl implements IfsApiService { } } + @Override + public List> InventoryPartDefLoc(String site, String partNo) { + try { + Map params = Map.of( + "ifsDBName", ifsDBName, + "domainUserID", getCurrentDomainUserID(), + "ifsSiteID", site, + "ifsPartNo", partNo + ); + ObjectMapper objectMapper = new ObjectMapper(); + String jsonBody = objectMapper.writeValueAsString(params); + log.info("IFS请求接口名称:{},请求参数: {}","InventoryPartDefLoc", jsonBody); + String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "InventoryPartDefLoc", jsonBody, null); + ObjectMapper mapper = new ObjectMapper(); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + List> result = mapper.readValue(ifsResponse, + new TypeReference>>() {}); + log.info("获取IFS默认库存信息成功,站点: {}, 返回记录: {}", site, result); + return result; + } catch (Exception e) { + log.error("调用IFS InventoryPartDefLoc接口异常:{}", e.getMessage()); + throw new XJException(e.getMessage()); + } + } + } diff --git a/src/main/java/com/gaotao/modules/factory/controller/PartAttributeController.java b/src/main/java/com/gaotao/modules/factory/controller/PartAttributeController.java index 788eb7c..540e78f 100644 --- a/src/main/java/com/gaotao/modules/factory/controller/PartAttributeController.java +++ b/src/main/java/com/gaotao/modules/factory/controller/PartAttributeController.java @@ -1,7 +1,9 @@ package com.gaotao.modules.factory.controller; +import com.fasterxml.jackson.core.JsonProcessingException; import com.gaotao.common.utils.PageUtils; import com.gaotao.common.utils.R; +import com.gaotao.modules.api.service.IfsApiService; import com.gaotao.modules.factory.entity.PartAttribute; import com.gaotao.modules.factory.entity.dto.NoOrderPartAttributeDto; import com.gaotao.modules.factory.entity.dto.PartAttributeQueryDto; @@ -11,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; +import java.util.Map; /** * 料件属性控制器 @@ -22,6 +25,9 @@ public class PartAttributeController extends AbstractController { @Autowired private PartAttributeService partAttributeService; + @Autowired + private IfsApiService ifsApiService; + /** * 分页查询料件属性列表 */ @@ -42,7 +48,9 @@ public class PartAttributeController extends AbstractController { @GetMapping("/info") public R info(@RequestParam String site, @RequestParam String partNo) { PartAttribute partAttribute = partAttributeService.getPartAttributeByKey(site, partNo); - return R.ok().put("data", partAttribute); + List> inventoryPartDefLoc; + inventoryPartDefLoc = ifsApiService.InventoryPartDefLoc(site, partNo); + return R.ok().put("data", partAttribute).put("partDefLoc", inventoryPartDefLoc); } /**