Commit a28271d3 by 王昆

gsb

parent 62e6de9d
......@@ -9,7 +9,6 @@ class ActionAPI extends APIBase {
this.iproductSve = system.getObject("service.product.iproductSve");
this.iprocessSve = system.getObject("service.product.iprocessSve");
}
/**
* 接口跳转
......@@ -45,7 +44,7 @@ class ActionAPI extends APIBase {
case "productDics": // 查询产品字典
// opResult = await this.oproductSve.productDics(action_body);
break;
case "allProcess": // 查询业务进度
case "processDics": // 查询业务进度
opResult = await this.iprocessSve.allNames(action_body);
break;
......
......@@ -21,7 +21,7 @@ class IInvoiceDao extends Dao {
return counts[0].total || 0;
}
async pageByParams(params, startRow, pageSize) {
async pageByParams(params) {
var sql = [];
sql.push("SELECT");
sql.push("t1.*");
......@@ -32,8 +32,6 @@ class IInvoiceDao extends Dao {
sql.push("ORDER BY t1.id DESC");
sql.push("LIMIT :startRow, :pageSize");
params.startRow = startRow || 0;
params.pageSize = pageSize || 10;
return await this.customQuery(sql.join(" "), params);
}
......@@ -50,11 +48,11 @@ class IInvoiceDao extends Dao {
if(params.invoice_type) {
sql.push("AND t1.`invoice_type` = :invoice_type");
}
if(params.invoiceTimeBegin) {
sql.push("AND t1.`invoice_time` >= :invoiceTimeBegin");
if(params.createTimeBegin) {
sql.push("AND t1.`created_at` >= :createTimeBegin");
}
if(params.invoiceTimeEnd) {
sql.push("AND t1.`invoice_time` <= :invoiceTimeEnd");
if(params.createTimeEnd) {
sql.push("AND t1.`created_at` <= :createTimeEnd");
}
if(params.red_status) {
......
......@@ -181,6 +181,9 @@ class IInvoiceService extends ServiceBase {
productIdList.push(item.product_id);
}
}
if(!productIdList || productIdList.length === 0) {
return;
}
let productMap = await this.iproductDao.mapByIds(productIdList);
for (let item of list) {
item.oproduct = productMap[item.product_id] || {}
......@@ -199,6 +202,9 @@ class IInvoiceService extends ServiceBase {
}
ids.push(item.invoice_deliver_id)
}
if(!ids || ids.length === 0) {
return;
}
let map = await this.iinvoicedeliverDao.findMapByIds(ids);
for (let item of list) {
......@@ -219,6 +225,10 @@ class IInvoiceService extends ServiceBase {
statuses.push(item.status);
}
if(!ids || ids.length === 0 || !statuses || statuses.length === 0) {
return;
}
let map = await this.iinvoiceprocessDao.mapByInvoiceIdsAndStatus(ids, statuses);
for (let item of list) {
let key = item.id + "_" + item.status;
......
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