Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
performance
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zry
performance
Commits
02aad627
Commit
02aad627
authored
Aug 17, 2020
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '医护工作量' into v2020calculate
parents
d8751755
3fedcb42
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
62 additions
and
28 deletions
+62
-28
performance/Performance.Api/Controllers/TemplateController.cs
+0
-2
performance/Performance.Api/wwwroot/Performance.Api.xml
+0
-1
performance/Performance.Extract.Api/Controllers/ExtractController.cs
+4
-2
performance/Performance.Infrastructure/Helper/HttpHelper.cs
+35
-1
performance/Performance.Infrastructure/Performance.Infrastructure.csproj
+1
-0
performance/Performance.Services/DFExtractService.cs
+18
-18
performance/Performance.Services/LogManageService.cs
+2
-2
performance/Performance.Services/PerExcelService/SheetDataCompute/PerSheetDataComputeWorkload.cs
+2
-2
No files found.
performance/Performance.Api/Controllers/TemplateController.cs
View file @
02aad627
...
...
@@ -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
]
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
02aad627
...
...
@@ -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)"
>
...
...
performance/Performance.Extract.Api/Controllers/ExtractController.cs
View file @
02aad627
...
...
@@ -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
);
...
...
performance/Performance.Infrastructure/Helper/HttpHelper.cs
View file @
02aad627
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
performance/Performance.Infrastructure/Performance.Infrastructure.csproj
View file @
02aad627
...
...
@@ -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>
...
...
performance/Performance.Services/DFExtractService.cs
View file @
02aad627
...
...
@@ -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
);
...
...
performance/Performance.Services/LogManageService.cs
View file @
02aad627
...
...
@@ -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
.
HttpPost
NoRequest
(
http
,
""
);
HttpHelper
.
HttpPost
(
http
);
}
catch
(
Exception
ex
)
{
...
...
performance/Performance.Services/PerExcelService/SheetDataCompute/PerSheetDataComputeWorkload.cs
View file @
02aad627
...
...
@@ -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
));
//需要乘系数的项
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment