Commit 32d319a2 by linboxuan

needBatchUpload

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