自动化立体仓库 - WMS系统
#
lty
20 小时以前 7e9902b21dce4549c837bec6ac234a576b2efb9b
src/main/java/com/zy/asrs/task/kingdee/handler/InboundOrderHandler.java
@@ -262,14 +262,27 @@
                        .setJson(add)
                        .build()
                        .doPost();
                if (response == null || response.trim().isEmpty()) {
                    log.error("检索失败:返回空响应,path={}", path);
                    continue;
                }
                JSONObject jsonResponse = JSON.parseObject(response);
                if(jsonResponse.getString("errorCode").equals("401")){
                if (jsonResponse == null) {
                    log.error("检索失败:响应无法解析为JSON,path={},response={}", path, response);
                    continue;
                }
                if ("401".equals(jsonResponse.getString("errorCode"))) {
                    log.error("检索失败错误信息:{}", jsonResponse.getString("message"));
                    loginAuthenticationHandler.start();
                    continue;
                }
                JSONArray data = jsonResponse.getJSONObject("data").getJSONArray("rows");
                if(data == null){
                JSONObject dataObj = jsonResponse.getJSONObject("data");
                if (dataObj == null) {
                    log.error("检索失败:响应data为空,path={},response={}", path, response);
                    continue;
                }
                JSONArray data = dataObj.getJSONArray("rows");
                if (data == null) {
                    continue;
                }
                if(data.size()<=0)  continue;
@@ -277,8 +290,8 @@
                if(kingDeeUtilType.formId.equals("BD_MATERIAL")) {
                    Tag tag = tagService.selectByName("全部", 1);
                    // 处理分页:根据返回的totalCount和pageSize计算页数
                    int pageSize = jsonResponse.getJSONObject("data").getIntValue("pageSize");
                    int totalCount = jsonResponse.getJSONObject("data").getIntValue("totalCount");
                    int pageSize = dataObj.getIntValue("pageSize");
                    int totalCount = dataObj.getIntValue("totalCount");
                    int totalPages = (int) Math.ceil((double) totalCount / pageSize);
                    for (int page = 1; page <= totalPages; page++) {
@@ -293,8 +306,24 @@
                                .build()
                                .doPost();
                        if (response == null || response.trim().isEmpty()) {
                            log.error("检索失败:分页返回空响应,path={},pageNo={}", path, page);
                            continue;
                        }
                        jsonResponse = JSON.parseObject(response);
                        data = jsonResponse.getJSONObject("data").getJSONArray("rows");
                        if (jsonResponse == null) {
                            log.error("检索失败:分页响应无法解析为JSON,path={},pageNo={},response={}", path, page, response);
                            continue;
                        }
                        dataObj = jsonResponse.getJSONObject("data");
                        if (dataObj == null) {
                            log.error("检索失败:分页响应data为空,path={},pageNo={},response={}", path, page, response);
                            continue;
                        }
                        data = dataObj.getJSONArray("rows");
                        if (data == null) {
                            continue;
                        }
                        for (int j = 0; j < data.size(); j++) {
                            JSONObject jsonObjectNew = data.getJSONObject(j);
                            Date modifyTime = sdf1.parse(jsonObjectNew.get("modifytime").toString());
@@ -1924,4 +1953,4 @@
    }
}
}