liding
2026-08-27 f62898792c0f3f8e870eb351d3e06a00f9a6fb6a
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);
@@ -96,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(), "查询库存信息-->");
    }
@@ -109,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 {
@@ -147,4 +155,8 @@
        stockMap.put("inAttr", inAttr);
        return stockMap;
    }
    private boolean isDisabled() {
        return true;
    }
}