Commit 02aad627 by ruyun.zhang@suvalue.com

Merge branch '医护工作量' into v2020calculate

parents d8751755 3fedcb42
......@@ -308,7 +308,6 @@ public IActionResult DownFile([FromQuery] AllotRequest request)
public ApiResponse SaveFile([FromForm] IFormCollection form, int allotId, int hospitalId)
{
logger.LogInformation($"保存提取文件请求参数:allotId:{allotId} hospitalId:{hospitalId}");
logger.LogInformation($"保存提取文件 参数:allotId:{allotId} hospitalId:{hospitalId}");
try
{
var file = ((FormFileCollection)form.Files).FirstOrDefault();
......@@ -364,7 +363,6 @@ public ApiResponse SaveFile([FromForm] IFormCollection form, int allotId, int ho
/// <param name="tag"></param>
/// <param name="message"></param>
/// <param name="level"></param>
/// <param name="success"></param>
/// <param name="groupName"></param>
[Route("returnlog")]
[HttpPost]
......
......@@ -1226,7 +1226,6 @@
<param name="tag"></param>
<param name="message"></param>
<param name="level"></param>
<param name="success"></param>
<param name="groupName"></param>
</member>
<member name="M:Performance.Api.Controllers.TemplateController.ReturnLog(Performance.EntityModels.log_dbug)">
......
......@@ -155,7 +155,8 @@ public void ExtractData([FromForm] IFormCollection form, int allotId, int hospit
if (!string.IsNullOrEmpty(filePath) && FileHelper.IsExistFile(filePath))
{
logger.LogInformation("请求路径:" + url.ImportFile + ",请求参数" + JsonHelper.Serialize(new
string http = url.ImportFile + $"/template/savefile?allotId={allotId}&hospitalId={hospitalId}";
logger.LogInformation("请求路径:" + http + ",请求参数" + JsonHelper.Serialize(new
{
allotId,
hospitalId
......@@ -169,7 +170,8 @@ public void ExtractData([FromForm] IFormCollection form, int allotId, int hospit
logger.LogInformation($"正在尝试第{i}次保存!");
//保存文件
string retJson = HttpHelper.HttpClient(url.ImportFile + $"/template/savefile?allotId={allotId}&hospitalId={hospitalId}", filePath);
var files = new Dictionary<string, string> { { "file", filePath } };
string retJson = HttpHelper.HttpPost(http, files: files);
logger.LogInformation("保存提取文件返回结果:" + JsonHelper.Serialize(retJson));
logger.LogInformation(retJson);
var ret = JsonHelper.Deserialize<ApiResponse>(retJson);
......
using System;
using RestSharp;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Security;
......@@ -191,5 +193,36 @@ public static string HttpClient(string url, string file, bool IsAsync = false)
throw ex;
}
}
public static string HttpPost(string url, int timeout = -1, Dictionary<string, string> files = null, Dictionary<string, string> parameters = null)
{
try
{
var client = new RestClient(url);
client.Timeout = timeout;
var request = new RestRequest(Method.POST);
if (files != null && files.Any())
{
foreach (var item in files)
{
request.AddFile(item.Key, item.Value);
}
}
if (parameters != null && parameters.Any())
{
foreach (var item in parameters)
{
request.AddParameter(item.Key, item.Value);
}
}
IRestResponse response = client.Execute(request);
return response.Content;
}
catch (Exception ex)
{
throw ex;
}
}
}
}
\ No newline at end of file
......@@ -11,6 +11,7 @@
<PackageReference Include="Microsoft.Extensions.Options" Version="2.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="CSRedisCore" Version="3.0.45" />
<PackageReference Include="RestSharp" Version="106.11.4" />
</ItemGroup>
<ItemGroup>
......
......@@ -395,12 +395,12 @@ public string TemplateExecute(string email, sys_hospital hospital, List<sys_hosp
var sheetRead = PerSheetDataFactory.GetDataRead(sheetType);
switch (sheetType)
{
case SheetType.Employee:
WriteEmployee(sheet, sheetRead);
break;
case SheetType.ClinicEmployee:
WriteClinicEmployee(sheet, sheetRead);
break;
//case SheetType.Employee:
// WriteEmployee(sheet, sheetRead);
// break;
//case SheetType.ClinicEmployee:
// WriteClinicEmployee(sheet, sheetRead);
// break;
case SheetType.OtherIncome:
WriteOtherIncome(sheet, sheetRead, modules, items, data);
break;
......@@ -413,9 +413,9 @@ public string TemplateExecute(string email, sys_hospital hospital, List<sys_hosp
case SheetType.Workload:
WriteWorkload(sheet, sheetRead, modules, items, data);
break;
case SheetType.AccountBasic:
WriteAccountBasic(sheet, sheetRead);
break;
//case SheetType.AccountBasic:
// WriteAccountBasic(sheet, sheetRead);
// break;
case SheetType.SpecialUnit:
WriteSpecialUnit(sheet, sheetRead, specials, data);
break;
......@@ -487,12 +487,12 @@ public string AlllotExecute(string email, sys_hospital hospital, List<sys_hospit
var sheetRead = PerSheetDataFactory.GetDataRead(sheetType);
switch (sheetType)
{
case SheetType.Employee:
WriteEmployee(sheet, sheetRead, false);
break;
case SheetType.ClinicEmployee:
WriteClinicEmployee(sheet, sheetRead, false);
break;
//case SheetType.Employee:
// WriteEmployee(sheet, sheetRead, false);
// break;
//case SheetType.ClinicEmployee:
// WriteClinicEmployee(sheet, sheetRead, false);
// break;
case SheetType.OtherIncome:
ClearData(sheet, 5, 7);
WriteOtherIncome(sheet, sheetRead, modules, items, extracts, false);
......@@ -509,9 +509,9 @@ public string AlllotExecute(string email, sys_hospital hospital, List<sys_hospit
ClearData(sheet, 3, 3);
WriteWorkload(sheet, sheetRead, modules, items, extracts, false);
break;
case SheetType.AccountBasic:
WriteAccountBasic(sheet, sheetRead, false);
break;
//case SheetType.AccountBasic:
// WriteAccountBasic(sheet, sheetRead, false);
// break;
case SheetType.SpecialUnit:
ClearData(sheet, 2, 0);
WriteSpecialUnit(sheet, sheetRead, specials, extracts, lastAllot, false);
......
......@@ -81,9 +81,9 @@ public void ReturnTheLog(int allotId, string groupName, int type, string tag, ob
try
{
var http = url.ImportFile + $"/template/returnlog?type={type}&tag={tag}&message={message}&level={level}&groupName={groupName}";
logger.LogInformation("发送日志:" + http);
//logger.LogInformation("发送日志:" + http);
logdbug.Add(allotId, tag, message.ToString(), level, type);
HttpHelper.HttpPostNoRequest(http, "");
HttpHelper.HttpPost(http);
}
catch (Exception ex)
{
......
......@@ -149,8 +149,8 @@ public PerSheet OnceCompute(PerSheet sheet, List<CofDrugProp> confs = null)
return (group.Sum(s => s.IsFactor ? s.CellValue * s.FactorValue : s.CellValue), null);
else
{
var factor = confs.FirstOrDefault(t => t.AccoutingUnit == group.First().AccountingUnit)?.Factor ?? 1;
var cmifactor = cmis.FirstOrDefault(t => t.AccountingUnit == group.First().AccountingUnit && unittype.Contains(t.UnitType))?.Value ?? 1;
var factor = confs?.FirstOrDefault(t => t.AccoutingUnit == group.First().AccountingUnit)?.Factor ?? 1;
var cmifactor = cmis?.FirstOrDefault(t => t.AccountingUnit == group.First().AccountingUnit && unittype.Contains(t.UnitType))?.Value ?? 1;
//需要乘系数的项
var fgroup = group.Where(t => workitems.Select(s => s.Item).Contains(t.TypeName));
//需要乘系数的项
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment