Commit 42c4ceaf by guanghui.cui

退单、状态变更实现

parent bbce0280
...@@ -183,7 +183,7 @@ std::string JsonModule::convertToNewOrderJson(orderObj &obj) ...@@ -183,7 +183,7 @@ std::string JsonModule::convertToNewOrderJson(orderObj &obj)
writer.StartObject(); writer.StartObject();
writer.Key("fm_cmd"); writer.Key("fm_cmd");
writer.Int(obj.fm_cmd); writer.Int(REQUEST_TYPE_NEWORDER_PUSH);
writer.Key("channel"); writer.Key("channel");
writer.String(obj.channel.c_str()); writer.String(obj.channel.c_str());
...@@ -465,7 +465,7 @@ std::string JsonModule::convertToOrderStatusJson(orderStatusObj &obj) ...@@ -465,7 +465,7 @@ std::string JsonModule::convertToOrderStatusJson(orderStatusObj &obj)
writer.StartObject(); writer.StartObject();
writer.Key("fm_cmd"); writer.Key("fm_cmd");
writer.Int(obj.fm_cmd); writer.Int(REQUEST_TYPE_STATUS_CHANGE);
writer.Key("order_id"); writer.Key("order_id");
writer.String(obj.order_id.c_str()); writer.String(obj.order_id.c_str());
...@@ -488,7 +488,7 @@ std::string JsonModule::convertToRefundJson(refundObj &obj) ...@@ -488,7 +488,7 @@ std::string JsonModule::convertToRefundJson(refundObj &obj)
writer.StartObject(); writer.StartObject();
writer.Key("fm_cmd"); writer.Key("fm_cmd");
writer.Int(obj.fm_cmd); writer.Int(REQUEST_TYPE_REFUND);
writer.Key("channel"); writer.Key("channel");
writer.String(obj.channel.c_str()); writer.String(obj.channel.c_str());
...@@ -578,7 +578,7 @@ std::string JsonModule::convertToStockWarnJson(stockWarnObj &obj) ...@@ -578,7 +578,7 @@ std::string JsonModule::convertToStockWarnJson(stockWarnObj &obj)
writer.StartObject(); writer.StartObject();
writer.Key("fm_cmd"); writer.Key("fm_cmd");
writer.Int(obj.fm_cmd); writer.Int(REQUEST_TYPE_STOCK_WARN);
//----------------商品信息---------------- //----------------商品信息----------------
writer.Key("products"); writer.Key("products");
...@@ -684,4 +684,18 @@ int JsonModule::_getPOSOrderStatus(int status) ...@@ -684,4 +684,18 @@ int JsonModule::_getPOSOrderStatus(int status)
break; break;
} }
return rltStatus; return rltStatus;
} }
\ No newline at end of file
void JsonModule::getStatusObj(IN orderObj &order_obj,OUT orderStatusObj &status_obj)
{
status_obj.order_id=order_obj.order_id;
status_obj.order_status=order_obj.status;
status_obj.delivery_status=order_obj.deliveryInfo.status;
}
void JsonModule::getRefundObj(IN orderObj &order_obj,OUT refundObj &refund_obj)
{
refund_obj.order_id=order_obj.order_id;
refund_obj.channel=order_obj.channel;
refund_obj.refund_amount=order_obj.total_price;
}
...@@ -19,6 +19,8 @@ public: ...@@ -19,6 +19,8 @@ public:
std::string convertToRefundJson(refundObj &obj); std::string convertToRefundJson(refundObj &obj);
std::string convertToStockWarnJson(stockWarnObj &obj); std::string convertToStockWarnJson(stockWarnObj &obj);
void getStatusObj(IN orderObj &order_obj,OUT orderStatusObj &status_obj);
void getRefundObj(IN orderObj &order_obj,OUT refundObj &refund_obj);
private: private:
std::string _getDeliveryTypeString(int type); std::string _getDeliveryTypeString(int type);
//订单状态转换(转换为POS对应的状态) //订单状态转换(转换为POS对应的状态)
......
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