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
2cf9a257
Commit
2cf9a257
authored
Jan 21, 2026
by
唐仲阳
Browse files
Options
Browse Files
Download
Plain Diff
1
parents
b73085c4
13fb3b8a
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
157 additions
and
346 deletions
+157
-346
api/WebApplication1.rar
+0
-0
api/WebApplication1/WebApplication1/DBHelper/DBHelper.csproj
+0
-11
api/WebApplication1/WebApplication1/DBHelper/DBHelpers.cs
+0
-74
api/WebApplication1/WebApplication1/WebApplication1.sln
+0
-31
api/WebApplication1/WebApplication1/WebApplication1/Controllers/CursorController.cs
+0
-18
api/WebApplication1/WebApplication1/WebApplication1/Program.cs
+0
-26
api/WebApplication1/WebApplication1/WebApplication1/Properties/launchSettings.json
+0
-31
api/WebApplication1/WebApplication1/WebApplication1/SqlModel.cs
+0
-8
api/WebApplication1/WebApplication1/WebApplication1/Startup.cs
+0
-59
api/WebApplication1/WebApplication1/WebApplication1/WeatherForecast.cs
+0
-15
api/WebApplication1/WebApplication1/WebApplication1/WebApplication1.csproj
+0
-15
api/WebApplication1/WebApplication1/WebApplication1/appsettings.Development.json
+0
-12
api/WebApplication1/WebApplication1/WebApplication1/appsettings.json
+0
-10
api/queryPlaform.Api/Controllers/DrugqueryController.cs
+6
-2
api/queryPlaform.Api/Controllers/HomeController.cs
+1
-0
api/queryPlaform.Api/Infrastructure/AutofacModules/QueriesModule.cs
+2
-1
api/queryPlaform.Api/Infrastructure/Job.cs
+2
-2
api/queryPlaform.Api/Infrastructure/Models/SYS_MODELS.cs
+4
-2
api/queryPlaform.Api/Infrastructure/Queries/DrugqueryQueries.cs
+18
-18
api/queryPlaform.Api/Infrastructure/Queries/HomeQueries.cs
+19
-0
api/queryPlaform.Api/Infrastructure/Queries/ResourceQueries.cs
+96
-5
api/queryPlaform.Api/Properties/PublishProfiles/FolderProfile.pubxml
+6
-4
api/queryPlaform.Api/appsettings.json
+2
-1
api/queryPlaform.Api/wwwroot/QueryPlatform.Api.xml
+1
-1
No files found.
api/WebApplication1.rar
deleted
100644 → 0
View file @
b73085c4
File deleted
api/WebApplication1/WebApplication1/DBHelper/DBHelper.csproj
deleted
100644 → 0
View file @
b73085c4
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Data.SqlClient" Version="4.8.5" />
</ItemGroup>
</Project>
api/WebApplication1/WebApplication1/DBHelper/DBHelpers.cs
deleted
100644 → 0
View file @
b73085c4
using
System
;
using
System.Collections.Generic
;
using
System.Data
;
using
System.Data.Common
;
using
System.Data.SqlClient
;
using
System.Data.SqlTypes
;
using
System.Linq
;
namespace
DBHelper
{
public
class
DBHelpers
{
public
static
string
ConectionString
=
"server=192.168.18.151;User Id=sa;Password=Suvalue2016;"
;
public
DBHelpers
()
{
}
/// <summary>
/// 执行循环的sql
/// </summary>
/// <param name="SQLString"></param>
/// <returns>表名集合</returns>
public
static
List
<
string
>
Query
(
string
CirculateSql
)
{
List
<
string
>
tableName
=
new
List
<
string
>();
using
(
SqlConnection
connection
=
new
SqlConnection
(
ConectionString
))
{
using
(
SqlCommand
cmd
=
new
SqlCommand
(
CirculateSql
,
connection
))
{
connection
.
Open
();
SqlDataReader
result
=
cmd
.
ExecuteReader
();
while
(
result
.
Read
())
{
tableName
.
Add
(
result
[
"name"
].
ToString
());
}
connection
.
Close
();
return
tableName
;
}
}
}
/// <summary>
/// 遍历表名,并执行sql
/// </summary>
/// <param name="tableName"></param>
/// <returns>受影响的行数(-1:执行的sql为空 -2:未找到表)</returns>
public
static
int
Add
(
List
<
string
>
tableName
,
string
ExcuteSql
){
int
count
=
0
;
if
(
ExcuteSql
==
""
||
ExcuteSql
==
null
)
{
count
=
-
1
;
return
count
;
}
else
if
(
tableName
.
Count
==
0
)
{
count
=
-
2
;
return
count
;
}
using
(
SqlConnection
connection
=
new
SqlConnection
(
ConectionString
))
{
connection
.
Open
();
foreach
(
var
name
in
tableName
)
{
SqlCommand
cmd
=
connection
.
CreateCommand
();
cmd
.
CommandText
=
ExcuteSql
.
Replace
(
"[@name]"
,
"["
+
name
+
"]"
);
count
+=
cmd
.
ExecuteNonQuery
();
ExcuteSql
=
ExcuteSql
.
Replace
(
"["
+
name
+
"]"
,
"[@name]"
);
}
connection
.
Close
();
}
return
count
;
}
}
}
api/WebApplication1/WebApplication1/WebApplication1.sln
deleted
100644 → 0
View file @
b73085c4
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.7.34018.315
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApplication1", "WebApplication1\WebApplication1.csproj", "{EF8E5F21-FE45-4812-B60F-5375F6C51C01}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DBHelper", "DBHelper\DBHelper.csproj", "{CB7F6E84-B3B5-46FA-80A2-88EC633828B3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EF8E5F21-FE45-4812-B60F-5375F6C51C01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EF8E5F21-FE45-4812-B60F-5375F6C51C01}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF8E5F21-FE45-4812-B60F-5375F6C51C01}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EF8E5F21-FE45-4812-B60F-5375F6C51C01}.Release|Any CPU.Build.0 = Release|Any CPU
{CB7F6E84-B3B5-46FA-80A2-88EC633828B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB7F6E84-B3B5-46FA-80A2-88EC633828B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB7F6E84-B3B5-46FA-80A2-88EC633828B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CB7F6E84-B3B5-46FA-80A2-88EC633828B3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C360C5EB-C4AE-4FDF-9AAD-406E0050028B}
EndGlobalSection
EndGlobal
api/WebApplication1/WebApplication1/WebApplication1/Controllers/CursorController.cs
deleted
100644 → 0
View file @
b73085c4
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Mvc
;
using
System.Collections.Generic
;
namespace
WebApplication1.Controllers
{
[
Route
(
"api/[controller]"
)]
[
ApiController
]
public
class
CursorController
:
ControllerBase
{
[
HttpPost
(
"Demo"
)]
public
int
Demo
([
FromBody
]
SqlModel
Sql
)
{
List
<
string
>
TableNames
=
DBHelper
.
DBHelpers
.
Query
(
Sql
.
CirculateSql
);
return
DBHelper
.
DBHelpers
.
Add
(
TableNames
,
Sql
.
ExecuteSql
);
}
}
}
api/WebApplication1/WebApplication1/WebApplication1/Program.cs
deleted
100644 → 0
View file @
b73085c4
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.Extensions.Configuration
;
using
Microsoft.Extensions.Hosting
;
using
Microsoft.Extensions.Logging
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
namespace
WebApplication1
{
public
class
Program
{
public
static
void
Main
(
string
[]
args
)
{
CreateHostBuilder
(
args
).
Build
().
Run
();
}
public
static
IHostBuilder
CreateHostBuilder
(
string
[]
args
)
=>
Host
.
CreateDefaultBuilder
(
args
)
.
ConfigureWebHostDefaults
(
webBuilder
=>
{
webBuilder
.
UseStartup
<
Startup
>();
});
}
}
api/WebApplication1/WebApplication1/WebApplication1/Properties/launchSettings.json
deleted
100644 → 0
View file @
b73085c4
{
"$schema"
:
"http://json.schemastore.org/launchsettings.json"
,
"iisSettings"
:
{
"windowsAuthentication"
:
false
,
"anonymousAuthentication"
:
true
,
"iisExpress"
:
{
"applicationUrl"
:
"http://localhost:41905"
,
"sslPort"
:
44327
}
},
"profiles"
:
{
"IIS Express"
:
{
"commandName"
:
"IISExpress"
,
"launchBrowser"
:
true
,
"launchUrl"
:
"swagger"
,
"environmentVariables"
:
{
"ASPNETCORE_ENVIRONMENT"
:
"Development"
}
},
"WebApplication1"
:
{
"commandName"
:
"Project"
,
"dotnetRunMessages"
:
"true"
,
"launchBrowser"
:
true
,
"launchUrl"
:
"swagger"
,
"applicationUrl"
:
"https://localhost:5001;http://localhost:5000"
,
"environmentVariables"
:
{
"ASPNETCORE_ENVIRONMENT"
:
"Development"
}
}
}
}
api/WebApplication1/WebApplication1/WebApplication1/SqlModel.cs
deleted
100644 → 0
View file @
b73085c4
namespace
WebApplication1
{
public
class
SqlModel
{
public
string
CirculateSql
{
get
;
set
;
}
public
string
ExecuteSql
{
get
;
set
;
}
}
}
api/WebApplication1/WebApplication1/WebApplication1/Startup.cs
deleted
100644 → 0
View file @
b73085c4
using
Microsoft.AspNetCore.Builder
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.AspNetCore.HttpsPolicy
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.Extensions.Configuration
;
using
Microsoft.Extensions.DependencyInjection
;
using
Microsoft.Extensions.Hosting
;
using
Microsoft.Extensions.Logging
;
using
Microsoft.OpenApi.Models
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
namespace
WebApplication1
{
public
class
Startup
{
public
Startup
(
IConfiguration
configuration
)
{
Configuration
=
configuration
;
}
public
IConfiguration
Configuration
{
get
;
}
// This method gets called by the runtime. Use this method to add services to the container.
public
void
ConfigureServices
(
IServiceCollection
services
)
{
services
.
AddControllers
();
services
.
AddSwaggerGen
(
c
=>
{
c
.
SwaggerDoc
(
"v1"
,
new
OpenApiInfo
{
Title
=
"WebApplication1"
,
Version
=
"v1"
});
});
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public
void
Configure
(
IApplicationBuilder
app
,
IWebHostEnvironment
env
)
{
if
(
env
.
IsDevelopment
())
{
app
.
UseDeveloperExceptionPage
();
app
.
UseSwagger
();
app
.
UseSwaggerUI
(
c
=>
c
.
SwaggerEndpoint
(
"/swagger/v1/swagger.json"
,
"WebApplication1 v1"
));
}
app
.
UseHttpsRedirection
();
app
.
UseRouting
();
app
.
UseAuthorization
();
app
.
UseEndpoints
(
endpoints
=>
{
endpoints
.
MapControllers
();
});
}
}
}
api/WebApplication1/WebApplication1/WebApplication1/WeatherForecast.cs
deleted
100644 → 0
View file @
b73085c4
using
System
;
namespace
WebApplication1
{
public
class
WeatherForecast
{
public
DateTime
Date
{
get
;
set
;
}
public
int
TemperatureC
{
get
;
set
;
}
public
int
TemperatureF
=>
32
+
(
int
)(
TemperatureC
/
0.5556
);
public
string
Summary
{
get
;
set
;
}
}
}
api/WebApplication1/WebApplication1/WebApplication1/WebApplication1.csproj
deleted
100644 → 0
View file @
b73085c4
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DBHelper\DBHelper.csproj" />
</ItemGroup>
</Project>
api/WebApplication1/WebApplication1/WebApplication1/appsettings.Development.json
deleted
100644 → 0
View file @
b73085c4
{
"Logging"
:
{
"LogLevel"
:
{
"Default"
:
"Information"
,
"Microsoft"
:
"Warning"
,
"Microsoft.Hosting.Lifetime"
:
"Information"
},
"Connection"
:
{
"ConnectionString"
:
"Host=192.168.18.187;Port=5432;Username=postgres;Password=Suvalue2016;Database=db_healthcare_drgs_gongcheng;SearchPath=public;"
}
}
}
api/WebApplication1/WebApplication1/WebApplication1/appsettings.json
deleted
100644 → 0
View file @
b73085c4
{
"Logging"
:
{
"LogLevel"
:
{
"Default"
:
"Information"
,
"Microsoft"
:
"Warning"
,
"Microsoft.Hosting.Lifetime"
:
"Information"
}
},
"AllowedHosts"
:
"*"
}
api/queryPlaform.Api/Controllers/DrugqueryController.cs
View file @
2cf9a257
using
Microsoft.AspNetCore.Authorization
;
using
com.sun.tools.javac.util
;
using
Microsoft.AspNetCore.Authorization
;
using
Microsoft.AspNetCore.Mvc
;
using
QueryPlatform.Api.Infrastructure.Modules
;
using
System
;
...
...
@@ -15,8 +16,10 @@ public class DrugqueryController : Controller
{
private
readonly
DrugqueryQueries
_drugqueryQueries
;
private
readonly
HomeQueries
_homeQueries
;
public
DrugqueryController
(
DrugqueryQueries
drugqueryQueries
,
HomeQueries
homeQueries
)
private
readonly
ResourceQueries
_resourceQueries
;
public
DrugqueryController
(
DrugqueryQueries
drugqueryQueries
,
HomeQueries
homeQueries
,
ResourceQueries
resourceQueries
)
{
_resourceQueries
=
resourceQueries
;
_drugqueryQueries
=
drugqueryQueries
;
_homeQueries
=
homeQueries
;
}
...
...
@@ -134,6 +137,7 @@ public DrugqueryController(DrugqueryQueries drugqueryQueries, HomeQueries homeQu
await
semaphore
.
WaitAsync
();
try
{
_resourceQueries
.
LOG
(
$"查询条件"
,
""
,
num
,
""
,
$"
{
icd_or_diseaseCondition
}{
drugs
}{
materialNames
}
"
);
asynsDrugquery
(
sYS_Drugquery
,
icd_or_diseaseCondition
,
drugs
,
materialNames
,
num
,
type
,
zxr
);
}
finally
...
...
api/queryPlaform.Api/Controllers/HomeController.cs
View file @
2cf9a257
...
...
@@ -5,6 +5,7 @@
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.AspNetCore.SignalR
;
using
NPoco
;
using
QueryPlatform.Api.Infrastructure.Hubs
;
using
QueryPlatform.Api.Infrastructure.Modules
;
using
QueryPlatform.Api.Infrastructure.Queries
;
...
...
api/queryPlaform.Api/Infrastructure/AutofacModules/QueriesModule.cs
View file @
2cf9a257
...
...
@@ -24,11 +24,12 @@ protected override void Load(ContainerBuilder builder)
var
Connection155
=
configuration
[
"ConnectionStrings:Connection155"
];
var
Connection156
=
configuration
[
"ConnectionStrings:Connection156"
];
var
Connection158
=
configuration
[
"ConnectionStrings:Connection158"
];
var
lskxc
=
configuration
[
"ConnectionStrings:lskxc"
];
builder
.
RegisterType
<
HubNotificationQueue
>().
SingleInstance
();
builder
.
Register
(
c
=>
new
UserStorage
(
configConnectionString
)).
InstancePerLifetimeScope
();
builder
.
Register
(
c
=>
new
UserQueries
(
configConnectionString
)).
InstancePerLifetimeScope
();
builder
.
Register
(
c
=>
new
ResourceQueries
(
Connection156
,
configConnectionString
)).
InstancePerLifetimeScope
();
builder
.
Register
(
c
=>
new
ResourceQueries
(
Connection156
,
configConnectionString
,
lskxc
)).
InstancePerLifetimeScope
();
builder
.
Register
(
c
=>
new
DrugqueryQueries
(
Connection156
,
configConnectionString
)).
InstancePerLifetimeScope
();
builder
.
Register
(
c
=>
new
HomeQueries
(
configConnectionString
,
Connection156
)).
InstancePerLifetimeScope
();
builder
.
Register
(
c
=>
new
AnalysisQueries
(
Connection156
,
configConnectionString
)).
InstancePerLifetimeScope
();
...
...
api/queryPlaform.Api/Infrastructure/Job.cs
View file @
2cf9a257
...
...
@@ -29,9 +29,9 @@ public Job(ILogger<Job> logger, DrugqueryQueries drugqueryQueries, HomeQueries h
{
var
day
=
DateTime
.
Now
.
Day
;
var
time
=
DateTime
.
Now
.
ToString
(
"HH:mm:ss"
);
if
(
day
==
8
&&
time
==
"09:39
:01"
)
if
(
day
==
1
&&
time
==
"00:00
:01"
)
{
//
_drugqueryQueries.定时执行();
_drugqueryQueries
.
定时执行
();
_homeQueries
.
SendMail
(
"定时任务"
,
"人群检索表 化验检查检索表合并成功"
);
}
}
...
...
api/queryPlaform.Api/Infrastructure/Models/SYS_MODELS.cs
View file @
2cf9a257
...
...
@@ -54,6 +54,9 @@ public class SYS_Hospital
{
public
int
id
{
get
;
set
;
}
public
string
HosName
{
get
;
set
;
}
public
string
City
{
get
;
set
;
}
public
string
HosLevel
{
get
;
set
;
}
public
string
HosType
{
get
;
set
;
}
public
string
ExecOpenLink
{
get
;
set
;
}
public
string
ExecDatabase
{
get
;
set
;
}
public
string
DataLoginName
{
get
;
set
;
}
...
...
@@ -448,8 +451,7 @@ public class SYS_LOG
}
public
class
DateExploration
{
public
int
id
{
get
;
set
;
}
public
int
Id
{
get
;
internal
set
;
}
public
int
Id
{
get
;
set
;
}
public
string
Name1
{
get
;
set
;
}
public
string
Name2
{
get
;
set
;
}
public
string
Name3
{
get
;
set
;
}
...
...
api/queryPlaform.Api/Infrastructure/Queries/DrugqueryQueries.cs
View file @
2cf9a257
...
...
@@ -912,19 +912,19 @@ public void ASSAYREPORT(long index, int id, string item_name = "")
//第一层切割
var
sql2
=
$@"UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'
','&') pr
long
('将回车替换&') UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'[','')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,']','')
PRlong
('将]替换 ')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,' ','`') pr
long
('将空格替换`')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'`L','') pr
long
('将 `L 去除')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'`H','') pr
long
('将 `H 去除')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'`*','') pr
long
('将 `* 去除')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'`↑','')pr
long
('将 `↑去除')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'`高','')pr
long
('将 `高 去除')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'`↓','')pr
long
('将 `↓去除')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'`低','')pr
long
('将 `低 去除')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'>','') pr
long
('将 > 去除')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'<','') pr
long
('将 < 去除')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=RIGHT(RESULTS,LEN(RESULTS)-1) WHERE LEFT(RESULTS,1)='`' pr
long
('将第一个字符为 ` 的去除')
','&') pr
int
('将回车替换&') UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'[','')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,']','')
print
('将]替换 ')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,' ','`') pr
int
('将空格替换`')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'`L','') pr
int
('将 `L 去除')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'`H','') pr
int
('将 `H 去除')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'`*','') pr
int
('将 `* 去除')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'`↑','')pr
int
('将 `↑去除')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'`高','')pr
int
('将 `高 去除')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'`↓','')pr
int
('将 `↓去除')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'`低','')pr
int
('将 `低 去除')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'>','') pr
int
('将 > 去除')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'<','') pr
int
('将 < 去除')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=RIGHT(RESULTS,LEN(RESULTS)-1) WHERE LEFT(RESULTS,1)='`' pr
int
('将第一个字符为 ` 的去除')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'&0','&')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'&1','&') WHERE RESULTS NOT LIKE '&1`'
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'&1`','&')
...
...
@@ -976,8 +976,8 @@ public void ASSAYREPORT(long index, int id, string item_name = "")
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'&47`','&')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'&48`','&')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'&49`','&')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'&50`','&') pr
long
('将 &1`/2`/3`/4`/5`..... 改为&')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'【互】','') pr
long
('将 【互】去除')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'&50`','&') pr
int
('将 &1`/2`/3`/4`/5`..... 改为&')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'【互】','') pr
int
('将 【互】去除')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'``','`') ---20次
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'``','`')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'``','`')
...
...
@@ -998,7 +998,7 @@ public void ASSAYREPORT(long index, int id, string item_name = "")
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'``','`')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'``','`')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'``','`')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'``','`')pr
long
('将 多个连续``` 改为 `')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'``','`')pr
int
('将 多个连续``` 改为 `')
UPDATE dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
SET RESULTS=REPLACE(RESULTS,'&`','&')"
;
//函数分列,换行
...
...
@@ -1139,7 +1139,7 @@ public void ASSAYREPORT(long index, int id, string item_name = "")
SELECT ORG_CODE,REPORT_ID,REG_CODE, [dbo].[fGetStrBySplit](RESULTS,50,'&')RESULTS FROM dbo.ASSAY_REPORT_TEMP_
{
index
}
_
{
id
}
)a WHERE [dbo].[fGetStrBySplit](RESULTS,1,'`') NOT LIKE '%名称%'
AND [dbo].[fGetStrBySplit](RESULTS,1,'`') <>'' AND [dbo].[fGetStrBySplit](RESULTS,1,'`') IS NOT NULL
pr
long
('临时数据生成中')
pr
int
('临时数据生成中')
SELECT * into [dbo].[ASSAY_
{
index
}
_
{
id
}
] FROM (
SELECT*FROM [dbo].[ASSAY1_
{
index
}
_
{
id
}
]
...
...
@@ -1159,7 +1159,7 @@ UNION ALL
AND a.ITEM_ENAME NOT LIKE '%审核%'
AND UNIT NOT LIKE '%备注%'
AND a.UNIT NOT LIKE '%标本%';
pr
long
('临时数据生成完成');"
;
pr
int
('临时数据生成完成');"
;
connection
.
Execute
(
sql
,
commandTimeout
:
60
*
60
*
5
);
connection
.
Execute
(
sql2
,
commandTimeout
:
60
*
60
*
5
);
connection
.
Execute
(
sql3
,
commandTimeout
:
60
*
60
*
5
);
...
...
api/queryPlaform.Api/Infrastructure/Queries/HomeQueries.cs
View file @
2cf9a257
...
...
@@ -1430,6 +1430,25 @@ public List<string> ceshi()
}
public
List
<
string
>
city_hosLevel_hosType
(
string
type
)
{
var
dbs
=
"SELECT city,left(hosLevel,1)hosLevel,hosType FROM [DB_SV_Data_Config].[dbo].[SYS_Hospital] where isnull([ExecOpenLink],'')!='' and isnull([ExecDatabase],'')!=''"
;
var
hoss
=
Connection
(
156
).
Query
<
SYS_Hospital
>(
dbs
);
if
(
type
==
"city"
)
{
return
hoss
.
Select
(
s
=>
s
.
City
.
Replace
(
" "
,
""
)).
Distinct
().
ToList
();
}
else
if
(
type
==
"hosLevel"
)
{
return
hoss
.
Select
(
s
=>
s
.
HosLevel
.
Replace
(
" "
,
""
)).
Distinct
().
ToList
();
}
else
if
(
type
==
"hosType"
)
{
return
hoss
.
Select
(
s
=>
s
.
HosType
.
Replace
(
" "
,
""
)).
Distinct
().
ToList
();
}
return
null
;
}
/// <summary>
/// 游标
/// </summary>
...
...
api/queryPlaform.Api/Infrastructure/Queries/ResourceQueries.cs
View file @
2cf9a257
...
...
@@ -2,7 +2,12 @@
using
DocumentFormat.OpenXml
;
using
DocumentFormat.OpenXml.Packaging
;
using
DocumentFormat.OpenXml.Wordprocessing
;
using
HtmlAgilityPack
;
using
java.sql
;
using
java.util.concurrent
;
using
Microsoft.Data.SqlClient
;
using
Microsoft.Extensions.Configuration
;
using
OfficeOpenXml
;
using
PuppeteerSharp
;
using
QueryPlatform.Api.Infrastructure.Modules
;
using
System
;
...
...
@@ -23,10 +28,12 @@ public class ResourceQueries
{
private
readonly
string
_Connection156
;
private
readonly
string
_configConnectionString
;
public
ResourceQueries
(
string
Connection156
,
string
configConnectionString
)
private
readonly
string
_lskxc
;
public
ResourceQueries
(
string
Connection156
,
string
configConnectionString
,
string
lskxc
)
{
_Connection156
=
Connection156
;
_configConnectionString
=
configConnectionString
;
_lskxc
=
lskxc
;
}
/// <summary>
/// 查询所有项目
...
...
@@ -99,6 +106,7 @@ public IEnumerable<dynamic> ShowITEM_NAME(int id)
return
sj
;
}
#
region
入参
public
class
nffb
{
public
string
n
{
get
;
set
;
}
...
...
@@ -400,13 +408,13 @@ UNION ALL
if
(
xz
==
1
)
{
string
aa
=
await
ConvertTo
Pdf
(
htmlContent
,
PROJECT_NAME
);
string
aa
=
await
ConvertTo
Excl
(
htmlContent
,
PROJECT_NAME
);
return
(
yearfb
,
dqfb
,
condition
,
PROJECT_NAME
,
ShowQuery3s
,
ShowQuery4s
,
aa
,
ShowQuery5s
);
}
return
(
yearfb
,
dqfb
,
condition
,
PROJECT_NAME
,
ShowQuery3s
,
ShowQuery4s
,
null
,
ShowQuery5s
);
}
#
endregion
/// <summary>
...
...
@@ -492,6 +500,7 @@ public string ConvertHtmlToPdf(string html, string xmname)
return
outfilepath
+
"pdf"
;
}
public
async
System
.
Threading
.
Tasks
.
Task
<
string
>
ConvertToPdf
(
string
html
,
string
xmname
)
{
...
...
@@ -523,6 +532,88 @@ public string ConvertHtmlToPdf(string html, string xmname)
}
public
async
System
.
Threading
.
Tasks
.
Task
<
string
>
ConvertToExcl
(
string
html
,
string
xmname
)
{
// 从HTML字符串获取数据表
DataTable
dataTable
=
ConvertHtmlToDataTable
(
html
);
// 将数据表保存为Excel文件
return
await
SaveDataTableToExcel
(
dataTable
,
$@"
{
fwq
}{
xmname
}
人群分布
{
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmss"
)
+
new
Random
().
Next
(
1000
,
9999
).
ToString
()}
.xlsx"
);
}
static
DataTable
ConvertHtmlToDataTable
(
string
html
)
{
DataTable
dataTable
=
new
DataTable
();
HtmlDocument
doc
=
new
HtmlDocument
();
doc
.
LoadHtml
(
html
);
// 从HTML中提取表格数据
var
tableNodes
=
doc
.
DocumentNode
.
SelectNodes
(
"//table"
);
if
(
tableNodes
!=
null
&&
tableNodes
.
Count
>
0
)
{
var
headers
=
tableNodes
[
0
].
SelectNodes
(
".//th"
);
if
(
headers
!=
null
)
{
foreach
(
var
header
in
headers
)
{
string
headerText
=
header
.
InnerText
.
Trim
();
if
(!
string
.
IsNullOrEmpty
(
headerText
))
{
dataTable
.
Columns
.
Add
(
headerText
);
}
}
}
var
rows
=
tableNodes
[
0
].
SelectNodes
(
".//tr"
);
foreach
(
var
row
in
rows
)
{
DataRow
dataRow
=
dataTable
.
NewRow
();
var
cells
=
row
.
SelectNodes
(
".//td"
);
for
(
int
i
=
0
;
i
<
cells
.
Count
;
i
++)
{
string
cellText
=
cells
[
i
].
InnerText
.
Trim
();
if
(
i
<
dataTable
.
Columns
.
Count
)
{
dataRow
[
i
]
=
cellText
;
}
}
dataTable
.
Rows
.
Add
(
dataRow
);
}
}
return
dataTable
;
}
public
async
System
.
Threading
.
Tasks
.
Task
<
string
>
SaveDataTableToExcel
(
DataTable
dataTable
,
string
filePath
)
{
FileInfo
fileInfo
=
new
FileInfo
(
filePath
);
using
(
ExcelPackage
package
=
new
ExcelPackage
(
fileInfo
))
{
ExcelWorksheet
worksheet
=
package
.
Workbook
.
Worksheets
.
Add
(
"Sheet1"
);
// 写入列标题
for
(
int
i
=
0
;
i
<
dataTable
.
Columns
.
Count
;
i
++)
{
worksheet
.
Cells
[
1
,
i
+
1
].
Value
=
dataTable
.
Columns
[
i
].
ColumnName
;
}
// 写入行数据
for
(
int
i
=
0
;
i
<
dataTable
.
Rows
.
Count
;
i
++)
{
for
(
int
j
=
0
;
j
<
dataTable
.
Columns
.
Count
;
j
++)
{
worksheet
.
Cells
[
i
+
2
,
j
+
1
].
Value
=
dataTable
.
Rows
[
i
][
j
];
}
}
package
.
Save
();
}
string
outfilepath
=
@
$"https://lsk.suvalue.com/api/export/export/人群分布报告/
{
filePath
.
Replace
(
$@"
{
fwq
}
"
,
""
)}
"
;
return
outfilepath
+
"xlsx"
;
}
/// <summary>
/// 创建流水表
/// </summary>
...
...
@@ -1476,7 +1567,7 @@ public void PullData(long indexs, string DatabaseName, string tableName, int dbz
}
catch
(
Exception
e
)
{
LOG
(
$"修复超时错误"
,
"修复超时错误"
,
indexs
,
"修复失败"
,
$"报错:
{
e
}
"
);
//
LOG($"修复超时错误", "修复超时错误", indexs, "修复失败", $"报错:{e}");
}
finally
{
...
...
@@ -1604,7 +1695,7 @@ public long QueryPatient(string tableName)
public
List
<
服务器
>
标准库
fwq
()
{
DbConnection
connection
=
new
SqlConnection
(
_configConnectionString
);
return
connection
.
Query
<
服务器
>(
$@"SELECT * FROM [SV_QueryPlatform].[dbo].[服务器]
where type='标准库'
"
).
ToList
();
return
connection
.
Query
<
服务器
>(
$@"SELECT * FROM [SV_QueryPlatform].[dbo].[服务器]"
).
ToList
();
}
}
...
...
api/queryPlaform.Api/Properties/PublishProfiles/FolderProfile.pubxml
View file @
2cf9a257
...
...
@@ -4,9 +4,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<DeleteExistingFiles>
T
rue</DeleteExistingFiles>
<ExcludeApp_Data>
F
alse</ExcludeApp_Data>
<LaunchSiteAfterPublish>
T
rue</LaunchSiteAfterPublish>
<DeleteExistingFiles>
t
rue</DeleteExistingFiles>
<ExcludeApp_Data>
f
alse</ExcludeApp_Data>
<LaunchSiteAfterPublish>
t
rue</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
...
...
@@ -15,6 +15,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<SiteUrlToLaunchAfterPublish />
<TargetFramework>netcoreapp3.1</TargetFramework>
<ProjectGuid>e9d630a1-10fd-4dcf-abc2-d827dd79d8d4</ProjectGuid>
<SelfContained>false</SelfContained>
<SelfContained>true</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>
</Project>
\ No newline at end of file
api/queryPlaform.Api/appsettings.json
View file @
2cf9a257
...
...
@@ -21,7 +21,8 @@
"Connection155"
:
"Server=192.168.18.155;Database=DB_SV_Data_Config;User ID=sa;Password=Suvalue2016;Trusted_Connection=False;"
,
"Connection156"
:
"Server=192.168.18.156;Database=DB_SV_Data_Config;User ID=sa;Password=srv@Ashersa;Trusted_Connection=False;"
,
"Connection158"
:
"Server=192.168.18.158;Database=DB_SV_Data_Config;User ID=sa;Password=Suvalue2016;Trusted_Connection=False;"
,
"pg"
:
"Host=192.168.18.185;Port=5432;Username=postgres;Password=Suvalue2016;Database=db_QueryPlatformcare_drgs;"
"pg"
:
"Host=192.168.18.185;Port=5432;Username=postgres;Password=Suvalue2016;Database=db_QueryPlatformcare_drgs;"
,
"lskxc"
:
"4"
}
}
...
...
api/queryPlaform.Api/wwwroot/QueryPlatform.Api.xml
View file @
2cf9a257
...
...
@@ -198,7 +198,7 @@
</summary>
<returns></returns>
</member>
<member
name=
"
F:QueryPlatform.Api.Controllers.ResourceController.semaphore
"
>
<member
name=
"
M:QueryPlatform.Api.Controllers.ResourceController.PullDataAsync(System.Int64,System.String,System.String,System.String)
"
>
<summary>
拉取流水库数据
</summary>
...
...
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