Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
5
51business
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
方斌
51business
Commits
c9aaa20f
Commit
c9aaa20f
authored
Sep 11, 2019
by
Hsinli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
5327e20c
Pipeline
#13688
passed with stage
in 5 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
6 deletions
+14
-6
blacklist.js
app/service/credit/blacklist.js
+1
-1
common.js
app/service/credit/common.js
+12
-4
order.js
app/service/credit/order.js
+1
-1
No files found.
app/service/credit/blacklist.js
View file @
c9aaa20f
...
@@ -241,7 +241,7 @@ class BlacklistService extends Service {
...
@@ -241,7 +241,7 @@ class BlacklistService extends Service {
ret
.
six_months
.
mobilephone_relecvant
.
msg
=
DeviceConfig
[
deviceLevel
].
replace
(
/XX/
,
deviceMax
.
type
);
ret
.
six_months
.
mobilephone_relecvant
.
msg
=
DeviceConfig
[
deviceLevel
].
replace
(
/XX/
,
deviceMax
.
type
);
if
(
!
ret
.
basic
.
report_no
)
{
if
(
!
ret
.
basic
.
report_no
)
{
ret
.
basic
.
report_no
=
await
ctx
.
service
.
credit
.
common
.
getReportNo
(
'
00
'
,
reportData
.
id
);
ret
.
basic
.
report_no
=
await
ctx
.
service
.
credit
.
common
.
getReportNo
(
'
blacklist
'
,
reportData
.
id
);
await
ctx
.
prometheusModel
.
CreditBlacklistReport
.
update
({
report_no
:
ret
.
basic
.
report_no
},
{
where
:
{
id
:
reportData
.
id
}
});
await
ctx
.
prometheusModel
.
CreditBlacklistReport
.
update
({
report_no
:
ret
.
basic
.
report_no
},
{
where
:
{
id
:
reportData
.
id
}
});
}
}
...
...
app/service/credit/common.js
View file @
c9aaa20f
...
@@ -13,11 +13,15 @@ class CommonService extends Service {
...
@@ -13,11 +13,15 @@ class CommonService extends Service {
/**
/**
*
*
* @param {*} type 黑名单
00通话01
* @param {*} type 黑名单
blacklist通话callrisk
* @param {*} id 报告自增编号(report_id)
* @param {*} id 报告自增编号(report_id)
*/
*/
async
getReportNo
(
type
,
id
)
{
async
getReportNo
(
type
,
id
)
{
let
prefix
=
'51GJJ'
+
moment
().
format
(
'YYYYMMDD'
)
+
type
;
if
(
!
TypeConfig
.
hasOwnProperty
(
type
))
{
this
.
ctx
.
failed
(
'getReportNo type undefined'
);
}
let
tip
=
(
type
===
'blacklist'
)
?
'00'
:
'01'
;
let
prefix
=
'51GJJ'
+
moment
().
format
(
'YYYYMMDD'
)
+
tip
;
let
suffix
=
String
(
Number
(
id
)
+
12580
);
let
suffix
=
String
(
Number
(
id
)
+
12580
);
if
(
suffix
.
length
>
5
)
{
if
(
suffix
.
length
>
5
)
{
let
subStart
=
suffix
.
length
-
5
;
let
subStart
=
suffix
.
length
-
5
;
...
@@ -29,11 +33,15 @@ class CommonService extends Service {
...
@@ -29,11 +33,15 @@ class CommonService extends Service {
/**
/**
*
*
* @param {*} type 黑名单
00通话01
* @param {*} type 黑名单
blacklist通话callrisk
* @param {*} id 订单自增编号(order_id)
* @param {*} id 订单自增编号(order_id)
*/
*/
async
getOrdertNo
(
type
,
id
)
{
async
getOrdertNo
(
type
,
id
)
{
let
prefix
=
'51GJJOD'
+
moment
().
format
(
'YYYYMMDD'
)
+
type
;
if
(
!
TypeConfig
.
hasOwnProperty
(
type
))
{
this
.
ctx
.
failed
(
'getOrdertNo type undefined'
);
}
let
tip
=
(
type
===
'blacklist'
)
?
'00'
:
'01'
;
let
prefix
=
'51GJJOD'
+
moment
().
format
(
'YYYYMMDD'
)
+
tip
;
let
suffix
=
String
(
Number
(
id
)
+
12580
);
let
suffix
=
String
(
Number
(
id
)
+
12580
);
if
(
suffix
.
length
>
5
)
{
if
(
suffix
.
length
>
5
)
{
let
subStart
=
suffix
.
length
-
5
;
let
subStart
=
suffix
.
length
-
5
;
...
...
app/service/credit/order.js
View file @
c9aaa20f
...
@@ -410,7 +410,7 @@ class OrderService extends Service {
...
@@ -410,7 +410,7 @@ class OrderService extends Service {
}
}
let
order
=
await
ctx
.
prometheusModel
.
CreditOrder
.
create
(
data
);
let
order
=
await
ctx
.
prometheusModel
.
CreditOrder
.
create
(
data
);
//生成order_no
//生成order_no
let
orderNoType
=
params
.
type
===
1
?
'
00'
:
'01
'
;
let
orderNoType
=
params
.
type
===
1
?
'
blacklist'
:
'callrisk
'
;
let
orderNo
=
await
ctx
.
service
.
credit
.
common
.
getOrdertNo
(
orderNoType
,
order
.
id
);
let
orderNo
=
await
ctx
.
service
.
credit
.
common
.
getOrdertNo
(
orderNoType
,
order
.
id
);
await
ctx
.
prometheusModel
.
CreditOrder
.
update
({
order_no
:
orderNo
},
{
where
:
{
id
:
order
.
id
}
});
await
ctx
.
prometheusModel
.
CreditOrder
.
update
({
order_no
:
orderNo
},
{
where
:
{
id
:
order
.
id
}
});
return
order
;
return
order
;
...
...
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