自动化立体仓库 - WMS系统
lty
7 天以前 2ad73d412385d20f1db975f24972fc11751ed040
#推送超时改为15秒
1个文件已修改
20 ■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
@@ -35,6 +35,7 @@
import javax.annotation.Resource;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
@@ -2109,13 +2110,25 @@
                        .setPath(MesConstant.GWCS_FPKW_URL)
                        .setHeaders(headers)
                        .setJson(body)
                        .setTimeout(15, TimeUnit.SECONDS) // 设置连接 + 读取超时为15秒
                        .build()
                        .doPost();
                if (!Cools.isEmpty(response)) {
                    success = true;
                    finalSuccess = true;
                    log.info("{} 成功,响应:{}", attemptMsg, response);
                    try {
                        JSONObject resJson = JSON.parseObject(response);
                        int code = resJson.getIntValue("code"); // 视具体接口而定
                        if (code == 0) {
                            success = true;
                            finalSuccess = true;
                            log.info("{} 成功,响应:{}", attemptMsg, response);
                        } else {
                            log.warn("{} 响应失败,返回code={},完整响应:{}", attemptMsg, code, response);
                        }
                    } catch (Exception parseEx) {
                        log.warn("{} 响应解析失败,内容:{}", attemptMsg, response);
                    }
                } else {
                    log.warn("{} 失败,响应为空", attemptMsg);
                }
@@ -2155,6 +2168,7 @@
    }
    Map<String, Object> getHeaders(){
        Map<String,Object> headers = new HashMap<>();
        headers.put("digi-type","sync ");