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
d5456c53
Commit
d5456c53
authored
May 12, 2020
by
孙亚楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dd
parent
9d30a104
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
79 deletions
+35
-79
xggsve-invoice/app/base/db/impl/invoice/iinvoiceDao.js
+21
-78
xggsve-invoice/app/base/service/impl/invoice/iinvoiceSve.js
+14
-1
No files found.
xggsve-invoice/app/base/db/impl/invoice/iinvoiceDao.js
View file @
d5456c53
...
...
@@ -109,6 +109,27 @@ class IInvoiceDao extends Dao {
return
{
personal_invoice_tax_total
:
res
[
0
].
personal_invoice_tax_total
||
0
,
personal_invoice_amount_total
:
res
[
0
].
personal_invoice_amount_total
||
0
};
}
async
countByParamsBycreditCode
(
params
){
var
sql
=
[];
sql
.
push
(
"SELECT count(1) as count"
);
sql
.
push
(
"FROM `saas_invoice` t1 INNER JOIN `saas_invoice_apply` t2 ON t1.id = t2.id "
);
sql
.
push
(
"WHERE 1 = 1 AND t1.`from_credit_code` in(:credit_code_array)"
);
if
(
params
.
from_name
){
sql
.
push
(
"AND t1.`from_name` = :from_name"
);
}
if
(
params
.
status
){
sql
.
push
(
"AND t2.`status` = :status"
)
}
if
(
params
.
statusArray
){
sql
.
push
(
"AND t2.`status` in (:statusArray)"
)
}
let
list
=
await
this
.
customQuery
(
sql
.
join
(
" "
),
params
);
if
(
list
.
length
==
0
){
return
{
count
:
0
};
}
return
list
[
0
];
}
/**
* 根据统一社会信用代码获取发票
* @param params
...
...
@@ -131,82 +152,5 @@ class IInvoiceDao extends Dao {
sql
.
push
(
"ORDER BY t1.invoice_time DESC"
);
return
await
this
.
customQuery
(
sql
.
join
(
" "
),
params
);
}
// /**
// * 红冲列表总计
// * @param {*} params
// */
// async countRedRushListByParams(params){
// var sql = [];
// sql.push(`select count(1) as count from invoice_apply a inner join invoice_deliverer b on a.deliverer_id =b.id
// inner join invoice c on b.invoice_id =c.id where a.id = c.id `);
// if (params.delivererId) {
// sql.push(` AND b.deliverer_id = :delivererId`);
// }
// if (params.applyNo) {
// sql.push(` AND a.apply_no = :applyNo`);
// }
// if (params.invoiceNo) {
// sql.push(` AND c.invoice_no = :invoiceNo`);
// }
// if (params.startTime) {
// sql.push(`and a.invoice_time >= :startTime`);
// }
// if (params.endTime) {
// sql.push(`and a.invoice_time <= :endTime`);
// }
// if(params.invoiceTime){
// sql.push(`and a.invoice_time >= :invoiceTime`);
// }
// if (params.type) {
// sql.push(`and a.type = :type`);
// }
// if (params.redStatus) {
// sql.push(`and c.red_status = :redStatus`);
// }
// if (params.status) {
// sql.push(`and c.status = :status`);
// }
// return await this.customQuery(sql.join(" "), params);
// }
// /**
// * 红冲列表
// * @param {*} params
// */
// async redRushListByParams(params){
// var sql = [];
// sql.push(`select a.apply_no,a.type,a.invoice_amount,a.invoice_time,c.status,
// a.merchant_name,a.businessmen_name,a.id,b.deliverer_id from invoice_apply a
// inner join invoice_deliverer b on a.deliverer_id =b.id
// inner join invoice c on b.invoice_id =c.id where a.id = c.id `);
// if (params.delivererId) {
// sql.push(` AND b.deliverer_id = :delivererId`);
// }
// if (params.applyNo) {
// sql.push(` AND a.apply_no = :applyNo`);
// }
// if (params.startTime) {
// sql.push(`and a.invoice_time >= :startTime`);
// }
// if (params.endTime) {
// sql.push(`and a.invoice_time <= :endTime`);
// }
// if(params.invoiceTime){
// sql.push(`and a.invoice_time >= :invoiceTime`);
// }
// if (params.type) {
// sql.push(`and a.type = :type`);
// }
// if (params.redStatus) {
// sql.push(`and c.red_status = :redStatus`);
// }
// sql.push("ORDER BY c.id DESC");
// sql.push("LIMIT :statRow, :pageSize");
// return await this.customQuery(sql.join(" "), params);
// }
}
module
.
exports
=
IInvoiceDao
;
\ No newline at end of file
xggsve-invoice/app/base/service/impl/invoice/iinvoiceSve.js
View file @
d5456c53
...
...
@@ -481,6 +481,19 @@ class IInvoiceService extends ServiceBase {
return
system
.
getResult
(
null
,
`参数错误 统一社会信用代码格式不正确`
);
}
try
{
params
.
currentPage
=
Number
(
params
.
currentPage
||
1
);
params
.
pageSize
=
Number
(
params
.
pageSize
||
10
);
params
.
startRow
=
Number
((
params
.
currentPage
-
1
)
*
params
.
pageSize
);
let
totalRes
=
await
this
.
dao
.
countByParamsBycreditCode
(
params
);
if
(
totalRes
.
count
==
0
)
{
return
system
.
getResult
({
count
:
0
,
rows
:
[]
});
}
let
list
=
await
this
.
dao
.
invoiceBycreditCode
(
params
);
if
(
!
list
||
list
.
length
==
0
){
return
system
.
getResult
([]);
...
...
@@ -492,7 +505,7 @@ class IInvoiceService extends ServiceBase {
}
item
.
invoice_amount
=
system
.
f2y
(
item
.
invoice_amount
);
}
return
system
.
getResult
(
list
);
return
system
.
getResult
(
{
count
:
totalRes
.
count
,
rows
:
list
}
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResult
(
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