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
57f911e6
Commit
57f911e6
authored
Sep 06, 2019
by
李尚科
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
credit callrisk fix
parent
89282201
Pipeline
#13421
passed with stage
in 29 seconds
Changes
9
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
851 additions
and
3 deletions
+851
-3
callrisk.js
app/controller/credit/callrisk.js
+9
-2
credit_callrisk_call_active.js
app/model/prometheus/credit_callrisk_call_active.js
+130
-0
credit_callrisk_call_behavior.js
app/model/prometheus/credit_callrisk_call_behavior.js
+166
-0
credit_callrisk_call_overview.js
app/model/prometheus/credit_callrisk_call_overview.js
+130
-0
credit_callrisk_call_type.js
app/model/prometheus/credit_callrisk_call_type.js
+154
-0
credit_callrisk_report.js
app/model/prometheus/credit_callrisk_report.js
+142
-0
credit_callrisk_silence_cycle.js
app/model/prometheus/credit_callrisk_silence_cycle.js
+118
-0
credit.js
app/router/credit.js
+2
-1
callrisk.js
app/service/credit/callrisk.js
+0
-0
No files found.
app/controller/credit/callrisk.js
View file @
57f911e6
...
@@ -7,14 +7,21 @@ class CallriskController extends Controller {
...
@@ -7,14 +7,21 @@ class CallriskController extends Controller {
/**
/**
* 获取黑名单报告
* 获取黑名单报告
*/
*/
async
get
Callrisk
Report
()
{
async
getReport
()
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
let
ret
=
await
ctx
.
service
.
credit
.
callrisk
.
getReport
();
const
report_no
=
ctx
.
params
.
report_no
;
let
ret
=
await
ctx
.
service
.
credit
.
callrisk
.
getReport
(
report_no
);
ctx
.
success
(
ret
);
ctx
.
success
(
ret
);
}
}
async
queryCallRisk
()
{
const
{
ctx
}
=
this
;
}
}
}
...
...
app/model/prometheus/credit_callrisk_call_active.js
0 → 100644
View file @
57f911e6
'use strict'
;
const
moment
=
require
(
'moment'
);
module
.
exports
=
app
=>
{
const
{
STRING
,
INTEGER
,
DATE
,
DECIMAL
,
TEXT
,
ENUM
}
=
app
.
Sequelize
;
const
CreditCallriskCallActive
=
app
.
prometheusModel
.
define
(
'credit_callrisk_call_active'
,
{
id
:
{
type
:
INTEGER
,
primaryKey
:
true
,
autoIncrement
:
true
},
report_id
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
routine_call_time
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
night_call_time
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
routine_call_count
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
night_call_count
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
time_interval_active
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
city_active
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
// is_deleted: {
// type: INTEGER,
// allowNull: false,
// },
// updated_at: {
// type: DATE,
// allowNull: true,
// get() {
// const date = this.getDataValue('updated_at');
// return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
// },
// },
// created_at: {
// type: DATE,
// allowNull: false,
// get() {
// const date = this.getDataValue('created_at');
// return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
// },
// }
},
{
timestamps
:
false
,
tableName
:
'credit_callrisk_call_active'
,
});
CreditCallriskCallActive
.
one
=
async
(
data
)
=>
{
const
attributes
=
data
.
attributes
?
data
.
attributes
:
{};
const
where
=
data
.
where
?
data
.
where
:
{};
return
await
CreditCallriskCallActive
.
findOne
({
attributes
:
attributes
,
where
:
where
,
});
}
CreditCallriskCallActive
.
all
=
async
(
data
)
=>
{
const
attributes
=
data
.
attributes
?
data
.
attributes
:
{};
const
where
=
data
.
where
?
data
.
where
:
{};
const
order
=
data
.
order
?
data
.
order
:
[];
return
await
CreditCallriskCallActive
.
findAll
({
attributes
:
attributes
,
where
:
where
,
order
,
});
}
CreditCallriskCallActive
.
list
=
async
(
data
=
{})
=>
{
const
limit
=
data
.
limit
?
Number
(
data
.
limit
)
:
10
;
const
page
=
data
.
page
?
data
.
page
:
1
;
const
order
=
data
.
order
?
data
.
order
:
[];
const
attributes
=
data
.
attributes
?
data
.
attributes
:
{};
const
where
=
data
.
where
?
data
.
where
:
{};
const
condition
=
{
offset
:
(
page
-
1
)
*
limit
,
limit
,
where
:
where
,
order
:
order
,
attributes
:
attributes
,
};
const
{
count
,
rows
}
=
await
CreditCallriskCallActive
.
findAndCountAll
(
condition
);
return
{
page
,
count
,
rows
};
}
CreditCallriskCallActive
.
add
=
async
(
data
)
=>
{
try
{
//返回promise对象实力 instance
const
res
=
await
CreditCallriskCallActive
.
create
(
data
);
//从promise 实例中中获得需要的id号,id 必须是自增长,而且必须主键,否则返回null
return
res
.
id
;
}
catch
(
error
)
{
throw
(
error
);
}
}
CreditCallriskCallActive
.
edit
=
async
(
data
)
=>
{
const
where
=
data
.
where
;
const
params
=
data
.
params
;
try
{
const
res
=
await
CreditCallriskCallActive
.
update
(
params
,
{
where
:
where
})
return
res
;
}
catch
(
error
)
{
throw
(
error
);
}
}
return
CreditCallriskCallActive
;
};
\ No newline at end of file
app/model/prometheus/credit_callrisk_call_behavior.js
0 → 100644
View file @
57f911e6
'use strict'
;
const
moment
=
require
(
'moment'
);
module
.
exports
=
app
=>
{
const
{
STRING
,
INTEGER
,
DATE
,
DECIMAL
,
TEXT
,
ENUM
}
=
app
.
Sequelize
;
const
CreditCallriskCallBehavior
=
app
.
prometheusModel
.
define
(
'credit_callrisk_call_behavior'
,
{
id
:
{
type
:
INTEGER
,
primaryKey
:
true
,
autoIncrement
:
true
},
report_id
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
active_call_count
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
passive_call_count
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
each_call_count
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
silence_count_3day
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
silence_time_3day
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
silence_time_rate_3day
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
maximum_active_call_count
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
maximum_active_call_number
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
maximum_active_call_city
:
{
type
:
STRING
,
allowNull
:
false
,
},
maximum_passive_call_count
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
maximum_passive_call_number
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
maximum_passive_call_city
:
{
type
:
STRING
,
allowNull
:
false
,
},
maximum_call_time
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
maximum_call_time_number
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
maximum_call_time_city
:
{
type
:
STRING
,
allowNull
:
false
,
},
// is_deleted: {
// type: INTEGER,
// allowNull: false,
// },
// updated_at: {
// type: DATE,
// allowNull: true,
// get() {
// const date = this.getDataValue('updated_at');
// return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
// },
// },
// created_at: {
// type: DATE,
// allowNull: false,
// get() {
// const date = this.getDataValue('created_at');
// return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
// },
// }
},
{
timestamps
:
false
,
tableName
:
'credit_callrisk_call_behavior'
,
});
CreditCallriskCallBehavior
.
one
=
async
(
data
)
=>
{
const
attributes
=
data
.
attributes
?
data
.
attributes
:
{};
const
where
=
data
.
where
?
data
.
where
:
{};
return
await
CreditCallriskCallBehavior
.
findOne
({
attributes
:
attributes
,
where
:
where
,
});
}
CreditCallriskCallBehavior
.
all
=
async
(
data
)
=>
{
const
attributes
=
data
.
attributes
?
data
.
attributes
:
{};
const
where
=
data
.
where
?
data
.
where
:
{};
const
order
=
data
.
order
?
data
.
order
:
[];
return
await
CreditCallriskCallBehavior
.
findAll
({
attributes
:
attributes
,
where
:
where
,
order
,
});
}
CreditCallriskCallBehavior
.
list
=
async
(
data
=
{})
=>
{
const
limit
=
data
.
limit
?
Number
(
data
.
limit
)
:
10
;
const
page
=
data
.
page
?
data
.
page
:
1
;
const
order
=
data
.
order
?
data
.
order
:
[];
const
attributes
=
data
.
attributes
?
data
.
attributes
:
{};
const
where
=
data
.
where
?
data
.
where
:
{};
const
condition
=
{
offset
:
(
page
-
1
)
*
limit
,
limit
,
where
:
where
,
order
:
order
,
attributes
:
attributes
,
};
const
{
count
,
rows
}
=
await
CreditCallriskCallBehavior
.
findAndCountAll
(
condition
);
return
{
page
,
count
,
rows
};
}
CreditCallriskCallBehavior
.
add
=
async
(
data
)
=>
{
try
{
//返回promise对象实力 instance
const
res
=
await
CreditCallriskCallBehavior
.
create
(
data
);
//从promise 实例中中获得需要的id号,id 必须是自增长,而且必须主键,否则返回null
return
res
.
id
;
}
catch
(
error
)
{
throw
(
error
);
}
}
CreditCallriskCallBehavior
.
edit
=
async
(
data
)
=>
{
const
where
=
data
.
where
;
const
params
=
data
.
params
;
try
{
const
res
=
await
CreditCallriskCallBehavior
.
update
(
params
,
{
where
:
where
})
return
res
;
}
catch
(
error
)
{
throw
(
error
);
}
}
return
CreditCallriskCallBehavior
;
};
\ No newline at end of file
app/model/prometheus/credit_callrisk_call_overview.js
0 → 100644
View file @
57f911e6
'use strict'
;
const
moment
=
require
(
'moment'
);
module
.
exports
=
app
=>
{
const
{
STRING
,
INTEGER
,
DATE
,
DECIMAL
,
TEXT
,
ENUM
}
=
app
.
Sequelize
;
const
CreditCallriskCallOverview
=
app
.
prometheusModel
.
define
(
'credit_callrisk_call_overview'
,
{
id
:
{
type
:
INTEGER
,
primaryKey
:
true
,
autoIncrement
:
true
},
report_id
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
month
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
call_time_month
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
call_fee_month
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
call_active_count_month
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
call_passive_count_month
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
call_count_month
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
// is_deleted: {
// type: INTEGER,
// allowNull: false,
// },
// updated_at: {
// type: DATE,
// allowNull: true,
// get() {
// const date = this.getDataValue('updated_at');
// return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
// },
// },
// created_at: {
// type: DATE,
// allowNull: false,
// get() {
// const date = this.getDataValue('created_at');
// return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
// },
// }
},
{
timestamps
:
false
,
tableName
:
'credit_callrisk_call_overview'
,
});
CreditCallriskCallOverview
.
one
=
async
(
data
)
=>
{
const
attributes
=
data
.
attributes
?
data
.
attributes
:
{};
const
where
=
data
.
where
?
data
.
where
:
{};
return
await
CreditCallriskCallOverview
.
findOne
({
attributes
:
attributes
,
where
:
where
,
});
}
CreditCallriskCallOverview
.
all
=
async
(
data
)
=>
{
const
attributes
=
data
.
attributes
?
data
.
attributes
:
{};
const
where
=
data
.
where
?
data
.
where
:
{};
const
order
=
data
.
order
?
data
.
order
:
[];
return
await
CreditCallriskCallOverview
.
findAll
({
attributes
:
attributes
,
where
:
where
,
order
,
});
}
CreditCallriskCallOverview
.
list
=
async
(
data
=
{})
=>
{
const
limit
=
data
.
limit
?
Number
(
data
.
limit
)
:
10
;
const
page
=
data
.
page
?
data
.
page
:
1
;
const
order
=
data
.
order
?
data
.
order
:
[];
const
attributes
=
data
.
attributes
?
data
.
attributes
:
{};
const
where
=
data
.
where
?
data
.
where
:
{};
const
condition
=
{
offset
:
(
page
-
1
)
*
limit
,
limit
,
where
:
where
,
order
:
order
,
attributes
:
attributes
,
};
const
{
count
,
rows
}
=
await
CreditCallriskCallOverview
.
findAndCountAll
(
condition
);
return
{
page
,
count
,
rows
};
}
CreditCallriskCallOverview
.
add
=
async
(
data
)
=>
{
try
{
//返回promise对象实力 instance
const
res
=
await
CreditCallriskCallOverview
.
create
(
data
);
//从promise 实例中中获得需要的id号,id 必须是自增长,而且必须主键,否则返回null
return
res
.
id
;
}
catch
(
error
)
{
throw
(
error
);
}
}
CreditCallriskCallOverview
.
edit
=
async
(
data
)
=>
{
const
where
=
data
.
where
;
const
params
=
data
.
params
;
try
{
const
res
=
await
CreditCallriskCallOverview
.
update
(
params
,
{
where
:
where
})
return
res
;
}
catch
(
error
)
{
throw
(
error
);
}
}
return
CreditCallriskCallOverview
;
};
\ No newline at end of file
app/model/prometheus/credit_callrisk_call_type.js
0 → 100644
View file @
57f911e6
'use strict'
;
const
moment
=
require
(
'moment'
);
module
.
exports
=
app
=>
{
const
{
STRING
,
INTEGER
,
DATE
,
DECIMAL
,
TEXT
,
ENUM
}
=
app
.
Sequelize
;
const
CreditCallriskCallType
=
app
.
prometheusModel
.
define
(
'credit_callrisk_call_type'
,
{
id
:
{
type
:
INTEGER
,
primaryKey
:
true
,
autoIncrement
:
true
},
report_id
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
bank_call_count
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
bank_call_time
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
bank_number_count
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
loan_call_count
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
loan_call_time
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
loan_number_count
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
court_call_count
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
collection_call_count
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
laywer_call_count
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
macao_call_count
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
c110_call_count
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
c120_call_count
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
// is_deleted: {
// type: INTEGER,
// allowNull: false,
// },
// updated_at: {
// type: DATE,
// allowNull: true,
// get() {
// const date = this.getDataValue('updated_at');
// return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
// },
// },
// created_at: {
// type: DATE,
// allowNull: false,
// get() {
// const date = this.getDataValue('created_at');
// return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
// },
// }
},
{
timestamps
:
false
,
tableName
:
'credit_callrisk_call_type'
,
});
CreditCallriskCallType
.
one
=
async
(
data
)
=>
{
const
attributes
=
data
.
attributes
?
data
.
attributes
:
{};
const
where
=
data
.
where
?
data
.
where
:
{};
return
await
CreditCallriskCallType
.
findOne
({
attributes
:
attributes
,
where
:
where
,
});
}
CreditCallriskCallType
.
all
=
async
(
data
)
=>
{
const
attributes
=
data
.
attributes
?
data
.
attributes
:
{};
const
where
=
data
.
where
?
data
.
where
:
{};
const
order
=
data
.
order
?
data
.
order
:
[];
return
await
CreditCallriskCallType
.
findAll
({
attributes
:
attributes
,
where
:
where
,
order
,
});
}
CreditCallriskCallType
.
list
=
async
(
data
=
{})
=>
{
const
limit
=
data
.
limit
?
Number
(
data
.
limit
)
:
10
;
const
page
=
data
.
page
?
data
.
page
:
1
;
const
order
=
data
.
order
?
data
.
order
:
[];
const
attributes
=
data
.
attributes
?
data
.
attributes
:
{};
const
where
=
data
.
where
?
data
.
where
:
{};
const
condition
=
{
offset
:
(
page
-
1
)
*
limit
,
limit
,
where
:
where
,
order
:
order
,
attributes
:
attributes
,
};
const
{
count
,
rows
}
=
await
CreditCallriskCallType
.
findAndCountAll
(
condition
);
return
{
page
,
count
,
rows
};
}
CreditCallriskCallType
.
add
=
async
(
data
)
=>
{
try
{
//返回promise对象实力 instance
const
res
=
await
CreditCallriskCallType
.
create
(
data
);
//从promise 实例中中获得需要的id号,id 必须是自增长,而且必须主键,否则返回null
return
res
.
id
;
}
catch
(
error
)
{
throw
(
error
);
}
}
CreditCallriskCallType
.
edit
=
async
(
data
)
=>
{
const
where
=
data
.
where
;
const
params
=
data
.
params
;
try
{
const
res
=
await
CreditCallriskCallType
.
update
(
params
,
{
where
:
where
})
return
res
;
}
catch
(
error
)
{
throw
(
error
);
}
}
return
CreditCallriskCallType
;
};
\ No newline at end of file
app/model/prometheus/credit_callrisk_report.js
0 → 100644
View file @
57f911e6
'use strict'
;
const
moment
=
require
(
'moment'
);
module
.
exports
=
app
=>
{
const
{
STRING
,
INTEGER
,
DATE
,
DECIMAL
,
TEXT
,
ENUM
}
=
app
.
Sequelize
;
const
CreditCallriskReport
=
app
.
prometheusModel
.
define
(
'credit_callrisk_report'
,
{
id
:
{
type
:
INTEGER
,
primaryKey
:
true
,
autoIncrement
:
true
},
report_no
:
{
type
:
STRING
,
allowNull
:
false
,
},
user_id
:
{
type
:
STRING
,
allowNull
:
false
,
},
app_type_id
:
{
type
:
STRING
,
allowNull
:
false
,
},
app_user_id
:
{
type
:
STRING
,
allowNull
:
false
,
},
app_id
:
{
type
:
STRING
,
allowNull
:
false
,
},
mobile
:
{
type
:
STRING
,
allowNull
:
false
,
},
operator
:
{
type
:
STRING
,
allowNull
:
false
,
},
net_time
:
{
type
:
STRING
,
allowNull
:
false
,
},
call_result_assessment
:
{
type
:
STRING
,
allowNull
:
false
,
},
// status: {
// type: ENUM('offline', 'online'),
// allowNull: false,
// },
// is_deleted: {
// type: INTEGER,
// allowNull: false,
// },
// updated_at: {
// type: DATE,
// allowNull: true,
// get() {
// const date = this.getDataValue('updated_at');
// return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
// },
// },
// created_at: {
// type: DATE,
// allowNull: false,
// get() {
// const date = this.getDataValue('created_at');
// return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
// },
// }
},
{
timestamps
:
false
,
tableName
:
'credit_callrisk_report'
,
});
CreditCallriskReport
.
one
=
async
(
data
)
=>
{
const
attributes
=
data
.
attributes
?
data
.
attributes
:
{};
const
where
=
data
.
where
?
data
.
where
:
{};
return
await
CreditCallriskReport
.
findOne
({
attributes
:
attributes
,
where
:
where
,
});
}
CreditCallriskReport
.
all
=
async
(
data
)
=>
{
const
attributes
=
data
.
attributes
?
data
.
attributes
:
{};
const
where
=
data
.
where
?
data
.
where
:
{};
const
order
=
data
.
order
?
data
.
order
:
[];
return
await
CreditCallriskReport
.
findAll
({
attributes
:
attributes
,
where
:
where
,
order
,
});
}
CreditCallriskReport
.
list
=
async
(
data
=
{})
=>
{
const
limit
=
data
.
limit
?
Number
(
data
.
limit
)
:
10
;
const
page
=
data
.
page
?
data
.
page
:
1
;
const
order
=
data
.
order
?
data
.
order
:
[];
const
attributes
=
data
.
attributes
?
data
.
attributes
:
{};
const
where
=
data
.
where
?
data
.
where
:
{};
const
condition
=
{
offset
:
(
page
-
1
)
*
limit
,
limit
,
where
:
where
,
order
:
order
,
attributes
:
attributes
,
};
const
{
count
,
rows
}
=
await
CreditCallriskReport
.
findAndCountAll
(
condition
);
return
{
page
,
count
,
rows
};
}
CreditCallriskReport
.
add
=
async
(
data
)
=>
{
try
{
//返回promise对象实力 instance
const
res
=
await
CreditCallriskReport
.
create
(
data
);
//从promise 实例中中获得需要的id号,id 必须是自增长,而且必须主键,否则返回null
return
res
.
id
;
}
catch
(
error
)
{
throw
(
error
);
}
}
CreditCallriskReport
.
edit
=
async
(
data
)
=>
{
const
where
=
data
.
where
;
const
params
=
data
.
params
;
try
{
const
res
=
await
CreditCallriskReport
.
update
(
params
,
{
where
:
where
})
return
res
;
}
catch
(
error
)
{
throw
(
error
);
}
}
return
CreditCallriskReport
;
};
\ No newline at end of file
app/model/prometheus/credit_callrisk_silence_cycle.js
0 → 100644
View file @
57f911e6
'use strict'
;
const
moment
=
require
(
'moment'
);
module
.
exports
=
app
=>
{
const
{
STRING
,
INTEGER
,
DATE
,
DECIMAL
,
TEXT
,
ENUM
}
=
app
.
Sequelize
;
const
CreditCallriskSilenceCycle
=
app
.
prometheusModel
.
define
(
'credit_callrisk_silence_cycle'
,
{
id
:
{
type
:
INTEGER
,
primaryKey
:
true
,
autoIncrement
:
true
},
report_id
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
call_behavior_id
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
silence_begin_time
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
silence_end_time
:
{
type
:
INTEGER
,
allowNull
:
false
,
},
// is_deleted: {
// type: INTEGER,
// allowNull: false,
// },
// updated_at: {
// type: DATE,
// allowNull: true,
// get() {
// const date = this.getDataValue('updated_at');
// return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
// },
// },
// created_at: {
// type: DATE,
// allowNull: false,
// get() {
// const date = this.getDataValue('created_at');
// return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
// },
// }
},
{
timestamps
:
false
,
tableName
:
'credit_callrisk_silence_cycle'
,
});
CreditCallriskSilenceCycle
.
one
=
async
(
data
)
=>
{
const
attributes
=
data
.
attributes
?
data
.
attributes
:
{};
const
where
=
data
.
where
?
data
.
where
:
{};
return
await
CreditCallriskSilenceCycle
.
findOne
({
attributes
:
attributes
,
where
:
where
,
});
}
CreditCallriskSilenceCycle
.
all
=
async
(
data
)
=>
{
const
attributes
=
data
.
attributes
?
data
.
attributes
:
{};
const
where
=
data
.
where
?
data
.
where
:
{};
const
order
=
data
.
order
?
data
.
order
:
[];
return
await
CreditCallriskSilenceCycle
.
findAll
({
attributes
:
attributes
,
where
:
where
,
order
,
});
}
CreditCallriskSilenceCycle
.
list
=
async
(
data
=
{})
=>
{
const
limit
=
data
.
limit
?
Number
(
data
.
limit
)
:
10
;
const
page
=
data
.
page
?
data
.
page
:
1
;
const
order
=
data
.
order
?
data
.
order
:
[];
const
attributes
=
data
.
attributes
?
data
.
attributes
:
{};
const
where
=
data
.
where
?
data
.
where
:
{};
const
condition
=
{
offset
:
(
page
-
1
)
*
limit
,
limit
,
where
:
where
,
order
:
order
,
attributes
:
attributes
,
};
const
{
count
,
rows
}
=
await
CreditCallriskSilenceCycle
.
findAndCountAll
(
condition
);
return
{
page
,
count
,
rows
};
}
CreditCallriskSilenceCycle
.
add
=
async
(
data
)
=>
{
try
{
//返回promise对象实力 instance
const
res
=
await
CreditCallriskSilenceCycle
.
create
(
data
);
//从promise 实例中中获得需要的id号,id 必须是自增长,而且必须主键,否则返回null
return
res
.
id
;
}
catch
(
error
)
{
throw
(
error
);
}
}
CreditCallriskSilenceCycle
.
edit
=
async
(
data
)
=>
{
const
where
=
data
.
where
;
const
params
=
data
.
params
;
try
{
const
res
=
await
CreditCallriskSilenceCycle
.
update
(
params
,
{
where
:
where
})
return
res
;
}
catch
(
error
)
{
throw
(
error
);
}
}
return
CreditCallriskSilenceCycle
;
};
\ No newline at end of file
app/router/credit.js
View file @
57f911e6
...
@@ -9,7 +9,8 @@ module.exports = app => {
...
@@ -9,7 +9,8 @@ module.exports = app => {
//我的信用-个人通话风险
//我的信用-个人通话风险
router
.
get
(
'/callrisk/report'
,
'credit.callrisk.getCallriskReport'
);
router
.
get
(
'/callrisk/report/:report_no'
,
'credit.callrisk.getReport'
);
//获取报告信息
router
.
post
(
'/callrisk/query'
,
'credit.callrisk.queryCallRisk'
);
//查询个人通话信息
};
};
app/service/credit/callrisk.js
View file @
57f911e6
This diff is collapsed.
Click to expand it.
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