Commit 44abe0d8 by 宋毅

Merge branch 'center-channel' of gitlab.gongsibao.com:jiangyong/zhichan into center-channel

parents 7f8336d9 7e44a453
......@@ -60,6 +60,9 @@ class OpNeed extends APIBase {
case "getStatisticsByProduct":
opResult = await this.utilsOpNeedSve.getStatisticsByProduct(pobj);
break;
case "getStatisticsByChannel":
opResult = await this.utilsOpNeedSve.getStatisticsByChannel(pobj);
break;
case "getNeedProductType":
opResult = await this.utilsOpNeedSve.getNeedProductType(pobj);
break;
......
......@@ -51,6 +51,9 @@ class ProductAPI extends WEBBase {
case "getOrderStatisticsByProduct":
opResult = await this.utilsOrderSve.getOrdersStatisticsByProduct(pobj);
break;
case "getOrderStatisticsByChannel":
opResult = await this.utilsOrderSve.getOrdersStatisticsByChannel(pobj);
break;
case "getOrdersComparison":
opResult = await this.utilsOrderSve.getOrdersComparison(pobj);
break;
......
......@@ -409,6 +409,47 @@ class UtilsOpNeedService extends AppServiceBase {
}
/**
* 需求统计(产品维度) 总数
* @param pobj
* @returns {Promise<void>}
*/
async getStatisticsByChannel(pobj){
let url = this.centerOrderUrl + "action/opNeed/springBoard";
let result = await this.restPostUrl(pobj, url);
if(result.status != 0){
return system.getResultFail(-1);
}
let data = result.data;
let temp="";
let arr = [];
let reArr = [];
for(let i=0;i<data.length;i++){
if((temp != data[i].uapp_id && temp !="")){
let obj = {
uapp_id:temp,
data:arr
}
reArr.push(obj);
arr =[];
}
let dArr = {
typeCode:data[i].typeCode,
count:data[i].count
}
arr.push(dArr);
temp = data[i].uapp_id;
if (i == data.length-1){
let obj = {
uapp_id:temp,
data:arr
}
reArr.push(obj);
}
}
return system.getResultSuccess(reArr);
}
/**
* 获取需求 的产品类型
* @param pobj
* @returns {Promise<void>}
......
......@@ -319,6 +319,47 @@ class UtilsOrderService extends AppServiceBase {
}
/**
* 需求统计(产品、渠道维度)
* @param pobj
* @returns {Promise<void>}
*/
async getOrdersStatisticsByChannel(pobj) {
let url = this.centerOrderUrl + "action/order/springBoard";
let result = await this.restPostUrl(pobj, url);
if (result.status != 0) {
return system.getResultFail(-1);
}
let data = result.data;
let temp = "";
let arr = [];
let reArr = [];
for (let i = 0; i < data.length; i++) {
if ((temp != data[i].uapp_id && temp != "")) {
let obj = {
uapp_id: temp,
data: arr
}
reArr.push(obj);
arr = [];
}
let dArr = {
pathName: data[i].pathName,
count: data[i].count
}
arr.push(dArr);
temp = data[i].uapp_id;
if (i == data.length - 1) {
let obj = {
uapp_id: temp,
data: arr
}
reArr.push(obj);
}
}
return system.getResultSuccess(reArr);
}
/**
* 订单数量对比
* @param pobj
* @returns {Promise<void>}
......@@ -1203,6 +1244,7 @@ class UtilsOrderService extends AppServiceBase {
channel_nickname: opOrderResult.data.order_info.channelUserId
};
opOrderResult.data.orderNo = params.orderNo;
opOrderResult.data.idempotentNo = opOrderResult.data.order_info.channelOrderNo
opOrderResult.data.order_info.pay_flow_no = params.trade_no || "";// 2020 0704 lin 新增 推送fq必填字段
opOrderResult.data.order_info.pay_channel = params.payType || "";//付款方式
opOrderResult.data.order_info.pay_time = params.payTime;//付款时间
......
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