Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
049245d4
Commit
049245d4
authored
Dec 14, 2019
by
赵庆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
8e6f015e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
212 additions
and
0 deletions
+212
-0
bpo-stat/app/base/controller/impl/all/merchantCtl.js
+26
-0
bpo-stat/app/base/db/impl/all/electroniccontractDao.js
+20
-0
bpo-stat/app/base/db/impl/all/loadDao.js
+20
-0
bpo-stat/app/base/db/impl/all/taxinfoDao.js
+39
-0
bpo-stat/app/base/db/impl/all/transactioninDao.js
+38
-0
bpo-stat/app/base/service/impl/all/electroniccontractSve.js
+24
-0
bpo-stat/app/base/service/impl/all/merchantSve.js
+45
-0
No files found.
bpo-stat/app/base/controller/impl/all/merchantCtl.js
View file @
049245d4
...
...
@@ -66,6 +66,32 @@ class MerchantCtl extends CtlBase {
}
//统计报表 个人
async
commercialCountToList
(
qobj
){
var
params
=
qobj
||
{};
try
{
var
page
=
await
this
.
service
.
commercialCountTo
(
params
);
return
system
.
getResult2
(
page
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getErrResult2
(
"您的网络不稳, 请稍后重试"
);
}
}
async
commercialCountToChares
(
qobj
){
var
params
=
qobj
||
{};
try
{
var
page
=
await
this
.
service
.
commercialCountToChares
(
params
);
return
system
.
getResult2
(
page
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getErrResult2
(
"您的网络不稳, 请稍后重试"
);
}
}
}
...
...
bpo-stat/app/base/db/impl/all/electroniccontractDao.js
View file @
049245d4
...
...
@@ -24,6 +24,25 @@ class electroniccontractDao extends Dao {
}
return
result
;
}
async
sCount
(
inno
)
{
var
result
=
{};
if
(
!
inno
||
inno
.
length
==
0
)
{
return
result
;
}
var
sql
=
"SELECT id_no, COUNT(1) AS num FROM `electronic_contract_info` WHERE id_no IN (:inno) GROUP BY id_no"
;
let
list
=
await
this
.
customQuery
(
sql
,
{
inno
:
inno
});
if
(
list
||
list
.
length
==
0
)
{
return
result
;
}
for
(
var
item
of
list
)
{
result
[
item
.
id_no
]
=
item
.
num
||
0
;
}
return
result
;
}
}
module
.
exports
=
electroniccontractDao
;
\ No newline at end of file
bpo-stat/app/base/db/impl/all/loadDao.js
View file @
049245d4
...
...
@@ -24,6 +24,25 @@ class LoadDao extends Dao {
}
return
result
;
}
async
sCount
(
inno
)
{
var
result
=
{};
if
(
!
inno
||
inno
.
length
==
0
)
{
return
result
;
}
var
sql
=
"SELECT id_no, COUNT(1) AS num FROM `load_info` WHERE id_no IN (:inno) GROUP BY id_no"
;
let
list
=
await
this
.
customQuery
(
sql
,
{
inno
:
inno
});
if
(
list
||
list
.
length
==
0
)
{
return
result
;
}
for
(
var
item
of
list
)
{
result
[
item
.
id_no
]
=
item
.
num
||
0
;
}
return
result
;
}
}
module
.
exports
=
LoadDao
;
\ No newline at end of file
bpo-stat/app/base/db/impl/all/taxinfoDao.js
View file @
049245d4
...
...
@@ -41,6 +41,44 @@ class TaxinfoDao extends Dao {
}
return
result
;
}
async
sCount
(
idno
)
{
var
result
=
{};
if
(
!
idno
||
idno
.
length
==
0
)
{
return
result
;
}
var
sql
=
"SELECT id_no, COUNT(1) AS num FROM `tax_info` WHERE id_no IN (:idno) GROUP BY name"
;
let
list
=
await
this
.
customQuery
(
sql
,
{
idno
:
idno
});
if
(
list
||
list
.
length
==
0
)
{
return
result
;
}
for
(
var
item
of
list
)
{
result
[
item
.
id_no
]
=
item
.
num
||
0
;
}
return
result
;
}
async
sCountS
(
inno
)
{
var
result
=
{};
if
(
!
inno
||
inno
.
length
==
0
)
{
return
result
;
}
var
sql
=
"SELECT id_no, SUM(actual_amount) AS num FROM `tax_info` WHERE company_name IN (:inno) GROUP BY name"
;
let
list
=
await
this
.
customQuery
(
sql
,
{
inno
:
inno
});
if
(
list
||
list
.
length
==
0
)
{
return
result
;
}
for
(
var
item
of
list
)
{
result
[
item
.
id_no
]
=
item
.
num
||
0
;
}
return
result
;
}
}
module
.
exports
=
TaxinfoDao
;
\ No newline at end of file
bpo-stat/app/base/db/impl/all/transactioninDao.js
View file @
049245d4
...
...
@@ -43,6 +43,43 @@ class TransactioninDao extends Dao {
}
return
result
;
}
async
sCount
(
idno
)
{
var
result
=
{};
if
(
!
idno
||
idno
.
length
==
0
)
{
return
result
;
}
var
sql
=
"SELECT id_no, COUNT(id_no) num FROM `transaction_info` WHERE id_no IN (:idno) GROUP BY id_no"
;
let
list
=
await
this
.
customQuery
(
sql
,
{
idno
:
idno
});
if
(
list
||
list
.
length
==
0
)
{
return
result
;
}
for
(
var
item
of
list
)
{
result
[
item
.
num
]
=
item
.
amount
||
0
;
}
return
result
;
}
async
sCountS
(
idno
)
{
var
result
=
{};
if
(
!
idno
||
idno
.
length
==
0
)
{
return
result
;
}
var
sql
=
"SELECT id_no, SUM(actual_amount) amount FROM `transaction_info` WHERE id_no IN (:idno) GROUP BY id_no"
;
let
list
=
await
this
.
customQuery
(
sql
,
{
idno
:
idno
});
if
(
list
||
list
.
length
==
0
)
{
return
result
;
}
for
(
var
item
of
list
)
{
result
[
item
.
amount
]
=
item
.
amount
||
0
;
}
return
result
;
}
}
module
.
exports
=
TransactioninDao
;
\ No newline at end of file
bpo-stat/app/base/service/impl/all/electroniccontractSve.js
View file @
049245d4
...
...
@@ -34,6 +34,29 @@ class ElectronicContractService extends ServiceBase {
return
page
;
}
async
signPageGroup
(
params
)
{
var
currentPage
=
Number
(
params
.
currentPage
||
0
);
var
pageSize
=
Number
(
params
.
pageSize
||
10
);
var
where
=
{};
if
(
params
.
company_name
)
{
where
.
company_name
=
{
[
this
.
db
.
Op
.
like
]:
"%"
+
params
.
company_name
+
"%"
};
}
if
(
params
.
sign_body
){
where
.
sign_body
=
params
.
sign_body
;
}
this
.
addWhereTime
(
where
,
'completed_date'
,
params
.
signBegin
,
params
.
signEnd
,
true
);
var
orderby
=
[
[
"id"
,
'desc'
]
];
var
attributes
=
[
`id`
,
`company_name`
,
`name`
,
`id_no`
,
`phone_no`
,
`bank_no`
,
`completed_date`
,
`file_url`
,
`sign_body`
];
var
page
=
await
this
.
getPageList
(
currentPage
,
pageSize
,
where
,
orderby
,
attributes
);
return
page
;
}
}
module
.
exports
=
ElectronicContractService
;
\ No newline at end of file
bpo-stat/app/base/service/impl/all/merchantSve.js
View file @
049245d4
...
...
@@ -263,6 +263,51 @@ class MerchantService extends ServiceBase {
}
async
commercialCountTo
(
params
){
let
page
=
await
this
.
electroniccontractSve
.
signPageGroup
(
params
);
let
rows
=
page
.
rows
;
if
(
!
page
||
!
page
.
rows
||
page
.
rows
.
length
==
0
)
{
return
page
;
}
let
companyNames
=
[];
for
(
var
row
of
rows
)
{
companyNames
.
push
(
row
.
id_no
);
}
// 电子签约数量
let
electronMap
=
await
this
.
electroniccontractDao
.
sCount
(
companyNames
);
// 工作量确认单
let
loadMap
=
await
this
.
loadDao
.
sCount
(
companyNames
);
// 交易笔数
let
traMap
=
await
this
.
transactioninDao
.
sCount
(
companyNames
);
//交易金额
let
traSUm
=
await
this
.
transactioninDao
.
sCountS
(
companyNames
);
// 完税人次
let
taxMap
=
await
this
.
taxinfoDao
.
sCount
(
companyNames
);
// 完税金额
let
taxSUm
=
await
this
.
taxinfoDao
.
statCounts
(
companyNames
);
for
(
var
row
of
rows
)
{
row
.
dzCount
=
electronMap
[
row
.
company_name
]
||
0
;
row
.
gzCount
=
loadMap
[
row
.
company_name
]
||
0
;
row
.
jyCOunt
=
traMap
[
row
.
company_name
]
||
0
;
row
.
jySum
=
traSUm
[
row
.
company_name
]
||
0
;
row
.
wsCOunt
=
taxMap
[
row
.
company_name
]
||
0
;
row
.
wsSum
=
taxSUm
[
row
.
company_name
]
||
0
;
}
page
.
rows
=
rows
;
return
page
;
}
async
commercialCountToChares
(){
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment