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
2e0cfa3b
Commit
2e0cfa3b
authored
Mar 14, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
f8fe653c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
211 additions
and
50 deletions
+211
-50
bpo-admin/app/base/api/impl/channelApi.js
+106
-2
bpo-admin/app/base/service/impl/channelSve.js
+4
-1
bpo-admin/app/base/service/impl/esettleSve.js
+19
-0
bpo-admin/app/base/service/impl/esettleofflineSve.js
+62
-46
bpo-admin/app/base/utils/aliyunClient.js
+4
-1
bpo-admin/app/config/settings.js
+16
-0
No files found.
bpo-admin/app/base/api/impl/channelApi.js
View file @
2e0cfa3b
var
system
=
require
(
"../../system"
)
var
system
=
require
(
"../../system"
);
var
settings
=
require
(
"../../../config/settings"
)
const
md5
=
require
(
"MD5"
);
const
md5
=
require
(
"MD5"
);
const
logCtl
=
system
.
getObject
(
"web.oplogCtl"
);
const
logCtl
=
system
.
getObject
(
"web.oplogCtl"
);
const
moment
=
require
(
"moment"
);
const
moment
=
require
(
"moment"
);
...
@@ -107,7 +109,6 @@ class ChannelApi {
...
@@ -107,7 +109,6 @@ class ChannelApi {
var
data
=
await
this
.
separateGet
(
queryobj
);
var
data
=
await
this
.
separateGet
(
queryobj
);
}
}
async
separateGet
(
queryobj
)
{
async
separateGet
(
queryobj
)
{
let
encry
=
system
.
decryption
(
queryobj
.
param
);
let
encry
=
system
.
decryption
(
queryobj
.
param
);
encry
=
JSON
.
parse
(
encry
);
encry
=
JSON
.
parse
(
encry
);
...
@@ -173,6 +174,109 @@ class ChannelApi {
...
@@ -173,6 +174,109 @@ class ChannelApi {
}
}
// -------------------------------------
async
pushChannels
(
queryobj
,
qobj
,
req
)
{
let
begin
;
let
end
;
if
(
queryobj
.
day
)
{
begin
=
queryobj
.
day
+
' 00:00:00'
;
/* 自定义时间 */
end
=
queryobj
.
day
+
' 23:59:59'
;
/* 自定义时间 */
}
else
{
begin
=
moment
().
subtract
(
1
,
'days'
).
format
(
'YYYY-MM-DD 00:00:00'
);
/*前一天的时间*/
end
=
moment
().
subtract
(
1
,
'days'
).
format
(
'YYYY-MM-DD 23:59:59'
);
/*前一天的时间*/
}
var
merchantIds
=
await
this
.
channelSve
.
getPushMerchantIds
()
||
[];
if
(
merchantIds
.
length
==
0
)
{
return
system
.
getErrResult2
(
"暂无绑定渠道"
);
}
for
(
let
merchantId
of
merchantIds
)
{
console
.
log
(
merchantId
,
"----------------------------"
);
// 查渠道商户id
let
merchant
=
(
await
this
.
channelSve
.
merchantInfo
({
id
:
merchantId
})
||
{}).
data
;
if
(
merchant
.
origin_id
==
10000
)
{
await
this
.
pushOnlineOrder
(
merchant
,
begin
,
end
);
}
else
{
await
this
.
pushOfflineOrder
(
merchant
,
begin
,
end
);
// let order = await this.esettleofflineSve.findById(merchant.data_id);
}
}
}
async
pushOnlineOrder
(
merchant
,
begin
,
end
)
{
let
orders
=
await
this
.
esettleSve
.
findPushInfos
(
merchant
.
origin_merchant_id
,
begin
,
end
)
||
[];
if
(
orders
.
length
==
0
)
{
return
;
}
for
(
let
order
of
orders
)
{
// 获取推送数据
let
pushData
=
this
.
getPushData
(
merchant
,
order
);
// 创建log
let
log
=
await
this
.
pushfqlogSve
.
create
(
pushData
.
log
);
// 推送数据
var
rc
=
system
.
getObject
(
"util.aliyunClient"
);
let
rtn
=
await
rc
.
post
(
this
.
FQURL
,
pushData
.
data
);
// 返回结果都保存到toPush中吧
log
.
topush
=
JSON
.
stringify
(
rtn
);
await
log
.
save
();
}
}
async
pushOfflineOrder
(
merchant
,
begin
,
end
)
{
let
orders
=
await
this
.
esettleofflineSve
.
findPushInfos
(
merchant
.
origin_merchant_id
,
begin
,
end
)
||
[];
if
(
orders
.
length
==
0
)
{
return
;
}
for
(
let
order
of
orders
)
{
// 获取推送数据
let
pushData
=
this
.
getPushData
(
merchant
,
order
);
// 创建log
let
log
=
await
this
.
pushfqlogSve
.
create
(
pushData
.
log
);
// 推送数据
var
rc
=
system
.
getObject
(
"util.aliyunClient"
);
let
rtn
=
await
rc
.
post
(
this
.
FQURL
,
pushData
.
data
);
// 返回结果都保存到toPush中吧
log
.
topush
=
JSON
.
stringify
({
rtn
});
await
log
.
save
();
}
}
getPushData
(
merchant
,
order
)
{
let
data
=
{
"idempotentId"
:
this
.
trim
(
order
.
id
),
// 业务编号(订单id)
"idempotentSource"
:
"bpo_xbg"
,
// 来源编号,写死:bpo_xbg
"idempotentSourceName"
:
"BPO"
,
// 来源编号,写死:BPO薪必果
"thirdPartyChannelId"
:
this
.
trim
(
merchant
.
channel_id
),
// 渠道id
"thirdPartyCustomerId"
:
this
.
trim
(
merchant
.
id
).
toString
(),
// 第三方客户id
// "productId": "5e6b02cc3290c3000a3a63dc",// 云服产品id (测试环境)
"productId"
:
settings
.
FQYF
().
productId
,
// 云服产品id (生产环境)
// "allotRatio":"50",// 分润比例(百分比的数字部分(如:50代表50%))
"orderPrice"
:
order
.
deduct_amt
,
// 订单金额
"productQuantity"
:
"1"
,
// 产品数量
"companyName"
:
merchant
.
merchant_name
,
// 公司名称
"phone"
:
merchant
.
contact_mobile
};
var
log
=
{
"data_id"
:
this
.
trim
(
order
.
id
),
// 发薪批次id tbl_order.id 或者 c_esettle_offline.id
"channel_id"
:
merchant
.
channel_id
,
//渠道id
"channel_merchant_id"
:
merchant
.
id
,
//渠道商户id
"origin_merchant_id"
:
merchant
.
origin_merchant_id
,
//来源商户id
};
data
.
param
=
encodeURIComponent
(
system
.
encryption
(
JSON
.
stringify
(
log
)));
return
{
data
:
data
,
param
:
log
,
}
}
async
orderInfo
(
queryobj
,
qobj
,
req
)
{
async
orderInfo
(
queryobj
,
qobj
,
req
)
{
let
param
=
system
.
decryption
(
queryobj
.
data
);
let
param
=
system
.
decryption
(
queryobj
.
data
);
// {"data_id":17,"channel_id":10002,"channel_merchant_id":"0","origin_merchant_id":"10048","pushplatform_channel_id":10000}
// {"data_id":17,"channel_id":10002,"channel_merchant_id":"0","origin_merchant_id":"10048","pushplatform_channel_id":10000}
...
...
bpo-admin/app/base/service/impl/channelSve.js
View file @
2e0cfa3b
...
@@ -46,7 +46,6 @@ class ChannelService extends microService {
...
@@ -46,7 +46,6 @@ class ChannelService extends microService {
return
await
this
.
callms
(
"channel"
,
"pushbindingchannel"
,
params
);
return
await
this
.
callms
(
"channel"
,
"pushbindingchannel"
,
params
);
}
}
// 商户api
// 商户api
async
merchantInfo
(
params
)
{
async
merchantInfo
(
params
)
{
return
await
this
.
callms
(
"channel"
,
"merchantInfo"
,
params
);
return
await
this
.
callms
(
"channel"
,
"merchantInfo"
,
params
);
...
@@ -57,5 +56,9 @@ class ChannelService extends microService {
...
@@ -57,5 +56,9 @@ class ChannelService extends microService {
async
merchantPage
(
params
)
{
async
merchantPage
(
params
)
{
return
await
this
.
callms
(
"channel"
,
"merchantPage"
,
params
);
return
await
this
.
callms
(
"channel"
,
"merchantPage"
,
params
);
}
}
async
getPushMerchantIds
(
params
){
return
await
this
.
callms
(
"channel"
,
"getPushMerchantIds"
,
params
);
}
}
}
module
.
exports
=
ChannelService
;
module
.
exports
=
ChannelService
;
bpo-admin/app/base/service/impl/esettleSve.js
View file @
2e0cfa3b
...
@@ -902,5 +902,24 @@ class EsettleService extends ServiceBase {
...
@@ -902,5 +902,24 @@ class EsettleService extends ServiceBase {
return
{
count
:
total
,
rows
:
list
};
return
{
count
:
total
,
rows
:
list
};
}
}
async
findPushInfos
(
busiId
,
begin
,
end
)
{
if
(
!
busiId
)
{
return
[];
}
let
sql
=
[];
sql
.
push
(
"SELECT"
);
sql
.
push
(
"id, deduct_amt "
);
sql
.
push
(
"FROM `tbl_order` "
);
sql
.
push
(
"WHERE busi_id = :busiId"
);
sql
.
push
(
"AND pay_complete_time >= :begin"
);
sql
.
push
(
"AND pay_complete_time <= :end"
);
var
list
=
await
this
.
settledb
.
query
(
sql
.
join
(
" "
),
{
replacements
:
{
busiId
:
busiId
,
begin
:
begin
,
end
:
end
}
});
if
(
list
&&
list
.
length
>
0
)
{
list
=
list
[
0
,
0
]
||
[];
}
return
list
;
}
}
}
module
.
exports
=
EsettleService
;
module
.
exports
=
EsettleService
;
bpo-admin/app/base/service/impl/esettleofflineSve.js
View file @
2e0cfa3b
...
@@ -20,12 +20,12 @@ class EsettleofflineService extends ServiceBase {
...
@@ -20,12 +20,12 @@ class EsettleofflineService extends ServiceBase {
var
self
=
this
;
var
self
=
this
;
var
opuser
=
settle
.
opid
;
var
opuser
=
settle
.
opid
;
var
rs
=
await
this
.
parseItems
(
opuser
,
settle
.
fileurl
,
settle
.
pay_complete_time
);
var
rs
=
await
this
.
parseItems
(
opuser
,
settle
.
fileurl
,
settle
.
pay_complete_time
);
if
(
!
rs
.
code
)
{
if
(
!
rs
.
code
)
{
return
rs
;
return
rs
;
}
}
var
itemList
=
rs
.
list
;
var
itemList
=
rs
.
list
;
return
self
.
db
.
transaction
(
async
function
(
t
){
return
self
.
db
.
transaction
(
async
function
(
t
)
{
if
(
settle
.
id
)
{
if
(
settle
.
id
)
{
await
self
.
update
(
settle
,
t
);
await
self
.
update
(
settle
,
t
);
}
else
{
}
else
{
settle
=
await
self
.
dao
.
create
(
settle
,
t
);
settle
=
await
self
.
dao
.
create
(
settle
,
t
);
...
@@ -33,12 +33,12 @@ class EsettleofflineService extends ServiceBase {
...
@@ -33,12 +33,12 @@ class EsettleofflineService extends ServiceBase {
await
self
.
esettleofflineitemDao
.
customExecAddOrPutSql
(
"DELETE FROM c_esettle_offline_item where esettleoffline_id = "
+
settle
.
id
);
await
self
.
esettleofflineitemDao
.
customExecAddOrPutSql
(
"DELETE FROM c_esettle_offline_item where esettleoffline_id = "
+
settle
.
id
);
for
(
var
item
of
itemList
)
{
for
(
var
item
of
itemList
)
{
item
.
month
=
settle
.
month
;
item
.
month
=
settle
.
month
;
item
.
esettleoffline_id
=
settle
.
id
;
item
.
esettleoffline_id
=
settle
.
id
;
}
}
await
self
.
esettleofflineitemDao
.
model
.
bulkCreate
(
itemList
,
{
transaction
:
t
});
await
self
.
esettleofflineitemDao
.
model
.
bulkCreate
(
itemList
,
{
transaction
:
t
});
var
sql
=
"INSERT INTO c_esettle_offline_log (esettleoffline_id, url, opuser, created_at, updated_at) VALUES ('"
+
settle
.
id
+
"', '"
+
settle
.
fileurl
+
"', '"
+
opuser
+
"', NOW(), NOW()) "
;
var
sql
=
"INSERT INTO c_esettle_offline_log (esettleoffline_id, url, opuser, created_at, updated_at) VALUES ('"
+
settle
.
id
+
"', '"
+
settle
.
fileurl
+
"', '"
+
opuser
+
"', NOW(), NOW()) "
;
await
self
.
dao
.
customExecAddOrPutSql
(
sql
);
await
self
.
dao
.
customExecAddOrPutSql
(
sql
);
...
@@ -88,7 +88,7 @@ class EsettleofflineService extends ServiceBase {
...
@@ -88,7 +88,7 @@ class EsettleofflineService extends ServiceBase {
];
];
var
attributes
=
[
"id"
,
"ecompany_id"
,
"ecompanyName"
,
"month"
,
"pay_complete_time"
,
"sourceType"
,
var
attributes
=
[
"id"
,
"ecompany_id"
,
"ecompanyName"
,
"month"
,
"pay_complete_time"
,
"sourceType"
,
"amt"
,
"actual_amt"
,
"service_rate"
,
"service_tax"
,
"added_value_tax"
,
"open_bank"
,
"bankno"
"amt"
,
"actual_amt"
,
"service_rate"
,
"service_tax"
,
"added_value_tax"
,
"open_bank"
,
"bankno"
];
];
var
page
=
await
this
.
getPageList
(
currentPage
,
pageSize
,
where
,
orderby
,
attributes
);
var
page
=
await
this
.
getPageList
(
currentPage
,
pageSize
,
where
,
orderby
,
attributes
);
...
@@ -103,9 +103,9 @@ class EsettleofflineService extends ServiceBase {
...
@@ -103,9 +103,9 @@ class EsettleofflineService extends ServiceBase {
async
parseItems
(
userId
,
ossurl
,
pay_complete_time
)
{
async
parseItems
(
userId
,
ossurl
,
pay_complete_time
)
{
var
result
=
{
var
result
=
{
code
:
0
,
code
:
0
,
msg
:
""
,
msg
:
""
,
list
:
[],
list
:
[],
};
};
var
isValid
=
false
;
var
isValid
=
false
;
...
@@ -122,17 +122,17 @@ class EsettleofflineService extends ServiceBase {
...
@@ -122,17 +122,17 @@ class EsettleofflineService extends ServiceBase {
await
this
.
restClient
.
execDownload
(
"'"
+
ossurl
+
"'"
,
filePath
);
await
this
.
restClient
.
execDownload
(
"'"
+
ossurl
+
"'"
,
filePath
);
var
sheets
=
xlsx
.
parse
(
filePath
);
var
sheets
=
xlsx
.
parse
(
filePath
);
fs
.
unlink
(
filePath
,
e
=>
{
fs
.
unlink
(
filePath
,
e
=>
{
console
.
log
(
"fail"
);
console
.
log
(
"fail"
);
});
});
if
(
!
sheets
||
sheets
.
length
==
0
)
{
if
(
!
sheets
||
sheets
.
length
==
0
)
{
result
.
msg
=
"明细excel为空"
;
result
.
msg
=
"明细excel为空"
;
return
result
;
return
result
;
}
}
var
sheet
=
sheets
[
0
];
var
sheet
=
sheets
[
0
];
if
(
!
sheet
||
!
sheet
.
data
||
sheet
.
data
.
length
==
0
)
{
if
(
!
sheet
||
!
sheet
.
data
||
sheet
.
data
.
length
==
0
)
{
result
.
msg
=
"明细无内容行"
;
result
.
msg
=
"明细无内容行"
;
return
result
;
return
result
;
}
}
...
@@ -142,7 +142,7 @@ class EsettleofflineService extends ServiceBase {
...
@@ -142,7 +142,7 @@ class EsettleofflineService extends ServiceBase {
var
erridnoLines
=
[];
var
erridnoLines
=
[];
for
(
var
idx
in
rows
)
{
for
(
var
idx
in
rows
)
{
if
(
idx
==
0
)
{
if
(
idx
==
0
)
{
continue
;
continue
;
}
}
...
@@ -150,10 +150,10 @@ class EsettleofflineService extends ServiceBase {
...
@@ -150,10 +150,10 @@ class EsettleofflineService extends ServiceBase {
var
rowNum
=
Number
(
idx
)
+
1
;
var
rowNum
=
Number
(
idx
)
+
1
;
var
cellLength
=
cells
.
length
;
var
cellLength
=
cells
.
length
;
if
(
cellLength
==
0
)
{
if
(
cellLength
==
0
)
{
continue
;
continue
;
}
}
if
(
cellLength
<
8
)
{
if
(
cellLength
<
8
)
{
result
.
msg
=
"excel第"
+
rowNum
+
"行,请至少填写姓名、身份证、银行卡号、应发金额、实发金额"
;
result
.
msg
=
"excel第"
+
rowNum
+
"行,请至少填写姓名、身份证、银行卡号、应发金额、实发金额"
;
return
result
;
return
result
;
}
}
...
@@ -169,67 +169,67 @@ class EsettleofflineService extends ServiceBase {
...
@@ -169,67 +169,67 @@ class EsettleofflineService extends ServiceBase {
data
.
actual_amt
=
system
.
y2f
(
this
.
trim
(
cells
[
7
])
||
0
);
data
.
actual_amt
=
system
.
y2f
(
this
.
trim
(
cells
[
7
])
||
0
);
data
.
rowNum
=
rowNum
;
data
.
rowNum
=
rowNum
;
if
(
cellLength
>=
9
)
{
if
(
cellLength
>=
9
)
{
data
.
service_tax
=
system
.
y2f
(
this
.
trim
(
cells
[
8
]));
data
.
service_tax
=
system
.
y2f
(
this
.
trim
(
cells
[
8
]));
}
}
if
(
cellLength
>=
13
)
{
if
(
cellLength
>=
13
)
{
data
.
added_value_rate
=
this
.
trim
(
cells
[
12
]);
data
.
added_value_rate
=
this
.
trim
(
cells
[
12
]);
}
}
if
(
cellLength
>=
10
)
{
if
(
cellLength
>=
10
)
{
data
.
added_value_tax
=
system
.
y2f
(
this
.
trim
(
cells
[
9
]));
data
.
added_value_tax
=
system
.
y2f
(
this
.
trim
(
cells
[
9
]));
}
}
if
(
cellLength
>=
11
)
{
if
(
cellLength
>=
11
)
{
data
.
total_amt
=
system
.
y2f
(
this
.
trim
(
cells
[
10
]));
data
.
total_amt
=
system
.
y2f
(
this
.
trim
(
cells
[
10
]));
}
}
if
(
cellLength
>=
12
)
{
if
(
cellLength
>=
12
)
{
data
.
remark
=
this
.
trim
(
cells
[
11
]);
data
.
remark
=
this
.
trim
(
cells
[
11
]);
}
}
if
(
!
data
.
amt
&&
!
data
.
actual_amt
&&
!
data
.
total_amt
)
{
if
(
!
data
.
amt
&&
!
data
.
actual_amt
&&
!
data
.
total_amt
)
{
continue
;
continue
;
}
}
if
(
!
data
.
id_name
)
{
if
(
!
data
.
id_name
)
{
result
.
msg
=
"excel第"
+
rowNum
+
"行,请填写姓名"
;
result
.
msg
=
"excel第"
+
rowNum
+
"行,请填写姓名"
;
return
result
;
return
result
;
}
}
if
(
!
data
.
id_no
)
{
if
(
!
data
.
id_no
)
{
result
.
msg
=
"excel第"
+
rowNum
+
"行,请填写身份证"
;
result
.
msg
=
"excel第"
+
rowNum
+
"行,请填写身份证"
;
return
result
;
return
result
;
}
}
if
(
!
data
.
amt
)
{
if
(
!
data
.
amt
)
{
result
.
msg
=
"excel第"
+
rowNum
+
"行,请填写应发金额"
;
result
.
msg
=
"excel第"
+
rowNum
+
"行,请填写应发金额"
;
return
result
;
return
result
;
}
}
if
(
!
data
.
actual_amt
)
{
if
(
!
data
.
actual_amt
)
{
result
.
msg
=
"excel第"
+
rowNum
+
"行,请填写实发金额"
;
result
.
msg
=
"excel第"
+
rowNum
+
"行,请填写实发金额"
;
return
result
;
return
result
;
}
}
if
(
!
data
.
total_amt
)
{
if
(
!
data
.
total_amt
)
{
result
.
msg
=
"excel第"
+
rowNum
+
"行,请填写总付款额"
;
result
.
msg
=
"excel第"
+
rowNum
+
"行,请填写总付款额"
;
return
result
;
return
result
;
}
}
if
(
data
.
amt
>
1000
&&
!
data
.
service_tax
)
{
if
(
data
.
amt
>
1000
&&
!
data
.
service_tax
)
{
result
.
msg
=
"excel第"
+
rowNum
+
"行,请填写服务费"
;
result
.
msg
=
"excel第"
+
rowNum
+
"行,请填写服务费"
;
return
result
;
return
result
;
}
}
if
(
data
.
added_value_tax
&&
!
data
.
added_value_rate
)
{
if
(
data
.
added_value_tax
&&
!
data
.
added_value_rate
)
{
result
.
msg
=
"excel第"
+
rowNum
+
"行,请填写增值税率"
;
result
.
msg
=
"excel第"
+
rowNum
+
"行,请填写增值税率"
;
return
result
;
return
result
;
}
}
if
(
!
await
this
.
idcardClient
.
checkIDCard
(
data
.
id_no
))
{
if
(
!
await
this
.
idcardClient
.
checkIDCard
(
data
.
id_no
))
{
erridnoLines
.
push
(
rowNum
);
erridnoLines
.
push
(
rowNum
);
data
.
errormsg
=
"身份证号码验证失败"
;
data
.
errormsg
=
"身份证号码验证失败"
;
}
}
if
(
!
regexNumber
.
test
(
data
.
acc_no
))
{
if
(
!
regexNumber
.
test
(
data
.
acc_no
))
{
result
.
msg
=
"excel第"
+
rowNum
+
"行,银行卡号格式错误,请填写纯数字"
;
result
.
msg
=
"excel第"
+
rowNum
+
"行,银行卡号格式错误,请填写纯数字"
;
return
result
;
return
result
;
}
}
...
@@ -237,12 +237,12 @@ class EsettleofflineService extends ServiceBase {
...
@@ -237,12 +237,12 @@ class EsettleofflineService extends ServiceBase {
datalist
.
push
(
data
);
datalist
.
push
(
data
);
}
}
if
(
datalist
.
length
==
0
)
{
if
(
datalist
.
length
==
0
)
{
result
.
msg
=
"请填写明细数据"
;
result
.
msg
=
"请填写明细数据"
;
return
result
;
return
result
;
}
}
if
(
isValid
&&
erridnoLines
.
length
>
0
)
{
if
(
isValid
&&
erridnoLines
.
length
>
0
)
{
result
.
msg
=
"excel第【"
+
erridnoLines
.
join
(
"、"
)
+
"】行,身份证号格式错误!"
;
result
.
msg
=
"excel第【"
+
erridnoLines
.
join
(
"、"
)
+
"】行,身份证号格式错误!"
;
return
result
;
return
result
;
}
}
...
@@ -251,9 +251,9 @@ class EsettleofflineService extends ServiceBase {
...
@@ -251,9 +251,9 @@ class EsettleofflineService extends ServiceBase {
result
.
code
=
1
;
result
.
code
=
1
;
result
.
list
=
datalist
;
result
.
list
=
datalist
;
if
(
unSignLines
&&
unSignLines
.
length
>
0
)
{
if
(
unSignLines
&&
unSignLines
.
length
>
0
)
{
var
endstr
=
""
var
endstr
=
""
if
(
unSignLines
.
length
>=
100
)
{
if
(
unSignLines
.
length
>=
100
)
{
endstr
=
"..."
;
endstr
=
"..."
;
}
}
result
.
unsignMsg
=
"excel第【"
+
unSignLines
.
join
(
"、"
)
+
endstr
+
"】行,未进行电子签!"
;
result
.
unsignMsg
=
"excel第【"
+
unSignLines
.
join
(
"、"
)
+
endstr
+
"】行,未进行电子签!"
;
...
@@ -271,19 +271,19 @@ class EsettleofflineService extends ServiceBase {
...
@@ -271,19 +271,19 @@ class EsettleofflineService extends ServiceBase {
var
banknoArr
=
[];
var
banknoArr
=
[];
var
unSignLines
=
[];
var
unSignLines
=
[];
if
(
!
datalist
||
datalist
.
length
==
0
)
{
if
(
!
datalist
||
datalist
.
length
==
0
)
{
return
[];
return
[];
}
}
for
(
var
data
of
datalist
)
{
for
(
var
data
of
datalist
)
{
personsSignArr
.
push
(
data
.
id_no
.
toString
());
personsSignArr
.
push
(
data
.
id_no
.
toString
());
banknoArr
.
push
(
data
.
acc_no
.
toString
());
banknoArr
.
push
(
data
.
acc_no
.
toString
());
if
(
unSignLines
.
length
<=
100
)
{
if
(
unSignLines
.
length
<=
100
)
{
unSignLines
.
push
(
data
.
rowNum
);
unSignLines
.
push
(
data
.
rowNum
);
}
}
}
}
if
(
!
personsSignArr
||
personsSignArr
.
length
==
0
||
!
banknoArr
||
banknoArr
.
length
==
0
)
{
if
(
!
personsSignArr
||
personsSignArr
.
length
==
0
||
!
banknoArr
||
banknoArr
.
length
==
0
)
{
return
unSignLines
;
return
unSignLines
;
}
}
...
@@ -297,19 +297,19 @@ class EsettleofflineService extends ServiceBase {
...
@@ -297,19 +297,19 @@ class EsettleofflineService extends ServiceBase {
var
map
=
[];
var
map
=
[];
var
list
=
await
this
.
dao
.
customQuery
(
sql
.
join
(
" "
),
{
personsSign
:
personsSignArr
,
bankno
:
banknoArr
});
var
list
=
await
this
.
dao
.
customQuery
(
sql
.
join
(
" "
),
{
personsSign
:
personsSignArr
,
bankno
:
banknoArr
});
if
(
!
list
||
list
.
length
==
0
)
{
if
(
!
list
||
list
.
length
==
0
)
{
return
unSignLines
;
return
unSignLines
;
}
}
unSignLines
=
[];
unSignLines
=
[];
for
(
var
item
of
list
)
{
for
(
var
item
of
list
)
{
map
[
item
.
personsSign
+
"_"
+
item
.
bankno
]
=
item
.
id
;
map
[
item
.
personsSign
+
"_"
+
item
.
bankno
]
=
item
.
id
;
}
}
for
(
var
data
of
datalist
)
{
for
(
var
data
of
datalist
)
{
var
item
=
map
[
data
.
id_no
+
"_"
+
data
.
acc_no
];
var
item
=
map
[
data
.
id_no
+
"_"
+
data
.
acc_no
];
if
(
!
item
&&
unSignLines
.
length
<=
100
)
{
if
(
!
item
&&
unSignLines
.
length
<=
100
)
{
unSignLines
.
push
(
data
.
rowNum
);
unSignLines
.
push
(
data
.
rowNum
);
}
}
}
}
...
@@ -330,14 +330,14 @@ class EsettleofflineService extends ServiceBase {
...
@@ -330,14 +330,14 @@ class EsettleofflineService extends ServiceBase {
sql
.
push
(
"WHERE 1 = 1"
);
sql
.
push
(
"WHERE 1 = 1"
);
var
where
=
{};
var
where
=
{};
if
(
params
.
month
)
{
if
(
params
.
month
)
{
sql
.
push
(
"AND t2.month = :month"
);
sql
.
push
(
"AND t2.month = :month"
);
where
.
month
=
params
.
month
;
where
.
month
=
params
.
month
;
}
}
var
stat
=
{};
var
stat
=
{};
var
list
=
await
this
.
dao
.
customQuery
(
sql
.
join
(
" "
),
where
);
var
list
=
await
this
.
dao
.
customQuery
(
sql
.
join
(
" "
),
where
);
if
(
list
&&
list
.
length
>
0
)
{
if
(
list
&&
list
.
length
>
0
)
{
stat
=
list
[
0
]
||
{};
stat
=
list
[
0
]
||
{};
stat
.
amtCount
=
system
.
f2y
(
stat
.
amtCount
);
stat
.
amtCount
=
system
.
f2y
(
stat
.
amtCount
);
stat
.
actualAmtCount
=
system
.
f2y
(
stat
.
actualAmtCount
);
stat
.
actualAmtCount
=
system
.
f2y
(
stat
.
actualAmtCount
);
...
@@ -347,5 +347,20 @@ class EsettleofflineService extends ServiceBase {
...
@@ -347,5 +347,20 @@ class EsettleofflineService extends ServiceBase {
return
stat
;
return
stat
;
}
}
async
findPushInfos
(
companyId
,
begin
,
end
)
{
if
(
!
companyId
)
{
return
[];
}
let
sql
=
[];
sql
.
push
(
"SELECT"
);
sql
.
push
(
"id, amt as deduct_amt"
);
sql
.
push
(
"FROM `c_esettle_offline` "
);
sql
.
push
(
"WHERE ecompany_id = :companyId"
);
sql
.
push
(
"AND created_at >= :begin"
);
sql
.
push
(
"AND created_at <= :end"
);
return
await
this
.
dao
.
customQuery
(
sql
.
join
(
" "
),
{
companyId
:
companyId
,
begin
:
begin
,
end
:
end
})
||
[];
}
}
}
module
.
exports
=
EsettleofflineService
;
module
.
exports
=
EsettleofflineService
;
\ No newline at end of file
bpo-admin/app/base/utils/aliyunClient.js
View file @
2e0cfa3b
const
settings
=
require
(
"../../config/settings"
);
const
Client
=
require
(
'aliyun-api-gateway'
).
Client
;
const
Client
=
require
(
'aliyun-api-gateway'
).
Client
;
var
RPCClient
=
require
(
'@alicloud/pop-core'
).
RPCClient
;
var
RPCClient
=
require
(
'@alicloud/pop-core'
).
RPCClient
;
// const client = new Client('203756805', 'crkyej0xlmqa6bmvqijun6ltxparllyn');//开发
// const client = new Client('203756805', 'crkyej0xlmqa6bmvqijun6ltxparllyn');//开发
const
client
=
new
Client
(
'203763771'
,
'e5e2ytnn6nrkr9qnqk4w5e6z0xlhkznu'
);
//线上
// const client = new Client('203763771', 'e5e2ytnn6nrkr9qnqk4w5e6z0xlhkznu');//线上
const
client
=
new
Client
(
settings
.
FQYF
().
k
,
settings
.
FQYF
().
v
);
//线上
class
aliyunClient
{
class
aliyunClient
{
constructor
()
{
constructor
()
{
// this.aliReqUrl = "https://aliapi.gongsibao.com/tm/springboard";
// this.aliReqUrl = "https://aliapi.gongsibao.com/tm/springboard";
...
...
bpo-admin/app/config/settings.js
View file @
2e0cfa3b
...
@@ -29,6 +29,21 @@ var settings = {
...
@@ -29,6 +29,21 @@ var settings = {
return
"http://43.247.184.94:7200/"
;
return
"http://43.247.184.94:7200/"
;
}
}
},
},
FQYF
:
function
()
{
if
(
settings
.
env
==
"dev"
)
{
return
{
k
:
"203756805"
,
v
:
"crkyej0xlmqa6bmvqijun6ltxparllyn"
,
productId
:
"5e6b02cc3290c3000a3a63dc"
,
// 云服产品id
};
}
else
{
return
{
k
:
"203763771"
,
v
:
"e5e2ytnn6nrkr9qnqk4w5e6z0xlhkznu"
,
productId
:
"5e6c89d54c52bf000a750bc5"
,
// 云服产品id (生产环境)
};
}
},
apiconfig
:
{
apiconfig
:
{
AES
:
{
AES
:
{
key
:
"qUPsMflPfgpPP1Ua"
,
//密钥
key
:
"qUPsMflPfgpPP1Ua"
,
//密钥
...
@@ -59,6 +74,7 @@ var settings = {
...
@@ -59,6 +74,7 @@ var settings = {
return
"https://o.tsign.cn/opentreaty-service"
;
return
"https://o.tsign.cn/opentreaty-service"
;
}
}
},
},
//e签宝银行验证接口Url
//e签宝银行验证接口Url
eSignBaoBankVerifyUrl
:
function
()
{
eSignBaoBankVerifyUrl
:
function
()
{
if
(
settings
.
env
==
"dev"
)
{
if
(
settings
.
env
==
"dev"
)
{
...
...
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