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