Commit c41498db by 兰国旗

laolan

parent fbce9085
...@@ -41,7 +41,8 @@ var regCfg = { ...@@ -41,7 +41,8 @@ var regCfg = {
"330700":"金华", "330700":"金华",
"220100":"长春", "220100":"长春",
"430100":"长沙", "430100":"长沙",
"370200":"青岛", "370200":"青岛",
"410200":"开封",
"230100":"哈尔滨", "230100":"哈尔滨",
"130100":"石家庄" "130100":"石家庄"
}, },
...@@ -86,6 +87,7 @@ var regCfg = { ...@@ -86,6 +87,7 @@ var regCfg = {
"长春": "220100", "长春": "220100",
"长沙": "430100", "长沙": "430100",
"青岛": "370200", "青岛": "370200",
"开封": "410200",
"哈尔滨":"230100", "哈尔滨":"230100",
"石家庄":"130100" "石家庄":"130100"
}, },
......
...@@ -71,8 +71,6 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -71,8 +71,6 @@ class RegCenterOrderService extends AppServiceBase {
pobj.actionBody.channelNeedNo = data.data.channelNeedNo || data.data.bizId ; pobj.actionBody.channelNeedNo = data.data.channelNeedNo || data.data.bizId ;
pobj.actionBody.needNo = data.data.needNo; pobj.actionBody.needNo = data.data.needNo;
pobj.actionBody.quantity = 1; pobj.actionBody.quantity = 1;
pobj.actionBody.price_desc = pobj.actionBody.taxpayerType;
pobj.actionBody.additions_desc = pobj.actionBody.companyProperties;
pobj.actionBody.channelOrder = { pobj.actionBody.channelOrder = {
channelServiceNo: pobj.actionBody.orderNo, channelServiceNo: pobj.actionBody.orderNo,
channelOrderNo: pobj.actionBody.orderNo, channelOrderNo: pobj.actionBody.orderNo,
...@@ -117,7 +115,9 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -117,7 +115,9 @@ class RegCenterOrderService extends AppServiceBase {
orderNo: pobj.actionBody.channelOrder.channelOrderNo, orderNo: pobj.actionBody.channelOrder.channelOrderNo,
orderPrice: Number(pobj.actionBody.orderPrice / 100), orderPrice: Number(pobj.actionBody.orderPrice / 100),
phone: pobj.actionBody.publishMobile, phone: pobj.actionBody.publishMobile,
needId: solutiondata.data.channelNeedNo needId: solutiondata.data.channelNeedNo,
price_desc : pobj.actionBody.taxpayerType,
additions_desc : pobj.actionBody.companyProperties
// companyName:solutiondata.data.solutionContent.CompanyName || '' // companyName:solutiondata.data.solutionContent.CompanyName || ''
}, },
appInfo: pobj.appInfo appInfo: pobj.appInfo
...@@ -382,7 +382,20 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -382,7 +382,20 @@ class RegCenterOrderService extends AppServiceBase {
//提交reg注册方案 //提交reg注册方案
async regSubmitSolution(pobj) { async regSubmitSolution(pobj) {
console.log('reg --- pobj -----',pobj) console.log('reg --- pobj -----',pobj)
var res = await this.reqCenterOrderApi(pobj, "action/regapi/springBoard"); var s
var subSnLength
if(pobj.actionBody.solutionList){
subSnLength = pobj.actionBody.solutionList.length
for(s = 0; s < subSnLength; s++){
if(!pobj.actionBody.solutionList[s].solutionContent.solution.channelSolutionNo){
var res = await this.reqCenterOrderApi(pobj, "action/regapi/springBoard");
}else{
pobj.actionType = "updateSolution"
var res = await this.reqCenterOrderApi(pobj, "action/regapi/springBoard");
}
}
}
if (res && res.status == 0 && res.data && res.data.needinfo && res.data.needsolutions) { if (res && res.status == 0 && res.data && res.data.needinfo && res.data.needsolutions) {
console.log('reg --- res -----',res) console.log('reg --- res -----',res)
var needinfo = res.data.needinfo;//需求信息 var needinfo = res.data.needinfo;//需求信息
...@@ -394,22 +407,36 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -394,22 +407,36 @@ class RegCenterOrderService extends AppServiceBase {
//推送数据至baidu //推送数据至baidu
var i=0; var i=0;
var needsolutionsLength = needsolutions.length; var needsolutionsLength = needsolutions.length;
var channelSolutionNo;
for(i=0;i<needsolutionsLength;i++){ for(i=0;i<needsolutionsLength;i++){
bizTypes = needsolutions[i].solutionContent; bizTypes = needsolutions[i].solutionContent;
console.log('bizTypes-----',bizTypes) console.log('bizTypes-----',bizTypes)
bizTypes = JSON.parse(bizTypes) console.log('bizTypes type-----',typeof(bizTypes))
console.log('bizTypes++++',bizTypes) if(typeof(bizTypes) == 'string'){
bizTypes = JSON.parse(bizTypes)
}
bizTypes.solution.area = regCfg.baiduAreaCode[bizTypes.solution.area] bizTypes.solution.area = regCfg.baiduAreaCode[bizTypes.solution.area]
bizTypes.solution.serviceArea = bizTypes.solution.area bizTypes.solution.serviceArea = bizTypes.solution.area
bizTypes.solution.isWhether = true//是否刻章,必带刻章true bizTypes.solution.isWhether = true//是否刻章,必带刻章true
var list = { //根据前端传参channelSolutionNo判断是新建方案还是修改方案
gsbBizId:needsolutions[i].solutionNo, if(pobj.actionBody.solutionList[i].solutionContent.solution.channelSolutionNo){
// bizType:"GSREG", channelSolutionNo = pobj.actionBody.solutionList[i].solutionContent.solution.channelSolutionNo
bizType:bizTypes.bizType, var list = {
solutionContent:bizTypes.solution bizId:channelSolutionNo,
gsbBizId:needsolutions[i].solutionNo,
bizType:bizTypes.bizType,
solutionContent:bizTypes.solution
}
}else{
var list = {
gsbBizId:needsolutions[i].solutionNo,
bizType:bizTypes.bizType,
solutionContent:bizTypes.solution
}
} }
solutionList.push(list) solutionList.push(list)
} }
var pushObj = { var pushObj = {
intentionBizId: needinfo.channelNeedNo, intentionBizId: needinfo.channelNeedNo,
solutionList:solutionList solutionList:solutionList
...@@ -417,8 +444,8 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -417,8 +444,8 @@ class RegCenterOrderService extends AppServiceBase {
console.log('pushObj---pushObj---',pushObj) console.log('pushObj---pushObj---',pushObj)
var pushBaiduRegSolution = await this.pushBaiduRegSolution(pushObj, pobj.appInfo, self); var pushBaiduRegSolution = await this.pushBaiduRegSolution(pushObj, pobj.appInfo, self);
console.log('pushBaiduRegSolution+++',pushBaiduRegSolution) console.log('pushBaiduRegSolution+++',pushBaiduRegSolution)
if(pushBaiduRegSolution.data.status != 0 ){ if(pushBaiduRegSolution.status != 0 ){
return system.getResultFail(-101,pushBaiduRegSolution.data.msg) return system.getResultFail(-101,pushBaiduRegSolution.msg)
} }
} }
this.logCtl.info({ this.logCtl.info({
...@@ -460,7 +487,7 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -460,7 +487,7 @@ class RegCenterOrderService extends AppServiceBase {
var a = await self.reqCenterOrderApi(reqObj2);//保存渠道方案id,用户确认方案url var a = await self.reqCenterOrderApi(reqObj2);//保存渠道方案id,用户确认方案url
console.log("保存渠道方案id,用户确认方案url aaaa++ ",a) console.log("保存渠道方案id,用户确认方案url aaaa++ ",a)
} }
return pushRes; return pushRes.data;
} }
//reg关闭需求 //reg关闭需求
...@@ -586,6 +613,9 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -586,6 +613,9 @@ class RegCenterOrderService extends AppServiceBase {
} }
if (result.data == regCfg.uappId.baidu) { if (result.data == regCfg.uappId.baidu) {
var ress = await self.baiduRegClient.baiduReqbyget({ path: "/v1/provider/demand?addCommRecord=", reqbody: pushObj }); var ress = await self.baiduRegClient.baiduReqbyget({ path: "/v1/provider/demand?addCommRecord=", reqbody: pushObj });
if(ress.data.status != 0 ){
return system.getResultFail(ress.data.msg)
}
console.log("regWriteCommunicationLog---------", ress) console.log("regWriteCommunicationLog---------", ress)
} }
} }
...@@ -610,7 +640,7 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -610,7 +640,7 @@ class RegCenterOrderService extends AppServiceBase {
appInfo: pobj.appInfo appInfo: pobj.appInfo
} }
self.utilsPushSve.baiduBusiness2Fq(fqobj, "aliFollowup"); self.utilsPushSve.baiduBusiness2Fq(fqobj, "aliFollowup");
return system.getResultSuccess(); return result
} }
//reg查询沟通记录 //reg查询沟通记录
......
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