|
@@ -136,7 +136,6 @@ public class ViewController extends Controller {
|
|
|
exams2.setClinDiag(record.getStr("diagnosis"));
|
|
|
exams2.update();
|
|
|
//传云医康 数据
|
|
|
- Map<String, String> params = new HashMap<String, String>();
|
|
|
Map<String, String> data = new HashMap<String, String>();
|
|
|
//获取data数据
|
|
|
//医院id
|
|
@@ -182,16 +181,10 @@ public class ViewController extends Controller {
|
|
|
data.put("confirm_doctor_id", record.getStr("reviewdoctor"));
|
|
|
//确认医生姓名
|
|
|
data.put("confirm_doctor_name",record.getStr("reviewdoctor"));
|
|
|
- //时间戳
|
|
|
- params.put("timestamp", String.valueOf(getSecondTimestamp(new Date())));
|
|
|
- //signature
|
|
|
- params.put("signature", Ksort(data));
|
|
|
- //datajson字符串
|
|
|
- params.put("data", JSON.toJSONString(data));
|
|
|
- //System.out.println(params);
|
|
|
+ System.out.println(data);
|
|
|
//调用接口
|
|
|
- String s = post(null, data);
|
|
|
- string = string+s;
|
|
|
+// String s = post(null, data);
|
|
|
+// string = string+s;
|
|
|
|
|
|
}
|
|
|
System.out.println(string);
|
|
@@ -323,7 +316,7 @@ public class ViewController extends Controller {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- private static String post(String url, Map<String, String> map) throws IOException {
|
|
|
+ private static void post(String url, Map<String, String> map) throws IOException {
|
|
|
RequestBody formBody = new FormBody.Builder()
|
|
|
.add("timestamp", String.valueOf(getSecondTimestamp(new Date())))
|
|
|
.add("signature", Ksort(map))
|
|
@@ -339,7 +332,7 @@ public class ViewController extends Controller {
|
|
|
if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
|
|
|
|
|
|
System.out.println(response.body().string());
|
|
|
- return response.body().string();
|
|
|
+// return response.body().string();
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -352,6 +345,7 @@ public class ViewController extends Controller {
|
|
|
index++;
|
|
|
}
|
|
|
Arrays.sort(key);
|
|
|
+
|
|
|
for (String s : key) {
|
|
|
sb += s + "=" + map.get(s) + "&";
|
|
|
}
|
|
@@ -372,4 +366,13 @@ public class ViewController extends Controller {
|
|
|
|
|
|
return String.valueOf(sdf.parse(data).getTime()/1000);
|
|
|
}
|
|
|
+ public static void main(String[] args) {
|
|
|
+ try {
|
|
|
+ String string = returnSecondTimestamp("2019-11-01 01:01:01");
|
|
|
+ System.out.println(string);
|
|
|
+ } catch (ParseException e) {
|
|
|
+ // TODO Auto-generated catch block
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|