Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
G
GS.Terminal.VisitorSelfService
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
终端组
GS.Terminal.VisitorSelfService
Commits
769ff595
Commit
769ff595
authored
Aug 19, 2021
by
姜春辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化登记流程
parent
612a66f7
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
102 additions
and
19 deletions
+102
-19
ViewModels.dll
...h/Addons/GS.Terminal.LogicShell/ViewModels/ViewModels.dll
+0
-0
Views.dll
Publish/Addons/GS.Terminal.LogicShell/Views/Views.dll
+0
-0
GS.Terminal.VisitorSelfService.Logic.dll
...elfService.Logic/GS.Terminal.VisitorSelfService.Logic.dll
+0
-0
AuthenticationPageHandler.cs
...isitorSelfService.Logic/Core/AuthenticationPageHandler.cs
+23
-8
MenuPageHandler.cs
...Terminal.VisitorSelfService.Logic/Core/MenuPageHandler.cs
+33
-10
Program.cs
...ice/Logic/GS.Terminal.VisitorSelfService.Logic/Program.cs
+1
-1
ViewModel.cs
...odelView/ViewModels/Pages/AuthenticationPage/ViewModel.cs
+29
-0
Index.xaml
...e/ViewModelView/Views/Pages/AuthenticationPage/Index.xaml
+16
-0
No files found.
Publish/Addons/GS.Terminal.LogicShell/ViewModels/ViewModels.dll
View file @
769ff595
No preview for this file type
Publish/Addons/GS.Terminal.LogicShell/Views/Views.dll
View file @
769ff595
No preview for this file type
Publish/Addons/GS.Terminal.VisitorSelfService.Logic/GS.Terminal.VisitorSelfService.Logic.dll
View file @
769ff595
No preview for this file type
Src/GS.Terminal.VisitorSelfService/Logic/GS.Terminal.VisitorSelfService.Logic/Core/AuthenticationPageHandler.cs
View file @
769ff595
...
...
@@ -91,10 +91,6 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
try
{
var
result
=
JsonConvert
.
DeserializeObject
<
FaceValidateResult
>(
e
.
Message
);
if
(
result
!=
null
)
{
MainShell
.
ShowPrompt
(
$"score:
{
result
.
score
}
"
);
}
if
(
result
?.
result
!=
null
&&
result
.
score
>=
LocalSetting
.
AddonDefaultConfig
.
FaceMinValue
)
{
...
...
@@ -198,8 +194,8 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
{
if
(
result
==
1
)
_faceWebSocket
?.
Send
(
_currentFeature
,
0
,
_currentFeature
.
Length
);
else
MainShell
.
ShowPrompt
(
$"面部识别失败,正在重试..."
);
//
else
//
MainShell.ShowPrompt($"面部识别失败,正在重试...");
}
}
}
...
...
@@ -221,6 +217,11 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
ShowView
();
}
public
void
Alert
(
string
msg
,
Action
callback
)
{
VM
.
Alert
(
msg
,
callback
);
}
private
void
VM_OnNavigateOut
()
{
_AuthSuccessCallback
=
null
;
...
...
@@ -229,6 +230,8 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
ThirdAddon
.
FaceRecognization
.
UnRegistOutPutMatEvent
(
VideoOut
);
_waiter
.
Reset
();
MainShell
.
RemoveWindowKeyUp
(
WindowKeyUp
);
VM
.
ShowAlert
=
false
;
VM
.
AlertMessage
=
""
;
}
private
void
VM_OnNavigateInto
()
...
...
@@ -282,21 +285,33 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
private
async
void
_SecondCardRead
()
{
int
faildTimes
=
0
;
while
(!
_CTS
.
IsCancellationRequested
)
{
_waiter
.
WaitOne
();
var
readResult
=
ThirdAddon
.
DeviceManager
.
CallDeviceByTypeWithDynamic
(
"Second"
,
"true"
);
DeviceManager
.
CallDeviceByTypeWithDynamic
(
"Second"
,
"true"
);
if
(
readResult
!=
null
)
{
string
cardid
=
readResult
.
cardid
;
if
(
string
.
IsNullOrEmpty
(
cardid
))
{
MainShell
.
ShowPrompt
(
"二代证读取异常,请重新刷二代证"
);
faildTimes
++;
Program
.
_Context
.
Logger
.
Error
(
$"未读取到二代证芯片号
{
readResult
.
number
}
"
,
null
);
if
(
faildTimes
>=
10
)
{
//连续10次读取失败,终止尝试,提示错误
VM
.
Alert
(
"二代证读取失败,请尝试其他认证方式"
,
()
=>
{
VM_OnExitClick
();
});
_waiter
.
Reset
();
}
await
Task
.
Delay
(
200
);
continue
;
}
faildTimes
=
0
;
//读二代证大概有600到700毫秒的延迟,所以回调前再次验证一下验证方式是否变更
if
(
VM
.
AuthMode
==
ViewModels
.
Pages
.
AuthenticationPage
.
AuthenticationMode
.
IdCard
)
{
...
...
Src/GS.Terminal.VisitorSelfService/Logic/GS.Terminal.VisitorSelfService.Logic/Core/MenuPageHandler.cs
View file @
769ff595
using
GS.Terminal.VisitorSelfService.LocalDB
;
using
GS.Terminal.VisitorSelfService.Logic.Remote.Models
;
using
GS.Terminal.VisitorSelfService.Logic.ThirdAddon
;
using
GS.Unitive.Framework.Data.Xpo
;
using
System
;
...
...
@@ -17,6 +18,18 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
{
VM
.
OnMenuItemClick
+=
VM_OnMenuItemClick
;
VM
.
OnNavigateInto
+=
VM_OnNavigateInto
;
//凌晨刷新本地统计
RefreshSummaryTask
();
}
private
void
RefreshSummaryTask
()
{
Task
.
Run
(
async
()
=>
{
await
Task
.
Delay
(
DateTime
.
Today
.
AddDays
(
1
).
AddMinutes
(
1
)
-
DateTime
.
Now
);
await
Summary
();
RefreshSummaryTask
();
});
}
private
void
VM_OnNavigateInto
(
LogicShell
.
Interface
.
IViewModel
obj
)
...
...
@@ -48,7 +61,12 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
//((dynamic)data).cardid 身份证芯片号
//((dynamic)data).poto 身份证照片
MainShell
.
ShowLoading
(
"正在查找"
);
var
findResult
=
await
Find
(
mode
==
AuthenticationMode
.
IdCard
?
((
dynamic
)
data
).
number
:
data
.
ToString
(),
mode
);
var
findResult
=
new
List
<
Appointment
>();
await
Task
.
WhenAll
(
Task
.
Run
(
async
()
=>
{
findResult
=
await
Find
(
mode
==
AuthenticationMode
.
IdCard
?
((
dynamic
)
data
).
number
:
data
.
ToString
(),
mode
);
}),
Task
.
Delay
(
1500
));
//增加最低等待时间
MainShell
.
HideLoading
();
if
(
findResult
?.
Count
>
0
)
{
...
...
@@ -58,7 +76,12 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
}
else
{
MainShell
.
ShowPrompt
(
$"没有找到有效的预约单"
);
//MainShell.ShowPrompt($"没有找到有效的预约单");
Handlers
.
GetHandler
<
AuthenticationPageHandler
>()?.
Alert
(
"没有找到有效的预约单"
,
()
=>
{
ShowView
();
});
return
true
;
}
return
findResult
?.
Count
>
0
;
}
...
...
@@ -77,15 +100,15 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
return
true
;
}
private
void
Summary
()
private
async
Task
Summary
()
{
Task
.
Run
(()
=>
{
var
session
=
Program
.
_ObjectSpace
.
Session
;
var
query
=
session
.
Query
<
自助登记流水
>();
var
count
=
query
.
Count
(
ss
=>
ss
.
CreationTime
.
Date
==
DateTime
.
Now
.
Date
);
VM
.
TodayPerson
=
count
;
});
await
Task
.
Run
(()
=>
{
var
session
=
Program
.
_ObjectSpace
.
Session
;
var
query
=
session
.
Query
<
自助登记流水
>();
var
count
=
query
.
Count
(
ss
=>
ss
.
CreationTime
.
Date
==
DateTime
.
Now
.
Date
);
VM
.
TodayPerson
=
count
;
});
}
}
}
Src/GS.Terminal.VisitorSelfService/Logic/GS.Terminal.VisitorSelfService.Logic/Program.cs
View file @
769ff595
...
...
@@ -18,7 +18,7 @@ namespace GS.Terminal.VisitorSelfService.Logic
internal
static
IAddonContext
_Context
;
internal
static
IObjectSpace
_ObjectSpace
;
internal
static
Locator
vmLocator
;
internal
static
string
_logicVersion
=
"081
5.11
"
;
internal
static
string
_logicVersion
=
"081
9.16
"
;
public
void
Start
(
IAddonContext
Context
)
{
...
...
Src/GS.Terminal.VisitorSelfService/ViewModelView/ViewModels/Pages/AuthenticationPage/ViewModel.cs
View file @
769ff595
...
...
@@ -86,6 +86,35 @@ namespace ViewModels.Pages.AuthenticationPage
set
{
_EnableQRCode
=
value
;
RaisePropertyChanged
(
"EnableQRCode"
);
}
}
private
bool
_ShowAlert
;
public
bool
ShowAlert
{
get
{
return
_ShowAlert
;
}
set
{
_ShowAlert
=
value
;
RaisePropertyChanged
(
"ShowAlert"
);
}
}
private
string
_AlertMessage
;
public
string
AlertMessage
{
get
{
return
_AlertMessage
;
}
set
{
_AlertMessage
=
value
;
RaisePropertyChanged
(
"AlertMessage"
);
}
}
private
event
Action
AlertCloseCallback
;
public
RelayCommand
CloseAlertCommand
=>
new
RelayCommand
(()
=>
{
ShowAlert
=
false
;
try
{
AlertCloseCallback
?.
Invoke
();
}
catch
{
}
AlertMessage
=
""
;
});
public
void
Alert
(
string
msg
,
Action
closeCallback
)
{
AlertMessage
=
msg
;
AlertCloseCallback
=
closeCallback
;
ShowAlert
=
true
;
}
public
void
Reset
()
...
...
Src/GS.Terminal.VisitorSelfService/ViewModelView/Views/Pages/AuthenticationPage/Index.xaml
View file @
769ff595
...
...
@@ -33,5 +33,21 @@
Command="{Binding ExitCommand}"
Width="250" Height="60" Content="退出" Foreground="#2a2b2d" FontSize="24" Focusable="False"/>
</Grid>
<Border Background="Transparent" Visibility="{Binding ShowAlert, Converter={StaticResource BooleanToVisibilityConverter}}">
<Border Height="420" Background="White"
BorderThickness="6" CornerRadius="15" BorderBrush="#f1f1f1"
Margin="50,0,50,50" Padding="50">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="140"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding AlertMessage}" FontSize="48"
HorizontalAlignment="Center" VerticalAlignment="Center"
TextWrapping="Wrap"/>
<gs:ImageButton Command="{Binding CloseAlertCommand}" Grid.Row="1" Width="320" ImgPath="/Views;component/Resources/btn_ikonw.png"/>
</Grid>
</Border>
</Border>
</Grid>
</Page>
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