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
41be9a5b
Commit
41be9a5b
authored
Aug 27, 2020
by
Sxy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 给财税中心传建账信息
parent
fa903c92
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
7 deletions
+15
-7
tx-fi-tax/app/base/controller/impl/bizchance/deliverybillCtl.js
+1
-1
tx-fi-tax/app/base/service/impl/bizchance/deliverybillSve.js
+2
-0
tx-fi-tax/app/base/utils/toFtClient.js
+12
-6
No files found.
tx-fi-tax/app/base/controller/impl/bizchance/deliverybillCtl.js
View file @
41be9a5b
...
...
@@ -91,7 +91,7 @@ class DeliverybillCtl extends CtlBase {
if
(
!
pobj
.
deliverId
)
{
throw
new
Error
(
"deliverId 不能为空"
);
}
if
(
!
pobj
.
contactsName
||
!
pobj
.
time
||
!
pobj
.
accountingType
||
!
pobj
.
taxpayerType
||
!
pobj
.
supplier
)
{
if
(
!
pobj
.
contactsName
||
!
pobj
.
time
||
!
pobj
.
accountingType
||
!
pobj
.
taxpayerType
||
(
!
pobj
.
supplier
&&
pobj
.
supplier
!=
0
)
)
{
throw
new
Error
(
"参数不能为空"
);
}
const
rs
=
await
this
.
service
.
setupBill
(
pobj
);
...
...
tx-fi-tax/app/base/service/impl/bizchance/deliverybillSve.js
View file @
41be9a5b
...
...
@@ -3,6 +3,7 @@ const ServiceBase = require("../../sve.base");
const
settings
=
require
(
"../../../../config/settings"
);
const
System
=
require
(
"../../../system"
);
const
appconfig
=
system
.
getSysConfig
();
const
toFtClient
=
require
(
"../../../utils/toFtClient"
);
class
DeliverybillService
extends
ServiceBase
{
constructor
()
{
super
(
"bizchance"
,
ServiceBase
.
getDaoName
(
DeliverybillService
));
...
...
@@ -65,6 +66,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
:
{
...
delivery_info
,
...
...
tx-fi-tax/app/base/utils/toFtClient.js
View file @
41be9a5b
...
...
@@ -23,7 +23,7 @@ const postRequest = async (url, data, headers = {}) => {
timeout
:
5000
,
});
result
=
result
.
data
;
console
.
log
(
"${url} : 返回数据 ------- "
);
console
.
log
(
`
${
url
}
: 返回数据 ------- `
);
console
.
log
(
JSON
.
stringify
(
result
));
if
(
result
.
code
==
1
)
{
return
result
.
data
...
...
@@ -54,7 +54,7 @@ const postToFt = (url, data, headers = {}) => {
* @param {*} headers
*/
const
postToFtBySign
=
async
(
url
,
data
,
headers
=
{})
=>
{
let
tenantInfo
=
await
getChannelCompany
();
let
tenantInfo
=
await
getChannelCompany
(
data
.
companyId
);
data
.
companyId
=
tenantInfo
.
id
;
let
sign
=
system
.
signValid
(
data
,
tenantInfo
.
signSecret
);
return
postRequest
(
`
${
ftConfig
.
url
}${
url
}
`
,
{
...
data
,
sign
},
headers
=
{})
...
...
@@ -74,7 +74,12 @@ const getChannelCompany = async (id) => {
});
companyData
=
companyData
.
datas
;
if
(
id
)
{
// TODO: 获取单个信息
companyData
=
_
.
find
(
companyData
,
(
item
)
=>
{
return
item
.
id
===
id
})
if
(
!
companyData
)
{
throw
new
Error
((
"查不到租户信息"
));
}
}
return
companyData
;
}
...
...
@@ -104,9 +109,9 @@ const addCusAccApplyInfo = async (deliverData, pobj) => {
valueAddedTax
:
valueAddedTax
[
pobj
.
taxpayerType
],
serviceTime
:
moment
(
deliverData
.
delivery_info
.
serviceEndTime
).
diff
(
moment
(
deliverData
.
delivery_info
.
serviceStartTime
),
'months'
).
toString
(),
initPeriod
:
parseInt
(
moment
(
deliverData
.
delivery_info
.
serviceStartTime
).
format
(
'YYYYMMDD'
)),
companyId
:
pobj
.
supplier
}
const
data
=
await
postToFtBySign
(
'/cusAccApplyInfo/addCusAccApplyInfo'
,
reqData
);
console
.
log
(
data
);
await
postToFtBySign
(
'/cusAccApplyInfo/addCusAccApplyInfo'
,
reqData
);
}
// console.log(moment("2021-05-31").diff(moment("2020-06-01"), 'months', true).toString())
...
...
@@ -114,4 +119,4 @@ module.exports = {
postToFtBySign
,
addCusAccApplyInfo
,
getChannelCompany
}
}
\ 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