Commit 5b2a033e by 王昆

gsb

parent 460f6e7d
...@@ -20,9 +20,11 @@ class MerchantCtl extends CtlBase { ...@@ -20,9 +20,11 @@ class MerchantCtl extends CtlBase {
//数据概览 //数据概览
async dataSummarize(qobj){ async dataSummarize(qobj){
var params = qobj || {}; var params = qobj || {};
var date = this.getMonthDays(params); if (params.month) {
params.signBegin =date[0]; let date = this.getMonthDays(params.month);
params.signEnd =date[date.length-1]; params.signBegin =date[0];
params.signEnd =date[date.length-1];
}
this.doTimeCondition(params, ["signBegin", "signEnd"]); this.doTimeCondition(params, ["signBegin", "signEnd"]);
try { try {
var page = await this.service.dataSummarize(params); var page = await this.service.dataSummarize(params);
...@@ -36,10 +38,13 @@ class MerchantCtl extends CtlBase { ...@@ -36,10 +38,13 @@ class MerchantCtl extends CtlBase {
//首页图表 //首页图表
async dataChart(qobj){ async dataChart(qobj){
var params = qobj || {}; var params = qobj || {};
var date = this.getMonthDays(params); if (params.month) {
params.signBegin =date[0]; let date = this.getMonthDays(params.month);
params.signEnd =date[date.length-1]; params.signBegin =date[0];
params.signEnd =date[date.length-1];
}
this.doTimeCondition(params, ["signBegin", "signEnd"]); this.doTimeCondition(params, ["signBegin", "signEnd"]);
try { try {
var page = await this.service.dataChart(params); var page = await this.service.dataChart(params);
return system.getResult2(page); return system.getResult2(page);
...@@ -62,9 +67,12 @@ class MerchantCtl extends CtlBase { ...@@ -62,9 +67,12 @@ class MerchantCtl extends CtlBase {
//统计商户报表 详情 //统计商户报表 详情
async commercialList(qobj){ async commercialList(qobj){
var params = qobj || {}; var params = qobj || {};
var date = this.getMonthDays(params); if (params.month) {
params.signBegin =date[0]; let date = this.getMonthDays(params.month);
params.signEnd =date[date.length-1]; params.signBegin =date[0];
params.signEnd =date[date.length-1];
}
this.doTimeCondition(params, ["signBegin", "signEnd"]);
try { try {
var page = await this.service.commercialList(params); var page = await this.service.commercialList(params);
return system.getResult2(page); return system.getResult2(page);
...@@ -90,9 +98,11 @@ class MerchantCtl extends CtlBase { ...@@ -90,9 +98,11 @@ class MerchantCtl extends CtlBase {
//统计报表 个人 图表 //统计报表 个人 图表
async commercialCountToChares(qobj){ async commercialCountToChares(qobj){
var params = qobj || {}; var params = qobj || {};
var date = this.getMonthDays(params); if (params.month) {
params.signBegin =date[0]; let date = this.getMonthDays(params.month);
params.signEnd =date[date.length-1]; params.signBegin =date[0];
params.signEnd =date[date.length-1];
}
try { try {
var page = await this.service.commercialCountToChares(params); var page = await this.service.commercialCountToChares(params);
return system.getResult2(page); return system.getResult2(page);
......
...@@ -15,7 +15,7 @@ class electroniccontractDao extends Dao { ...@@ -15,7 +15,7 @@ class electroniccontractDao extends Dao {
let list = await this.customQuery(sql, {companyNames: companyNames}); let list = await this.customQuery(sql, {companyNames: companyNames});
if(list || list.length == 0) { if(!list || list.length == 0) {
return result; return result;
} }
......
...@@ -15,7 +15,7 @@ class LoadDao extends Dao { ...@@ -15,7 +15,7 @@ class LoadDao extends Dao {
let list = await this.customQuery(sql, {companyNames: companyNames}); let list = await this.customQuery(sql, {companyNames: companyNames});
if(list || list.length == 0) { if(!list || list.length == 0) {
return result; return result;
} }
......
...@@ -15,7 +15,7 @@ class RecruitDao extends Dao { ...@@ -15,7 +15,7 @@ class RecruitDao extends Dao {
let list = await this.customQuery(sql, {companyNames: companyNames}); let list = await this.customQuery(sql, {companyNames: companyNames});
if(list || list.length == 0) { if(!list || list.length == 0) {
return result; return result;
} }
......
...@@ -14,7 +14,7 @@ class TaxinfoDao extends Dao { ...@@ -14,7 +14,7 @@ class TaxinfoDao extends Dao {
let list = await this.customQuery(sql, {companyNames: companyNames}); let list = await this.customQuery(sql, {companyNames: companyNames});
if(list || list.length == 0) { if(!list || list.length == 0) {
return result; return result;
} }
...@@ -32,7 +32,7 @@ class TaxinfoDao extends Dao { ...@@ -32,7 +32,7 @@ class TaxinfoDao extends Dao {
let list = await this.customQuery(sql, {companyNames: companyNames}); let list = await this.customQuery(sql, {companyNames: companyNames});
if(list || list.length == 0) { if(!list || list.length == 0) {
return result; return result;
} }
......
...@@ -14,13 +14,12 @@ class TransactioninDao extends Dao { ...@@ -14,13 +14,12 @@ class TransactioninDao extends Dao {
let list = await this.customQuery(sql, {companyNames: companyNames}); let list = await this.customQuery(sql, {companyNames: companyNames});
if(list || list.length == 0) { if(!list || list.length == 0) {
return result; return result;
} }
for (var item of list) { for (var item of list) {
result[item.company_name] = item.num || 0; result[item.company_name] = item.num || 0;
result[item.company_name] = item.amount || 0;
} }
return result; return result;
} }
...@@ -34,12 +33,13 @@ class TransactioninDao extends Dao { ...@@ -34,12 +33,13 @@ class TransactioninDao extends Dao {
let list = await this.customQuery(sql, {companyNames: companyNames}); let list = await this.customQuery(sql, {companyNames: companyNames});
if(list || list.length == 0) { if(!list || list.length == 0) {
return result; return result;
} }
for (var item of list) { for (var item of list) {
result[item.company_name] = item.amount || 0; // result[item.company_name] = item.amount || 0;
result[item.company_name] = parseFloat((item.amount || 0).toFixed(2));
} }
return result; return result;
} }
......
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