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
fb73aa6e
Commit
fb73aa6e
authored
Sep 16, 2020
by
王勇飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gyq
parent
74a8c79f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
29 deletions
+45
-29
tx-fi-tax/app/base/controller/impl/bizchance/deliverybillCtl.js
+3
-0
tx-fi-tax/app/base/service/impl/bizchance/deliverybillSve.js
+39
-28
tx-fi-tax/app/base/utils/toFtClient.js
+3
-1
No files found.
tx-fi-tax/app/base/controller/impl/bizchance/deliverybillCtl.js
View file @
fb73aa6e
...
...
@@ -93,6 +93,7 @@ class DeliverybillCtl extends CtlBase {
* @param {*} req
*/
async
setupBill
(
pobj
,
qobj
,
req
)
{
console
.
log
(
"deliveryCtl:setupBill:pobj--------------------------------"
+
JSON
.
stringify
(
pobj
));
try
{
if
(
!
pobj
.
deliverId
)
{
throw
new
Error
(
"deliverId 不能为空"
);
...
...
@@ -101,8 +102,10 @@ class DeliverybillCtl extends CtlBase {
throw
new
Error
(
"参数不能为空"
);
}
const
rs
=
await
this
.
service
.
setupBill
(
pobj
);
console
.
log
(
"deliveryCtl:setupBill:rs--------------------------------"
+
JSON
.
stringify
(
rs
));
return
system
.
getResult
(
rs
);
}
catch
(
err
)
{
console
.
log
(
"deliveryCtl:setupBill:err--------------------------------"
+
err
);
return
system
.
getResult
(
null
,
err
.
message
)
}
}
...
...
tx-fi-tax/app/base/service/impl/bizchance/deliverybillSve.js
View file @
fb73aa6e
...
...
@@ -29,6 +29,7 @@ class DeliverybillService extends ServiceBase {
if
(
!
deliverData
.
delivery_info
.
companyName
)
{
throw
new
Error
(
"查不到对应公司名称"
);
}
let
updateResult
=
{};
let
{
delivery_info
}
=
deliverData
;
if
(
pobj
.
orderStaus
===
true
)
{
...
...
@@ -75,36 +76,46 @@ class DeliverybillService extends ServiceBase {
}
async
setupBill
(
pobj
)
{
let
deliverData
=
await
this
.
dao
.
findOne
({
id
:
pobj
.
deliverId
});
if
(
!
deliverData
)
{
throw
new
Error
(
"查不到此交付单"
);
}
if
(
deliverData
.
delivery_status
!==
system
.
SERVERSESTATUS
.
INSERVICE
)
{
throw
new
Error
(
"该状态下不可建账"
);
try
{
console
.
log
(
"deliverySve:setupBill:pobj----------------------------------------"
,
JSON
.
stringify
(
pobj
));
let
deliverData
=
await
this
.
dao
.
findOne
({
id
:
pobj
.
deliverId
});
if
(
!
deliverData
)
{
throw
new
Error
(
"查不到此交付单"
);
}
if
(
deliverData
.
delivery_status
!==
system
.
SERVERSESTATUS
.
INSERVICE
)
{
throw
new
Error
(
"该状态下不可建账"
);
}
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
,
setupStatus
:
system
.
SERVERSESTATUS
.
SETUP
,
setupInfo
:
{
contactsName
:
pobj
.
contactsName
,
time
:
pobj
.
time
,
accountingType
:
pobj
.
accountingType
,
taxpayerType
:
pobj
.
taxpayerType
,
supplier
:
pobj
.
supplier
}
}
},
{
id
:
pobj
.
deliverId
});
console
.
log
(
"deliverySve:setupBill:SUCCESS----------------------------------------SUCCESS"
);
return
"SUCCESS"
}
if
(
deliverData
.
delivery_info
.
setupStatus
&&
deliverData
.
delivery_info
.
setupStatus
===
system
.
SERVERSESTATUS
.
SETUP
)
{
throw
new
Error
(
"已建账"
);
catch
(
error
)
{
console
.
log
(
"deliverySve:setupBill:error----------------------------------------"
+
error
);
return
error
;
}
// 通知 财税
await
toFtClient
.
addCusAccApplyInfo
(
deliverData
,
pobj
);
await
this
.
dao
.
updateByWhere
({
delivery_info
:
{
...
delivery_info
,
setupStatus
:
system
.
SERVERSESTATUS
.
SETUP
,
setupInfo
:
{
contactsName
:
pobj
.
contactsName
,
time
:
pobj
.
time
,
accountingType
:
pobj
.
accountingType
,
taxpayerType
:
pobj
.
taxpayerType
,
supplier
:
pobj
.
supplier
}
}
},
{
id
:
pobj
.
deliverId
});
return
"SUCCESS"
}
async
deliverInfo
(
pobj
)
{
...
...
tx-fi-tax/app/base/utils/toFtClient.js
View file @
fb73aa6e
...
...
@@ -59,7 +59,9 @@ const postToFtBySign = async (url, data, headers = {}) => {
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
=
{})
var
res
=
postRequest
(
`
${
ftConfig
.
url
}${
url
}
`
,
{
...
data
,
sign
},
headers
=
{});
console
.
log
(
"postToFtBySign:res--------------------------------------"
+
JSON
.
stringify
(
res
));
return
res
;
}
/**
...
...
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