|
@ -0,0 +1,144 @@
|
|
|
|
package com.yihu.wlyy.service.app.record;
|
|
|
|
|
|
|
|
import com.yihu.wlyy.service.BaseService;
|
|
|
|
import com.yihu.wlyy.util.HttpClientUtil;
|
|
|
|
import com.yihu.wlyy.util.SystemConf;
|
|
|
|
import org.apache.http.NameValuePair;
|
|
|
|
import org.apache.http.message.BasicNameValuePair;
|
|
|
|
import org.json.JSONArray;
|
|
|
|
import org.json.JSONObject;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author HZY
|
|
|
|
* @vsrsion 1.0
|
|
|
|
* Created at 2016/10/17.
|
|
|
|
*/
|
|
|
|
@Service
|
|
|
|
public class InspectionService extends BaseService {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取检查报告信息
|
|
|
|
*/
|
|
|
|
public JSONArray getChecking(String strSSID, String startDate, String endDate, String startNum, String endNum) throws Exception {
|
|
|
|
String url = SystemConf.getInstance().getSystemProperties().getProperty("sign_check_upload");
|
|
|
|
url = url + "/third/smjk/ExamReport";
|
|
|
|
|
|
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
|
|
params.add(new BasicNameValuePair("strSSID", strSSID));
|
|
|
|
params.add(new BasicNameValuePair("startDate", startDate));
|
|
|
|
params.add(new BasicNameValuePair("endDate", endDate));
|
|
|
|
params.add(new BasicNameValuePair("startNum", startNum));
|
|
|
|
params.add(new BasicNameValuePair("endNum", endNum));
|
|
|
|
|
|
|
|
JSONArray result = new JSONArray();
|
|
|
|
String response = HttpClientUtil.post(url, params, "UTF-8");
|
|
|
|
|
|
|
|
if (!StringUtils.isEmpty(response)){
|
|
|
|
JSONObject jsonObject = new JSONObject(response);
|
|
|
|
int status = jsonObject.getInt("status");
|
|
|
|
if (status == 200){
|
|
|
|
String data = jsonObject.getString("data");
|
|
|
|
if (!StringUtils.isEmpty(data)){
|
|
|
|
JSONObject jsonData = new JSONObject(data);
|
|
|
|
result = jsonData.getJSONArray("EhrList");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取检验报告信息
|
|
|
|
*/
|
|
|
|
public JSONArray getInspection(String strSSID, String startDate, String endDate, String startNum, String endNum) throws Exception {
|
|
|
|
String url = SystemConf.getInstance().getSystemProperties().getProperty("sign_check_upload");
|
|
|
|
url = url + "/third/smjk/LabReport";
|
|
|
|
|
|
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
|
|
params.add(new BasicNameValuePair("strSSID", strSSID));
|
|
|
|
params.add(new BasicNameValuePair("startDate", startDate));
|
|
|
|
params.add(new BasicNameValuePair("endDate", endDate));
|
|
|
|
params.add(new BasicNameValuePair("startNum", startNum));
|
|
|
|
params.add(new BasicNameValuePair("endNum", endNum));
|
|
|
|
|
|
|
|
JSONArray result = new JSONArray();
|
|
|
|
String response = HttpClientUtil.post(url, params, "UTF-8");
|
|
|
|
if (!StringUtils.isEmpty(response)){
|
|
|
|
JSONObject jsonObject = new JSONObject(response);
|
|
|
|
int status = jsonObject.getInt("status");
|
|
|
|
if (status == 200){
|
|
|
|
String data = jsonObject.getString("data");
|
|
|
|
if (!StringUtils.isEmpty(data)){
|
|
|
|
JSONObject jsonData = new JSONObject(data);
|
|
|
|
result = jsonData.getJSONArray("EhrList");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取检查检验 信息
|
|
|
|
* @param strSSID
|
|
|
|
* @param startDate
|
|
|
|
* @param endDate
|
|
|
|
* @param startNum
|
|
|
|
* @param endNum
|
|
|
|
* @return
|
|
|
|
* @throws Exception
|
|
|
|
*/
|
|
|
|
public JSONArray getInspectionAndChecking(String strSSID, String startDate, String endDate, String startNum, String endNum) throws Exception {
|
|
|
|
JSONArray total = new JSONArray();
|
|
|
|
JSONArray check = getChecking(strSSID, startDate, endDate, startNum, endNum);
|
|
|
|
JSONArray inspect = getInspection(strSSID, startDate, endDate, startNum, endNum);
|
|
|
|
//TODO 检查检验数据合并
|
|
|
|
|
|
|
|
return total;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 档案详情
|
|
|
|
* @param strSSID 健康卡号
|
|
|
|
* @param strEvent 事件ID
|
|
|
|
* @param strCatalog 档案类型
|
|
|
|
* @param strSerial 该类别顺序号,默认填1
|
|
|
|
* @return
|
|
|
|
* @throws Exception
|
|
|
|
*/
|
|
|
|
public JSONArray getHealthData(String strSSID, String strEvent, String strCatalog, String strSerial) throws Exception {
|
|
|
|
String url = SystemConf.getInstance().getSystemProperties().getProperty("sign_check_upload");
|
|
|
|
url = url + "/third/smjk/HealthData";
|
|
|
|
|
|
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
|
|
params.add(new BasicNameValuePair("strSSID", strSSID));
|
|
|
|
params.add(new BasicNameValuePair("strEvent", strEvent));
|
|
|
|
params.add(new BasicNameValuePair("strCatalog", strCatalog));
|
|
|
|
params.add(new BasicNameValuePair("strSerial", strSerial));
|
|
|
|
|
|
|
|
JSONArray result = new JSONArray();
|
|
|
|
String response = HttpClientUtil.post(url, params, "UTF-8");
|
|
|
|
if (!StringUtils.isEmpty(response)){
|
|
|
|
JSONObject jsonObject = new JSONObject(response);
|
|
|
|
int status = jsonObject.getInt("status");
|
|
|
|
if (status == 200){
|
|
|
|
String data = jsonObject.getString("data");
|
|
|
|
if (!StringUtils.isEmpty(data)){
|
|
|
|
JSONObject jsonData = new JSONObject(data);
|
|
|
|
result = jsonData.getJSONArray("EhrList");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|