From 0eb2401d92b4aaaadc4c00099f9d15380d896ecb Mon Sep 17 00:00:00 2001 From: chenhc <2369838784@qq.com> Date: Tue, 14 Jan 2025 16:42:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../udidl/admin/service/chsapi/ChsYbChsHttpClient.java | 6 +----- .../udidl/admin/service/chsapi/ChsYbDrugService.java | 10 ++++++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/glxp/udidl/admin/service/chsapi/ChsYbChsHttpClient.java b/src/main/java/com/glxp/udidl/admin/service/chsapi/ChsYbChsHttpClient.java index e71fafd..946a2ad 100644 --- a/src/main/java/com/glxp/udidl/admin/service/chsapi/ChsYbChsHttpClient.java +++ b/src/main/java/com/glxp/udidl/admin/service/chsapi/ChsYbChsHttpClient.java @@ -86,11 +86,7 @@ public class ChsYbChsHttpClient { params.put("page", pageNum); if (StrUtil.isNotBlank(goodsCode)) params.put("goodsCode", goodsCode); - try { - Thread.sleep(15000); - } catch (InterruptedException e) { - e.printStackTrace(); - } + String response = sendPost(getDrugUrl+getParams(params), "",Charset.forName("utf-8")); response = response.replace("”", "").replace("“", "").replace("\\\"" , "").replace("\\\"" , "").replace("\\", ""); System.out.println(response); diff --git a/src/main/java/com/glxp/udidl/admin/service/chsapi/ChsYbDrugService.java b/src/main/java/com/glxp/udidl/admin/service/chsapi/ChsYbDrugService.java index 3ba5f27..104cd08 100644 --- a/src/main/java/com/glxp/udidl/admin/service/chsapi/ChsYbDrugService.java +++ b/src/main/java/com/glxp/udidl/admin/service/chsapi/ChsYbDrugService.java @@ -31,9 +31,19 @@ public class ChsYbDrugService extends ServiceImpl { Integer total = ybDrugResponse.getTotal(); //处理第一批数据 processUpdates(ybDrugResponse); + try { + Thread.sleep(15000); + } catch (InterruptedException e) { + e.printStackTrace(); + } //处理后续数据 if (total>pageNum){ for (int i = 2; i <= total ; i++) { + try { + Thread.sleep(15000); + } catch (InterruptedException e) { + e.printStackTrace(); + } System.out.println("更新数据库的YbDrug列表数据"+ i); processUpdates(ybChsHttpClient.getYbDrugList(i, pageSize,null)); }