Commit 24b49c10 by 庄冰

orderlist

parent dc4970b3
...@@ -15,6 +15,7 @@ class TmOrderAPI extends APIBase { ...@@ -15,6 +15,7 @@ class TmOrderAPI extends APIBase {
this.pushlogSve = system.getObject("service.common.pushlogSve"); this.pushlogSve = system.getObject("service.common.pushlogSve");
this.toolSve = system.getObject("service.trademark.toolSve"); this.toolSve = system.getObject("service.trademark.toolSve");
this.appProductSve = system.getObject("service.dbapp.appproductSve"); this.appProductSve = system.getObject("service.dbapp.appproductSve");
this.orderinfoSve = system.getObject("service.dbcorder.orderinfoSve");
} }
/** /**
* 接口跳转-POST请求 * 接口跳转-POST请求
...@@ -46,6 +47,8 @@ class TmOrderAPI extends APIBase { ...@@ -46,6 +47,8 @@ class TmOrderAPI extends APIBase {
async opActionProcess(action_process, action_type, action_body, pobj, req) { async opActionProcess(action_process, action_type, action_body, pobj, req) {
action_body.app = req.app; action_body.app = req.app;
action_body.user = req.user; action_body.user = req.user;
// action_body.app = { id: 2,uAppId:18};
// action_body.user = { id: 6, app_id: 2, nickname: "测试用户",channelUserId:"testUserId01" };
var opResult = null; var opResult = null;
if (["subTmOrder", "getTmOrderList", "getTmOrderInfo", "getTmApplyInfo", "getTmNclList", "getNeedInfo", if (["subTmOrder", "getTmOrderList", "getTmOrderInfo", "getTmApplyInfo", "getTmNclList", "getNeedInfo",
"tmConfirm", "updateTmInfo", "updateNclInfo", "updateContacts", "updateCustomerInfo", "tmConfirm", "updateTmInfo", "updateNclInfo", "updateContacts", "updateCustomerInfo",
...@@ -59,6 +62,9 @@ class TmOrderAPI extends APIBase { ...@@ -59,6 +62,9 @@ class TmOrderAPI extends APIBase {
case "test"://测试 case "test"://测试
opResult = system.getResultSuccess(null, "测试成功"); opResult = system.getResultSuccess(null, "测试成功");
break; break;
case "getOrderList"://获取订单列表(分页)
opResult = await this.orderinfoSve.findAndCountAll(action_body,req);
break;
case "decryptStr":// case "decryptStr"://
opResult = await this.toolSve.decryptStr(req.app, action_body.opStr); opResult = await this.toolSve.decryptStr(req.app, action_body.opStr);
break; break;
......
...@@ -64,6 +64,9 @@ class Dao { ...@@ -64,6 +64,9 @@ class Dao {
//return {"key":"include","value":{model:this.db.models.app}}; //return {"key":"include","value":{model:this.db.models.app}};
return [["created_at", "DESC"]]; return [["created_at", "DESC"]];
} }
buildAttributes(){
return [];
}
buildQuery(qobj) { buildQuery(qobj) {
var linkAttrs = []; var linkAttrs = [];
const pageNo = qobj.pageInfo.pageNo; const pageNo = qobj.pageInfo.pageNo;
...@@ -123,6 +126,10 @@ class Dao { ...@@ -123,6 +126,10 @@ class Dao {
if (extraFilter) { if (extraFilter) {
qc[extraFilter.key] = extraFilter.value; qc[extraFilter.key] = extraFilter.value;
} }
var attributesObj = this.buildAttributes();
if(attributesObj && attributesObj.length>0){
qc.attributes=attributesObj;
}
console.log("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm"); console.log("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm");
console.log(qc); console.log(qc);
return qc; return qc;
......
...@@ -4,5 +4,25 @@ class OrderInfoDao extends Dao { ...@@ -4,5 +4,25 @@ class OrderInfoDao extends Dao {
constructor() { constructor() {
super(Dao.getModelName(OrderInfoDao)); super(Dao.getModelName(OrderInfoDao));
} }
buildAttributes(){
return [
"orderNo",
"channelServiceNo",
"needNo",
"payTime",
"channelUserId",
"quantity",
"serviceQuantity",
"orderPayStatusName",
"orderPayStatus",
"totalSum",
"payTotalSum",
"refundSum",
"channelProfitSum",
"pfSettleProfit",
"notes",
"opNotes"
];
}
} }
module.exports = OrderInfoDao; module.exports = OrderInfoDao;
...@@ -263,6 +263,31 @@ class OrderInfoService extends ServiceBase { ...@@ -263,6 +263,31 @@ class OrderInfoService extends ServiceBase {
}); });
} }
} }
async findAndCountAll(obj,req) {
var app = req.app;
if(!app || !app.uAppId){
return system.getResult(null, "渠道信息有误");
}
obj["search"]["uapp_id"]=app.uAppId;
const result = await this.dao.findAndCountAll(obj);
return result;
}
async getOrderDetailByOrderNo(obj){
var orderNo = obj.orderNo;
if(!orderNo){
return system.getResult(null, "订单编号不能为空");
}
var app = req.app;
if(!app || !app.uAppId){
return system.getResult(null, "渠道信息有误");
}
var order = await this.dao.model.findOne({
where:{orderNo:orderNo,uapp_id:app.uAppId},
raw:true
});
return order;
}
} }
module.exports = OrderInfoService; module.exports = OrderInfoService;
// var task = new OrderInfoService(); // var task = new OrderInfoService();
......
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