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
e23d7924
Commit
e23d7924
authored
Sep 14, 2021
by
姜春辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加登记前管理员刷卡确认操作,管理员卡在Logic插件配置文件中配置
parent
769ff595
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
111 additions
and
7 deletions
+111
-7
App.xaml.cs
...torSelfService/GS.Terminal.VisitorSelfService/App.xaml.cs
+42
-0
AssemblyInfo.cs
...GS.Terminal.VisitorSelfService/Properties/AssemblyInfo.cs
+2
-2
Config.xml
...ice/Logic/GS.Terminal.VisitorSelfService.Logic/Config.xml
+1
-0
AppointmentDetailPageHandler.cs
...torSelfService.Logic/Core/AppointmentDetailPageHandler.cs
+43
-0
LocalSetting.cs
...ogic/GS.Terminal.VisitorSelfService.Logic/LocalSetting.cs
+2
-1
Program.cs
...ice/Logic/GS.Terminal.VisitorSelfService.Logic/Program.cs
+1
-1
DeviceManager.cs
...inal.VisitorSelfService.Logic/ThirdAddon/DeviceManager.cs
+5
-0
ViewModel.cs
...lView/ViewModels/Pages/AppointmentDetailPage/ViewModel.cs
+10
-1
Style.xaml
...iewModelView/Views/Pages/AppointmentDetailPage/Style.xaml
+5
-2
No files found.
Src/GS.Terminal.VisitorSelfService/GS.Terminal.VisitorSelfService/App.xaml.cs
View file @
e23d7924
...
...
@@ -4,7 +4,9 @@ using System;
using
System.Collections.Generic
;
using
System.Configuration
;
using
System.Data
;
using
System.Diagnostics
;
using
System.Linq
;
using
System.Runtime.InteropServices
;
using
System.Threading.Tasks
;
using
System.Windows
;
...
...
@@ -19,9 +21,49 @@ namespace GS.Terminal.VisitorSelfService
{
DispatcherHelper
.
Initialize
();
}
///<summary>
/// 该函数设置由不同线程产生的窗口的显示状态
/// </summary>
/// <param name="hWnd">窗口句柄</param>
/// <param name="cmdShow">指定窗口如何显示。查看允许值列表,请查阅ShowWlndow函数的说明部分</param>
/// <returns>如果函数原来可见,返回值为非零;如果函数原来被隐藏,返回值为零</returns>
[
DllImport
(
"User32.dll"
)]
private
static
extern
bool
ShowWindowAsync
(
IntPtr
hWnd
,
int
cmdShow
);
/// <summary>
/// 该函数将创建指定窗口的线程设置到前台,并且激活该窗口。键盘输入转向该窗口,并为用户改各种可视的记号。
/// 系统给创建前台窗口的线程分配的权限稍高于其他线程。
/// </summary>
/// <param name="hWnd">将被激活并被调入前台的窗口句柄</param>
/// <returns>如果窗口设入了前台,返回值为非零;如果窗口未被设入前台,返回值为零</returns>
[
DllImport
(
"User32.dll"
)]
private
static
extern
bool
SetForegroundWindow
(
IntPtr
hWnd
);
private
const
int
SW_SHOWNOMAL
=
1
;
internal
static
void
HandleRunningInstance
(
Process
instance
)
{
ShowWindowAsync
(
instance
.
MainWindowHandle
,
SW_SHOWNOMAL
);
//显示
SetForegroundWindow
(
instance
.
MainWindowHandle
);
//当到最前端
}
protected
override
void
OnStartup
(
StartupEventArgs
e
)
{
#
region
检查重复启动
Process
[]
pro
=
Process
.
GetProcesses
();
var
process
=
pro
.
Where
(
p
=>
p
.
ProcessName
.
Equals
(
Process
.
GetCurrentProcess
().
ProcessName
));
int
n
=
process
.
Count
();
if
(
n
>
1
)
{
MessageBox
.
Show
(
"程序已经启动,请勿重复启动"
,
"提示"
,
MessageBoxButton
.
OK
,
MessageBoxImage
.
Error
);
HandleRunningInstance
(
process
.
FirstOrDefault
());
Current
.
Shutdown
();
return
;
}
#
endregion
Current
.
ShutdownMode
=
ShutdownMode
.
OnExplicitShutdown
;
AddonRuntime
addonRuntime
=
new
AddonRuntime
();
addonRuntime
.
Start
();
...
...
Src/GS.Terminal.VisitorSelfService/GS.Terminal.VisitorSelfService/Properties/AssemblyInfo.cs
View file @
e23d7924
...
...
@@ -51,5 +51,5 @@ using System.Windows;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.
0
.0.0")]
[assembly: AssemblyFileVersion("1.
0
.0.0")]
[assembly: AssemblyVersion("1.
1
.0.0")]
[assembly: AssemblyFileVersion("1.
1
.0.0")]
Src/GS.Terminal.VisitorSelfService/Logic/GS.Terminal.VisitorSelfService.Logic/Config.xml
View file @
e23d7924
...
...
@@ -7,6 +7,7 @@
<Key
Caption=
"心跳端口"
Name=
"HeartPort"
Value=
"18083"
/>
<Key
Caption=
"重复登记提示"
Name=
"RepeatMessage"
Value=
"你已经完成确认,欢迎进入海信大厦"
/>
<Key
Caption=
"远程认证地址"
Name=
"FaceWebSocket"
Value=
"ws://192.168.1.7:15055/face/sdk2?persontype=访客"
/>
<Key
Caption=
"管理员卡片"
Name=
"AdminCard"
Value=
"EEEE,FFF,AAAAA,DDDDD"
/>
</Dict>
<Dict
Caption=
"识别方式配置"
Name=
"authenticationconfig"
>
<Key
Caption=
"人脸识别"
Name=
"EnableFace"
Value=
"false"
/>
...
...
Src/GS.Terminal.VisitorSelfService/Logic/GS.Terminal.VisitorSelfService.Logic/Core/AppointmentDetailPageHandler.cs
View file @
e23d7924
...
...
@@ -9,6 +9,7 @@ using System.Drawing.Imaging;
using
System.IO
;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
ViewModels.Pages.AppointmentDetailPage
;
...
...
@@ -18,13 +19,26 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
Corebase
<
ViewModel
>
{
private
IViewModel
_ExitView
;
private
CancellationTokenSource
_ConfirmCTS
;
private
Task
_ConfirmTask
;
public
override
void
Init
()
{
VM
.
OnExitClick
+=
VM_OnExitClick
;
VM
.
OnConfirmYesClick
+=
VM_OnConfirmYesClick
;
VM
.
OnConfirmNoClick
+=
VM_OnConfirmNoClick
;
VM
.
OnSubmitClick
+=
VM_OnSubmitClick
;
}
private
void
VM_OnConfirmNoClick
()
{
if
(
_ConfirmCTS
!=
null
)
{
_ConfirmCTS
.
Cancel
();
while
(
_ConfirmTask
.
Status
==
TaskStatus
.
Running
)
Task
.
Delay
(
100
).
Wait
();
}
}
private
void
VM_OnSubmitClick
(
AppointmentItem
obj
)
{
if
(
obj
!=
null
&&
obj
.
todayvisittimes
>
0
)
...
...
@@ -35,6 +49,32 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
}
else
{
//判断是否需要确认
if
(!
string
.
IsNullOrEmpty
(
LocalSetting
.
AddonDefaultConfig
.
AdminCard
))
{
VM
.
ConfirmYesEnable
=
false
;
_ConfirmCTS
=
new
CancellationTokenSource
();
_ConfirmTask
=
Task
.
Run
(
async
()
=>
{
while
(!
_ConfirmCTS
.
IsCancellationRequested
)
{
var
cardNum
=
DeviceManager
.
SerialReaderTouch
();
if
(!
string
.
IsNullOrEmpty
(
cardNum
))
{
if
(
LocalSetting
.
AddonDefaultConfig
.
AdminCard
.
Contains
(
cardNum
))
{
VM
.
ConfirmYesEnable
=
true
;
break
;
}
else
{
MainShell
.
ShowPrompt
(
"无效卡"
);
}
}
await
Task
.
Delay
(
100
);
}
},
_ConfirmCTS
.
Token
);
}
VM
.
ShowConfirm
=
true
;
}
}
...
...
@@ -116,11 +156,14 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
return
false
;
}
private
void
VM_OnExitClick
()
{
ThirdAddon
.
LogicShell
.
ShowView
(
_ExitView
??
vmLocator
.
MenuPage
);
VM
.
Reset
();
_ExitView
=
null
;
VM
.
ShowConfirm
=
false
;
VM_OnConfirmNoClick
();
}
string
_secondcardid
=
""
;
byte
[]
_secondcardphoto
=
null
;
...
...
Src/GS.Terminal.VisitorSelfService/Logic/GS.Terminal.VisitorSelfService.Logic/LocalSetting.cs
View file @
e23d7924
...
...
@@ -14,7 +14,7 @@ namespace GS.Terminal.VisitorSelfService.Logic
AppConfig
=
LocalSettingLoader
.
Load
<
AppConfig
>(
Program
.
_Context
);
ServiceList
=
LocalSettingLoader
.
Load
<
ServiceList
>(
Program
.
_Context
);
AddonDefaultConfig
=
LocalSettingLoader
.
Load
<
AddonDefaultConfig
>(
Program
.
_Context
);
AuthenticationConfig
=
LocalSettingLoader
.
Load
<
AuthenticationConfig
>(
Program
.
_Context
);
AuthenticationConfig
=
LocalSettingLoader
.
Load
<
AuthenticationConfig
>(
Program
.
_Context
);
}
public
static
AddonDefaultConfig
AddonDefaultConfig
{
get
;
}
public
static
AppConfig
AppConfig
{
get
;
}
...
...
@@ -38,6 +38,7 @@ namespace GS.Terminal.VisitorSelfService.Logic
public
int
HeartPort
{
get
;
set
;
}
public
bool
DisableVideoDetect
{
get
;
set
;
}
public
string
FaceWebSocket
{
get
;
set
;
}
public
string
AdminCard
{
get
;
set
;
}
public
string
DictName
=>
"defaultconfig"
;
}
...
...
Src/GS.Terminal.VisitorSelfService/Logic/GS.Terminal.VisitorSelfService.Logic/Program.cs
View file @
e23d7924
...
...
@@ -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
=
"0
819.16
"
;
internal
static
string
_logicVersion
=
"0
914.10
"
;
public
void
Start
(
IAddonContext
Context
)
{
...
...
Src/GS.Terminal.VisitorSelfService/Logic/GS.Terminal.VisitorSelfService.Logic/ThirdAddon/DeviceManager.cs
View file @
e23d7924
...
...
@@ -48,5 +48,10 @@ namespace GS.Terminal.VisitorSelfService.Logic.ThirdAddon
{
return
_DeviceTiggerService
?.
CallGPIO
(
arg
);
}
public
static
string
SerialReaderTouch
()
{
return
_DeviceTiggerService
?.
SerialReaderTouch
();
}
}
}
Src/GS.Terminal.VisitorSelfService/ViewModelView/ViewModels/Pages/AppointmentDetailPage/ViewModel.cs
View file @
e23d7924
...
...
@@ -90,6 +90,14 @@ namespace ViewModels.Pages.AppointmentDetailPage
set
{
_ShowConfirm
=
value
;
RaisePropertyChanged
(
"ShowConfirm"
);
}
}
private
bool
_ConfirmYesEnable
;
public
bool
ConfirmYesEnable
{
get
{
return
_ConfirmYesEnable
;
}
set
{
_ConfirmYesEnable
=
value
;
RaisePropertyChanged
(
"ConfirmYesEnable"
);
}
}
public
RelayCommand
ShowExtendInfoCommand
=>
new
RelayCommand
(()
=>
{
...
...
@@ -154,10 +162,11 @@ namespace ViewModels.Pages.AppointmentDetailPage
{
OnSubmitClick
?.
Invoke
(
Appointment
);
});
public
event
Action
OnConfirmNoClick
;
public
RelayCommand
ConfirmClose
=>
new
RelayCommand
(()
=>
{
ShowConfirm
=
false
;
OnConfirmNoClick
?.
Invoke
();
});
public
event
Action
<
AppointmentItem
>
OnConfirmYesClick
;
public
RelayCommand
ConfirmYes
=>
new
RelayCommand
(()
=>
...
...
Src/GS.Terminal.VisitorSelfService/ViewModelView/Views/Pages/AppointmentDetailPage/Style.xaml
View file @
e23d7924
...
...
@@ -159,12 +159,15 @@
<RowDefinition/>
<RowDefinition Height="160"/>
</Grid.RowDefinitions>
<TextBlock Text="确定提交到访信息?" FontSize="48"
<StackPanel VerticalAlignment="Center">
<TextBlock Text="确定提交到访信息?" FontSize="48"
HorizontalAlignment="Center" VerticalAlignment="Center"
TextWrapping="Wrap"/>
<TextBlock Text="请联系您身边的工作人员帮您确认" Foreground="#f96400" HorizontalAlignment="Center" FontSize="28" Margin="0,20,0,0"/>
</StackPanel>
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
<gs:ImageButtonFix Command="{Binding ConfirmClose}" Width="360" Height="160" Image="/Views;component/Resources/confirm-no.png"/>
<gs:ImageButtonFix Command="{Binding ConfirmYes}" Width="360" Height="160" Image="/Views;component/Resources/confirm-yes.png"/>
<gs:ImageButtonFix Command="{Binding ConfirmYes}"
IsEnabled="{Binding ConfirmYesEnable}"
Width="360" Height="160" Image="/Views;component/Resources/confirm-yes.png"/>
</StackPanel>
</Grid>
</Border>
...
...
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