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
26d61fae
Commit
26d61fae
authored
Jan 31, 2018
by
NitefullWind
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 实现支付。
parent
607a96ba
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
41 additions
and
15 deletions
+41
-15
fmvip/db/database.h
+2
-0
fmvip/db/item.cpp
+12
-2
fmvip/db/item.h
+7
-5
fmvip/db/item.xml
+9
-1
fmvip/task/fmtask.cpp
+4
-0
fmvip/task/tasklogin.cpp
+2
-0
fmvip/task/taskpay.cpp
+0
-0
fmvip/task/taskpay.h
+3
-5
tests/tests.pro
+1
-1
version.h
+1
-1
No files found.
fmvip/db/database.h
View file @
26d61fae
...
@@ -167,6 +167,7 @@ inline QSharedPointer<StoreInfo> GetLastStoreInfo()
...
@@ -167,6 +167,7 @@ inline QSharedPointer<StoreInfo> GetLastStoreInfo()
odb
::
transaction
t
(
DBSP
()
->
begin
());
odb
::
transaction
t
(
DBSP
()
->
begin
());
StoreInfo_last
storeInfo
=
DBSP
()
->
query_value
<
StoreInfo_last
>
();
StoreInfo_last
storeInfo
=
DBSP
()
->
query_value
<
StoreInfo_last
>
();
storeInfoP
->
setId
(
storeInfo
.
_id
);
storeInfoP
->
setStoreId
(
storeInfo
.
_storeId
);
storeInfoP
->
setStoreId
(
storeInfo
.
_storeId
);
storeInfoP
->
setPosId
(
storeInfo
.
_posId
);
storeInfoP
->
setPosId
(
storeInfo
.
_posId
);
storeInfoP
->
setBusinessDate
(
storeInfo
.
_businessDate
);
storeInfoP
->
setBusinessDate
(
storeInfo
.
_businessDate
);
...
@@ -174,6 +175,7 @@ inline QSharedPointer<StoreInfo> GetLastStoreInfo()
...
@@ -174,6 +175,7 @@ inline QSharedPointer<StoreInfo> GetLastStoreInfo()
t
.
commit
();
t
.
commit
();
}
catch
(
const
odb
::
exception
&
e
)
{
}
catch
(
const
odb
::
exception
&
e
)
{
storeInfoP
.
clear
();
qDebug
()
<<
"Exception: Get last store info: "
<<
e
.
what
();
qDebug
()
<<
"Exception: Get last store info: "
<<
e
.
what
();
}
}
return
storeInfoP
;
return
storeInfoP
;
...
...
fmvip/db/item.cpp
View file @
26d61fae
...
@@ -123,7 +123,12 @@ void Order::setRefunded(bool refunded)
...
@@ -123,7 +123,12 @@ void Order::setRefunded(bool refunded)
_refunded
=
refunded
;
_refunded
=
refunded
;
}
}
PayList
Order
::
payList
()
const
PayList
&
Order
::
payList
()
{
return
_payList
;
}
const
PayList
&
Order
::
payList
()
const
{
{
return
_payList
;
return
_payList
;
}
}
...
@@ -133,7 +138,12 @@ void Order::setPayList(const PayList &payList)
...
@@ -133,7 +138,12 @@ void Order::setPayList(const PayList &payList)
_payList
=
payList
;
_payList
=
payList
;
}
}
QLazySharedPointer
<
StoreInfo
>
Order
::
storeInfo
()
const
QLazySharedPointer
<
StoreInfo
>
&
Order
::
storeInfo
()
{
return
_storeInfo
;
}
const
QLazySharedPointer
<
StoreInfo
>
&
Order
::
storeInfo
()
const
{
{
return
_storeInfo
;
return
_storeInfo
;
}
}
...
...
fmvip/db/item.h
View file @
26d61fae
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
#include <odb/qt/lazy-ptr.hxx>
#include <odb/qt/lazy-ptr.hxx>
#define DB_VERSION_BASE 1
#define DB_VERSION_BASE 1
#define DB_VERSION_CURRENT 1
0
#define DB_VERSION_CURRENT 1
2
#pragma db model version(DB_VERSION_BASE, DB_VERSION_CURRENT)
#pragma db model version(DB_VERSION_BASE, DB_VERSION_CURRENT)
namespace
DB
{
namespace
DB
{
...
@@ -79,10 +79,12 @@ public:
...
@@ -79,10 +79,12 @@ public:
bool
refunded
()
const
;
bool
refunded
()
const
;
void
setRefunded
(
bool
refunded
);
void
setRefunded
(
bool
refunded
);
PayList
payList
()
const
;
PayList
&
payList
();
const
PayList
&
payList
()
const
;
void
setPayList
(
const
PayList
&
payList
);
void
setPayList
(
const
PayList
&
payList
);
QLazySharedPointer
<
StoreInfo
>
storeInfo
()
const
;
QLazySharedPointer
<
StoreInfo
>
&
storeInfo
();
const
QLazySharedPointer
<
StoreInfo
>
&
storeInfo
()
const
;
void
setStoreInfo
(
const
QLazySharedPointer
<
StoreInfo
>
&
storeInfo
);
void
setStoreInfo
(
const
QLazySharedPointer
<
StoreInfo
>
&
storeInfo
);
unsigned
long
id
()
const
;
unsigned
long
id
()
const
;
...
@@ -112,8 +114,6 @@ private:
...
@@ -112,8 +114,6 @@ private:
#pragma db not_null
#pragma db not_null
QLazySharedPointer
<
StoreInfo
>
_storeInfo
;
QLazySharedPointer
<
StoreInfo
>
_storeInfo
;
QString
_testCol
;
};
};
//! Pay
//! Pay
...
@@ -218,6 +218,8 @@ private:
...
@@ -218,6 +218,8 @@ private:
query((?) + "order by id desc limit 0,1")
query((?) + "order by id desc limit 0,1")
struct
StoreInfo_last
struct
StoreInfo_last
{
{
#pragma db column(StoreInfo::_id)
unsigned
long
_id
;
#pragma db column(StoreInfo::_storeId)
#pragma db column(StoreInfo::_storeId)
QString
_storeId
;
QString
_storeId
;
#pragma db column(StoreInfo::_posId)
#pragma db column(StoreInfo::_posId)
...
...
fmvip/db/item.xml
View file @
26d61fae
<changelog
xmlns=
"http://www.codesynthesis.com/xmlns/odb/changelog"
database=
"sqlite"
version=
"1"
>
<changelog
xmlns=
"http://www.codesynthesis.com/xmlns/odb/changelog"
database=
"sqlite"
version=
"1"
>
<changeset
version=
"10"
/>
<changeset
version=
"12"
/>
<changeset
version=
"11"
/>
<changeset
version=
"10"
>
<alter-table
name=
"Order"
>
<drop-column
name=
"testCol"
/>
</alter-table>
</changeset>
<changeset
version=
"9"
/>
<changeset
version=
"9"
/>
...
...
fmvip/task/fmtask.cpp
View file @
26d61fae
...
@@ -118,6 +118,10 @@ bool FMTask::sendToServer(bool isShowMsg)
...
@@ -118,6 +118,10 @@ bool FMTask::sendToServer(bool isShowMsg)
QByteArray
data
=
json
.
toJson
(
QJsonDocument
::
Compact
);
QByteArray
data
=
json
.
toJson
(
QJsonDocument
::
Compact
);
url
=
FMPVipSettings
::
instance
()
->
getServerUrl
()
+
"/"
+
ReqUrl
.
at
(
FM_Type
());
url
=
FMPVipSettings
::
instance
()
->
getServerUrl
()
+
"/"
+
ReqUrl
.
at
(
FM_Type
());
#ifdef FM_DEBUG
url
=
"http://127.0.0.1:5000/vip/"
+
ReqUrl
.
at
(
FM_Type
());
#endif
QByteArray
rspData
;
QByteArray
rspData
;
FMNetwork
net
;
FMNetwork
net
;
...
...
fmvip/task/tasklogin.cpp
View file @
26d61fae
...
@@ -19,9 +19,11 @@ void TaskLogin::packagePOSReq()
...
@@ -19,9 +19,11 @@ void TaskLogin::packagePOSReq()
QString
msg
;
QString
msg
;
if
(
storeInfo
==
nullptr
)
{
if
(
storeInfo
==
nullptr
)
{
msg
=
QString
::
fromLocal8Bit
(
"未设置营业信息,不能进行会员认证"
);
msg
=
QString
::
fromLocal8Bit
(
"未设置营业信息,不能进行会员认证"
);
FMP_ERROR
()
<<
msg
;
setError
(
FM_API_ERROR
,
msg
);
setError
(
FM_API_ERROR
,
msg
);
return
;
return
;
}
}
posReqJsonObj
[
PosProps
.
StoreId
]
=
storeInfo
->
storeId
();
posReqJsonObj
[
PosProps
.
StoreId
]
=
storeInfo
->
storeId
();
posReqJsonObj
[
PosProps
.
PosId
]
=
storeInfo
->
posId
();
posReqJsonObj
[
PosProps
.
PosId
]
=
storeInfo
->
posId
();
posReqJsonObj
[
PosProps
.
BusinessDate
]
=
storeInfo
->
businessDate
();
posReqJsonObj
[
PosProps
.
BusinessDate
]
=
storeInfo
->
businessDate
();
...
...
fmvip/task/taskpay.cpp
View file @
26d61fae
This diff is collapsed.
Click to expand it.
fmvip/task/taskpay.h
View file @
26d61fae
...
@@ -2,14 +2,11 @@
...
@@ -2,14 +2,11 @@
#define TASKPAY_H
#define TASKPAY_H
#include "fmtask.h"
#include "fmtask.h"
#include "taskothers.h"
#include "taskothers.h"
#include "database.h"
#include <QThread>
#include <QThread>
class
TaskCouponThread
;
class
TaskCouponThread
;
//namespace FMItem {
// class Order;
//}
class
TaskPay
:
public
FMTask
class
TaskPay
:
public
FMTask
{
{
Q_OBJECT
Q_OBJECT
...
@@ -28,7 +25,8 @@ private slots:
...
@@ -28,7 +25,8 @@ private slots:
private
:
private
:
TaskCouponThread
*
couponThread
;
TaskCouponThread
*
couponThread
;
// FMItem::Order *_order;
QSharedPointer
<
DB
::
Order
>
_order
;
// odb::transaction _transactionPay;
};
};
// 加载代金券的线程类
// 加载代金券的线程类
...
...
tests/tests.pro
View file @
26d61fae
TEMPLATE
=
subdirs
TEMPLATE
=
subdirs
SUBDIRS
+=
\
SUBDIRS
+=
\
#
testplugin \
testplugin
\
autotest
autotest
CONFIG
+=
ordered
CONFIG
+=
ordered
version.h
View file @
26d61fae
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#define VER_MINOR 1
#define VER_MINOR 1
#define VER_REVISION 0
#define VER_REVISION 0
#define VER_BUILD
39
#define VER_BUILD
42
//! Convert version numbers to string
//! Convert version numbers to string
#define _STR(S) #S
#define _STR(S) #S
...
...
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