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
b11073e2
Commit
b11073e2
authored
Apr 04, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
16a4364c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
123 additions
and
2 deletions
+123
-2
xggsve-order/app/base/api/impl/op/action.js
+3
-0
xggsve-order/app/base/db/impl/saas/saasorderdeliverinfoDao.js
+92
-2
xggsve-order/app/base/service/impl/saas/saasorderSve.js
+28
-0
No files found.
xggsve-order/app/base/api/impl/op/action.js
View file @
b11073e2
...
...
@@ -168,6 +168,9 @@ class ActionAPI extends APIBase {
case
"saasOrderDeliverMapByCreditCodes"
:
// 订单信息
opResult
=
await
this
.
saasorderSve
.
mapByCreditCodes
(
action_body
);
break
;
case
"saasOrderDeliverBusinessmenPage"
:
// 订单交付的个体户信息
opResult
=
await
this
.
saasorderSve
.
businessmenPage
(
action_body
);
break
;
//******************************************************************** */
// // 订单
...
...
xggsve-order/app/base/db/impl/saas/saasorderdeliverinfoDao.js
View file @
b11073e2
...
...
@@ -5,6 +5,98 @@ class SaasOrderDeliverInfoDao extends Dao {
super
(
Dao
.
getModelName
(
SaasOrderDeliverInfoDao
));
}
async
countByCondition
(
params
)
{
var
sql
=
[];
sql
.
push
(
"SELECT"
);
sql
.
push
(
"count(1) as num"
);
sql
.
push
(
"FROM"
);
sql
.
push
(
"saas_order t1"
);
sql
.
push
(
"INNER JOIN `saas_order_deliver_info` t2 ON t1.`id` = t2.`id`"
);
sql
.
push
(
"WHERE t1.deleted_at IS NULL"
);
this
.
setCondition
(
sql
,
params
);
var
list
=
await
this
.
customQuery
(
sql
.
join
(
" "
),
params
);
if
(
!
list
||
list
.
length
==
0
)
{
return
0
;
}
return
list
[
0
].
num
;
}
async
listByCondition
(
params
)
{
params
.
startRow
=
Number
(
params
.
startRow
||
0
);
params
.
pageSize
=
Number
(
params
.
pageSize
||
10
);
let
attrs
=
"t2.*"
;
if
(
params
.
attrs
&&
params
.
attrs
.
length
>
0
)
{
attrs
=
"t2."
+
params
.
attrs
.
join
(
", t2."
);
}
var
sql
=
[];
sql
.
push
(
"SELECT"
);
sql
.
push
(
attrs
);
sql
.
push
(
"FROM"
);
sql
.
push
(
"saas_order t1"
);
sql
.
push
(
"INNER JOIN `saas_order_deliver_info` t2 ON t1.`id` = t2.`id`"
);
sql
.
push
(
"WHERE t1.deleted_at IS NULL"
);
this
.
setCondition
(
sql
,
params
);
sql
.
push
(
"ORDER BY t1.id DESC"
);
sql
.
push
(
"LIMIT :startRow, :pageSize"
);
return
await
this
.
customQuery
(
sql
.
join
(
" "
),
params
);
}
setCondition
(
sql
,
params
)
{
if
(
!
params
||
!
sql
)
{
return
;
}
if
(
params
.
isBusinessmenCreated
)
{
sql
.
push
(
"AND t2.sve_businessmen_customer_id <> ''"
);
}
if
(
params
.
saas_id
)
{
sql
.
push
(
"AND t1.saas_id = :saas_id"
);
}
if
(
params
.
merchant_id
)
{
sql
.
push
(
"AND t1.merchant_id = :merchant_id"
);
}
if
(
params
.
saas_merchant_id
)
{
sql
.
push
(
"AND t1.merchant_id = :saas_merchant_id"
);
}
if
(
params
.
pay_status
)
{
sql
.
push
(
"AND t1.pay_status = :pay_status"
);
}
if
(
params
.
audit_status
)
{
sql
.
push
(
"AND t1.audit_status = :audit_status"
);
}
if
(
params
.
handle_status
)
{
sql
.
push
(
"AND t1.handle_status = :handle_status"
);
}
if
(
params
.
createBegin
)
{
sql
.
push
(
"AND t2.created_at >= :createBegin"
);
}
if
(
params
.
createEnd
)
{
sql
.
push
(
"AND t2.created_at <= :createEnd"
);
}
if
(
params
.
merchant_app_user_id
)
{
sql
.
push
(
"AND t1.merchant_app_user_id = :merchant_app_user_id"
);
}
if
(
params
.
sve_businessmen_name
)
{
params
.
sve_businessmen_name_like
=
`%
${
params
.
sve_businessmen_name
}
%`
;
sql
.
push
(
"AND t2.sve_businessmen_name LIKE :sve_businessmen_name_like"
);
}
if
(
params
.
sve_businessmen_credit_code
)
{
sql
.
push
(
"AND t2.sve_businessmen_credit_code = :sve_businessmen_credit_code"
);
}
}
async
mapByIds
(
ids
,
attrs
)
{
let
result
=
{};
if
(
!
ids
||
ids
.
length
==
0
)
{
...
...
@@ -50,6 +142,5 @@ class SaasOrderDeliverInfoDao extends Dao {
return
result
;
}
}
module
.
exports
=
SaasOrderDeliverInfoDao
;
\ No newline at end of file
xggsve-order/app/base/service/impl/saas/saasorderSve.js
View file @
b11073e2
...
...
@@ -520,6 +520,34 @@ class SaasOrderService extends ServiceBase {
let
rs
=
await
this
.
saasorderdeliverinfoDao
.
mapByCreditCodes
(
params
.
creditCodes
,
params
.
attrs
)
||
{};
return
system
.
getResultSuccess
(
rs
);
}
async
businessmenPage
(
params
)
{
let
page
=
{
count
:
0
,
rows
:
[]
}
params
.
currentPage
=
Number
(
params
.
currentPage
||
1
);
params
.
pageSize
=
Number
(
params
.
pageSize
||
10
);
params
.
startRow
=
(
params
.
currentPage
-
1
)
*
params
.
pageSize
;
// 只查询已经建账的个体户
params
.
isBusinessmenCreated
=
true
;
page
.
count
=
await
this
.
saasorderdeliverinfoDao
.
countByCondition
(
params
);
if
(
page
.
count
==
0
)
{
return
system
.
getResultSuccess
(
page
);
}
params
.
attrs
=
[
"id"
,
"sve_businessmen_company_id"
,
"sve_businessmen_customer_id"
,
"sve_businessmen_name"
,
"sve_businessmen_credit_code"
];
page
.
rows
=
await
this
.
saasorderdeliverinfoDao
.
listByCondition
(
params
);
if
(
page
.
rows
)
{
for
(
var
row
of
page
.
rows
)
{
this
.
handleDate
(
row
,
[
"created_at"
],
null
,
-
8
);
}
}
return
system
.
getResultSuccess
(
page
);
}
}
module
.
exports
=
SaasOrderService
;
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