fix: 优化

v3
chenhc 3 months ago
parent 70e487806e
commit 0eb2401d92

@ -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);

@ -31,9 +31,19 @@ public class ChsYbDrugService extends ServiceImpl<YbDrugMapper, YbDrug> {
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));
}

Loading…
Cancel
Save