Commit 4316d10c by 庄冰

push2ali

parent cdd4fabc
...@@ -22,35 +22,39 @@ class CenterorderService{ ...@@ -22,35 +22,39 @@ class CenterorderService{
async submitProgramme(pobj){ async submitProgramme(pobj){
var res = await this.reqCenterOrderApi(pobj); var res = await this.reqCenterOrderApi(pobj);
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"){
// var bizType = ab.solutionContent.bizType || "";//业务类型里 ab.solutionContent = JSON.parse(ab.solutionContent);
// var pushObj = { }
// intentionBizId:needinfo.channelNeedNo,bizType:bizType,solution:ab.solutionContent.solution //推送数据至阿里
// }; var bizType = ab.solutionContent.bizType || "";//业务类型里
// //推送方案 var pushObj = {
// this.aliclient.reqbyget({action:"SubmitSolution",reqbody:pushObj}).then(pushRes=>{ intentionBizId:needinfo.channelNeedNo,bizType:bizType,solution:JSON.stringify(ab.solutionContent.solution)
// if(pushRes && pushRes.status==0 && pushRes.data){ };
// var resData = pushRes.data; var self = this;
// var reqObj2 = { //推送方案
// actionType:"receiveProgrammeNo", this.aliclient.reqbyget({action:"SubmitSolution",reqbody:pushObj}).then(pushRes=>{
// actionBody:{ if(pushRes && pushRes.status==0 && pushRes.data){
// solutionNo:needsolution.solutionNo, var resData = pushRes.data;
// solutionBizId:resData.SolutionBizId var reqObj2 = {
// } actionType:"receiveProgrammeNo",
// }; actionBody:{
// await this.reqCenterOrderApi(reqObj2);//保存渠道方案id solutionNo:needsolution.solutionNo,
// } solutionBizId:resData.SolutionBizId
// }); }
// //推送需求小记 };
// if(needinfo.pushflag && needinfo.pushflag==1){//推送标志 值为1推送需求小记 self.reqCenterOrderApi(reqObj2);//保存渠道方案id
// var pushObj2={ }
// intentionBizId:needinfo.channelNeedNo,note:"创建方案" });
// }; //推送需求小记
// this.aliclient.reqbyget({action:"SubmitIntentionNote",reqbody:pushObj2}); if(needinfo.pushflag && needinfo.pushflag==1){//推送标志 值为1推送需求小记
// } var pushObj2={
intentionBizId:needinfo.channelNeedNo,note:"创建方案"
};
this.aliclient.reqbyget({action:"SubmitIntentionNote",reqbody:pushObj2});
}
} }
return system.getResultSuccess(); return system.getResultSuccess();
} }
...@@ -59,17 +63,65 @@ class CenterorderService{ ...@@ -59,17 +63,65 @@ class CenterorderService{
var res = await this.reqCenterOrderApi(pobj); var res = await this.reqCenterOrderApi(pobj);
if(res && res.status==0 && res.data && res.data.channelSolutionNo){ if(res && res.status==0 && res.data && res.data.channelSolutionNo){
//推送数据至阿里 //推送数据至阿里
// var pushObj = { var pushObj = {
// solutionBizId:res.data.channelSolutionNo,note:pobj.actionBody.note || "" solutionBizId:res.data.channelSolutionNo,note:pobj.actionBody.note || ""
// }; };
// this.aliclient.reqbyget({action:"RejectSolution",reqbody:pushObj}) this.aliclient.reqbyget({action:"RejectSolution",reqbody:pushObj})
} }
return res; return res;
} }
} }
module.exports = CenterorderService; module.exports = CenterorderService;
// var task = new CenterorderService(); // var task = new CenterorderService();
// task.aliclient.reqbyget({action:"SubmitSolution",reqbody:{}}).then(d=>{ // var pobj={
// "actionType":"submitProgramme",
// "actionBody":{
// "needNo":"I20200323132918000001",
// "solutionContent":'{"bizType":"esp.companyreg","solution":{"companyName":"北京联大共享科技有限公司","city":"北京市","area":"朝阳区","companyCategory":"内资小规模","companyType":"集团","orgType":"有限公司","industryType":"科技类","scope":"测试经营范围","remark":"方案备注测试方案"},"notes":"","totalSum":""}',
// "createUserId":177,
// "channelNeedNo":"I20200323132918000001",
// "solutionNo":"NS2020032315041UIBzq",
// "status":"dqr"
// },
// "appInfo":{
// "id":17,
// "app_hosts":"gsbweb.qifu.gongsibao.com",
// "app_code":"gsbweb",
// "app_name":"公司宝官网web应用",
// "uapp_id":"22",
// "uapp_key":"201912141625",
// "uapp_secret":"8cbb846776874167b5c7e01cd0116c66",
// "contact_name":"宋毅",
// "contact_mobile":"15010929366",
// "contact_email":null,
// "is_enabled":1,
// "is_sign":0,
// "pay_type":"10",
// "delivery_type":"10",
// "created_at":"2020-03-11T22:13:48.000Z",
// "version":0,
// "token":"d23241c188814e12af41d7c9032712d3"
// },
// "actionProcess":"gsbweb",
// "userInfo":{
// "id":177,
// "uapp_id":22,
// "channel_userid":"13075556693",
// "channel_username":"13075556693",
// "channel_nickname":"庄冰",
// "open_id":null,
// "head_url":null,
// "mobile":"13075556693",
// "org_name":"汉唐集团",
// "org_path":"",
// "email":"",
// "is_admin":0,
// "is_super":0,
// "is_enabled":1,
// "userpin":"c49330125e0445019d1ea5acfcb41927"
// }
// };
// task.submitProgramme(pobj).then(d=>{
// console.log(d,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); // console.log(d,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
// }) // })
// 提方案-SubmitSolution // 提方案-SubmitSolution
......
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