diff --git a/QZWebApi/Controllers/ValuesController.cs b/QZWebApi/Controllers/ValuesController.cs
index 2dca907..91437fc 100644
--- a/QZWebApi/Controllers/ValuesController.cs
+++ b/QZWebApi/Controllers/ValuesController.cs
@@ -20,8 +20,8 @@ namespace QZWebApi.Controllers
public class ValuesController : ApiController
{
[HttpGet]
-
- public string GetPlanChange(string HospitalId,string year,string AesKey)
+
+ public string GetPlanChange(string HospitalId, string year, string AesKey)
{
//获得请求的时间秒数
long timeStamp = TjSignUtil.Get_Timestamp();
@@ -93,24 +93,24 @@ namespace QZWebApi.Controllers
model.plans = plansStr;
}
catch
- {
-
+ {
+
}
return model;
}
[HttpGet]
- public string SetPlanOK(string HospitalId, string AesKey, string ids,string delids)
+ public string SetPlanOK(string HospitalId, string AesKey, string ids, string delids)
{
//获得请求的时间秒数
long timeStamp = TjSignUtil.Get_Timestamp();
//获得请求参数签名
- string signature = TjSignUtil.GetSignatureBytoken(AesKey, timeStamp.ToString(), HospitalId + ids+delids);
+ string signature = TjSignUtil.GetSignatureBytoken(AesKey, timeStamp.ToString(), HospitalId + ids + delids);
//定义远程接口参数
NameValueCollection c = new NameValueCollection();
c.Add("hospitalId", HospitalId);
c.Add("ids", ids);
- c.Add("delids",delids);
+ c.Add("delids", delids);
c.Add("timestamp", timeStamp.ToString());
c.Add("signature", signature);
//获取远程接口返回数据
@@ -121,8 +121,8 @@ namespace QZWebApi.Controllers
result = HttpHelper.CreateGetHttpRequest(url, c, "", 10000);
}
catch
- {
-
+ {
+
}
return result;
}
@@ -193,18 +193,111 @@ namespace QZWebApi.Controllers
// }
// //string jsonStr = JsonConvert.SerializeObject(m);
-
+
// }
// catch (Exception ex)
// {
// m.message = ex.Message;
// m.status = false;
-
+
// }
// }
// return m;
//}
+
+ /////
+ ///// 获取体检信息
+ /////
+ /////
+ /////
+ /////
+ /////
+ /////
+ //[HttpGet]
+ //public GetTjjlModel getTjxx(string deptId, int planUserId, string timestamp, string signature)
+ //{
+ // GetTjjlModel m = new GetTjjlModel();
+
+ // try
+ // {
+ // //获得请求的时间秒数
+ // long timeStamp = TjSignUtil.Get_Timestamp();
+
+
+
+ // //获取对应计划的数据
+ // DataTable data1 = new DataTable();
+ // DataTable data2 = new DataTable();
+ // DataTable data3 = new DataTable();
+ // DataBase db = new DataBase();
+ // data1 = db.QyeryJL1(deptId, planUserId);
+ // if (data1.Rows.Count == 0)
+ // {
+ // m.status = 1;
+ // m.errorMsg = "该体检计划对应的体检项目未全部完成";
+ // }
+ // else
+ // {
+ // data2 = db.QyeryJL2(planUserId);
+ // data3 = db.QyeryJL3(planUserId);
+ // m.status = 0;
+ // m.errorMsg = "OK";
+ // m.planUserId = Convert.ToInt32(planUserId);
+ // m.date = DateTime.Parse(data1.Rows[0]["summary_date"].ToString()).ToString("yyyy-MM-dd");
+ // TjjlDetails d = new TjjlDetails();
+ // d.summary = data1.Rows[0]["summary"] == DBNull.Value ? "" : data1.Rows[0]["summary"].ToString();
+ // d.suggestion = data1.Rows[0]["suggestion"] == DBNull.Value ? "" : data1.Rows[0]["suggestion"].ToString();
+ // d.cardId = data1.Rows[0]["id_card_no"] == DBNull.Value ? "" : data1.Rows[0]["id_card_no"].ToString();
+ // d.packages = new List();
+ // foreach (DataRow dr in data2.Rows)
+ // {
+ // TjjlPackages p = new TjjlPackages();
+ // p.packageName = dr["asbitem_name"] == DBNull.Value ? "" : dr["asbitem_name"].ToString();
+ // p.fee = dr["price"] == DBNull.Value ? 0d : double.Parse(dr["price"].ToString());
+ // p.summary = dr["summary"] == DBNull.Value ? "" : dr["summary"].ToString();
+ // p.items = new List();
+ // foreach (DataRow dr1 in data3.Rows)
+ // {
+ // JkTjxxBean j = new JkTjxxBean();
+ // if (dr1["asbitem_id"].ToString().Equals(dr["asbitem_id"].ToString()))
+ // {
+ // //j.id=dr1["id"]
+ // j.price = dr1["price"] == DBNull.Value ? 0d : double.Parse(dr1["price"].ToString());
+ // j.tjxmMc = dr1["item_name"] == DBNull.Value ? "" : dr1["item_name"].ToString();
+ // j.reference = dr1["reference"] == DBNull.Value ? "" : dr1["reference"].ToString();
+ // j.remark = dr1["remark"] == DBNull.Value ? "" : dr1["remark"].ToString();
+ // j.tjUnit = dr1["unit"] == DBNull.Value ? "" : dr1["unit"].ToString();
+ // j.ysValue = dr1["result"] == DBNull.Value ? "" : dr1["result"].ToString();
+ // p.items.Add(j);
+ // }
+ // }
+ // d.packages.Add(p);
+ // }
+
+ // string itemsStr = JsonConvert.SerializeObject(d);
+ // m.data = TjSignUtil.AESEncode(itemsStr, ConfigurationManager.AppSettings["AESJavaToNetKey"].ToString());
+ // }
+
+ // return m;
+ // }
+ // catch(Exception ex)
+ // {
+ // m.errorMsg = ex.ToString();
+ // return m;
+ // }
+ //}
+
+
+
+ ///
+ /// 获取体检信息
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
[HttpGet]
public GetTjjlModel getTjxx(string deptId, int planUserId, string timestamp, string signature)
{
@@ -215,91 +308,55 @@ namespace QZWebApi.Controllers
//获得请求的时间秒数
long timeStamp = TjSignUtil.Get_Timestamp();
-
- //{status:true,message:"OK"
- //if (!AesKey.Equals(ConfigurationManager.AppSettings["AESKey"].ToString()))
- //{
- // m.status = 1;
- // m.errorMsg = "身份密匙错误";
- // //return m;
- //}
- //if ((timeStamp - long.Parse(timestamp)) > 10L)
- //{
- // m.status = 1;
- // m.errorMsg = "时间校验失败";
- // //return m;
- //}
- //else if (!TjSignUtil.GetSignatureBytoken(ConfigurationManager.AppSettings["AESKey"].ToString(), timestamp, deptId + planUserId).Equals(signature))
- //{
- // m.status = 1;
- // m.errorMsg = "请求参数签名错误";
- // //return m;
- //}
- //else
- //{
+
+
//获取对应计划的数据
- DataTable data1 = new DataTable();
+ DataTable data_peis = new DataTable();
DataTable data2 = new DataTable();
DataTable data3 = new DataTable();
- DataBase db = new DataBase();
- data1 = db.QyeryJL1(deptId, planUserId);
- if (data1.Rows.Count == 0)
+ SqlSugarHelper db = new SqlSugarHelper();
+ data_peis = db.GetPeisInfo(planUserId.ToString());
+ if (data_peis.Rows.Count == 0)
{
m.status = 1;
m.errorMsg = "该体检计划对应的体检项目未全部完成";
}
else
{
- data2 = db.QyeryJL2(planUserId);
- data3 = db.QyeryJL3(planUserId);
+ //data2 = db.QyeryJL2(planUserId);
+ //data3 = db.QyeryJL3(planUserId);
m.status = 0;
m.errorMsg = "OK";
m.planUserId = Convert.ToInt32(planUserId);
- m.date = DateTime.Parse(data1.Rows[0]["summary_date"].ToString()).ToString("yyyy-MM-dd");
+ m.date = DateTime.Parse(data_peis.Rows[0]["summary_date"].ToString()).ToString("yyyy-MM-dd");
TjjlDetails d = new TjjlDetails();
- d.summary = data1.Rows[0]["summary"] == DBNull.Value ? "" : data1.Rows[0]["summary"].ToString();
- d.suggestion = data1.Rows[0]["suggestion"] == DBNull.Value ? "" : data1.Rows[0]["suggestion"].ToString();
- d.cardId = data1.Rows[0]["id_card_no"] == DBNull.Value ? "" : data1.Rows[0]["id_card_no"].ToString();
- d.packages = new List();
- foreach (DataRow dr in data2.Rows)
- {
- TjjlPackages p = new TjjlPackages();
- p.packageName = dr["asbitem_name"] == DBNull.Value ? "" : dr["asbitem_name"].ToString();
- p.fee = dr["price"] == DBNull.Value ? 0d : double.Parse(dr["price"].ToString());
- p.summary = dr["summary"] == DBNull.Value ? "" : dr["summary"].ToString();
- p.items = new List();
- foreach (DataRow dr1 in data3.Rows)
- {
- JkTjxxBean j = new JkTjxxBean();
- if (dr1["asbitem_id"].ToString().Equals(dr["asbitem_id"].ToString()))
- {
- //j.id=dr1["id"]
- j.price = dr1["price"] == DBNull.Value ? 0d : double.Parse(dr1["price"].ToString());
- j.tjxmMc = dr1["item_name"] == DBNull.Value ? "" : dr1["item_name"].ToString();
- j.reference = dr1["reference"] == DBNull.Value ? "" : dr1["reference"].ToString();
- j.remark = dr1["remark"] == DBNull.Value ? "" : dr1["remark"].ToString();
- j.tjUnit = dr1["unit"] == DBNull.Value ? "" : dr1["unit"].ToString();
- j.ysValue = dr1["result"] == DBNull.Value ? "" : dr1["result"].ToString();
- p.items.Add(j);
- }
- }
- d.packages.Add(p);
- }
+ d.summary = db.GetSumSummary(planUserId.ToString());
+ d.suggestion = db.GetSumSuggestion(planUserId.ToString());
+ d.cardId = string.IsNullOrWhiteSpace(data_peis.Rows[0]["id_no"].ToString()) ? "" : data_peis.Rows[0]["id_no"].ToString();
+ d.packages = db.GetRegisterCheck(planUserId.ToString());
string itemsStr = JsonConvert.SerializeObject(d);
m.data = TjSignUtil.AESEncode(itemsStr, ConfigurationManager.AppSettings["AESJavaToNetKey"].ToString());
}
- //}
- //string jsonStr = JsonConvert.SerializeObject(m);
+
return m;
}
- catch(Exception ex)
+ catch (Exception ex)
{
- m.errorMsg = ex.ToString();
+ m.errorMsg = ex.ToString();
return m;
}
}
+
+ ///
+ /// 获取体检报告
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
[HttpGet]
public TiwdModel getReport(string deptId, int planUserId, string timestamp, string signature)
{
@@ -308,69 +365,34 @@ namespace QZWebApi.Controllers
TiwdModel m = new TiwdModel();
- //{status:true,message:"OK"
- //if (!AesKey.Equals(ConfigurationManager.AppSettings["AESKey"].ToString()))
- //{
- // m.status = 1;
- // m.errorMsg = "身份密匙错误";
- // return m;
- //}
- //if ((timeStamp - long.Parse(timestamp)) > 10L)
- //{
- // m.status = 1;
- // m.errorMsg = "时间校验失败";
- // return m;
- //}
- //if (!TjSignUtil.GetSignatureBytoken(ConfigurationManager.AppSettings["AESKey"], timestamp, deptId + planUserId).Equals(signature))
- //{
- // m.status = 1;
- // m.errorMsg = "请求参数签名错误";
- // return m;
- //}
- //else
+
//{
- //获取对应计划的数据
- DataTable data = new DataTable();
- DataBase db = new DataBase();
- data = db.QyeryBG(deptId, planUserId);
- if (data.Rows.Count == 0)
- {
- m.status = 1;
- m.errorMsg = "没有对应的体检报告";
- return m;
- }
- else
- {
- //byte[] buffer = (byte[])data.Rows[0]["report"];
- //string filename = data.Rows[0]["patient_name"].ToString() + DateTime.Parse(data.Rows[0]["summary_date"].ToString()).ToString("yyyy-MM-dd");
- //string filepath = ConfigurationManager.AppSettings["FileSource"].ToString() + "\\"+ filename+".pdf";
-
- //if (File.Exists(filepath))
- // File.Delete(filepath);
- //using (System.IO.FileStream fs = new System.IO.FileStream(filepath, System.IO.FileMode.Create, System.IO.FileAccess.ReadWrite))
- //{
- // using (System.IO.BinaryWriter bw = new System.IO.BinaryWriter(fs))
- // {
- // bw.Write(buffer);
- // bw.Close();
- // }
- //}
-
- //var f = new FileInfo(filepath);
- //return new FileStreamResult(f.OpenRead(), "application/octet-stream", filename+".pdf");
- m.errorMsg = "";
- m.IsSec = 0;
- m.planUserId = planUserId.ToString();
- var str = Convert.ToBase64String((byte[])data.Rows[0]["report"]);
-
- //m.file = TjSignUtil.AESEncode(str, ConfigurationManager.AppSettings["AESJavaToNetKey"].ToString());
- m.file = str;
- m.type = "pdf";
- m.status = 0;
- return m;
- }
- // }
-
+ //获取对应计划的数据
+ DataTable data = new DataTable();
+ SqlSugarHelper db = new SqlSugarHelper();
+ data = db.GetPeisReport(planUserId.ToString());
+ if (data.Rows.Count == 0)
+ {
+ m.status = 1;
+ m.errorMsg = "没有对应的体检报告";
+ return m;
+ }
+ else
+ {
+
+ m.errorMsg = "";
+ m.IsSec = 0;
+ m.planUserId = planUserId.ToString();
+ var str = db.GetImageBase64StringAsync(ConfigurationManager.AppSettings["WebApiUrl"].ToString() + data.Rows[0]["report_file"].ToString());
+
+
+ m.file = str;
+ m.type = "pdf";
+ m.status = 0;
+ return m;
+ }
+
+
}
// GET api/values
@@ -386,12 +408,12 @@ namespace QZWebApi.Controllers
}
// POST api/values
- public void Post([FromBody]string value)
+ public void Post([FromBody] string value)
{
}
// PUT api/values/5
- public void Put(int id, [FromBody]string value)
+ public void Put(int id, [FromBody] string value)
{
}
diff --git a/QZWebApi/Models/GetTjxxModel.cs b/QZWebApi/Models/GetTjxxModel.cs
index 135a913..86523ef 100644
--- a/QZWebApi/Models/GetTjxxModel.cs
+++ b/QZWebApi/Models/GetTjxxModel.cs
@@ -24,22 +24,50 @@ namespace QZWebApi.Models
public string data;
}
+ ///
+ /// 体检信息1
+ ///
public class TjjlDetails
{
+ ///
+ /// 总检综述
+ ///
public string summary;
+ ///
+ /// 总检建议
+ ///
public string suggestion;
+ ///
+ /// 身份证号码
+ ///
public string cardId;
+
public List packages;
}
-
+ ///
+ /// 体检信息2
+ ///
public class TjjlPackages
{
+ ///
+ /// 套餐
+ ///
public string packageName;
+ ///
+ /// 金额
+ ///
public double fee;
+
+ ///
+ /// 医生小结
+ ///
public string summary;
public List items;
}
+ ///
+ /// 体检信息3
+ ///
public class JkTjxxBean
{
//用户ID
@@ -63,6 +91,10 @@ namespace QZWebApi.Models
}
+
+ ///
+ /// 体检报告
+ ///
public class TiwdModel
{
public int status;
diff --git a/QZWebApi/Models/SqlSugarHelper.cs b/QZWebApi/Models/SqlSugarHelper.cs
new file mode 100644
index 0000000..553ee0b
--- /dev/null
+++ b/QZWebApi/Models/SqlSugarHelper.cs
@@ -0,0 +1,272 @@
+using SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Text;
+using System.Web;
+
+namespace QZWebApi.Models
+{
+ public class SqlSugarHelper
+ {
+ public static string Sqlconn = ConfigurationManager.AppSettings["ConnectionString"].ToString();
+
+ public DataTable GetPeisInfo(string planUserId)
+ {
+ SqlSugarClient WebDb = new SqlSugarClient(new ConnectionConfig()
+ {
+ ConnectionString = Sqlconn,
+ DbType = SqlSugar.DbType.PostgreSQL,
+ IsAutoCloseConnection = true
+ });
+
+ var dt = WebDb.Ado.GetDataTable($"select a.patient_register_id,b.id_no,a.summary_date from patient_register as a left join patient as b on a.patient_id=b.patient_id where a.third_register_id='{planUserId}' and complete_flag='3'");
+
+ return dt;
+
+ }
+
+ ///
+ /// 获取总检综述
+ ///
+ ///
+ ///
+ public string GetSumSummary(string planUserId)
+ {
+ StringBuilder sb = new StringBuilder();
+
+ SqlSugarClient WebDb = new SqlSugarClient(new ConnectionConfig()
+ {
+ ConnectionString = Sqlconn,
+ DbType = SqlSugar.DbType.PostgreSQL,
+ IsAutoCloseConnection = true
+ });
+
+
+ var dt = WebDb.Ado.GetDataTable($"select b.sum_summary_header_id,b.summary_title from patient_register as a left join sum_summary_header as b " +
+ $"on a.patient_register_id=b.patient_register_id where a.third_register_id='{planUserId}' and complete_flag='3' order by b.display_order");
+
+ if (dt.Rows.Count > 0)
+ {
+ foreach (DataRow row in dt.Rows)
+ {
+ sb.Append($" * {row["summary_title"].ToString()}:");
+ var dt2 = WebDb.Ado.GetDataTable($"select b.summary_content from sum_summary_header as a " +
+ $"left join sum_summary_content as b on a.sum_summary_header_id=b.sum_summary_header_id where a.sum_summary_header_id='{row["sum_summary_header_id"].ToString()}' order by b.display_order");
+ if (dt2.Rows.Count > 0)
+ {
+ foreach (DataRow row2 in dt2.Rows)
+ {
+ sb.Append($"{row2["summary_content"].ToString()}");
+ //if (dt2.Rows.IndexOf(row2) == dt2.Rows.Count - 1)
+ //{
+ // sb.Append($"{row2["summary_content"].ToString()}");
+ //}
+ //else
+ //{
+ // sb.Append($"{row2["summary_content"].ToString()}");
+ //}
+
+ }
+ }
+ }
+
+ }
+ return sb.ToString();
+ }
+
+
+ ///
+ /// 获取总检建议
+ ///
+ ///
+ ///
+ public string GetSumSuggestion(string planUserId)
+ {
+ StringBuilder sb = new StringBuilder();
+
+ SqlSugarClient WebDb = new SqlSugarClient(new ConnectionConfig()
+ {
+ ConnectionString = Sqlconn,
+ DbType = SqlSugar.DbType.PostgreSQL,
+ IsAutoCloseConnection = true
+ });
+
+
+ var dt = WebDb.Ado.GetDataTable($"select b.sum_suggestion_header_id,b.suggestion_title from patient_register as a left join sum_suggestion_header as b " +
+ $"on a.patient_register_id=b.patient_register_id where a.third_register_id='{planUserId}' and complete_flag='3' order by b.display_order");
+
+ if (dt.Rows.Count > 0)
+ {
+ foreach (DataRow row in dt.Rows)
+ {
+ sb.Append($" * {row["suggestion_title"].ToString()}:");
+ var dt2 = WebDb.Ado.GetDataTable($"select b.suggestion_content from sum_suggestion_header as a " +
+ $"left join sum_suggestion_content as b on a.sum_suggestion_header_id=b.sum_suggestion_header_id where a.sum_suggestion_header_id='{row["sum_suggestion_header_id"].ToString()}' order by b.display_order");
+ if (dt2.Rows.Count > 0)
+ {
+ foreach (DataRow row2 in dt2.Rows)
+ {
+ sb.Append($"{row2["suggestion_content"].ToString()}");
+ //if (dt2.Rows.IndexOf(row2) == dt2.Rows.Count - 1)
+ //{
+ // sb.Append($"{row2["suggestion_content"].ToString()}");
+ //}
+ //else
+ //{
+ // sb.Append($"{row2["suggestion_content"].ToString()}");
+ //}
+
+ }
+ }
+ }
+
+ }
+ return sb.ToString();
+ }
+
+
+
+ ///
+ /// 获取项目、结果、以及明细
+ ///
+ ///
+ ///
+ public List GetRegisterCheck(string planUserId)
+ {
+
+ List tjjlPackagesList = new List();
+
+ SqlSugarClient WebDb = new SqlSugarClient(new ConnectionConfig()
+ {
+ ConnectionString = Sqlconn,
+ DbType = SqlSugar.DbType.PostgreSQL,
+ IsAutoCloseConnection = true
+ });
+
+
+ var dt = WebDb.Ado.GetDataTable($"select b.register_check_id from patient_register as a left join register_check as b on a.patient_register_id=b.patient_register_id " +
+ $" where a.third_register_id='{planUserId}' and a.complete_flag='3' ");
+
+ if (dt.Rows.Count > 0)
+ {
+
+ foreach (DataRow row in dt.Rows)
+ {
+ TjjlPackages tjjlPackages = new TjjlPackages();
+
+ var dt2 = WebDb.Ado.GetDataTable($"select sum(a.charge_price) as charge_price,STRING_AGG(b.asbitem_name, ',' ORDER BY b.asbitem_name) AS asbitem_name from register_check_asbitem as a " +
+ $"left join asbitem as b on a.asbitem_id = b.asbitem_id where a.register_check_id='{row["register_check_id"].ToString()}' group by register_check_id ");
+ if (dt2.Rows.Count > 0)
+ {
+ tjjlPackages.packageName = dt2.Rows[0]["asbitem_name"].ToString();
+ tjjlPackages.fee = Convert.ToDouble(Convert.ToDecimal(dt2.Rows[0]["charge_price"].ToString()) * 100);
+ }
+
+ var dt3 = WebDb.Ado.GetDataTable($"select summary from register_check_summary where register_check_id='{row["register_check_id"].ToString()}' ");
+ if (dt3.Rows.Count > 0)
+ {
+ string summary = "";
+
+ foreach (DataRow row3 in dt3.Rows)
+ {
+ if (dt3.Rows.IndexOf(row3) == dt3.Rows.Count - 1)
+ {
+ summary += $"{row3["summary"].ToString()},";
+ }
+ else
+ {
+ summary += $"{row3["summary"].ToString()}";
+ }
+ }
+ tjjlPackages.summary = summary;
+ }
+
+
+ //明细结果
+ var dt4 = WebDb.Ado.GetDataTable($"select b.price,b.item_name,a.result,a.reference_range_value,a.unit,c.data_input_prompt from register_check_item as a " +
+ $"left join item as b on a.item_id=b.item_id left join result_status as c on a.result_status_id=c.result_status_id " +
+ $"where a.register_check_id='{row["register_check_id"].ToString()}'");
+ if (dt4.Rows.Count > 0)
+ {
+ List jkTjxxBeanList = new List();
+ foreach (DataRow row4 in dt4.Rows)
+ {
+ JkTjxxBean jkTjxxBean = new JkTjxxBean();
+ jkTjxxBean.price = Convert.ToDouble(Convert.ToDecimal(row4["price"].ToString()) * 100);
+ jkTjxxBean.ysValue = row4["result"].ToString();
+ jkTjxxBean.tjxmMc = row4["item_name"].ToString();
+ jkTjxxBean.tjUnit = row4["unit"].ToString();
+ jkTjxxBean.reference = row4["reference_range_value"].ToString();
+
+ string remark = "-1";
+
+ if (row4["data_input_prompt"] != DBNull.Value)
+ {
+ if (row4["data_input_prompt"].ToString() == "")
+ {
+ remark = "0";
+ }
+ else if (row4["data_input_prompt"].ToString() == "+" || row4["data_input_prompt"].ToString() == "↑" || row4["data_input_prompt"].ToString() == "±")
+ {
+ remark = "2";
+ }
+ else
+ {
+ remark = "1";
+ }
+ }
+ jkTjxxBean.remark = remark;
+
+ jkTjxxBeanList.Add(jkTjxxBean);
+ }
+ }
+
+ tjjlPackagesList.Add(tjjlPackages);
+ }
+ }
+
+ return tjjlPackagesList;
+ }
+
+ public DataTable GetPeisReport(string planUserId)
+ {
+ SqlSugarClient WebDb = new SqlSugarClient(new ConnectionConfig()
+ {
+ ConnectionString = Sqlconn,
+ DbType = SqlSugar.DbType.PostgreSQL,
+ IsAutoCloseConnection = true
+ });
+
+ var dt = WebDb.Ado.GetDataTable($"select report_file from patient_register where third_register_id='{planUserId}' and complete_flag='3'");
+
+ return dt;
+ }
+
+ public string GetImageBase64StringAsync(string pdfUrl)
+ {
+ string result = "";
+ try
+ {
+ pdfUrl = pdfUrl.Replace(@"\", "/");
+
+ WebClient webClient = new WebClient();
+ byte[] byteArray =webClient.DownloadData(pdfUrl);
+ result = Convert.ToBase64String(byteArray);
+
+ }
+ catch
+ {
+ result = "";
+ }
+
+ //if (!string.IsNullOrEmpty(result))
+ // result = "data:image/jpeg;base64," + result;
+ return result;
+ }
+ }
+}
\ No newline at end of file
diff --git a/QZWebApi/QZWebApi.csproj b/QZWebApi/QZWebApi.csproj
index 2513c20..7ff38ca 100644
--- a/QZWebApi/QZWebApi.csproj
+++ b/QZWebApi/QZWebApi.csproj
@@ -46,11 +46,48 @@
4
+
+ ..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll
+
+
+ ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll
+
+
+ ..\packages\Npgsql.4.1.14\lib\net461\Npgsql.dll
+
+
+ ..\packages\sqlSugar.5.0.0\lib\SqlSugar.dll
+
+
+ ..\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll
+
+
+ ..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll
+
+
+
+ ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll
+
+
+ ..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll
+
+
+ ..\packages\System.Text.Encodings.Web.4.6.0\lib\netstandard2.0\System.Text.Encodings.Web.dll
+
+
+ ..\packages\System.Text.Json.4.6.0\lib\net461\System.Text.Json.dll
+
+
+ ..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll
+
+
+ ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll
+
@@ -66,9 +103,6 @@
True
..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll
-
- ..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll
-
@@ -170,6 +204,7 @@
+
diff --git a/QZWebApi/Web.config b/QZWebApi/Web.config
index 75be93d..df84c7c 100644
--- a/QZWebApi/Web.config
+++ b/QZWebApi/Web.config
@@ -1,18 +1,20 @@
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
\ No newline at end of file
diff --git a/QZWebApi/packages.config b/QZWebApi/packages.config
index c8f8fcc..1782896 100644
--- a/QZWebApi/packages.config
+++ b/QZWebApi/packages.config
@@ -19,9 +19,20 @@
+
-
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file