Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sbkpay
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
zhenfei.zhang
sbkpay
Commits
80e41b72
Commit
80e41b72
authored
Aug 18, 2017
by
李定达
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.查询完成; 2.添加支付成功返回的用户实付商户优惠等信息
parent
e81624bf
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
972 additions
and
666 deletions
+972
-666
sbkpay/control.cpp
+24
-1
sbkpay/global.h
+23
-2
sbkpay/hostwidget.cpp
+193
-9
sbkpay/hostwidget.h
+13
-0
sbkpay/hostwidget.ui
+628
-636
sbkpay/jsonfactory.h
+33
-10
sbkpay/lib/lib.zip
+0
-0
sbkpay/main.cpp
+3
-2
sbkpay/requestmodel.h
+1
-1
sbkpay/rspfactory.h
+52
-3
sbkpay/sbkpay.pro
+1
-1
sbkpay/sbkpay.pro.user
+1
-1
No files found.
sbkpay/control.cpp
View file @
80e41b72
...
@@ -10,6 +10,9 @@
...
@@ -10,6 +10,9 @@
#include <QSettings>
#include <QSettings>
#include <QJsonObject>
#include <QJsonObject>
#include <QEventLoop>
#include <QEventLoop>
#include <QFont>
#include <QFontDatabase>
#include <QApplication>
#include <QJsonDocument>
#include <QJsonDocument>
#include <Windows.h>
#include <Windows.h>
...
@@ -43,6 +46,13 @@ Control::Control(QObject *parent) : QObject(parent), _widget(NULL)
...
@@ -43,6 +46,13 @@ Control::Control(QObject *parent) : QObject(parent), _widget(NULL)
void
Control
::
Start
(
const
char
*
indata
,
char
*
outdata
)
void
Control
::
Start
(
const
char
*
indata
,
char
*
outdata
)
{
{
QString
appPath
;
char
pathStr
[
MAX_PATH
]
=
{
0
};
GetProcPath
(
pathStr
);
appPath
=
QString
::
fromLocal8Bit
(
pathStr
);
QFontDatabase
::
addApplicationFont
(
appPath
+
"
\\
msyh.ttf"
);
QFont
ft
(
"Microsoft YaHei UI Light"
);
qApp
->
setFont
(
ft
);
QEventLoop
loop
;
QEventLoop
loop
;
if
(
_widget
==
NULL
)
if
(
_widget
==
NULL
)
...
@@ -228,8 +238,15 @@ bool Control::GetJson(ReqType type,QJsonObject &json, const QByteArray array, QS
...
@@ -228,8 +238,15 @@ bool Control::GetJson(ReqType type,QJsonObject &json, const QByteArray array, QS
if
(
json
.
contains
(
JSON_KEY_MESSAGE
))
if
(
json
.
contains
(
JSON_KEY_MESSAGE
))
error
=
json
[
JSON_KEY_MESSAGE
].
toString
();
error
=
json
[
JSON_KEY_MESSAGE
].
toString
();
if
(
json
.
contains
(
JSON_KEY_MESSAGE
)
&&
json
.
contains
(
JSON_KEY_STATUSCODE
)
&&
json
[
JSON_KEY_STATUSCODE
].
toInt
()
==
302
)
error
=
QString
::
fromLocal8Bit
(
"签名过期,请获取签名"
);
if
(
json
.
contains
(
JSON_KEY_STATUSCODE
)
&&
json
[
JSON_KEY_STATUSCODE
].
toInt
()
==
100
)
if
(
json
.
contains
(
JSON_KEY_STATUSCODE
)
&&
json
[
JSON_KEY_STATUSCODE
].
toInt
()
==
100
)
return
true
;
return
true
;
return
false
;
return
false
;
}
}
...
@@ -249,8 +266,14 @@ void Control::Request(ReqType type, QStringList list)
...
@@ -249,8 +266,14 @@ void Control::Request(ReqType type, QStringList list)
SetResPonseWithMessage
(
"23"
,
error
);
SetResPonseWithMessage
(
"23"
,
error
);
_lock
.
lock
();
_lock
.
lock
();
if
(
_widget
!=
NULL
)
if
(
_widget
!=
NULL
&&
type
==
finds
)
{
_widget
->
ShowWiteJson
(
rlt
,
rtjson
,
error
);
}
else
{
_widget
->
ShowWiteMGS
(
type
,
rlt
,
error
);
_widget
->
ShowWiteMGS
(
type
,
rlt
,
error
);
}
_lock
.
unlock
();
_lock
.
unlock
();
}
}
...
...
sbkpay/global.h
View file @
80e41b72
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
#define MAX_BUF_LEN 25600
#define MAX_BUF_LEN 25600
#define MAX_CHILED_LEN 256
#define MAX_CHILED_LEN 256
#define MAX_PRINT_LEN
4096
#define MAX_PRINT_LEN
8192
#define PRINT_FILE_NAME "print.txt"
#define PRINT_FILE_NAME "print.txt"
...
@@ -19,12 +19,18 @@
...
@@ -19,12 +19,18 @@
#define JSON_KEY_STATIONID "stationId"
#define JSON_KEY_STATIONID "stationId"
#define JSON_KEY_OPERATORID "operatorId"
#define JSON_KEY_OPERATORID "operatorId"
#define JSON_KEY_TRANSID "transId"
#define JSON_KEY_TRANSID "transId"
#define JSON_KEY_REFUNDID "refundId"
#define JSON_KEY_BUSINESSDATE "businessDate"
#define JSON_KEY_BUSINESSDATE "businessDate"
#define JSON_KEY_CODE "code"
#define JSON_KEY_CODE "code"
#define JSON_KEY_FMID "fmId"
#define JSON_KEY_FMID "fmId"
#define JSON_KEY_TRANSAMOUNT "transAmount"
#define JSON_KEY_TRANSAMOUNT "transAmount"
#define JSON_KEY_REFUNDAMOUT "refundAmount"
#define JSON_KEY_REFUNDAMOUT "refundAmount"
#define JSON_KEY_ENDTIME "endTime"
#define JSON_KEY_ENDTIME "endTime"
#define JSON_KEY_TRANSTIME "transTime"
#define JSON_KEY_STATE "state"
#define JSON_KEY_STATEMSG "stateMsg"
#define JSON_KEY_METHCODE "paymentMethodCode"
//response
//response
#define JSON_KEY_MESSAGE "message"
#define JSON_KEY_MESSAGE "message"
...
@@ -32,6 +38,12 @@
...
@@ -32,6 +38,12 @@
#define JSON_KEY_FMID "fmId"
#define JSON_KEY_FMID "fmId"
#define JSON_KEY_EXT "ext"
#define JSON_KEY_EXT "ext"
#define JSON_KEY_PRINT "print"
#define JSON_KEY_PRINT "print"
#define JSON_KEY_PRINTACTION "printAction"
#define JSON_KEY_PAYMENTMETHODCODE "paymentMethodCode"
#define JSON_KEY_TRANSAMOUNT "transAmount"
#define JSON_KEY_MERDISCOUNT "merchantDiscount"
#define JSON_KEY_PLTDISCOUNT "platformDiscount"
#define JSON_KEY_UNAMOUNT "undiscountAmount"
#define JSON_KEY_UNAMOUNT "undiscountAmount"
#define JSON_KEY_PARTORDERID "partnerOrderId"
#define JSON_KEY_PARTORDERID "partnerOrderId"
...
@@ -44,6 +56,15 @@
...
@@ -44,6 +56,15 @@
#define JSON_KEY_PRODUCTS_SALESTYPE "salesType"
#define JSON_KEY_PRODUCTS_SALESTYPE "salesType"
#define JSON_KEY_PRODUCTS_PRICE "price"
#define JSON_KEY_PRODUCTS_PRICE "price"
#define JSON_KEY_TOTALNUM "totalNum"
#define JSON_KEY_QUERYINFO "queryInfo"
#define JSON_KEY_PAGENUM "pageNum"
#define JSON_KEY_PAGESIZE "pageSize"
#define JSON_KEY_BEGINTIME "beginTime"
#define JSON_KEY_ENDTIME "endTime"
#define DEFAULT_JSON_VER_VALUE 1
#define DEFAULT_JSON_VER_VALUE 1
#define DEFAULT_JSON_PRODUCTS_NORMAL "NORMAL"
#define DEFAULT_JSON_PRODUCTS_NORMAL "NORMAL"
#define DEFAULT_JSON_PRODUCTS_FREE "FREE"
#define DEFAULT_JSON_PRODUCTS_FREE "FREE"
...
@@ -52,7 +73,7 @@
...
@@ -52,7 +73,7 @@
#define JSON_REQTYPE_REFUND 62
#define JSON_REQTYPE_REFUND 62
#define JSON_REQTYPE_ENDDAY 82
#define JSON_REQTYPE_ENDDAY 82
#define JSON_REQTYPE_PRINTER 85
#define JSON_REQTYPE_PRINTER 85
#define JSON_REQTYPE_
find
2
#define JSON_REQTYPE_
FIND
2
#endif // GLOBAL
#endif // GLOBAL
sbkpay/hostwidget.cpp
View file @
80e41b72
...
@@ -6,6 +6,8 @@
...
@@ -6,6 +6,8 @@
#include "labelstimer.h"
#include "labelstimer.h"
#include <QMovie>
#include <QMovie>
#include <QDateTime>
#include <QJsonArray>
HostWidget
::
HostWidget
(
QWidget
*
parent
)
:
HostWidget
::
HostWidget
(
QWidget
*
parent
)
:
FMPWindow
(
parent
),
FMPWindow
(
parent
),
...
@@ -16,7 +18,6 @@ HostWidget::HostWidget(QWidget *parent) :
...
@@ -16,7 +18,6 @@ HostWidget::HostWidget(QWidget *parent) :
_need_exit
=
false
;
_need_exit
=
false
;
_widgetlist
.
append
(
ui
->
pay
);
_widgetlist
.
append
(
ui
->
pay
);
_widgetlist
.
append
(
ui
->
refund
);
_widgetlist
.
append
(
ui
->
find
);
_widgetlist
.
append
(
ui
->
find
);
_widgetlist
.
append
(
ui
->
Manager
);
_widgetlist
.
append
(
ui
->
Manager
);
_widgetlist
.
append
(
ui
->
sign
);
_widgetlist
.
append
(
ui
->
sign
);
...
@@ -24,18 +25,27 @@ HostWidget::HostWidget(QWidget *parent) :
...
@@ -24,18 +25,27 @@ HostWidget::HostWidget(QWidget *parent) :
_curr_show_widget
=
NULL
;
_curr_show_widget
=
NULL
;
//ui->btn_mananger_print->setEnabled(false);
//ui->btn_mananger_print->setEnabled(false);
ui
->
btn_mananger_check
->
setEnabled
(
false
);
//
ui->btn_mananger_check->setEnabled(false);
InitWidget
();
InitWidget
();
_label_pay_timer
=
new
LabelsTimer
(
ui
->
label_pay_time
,
60
,
QString
::
fromLocal8Bit
(
"%1 秒"
));
_label_pay_timer
=
new
LabelsTimer
(
ui
->
label_pay_time
,
60
,
QString
::
fromLocal8Bit
(
"%1 秒"
));
_label_find_timer
=
new
LabelsTimer
(
ui
->
label_check_timer
,
60
,
QString
::
fromLocal8Bit
(
"%1 秒"
));
connect
(
_label_pay_timer
,
&
LabelsTimer
::
timeout
,
this
,
&
HostWidget
::
on_TimeOut
);
connect
(
_label_pay_timer
,
&
LabelsTimer
::
timeout
,
this
,
&
HostWidget
::
on_TimeOut
);
connect
(
_label_find_timer
,
&
LabelsTimer
::
timeout
,
this
,
&
HostWidget
::
on_TimeOut
);
_label_pay_movie
=
new
QMovie
(
":res/loading.gif"
);
_label_pay_movie
=
new
QMovie
(
":res/loading.gif"
);
_label_pay_movie
->
start
();
_label_pay_movie
->
start
();
ui
->
label_pay_time_load
->
setMovie
(
_label_pay_movie
);
ui
->
label_pay_time_load
->
setMovie
(
_label_pay_movie
);
ui
->
label_logo
->
setMovie
(
_label_pay_movie
);
ui
->
tableWidget
->
setEditTriggers
(
QAbstractItemView
::
NoEditTriggers
);
ui
->
tableWidget
->
horizontalHeader
()
->
setSectionResizeMode
(
QHeaderView
::
Stretch
);
ui
->
tableWidget
->
verticalHeader
()
->
setDefaultSectionSize
(
45
);
}
}
void
HostWidget
::
ShowWidget
(
QWidget
*
showwidget
)
void
HostWidget
::
ShowWidget
(
QWidget
*
showwidget
)
...
@@ -104,8 +114,8 @@ void HostWidget::keyPressEvent(QKeyEvent *ke)
...
@@ -104,8 +114,8 @@ void HostWidget::keyPressEvent(QKeyEvent *ke)
}
}
else
else
{
{
ui
->
label_pay_title
->
setText
(
QString
::
fromLocal8Bit
(
"支付宝退款中..."
));
//
ui->label_pay_title->setText(QString::fromLocal8Bit("支付宝退款中..."));
emit
RequestWithType
(
refund
,
list
);
//
emit RequestWithType(refund, list);
}
}
}
else
}
else
...
@@ -136,7 +146,7 @@ void HostWidget::ShowWithRequest(AlipayRequest request)
...
@@ -136,7 +146,7 @@ void HostWidget::ShowWithRequest(AlipayRequest request)
ShowWidget
(
ui
->
pay
);
ShowWidget
(
ui
->
pay
);
_curr_show_widget
=
ui
->
pay
;
_curr_show_widget
=
ui
->
pay
;
double
Amount
=
FMTool
::
GetString
(
_data
.
Amount
,
12
).
toInt
()
/
100.0
;
double
Amount
=
FMTool
::
GetString
(
_data
.
Amount
,
12
).
toInt
()
/
100.0
;
ui
->
label_pay_title
->
setText
(
QString
::
fromLocal8Bit
(
"请扫描
输入
支付宝二维码"
));
ui
->
label_pay_title
->
setText
(
QString
::
fromLocal8Bit
(
"请扫描支付宝二维码"
));
ui
->
btn_pay_exit
->
setText
(
QString
::
fromLocal8Bit
(
"取消支付"
));
ui
->
btn_pay_exit
->
setText
(
QString
::
fromLocal8Bit
(
"取消支付"
));
ui
->
label_pay_money
->
setText
(
QString
::
fromLocal8Bit
(
"需收取 ¥ %1"
).
arg
(
Amount
));
ui
->
label_pay_money
->
setText
(
QString
::
fromLocal8Bit
(
"需收取 ¥ %1"
).
arg
(
Amount
));
}
}
...
@@ -146,10 +156,124 @@ void HostWidget::ShowWithRequest(AlipayRequest request)
...
@@ -146,10 +156,124 @@ void HostWidget::ShowWithRequest(AlipayRequest request)
_type
=
refund
;
_type
=
refund
;
ShowWidget
(
ui
->
pay
);
ShowWidget
(
ui
->
pay
);
_curr_show_widget
=
ui
->
pay
;
_curr_show_widget
=
ui
->
pay
;
double
Amount
=
FMTool
::
GetString
(
_data
.
Amount
,
12
).
toInt
()
/
100.0
;
// double Amount = FMTool::GetString(_data.Amount, 12).toInt()/100.0;
ui
->
label_pay_title
->
setText
(
QString
::
fromLocal8Bit
(
"请扫描退款凭证号"
));
// ui->label_pay_title->setText(QString::fromLocal8Bit("请扫描退款凭证号"));
ui
->
btn_pay_exit
->
setText
(
QString
::
fromLocal8Bit
(
"取消退款"
));
// ui->btn_pay_exit->setText(QString::fromLocal8Bit("取消退款"));
ui
->
label_pay_money
->
setText
(
QString
::
fromLocal8Bit
(
"退款 ¥ %1"
).
arg
(
Amount
));
// ui->label_pay_money->setText(QString::fromLocal8Bit("退款 ¥ %1").arg(Amount));
ui
->
btn_pay_exit
->
hide
();
ui
->
label_pay_money
->
hide
();
_refundamout
=
FMTool
::
GetString
(
_data
.
Amount
,
12
).
toInt
();
_label_pay_timer
->
start
(
60
,
QString
::
fromLocal8Bit
(
"%1 秒"
));
QStringList
list
;
list
.
append
(
FMTool
::
GetString
(
request
.
OriginTrace
,
64
));
ui
->
label_pay_title
->
setText
(
QString
::
fromLocal8Bit
(
"支付宝退款中..."
));
emit
RequestWithType
(
refund
,
list
);
}
if
(
reqtype
.
compare
(
"80"
)
==
0
)
{
_type
=
finds
;
ui
->
label_find_msg
->
clear
();
ui
->
dateEdit_find_begin
->
setDate
(
QDate
::
currentDate
());
ui
->
dateEdit_find_end
->
setDate
(
QDate
::
currentDate
());
ui
->
tableWidget
->
hide
();
ui
->
frame
->
hide
();
ui
->
widget_check_load
->
hide
();
ShowWidget
(
ui
->
find
);
_curr_show_widget
=
ui
->
find
;
ui
->
label_find_page
->
setText
(
"1"
);
}
}
void
HostWidget
::
ShowWiteJson
(
bool
flag
,
QJsonObject
object
,
QString
error
)
{
ui
->
widget_check_load
->
hide
();
ui
->
btn_find_check
->
show
();
_label_find_timer
->
stop
();
QLOG_INFO
()
<<
object
;
if
(
!
flag
)
{
ui
->
label_find_msg
->
setText
(
QString
::
fromLocal8Bit
(
"查询失败(%1)"
).
arg
(
error
));
}
else
{
if
((
object
.
contains
(
JSON_KEY_TOTALNUM
)
&&
object
[
JSON_KEY_TOTALNUM
].
toInt
()
==
0
)
||
!
object
.
contains
(
JSON_KEY_QUERYINFO
))
{
ui
->
label_find_msg
->
setText
(
QString
::
fromLocal8Bit
(
"无交易记录"
));
}
else
{
ui
->
frame
->
show
();
ui
->
label_find_msg
->
setText
(
QString
::
fromLocal8Bit
(
"%1到%2的账单流水"
).
arg
(
ui
->
dateEdit_find_begin
->
text
(),
ui
->
dateEdit_find_end
->
text
()));
if
(
ui
->
label_find_page
->
text
().
compare
(
"1"
)
==
0
)
{
_line
=
object
[
JSON_KEY_TOTALNUM
].
toInt
()
/
10
;
if
(
object
[
JSON_KEY_TOTALNUM
].
toInt
()
%
10
!=
0
)
_line
+=
1
;
}
QJsonArray
array
=
object
[
JSON_KEY_QUERYINFO
].
toArray
();
foreach
(
auto
val
,
array
)
{
QJsonObject
tmp
=
val
.
toObject
();
ui
->
tableWidget
->
insertRow
(
0
);
QTableWidgetItem
*
item0
=
new
QTableWidgetItem
(
tmp
[
JSON_KEY_FMID
].
toString
());
item0
->
setTextAlignment
(
Qt
::
AlignCenter
);
ui
->
tableWidget
->
setItem
(
0
,
0
,
item0
);
QTableWidgetItem
*
item1
=
new
QTableWidgetItem
(
QString
::
number
(
tmp
[
JSON_KEY_TRANSAMOUNT
].
toInt
()
/
100.0
));
item1
->
setTextAlignment
(
Qt
::
AlignCenter
);
ui
->
tableWidget
->
setItem
(
0
,
1
,
item1
);
QTableWidgetItem
*
item2
=
new
QTableWidgetItem
(
tmp
[
JSON_KEY_TRANSTIME
].
toString
());
item2
->
setTextAlignment
(
Qt
::
AlignCenter
);
ui
->
tableWidget
->
setItem
(
0
,
2
,
item2
);
QTableWidgetItem
*
item3
=
new
QTableWidgetItem
(
tmp
[
JSON_KEY_STATEMSG
].
toString
());
item3
->
setTextAlignment
(
Qt
::
AlignCenter
);
ui
->
tableWidget
->
setItem
(
0
,
3
,
item3
);
QWidget
*
pWdg
=
new
QWidget
(
ui
->
tableWidget
);
QHBoxLayout
*
hLayout
=
new
QHBoxLayout
(
pWdg
);
QPushButton
*
pBtn
=
new
QPushButton
(
pWdg
);
pBtn
->
setFixedSize
(
70
,
30
);
pBtn
->
setFocusPolicy
(
Qt
::
NoFocus
);
pBtn
->
setProperty
(
"orderId"
,
tmp
[
JSON_KEY_FMID
].
toString
());
pBtn
->
setText
(
QString
::
fromLocal8Bit
(
"打印"
));
hLayout
->
addWidget
(
pBtn
);
hLayout
->
setMargin
(
0
);
pWdg
->
setLayout
(
hLayout
);
ui
->
tableWidget
->
setCellWidget
(
0
,
4
,
pWdg
);
// 操作按钮
pBtn
->
setStyleSheet
(
"border:0px;border-radius:2px;background-color: rgb(0, 179, 238);font: 75 20px
\"
Microsoft YaHei UI Light
\"
;"
);
connect
(
pBtn
,
&
QPushButton
::
clicked
,
this
,
[
this
,
pBtn
]()
{
QStringList
list
;
list
.
append
(
pBtn
->
property
(
"orderId"
).
toString
());
this
->
hide
();
emit
RequestWithType
(
againprint
,
list
);
});
}
ui
->
tableWidget
->
show
();
}
}
}
}
}
...
@@ -221,6 +345,11 @@ void HostWidget::ShowWiteMGS(ReqType type, bool flag, QString message)
...
@@ -221,6 +345,11 @@ void HostWidget::ShowWiteMGS(ReqType type, bool flag, QString message)
return
;
return
;
}
}
if
(
type
==
againprint
)
{
emit
Exits
();
return
;
}
}
}
void
HostWidget
::
on_btn_mananger_register_clicked
()
void
HostWidget
::
on_btn_mananger_register_clicked
()
...
@@ -237,7 +366,19 @@ void HostWidget::on_btn_mananger_register_clicked()
...
@@ -237,7 +366,19 @@ void HostWidget::on_btn_mananger_register_clicked()
void
HostWidget
::
on_btn_mananger_check_clicked
()
void
HostWidget
::
on_btn_mananger_check_clicked
()
{
{
_type
=
finds
;
ui
->
label_find_msg
->
clear
();
ui
->
dateEdit_find_begin
->
setDisplayFormat
(
"yyyy-MM-dd"
);
ui
->
dateEdit_find_end
->
setDisplayFormat
(
"yyyy-MM-dd"
);
ui
->
dateEdit_find_begin
->
setDate
(
QDate
::
currentDate
());
ui
->
dateEdit_find_end
->
setDate
(
QDate
::
currentDate
());
ui
->
tableWidget
->
hide
();
ui
->
frame
->
hide
();
ui
->
widget_check_load
->
hide
();
ShowWidget
(
ui
->
find
);
ShowWidget
(
ui
->
find
);
_curr_show_widget
=
ui
->
find
;
ui
->
label_find_page
->
setText
(
"1"
);
}
}
void
HostWidget
::
on_btn_mananger_print_clicked
()
void
HostWidget
::
on_btn_mananger_print_clicked
()
...
@@ -294,3 +435,46 @@ void HostWidget::on_btn_sign_sign_clicked()
...
@@ -294,3 +435,46 @@ void HostWidget::on_btn_sign_sign_clicked()
ui
->
btn_sign_sign
->
hide
();
ui
->
btn_sign_sign
->
hide
();
emit
RequestWithType
(
sign
,
list
);
emit
RequestWithType
(
sign
,
list
);
}
}
void
HostWidget
::
on_btn_find_check_clicked
()
{
QStringList
list
;
ui
->
tableWidget
->
clear
();
QStringList
headerString
;
headerString
<<
QString
::
fromLocal8Bit
(
"订单编号"
)
<<
QString
::
fromLocal8Bit
(
"订单金额"
)
<<
QString
::
fromLocal8Bit
(
"订单时间"
)
<<
QString
::
fromLocal8Bit
(
"支付状态"
)
<<
QString
::
fromLocal8Bit
(
"操作"
);
ui
->
tableWidget
->
horizontalHeader
()
->
setStyleSheet
(
"QHeaderView::section{border: 0px;font: 75 18px
\"
Microsoft YaHei UI Light
\"
;}"
);
ui
->
tableWidget
->
horizontalHeader
()
->
setFixedHeight
(
25
);
//设置表头的高度
ui
->
tableWidget
->
setHorizontalHeaderLabels
(
headerString
);
ui
->
frame
->
hide
();
ui
->
widget_check_load
->
show
();
ui
->
btn_find_check
->
hide
();
list
.
append
(
ui
->
dateEdit_find_begin
->
text
().
replace
(
"/"
,
"-"
));
list
.
append
(
ui
->
dateEdit_find_end
->
text
().
replace
(
"/"
,
"-"
));
list
.
append
(
ui
->
label_find_page
->
text
());
_label_find_timer
->
start
();
emit
RequestWithType
(
finds
,
list
);
}
void
HostWidget
::
on_btn_find_next_clicked
()
{
if
(
ui
->
label_find_page
->
text
().
toInt
()
==
_line
)
return
;
int
page
=
ui
->
label_find_page
->
text
().
toInt
()
+
1
;
ui
->
label_find_page
->
setText
(
QString
::
number
(
page
));
on_btn_find_check_clicked
();
}
void
HostWidget
::
on_btn_find_up_clicked
()
{
if
(
ui
->
label_find_page
->
text
().
compare
(
"1"
)
!=
0
)
{
int
page
=
ui
->
label_find_page
->
text
().
toInt
()
-
1
;
ui
->
label_find_page
->
setText
(
QString
::
number
(
page
));
}
on_btn_find_check_clicked
();
}
sbkpay/hostwidget.h
View file @
80e41b72
...
@@ -28,6 +28,7 @@ public:
...
@@ -28,6 +28,7 @@ public:
void
ShowWiteMGS
(
ReqType
type
,
bool
flag
,
QString
message
=
QString
());
void
ShowWiteMGS
(
ReqType
type
,
bool
flag
,
QString
message
=
QString
());
void
ShowWiteJson
(
bool
flag
,
QJsonObject
object
,
QString
error
);
signals
:
signals
:
void
RequestWithType
(
ReqType
type
,
QStringList
list
);
void
RequestWithType
(
ReqType
type
,
QStringList
list
);
...
@@ -58,6 +59,12 @@ private slots:
...
@@ -58,6 +59,12 @@ private slots:
void
on_TimeOut
();
void
on_TimeOut
();
void
on_btn_find_check_clicked
();
void
on_btn_find_next_clicked
();
void
on_btn_find_up_clicked
();
private
:
private
:
void
ShowWidget
(
QWidget
*
showwidget
);
void
ShowWidget
(
QWidget
*
showwidget
);
...
@@ -74,10 +81,16 @@ private:
...
@@ -74,10 +81,16 @@ private:
LabelsTimer
*
_label_pay_timer
;
LabelsTimer
*
_label_pay_timer
;
LabelsTimer
*
_label_find_timer
;
QMovie
*
_label_pay_movie
;
QMovie
*
_label_pay_movie
;
int
_line
;
bool
_need_exit
;
bool
_need_exit
;
int
_refundamout
;
ReqType
_type
;
ReqType
_type
;
};
};
...
...
sbkpay/hostwidget.ui
View file @
80e41b72
...
@@ -6,8 +6,8 @@
...
@@ -6,8 +6,8 @@
<rect>
<rect>
<x>
0
</x>
<x>
0
</x>
<y>
0
</y>
<y>
0
</y>
<width>
1
78
4
</width>
<width>
1
69
4
</width>
<height>
634
</height>
<height>
839
</height>
</rect>
</rect>
</property>
</property>
<property
name=
"minimumSize"
>
<property
name=
"minimumSize"
>
...
@@ -25,7 +25,10 @@
...
@@ -25,7 +25,10 @@
background-color: rgb(165, 165, 165);
background-color: rgb(165, 165, 165);
}
</string>
}
</string>
</property>
</property>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_13"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_4"
>
<property
name=
"spacing"
>
<number>
0
</number>
</property>
<property
name=
"leftMargin"
>
<property
name=
"leftMargin"
>
<number>
0
</number>
<number>
0
</number>
</property>
</property>
...
@@ -784,696 +787,685 @@
...
@@ -784,696 +787,685 @@
</widget>
</widget>
</item>
</item>
<item>
<item>
<widget
class=
"QWidget"
name=
"
refu
nd"
native=
"true"
>
<widget
class=
"QWidget"
name=
"
fi
nd"
native=
"true"
>
<property
name=
"styleSheet"
>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#
refu
nd
<string
notr=
"true"
>
#
fi
nd
{
{
background-color: rgb(255, 255, 255);
}
</string>
}
</string>
</property>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_5"
>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_5"
>
<property
name=
"spacing"
>
<number>
0
</number>
</property>
<property
name=
"leftMargin"
>
<property
name=
"leftMargin"
>
<number>
0
</number>
<number>
3
0
</number>
</property>
</property>
<property
name=
"topMargin"
>
<property
name=
"topMargin"
>
<number>
0
</number>
<number>
3
0
</number>
</property>
</property>
<property
name=
"rightMargin"
>
<property
name=
"rightMargin"
>
<number>
0
</number>
<number>
3
0
</number>
</property>
</property>
<property
name=
"bottomMargin"
>
<property
name=
"bottomMargin"
>
<number>
0
</number>
<number>
3
0
</number>
</property>
</property>
<item>
<item>
<spacer
name=
"verticalSpacer_10"
>
<widget
class=
"QWidget"
name=
"widget_find_main"
native=
"true"
>
<property
name=
"orientation"
>
<property
name=
"styleSheet"
>
<enum>
Qt::Vertical
</enum>
<string
notr=
"true"
>
#widget_find_main
</property>
{
<property
name=
"sizeHint"
stdset=
"0"
>
border: 1px solid black;
<size>
}
</string>
<width>
20
</width>
<height>
199
</height>
</size>
</property>
</spacer>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_6"
>
<property
name=
"spacing"
>
<number>
0
</number>
</property>
</property>
<item>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_4"
>
<spacer
name=
"horizontalSpacer_9"
>
<property
name=
"leftMargin"
>
<property
name=
"orientation"
>
<number>
1
</number>
<enum>
Qt::Horizontal
</enum>
</property>
</property>
<property
name=
"topMargin"
>
<property
name=
"sizeHint"
stdset=
"0"
>
<number>
9
</number>
<size>
</property>
<width>
40
</width>
<property
name=
"rightMargin"
>
<height>
20
</height>
<number>
1
</number>
</size>
</property>
</property>
<item>
</spacer>
<widget
class=
"QLabel"
name=
"label_find_title"
>
</item>
<property
name=
"styleSheet"
>
<item>
<string
notr=
"true"
>
#label_find_title
<widget
class=
"QWidget"
name=
"widget_refund_main"
native=
"true"
>
<property
name=
"minimumSize"
>
<size>
<width>
400
</width>
<height>
350
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
400
</width>
<height>
350
</height>
</size>
</property>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#widget_refund_main
{
{
border-radius:15px;
font: 75 25px
"
Microsoft YaHei UI Light
"
;
background-color: rgb(255, 255, 255);
}
</string>
}
</string>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_4"
>
<property
name=
"spacing"
>
<number>
0
</number>
</property>
</property>
<property
name=
"
leftMargin
"
>
<property
name=
"
text
"
>
<
number>
0
</number
>
<
string>
门店0001交易流水查询
</string
>
</property>
</property>
<property
name=
"
topMargin
"
>
<property
name=
"
alignment
"
>
<
number>
0
</number
>
<
set>
Qt::AlignCenter
</set
>
</property>
</property>
<property
name=
"rightMargin"
>
</widget>
<number>
0
</number>
</item>
<item>
<widget
class=
"QWidget"
name=
"widget_find_head"
native=
"true"
>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#widget_find_head
{
border: 1px solid black;
background-color: rgb(208, 208, 208);
}
</string>
</property>
</property>
<property
name=
"bottomMargin"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_7"
>
<property
name=
"spacing"
>
<number>
0
</number>
</property>
<property
name=
"leftMargin"
>
<number>
0
</number>
</property>
<property
name=
"topMargin"
>
<number>
5
</number>
</property>
<property
name=
"rightMargin"
>
<number>
0
</number>
</property>
<property
name=
"bottomMargin"
>
<number>
5
</number>
</property>
<item>
<spacer
name=
"horizontalSpacer_29"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_find_begin"
>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#label_find_begin
{
font: 75 20px
"
Microsoft YaHei UI Light
"
;
}
</string>
</property>
<property
name=
"text"
>
<string>
开始时间
</string>
</property>
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer_28"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeType"
>
<enum>
QSizePolicy::Maximum
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
<item>
<widget
class=
"QDateEdit"
name=
"dateEdit_find_begin"
>
<property
name=
"cursor"
>
<cursorShape>
ArrowCursor
</cursorShape>
</property>
<property
name=
"autoFillBackground"
>
<bool>
false
</bool>
</property>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#dateEdit_find_begin
{
font: 75 20px
"
Microsoft YaHei UI Light
"
;
background-color: rgb(208, 208, 208);
}
</string>
</property>
<property
name=
"maximumDate"
>
<date>
<year>
7999
</year>
<month>
12
</month>
<day>
30
</day>
</date>
</property>
<property
name=
"displayFormat"
>
<string>
yyyy-MM-dd
</string>
</property>
<property
name=
"calendarPopup"
>
<bool>
true
</bool>
</property>
<property
name=
"date"
>
<date>
<year>
2017
</year>
<month>
8
</month>
<day>
15
</day>
</date>
</property>
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer_27"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeType"
>
<enum>
QSizePolicy::Maximum
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_find_end"
>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#label_find_end
{
font: 75 20px
"
Microsoft YaHei UI Light
"
;
}
</string>
</property>
<property
name=
"text"
>
<string>
结束时间
</string>
</property>
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer_26"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeType"
>
<enum>
QSizePolicy::Maximum
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
<item>
<widget
class=
"QDateEdit"
name=
"dateEdit_find_end"
>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#dateEdit_find_end
{
font: 75 20px
"
Microsoft YaHei UI Light
"
;
background-color: rgb(208, 208, 208);
}
</string>
</property>
<property
name=
"calendarPopup"
>
<bool>
true
</bool>
</property>
<property
name=
"date"
>
<date>
<year>
2017
</year>
<month>
8
</month>
<day>
15
</day>
</date>
</property>
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer_9"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeType"
>
<enum>
QSizePolicy::Maximum
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
<item>
<widget
class=
"QPushButton"
name=
"btn_find_check"
>
<property
name=
"minimumSize"
>
<size>
<width>
100
</width>
<height>
35
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
100
</width>
<height>
35
</height>
</size>
</property>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#btn_find_check
{
border:0px;
border-radius:2px;
background-color: rgb(0, 179, 238);
font: 75 20px
"
Microsoft YaHei UI Light
"
;
}
</string>
</property>
<property
name=
"text"
>
<string>
查询
</string>
</property>
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer_10"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeType"
>
<enum>
QSizePolicy::Maximum
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
<item>
<widget
class=
"QPushButton"
name=
"btn_find_exit"
>
<property
name=
"minimumSize"
>
<size>
<width>
100
</width>
<height>
35
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
100
</width>
<height>
35
</height>
</size>
</property>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#btn_find_exit
{
border:0px;
border-radius:2px;
background-color: rgb(150, 150, 150);
font: 75 20px
"
Microsoft YaHei UI Light
"
;
}
</string>
</property>
<property
name=
"text"
>
<string>
退出
</string>
</property>
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer_25"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_find_msg"
>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#label_find_msg
{
font: 75 18px
"
Microsoft YaHei UI Light
"
;
}
</string>
</property>
<property
name=
"text"
>
<string>
2017-11-11至2018-11-11交易流水
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
</widget>
</item>
<item>
<widget
class=
"QTableWidget"
name=
"tableWidget"
>
<property
name=
"minimumSize"
>
<size>
<width>
0
</width>
<height>
500
</height>
</size>
</property>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#tableWidget
{
font: 75 18px
"
Microsoft YaHei UI Light
"
;
}
QHeaderView::section{
border: 0px;
font: 75 18px
"
Microsoft YaHei UI Light
"
;
}
</string>
</property>
<property
name=
"verticalScrollBarPolicy"
>
<enum>
Qt::ScrollBarAlwaysOff
</enum>
</property>
<property
name=
"horizontalScrollBarPolicy"
>
<enum>
Qt::ScrollBarAlwaysOff
</enum>
</property>
<attribute
name=
"horizontalHeaderHighlightSections"
>
<bool>
true
</bool>
</attribute>
<attribute
name=
"horizontalHeaderStretchLastSection"
>
<bool>
false
</bool>
</attribute>
<attribute
name=
"verticalHeaderVisible"
>
<bool>
false
</bool>
</attribute>
<column>
<property
name=
"text"
>
<string>
商户订单号
</string>
</property>
</column>
<column>
<property
name=
"text"
>
<string>
订单金额
</string>
</property>
</column>
<column>
<property
name=
"text"
>
<string>
订单时间
</string>
</property>
</column>
<column>
<property
name=
"text"
>
<string>
支付状态
</string>
</property>
</column>
<column>
<property
name=
"text"
>
<string>
操作
</string>
</property>
</column>
</widget>
</item>
<item>
<spacer
name=
"verticalSpacer_11"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeType"
>
<enum>
QSizePolicy::Expanding
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_5"
>
<property
name=
"spacing"
>
<number>
0
</number>
<number>
0
</number>
</property>
</property>
<item>
<item>
<spacer
name=
"
verticalSpacer_12
"
>
<spacer
name=
"
horizontalSpacer_30
"
>
<property
name=
"orientation"
>
<property
name=
"orientation"
>
<enum>
Qt::
Vertic
al
</enum>
<enum>
Qt::
Horizont
al
</enum>
</property>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<size>
<width>
2
0
</width>
<width>
4
0
</width>
<height>
4
0
</height>
<height>
2
0
</height>
</size>
</size>
</property>
</property>
</spacer>
</spacer>
</item>
</item>
<item>
<item>
<widget
class=
"QLabel"
name=
"label_refund_title"
>
<widget
class=
"QWidget"
name=
"widget_check_load"
native=
"true"
>
<property
name=
"styleSheet"
>
<property
name=
"minimumSize"
>
<string
notr=
"true"
>
#label_refund_title
<size>
{
<width>
64
</width>
font: 75 25px
"
Microsoft YaHei UI Light
"
;
<height>
64
</height>
}
</string>
</size>
</property>
<property
name=
"text"
>
<string>
退款
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
</widget>
</item>
<item>
<spacer
name=
"verticalSpacer_24"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeType"
>
<enum>
QSizePolicy::Maximum
</enum>
</property>
</property>
<property
name=
"
sizeHint"
stdset=
"0
"
>
<property
name=
"
maximumSize
"
>
<size>
<size>
<width>
20
</width>
<width>
64
</width>
<height>
1
4
</height>
<height>
6
4
</height>
</size>
</size>
</property>
</property>
</spacer>
<widget
class=
"QLabel"
name=
"label_logo"
>
</item>
<property
name=
"geometry"
>
<item>
<rect>
<widget
class=
"QLabel"
name=
"label__refund_money"
>
<x>
0
</x>
<property
name=
"styleSheet"
>
<y>
0
</y>
<string
notr=
"true"
>
#label__refund_money
<width>
64
</width>
<height>
64
</height>
</rect>
</property>
<property
name=
"minimumSize"
>
<size>
<width>
64
</width>
<height>
64
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
64
</width>
<height>
64
</height>
</size>
</property>
<property
name=
"text"
>
<string/>
</property>
</widget>
<widget
class=
"QLabel"
name=
"label_check_timer"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
64
</width>
<height>
64
</height>
</rect>
</property>
<property
name=
"minimumSize"
>
<size>
<width>
64
</width>
<height>
64
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
64
</width>
<height>
64
</height>
</size>
</property>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#label_check_timer
{
{
font: 75 16px
"
Microsoft YaHei UI Light
"
;
font: 16px
"
微软雅黑
"
;
color: rgb(203, 203, 203);
color: rgb(
160, 160, 160
);
color: rgb(
0, 179, 238
);
}
</string>
}
</string>
</property>
</property>
<property
name=
"text"
>
<property
name=
"text"
>
<string>
100
</string>
<string>
60秒
</string>
</property>
</property>
<property
name=
"alignment"
>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
<set>
Qt::AlignCenter
</set>
</property>
</property>
</widget>
<zorder>
label_check_timer
</zorder>
<zorder>
label_logo
</zorder>
</widget>
</widget>
</item>
</item>
<item>
<item>
<spacer
name=
"
verticalSpacer_13
"
>
<spacer
name=
"
horizontalSpacer_31
"
>
<property
name=
"orientation"
>
<property
name=
"orientation"
>
<enum>
Qt::
Vertic
al
</enum>
<enum>
Qt::
Horizont
al
</enum>
</property>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<size>
<width>
2
0
</width>
<width>
4
0
</width>
<height>
4
0
</height>
<height>
2
0
</height>
</size>
</size>
</property>
</property>
</spacer>
</spacer>
</item>
</item>
<item>
</layout>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_4"
>
</item>
<item>
<item>
<spacer
name=
"horizontalSpacer_25"
>
<spacer
name=
"verticalSpacer_10"
>
<property
name=
"orientation"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
<enum>
Qt::Vertical
</enum>
</property>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<property
name=
"sizeType"
>
<size>
<enum>
QSizePolicy::Expanding
</enum>
<width>
40
</width>
</property>
<height>
20
</height>
<property
name=
"sizeHint"
stdset=
"0"
>
</size>
<size>
</property>
<width>
17
</width>
</spacer>
<height>
176
</height>
</item>
</size>
<item>
</property>
<widget
class=
"QLabel"
name=
"label__refund_bus"
>
</spacer>
<property
name=
"styleSheet"
>
</item>
<string
notr=
"true"
>
#label__refund_bus
<item>
{
<widget
class=
"QFrame"
name=
"frame"
>
font: 16px
"
微软雅黑
"
;
<property
name=
"styleSheet"
>
}
</string>
<string
notr=
"true"
>
QPushButton
</property>
<property
name=
"text"
>
<string>
营业日期 :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"label__refund_bussessdata"
>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#label__refund_businessdata
{
{
font: 16px
"
微软雅黑
"
;
border: 1px solid black;
font: 75 20px
"
Microsoft YaHei UI Light
"
;
border-color: rgb(179, 179, 179);
}
</string>
}
</string>
</property>
<property
name=
"text"
>
<string>
2017-11-11
</string>
</property>
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer_26"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_5"
>
<item>
<spacer
name=
"horizontalSpacer_28"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
<item>
<widget
class=
"QLabel"
name=
"label__refund_order"
>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#label__refund_order
{
font: 16px
"
微软雅黑
"
;
}
</string>
</property>
<property
name=
"text"
>
<string>
订单号 :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"label__refund_id"
>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#label__refund_id
{
font: 16px
"
微软雅黑
"
;
}
</string>
</property>
<property
name=
"text"
>
<string>
1
</string>
</property>
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer_27"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer
name=
"verticalSpacer_23"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
40
</height>
</size>
</property>
</spacer>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_12"
>
<property
name=
"spacing"
>
<number>
0
</number>
</property>
<item>
<spacer
name=
"horizontalSpacer_29"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
<item>
<widget
class=
"QPushButton"
name=
"btn__refund_refund"
>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#btn__refund_refund
{
border:0px;
border-radius:3px;
background-color: rgb(128, 134, 143);
font: 75 20px
"
Microsoft YaHei UI Light
"
;
color: rgb(255, 255, 255);
}
</string>
</property>
<property
name=
"text"
>
<string>
发起退款(60)
</string>
</property>
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer_30"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer
name=
"verticalSpacer_14"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
40
</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer_10"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer
name=
"verticalSpacer_11"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
199
</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget
class=
"QWidget"
name=
"find"
native=
"true"
>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#find
{
background-color: rgb(211, 255, 198);
}
</string>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_6"
stretch=
"0,0,0,0,0"
>
<property
name=
"spacing"
>
<number>
0
</number>
</property>
<property
name=
"leftMargin"
>
<number>
0
</number>
</property>
<property
name=
"topMargin"
>
<number>
30
</number>
</property>
<property
name=
"rightMargin"
>
<number>
0
</number>
</property>
<property
name=
"bottomMargin"
>
<number>
0
</number>
</property>
<item>
<widget
class=
"QLabel"
name=
"label_7"
>
<property
name=
"text"
>
<string>
门店0001交易流水查询
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
</widget>
</item>
<item>
<widget
class=
"QWidget"
name=
"widget_3"
native=
"true"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_7"
>
<item>
<widget
class=
"QLabel"
name=
"label_8"
>
<property
name=
"text"
>
<string>
开始时间
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit"
/>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_9"
>
<property
name=
"text"
>
<string>
结束时间
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_2"
/>
</item>
<item>
<widget
class=
"QPushButton"
name=
"btn_find_sheck"
>
<property
name=
"text"
>
<string>
查询
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QPushButton"
name=
"btn_find_exit"
>
<property
name=
"text"
>
<string>
退出
</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_10"
>
<property
name=
"text"
>
<string>
2017-11-11至2018-11-11交易流水
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
</widget>
</item>
<item>
<widget
class=
"QTableWidget"
name=
"tableWidget"
>
<attribute
name=
"horizontalHeaderVisible"
>
<bool>
false
</bool>
</attribute>
<attribute
name=
"horizontalHeaderStretchLastSection"
>
<bool>
false
</bool>
</attribute>
<column>
<property
name=
"text"
>
<string>
商户订单号
</string>
</property>
</column>
<column>
<property
name=
"text"
>
<string>
订单金额
</string>
</property>
</column>
<column>
<property
name=
"text"
>
<string>
订单时间
</string>
</property>
</column>
<column>
<property
name=
"text"
>
<string>
支付状态
</string>
</property>
</column>
<column>
<property
name=
"text"
>
<string>
操作
</string>
</property>
</column>
</widget>
</item>
<item>
<widget
class=
"QFrame"
name=
"frame"
>
<property
name=
"frameShape"
>
<enum>
QFrame::StyledPanel
</enum>
</property>
<property
name=
"frameShadow"
>
<enum>
QFrame::Raised
</enum>
</property>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_8"
>
<property
name=
"spacing"
>
<number>
0
</number>
</property>
<property
name=
"leftMargin"
>
<number>
0
</number>
</property>
<property
name=
"topMargin"
>
<number>
0
</number>
</property>
<property
name=
"rightMargin"
>
<number>
0
</number>
</property>
<property
name=
"bottomMargin"
>
<number>
0
</number>
</property>
<item>
<spacer
name=
"horizontalSpacer_11"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
<item>
<widget
class=
"QPushButton"
name=
"pushButton_4"
>
<property
name=
"minimumSize"
>
<size>
<width>
30
</width>
<height>
30
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
30
</width>
<height>
30
</height>
</size>
</property>
<property
name=
"text"
>
<string>
<<
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QPushButton"
name=
"pushButton_5"
>
<property
name=
"minimumSize"
>
<size>
<width>
30
</width>
<height>
30
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
30
</width>
<height>
30
</height>
</size>
</property>
<property
name=
"text"
>
<string>
1
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QPushButton"
name=
"pushButton_6"
>
<property
name=
"minimumSize"
>
<size>
<width>
30
</width>
<height>
30
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
30
</width>
<height>
30
</height>
</size>
</property>
<property
name=
"text"
>
<string>
2
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QPushButton"
name=
"pushButton_7"
>
<property
name=
"minimumSize"
>
<size>
<width>
30
</width>
<height>
30
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
30
</width>
<height>
30
</height>
</size>
</property>
<property
name=
"text"
>
<string>
3
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QPushButton"
name=
"pushButton_8"
>
<property
name=
"minimumSize"
>
<size>
<width>
30
</width>
<height>
30
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
30
</width>
<height>
30
</height>
</size>
</property>
<property
name=
"text"
>
<string>
4
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QPushButton"
name=
"pushButton_9"
>
<property
name=
"minimumSize"
>
<size>
<width>
30
</width>
<height>
30
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
30
</width>
<height>
30
</height>
</size>
</property>
<property
name=
"text"
>
<string>
5
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QPushButton"
name=
"pushButton_10"
>
<property
name=
"minimumSize"
>
<size>
<width>
30
</width>
<height>
30
</height>
</size>
</property>
</property>
<property
name=
"maximumSize"
>
<property
name=
"frameShape"
>
<size>
<enum>
QFrame::StyledPanel
</enum>
<width>
30
</width>
<height>
30
</height>
</size>
</property>
</property>
<property
name=
"
text
"
>
<property
name=
"
frameShadow
"
>
<
string>
>>
</string
>
<
enum>
QFrame::Raised
</enum
>
</property>
</property>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_8"
>
<property
name=
"spacing"
>
<number>
0
</number>
</property>
<property
name=
"leftMargin"
>
<number>
0
</number>
</property>
<property
name=
"topMargin"
>
<number>
0
</number>
</property>
<property
name=
"rightMargin"
>
<number>
0
</number>
</property>
<property
name=
"bottomMargin"
>
<number>
0
</number>
</property>
<item>
<spacer
name=
"horizontalSpacer_11"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
<item>
<widget
class=
"QPushButton"
name=
"btn_find_up"
>
<property
name=
"minimumSize"
>
<size>
<width>
30
</width>
<height>
30
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
30
</width>
<height>
30
</height>
</size>
</property>
<property
name=
"text"
>
<string>
<<
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_find_page"
>
<property
name=
"minimumSize"
>
<size>
<width>
30
</width>
<height>
30
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
30
</width>
<height>
30
</height>
</size>
</property>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
font: 75 20px
"
Microsoft YaHei UI Light
"
;
background-color: rgb(0, 179, 238);
color: rgb(255, 255, 255);
</string>
</property>
<property
name=
"text"
>
<string>
1
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
</widget>
</item>
<item>
<widget
class=
"QPushButton"
name=
"btn_find_next"
>
<property
name=
"minimumSize"
>
<size>
<width>
30
</width>
<height>
30
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
30
</width>
<height>
30
</height>
</size>
</property>
<property
name=
"text"
>
<string>
>>
</string>
</property>
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer_12"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</item>
<item>
<spacer
name=
"horizontalSpacer_12"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
</layout>
</layout>
</widget>
</widget>
</item>
</item>
...
...
sbkpay/jsonfactory.h
View file @
80e41b72
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
#include <QStringList>
#include <QStringList>
#include <QJsonParseError>
#include <QJsonParseError>
#include <QJsonDocument>
#include <QJsonDocument>
#include <QDateTime>
//接受pos的请求转化为json
//接受pos的请求转化为json
class
JsonFactory
class
JsonFactory
...
@@ -24,7 +25,7 @@ public:
...
@@ -24,7 +25,7 @@ public:
return
GetDayEndJson
(
json
,
request
,
list
);
return
GetDayEndJson
(
json
,
request
,
list
);
if
(
type
==
againprint
)
if
(
type
==
againprint
)
return
GetAgainPrinteJson
(
json
,
request
,
list
);
return
GetAgainPrinteJson
(
json
,
request
,
list
);
if
(
type
==
find
)
if
(
type
==
find
s
)
return
GetFindJson
(
json
,
request
,
list
);
return
GetFindJson
(
json
,
request
,
list
);
return
false
;
return
false
;
}
}
...
@@ -47,7 +48,7 @@ public:
...
@@ -47,7 +48,7 @@ public:
return
GetDayEndResponse
(
rspJsonObj
,
response
);
return
GetDayEndResponse
(
rspJsonObj
,
response
);
if
(
type
==
againprint
)
if
(
type
==
againprint
)
return
GetAgainPrinteResponse
(
rspJsonObj
,
response
);
return
GetAgainPrinteResponse
(
rspJsonObj
,
response
);
if
(
type
==
find
)
if
(
type
==
find
s
)
return
GetFindResponse
(
rspJsonObj
,
response
);
return
GetFindResponse
(
rspJsonObj
,
response
);
return
false
;
return
false
;
}
}
...
@@ -116,7 +117,7 @@ private:
...
@@ -116,7 +117,7 @@ private:
json
.
insert
(
JSON_KEY_STOREID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
StoreNo
),
20
));
json
.
insert
(
JSON_KEY_STOREID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
StoreNo
),
20
));
json
.
insert
(
JSON_KEY_STATIONID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
DeviceNo
),
6
));
json
.
insert
(
JSON_KEY_STATIONID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
DeviceNo
),
6
));
json
.
insert
(
JSON_KEY_OPERATORID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
CashierNo
),
6
));
json
.
insert
(
JSON_KEY_OPERATORID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
CashierNo
),
6
));
json
.
insert
(
JSON_KEY_
TRANS
ID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
CashTraceNo
),
6
));
json
.
insert
(
JSON_KEY_
REFUND
ID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
CashTraceNo
),
6
));
json
.
insert
(
JSON_KEY_BUSINESSDATE
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
BusinessDay
),
8
));
json
.
insert
(
JSON_KEY_BUSINESSDATE
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
BusinessDay
),
8
));
json
.
insert
(
JSON_KEY_FMID
,
list
[
0
]);
json
.
insert
(
JSON_KEY_FMID
,
list
[
0
]);
json
.
insert
(
JSON_KEY_REFUNDAMOUT
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
Amount
),
12
).
toInt
());
json
.
insert
(
JSON_KEY_REFUNDAMOUT
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
Amount
),
12
).
toInt
());
...
@@ -141,31 +142,53 @@ private:
...
@@ -141,31 +142,53 @@ private:
//重打小票
//重打小票
static
bool
GetAgainPrinteJson
(
QJsonObject
&
json
,
const
AlipayRequest
&
request
,
QStringList
list
)
static
bool
GetAgainPrinteJson
(
QJsonObject
&
json
,
const
AlipayRequest
&
request
,
QStringList
list
)
{
{
if
(
list
.
size
()
!=
2
||
list
[
0
].
isEmpty
()
||
list
[
1
].
isEmpty
())
if
(
!
list
.
isEmpty
()
&&
list
[
0
].
isEmpty
())
return
false
;
return
false
;
json
.
insert
(
JSON_KEY_VER
,
DEFAULT_JSON_VER_VALUE
);
json
.
insert
(
JSON_KEY_VER
,
DEFAULT_JSON_VER_VALUE
);
json
.
insert
(
JSON_KEY_REQTYPE
,
JSON_REQTYPE_
REFUND
);
json
.
insert
(
JSON_KEY_REQTYPE
,
JSON_REQTYPE_
PRINTER
);
json
.
insert
(
JSON_KEY_PARTNERID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
PlatNo
),
4
).
toInt
());
json
.
insert
(
JSON_KEY_PARTNERID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
PlatNo
),
4
).
toInt
());
json
.
insert
(
JSON_KEY_STOREID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
StoreNo
),
20
));
json
.
insert
(
JSON_KEY_STOREID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
StoreNo
),
20
));
json
.
insert
(
JSON_KEY_STATIONID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
DeviceNo
),
6
));
json
.
insert
(
JSON_KEY_STATIONID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
DeviceNo
),
6
));
json
.
insert
(
JSON_KEY_OPERATORID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
CashierNo
),
6
));
json
.
insert
(
JSON_KEY_OPERATORID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
CashierNo
),
6
));
json
.
insert
(
JSON_KEY_FMID
,
list
[
1
]);
json
.
insert
(
JSON_KEY_FMID
,
list
[
0
]);
json
.
insert
(
JSON_KEY_PRINTACTION
,
QString
(
"103"
));
return
true
;
return
true
;
}
}
//查询流水
//查询流水
static
bool
GetFindJson
(
QJsonObject
&
json
,
const
AlipayRequest
&
request
,
QStringList
list
)
static
bool
GetFindJson
(
QJsonObject
&
json
,
const
AlipayRequest
&
request
,
QStringList
list
)
{
{
return
true
;
if
(
list
.
size
()
!=
3
||
list
[
0
].
isEmpty
()
||
list
[
1
].
isEmpty
())
}
return
false
;
QString
tmp0
=
list
[
0
];
QString
tmp1
=
list
[
1
];
QString
tmp2
=
list
[
2
];
QString
cur
=
QDateTime
::
currentDateTime
().
toString
(
"hh:mm:ss"
);
tmp0
.
append
(
" 00:00:00"
);
tmp1
.
append
(
QString
(
" "
)
+
cur
);
json
.
insert
(
JSON_KEY_VER
,
DEFAULT_JSON_VER_VALUE
);
json
.
insert
(
JSON_KEY_REQTYPE
,
JSON_REQTYPE_FIND
);
json
.
insert
(
JSON_KEY_PARTNERID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
PlatNo
),
4
).
toInt
());
json
.
insert
(
JSON_KEY_STOREID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
StoreNo
),
20
));
json
.
insert
(
JSON_KEY_STATIONID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
DeviceNo
),
6
));
json
.
insert
(
JSON_KEY_OPERATORID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
CashierNo
),
6
));
json
.
insert
(
JSON_KEY_BEGINTIME
,
tmp0
);
json
.
insert
(
JSON_KEY_ENDTIME
,
tmp1
);
json
.
insert
(
JSON_KEY_PAGESIZE
,
10
);
json
.
insert
(
JSON_KEY_PAGENUM
,
tmp2
.
toInt
());
json
.
insert
(
JSON_KEY_METHCODE
,
10001
);
return
true
;
}
// 支付AlipayResponse
// 支付AlipayResponse
static
bool
GetPayResponse
(
const
QJsonObject
&
rspJsonObj
,
AlipayResponse
&
response
)
static
bool
GetPayResponse
(
const
QJsonObject
&
rspJsonObj
,
AlipayResponse
&
response
)
{
{
return
false
;
return
true
;
}
}
// 退款AlipayResponse
// 退款AlipayResponse
static
bool
GetRefundResponse
(
const
QJsonObject
&
rspJsonObj
,
AlipayResponse
&
response
)
static
bool
GetRefundResponse
(
const
QJsonObject
&
rspJsonObj
,
AlipayResponse
&
response
)
...
...
sbkpay/lib/lib.zip
0 → 100644
View file @
80e41b72
File added
sbkpay/main.cpp
View file @
80e41b72
...
@@ -237,13 +237,14 @@ int main(int argc, char *argv[])
...
@@ -237,13 +237,14 @@ int main(int argc, char *argv[])
AlipayRequest
req
;
AlipayRequest
req
;
FMTool
::
SetString
(
req
.
BusinessDay
,
8
,
QString
(
"20170908"
));
FMTool
::
SetString
(
req
.
BusinessDay
,
8
,
QString
(
"20170908"
));
FMTool
::
SetString
(
req
.
TransType
,
2
,
QString
(
"
3
0"
));
FMTool
::
SetString
(
req
.
TransType
,
2
,
QString
(
"
1
0"
));
FMTool
::
SetString
(
req
.
PlatNo
,
4
,
QString
(
"1443"
));
FMTool
::
SetString
(
req
.
PlatNo
,
4
,
QString
(
"1443"
));
FMTool
::
SetString
(
req
.
TransTime
,
6
,
QString
(
"130301"
));
FMTool
::
SetString
(
req
.
TransTime
,
6
,
QString
(
"130301"
));
FMTool
::
SetString
(
req
.
StoreNo
,
20
,
QString
(
"17607"
));
FMTool
::
SetString
(
req
.
StoreNo
,
20
,
QString
(
"17607"
));
FMTool
::
SetString
(
req
.
DeviceNo
,
6
,
QString
(
"1"
));
FMTool
::
SetString
(
req
.
DeviceNo
,
6
,
QString
(
"1"
));
FMTool
::
SetString
(
req
.
CashierNo
,
6
,
QString
(
"0123"
));
FMTool
::
SetString
(
req
.
CashierNo
,
6
,
QString
(
"0123"
));
FMTool
::
SetString
(
req
.
CashTraceNo
,
6
,
QString
(
"123123"
));
FMTool
::
SetString
(
req
.
CashTraceNo
,
6
,
QString
(
"123123"
));
FMTool
::
SetString
(
req
.
OriginTrace
,
64
,
QString
(
"*1232132132131234565354342-"
));
FMTool
::
SetString
(
req
.
Amount
,
12
,
QString
(
"1"
));
FMTool
::
SetString
(
req
.
Amount
,
12
,
QString
(
"1"
));
FMTool
::
SetString
(
req
.
Reserved1
,
48
,
QString
(
"124112312312312312312----32"
));
FMTool
::
SetString
(
req
.
Reserved1
,
48
,
QString
(
"124112312312312312312----32"
));
req
.
item_line_qty
[
0
]
=
'2'
;
req
.
item_line_qty
[
0
]
=
'2'
;
...
...
sbkpay/requestmodel.h
View file @
80e41b72
...
@@ -7,7 +7,7 @@ typedef enum
...
@@ -7,7 +7,7 @@ typedef enum
refund
,
refund
,
endday
,
endday
,
againprint
,
againprint
,
find
,
find
s
,
sign
sign
}
ReqType
;
}
ReqType
;
...
...
sbkpay/rspfactory.h
View file @
80e41b72
...
@@ -28,7 +28,7 @@ public:
...
@@ -28,7 +28,7 @@ public:
return
GetDayEndResponse
(
response
,
json
);
return
GetDayEndResponse
(
response
,
json
);
if
(
type
==
againprint
)
if
(
type
==
againprint
)
return
GetAgainPrinteResponse
(
response
,
json
);
return
GetAgainPrinteResponse
(
response
,
json
);
if
(
type
==
find
)
if
(
type
==
find
s
)
return
GetFindResponse
(
response
,
json
);
return
GetFindResponse
(
response
,
json
);
return
false
;
return
false
;
}
}
...
@@ -56,6 +56,46 @@ private:
...
@@ -56,6 +56,46 @@ private:
FMTool
::
SetString
(
response
.
ResponseMsg
,
40
,
json
[
JSON_KEY_MESSAGE
].
toString
());
FMTool
::
SetString
(
response
.
ResponseMsg
,
40
,
json
[
JSON_KEY_MESSAGE
].
toString
());
FMTool
::
SetString
(
response
.
CardTraceNo
,
40
,
json
[
JSON_KEY_FMID
].
toString
());
FMTool
::
SetString
(
response
.
CardTraceNo
,
40
,
json
[
JSON_KEY_FMID
].
toString
());
FMTool
::
SetString
(
response
.
NeedPrint
,
2
,
QString
(
"01"
));
FMTool
::
SetString
(
response
.
NeedPrint
,
2
,
QString
(
"01"
));
int
transAmount
=
json
[
JSON_KEY_TRANSAMOUNT
].
toInt
();
int
merchantDiscount
=
json
[
JSON_KEY_MERDISCOUNT
].
toInt
();
int
platformDiscount
=
json
[
JSON_KEY_PLTDISCOUNT
].
toInt
();
int
userAmount
=
transAmount
-
merchantDiscount
-
platformDiscount
;
//用户实付
struct
EFTItem
*
item
=
(
struct
EFTItem
*
)
response
.
EFT_Detail_information
[
0
];
FMTool
::
SetString
((
void
*
)
&
(
item
->
billType
),
1
,
"1"
);
FMTool
::
SetString
((
void
*
)
&
(
item
->
billId
),
8
,
QString
(
"36464"
));
FMTool
::
SetString
((
void
*
)
&
(
item
->
amount
),
12
,
QString
::
number
(
userAmount
));
FMTool
::
SetString
((
void
*
)
&
(
item
->
transactionNum
),
64
,
json
[
JSON_KEY_PAYMENTMETHODCODE
].
toString
());
if
(
merchantDiscount
!=
0
)
{
//商户补贴
struct
EFTItem
*
item
=
(
struct
EFTItem
*
)
response
.
EFT_Detail_information
[
1
];
FMTool
::
SetString
((
void
*
)
&
(
item
->
billType
),
1
,
"1"
);
FMTool
::
SetString
((
void
*
)
&
(
item
->
billId
),
8
,
QString
(
"36466"
));
FMTool
::
SetString
((
void
*
)
&
(
item
->
amount
),
12
,
QString
::
number
(
merchantDiscount
));
FMTool
::
SetString
((
void
*
)
&
(
item
->
transactionNum
),
64
,
json
[
JSON_KEY_PAYMENTMETHODCODE
].
toString
());
}
if
(
platformDiscount
!=
0
)
{
//支付宝补贴
struct
EFTItem
*
item
=
(
struct
EFTItem
*
)
response
.
EFT_Detail_information
[
2
];
FMTool
::
SetString
((
void
*
)
&
(
item
->
billType
),
1
,
"1"
);
FMTool
::
SetString
((
void
*
)
&
(
item
->
billId
),
8
,
QString
(
"10001"
));
FMTool
::
SetString
((
void
*
)
&
(
item
->
amount
),
12
,
QString
::
number
(
platformDiscount
));
FMTool
::
SetString
((
void
*
)
&
(
item
->
transactionNum
),
64
,
json
[
JSON_KEY_PAYMENTMETHODCODE
].
toString
());
}
if
(
json
[
JSON_KEY_STATUSCODE
].
toInt
()
==
100
)
if
(
json
[
JSON_KEY_STATUSCODE
].
toInt
()
==
100
)
return
SetPinter
(
response
,
json
);
return
SetPinter
(
response
,
json
);
...
@@ -88,7 +128,14 @@ private:
...
@@ -88,7 +128,14 @@ private:
static
bool
GetAgainPrinteResponse
(
AlipayResponse
&
response
,
const
QJsonObject
&
json
)
static
bool
GetAgainPrinteResponse
(
AlipayResponse
&
response
,
const
QJsonObject
&
json
)
{
{
return
false
;
FMTool
::
SetString
(
response
.
ResponseCode
,
3
,
QString
::
number
(
json
[
JSON_KEY_STATUSCODE
].
toInt
()));
FMTool
::
SetString
(
response
.
ResponseMsg
,
40
,
json
[
JSON_KEY_MESSAGE
].
toString
());
FMTool
::
SetString
(
response
.
CardTraceNo
,
40
,
json
[
JSON_KEY_FMID
].
toString
());
FMTool
::
SetString
(
response
.
NeedPrint
,
2
,
QString
(
"01"
));
if
(
json
[
JSON_KEY_STATUSCODE
].
toInt
()
==
100
)
return
SetPinter
(
response
,
json
);
return
true
;
}
}
static
bool
GetFindResponse
(
AlipayResponse
&
response
,
const
QJsonObject
&
json
)
static
bool
GetFindResponse
(
AlipayResponse
&
response
,
const
QJsonObject
&
json
)
...
@@ -101,12 +148,14 @@ private:
...
@@ -101,12 +148,14 @@ private:
if
(
!
json
.
contains
(
JSON_KEY_EXT
)
||
!
json
[
JSON_KEY_EXT
].
isObject
())
if
(
!
json
.
contains
(
JSON_KEY_EXT
)
||
!
json
[
JSON_KEY_EXT
].
isObject
())
return
false
;
return
false
;
FMTool
::
SetString
(
response
.
NeedPrint
,
2
,
QString
(
"0
1
"
));
FMTool
::
SetString
(
response
.
NeedPrint
,
2
,
QString
(
"0
0
"
));
QJsonObject
obj
=
json
[
JSON_KEY_EXT
].
toObject
();
QJsonObject
obj
=
json
[
JSON_KEY_EXT
].
toObject
();
QString
str
=
obj
[
JSON_KEY_PRINT
].
toString
();
QString
str
=
obj
[
JSON_KEY_PRINT
].
toString
();
str
.
replace
(
"#"
,
"
\r\n
"
);
QFile
file
(
qApp
->
applicationDirPath
()
+
"/"
+
PRINT_FILE_NAME
);
QFile
file
(
qApp
->
applicationDirPath
()
+
"/"
+
PRINT_FILE_NAME
);
FMTool
::
SetString
(
response
.
EFTprintFileName
,
200
,
QString
(
qApp
->
applicationDirPath
()
+
"/"
+
PRINT_FILE_NAME
));
FMTool
::
SetString
(
response
.
EFTprintFileName
,
200
,
QString
(
qApp
->
applicationDirPath
()
+
"/"
+
PRINT_FILE_NAME
));
...
...
sbkpay/sbkpay.pro
View file @
80e41b72
...
@@ -13,7 +13,7 @@ TARGET = sbkpay
...
@@ -13,7 +13,7 @@ TARGET = sbkpay
include
(
"./QsLog/QsLog.pri"
)
include
(
"./QsLog/QsLog.pri"
)
CONFIG
+=
C
++
11
CONFIG
+=
C
++
11
SBKDLL
include
(
$$
PWD
/
qtwinmigrate
/
src
/
qtwinmigrate
.
pri
)
include
(
$$
PWD
/
qtwinmigrate
/
src
/
qtwinmigrate
.
pri
)
...
...
sbkpay/sbkpay.pro.user
View file @
80e41b72
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.5.1, 2017-08-1
4T12:31:22
. -->
<!-- Written by QtCreator 3.5.1, 2017-08-1
8T10:49:38
. -->
<qtcreator>
<qtcreator>
<data>
<data>
<variable>
EnvironmentId
</variable>
<variable>
EnvironmentId
</variable>
...
...
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