|
@@ -12227,6 +12227,10 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
|
|
|
TimeSpan t3 = EndDate - StartDate; //两个时间相减 。默认得到的是 两个时间之间的天数 得到:365.00:00:00
|
|
|
var getDay = t3.Days;
|
|
|
if (getDay == 0) getDay = 1;
|
|
|
+
|
|
|
+ //获取时间区间
|
|
|
+
|
|
|
+
|
|
|
string[] Day = new string[] { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" };
|
|
|
_sqlSugar.BeginTran();
|
|
|
for (int i = 0; i < getDay; i++)
|
|
@@ -12332,8 +12336,8 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
|
|
|
group.VisitPNumber,
|
|
|
group.TeamName,
|
|
|
group.Id,
|
|
|
- group.VisitStartDate,
|
|
|
- group.VisitEndDate
|
|
|
+ visitStartDate = group.VisitStartDate.ToString("yyyy-MM-dd"),
|
|
|
+ visitEndDate = group.VisitEndDate.ToString("yyyy-MM-dd")
|
|
|
},
|
|
|
};
|
|
|
|
|
@@ -12753,6 +12757,114 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
|
|
|
lshCell.AppendChild(p);
|
|
|
}
|
|
|
|
|
|
+ [HttpPost]
|
|
|
+ public async Task<IActionResult> ServerHttp(string paramStr)
|
|
|
+ {
|
|
|
+ paramStr = paramStr.TrimEnd('\'');
|
|
|
+ paramStr = paramStr.TrimStart('\'');
|
|
|
+ JsonView jw = JsonView(false);
|
|
|
+ JObject param = JObject.Parse(paramStr);
|
|
|
+ if (!param.ContainsKey("url"))
|
|
|
+ {
|
|
|
+ jw.Msg = "url null";
|
|
|
+ return Ok(jw);
|
|
|
+ }
|
|
|
+
|
|
|
+ string url = param["url"]!.ToString();
|
|
|
+ var methon = "get";
|
|
|
+
|
|
|
+ Dictionary<string, string> bodyValues = null;
|
|
|
+ Dictionary<string, string> headValues = null;
|
|
|
+
|
|
|
+ if (param.ContainsKey("methon"))
|
|
|
+ {
|
|
|
+ methon = param["methon"]!.ToString();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (param.ContainsKey("header"))
|
|
|
+ {
|
|
|
+ var header = param["header"]!.ToString();
|
|
|
+ JObject headerJobject = JObject.Parse(header);
|
|
|
+ headValues = new Dictionary<string, string>();
|
|
|
+ foreach (JProperty item in headerJobject.Properties())
|
|
|
+ {
|
|
|
+ var value = item.Value.ToString();
|
|
|
+ var head = item.Path;
|
|
|
+ headValues.Add(head, value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (param.ContainsKey("body"))
|
|
|
+ {
|
|
|
+ var body = param["body"]!.ToString();
|
|
|
+ bodyValues = new Dictionary<string, string>();
|
|
|
+ JObject bodyJobject = JObject.Parse(body);
|
|
|
+ foreach (JProperty item in bodyJobject.Properties())
|
|
|
+ {
|
|
|
+ var value = item.Value.ToString();
|
|
|
+ var head = item.Path;
|
|
|
+ bodyValues.Add(head, value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ HttpClient client = new HttpClient();
|
|
|
+ string responseString = string.Empty;
|
|
|
+
|
|
|
+ if (param.ContainsKey("isJson"))
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (headValues != null)
|
|
|
+ {
|
|
|
+ foreach (var item in headValues.Keys)
|
|
|
+ {
|
|
|
+ client.DefaultRequestHeaders.Add(item, headValues[item]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if (methon == "get")
|
|
|
+ {
|
|
|
+ responseString = await client.GetStringAsync(url);
|
|
|
+
|
|
|
+ }
|
|
|
+ else if (methon == "post")
|
|
|
+ {
|
|
|
+
|
|
|
+ if (bodyValues == null)
|
|
|
+ {
|
|
|
+ jw.Msg = "methon post body null";
|
|
|
+ return Ok(jw);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 数据转化为 key=val 格式
|
|
|
+ var content = new FormUrlEncodedContent(bodyValues);
|
|
|
+ var response = await client.PostAsync(url, content);
|
|
|
+ // 获取数据
|
|
|
+ responseString = await response.Content.ReadAsStringAsync();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ jw.Msg = "methon error";
|
|
|
+ }
|
|
|
+
|
|
|
+ jw = JsonView(true, "success", responseString);
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ jw.Msg = "error " + ex.Message;
|
|
|
+ jw.Data = ex.StackTrace;
|
|
|
+ }
|
|
|
+ finally
|
|
|
+ {
|
|
|
+ client.Dispose();
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(jw);
|
|
|
+ }
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
// /// <summary>
|