Commit 7115f4e8 by 王栋源

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

parents 5d6f4d2d 171af02e
......@@ -33,6 +33,12 @@ class LogoOrderAPI extends APIBase {
case "singlelogo"://生成logo
opResult = await this.centerorderSve.singlelogo(pobj);
break;
case "changelogo"://换一批logo
opResult = await this.centerorderSve.changelogo(pobj);
break;
case "downloadlogoscene"://下载logo场景
opResult = await this.centerorderSve.downloadlogoscene(pobj);
break;
case "getPaidLogoListByUser"://获取已购买的logo
opResult = await this.centerorderSve.reqCenterOrderApi(pobj,"action/logoOrderApi/springBoard");
break;
......
......@@ -29,14 +29,20 @@ class FgbusinesschanceAPI extends WEBBase {
case "create"://创建复购商机
opResult = await this.utilsFgbusinesschancSve.create(pobj, pobj.actionBody);
break;
case "getInfo"://获取商机
opResult = await this.utilsFgbusinesschancSve.getInfo(pobj, pobj.actionBody);
case "createOrderRefundFq":
opResult = await this.utilsFgbusinesschancSve.createOrderRefundFq(pobj, pobj.actionBody);
break;
case "createOnlineProductClassificiationFq":
opResult = await this.utilsFgbusinesschancSve.createOnlineProductClassificiationFq(pobj, pobj.actionBody);
break;
case "createOrderInfoAndPayFq":
opResult = await this.utilsFgbusinesschancSve.createOrderInfoAndPayFq(pobj, pobj.actionBody);
break;
// ------ 对蜂擎页面 -------
case "getCompanyInfo": // 获取工商信息--ok
case "getCompanyInfo": // 获取工商信息
opResult = await this.toolSve.getEntregistryByCompanyName(pobj.actionBody, req);
break;
case "getCompanyLabel":// 三十秒认知客户--ok
case "getCompanyLabel":// 三十秒认知客户
opResult = await this.utilsFgbusinesschancSve.getCompanyLabel(pobj, pobj.actionBody);
break
case "getRecommendProducts": // 获取推荐产品列表
......
......@@ -404,7 +404,47 @@ class CenterorderService extends AppServiceBase {
return res;
}
//--------------------------阿里ICP---end--------------------------------------------------------
//LOGO场景接口服务
async downloadlogoscene(pobj){
var reqUrl = "http://43.247.184.92:15501/api/downloadscene";
var obj = pobj.actionBody;
if(!obj.title){
return system.getResult(null,"品牌名称不能为空");
}
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场景异常");
}
}
//换一批logo
async changelogo(pobj){
var reqUrl = "http://43.247.184.92:15501/api/changelogo";
var obj = pobj.actionBody;
if(!obj.title){
return system.getResult(null,"品牌名称不能为空");
}
if(!obj.profession){
return system.getResult(null,"行业名称不能为空");
}
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异常");
}
}
//生成logo
async singlelogo(pobj){
var reqUrl = "http://43.247.184.92:15501/api/singlelogo";
......@@ -412,9 +452,9 @@ class CenterorderService extends AppServiceBase {
if(!obj.title){
return system.getResult(null,"品牌名称不能为空");
}
if(!obj.subtitle){
return system.getResult(null,"品牌标语不能为空");
}
// if(!obj.subtitle){
// return system.getResult(null,"品牌标语不能为空");
// }
if(!obj.profession){
return system.getResult(null,"行业名称不能为空");
}
......@@ -426,7 +466,7 @@ class CenterorderService extends AppServiceBase {
rtn = await this.execClient.execPost(obj, reqUrl);
var res = JSON.parse(rtn.stdout);
if(res && res.status==0 && res.data){
return system.getResultSuccess(res.data);
return res;//system.getResultSuccess(res.data);
}else{
return system.getResult(null,"生成logo操作失败");
}
......
......@@ -14,16 +14,7 @@ class UtilsFgbusinesschancService extends AppServiceBase {
this.centerAppUrl = settings.centerAppUrl();
this.centerAppPayUrl = settings.centerAppUrl() + "payment/paymentApi/springBoard";
};
// async getOrderInfo(pobj, actionBody) {
// var reqUrl = this.centerOrderUrl + "action/order/springBoard";
// var result = await this.restPostUrl(pobj, reqUrl);
// return result;
// }
async getInfo(pobj, actionBody) {
var reqUrl = this.centerOrderUrl + "action/fgbusinesschance/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
return result;
}
async create(pobj, actionBody) {
if (!actionBody.businessData) {
return system.getResult(null, "actionBody.businessData can not be empty,100290");
......@@ -52,18 +43,41 @@ class UtilsFgbusinesschancService extends AppServiceBase {
}
// async getCompanyInfo(pobj, actionBody) {
// if (!actionBody.companyName) {
// return system.getResult(null, "actionBody.companyName can not be empty,100290");
// }
// }
async createOrderRefundFq(pobj, actionBody) {
if (!actionBody || Object.keys(actionBody).length === 0) {
return system.getResult(null, "actionBody can not be empty,100290");
}
let url = this.centerOrderUrl + "action/fgbusinesschance/springBoard";
return await this.restPostUrl(pobj, url);
}
async createOnlineProductClassificiationFq(pobj, actionBody) {
if (!actionBody.product_id) {
return system.getResult(null, "actionBody.product_id can not be empty,100290");
}
let url = this.centerOrderUrl + "action/fgbusinesschance/springBoard";
return await this.restPostUrl(pobj, url);
}
async createOrderInfoAndPayFq(pobj, actionBody) {
if (!actionBody.orderInfo) {
return system.getResult(null, "actionBody.orderInfo can not be empty,100290");
}
if (!actionBody.payInfo) {
return system.getResult(null, "actionBody.payInfo can not be empty,100290");
}
let url = this.centerOrderUrl + "action/fgbusinesschance/springBoard";
return await this.restPostUrl(pobj, url);
}
async getCompanyLabel(pobj, actionBody) {
if (!actionBody.companyName) {
return system.getResult(null, "actionBody.companyName can not be empty,100290");
}
actionBody.companyName = await this.getConvertSemiangleStr(actionBody.companyName);
var url = settings.entProfileUrl() + "lable";
// var url = settings.entProfileUrl() + "lable";
var url = settings.entProfileUrl() + "gsb/api/company_hx";
var reqParam = {
company_name: actionBody.companyName
}
......
......@@ -55,7 +55,7 @@ class aliyunClient {
appkey: obj.appInfo ? obj.appInfo.uapp_key || "" : "",
requestId: obj.requestId || "",
content: JSON.stringify(obj),//推送的参数信息
resultInfo: "error:" + JSON.stringify(e.stack),
resultInfo: "error:" + JSON.stringify(e),
clientIp: obj.clientIp || "",
failType: 1,
opTitle: "old-reqbyget推送阿里信息返回异常",
......
......@@ -6,53 +6,71 @@ var marked = require("marked");
module.exports = function (app) {
app.get('/doc', function (req, res) {
if (!req.query.key) {
res.send("文件不存在!!!");
return;
}
if (req.query.key != "doc12345789") {
res.send("文件不存在!!!!!!");
return;
}
var path = process.cwd() + "/app/front/entry/public/apidoc/README.md";
fs.readFile(path, function(err, data){
if(err){
fs.readFile(path, function (err, data) {
if (err) {
console.log(err);
res.send("文件不存在!");
} else{
} else {
console.log(data);
str = marked(data.toString());
res.render('apidoc',{str});
}
res.render('apidoc', { str });
}
});
});
app.get('/doc/:forder', function (req, res) {
var path = process.cwd() + "/app/front/entry/public/apidoc/README.md";
fs.readFile(path, function(err, data){
if(err){
fs.readFile(path, function (err, data) {
if (err) {
console.log(err);
res.send("文件不存在!");
} else{
} else {
console.log(data);
str = marked(data.toString());
res.render('apidoc',{str});
}
res.render('apidoc', { str });
}
});
});
app.get('/doc/api/:forder/:fileName', function (req, res) {
if (req.url != "/doc/api/platform/fgbusinesschance.md") {
if (!req.query.key) {
res.send("文件不存在!!!");
return;
}
if (req.query.key != "doc12345789") {
res.send("文件不存在!!!!!!");
return;
}
}
var forder = req.params["forder"];
var fileName = req.params["fileName"] || "README.md";
var path = process.cwd() + "/app/front/entry/public/apidoc";
if(forder) {
path = path + "/" + forder + "/" + fileName;
if (forder) {
path = path + "/" + forder + "/" + fileName;
} else {
path = path + "/" + fileName;
}
fs.readFile(path, function(err, data){
if(err){
fs.readFile(path, function (err, data) {
if (err) {
console.log(err);
res.send("文件不存在!");
} else{
} else {
console.log(data);
str = marked(data.toString());
console.log(str);
res.render('apidoc',{str});
}
res.render('apidoc', { str });
}
});
});
};
......@@ -2,12 +2,14 @@
1. [获取营销话术](#a)
1. [获取工商接口](#b)
1. [30秒认知客户及产品服务标签](#c)
1. [更多客户信息链接地址](#d)
1. [30秒认知](#c)
1. [推荐业务状态更新](#e)
1. [推荐业务列表](#f)
1. [已购产品列表](#g)
1. [推送商机](#h)
1. [写入在线产品表](#i)
1. [写入订单退款表](#j)
1. [写入支付表和订单详情表](#k)
## **<a name="a"> 获取营销话术</a>**
[返回到目录](#menu)
......@@ -409,3 +411,118 @@
}
```
## **<a name="i">写入在线产品表</a>**
[返回到目录](#menu)
##### URL
[/api/opaction/fgbusinesschance/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加token的值
#### 渠道执行的类型 actionType:createOnlineProductClassificiationFq
#### 请求数据
```
{
"actionType":"createOnlineProductClassificiationFq",
actionBody:{
// 参数 为 online_product_classificiation_fq表中相关字段
}
}
```
#### 返回结果
```
{
"status": 0,// 0为成功,否则失败
"msg": "success",
"data":null,
"requestId": "f21446617c5e46ad889f3fab7bb69456"
}
```
## **<a name="j">写入订单退款表</a>**
[返回到目录](#menu)
##### URL
[/api/opaction/fgbusinesschance/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加token的值
#### 渠道执行的类型 actionType:createOrderRefundFq
#### 请求数据
```
{
"actionType":"createOrderRefundFq",
actionBody:{
// 参数 为 order_refund_fq 表中相关字段
}
}
```
#### 返回结果
```
{
"status": 0,// 0为成功,否则失败
"msg": "success",
"data":null,
"requestId": "f21446617c5e46ad889f3fab7bb69456"
}
```
## **<a name="k">写入支付表和订单详情表</a>**
[返回到目录](#menu)
##### URL
[/api/opaction/fgbusinesschance/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加token的值
#### 渠道执行的类型 actionType:createOrderInfoAndPayFq
#### 请求数据
```
{
"actionType":"createOrderInfoAndPayFq",
actionBody:{
orderInfo :{
// 参数 为 order_info_fq 表中相关字段
},
payInfo:{
// 参数 为 pay_fq 表中相关字段
}
}
}
```
#### 返回结果
```
{
"status": 0,// 0为成功,否则失败
"msg": "success",
"data":null,
"requestId": "f21446617c5e46ad889f3fab7bb69456"
}
```
\ No newline at end of file
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