Commit c67f3efe by 赵庆

gsb

parent 949f56c4
# Default ignored files
/workspace.xml
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/bpo-web.iml" filepath="$PROJECT_DIR$/.idea/bpo-web.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
\ No newline at end of file
......@@ -2,6 +2,7 @@ var system = require("../../system")
const md5 = require("MD5");
const logCtl = system.getObject("web.oplogCtl");
const moment = require("moment");
class EcontractApi {
constructor() {
this.ecompanySve = system.getObject("service.ecompanySve");
......@@ -144,6 +145,7 @@ class EcontractApi {
async transferNotify(obj, req) {
this.econtractSve.testtransfer(obj);
}
async contractcb(obj, req) {
this.econtractSve.updateCallbackStatus(obj);
}
......@@ -701,8 +703,10 @@ class EcontractApi {
idNo: this.trim(pobj.idNo),
bankno: this.trim(pobj.bankno),
nonceStr: this.trim(pobj.nonceStr),
userCode: this.trim(pobj.userCode),//用户code-韵达
branchCode: this.trim(pobj.branchCode),//韵达分公司ID
sign: this.trim(pobj.sign)
}
};
if (!param.ecid) {
return this.returnjson(-1, "请传入薪必果提供的ecid")
......@@ -987,7 +991,8 @@ class EcontractApi {
try {
this.econtractSve.testtransfer(JSON.stringify(obj));
} catch (error) {}
} catch (error) {
}
var regexNumber = /^[0-9]*$/;
var wechatNoticeList = [] //微信通知列表
......@@ -1261,4 +1266,5 @@ class EcontractApi {
}
}
}
module.exports = EcontractApi;
\ No newline at end of file
......@@ -281,13 +281,15 @@ class EcontractService extends ServiceBase {
for (var item of errorItems) {
errors += item + "、";
}
return system.getErrResult2(errors.substr(0, errors.length - 1));
}
return resultAll;
}
async getCount(params){
async getCount(params) {
var where = {};
if (params.ecompanyIds) {
where.ecompany_id = {
......@@ -317,7 +319,8 @@ class EcontractService extends ServiceBase {
if (params.eflowstatusList) {
where.eflowstatus = {
[this.db.Op.in]: params.eflowstatusList
};;
};
;
}
if (params.accountName || params.accountMobile || params.accountIdno) {
......@@ -344,7 +347,7 @@ class EcontractService extends ServiceBase {
["id", 'desc']
];
var attributes = [`id`, `fileurl`,`etemplate_id`, `eflowstatus`, `eflowstatusname`, `completed_at`, `end_at`, `user_id`, `usereaccount_id`, `ecompany_id`];
var attributes = [`id`, `fileurl`, `etemplate_id`, `eflowstatus`, `eflowstatusname`, `completed_at`, `end_at`, `user_id`, `usereaccount_id`, `ecompany_id`];
var page = await this.getPageList(currentPage, pageSize, where, orderby, attributes);
if (page && page.rows) {
......@@ -521,16 +524,19 @@ class EcontractService extends ServiceBase {
// }
try {
this.updateApply(contract.id);
} catch (error) {}
} catch (error) {
}
try {
this.syncContract(contract.id);
} catch (error) {}
} catch (error) {
}
try {
// 推送签约信息给客户
this.syncSign(contract.id);
} catch (error) {}
} catch (error) {
}
}
} catch (e) {
logCtl.error({
......@@ -696,6 +702,7 @@ class EcontractService extends ServiceBase {
});
}
}
async pushContract() {
var comsql = "SELECT id, `name`,`encryptkey`, `posturl` FROM `c_ecompany` WHERE posturl <> '' AND posturl IS NOT NULL AND encryptkey IS NOT NULL AND isEnabled = 1";
var companyList = await this.customQuery(comsql);
......@@ -1185,6 +1192,7 @@ class EcontractService extends ServiceBase {
});
return list || [];
}
// 根据身份证Id,获取openId status-2 签约成功
async findOpenIdByNo(status, idNo) {
if (!idNo) {
......@@ -1231,6 +1239,8 @@ class EcontractService extends ServiceBase {
appkey: params.appId,
unionId: unionId,
userId3rd: params.userId,
userCode3rd: params.userCode,
branchCode3rd: params.branchCode,
userName: params.idName,
mobile: params.mobile,
utype: 0,
......@@ -1330,7 +1340,7 @@ class EcontractService extends ServiceBase {
etemplate_id: etemplate.id,
ecompany_id: ecompany.id,
// end_at: end,
}
};
econtract = await this.create(econtract);
// 创建印章id
......@@ -1368,7 +1378,7 @@ class EcontractService extends ServiceBase {
signDateA: today, //甲方签约日期 必填
signDateB: today //乙方签约日期 必填
}
}
};
var ebaoAccountId = eaccount.eaccountid; //签署人账户id-- 必填
var thirdOrderNo = econtract.id; //第三方流水号,通知回调使用---选填
var eBaoRedirectBossUrl = "";
......@@ -1388,6 +1398,7 @@ class EcontractService extends ServiceBase {
econtract.end_at = end_at;
await econtract.save();
this.syncSign(econtract.id);
return this.returnjson(0, "success", {
contractId: econtract.id
});
......@@ -1395,6 +1406,7 @@ class EcontractService extends ServiceBase {
return this.returnjson(-1, tt.message || "签约失败", tt.code);
}
/**
* 静默签
* @param {ecid, appId, userId, idName, mobile, idNo, bankno, nonceStr, sign} params
......@@ -1587,4 +1599,5 @@ class EcontractService extends ServiceBase {
}
}
}
module.exports = EcontractService;
\ 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