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