|
@@ -93,26 +93,32 @@ public class ViewController extends Controller {
|
|
|
//状态4:下载中
|
|
|
studyidfind.set("status", 4);
|
|
|
Db.use("local").update("study", studyidfind);
|
|
|
- dicomfind = Db.use("connected_dicom").find("select top 2000 * from dicominfo where studyuid=?",studyidfind.getStr("studyuid"));
|
|
|
+ dicomfind = Db.use("connected_dicom").find("select top 500 * from dicominfo where studyuid=?",studyidfind.getStr("studyuid"));
|
|
|
for (Record record : dicomfind) {
|
|
|
- String urlString = record.getStr("URL");
|
|
|
- if (urlString.isBlank()) {
|
|
|
+ try {
|
|
|
+ String urlString = record.getStr("URL");
|
|
|
+ if (urlString.isBlank()) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ Request request = new Request.Builder()
|
|
|
+ .url(urlString)
|
|
|
+ .build();
|
|
|
+ aString =aString+urlString+"\n";
|
|
|
+ try (Response response = OKHTTP_CLIENT.newCall(request).execute()) {
|
|
|
+ if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
|
|
|
+
|
|
|
+ int cString = writeFile(response,studyidfind.getStr("studyuid"));
|
|
|
+ bString =bString+cString;
|
|
|
+ } catch (IOException e1) {
|
|
|
+ // TODO Auto-generated catch block
|
|
|
+ e1.printStackTrace();
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ // TODO: handle exception
|
|
|
continue;
|
|
|
}
|
|
|
- Request request = new Request.Builder()
|
|
|
- .url(urlString)
|
|
|
- .build();
|
|
|
- aString =aString+urlString+"\n";
|
|
|
- try (Response response = OKHTTP_CLIENT.newCall(request).execute()) {
|
|
|
- if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
|
|
|
-
|
|
|
- int cString = writeFile(response,studyidfind.getStr("studyuid"));
|
|
|
- bString =bString+cString;
|
|
|
- } catch (IOException e1) {
|
|
|
- // TODO Auto-generated catch block
|
|
|
- e1.printStackTrace();
|
|
|
- continue;
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
}
|
|
|
studyidfind.set("status", 3);
|