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
19a43cc8
Commit
19a43cc8
authored
Aug 10, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
228891f9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
103 additions
and
3 deletions
+103
-3
bpo-web/app/base/api/impl/bpoSDPJApi.js
+70
-1
bpo-web/app/base/db/impl/ccashinfoDao.js
+6
-0
bpo-web/app/base/db/models/ccashinfo.js
+23
-2
bpo-web/app/base/service/impl/ccashinfoSve.js
+4
-0
No files found.
bpo-web/app/base/api/impl/bpoSDPJApi.js
View file @
19a43cc8
...
...
@@ -745,6 +745,74 @@ class BpoSDPJApi {
// return cashInfo;
// }
async
testCashAmtTaskMoreIds
(
obj
,
req
)
{
let
lessId
=
Number
(
obj
.
lessId
||
0
);
let
mchtId
=
obj
.
mchtId
||
""
;
let
limit
=
Number
(
obj
.
limit
||
0
);
let
ids
=
await
this
.
ccashinfoSve
.
moreIds
(
lessId
,
mchtId
,
limit
);
if
(
!
ids
||
ids
.
length
==
0
)
{
return
""
;
}
for
(
let
id
of
ids
)
{
try
{
this
.
syncOneCashAmt
(
id
.
id
);
}
catch
(
e
)
{
console
.
log
(
'------------testCashAmtTaskByIds------------error'
,
e
);
}
}
return
"生成中"
;
}
async
testCashAmtTaskByIds
(
obj
,
req
)
{
let
ids
=
obj
.
ids
;
if
(
!
ids
||
ids
.
length
==
0
)
{
return
""
;
}
for
(
let
id
of
ids
)
{
try
{
await
this
.
syncOneCashAmt
(
id
);
}
catch
(
e
)
{
console
.
log
(
'------------testCashAmtTaskByIds------------error'
,
e
);
}
}
return
"生成中"
;
}
async
syncOneCashAmt
(
id
)
{
try
{
console
.
log
(
'------------syncOneCashAmt------------ id = '
,
id
);
let
cashInfo
=
await
this
.
ccashinfoSve
.
findById
(
id
);
let
api
=
await
this
.
ecompanybusiSve
.
findOne
({
appId
:
cashInfo
.
app_id
,
etemplate_id
:
cashInfo
.
ecid
,
mchtId
:
cashInfo
.
mchtId
,
});
await
this
.
syncCashAmt
(
cashInfo
,
api
);
return
cashInfo
;
}
catch
(
e
)
{
console
.
log
(
'------------syncOneCashAmt------------error'
,
e
);
}
}
async
syncCashAmt
(
cashInfo
,
api
)
{
try
{
let
item
=
await
this
.
getActualAmt
(
cashInfo
,
api
);
console
.
log
(
item
);
if
(
!
item
||
!
item
.
amt
)
{
return
;
}
cashInfo
.
deduct_amt
=
item
.
deductAmt
;
cashInfo
.
income_tax
=
item
.
incomeTax
;
cashInfo
.
service_tax
=
item
.
serviceTax
;
cashInfo
.
added_value_tax
=
item
.
addedValueTax
;
await
cashInfo
.
save
();
}
catch
(
e
)
{
console
.
log
(
'------------syncCashAmt------------error'
,
e
);
}
}
async
getActualAmt
(
cashInfo
,
api
)
{
let
params
=
{
"appId"
:
cashInfo
.
app_id
,
...
...
@@ -835,7 +903,7 @@ class BpoSDPJApi {
console
.
log
(
"------------- wx-sdpj转账回调 签名错误 --------------"
);
return
{
code
:
""
};
}
cashInfo
.
trade_notify_time
=
new
Date
();
// 回调逻辑判断
let
respTradeStatus
=
this
.
trim
(
obj
.
tradeStatus
);
if
(
respTradeStatus
==
"00"
)
{
...
...
@@ -851,6 +919,7 @@ class BpoSDPJApi {
this
.
notifyCash
(
cashInfo
.
id
);
}
else
{
}
this
.
syncOneCashAmt
(
cashInfo
.
id
);
return
{
code
:
""
};
}
catch
(
e
)
{
console
.
log
(
e
);
...
...
bpo-web/app/base/db/impl/ccashinfoDao.js
View file @
19a43cc8
...
...
@@ -13,5 +13,11 @@ class CcashinfoDao extends Dao{
return
list
;
}
async
moreIds
(
id
,
mchtId
,
limit
)
{
let
sql
=
"SELECT id FROM `c_cash_info` WHERE id >= :id AND deduct_amt = 0 AND mchtId = :mchtId LIMIT :limit"
;
let
list
=
await
this
.
customQuery
(
sql
,
{
id
:
id
,
mchtId
:
mchtId
,
limit
:
limit
});
return
list
;
}
}
module
.
exports
=
CcashinfoDao
;
bpo-web/app/base/db/models/ccashinfo.js
View file @
19a43cc8
...
...
@@ -27,6 +27,26 @@ module.exports = (db, DataTypes) => {
type
:
DataTypes
.
BIGINT
,
allowNull
:
true
,
},
actual_amt
:{
type
:
DataTypes
.
BIGINT
,
allowNull
:
true
,
},
deduct_amt
:{
type
:
DataTypes
.
BIGINT
,
allowNull
:
true
,
},
income_tax
:{
type
:
DataTypes
.
BIGINT
,
allowNull
:
true
,
},
service_tax
:{
type
:
DataTypes
.
BIGINT
,
allowNull
:
true
,
},
added_value_tax
:{
type
:
DataTypes
.
BIGINT
,
allowNull
:
true
,
},
sign_url
:{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
...
...
@@ -71,8 +91,9 @@ module.exports = (db, DataTypes) => {
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
},
actual_amt
:{
type
:
DataTypes
.
BIGINT
,
trade_notify_time
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
},
notify_rs
:
{
...
...
bpo-web/app/base/service/impl/ccashinfoSve.js
View file @
19a43cc8
...
...
@@ -11,6 +11,10 @@ class CcashinfoService extends ServiceBase {
return
await
this
.
dao
.
findUnNotifyIds
();
}
async
moreIds
(
id
,
mchtId
,
limit
)
{
return
await
this
.
dao
.
moreIds
(
id
,
mchtId
,
limit
);
}
/**
* fn:根据条件获取对象
* @param params
...
...
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