Commit c1262efe by zhaoxiqing

gsb

parent 7e409708
...@@ -40,5 +40,12 @@ class ApiBase{ ...@@ -40,5 +40,12 @@ class ApiBase{
} }
return params; return params;
} }
endWith(source, str){
if(!str || !source || source.length == 0 || str.length > source.length) {
return false;
}
return source.substring(source.length - str.length) == str;
}
} }
module.exports=ApiBase; module.exports=ApiBase;
...@@ -8,7 +8,9 @@ class XbgApi extends apiBase{ ...@@ -8,7 +8,9 @@ class XbgApi extends apiBase{
this.etemplateSve = system.getObject("service.etemplateSve"); this.etemplateSve = system.getObject("service.etemplateSve");
this.ecompanySve = system.getObject("service.ecompanySve"); this.ecompanySve = system.getObject("service.ecompanySve");
this.econtractSve = system.getObject("service.econtractSve"); this.econtractSve = system.getObject("service.econtractSve");
this.esettleSve = system.getObject("service.esettleSve") this.esettleSve = system.getObject("service.esettleSve");
this.etemplatebusiSve = system.getObject("service.etemplatebusiSve");
this.excelClient = system.getObject("util.excelClient");
} }
//合同模板 //合同模板
...@@ -37,6 +39,10 @@ class XbgApi extends apiBase{ ...@@ -37,6 +39,10 @@ class XbgApi extends apiBase{
params.ecompanyIds = ecompanyIds; params.ecompanyIds = ecompanyIds;
delete params.ecompany_id; delete params.ecompany_id;
} }
var eteids = await this.etemplatebusiSve.geteteIds(params.mtchId);
if(eteids.length > 0){
params.etemplateIds = eteids;
}
params.eflowstatusList = ['2']; params.eflowstatusList = ['2'];
this.doTimeCondition(params, ["signBegin", "signEnd"]); this.doTimeCondition(params, ["signBegin", "signEnd"]);
var page = await this.econtractSve.pageByCondition(params); var page = await this.econtractSve.pageByCondition(params);
...@@ -47,6 +53,30 @@ class XbgApi extends apiBase{ ...@@ -47,6 +53,30 @@ class XbgApi extends apiBase{
} }
} }
//已签合同导出
async allExport(qobj) {
var params = qobj || {};
params.currentPage = 1;
params.pageSize = 60000;
var eteids = await this.etemplatebusiSve.geteteIds(params.mtchId);
if(eteids.length > 0){
params.etemplateIds = eteids;
}
params.eflowstatusList = ['2'];
this.doTimeCondition(params, ["signBegin", "signEnd"]);
try {
return await this.econtractSve.pageByCondition(params);
} catch (e) {
console.log(e);
return system.getErrResult2("您的网络不稳, 请稍后重试");
}
}
//纳税人人员 //纳税人人员
async ratepayingListToPe(qobj) { async ratepayingListToPe(qobj) {
try { try {
...@@ -148,4 +178,4 @@ class XbgApi extends apiBase{ ...@@ -148,4 +178,4 @@ class XbgApi extends apiBase{
} }
module.exports = XbgApi; module.exports = XbgApi;
\ No newline at end of file
...@@ -328,6 +328,12 @@ class EcontractService extends ServiceBase { ...@@ -328,6 +328,12 @@ class EcontractService extends ServiceBase {
}; };
} }
if (params.etemplateIds) {
where.etemplate_id = {
[this.db.Op.in]: params.etemplateIds
};
}
if (params.ecompany_id) { if (params.ecompany_id) {
where.ecompany_id = params.ecompany_id; where.ecompany_id = params.ecompany_id;
} }
......
...@@ -14,13 +14,21 @@ class EtemplatebusiService extends ServiceBase { ...@@ -14,13 +14,21 @@ class EtemplatebusiService extends ServiceBase {
var sql = "SELECT busi_id FROM c_etemplate_busi WHERE template_id = :template_id"; var sql = "SELECT busi_id FROM c_etemplate_busi WHERE template_id = :template_id";
var list = await this.customQuery(sql, {template_id: template_id}); var list = await this.customQuery(sql, {template_id: template_id});
let rs = []; let rs = [];
return rs;
}
async geteteIds(busi_id) {
var sql = "SELECT template_id FROM c_etemplate_busi WHERE template_type = 1 AND busi_id = :busi_id";
var list = await this.customQuery(sql, {busi_id: busi_id});
let ids = [];
if (!list || list.length == 0) { if (!list || list.length == 0) {
return rs; return ids;
} }
for (let item of list) { for (let item of list) {
rs.push(item.busi_id); ids.push(item.template_id);
} }
return rs; return ids;
} }
async busiByTemplate(template_id) { async busiByTemplate(template_id) {
......
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