Commit 7a24dcb1 by 宋毅

tj

parent cf5e78ae
...@@ -29,15 +29,20 @@ class OrderAPI extends APIBase { ...@@ -29,15 +29,20 @@ class OrderAPI extends APIBase {
opResult = await this.addOrder(pobj, pobj.actionBody); opResult = await this.addOrder(pobj, pobj.actionBody);
await this.pushOrder(opResult, pobj, pobj.actionBody); await this.pushOrder(opResult, pobj, pobj.actionBody);
break; break;
case "getOrderInfo"://获取订单信息 case "getOrderInfo"://获取订单列表信息
opResult = await this.orderinfoSve.getOrderInfo(pobj, pobj.actionBody); opResult = await this.orderinfoSve.getOrderInfo(pobj, pobj.actionBody);
break; break;
case "getOrderDeliveryInfo"://获取订单交付信息
opResult = await this.orderinfoSve.getOrderDeliveryInfo(pobj, pobj.actionBody);
break;
//--------------------------------支付相关接口------------开始
case "getPayOrderInfo"://获取付款订单信息 case "getPayOrderInfo"://获取付款订单信息
opResult = await this.orderinfoSve.getPayOrderInfo(pobj, pobj.actionBody); opResult = await this.orderinfoSve.getPayOrderInfo(pobj, pobj.actionBody);
break; break;
case "putReceiptVoucherInfo"://修改订单收款信息 case "putReceiptVoucherInfo"://修改订单收款信息
opResult = await this.orderinfoSve.putReceiptVoucherInfo(pobj, pobj.actionBody); opResult = await this.orderinfoSve.putReceiptVoucherInfo(pobj, pobj.actionBody);
break; break;
//--------------------------------支付相关接口------------结束
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
......
...@@ -192,7 +192,7 @@ class OrderInfoService extends ServiceBase { ...@@ -192,7 +192,7 @@ class OrderInfoService extends ServiceBase {
return system.getResultSuccess(); return system.getResultSuccess();
} }
async getOrderInfo(pobj, actionBody) {//获取已经付款的订单信息列表 async getOrderInfo(pobj, actionBody) {//获取订单列表信息
var pageSize = Number(actionBody.pageSize || 20); var pageSize = Number(actionBody.pageSize || 20);
if (pageSize > 50) { if (pageSize > 50) {
pageSize = 50; pageSize = 50;
...@@ -202,19 +202,41 @@ class OrderInfoService extends ServiceBase { ...@@ -202,19 +202,41 @@ class OrderInfoService extends ServiceBase {
var sql = "select `orderNo`,`channelServiceNo`,`channelOrderNo`,`channelUserId`,`ownerUserId`,`payTime`,`quantity`,`serviceQuantity`,`orderStatusName`,`orderStatus`,`totalSum`,`payTotalSum`,`refundSum`,`invoiceApplyStatus`,`opNotes`,`channelItemCode`,`channelItemName`,`serviceItemCode`,`picUrl`" var sql = "select `orderNo`,`channelServiceNo`,`channelOrderNo`,`channelUserId`,`ownerUserId`,`payTime`,`quantity`,`serviceQuantity`,`orderStatusName`,`orderStatus`,`totalSum`,`payTotalSum`,`refundSum`,`invoiceApplyStatus`,`opNotes`,`channelItemCode`,`channelItemName`,`serviceItemCode`,`picUrl`"
+ " from v_order where uapp_id=" + pobj.appInfo.uapp_id + " and channelUserId=" + pobj.userInfo.channel_userid; + " from v_order where uapp_id=" + pobj.appInfo.uapp_id + " and channelUserId=" + pobj.userInfo.channel_userid;
var sqlCount = "select count(1) from v_order where uapp_id=" + pobj.appInfo.uapp_id + " and channelUserId=" + pobj.userInfo.channel_userid;
if (actionBody.channelItemName) { if (actionBody.channelItemName) {
sql += " and channelItemName like '%" + actionBody.channelItemName + "%'"; sql += " and channelItemName like '%" + actionBody.channelItemName + "%'";
sqlCount += " and channelItemName like '%" + actionBody.channelItemName + "%'";
} }
if (actionBody.channelServiceNo) { if (actionBody.channelServiceNo) {
sql += " and channelServiceNo like '%" + actionBody.channelServiceNo + "%'"; sql += " and channelServiceNo like '%" + actionBody.channelServiceNo + "%'";
sqlCount += " and channelServiceNo like '%" + actionBody.channelServiceNo + "%'";
} }
if (actionBody.orderStatus) { if (actionBody.orderStatus) {
sql += " and orderStatus ='" + actionBody.orderStatus + "'"; sql += " and orderStatus ='" + actionBody.orderStatus + "'";
sqlCount += " and orderStatus ='" + actionBody.orderStatus + "'";
} }
sql += " LIMIT " + pageSize + " OFFSET " + from; sql += " LIMIT " + pageSize + " OFFSET " + from;
var list = await this.customQuery(sql); var list = await this.customQuery(sql);
return system.getResultSuccess(list); var result = system.getResultSuccess(list);
var tmpResultCount = await this.customQuery(sqlCount);
result.dataCount = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
return result;
}
async getOrderDeliveryInfo(pobj, actionBody) {//获取订单交付信息
var sql = "select * from c_order_delivery where sourceOrderNo='" + pobj.actionBody.orderNo + "'";
var list = await this.customQuery(sql);
if (list && list.length > 0) {
if (list[0].deliveryContent) {
return system.getResultSuccess(list[0].deliveryContent);
}
}
return system.getResultSuccess();
} }
} }
......
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