Commit e70d0784 by 任晓松

需求统计

parent a04ad50e
......@@ -53,9 +53,16 @@ class OpNeed extends APIBase {
// case "receiveFeedback"://关闭方案
// opResult = await this.centerorderSve.reqCenterOrderApi(pobj);
// break;
//企服通统计页面接口----start
case "getStatisticsByUappId":
opResult = await this.utilsOpNeedSve.getStatisticsByUappId(pobj);
break;
case "getStatisticsByProduct":
opResult = await this.utilsOpNeedSve.getStatisticsByProduct(pobj);
break;
case "getNeedFunnelStatistics":
opResult = await this.utilsOpNeedSve.getNeedFunnelStatistics(pobj);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
......@@ -353,6 +353,58 @@ class UtilsOpNeedService extends AppServiceBase {
return system.getResultSuccess(final);
}
/**
* 需求统计漏斗图
* @param pobj
* @returns {Promise<void>}
*/
async getNeedFunnelStatistics(pobj){
let url = this.centerOrderUrl + "action/opNeed/springBoard";
let result = await this.restPostUrl(pobj, url);
return result;
}
/**
* 需求统计(产品维度)
* @param pobj
* @returns {Promise<void>}
*/
async getStatisticsByProduct(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].typeCode && temp !="")){
let obj = {
type_code:temp,
data:arr
}
reArr.push(obj);
arr =[];
}
let dArr = {
status:data[i].status,
count:data[i].count
}
arr.push(dArr);
temp = data[i].typeCode;
if (i == data.length-1){
let obj = {
type_code:temp,
data:arr
}
reArr.push(obj);
}
}
return system.getResultSuccess(reArr);
}
urlSplit(url) {
var arr = url.split("?")[1]; //根据?跟个url
......
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