From f62898792c0f3f8e870eb351d3e06a00f9a6fb6a Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期四, 27 八月 2026 10:36:44 +0800
Subject: [PATCH] feat:停用IFS对外HTTP调用
---
ruoyi-common/src/main/java/com/ruoyi/common/utils/api/IfsApiUtils.java | 28 ++++++++++++++++++++++++----
1 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/api/IfsApiUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/api/IfsApiUtils.java
index ca4d3a9..6cb44f3 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/api/IfsApiUtils.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/api/IfsApiUtils.java
@@ -1,6 +1,5 @@
package com.ruoyi.common.utils.api;
-import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -32,9 +31,12 @@
* 鏌ヨ閲囪喘璁㈠崟鏈楠�
*/
public List<Map<String, Object>> getInventory(String inAttr) {
+ if (isDisabled()) {
+ return java.util.Collections.emptyList();
+ }
String procedureName = "QUERY_POL_RECEIPT_STD";
JSONObject stockMap = getJsonObject(procedureName, inAttr);
- String body = HttpRequest.post(ifsProperties.getCustorderPort()).form(stockMap).execute().body();
+ String body = "";
ObjectMapper objectMapper = new ObjectMapper();
try {
Map map = objectMapper.readValue(body, Map.class);
@@ -79,7 +81,15 @@
return getResult("MODIFY_PURCH_RECEIPT_LOT_STD", inAttr, ifsProperties.getCustorder(), "淇敼閲囪喘璁㈠崟鎵规鍙�-->");
}
-
+ /**
+ * 搴撳瓨鐗╂枡鎵规灞炴�ф柊澧炰慨鏀规帴鍙�
+ *
+ * @param inAttr
+ * @return
+ */
+ public Result importPartLotAttr(String inAttr) {
+ return getResult("IMPORT_PART_LOT_ATTR_STD", inAttr, ifsProperties.getCustorder(), "搴撳瓨鐗╂枡鎵规灞炴�ф柊澧炰慨鏀规帴鍙�-->");
+ }
/**
* 鏌ヨ搴撳瓨鏁版嵁
@@ -88,6 +98,9 @@
* @return
*/
public Result getIfsStock(String inAttr) {
+ if (isDisabled()) {
+ return Result.success(java.util.Collections.singletonMap("LIST_INFO", java.util.Collections.emptyList()));
+ }
return getResult("QUERY_INVENTORY_INFO_STD", inAttr, ifsProperties.getCustorderPort(), "鏌ヨ搴撳瓨淇℃伅-->");
}
@@ -101,13 +114,16 @@
* @return
*/
private Result<?> getResult(String procedureName, String inAttr, String url, String image) {
+ if (isDisabled()) {
+ return Result.success();
+ }
JSONObject stockMap = new JSONObject();
stockMap.put("procedureName", procedureName);
stockMap.put("contract", ifsProperties.getContract());
stockMap.put("contractKey", ifsProperties.getContractKeyPost());
stockMap.put("userId", "lims_user");
stockMap.put("inAttr", inAttr);
- String body = HttpRequest.post(url).form(stockMap).execute().body();
+ String body = "";
log.info(image + body);
ObjectMapper objectMapper = new ObjectMapper();
try {
@@ -139,4 +155,8 @@
stockMap.put("inAttr", inAttr);
return stockMap;
}
+
+ private boolean isDisabled() {
+ return true;
+ }
}
--
Gitblit v1.9.3