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
ebc7135c
Commit
ebc7135c
authored
May 12, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
抽取时4.1及5.*补充科室修改,优先抽取4.1,兼容核算单元类别写入,nolg配置修改,优化抽取跳过抽取数据全为0的科室
parent
4ce6a08f
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
70 additions
and
24 deletions
+70
-24
performance/Performance.Api/Job/JobRegistry.cs
+2
-2
performance/Performance.Api/Performance.Api.csproj
+1
-1
performance/Performance.Api/Program.cs
+18
-1
performance/Performance.Api/Properties/PublishProfiles/FolderProfile.pubxml
+8
-11
performance/Performance.Api/Startup.cs
+1
-4
performance/Performance.Api/wwwroot/Performance.Api.xml
+2
-2
performance/Performance.Services/ExtractExcelService/ExtractHelper/WriteDataHelper.cs
+2
-2
performance/Performance.Services/ExtractExcelService/ExtractJobService.cs
+2
-0
performance/Performance.Services/ExtractExcelService/ExtractService.cs
+32
-1
performance/Performance.Services/ExtractExcelService/SheetDataWrite/AccountExtraDataWrite.cs
+2
-0
No files found.
performance/Performance.Api/Job/JobRegistry.cs
View file @
ebc7135c
...
...
@@ -6,8 +6,8 @@ public class JobRegistry : Registry
{
public
JobRegistry
()
{
Schedule
<
ExtractDataJob
>().
ToRunNow
().
AndEvery
(
1
).
Days
().
At
(
23
,
0
);
//
Schedule<ExtractDataJob>().ToRunEvery(1).Days().At(23, 0);
//
Schedule<ExtractDataJob>().ToRunNow().AndEvery(1).Days().At(23, 0);
Schedule
<
ExtractDataJob
>().
ToRunEvery
(
1
).
Days
().
At
(
23
,
0
);
}
}
}
performance/Performance.Api/Performance.Api.csproj
View file @
ebc7135c
...
...
@@ -69,7 +69,7 @@
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Content>
<Content Update="nlog.config">
<CopyToOutputDirectory>
Never
</CopyToOutputDirectory>
<CopyToOutputDirectory>
Always
</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\Performance.Api.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
...
...
performance/Performance.Api/Program.cs
View file @
ebc7135c
...
...
@@ -15,8 +15,20 @@ public class Program
{
public
static
void
Main
(
string
[]
args
)
{
var
logger
=
NLogBuilder
.
ConfigureNLog
(
"nlog.config"
).
GetCurrentClassLogger
();
try
{
CreateWebHostBuilder
(
args
).
Build
().
Run
();
}
catch
(
Exception
ex
)
{
logger
.
Error
(
ex
,
"Stopped program because of exception"
);
}
finally
{
NLog
.
LogManager
.
Shutdown
();
}
}
public
static
IWebHostBuilder
CreateWebHostBuilder
(
string
[]
args
)
=>
WebHost
.
CreateDefaultBuilder
(
args
)
...
...
@@ -25,9 +37,14 @@ public static void Main(string[] args)
var
env
=
context
.
HostingEnvironment
;
config
.
AddJsonFile
(
"appsettings.json"
,
true
,
true
);
config
.
AddJsonFile
(
$"appsettings.
{
env
.
EnvironmentName
}
.json"
,
true
,
true
);
env
.
ConfigureNLog
(
"nlog.config"
);
})
.
UseUrls
(
"http://*:5001"
)
.
ConfigureLogging
(
logging
=>
{
logging
.
ClearProviders
();
logging
.
SetMinimumLevel
(
LogLevel
.
Trace
);
})
.
UseNLog
()
.
UseStartup
<
Startup
>();
}
}
performance/Performance.Api/Properties/PublishProfiles/FolderProfile.pubxml
View file @
ebc7135c
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!--
此文件由 Web 项目的发布/打包过程使用。可以通过编辑此 MSBuild 文件
自定义此过程的行为。为了解与此相关的更多内容,请访问 https://go.microsoft.com/fwlink/?LinkID=208121。
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>
FileSystem
</WebPublishMethod>
<PublishProvider>
FileSystem
</PublishProvider>
<DeleteExistingFiles>True</DeleteExistingFiles>
<ExcludeApp_Data>False</ExcludeApp_Data>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
<PublishUrl>bin\Release\netcoreapp2.2\publish\</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>
True
</LaunchSiteAfterPublish>
<ExcludeApp_Data>
False
</ExcludeApp_Data>
<TargetFramework>netcoreapp2.2</TargetFramework>
<ProjectGuid>3ae00ff5-f0ba-4d72-a23b-770186309327</ProjectGuid>
<SelfContained>false</SelfContained>
<_IsPortable>
true
</_IsPortable>
<publishUrl>
E:\release\jx.suvalue.com
</publishUrl>
<DeleteExistingFiles>
True
</DeleteExistingFiles>
</PropertyGroup>
</Project>
\ No newline at end of file
performance/Performance.Api/Startup.cs
View file @
ebc7135c
...
...
@@ -215,9 +215,8 @@ public void ConfigureServices(IServiceCollection services)
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public
void
Configure
(
IApplicationBuilder
app
,
IHostingEnvironment
env
,
ILoggerFactory
loggerFactory
)
public
void
Configure
(
IApplicationBuilder
app
,
IHostingEnvironment
env
)
{
loggerFactory
.
AddNLog
();
if
(
env
.
IsDevelopment
())
{
app
.
UseDeveloperExceptionPage
();
...
...
@@ -248,8 +247,6 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
app
.
UseCors
(
"SignalrCore"
);
app
.
UseSignalR
(
routes
=>
routes
.
MapHub
<
AllotLogHub
>(
"/performance/allotLogHub"
));
loggerFactory
.
CreateLogger
<
Startup
>().
LogDebug
(
env
.
EnvironmentName
);
app
.
UseMvc
();
}
}
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
ebc7135c
...
...
@@ -1325,13 +1325,13 @@
</summary>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.SecondAllotController.WorkTypeList(Performance.DtoModels.WorkloadRequest)"
>
<member
name=
"M:Performance.Api.Controllers.SecondAllotController.WorkTypeList(Performance.DtoModels.WorkloadRequest
,System.Int32
)"
>
<summary>
二次绩效工作量类型列表
</summary>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.SecondAllotController.SingleSave(Performance.EntityModels.ag_workload_type)"
>
<member
name=
"M:Performance.Api.Controllers.SecondAllotController.SingleSave(Performance.EntityModels.ag_workload_type
,System.Int32
)"
>
<summary>
保存二次绩效工作量类型
</summary>
...
...
performance/Performance.Services/ExtractExcelService/ExtractHelper/WriteDataHelper.cs
View file @
ebc7135c
...
...
@@ -132,7 +132,7 @@ public static void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType s
if
(
string
.
IsNullOrEmpty
(
department
))
continue
;
var
deptData
=
data
.
Where
(
t
=>
t
.
Department
==
department
);
if
(
deptData
==
null
||
!
deptData
.
Any
())
continue
;
if
(
deptData
==
null
||
!
deptData
.
Any
(
t
=>
t
.
Value
.
HasValue
&&
t
.
Value
!=
0
))
continue
;
#
region
写入数据
...
...
@@ -354,7 +354,7 @@ public static void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType
if
(
string
.
IsNullOrEmpty
(
department
))
continue
;
var
deptData
=
data
.
Where
(
t
=>
t
.
Department
==
department
);
if
(
deptData
==
null
||
!
deptData
.
Any
())
continue
;
if
(
deptData
==
null
||
!
deptData
.
Any
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
CellValue
)
))
continue
;
#
region
写入数据
...
...
performance/Performance.Services/ExtractExcelService/ExtractJobService.cs
View file @
ebc7135c
...
...
@@ -41,6 +41,8 @@ PerforPerallotRepository perallotRepository
public
void
Execute
()
{
logger
.
LogInformation
(
"Initial ExtractJobService"
);
var
hospitals
=
hospitalRepository
.
GetEntities
(
w
=>
w
.
IsOpenTimedTasks
==
1
);
if
(
hospitals
==
null
||
!
hospitals
.
Any
())
return
;
...
...
performance/Performance.Services/ExtractExcelService/ExtractService.cs
View file @
ebc7135c
...
...
@@ -141,14 +141,41 @@ private void WriteDataToFile(IWorkbook workbook, per_allot allot, Dictionary<ExD
WriteDataFactory
factory
=
new
WriteDataFactory
();
var
types
=
new
List
<
SheetType
>
{
SheetType
.
OtherIncome
,
SheetType
.
Income
,
SheetType
.
Expend
,
SheetType
.
Workload
,
SheetType
.
OtherWorkload
/*, SheetType.AccountBasic*/
};
decimal
ratio
=
60
m
;
string
accountBasicSheetName
=
""
;
for
(
int
sheetIndex
=
0
;
sheetIndex
<
workbook
.
NumberOfSheets
;
sheetIndex
++)
{
var
sheetName
=
workbook
.
GetSheetAt
(
sheetIndex
).
SheetName
;
if
(!
sheetName
.
StartsWith
(
"4.1"
))
continue
;
accountBasicSheetName
=
sheetName
;
break
;
}
var
accountBasicSheet
=
workbook
.
GetSheet
(
accountBasicSheetName
);
HandleSheet
(
workbook
,
allot
,
exdict
,
extractDto
,
groupName
,
isSingle
,
accountBasicSheet
,
ratio
,
types
,
factory
,
style
,
employeeDict
,
collectData
);
for
(
int
sheetIndex
=
0
;
sheetIndex
<
workbook
.
NumberOfSheets
;
sheetIndex
++)
{
var
sheet
=
workbook
.
GetSheetAt
(
sheetIndex
);
HandleSheet
(
workbook
,
allot
,
exdict
,
extractDto
,
groupName
,
isSingle
,
sheet
,
ratio
,
types
,
factory
,
style
,
employeeDict
,
collectData
);
}
}
private
void
HandleSheet
(
IWorkbook
workbook
,
per_allot
allot
,
Dictionary
<
ExDataDict
,
object
>
exdict
,
List
<
ExtractTransDto
>
extractDto
,
string
groupName
,
bool
isSingle
,
ISheet
sheet
,
decimal
ratio
,
List
<
SheetType
>
types
,
WriteDataFactory
factory
,
ExcelStyle
style
,
List
<
per_employee
>
employeeDict
,
List
<
collect_data
>
collectData
)
{
try
{
if
(
sheet
==
null
)
return
;
string
sheetName
=
sheet
.
SheetName
.
NoBlank
();
ratio
+=
40
m
/
workbook
.
NumberOfSheets
;
var
sheetType
=
perSheetService
.
GetSheetType
(
sheet
.
SheetName
);
if
(
sheetType
==
SheetType
.
Unidentifiable
)
continue
;
if
(
sheetType
==
SheetType
.
Unidentifiable
)
return
;
logService
.
ReturnTheLog
(
allot
.
ID
,
groupName
,
3
,
""
,
ratio
>
99
?
99
:
ratio
,
1
,
isSingle
);
logService
.
ReturnTheLog
(
allot
.
ID
,
groupName
,
2
,
"写入数据"
,
$"sheet“
{
sheet
.
SheetName
}
”开始写入数据"
,
1
,
isSingle
);
...
...
@@ -179,6 +206,10 @@ private void WriteDataToFile(IWorkbook workbook, per_allot allot, Dictionary<ExD
logService
.
ReturnTheLog
(
allot
.
ID
,
groupName
,
2
,
"写入数据"
,
$"sheet“
{
sheet
.
SheetName
}
”已完成数据写入"
,
1
,
isSingle
);
}
catch
(
Exception
ex
)
{
logger
.
LogError
(
"写入数据时发生异常:"
+
ex
);
}
}
private
object
GetDataBySheetType
(
int
hospitalId
,
SheetType
sheetType
,
List
<
ExtractTransDto
>
extractDto
,
List
<
per_employee
>
employeeDict
)
...
...
performance/Performance.Services/ExtractExcelService/SheetDataWrite/AccountExtraDataWrite.cs
View file @
ebc7135c
...
...
@@ -143,6 +143,8 @@ private void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheet
private
static
readonly
Dictionary
<
string
,
Func
<
Account
,
string
>>
collectExtra
=
new
Dictionary
<
string
,
Func
<
Account
,
string
>>
{
{
"核算单元类型"
,
(
dto
)
=>
dto
.
UnitType
},
{
"核算组别"
,
(
dto
)
=>
dto
.
UnitType
},
{
"核算单元分类"
,
(
dto
)
=>
dto
.
UnitType
},
{
"核算单元"
,
(
dto
)
=>
dto
.
AccountingUnit
},
};
}
...
...
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