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
05e8e12d
Commit
05e8e12d
authored
Aug 29, 2020
by
王勇飞
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'tx-fi-tax' of gitlab.gongsibao.com:jiangyong/zhichan into tx-fi-tax
parents
43309873
e3bfff00
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
3 deletions
+52
-3
tx-fi-tax/app/base/service/impl/bizchance/deliverybillSve.js
+9
-0
tx-fi-tax/app/base/utils/toFtClient.js
+43
-3
No files found.
tx-fi-tax/app/base/service/impl/bizchance/deliverybillSve.js
View file @
05e8e12d
...
...
@@ -23,6 +23,9 @@ class DeliverybillService extends ServiceBase {
if
(
deliverData
.
delivery_status
!==
system
.
SERVERSESTATUS
.
RECEIVED
)
{
throw
new
Error
(
"该状态下不可处理"
);
}
if
(
!
deliverData
.
delivery_info
.
companyName
)
{
throw
new
Error
(
"查不到对应公司名称"
);
}
let
updateResult
=
{};
let
{
delivery_info
}
=
deliverData
;
if
(
pobj
.
orderStaus
===
true
)
{
...
...
@@ -40,6 +43,11 @@ class DeliverybillService extends ServiceBase {
close_reason
:
pobj
.
note
}
}
// 通过消息队列 发送 融易算
await
toFtClient
.
feedbackToRys
({
...
pobj
,
bizId
:
deliverData
.
delivery_info
.
bizId
});
await
this
.
dao
.
updateByWhere
(
updateResult
,
{
id
:
pobj
.
deliverId
});
...
...
@@ -66,6 +74,7 @@ class DeliverybillService extends ServiceBase {
if
(
deliverData
.
delivery_info
.
setupStatus
&&
deliverData
.
delivery_info
.
setupStatus
===
system
.
SERVERSESTATUS
.
SETUP
)
{
throw
new
Error
(
"已建账"
);
}
// 通知 财税
await
toFtClient
.
addCusAccApplyInfo
(
deliverData
,
pobj
);
await
this
.
dao
.
updateByWhere
({
delivery_info
:
{
...
...
tx-fi-tax/app/base/utils/toFtClient.js
View file @
05e8e12d
...
...
@@ -4,6 +4,8 @@ const system = require("../system");
const
moment
=
require
(
'moment'
);
const
ftConfig
=
settings
.
ftConfig
();
const
_
=
require
(
"lodash"
)
const
uuidv4
=
require
(
'uuid/v4'
);
/**
* 发送 post 请求
...
...
@@ -78,7 +80,7 @@ const getChannelCompany = async (id) => {
return
item
.
id
===
id
})
if
(
!
companyData
)
{
throw
new
Error
(
(
"查不到租户信息"
)
);
throw
new
Error
(
"查不到租户信息"
);
}
}
return
companyData
;
...
...
@@ -107,14 +109,51 @@ const addCusAccApplyInfo = async (deliverData, pobj) => {
customerName
:
deliverData
.
delivery_info
.
companyName
,
phoneNumber
:
deliverData
.
delivery_info
.
contactsPhone
,
valueAddedTax
:
valueAddedTax
[
pobj
.
taxpayerType
],
serviceTime
:
Math
.
round
(
moment
(
deliverData
.
delivery_info
.
serviceEndTime
).
diff
(
moment
(
deliverData
.
delivery_info
.
serviceStartTime
),
'months'
,
true
)).
toString
(),
serviceTime
:
Math
.
ceil
(
moment
(
deliverData
.
delivery_info
.
serviceEndTime
).
diff
(
moment
(
deliverData
.
delivery_info
.
serviceStartTime
),
'months'
,
true
)).
toString
(),
initPeriod
:
parseInt
(
moment
(
deliverData
.
delivery_info
.
serviceStartTime
).
format
(
'YYYYMMDD'
)),
companyId
:
pobj
.
supplier
}
await
postToFtBySign
(
'/cusAccApplyInfo/addCusAccApplyInfo'
,
reqData
);
}
/**
* 向融易算 发消息
* @param {*} data
*/
const
feedbackToRys
=
async
(
data
)
=>
{
let
reqData
=
{
BizId
:
data
.
bizId
};
if
(
data
.
orderStaus
===
true
)
{
reqData
=
{
...
reqData
,
AuditResult
:
1
,
ServiceStartTime
:
moment
(
data
.
setupAt
).
format
(
'YYYY-MM-DD'
)
}
}
if
(
data
.
orderStaus
===
false
)
{
reqData
=
{
...
reqData
,
AuditResult
:
2
,
Note
:
data
.
note
}
}
let
resData
=
await
system
.
queueOper
({
pushUrl
:
this
.
rysUrl
+
"service/feedback"
,
actionType
:
"feedback"
,
messageBody
:
reqData
,
headData
:
{
'Source'
:
'GSB'
},
requestId
:
uuidv4
()
});
if
(
resData
!==
0
)
{
throw
new
Error
(
resData
.
msg
)
}
}
module
.
exports
=
{
postToFtBySign
,
addCusAccApplyInfo
,
getChannelCompany
getChannelCompany
,
feedbackToRys
}
\ 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