| | |
| | | path = orgAddress; |
| | | break; |
| | | case "PUR_RECEIVEBIll": //已审核收料单查询 |
| | | jsonObject.put("start_biztime", latestUpdateTime);//业务起始日期 |
| | | jsonObject.put("start_biztime", "2026-03-28");//业务起始日期 |
| | | jsonObject.put("end_biztime", sdf1.format(now));//业务结束日期 |
| | | jsonObject.put("billno", null); |
| | | jsonObject.put("billstatus", Arrays.asList("C"));//数据状态 [A:暂存, B:已提交, C:已审核] |
| | |
| | | .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; |
| | |
| | | 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++) { |
| | |
| | | .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()); |
| | |
| | | String ownerUuid = jsonObjectNew.get("org_number").toString();//erp货主编号 |
| | | String orderId = jsonObjectNew.get("id").toString(); |
| | | JSONObject detailParam = new JSONObject(); |
| | | JSONObject dataObj = new JSONObject(); |
| | | dataObj.put("billno", billNo); |
| | | JSONObject billnoParam = new JSONObject(); |
| | | billnoParam.put("billno", billNo); |
| | | detailParam.put("pageNo", 1); |
| | | detailParam.put("pageSize", 100); |
| | | detailParam.put("data", dataObj); |
| | | detailParam.put("data", billnoParam); |
| | | boolean hasNext = true; |
| | | while (hasNext) { |
| | | String reqJson = detailParam.toJSONString(); |
| | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |