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
a60cc651
Commit
a60cc651
authored
Apr 03, 2020
by
王昆
Browse files
Options
Browse Files
Download
Plain Diff
gsb
parents
47567dbe
22333022
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
20 deletions
+63
-20
xgg-admin/app/base/controller/impl/invoice/invoiceCtl.js
+1
-1
xgg-admin/app/base/controller/impl/order/orderCtl.js
+16
-0
xgg-admin/app/base/service/impl/invoice/invoiceSve.js
+19
-13
xgg-admin/app/base/service/impl/order/orderSve.js
+21
-0
xgg-admin/app/base/system.js
+2
-2
xgg-admin/app/config/settings.js
+4
-4
No files found.
xgg-admin/app/base/controller/impl/invoice/invoiceCtl.js
View file @
a60cc651
...
@@ -111,7 +111,7 @@ class InvoiceCtl extends CtlBase {
...
@@ -111,7 +111,7 @@ class InvoiceCtl extends CtlBase {
* @param {*} pobj2
* @param {*} pobj2
* @param {*} req
* @param {*} req
*/
*/
async
uploadDetail
Sve
(
pobj
,
pobj2
,
req
){
async
uploadDetail
(
pobj
,
pobj2
,
req
){
if
(
!
pobj
.
invoice_id
){
if
(
!
pobj
.
invoice_id
){
return
system
.
getResult
(
null
,
`参数错误 发票ID 不能为空`
);
return
system
.
getResult
(
null
,
`参数错误 发票ID 不能为空`
);
}
}
...
...
xgg-admin/app/base/controller/impl/order/orderCtl.js
View file @
a60cc651
...
@@ -379,6 +379,22 @@ class OrderCtl extends CtlBase {
...
@@ -379,6 +379,22 @@ class OrderCtl extends CtlBase {
}
}
}
}
/**
* 获取账簿用户信息
* @param {*} pobj
* @param {*} pobj2
* @param {*} req
* @id
*/
async
getCustomerById
(
pobj
,
pobj2
,
req
){
if
(
!
pobj
.
id
){
return
system
.
getResult
(
null
,
`参数错误 ID 不能为空`
);
}
let
res
=
await
this
.
orderSve
.
getCustomerById
(
pobj
.
invoice_id
);
return
res
;
}
}
}
...
...
xgg-admin/app/base/service/impl/invoice/invoiceSve.js
View file @
a60cc651
...
@@ -135,15 +135,15 @@ class InvoiceService extends ServiceBase {
...
@@ -135,15 +135,15 @@ class InvoiceService extends ServiceBase {
if
(
!
invoicesummaryinfo
.
summary
){
if
(
!
invoicesummaryinfo
.
summary
){
return
system
.
getResult
(
"系统错误 发票摘要信息错误"
);
return
system
.
getResult
(
"系统错误 发票摘要信息错误"
);
}
}
let
_summary
=
JSON
.
parse
(
invoicesummaryinfo
.
summary
);
let
_res
=
[];
let
_res
=
[];
for
(
let
item
of
_summary
){
for
(
let
item
of
invoicesummaryinfo
.
summary
){
// item = JSON.parse(item);
let
temp
=
{
let
temp
=
{
abstractMsg
:
item
.
summaryInfo
,
abstractMsg
:
item
.
summaryInfo
,
attr
:{
"standard"
:
item
.
category
,
"unit"
:
item
.
unit
,
"number"
:
item
.
number
,
"unit_price"
:
item
.
unitPrice
},
attr
:{
"standard"
:
item
.
category
,
"unit"
:
item
.
unit
,
"number"
:
item
.
number
,
"unit_price"
:
item
.
unitPrice
},
amount
:
item
.
amount
,
amount
:
item
.
amount
,
tax
:
item
.
taxAmount
,
tax
:
item
.
taxAmount
,
totalPrice
:
Number
(
item
.
amount
)
+
Number
(
item
.
tax
),
totalPrice
:
Number
(
item
.
amount
)
+
Number
(
item
.
tax
Amount
),
taxRate
:
item
.
taxRate
,
taxRate
:
item
.
taxRate
,
abstractType
:
item
.
summaryType
abstractType
:
item
.
summaryType
};
};
...
@@ -166,10 +166,10 @@ class InvoiceService extends ServiceBase {
...
@@ -166,10 +166,10 @@ class InvoiceService extends ServiceBase {
}
}
let
businessmen
=
await
this
.
callms
(
"order"
,
"queryObusinessmenByCreditCode"
,
{
credit_code
:
invoice
.
data
.
invoicesummaryinfo
.
businessmen_credit_code
});
let
businessmen
=
await
this
.
callms
(
"order"
,
"queryObusinessmenByCreditCode"
,
{
credit_code
:
invoice
.
data
.
invoicesummaryinfo
.
businessmen_credit_code
});
//获取交付商信息 拿到companyID 在common服务下 参数:通过deliver_id
//获取交付商信息 拿到companyID 在common服务下 参数:通过deliver_id
if
(
!
invoice
.
data
.
invoicedeliver
[
0
].
deliver_id
){
if
(
!
invoice
.
data
.
deliver_id
){
return
system
.
getResult
(
`交付商不存在`
);
return
system
.
getResult
(
`交付商不存在`
);
}
}
var
deliver
=
await
this
.
callms
(
"common"
,
"deliverInfo"
,
{
id
:
invoice
.
data
.
invoicedeliver
[
0
].
deliver_id
});
var
deliver
=
await
this
.
callms
(
"common"
,
"deliverInfo"
,
{
id
:
invoice
.
data
.
deliver_id
});
if
(
!
deliver
.
data
){
if
(
!
deliver
.
data
){
return
system
.
getResult
(
null
,
`交付商不存在`
);
return
system
.
getResult
(
null
,
`交付商不存在`
);
}
}
...
@@ -183,13 +183,13 @@ class InvoiceService extends ServiceBase {
...
@@ -183,13 +183,13 @@ class InvoiceService extends ServiceBase {
return
system
.
getResult
(
"推送失败,参数错误"
);
return
system
.
getResult
(
"推送失败,参数错误"
);
}
}
let
url
=
settings
.
ntapi
().
uploadDetail
;
let
url
=
settings
.
ntapi
().
uploadDetail
;
let
res
=
await
this
.
callApi
(
url
,
data
,
"提交发票"
);
let
res
=
await
this
.
callApi
(
url
,
_params
,
"提交发票"
);
console
.
log
(
res
);
console
.
log
(
res
);
if
(
!
res
||
!
res
.
data
)
{
if
(
!
res
||
res
.
code
!=
'000000'
)
{
return
system
.
getResult
(
null
,
"提交发票失败"
);
return
system
.
getResult
(
null
,
"提交发票失败"
);
}
}
//更新发票建账
//更新发票建账
await
this
.
callms
(
"invoice"
,
"up
dateAccountCreation
"
,
{
id
:
invoice_id
});
await
this
.
callms
(
"invoice"
,
"up
loadDetail
"
,
{
id
:
invoice_id
});
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
error
);
console
.
log
(
error
);
...
@@ -201,6 +201,7 @@ class InvoiceService extends ServiceBase {
...
@@ -201,6 +201,7 @@ class InvoiceService extends ServiceBase {
* 推送票据
* 推送票据
*/
*/
async
buildParams
(
businessmen
,
invoice
,
deliver
){
async
buildParams
(
businessmen
,
invoice
,
deliver
){
try
{
let
_invoicesummaryinfo
=
invoice
.
invoicesummaryinfo
||
null
;
let
_invoicesummaryinfo
=
invoice
.
invoicesummaryinfo
||
null
;
if
(
!
_invoicesummaryinfo
){
if
(
!
_invoicesummaryinfo
){
return
system
.
getResult
(
null
,
`系统错误 发票信息错误`
);
return
system
.
getResult
(
null
,
`系统错误 发票信息错误`
);
...
@@ -209,14 +210,14 @@ class InvoiceService extends ServiceBase {
...
@@ -209,14 +210,14 @@ class InvoiceService extends ServiceBase {
companyId
:
deliver
.
nt_company_id
,
//公司ID
companyId
:
deliver
.
nt_company_id
,
//公司ID
customerId
:
businessmen
.
customer_id
,
//客户ID
customerId
:
businessmen
.
customer_id
,
//客户ID
uploadPeriod
:
moment
(
businessmen
.
create_account_time
).
format
(
'YYYYMM'
),
//上传账期
uploadPeriod
:
moment
(
businessmen
.
create_account_time
).
format
(
'YYYYMM'
),
//上传账期
imageName
:
invoice
[
'invoice_img'
].
slice
(
str
.
lastIndexOf
(
"/"
)
+
1
,
-
1
)
||
""
,
//图片名称
imageName
:
invoice
[
'invoice_img'
].
slice
(
invoice
[
'invoice_img'
]
.
lastIndexOf
(
"/"
)
+
1
,
-
1
)
||
""
,
//图片名称
imageBasename
:
invoice
[
'invoice_img'
]
||
""
,
//图片url
imageBasename
:
invoice
[
'invoice_img'
]
||
""
,
//图片url
billType
:
formatInvoiceType
(
_invoicesummaryinfo
),
//发票类型
billType
:
this
.
formatInvoiceType
(
_invoicesummaryinfo
),
//发票类型
isDaikai
:
`1`
,
//是否代开 1:yes 0:no
isDaikai
:
`1`
,
//是否代开 1:yes 0:no
signDate
:
moment
(
_invoicesummaryinfo
.
invoice_time
).
format
(
"YYYY-MM-DD"
),
//开票时间
signDate
:
moment
(
_invoicesummaryinfo
.
invoice_time
).
format
(
"YYYY-MM-DD"
),
//开票时间
invoiceCode
:
_invoicesummaryinfo
.
invoice_no
,
//发票代码
invoiceCode
:
_invoicesummaryinfo
.
invoice_no
,
//发票代码
invoiceNumber
:
_invoicesummaryinfo
.
invoice_number
,
//发票号码
invoiceNumber
:
_invoicesummaryinfo
.
invoice_number
,
//发票号码
invoiceOrder
:
formatInvoiceJoin
(
_invoicesummaryinfo
),
//发票联次
invoiceOrder
:
this
.
formatInvoiceJoin
(
_invoicesummaryinfo
),
//发票联次
payName
:
_invoicesummaryinfo
.
merchant_name
,
payName
:
_invoicesummaryinfo
.
merchant_name
,
receiveName
:
_invoicesummaryinfo
.
businessmen_name
,
receiveName
:
_invoicesummaryinfo
.
businessmen_name
,
payBank
:
_invoicesummaryinfo
.
merchant_bank
,
payBank
:
_invoicesummaryinfo
.
merchant_bank
,
...
@@ -233,10 +234,15 @@ class InvoiceService extends ServiceBase {
...
@@ -233,10 +234,15 @@ class InvoiceService extends ServiceBase {
province
:
PROVINCE_CODE_MAP
[
_invoicesummaryinfo
.
province
],
province
:
PROVINCE_CODE_MAP
[
_invoicesummaryinfo
.
province
],
receiveAccountName
:
""
,
//xxxx
receiveAccountName
:
""
,
//xxxx
sourceClient
:
"0"
,
//票据来源
sourceClient
:
"0"
,
//票据来源
createDate
:
moment
(
_invoicesummaryinfo
.
created_at
).
format
(
"YYYY-MM-DD"
),
//创建时间
createDate
:
moment
(
_invoicesummaryinfo
.
created_at
).
format
(
"YYYY-MM-DD HH:ss:mm"
),
//创建时间
list
:
formatSummary
(
_invoicesummaryinfo
)
// createDate:new Date(_invoicesummaryinfo.created_at), //创建时间
list
:
this
.
formatSummary
(
_invoicesummaryinfo
)
}
}
return
params
;
return
params
;
}
catch
(
error
)
{
console
.
log
(
error
);
return
{};
}
}
}
...
...
xgg-admin/app/base/service/impl/order/orderSve.js
View file @
a60cc651
...
@@ -251,5 +251,25 @@ class OrderService extends ServiceBase {
...
@@ -251,5 +251,25 @@ class OrderService extends ServiceBase {
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
}
}
/**
* 获取用户账簿信息
* @param {*} params
* id 个体工商户ID
*/
async
getCustomerById
(
params
){
try
{
let
businessmen
=
await
this
.
callms
(
"order"
,
"queryObusinessmen"
,
{
id
:
params
.
id
});
if
(
!
businessmen
||
!
businessmen
.
data
){
return
system
.
getResult
(
null
,
`个体工商户不存在`
);
}
let
url
=
settings
.
ntapi
().
getCustomerById
;
let
res
=
await
this
.
callApi
(
url
,
{
id
:
businessmen
.
customer_id
},
"获取用户账簿信息"
);
return
res
;
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
}
}
module
.
exports
=
OrderService
;
module
.
exports
=
OrderService
;
\ No newline at end of file
xgg-admin/app/base/system.js
View file @
a60cc651
...
@@ -186,8 +186,8 @@ class System {
...
@@ -186,8 +186,8 @@ class System {
// order: "http://127.0.0.1:3103" + path,
// order: "http://127.0.0.1:3103" + path,
// 发票服务
// 发票服务
//
invoice: domain2 + ":3105" + path,
invoice
:
domain2
+
":3105"
+
path
,
invoice
:
"http://127.0.0.1:3105"
+
path
,
//
invoice: "http://127.0.0.1:3105" + path,
// 用户中心
// 用户中心
uc
:
domain
+
":3106"
+
path
,
uc
:
domain
+
":3106"
+
path
,
...
...
xgg-admin/app/config/settings.js
View file @
a60cc651
...
@@ -105,15 +105,15 @@ var settings = {
...
@@ -105,15 +105,15 @@ var settings = {
updateCompanyStatus
:
domain
+
"/nga-api/company/updateCompanyStatus"
,
updateCompanyStatus
:
domain
+
"/nga-api/company/updateCompanyStatus"
,
// 建账
// 建账
createCustomer
:
domain
+
"/nga-api/createCustomer"
,
createCustomer
:
domain
+
"/nga-api/createCustomer"
,
// 查询账户信息
getCustomerById
:
domain
+
"/nga-api/getCustomerById"
,
// 上传发票
// 上传发票
uploadDetail
:
domain
+
"/nga-api/uploadDetail"
,
uploadDetail
:
domain
+
"/nga-api/uploadDetail"
,
// 获取用户账簿
getCustomerById
:
domain
+
"/nga-api/getCustomerById"
,
// 月报表
// 月报表
getReportData
:
domain
+
"/nga-api/report/getReportData"
,
getReportData
:
domain
+
"/nga-api/report/getReportData"
,
// 季报表
// 季报表
getReportDataQuarter
:
domain
+
"/nga-api/report/getReportDataQuarter"
,
getReportDataQuarter
:
domain
+
"/nga-api/report/getReportDataQuarter"
}
}
;
},
},
redis
:
function
()
{
redis
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
if
(
this
.
env
==
"dev"
)
{
...
...
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