Commit b970d779 by 宋毅

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

parents e703ccf1 f863e335
const system = require("../system");
const settings = require("../../config/settings");
const uuidv4 = require('uuid/v4');
const sha256 = require('sha256');
const md5 = require("MD5");
class APIBase {
constructor() {
this.restClient = system.getObject("util.restClient");
this.redisClient = system.getObject("util.redisClient");
this.cacheManager = system.getObject("db.common.cacheManager");
this.logCtl = system.getObject("service.common.oplogSve");
this.toolSve = system.getObject("service.trademark.toolSve");
this.exTime = 6 * 3600;//缓存过期时间,6小时
this.cacheMethodList = [
];
}
getUUID() {
var uuid = uuidv4();
......@@ -20,6 +25,12 @@ class APIBase {
async doexecMethod(gname, methodname, pobj, query, req) {
req.requestId = this.getUUID();
try {
var shaStr = await sha256(JSON.stringify(pobj));
//查询缓存
var cacheRes = await this.redisClient.get(shaStr);
if (cacheRes) {
return JSON.parse(cacheRes);
}
var rtn = await this[methodname](pobj, query, req);
this.logCtl.createDb({
appid: req.app.id,
......@@ -33,6 +44,10 @@ class APIBase {
opTitle: "api服务提供方appKey:" + settings.appKey,
});
rtn.requestId = req.requestId;
if(this.cacheMethodList.indexOf(methodname)>=0 && rtn.status && rtn.status==0){
//保存缓存
await this.redisClient.setWithEx(shaStr, JSON.stringify(rtn), 3600);
}
return rtn;
} catch (e) {
console.log(e.stack, "api调用出现异常,请联系管理员..........")
......
......@@ -23,11 +23,14 @@ class QcAPI extends APIBase {
var opResult = null;
switch (action_type) {
case "getNeedSolutionDetailByUser"://获取方案详情
opResult = await this.centerorderSve.reqCenterOrderApi(pobj,"action/icpapi/springBoard");
opResult = await this.centerorderSve.reqCenterOrderApi(pobj,"action/qcapi/springBoard");
break;
case "submitIcpProgramme"://icp方案提交
opResult = await this.centerorderSve.submitIcpProgramme(pobj);
break;
case "receiveProgrammeNo"://接收渠道方案号(测试)
opResult = await this.centerorderSve.reqCenterOrderApi(pobj);
break;
case "submitIcpMaterial"://icp材料提交
opResult = await this.centerorderSve.submitIcpMaterial(pobj);
break;
......@@ -38,7 +41,17 @@ class QcAPI extends APIBase {
opResult = await this.centerorderSve.abolishIcpProgramme(pobj);
break;
case "getProgrammeInfoByChannelNeedNo"://获取需求方案列表
opResult = await this.centerorderSve.reqCenterOrderApi(pobj,"action/icpapi/springBoard");
opResult = await this.centerorderSve.reqCenterOrderApi(pobj,"action/qcapi/springBoard");
break;
case "serviceProviderSubmitMaterial"://交付商提交材料信息
opResult = await this.centerorderSve.serviceProviderSubmitMaterial(pobj);
break;
case "serviceProviderNotification"://交付商通知状态变更
opResult = await this.centerorderSve.serviceProviderNotification(pobj);
break;
case "closeOrderDelivery"://交付商关闭交付单
opResult = await this.centerorderSve.closeOrderDelivery(pobj);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
......
......@@ -58,16 +58,22 @@ class Need extends APIBase {
break;
case "icpFeedbackSubmit"://icp接收方案反馈信息
pobj.actionType = "receiveIcpFeedback";
opResult = await this.utilsNeedSve.reqCenterOrderApi(pobj);
opResult = await this.utilsNeedSve.reqCenterOrderQcApi(pobj);
break;
case "icpNotify"://icp方案更新
var rtn = await this.utilsNeedSve.icpNotify(pobj, pobj.actionBody);
if (pobj.actionBody.status == 4 && rtn.status == 0) {
if (pobj.actionBody.status == 2 && rtn.status == 0) {
opResult = await self.centerorderSve.icppaysuccess(pobj, pobj.actionBody);
} else {
opResult = rtn;
}
break;
case "writeCommunicationLog"://icp接收方案反馈信息
opResult = await this.utilsNeedSve.writeCommunicationLog(pobj);
break;
case "queryExpertApplyCommunicationLogs"://icp接收方案反馈信息
opResult = await this.utilsNeedSve.queryExpertApplyCommunicationLogs(pobj);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
......@@ -5,6 +5,7 @@ const AppServiceBase = require("../../app.base");
class CenterorderService extends AppServiceBase {
constructor() {
super();
this.qifubaoUrl = settings.qifubaoUrl();
this.centerOrderUrl = settings.centerOrderUrl();
this.execClient = system.getObject("util.execClient");
this.aliclient = system.getObject("util.aliyunClient");
......@@ -199,8 +200,21 @@ class CenterorderService extends AppServiceBase {
return system.getResultSuccess();
}
async icppaysuccess(pobj) {
/**
* 推送ICP交付信息至企业宝(交付系统)
*/
async pushIcpOrderDelivery2Qfb(orderNo, needsolution) {
var pushObj = {
orderNo: orderNo,
needsolution: needsolution.solutionContent
};
var url = this.qifubaoUrl + "xxx/xxxxx";
var rtn = await this.execClient.execPost(pushObj, url);
var data = JSON.parse(rtn.stdout);
return system.getResultSuccess(data);
}
async icppaysuccess(pobj) {
var sobj = {
actionType: "getaliicpProduce",
// actionBody: { typeCode: itemResult.data.channelTypeCode, province: itemResult.data.province },
......@@ -225,6 +239,8 @@ class CenterorderService extends AppServiceBase {
pobj.actionBody.payTotalSum = data.data.price;
pobj.actionBody.payCode = data.data.payCode;
pobj.actionBody.channelItemCode = data.data.channelItemCode;
pobj.actionBody.channelNeedNo = data.data.channelNeedNo;
pobj.actionBody.needNo = data.data.needNo;
pobj.actionBody.quantity = 1;
pobj.actionBody.channelOrder = {
channelServiceNo: pobj.actionBody.orderNo,
......@@ -232,19 +248,18 @@ class CenterorderService extends AppServiceBase {
orderStatus: 2
}
var orderrtn = await this.utilsOrderSve.addOrder(pobj, pobj.actionBody);
if (orderrtn.status != 0) {
if (orderrtn.status == -1) {
return system.getResultSuccess(null, "订单已经创建");
}
if (orderrtn.status != 0 && orderrtn.status != -1) {
return system.getResultFail(-5012, "订单创建失败");
}
if (orderrtn.data) {
pobj.actionBody.orderNo = orderrtn.data.orderNo
}
pobj.actionBody.channelSolutionNo = pobj.actionBody.bizId;
pobj.actionType = "receiveSolutionPayInfo";
var url = settings.centerOrderUrl() + "action/icapi/springBoard";
var solutionrtn = await this.execClient.execPost(pobj, url);
console.log(solutionrtn);
if (!solutionrtn || !solutionrtn.stdout) {
return system.getResultFail(-5011, "方案查询失败");
}
......@@ -255,20 +270,31 @@ class CenterorderService extends AppServiceBase {
if (solutiondata.data && solutiondata.data.channelNeedNo) {
pobj.actionBody.needId = solutiondata.data.channelNeedNo;
}
if(pobj.actionBody.channelItemCode=='5'){
pobj.actionBody.regType="ali.icp";
}else if(pobj.actionBody.channelItemCode=='7'){
pobj.actionBody.regType="ali.edi";
}
if (solutiondata.status == 0) {
pobj.actionBody.orderNo = pobj.actionBody.channelOrder.channelOrderNo;
this.utilsPushSve.aliBusiness2Fq(pobj, "paySuccess");
if (pobj.actionBody.channelItemCode == '5') {
pobj.actionBody.regType = "ali.icp";
} else if (pobj.actionBody.channelItemCode == '7') {
pobj.actionBody.regType = "ali.edi";
}
var fqobj = {
"actionType": "getAppInterface",
"actionBody": {
"area": pobj.actionBody.province,
"city": pobj.actionBody.province,
"regType": pobj.actionBody.regType,
"orderNo": pobj.actionBody.channelOrder.channelOrderNo,
"orderPrice": pobj.actionBody.orderPrice,
"phone": pobj.actionBody.publishMobile,
"needId": solutiondata.data.channelNeedNo
},
"appInfo": pobj.appInfo
}
this.utilsPushSve.aliBusiness2Fq(fqobj, "pushOrderICPBusiness");
return system.getResultSuccess();
}
//--------------------------阿里IC---end--------------------------------------------------------
//--------------------------阿里ICP---start--------------------------------------------------------
//--------------------------阿里ICP---start------无效已迁移至qcCenterOrderSve.js--------------------------------------------------
//提交公司注册方案
async submitIcpProgramme(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/icpapi/springBoard");
......@@ -292,7 +318,7 @@ class CenterorderService extends AppServiceBase {
};
var self = this;
//推送方案
this.pushIcpSolution(pushObj,needsolution.solutionNo,pobj.appInfo,self);
this.pushIcpSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self);
return system.getResultSuccess();
}
return res;
......@@ -315,7 +341,7 @@ class CenterorderService extends AppServiceBase {
var a = await self.reqCenterOrderApi(reqObj2);//保存渠道方案id
if (a && a.status == 0) {
//推送方案确认信息
await self.aliclient.reqbyget({action:"ConfirmIntention",reqbody:{BizId:pushObj.IntentionBizId},apiVersion:"2019-05-08"});
await self.aliclient.reqbyget({ action: "ConfirmIntention", reqbody: { BizId: pushObj.IntentionBizId }, apiVersion: "2019-05-08" });
}
}
}
......@@ -361,7 +387,7 @@ class CenterorderService extends AppServiceBase {
};
var self = this;
//推送方案材料
self.aliclient.reqbyget({action:"SavePartnerSubmitMaterial",reqbody:pushObj,apiVersion:"2019-05-08"});
self.aliclient.reqbyget({ action: "SavePartnerSubmitMaterial", reqbody: pushObj, apiVersion: "2019-05-08" });
return system.getResultSuccess();
}
return res;
......@@ -374,12 +400,12 @@ class CenterorderService extends AppServiceBase {
//推送数据至阿里
// var pushObj = res.data;
var pushObj = {
BizId:res.data.BizId,
OfficialFileURL:res.data.OfficialFileURL,
ApplicationStatus:res.data.ApplicationStatus
BizId: res.data.BizId,
OfficialFileURL: res.data.OfficialFileURL,
ApplicationStatus: res.data.ApplicationStatus
};
//推送方案
this.aliclient.reqbyget({action:"AcceptPartnerNotification",reqbody:pushObj,apiVersion:"2019-05-08"});
this.aliclient.reqbyget({ action: "AcceptPartnerNotification", reqbody: pushObj, apiVersion: "2019-05-08" });
return system.getResultSuccess();
}
return res;
......@@ -398,81 +424,81 @@ class CenterorderService extends AppServiceBase {
BizId: ab.BizId, Note: ab.Note
};
//关闭方案
this.aliclient.reqbyget({action:"CloseIcpProduce",reqbody:pushObj,apiVersion:"2019-05-08"});
this.aliclient.reqbyget({ action: "CloseIcpProduce", reqbody: pushObj, apiVersion: "2019-05-08" });
return system.getResultSuccess();
}
return res;
}
//--------------------------阿里ICP---end--------------------------------------------------------
//LOGO场景接口服务
async downloadlogoscene(pobj){
async downloadlogoscene(pobj) {
var reqUrl = "http://123.57.217.203:4724/api/downloadscene";//"http://ailogo-service/api/downloadscene";
var obj = pobj.actionBody;
if(!obj.title){
return system.getResult(null,"品牌名称不能为空");
if (!obj.title) {
return system.getResult(null, "品牌名称不能为空");
}
if(!obj.id){
return system.getResult(null,"品牌id不能为空");
if (!obj.id) {
return system.getResult(null, "品牌id不能为空");
}
var rtn = null;
try {
rtn = await this.execClient.execPost(obj, reqUrl);
var res = JSON.parse(rtn.stdout);
return res;
}catch (e) {
return system.getResult(null,"获取logo场景异常");
} catch (e) {
return system.getResult(null, "获取logo场景异常");
}
}
//换一批logo
async changelogo(pobj){
async changelogo(pobj) {
var reqUrl = "http://123.57.217.203:4724/api/changelogo";
var obj = pobj.actionBody;
if(!obj.title){
return system.getResult(null,"品牌名称不能为空");
if (!obj.title) {
return system.getResult(null, "品牌名称不能为空");
}
if(!obj.profession){
return system.getResult(null,"行业名称不能为空");
if (!obj.profession) {
return system.getResult(null, "行业名称不能为空");
}
if(!obj.description){
obj.description="";
if (!obj.description) {
obj.description = "";
}
var rtn = null;
try {
rtn = await this.execClient.execPost(obj, reqUrl);
var res = JSON.parse(rtn.stdout);
return res;
}catch (e) {
return system.getResult(null,"获取logo异常");
} catch (e) {
return system.getResult(null, "获取logo异常");
}
}
//生成logo
async singlelogo(pobj){
async singlelogo(pobj) {
var reqUrl = "http://123.57.217.203:4724/api/singlelogo";
var obj = pobj.actionBody;
if(!obj.title){
return system.getResult(null,"品牌名称不能为空");
if (!obj.title) {
return system.getResult(null, "品牌名称不能为空");
}
// if(!obj.subtitle){
// return system.getResult(null,"品牌标语不能为空");
// }
if(!obj.profession){
return system.getResult(null,"行业名称不能为空");
if (!obj.profession) {
return system.getResult(null, "行业名称不能为空");
}
if(!obj.description){
obj.description="";
if (!obj.description) {
obj.description = "";
}
var rtn = null;
try {
rtn = await this.execClient.execPost(obj, reqUrl);
var res = JSON.parse(rtn.stdout);
if(res && res.status==0 && res.data){
if (res && res.status == 0 && res.data) {
return res;//system.getResultSuccess(res.data);
}else{
return system.getResult(null,"生成logo操作失败");
} else {
return system.getResult(null, "生成logo操作失败");
}
}catch (e) {
return system.getResult(null,"生成logo操作异常");
} catch (e) {
return system.getResult(null, "生成logo操作异常");
}
}
}
......
......@@ -3,7 +3,7 @@ const crypto = require('crypto');
var settings = require("../../../../config/settings");
const AppServiceBase = require("../../app.base");
/**
* 资质信息提报相关接口
* 资质信息提报相关接口(ICP\EDI)
*/
class QcCenterOrderService extends AppServiceBase {
constructor() {
......@@ -50,7 +50,7 @@ class QcCenterOrderService extends AppServiceBase {
};
var self = this;
//推送方案
// this.pushIcpSolution(pushObj,needsolution.solutionNo,pobj.appInfo,self);
this.pushIcpSolution(pushObj,needsolution.solutionNo,pobj.appInfo,self);
return system.getResultSuccess();
}
return res;
......@@ -78,7 +78,7 @@ class QcCenterOrderService extends AppServiceBase {
}
}
}
//icp材料提交
//icp材料提交(停用)
async submitIcpMaterial(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
......@@ -108,12 +108,12 @@ class QcCenterOrderService extends AppServiceBase {
};
var self = this;
//推送方案材料
self.aliclient.reqbyget({action:"SavePartnerSubmitMaterial",reqbody:pushObj,apiVersion:"2019-05-08"});
// self.aliclient.reqbyget({action:"SavePartnerSubmitMaterial",reqbody:pushObj,apiVersion:"2019-05-08"});
return system.getResultSuccess();
}
return res;
}
//icp通知状态变更
//icp通知状态变更(停用)
async acceptIcpPartnerNotification(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
......@@ -126,7 +126,7 @@ class QcCenterOrderService extends AppServiceBase {
ApplicationStatus:res.data.ApplicationStatus
};
//推送方案
this.aliclient.reqbyget({action:"AcceptPartnerNotification",reqbody:pushObj,apiVersion:"2019-05-08"});
// this.aliclient.reqbyget({action:"AcceptPartnerNotification",reqbody:pushObj,apiVersion:"2019-05-08"});
return system.getResultSuccess();
}
return res;
......@@ -150,5 +150,73 @@ class QcCenterOrderService extends AppServiceBase {
}
return res;
}
//交付材料提交
async serviceProviderSubmitMaterial(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
var needsolution = res.data;//方案信息
var ab = pobj.actionBody;
if (typeof (ab.material) == "string") {
ab.material = JSON.parse(ab.material);
}
var material = ab.material;
//推送数据至阿里
var BizId = needsolution.channelSolutionNo;//⽅案业务ID
var pushObj = {
"BizId": BizId,
"Domain": material.Domain,
"CorporateName": material.CorporateName,
"IncludeForeignInvestment": material.IncludeForeignInvestment,
"PartnerBusinessLicense": material.PartnerBusinessLicense,
"PartnerIdCardList": material.PartnerIdCardList,
"PartnerDomainCertificate": material.PartnerDomainCertificate,
"PartnerPreviewOtherList": material.PartnerPreviewOtherList || [],
"PartnerPlan": material.PartnerPlan || "",
"PartnerForeignInvestment": material.PartnerForeignInvestment || "",
"PartnerLaw": material.PartnerLaw || "",
"PartnerStampOtherList": material.PartnerStampOtherList || [],
"PartnerSignOtherList": material.PartnerSignOtherList || [],
"PartnerSignAndStampOtherList": material.PartnerSignAndStampOtherList || []
};
var self = this;
//推送方案材料
self.aliclient.reqbyget({action:"SavePartnerSubmitMaterial",reqbody:pushObj,apiVersion:"2019-05-08"});
return system.getResultSuccess();
}
return res;
}
//通知交付状态变更
async serviceProviderNotification(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
//推送数据至阿里
var pushObj = {
BizId:res.data.BizId,
OfficialFileURL:res.data.OfficialFileURL,
ApplicationStatus:res.data.ApplicationStatus
};
//推送状态变更
this.aliclient.reqbyget({action:"AcceptPartnerNotification",reqbody:pushObj,apiVersion:"2019-05-08"});
return system.getResultSuccess();
}
return res;
}
//交付单关闭
async closeOrderDelivery(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
var needsolution = res.data;//方案信息
var ab = pobj.actionBody;
//推送数据至阿里
var pushObj = {
BizId: needsolution.channelSolutionNo, Note: ab.note
};
//关闭方案
this.aliclient.reqbyget({action:"CloseIcpProduce",reqbody:pushObj,apiVersion:"2019-05-08"});
return system.getResultSuccess();
}
return res;
}
}
module.exports = QcCenterOrderService;
\ No newline at end of file
......@@ -45,17 +45,17 @@ class UtilsNeedService extends AppServiceBase {
this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedBusiness");
}else{
if(pobj.actionBody.channel_type_code==5){
pobj.actionBody.regType="ali.icp";
pobj.actionBody.type="ali.icp";
}else{
pobj.actionBody.regType="ali.edi";
pobj.actionBody.type="ali.edi";
}
this.utilsPushSve.aliBusiness2Fq(pobj, "intention");
this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedICPBusiness");
}
}
return result;
}
//调用center-order icp需求反馈
//调用center-order
async reqCenterOrderApi(pobj, reqUrl) {
var url = this.centerOrderUrl + "action/icpapi/springBoard";
if (reqUrl) {
......@@ -67,6 +67,18 @@ class UtilsNeedService extends AppServiceBase {
return data;
}
//调用center-order icp需求反馈
async reqCenterOrderQcApi(pobj, reqUrl) {
var url = this.centerOrderUrl + "action/qcapi/springBoard";
if (reqUrl) {
var url = this.centerOrderUrl + reqUrl;
}
pobj.actionType = "receiveIcpFeedback";
var rtn = await this.execClient.execPost(pobj, url);
var data = JSON.parse(rtn.stdout);
return data;
}
/**
* 提交需求
* @param {*} pobj
......@@ -192,9 +204,9 @@ class UtilsNeedService extends AppServiceBase {
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
if (result.status == 0) {
//推送ali
// await self.aliclient.reqbyget({ action: "CloseIntention", reqbody: { BizId: actionBody.channelNeedNo }, apiVersion: "2019-05-08" });
// self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseNeed");
// 推送ali
await self.aliclient.reqbyget({ action: "CloseIntention", reqbody: { BizId: actionBody.channelNeedNo }, apiVersion: "2019-05-08" });
self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseICPNeed");
return system.getResultSuccess();
} else {
return system.getResult(null, "close fail 100389");
......@@ -254,10 +266,16 @@ class UtilsNeedService extends AppServiceBase {
actionBody.newuserOtherList = newuserOtherList;
}
pobj.actionType = "receiveIcpStatusNotify";
var url = settings.centerOrderUrl() + "action/icpapi/springBoard";
var url = settings.centerOrderUrl() + "action/qcapi/springBoard";
var rtn = await this.restPostUrl(pobj, url);
return rtn;
}
/**
* 推送交付信息至企业宝(交付系统)
*/
async pushOrderDelivery2Qfb(pobj,needsolution){
}
async opDownFileInfo(docUrl, result) { //从oss下载到本地并上传到自己oss,之后删除本地文件
/*docUrl下载链接,全路径,如:https://XXXXXX.pdf?XXXXX */
......@@ -318,6 +336,37 @@ class UtilsNeedService extends AppServiceBase {
return itemResult;
}
async writeCommunicationLog(pobj) {
if (!pobj.actionBody.BizId) {
return system.getResult(null, "actionBody.BizId can not be empty,100491");
}
if (!pobj.actionBody.Note) {
return system.getResult(null, "actionBody.Note can not be empty,100492");
}
var self = this;
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
let res = await self.aliclient.reqbyget({ action: "WriteCommunicationLog", reqbody: { BizId: pobj.actionBody.BizId ,Note:pobj.actionBody.Note}, apiVersion: "2019-05-08" });
return result;
}
async queryExpertApplyCommunicationLogs(pobj) {
if (!pobj.actionBody.BizId) {
return system.getResult(null, "actionBody.BizId can not be empty,100493");
}
if (!pobj.actionBody.UserFeedBack) {
return system.getResult(null, "actionBody.UserFeedBack can not be empty,100494");
}
let res = await self.aliclient.reqbyget({ action: "queryExpertApplyCommunicationLogs", reqbody: {
BeginTime: pobj.actionBody.BeginTime ? pobj.actionBody.BeginTime : "",
EndTime:pobj.actionBody.EndTime ? pobj.actionBody.EndTime : "",
BizId:pobj.actionBody.BizId,
UserFeedBack:pobj.actionBody.UserFeedBack,
apiVersion: "2019-05-08"
}});
return res;
}
// async test1() {
// var a = await this.aliclient.reqbyget({ action: "CloseIntention", reqbody: { BizId: "20200416125415000001", Note: "测试需求关闭" }, apiVersion: "2019-05-08" });
......
......@@ -12,6 +12,7 @@ class UtilsPushService extends AppServiceBase {
var reqUrl = settings.centerAppUrl() + "action/opProduct/springBoard";
var productItemInterfaceResult = await this.restPostUrl(pobj, reqUrl);
pobj.interface_info = productItemInterfaceResult.data;
debugger;
//日志记录
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
......
......@@ -27,7 +27,7 @@ module.exports = function (app) {
app.all('*', function (req, res, next) {
req.objs = system;
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Headers', 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild');
res.header('Access-Control-Allow-Headers', 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild,Authorization,XAPPKEY,XFROMAPPKEY,XFROMCOMPANYKEY,XREGROLE,XBIZPATH');
res.header('Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS');
// res.header('Access-Control-Allow-Credentials', 'true');
res.header('content-type', 'text/html;charset=UTF-8');
......
......@@ -229,18 +229,15 @@ module.exports = function (app) {
return;
}
var cacheManager = system.getObject("db.common.cacheManager");
// 2020 0727 lin新增 增加验证token打印日志
console.log("验证token------------------------",token)
console.log("req.body-------------------------",req.body)
var result = await cacheManager["AppTokenByHostsCache"].getCache(token, system.exTime);
console.log("验证token返回结果------------------------",result)
if (result.status != 0) {
res.end(JSON.stringify(result));
return;
}
req.body.appInfo = result.data;
req.body.actionProcess = result.data.app_code;
var lst = ["tmConfirm", "getNeedSolutionDetailByUser","getProgrammeInfoByChannelNeedNo",
var lst = ["serviceProviderSubmitMaterial","closeOrderDelivery","serviceProviderNotification",
"tmConfirm", "getNeedSolutionDetailByUser","getProgrammeInfoByChannelNeedNo",
"submitIcpProgramme", "submitIcpMaterial", "acceptIcpPartnerNotification", "abolishIcpProgramme",
"addOrder", "getH5PayUrl", "getOrderQrCode", "queryOrderStatus", "getOrderInfo", "getOrderDeliveryInfo", "getOrderDetails",
"getOrderDeliveryFlowInfo", "getOrderDeliveryFlowList", "getOrderLogInfo", "updateContacts", "updateTmOrder", "delOrder",
......
var path = require('path');
var AlipaySdk = require('alipay-sdk').default;
var WXPay = require('wx-pay');
const tenpay = require('tenpay');
// const tenpay = require('tenpay');
var ENVINPUT = {
DB_HOST: process.env.DB_HOST,
DB_PORT: process.env.DB_PORT,
......@@ -58,6 +58,13 @@ var settings = {
return "http://gsb.qifu.gongsibao.com/tlpay/notify";
}
},
qifubaoUrl: function () {//企服宝(交付系统)
if (this.env == "dev") {
return "http://xxxx:xxxx/";
} else {
return "";
}
},
paasUrl: function () {
if (this.env == "dev") {
return "http://p.apps.com:4001/";
......
......@@ -8,11 +8,14 @@
1. [获取方案详情](#getNeedSolutionDetailByUser)
1. [获取需求详情](#getItemByNeedNo)
1. [需求关闭](#needCloseIcp)
1. [交付商提交材料信息](#serviceProviderSubmitMaterial)
1. [交付商通知状态变更](#serviceProviderNotification)
1. [交付商关闭交付单](#closeOrderDelivery)
## **<a name="submitIcpProgramme"> icp方案提交</a>**
[返回到目录](#menu)
##### URL
[/web/action/icpapi/springBoard]
[/web/action/qcapi/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加userpin(用户登录后的凭证)的值
......@@ -52,7 +55,7 @@
## **<a name="submitIcpMaterial"> icp材料提交</a>**
[返回到目录](#menu)
##### URL
[/web/action/icpapi/springBoard]
[/web/action/qcapi/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加userpin(用户登录后的凭证)的值
......@@ -98,7 +101,7 @@
## **<a name="getProgrammeInfoByChannelNeedNo"> 根据需求查看方案详情</a>**
[返回到目录](#menu)
##### URL
[/web/action/icpapi/springBoard]
[/web/action/qcapi/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加userpin(用户登录后的凭证)的值
......@@ -339,7 +342,7 @@
## **<a name="acceptIcpPartnerNotification"> icp通知状态变更</a>**
[返回到目录](#menu)
##### URL
[/web/action/icapi/springBoard]
[/web/action/qcapi/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加userpin(用户登录后的凭证)的值
......@@ -377,7 +380,7 @@ ApplicationStatus:
## **<a name="abolishIcpProgramme"> 服务商关闭icp方案</a>**
[返回到目录](#menu)
##### URL
[/web/action/icapi/springBoard]
[/web/action/qcapi/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加userpin(用户登录后的凭证)的值
......@@ -406,7 +409,7 @@ ApplicationStatus:
## **<a name="getNeedSolutionDetailByUser"> 获取方案详情</a>**
[返回到目录](#menu)
##### URL
[/web/action/icpapi/springBoard]
[/web/action/qcapi/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加userpin(用户登录后的凭证)的值
......@@ -597,3 +600,125 @@ ApplicationStatus:
## **<a name="serviceProviderSubmitMaterial"> 交付商提交材料信息</a>**
[返回到目录](#menu)
##### URL
[/web/action/qcapi/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加userpin(用户登录后的凭证)的值
#### 渠道执行的类型 actionType:serviceProviderSubmitMaterial
``` javascript
{
"actionType": "serviceProviderSubmitMaterial",
"actionBody": {
"orderNo": "NS202007281012kdOHlK",//订单号 必填
"material": { //材料信息
"Domain": "备案域名", //必填
"CorporateName": "法人名称", //必填
"IncludeForeignInvestment": true, //必填
"PartnerBusinessLicense": "营业执照", //必填
"PartnerIdCardList": [
"相关人员身份证"
], //必填
"PartnerDomainCertificate": "域名证书", //必填
"PartnerPreviewOtherList": [
"合作方递交其他供预览的件,只能传递ZIP包"
],
"PartnerPlan": "收费方案计划书",
"PartnerForeignInvestment": "股东追溯不涉及外资承诺书",
"PartnerLaw": "依法经营电信业务承诺书",
"PartnerStampOtherList": [
"需要盖章,只能传递1个zip包"
],
"PartnerSignOtherList": [
"需要签字,只能传递1个zip包"
],
"PartnerSignAndStampOtherList": [
"需要盖章,只能传递1个zip包"
]
}
}
}
```
#### 返回结果
```javascript
{
"status": 0,// 0为成功,否则失败
"msg": "success",
"data":null,
"requestId": "a277fb799d9f4dda9053fb8830f9d252"
}
```
## **<a name="serviceProviderNotification"> 交付商通知状态变更</a>**
[返回到目录](#menu)
##### URL
[/web/action/qcapi/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加userpin(用户登录后的凭证)的值
#### 渠道执行的类型 actionType:serviceProviderNotification
``` javascript
{
"actionType": "serviceProviderNotification",
"actionBody": {
"orderNo": "NS202007281012kdOHlK",//订单号 必填
"status": 507,//交付状态 必填
"officialFileURL":""//官文url 非必填
}
}
status
507, "完成账户注册"
508, "服务商完成提交资料到⼯信部"
509, "⼯商部已受理",可以传递发⽂
510, "⼯商部不予受理",可以传递发⽂
511, "⼯商部通过",可以传递发⽂
512, "⼯商部未通过",可以传递发⽂
```
#### 返回结果
```javascript
{
"status": 0,// 0为成功,否则失败
"msg": "success",
"data":null,
"requestId": "a277fb799d9f4dda9053fb8830f9d252"
}
```
## **<a name="closeOrderDelivery"> 交付商关闭交付单</a>**
[返回到目录](#menu)
##### URL
[/web/action/qcapi/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加userpin(用户登录后的凭证)的值
#### 渠道执行的类型 actionType:closeOrderDelivery
``` javascript
{
"actionType": "closeOrderDelivery",
"actionBody": {
"orderNo": "NS202007281012kdOHlK",//订单号 必填
"note": "交付商关闭交付单"//关闭原因 必填
}
}
```
#### 返回结果
```javascript
{
"status":0,
"msg":"success",
"data":null,
"requestId":"40769e74e83f4505a78b24d84fed870b"
}
```
......@@ -52,6 +52,7 @@
"sequelize-cli": "^4.1.1",
"serve-favicon": "^2.4.5",
"sha1": "^1.1.1",
"sha256": "^0.2.0",
"socket.io": "^2.1.1",
"tenpay": "^2.1.18",
"uuid": "^3.2.1",
......
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