Commit 4316d10c by 庄冰

push2ali

parent cdd4fabc
......@@ -22,35 +22,39 @@ class CenterorderService{
async submitProgramme(pobj){
var res = await this.reqCenterOrderApi(pobj);
if(res && res.status==0 && res.data && res.data.needinfo && res.data.needsolution){
// var needinfo = res.data.needinfo;//需求信息
// var needsolution = res.data.needsolution;//方案信息
// var ab = pobj.actionBody;
// //推送数据至阿里
// var bizType = ab.solutionContent.bizType || "";//业务类型里
// var pushObj = {
// intentionBizId:needinfo.channelNeedNo,bizType:bizType,solution:ab.solutionContent.solution
// };
// //推送方案
// this.aliclient.reqbyget({action:"SubmitSolution",reqbody:pushObj}).then(pushRes=>{
// if(pushRes && pushRes.status==0 && pushRes.data){
// var resData = pushRes.data;
// var reqObj2 = {
// actionType:"receiveProgrammeNo",
// actionBody:{
// solutionNo:needsolution.solutionNo,
// solutionBizId:resData.SolutionBizId
// }
// };
// await this.reqCenterOrderApi(reqObj2);//保存渠道方案id
// }
// });
// //推送需求小记
// if(needinfo.pushflag && needinfo.pushflag==1){//推送标志 值为1推送需求小记
// var pushObj2={
// intentionBizId:needinfo.channelNeedNo,note:"创建方案"
// };
// this.aliclient.reqbyget({action:"SubmitIntentionNote",reqbody:pushObj2});
// }
var needinfo = res.data.needinfo;//需求信息
var needsolution = res.data.needsolution;//方案信息
var ab = pobj.actionBody;
if(typeof(ab.solutionContent) == "string"){
ab.solutionContent = JSON.parse(ab.solutionContent);
}
//推送数据至阿里
var bizType = ab.solutionContent.bizType || "";//业务类型里
var pushObj = {
intentionBizId:needinfo.channelNeedNo,bizType:bizType,solution:JSON.stringify(ab.solutionContent.solution)
};
var self = this;
//推送方案
this.aliclient.reqbyget({action:"SubmitSolution",reqbody:pushObj}).then(pushRes=>{
if(pushRes && pushRes.status==0 && pushRes.data){
var resData = pushRes.data;
var reqObj2 = {
actionType:"receiveProgrammeNo",
actionBody:{
solutionNo:needsolution.solutionNo,
solutionBizId:resData.SolutionBizId
}
};
self.reqCenterOrderApi(reqObj2);//保存渠道方案id
}
});
//推送需求小记
if(needinfo.pushflag && needinfo.pushflag==1){//推送标志 值为1推送需求小记
var pushObj2={
intentionBizId:needinfo.channelNeedNo,note:"创建方案"
};
this.aliclient.reqbyget({action:"SubmitIntentionNote",reqbody:pushObj2});
}
}
return system.getResultSuccess();
}
......@@ -59,17 +63,65 @@ class CenterorderService{
var res = await this.reqCenterOrderApi(pobj);
if(res && res.status==0 && res.data && res.data.channelSolutionNo){
//推送数据至阿里
// var pushObj = {
// solutionBizId:res.data.channelSolutionNo,note:pobj.actionBody.note || ""
// };
// this.aliclient.reqbyget({action:"RejectSolution",reqbody:pushObj})
var pushObj = {
solutionBizId:res.data.channelSolutionNo,note:pobj.actionBody.note || ""
};
this.aliclient.reqbyget({action:"RejectSolution",reqbody:pushObj})
}
return res;
}
}
module.exports = 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,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
// })
// 提方案-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