Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
queryPlatform
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
唐仲阳
queryPlatform
Commits
c4534545
Commit
c4534545
authored
May 18, 2023
by
tangzhongyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导出查询报告
parent
302f23c5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
50 deletions
+63
-50
api/queryPlaform.Api/Controllers/HomeController.cs
+15
-12
api/queryPlaform.Api/Infrastructure/Hubs/NotificationHub.cs
+2
-1
api/queryPlaform.Api/Infrastructure/Queries/HomeQueries.cs
+9
-3
api/queryPlaform.Api/Infrastructure/Queries/ResourceQueries.cs
+37
-34
No files found.
api/queryPlaform.Api/Controllers/HomeController.cs
View file @
c4534545
...
...
@@ -2,6 +2,8 @@
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.AspNetCore.SignalR
;
using
QueryPlatform.Api.Infrastructure.Hubs
;
using
QueryPlatform.Api.Infrastructure.Modules
;
using
QueryPlatform.Api.Infrastructure.Queries
;
using
System
;
...
...
@@ -12,16 +14,18 @@
namespace
QueryPlatform.Api.Controllers
{
[
Authorize
]
[
Route
(
"api/
resourc
e"
)]
[
Route
(
"api/
hom
e"
)]
[
ApiController
]
public
class
HomeController
:
Controller
{
private
readonly
HomeQueries
_homeQueries
;
private
readonly
IWebHostEnvironment
environment
;
public
HomeController
(
HomeQueries
homeQueries
,
IWebHostEnvironment
environment
)
private
readonly
IWebHostEnvironment
_environment
;
private
readonly
IHubContext
<
NotificationHub
>
_hubContext
;
public
HomeController
(
HomeQueries
homeQueries
,
IWebHostEnvironment
environment
,
IHubContext
<
NotificationHub
>
hubContext
)
{
this
.
_homeQueries
=
homeQueries
;
this
.
environment
=
environment
;
_homeQueries
=
homeQueries
;
_environment
=
environment
;
_hubContext
=
hubContext
;
}
/// <summary>
/// 查询所有项目记录
...
...
@@ -70,7 +74,7 @@ public void DemandAdd([FromBody] SYS_DEMAND sYS_Demand)
[
AllowAnonymous
]
public
void
DemandAddfu
([
FromForm
]
SYS_DEMANDSUBLIS
sYS_DemandSublist
)
{
_homeQueries
.
Demandfu
(
sYS_DemandSublist
,
environment
.
WebRootPath
);
_homeQueries
.
Demandfu
(
sYS_DemandSublist
,
_
environment
.
WebRootPath
);
}
/// <summary>
/// 添加服务器
...
...
@@ -117,8 +121,7 @@ public IEnumerable<dynamic> Funca()
{
var
DemandQuery
=
_homeQueries
.
FuncaQuery
();
return
DemandQuery
;
}
}
//[HttpGet("lingchuanglujingjiancha")]
//[AllowAnonymous]
...
...
@@ -135,7 +138,7 @@ public IEnumerable<dynamic> Funca()
[
AllowAnonymous
]
public
string
Executes
(
DateTime
StartTime
,
DateTime
EndTime
)
{
return
_homeQueries
.
Executes
(
StartTime
,
EndTime
,
environment
.
WebRootPath
);
return
_homeQueries
.
Executes
(
StartTime
,
EndTime
,
_
environment
.
WebRootPath
);
}
/// <summary>
/// 南海核对数据下拉框
...
...
@@ -259,7 +262,7 @@ public IActionResult SendMail(string title, string content, string zxr = "")
var
export
=
""
;
try
{
export
=
_homeQueries
.
Excelex
(
ExportTableName
,
environment
.
WebRootPath
);
;
export
=
_homeQueries
.
Excelex
(
ExportTableName
,
_
environment
.
WebRootPath
);
;
}
catch
(
Exception
e
)
{
...
...
@@ -305,8 +308,7 @@ public IActionResult ceshi()
{
return
Ok
(
_homeQueries
.
ceshi
());
}
}
}
\ No newline at end of file
api/queryPlaform.Api/Infrastructure/Hubs/NotificationHub.cs
View file @
c4534545
...
...
@@ -22,6 +22,7 @@ public override Task OnDisconnectedAsync(Exception exception)
var
userId
=
Context
.
User
.
Claims
.
FirstOrDefault
(
w
=>
w
.
Type
==
ClaimTypes
.
Sid
)?.
Value
;
Groups
.
RemoveFromGroupAsync
(
Context
.
ConnectionId
,
userId
);
return
base
.
OnDisconnectedAsync
(
exception
);
}
}
}
}
api/queryPlaform.Api/Infrastructure/Queries/HomeQueries.cs
View file @
c4534545
...
...
@@ -3,6 +3,7 @@
using
FluentEmail.Core
;
//
using
FluentEmail.Smtp
;
//
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.SignalR
;
using
Microsoft.Data.SqlClient
;
using
Newtonsoft.Json
;
using
NPOI.HSSF.UserModel
;
...
...
@@ -18,10 +19,11 @@
using
System.Net
;
//
using
System.Net.Mail
;
//
using
System.Text
;
using
System.Threading.Tasks
;
namespace
QueryPlatform.Api.Infrastructure.Queries
{
public
class
HomeQueries
{
private
readonly
string
_configConnectionString
;
...
...
@@ -1410,9 +1412,12 @@ public List<string> ceshi()
return
errs
;
}
}
}
\ No newline at end of file
api/queryPlaform.Api/Infrastructure/Queries/ResourceQueries.cs
View file @
c4534545
...
...
@@ -299,8 +299,13 @@ UNION ALL
string
filePath
=
$"
{
diz
}
/export/模板.html"
;
//$"E:/C盘文件/桌面/非小细胞癌药品分布.html"; //$"{diz}/export/模板.html"// 指定文件路径
var
htmlContent
=
""
;
string
mb
=
@"<tr>
<td width='55' ><p align='right'><font size='2' style='font-size: 10pt'><span lang='zh-CN'><b><font face='宋体'>{nf}</font></b></span></font></p></td>
<td width='74'><p align='right'><font size='2' style='font-size: 10pt'><span lang='en-US'><font size='3' style='font-size: 12pt'>{rs}</font></span></font></p></td>
<td width='65%' bgcolor='#ffffff' style='background: #ffffff'>
<p style='text-align: center; font-weight: bold;'><font color='#000000'><font face='宋体'><font size='2' style='font-size: 12pt'><span lang='zh-CN'>{nf}</span></font></font></font></p>
</td>
<td width='35%' bgcolor='#ffffff' style='background: #ffffff'>
<p style='text-align: center; '><font face='宋体'><font size='2' style='font-size: 12pt'><span lang='zh-CN'><font face='宋体'>{rs}</font></span></font></font></p>
</td>
</tr> "
;
string
yearfbhtmlfh
=
""
;
string
sexfbhtmlfh
=
""
;
...
...
@@ -331,43 +336,41 @@ UNION ALL
}
mb
=
@"
<tr>
<td rowspan='{hbdyg}' width='28%' bgcolor='#ffffff' style='background: #ffffff'>
<p align='right'><font color='#000000'><font face='宋体'><font size='2' style='font-size: 9pt'><span lang='zh-CN'>{fl}</span></font></font></font></p>
</td>
<td width='17%' bgcolor='#ffffff' style='background: #ffffff'>
<p align='right' ><font face='宋体'><font size='2' style='font-size: 9pt'><span lang='zh-CN'><font face='宋体'>{hos}</font></span></font></font></p>
</td>
<td width='17%' bgcolor='#ffffff' style='background: #ffffff'>
<p align='right'><font face='宋体'><font size='2' style='font-size: 9pt'><span lang='zh-CN'><font face='宋体'>{hoss}</font></span></font></font></p>
</td>
<td width='37%' bgcolor='#ffffff' style='background: #ffffff'>
<p align='right'><font face='宋体'><font size='2' style='font-size: 9pt'><span lang='zh-CN'><font face='宋体'>{hzs}</font></span></font></font></p>
</td>
</tr>
"
;
<tr>
<td rowspan='{hbdyg}' width='28%' bgcolor='#ffffff' style='background: #ffffff'>
<p align='right' ><font face='宋体'><font size='2' style='font-size: 13pt'><span lang='zh-CN'><font face='宋体'>{fl}</font></span></font></font></p>
</td>
<td width='17%' bgcolor='#ffffff' style='background: #ffffff'>
<p align='right' ><font face='宋体'><font size='2' style='font-size: 13pt'><span lang='zh-CN'><font face='宋体'>{hos}</font></span></font></font></p>
</td>
<td width='17%' bgcolor='#ffffff' style='background: #ffffff'>
<p align='right'><font face='宋体'><font size='2' style='font-size: 13pt'><span lang='zh-CN'><font face='宋体'>{hoss}</font></span></font></font></p>
</td>
<td width='37%' bgcolor='#ffffff' style='background: #ffffff'>
<p align='right'><font face='宋体'><font size='2' style='font-size: 13pt'><span lang='zh-CN'><font face='宋体'>{hzs}</font></span></font></font></p>
</td>
</tr>"
;
var
mb2
=
@"
<tr>
<td width='17%' bgcolor='#ffffff' style='background: #ffffff'>
<p align='right'><font face='宋体'><font size='2' style='font-size: 9
pt'><span lang='zh-CN'><font face='宋体'>{hos}</font></span></font></font></p>
</td>
<td width='17%' bgcolor='#ffffff' style='background: #ffffff'>
<p align='right'><font face='宋体'><font size='2' style='font-size: 9
pt'><span lang='zh-CN'><font face='宋体'>{hoss}</font></span></font></font></p>
</td>
<td>
<p align='right'><font face='宋体'><font size='2' style='font-size: 9
pt'><span lang='zh-CN'><font face='宋体'>{hzs}</font></span></font></font></p>
</td>
</tr>
"
;
var
ksmb
=
@"
<tr>
<tr>
<td width='17%' bgcolor='#ffffff' style='background: #ffffff'>
<p align='right'><font face='宋体'><font size='2' style='font-size: 13
pt'><span lang='zh-CN'><font face='宋体'>{hos}</font></span></font></font></p>
</td>
<td width='17%' bgcolor='#ffffff' style='background: #ffffff'>
<p align='right'><font face='宋体'><font size='2' style='font-size: 13
pt'><span lang='zh-CN'><font face='宋体'>{hoss}</font></span></font></font></p>
</td>
<td>
<p align='right'><font face='宋体'><font size='2' style='font-size: 13
pt'><span lang='zh-CN'><font face='宋体'>{hzs}</font></span></font></font></p>
</td>
</tr>"
;
var
ksmb
=
@"
<tr>
<td width='63%' bgcolor='#ffffff' style='background: #ffffff'>
<p align='right'><font face='宋体'><font size='2' style='font-size:
9
pt'><span lang='zh-CN'><font face='宋体'>{dept_name}</font></span></font></font></p>
<p align='right'><font face='宋体'><font size='2' style='font-size:
13
pt'><span lang='zh-CN'><font face='宋体'>{dept_name}</font></span></font></font></p>
</td>
<td width='36%' bgcolor='#ffffff' style='background: #ffffff'>
<p align='right'><font face='宋体'><font size='2' style='font-size:
7
pt'><span lang='zh-CN'><font face='宋体'>{rc}</font></span></font></font></p>
<p align='right'><font face='宋体'><font size='2' style='font-size:
13
pt'><span lang='zh-CN'><font face='宋体'>{rc}</font></span></font></font></p>
</td>
</tr>
"
;
</tr>"
;
// 现在你可以使用htmlContent变量中的HTML代码
foreach
(
var
item
in
dqfb
.
Select
(
s
=>
s
.
classification
).
Distinct
())
{
...
...
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