Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmp_vip
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
xiaojing.zhang
fmp_vip
Commits
f821c854
Commit
f821c854
authored
Oct 27, 2017
by
刘帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
linux下编译运行通过
parent
1896782c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
122 additions
and
41 deletions
+122
-41
fmp_vip.pro
+10
-1
fmp_vip_server.cpp
+2
-2
fmvipdispatcher.cpp
+1
-1
task/fmtask.cpp
+40
-11
task/tasklogin.cpp
+33
-12
task/taskpay.cpp
+32
-10
windows/fmvipwnd.cpp
+4
-4
No files found.
fmp_vip.pro
View file @
f821c854
...
@@ -81,7 +81,12 @@ unix {
...
@@ -81,7 +81,12 @@ unix {
#Target name
#Target name
VER
=
$$
system
(
$$
PWD
/../
fmprc
.
bat
$$
TARGET
)
VER
=
$$
system
(
$$
PWD
/../
fmprc
.
bat
$$
TARGET
)
ORIGIN_TARGET
=
$$
TARGET
ORIGIN_TARGET
=
$$
TARGET
TARGET
=
$$
{
TARGET
}
_
$$
{
VER
}
win32
{
TARGET
=
$$
{
TARGET
}
_
$$
{
VER
}
}
else
{
TARGET
=
$$
{
TARGET
}
}
#Header path
#Header path
INCLUDEPATH
+=
$$
PWD
/../
include
/
ctk
\
INCLUDEPATH
+=
$$
PWD
/../
include
/
ctk
\
...
@@ -96,7 +101,11 @@ LIBS += -lws2_32 -luser32
...
@@ -96,7 +101,11 @@ LIBS += -lws2_32 -luser32
CONFIG
(
debug
,
debug
|
release
)
{
CONFIG
(
debug
,
debug
|
release
)
{
#
Linking
library
#
Linking
library
win32
{
LIBS
+=
-
lCTKCored
-
lCTKPluginFrameworkd
LIBS
+=
-
lCTKCored
-
lCTKPluginFrameworkd
}
else
{
LIBS
+=
-
lCTKCore
-
lCTKPluginFramework
}
#
Destination
path
#
Destination
path
DESTDIR
=
$$
PWD
/../
debug
/
plugins
DESTDIR
=
$$
PWD
/../
debug
/
plugins
}
else
{
}
else
{
...
...
fmp_vip_server.cpp
View file @
f821c854
...
@@ -63,8 +63,8 @@ void FMPVipServer::onReadyRead()
...
@@ -63,8 +63,8 @@ void FMPVipServer::onReadyRead()
//向23771发送数据
//向23771发送数据
SendToMonitor
(
rspData
);
SendToMonitor
(
rspData
);
}
}
socket
->
waitForDisconnected
();
socket
->
waitForDisconnected
(
2000
);
socket
->
close
();
socket
->
deleteLater
();
socket
->
deleteLater
();
socket
=
nullptr
;
socket
=
nullptr
;
...
...
fmvipdispatcher.cpp
View file @
f821c854
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
#include <QTimer>
#include <QTimer>
#include <QJsonParseError>
#include <QJsonParseError>
#include "fmp_vip_settings.h"
#include "fmp_vip_settings.h"
#include <winsock2.h>
//
#include <winsock2.h>
#include "fmvipdispatcher.h"
#include "fmvipdispatcher.h"
#include "fmtask.h"
#include "fmtask.h"
#include "taskfactory.h"
#include "taskfactory.h"
...
...
task/fmtask.cpp
View file @
f821c854
...
@@ -7,13 +7,13 @@
...
@@ -7,13 +7,13 @@
#include <QCryptographicHash>
#include <QCryptographicHash>
#include "fmp_vip_settings.h"
#include "fmp_vip_settings.h"
#define RunFunction(function) do { \
//
#define RunFunction(function) do { \
function##(); \
//
function##(); \
if(error() != FM_API_SUCCESS) { \
//
if(error() != FM_API_SUCCESS) { \
FMP_WARN() << QString("Task error %1: %2").arg(error()).arg(errorString()); \
//
FMP_WARN() << QString("Task error %1: %2").arg(error()).arg(errorString()); \
return QString(ErrorMsgJson).arg(error()).arg(errorString()).toLatin1(); \
//
return QString(ErrorMsgJson).arg(error()).arg(errorString()).toLatin1(); \
} \
//
} \
} while(0);
//
} while(0);
FMTask
::
FMTask
(
QJsonObject
&
jsonObj
,
FM_TYPE
fmType
,
Session
*
session
,
QObject
*
parent
)
:
FMTask
::
FMTask
(
QJsonObject
&
jsonObj
,
FM_TYPE
fmType
,
Session
*
session
,
QObject
*
parent
)
:
QObject
(
parent
),
QObject
(
parent
),
...
@@ -45,10 +45,39 @@ FMTask::~FMTask()
...
@@ -45,10 +45,39 @@ FMTask::~FMTask()
QByteArray
FMTask
::
doTask
()
QByteArray
FMTask
::
doTask
()
{
{
FMP_DEBUG
()
<<
__FUNCTION__
;
FMP_DEBUG
()
<<
__FUNCTION__
;
RunFunction
(
copyPros
);
// RunFunction(copyPros);
RunFunction
(
setWindow
);
// RunFunction(setWindow);
RunFunction
(
showWindow
);
// RunFunction(showWindow);
RunFunction
(
packagePOSRsp
);
// RunFunction(packagePOSRsp);
do
{
copyPros
();
if
(
error
()
!=
FM_API_SUCCESS
)
{
FMP_WARN
()
<<
QString
(
"Task error %1: %2"
).
arg
(
error
()).
arg
(
errorString
());
return
QString
(
ErrorMsgJson
).
arg
(
error
()).
arg
(
errorString
()).
toLatin1
();
}
}
while
(
0
);
do
{
setWindow
();
if
(
error
()
!=
FM_API_SUCCESS
)
{
FMP_WARN
()
<<
QString
(
"Task error %1: %2"
).
arg
(
error
()).
arg
(
errorString
());
return
QString
(
ErrorMsgJson
).
arg
(
error
()).
arg
(
errorString
()).
toLatin1
();
}
}
while
(
0
);
do
{
showWindow
();
if
(
error
()
!=
FM_API_SUCCESS
)
{
FMP_WARN
()
<<
QString
(
"Task error %1: %2"
).
arg
(
error
()).
arg
(
errorString
());
return
QString
(
ErrorMsgJson
).
arg
(
error
()).
arg
(
errorString
()).
toLatin1
();
}
}
while
(
0
);
do
{
packagePOSRsp
();
if
(
error
()
!=
FM_API_SUCCESS
)
{
FMP_WARN
()
<<
QString
(
"Task error %1: %2"
).
arg
(
error
()).
arg
(
errorString
());
return
QString
(
ErrorMsgJson
).
arg
(
error
()).
arg
(
errorString
()).
toLatin1
();
}
}
while
(
0
);
QJsonDocument
json
(
posRspJsonObj
);
QJsonDocument
json
(
posRspJsonObj
);
return
json
.
toJson
(
QJsonDocument
::
Compact
);
return
json
.
toJson
(
QJsonDocument
::
Compact
);
...
...
task/tasklogin.cpp
View file @
f821c854
...
@@ -5,13 +5,13 @@
...
@@ -5,13 +5,13 @@
#include <QJsonDocument>
#include <QJsonDocument>
#include <QCryptographicHash>
#include <QCryptographicHash>
#define RunFunction(function) do { \
//
#define RunFunction(function) do { \
function##(); \
//
function##(); \
if(error() != FM_API_SUCCESS) { \
//
if(error() != FM_API_SUCCESS) { \
FMP_WARN() << QString("Task error %1: %2").arg(error()).arg(errorString()); \
//
FMP_WARN() << QString("Task error %1: %2").arg(error()).arg(errorString()); \
return QString(ErrorMsgJson).arg(error()).arg(errorString()).toLatin1(); \
//
return QString(ErrorMsgJson).arg(error()).arg(errorString()).toLatin1(); \
} \
//
} \
} while(0);
//
} while(0);
TaskLogin
::
TaskLogin
(
QJsonObject
&
jsonObj
,
Session
*
session
,
QObject
*
parent
)
TaskLogin
::
TaskLogin
(
QJsonObject
&
jsonObj
,
Session
*
session
,
QObject
*
parent
)
:
QObject
(
parent
)
:
QObject
(
parent
)
...
@@ -30,9 +30,31 @@ TaskLogin::~TaskLogin()
...
@@ -30,9 +30,31 @@ TaskLogin::~TaskLogin()
QByteArray
TaskLogin
::
doTask
()
QByteArray
TaskLogin
::
doTask
()
{
{
FMP_DEBUG
()
<<
__FUNCTION__
;
FMP_DEBUG
()
<<
__FUNCTION__
;
RunFunction
(
setWindow
);
// RunFunction(setWindow);
RunFunction
(
showWindow
);
// RunFunction(showWindow);
RunFunction
(
packagePOSRsp
);
// RunFunction(packagePOSRsp);
do
{
setWindow
();
if
(
error
()
!=
FM_API_SUCCESS
)
{
FMP_WARN
()
<<
QString
(
"Task error %1: %2"
).
arg
(
error
()).
arg
(
errorString
());
return
QString
(
ErrorMsgJson
).
arg
(
error
()).
arg
(
errorString
()).
toLatin1
();
}
}
while
(
0
);
do
{
showWindow
();
if
(
error
()
!=
FM_API_SUCCESS
)
{
FMP_WARN
()
<<
QString
(
"Task error %1: %2"
).
arg
(
error
()).
arg
(
errorString
());
return
QString
(
ErrorMsgJson
).
arg
(
error
()).
arg
(
errorString
()).
toLatin1
();
}
}
while
(
0
);
do
{
packagePOSRsp
();
if
(
error
()
!=
FM_API_SUCCESS
)
{
FMP_WARN
()
<<
QString
(
"Task error %1: %2"
).
arg
(
error
()).
arg
(
errorString
());
return
QString
(
ErrorMsgJson
).
arg
(
error
()).
arg
(
errorString
()).
toLatin1
();
}
}
while
(
0
);
QJsonDocument
json
(
posRspJsonObj
);
QJsonDocument
json
(
posRspJsonObj
);
return
json
.
toJson
(
QJsonDocument
::
Compact
);
return
json
.
toJson
(
QJsonDocument
::
Compact
);
...
@@ -231,4 +253,4 @@ QString TaskLogin::sign() const
...
@@ -231,4 +253,4 @@ QString TaskLogin::sign() const
QByteArray
md5Bt
=
QCryptographicHash
::
hash
(
bt
,
QCryptographicHash
::
Md5
);
QByteArray
md5Bt
=
QCryptographicHash
::
hash
(
bt
,
QCryptographicHash
::
Md5
);
return
md5Bt
.
toHex
();
return
md5Bt
.
toHex
();
}
}
\ No newline at end of file
task/taskpay.cpp
View file @
f821c854
...
@@ -9,13 +9,13 @@
...
@@ -9,13 +9,13 @@
#include <QJsonObject>
#include <QJsonObject>
#include <QCryptographicHash>
#include <QCryptographicHash>
#define RunFunction(function) do { \
//
#define RunFunction(function) do { \
function##(); \
//
function##(); \
if(error() != FM_API_SUCCESS) { \
//
if(error() != FM_API_SUCCESS) { \
FMP_WARN() << QString("Task error %1: %2").arg(error()).arg(errorString()); \
//
FMP_WARN() << QString("Task error %1: %2").arg(error()).arg(errorString()); \
return QString(ErrorMsgJson).arg(error()).arg(errorString()).toLatin1(); \
//
return QString(ErrorMsgJson).arg(error()).arg(errorString()).toLatin1(); \
} \
//
} \
} while(0);
//
} while(0);
TaskPay
::
TaskPay
(
QJsonObject
&
jsonObj
,
Session
*
session
,
QObject
*
parent
)
TaskPay
::
TaskPay
(
QJsonObject
&
jsonObj
,
Session
*
session
,
QObject
*
parent
)
:
QObject
(
parent
)
:
QObject
(
parent
)
...
@@ -65,9 +65,31 @@ QByteArray TaskPay::doTask()
...
@@ -65,9 +65,31 @@ QByteArray TaskPay::doTask()
serverRspJsonObj
.
remove
(
key
);
serverRspJsonObj
.
remove
(
key
);
}
}
RunFunction
(
setWindow
);
// RunFunction(setWindow);
RunFunction
(
showWindow
);
// RunFunction(showWindow);
RunFunction
(
packagePOSRsp
);
// RunFunction(packagePOSRsp);
do
{
setWindow
();
if
(
error
()
!=
FM_API_SUCCESS
)
{
FMP_WARN
()
<<
QString
(
"Task error %1: %2"
).
arg
(
error
()).
arg
(
errorString
());
return
QString
(
ErrorMsgJson
).
arg
(
error
()).
arg
(
errorString
()).
toLatin1
();
}
}
while
(
0
);
do
{
showWindow
();
if
(
error
()
!=
FM_API_SUCCESS
)
{
FMP_WARN
()
<<
QString
(
"Task error %1: %2"
).
arg
(
error
()).
arg
(
errorString
());
return
QString
(
ErrorMsgJson
).
arg
(
error
()).
arg
(
errorString
()).
toLatin1
();
}
}
while
(
0
);
do
{
packagePOSRsp
();
if
(
error
()
!=
FM_API_SUCCESS
)
{
FMP_WARN
()
<<
QString
(
"Task error %1: %2"
).
arg
(
error
()).
arg
(
errorString
());
return
QString
(
ErrorMsgJson
).
arg
(
error
()).
arg
(
errorString
()).
toLatin1
();
}
}
while
(
0
);
QJsonDocument
json
(
posRspJsonObj
);
QJsonDocument
json
(
posRspJsonObj
);
return
json
.
toJson
(
QJsonDocument
::
Compact
);
return
json
.
toJson
(
QJsonDocument
::
Compact
);
...
...
windows/fmvipwnd.cpp
View file @
f821c854
...
@@ -50,12 +50,12 @@ void FMVipWnd::setIsBusy(const bool isBusy)
...
@@ -50,12 +50,12 @@ void FMVipWnd::setIsBusy(const bool isBusy)
int
FMVipWnd
::
exec
()
int
FMVipWnd
::
exec
()
{
{
showNormal
();
showNormal
();
::
SetForegroundWindow
((
HWND
)
effectiveWinId
());
//
::SetForegroundWindow((HWND)effectiveWinId());
::
SetWindowPos
(
(
HWND
)
effectiveWinId
(),
HWND_TOPMOST
,
0
,
0
,
0
,
0
,
SWP_NOMOVE
|
SWP_NOSIZE
|
SWP_SHOWWINDOW
);
//
::SetWindowPos( (HWND)effectiveWinId(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
showNormal
();
//
showNormal();
::
SetForegroundWindow
((
HWND
)
effectiveWinId
());
//
::SetForegroundWindow((HWND)effectiveWinId());
QDesktopWidget
w
;
QDesktopWidget
w
;
QRect
rc
=
w
.
availableGeometry
();
QRect
rc
=
w
.
availableGeometry
();
...
...
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