Commit 7f2362df by 王栋源

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

parents 602bc536 b0889fc9
let WEBBase = require("../../web.base");
let system = require("../../../system");
class brand extends WEBBase {
constructor() {
super();
this.utilsNeedSve = system.getObject("service.utilsSve.utilsNeedSve");
}
async springBoard(pobj, qobj, req) {
return await this.opActionProcess(pobj, pobj.actionType, req);
}
async opActionProcess(pobj, action_type, req) {
let opResult = null;
switch (action_type) {
case "QueryTradeIntentionUserList":// 查询咨询客户列表
let endtime = Date.now();
let starttime = Date.now() - 30 * 60 * 1000;//30分钟(毫秒)
pobj.actionBody = {
Begin: starttime,
End: endtime
};
opResult = await this.utilsNeedSve.queryTradeIntentionUserList(pobj);
break;
}
return opResult;
}
}
module.exports = brand;
\ No newline at end of file
......@@ -549,24 +549,41 @@ class UtilsNeedService extends AppServiceBase {
}
}
async queryTradeIntentionUserList(pobj) {
if (!pobj.actionBody.intentionBizId) {
return system.getResult(null, "actionBody.intentionBizId can not be empty,100493");
}
if (!pobj.actionBody.userFeedBack) {
return system.getResult(null, "actionBody.userFeedBack can not be empty,100494");
}
// if (!pobj.actionBody.intentionBizId) {
// return system.getResult(null, "actionBody.intentionBizId can not be empty,100493");
// }
// if (!pobj.actionBody.userFeedBack) {
// return system.getResult(null, "actionBody.userFeedBack can not be empty,100494");
// }
let res = await this.aliclient.reqbyget({
action: "QueryTradeIntentionUserList", reqbody: {
BeginTime: pobj.actionBody.BeginTime ? pobj.actionBody.BeginTime : "",
EndTime: pobj.actionBody.EndTime ? pobj.actionBody.EndTime : "",
BizId: pobj.actionBody.intentionBizId,
UserFeedBack: pobj.actionBody.userFeedBack,
PageNum: pobj.actionBody.pageNum || 1,
PageSize: pobj.actionBody.pageSize || 10,
Begin: pobj.actionBody.Begin ? pobj.actionBody.Begin : "",
End: pobj.actionBody.End ? pobj.actionBody.End : "",
}, apiVersion: "2019-05-08"
});
if (res.status == 0){
pobj.actionType = "getUnCreated";
pobj.actionBody.data = res.data.Data;
let reqUrl = this.centerOrderUrl + "action/need/springBoard";
let result = await this.restPostUrl(pobj, reqUrl);
if (result.status == 0) {
pobj.actionBody = {
type:"tmjy"
};
for (let item of result.data){
pobj.actionBody.intentionBizId=item.BizId;
pobj.actionBody.mobile=item.Mobile?item.Mobile:"";
pobj.actionBody.userName=item.UserName?item.UserName:"";
pobj.notes=`${item.RegisterNumber?"RegisterNumber:"+item.RegisterNumber:""}${item.Classification?"Classification:"+item.Classification:""}`;
let res = await this.submitNeed(JSON.parse(JSON.stringify(pobj)),{intentionBizId:item.BizId});
console.log(res)
return system.getResultSuccess(res);
}
return system.getResultSuccess();
}else {
return system.getResultFail(result.status,result.msg);
}
}
return system.getResultFail(res.status,res.msg);
}
async testsymq(pobj) {
......
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