初始化导入
This commit is contained in:
parent
394cb58b4a
commit
0a6ce62d9a
25
.dockerignore
Normal file
25
.dockerignore
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
**/.dockerignore
|
||||||
|
**/.env
|
||||||
|
**/.git
|
||||||
|
**/.gitignore
|
||||||
|
**/.project
|
||||||
|
**/.settings
|
||||||
|
**/.toolstarget
|
||||||
|
**/.vs
|
||||||
|
**/.vscode
|
||||||
|
**/.idea
|
||||||
|
**/*.*proj.user
|
||||||
|
**/*.dbmdl
|
||||||
|
**/*.jfm
|
||||||
|
**/azds.yaml
|
||||||
|
**/bin
|
||||||
|
**/charts
|
||||||
|
**/docker-compose*
|
||||||
|
**/Dockerfile*
|
||||||
|
**/node_modules
|
||||||
|
**/npm-debug.log
|
||||||
|
**/obj
|
||||||
|
**/secrets.dev.yaml
|
||||||
|
**/values.dev.yaml
|
||||||
|
LICENSE
|
||||||
|
README.md
|
||||||
365
.gitignore
vendored
Normal file
365
.gitignore
vendored
Normal file
@ -0,0 +1,365 @@
|
|||||||
|
## Ignore Visual Studio temporary files, build results, and
|
||||||
|
## files generated by popular Visual Studio add-ons.
|
||||||
|
##
|
||||||
|
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||||
|
.idea/
|
||||||
|
.vs/
|
||||||
|
# User-specific files
|
||||||
|
*.rsuser
|
||||||
|
*.suo
|
||||||
|
*.user
|
||||||
|
*.userosscache
|
||||||
|
*.sln.docstates
|
||||||
|
bin/
|
||||||
|
|
||||||
|
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||||
|
*.userprefs
|
||||||
|
|
||||||
|
# Mono auto generated files
|
||||||
|
mono_crash.*
|
||||||
|
|
||||||
|
# Build results
|
||||||
|
[Dd]ebug/
|
||||||
|
[Dd]ebugPublic/
|
||||||
|
[Rr]elease/
|
||||||
|
[Rr]eleases/
|
||||||
|
x64/
|
||||||
|
x86/
|
||||||
|
[Ww][Ii][Nn]32/
|
||||||
|
[Aa][Rr][Mm]/
|
||||||
|
[Aa][Rr][Mm]64/
|
||||||
|
bld/
|
||||||
|
[Bb]in/
|
||||||
|
[Oo]bj/
|
||||||
|
[Oo]ut/
|
||||||
|
[Ll]og/
|
||||||
|
[Ll]ogs/
|
||||||
|
|
||||||
|
# Visual Studio 2015/2017 cache/options directory
|
||||||
|
.vs/
|
||||||
|
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||||
|
#wwwroot/
|
||||||
|
|
||||||
|
# Visual Studio 2017 auto generated files
|
||||||
|
Generated\ Files/
|
||||||
|
|
||||||
|
# MSTest test Results
|
||||||
|
[Tt]est[Rr]esult*/
|
||||||
|
[Bb]uild[Ll]og.*
|
||||||
|
|
||||||
|
# NUnit
|
||||||
|
*.VisualState.xml
|
||||||
|
TestResult.xml
|
||||||
|
nunit-*.xml
|
||||||
|
|
||||||
|
# Build Results of an ATL Project
|
||||||
|
[Dd]ebugPS/
|
||||||
|
[Rr]eleasePS/
|
||||||
|
dlldata.c
|
||||||
|
|
||||||
|
# Benchmark Results
|
||||||
|
BenchmarkDotNet.Artifacts/
|
||||||
|
|
||||||
|
# .NET Core
|
||||||
|
project.lock.json
|
||||||
|
project.fragment.lock.json
|
||||||
|
artifacts/
|
||||||
|
|
||||||
|
# ASP.NET Scaffolding
|
||||||
|
ScaffoldingReadMe.txt
|
||||||
|
|
||||||
|
# StyleCop
|
||||||
|
StyleCopReport.xml
|
||||||
|
|
||||||
|
# Files built by Visual Studio
|
||||||
|
*_i.c
|
||||||
|
*_p.c
|
||||||
|
*_h.h
|
||||||
|
*.ilk
|
||||||
|
*.meta
|
||||||
|
*.obj
|
||||||
|
*.iobj
|
||||||
|
*.pch
|
||||||
|
*.pdb
|
||||||
|
*.ipdb
|
||||||
|
*.pgc
|
||||||
|
*.pgd
|
||||||
|
*.rsp
|
||||||
|
*.sbr
|
||||||
|
*.tlb
|
||||||
|
*.tli
|
||||||
|
*.tlh
|
||||||
|
*.tmp
|
||||||
|
*.tmp_proj
|
||||||
|
*_wpftmp.csproj
|
||||||
|
*.log
|
||||||
|
*.vspscc
|
||||||
|
*.vssscc
|
||||||
|
.builds
|
||||||
|
*.pidb
|
||||||
|
*.svclog
|
||||||
|
*.scc
|
||||||
|
|
||||||
|
# Chutzpah Test files
|
||||||
|
_Chutzpah*
|
||||||
|
|
||||||
|
# Visual C++ cache files
|
||||||
|
ipch/
|
||||||
|
*.aps
|
||||||
|
*.ncb
|
||||||
|
*.opendb
|
||||||
|
*.opensdf
|
||||||
|
*.sdf
|
||||||
|
*.cachefile
|
||||||
|
*.VC.db
|
||||||
|
*.VC.VC.opendb
|
||||||
|
|
||||||
|
# Visual Studio profiler
|
||||||
|
*.psess
|
||||||
|
*.vsp
|
||||||
|
*.vspx
|
||||||
|
*.sap
|
||||||
|
|
||||||
|
# Visual Studio Trace Files
|
||||||
|
*.e2e
|
||||||
|
|
||||||
|
# TFS 2012 Local Workspace
|
||||||
|
$tf/
|
||||||
|
|
||||||
|
# Guidance Automation Toolkit
|
||||||
|
*.gpState
|
||||||
|
|
||||||
|
# ReSharper is a .NET coding add-in
|
||||||
|
_ReSharper*/
|
||||||
|
*.[Rr]e[Ss]harper
|
||||||
|
*.DotSettings.user
|
||||||
|
|
||||||
|
# TeamCity is a build add-in
|
||||||
|
_TeamCity*
|
||||||
|
|
||||||
|
# DotCover is a Code Coverage Tool
|
||||||
|
*.dotCover
|
||||||
|
|
||||||
|
# AxoCover is a Code Coverage Tool
|
||||||
|
.axoCover/*
|
||||||
|
!.axoCover/settings.json
|
||||||
|
|
||||||
|
# Coverlet is a free, cross platform Code Coverage Tool
|
||||||
|
coverage*.json
|
||||||
|
coverage*.xml
|
||||||
|
coverage*.info
|
||||||
|
|
||||||
|
# Visual Studio code coverage results
|
||||||
|
*.coverage
|
||||||
|
*.coveragexml
|
||||||
|
|
||||||
|
# NCrunch
|
||||||
|
_NCrunch_*
|
||||||
|
.*crunch*.local.xml
|
||||||
|
nCrunchTemp_*
|
||||||
|
|
||||||
|
# MightyMoose
|
||||||
|
*.mm.*
|
||||||
|
AutoTest.Net/
|
||||||
|
|
||||||
|
# Web workbench (sass)
|
||||||
|
.sass-cache/
|
||||||
|
|
||||||
|
# Installshield output folder
|
||||||
|
[Ee]xpress/
|
||||||
|
|
||||||
|
# DocProject is a documentation generator add-in
|
||||||
|
DocProject/buildhelp/
|
||||||
|
DocProject/Help/*.HxT
|
||||||
|
DocProject/Help/*.HxC
|
||||||
|
DocProject/Help/*.hhc
|
||||||
|
DocProject/Help/*.hhk
|
||||||
|
DocProject/Help/*.hhp
|
||||||
|
DocProject/Help/Html2
|
||||||
|
DocProject/Help/html
|
||||||
|
|
||||||
|
# Click-Once directory
|
||||||
|
publish/
|
||||||
|
|
||||||
|
# Publish Web Output
|
||||||
|
*.[Pp]ublish.xml
|
||||||
|
*.azurePubxml
|
||||||
|
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||||
|
# but database connection strings (with potential passwords) will be unencrypted
|
||||||
|
*.pubxml
|
||||||
|
*.publishproj
|
||||||
|
|
||||||
|
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||||
|
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||||
|
# in these scripts will be unencrypted
|
||||||
|
PublishScripts/
|
||||||
|
|
||||||
|
# NuGet Packages
|
||||||
|
*.nupkg
|
||||||
|
# NuGet Symbol Packages
|
||||||
|
*.snupkg
|
||||||
|
# The packages folder can be ignored because of Package Restore
|
||||||
|
**/[Pp]ackages/*
|
||||||
|
# except build/, which is used as an MSBuild target.
|
||||||
|
!**/[Pp]ackages/build/
|
||||||
|
# Uncomment if necessary however generally it will be regenerated when needed
|
||||||
|
#!**/[Pp]ackages/repositories.config
|
||||||
|
# NuGet v3's project.json files produces more ignorable files
|
||||||
|
*.nuget.props
|
||||||
|
*.nuget.targets
|
||||||
|
|
||||||
|
# Microsoft Azure Build Output
|
||||||
|
csx/
|
||||||
|
*.build.csdef
|
||||||
|
|
||||||
|
# Microsoft Azure Emulator
|
||||||
|
ecf/
|
||||||
|
rcf/
|
||||||
|
|
||||||
|
# Windows Store app package directories and files
|
||||||
|
AppPackages/
|
||||||
|
BundleArtifacts/
|
||||||
|
Package.StoreAssociation.xml
|
||||||
|
_pkginfo.txt
|
||||||
|
*.appx
|
||||||
|
*.appxbundle
|
||||||
|
*.appxupload
|
||||||
|
|
||||||
|
# Visual Studio cache files
|
||||||
|
# files ending in .cache can be ignored
|
||||||
|
*.[Cc]ache
|
||||||
|
# but keep track of directories ending in .cache
|
||||||
|
!?*.[Cc]ache/
|
||||||
|
|
||||||
|
# Others
|
||||||
|
ClientBin/
|
||||||
|
~$*
|
||||||
|
*~
|
||||||
|
*.dbmdl
|
||||||
|
*.dbproj.schemaview
|
||||||
|
*.jfm
|
||||||
|
*.pfx
|
||||||
|
*.publishsettings
|
||||||
|
orleans.codegen.cs
|
||||||
|
|
||||||
|
# Including strong name files can present a security risk
|
||||||
|
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
||||||
|
#*.snk
|
||||||
|
|
||||||
|
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||||
|
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||||
|
#bower_components/
|
||||||
|
|
||||||
|
# RIA/Silverlight projects
|
||||||
|
Generated_Code/
|
||||||
|
|
||||||
|
# Backup & report files from converting an old project file
|
||||||
|
# to a newer Visual Studio version. Backup files are not needed,
|
||||||
|
# because we have git ;-)
|
||||||
|
_UpgradeReport_Files/
|
||||||
|
Backup*/
|
||||||
|
UpgradeLog*.XML
|
||||||
|
UpgradeLog*.htm
|
||||||
|
ServiceFabricBackup/
|
||||||
|
*.rptproj.bak
|
||||||
|
|
||||||
|
# SQL Server files
|
||||||
|
*.mdf
|
||||||
|
*.ldf
|
||||||
|
*.ndf
|
||||||
|
|
||||||
|
# Business Intelligence projects
|
||||||
|
*.rdl.data
|
||||||
|
*.bim.layout
|
||||||
|
*.bim_*.settings
|
||||||
|
*.rptproj.rsuser
|
||||||
|
*- [Bb]ackup.rdl
|
||||||
|
*- [Bb]ackup ([0-9]).rdl
|
||||||
|
*- [Bb]ackup ([0-9][0-9]).rdl
|
||||||
|
|
||||||
|
# Microsoft Fakes
|
||||||
|
FakesAssemblies/
|
||||||
|
|
||||||
|
# GhostDoc plugin setting file
|
||||||
|
*.GhostDoc.xml
|
||||||
|
|
||||||
|
# Node.js Tools for Visual Studio
|
||||||
|
.ntvs_analysis.dat
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# Visual Studio 6 build log
|
||||||
|
*.plg
|
||||||
|
|
||||||
|
# Visual Studio 6 workspace options file
|
||||||
|
*.opt
|
||||||
|
|
||||||
|
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||||
|
*.vbw
|
||||||
|
|
||||||
|
# Visual Studio LightSwitch build output
|
||||||
|
**/*.HTMLClient/GeneratedArtifacts
|
||||||
|
**/*.DesktopClient/GeneratedArtifacts
|
||||||
|
**/*.DesktopClient/ModelManifest.xml
|
||||||
|
**/*.Server/GeneratedArtifacts
|
||||||
|
**/*.Server/ModelManifest.xml
|
||||||
|
_Pvt_Extensions
|
||||||
|
|
||||||
|
# Paket dependency manager
|
||||||
|
.paket/paket.exe
|
||||||
|
paket-files/
|
||||||
|
|
||||||
|
# FAKE - F# Make
|
||||||
|
.fake/
|
||||||
|
|
||||||
|
# CodeRush personal settings
|
||||||
|
.cr/personal
|
||||||
|
|
||||||
|
# Python Tools for Visual Studio (PTVS)
|
||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
|
||||||
|
# Cake - Uncomment if you are using it
|
||||||
|
# tools/**
|
||||||
|
# !tools/packages.config
|
||||||
|
|
||||||
|
# Tabs Studio
|
||||||
|
*.tss
|
||||||
|
|
||||||
|
# Telerik's JustMock configuration file
|
||||||
|
*.jmconfig
|
||||||
|
|
||||||
|
# BizTalk build output
|
||||||
|
*.btp.cs
|
||||||
|
*.btm.cs
|
||||||
|
*.odx.cs
|
||||||
|
*.xsd.cs
|
||||||
|
|
||||||
|
# OpenCover UI analysis results
|
||||||
|
OpenCover/
|
||||||
|
|
||||||
|
# Azure Stream Analytics local run output
|
||||||
|
ASALocalRun/
|
||||||
|
|
||||||
|
# MSBuild Binary and Structured Log
|
||||||
|
*.binlog
|
||||||
|
|
||||||
|
# NVidia Nsight GPU debugger configuration file
|
||||||
|
*.nvuser
|
||||||
|
|
||||||
|
# MFractors (Xamarin productivity tool) working folder
|
||||||
|
.mfractor/
|
||||||
|
|
||||||
|
# Local History for Visual Studio
|
||||||
|
.localhistory/
|
||||||
|
|
||||||
|
# BeatPulse healthcheck temp database
|
||||||
|
healthchecksdb
|
||||||
|
|
||||||
|
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
||||||
|
MigrationBackup/
|
||||||
|
|
||||||
|
# Ionide (cross platform F# VS Code tools) working folder
|
||||||
|
.ionide/
|
||||||
|
|
||||||
|
# Fody - auto-generated XML schema
|
||||||
|
FodyWeavers.xsd
|
||||||
22
AutoDispatching.sln
Normal file
22
AutoDispatching.sln
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoDispatching", "AutoDispatching\AutoDispatching.csproj", "{2C965E22-EBA5-4F50-A979-C11AD28B61B2}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoDispathingWork", "AutoDispathingWork\AutoDispathingWork.csproj", "{39E15372-E957-4785-ABE7-D160ECC6440C}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{2C965E22-EBA5-4F50-A979-C11AD28B61B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{2C965E22-EBA5-4F50-A979-C11AD28B61B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{2C965E22-EBA5-4F50-A979-C11AD28B61B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{2C965E22-EBA5-4F50-A979-C11AD28B61B2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{39E15372-E957-4785-ABE7-D160ECC6440C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{39E15372-E957-4785-ABE7-D160ECC6440C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{39E15372-E957-4785-ABE7-D160ECC6440C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{39E15372-E957-4785-ABE7-D160ECC6440C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
20
AutoDispatching/AutoDispatching.csproj
Normal file
20
AutoDispatching/AutoDispatching.csproj
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="..\.dockerignore">
|
||||||
|
<Link>.dockerignore</Link>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="LiteDB" Version="5.0.17" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
20
AutoDispatching/Dockerfile
Normal file
20
AutoDispatching/Dockerfile
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
||||||
|
WORKDIR /app
|
||||||
|
EXPOSE 80
|
||||||
|
EXPOSE 443
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||||
|
WORKDIR /src
|
||||||
|
COPY ["AutoDispatching/AutoDispatching.csproj", "AutoDispatching/"]
|
||||||
|
RUN dotnet restore "AutoDispatching/AutoDispatching.csproj"
|
||||||
|
COPY . .
|
||||||
|
WORKDIR "/src/AutoDispatching"
|
||||||
|
RUN dotnet build "AutoDispatching.csproj" -c Release -o /app/build
|
||||||
|
|
||||||
|
FROM build AS publish
|
||||||
|
RUN dotnet publish "AutoDispatching.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
||||||
|
|
||||||
|
FROM base AS final
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=publish /app/publish .
|
||||||
|
ENTRYPOINT ["dotnet", "AutoDispatching.dll"]
|
||||||
6
AutoDispatching/Program.cs
Normal file
6
AutoDispatching/Program.cs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
var app = builder.Build();
|
||||||
|
|
||||||
|
app.MapGet("/", () => "Hello World!");
|
||||||
|
|
||||||
|
app.Run();
|
||||||
38
AutoDispatching/Properties/launchSettings.json
Normal file
38
AutoDispatching/Properties/launchSettings.json
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
{
|
||||||
|
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||||
|
"iisSettings": {
|
||||||
|
"windowsAuthentication": false,
|
||||||
|
"anonymousAuthentication": true,
|
||||||
|
"iisExpress": {
|
||||||
|
"applicationUrl": "http://localhost:26851",
|
||||||
|
"sslPort": 44330
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"profiles": {
|
||||||
|
"http": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"launchBrowser": true,
|
||||||
|
"applicationUrl": "http://localhost:5048",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"https": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"launchBrowser": true,
|
||||||
|
"applicationUrl": "https://localhost:7273;http://localhost:5048",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"IIS Express": {
|
||||||
|
"commandName": "IISExpress",
|
||||||
|
"launchBrowser": true,
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
8
AutoDispatching/appsettings.Development.json
Normal file
8
AutoDispatching/appsettings.Development.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
9
AutoDispatching/appsettings.json
Normal file
9
AutoDispatching/appsettings.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AllowedHosts": "*"
|
||||||
|
}
|
||||||
23
AutoDispathingWork/AutoDispathingWork.csproj
Normal file
23
AutoDispathingWork/AutoDispathingWork.csproj
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk.Worker">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<UserSecretsId>dotnet-WorkerService1-16724269-88FF-4E7A-9946-5155FD173413</UserSecretsId>
|
||||||
|
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||||
|
<RootNamespace>WorkerService1</RootNamespace>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0-preview.7.23375.6"/>
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="..\.dockerignore">
|
||||||
|
<Link>.dockerignore</Link>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
64
AutoDispathingWork/CloseWorker.cs
Normal file
64
AutoDispathingWork/CloseWorker.cs
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
using Microsoft.Extensions.Options;
|
||||||
|
using WorkerService1.Dto.Configuration;
|
||||||
|
using WorkerService1.Services;
|
||||||
|
|
||||||
|
namespace WorkerService1;
|
||||||
|
|
||||||
|
public class CloseWorker : BackgroundService
|
||||||
|
{
|
||||||
|
private readonly ILogger<CloseWorker> _logger;
|
||||||
|
private readonly SpiderServices _spiderServices;
|
||||||
|
|
||||||
|
private readonly IServiceProvider _serviceProvider;
|
||||||
|
|
||||||
|
public CloseWorker(ILogger<CloseWorker> logger, SpiderServices spiderServices, IServiceProvider serviceProvider)
|
||||||
|
{
|
||||||
|
_logger = logger;
|
||||||
|
_spiderServices = spiderServices;
|
||||||
|
_serviceProvider = serviceProvider;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||||
|
{
|
||||||
|
while (!stoppingToken.IsCancellationRequested)
|
||||||
|
{
|
||||||
|
if (_logger.IsEnabled(LogLevel.Information))
|
||||||
|
{
|
||||||
|
_logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await Handle();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_logger.LogError("执行控制器发生错误,错误信息:ex{}", e.StackTrace);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
using var scope = _serviceProvider.CreateScope();
|
||||||
|
var options = scope.ServiceProvider.GetRequiredService<IOptionsMonitor<ClientOptions>>();
|
||||||
|
await Task.Delay(options.CurrentValue.Delay, stoppingToken);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task Handle()
|
||||||
|
{
|
||||||
|
var listRes = await _spiderServices.GetTaskList(3);
|
||||||
|
if (listRes.IsSuccess)
|
||||||
|
{
|
||||||
|
var needDispose = listRes.Result?.records;
|
||||||
|
//轮询列表,看有没有符合状态的进行处理
|
||||||
|
if (needDispose?.Any() ?? false)
|
||||||
|
{
|
||||||
|
foreach (var item in needDispose)
|
||||||
|
{
|
||||||
|
//2.结案操作
|
||||||
|
var result = await _spiderServices.CloseFile(item.caseNumber, "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
18
AutoDispathingWork/Dockerfile
Normal file
18
AutoDispathingWork/Dockerfile
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||||
|
WORKDIR /src
|
||||||
|
COPY ["WorkerService1/WorkerService1.csproj", "WorkerService1/"]
|
||||||
|
RUN dotnet restore "WorkerService1/WorkerService1.csproj"
|
||||||
|
COPY . .
|
||||||
|
WORKDIR "/src/WorkerService1"
|
||||||
|
RUN dotnet build "WorkerService1.csproj" -c Release -o /app/build
|
||||||
|
|
||||||
|
FROM build AS publish
|
||||||
|
RUN dotnet publish "WorkerService1.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
||||||
|
|
||||||
|
FROM base AS final
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=publish /app/publish .
|
||||||
|
ENTRYPOINT ["dotnet", "WorkerService1.dll"]
|
||||||
36
AutoDispathingWork/Dto/Configuration/ClientOptions.cs
Normal file
36
AutoDispathingWork/Dto/Configuration/ClientOptions.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace WorkerService1.Dto.Configuration;
|
||||||
|
|
||||||
|
public class ClientOptions
|
||||||
|
{
|
||||||
|
public string ApiGateway { get; set; } = "http://121.4.75.240/";
|
||||||
|
[JsonPropertyName("username")]
|
||||||
|
public string UserName { get; set; } = "ganquanjiedao";
|
||||||
|
public string Password { get; set; } = "12345678a";
|
||||||
|
public int Delay { get; set; } = 1000;
|
||||||
|
public string LoginApi { get; set; } = "api/auth/v5/users/login";
|
||||||
|
public string GetTaskApi { get; set; } = "api/megcity/v1/events/queryByWaterFall";
|
||||||
|
|
||||||
|
public string GetUserApi { get; set; } = "api/galaxy/v1/auth/users/query";
|
||||||
|
|
||||||
|
public string DiposeOrder { get; set; } = "api/megcity/v1/events/dispatch/{0}";
|
||||||
|
public string CloseFileApi { get; set; } = "api/megcity/v1/events/pass";
|
||||||
|
|
||||||
|
//登录接口
|
||||||
|
public string LoginUrl => $"{ApiGateway}{LoginApi}";
|
||||||
|
|
||||||
|
//案件接口
|
||||||
|
public string GetTaskUrl => $"{ApiGateway}{GetTaskApi}";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//获取用户接口
|
||||||
|
|
||||||
|
public string GetUserUrl => $"{ApiGateway}{GetUserApi}";
|
||||||
|
public string DiposeOrderUrl => $"{ApiGateway}{DiposeOrder}";
|
||||||
|
|
||||||
|
public string CloseFileUrl => $"{ApiGateway}{CloseFileApi}";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
62
AutoDispathingWork/Dto/LoginResponse.cs
Normal file
62
AutoDispathingWork/Dto/LoginResponse.cs
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace WorkerService1.Dto;
|
||||||
|
|
||||||
|
// {"code":0,"msg":"成功","data":{"token":"sXMHBPcPEBqrHCBfAREgMoffLbGutKszqfclcYJoXRvonLHsZiVZXcNgjwiD","expireTime":86400000,"user":{"organization":{"users":[],"orgName":"甘泉街道","subOrgs":[],"userCount":0,"orderCode":0,"orgLevel":1,"userTotalCount":0,"permit":true,"id":"6e9232ef-7b84-11e8-86b1-6c92bf4e6960"},"online":false,"passWDInit":false,"ip":"","sso":false,"userName":"ganquanjiedao","roles":[{"users":[],"remark":"","roleName":"高级管理员","permissions":[],"id":"0c772d50-a4af-439f-a18a-8fd332343d5e"}],"pkiId":"","creator":"73d82f01-dc1e-4666-bc79-3e59fc574cee","isApp":false,"thumb":"","phoneNo":"","employeeId":"","enabled":true,"userRealName":"ganquan","clientAppId":"megcity-web","datas":{},"id":"27465e20-6942-4569-8141-2ff5c264111e"}}}
|
||||||
|
public class LoginResponse
|
||||||
|
{
|
||||||
|
[JsonPropertyName("code")] public int Code { get; set; }
|
||||||
|
[JsonPropertyName("msg")] public string? Msg { get; set; }
|
||||||
|
[JsonPropertyName("data")] public LoginResultData? Data { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class LoginResultData
|
||||||
|
{
|
||||||
|
[JsonPropertyName("token")] public string? Token { get; set; }
|
||||||
|
[JsonPropertyName("expireTime")] public int ExpireTime { get; set; }
|
||||||
|
[JsonPropertyName("user")] public LoginResultDataUser? User { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class LoginResultDataUser
|
||||||
|
{
|
||||||
|
[JsonPropertyName("organization")] public LoginResultDataUserOrganization? Organization { get; set; }
|
||||||
|
[JsonPropertyName("online")] public bool Online { get; set; }
|
||||||
|
[JsonPropertyName("passWDInit")] public bool PassWDInit { get; set; }
|
||||||
|
[JsonPropertyName("ip")] public string? Ip { get; set; }
|
||||||
|
[JsonPropertyName("sso")] public bool Sso { get; set; }
|
||||||
|
[JsonPropertyName("userName")] public string? UserName { get; set; }
|
||||||
|
[JsonPropertyName("roles")] public LoginResultDataUserRole[]? Roles { get; set; }
|
||||||
|
[JsonPropertyName("pkiId")] public string? PkiId { get; set; }
|
||||||
|
[JsonPropertyName("creator")] public string? Creator { get; set; }
|
||||||
|
[JsonPropertyName("isApp")] public bool IsApp { get; set; }
|
||||||
|
[JsonPropertyName("thumb")] public string? Thumb { get; set; }
|
||||||
|
[JsonPropertyName("phoneNo")] public string? PhoneNo { get; set; }
|
||||||
|
[JsonPropertyName("employeeId")] public string? EmployeeId { get; set; }
|
||||||
|
[JsonPropertyName("enabled")] public bool Enabled { get; set; }
|
||||||
|
[JsonPropertyName("userRealName")] public string? UserRealName { get; set; }
|
||||||
|
[JsonPropertyName("clientAppId")] public string? ClientAppId { get; set; }
|
||||||
|
[JsonPropertyName("datas")] public object? Datas { get; set; }
|
||||||
|
[JsonPropertyName("id")] public string? Id { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class LoginResultDataUserOrganization
|
||||||
|
{
|
||||||
|
[JsonPropertyName("users")] public object[]? Users { get; set; }
|
||||||
|
[JsonPropertyName("orgName")] public string? OrgName { get; set; }
|
||||||
|
[JsonPropertyName("subOrgs")] public object[]? SubOrgs { get; set; }
|
||||||
|
[JsonPropertyName("userCount")] public int UserCount { get; set; }
|
||||||
|
[JsonPropertyName("orderCode")] public int OrderCode { get; set; }
|
||||||
|
[JsonPropertyName("orgLevel")] public int OrgLevel { get; set; }
|
||||||
|
[JsonPropertyName("userTotalCount")] public int UserTotalCount { get; set; }
|
||||||
|
[JsonPropertyName("permit")] public bool Permit { get; set; }
|
||||||
|
[JsonPropertyName("id")] public string? Id { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class LoginResultDataUserRole
|
||||||
|
{
|
||||||
|
[JsonPropertyName("users")] public object[]? Users { get; set; }
|
||||||
|
[JsonPropertyName("remark")] public string? Remark { get; set; }
|
||||||
|
[JsonPropertyName("roleName")] public string? RoleName { get; set; }
|
||||||
|
[JsonPropertyName("permissions")] public object[]? Permissions { get; set; }
|
||||||
|
[JsonPropertyName("id")] public string? Id { get; set; }
|
||||||
|
}
|
||||||
7
AutoDispathingWork/Dto/LoginResult.cs
Normal file
7
AutoDispathingWork/Dto/LoginResult.cs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
namespace WorkerService1.Dto;
|
||||||
|
|
||||||
|
public class LoginResult
|
||||||
|
{
|
||||||
|
public string? Token { get; set; }
|
||||||
|
public string? Message { get; set; }
|
||||||
|
}
|
||||||
11
AutoDispathingWork/Dto/QueryRequest/CloseReq.cs
Normal file
11
AutoDispathingWork/Dto/QueryRequest/CloseReq.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace WorkerService1.Dto.QueryRequest;
|
||||||
|
|
||||||
|
public class CloseReq
|
||||||
|
{
|
||||||
|
[JsonPropertyName("caseNumber")]
|
||||||
|
public string CaseNumber { get; set; }
|
||||||
|
[JsonPropertyName("suggestion")]
|
||||||
|
public string Suggestion { get; set; }
|
||||||
|
}
|
||||||
16
AutoDispathingWork/Dto/QueryRequest/DispatchReq.cs
Normal file
16
AutoDispathingWork/Dto/QueryRequest/DispatchReq.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace WorkerService1.Dto.QueryRequest;
|
||||||
|
|
||||||
|
public class DispatchReq
|
||||||
|
{
|
||||||
|
// {"acceptTypeCode":"A2-01-10","target":2,"handlerId":"66fa9261-16f6-49aa-a391-5848f40301e0","typeCode":"A2-01-10"}
|
||||||
|
[JsonPropertyName("acceptTypeCode")]
|
||||||
|
public string AcceptTypeCode { get; set; } = "A2-01-10";
|
||||||
|
[JsonPropertyName("target")]
|
||||||
|
public int Target { get; set; } = 2;
|
||||||
|
[JsonPropertyName("handlerId")]
|
||||||
|
public string HandlerId { get; set; } = "66fa9261-16f6-49aa-a391-5848f40301e0";
|
||||||
|
[JsonPropertyName("typeCode")]
|
||||||
|
public string TypeCode { get; set; } = "A2-01-10";
|
||||||
|
}
|
||||||
14
AutoDispathingWork/Dto/QueryRequest/QueryReq.cs
Normal file
14
AutoDispathingWork/Dto/QueryRequest/QueryReq.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace WorkerService1.Dto.QueryRequest;
|
||||||
|
|
||||||
|
public class QueryReq
|
||||||
|
{
|
||||||
|
[JsonPropertyName("state")] public int[]? State { get; set; }
|
||||||
|
[JsonPropertyName("pageNo")] public int PageNo { get; set; }
|
||||||
|
[JsonPropertyName("pageSize")] public int PageSize { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("sortType")] public int[]? SortType { get; set; }
|
||||||
|
[JsonPropertyName("createStartTime")] public long CreateStartTime { get; set; }
|
||||||
|
[JsonPropertyName("createEndTime")] public long CreateEndTime { get; set; }
|
||||||
|
}
|
||||||
24
AutoDispathingWork/Dto/QueryRequest/UserQuery.cs
Normal file
24
AutoDispathingWork/Dto/QueryRequest/UserQuery.cs
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace WorkerService1.Dto.QueryRequest;
|
||||||
|
|
||||||
|
public class UserQuery
|
||||||
|
{
|
||||||
|
// {"pageNo":1,"pageSize":20,"condition":{"roleIds":["a2e267c0-d88d-4ecb-a4b5-d904e85dfbb6"],"enabled":"null"}}
|
||||||
|
[JsonPropertyName("pageNo")]
|
||||||
|
public int PageNo { get; set; } = 1;
|
||||||
|
[JsonPropertyName("pageSize")]
|
||||||
|
public int PageSize { get; set; } = 20;
|
||||||
|
[JsonPropertyName("condition")]
|
||||||
|
public Condition Condition { get; set; } = new Condition();
|
||||||
|
[JsonPropertyName("enabled")]
|
||||||
|
public bool? Enabled { get; set; } = null;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Condition
|
||||||
|
{
|
||||||
|
[JsonPropertyName("roleIds")]
|
||||||
|
public string[] RoleIds { get; set; } = new string[] { "a2e267c0-d88d-4ecb-a4b5-d904e85dfbb6" };
|
||||||
|
}
|
||||||
|
|
||||||
9
AutoDispathingWork/Dto/QueryResponse/CloseResp.cs
Normal file
9
AutoDispathingWork/Dto/QueryResponse/CloseResp.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
namespace WorkerService1.Dto.QueryResponse;
|
||||||
|
|
||||||
|
public class CloseResp
|
||||||
|
{
|
||||||
|
public int code { get; set; }
|
||||||
|
public string msg { get; set; }
|
||||||
|
|
||||||
|
public object data { get; set; }
|
||||||
|
}
|
||||||
9
AutoDispathingWork/Dto/QueryResponse/DispatchResp.cs
Normal file
9
AutoDispathingWork/Dto/QueryResponse/DispatchResp.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
namespace WorkerService1.Dto.QueryResponse;
|
||||||
|
|
||||||
|
public class DispatchResp
|
||||||
|
{
|
||||||
|
public int code { get; set; }
|
||||||
|
public string msg { get; set; }
|
||||||
|
|
||||||
|
public object data { get; set; }
|
||||||
|
}
|
||||||
4043
AutoDispathingWork/Dto/QueryResponse/QueryResp.cs
Normal file
4043
AutoDispathingWork/Dto/QueryResponse/QueryResp.cs
Normal file
File diff suppressed because it is too large
Load Diff
166
AutoDispathingWork/Dto/QueryResponse/UserResp.cs
Normal file
166
AutoDispathingWork/Dto/QueryResponse/UserResp.cs
Normal file
@ -0,0 +1,166 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace WorkerService1.Dto.QueryResponse;
|
||||||
|
|
||||||
|
public class UserResp
|
||||||
|
{
|
||||||
|
// {
|
||||||
|
// "code": 0,
|
||||||
|
// "msg": "成功",
|
||||||
|
// "data": {
|
||||||
|
// "pageNo": 1,
|
||||||
|
// "pageSize": 20,
|
||||||
|
// "totalRecords": 3,
|
||||||
|
// "records": [
|
||||||
|
// {
|
||||||
|
// "organization": {
|
||||||
|
// "users": [],
|
||||||
|
// "orgName": "甘泉街道",
|
||||||
|
// "subOrgs": [],
|
||||||
|
// "userCount": 0,
|
||||||
|
// "orderCode": 0,
|
||||||
|
// "orgLevel": 1,
|
||||||
|
// "userTotalCount": 0,
|
||||||
|
// "permit": true,
|
||||||
|
// "id": "6e9232ef-7b84-11e8-86b1-6c92bf4e6960"
|
||||||
|
// },
|
||||||
|
// "online": false,
|
||||||
|
// "passWDInit": true,
|
||||||
|
// "ip": "",
|
||||||
|
// "sso": false,
|
||||||
|
// "userName": "md123",
|
||||||
|
// "roles": [
|
||||||
|
// {
|
||||||
|
// "users": [],
|
||||||
|
// "remark": "禁止编辑删除角色,否则影响系统正常使用",
|
||||||
|
// "roleName": "执法人员",
|
||||||
|
// "permissions": [],
|
||||||
|
// "id": "a2e267c0-d88d-4ecb-a4b5-d904e85dfbb6"
|
||||||
|
// }
|
||||||
|
// ],
|
||||||
|
// "pkiId": "",
|
||||||
|
// "creator": "27465e20-6942-4569-8141-2ff5c264111e",
|
||||||
|
// "isApp": false,
|
||||||
|
// "thumb": "",
|
||||||
|
// "phoneNo": "",
|
||||||
|
// "employeeId": "",
|
||||||
|
// "enabled": true,
|
||||||
|
// "userRealName": "名都物业",
|
||||||
|
// "datas": {},
|
||||||
|
// "id": "1942ec57-5019-411d-b85f-a67055797e0f"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "organization": {
|
||||||
|
// "users": [],
|
||||||
|
// "orgName": "甘泉街道",
|
||||||
|
// "subOrgs": [],
|
||||||
|
// "userCount": 0,
|
||||||
|
// "orderCode": 0,
|
||||||
|
// "orgLevel": 1,
|
||||||
|
// "userTotalCount": 0,
|
||||||
|
// "permit": true,
|
||||||
|
// "id": "6e9232ef-7b84-11e8-86b1-6c92bf4e6960"
|
||||||
|
// },
|
||||||
|
// "online": false,
|
||||||
|
// "passWDInit": false,
|
||||||
|
// "ip": "",
|
||||||
|
// "sso": false,
|
||||||
|
// "userName": "zgc123",
|
||||||
|
// "roles": [
|
||||||
|
// {
|
||||||
|
// "users": [],
|
||||||
|
// "remark": "禁止编辑删除角色,否则影响系统正常使用",
|
||||||
|
// "roleName": "执法人员",
|
||||||
|
// "permissions": [],
|
||||||
|
// "id": "a2e267c0-d88d-4ecb-a4b5-d904e85dfbb6"
|
||||||
|
// }
|
||||||
|
// ],
|
||||||
|
// "pkiId": "",
|
||||||
|
// "creator": "27465e20-6942-4569-8141-2ff5c264111e",
|
||||||
|
// "isApp": false,
|
||||||
|
// "thumb": "",
|
||||||
|
// "phoneNo": "",
|
||||||
|
// "employeeId": "",
|
||||||
|
// "enabled": true,
|
||||||
|
// "userRealName": "朱龚超",
|
||||||
|
// "datas": {},
|
||||||
|
// "id": "01edee4a-f345-4060-a33a-34bbd9b55247"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "organization": {
|
||||||
|
// "users": [],
|
||||||
|
// "orgName": "甘泉街道",
|
||||||
|
// "subOrgs": [],
|
||||||
|
// "userCount": 0,
|
||||||
|
// "orderCode": 0,
|
||||||
|
// "orgLevel": 1,
|
||||||
|
// "userTotalCount": 0,
|
||||||
|
// "permit": true,
|
||||||
|
// "id": "6e9232ef-7b84-11e8-86b1-6c92bf4e6960"
|
||||||
|
// },
|
||||||
|
// "online": false,
|
||||||
|
// "passWDInit": false,
|
||||||
|
// "ip": "",
|
||||||
|
// "sso": false,
|
||||||
|
// "userName": "gm123",
|
||||||
|
// "roles": [
|
||||||
|
// {
|
||||||
|
// "users": [],
|
||||||
|
// "remark": "",
|
||||||
|
// "roleName": "高级管理员",
|
||||||
|
// "permissions": [],
|
||||||
|
// "id": "0c772d50-a4af-439f-a18a-8fd332343d5e"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "users": [],
|
||||||
|
// "remark": "禁止编辑删除角色,否则影响系统正常使用",
|
||||||
|
// "roleName": "执法人员",
|
||||||
|
// "permissions": [],
|
||||||
|
// "id": "a2e267c0-d88d-4ecb-a4b5-d904e85dfbb6"
|
||||||
|
// }
|
||||||
|
// ],
|
||||||
|
// "pkiId": "",
|
||||||
|
// "creator": "27465e20-6942-4569-8141-2ff5c264111e",
|
||||||
|
// "isApp": false,
|
||||||
|
// "thumb": "",
|
||||||
|
// "phoneNo": "18721100373",
|
||||||
|
// "employeeId": "12138",
|
||||||
|
// "enabled": true,
|
||||||
|
// "userRealName": "张辉",
|
||||||
|
// "datas": {},
|
||||||
|
// "id": "66fa9261-16f6-49aa-a391-5848f40301e0"
|
||||||
|
// }
|
||||||
|
// ],
|
||||||
|
// "totalPage": 1
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
[JsonPropertyName("code")] public int Code { get; set; }
|
||||||
|
[JsonPropertyName("msg")] public string Msg { get; set; }
|
||||||
|
[JsonPropertyName("data")] public Data Data { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Data
|
||||||
|
{
|
||||||
|
[JsonPropertyName("pageNo")]
|
||||||
|
public int PageNo { get; set; }
|
||||||
|
[JsonPropertyName("pageSize")]
|
||||||
|
public int PageSize { get; set; }
|
||||||
|
[JsonPropertyName("totalRecords")]
|
||||||
|
public int TotalRecords { get; set; }
|
||||||
|
[JsonPropertyName("records")]
|
||||||
|
public Record[] Records { get; set; }
|
||||||
|
[JsonPropertyName("totalPage")]
|
||||||
|
public int TotalPage { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Record
|
||||||
|
{
|
||||||
|
[JsonPropertyName("id")]
|
||||||
|
public string Id { get; set; }
|
||||||
|
[JsonPropertyName("userName")]
|
||||||
|
public string UserName { get; set; }
|
||||||
|
[JsonPropertyName("userRealName")]
|
||||||
|
public string UserRealName { get; set; }
|
||||||
|
}
|
||||||
16
AutoDispathingWork/Dto/SpiderResponse.cs
Normal file
16
AutoDispathingWork/Dto/SpiderResponse.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
namespace WorkerService1.Dto;
|
||||||
|
|
||||||
|
public class SpiderResponse<T> where T : class
|
||||||
|
{
|
||||||
|
public bool IsSuccess { get; set; }
|
||||||
|
public SpiderResponseCode Code { get; set; }
|
||||||
|
public string? Message { get; set; }
|
||||||
|
public T? Result { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum SpiderResponseCode
|
||||||
|
{
|
||||||
|
Success = 0,
|
||||||
|
Fail = 1,
|
||||||
|
Exception = 2
|
||||||
|
}
|
||||||
21
AutoDispathingWork/Program.cs
Normal file
21
AutoDispathingWork/Program.cs
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
using WorkerService1;
|
||||||
|
using WorkerService1.Dto.Configuration;
|
||||||
|
using WorkerService1.Services;
|
||||||
|
|
||||||
|
|
||||||
|
var builder = Host.CreateApplicationBuilder(args);
|
||||||
|
var config = new ConfigurationManager()
|
||||||
|
.AddJsonFile("appsettings.json", false, true)
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
builder.Services.AddSingleton<IConfiguration>(config);
|
||||||
|
builder.Services.Configure<ClientOptions>(config.GetSection("ClientOptions"));
|
||||||
|
builder.Services.AddHttpClient();
|
||||||
|
builder.Services.AddMemoryCache();
|
||||||
|
builder.Services.AddLogging();
|
||||||
|
builder.Services.AddSingleton<SpiderServices>();
|
||||||
|
builder.Services.AddHostedService<Worker>();
|
||||||
|
builder.Services.AddHostedService<CloseWorker>();
|
||||||
|
|
||||||
|
var host = builder.Build();
|
||||||
|
host.Run();
|
||||||
12
AutoDispathingWork/Properties/launchSettings.json
Normal file
12
AutoDispathingWork/Properties/launchSettings.json
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||||
|
"profiles": {
|
||||||
|
"WorkerService1": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"environmentVariables": {
|
||||||
|
"DOTNET_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
294
AutoDispathingWork/Services/SpiderServices.cs
Normal file
294
AutoDispathingWork/Services/SpiderServices.cs
Normal file
@ -0,0 +1,294 @@
|
|||||||
|
using System.Net.Http.Json;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.Json;
|
||||||
|
using Microsoft.Extensions.Caching.Memory;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
|
using WorkerService1.Dto;
|
||||||
|
using WorkerService1.Dto.Configuration;
|
||||||
|
using WorkerService1.Dto.QueryRequest;
|
||||||
|
using WorkerService1.Dto.QueryResponse;
|
||||||
|
|
||||||
|
namespace WorkerService1.Services;
|
||||||
|
|
||||||
|
public class SpiderServices
|
||||||
|
{
|
||||||
|
private readonly IHttpClientFactory _httpClientFactory;
|
||||||
|
private readonly IOptionsMonitor<ClientOptions> _optionsMonitor;
|
||||||
|
private readonly IMemoryCache _memoryCache;
|
||||||
|
private readonly ILogger<SpiderServices> _logger;
|
||||||
|
private readonly IServiceProvider _serviceProvider;
|
||||||
|
|
||||||
|
public SpiderServices(IHttpClientFactory httpClientFactory, IOptionsMonitor<ClientOptions> optionsMonitor,
|
||||||
|
IMemoryCache memoryCache, ILogger<SpiderServices> logger, IServiceProvider serviceProvider)
|
||||||
|
{
|
||||||
|
_httpClientFactory = httpClientFactory;
|
||||||
|
_optionsMonitor = optionsMonitor;
|
||||||
|
_memoryCache = memoryCache;
|
||||||
|
_logger = logger;
|
||||||
|
_serviceProvider = serviceProvider;
|
||||||
|
}
|
||||||
|
|
||||||
|
private IOptionsMonitor<ClientOptions> OptionsMonitor => _serviceProvider.CreateScope().ServiceProvider
|
||||||
|
.GetRequiredService<IOptionsMonitor<ClientOptions>>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<SpiderResponse<LoginResultData>> Login()
|
||||||
|
{
|
||||||
|
using var client = _httpClientFactory.CreateClient();
|
||||||
|
var loginApi = OptionsMonitor.CurrentValue.LoginUrl;
|
||||||
|
var json = $@"
|
||||||
|
{{""userName"":""{_optionsMonitor.CurrentValue.UserName}"",""userPwd"":""{_optionsMonitor.CurrentValue.Password}"",""type"":""account"",""clientAppId"":""megcity-web""}}
|
||||||
|
";
|
||||||
|
client.DefaultRequestHeaders.Add("Module-Alias", "pending-forward");
|
||||||
|
client.DefaultRequestHeaders.Add("Module-Source", "megcity-web");
|
||||||
|
client.DefaultRequestHeaders.Add("Origin", "http://121.4.75.240");
|
||||||
|
var response = await client.PostAsync(loginApi, new StringContent(json, Encoding.UTF8, "application/json"));
|
||||||
|
var respJsonStr = await response.Content.ReadAsStringAsync();
|
||||||
|
_logger.LogInformation("登录返回: {tokenRes}", respJsonStr);
|
||||||
|
var tokenRes = JsonSerializer.Deserialize<LoginResponse>(respJsonStr);
|
||||||
|
if (response.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
if (tokenRes?.Code == 0)
|
||||||
|
{
|
||||||
|
_logger.LogInformation("成功登录, token: {token}", tokenRes?.Data?.Token);
|
||||||
|
return new SpiderResponse<LoginResultData>()
|
||||||
|
{
|
||||||
|
IsSuccess = true,
|
||||||
|
Result = tokenRes.Data,
|
||||||
|
Code = SpiderResponseCode.Success,
|
||||||
|
Message = "成功登录"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new SpiderResponse<LoginResultData>()
|
||||||
|
{
|
||||||
|
IsSuccess = false,
|
||||||
|
Result = null,
|
||||||
|
Code = SpiderResponseCode.Fail,
|
||||||
|
Message = "登录失败"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<string?> GetToken()
|
||||||
|
{
|
||||||
|
return await _memoryCache.GetOrCreateAsync(nameof(GetToken), async entry =>
|
||||||
|
{
|
||||||
|
var loginRes = await Login();
|
||||||
|
if (!loginRes.IsSuccess) return null;
|
||||||
|
entry.AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(loginRes.Result?.ExpireTime ?? 0);
|
||||||
|
return loginRes.Result?.Token;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<SpiderResponse<QueryRespData>> GetTaskList(int state)
|
||||||
|
{
|
||||||
|
// "headers": {
|
||||||
|
// "accept": "application/json, text/plain, */*",
|
||||||
|
// "accept-language": "zh-CN,zh;q=0.9",
|
||||||
|
// "authorization": "WVPCDLzQeRWYySPkQMuLAislgqfQJuubaHmDnfgyRkSxNCpbwzTgOrvtjSeg",
|
||||||
|
// "client-app-id": "megcity-web",
|
||||||
|
// "content-type": "application/json;charset=UTF-8",
|
||||||
|
// "module-alias": "pending-forward",
|
||||||
|
// "module-source": "megcity-web"
|
||||||
|
// },
|
||||||
|
// "referrer": "http://33.10.72.100/megcity/",
|
||||||
|
// "referrerPolicy": "strict-origin-when-cross-origin",
|
||||||
|
var token = await GetToken();
|
||||||
|
using var client = _httpClientFactory.CreateClient();
|
||||||
|
client.DefaultRequestHeaders.Add("authorization", $"{token}");
|
||||||
|
client.DefaultRequestHeaders.Add("accept-language", "zh-CN,zh;q=0.9");
|
||||||
|
client.DefaultRequestHeaders.Add("client-app-id", "megcity-web");
|
||||||
|
client.DefaultRequestHeaders.Add("module-alias", "pending-forward");
|
||||||
|
client.DefaultRequestHeaders.Add("module-source", "megcity-web");
|
||||||
|
// var beginTime = DateTime.Now.AddMonths(-1);
|
||||||
|
var startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1));
|
||||||
|
var beginTs = (long)(DateTime.Now.AddMonths(-1) - startTime).TotalMilliseconds;
|
||||||
|
var endTs = (long)(DateTime.Now - startTime).TotalMilliseconds;
|
||||||
|
var body = new QueryReq
|
||||||
|
{
|
||||||
|
State = new int[] { state },
|
||||||
|
PageNo = 1,
|
||||||
|
PageSize = 50,
|
||||||
|
SortType = new int[] { 20, 10 },
|
||||||
|
CreateStartTime = (long)beginTs,
|
||||||
|
CreateEndTime = (long)endTs
|
||||||
|
};
|
||||||
|
// {"state":[3],"pageNo":1,"pageSize":50,"sortType":[40,10],"handleStartTime":1697293650750,"handleEndTime":1699885650750}
|
||||||
|
// {"state":[1],"pageNo":1,"pageSize":50,"sortType":[20,10],"createStartTime":1697290618034,"createEndTime":1699882618034}
|
||||||
|
// {\"state\":[1],\"pageNo\":1,\"pageSize\":50,\"sortType\":[20,10],\"createStartTime\":1697204639551,\"createEndTime\":1697204639551}
|
||||||
|
var taskPath = OptionsMonitor.CurrentValue.GetTaskUrl;
|
||||||
|
var response = await client.PostAsync(taskPath,
|
||||||
|
new StringContent(JsonSerializer.Serialize(body), Encoding.UTF8, "application/json"));
|
||||||
|
var respJsonStr = await response.Content.ReadAsStringAsync();
|
||||||
|
_logger.LogInformation("获得列表返回json: {respJsonStr}", respJsonStr);
|
||||||
|
var spiderRes = JsonSerializer.Deserialize<QueryResp>(respJsonStr);
|
||||||
|
if (response.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
if (spiderRes?.code == 0)
|
||||||
|
{
|
||||||
|
_logger.LogInformation("成功获取监控结果");
|
||||||
|
|
||||||
|
return new SpiderResponse<QueryRespData>()
|
||||||
|
{
|
||||||
|
IsSuccess = true,
|
||||||
|
Result = spiderRes.data,
|
||||||
|
Code = SpiderResponseCode.Success,
|
||||||
|
Message = "成功获取监控结果"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new SpiderResponse<QueryRespData>()
|
||||||
|
{
|
||||||
|
IsSuccess = false,
|
||||||
|
Result = null,
|
||||||
|
Code = SpiderResponseCode.Fail,
|
||||||
|
Message = "获取监控结果失败"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// {"pageNo":1,"pageSize":20,"condition":{"roleIds":["a2e267c0-d88d-4ecb-a4b5-d904e85dfbb6"],"enabled":"null"}}
|
||||||
|
public async Task<SpiderResponse<Data>> GetUsers()
|
||||||
|
{
|
||||||
|
var token = await GetToken();
|
||||||
|
using var client = _httpClientFactory.CreateClient();
|
||||||
|
client.DefaultRequestHeaders.Add("authorization", $"{token}");
|
||||||
|
client.DefaultRequestHeaders.Add("accept-language", "zh-CN,zh;q=0.9");
|
||||||
|
client.DefaultRequestHeaders.Add("client-app-id", "megcity-web");
|
||||||
|
client.DefaultRequestHeaders.Add("module-alias", "pending-forward");
|
||||||
|
client.DefaultRequestHeaders.Add("module-source", "megcity-web");
|
||||||
|
var request = new UserQuery();
|
||||||
|
var userPath = OptionsMonitor.CurrentValue.GetUserUrl;
|
||||||
|
var response = await client.PostAsync(userPath,
|
||||||
|
new StringContent(JsonSerializer.Serialize(request), Encoding.UTF8, "application/json"));
|
||||||
|
var respJsonStr = await response.Content.ReadAsStringAsync();
|
||||||
|
_logger.LogInformation("获得列表返回json: {respJsonStr}", respJsonStr);
|
||||||
|
var spiderRes = JsonSerializer.Deserialize<UserResp>(respJsonStr);
|
||||||
|
if (response.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
if (spiderRes?.Code == 0)
|
||||||
|
{
|
||||||
|
_logger.LogInformation("成功获取监控结果");
|
||||||
|
|
||||||
|
return new SpiderResponse<Data>()
|
||||||
|
{
|
||||||
|
IsSuccess = true,
|
||||||
|
Result = spiderRes.Data,
|
||||||
|
Code = SpiderResponseCode.Success,
|
||||||
|
Message = "成功获取监控结果"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new SpiderResponse<Data>()
|
||||||
|
{
|
||||||
|
IsSuccess = false,
|
||||||
|
Result = null,
|
||||||
|
Code = SpiderResponseCode.Fail,
|
||||||
|
Message = "获取监控结果失败"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
//{"acceptTypeCode":"A2-01-10","target":2,"handlerId":"66fa9261-16f6-49aa-a391-5848f40301e0","typeCode":"A2-01-10"}
|
||||||
|
//{ "code": 0, "msg": "SUCCESS", "data": {} }
|
||||||
|
public async Task<SpiderResponse<object>> DispatchTask(string caseNumber, string handlerId, string typeCode)
|
||||||
|
{
|
||||||
|
var token = await GetToken();
|
||||||
|
using var client = _httpClientFactory.CreateClient();
|
||||||
|
client.DefaultRequestHeaders.Add("authorization", $"{token}");
|
||||||
|
client.DefaultRequestHeaders.Add("accept-language", "zh-CN,zh;q=0.9");
|
||||||
|
client.DefaultRequestHeaders.Add("client-app-id", "megcity-web");
|
||||||
|
client.DefaultRequestHeaders.Add("module-alias", "pending-forward");
|
||||||
|
client.DefaultRequestHeaders.Add("module-source", "megcity-web");
|
||||||
|
var request = new DispatchReq
|
||||||
|
{
|
||||||
|
AcceptTypeCode = typeCode,
|
||||||
|
Target = 2,
|
||||||
|
HandlerId = handlerId,
|
||||||
|
TypeCode = typeCode
|
||||||
|
};
|
||||||
|
var dispatchPath = string.Format(OptionsMonitor.CurrentValue.DiposeOrderUrl, caseNumber);
|
||||||
|
|
||||||
|
var response = await client.PostAsync(dispatchPath,
|
||||||
|
new StringContent(JsonSerializer.Serialize(request), Encoding.UTF8, "application/json"));
|
||||||
|
var respJsonStr = await response.Content.ReadAsStringAsync();
|
||||||
|
_logger.LogInformation("获得列表返回json: {respJsonStr}", respJsonStr);
|
||||||
|
var spiderRes = JsonSerializer.Deserialize<DispatchResp>(respJsonStr);
|
||||||
|
|
||||||
|
if (response.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
if (spiderRes?.code == 0)
|
||||||
|
{
|
||||||
|
_logger.LogInformation("成功分发任务");
|
||||||
|
|
||||||
|
return new SpiderResponse<object>()
|
||||||
|
{
|
||||||
|
IsSuccess = true,
|
||||||
|
Result = spiderRes.data,
|
||||||
|
Code = SpiderResponseCode.Success,
|
||||||
|
Message = "成功分发任务"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new SpiderResponse<object>()
|
||||||
|
{
|
||||||
|
IsSuccess = false,
|
||||||
|
Result = null,
|
||||||
|
Code = SpiderResponseCode.Fail,
|
||||||
|
Message = "分发任务失败"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// api/megcity/v1/events/pass
|
||||||
|
public async Task<SpiderResponse<object>> CloseFile(string caseNumber, string suggestion)
|
||||||
|
{
|
||||||
|
var token = await GetToken();
|
||||||
|
using var client = _httpClientFactory.CreateClient();
|
||||||
|
client.DefaultRequestHeaders.Add("authorization", $"{token}");
|
||||||
|
client.DefaultRequestHeaders.Add("accept-language", "zh-CN,zh;q=0.9");
|
||||||
|
client.DefaultRequestHeaders.Add("client-app-id", "megcity-web");
|
||||||
|
client.DefaultRequestHeaders.Add("module-alias", "pending-forward");
|
||||||
|
client.DefaultRequestHeaders.Add("module-source", "megcity-web");
|
||||||
|
|
||||||
|
var form = new MultipartFormDataContent();
|
||||||
|
//Region为请求文件接口需要的参数,根据调用接口参数而定
|
||||||
|
form.Add(new StringContent(caseNumber), "caseNumber");
|
||||||
|
form.Add(new StringContent(suggestion), "suggestion");
|
||||||
|
var closeFile = OptionsMonitor.CurrentValue.CloseFileUrl;
|
||||||
|
|
||||||
|
var response = await client.PostAsync(closeFile, form);
|
||||||
|
var respJsonStr = await response.Content.ReadAsStringAsync();
|
||||||
|
_logger.LogInformation("结案响应: {respJsonStr}", respJsonStr);
|
||||||
|
var spiderRes = JsonSerializer.Deserialize<CloseResp>(respJsonStr);
|
||||||
|
|
||||||
|
if (response.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
if (spiderRes?.code == 0)
|
||||||
|
{
|
||||||
|
_logger.LogInformation("成功结案");
|
||||||
|
|
||||||
|
return new SpiderResponse<object>()
|
||||||
|
{
|
||||||
|
IsSuccess = true,
|
||||||
|
Result = spiderRes.data,
|
||||||
|
Code = SpiderResponseCode.Success,
|
||||||
|
Message = "成功结案"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new SpiderResponse<object>()
|
||||||
|
{
|
||||||
|
IsSuccess = false,
|
||||||
|
Result = null,
|
||||||
|
Code = SpiderResponseCode.Fail,
|
||||||
|
Message = "结案失败"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
71
AutoDispathingWork/Worker.cs
Normal file
71
AutoDispathingWork/Worker.cs
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
using Microsoft.Extensions.Options;
|
||||||
|
using WorkerService1.Dto.Configuration;
|
||||||
|
using WorkerService1.Services;
|
||||||
|
|
||||||
|
namespace WorkerService1;
|
||||||
|
|
||||||
|
public class Worker : BackgroundService
|
||||||
|
{
|
||||||
|
private readonly ILogger<Worker> _logger;
|
||||||
|
private readonly SpiderServices _spiderServices;
|
||||||
|
private readonly IServiceProvider _serviceProvider;
|
||||||
|
|
||||||
|
public Worker(ILogger<Worker> logger,IServiceProvider serviceProvider, SpiderServices spiderServices)
|
||||||
|
{
|
||||||
|
_logger = logger;
|
||||||
|
_serviceProvider = serviceProvider;
|
||||||
|
_spiderServices = spiderServices;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||||
|
{
|
||||||
|
while (!stoppingToken.IsCancellationRequested)
|
||||||
|
{
|
||||||
|
if (_logger.IsEnabled(LogLevel.Information))
|
||||||
|
{
|
||||||
|
_logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await Handle();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_logger.LogError("执行控制器发生错误,错误信息:ex{}", e.StackTrace);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
using var scope = _serviceProvider.CreateScope();
|
||||||
|
var options = scope.ServiceProvider.GetRequiredService<IOptionsMonitor<ClientOptions>>();
|
||||||
|
await Task.Delay(options.CurrentValue.Delay, stoppingToken);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task Handle()
|
||||||
|
{
|
||||||
|
var listRes = await _spiderServices.GetTaskList(1);
|
||||||
|
if (listRes.IsSuccess)
|
||||||
|
{
|
||||||
|
var needDispose = listRes.Result?.records.Where(x => x.disposalStatus == 1);
|
||||||
|
//轮询列表,看有没有符合状态的进行处理
|
||||||
|
if (needDispose?.Any() ?? false)
|
||||||
|
{
|
||||||
|
//处理逻辑
|
||||||
|
//1.查询角色是 城管?的用户
|
||||||
|
var users = await _spiderServices.GetUsers();
|
||||||
|
var cityManager = users.Result?.Records;
|
||||||
|
if (cityManager?.Any() ?? false)
|
||||||
|
{
|
||||||
|
foreach (var item in needDispose)
|
||||||
|
{
|
||||||
|
//2.进行派单操作
|
||||||
|
var result =
|
||||||
|
await _spiderServices.DispatchTask(item.caseNumber, cityManager.First().Id, item.typeCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
8
AutoDispathingWork/appsettings.Development.json
Normal file
8
AutoDispathingWork/appsettings.Development.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
19
AutoDispathingWork/appsettings.json
Normal file
19
AutoDispathingWork/appsettings.json
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ClientOptions": {
|
||||||
|
"ApiGateway": "http://121.4.75.240/",
|
||||||
|
"UserName": "ganquanjiedao",
|
||||||
|
"Password": "12345678a",
|
||||||
|
"Delay": 2000,
|
||||||
|
"LoginApi": "api/auth/v5/users/login",
|
||||||
|
"GetTaskApi": "api/megcity/v1/events/queryByWaterFall",
|
||||||
|
"GetUserApi": "api/galaxy/v1/auth/users/query",
|
||||||
|
"DiposeOrder": "api/megcity/v1/events/dispatch/{0}",
|
||||||
|
"CloseFileApi": "api/megcity/v1/events/pass"
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user