Commit ccdebf65 by 庄冰

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

parents cc5e6840 1dfa4f5b
...@@ -38,6 +38,12 @@ class Need extends APIBase { ...@@ -38,6 +38,12 @@ class Need extends APIBase {
case "needCloseIcp"://关闭需求 case "needCloseIcp"://关闭需求
opResult = await this.utilsNeedSve.needCloseIcp(pobj, pobj.actionBody); opResult = await this.utilsNeedSve.needCloseIcp(pobj, pobj.actionBody);
break; break;
case "needDetailByChannelNo":
opResult = await this.utilsNeedSve.needDetailByChannelNo(pobj, pobj.actionBody);
break;
case "getItemByChannelNeedNo":
opResult = await this.utilsNeedSve.getItemByChannelNeedNo(pobj, pobj.actionBody);
break;
case "getItemByNeedNo": case "getItemByNeedNo":
opResult = await this.utilsNeedSve.getItemByNeedNo(pobj, pobj.actionBody); opResult = await this.utilsNeedSve.getItemByNeedNo(pobj, pobj.actionBody);
break; break;
...@@ -45,7 +51,8 @@ class Need extends APIBase { ...@@ -45,7 +51,8 @@ class Need extends APIBase {
opResult = await this.centerorderSve.reqCenterOrderApi(pobj); opResult = await this.centerorderSve.reqCenterOrderApi(pobj);
break; break;
case "icpFeedbackSubmit"://icp接收方案反馈信息 case "icpFeedbackSubmit"://icp接收方案反馈信息
opResult = await this.utilsNeedSve.icpFeedbackSubmit(pobj); pobj.actionType = "receiveIcpFeedback";
opResult = await this.utilsNeedSve.reqCenterOrderApi(pobj);
break; break;
case "icpNotify"://icp方案更新 case "icpNotify"://icp方案更新
var rtn = await this.utilsNeedSve.icpNotify(pobj, pobj.actionBody); var rtn = await this.utilsNeedSve.icpNotify(pobj, pobj.actionBody);
......
const system = require("../../../system"); const system = require("../../../system");
const crypto = require('crypto'); const crypto = require('crypto');
var settings = require("../../../../config/settings"); var settings = require("../../../../config/settings");
class CenterorderService { const AppServiceBase = require("../../app.base");
class CenterorderService extends AppServiceBase {
constructor() { constructor() {
super();
this.centerOrderUrl = settings.centerOrderUrl(); this.centerOrderUrl = settings.centerOrderUrl();
this.execClient = system.getObject("util.execClient"); this.execClient = system.getObject("util.execClient");
this.aliclient = system.getObject("util.aliyunClient"); this.aliclient = system.getObject("util.aliyunClient");
...@@ -198,34 +200,11 @@ class CenterorderService { ...@@ -198,34 +200,11 @@ class CenterorderService {
} }
async icppaysuccess(pobj) { async icppaysuccess(pobj) {
if (!pobj.actionBody.bizId) {
return system.getResult(null, "actionBody.bizId can not be empty,100491");
}
var solutionobj = {
actionType: "",
actionBody: pobj.actionBody.bizId,
appInfo: pobj.appInfo,
actionProcess: pobj.actionProcess
}
var solutionrtn = await this.execClient.execPost(solutionobj, url);
if (!solutionrtn || !solutionrtn.stdout) {
return system.getResultFail(-5011, "方案查询失败");
}
var solutiondata = JSON.parse(solutionrtn.stdout);
if (solutiondata.status != 0) {
return system.getResultFail(-5011, "方案查询失败");
}
if (solutiondata.data && solutiondata.data.channelNeedNo) {
pobj.actionBody.needId = solutiondata.data.channelNeedNo;
}
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var itemResult = await this.restPostUrl(pobj, reqUrl);
if (needResult.status != 0) {
return needResult;
}
var sobj = { var sobj = {
actionType: "getaliicpProduce", actionType: "getaliicpProduce",
actionBody: pobj.actionBody, // actionBody: { typeCode: itemResult.data.channelTypeCode, province: itemResult.data.province },
actionBody: { typeCode: pobj.actionBody.channelTypeCode, province: pobj.actionBody.province },
appInfo: pobj.appInfo, appInfo: pobj.appInfo,
actionProcess: pobj.actionProcess actionProcess: pobj.actionProcess
} }
...@@ -239,10 +218,12 @@ class CenterorderService { ...@@ -239,10 +218,12 @@ class CenterorderService {
if (data.status != 0) { if (data.status != 0) {
return system.getResultFail(-5010, "产品查询失败"); return system.getResultFail(-5010, "产品查询失败");
} }
pobj.actionBody = data.data; // pobj.actionBody = data.data;
pobj.actionBody.orderNo = pobj.actionBody.bizId; pobj.actionBody.orderNo = pobj.actionBody.bizId;
pobj.actionBody.totalSum = pobj.actionBody.price; pobj.actionBody.totalSum = data.data.price;
pobj.actionBody.payTotalSum = pobj.actionBody.price; pobj.actionBody.payTotalSum = data.data.price;
pobj.actionBody.payCode = data.data.payCode;
pobj.actionBody.channelItemCode = data.data.channelItemCode;
pobj.actionBody.quantity = 1; pobj.actionBody.quantity = 1;
pobj.actionBody.channelOrder = { pobj.actionBody.channelOrder = {
channelServiceNo: pobj.actionBody.orderNo, channelServiceNo: pobj.actionBody.orderNo,
...@@ -285,24 +266,24 @@ class CenterorderService { ...@@ -285,24 +266,24 @@ class CenterorderService {
//--------------------------阿里ICP---start-------------------------------------------------------- //--------------------------阿里ICP---start--------------------------------------------------------
//提交公司注册方案 //提交公司注册方案
async submitIcpProgramme(pobj) { async submitIcpProgramme(pobj) {
var res = await this.reqCenterOrderApi(pobj,"action/icpapi/springBoard"); var res = await this.reqCenterOrderApi(pobj, "action/icpapi/springBoard");
if(res && res.status==0 && res.data && res.data.needinfo && res.data.needsolution){ if (res && res.status == 0 && res.data && res.data.needinfo && res.data.needsolution) {
var needinfo = res.data.needinfo;//需求信息 var needinfo = res.data.needinfo;//需求信息
var needsolution = res.data.needsolution;//方案信息 var needsolution = res.data.needsolution;//方案信息
var ab = pobj.actionBody; var ab = pobj.actionBody;
if(typeof(ab.solutionContent) == "string"){ if (typeof (ab.solutionContent) == "string") {
ab.solutionContent = JSON.parse(ab.solutionContent); ab.solutionContent = JSON.parse(ab.solutionContent);
} }
if(typeof(needsolution.solutionContent) == "string"){ if (typeof (needsolution.solutionContent) == "string") {
needsolution.solutionContent = JSON.parse(needsolution.solutionContent); needsolution.solutionContent = JSON.parse(needsolution.solutionContent);
} }
var solution = needsolution.solutionContent.solution; var solution = needsolution.solutionContent.solution;
//推送数据至阿里 //推送数据至阿里
var bizType = needinfo.channelTypeCode;//业务类型里 var bizType = needinfo.channelTypeCode;//业务类型里
var pushObj = { var pushObj = {
IntentionBizId:needinfo.channelNeedNo, IntentionBizId: needinfo.channelNeedNo,
CompanyName:solution.CompanyName,IcpType:solution.IcpType,CompanyAddress:solution.CompanyAddress, CompanyName: solution.CompanyName, IcpType: solution.IcpType, CompanyAddress: solution.CompanyAddress,
Area:solution.Area,Note:solution.Note Area: solution.Area, Note: solution.Note
}; };
var self = this; var self = this;
//推送方案 //推送方案
...@@ -312,22 +293,22 @@ class CenterorderService { ...@@ -312,22 +293,22 @@ class CenterorderService {
return res; return res;
} }
//推送ICP方案 //推送ICP方案
async pushIcpSolution(pushObj,solutionNo,appInfo,self){ async pushIcpSolution(pushObj, solutionNo, appInfo, self) {
//推送方案信息 //推送方案信息
var pushRes = await self.aliclient.reqbyget({action:"SubmitIcpSolution",reqbody:pushObj,apiVersion:"2019-05-08"}); var pushRes = await self.aliclient.reqbyget({ action: "SubmitIcpSolution", reqbody: pushObj, apiVersion: "2019-05-08" });
if(pushRes && pushRes.status==0 && pushRes.data){ if (pushRes && pushRes.status == 0 && pushRes.data) {
var resData = pushRes.data; var resData = pushRes.data;
if(resData.BizId){ if (resData.BizId) {
var reqObj2 = { var reqObj2 = {
actionType:"receiveProgrammeNo", actionType: "receiveProgrammeNo",
appInfo:appInfo, appInfo: appInfo,
actionBody:{ actionBody: {
solutionNo:solutionNo, solutionNo: solutionNo,
solutionBizId:resData.BizId solutionBizId: resData.BizId
} }
}; };
var a = await self.reqCenterOrderApi(reqObj2);//保存渠道方案id var a = await self.reqCenterOrderApi(reqObj2);//保存渠道方案id
if(a && a.status==0){ if (a && a.status == 0) {
//推送方案确认信息 //推送方案确认信息
await self.aliclient.reqbyget({action:"ConfirmIntention",reqbody:{BizId:pushObj.IntentionBizId},apiVersion:"2019-05-08"}); await self.aliclient.reqbyget({action:"ConfirmIntention",reqbody:{BizId:pushObj.IntentionBizId},apiVersion:"2019-05-08"});
} }
...@@ -335,7 +316,7 @@ class CenterorderService { ...@@ -335,7 +316,7 @@ class CenterorderService {
} }
} }
//材料链接转换 //材料链接转换
async materialUrlConversion(pobj){ async materialUrlConversion(pobj) {
// if(!pobj || !pobj.actionBody || !pobj.actionBody.material){ // if(!pobj || !pobj.actionBody || !pobj.actionBody.material){
// return pobj; // return pobj;
// } // }
...@@ -347,31 +328,31 @@ class CenterorderService { ...@@ -347,31 +328,31 @@ class CenterorderService {
//icp材料提交 //icp材料提交
async submitIcpMaterial(pobj) { async submitIcpMaterial(pobj) {
// pobj = await this.materialUrlConversion(pobj); // pobj = await this.materialUrlConversion(pobj);
var res = await this.reqCenterOrderApi(pobj,"action/icpapi/springBoard"); var res = await this.reqCenterOrderApi(pobj, "action/icpapi/springBoard");
if(res && res.status==0 && res.data){ if (res && res.status == 0 && res.data) {
var needsolution = res.data;//方案信息 var needsolution = res.data;//方案信息
var ab = pobj.actionBody; var ab = pobj.actionBody;
if(typeof(ab.material) == "string"){ if (typeof (ab.material) == "string") {
ab.material = JSON.parse(ab.material); ab.material = JSON.parse(ab.material);
} }
var material = ab.material; var material = ab.material;
//推送数据至阿里 //推送数据至阿里
var BizId = ab.BizId;//⽅案业务ID var BizId = ab.BizId;//⽅案业务ID
var pushObj = { var pushObj = {
"BizId":BizId, "BizId": BizId,
"Domain":material.Domain, "Domain": material.Domain,
"CorporateName":material.CorporateName, "CorporateName": material.CorporateName,
"IncludeForeignInvestment":material.IncludeForeignInvestment, "IncludeForeignInvestment": material.IncludeForeignInvestment,
"PartnerBusinessLicense":material.PartnerBusinessLicense, "PartnerBusinessLicense": material.PartnerBusinessLicense,
"PartnerIdCardList":material.PartnerIdCardList, "PartnerIdCardList": material.PartnerIdCardList,
"PartnerDomainCertificate":material.PartnerDomainCertificate, "PartnerDomainCertificate": material.PartnerDomainCertificate,
"PartnerPreviewOtherList":material.PartnerPreviewOtherList || [], "PartnerPreviewOtherList": material.PartnerPreviewOtherList || [],
"PartnerPlan":material.PartnerPlan || "", "PartnerPlan": material.PartnerPlan || "",
"PartnerForeignInvestment":material.PartnerForeignInvestment || "", "PartnerForeignInvestment": material.PartnerForeignInvestment || "",
"PartnerLaw":material.PartnerLaw || "", "PartnerLaw": material.PartnerLaw || "",
"PartnerStampOtherList":material.PartnerStampOtherList || [], "PartnerStampOtherList": material.PartnerStampOtherList || [],
"PartnerSignOtherList":material.PartnerSignOtherList || [], "PartnerSignOtherList": material.PartnerSignOtherList || [],
"PartnerSignAndStampOtherList":material.PartnerSignAndStampOtherList || [] "PartnerSignAndStampOtherList": material.PartnerSignAndStampOtherList || []
}; };
var self = this; var self = this;
//推送方案材料 //推送方案材料
...@@ -381,9 +362,9 @@ class CenterorderService { ...@@ -381,9 +362,9 @@ class CenterorderService {
return res; return res;
} }
//icp通知状态变更 //icp通知状态变更
async acceptIcpPartnerNotification(pobj){ async acceptIcpPartnerNotification(pobj) {
var res = await this.reqCenterOrderApi(pobj,"action/icpapi/springBoard"); var res = await this.reqCenterOrderApi(pobj, "action/icpapi/springBoard");
if(res && res.status==0 && res.data){ if (res && res.status == 0 && res.data) {
var ab = pobj.actionBody; var ab = pobj.actionBody;
//推送数据至阿里 //推送数据至阿里
// var pushObj = res.data; // var pushObj = res.data;
...@@ -399,17 +380,17 @@ class CenterorderService { ...@@ -399,17 +380,17 @@ class CenterorderService {
return res; return res;
} }
//服务商icp方案关闭 //服务商icp方案关闭
async abolishIcpProgramme(pobj){ async abolishIcpProgramme(pobj) {
var res = await this.reqCenterOrderApi(pobj,"action/icpapi/springBoard"); var res = await this.reqCenterOrderApi(pobj, "action/icpapi/springBoard");
if(res && res.status==0 && res.data){ if (res && res.status == 0 && res.data) {
var needsolution = res.data;//方案信息 var needsolution = res.data;//方案信息
var ab = pobj.actionBody; var ab = pobj.actionBody;
if(typeof(ab.material) == "string"){ if (typeof (ab.material) == "string") {
ab.material = JSON.parse(ab.material); ab.material = JSON.parse(ab.material);
} }
//推送数据至阿里 //推送数据至阿里
var pushObj = { var pushObj = {
BizId:ab.BizId,Note:ab.Note BizId: ab.BizId, Note: ab.Note
}; };
//关闭方案 //关闭方案
this.aliclient.reqbyget({action:"CloseIcpProduce",reqbody:pushObj,apiVersion:"2019-05-08"}); this.aliclient.reqbyget({action:"CloseIcpProduce",reqbody:pushObj,apiVersion:"2019-05-08"});
......
...@@ -544,19 +544,19 @@ ApplicationStatus: ...@@ -544,19 +544,19 @@ ApplicationStatus:
} }
``` ```
## **<a name="getItemByNeedNo"> 获取需求详情</a>** ## **<a name="getItemByChannelNeedNo"> 获取需求详情</a>**
[返回到目录](#menu) [返回到目录](#menu)
##### URL ##### URL
[/web/opreceive/need/springBoard] [/web/opreceive/need/springBoard]
#### 参数格式 `JSON` #### 参数格式 `JSON`
#### HTTP请求方式 `POST` #### HTTP请求方式 `POST`
#### 请求头中需要增加userpin(用户登录后的凭证)的值 #### 请求头中需要增加userpin(用户登录后的凭证)的值
#### 渠道执行的类型 actionType:getItemByNeedNo #### 渠道执行的类型 actionType:getItemByChannelNeedNo
``` javascript ``` javascript
{ {
"actionType":"getItemByNeedNo", "actionType":"getItemByChannelNeedNo",
"actionBody":{ "actionBody":{
"needNo":"NS202004131008iKPRDB" "needNo":"NS202004131008iKPRDB"
} }
......
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