|
@@ -70,7 +70,7 @@ public class ViewController extends Controller {
|
|
|
|
|
|
public void downDcm() {
|
|
public void downDcm() {
|
|
String aString ="";
|
|
String aString ="";
|
|
- String bString ="";
|
|
|
|
|
|
+ int bString =0;
|
|
|
|
|
|
List<Record> studyidfinds = Db.use("local").find("select * from study where status =1 or status =2 order by createAt asc limit 1");
|
|
List<Record> studyidfinds = Db.use("local").find("select * from study where status =1 or status =2 order by createAt asc limit 1");
|
|
if (studyidfinds == null) {
|
|
if (studyidfinds == null) {
|
|
@@ -93,7 +93,7 @@ public class ViewController extends Controller {
|
|
//状态4:下载中
|
|
//状态4:下载中
|
|
studyidfind.set("status", 4);
|
|
studyidfind.set("status", 4);
|
|
Db.use("local").update("study", studyidfind);
|
|
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 2000 * from dicominfo where studyuid=?",studyidfind.getStr("studyuid"));
|
|
for (Record record : dicomfind) {
|
|
for (Record record : dicomfind) {
|
|
String urlString = record.getStr("URL");
|
|
String urlString = record.getStr("URL");
|
|
if (urlString.isBlank()) {
|
|
if (urlString.isBlank()) {
|
|
@@ -102,11 +102,11 @@ public class ViewController extends Controller {
|
|
Request request = new Request.Builder()
|
|
Request request = new Request.Builder()
|
|
.url(urlString)
|
|
.url(urlString)
|
|
.build();
|
|
.build();
|
|
- aString =aString+record.getStr("URL")+"/n";
|
|
|
|
|
|
+ aString =aString+urlString+"\n";
|
|
try (Response response = OKHTTP_CLIENT.newCall(request).execute()) {
|
|
try (Response response = OKHTTP_CLIENT.newCall(request).execute()) {
|
|
if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
|
|
if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
|
|
|
|
|
|
- String cString = writeFile(response,studyidfind.getStr("studyuid"));
|
|
|
|
|
|
+ int cString = writeFile(response,studyidfind.getStr("studyuid"));
|
|
bString =bString+cString;
|
|
bString =bString+cString;
|
|
} catch (IOException e1) {
|
|
} catch (IOException e1) {
|
|
// TODO Auto-generated catch block
|
|
// TODO Auto-generated catch block
|
|
@@ -139,7 +139,7 @@ public class ViewController extends Controller {
|
|
this.renderText(e.toString());
|
|
this.renderText(e.toString());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- private String writeFile(Response response, String uid) {
|
|
|
|
|
|
+ private int writeFile(Response response, String uid) {
|
|
InputStream is = response.body().byteStream();;
|
|
InputStream is = response.body().byteStream();;
|
|
FileOutputStream fos = null;
|
|
FileOutputStream fos = null;
|
|
String path = "/home/lenovo/CFIND_XML";
|
|
String path = "/home/lenovo/CFIND_XML";
|
|
@@ -162,7 +162,7 @@ public class ViewController extends Controller {
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
- return "0";
|
|
|
|
|
|
+ return 1;
|
|
|
|
|
|
}
|
|
}
|
|
public static DruidPlugin createConnectedDruidPlugin() {
|
|
public static DruidPlugin createConnectedDruidPlugin() {
|