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
bfd813e2
Commit
bfd813e2
authored
Mar 10, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
f460c0de
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
137 additions
and
174 deletions
+137
-174
xggsve-invoice/app/base/api/impl/op/action.js
+5
-2
xggsve-invoice/app/base/db/impl/invoice/iinvoiceDao.js
+100
-102
xggsve-invoice/app/base/db/impl/invoice/iinvoicedeliverDao.js
+15
-0
xggsve-invoice/app/base/db/impl/invoice/iinvoiceprocessDao.js
+15
-15
xggsve-invoice/app/base/service/impl/invoice/iinvoiceSve.js
+2
-55
No files found.
xggsve-invoice/app/base/api/impl/op/action.js
View file @
bfd813e2
...
...
@@ -5,6 +5,10 @@ class ActionAPI extends APIBase {
constructor
()
{
super
();
this
.
iinvoiceSve
=
system
.
getObject
(
"service.invoice.iinvoiceSve"
);
this
.
iproductSve
=
system
.
getObject
(
"service.product.iproductSve"
);
this
.
iprocessSve
=
system
.
getObject
(
"service.product.iprocessSve"
);
}
/**
* 接口跳转
...
...
@@ -40,9 +44,8 @@ class ActionAPI extends APIBase {
case
"productDics"
:
// 查询产品字典
// opResult = await this.oproductSve.productDics(action_body);
break
;
case
"allProcess"
:
// 查询业务进度
// opResult = await this.o
processSve.allNames(action_body);
opResult
=
await
this
.
i
processSve
.
allNames
(
action_body
);
break
;
// case "verificationAndCalculation": // 发票试算接口
...
...
xggsve-invoice/app/base/db/impl/invoice/iinvoiceDao.js
View file @
bfd813e2
...
...
@@ -10,9 +10,8 @@ class IInvoiceDao extends Dao {
var
sql
=
[];
sql
.
push
(
"SELECT"
);
sql
.
push
(
"COUNT(1) as total"
);
sql
.
push
(
"FROM `invoice` t1"
);
sql
.
push
(
"INNER JOIN `invoice_apply` t2 ON t1.`id` = t2.`id`"
);
sql
.
push
(
"WHERE 1 = 1 and t2.status in('1070','1080','1090')"
);
sql
.
push
(
"FROM `i_invoice` t1"
);
sql
.
push
(
"WHERE 1 = 1 "
);
this
.
setCondition
(
params
,
sql
);
...
...
@@ -27,8 +26,7 @@ class IInvoiceDao extends Dao {
var
sql
=
[];
sql
.
push
(
"SELECT"
);
sql
.
push
(
"t1.*"
);
sql
.
push
(
"FROM `invoice` t1"
);
sql
.
push
(
"INNER JOIN `invoice_apply` t2 ON t1.`id` = t2.`id`"
);
sql
.
push
(
"FROM `i_invoice` t1"
);
sql
.
push
(
"WHERE 1 = 1 "
);
this
.
setCondition
(
params
,
sql
);
...
...
@@ -41,116 +39,115 @@ class IInvoiceDao extends Dao {
}
setCondition
(
params
,
sql
)
{
var
complateTax
=
params
.
complateTax
;
if
(
complateTax
!=
"-1"
)
{
params
.
complateTax
=
Number
(
complateTax
);
sql
.
push
(
"AND t1.`complate_tax` = :complateTax"
);
}
// invoiceTimeBegin 2019-01-01 2019-01-01 00:00:00
// invoiceTimeEnd 2019-11-01 2019-11-01 23:59:59
if
(
params
.
invoiceTimeBegin
)
{
sql
.
push
(
"AND t1.`invoice_time` >= :invoiceTimeBegin"
);
}
if
(
params
.
invoiceTimeEnd
)
{
sql
.
push
(
"AND t1.`invoice_time` <= :invoiceTimeEnd"
);
}
if
(
params
.
invoiceTime
){
sql
.
push
(
"AND t1.`invoice_time` >= :invoiceTime"
);
}
if
(
params
.
applyNo
)
{
sql
.
push
(
"AND t2.`apply_no` = :applyNo"
);
if
(
params
.
apply_no
)
{
sql
.
push
(
"AND t2.`apply_no` = :apply_no"
);
}
if
(
params
.
redStatus
)
{
sql
.
push
(
"AND t1.`red_status` = :redStatus"
);
}
if
(
params
.
type
)
{
sql
.
push
(
"AND t2.`type` = :type"
);
if
(
params
.
status
)
{
sql
.
push
(
"AND t2.`status` = :status"
);
}
if
(
params
.
statuses
&&
params
.
statuses
.
length
>
0
){
sql
.
push
(
"AND t2.`status` in (:statuses)"
);
}
}
/**
* 红冲列表总计
* @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
.
invoice_type
)
{
sql
.
push
(
"AND t2.`invoice_type` = :invoice_type"
);
}
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
.
invoiceTimeBegin
)
{
sql
.
push
(
"AND t1.`invoice_time` >= :invoiceTimeBegin"
);
}
if
(
params
.
status
)
{
sql
.
push
(
`and c.status = :status`
);
if
(
params
.
invoiceTimeEnd
)
{
sql
.
push
(
"AND t1.`invoice_time` <= :invoiceTimeEnd"
);
}
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
.
red_status
)
{
sql
.
push
(
"AND t1.`red_status` = :red_status"
);
}
if
(
params
.
startTime
)
{
sql
.
push
(
`and a.invoice_time >= :startTime`
);
if
(
params
.
deliver_id
)
{
sql
.
push
(
"AND t2.`deliver_id` = :deliver_id"
);
}
if
(
params
.
endTime
)
{
sql
.
push
(
`and a.invoice_time <= :endTime`
);
if
(
params
.
bd_id
)
{
sql
.
push
(
"AND t2.`bd_id` = :bd_id"
);
}
if
(
params
.
invoiceTime
){
sql
.
push
(
`and a.invoice_time >= :invoiceTime`
);
if
(
params
.
bd_path
)
{
params
.
bd_path_like
=
params
.
bd_path
+
"%"
;
sql
.
push
(
"AND t2.`bd_path` = :bd_path_like"
);
}
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
);
}
// /**
// * 红冲列表总计
// * @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/db/impl/invoice/iinvoicedeliverDao.js
View file @
bfd813e2
...
...
@@ -6,6 +6,21 @@ class IinvoicedeliverDao extends Dao {
this
.
tableName
=
this
.
model
.
tableName
;
}
async
findMapByIds
(
ids
)
{
var
result
=
{};
var
sql
=
`SELECT * FROM
${
this
.
tableName
}
WHERE id IN (:ids)`
;
var
list
=
await
this
.
customQuery
(
sql
,
{
ids
:
ids
});
if
(
!
list
||
list
.
length
==
0
)
{
return
result
;
}
for
(
var
item
of
list
)
{
result
[
item
.
id
]
=
item
;
}
return
result
;
}
//交付商业务概览
async
countStat
(
params
)
{
var
sql
=
[];
...
...
xggsve-invoice/app/base/db/impl/invoice/iinvoiceprocessDao.js
View file @
bfd813e2
...
...
@@ -7,16 +7,16 @@ class IInvoiceprocessDao extends Dao {
this
.
tableName
=
this
.
model
.
tableName
;
}
async
delBy
OrderId
(
order
_id
)
{
if
(
!
order
_id
)
{
async
delBy
InvoiceId
(
invoice
_id
)
{
if
(
!
invoice
_id
)
{
return
;
}
let
sql
=
`DELETE FROM
${
this
.
tableName
}
WHERE
order_id = :order
_id`
;
await
this
.
customUpdate
(
sql
,
{
order_id
:
order
_id
});
let
sql
=
`DELETE FROM
${
this
.
tableName
}
WHERE
invoice_id = :invoice
_id`
;
await
this
.
customUpdate
(
sql
,
{
invoice_id
:
invoice
_id
});
}
async
findBy
OrderIdAndStatus
(
order
Id
,
status
)
{
if
(
!
order
Id
||
!
status
)
{
async
findBy
InvoiceIdAndStatus
(
invoice
Id
,
status
)
{
if
(
!
invoice
Id
||
!
status
)
{
return
null
;
}
let
sql
=
[];
...
...
@@ -24,19 +24,19 @@ class IInvoiceprocessDao extends Dao {
sql
.
push
(
"*"
);
sql
.
push
(
"FROM"
);
sql
.
push
(
this
.
tableName
);
sql
.
push
(
"WHERE
order_id = :order
Id"
);
sql
.
push
(
"WHERE
invoice_id = :invoice
Id"
);
sql
.
push
(
"AND `status` = :status"
);
let
list
=
await
this
.
customQuery
(
sql
.
join
(
" "
),
{
orderId
:
order
Id
,
status
:
status
});
let
list
=
await
this
.
customQuery
(
sql
.
join
(
" "
),
{
invoiceId
:
invoice
Id
,
status
:
status
});
if
(
!
list
||
list
.
length
==
0
)
{
return
null
;
}
return
list
[
0
];
}
async
listBy
OrderIdsAndStatus
(
order
Ids
,
statuses
)
{
async
listBy
InvoiceIdsAndStatus
(
invoice
Ids
,
statuses
)
{
var
result
=
{};
if
(
!
orderIds
||
order
Ids
.
length
==
0
||
!
statuses
||
statuses
.
length
==
0
)
{
if
(
!
invoiceIds
||
invoice
Ids
.
length
==
0
||
!
statuses
||
statuses
.
length
==
0
)
{
return
result
;
}
let
sql
=
[];
...
...
@@ -44,21 +44,21 @@ class IInvoiceprocessDao extends Dao {
sql
.
push
(
"*"
);
sql
.
push
(
"FROM"
);
sql
.
push
(
this
.
tableName
);
sql
.
push
(
"WHERE
order_id IN (:order
Ids)"
);
sql
.
push
(
"WHERE
invoice_id IN (:invoice
Ids)"
);
sql
.
push
(
"AND `status` IN (:statuses)"
);
return
await
this
.
customQuery
(
sql
.
join
(
" "
),
{
orderIds
:
order
Ids
,
statuses
:
statuses
});
return
await
this
.
customQuery
(
sql
.
join
(
" "
),
{
invoiceIds
:
invoice
Ids
,
statuses
:
statuses
});
}
async
mapBy
OrderIdsAndStatus
(
order
Ids
,
statuses
)
{
async
mapBy
InvoiceIdsAndStatus
(
invoice
Ids
,
statuses
)
{
var
result
=
{};
let
list
=
await
this
.
listBy
OrderIdsAndStatus
(
order
Ids
,
statuses
);
let
list
=
await
this
.
listBy
InvoiceIdsAndStatus
(
invoice
Ids
,
statuses
);
if
(
!
list
||
list
.
length
==
0
)
{
return
result
;
}
for
(
let
item
of
list
)
{
result
[
item
.
order
_id
+
"_"
+
item
.
status
]
=
item
;
result
[
item
.
invoice
_id
+
"_"
+
item
.
status
]
=
item
;
}
return
result
;
}
...
...
xggsve-invoice/app/base/service/impl/invoice/iinvoiceSve.js
View file @
bfd813e2
...
...
@@ -23,62 +23,10 @@ class IInvoiceService extends ServiceBase {
* 发票申请
* @param {*} params
*/
async
invoiceApply
(
params
){
async
invoiceApply
(
params
)
{
}
//********************************************** 代码分隔 总统在上面写 *********************************************************** */
//**********************************************以下是旧版本************************************************************ */
/**
* 构建产品流程对象
* @param productPid
* @param chooseProductIds
* @returns {Promise<void>}
*/
async
buildProcess
(
params
)
{
let
productPid
=
params
.
productPid
||
50010000
;
// 查询产品流程
let
productProcessList
=
await
this
.
iproductprocessDao
.
byProductPid
(
productPid
);
if
(
!
productProcessList
||
productProcessList
.
length
==
0
)
{
return
[];
}
let
invoiceProcessList
=
[];
// 批量查流程
let
processMap
=
await
this
.
iprocessDao
.
mapAll
();
for
(
let
productProcess
of
productProcessList
)
{
// 风还钻该处理每一个子项流程 变为 订单流程对象
let
process
=
processMap
[
productProcess
.
process_id
];
let
nextArr
=
this
.
trim
(
productProcess
.
next_status
).
split
(
","
);
let
nextStatus
=
[];
for
(
let
nextId
of
nextArr
)
{
nextId
=
Number
(
nextId
||
0
);
let
nextObj
=
processMap
[
nextId
];
if
(
!
nextObj
)
{
continue
;
}
nextStatus
.
push
({
next_status
:
nextObj
.
status
,
next_name
:
nextObj
.
name
});
}
let
orderProcess
=
{
product_id
:
productPid
,
name
:
process
.
name
,
status
:
process
.
status
,
func
:
productProcess
.
func
,
next_status
:
JSON
.
stringify
(
nextStatus
),
name1
:
productProcess
.
name1
,
name2
:
productProcess
.
name2
,
name3
:
productProcess
.
name3
,
name4
:
productProcess
.
name4
,
sort
:
productProcess
.
sort
,
autoIncrement
:
true
};
invoiceProcessList
.
push
(
orderProcess
);
}
return
invoiceProcessList
;
}
}
module
.
exports
=
IInvoiceService
;
\ No newline at end of file
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