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
351d3901
Commit
351d3901
authored
Aug 29, 2017
by
NitefullWind
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 会员认证和支付接口返回会员手机号和姓名。 2.完善备份重发机制。 3. 取消手机号认证成功的弹窗。
parent
cabb2585
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
12 deletions
+22
-12
backup/fmbackup.cpp
+2
-2
backup/resend.cpp
+7
-2
global.h
+2
-1
task/taskfinal.cpp
+3
-3
task/tasklogin.cpp
+6
-4
task/taskpay.cpp
+2
-0
No files found.
backup/fmbackup.cpp
View file @
351d3901
...
...
@@ -36,7 +36,7 @@ bool FMBackup::connect()
if
(
!
QFile
::
exists
(
dbname
))
{
isOk
=
createTable
(
dbname
);
}
else
{
_db
=
QSqlDatabase
::
addDatabase
(
"QSQLITE"
);
_db
=
QSqlDatabase
::
addDatabase
(
"QSQLITE"
,
"fmvipbackupdb"
);
_db
.
setDatabaseName
(
dbname
);
isOk
=
_db
.
open
();
}
...
...
@@ -51,7 +51,7 @@ bool FMBackup::connect()
bool
FMBackup
::
createTable
(
const
QString
&
dbname
)
{
_db
=
QSqlDatabase
::
addDatabase
(
"QSQLITE"
);
_db
=
QSqlDatabase
::
addDatabase
(
"QSQLITE"
,
"fmvipbackupdb"
);
_db
.
setDatabaseName
(
dbname
);
_db
.
open
();
QSqlQuery
query
(
_db
);
...
...
backup/resend.cpp
View file @
351d3901
...
...
@@ -2,6 +2,7 @@
#include "fmbackup.h"
#include "fmnetwork.h"
#include "fmp_vip_settings.h"
#include "global.h"
#include <QSqlQuery>
#include <QSqlRecord>
#include <QNetworkReply>
...
...
@@ -31,7 +32,7 @@ void ReSend::trySend()
net
.
send
(
url
,
data
,
rspData
);
// 如果发送失败则不再继续发送
if
(
net
.
error
!=
1
)
{
if
(
net
.
error
!=
FM_API_SUCCESS
)
{
break
;
}
else
{
FMBackup
::
instance
()
->
removeReqData
(
id
);
...
...
@@ -42,9 +43,13 @@ void ReSend::trySend()
void
ReSend
::
run
()
{
int
waitTime
=
0
;
while
(
true
)
{
if
(
++
waitTime
>
30
)
{
trySend
();
QThread
::
sleep
(
5
);
waitTime
=
0
;
}
QThread
::
sleep
(
1
);
}
}
global.h
View file @
351d3901
...
...
@@ -72,7 +72,7 @@ struct PP{
Name
=
"name"
;
Birthday
=
"birthday"
;
Amount
=
"amount"
;
Mobile
=
"
mobil
e"
;
Mobile
=
"
phon
e"
;
Fm_open_id
=
"fm_open_id"
;
Account
=
"account"
;
CanPay
=
"can_pay"
;
...
...
@@ -204,6 +204,7 @@ const PropsMap::value_type PropsMapPairs[] =
PropsMap
::
value_type
(
PosProps
.
StatusCode
,
"status_code"
),
PropsMap
::
value_type
(
PosProps
.
Fm_transId
,
"trans_id"
),
PropsMap
::
value_type
(
PosProps
.
OrderAmount
,
"amount"
),
PropsMap
::
value_type
(
PosProps
.
Mobile
,
"mobile"
),
PropsMap
::
value_type
(
PosProps
.
PaidAmount
,
"pay_amount"
),
PropsMap
::
value_type
(
PosProps
.
CodeAmount
,
"code_amount"
),
PropsMap
::
value_type
(
PosProps
.
CashAmount
,
"cash_amount"
),
...
...
task/taskfinal.cpp
View file @
351d3901
...
...
@@ -95,7 +95,7 @@ bool TaskFinal::sendToServer(bool isShowMsg)
FMTask
::
sendToServer
(
false
);
// 备份
if
(
error
()
==
FM_API_NETWORERROR
)
{
if
(
error
()
==
FM_API_NETWORERROR
||
error
()
==
FM_API_TIMEOUT
)
{
if
(
searchJsonValue
(
serverReqJsonObj
,
ServerProps
(
PosProps
.
CodeAmount
)).
toInt
()
==
0
&&
searchJsonValue
(
serverReqJsonObj
,
ServerProps
(
PosProps
.
ScoreAmount
)).
toInt
()
==
0
&&
...
...
@@ -141,11 +141,11 @@ QString TaskFinal::backup()
QString
uuid
=
QString
(
"E%1%2%3%4"
)
.
arg
(
getPosJsonValue
(
PosProps
.
StoreId
).
toString
())
.
arg
(
getPosJsonValue
(
PosProps
.
PosId
).
toString
().
toInt
(),
2
,
10
,
QChar
(
'0'
))
.
arg
(
QDateTime
::
currentDateTime
().
toString
(
"yyMMdd"
))
.
arg
(
QDateTime
::
currentDateTime
().
toString
(
"yyMMdd
hhmmsszzz
"
))
.
arg
(
newId
,
5
,
10
,
QChar
(
'0'
));
QJsonDocument
json
(
serverReqJsonObj
);
bool
isOk
=
FMBackup
::
instance
()
->
updateReqData
(
newId
,
this
->
url
,
json
.
toJson
(
QJsonDocument
::
Compact
));
if
(
isOk
&&
uuid
.
length
()
==
20
)
{
if
(
isOk
)
{
return
uuid
;
}
return
""
;
...
...
task/tasklogin.cpp
View file @
351d3901
...
...
@@ -26,6 +26,8 @@ void TaskLogin::packagePOSRsp()
p
.
push_back
(
PosProps
.
StatusCode
);
p
.
push_back
(
PosProps
.
Msg
);
p
.
push_back
(
PosProps
.
Fm_open_id
);
p
.
push_back
(
PosProps
.
Mobile
);
p
.
push_back
(
PosProps
.
Name
);
foreach
(
QString
prop
,
p
)
{
posRspJsonObj
[
prop
]
=
getServerJsonValue
(
prop
);
}
...
...
@@ -61,9 +63,9 @@ void TaskLogin::onLogin()
QString
birthday
=
getServerJsonValue
(
PosProps
.
Birthday
).
toString
();
QString
name
=
getServerJsonValue
(
PosProps
.
Name
).
toString
();
if
(
session
()
->
data
(
PosProps
.
FM_Type
).
toInt
()
==
FM_Login
)
{
FMMsgWnd
::
LoginSuccess
(
account
,
name
,
birthday
,
_window
);
}
else
{
//
if(session()->data(PosProps.FM_Type).toInt() == FM_Login) {
//
FMMsgWnd::LoginSuccess(account,name,birthday, _window);
//
} else {
session
()
->
addData
(
PosProps
.
Name
,
name
);
session
()
->
addData
(
PosProps
.
Amount
,
getServerJsonValue
(
PosProps
.
Amount
).
toInt
());
session
()
->
addData
(
PosProps
.
Birthday
,
birthday
);
...
...
@@ -86,7 +88,7 @@ void TaskLogin::onLogin()
couponMap
[
code
]
=
v
;
}
session
()
->
addData
(
PosProps
.
CouponMap
,
couponMap
);
}
//
}
_window
->
accept
();
}
if
(
_window
!=
nullptr
)
{
...
...
task/taskpay.cpp
View file @
351d3901
...
...
@@ -117,6 +117,8 @@ void TaskPay::packagePOSRsp()
posRspJsonObj
[
"invoice_amount"
]
=
total_amount
;
posRspJsonObj
[
"discount_amount"
]
=
0
;
posRspJsonObj
[
"forward"
]
=
posReqJsonObj
[
"forward"
];
posRspJsonObj
[
PosProps
.
Mobile
]
=
session
()
->
data
(
PosProps
.
Mobile
).
toString
();
posRspJsonObj
[
PosProps
.
Name
]
=
session
()
->
data
(
PosProps
.
Name
).
toString
();
}
void
TaskPay
::
onPay
()
...
...
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