Commit 61ebcf44 by zhaoxiqing

gsb

parent d05f3668
......@@ -19,7 +19,7 @@ class YZContractApi {
async syncSignedFile() {
this.entcontractSve.downloadCompleteUrl();
return "start success"
return "start success";
}
async merchantSign(pobj) {
......@@ -176,7 +176,6 @@ class YZContractApi {
if (param.sign != sign) {
return this.returnjson(1001001, "签名错误");
}
try {
var result = await this.econtractSve.autoSignNoBank(param);
return result;
......
......@@ -33,10 +33,10 @@ module.exports = (db, DataTypes) => {
begin_at: DataTypes.DATE,
end_at: DataTypes.DATE,
isPush: {
type: DataTypes.BOOLEAN,
defaultValue: true
},
// isPush: {
// type: DataTypes.BOOLEAN,
// defaultValue: true
// },
}, {
paranoid: true, //假的删除
underscored: true,
......
......@@ -556,8 +556,6 @@ class EntcontractService extends ServiceBase {
},
}
return res;
}
// e签宝流程
......@@ -708,6 +706,7 @@ class EntcontractService extends ServiceBase {
}
if (!contract.fileurl) {
await this.syncYzSign(2134);
// 请求文件地址
let fileRs = await this.utilesignbaoSve.downloadUserContractFile(contract.eflowid, "econtractSve");
if (fileRs.code == 1 && fileRs.data.selfossUrl) {
......@@ -753,16 +752,15 @@ class EntcontractService extends ServiceBase {
if (!account) {
return null;
}
// 查用户
var user = await this.userDao.findById(account.user_id);
// 查商户签约返回值
let signInfo = this.yzmerchantsignedDao.findOne({entcontract_id: contractId});
let signInfo =await this.yzmerchantsignedDao.findOne({entcontract_id: contractId});
if (!signInfo) {
return null;
}
// 获取yz配置
let conf = this.getAppConfig();
let conf = await this.getAppConfig();
// 推送数据
var param = {
"appId": conf.appId, // appId
......@@ -771,17 +769,18 @@ class EntcontractService extends ServiceBase {
"fileUrl": contract.fileurl, // 签约合同pdf文件
"idName": account.userName, // 代理人姓名
"idNo": account.personsSign, // 代理人身份证
"mobile" : account.mobile, //代理人手机号
"nonceStr": await this.getUidStr(16), // 随机码
"beginDate": await this.formateTime(contract.begin_at), // 合同开始时间
"endDate": await this.formateTime(contract.end_at), // 合同结束时间
}
};
// 签名
var signArr = [];
signArr.push("appId=" + param.appId);
// ...补全签名信息
signArr.push("nonceStr=" + param.nonceStr);
signArr.push("key=" + busi.key);
signArr.push("key=" + this.YZKEY);
param.sign = md5(signArr.join("&")).toUpperCase();
console.log(JSON.stringify(param));
var rs = "";
......@@ -802,6 +801,22 @@ class EntcontractService extends ServiceBase {
}
}
async formateTime(inputTime) {
var date = new Date(inputTime);
var y = date.getFullYear();
var m = date.getMonth() + 1;
m = m < 10 ? ('0' + m) : m;
var d = date.getDate();
d = d < 10 ? ('0' + d) : d;
var h = date.getHours();
h = h < 10 ? ('0' + h) : h;
var minute = date.getMinutes();
var second = date.getSeconds();
minute = minute < 10 ? ('0' + minute) : minute;
second = second < 10 ? ('0' + second) : second;
return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second;
}
}
module.exports = EntcontractService;
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