Commit d56d3832 by 孙亚楠

d

parent fa655567
...@@ -31,10 +31,41 @@ class ChannelCtl extends CtlBase { ...@@ -31,10 +31,41 @@ class ChannelCtl extends CtlBase {
} }
} }
/**
* fn:订单列表
* @param params
* @param pobj2
* @param req
* @returns {Promise<{msg: string, data: (*|null), bizmsg: string, status: number}|{msg: string, data, bizmsg: (*|string), status: number}|*>}
*/
async page(params, pobj2, req) { async page(params, pobj2, req) {
try { try {
return await this.orderSve.page(params); let listRes = await this.orderSve.page(params);
} catch (error) { if (listRes.status != 0) {
return system.getResult(null, `系统错误`);
}
let source_nos = [];
for (let item of listRes.data.rows) {
source_nos.push(item.id);
}
if(source_nos.length==0){
return system.getResult(null, `暂无数据`);
}
let res =await this.orderSve.queryOrderStatusBySourceNo({source_nos:source_nos});
if(res.status!=0){
return res;
}
let StatusMap = res.data;
for(let item of listRes.data.rows){
if(StatusMap[item.id]){
item.handle_name = StatusMap[item.id]['name'] || "处理中";
}else{
item.handle_name = "待分配";
}
}
return listRes;
}
catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`); return system.getResult(null, `系统错误 错误信息 ${error}`);
} }
} }
...@@ -58,8 +89,6 @@ class ChannelCtl extends CtlBase { ...@@ -58,8 +89,6 @@ class ChannelCtl extends CtlBase {
} }
} }
/** /**
* fn:查询产品 * fn:查询产品
* @param pobj * @param pobj
......
...@@ -148,5 +148,29 @@ class OrderService extends ServiceBase { ...@@ -148,5 +148,29 @@ class OrderService extends ServiceBase {
let rs = await this.callms("order", "saasorderbusinessmenPage", params); let rs = await this.callms("order", "saasorderbusinessmenPage", params);
return rs; return rs;
} }
/**
* fn:根据订单来源查询状态
* @param params
* @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|any|undefined>}
*/
async queryOrderStatusBySourceNo(params){
try{
let res = await axios({
method: 'post',
url: settings.deliverSysApi().queryOrderStatusBySourceNo,
data: params
});
console.log(res.data);
if(res.status == 200 && res.data && res.data.status == 0 && res.data.data) {
return res.data;
}
console.log(`xgg-saas-platform->orderSve->queryOrderStatusBySourceNo 请求结果` + JSON.stringify(res));
return system.getResult(null, `系统错误`);
}catch (e) {
console.log(e);
return system.getResult(null, `系统错误`);
}
}
} }
module.exports = OrderService; module.exports = OrderService;
\ No newline at end of file
...@@ -198,7 +198,7 @@ class System { ...@@ -198,7 +198,7 @@ class System {
merchant: dev + ":3101" + path, merchant: dev + ":3101" + path,
// 订单服务 // 订单服务
order: dev + ":3103" + path, order: local + ":3103" + path,
// 发票服务 // 发票服务
invoice: dev + ":3105" + path, invoice: dev + ":3105" + path,
......
...@@ -127,8 +127,10 @@ var settings = { ...@@ -127,8 +127,10 @@ var settings = {
deliverSysApi: function () { deliverSysApi: function () {
let domain = "",orderDomain = ""; let domain = "",orderDomain = "";
if (this.env == "dev") { if (this.env == "dev") {
orderDomain= "http://39.107.234.14:3012"; // orderDomain= "http://39.107.234.14:3012";
// orderDomain= "http://127.0.0.1:3012"; orderDomain= "http://127.0.0.1:3012";
domain = "http://39.107.234.14:3002"; domain = "http://39.107.234.14:3002";
// domain = "http://127.0.0.1:3112"; // domain = "http://127.0.0.1:3112";
} else { } else {
...@@ -138,6 +140,8 @@ var settings = { ...@@ -138,6 +140,8 @@ var settings = {
return { return {
// 推送订单s // 推送订单s
orderPushApi: orderDomain + "/web/order/orderCtl/addSourceOrder", orderPushApi: orderDomain + "/web/order/orderCtl/addSourceOrder",
// 根据订单来源查询状态
queryOrderStatusBySourceNo: orderDomain + "/web/order/orderCtl/queryOrderStatusBySourceNo",
//发票是试算 //发票是试算
calcInvoice: domain + "/web/invoice/invoiceCtl/calcInvoice", calcInvoice: domain + "/web/invoice/invoiceCtl/calcInvoice",
//推送发票申请 //推送发票申请
......
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