Commit bfdba3c3 by zhaoxiqing

gsb

parent 14642b8e
......@@ -14,6 +14,7 @@ class ChannelApi {
this.FQURL = settings.FQYF().pushOrderApi;
this.pushfqlogSve = system.getObject("service.pushfqlogSve")
this.esettleofflineSve = system.getObject("service.esettleofflineSve")
this.channelService = system.getObject("service.ChannelSve")
}
//渠道绑定
......@@ -100,6 +101,105 @@ class ChannelApi {
}
//渠道添加
async pushAddChannel(queryobj, qobj, req) {
try {
if(!queryobj.platform_id){
return system.getResultFail(-1, "platform_id不能为空");
}
if(!queryobj.ctype){
return system.getResultFail(-1, "ctype不能为空");
}
if(!queryobj.name){
return system.getResultFail(-1, "name不能为空");
}
if(!queryobj.idcode){
return system.getResultFail(-1, "idcode不能为空");
}
if(queryobj.ctype == 1){
if(!queryobj.business_license){
return system.getResultFail(-1, "business_license不能为空");
}
}else {
if(!queryobj.idcard_front){
return system.getResultFail(-1, "idcard_front不能为空");
}
if(!queryobj.idcard_back){
return system.getResultFail(-1, "idcard_back不能为空");
}
}
if(!queryobj.contact_man){
return system.getResultFail(-1, "contact_man不能为空");
}
if(!queryobj.contact_mobile){
return system.getResultFail(-1, "contact_mobile不能为空");
}
if(!queryobj.contact_email){
return system.getResultFail(-1, "contact_email不能为空");
}
if(!queryobj.contact_addr){
return system.getResultFail(-1, "contact_addr不能为空");
}
var da = await this.channelService.channelSave(queryobj)
if (da.data) {
var bind = {
platform_id: queryobj.platform_id,
channel_id: da.data.id,
platform_channel_id:10000
}
var result = this.channelSve.bindPlatform(bind);
console.log(result);
}
return da;
} catch (e) {
console.log(e);
return system.getResultFail(500, "接口错误");
}
}
//商户添加
async pushAddMerchant(queryobj, qobj, req){
try {
if(!queryobj.channel_id){
return system.getResultFail(-1, "channel_id不能为空");
}
if(!queryobj.origin_id){
return system.getResultFail(-1, "origin_id不能为空");
}
if(!queryobj.merchant_name){
return system.getResultFail(-1, "merchant_name不能为空");
}
if(!queryobj.contact_man){
return system.getResultFail(-1, "contact_man不能为空");
}
if(!queryobj.contact_mobile){
return system.getResultFail(-1, "contact_mobile不能为空");
}
if(!queryobj.contact_email){
return system.getResultFail(-1, "contact_email不能为空");
}
if(!queryobj.contact_addr){
return system.getResultFail(-1, "contact_addr不能为空");
}
if(queryobj.id){
if(!queryobj.origin_merchant_id){
return system.getResultFail(-1, "origin_merchant_id不能为空");
}
if(!queryobj.origin_merchant_name){
return system.getResultFail(-1, "origin_merchant_name不能为空");
}
}
return await this.channelService.merchantSaves(queryobj);
} catch (e) {
console.log(e);
return system.getResultFail(500, "接口错误");
}
}
async paydayCount(queryobj, qobj, req) {
var data = await this.separateGet(queryobj);
console.log(data.dataValues)
......@@ -127,8 +227,8 @@ class ChannelApi {
"idempotentSourceName": "BPO",// 来源编号,写死:BPO薪必果
"thirdPartyChannelId": chnanel.channel_id.toString(),// 渠道id
"thirdPartyCustomerId": chnanel.id.toString(),// 第三方客户id
// "productId": "5e6b02cc3290c3000a3a63dc",// 云服产品id (测试环境)
"productId": "5e6c89d54c52bf000a750bc5",// 云服产品id (生产环境)
"productId": "5e6b02cc3290c3000a3a63dc",// 云服产品id (测试环境)
//"productId": "5e6c89d54c52bf000a750bc5",// 云服产品id (生产环境)
// "allotRatio":"50",// 分润比例(百分比的数字部分(如:50代表50%))
"orderPrice": da.deduct_amt,// 订单金额
......@@ -154,8 +254,8 @@ class ChannelApi {
"idempotentSourceName": "BPO",// 来源编号,写死:BPO薪必果
"thirdPartyChannelId": chnanel.channel_id.toString(),// 渠道id
"thirdPartyCustomerId": chnanel.id.toString(),// 第三方客户id
// "productId": "5e6b02cc3290c3000a3a63dc",// 云服产品id (测试环境)
"productId": "5e6c89d54c52bf000a750bc5",// 云服产品id (生产环境)
"productId": "5e6b02cc3290c3000a3a63dc",// 云服产品id (测试环境)
// "productId": "5e6c89d54c52bf000a750bc5",// 云服产品id (生产环境)
// "allotRatio":"50",// 分润比例(百分比的数字部分(如:50代表50%))
"orderPrice": da.amt,// 订单金额
"productQuantity": "1",// 产品数量
......
const system = require("../../system");
const Dao = require("../dao.base");
class YzmerchantsignedDao extends Dao {
constructor() {
super(Dao.getModelName(YzmerchantsignedDao));
}
async getById(id) {
return await this.model.findOne({where: {id: id}, raw: true});
}
}
module.exports = YzmerchantsignedDao;
const system = require("../../system");
const settings = require("../../../config/settings");
const uiconfig = system.getUiConfig2(settings.wxconfig.appId);
module.exports = (db, DataTypes) => {
return db.define("yzmerchantsigned", {
companyName: DataTypes.STRING,
appId: DataTypes.STRING,
mchtId: DataTypes.STRING,
mainId: DataTypes.STRING,
secret: DataTypes.STRING,
ecid: DataTypes.INTEGER,
params : DataTypes.TEXT,
entcontract_id: DataTypes.INTEGER,
}, {
paranoid: true, //假的删除
underscored: true,
version: true,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
tableName: 'c_yzmerchant_signed',
validate: {
},
indexes: [
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
});
}
......@@ -53,6 +53,9 @@ class ChannelService extends microService {
async merchantSave(params) {
return await this.callms("channel", "merchantSave", params);
}
async merchantSaves(params) {//峰擎推送添加
return await this.callms("channel", "merchantSaves", params);
}
async merchantPage(params) {
return await this.callms("channel", "merchantPage", params);
}
......
......@@ -21,12 +21,14 @@ class EntcontractService extends ServiceBase {
this.ecompanybusiDao = system.getObject("db.ecompanybusiDao");
this.userDao = system.getObject("db.userDao");
this.esealSve = system.getObject("service.esealSve");
this.enttemplateSve = system.getObject("service.enttemplateSve");
this.entcompanyDao = system.getObject("db.entcompanyDao")
this.ejobapplySve = system.getObject("service.ejobapplySve");
this.restClient = system.getObject("util.restClient");
this.maindict = system.getObject("util.maindict");
this.yzmerchantsignedSve = system.getObject("service.yzmerchantsignedSve");
this.eSignBaoRedirectBossUrl = settings.apiconfig.eSignBaoRedirectBossUrl();
}
......@@ -932,7 +934,7 @@ class EntcontractService extends ServiceBase {
async yzMerchantReSign(params) {
let id = params.id;
let econtract = this.dao.findById(id);
let econtract =await this.dao.findById(id);
if (!econtract) {
return this.returnjson(-1, "协议不存在");
}
......@@ -944,6 +946,11 @@ class EntcontractService extends ServiceBase {
let enttemplate = await this.enttemplateSve.findById(econtract.enttemplate_id);
// entcompany
let entcompany = await this.entcompanyDao.findById(econtract.entcompany_id);
//c_yzmerchant_signed
var yzparams = await this.yzmerchantsignedSve.findOne({entcontract_id:id})
var yz = JSON.parse(yzparams.params);
// p_user
let user = await this.userDao.findById(econtract.user_id);
let eaccount = await this.usereaccountDao.findById(econtract.usereaccount_id);
......@@ -954,11 +961,11 @@ class EntcontractService extends ServiceBase {
templateId: enttemplate.templateid, //模板id,由创建模板接口调用返回的templateId 必填
name: enttemplate.name, //合同模板名称 必填
simpleFormFields: {
nameA: params.merchantName, //甲方 必填
addressA: params.merchantAddr, //甲方地址
representA: params.merchantLegal,//甲方法定代表人
agentA: params.idName,//甲方联系人
agentMobileA: params.mobile,//甲方 联系电话
nameA: yz.merchantName, //甲方 必填
addressA: yz.merchantAddr, //甲方地址
representA: yz.merchantLegal,//甲方法定代表人
agentA: yz.idName,//甲方联系人
agentMobileA: yz.mobile,//甲方 联系电话
nameB: entcompany.name, //乙方 必填
addressB: entcompany.addr, //乙方 地址
......@@ -966,17 +973,13 @@ class EntcontractService extends ServiceBase {
agentB: entcompany.contactName,//乙方 联系人
agentMobileB: entcompany.contactMobile,//乙方 联系电话
// bankNameB: entcompany.bankAccount,//账户名称
// bank: entcompany.bankName,//开户行
// bankNumB: entcompany.bankNo,//账号
signDate: today,//签约时间
signDateA: today, //甲方签约日期 必填
signDateB: today //乙方签约日期 必填
}
};
var ebaoAccountId = eaccount.eaccountid; //签署人账户id-- 必填
var thirdOrderNo = "ent_" + entcontract.id; //第三方流水号,通知回调使用---选填
var thirdOrderNo = id; //第三方流水号,通知回调使用---选填
var eBaoRedirectBossUrl = "";
var tt = await this.utilesignbaoSve.userSignContractNoTemplaterEversalSeal(signParams, ebaoAccountId, thirdOrderNo, eBaoRedirectBossUrl, "econtractSve", sealId);
console.log(tt, "-============= result ===========================");
......
const system = require("../../system");
const ServiceBase = require("../sve.base")
class YzmerchantsignedService extends ServiceBase {
constructor() {
super(ServiceBase.getDaoName(YzmerchantsignedService));
}
}
module.exports = YzmerchantsignedService;
......@@ -27,6 +27,14 @@ class System {
return System.objTable[key];
}
static getResultFail(status = -1, errmsg = "fail", data = null) {
return {
status: status,
msg: errmsg,
data: data,
};
}
static getResult3(data,req,okmsg="操作成功",errmsg="操作失败"){
var total=data.total;
data=data.hits;
......@@ -264,7 +272,7 @@ class System {
var domain = "http://39.107.234.14";
return {
// 渠道服务
channel: domain + ":3003" + path,
channel: domain2 + ":3003" + path,
}
} else {
// var odomain = "http://123.57.217.203"
......
......@@ -434,7 +434,16 @@
});
},
toHand(id) {
alert(id);
var self = this;
self.$root.postReq("/web/entcontractCtl/yzReSign", {
id: id
}).then(function (d) {
if (d.status == 0 && d.data) {
window.open(d.data.esignUrl,'_blank');
} else {
self.$message.warning(d.msg || "签署失败");
}
});
},
},
vname: "gsb-econtractall2"
......
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