Commit 32d319a2 by linboxuan

needBatchUpload

parent 537ee14a
......@@ -54,7 +54,8 @@ class QcCenterOrderService extends AppServiceBase {
}
var self = this;
//推送方案
await this.pushIcpSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self);
// 2020 0916 lin 修改 增加获取返回值
var pushIcpSolutionRes = await this.pushIcpSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self);
// // 2020 0806 lin 新增推送
// var reqParams = {
......@@ -87,7 +88,8 @@ class QcCenterOrderService extends AppServiceBase {
appInfo: pobj.appInfo
}
this.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
return system.getResultSuccess();
//
return system.getResultSuccess(pushIcpSolutionRes);
}
return res;
}
......@@ -124,6 +126,7 @@ class QcCenterOrderService extends AppServiceBase {
var a = await self.reqCenterOrderApi(reqObj3);//保存用户确认方案url
}
}
return confirmRes;
}
}
}
......
......@@ -449,7 +449,8 @@ class UtilsNeedService extends AppServiceBase {
var self = this;
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
await self.aliclient.reqbyget({ action: "WriteCommunicationLog", reqbody: { BizId: pobj.actionBody.intentionBizId, Note: pobj.actionBody.note }, apiVersion: "2019-05-08" });
var res = await self.aliclient.reqbyget({ action: "WriteCommunicationLog", reqbody: { BizId: pobj.actionBody.intentionBizId, Note: pobj.actionBody.note }, apiVersion: "2019-05-08" });
console.log("res",res)
//推送交付系统
var reqParams = {
actionBody: {
......@@ -614,7 +615,7 @@ class UtilsNeedService extends AppServiceBase {
// 2020 0914 lin 新增 刷单一条龙服务
async needBatchUpload(pobj,actionBody) {
var BizIds = [];
var BizIds="";
var demands = [];
for(var i = 0;i < actionBody.demands.length;i++) {
// 第一步
......@@ -639,7 +640,8 @@ class UtilsNeedService extends AppServiceBase {
}
// 第二步
// 创建企服通需求单
var npobj = pobj;
var objString = JSON.stringify(pobj);
var npobj = JSON.parse(objString);
npobj.actionBody = {
intentionBizId: aliResult.data.BizId,
type: this.bizTypeChange(actionBody.demands[i].type),
......@@ -650,7 +652,8 @@ class UtilsNeedService extends AppServiceBase {
console.log("needBatchUpload-opResult",opResult)
// 第三步
// 提交Icp注册方案
var spobj = pobj;
var sobjString = JSON.stringify(pobj);
var spobj = JSON.parse(sobjString);
spobj.actionType = "submitIcpProgramme";
spobj.actionBody = {
"needNo": aliResult.data.BizId,//渠道需求号
......@@ -666,37 +669,43 @@ class UtilsNeedService extends AppServiceBase {
}
}
}
var subRes = await this.qcCenterOrderSve.submitIcpProgramme(pobj);
var subRes = await this.qcCenterOrderSve.submitIcpProgramme(spobj);
console.log("----------------------------------start");
console.log("needBatchUpload-res",subRes)
console.log("----------------------------------end");
// 第四步
// 需求沟通记录接口
var writeRes = await this.writeCommunicationLog({actionBody:{intentionBizId:"20200804200124000001",note:"测试反馈"}});
console.log("needBatchUpload-writeRes",writeRes)
// 整合前端需要的数据
BizIds.push(aliResult.data.BizId)
// BizIds.push(aliResult.data.BizId)
BizIds += aliResult.data.BizId + ",";
demands.push({
uniqueCode:actionBody.demands[i].uniqueCode,
demandCode: opResult.data.needNo
})
}
BizIds = BizIds.substr(0, BizIds.length - 1);
// 第五步 用户需求确认
var aliConfirmResult = await this.aliclient.reqbyget({ action: "ConfirmIcpIntention", reqbody: {BizIds:BizIds}, apiVersion: "2019-05-08" });
console.log("needBatchUpload-aliConfirmResult",aliConfirmResult)
// 获取链接失败
if(aliConfirmResult.status != 0) {
var res = {
paymentLink:"",
paymentLink:"www.baidu.com",
batchNumber:actionBody.batchNumber,
demands:demands
}
return system.getResultFail(-5018,"confirmIcpIntention fail");
// return system.getResultRedisSuccess(res);
}
var res = {
paymentLink:aliConfirmResult.confirmUrl,
paymentLink:aliConfirmResult.data.ConfirmUrl,
batchNumber:actionBody.batchNumber,
demands:demands
}
return system.getResultSuccess(res);
// 2020 0916 lin 新增返回格式 成功status为1
return system.getResultRedisSuccess(res);
}
async testsymq(pobj) {
var a = null;
......
......@@ -172,7 +172,15 @@ class System {
data: data || null,
};
}
// 2020 0916 lin 新增返回格式 成功status为1
static getResultRedisQueueSuccess(data, okmsg = "success") {
return {
status: 1,
msg: okmsg,
data: data || null,
};
}
/**
* 请求返回成功 自定义
* @param {*} data 操作成功返回的数据
......
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