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
3fedcb42
Commit
3fedcb42
authored
Aug 17, 2020
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
科室cmi未分配取值报错,http请求方法修改,绩效抽取注释人员及4.1抽取
parent
716adc59
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
63 additions
and
29 deletions
+63
-29
performance/Performance.Api/Controllers/TemplateController.cs
+0
-2
performance/Performance.Api/wwwroot/Performance.Api.xml
+1
-2
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 @
3fedcb42
...
@@ -308,7 +308,6 @@ public IActionResult DownFile([FromQuery] AllotRequest request)
...
@@ -308,7 +308,6 @@ public IActionResult DownFile([FromQuery] AllotRequest request)
public
ApiResponse
SaveFile
([
FromForm
]
IFormCollection
form
,
int
allotId
,
int
hospitalId
)
public
ApiResponse
SaveFile
([
FromForm
]
IFormCollection
form
,
int
allotId
,
int
hospitalId
)
{
{
logger
.
LogInformation
(
$"保存提取文件请求参数:allotId:
{
allotId
}
hospitalId:
{
hospitalId
}
"
);
logger
.
LogInformation
(
$"保存提取文件请求参数:allotId:
{
allotId
}
hospitalId:
{
hospitalId
}
"
);
logger
.
LogInformation
(
$"保存提取文件 参数:allotId:
{
allotId
}
hospitalId:
{
hospitalId
}
"
);
try
try
{
{
var
file
=
((
FormFileCollection
)
form
.
Files
).
FirstOrDefault
();
var
file
=
((
FormFileCollection
)
form
.
Files
).
FirstOrDefault
();
...
@@ -364,7 +363,6 @@ public ApiResponse SaveFile([FromForm] IFormCollection form, int allotId, int ho
...
@@ -364,7 +363,6 @@ public ApiResponse SaveFile([FromForm] IFormCollection form, int allotId, int ho
/// <param name="tag"></param>
/// <param name="tag"></param>
/// <param name="message"></param>
/// <param name="message"></param>
/// <param name="level"></param>
/// <param name="level"></param>
/// <param name="success"></param>
/// <param name="groupName"></param>
/// <param name="groupName"></param>
[
Route
(
"returnlog"
)]
[
Route
(
"returnlog"
)]
[
HttpPost
]
[
HttpPost
]
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
3fedcb42
...
@@ -1190,7 +1190,7 @@
...
@@ -1190,7 +1190,7 @@
<param
name=
"hospitalId"
></param>
<param
name=
"hospitalId"
></param>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"M:Performance.Api.Controllers.TemplateController.ReturnLog(System.Int32,System.String,System.String,System.Int32,System.
Boolean,System.
String)"
>
<member
name=
"M:Performance.Api.Controllers.TemplateController.ReturnLog(System.Int32,System.String,System.String,System.Int32,System.String)"
>
<summary>
<summary>
返回日志
返回日志
</summary>
</summary>
...
@@ -1198,7 +1198,6 @@
...
@@ -1198,7 +1198,6 @@
<param
name=
"tag"
></param>
<param
name=
"tag"
></param>
<param
name=
"message"
></param>
<param
name=
"message"
></param>
<param
name=
"level"
></param>
<param
name=
"level"
></param>
<param
name=
"success"
></param>
<param
name=
"groupName"
></param>
<param
name=
"groupName"
></param>
</member>
</member>
<member
name=
"M:Performance.Api.Controllers.TemplateController.ReturnLog(Performance.EntityModels.log_dbug)"
>
<member
name=
"M:Performance.Api.Controllers.TemplateController.ReturnLog(Performance.EntityModels.log_dbug)"
>
...
...
performance/Performance.Extract.Api/Controllers/ExtractController.cs
View file @
3fedcb42
...
@@ -155,7 +155,8 @@ public void ExtractData([FromForm] IFormCollection form, int allotId, int hospit
...
@@ -155,7 +155,8 @@ public void ExtractData([FromForm] IFormCollection form, int allotId, int hospit
if
(!
string
.
IsNullOrEmpty
(
filePath
)
&&
FileHelper
.
IsExistFile
(
filePath
))
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
,
allotId
,
hospitalId
hospitalId
...
@@ -169,7 +170,8 @@ public void ExtractData([FromForm] IFormCollection form, int allotId, int hospit
...
@@ -169,7 +170,8 @@ public void ExtractData([FromForm] IFormCollection form, int allotId, int hospit
logger
.
LogInformation
(
$"正在尝试第
{
i
}
次保存!"
);
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
(
"保存提取文件返回结果:"
+
JsonHelper
.
Serialize
(
retJson
));
logger
.
LogInformation
(
retJson
);
logger
.
LogInformation
(
retJson
);
var
ret
=
JsonHelper
.
Deserialize
<
ApiResponse
>(
retJson
);
var
ret
=
JsonHelper
.
Deserialize
<
ApiResponse
>(
retJson
);
...
...
performance/Performance.Infrastructure/Helper/HttpHelper.cs
View file @
3fedcb42
using
System
;
using
RestSharp
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.IO
;
using
System.Linq
;
using
System.Net
;
using
System.Net
;
using
System.Net.Http
;
using
System.Net.Http
;
using
System.Net.Security
;
using
System.Net.Security
;
...
@@ -191,5 +193,36 @@ public static string HttpClient(string url, string file, bool IsAsync = false)
...
@@ -191,5 +193,36 @@ public static string HttpClient(string url, string file, bool IsAsync = false)
throw
ex
;
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 @
3fedcb42
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
<PackageReference Include="Microsoft.Extensions.Options" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="2.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="CSRedisCore" Version="3.0.45" />
<PackageReference Include="CSRedisCore" Version="3.0.45" />
<PackageReference Include="RestSharp" Version="106.11.4" />
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
...
...
performance/Performance.Services/DFExtractService.cs
View file @
3fedcb42
...
@@ -395,12 +395,12 @@ public string TemplateExecute(string email, sys_hospital hospital, List<sys_hosp
...
@@ -395,12 +395,12 @@ public string TemplateExecute(string email, sys_hospital hospital, List<sys_hosp
var
sheetRead
=
PerSheetDataFactory
.
GetDataRead
(
sheetType
);
var
sheetRead
=
PerSheetDataFactory
.
GetDataRead
(
sheetType
);
switch
(
sheetType
)
switch
(
sheetType
)
{
{
case
SheetType
.
Employee
:
//
case SheetType.Employee:
WriteEmployee
(
sheet
,
sheetRead
);
//
WriteEmployee(sheet, sheetRead);
break
;
//
break;
case
SheetType
.
ClinicEmployee
:
//
case SheetType.ClinicEmployee:
WriteClinicEmployee
(
sheet
,
sheetRead
);
//
WriteClinicEmployee(sheet, sheetRead);
break
;
//
break;
case
SheetType
.
OtherIncome
:
case
SheetType
.
OtherIncome
:
WriteOtherIncome
(
sheet
,
sheetRead
,
modules
,
items
,
data
);
WriteOtherIncome
(
sheet
,
sheetRead
,
modules
,
items
,
data
);
break
;
break
;
...
@@ -413,9 +413,9 @@ public string TemplateExecute(string email, sys_hospital hospital, List<sys_hosp
...
@@ -413,9 +413,9 @@ public string TemplateExecute(string email, sys_hospital hospital, List<sys_hosp
case
SheetType
.
Workload
:
case
SheetType
.
Workload
:
WriteWorkload
(
sheet
,
sheetRead
,
modules
,
items
,
data
);
WriteWorkload
(
sheet
,
sheetRead
,
modules
,
items
,
data
);
break
;
break
;
case
SheetType
.
AccountBasic
:
//
case SheetType.AccountBasic:
WriteAccountBasic
(
sheet
,
sheetRead
);
//
WriteAccountBasic(sheet, sheetRead);
break
;
//
break;
case
SheetType
.
SpecialUnit
:
case
SheetType
.
SpecialUnit
:
WriteSpecialUnit
(
sheet
,
sheetRead
,
specials
,
data
);
WriteSpecialUnit
(
sheet
,
sheetRead
,
specials
,
data
);
break
;
break
;
...
@@ -487,12 +487,12 @@ public string AlllotExecute(string email, sys_hospital hospital, List<sys_hospit
...
@@ -487,12 +487,12 @@ public string AlllotExecute(string email, sys_hospital hospital, List<sys_hospit
var
sheetRead
=
PerSheetDataFactory
.
GetDataRead
(
sheetType
);
var
sheetRead
=
PerSheetDataFactory
.
GetDataRead
(
sheetType
);
switch
(
sheetType
)
switch
(
sheetType
)
{
{
case
SheetType
.
Employee
:
//
case SheetType.Employee:
WriteEmployee
(
sheet
,
sheetRead
,
false
);
//
WriteEmployee(sheet, sheetRead, false);
break
;
//
break;
case
SheetType
.
ClinicEmployee
:
//
case SheetType.ClinicEmployee:
WriteClinicEmployee
(
sheet
,
sheetRead
,
false
);
//
WriteClinicEmployee(sheet, sheetRead, false);
break
;
//
break;
case
SheetType
.
OtherIncome
:
case
SheetType
.
OtherIncome
:
ClearData
(
sheet
,
5
,
7
);
ClearData
(
sheet
,
5
,
7
);
WriteOtherIncome
(
sheet
,
sheetRead
,
modules
,
items
,
extracts
,
false
);
WriteOtherIncome
(
sheet
,
sheetRead
,
modules
,
items
,
extracts
,
false
);
...
@@ -509,9 +509,9 @@ public string AlllotExecute(string email, sys_hospital hospital, List<sys_hospit
...
@@ -509,9 +509,9 @@ public string AlllotExecute(string email, sys_hospital hospital, List<sys_hospit
ClearData
(
sheet
,
3
,
3
);
ClearData
(
sheet
,
3
,
3
);
WriteWorkload
(
sheet
,
sheetRead
,
modules
,
items
,
extracts
,
false
);
WriteWorkload
(
sheet
,
sheetRead
,
modules
,
items
,
extracts
,
false
);
break
;
break
;
case
SheetType
.
AccountBasic
:
//
case SheetType.AccountBasic:
WriteAccountBasic
(
sheet
,
sheetRead
,
false
);
//
WriteAccountBasic(sheet, sheetRead, false);
break
;
//
break;
case
SheetType
.
SpecialUnit
:
case
SheetType
.
SpecialUnit
:
ClearData
(
sheet
,
2
,
0
);
ClearData
(
sheet
,
2
,
0
);
WriteSpecialUnit
(
sheet
,
sheetRead
,
specials
,
extracts
,
lastAllot
,
false
);
WriteSpecialUnit
(
sheet
,
sheetRead
,
specials
,
extracts
,
lastAllot
,
false
);
...
...
performance/Performance.Services/LogManageService.cs
View file @
3fedcb42
...
@@ -81,9 +81,9 @@ public void ReturnTheLog(int allotId, string groupName, int type, string tag, ob
...
@@ -81,9 +81,9 @@ public void ReturnTheLog(int allotId, string groupName, int type, string tag, ob
try
try
{
{
var
http
=
url
.
ImportFile
+
$"/template/returnlog?type=
{
type
}
&tag=
{
tag
}
&message=
{
message
}
&level=
{
level
}
&groupName=
{
groupName
}
"
;
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
);
logdbug
.
Add
(
allotId
,
tag
,
message
.
ToString
(),
level
,
type
);
HttpHelper
.
HttpPost
NoRequest
(
http
,
""
);
HttpHelper
.
HttpPost
(
http
);
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
...
...
performance/Performance.Services/PerExcelService/SheetDataCompute/PerSheetDataComputeWorkload.cs
View file @
3fedcb42
...
@@ -149,8 +149,8 @@ public PerSheet OnceCompute(PerSheet sheet, List<CofDrugProp> confs = null)
...
@@ -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
);
return
(
group
.
Sum
(
s
=>
s
.
IsFactor
?
s
.
CellValue
*
s
.
FactorValue
:
s
.
CellValue
),
null
);
else
else
{
{
var
factor
=
confs
.
FirstOrDefault
(
t
=>
t
.
AccoutingUnit
==
group
.
First
().
AccountingUnit
)?.
Factor
??
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
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
));
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