Commit c1262efe by zhaoxiqing

gsb

parent 7e409708
......@@ -40,5 +40,12 @@ class ApiBase{
}
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;
......@@ -8,7 +8,9 @@ class XbgApi extends apiBase{
this.etemplateSve = system.getObject("service.etemplateSve");
this.ecompanySve = system.getObject("service.ecompanySve");
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{
params.ecompanyIds = ecompanyIds;
delete params.ecompany_id;
}
var eteids = await this.etemplatebusiSve.geteteIds(params.mtchId);
if(eteids.length > 0){
params.etemplateIds = eteids;
}
params.eflowstatusList = ['2'];
this.doTimeCondition(params, ["signBegin", "signEnd"]);
var page = await this.econtractSve.pageByCondition(params);
......@@ -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) {
try {
......
......@@ -328,6 +328,12 @@ class EcontractService extends ServiceBase {
};
}
if (params.etemplateIds) {
where.etemplate_id = {
[this.db.Op.in]: params.etemplateIds
};
}
if (params.ecompany_id) {
where.ecompany_id = params.ecompany_id;
}
......
......@@ -14,13 +14,21 @@ class EtemplatebusiService extends ServiceBase {
var sql = "SELECT busi_id FROM c_etemplate_busi WHERE template_id = :template_id";
var list = await this.customQuery(sql, {template_id: template_id});
let rs = [];
if (!list || list.length == 0) {
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) {
return ids;
}
for (let item of list) {
rs.push(item.busi_id);
ids.push(item.template_id);
}
return rs;
return ids;
}
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