Commit 5668dd80 by 王昆

Merge branch 'bpo-web' of gitlab.gongsibao.com:jiangyong/zhichan into bpo-web

parents a9e7f1ac 111f3e36
......@@ -562,6 +562,8 @@ class EntcontractService extends ServiceBase {
ecid: 10287
};
try {
erchants = await this.yzmerchantsignedDao.create(erchants);
} catch (e) {
console.log("c_yzmerchant_signed插入失败", erchants);
......@@ -582,6 +584,49 @@ class EntcontractService extends ServiceBase {
}
reso.erchants = erchants;
reso.data.ecid = 10287;
//----------------
let ecompany = await this.ecompanyDao.findOne({
"name": params.merchantName,
})
if (!ecompany) {
// 创建ecompany
ecompany = await this.ecompanyDao.create({
"name": params.merchantName,
"nameA": '',
"isEnabled": true,
"isQuiet": true,
"sealurl": "",
"encryptkey": "",
"posturl": ""
});
}
let busi = await this.ecompanybusiDao.findOne({
ecompany_id: ecompany.id,
etemplate_id: 10287,
});
if (!busi) {
await this.ecompanybusiDao.create({
ecompany_id: ecompany.id,
etemplate_id: 10287,
postwxurl: "",
postsignurl: "",
appId: reso.data.appId,
mchtId: reso.data.mchtId,
mainId: reso.data.mainId,
key: reso.data.secret,
});
} else {
busi.appId = reso.data.appId;
busi.mchtId = reso.data.mchtId;
busi.mainId = reso.data.mainId;
busi.key = reso.data.secret;
await busi.save();
}
//----------------
return reso;
} catch (e) {
console.log(e.stack);
......
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