|
|
|
@ -6,6 +6,7 @@
|
|
|
|
|
*/
|
|
|
|
|
package com.emr.controller;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.emr.entity.*;
|
|
|
|
@ -14,12 +15,21 @@ import com.emr.util.HttpClientTool;
|
|
|
|
|
import com.emr.util.IDHelper;
|
|
|
|
|
import com.emr.util.ThreadExcelUtils;
|
|
|
|
|
import com.emr.util.XMLUtil;
|
|
|
|
|
import com.emr.vo.CollectionVo;
|
|
|
|
|
import com.emr.webservice.MedicalRecordShowBackContent.MR_FILE_CALLBACK_RECORD;
|
|
|
|
|
import com.emr.webservice.MedicalRecordShowBackContent.MR_FILE_INDEX_CALLBACK;
|
|
|
|
|
import org.apache.axis.client.Call;
|
|
|
|
|
import org.apache.axis.client.Service;
|
|
|
|
|
import org.apache.axis.encoding.XMLType;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.apache.http.HttpStatus;
|
|
|
|
|
import org.apache.http.client.config.RequestConfig;
|
|
|
|
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
|
|
|
|
import org.apache.http.client.methods.HttpPost;
|
|
|
|
|
import org.apache.http.entity.StringEntity;
|
|
|
|
|
import org.apache.http.impl.client.CloseableHttpClient;
|
|
|
|
|
import org.apache.http.impl.client.HttpClients;
|
|
|
|
|
import org.apache.http.util.EntityUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
@ -39,10 +49,9 @@ import java.net.URL;
|
|
|
|
|
import java.net.URLConnection;
|
|
|
|
|
import java.rmi.RemoteException;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Controller
|
|
|
|
|
@RequestMapping("signList")
|
|
|
|
@ -64,6 +73,13 @@ public class signListController {
|
|
|
|
|
@Autowired
|
|
|
|
|
private PowerUserService powerUserService;
|
|
|
|
|
|
|
|
|
|
private static RequestConfig requestConfig = null;
|
|
|
|
|
|
|
|
|
|
static {
|
|
|
|
|
// 设置请求和传输超时时间
|
|
|
|
|
requestConfig = RequestConfig.custom().setSocketTimeout(600000).setConnectTimeout(600000).build();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private Emr_Fault_DetailService emrFaultDetailService;
|
|
|
|
@ -146,7 +162,7 @@ public class signListController {
|
|
|
|
|
request.setCharacterEncoding("utf-8");
|
|
|
|
|
String result = "";
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
List<Archive_Master> master = archiveMasterService.selectByCol(archiveMasterVo);
|
|
|
|
|
List<Archive_Master> master = archiveMasterService.selectByInpAndVisitId(archiveMasterVo);
|
|
|
|
|
Sign_List signList = new Sign_List();
|
|
|
|
|
if (master != null && master.size() > 0) {
|
|
|
|
|
if (!"0".equals(master.get(0).getIsscaned())) {
|
|
|
|
@ -851,12 +867,56 @@ public class signListController {
|
|
|
|
|
|
|
|
|
|
@ResponseBody
|
|
|
|
|
@RequestMapping(value = "/collection")
|
|
|
|
|
public String collection(HttpServletRequest request, HttpServletResponse response, int flagNum, String id) throws Exception {
|
|
|
|
|
String taskId = afCollectTaskService.getTaskId(flagNum, id);
|
|
|
|
|
String url="http://127.0.0.1:9296/api/noviewtask/UrgentMakeUp";
|
|
|
|
|
String s = sendGet(url, taskId);
|
|
|
|
|
public JSONObject collection(HttpServletRequest request, HttpServletResponse response, String flagNum, String id) throws Exception {
|
|
|
|
|
// String taskId = afCollectTaskService.getTaskId(flagNum, id);
|
|
|
|
|
// String url="http://127.0.0.1:9296/api/noviewtask/UrgentMakeUp";
|
|
|
|
|
// String s = sendGet(url, taskId);
|
|
|
|
|
CollectionVo collectionVo = new CollectionVo();
|
|
|
|
|
List<String> patientIds=new ArrayList<>();
|
|
|
|
|
patientIds.add(id);
|
|
|
|
|
collectionVo.setPatientIds(patientIds);
|
|
|
|
|
collectionVo.setSysCodes(flagNum);
|
|
|
|
|
String url="http://192.168.16.63:9295/api/NoViewCollect/generateTaskByPatientIdAndSysCodes";
|
|
|
|
|
JSONObject jsonParam= (JSONObject) JSONObject.toJSON(collectionVo);
|
|
|
|
|
JSONObject jsonObject = httpPost(url, jsonParam);
|
|
|
|
|
//查询新任务表id
|
|
|
|
|
return s;
|
|
|
|
|
return jsonObject;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static JSONObject httpPost(String url, JSONObject jsonParam) {
|
|
|
|
|
// post请求返回结果
|
|
|
|
|
CloseableHttpClient httpClient = HttpClients.createDefault();
|
|
|
|
|
JSONObject jsonResult = null;
|
|
|
|
|
HttpPost httpPost = new HttpPost(url);
|
|
|
|
|
// 设置请求和传输超时时间
|
|
|
|
|
httpPost.setConfig(requestConfig);
|
|
|
|
|
try {
|
|
|
|
|
if (null != jsonParam) {
|
|
|
|
|
// 解决中文乱码问题
|
|
|
|
|
StringEntity entity = new StringEntity(jsonParam.toString(), "utf-8");
|
|
|
|
|
entity.setContentEncoding("UTF-8");
|
|
|
|
|
entity.setContentType("application/json");
|
|
|
|
|
httpPost.setEntity(entity);
|
|
|
|
|
}
|
|
|
|
|
CloseableHttpResponse result = httpClient.execute(httpPost);
|
|
|
|
|
// 请求发送成功,并得到响应
|
|
|
|
|
if (result.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
|
|
|
|
|
String str = "";
|
|
|
|
|
try {
|
|
|
|
|
// 读取服务器返回过来的json字符串数据
|
|
|
|
|
str = EntityUtils.toString(result.getEntity(), "utf-8");
|
|
|
|
|
// 把json字符串转换成json对象
|
|
|
|
|
jsonResult = JSONObject.parseObject(str);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
System.out.println("post请求提交失败");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
System.out.println("post请求提交失败");
|
|
|
|
|
} finally {
|
|
|
|
|
httpPost.releaseConnection();
|
|
|
|
|
}
|
|
|
|
|
return jsonResult;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static String sendGet(String url, String param) {
|
|
|
|
|