Commit 7c692847 by gujin.wang

添加退款功能

parent ed18036b
...@@ -32,8 +32,8 @@ enum FM_TYPE { ...@@ -32,8 +32,8 @@ enum FM_TYPE {
FM_Order_Revoke, FM_Order_Revoke,
FM_QR_Pay = 10031, FM_QR_Pay = 10031,
FM_QR_Refund = 10041, FM_QR_Refund = 10041,
FM_Refund_Pay, FM_Refund_Pay = 1004,
FM_Refund_Order FM_Refund_Order = 1005
}; };
enum Member_Type { enum Member_Type {
...@@ -256,21 +256,8 @@ const PropsMap::value_type PropsMapPairs[] = ...@@ -256,21 +256,8 @@ const PropsMap::value_type PropsMapPairs[] =
PropsMap::value_type(PosProps.ConsumeNum, "consumeNum"), PropsMap::value_type(PosProps.ConsumeNum, "consumeNum"),
}; };
static PropsMap PosToServerProps(PropsMapPairs, PropsMapPairs + (sizeof(PropsMapPairs)/sizeof(PropsMapPairs[0]))); static PropsMap PosToServerProps(PropsMapPairs, PropsMapPairs + (sizeof(PropsMapPairs)/sizeof(PropsMapPairs[0])));
class FMPropsMap
{
public:
static QString get(QString posProp) {
PropsMap::iterator it = PosToServerProps.find(posProp);
if(it != PosToServerProps.end()) {
return it->second;
}
return posProp;
}
};
#endif #endif
#define ServerProps(posProp) PosToServerProps.find(posProp) == PosToServerProps.end() ? posProp : PosToServerProps[posProp]
#define ServerProps(posProp) FMPropsMap::get(posProp)
// 签名字段 // 签名字段
const static QString SignProps[] = { const static QString SignProps[] = {
...@@ -333,10 +320,7 @@ const FMErrorMap fm_error(fm_error_pairs, fm_error_pairs + (sizeof fm_error_pair ...@@ -333,10 +320,7 @@ const FMErrorMap fm_error(fm_error_pairs, fm_error_pairs + (sizeof fm_error_pair
#endif #endif
#define AppDirPath qApp->applicationDirPath() #define AppDirPath qApp->applicationDirPath()
#define QuitCMD "{\"reqType\":-1}" #define QuitCMD "{\"reqType\":-1}"
#endif // GLOBAL_H #endif // GLOBAL_H
...@@ -14,15 +14,6 @@ TaskFinal::TaskFinal(QJsonObject &jsonObj, Session *session, QObject *parent) ...@@ -14,15 +14,6 @@ TaskFinal::TaskFinal(QJsonObject &jsonObj, Session *session, QObject *parent)
{ {
} }
QByteArray TaskFinal::doTask()
{
serverReqJsonObj = posReqJsonObj;
sendToServer(false);
packagePOSRsp();
QJsonDocument json(posRspJsonObj);
return json.toJson(QJsonDocument::Compact);
}
void TaskFinal::packageServerReq() void TaskFinal::packageServerReq()
{ {
isUseVipPay = false; isUseVipPay = false;
......
...@@ -7,7 +7,6 @@ class TaskFinal : public FMTaskNoWnd ...@@ -7,7 +7,6 @@ class TaskFinal : public FMTaskNoWnd
Q_OBJECT Q_OBJECT
public: public:
explicit TaskFinal(QJsonObject &jsonObj, Session *session = 0, QObject *parent = 0); explicit TaskFinal(QJsonObject &jsonObj, Session *session = 0, QObject *parent = 0);
virtual QByteArray doTask();
void packageServerReq(); void packageServerReq();
bool sendToServer(bool isShowMsg = true); bool sendToServer(bool isShowMsg = true);
void packagePOSRsp(); void packagePOSRsp();
......
...@@ -42,21 +42,6 @@ void TaskCoupon::packagePOSRsp() ...@@ -42,21 +42,6 @@ void TaskCoupon::packagePOSRsp()
int type = couponOb[ServerProps(PosProps.Coupon_type)].toInt(); int type = couponOb[ServerProps(PosProps.Coupon_type)].toInt();
QString limitTime = couponOb["expiration_date"].toString(); QString limitTime = couponOb["expiration_date"].toString();
// double disAmount = qRound((1-amount)*canDisAmount/100);
// if(amount<1) // 折扣券
// {
// Coupon c(desc, code, "discount", disAmount , 0, limitTime, false);
// c.setDiscountFactor(amount*10);
// QVariant v;
// v.setValue(c);
// couponMap[code] = v;
// } else {
// Coupon c(desc, code, QString::number(type), amount, 0, limitTime, false);
// QVariant v;
// v.setValue(c);
// couponMap[code] = v;
// }
Coupon c(desc, code, QString::number(type), amount, 0, limitTime, true); Coupon c(desc, code, QString::number(type), amount, 0, limitTime, true);
QVariant v; QVariant v;
v.setValue(c); v.setValue(c);
......
...@@ -153,7 +153,10 @@ void FMVipOrder::onSelectionChanged(const QItemSelection &selected, const QItemS ...@@ -153,7 +153,10 @@ void FMVipOrder::onSelectionChanged(const QItemSelection &selected, const QItemS
orderInfo->selectCouponMap.remove(coupon.code()); orderInfo->selectCouponMap.remove(coupon.code());
orderInfo->setMaxDisAmount(orderInfo->getMaxDisAmount() + coupon.limitAmount()); orderInfo->setMaxDisAmount(orderInfo->getMaxDisAmount() + coupon.limitAmount());
} }
orderInfo->enoughCoupon(); if(orderInfo->enoughCoupon())
{
FMMsgWnd::WarningWnd(QString::fromLocal8Bit("已超出待付金额"), this);
}
oldPayText = DOUBLE_STR(orderInfo->getMaxWillPay()); oldPayText = DOUBLE_STR(orderInfo->getMaxWillPay());
setWillPayText(); setWillPayText();
} }
......
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