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
f3a7957f
Commit
f3a7957f
authored
Aug 29, 2020
by
Sxy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 服务处理反馈 队列
parent
a404733a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
3 deletions
+48
-3
tx-fi-tax/app/base/service/impl/bizchance/deliverybillSve.js
+5
-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 @
f3a7957f
...
...
@@ -40,6 +40,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
});
...
...
tx-fi-tax/app/base/utils/toFtClient.js
View file @
f3a7957f
...
...
@@ -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