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
e5d7ade4
Commit
e5d7ade4
authored
Sep 02, 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
5c4148ec
94f384b8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
105 additions
and
25 deletions
+105
-25
tx-fi-tax/app/base/service/impl/bizchance/deliverybillSve.js
+43
-0
tx-fi-tax/app/base/utils/toFtClient.js
+46
-2
tx-fi-tax/app/config/routes/api.js
+16
-23
No files found.
tx-fi-tax/app/base/service/impl/bizchance/deliverybillSve.js
View file @
e5d7ade4
...
@@ -359,5 +359,47 @@ class DeliverybillService extends ServiceBase {
...
@@ -359,5 +359,47 @@ class DeliverybillService extends ServiceBase {
}
}
return
result
;
return
result
;
}
}
/**
* 通过 财税给的数据 组装 融易算 所需 数据格式 发送
*/
async
fromFtToRys
(
pobj
)
{
let
{
option
,
data
}
=
pobj
;
let
deliverData
=
await
this
.
dao
.
findOne
({
$or
:
[
{
v_creditCode
:
data
.
creditCode
},
{
v_ftClientId
:
data
.
customerId
}
]
});
if
(
!
deliverData
)
{
throw
new
Error
(
"查不到 对应服务单"
)
}
const
bizId
=
deliverData
.
delivery_info
.
bizId
;
switch
(
option
)
{
case
"1"
:
// 创建 套餐
await
this
.
dao
.
updateByWhere
({
delivery_info
:
{
...
deliverData
.
delivery_info
,
ftClientId
:
data
.
customerId
,
}
},
{
id
:
deliverData
.
id
});
await
toFtClient
.
accountingFinishToRys
(
bizId
,
data
);
break
case
"2"
:
// 结账
break
case
"3"
:
// 报税
await
toFtClient
.
taxSubmitToRys
(
bizId
,
data
);
break
default
:
throw
new
Error
(
"option 错误"
)
}
}
}
}
module
.
exports
=
DeliverybillService
;
module
.
exports
=
DeliverybillService
;
\ No newline at end of file
tx-fi-tax/app/base/utils/toFtClient.js
View file @
e5d7ade4
...
@@ -117,7 +117,7 @@ const addCusAccApplyInfo = async (deliverData, pobj) => {
...
@@ -117,7 +117,7 @@ const addCusAccApplyInfo = async (deliverData, pobj) => {
}
}
/**
/**
* 向融易算 发消息
*
交付单 处理
向融易算 发消息
* @param {*} data
* @param {*} data
*/
*/
const
feedbackToRys
=
async
(
data
)
=>
{
const
feedbackToRys
=
async
(
data
)
=>
{
...
@@ -151,9 +151,52 @@ const feedbackToRys = async (data) => {
...
@@ -151,9 +151,52 @@ const feedbackToRys = async (data) => {
throw
new
Error
(
resData
.
msg
)
throw
new
Error
(
resData
.
msg
)
}
}
}
}
/**
* 确认做账服务完成
* @param {*} bizId
* @param {*} data
*/
const
accountingFinishToRys
=
async
(
bizId
,
data
)
=>
{
}
/**
* 报税情况录入
* @param {*} bizId
* @param {*} data
*/
const
taxSubmitToRys
=
async
(
bizId
,
data
)
=>
{
}
/**
* 三大报表导入接口
* @param {*} bizId
* @param {*} data
*/
const
financialStatementsToRys
=
async
(
bizId
,
data
)
=>
{
}
/**
* 余额表导入接口
* @param {*} bizId
* @param {*} data
*/
const
subjectBalanceToRys
=
async
(
bizId
,
data
)
=>
{
}
module
.
exports
=
{
module
.
exports
=
{
postToFtBySign
,
postToFtBySign
,
addCusAccApplyInfo
,
addCusAccApplyInfo
,
getChannelCompany
,
getChannelCompany
,
feedbackToRys
feedbackToRys
,
accountingFinishToRys
,
taxSubmitToRys
,
financialStatementsToRys
,
subjectBalanceToRys
}
}
\ No newline at end of file
tx-fi-tax/app/config/routes/api.js
View file @
e5d7ade4
var
url
=
require
(
"url"
);
var
url
=
require
(
"url"
);
var
System
=
require
(
"../../base/system"
);
var
System
=
require
(
"../../base/system"
);
const
deliverService
=
System
.
getObject
(
"service.bizchance.deliverybillSve"
);
module
.
exports
=
function
(
app
)
{
module
.
exports
=
function
(
app
)
{
app
.
get
(
'/api/:gname/:qname/:method'
,
function
(
req
,
res
)
{
app
.
get
(
'/api/:gname/:qname/:method'
,
function
(
req
,
res
)
{
// var classPath = req.params["qname"];
// var classPath = req.params["qname"];
...
@@ -56,28 +57,20 @@ module.exports = function (app) {
...
@@ -56,28 +57,20 @@ module.exports = function (app) {
app
.
post
(
"/acceptFtCallback"
,
async
(
req
,
res
,
next
)
=>
{
app
.
post
(
"/acceptFtCallback"
,
async
(
req
,
res
,
next
)
=>
{
console
.
log
(
"-------------- 财税 acceptFtCallback ------------"
);
console
.
log
(
"-------------- 财税 acceptFtCallback ------------"
);
/**
try
{
* {
console
.
log
(
JSON
.
stringify
(
req
.
body
));
"info": {
await
deliverService
.
fromFtToRys
(
JSON
.
parse
(
req
.
body
.
info
));
"data": {
res
.
json
({
"accountStandard": "1",
status
:
0
,
"accountant": "测试",
msg
:
"SUCCESS"
,
"initPeriod": 202003,
data
:
"SUCCESS"
,
"serviceExpirationDate": "3",
});
"customerName": "测试建账接口",
}
catch
(
err
)
{
"companyId": 11111,
res
.
json
({
"province": 4100,
status
:
-
1
,
"bankStatus": 0
msg
:
err
.
message
,
},
data
:
null
,
"option": "1"
});
}
}
}
*/
console
.
log
(
JSON
.
stringify
(
req
.
body
));
res
.
json
({
status
:
0
,
msg
:
"SUCCESS"
,
data
:
"SUCCESS"
,
});
});
});
};
};
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