Commit c51d56e9 by 刘帅

支持上线浦发银行券

parent 8c451a96
...@@ -16,8 +16,3 @@ ...@@ -16,8 +16,3 @@
[submodule "fmp_printer"] [submodule "fmp_printer"]
path = fmp_printer path = fmp_printer
url = git@git.oschina.net:kong__mo/fmp_printer.git url = git@git.oschina.net:kong__mo/fmp_printer.git
[submodule "fmp_coupon"]
path = fmp_coupon
url = git@gitlab.freemud.com:gujin.wang/fmp_coupon.git
Subproject commit 5da0cec7ac3e369d63f6b5b384124bd90e850808
fmp_epay @ e65e6b51
Subproject commit 96735c51448644c6ac421c3ccb8e022a8fbf4997 Subproject commit e65e6b51182eecea81aff8b52887d68d2d0770e3
fmp_home @ ae117074
Subproject commit e32c00d448c4366d6b103a83db400fce36853787 Subproject commit ae1170745403d24c3d1cbd1ce5bd418732b02075
...@@ -41,7 +41,7 @@ bool ConsumptionDialog::ShowForUnConsum(const QString& act_name, double face_amo ...@@ -41,7 +41,7 @@ bool ConsumptionDialog::ShowForUnConsum(const QString& act_name, double face_amo
return false; return false;
} }
bool ConsumptionDialog::ShowForHasConsum(const QString& act_name, const QString& code_name, const QString& time_name, const QString& coupon, QWidget *parent) bool ConsumptionDialog::ShowForHasConsum(const QString& act_name, const QString channel, const QString& code_name, const QString& time_name, const QString& coupon, QWidget *parent)
{ {
ConsumptionDialog v(parent); ConsumptionDialog v(parent);
// v.setGeometry( 0,0,350,470); // v.setGeometry( 0,0,350,470);
...@@ -53,7 +53,7 @@ bool ConsumptionDialog::ShowForHasConsum(const QString& act_name, const QString& ...@@ -53,7 +53,7 @@ bool ConsumptionDialog::ShowForHasConsum(const QString& act_name, const QString&
v.ui->btnConsumption->setStyleSheet( v.ui->btnConsumption->styleSheet()); v.ui->btnConsumption->setStyleSheet( v.ui->btnConsumption->styleSheet());
v.ui->btnConsumption->setEnabled( false); v.ui->btnConsumption->setEnabled( false);
v.setData( act_name,code_name ,time_name,coupon ); v.setData( act_name,channel, code_name ,time_name,coupon );
v.ui->labActName->setStyleSheet("color:white;"); v.ui->labActName->setStyleSheet("color:white;");
if( v.exec() == QDialog::Accepted){ if( v.exec() == QDialog::Accepted){
return true; return true;
...@@ -105,12 +105,13 @@ void ConsumptionDialog::HideForWaiting() ...@@ -105,12 +105,13 @@ void ConsumptionDialog::HideForWaiting()
reject(); reject();
} }
void ConsumptionDialog::setData(const QString& act_name, const QString& code_name, const QString& time_name, const QString& coupon) void ConsumptionDialog::setData(const QString& act_name, const QString channel, const QString& code_name, const QString& time_name, const QString& coupon)
{ {
ui->labCode->setText( coupon); ui->labCode->setText( coupon);
ui->labCodeName->setAlignment(Qt::AlignCenter); ui->labCodeName->setAlignment(Qt::AlignCenter);
ui->actualAmount->hide(); ui->actualAmount->hide();
ui->ebname->hide(); ui->ebname->setText(QString::fromLocal8Bit("渠道: ") + channel);
//ui->ebname->hide();
ui->labCodeName->setText( code_name); ui->labCodeName->setText( code_name);
ui->labActName->setText( act_name); ui->labActName->setText( act_name);
ui->labTime->setText( time_name); ui->labTime->setText( time_name);
......
...@@ -18,10 +18,10 @@ public: ...@@ -18,10 +18,10 @@ public:
explicit ConsumptionDialog(QWidget * parent = 0, Qt::WindowFlags f = 0); explicit ConsumptionDialog(QWidget * parent = 0, Qt::WindowFlags f = 0);
~ConsumptionDialog(); ~ConsumptionDialog();
void setData(const QString& act_name, const QString& code_name, const QString& time_name, const QString& coupon); void setData(const QString& act_name, const QString channel, const QString& code_name, const QString& time_name, const QString& coupon);
void setData(const QString &act_name, double face_amount, double actual_amount, const QString& eb_name, const QString& time_name, const QString& coupon); void setData(const QString &act_name, double face_amount, double actual_amount, const QString& eb_name, const QString& time_name, const QString& coupon);
static bool ShowForUnConsum(const QString &act_name, double face_amount, double actual_amount, const QString& eb_name, const QString& time_name, const QString& coupon, QWidget *parent = 0); static bool ShowForUnConsum(const QString &act_name, double face_amount, double actual_amount, const QString& eb_name, const QString& time_name, const QString& coupon, QWidget *parent = 0);
static bool ShowForHasConsum(const QString& act_name, const QString& code_name, const QString& time_name, const QString& coupon, QWidget *parent = 0); static bool ShowForHasConsum(const QString& act_name, const QString channel, const QString& code_name, const QString& time_name, const QString& coupon, QWidget *parent = 0);
void ShowForWaiting(QString context, QString coupon, QWidget *parent = 0); void ShowForWaiting(QString context, QString coupon, QWidget *parent = 0);
void HideForWaiting(); void HideForWaiting();
......
...@@ -197,6 +197,9 @@ ...@@ -197,6 +197,9 @@
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget> </widget>
<widget class="QLabel" name="labTime"> <widget class="QLabel" name="labTime">
<property name="geometry"> <property name="geometry">
......
...@@ -55,7 +55,7 @@ void ErrCodeDialog::showForExpird(const QString& act_name, const QString& code_n ...@@ -55,7 +55,7 @@ void ErrCodeDialog::showForExpird(const QString& act_name, const QString& code_n
v.exec(); v.exec();
} }
void ErrCodeDialog::showForErr(const QString& coupon, const QString& mess, QWidget *parent) void ErrCodeDialog::showForErr(const QString& coupon, const QString& mess, const QString channel, QWidget *parent)
{ {
ErrCodeDialog v(parent); ErrCodeDialog v(parent);
// v.setGeometry( 0,0,350,470); // v.setGeometry( 0,0,350,470);
...@@ -67,15 +67,20 @@ void ErrCodeDialog::showForErr(const QString& coupon, const QString& mess, QWidg ...@@ -67,15 +67,20 @@ void ErrCodeDialog::showForErr(const QString& coupon, const QString& mess, QWidg
v.ui->labChannel->setVisible( true); v.ui->labChannel->setVisible( true);
//100 -> 浦发银行 //100 -> 浦发银行
//88 -> 交通银行 //88 -> 交通银行
QString channel; QString finalChannel = channel;
if(coupon.left(3) == "100" && coupon.length()==12) int index = channel.indexOf("-");
channel = QString::fromLocal8Bit("浦发银行"); if( index != -1)
else if(coupon.left(2) == "88" && coupon.length()==12) {
channel = QString::fromLocal8Bit("交通银行"); finalChannel = channel.left(index);
else }
channel = QString::fromLocal8Bit("未知"); // if(coupon.left(3) == "100" && coupon.length()==12)
// channel = QString::fromLocal8Bit("浦发银行");
// else if(coupon.left(2) == "88" && coupon.length()==12)
// channel = QString::fromLocal8Bit("交通银行");
// else
// channel = QString::fromLocal8Bit("未知");
v.ui->labChannel->setText(QString::fromLocal8Bit("渠道: ") + channel); v.ui->labChannel->setText(QString::fromLocal8Bit("渠道: ") + finalChannel);
v.ui->labActName->setVisible( true); v.ui->labActName->setVisible( true);
v.ui->labCode->setText(coupon ); v.ui->labCode->setText(coupon );
...@@ -102,4 +107,4 @@ void ErrCodeDialog::showForErr(const QString& coupon, const QString& mess, QWidg ...@@ -102,4 +107,4 @@ void ErrCodeDialog::showForErr(const QString& coupon, const QString& mess, QWidg
v.ui->labActName->setStyleSheet("color:white;"); v.ui->labActName->setStyleSheet("color:white;");
v.exec(); v.exec();
} }
\ No newline at end of file
...@@ -17,7 +17,7 @@ public: ...@@ -17,7 +17,7 @@ public:
static void showForInvalid(const QString& coupon, QWidget *parent = 0); static void showForInvalid(const QString& coupon, QWidget *parent = 0);
static void showForExpird(const QString& act_name, const QString& code_name, const QString& time_name, const QString& coupon, QWidget *parent = 0); static void showForExpird(const QString& act_name, const QString& code_name, const QString& time_name, const QString& coupon, QWidget *parent = 0);
static void showForErr(const QString& coupon, const QString& mess, QWidget *parent = 0); static void showForErr(const QString& coupon, const QString& mess, const QString channel, QWidget *parent = 0);
private: private:
Ui::ErrCodeDialog *ui; Ui::ErrCodeDialog *ui;
......
...@@ -297,10 +297,22 @@ QJsonObject FMPRedeem::ShowForUnConsum(QJsonObject json) ...@@ -297,10 +297,22 @@ QJsonObject FMPRedeem::ShowForUnConsum(QJsonObject json)
QString ebcode = codeInfo["ebcode"].toString(); QString ebcode = codeInfo["ebcode"].toString();
QString ebname = codeInfo["ebname"].toString(); QString ebname = codeInfo["ebname"].toString();
QString channel = json["channel"].toString(); QString channel = json["channel"].toString();
QString fullChannel = json["channel"].toString();
int index = fullChannel.indexOf("-");
if( index != -1)
{
channel = fullChannel.left(index);
}
double realAmount = codeInfo["amount"].toInt()/100.0; // 面值 double realAmount = codeInfo["amount"].toInt()/100.0; // 面值
if(coupon.trimmed().length() == 9 || coupon.trimmed().length() == 15) //非码券
{
realAmount = codeInfo["originalPrice"].toInt()/100.0; // 面值
}
double amount = codeInfo["paid"].toInt()/100.0; //实付 double amount = codeInfo["paid"].toInt()/100.0; //实付
QString time_name = QString::fromLocal8Bit("有效期至: ").append(QDate::fromString(vdata, "yyyyMMdd").toString("yyyy-MM-dd")); QString time_name = QString::fromLocal8Bit("有效期至: ").append(QDate::fromString(vdata, "yyyyMMdd").toString("yyyy-MM-dd"));
//UNUSED(time_name);
int couponType = json["couponType"].toInt(); int couponType = json["couponType"].toInt();
if( ConsumptionDialog::ShowForUnConsum(act_name, realAmount, amount, channel, "", coupon)) if( ConsumptionDialog::ShowForUnConsum(act_name, realAmount, amount, channel, "", coupon))
{ {
...@@ -382,7 +394,7 @@ QJsonObject FMPRedeem::ShowForUnConsum(QJsonObject json) ...@@ -382,7 +394,7 @@ QJsonObject FMPRedeem::ShowForUnConsum(QJsonObject json)
} }
break; break;
default: default:
ErrCodeDialog::showForErr(coupon, msg); ErrCodeDialog::showForErr(coupon, msg, retJson["channel"].toString());
break; break;
} }
redeemResult["statusCode"] = retJson["statusCode"]; redeemResult["statusCode"] = retJson["statusCode"];
...@@ -400,7 +412,7 @@ QJsonObject FMPRedeem::ShowForUnConsum(QJsonObject json) ...@@ -400,7 +412,7 @@ QJsonObject FMPRedeem::ShowForUnConsum(QJsonObject json)
QJsonObject FMPRedeem::ShowForHasConsum(QJsonObject json) QJsonObject FMPRedeem::ShowForHasConsum(QJsonObject json)
{ {
ConsumptionDialog::ShowForHasConsum(json["msg"].toString(), "", "", _coupon); ConsumptionDialog::ShowForHasConsum(json["msg"].toString(), json["channel"].toString(), "", "", _coupon);
return json; return json;
} }
...@@ -419,7 +431,7 @@ QJsonObject FMPRedeem::ShowForExpird(QJsonObject json) ...@@ -419,7 +431,7 @@ QJsonObject FMPRedeem::ShowForExpird(QJsonObject json)
QJsonObject FMPRedeem::ShowForErr(QJsonObject json) QJsonObject FMPRedeem::ShowForErr(QJsonObject json)
{ {
QString msg = json["msg"].toString(); QString msg = json["msg"].toString();
ErrCodeDialog::showForErr(_coupon, msg); ErrCodeDialog::showForErr(_coupon, msg, json["channel"].toString());
return json; return json;
} }
...@@ -509,5 +521,10 @@ void FMPRedeem::LoadStoreInfo() ...@@ -509,5 +521,10 @@ void FMPRedeem::LoadStoreInfo()
_operator_id = settings.value(FMP_INIKEY_LOGINCASHIER).toString(); _operator_id = settings.value(FMP_INIKEY_LOGINCASHIER).toString();
_redeem_url = settings.value(FMP_INIKEY_EPAYURL).toString(); _redeem_url = settings.value(FMP_INIKEY_EPAYURL).toString();
_redeem_log_url = settings.value(FMP_INIKEY_REDEEM_LOG).toString(); _redeem_log_url = settings.value(FMP_INIKEY_REDEEM_LOG).toString();
_partner_id = settings.value(FMP_INIKEY_LOGINPARTNERID).toInt(); //_partner_id = settings.value(FMP_INIKEY_LOGINPARTNERID).toInt();
QSettings urlSettings(QString("%1/server_url.ini").arg(apppath), QSettings::IniFormat);
_redeem_url = urlSettings.value(FMP_INIKEY_EPAYURL).toString();
_redeem_log_url = urlSettings.value(FMP_INIKEY_REDEEM_LOG).toString();
_partner_id = urlSettings.value(FMP_INIKEY_LOGINPARTNERID).toInt();
} }
...@@ -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 90 #define VER_BUILD 91
//! Convert version numbers to string //! Convert version numbers to string
#define _STR(S) #S #define _STR(S) #S
......
...@@ -23,12 +23,12 @@ CashierId=001 ...@@ -23,12 +23,12 @@ CashierId=001
ShowStoreInfo=0 ShowStoreInfo=0
[Pay] [Pay]
Server="http://115.159.119.32:27935/api?partner=yhdw" Server="http://115.159.119.32:27939/api?partner=yhdw"
Timeout=60 Timeout=60
[Coupon] [Coupon]
Server=http://115.159.142.32/api Server=http://115.159.142.32/api
RedeemLog=http://115.159.119.32:27935/getRedeemLog RedeemLog=http://115.159.119.32:27939/getRedeemLog
[Vip] [Vip]
Server=http://member.freemudorder.com/member_today/service/restful/pos Server=http://member.freemudorder.com/member_today/service/restful/pos
...@@ -57,7 +57,7 @@ Entryurl= ...@@ -57,7 +57,7 @@ Entryurl=
Entryport= Entryport=
[Printer] [Printer]
Name=Send To OneNote 16 Name=Send To OneNote 2016
Mode=2 Mode=2
PaperWidth=80 PaperWidth=80
type=4 type=4
......
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