Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yunjiao-admin
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
童普新
yunjiao-admin
Commits
c32f2a9e
Commit
c32f2a9e
authored
Jul 26, 2024
by
tongpuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加录音下载解冻
parent
a41631ba
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
361 additions
and
6 deletions
+361
-6
ExGridLoad.java
src/main/java/com/app/framework/core/support/view/grid/ExGridLoad.java
+4
-3
CallRecordController.java
src/main/java/com/app/ydl/ydl/controller/CallRecordController.java
+122
-0
CallRecordDao.java
src/main/java/com/app/ydl/ydl/dao/CallRecordDao.java
+40
-0
CallRecordService.java
src/main/java/com/app/ydl/ydl/service/CallRecordService.java
+36
-0
CallRecordView.java
src/main/java/com/app/ydl/ydl/view/CallRecordView.java
+17
-0
application-dev.yml
src/main/resources/application-dev.yml
+9
-3
application-prod.yml
src/main/resources/application-prod.yml
+6
-0
list.js
src/main/resources/templates/admin/business/call_record/js/list.js
+79
-0
list.html
src/main/resources/templates/admin/business/call_record/list.html
+48
-0
ydl_admin.db
src/main/resources/ydl_admin.db
+0
-0
No files found.
src/main/java/com/app/framework/core/support/view/grid/ExGridLoad.java
View file @
c32f2a9e
...
...
@@ -45,10 +45,11 @@ public class ExGridLoad {
* @param page 分页对象
*/
public
static
ExGridLoad
wrapExGridLoad
(
Collection
<?>
list
,
Paging
page
)
{
Long
totalCount
=
page
.
getTotalCount
();
if
(
totalCount
==
null
||
totalCount
<=
0
)
totalCount
=
new
Long
(
list
.
size
());
if
(
page
.
getTotalCount
()
==
null
||
page
.
getTotalCount
()
<=
0
)
{
page
.
setTotalCount
(
new
Long
(
list
.
size
()));
}
ExGridLoad
exGridLoad
=
new
ExGridLoad
();
exGridLoad
.
setTotalCount
(
totalCount
);
exGridLoad
.
setTotalCount
(
page
.
getTotalCount
()
);
exGridLoad
.
setTotalPage
(
page
.
getTotalPage
());
exGridLoad
.
setResult
(
list
);
return
exGridLoad
;
...
...
src/main/java/com/app/ydl/ydl/controller/CallRecordController.java
0 → 100644
View file @
c32f2a9e
package
com
.
app
.
ydl
.
ydl
.
controller
;
import
cn.hutool.core.collection.ListUtil
;
import
com.app.framework.core.support.controller.CrudBaseControllerSupport
;
import
com.app.framework.core.support.view.form.AjaxResult
;
import
com.app.framework.core.support.view.grid.Paging
;
import
com.app.ydl.ydl.service.CallRecordService
;
import
com.app.ydl.ydl.view.CallRecordView
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.servlet.ModelAndView
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 录音文件下载、解冻
*/
@Slf4j
@Controller
@RequestMapping
(
"/call/call_record"
)
public
class
CallRecordController
extends
CrudBaseControllerSupport
<
CallRecordView
>
{
@Resource
CallRecordService
callRecordService
;
private
boolean
isStandardOrder
(
String
id
)
{
if
(
id
.
startsWith
(
"97"
)
||
id
.
startsWith
(
"99"
))
{
return
true
;
}
return
false
;
}
/**
* 查询列表的具体实现
* 请求:list
*
* @param request HttpServletRequest
* @param view 查询条件
* @param paging 分页条件
* @return 查询结果
*/
@Override
public
List
<
CallRecordView
>
list
(
HttpServletRequest
request
,
CallRecordView
view
,
Paging
paging
)
{
List
<
CallRecordView
>
list
=
null
;
if
(
StringUtils
.
isNotBlank
(
view
.
getOrderId
()))
{
if
(
this
.
isStandardOrder
(
view
.
getOrderId
()))
{
return
callRecordService
.
getByStandardOrderId
(
Long
.
parseLong
(
view
.
getOrderId
()));
}
else
{
list
=
callRecordService
.
getByRelationId
(
view
.
getOrderId
());
}
}
else
if
(
StringUtils
.
isNotBlank
(
view
.
getRelationId
()))
{
if
(
this
.
isStandardOrder
(
view
.
getRelationId
()))
{
return
callRecordService
.
getByStandardOrderServiceId
(
Long
.
parseLong
(
view
.
getRelationId
()));
}
else
{
list
=
callRecordService
.
getByRelationId
(
view
.
getRelationId
());
}
}
else
if
(
view
.
getId
()
!=
null
)
{
CallRecordView
byId
=
callRecordService
.
getById
(
view
.
getId
());
if
(
this
.
isStandardOrder
(
byId
.
getRelationId
()))
{
return
callRecordService
.
getByStandardOrderAndCallRecordId
(
view
.
getId
());
}
else
{
list
=
ListUtil
.
toList
(
byId
);
}
}
if
(
list
==
null
)
{
list
=
new
ArrayList
<>();
}
for
(
CallRecordView
callRecordView
:
list
)
{
callRecordView
.
setOrderId
(
callRecordView
.
getRelationId
());
}
return
list
;
}
/**
* 保存记录的具体实现
* 请求:saveEntity
*
* @param request HttpServletRequest
* @param entity 实体
* @return 影响结果数
*/
@Override
public
AjaxResult
saveEntity
(
HttpServletRequest
request
,
CallRecordView
entity
)
{
return
AjaxResult
.
wrap
(
false
);
}
/**
* 删除记录,根据Id 具体实现
* 请求:deleteById 参数oid
* 请求:batchDelete 参数oid数组
*
* @param request HttpServletRequest
* @param oids 实体
* @return 影响结果数
*/
@Override
public
AjaxResult
batchDelete
(
HttpServletRequest
request
,
Long
oids
[])
{
return
AjaxResult
.
wrap
(
false
);
}
@RequestMapping
(
value
=
"/golist"
)
public
ModelAndView
info
(
HttpServletRequest
request
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
return
new
ModelAndView
(
"admin/business/call_record/list.html"
,
result
);
}
@RequestMapping
(
value
=
"/thaw"
)
@ResponseBody
public
AjaxResult
thaw
(
String
recordUrl
)
{
log
.
info
(
"call_record.thaw:{}"
,
recordUrl
);
return
AjaxResult
.
wrap
(
true
);
}
}
src/main/java/com/app/ydl/ydl/dao/CallRecordDao.java
0 → 100644
View file @
c32f2a9e
package
com
.
app
.
ydl
.
ydl
.
dao
;
import
com.app.ydl.ydl.view.CallRecordView
;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
org.apache.ibatis.annotations.Select
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Repository
@DS
(
"ydl"
)
public
interface
CallRecordDao
{
@Select
(
"SELECT r.id, r.relation_id, r.record_url FROM ydl.call_record r WHERE r.id = #{id}"
)
CallRecordView
getById
(
Long
id
);
@Select
(
"SELECT r.id, r.relation_id, r.record_url FROM ydl.call_record r "
+
"WHERE r.record_url != '' AND r.record_url != 'no' "
+
"AND r.relation_id = #{relationId}"
)
List
<
CallRecordView
>
getByRelationId
(
String
relationId
);
@Select
(
"SELECT sos.standard_order_id AS order_id, sos.id AS relation_id, r.record_url, r.id FROM ydl.call_record r "
+
"LEFT JOIN ydl.standard_order_service sos ON sos.id = r.relation_id "
+
"WHERE r.record_url != '' AND r.record_url != 'no' "
+
"AND sos.id = #{orderServiceId} ;"
)
List
<
CallRecordView
>
getByStandardOrderServiceId
(
Long
orderServiceId
);
@Select
(
"SELECT sos.standard_order_id AS order_id, sos.id AS relation_id, r.record_url, r.id FROM ydl.call_record r "
+
"LEFT JOIN ydl.standard_order_service sos ON sos.id = r.relation_id "
+
"WHERE r.record_url != '' AND r.record_url != 'no' "
+
"AND sos.standard_order_id = #{orderId} ;"
)
List
<
CallRecordView
>
getByStandardOrderId
(
Long
orderId
);
@Select
(
"SELECT sos.standard_order_id AS order_id, sos.id AS relation_id, r.record_url, r.id FROM ydl.call_record r "
+
"LEFT JOIN ydl.standard_order_service sos ON sos.id = r.relation_id "
+
"WHERE r.record_url != '' AND r.record_url != 'no' "
+
"AND r.id = #{callRecordId} ;"
)
List
<
CallRecordView
>
getByStandardOrderAndCallRecordId
(
Long
callRecordId
);
}
\ No newline at end of file
src/main/java/com/app/ydl/ydl/service/CallRecordService.java
0 → 100644
View file @
c32f2a9e
package
com
.
app
.
ydl
.
ydl
.
service
;
import
com.app.ydl.ydl.dao.CallRecordDao
;
import
com.app.ydl.ydl.view.CallRecordView
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
@Service
public
class
CallRecordService
{
@Resource
private
CallRecordDao
callRecordDao
;
public
CallRecordView
getById
(
Long
id
)
{
return
callRecordDao
.
getById
(
id
);
}
public
List
<
CallRecordView
>
getByRelationId
(
String
relationId
)
{
return
callRecordDao
.
getByRelationId
(
relationId
);
}
public
List
<
CallRecordView
>
getByStandardOrderId
(
Long
orderId
)
{
return
callRecordDao
.
getByStandardOrderId
(
orderId
);
}
public
List
<
CallRecordView
>
getByStandardOrderServiceId
(
Long
orderServiceId
)
{
return
callRecordDao
.
getByStandardOrderServiceId
(
orderServiceId
);
}
public
List
<
CallRecordView
>
getByStandardOrderAndCallRecordId
(
Long
callRecordId
)
{
return
callRecordDao
.
getByStandardOrderAndCallRecordId
(
callRecordId
);
}
}
\ No newline at end of file
src/main/java/com/app/ydl/ydl/view/CallRecordView.java
0 → 100644
View file @
c32f2a9e
package
com
.
app
.
ydl
.
ydl
.
view
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
CallRecordView
implements
Serializable
{
private
Long
id
;
private
String
relationId
;
private
String
recordUrl
;
private
String
orderId
;
}
src/main/resources/application-dev.yml
View file @
c32f2a9e
...
...
@@ -20,7 +20,7 @@ spring:
# 主库数据源
master
:
driverClassName
:
org.sqlite.JDBC
url
:
jdbc:sqlite:
:resource:
ydl_admin.db?date_string_format=yyyy-MM-dd HH:mm:ss
url
:
jdbc:sqlite:
/Users/tongpuxin/Documents/workspace/ydl/yunjiao-admin/src/main/resources/
ydl_admin.db?date_string_format=yyyy-MM-dd HH:mm:ss
username
:
root
password
:
root
# 营销数据源
...
...
@@ -30,9 +30,15 @@ spring:
username
:
ydl
password
:
tt12345
# 医疗数据源
ydl_yiliao
:
# ydl_yiliao:
# driverClassName: com.mysql.jdbc.Driver
# url: jdbc:mysql://120.26.213.52:3306/ydl_yiliao?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
# username: ydl
# password: tt12345
# ydl数据源
ydl
:
driverClassName
:
com.mysql.jdbc.Driver
url
:
jdbc:mysql://120.26.213.52:3306/ydl
_yiliao
?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
url
:
jdbc:mysql://120.26.213.52:3306/ydl?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
username
:
ydl
password
:
tt12345
druid
:
...
...
src/main/resources/application-prod.yml
View file @
c32f2a9e
...
...
@@ -35,6 +35,12 @@ spring:
# url: jdbc:mysql://rm-bp1z1072kug2190fy.mysql.rds.aliyuncs.com:3306/ydl_yiliao?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
# username: ydl_yiliao_read
# password: Yl$2304823jjY5699
# ydl数据源
ydl
:
driverClassName
:
com.mysql.jdbc.Driver
url
:
jdbc:mysql://rm-bp14n58nzawa6ykny.mysql.rds.aliyuncs.com:3306/ydl?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
username
:
ydl_yiliao
password
:
CD1V*DSV7w4!fDaAzs@&
druid
:
initial-size
:
5
max-active
:
100
...
...
src/main/resources/templates/admin/business/call_record/js/list.js
0 → 100644
View file @
c32f2a9e
/**
* 录音文件查询
*/
$
(
function
(){
AppCallRecord
=
{
Events
:
{
'click .btn'
:
function
(
e
,
value
,
row
,
index
)
{
var
event
=
$
(
e
.
target
).
data
(
'event'
);
if
(
event
==
'download'
){
AppCallRecord
.
download
(
row
);
}
else
if
(
event
==
'thaw'
){
AppCallRecord
.
thaw
(
row
);
}
}},
download
:
function
(
row
){
var
recordUrl
=
row
[
'recordUrl'
];
if
(
!
recordUrl
)
{
App
.
MsgBox
.
msg
(
"文件URL为空"
);
return
;
}
window
.
open
(
recordUrl
);
},
thaw
:
function
(
row
){
App
.
MsgBox
.
confirm
(
'确定要解冻吗'
,
function
(){
var
recordUrl
=
row
[
'recordUrl'
];
if
(
!
recordUrl
)
{
App
.
MsgBox
.
msg
(
"文件URL为空"
);
return
;
}
App
.
Ajax
.
request
({
url
:
Config
.
ROOT
+
'/call/call_record/thaw'
,
params
:
{
'recordUrl'
:
recordUrl
},
success
:
function
(
resp
){
}
});
});
},
search
:
function
()
{
$table
.
search
({
'page'
:
1
});
}
};
//初始化表格
var
$table
=
new
App
.
Table
({
url
:
Config
.
ROOT
+
'/call/call_record/list'
,
search
:
false
,
searchParamName
:
''
,
searchPlaceholder
:
''
,
columns
:[
{
field
:
'id'
,
title
:
'操作'
,
width
:
120
,
toolbar
:
'tableRowToolbar'
,
events
:
AppCallRecord
.
Events
},
{
field
:
''
,
title
:
'通话记录ID'
,
formatter
:
function
(
value
,
row
,
index
)
{
return
row
[
'id'
];
}},
{
field
:
'relationId'
,
title
:
'订单'
,
formatter
:
function
(
value
,
row
,
index
)
{
return
row
[
'orderId'
]
+
'_'
+
value
;
}},
{
field
:
'recordUrl'
,
title
:
'音频'
}
],
getQueryParam
:
function
()
{
var
search_orderId
=
$
(
'#search_orderId'
).
val
()
||
''
;
var
search_relationId
=
$
(
'#search_relationId'
).
val
()
||
''
;
var
search_callRecordId
=
$
(
'#search_callRecordId'
).
val
()
||
''
;
var
postData
=
{
'orderId'
:
search_orderId
,
'relationId'
:
search_relationId
,
'id'
:
search_callRecordId
};
return
postData
;
}
});
});
\ No newline at end of file
src/main/resources/templates/admin/business/call_record/list.html
0 → 100644
View file @
c32f2a9e
<!DOCTYPE html>
<html
lang=
"zh"
>
<head>
<
@
meta
/>
<title>
录音文件查询
</title>
<
#
include
"
admin
/
common
/
include_hplus
.
ftl
"
>
<
#
include
"
admin
/
common
/
include_form
.
ftl
"
>
<
#
include
"
admin
/
common
/
include_table
.
ftl
"
>
<script
src=
"<@contextPath/>/templates/admin/business/call_record/js/list.js"
type=
"text/javascript"
></script>
</head>
<body
class=
"gray-bg"
>
<div
class=
"wrapper wrapper-content animated fadeInRight"
>
<div
class=
"row"
>
<div
class=
"col-sm-12"
>
<div
class=
"ibox "
>
<div
class=
"ibox-content"
>
<h3>
${module.name}
</h3>
<script
type=
"text/html"
id=
"tableRowToolbar"
>
<
a
class
=
"btn btn-xs btn-primary"
data
-
event
=
"download"
>
下载
<
/a></
br
><
/br
>
<
a
class
=
"btn btn-xs btn-success"
data
-
event
=
"thaw"
>
解冻
<
/a></
br
><
/br
>
</script>
<form
role=
"form"
class=
"form-inline"
onsubmit=
"return false"
>
<div
class=
"form-group"
>
<input
type=
"text"
placeholder=
"orderId"
id=
"search_orderId"
class=
"form-control"
>
</div>
<div
class=
"form-group"
>
<input
type=
"text"
placeholder=
"relationId"
id=
"search_relationId"
class=
"form-control"
>
</div>
<div
class=
"form-group"
>
<input
type=
"text"
placeholder=
"callRecordId"
id=
"search_callRecordId"
class=
"form-control"
>
</div>
<button
class=
"btn btn-primary"
type=
"button"
onclick=
"AppCallRecord.search()"
>
搜索
</button>
</form>
<div
class=
"btn-group"
id=
"tableEventsToolbar"
role=
"group"
>
</div>
<table
id=
"tableEvents"
data-mobile-responsive=
"true"
>
</table>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
src/main/resources/ydl_admin.db
View file @
c32f2a9e
No preview for this file type
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