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
35631822
Commit
35631822
authored
Feb 25, 2021
by
钟博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提取数据完成后可以选择上传
parent
f7c5bf9d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
3 deletions
+49
-3
performance/Performance.Api/Controllers/AllotController.cs
+46
-0
performance/Performance.Services/CollectService.cs
+3
-3
No files found.
performance/Performance.Api/Controllers/AllotController.cs
View file @
35631822
...
@@ -168,6 +168,52 @@ public ApiResponse Import([FromForm] IFormCollection form)
...
@@ -168,6 +168,52 @@ public ApiResponse Import([FromForm] IFormCollection form)
return
new
ApiResponse
(
ResponseType
.
OK
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
}
/// <summary>
/// 上传文件
/// </summary>
/// <param name="form"></param>
/// <returns></returns>
[
Route
(
"ImportExtraction/{allotId}"
)]
[
HttpPost
]
public
ApiResponse
ImportExtraction
(
int
allotId
)
{
var
allot
=
_allotService
.
GetAllot
(
allotId
);
if
(
allot
==
null
)
return
new
ApiResponse
(
ResponseType
.
Fail
,
"allotid不存在"
);
var
fileName
=
allot
.
ExtractPath
.
Split
(
"\\"
).
Last
().
Replace
(
@"\d"
,
""
);
//var file = ((FormFileCollection)allot.ExtractPath).FirstOrDefault();
//if (file == null)
// return new ApiResponse(ResponseType.Fail, "参数错误", "文件无效");
var
name
=
FileHelper
.
GetFileNameNoExtension
(
fileName
)
+
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmssfff"
);
var
ext
=
FileHelper
.
GetExtension
(
fileName
);
var
dpath
=
Path
.
Combine
(
_evn
.
ContentRootPath
,
"Files"
,
$"
{
allot
.
HospitalId
}
"
,
$"
{
allot
.
Year
}{
allot
.
Month
.
ToString
().
PadLeft
(
2
,
'0'
)}
"
);
FileHelper
.
CreateDirectory
(
dpath
);
var
path
=
Path
.
Combine
(
dpath
,
$"
{
name
}{
ext
}
"
);
using
(
var
stream
=
System
.
IO
.
File
.
OpenRead
(
allot
.
ExtractPath
))
{
byte
[]
bytes
=
new
byte
[
stream
.
Length
];
stream
.
Read
(
bytes
,
0
,
bytes
.
Length
);
if
(!
FileHelper
.
CreateFile
(
path
,
bytes
))
return
new
ApiResponse
(
ResponseType
.
Fail
,
$"上传失败"
);
allot
.
Path
=
path
;
allot
.
States
=
(
int
)
AllotStates
.
FileUploaded
;
allot
.
Remark
=
EnumHelper
.
GetDescription
(
AllotStates
.
FileUploaded
);
allot
.
UploadDate
=
DateTime
.
Now
;
allot
.
Generate
=
(
int
)
AllotGenerate
.
Init
;
if
(!
_allotService
.
Update
(
allot
))
return
new
ApiResponse
(
ResponseType
.
Fail
,
$"上传成功,修改状态失败"
);
_configService
.
Clear
(
allot
.
ID
);
}
return
new
ApiResponse
(
ResponseType
.
OK
);
}
/// <summary>
/// <summary>
/// 绩效生成
/// 绩效生成
/// </summary>
/// </summary>
...
...
performance/Performance.Services/CollectService.cs
View file @
35631822
...
@@ -766,15 +766,15 @@ private void UnitFit(List<HandsonRowData> rowDatas, List<HandsonCellData> cellDa
...
@@ -766,15 +766,15 @@ private void UnitFit(List<HandsonRowData> rowDatas, List<HandsonCellData> cellDa
exists
=
true
;
exists
=
true
;
}
}
if
(
cellData
.
Name
==
"核算单元分类"
&&
cellData
.
Value
?.
ToString
()
==
cell
.
Value
)
if
(
cellData
.
Name
==
"核算单元分类"
&&
cellData
.
Value
==
cell
.
Value
)
{
{
exists2
=
true
;
exists2
=
true
;
}
}
else
if
(
cellData
.
Name
==
"核算组别"
&&
cellData
.
Value
?.
ToString
()
==
cell
.
Value
)
else
if
(
cellData
.
Name
==
"核算组别"
&&
cellData
.
Value
==
cell
.
Value
)
{
{
exists2
=
true
;
exists2
=
true
;
}
}
else
if
(
cellData
.
Name
==
"核算单元类型"
&&
cellData
.
Value
?.
ToString
()
==
cell
.
Value
)
else
if
(
cellData
.
Name
==
"核算单元类型"
&&
cellData
.
Value
==
cell
.
Value
)
{
{
exists2
=
true
;
exists2
=
true
;
}
}
...
...
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