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
93a17dd0
Commit
93a17dd0
authored
Mar 11, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
d4d4ebd8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
93 additions
and
20 deletions
+93
-20
xggsve-invoice/app/base/api/impl/op/action.js
+3
-2
xggsve-invoice/app/base/db/impl/invoice/iinvoiceDao.js
+8
-8
xggsve-invoice/app/base/db/impl/invoice/iinvoicedeliverDao.js
+0
-0
xggsve-invoice/app/base/db/models/invoice/iinvoice.js
+3
-3
xggsve-invoice/app/base/service/impl/invoice/iinvoiceSve.js
+2
-3
xggsve-invoice/app/base/service/impl/invoice/iinvoicedeliverSve.js
+77
-4
No files found.
xggsve-invoice/app/base/api/impl/op/action.js
View file @
93a17dd0
...
@@ -5,10 +5,11 @@ class ActionAPI extends APIBase {
...
@@ -5,10 +5,11 @@ class ActionAPI extends APIBase {
constructor
()
{
constructor
()
{
super
();
super
();
this
.
iinvoiceSve
=
system
.
getObject
(
"service.invoice.iinvoiceSve"
);
this
.
iinvoiceSve
=
system
.
getObject
(
"service.invoice.iinvoiceSve"
);
this
.
iinvoicedeliverSve
=
system
.
getObject
(
"service.invoice.iinvoicedeliverSve"
);
this
.
iproductSve
=
system
.
getObject
(
"service.product.iproductSve"
);
this
.
iproductSve
=
system
.
getObject
(
"service.product.iproductSve"
);
this
.
iprocessSve
=
system
.
getObject
(
"service.product.iprocessSve"
);
this
.
iprocessSve
=
system
.
getObject
(
"service.product.iprocessSve"
);
}
}
/**
/**
* 接口跳转
* 接口跳转
...
@@ -36,7 +37,7 @@ class ActionAPI extends APIBase {
...
@@ -36,7 +37,7 @@ class ActionAPI extends APIBase {
opResult
=
await
this
.
iinvoiceSve
.
invoicePage
(
action_body
);
opResult
=
await
this
.
iinvoiceSve
.
invoicePage
(
action_body
);
break
;
break
;
case
"deliverInvoicePage"
:
// 发票申请列表页(交付商)
case
"deliverInvoicePage"
:
// 发票申请列表页(交付商)
opResult
=
await
this
.
iinvoice
Sve
.
deliverI
nvoicePage
(
action_body
);
opResult
=
await
this
.
iinvoice
deliverSve
.
i
nvoicePage
(
action_body
);
break
;
break
;
case
"handleStatus"
:
//进度处理
case
"handleStatus"
:
//进度处理
break
;
break
;
...
...
xggsve-invoice/app/base/db/impl/invoice/iinvoiceDao.js
View file @
93a17dd0
...
@@ -30,7 +30,7 @@ class IInvoiceDao extends Dao {
...
@@ -30,7 +30,7 @@ class IInvoiceDao extends Dao {
this
.
setCondition
(
params
,
sql
);
this
.
setCondition
(
params
,
sql
);
sql
.
push
(
"ORDER BY id DESC"
);
sql
.
push
(
"ORDER BY
t1.
id DESC"
);
sql
.
push
(
"LIMIT :startRow, :pageSize"
);
sql
.
push
(
"LIMIT :startRow, :pageSize"
);
params
.
startRow
=
startRow
||
0
;
params
.
startRow
=
startRow
||
0
;
params
.
pageSize
=
pageSize
||
10
;
params
.
pageSize
=
pageSize
||
10
;
...
@@ -39,16 +39,16 @@ class IInvoiceDao extends Dao {
...
@@ -39,16 +39,16 @@ class IInvoiceDao extends Dao {
setCondition
(
params
,
sql
)
{
setCondition
(
params
,
sql
)
{
if
(
params
.
apply_no
)
{
if
(
params
.
apply_no
)
{
sql
.
push
(
"AND t
2
.`apply_no` = :apply_no"
);
sql
.
push
(
"AND t
1
.`apply_no` = :apply_no"
);
}
}
if
(
params
.
status
)
{
if
(
params
.
status
)
{
sql
.
push
(
"AND t
2
.`status` = :status"
);
sql
.
push
(
"AND t
1
.`status` = :status"
);
}
}
if
(
params
.
statuses
&&
params
.
statuses
.
length
>
0
){
if
(
params
.
statuses
&&
params
.
statuses
.
length
>
0
){
sql
.
push
(
"AND t
2
.`status` in (:statuses)"
);
sql
.
push
(
"AND t
1
.`status` in (:statuses)"
);
}
}
if
(
params
.
invoice_type
)
{
if
(
params
.
invoice_type
)
{
sql
.
push
(
"AND t
2
.`invoice_type` = :invoice_type"
);
sql
.
push
(
"AND t
1
.`invoice_type` = :invoice_type"
);
}
}
if
(
params
.
invoiceTimeBegin
)
{
if
(
params
.
invoiceTimeBegin
)
{
sql
.
push
(
"AND t1.`invoice_time` >= :invoiceTimeBegin"
);
sql
.
push
(
"AND t1.`invoice_time` >= :invoiceTimeBegin"
);
...
@@ -61,14 +61,14 @@ class IInvoiceDao extends Dao {
...
@@ -61,14 +61,14 @@ class IInvoiceDao extends Dao {
sql
.
push
(
"AND t1.`red_status` = :red_status"
);
sql
.
push
(
"AND t1.`red_status` = :red_status"
);
}
}
if
(
params
.
deliver_id
)
{
if
(
params
.
deliver_id
)
{
sql
.
push
(
"AND t
2
.`deliver_id` = :deliver_id"
);
sql
.
push
(
"AND t
1
.`deliver_id` = :deliver_id"
);
}
}
if
(
params
.
bd_id
)
{
if
(
params
.
bd_id
)
{
sql
.
push
(
"AND t
2
.`bd_id` = :bd_id"
);
sql
.
push
(
"AND t
1
.`bd_id` = :bd_id"
);
}
}
if
(
params
.
bd_path
)
{
if
(
params
.
bd_path
)
{
params
.
bd_path_like
=
params
.
bd_path
+
"%"
;
params
.
bd_path_like
=
params
.
bd_path
+
"%"
;
sql
.
push
(
"AND t
2
.`bd_path` = :bd_path_like"
);
sql
.
push
(
"AND t
1
.`bd_path` = :bd_path_like"
);
}
}
}
}
...
...
xggsve-invoice/app/base/db/impl/invoice/iinvoicedeliverDao.js
View file @
93a17dd0
This diff is collapsed.
Click to expand it.
xggsve-invoice/app/base/db/models/invoice/iinvoice.js
View file @
93a17dd0
...
@@ -33,12 +33,12 @@ module.exports = (db, DataTypes) => {
...
@@ -33,12 +33,12 @@ module.exports = (db, DataTypes) => {
businessmen_account
:
{
type
:
DataTypes
.
STRING
(
45
),
allowNull
:
false
,
COMMENT
:
'销售方银行账号'
},
businessmen_account
:
{
type
:
DataTypes
.
STRING
(
45
),
allowNull
:
false
,
COMMENT
:
'销售方银行账号'
},
apply_no
:
{
type
:
DataTypes
.
STRING
(
45
),
allowNull
:
true
,
defaultValue
:
""
,
COMMENT
:
'发票申请编号'
},
apply_no
:
{
type
:
DataTypes
.
STRING
(
45
),
allowNull
:
true
,
defaultValue
:
""
,
COMMENT
:
'发票申请编号'
},
apply_time
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
defaultValue
:
null
,
COMMENT
:
'发票申请时间'
},
apply_time
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
defaultValue
:
null
,
COMMENT
:
'发票申请时间'
},
invoice_amount
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
defaultValue
:
0
,
COMMENT
:
'价税合计总金额'
},
invoice_amount
:
{
type
:
DataTypes
.
BIGINT
,
allowNull
:
true
,
defaultValue
:
0
,
COMMENT
:
'价税合计总金额'
},
invoice_content
:
{
type
:
DataTypes
.
STRING
(
300
),
allowNull
:
false
,
defaultValue
:
null
,
COMMENT
:
'开票内容'
},
invoice_content
:
{
type
:
DataTypes
.
STRING
(
300
),
allowNull
:
false
,
defaultValue
:
null
,
COMMENT
:
'开票内容'
},
contract
:
{
type
:
DataTypes
.
STRING
(
500
),
allowNull
:
true
,
delaultValue
:
""
,
COMMENT
:
'合同'
},
contract
:
{
type
:
DataTypes
.
STRING
(
500
),
allowNull
:
true
,
delaultValue
:
""
,
COMMENT
:
'合同'
},
personal_invoice_tax
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
false
,
defaultValue
:
null
,
COMMENT
:
'个税'
},
personal_invoice_tax
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
false
,
defaultValue
:
null
,
COMMENT
:
'个税'
},
additional_tax
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
false
,
defaultValue
:
null
,
COMMENT
:
'附加税'
},
additional_tax
:
{
type
:
DataTypes
.
BIGINT
,
allowNull
:
false
,
defaultValue
:
null
,
COMMENT
:
'附加税'
},
value_added_tax
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
false
,
defaultValue
:
null
,
COMMENT
:
'增值税'
},
value_added_tax
:
{
type
:
DataTypes
.
BIGINT
,
allowNull
:
false
,
defaultValue
:
null
,
COMMENT
:
'增值税'
},
mail_addr
:
{
type
:
DataTypes
.
STRING
(
200
),
allowNull
:
true
,
defaultValue
:
null
,
COMMENT
:
'邮寄地址'
},
mail_addr
:
{
type
:
DataTypes
.
STRING
(
200
),
allowNull
:
true
,
defaultValue
:
null
,
COMMENT
:
'邮寄地址'
},
mail_mobile
:
{
type
:
DataTypes
.
STRING
(
20
),
allowNull
:
true
,
defaultValue
:
null
,
COMMENT
:
'邮寄电话'
},
mail_mobile
:
{
type
:
DataTypes
.
STRING
(
20
),
allowNull
:
true
,
defaultValue
:
null
,
COMMENT
:
'邮寄电话'
},
mail_to
:
{
type
:
DataTypes
.
STRING
(
20
),
allowNull
:
true
,
defaultValue
:
null
,
COMMENT
:
'邮寄人'
},
mail_to
:
{
type
:
DataTypes
.
STRING
(
20
),
allowNull
:
true
,
defaultValue
:
null
,
COMMENT
:
'邮寄人'
},
...
...
xggsve-invoice/app/base/service/impl/invoice/iinvoiceSve.js
View file @
93a17dd0
...
@@ -144,7 +144,6 @@ class IInvoiceService extends ServiceBase {
...
@@ -144,7 +144,6 @@ class IInvoiceService extends ServiceBase {
return
system
.
getResult
(
null
,
`系统错误`
);
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
}
}
async
invoicePage
(
params
)
{
async
invoicePage
(
params
)
{
params
.
currentPage
=
Number
(
params
.
currentPage
||
1
);
params
.
currentPage
=
Number
(
params
.
currentPage
||
1
);
...
@@ -161,7 +160,7 @@ class IInvoiceService extends ServiceBase {
...
@@ -161,7 +160,7 @@ class IInvoiceService extends ServiceBase {
for
(
var
item
of
list
)
{
for
(
var
item
of
list
)
{
this
.
handleDate
(
item
,
[
'updated_at'
,
'created_at'
],
'YYYY-MM-DD HH:mm:ss'
);
this
.
handleDate
(
item
,
[
'updated_at'
,
'created_at'
],
'YYYY-MM-DD HH:mm:ss'
);
}
}
//格式化
订单
产品
//格式化产品
await
this
.
setDeliver
(
list
);
await
this
.
setDeliver
(
list
);
//格式化业务员
//格式化业务员
await
this
.
setStatus
(
list
);
await
this
.
setStatus
(
list
);
...
@@ -172,7 +171,7 @@ class IInvoiceService extends ServiceBase {
...
@@ -172,7 +171,7 @@ class IInvoiceService extends ServiceBase {
}
}
/**
/**
* 格式化
订单
产品
* 格式化产品
* @param {*} list
* @param {*} list
*/
*/
async
setProduct
(
list
)
{
async
setProduct
(
list
)
{
...
...
xggsve-invoice/app/base/service/impl/invoice/iinvoicedeliverSve.js
View file @
93a17dd0
...
@@ -4,9 +4,82 @@ const moment = require('moment');
...
@@ -4,9 +4,82 @@ const moment = require('moment');
/**
/**
* 平台提交的信息
* 平台提交的信息
*/
*/
class
Iinvoicedeliver
er
Service
extends
ServiceBase
{
class
IinvoicedeliverService
extends
ServiceBase
{
constructor
()
{
constructor
()
{
super
(
"invoice"
,
ServiceBase
.
getDaoName
(
DelivererService
));
super
(
"invoice"
,
ServiceBase
.
getDaoName
(
IinvoicedeliverService
));
this
.
iinvoiceDao
=
system
.
getObject
(
"db.invoice.iinvoiceDao"
);
this
.
iinvoiceprocessDao
=
system
.
getObject
(
"db.invoice.iinvoiceprocessDao"
);
this
.
iinvoiceinforegDao
=
system
.
getObject
(
"db.invoice.iinvoiceinforegDao"
);
this
.
iproductDao
=
system
.
getObject
(
"db.product.iproductDao"
);
this
.
iprocessDao
=
system
.
getObject
(
"db.product.iprocessDao"
);
this
.
iproductprocessDao
=
system
.
getObject
(
"db.product.iproductprocessDao"
);
}
async
invoicePage
(
params
)
{
params
.
currentPage
=
Number
(
params
.
currentPage
||
1
);
params
.
pageSize
=
Number
(
params
.
pageSize
||
10
);
params
.
startRow
=
Number
((
params
.
currentPage
-
1
)
*
params
.
pageSize
);
let
deliver_id
=
params
.
deliver_id
;
let
total
=
await
this
.
dao
.
countByParams
(
params
);
if
(
total
==
0
)
{
return
{
count
:
0
,
rows
:
[]
};
}
let
list
=
await
this
.
dao
.
pageByParams
(
params
);
if
(
list
)
{
for
(
var
item
of
list
)
{
this
.
handleDate
(
item
,
[
'updated_at'
,
'created_at'
],
'YYYY-MM-DD HH:mm:ss'
);
this
.
handleDate
(
item
,
[
'updated_at'
,
'created_at'
],
'YYYY-MM-DD HH:mm:ss'
);
}
await
this
.
setStatus
(
list
);
await
this
.
setProduct
(
list
);
}
return
{
count
:
total
,
rows
:
list
};
}
/**
* 格式化产品
* @param {*} list
*/
async
setProduct
(
list
)
{
let
productIdList
=
[];
for
(
let
item
of
list
)
{
if
(
item
.
product_id
)
{
productIdList
.
push
(
item
.
product_id
);
}
}
let
productMap
=
await
this
.
iproductDao
.
mapByIds
(
productIdList
);
for
(
let
item
of
list
)
{
item
.
oproduct
=
productMap
[
item
.
product_id
]
||
{}
}
}
/**
* 处理状态数据
* @param list
* @returns {Promise<void>}
*/
async
setStatus
(
list
)
{
let
ids
=
[];
let
statuses
=
[];
for
(
let
item
of
list
)
{
ids
.
push
(
item
.
id
);
statuses
.
push
(
item
.
status
);
}
let
map
=
await
this
.
iinvoiceprocessDao
.
mapByInvoiceIdsAndStatus
(
ids
,
statuses
);
for
(
let
item
of
list
)
{
let
key
=
item
.
id
+
"_"
+
item
.
status
;
let
v
=
map
[
key
]
||
{};
item
.
status_name
=
v
.
name
;
item
.
next_status
=
JSON
.
parse
(
v
.
next_status
||
"[]"
);
}
console
.
log
(
list
);
}
}
}
}
module
.
exports
=
IinvoicedelivererService
;
module
.
exports
=
IinvoicedeliverService
;
\ No newline at end of file
\ 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