Commit b06641a5 by guanghui.cui

插件更新

parent 26345010
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
#include "fmp_pe_handlers.h" #include "fmp_pe_handlers.h"
#include <QDateTime> #include <QDateTime>
class ctkPluginContext;
FMPePay::FMPePay(ctkPluginContext *context) FMPePay::FMPePay(const FMPContext ctx)
: FMPePayInterface(context), : FMPePayInterface(),
pluginContext(ctx),
//_url(DEFAULT_EPAY_RWQUESTURL), //_url(DEFAULT_EPAY_RWQUESTURL),
_inited(false), _inited(false),
//_needanimation(false), //_needanimation(false),
...@@ -19,7 +19,7 @@ FMPePay::FMPePay(ctkPluginContext *context) ...@@ -19,7 +19,7 @@ FMPePay::FMPePay(ctkPluginContext *context)
_store_id(DEFAULT_EPAY_STRID), _store_id(DEFAULT_EPAY_STRID),
_station_id(DEFAULT_EPAY_STNID), _station_id(DEFAULT_EPAY_STNID),
_time_out(60), _time_out(60),
_ste_handler(new FMPStartEventHandler(_ctx, this)), _ste_handler(new FMPStartEventHandler(this)),
d_ptr(new FMPePayPrivate(this)) d_ptr(new FMPePayPrivate(this))
{ {
} }
......
...@@ -18,7 +18,7 @@ class FMPePay : public FMPePayInterface ...@@ -18,7 +18,7 @@ class FMPePay : public FMPePayInterface
Q_DECLARE_PRIVATE(FMPePay) Q_DECLARE_PRIVATE(FMPePay)
public: public:
explicit FMPePay(ctkPluginContext *context); explicit FMPePay(const FMPContext ctx);
virtual ~FMPePay(); virtual ~FMPePay();
void SetBasicInfo(QVariantHash hash); void SetBasicInfo(QVariantHash hash);
...@@ -28,12 +28,13 @@ public: ...@@ -28,12 +28,13 @@ public:
void DockRefundRequest(const QByteArray &json); void DockRefundRequest(const QByteArray &json);
QByteArray DockRefundRespond(); QByteArray DockRefundRespond();
protected:
const FMPContext GetContext() const { return pluginContext; }
protected slots: protected slots:
void InitService(); void InitService();
void UninitService(); void UninitService();
private: private:
bool _inited; bool _inited;
//bool _needanimation; //bool _needanimation;
...@@ -52,6 +53,7 @@ private: ...@@ -52,6 +53,7 @@ private:
int _ordershelflife; int _ordershelflife;
FMPePayPrivate* d_ptr; FMPePayPrivate* d_ptr;
const FMPContext pluginContext;
QPointer<FMPStartEventHandler> _ste_handler; QPointer<FMPStartEventHandler> _ste_handler;
}; };
......
...@@ -16,7 +16,7 @@ class FMPePayInterface : public QObject, public FMPluginInterface ...@@ -16,7 +16,7 @@ class FMPePayInterface : public QObject, public FMPluginInterface
Q_INTERFACES(FMPBaseInterface) Q_INTERFACES(FMPBaseInterface)
Q_INTERFACES(FMPluginInterface) Q_INTERFACES(FMPluginInterface)
public: public:
explicit FMPePayInterface(ctkPluginContext *ctx) : FMPluginInterface(ctx) explicit FMPePayInterface() : FMPluginInterface()
{ {
connect(this, &FMPePayInterface::TriggerInit, this, &FMPePayInterface::OnTriggerInit); connect(this, &FMPePayInterface::TriggerInit, this, &FMPePayInterface::OnTriggerInit);
connect(this, &FMPePayInterface::TriggerUninit, this, &FMPePayInterface::OnTriggerUninit); connect(this, &FMPePayInterface::TriggerUninit, this, &FMPePayInterface::OnTriggerUninit);
...@@ -35,38 +35,9 @@ signals: ...@@ -35,38 +35,9 @@ signals:
protected slots: protected slots:
void OnTriggerInit() { FMPluginInterface::OnTriggerInit(); } void OnTriggerInit() { FMPluginInterface::OnTriggerInit(); }
void OnTriggerUninit() { FMPluginInterface::OnTriggerUninit(); } void OnTriggerUninit() { FMPluginInterface::OnTriggerUninit(); }
// /**
// * @brief ShowPayDialog
// * 呈现支付主界面
// * @return
// */
// virtual int ShowPayDialog() = 0;
// /**
// * @brief ControlPayJson
// * 获取发送支付请求
// * @param sum
// * @param code
// */
// virtual void ControlPayJson(QString sum, QString code) = 0;
// /**
// * @brief ControlRefundJson
// * 获取发送退款请求
// * @param sum
// * @param code(fmID/pay_transId)
// */
// virtual void ControlRefundJson(QString sum, QString code) = 0;
// /**
// * @brief ControlReverseJson
// * 冲正
// */
// virtual void ControlReverseJson() = 0;
}; };
Q_DECLARE_INTERFACE(FMPePayInterface, "com.fmp.epay") Q_DECLARE_INTERFACE(FMPePayInterface, "fmp.epay")
#endif // FMP_LOGGER_I_H #endif // FMP_LOGGER_I_H
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
#include <QDateTime> #include <QDateTime>
#include <fmp_settings_i.h> #include <fmp_settings_i.h>
#include <QCoreApplication> #include <QCoreApplication>
#include <ctkPluginContext.h>
#include <ctkServiceReference.h> #include <ctkServiceReference.h>
#include "fmp_epay_p.h" #include "fmp_epay_p.h"
#include "fmp_epay_def.h" #include "fmp_epay_def.h"
...@@ -46,7 +45,6 @@ FMPePayPrivate::FMPePayPrivate(FMPePay *parent) ...@@ -46,7 +45,6 @@ FMPePayPrivate::FMPePayPrivate(FMPePay *parent)
_queryThread(nullptr) _queryThread(nullptr)
{ {
Q_Q(FMPePay); Q_Q(FMPePay);
FMPLoggerInterface::InitContext(q_ptr->_ctx);
_watcher = new QFutureWatcher<QByteArray>(); _watcher = new QFutureWatcher<QByteArray>();
connect( _watcher, SIGNAL( finished() ), this, SLOT( witedata() ) ); connect( _watcher, SIGNAL( finished() ), this, SLOT( witedata() ) );
...@@ -87,14 +85,25 @@ FMPePayPrivate::FMPePayPrivate(FMPePay *parent) ...@@ -87,14 +85,25 @@ FMPePayPrivate::FMPePayPrivate(FMPePay *parent)
_queryThread=new CQueryThread(this); _queryThread=new CQueryThread(this);
//读取配置文件信息 //读取配置文件信息
_setting = q->GetService<FMPSettingsInterface>(q->_ctx); QString apppath=QCoreApplication::applicationDirPath();
q->_url = _setting->GetString(FMP_INIKEY_EPAYURL); QSettings *settings = new QSettings(QString("%1/FreemudPOS.ini").arg(apppath), QSettings::IniFormat);
q->_partner_id = _setting->GetString(FMP_INIKEY_LOGINPARTNERID); q->_url = settings->value(FMP_INIKEY_EPAYURL).toString();
q->_time_out = _setting->GetInt(FMP_INIKEY_EPAYTIMEOUT); q->_partner_id = settings->value(FMP_INIKEY_LOGINPARTNERID).toString();
q->_time_out = settings->value(FMP_INIKEY_EPAYTIMEOUT).toInt();
q->_time_out = (q->_time_out > 60 ? q->_time_out : 60); q->_time_out = (q->_time_out > 60 ? q->_time_out : 60);
q->_store_id = _setting->GetString(FMP_INIKEY_LOGINSTOREID); q->_store_id = settings->value(FMP_INIKEY_LOGINSTOREID).toString();
q->_station_id = _setting->GetString(FMP_INIKEY_LOGINPOSID); q->_station_id = settings->value(FMP_INIKEY_LOGINPOSID).toString();
q->_operator_id = _setting->GetString(FMP_INIKEY_LOGINCASHIER); q->_operator_id = settings->value(FMP_INIKEY_LOGINCASHIER).toString();
delete settings;
// _setting = FMP::GetService<FMPSettingsInterface>();
// q->_url = _setting->GetString(FMP_INIKEY_EPAYURL);
// q->_partner_id = _setting->GetString(FMP_INIKEY_LOGINPARTNERID);
// q->_time_out = _setting->GetInt(FMP_INIKEY_EPAYTIMEOUT);
// q->_time_out = (q->_time_out > 60 ? q->_time_out : 60);
// q->_store_id = _setting->GetString(FMP_INIKEY_LOGINSTOREID);
// q->_station_id = _setting->GetString(FMP_INIKEY_LOGINPOSID);
// q->_operator_id = _setting->GetString(FMP_INIKEY_LOGINCASHIER);
//检查异常订单 //检查异常订单
CheckErrorOrder(); CheckErrorOrder();
...@@ -172,7 +181,7 @@ void FMPePayPrivate::Init() ...@@ -172,7 +181,7 @@ void FMPePayPrivate::Init()
if(_network == nullptr) if(_network == nullptr)
{ {
_network = q->GetService<FMPNetworkInterface>(q->_ctx); _network = FMP::GetService<FMPNetworkInterface>();
} }
if(_model == nullptr) if(_model == nullptr)
...@@ -190,9 +199,11 @@ void FMPePayPrivate::Init() ...@@ -190,9 +199,11 @@ void FMPePayPrivate::Init()
hash[FMP_EPAY_PARTNERID] = q->_partner_id; hash[FMP_EPAY_PARTNERID] = q->_partner_id;
hash[FMP_EPAY_TIMEOUT] = q->_time_out; hash[FMP_EPAY_TIMEOUT] = q->_time_out;
//更新日期
q->_businessdate=QDateTime::currentDateTime().toString("yyyy-MM-dd");
if (!_is_api) { if (!_is_api) {
hash[FMP_EPAY_ANIMATION] = _setting->GetBool(FMP_INIKEY_ANIMATION); //hash[FMP_EPAY_ANIMATION] = _setting->GetBool(FMP_INIKEY_ANIMATION);
hash[FMP_EPAY_ANIMATION] = true;
hash[FMP_EPAY_BUSINESSDATE] = q->_businessdate; hash[FMP_EPAY_BUSINESSDATE] = q->_businessdate;
hash[FMP_EPAY_STOREID] = q->_store_id; hash[FMP_EPAY_STOREID] = q->_store_id;
hash[FMP_EPAY_STATIONID] = q->_station_id; hash[FMP_EPAY_STATIONID] = q->_station_id;
...@@ -229,7 +240,7 @@ void FMPePayPrivate::Init() ...@@ -229,7 +240,7 @@ void FMPePayPrivate::Init()
} }
hash["products"] = products; hash["products"] = products;
} }
FMP_INFO() << "++++++++++++++++++request JOSN" <<hash;
_payDialog = new FMPPayDialog(this, hash); _payDialog = new FMPPayDialog(this, hash);
} }
...@@ -326,6 +337,7 @@ void FMPePayPrivate::DockRefundRequest(const QByteArray &json) ...@@ -326,6 +337,7 @@ void FMPePayPrivate::DockRefundRequest(const QByteArray &json)
{ {
_is_api = true; _is_api = true;
_origin_request = QJsonDocument::fromJson(json).object(); _origin_request = QJsonDocument::fromJson(json).object();
FMP_INFO() << "DockRefundRequest : " << _docked_request;
} }
QByteArray FMPePayPrivate::DockRefundRespond() QByteArray FMPePayPrivate::DockRefundRespond()
...@@ -588,6 +600,7 @@ void FMPePayPrivate::ControlRefundJson(const QJsonObject &trans) ...@@ -588,6 +600,7 @@ void FMPePayPrivate::ControlRefundJson(const QJsonObject &trans)
Q_Q(FMPePay); Q_Q(FMPePay);
_origin_response = QJsonObject(); _origin_response = QJsonObject();
FMP_INFO() << "RefundJson trans: " << trans;
QtConcurrent::run( [q, trans, this ]() QtConcurrent::run( [q, trans, this ]()
{ {
QStringList keylist; QStringList keylist;
...@@ -718,8 +731,8 @@ bool FMPePayPrivate::GetPayJson(const QString& sum, const QString& code) ...@@ -718,8 +731,8 @@ bool FMPePayPrivate::GetPayJson(const QString& sum, const QString& code)
products.append(o); products.append(o);
} }
transaction["products"] = products; transaction["products"] = products;
_docked_request[FMP_EPAY_STOREID] = _origin_request[FMP_EPAY_STOREID]; _docked_request[FMP_EPAY_STOREID] = q->_store_id;
_docked_request[FMP_EPAY_STATIONID] = _origin_request["pos_id"]; _docked_request[FMP_EPAY_STATIONID] = q->_station_id;
_docked_request[FMP_EPAY_OPERATORID] = _origin_request[FMP_EPAY_OPERATORID]; _docked_request[FMP_EPAY_OPERATORID] = _origin_request[FMP_EPAY_OPERATORID];
_docked_request[FMP_EPAY_BUSINESSDATE] = _origin_request[FMP_EPAY_BUSINESSDATE]; _docked_request[FMP_EPAY_BUSINESSDATE] = _origin_request[FMP_EPAY_BUSINESSDATE];
} }
...@@ -762,6 +775,7 @@ bool FMPePayPrivate::GetRefundJson(const QJsonObject &trans) ...@@ -762,6 +775,7 @@ bool FMPePayPrivate::GetRefundJson(const QJsonObject &trans)
int ver = 2; int ver = 2;
FMP_INFO() << "RefundJson trans: " << trans;
if(trans.contains(FMP_JKEY_FM_ORDERID) && !trans[FMP_JKEY_FM_ORDERID].toString().isEmpty()) if(trans.contains(FMP_JKEY_FM_ORDERID) && !trans[FMP_JKEY_FM_ORDERID].toString().isEmpty())
{ {
transaction.insert(FMP_EPAY_REFUND_TRANSTRACTION_FMID, trans[FMP_JKEY_FM_ORDERID]); transaction.insert(FMP_EPAY_REFUND_TRANSTRACTION_FMID, trans[FMP_JKEY_FM_ORDERID]);
...@@ -801,7 +815,7 @@ bool FMPePayPrivate::GetRefundJson(const QJsonObject &trans) ...@@ -801,7 +815,7 @@ bool FMPePayPrivate::GetRefundJson(const QJsonObject &trans)
_docked_request.insert( FMP_EPAY_OPERATORID, q->_operator_id); _docked_request.insert( FMP_EPAY_OPERATORID, q->_operator_id);
_docked_request.insert( FMP_EPAY_TRANSTRACTION, transactionarry); _docked_request.insert( FMP_EPAY_TRANSTRACTION, transactionarry);
} }
FMP_INFO() << "Refund Json:" << _docked_request;
return true; return true;
} }
...@@ -952,6 +966,7 @@ bool FMPePayPrivate::SendToMonitor(const QByteArray &data) ...@@ -952,6 +966,7 @@ bool FMPePayPrivate::SendToMonitor(const QByteArray &data)
result=false; result=false;
} }
client.close(); client.close();
delete[] m_pFmPackage;
return result; return result;
} }
...@@ -986,8 +1001,8 @@ void FMPePayPrivate::GetDailyBillData(QVector<PayDetail> &vecPay) ...@@ -986,8 +1001,8 @@ void FMPePayPrivate::GetDailyBillData(QVector<PayDetail> &vecPay)
QSqlQuery query; QSqlQuery query;
PayDetail pay; PayDetail pay;
//支付宝查询 //支付宝查询
if(!_db->find(q->_table, query, keylist, QString("statusCode = %1 and business_date= '%2' and pay_ebcode='%3'").arg(100).arg(q->_businessdate).arg("10001")) || !query.next()) { if(!_db->find(q->_table, query, keylist, QString("statusCode = %1 and addtime like '%2%%' and pay_ebcode='%3'").arg(100).arg(q->_businessdate).arg("10001")) || !query.next()) {
FMP_ERROR() << "查询支付数据错误!"; FMP_ERROR() << "查询支付数据错误!";
} }
else { else {
pay.name=QString::fromLocal8Bit("支付宝"); pay.name=QString::fromLocal8Bit("支付宝");
...@@ -997,8 +1012,8 @@ void FMPePayPrivate::GetDailyBillData(QVector<PayDetail> &vecPay) ...@@ -997,8 +1012,8 @@ void FMPePayPrivate::GetDailyBillData(QVector<PayDetail> &vecPay)
vecPay.push_back(pay); vecPay.push_back(pay);
} }
//微信查询 //微信查询
if(!_db->find(q->_table, query, keylist, QString("statusCode = %1 and business_date= '%2' and pay_ebcode='%3'").arg(100).arg(q->_businessdate).arg("10004")) || !query.next()) { if(!_db->find(q->_table, query, keylist, QString("statusCode = %1 and addtime like '%2%%' and pay_ebcode='%3'").arg(100).arg(q->_businessdate).arg("10004")) || !query.next()) {
FMP_ERROR() << "查询支付数据错误!"; FMP_ERROR() << "查询微信数据错误!";
} }
else { else {
pay.name=QString::fromLocal8Bit("微信"); pay.name=QString::fromLocal8Bit("微信");
...@@ -1008,8 +1023,8 @@ void FMPePayPrivate::GetDailyBillData(QVector<PayDetail> &vecPay) ...@@ -1008,8 +1023,8 @@ void FMPePayPrivate::GetDailyBillData(QVector<PayDetail> &vecPay)
vecPay.push_back(pay); vecPay.push_back(pay);
} }
//全部查询 //全部查询
if(!_db->find(q->_table, query, keylist, QString("statusCode = %1 and business_date= '%2'").arg(100).arg(q->_businessdate)) || !query.next()) { if(!_db->find(q->_table, query, keylist, QString("statusCode = %1 and addtime like '%2%%'").arg(100).arg(q->_businessdate)) || !query.next()) {
FMP_ERROR() << "查询支付数据错误!"; FMP_ERROR() << "查询全部支付数据错误!";
} }
else { else {
pay.name=QString::fromLocal8Bit("全部"); pay.name=QString::fromLocal8Bit("全部");
...@@ -1020,8 +1035,9 @@ void FMPePayPrivate::GetDailyBillData(QVector<PayDetail> &vecPay) ...@@ -1020,8 +1035,9 @@ void FMPePayPrivate::GetDailyBillData(QVector<PayDetail> &vecPay)
} }
//QString::number(json[FMP_RPAY_PAY_RETURN_TOTAL].toDouble()/100) //QString::number(json[FMP_RPAY_PAY_RETURN_TOTAL].toDouble()/100)
//未成功支付 //未成功支付
if(!_db->find(q->_table, query, keylist, QString("statusCode != %1 and business_date= '%2'").arg(100).arg(q->_businessdate)) || !query.next()) { FMP_INFO() << "未成功支付查询!";
FMP_ERROR() << "查询支付数据错误!"; if(!_db->find(q->_table, query, keylist, QString("statusCode != %1 and addtime like '%2%%'").arg(100).arg(q->_businessdate)) || !query.next()) {
FMP_ERROR() << "查询未成功支付数据错误!";
} }
else { else {
pay.name=QString::fromLocal8Bit(""); pay.name=QString::fromLocal8Bit("");
......
...@@ -748,7 +748,12 @@ void FMPPayDialog::PlayAnimation(QWidget *target0, QWidget *target1, Movemode mo ...@@ -748,7 +748,12 @@ void FMPPayDialog::PlayAnimation(QWidget *target0, QWidget *target1, Movemode mo
ui->btn_pay->setEnabled(false); ui->btn_pay->setEnabled(false);
ui->btn_refund->setEnabled(false); ui->btn_refund->setEnabled(false);
ui->btn_check->setEnabled(false); ui->btn_check->setEnabled(false);
ui->btn_waitPay->setEnabled(false);
ui->btn_errorOrder->setEnabled(false);
ui->btn_success->setEnabled(false);
ui->btn_done->setEnabled(false);
ui->btn_dailyBill->setEnabled(false);
int tg0_begin_x = 0, tg0_begin_y = 0; int tg0_begin_x = 0, tg0_begin_y = 0;
int tg0_end_x = 0, tg0_end_y = 0; int tg0_end_x = 0, tg0_end_y = 0;
...@@ -823,6 +828,11 @@ void FMPPayDialog::PlayAnimation(QWidget *target0, QWidget *target1, Movemode mo ...@@ -823,6 +828,11 @@ void FMPPayDialog::PlayAnimation(QWidget *target0, QWidget *target1, Movemode mo
ui->btn_pay->setEnabled(true); ui->btn_pay->setEnabled(true);
ui->btn_refund->setEnabled(true); ui->btn_refund->setEnabled(true);
ui->btn_check->setEnabled(true); ui->btn_check->setEnabled(true);
ui->btn_waitPay->setEnabled(true);
ui->btn_errorOrder->setEnabled(true);
ui->btn_success->setEnabled(true);
ui->btn_done->setEnabled(true);
ui->btn_dailyBill->setEnabled(true);
} }
//确定按钮 //确定按钮
...@@ -973,7 +983,7 @@ void FMPPayDialog::on_pushButton_2_clicked() ...@@ -973,7 +983,7 @@ void FMPPayDialog::on_pushButton_2_clicked()
_wait->SetContent(FMPPayWait::LOADING, QString::fromLocal8Bit("退款中...")); _wait->SetContent(FMPPayWait::LOADING, QString::fromLocal8Bit("退款中..."));
QJsonObject trans; QJsonObject trans;
trans["refund_amount"] = ((int)model->data(idx.sibling(idx.row(), 6)).toDouble() + 0.005) * 100; trans["refund_amount"] = (int)((model->data(idx.sibling(idx.row(), 6)).toDouble() + 0.005) * 100);
trans["fm_id"] = model->data(idx.sibling(idx.row(),0)).toString(); trans["fm_id"] = model->data(idx.sibling(idx.row(),0)).toString();
_control->ControlRefundJson(trans); _control->ControlRefundJson(trans);
...@@ -1064,7 +1074,7 @@ void FMPPayDialog::setShowFunc() ...@@ -1064,7 +1074,7 @@ void FMPPayDialog::setShowFunc()
} }
else{ else{
ui->btn_pay->setVisible(false); ui->btn_pay->setVisible(false);
ui->btn_check->setVisible(false); ui->btn_check->setVisible(true);
ui->btn_refund->setVisible(false); ui->btn_refund->setVisible(false);
ui->btn_waitPay->setVisible(true); ui->btn_waitPay->setVisible(true);
ui->btn_errorOrder->setVisible(true); ui->btn_errorOrder->setVisible(true);
......
...@@ -769,7 +769,7 @@ QScrollBar::add-page:vertical,QScrollBar::sub-page:vertical ...@@ -769,7 +769,7 @@ QScrollBar::add-page:vertical,QScrollBar::sub-page:vertical
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>395</height> <height>420</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
...@@ -790,19 +790,19 @@ QScrollBar::add-page:vertical,QScrollBar::sub-page:vertical ...@@ -790,19 +790,19 @@ QScrollBar::add-page:vertical,QScrollBar::sub-page:vertical
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>628</width> <width>628</width>
<height>405</height> <height>420</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>628</width> <width>628</width>
<height>405</height> <height>420</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>628</width> <width>628</width>
<height>405</height> <height>420</height>
</size> </size>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
...@@ -1517,19 +1517,19 @@ QPushButton:hover { ...@@ -1517,19 +1517,19 @@ QPushButton:hover {
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>628</width> <width>628</width>
<height>405</height> <height>420</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>628</width> <width>628</width>
<height>405</height> <height>420</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>628</width> <width>628</width>
<height>405</height> <height>420</height>
</size> </size>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
...@@ -2816,19 +2816,19 @@ border:0px</string> ...@@ -2816,19 +2816,19 @@ border:0px</string>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>628</width> <width>628</width>
<height>405</height> <height>420</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>628</width> <width>628</width>
<height>405</height> <height>420</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>628</width> <width>628</width>
<height>405</height> <height>420</height>
</size> </size>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
...@@ -3082,9 +3082,15 @@ QHeaderView::section { ...@@ -3082,9 +3082,15 @@ QHeaderView::section {
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>626</width> <width>626</width>
<height>405</height> <height>420</height>
</rect> </rect>
</property> </property>
<property name="minimumSize">
<size>
<width>0</width>
<height>420</height>
</size>
</property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">background-color: rgb(255, 255, 255);</string> <string notr="true">background-color: rgb(255, 255, 255);</string>
</property> </property>
...@@ -3094,7 +3100,7 @@ QHeaderView::section { ...@@ -3094,7 +3100,7 @@ QHeaderView::section {
<x>0</x> <x>0</x>
<y>52</y> <y>52</y>
<width>621</width> <width>621</width>
<height>321</height> <height>361</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
...@@ -3238,9 +3244,15 @@ QHeaderView::section { ...@@ -3238,9 +3244,15 @@ QHeaderView::section {
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>628</width> <width>628</width>
<height>405</height> <height>420</height>
</rect> </rect>
</property> </property>
<property name="minimumSize">
<size>
<width>0</width>
<height>420</height>
</size>
</property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">background-color: rgb(255, 255, 255);</string> <string notr="true">background-color: rgb(255, 255, 255);</string>
</property> </property>
...@@ -3250,7 +3262,7 @@ QHeaderView::section { ...@@ -3250,7 +3262,7 @@ QHeaderView::section {
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>628</width> <width>628</width>
<height>405</height> <height>411</height>
</rect> </rect>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
...@@ -3288,9 +3300,15 @@ QHeaderView::section { ...@@ -3288,9 +3300,15 @@ QHeaderView::section {
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>628</width> <width>628</width>
<height>405</height> <height>420</height>
</rect> </rect>
</property> </property>
<property name="minimumSize">
<size>
<width>0</width>
<height>420</height>
</size>
</property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">background-color: rgb(255, 255, 255);</string> <string notr="true">background-color: rgb(255, 255, 255);</string>
</property> </property>
...@@ -3300,7 +3318,7 @@ QHeaderView::section { ...@@ -3300,7 +3318,7 @@ QHeaderView::section {
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>628</width> <width>628</width>
<height>363</height> <height>421</height>
</rect> </rect>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
...@@ -3338,9 +3356,15 @@ QHeaderView::section { ...@@ -3338,9 +3356,15 @@ QHeaderView::section {
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>628</width> <width>628</width>
<height>405</height> <height>420</height>
</rect> </rect>
</property> </property>
<property name="minimumSize">
<size>
<width>0</width>
<height>420</height>
</size>
</property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">background-color: rgb(255, 255, 255);</string> <string notr="true">background-color: rgb(255, 255, 255);</string>
</property> </property>
...@@ -3350,7 +3374,7 @@ QHeaderView::section { ...@@ -3350,7 +3374,7 @@ QHeaderView::section {
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>661</width> <width>661</width>
<height>401</height> <height>421</height>
</rect> </rect>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
...@@ -3388,9 +3412,15 @@ QHeaderView::section { ...@@ -3388,9 +3412,15 @@ QHeaderView::section {
<x>5</x> <x>5</x>
<y>10</y> <y>10</y>
<width>631</width> <width>631</width>
<height>381</height> <height>420</height>
</rect> </rect>
</property> </property>
<property name="minimumSize">
<size>
<width>0</width>
<height>420</height>
</size>
</property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">background-color: rgb(255, 255, 255);</string> <string notr="true">background-color: rgb(255, 255, 255);</string>
</property> </property>
...@@ -3488,15 +3518,15 @@ QHeaderView::section { ...@@ -3488,15 +3518,15 @@ QHeaderView::section {
</property> </property>
</widget> </widget>
</widget> </widget>
<zorder>wdg_errorPay_main</zorder>
<zorder>wdg_refund_main</zorder> <zorder>wdg_refund_main</zorder>
<zorder>wdg_hasPay_main</zorder>
<zorder>wdg_query_main</zorder> <zorder>wdg_query_main</zorder>
<zorder>wdg_waitPay_main</zorder>
<zorder>wdg_pay_main</zorder> <zorder>wdg_pay_main</zorder>
<zorder>wdg_done_main</zorder>
<zorder>wdg_dailyBill_main</zorder> <zorder>wdg_dailyBill_main</zorder>
<zorder>wdg_waitPay_main</zorder>
<zorder>wdg_success_main</zorder> <zorder>wdg_success_main</zorder>
<zorder>wdg_hasPay_main</zorder>
<zorder>wdg_errorPay_main</zorder>
<zorder>wdg_done_main</zorder>
</widget> </widget>
</item> </item>
<item> <item>
......
...@@ -2,14 +2,12 @@ ...@@ -2,14 +2,12 @@
#include "fmp_pe_handlers.h" #include "fmp_pe_handlers.h"
#include "fmp_epay.h" #include "fmp_epay.h"
FMPStartEventHandler::FMPStartEventHandler(ctkPluginContext *ctx, FMPePay *epay) FMPStartEventHandler::FMPStartEventHandler(FMPePay *epay)
: FMPePayEventHandler(FMP_TOPICS_SERVICES FMPE_SERVICE_ACK_START "/" : FMPePayEventHandler(FMP_TOPICS_SERVICES FMPE_SERVICE_ACK_START "/" + QString::number(epay->GetPluginId()), epay)
+ QString::number(ctx->getPlugin()->getPluginId()), epay),
_ctx(ctx)
{ {
FMPProps props; FMPProps props;
props[ctkEventConstants::EVENT_TOPIC] = _topic; props[ctkEventConstants::EVENT_TOPIC] = _topic;
_ctx->registerService<ctkEventHandler>(this, props); FMP::RegisterService<ctkEventHandler>(this, props);
} }
...@@ -30,14 +28,12 @@ void FMPStartEventHandler::handleEvent(const ctkEvent &event) ...@@ -30,14 +28,12 @@ void FMPStartEventHandler::handleEvent(const ctkEvent &event)
} }
FMPNetWorkEventHandler::FMPNetWorkEventHandler(ctkPluginContext *ctx, FMPePay *epay) FMPNetWorkEventHandler::FMPNetWorkEventHandler(FMPePay *epay)
: FMPePayEventHandler(FMP_TOPICS_SERVICES FMPE_SERVICE_ACK_START "/" : FMPePayEventHandler(FMP_TOPICS_SERVICES FMPE_SERVICE_ACK_START "/" + QString::number(epay->GetPluginId()), epay)
+ QString::number(ctx->getPlugin()->getPluginId()), epay),
_ctx(ctx)
{ {
FMPProps props; FMPProps props;
props[ctkEventConstants::EVENT_TOPIC] = _topic; props[ctkEventConstants::EVENT_TOPIC] = _topic;
_ctx->registerService<ctkEventHandler>(this, props); FMP::RegisterService<ctkEventHandler>(this, props);
} }
......
...@@ -27,11 +27,8 @@ class FMPStartEventHandler : public QObject, public FMPePayEventHandler ...@@ -27,11 +27,8 @@ class FMPStartEventHandler : public QObject, public FMPePayEventHandler
Q_OBJECT Q_OBJECT
Q_INTERFACES(ctkEventHandler) Q_INTERFACES(ctkEventHandler)
public: public:
explicit FMPStartEventHandler(ctkPluginContext *ctx, FMPePay *epay); explicit FMPStartEventHandler(FMPePay *epay);
void handleEvent(const ctkEvent &event); void handleEvent(const ctkEvent &event);
private:
ctkPluginContext* _ctx;
}; };
...@@ -44,11 +41,8 @@ class FMPNetWorkEventHandler : public QObject, public FMPePayEventHandler ...@@ -44,11 +41,8 @@ class FMPNetWorkEventHandler : public QObject, public FMPePayEventHandler
Q_OBJECT Q_OBJECT
Q_INTERFACES(ctkEventHandler) Q_INTERFACES(ctkEventHandler)
public: public:
explicit FMPNetWorkEventHandler(ctkPluginContext *ctx, FMPePay *epay); explicit FMPNetWorkEventHandler(FMPePay *epay);
void handleEvent(const ctkEvent &event); void handleEvent(const ctkEvent &event);
private:
ctkPluginContext* _ctx;
}; };
#endif // FMP_MANAGER_EVENT_HANDLERS_H #endif // FMP_MANAGER_EVENT_HANDLERS_H
...@@ -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 16 #define VER_BUILD 17
//! Convert version numbers to string //! Convert version numbers to string
#define _STR(S) #S #define _STR(S) #S
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment