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
f862b48d
Commit
f862b48d
authored
Dec 14, 2019
by
赵庆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
1d5afa98
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
38 deletions
+76
-38
bpo-stat/app/base/controller/impl/all/merchantCtl.js
+3
-3
bpo-stat/app/base/service/impl/all/merchantSve.js
+42
-4
bpo-stat/app/config/routes/web.js
+31
-31
No files found.
bpo-stat/app/base/controller/impl/all/merchantCtl.js
View file @
f862b48d
...
...
@@ -42,7 +42,7 @@ class MerchantCtl extends CtlBase {
}
}
//统计商户报表
async
commercialCount
(){
async
commercialCount
(
qobj
){
var
params
=
qobj
||
{};
try
{
var
page
=
await
this
.
service
.
commercialCount
(
params
);
...
...
@@ -52,8 +52,8 @@ class MerchantCtl extends CtlBase {
return
system
.
getErrResult2
(
"您的网络不稳, 请稍后重试"
);
}
}
async
commercialList
(){
//统计商户报表 详情
async
commercialList
(
qobj
){
var
params
=
qobj
||
{};
try
{
var
page
=
await
this
.
service
.
commercialList
(
params
);
...
...
bpo-stat/app/base/service/impl/all/merchantSve.js
View file @
f862b48d
...
...
@@ -10,6 +10,12 @@ class MerchantService extends ServiceBase {
this
.
recruitDao
=
system
.
getObject
(
"db.all.recruitDao"
);
this
.
taxinfoDao
=
system
.
getObject
(
"db.all.taxinfoDao"
);
this
.
transactioninDao
=
system
.
getObject
(
"db.all.transactioninDao"
);
this
.
recruitSve
=
system
.
getObject
(
"service.all.recruitSve"
);
this
.
electroniccontractSve
=
system
.
getObject
(
"service.all.electroniccontractSve"
);
this
.
loadSve
=
system
.
getObject
(
"service.all.loadSve"
);
this
.
taxinfoSve
=
system
.
getObject
(
"service.all.taxinfoSve"
);
this
.
transactioninSve
=
system
.
getObject
(
"service.all.transactioninSve"
);
}
async
signPage
(
params
)
{
...
...
@@ -180,18 +186,50 @@ class MerchantService extends ServiceBase {
}
async
commercialList
(
params
){
var
result
=
[];
var
currentPage
=
Number
(
params
.
currentPage
||
1
);
var
pageSize
=
Number
(
params
.
pageSize
||
10
);
var
sql
=
""
;
var
db
=
""
;
var
firlt
=
""
;
var
page
=
{};
if
(
params
.
type
==
1
){
//招工
db
=
"recruit_info"
;
firlt
=
"publish_date"
page
=
await
this
.
recruitSve
.
signPage
(
params
);
}
else
if
(
params
.
type
==
2
){
//电子签约
db
=
"electronic_contract_info"
;
firlt
=
"completed_date"
;
page
=
await
this
.
electroniccontractSve
.
signPage
(
params
);
}
else
if
(
params
.
type
==
3
){
//工作量
db
=
"load_info"
;
firlt
=
"affirm_time"
;
page
=
await
this
.
loadSve
.
signPage
(
params
);
}
else
if
(
params
.
type
==
4
){
//交易
db
=
"transaction_info"
;
firlt
=
"transaction_time"
;
page
=
await
this
.
transactioninSve
.
signPage
(
params
);
}
else
{
//完税
db
=
"tax_info"
;
firlt
=
"tax_time"
;
page
=
await
this
.
taxinfoSve
.
signPage
(
params
);
}
var
sql
=
"SELECT DATE_FORMAT("
+
firlt
+
",'%Y-%m-%d') days,COUNT(id) COUNT FROM "
+
db
+
" WHERE 1=1"
;
if
(
params
.
company_name
)
{
sql
=
sql
+
" ANN company_name = "
+
params
.
company_name
;
}
if
(
params
.
sign_body
)
{
sql
=
sql
+
" AND sign_body = "
+
params
.
sign_body
;
}
var
charts
=
[[],[]];
var
chart
=
await
this
.
customQuery
(
sql
);
for
(
let
i
=
0
;
i
<
chart
.
length
;
i
++
){
charts
[
0
].
push
(
chart
[
i
].
days
)
charts
[
1
].
push
(
chart
[
i
].
COUNT
)
}
page
.
charts
=
charts
;
return
page
;
}
...
...
bpo-stat/app/config/routes/web.js
View file @
f862b48d
...
...
@@ -5,37 +5,37 @@ var userCtl = system.getObject("web.auth.userCtl");
const
redisClient
=
system
.
getObject
(
"util.redisClient"
);
module
.
exports
=
function
(
app
)
{
app
.
all
(
"/web/*"
,
async
function
(
req
,
res
,
next
)
{
let
bpostatsid
=
req
.
headers
[
"bpostatsid"
]
||
""
;
jsonUser
=
await
redisClient
.
get
(
bpostatsid
);
if
(
jsonUser
)
{
jsonUser
=
JSON
.
parse
(
jsonUser
);
}
if
(
req
.
url
.
indexOf
(
"auth/userCtl/login"
)
>
0
||
req
.
url
.
indexOf
(
"auth/userCtl/register"
)
>
0
||
req
.
url
.
indexOf
(
"getRsConfig"
)
>
0
)
{
if
(
jsonUser
)
{
req
.
loginUser
=
jsonUser
;
}
else
{
req
.
loginUser
=
null
;
}
return
next
();
}
if
(
!
jsonUser
)
{
res
.
end
(
JSON
.
stringify
({
status
:
-
99
,
msg
:
"no login"
}));
return
;
}
if
(
bpostatsid
)
{
redisClient
.
setWithEx
(
bpostatsid
,
JSON
.
stringify
(
jsonUser
),
60
*
60
*
60
);
}
req
.
loginUser
=
jsonUser
;
next
();
});
//
app.all("/web/*", async function (req, res, next) {
//
let bpostatsid = req.headers["bpostatsid"] || "";
//
jsonUser = await redisClient.get(bpostatsid);
//
if (jsonUser) {
//
jsonUser = JSON.parse(jsonUser);
//
}
//
//
if (req.url.indexOf("auth/userCtl/login") > 0 ||
//
req.url.indexOf("auth/userCtl/register") > 0 ||
//
req.url.indexOf("getRsConfig") > 0) {
//
//
if (jsonUser) {
//
req.loginUser = jsonUser;
//
} else {
//
req.loginUser = null;
//
}
//
return next();
//
}
//
//
if (!jsonUser) {
//
res.end(JSON.stringify({status: -99, msg: "no login"}));
//
return;
//
}
//
//
if (bpostatsid) {
//
redisClient.setWithEx(bpostatsid, JSON.stringify(jsonUser), 60 * 60 * 60);
//
}
//
//
req.loginUser = jsonUser;
//
next();
//
});
app
.
get
(
"/"
,
async
function
(
req
,
res
)
{
res
.
render
(
"index"
,
{
appinfo
:
null
,
app
:
null
});
...
...
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