Commit a9e7f1ac by 王昆

gsb

parent 283ecc44
......@@ -55,6 +55,35 @@ class EcontractApi {
return 1;
}
async importETemplate(obj) {
console.log(obj, "===================>>>>>>>>>>>>>>>>>>>>>");
var names = obj.companyNames;
var etemplateId = obj.etemplateId;
var etemplate = await this.etemplateSve.findById(Number(etemplateId || 0));
if (!etemplate) {
return 0;
}
let errors = [];
for (var name of names) {
try {
let company = await this.ecompanySve.findOne({name: name});
if (!company) {
errors.push(name);
continue;
}
// 创建模板
let etemplate = {
};
await this.etemplateSve.create(etemplate);
} catch (e) {
console.log(e);
}
}
return errors;
}
async testpushContract(obj, req) {
var ids = obj.ids || [];
for (var id of ids) {
......
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