|
@@ -8,6 +8,8 @@ import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.jfinal.core.Controller;
|
|
|
import com.jfinal.kit.PropKit;
|
|
@@ -17,6 +19,8 @@ import com.jfinal.plugin.activerecord.Record;
|
|
|
import com.jfinal.plugin.activerecord.dialect.OracleDialect;
|
|
|
import com.jfinal.plugin.activerecord.dialect.SqlServerDialect;
|
|
|
import com.jfinal.plugin.druid.DruidPlugin;
|
|
|
+import com.zskk.tools.AESUtils;
|
|
|
+
|
|
|
import okhttp3.FormBody;
|
|
|
import okhttp3.MediaType;
|
|
|
import okhttp3.OkHttpClient;
|
|
@@ -43,7 +47,43 @@ public class ViewController extends Controller {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 获取未出报告的检查列表
|
|
|
+ * @param instutionId
|
|
|
+ * @param number
|
|
|
+ */
|
|
|
+ public void getExamList() {
|
|
|
+ String IV = "0000000000000000";
|
|
|
+ Map <String,String> map = new HashMap<String,String>();
|
|
|
+ map.put("exam_status","3");
|
|
|
+ map.put("createAt", "2023-06-01 00:00:00,2023-06-15 12:00:00");
|
|
|
+ map.put("num", "20");
|
|
|
+ String aesEncryptStr = AESUtils.aesEncryptStr(JSON.toJSONString(map), PropKit.get("nw_key"),IV);
|
|
|
+ Map <String,String> mapaes = new HashMap<String,String>();
|
|
|
+ mapaes.put("data",aesEncryptStr);
|
|
|
+ String content = postWithParameters("http://127.0.0.1:8082/df/view/getExam", mapaes);
|
|
|
+// this.renderText(content);
|
|
|
+
|
|
|
+// JSONObject jsonObject = JSON.parseObject(content);
|
|
|
+// if (!jsonObject.getString("msg").equals("success")) {
|
|
|
+// return null;
|
|
|
+// }
|
|
|
+ String aesDecodeStr ="";
|
|
|
+ try {
|
|
|
+ aesDecodeStr = AESUtils.aesDecodeStr(content, PropKit.get("nw_key"),IV);
|
|
|
+ } catch (Exception e) {
|
|
|
+ // TODO Auto-generated catch block
|
|
|
+ e.printStackTrace();
|
|
|
+// return null;
|
|
|
+ }
|
|
|
+ JSONArray jsonArray = JSON.parseArray(aesDecodeStr);
|
|
|
+// return jsonArray;
|
|
|
+ this.renderJson(jsonArray);
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
public void testConn() {
|
|
|
try {
|
|
|
DruidPlugin druidPluginConnected = createConnectedDruidPlugin();
|
|
@@ -169,6 +209,30 @@ public class ViewController extends Controller {
|
|
|
return date;
|
|
|
}
|
|
|
|
|
|
+public static String postWithParameters(String url, Map<String, String> map) {
|
|
|
+
|
|
|
+ FormBody.Builder formbody = new FormBody.Builder();
|
|
|
+
|
|
|
+ for (Map.Entry<String, String> entry : map.entrySet()) {
|
|
|
+ formbody.add(entry.getKey(), entry.getValue());
|
|
|
+ }
|
|
|
+ RequestBody requestBody = formbody.build();
|
|
|
+
|
|
|
+ Request request = new Request.Builder()
|
|
|
+ .url(url)
|
|
|
+ .post(requestBody)
|
|
|
+ .build();
|
|
|
+
|
|
|
+ try (Response response = OKHTTP_CLIENT.newCall(request).execute()) {
|
|
|
+ if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
|
|
|
+ String content = response.body().string();
|
|
|
+ return content;
|
|
|
+ } catch (IOException e) {
|
|
|
+ // TODO Auto-generated catch block
|
|
|
+ e.printStackTrace();
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
public static void main(String[] args) {
|
|
|
Map<String,String> paramsMap=new HashMap<String,String>();
|
|
|
paramsMap.put("institution_id", "44100001");
|