Commit 82776e93 by 王昆

Merge branch 'xgg-saas-admin' of gitlab.gongsibao.com:jiangyong/zhichan into xgg-saas-admin

parents 5992e08d 3cae0cdc
...@@ -5,15 +5,9 @@ class ChannelCtl extends CtlBase { ...@@ -5,15 +5,9 @@ class ChannelCtl extends CtlBase {
constructor() { constructor() {
super(); super();
this.orderSve = system.getObject("service.saas.orderSve"); this.orderSve = system.getObject("service.saas.orderSve");
this.channelSve = system.getObject("service.saas.channelSve");
} }
// async microAdd(params, pobj2, req) {
// try {
// return await this.orderSve.microAdd(params);
// } catch (error) {
// return system.getResult(null, `系统错误 错误信息 ${error}`);
// }
// }
async platformInfo(params, pobj2, req) { async platformInfo(params, pobj2, req) {
try { try {
...@@ -57,6 +51,61 @@ class ChannelCtl extends CtlBase { ...@@ -57,6 +51,61 @@ class ChannelCtl extends CtlBase {
return system.getResult(null, `系统错误 错误信息 ${error}`); return system.getResult(null, `系统错误 错误信息 ${error}`);
} }
} }
/**
* fn:查看所有订单
* condition1:需要将channel_name显示出来
* condition2:需要将对应的businessmen详情带出来
* @param params
* @param pobj2
* @param req
* @returns {Promise<void>}
*/
async queryOrderGroupByChannel(params, pobj2, req) {
// if(!params.channel_id){
// return system.getResult(null, `参数错误 渠道ID不能为空`);
// }
this.doTimeCondition(params, ["createBegin", "createEnd"]);
try {
let channels = await this.channelSve.dics({});
if(channels.status!=0){
return system.getResult(null, `渠道列表获取失败,请稍后再试`);
}
let channelMap = {};
for(let channel_item of channels.data) {
channelMap[channel_item.id] = channel_item.name;
}
let orders= await this.orderSve.page(params);
let order_ids = [];
if(orders.status!=0 || !orders.data){
return system.getResult({count:0,rows:[]});
}
for (let item of orders.data.rows) {
item.channel_name = channelMap[item.channel_id] || "";
order_ids.push(item.id)
}
let obusinessmenMap = await this.orderSve.businessmenByOrderIds({order_ids});
if(obusinessmenMap.status!=0 ){
return system.getResult(null, `系统错误 个体户不存在`);
}
for (let element of orders.data.rows) {
element.obusinessmen = obusinessmenMap.data[element.id] ?obusinessmenMap.data[element.id]:{} ;
}
return orders;
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async info(params, pobj2, req) {
try {
let order = await this.orderSve.saasOrderMerchantOrderInfo(params);
return order;
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
} }
module.exports = ChannelCtl; module.exports = ChannelCtl;
\ No newline at end of file
...@@ -137,6 +137,26 @@ class OrderService extends ServiceBase { ...@@ -137,6 +137,26 @@ class OrderService extends ServiceBase {
return rs; return rs;
} }
/**
* fn:查看saas订单信息
* @param params
* @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|*|undefined>}
*/
async saasOrderMerchantOrderInfo(params) {
let rs = await this.callms("order", "saasOrderMerchantOrderInfo", params);
return rs;
}
/**
* fn:根据订单IDs查询个体户
* @param params
* @returns {Promise<void>}
*/
async businessmenByOrderIds(params){
let rs = await this.callms("order", "businessmenByOrderIds", params);
return rs;
}
} }
module.exports = OrderService; module.exports = OrderService;
\ No newline at end of file
...@@ -197,7 +197,7 @@ class System { ...@@ -197,7 +197,7 @@ class System {
merchant: local + ":3101" + path, merchant: local + ":3101" + path,
// 订单服务 // 订单服务
order: dev + ":3103" + path, order: local + ":3103" + path,
// 发票服务 // 发票服务
invoice: dev + ":3105" + path, invoice: dev + ":3105" + path,
...@@ -205,7 +205,7 @@ class System { ...@@ -205,7 +205,7 @@ class System {
// 用户服务 // 用户服务
uc: dev + ":3106" + path, uc: dev + ":3106" + path,
// 交易 // 交易6
trade: dev + ":3107" + path, trade: dev + ":3107" + path,
} }
} else { } else {
......
...@@ -92,12 +92,6 @@ module.exports = function (app) { ...@@ -92,12 +92,6 @@ module.exports = function (app) {
req.body.clientIp = tClientIp; req.body.clientIp = tClientIp;
req.body.agent = req.headers["user-agent"]; req.body.agent = req.headers["user-agent"];
req.body.classname = classPath; req.body.classname = classPath;
// if(req.loginUser) {
// req.body.saas_id = req.loginUser.saas_id;
// req.body.channel_id = req.loginUser.channel_id;
// }
params.push(methodName); params.push(methodName);
params.push(req.body); params.push(req.body);
params.push(req.query); params.push(req.query);
......
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