Commit 7f58b9e1 by 宋毅

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

parents 5713a212 413d5fd7
...@@ -4,6 +4,7 @@ var settings = require("../../../../config/settings"); ...@@ -4,6 +4,7 @@ var settings = require("../../../../config/settings");
class Ic extends APIBase { class Ic extends APIBase {
constructor() { constructor() {
super(); super();
this.centerorderSve = system.getObject("service.common.centerorderSve");
} }
/** /**
...@@ -19,16 +20,19 @@ class Ic extends APIBase { ...@@ -19,16 +20,19 @@ class Ic extends APIBase {
if (!pobj.actionType) { if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空"); return system.getResult(null, "actionType参数不能为空");
} }
var result = await this.opActionProcess(pobj,pobj.actionProcess, pobj.actionType, pobj.actionBody, req); var result = await this.opActionProcess(pobj, pobj.actionProcess, pobj.actionType, pobj.actionBody, req);
return result; return result;
} }
async opActionProcess(pobj,action_process, action_type, action_body, req) { async opActionProcess(pobj, action_process, action_type, action_body, req) {
var opResult = null; var opResult = null;
switch (action_type) { switch (action_type) {
case "deliveryInfo"://办理公司表单数据 case "deliveryInfo"://办理公司表单数据
break; break;
case "deliveryStatus"://办理公司状态 case "deliveryStatus"://办理公司状态
break; break;
case "reqCenterOrderApi"://办理公司状态
break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
......
...@@ -25,10 +25,10 @@ class CenterorderService{ ...@@ -25,10 +25,10 @@ class CenterorderService{
var needinfo = res.data.needinfo;//需求信息 var needinfo = res.data.needinfo;//需求信息
var needsolution = res.data.needsolution;//方案信息 var needsolution = res.data.needsolution;//方案信息
//推送数据至阿 //推送数据至阿
// var bizType = pobj.actionBody.solutionContent.bizType || "";//业务类型里 var bizType = pobj.actionBody.solutionContent.bizType || "";//业务类型里
// var pushObj = { var pushObj = {
// intentionBizId:needinfo.channelNeedNo,bizType:bizType,solution:ab.solutionContent.solution intentionBizId:needinfo.channelNeedNo,bizType:bizType,solution:ab.solutionContent.solution
// }; };
// var pushRes = await this.aliclient.reqbyget({action:"",reqbody:pushObj}); // var pushRes = await this.aliclient.reqbyget({action:"",reqbody:pushObj});
// if(pushRes && pushRes.SolutionBizId){ // if(pushRes && pushRes.SolutionBizId){
// var reqObj2 = { // var reqObj2 = {
...@@ -40,9 +40,8 @@ class CenterorderService{ ...@@ -40,9 +40,8 @@ class CenterorderService{
// }; // };
// await this.reqCenterOrderApi(reqObj2);//保存渠道方案id // await this.reqCenterOrderApi(reqObj2);//保存渠道方案id
// } // }
return system.getResultSuccess();
} }
return res; return system.getResultSuccess();
} }
//服务商方案作废 //服务商方案作废
async abolishProgramme(pobj){ async abolishProgramme(pobj){
...@@ -53,9 +52,10 @@ class CenterorderService{ ...@@ -53,9 +52,10 @@ class CenterorderService{
solutionBizId:res.data.channelNeedNo,note:pobj.actionBody.note || "" solutionBizId:res.data.channelNeedNo,note:pobj.actionBody.note || ""
}; };
// var pushRes = await this.aliclient.reqbyget({action:"",reqbody:pushObj}); // var pushRes = await this.aliclient.reqbyget({action:"",reqbody:pushObj});
return system.getResultSuccess();
} }
return res; return res;
} }
} }
module.exports = CenterorderService; module.exports = CenterorderService;
...@@ -14,11 +14,11 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -14,11 +14,11 @@ class UtilsNeedSve extends AppServiceBase {
* @param {*} actionBody * @param {*} actionBody
*/ */
async submitNeed(pobj, actionBody) { async submitNeed(pobj, actionBody) {
if (!actionBody.needNo) { if (!actionBody.intentionBizId) {
return system.getResult(null, "actionBody.needNo can not be empty,100380"); return system.getResult(null, "actionBody.intentionBizId can not be empty,100380");
} }
var reqUrl = this.centerOrderUrl + "action/need/springBoard"; var reqUrl = this.centerOrderUrl + "action/need/springBoard";
return await this.restPostUrl(pobj, url); return await this.restPostUrl(pobj, reqUrl);
} }
/** /**
* 获取需求详情 * 获取需求详情
...@@ -26,8 +26,8 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -26,8 +26,8 @@ class UtilsNeedSve extends AppServiceBase {
* @param {*} actionBody needNo 需求号 * @param {*} actionBody needNo 需求号
*/ */
async getItemByNeedNo(pobj, actionBody) { async getItemByNeedNo(pobj, actionBody) {
if (!actionBody.needNo) { if (!actionBody.intentionBizId) {
return system.getResult(null, "actionBody.needNo can not be empty,100380"); return system.getResult(null, "actionBody.intentionBizId can not be empty,100380");
} }
var reqUrl = this.centerOrderUrl + "action/need/springBoard"; var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var itemResult = await this.restPostUrl(pobj, reqUrl); var itemResult = await this.restPostUrl(pobj, reqUrl);
...@@ -39,11 +39,11 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -39,11 +39,11 @@ class UtilsNeedSve extends AppServiceBase {
* @param {*} actionBody * @param {*} actionBody
*/ */
async needClose(pobj, actionBody) { async needClose(pobj, actionBody) {
if (!actionBody.needNo) { if (!actionBody.intentionBizId) {
return system.getResult(null, "actionBody.needNo can not be empty,100380"); return system.getResult(null, "actionBody.intentionBizId can not be empty,100380");
} }
var reqUrl = this.centerOrderUrl + "action/need/springBoard"; var reqUrl = this.centerOrderUrl + "action/need/springBoard";
return await this.restPostUrl(pobj, url); return await this.restPostUrl(pobj, reqUrl);
} }
} }
module.exports = UtilsNeedSve; module.exports = UtilsNeedSve;
......
const Client = require('aliyun-api-gateway').Client; const Client = require('aliyun-api-gateway').Client;
var RPCClient = require('@alicloud/pop-core').RPCClient;
class aliyunClient { class aliyunClient {
constructor() { constructor() {
this.aliclient = new RPCClient({
accessKeyId: "LTAI1pJs7KQizBe2",
accessKeySecret: "MMNibebAPqR9AnX5YWHnSL2tHMSIoL",
endpoint: "https://companyreg.aliyuncs.com",
apiVersion: "2020-03-06"
});
} }
async post(aliReqUrl, key, secret, actionBody) { async post(aliReqUrl, key, secret, actionBody) {
const client = new Client(key, secret); const client = new Client(key, secret);
...@@ -18,12 +26,6 @@ class aliyunClient { ...@@ -18,12 +26,6 @@ class aliyunClient {
} }
//阿里接口 //阿里接口
async reqbyget(obj, cbk) { async reqbyget(obj, cbk) {
const aliclient = new RPCClient({
accessKeyId: 'LTAI4FmyipY1wuLHjLhMWiPa',
accessKeySecret: 'hp4FF18IDCSym1prqzxrAjnnhNH3ju',
endpoint: 'https://trademark.aliyuncs.com',
apiVersion: '2018-07-24'
});
var action = obj.action; var action = obj.action;
var reqbody = obj.reqbody; var reqbody = obj.reqbody;
return this.aliclient.request(action, reqbody, { return this.aliclient.request(action, reqbody, {
......
...@@ -57,7 +57,7 @@ var settings = { ...@@ -57,7 +57,7 @@ var settings = {
}, },
centerOrderUrl: function () { centerOrderUrl: function () {
if (this.env == "dev") { if (this.env == "dev") {
return "http://centerorder.apps.com:4011/"; return "http://192.168.0.103:4011/";
} else { } else {
return "http://center-order-service/"; return "http://center-order-service/";
} }
......
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