Commit 2d7ef743 by zhaoxiqing

gsb

parent da32b3ab
var system = require("../../system")
const md5 = require("MD5");
const logCtl = system.getObject("web.oplogCtl");
const moment = require("moment");
class ChannelApi {
constructor() {
this.channelSve = system.getObject("service.channelSve");
}
//渠道绑定
async bindPlatform(queryobj, qobj, req) {
if(!this.trim(queryobj.platform_id)){
return system.getErrResult2("platform_id不能为空")
}
if(!this.trim(queryobj.channel_id)){
return system.getErrResult2("channel_id不能为空")
}
if(!this.trim(queryobj.platform_channel_id)){
return system.getErrResult2("platform_channel_id不能为空")
}
var result = await this.channelSve.bindPlatform(queryobj);
return result;
}
//绑定渠道推送
async pushbindingchannel(queryobj, qobj, req){
queryobj.begin = moment().subtract(1, 'days').format('YYYY-MM-DD 00:00:00'); /*前一天的时间*/
queryobj.end = moment().subtract(1, 'days').format('YYYY-MM-DD 23:59:59'); /*前一天的时间*/
console.log(queryobj);
var result = await this.channelSve.pushbindingchannel(queryobj);
return result;
}
trim(o) {
if (!o) {
return "";
}
return o.toString().trim();
}
}
module.exports = ChannelApi;
...@@ -38,6 +38,14 @@ class ChannelService extends microService { ...@@ -38,6 +38,14 @@ class ChannelService extends microService {
return await this.callms("channel", "channelPage", params); return await this.callms("channel", "channelPage", params);
} }
async bindPlatform(params){
return await this.callms("channel" , "bindPlatform", params);
}
async pushbindingchannel(params){
return await this.callms("channel" , "pushbindingchannel", params);
}
// 商户api // 商户api
async merchantInfo(params) { async merchantInfo(params) {
return await this.callms("channel", "merchantInfo", params); return await this.callms("channel", "merchantInfo", params);
...@@ -49,4 +57,4 @@ class ChannelService extends microService { ...@@ -49,4 +57,4 @@ class ChannelService extends microService {
return await this.callms("channel", "merchantPage", params); return await this.callms("channel", "merchantPage", params);
} }
} }
module.exports = ChannelService; module.exports = ChannelService;
\ No newline at end of file
...@@ -225,7 +225,7 @@ class System { ...@@ -225,7 +225,7 @@ class System {
var v = item[f]; var v = item[f];
if(v) { if(v) {
try { try {
item[f + "_y"] = prev + parseFloat((Number(v) / 100).toFixed(2)); item[f + "_y"] = prev + parseFloat((Number(v) / 100).toFixed(2));
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
...@@ -262,7 +262,7 @@ class System { ...@@ -262,7 +262,7 @@ class System {
var domain = "http://39.107.234.14"; var domain = "http://39.107.234.14";
return { return {
// 渠道服务 // 渠道服务
channel: domain + ":3003" + path, channel: domain2 + ":3003" + path,
} }
} else { } else {
// var odomain = "http://123.57.217.203" // var odomain = "http://123.57.217.203"
......
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
}, },
"requestid": "d3fde2b829244c20966031d8e7f93e2a" "requestid": "d3fde2b829244c20966031d8e7f93e2a"
} }
2.4 渠道信息 2.4 渠道信息
url: /web/channelCtl/channelInfo url: /web/channelCtl/channelInfo
请求参数: 请求参数:
...@@ -176,7 +176,7 @@ ...@@ -176,7 +176,7 @@
"channel_idcode": "xxxxx", // 渠道统一社会信用代码或者身份证 "channel_idcode": "xxxxx", // 渠道统一社会信用代码或者身份证
"origin_id": 10001, // 来源id "origin_id": 10001, // 来源id
"merchant_name": "测试商户7", // 商户名称 "merchant_name": "测试商户7", // 商户名称
"contact_man": "联系人7", "contact_man": "联系人7",
"contact_mobile": "联系电话7", "contact_mobile": "联系电话7",
"contact_email": "联系偶像7", "contact_email": "联系偶像7",
"contact_addr": "联系地址7", "contact_addr": "联系地址7",
...@@ -203,7 +203,7 @@ ...@@ -203,7 +203,7 @@
"channel_idcode": "xxxxx", // 渠道统一社会信用代码或者身份证 "channel_idcode": "xxxxx", // 渠道统一社会信用代码或者身份证
"origin_id": 10001, // 来源id "origin_id": 10001, // 来源id
"merchant_name": "测试商户7", // 商户名称 "merchant_name": "测试商户7", // 商户名称
"contact_man": "联系人7", "contact_man": "联系人7",
"contact_mobile": "联系电话7", "contact_mobile": "联系电话7",
"contact_email": "联系偶像7", "contact_email": "联系偶像7",
"contact_addr": "联系地址7", "contact_addr": "联系地址7",
...@@ -232,4 +232,27 @@ ...@@ -232,4 +232,27 @@
"status": 0, // 状态码 0成功 其他失败 "status": 0, // 状态码 0成功 其他失败
"msg": "success", "msg": "success",
"requestid": "8b5299922e314dd7a9c2711a312f1952" "requestid": "8b5299922e314dd7a9c2711a312f1952"
} }
\ No newline at end of file 3.4 渠道绑定
url: /api/channelApi/bindPlatform
请求参数:
{
"platform_id":"10000", //平台渠道ID
"channel_id":10000, //渠道id
"platform_channel_id":10000 //默认写死 10000
}
返回结果:
{
"status": 0, // 状态码 0成功 其他失败
"msg": "success",
"data": 10002,
"requestid": "26d5cee56dd54d938b46c759a6885a0f"
}
{
"status": -1,
"msg": "platform_id不能为空",
"data": null,
"bizmsg": "empty"
}
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