Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
foc_manage
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
首航-临时账号
foc_manage
Commits
f62245ea
Commit
f62245ea
authored
Aug 30, 2021
by
姚镇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
论证单号bug修改,导出用户通话录音
parent
59cb69d9
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
1038 additions
and
19 deletions
+1038
-19
verifyForm.jsp
WebContent/WEB-INF/views/modules/airline/verifyForm.jsp
+67
-0
soundRecordingList.jsp
WebContent/WEB-INF/views/modules/contact/soundRecordingList.jsp
+77
-6
VerifyDao.xml
resources/mappings/modules/airline/VerifyDao.xml
+11
-0
SoundRecordingDao.xml
resources/mappings/modules/contact/SoundRecordingDao.xml
+204
-0
CrudDao.java
src/com/ejweb/core/persistence/CrudDao.java
+8
-0
CrudService.java
src/com/ejweb/core/service/CrudService.java
+14
-0
TimeUtils.java
src/com/ejweb/core/utils/TimeUtils.java
+34
-1
VerifyDao.java
src/com/ejweb/modules/airline/dao/VerifyDao.java
+1
-0
VerifyUpdateUserDao.java
src/com/ejweb/modules/airline/dao/VerifyUpdateUserDao.java
+1
-0
VerifyService.java
src/com/ejweb/modules/airline/service/VerifyService.java
+5
-1
VerifyController.java
src/com/ejweb/modules/airline/web/VerifyController.java
+7
-1
SoundRecordingDao.java
src/com/ejweb/modules/contact/dao/SoundRecordingDao.java
+8
-0
ShowSoundRecordingVO.java
src/com/ejweb/modules/contact/entity/ShowSoundRecordingVO.java
+146
-0
SoundRecordingEntity.java
src/com/ejweb/modules/contact/entity/SoundRecordingEntity.java
+8
-0
SoundRecordingStatisticsInfoVO.java
src/com/ejweb/modules/contact/entity/SoundRecordingStatisticsInfoVO.java
+114
-0
SoundRecordingService.java
src/com/ejweb/modules/contact/service/SoundRecordingService.java
+270
-1
SoundRecordingController.java
src/com/ejweb/modules/contact/web/SoundRecordingController.java
+63
-9
No files found.
WebContent/WEB-INF/views/modules/airline/verifyForm.jsp
View file @
f62245ea
...
...
@@ -14,6 +14,61 @@
messages
:
{
},
submitHandler
:
function
(
form
){
var
reg
=
/
[
,;'
\\]
+/g
;
//var textReg = /^[A-Z0-9a-z]{1,15}$/;
var
verifNo
=
$
(
"#verifNo"
).
val
();
var
routeNo
=
$
(
"#routeNo"
).
val
();
var
operateUser
=
$
(
"#operateUser"
).
val
();
var
flightNo
=
$
(
"#flightNo"
).
val
();
var
reason
=
$
(
"#reason"
).
val
();
var
flag
=
false
;
if
(
reg
.
test
(
verifNo
)){
alert
(
"不能输入英文 , + ; '
\\
5种符号"
)
flag
=
true
;
}
else
if
(
reg
.
test
(
routeNo
)){
alert
(
"不能输入英文 , + ; '
\\
5种符号"
)
flag
=
true
;
}
else
if
(
reg
.
test
(
operateUser
)){
alert
(
"不能输入英文 , + ; '
\\
5种符号"
)
flag
=
true
;
}
else
if
(
reg
.
test
(
flightNo
)){
alert
(
"不能输入英文 , + ; '
\\
5种符号"
)
flag
=
true
;
}
else
if
(
reg
.
test
(
reason
)){
alert
(
"不能输入英文 , + ; '
\\
5种符号"
)
flag
=
true
;
}
if
(
flag
){
return
;
}
var
expr1
=
/select/
;
var
expr2
=
/update/
;
var
expr3
=
/delete/
;
var
expr4
=
/insert/
;
if
(
expr1
.
test
(
verifNo
)
||
expr2
.
test
(
verifNo
)
||
expr3
.
test
(
verifNo
)
||
expr4
.
test
(
verifNo
)){
alert
(
"不能包含sql关键字(select,update,delete,insert)"
)
return
;
}
if
(
expr1
.
test
(
routeNo
)
||
expr2
.
test
(
routeNo
)
||
expr3
.
test
(
routeNo
)
||
expr4
.
test
(
routeNo
)){
alert
(
"不能包含sql关键字(select,update,delete,insert)"
)
return
;
}
if
(
expr1
.
test
(
operateUser
)
||
expr2
.
test
(
operateUser
)
||
expr3
.
test
(
operateUser
)
||
expr4
.
test
(
operateUser
)){
alert
(
"不能包含sql关键字(select,update,delete,insert)"
)
return
;
}
if
(
expr1
.
test
(
flightNo
)
||
expr2
.
test
(
flightNo
)
||
expr3
.
test
(
flightNo
)
||
expr4
.
test
(
flightNo
)){
alert
(
"不能包含sql关键字(select,update,delete,insert)"
)
return
;
}
if
(
expr1
.
test
(
reason
)
||
expr2
.
test
(
reason
)
||
expr3
.
test
(
reason
)
||
expr4
.
test
(
reason
)){
alert
(
"不能包含sql关键字(select,update,delete,insert)"
)
return
;
}
loading
(
'正在提交,请稍等...'
);
form
.
submit
();
},
...
...
@@ -27,6 +82,18 @@
}
}
});
function
regStr
(
str
)
{
var
expr1
=
/select/
;
var
expr2
=
/update/
;
var
expr3
=
/delete/
;
var
expr4
=
/insert/
;
if
(
expr1
.
test
(
str
)
||
expr2
.
test
(
str
)
||
expr3
.
test
(
str
)
||
expr4
.
test
(
str
)){
alert
(
"不能包含sql关键字(select,update,delete,insert)"
)
return
false
;
}
}
});
</script>
</head>
...
...
WebContent/WEB-INF/views/modules/contact/soundRecordingList.jsp
View file @
f62245ea
...
...
@@ -6,13 +6,59 @@
<title>
通话录音管理
</title>
<meta
name=
"decorator"
content=
"default"
/>
<script
type=
"text/javascript"
>
/*每次刷新列表页面,都会关闭加载框*/
//console.log('重新进图页面');
var
flag
=
'refresh'
;
if
(
flag
==
'refresh'
){
closeLoading
();
}
function
page
(
n
,
s
)
{
if
(
n
)
$
(
"#pageNo"
).
val
(
n
);
if
(
s
)
$
(
"#pageSize"
).
val
(
s
);
$
(
"#searchForm"
).
attr
(
"action"
,
"${ctx}/contact/soundRecording/newList"
);
$
(
"#searchForm"
).
submit
();
loading
(
"正在加载..请稍后"
);
return
false
;
}
function
exportInfo
()
{
var
begTime
=
$
(
"#beginTime"
).
val
();
var
endTime
=
$
(
"#endTime"
).
val
();
if
(
!
endTime
){
alert
(
"请选择结束时间"
);
return
;
}
var
day
=
timeInterval
(
begTime
,
endTime
);
if
(
day
>=
7
){
alert
(
"想要导出数据的时间范围不能大于7天"
);
return
;
}
top
.
$
.
jBox
.
confirm
(
"确认要导出用户数据吗?"
,
"系统提示"
,
function
(
v
,
h
,
f
){
if
(
v
==
"ok"
){
$
(
"#searchForm"
).
attr
(
"action"
,
"${ctx}/contact/soundRecording/exportNewList"
);
$
(
"#searchForm"
).
submit
();
loading
(
"请耐心等待导出完成...提示会在5s后自动关闭"
);
setTimeout
(
function
()
{
closeLoading
();
},
5000
)
}
},{
buttonsFocus
:
1
});
top
.
$
(
'.jbox-body .jbox-icon'
).
css
(
'top'
,
'55px'
);
}
function
timeInterval
(
beginTime
,
endTime
)
{
let
start
=
new
Date
(
beginTime
).
getTime
();
// 开始时间
let
end
=
new
Date
(
endTime
).
getTime
();
// 结束时间
var
day
=
Math
.
floor
((
end
-
start
)
/
1000
/
60
/
60
/
24
);
// 天数
return
day
;
}
</script>
</head>
<body>
...
...
@@ -42,21 +88,46 @@
<form:input
path=
"acceptNo"
htmlEscape=
"false"
maxlength=
"100"
class=
"input-medium"
/>
</li>
<li>
<label>
通话状态:
</label>
<select
id=
"endStatus"
class=
'endStatus'
name=
"endStatus"
maxlength=
"100"
style=
"width:177px;"
>
<option
value =
""
<
c:if
test=
"${endStatus == ''}"
>
selected="selected"
</c:if>
>请选择通话类型
</option>
<option
value =
"SUCCESS"
<
c:if
test=
"${endStatus == 'SUCCESS'}"
>
selected="selected"
</c:if>
>通话成功
</option>
<option
value=
"FAILD"
<
c:if
test=
"${endStatus == 'FAILD'}"
>
selected="selected"
</c:if>
>未接听
</option>
<option
value=
"INIT"
<
c:if
test=
"${endStatus == 'INIT'}"
>
selected="selected"
</c:if>
>占线未接听
</option>
</select>
</li>
<li>
<label>
开始时间:
</label>
<input
name=
"beginTime"
value=
"${soundRecordingEntity.beginTime}"
type=
"text"
readonly=
"readonly"
maxlength=
"20"
class=
"Wdate input-medium"
<input
id=
'beginTime'
name=
"beginTime"
value=
"${soundRecordingEntity.beginTime}"
type=
"text"
readonly=
"readonly"
maxlength=
"20"
class=
"Wdate input-medium"
onclick=
"WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});"
/>
<
%
--
<
form:input
path=
"beginTime"
htmlEscape=
"false"
maxlength=
"100"
class=
"input-medium"
/>
--%>
<
%
--
onclick=
"WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'endTime\',{d:-7})||\'1900-01-01\'}' ,maxDate: '#F{$dp.$D(\'endTime\')||\'2099-12-31\'}'});"
/>
--%>
</li>
<li>
<label>
结束时间:
</label>
<input
name=
"endTime"
value=
"${soundRecordingEntity.endTime}"
type=
"text"
readonly=
"readonly"
maxlength=
"20"
class=
"Wdate input-medium"
<input
id=
'endTime'
name=
"endTime"
value=
"${soundRecordingEntity.endTime}"
type=
"text"
readonly=
"readonly"
maxlength=
"20"
class=
"Wdate input-medium"
onclick=
"WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});"
/>
<
%
--
<
form:input
path=
"endTime"
htmlEscape=
"false"
maxlength=
"100"
class=
"input-medium"
/>
--%>
<
%
--
onclick=
"WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'beginTime\')||\'1900-01-01\'}' ,maxDate: '#F{$dp.$D(\'beginTime\',{d:+7})||\'2099-12-31\'}'});"
/>
--%>
</li>
<li
class=
"btns"
>
<input
id=
"btnSubmit"
class=
"btn btn-primary"
type=
"submit"
value=
"查询"
onclick=
"return page();"
/>
</li>
<li
class=
"btns"
>
&
nbsp
<input
id=
"btnExport"
class=
"btn btn-primary"
type=
"button"
value=
"导出"
onclick=
"exportInfo()"
/>
</li>
<li
class=
"clearfix"
></li>
</ul>
</form:form>
...
...
@@ -86,12 +157,12 @@
<td>
${record.beginTime }
</td>
<td>
${record.endTime }
</td>
<td>
${record.duration }
</td>
<!--
<!--
<td>${record.result == 'FAILD' ? '通话失败' : '通话成功'}</td>
-->
<td><c:if
test=
"${empty record.downloadUrl and record.result
ne 'FAILD'}"
>
通话失败
</c:if>
<c:if
test=
"${empty record.downloadUrl and record.result
ne 'UNLISTEN'}"
>
未接听
</c:if>
<c:if
test=
"${not empty record.downloadUrl}"
>
通话成功
</c:if></td>
<td><c:if
test=
"${empty record.downloadUrl and record.result
eq 'FAILD'}"
>
未接听
</c:if>
<c:if
test=
"${empty record.downloadUrl and record.result
eq 'INIT'}"
>
占线
未接听
</c:if>
<c:if
test=
"${not empty record.downloadUrl
and record.result eq 'SUCCESS'
}"
>
通话成功
</c:if></td>
<td><c:if
test=
"${not empty record.downloadUrl}"
><a
href=
"${record.downloadUrl}"
>
下载
</a></c:if></td>
</tr>
</c:forEach>
...
...
resources/mappings/modules/airline/VerifyDao.xml
View file @
f62245ea
...
...
@@ -136,6 +136,17 @@
AND a.verif_no=#{verifNo}
</if>
</select>
<select
id=
"findOldVerifNo"
resultType=
"java.lang.String"
>
SELECT a.verif_no
FROM foc_airline_verify a
where a.del_flag = #{DEL_FLAG_NORMAL}
<if
test=
"verifNo!= null and verifNo!=''"
>
AND a.id=#{id}
</if>
limit 0,1
</select>
<select
id=
"findAllList"
resultType=
"com.ejweb.modules.airline.entity.VerifyEntity"
>
SELECT a.verif_no as verifNo,
a.id as verifId,
...
...
resources/mappings/modules/contact/SoundRecordingDao.xml
View file @
f62245ea
...
...
@@ -126,4 +126,207 @@
and ap.username=#{acceptName}
and ac.start_time=#{endTime}
</select>
<select
id=
"findNewList"
resultType=
"com.ejweb.modules.contact.entity.SoundRecordingEntity"
>
SELECT
create_phone AS callNo,ac.create_name AS callName,ap.phone AS acceptNo,ap.username AS acceptName,
ac.start_time AS beginTime, ac.end_time AS endTime, ac.download_url ,ac.duration,end_status AS result
FROM foc_sound_records ac
LEFT JOIN foc_sound_phones ap ON ac.id=ap.record_id
where
ac.end_status in('SUCCESS','INIT','FAILD')
<if
test=
"seatList.size() > 0"
>
and (ac.create_by in
<foreach
item=
"item"
collection=
"seatList"
separator=
","
open=
"("
close=
")"
index=
""
>
#{item.id}
</foreach>
or
ap.user_id in
<foreach
item=
"item"
collection=
"seatList"
separator=
","
open=
"("
close=
")"
index=
""
>
#{item.id}
</foreach>
)
</if>
<if
test=
"callNo != null and callNo != ''"
>
AND ac.create_phone LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{callNo}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{callNo}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{callNo}, '%')
</if>
</if>
<if
test=
"callName != null and callName != ''"
>
AND ac.create_name LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{callName}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{callName}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{callName}, '%')
</if>
</if>
<if
test=
"acceptNo != null and acceptNo != ''"
>
AND ap.phone LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{acceptNo}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{acceptNo}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{acceptNo}, '%')
</if>
</if>
<if
test=
'acceptName != null and acceptName != ""'
>
AND ap.username LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{acceptName}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{acceptName}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{acceptName}, '%')
</if>
</if>
<if
test=
'endStatus !=null and endStatus!= ""'
>
AND ac.end_status = #{endStatus}
</if>
<if
test=
'beginTime != null and beginTime != ""'
>
AND ac.start_time
<
= #{endTime} and ac.start_time
>
= #{beginTime}
AND ac.start_time
>
#{beginTime}
</if>
<if
test=
'endTime != null and endTime != ""'
>
AND ( ac.end_time
<
#{endTime} OR ac.end_time is NULL)
</if>
ORDER BY beginTime DESC
</select>
<select
id=
"findNewRecordingList"
resultType=
"com.ejweb.modules.contact.entity.SoundRecordingEntity"
>
SELECT
create_phone AS callNo,ac.create_name AS callName,ap.phone AS acceptNo,ap.username AS acceptName,
ac.start_time AS beginTime, ac.end_time AS endTime, ac.download_url ,ac.duration,end_status AS result
FROM foc_sound_records ac
LEFT JOIN foc_sound_phones ap ON ac.id=ap.record_id
where
ac.create_name=#{callName}
and ap.username=#{acceptName}
and ac.start_time=#{endTime}
</select>
<select
id=
"getListShowInfo"
resultType=
"com.ejweb.modules.contact.entity.ShowSoundRecordingVO"
>
SELECT
ac.create_phone AS callNo,
ac.create_name AS callName,
ap.phone AS acceptNo,
ap.username AS acceptName,
concat(ifnull(ac.create_phone,''),'-',ifnull(ap.phone,'')) as tempCode,
count(ac.create_phone) as callTotalNum
FROM foc_sound_records ac
LEFT JOIN foc_sound_phones ap ON ac.id=ap.record_id
where
ac.end_status in('SUCCESS','INIT','FAILD')
<if
test=
"seatList.size() > 0"
>
and (ac.create_by in
<foreach
item=
"item"
collection=
"seatList"
separator=
","
open=
"("
close=
")"
index=
""
>
#{item.id}
</foreach>
or
ap.user_id in
<foreach
item=
"item"
collection=
"seatList"
separator=
","
open=
"("
close=
")"
index=
""
>
#{item.id}
</foreach>
)
</if>
<if
test=
"callNo != null and callNo != ''"
>
AND ac.create_phone LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{callNo}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{callNo}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{callNo}, '%')
</if>
</if>
<if
test=
"callName != null and callName != ''"
>
AND ac.create_name LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{callName}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{callName}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{callName}, '%')
</if>
</if>
<if
test=
"acceptNo != null and acceptNo != ''"
>
AND ap.phone LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{acceptNo}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{acceptNo}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{acceptNo}, '%')
</if>
</if>
<if
test=
'acceptName != null and acceptName != ""'
>
AND ap.username LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{acceptName}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{acceptName}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{acceptName}, '%')
</if>
</if>
<if
test=
'endStatus !=null and endStatus!= ""'
>
AND ac.end_status = #{endStatus}
</if>
<if
test=
'beginTime != null and beginTime != ""'
>
AND ac.start_time
<
= #{endTime} and ac.start_time
>
= #{beginTime}
AND ac.start_time
>
#{beginTime}
</if>
<if
test=
'endTime != null and endTime != ""'
>
AND ( ac.end_time
<
#{endTime} OR ac.end_time is NULL)
</if>
group by ac.create_phone,ap.phone
ORDER BY ac.start_time desc
</select>
<select
id=
"getListStatisticsInfo"
resultType=
"com.ejweb.modules.contact.entity.SoundRecordingStatisticsInfoVO"
>
SELECT
create_phone AS callNo,
ac.create_name AS callName,
ap.phone AS acceptNo,
ap.username AS acceptName,
ac.start_time as beginTime,
ac.end_time as endTime,
ac.duration,
ac.end_status as result,
concat(ifnull(ac.create_phone,''),'-',ifnull(ap.phone,'')) as tempCode
FROM foc_sound_records ac
LEFT JOIN foc_sound_phones ap ON ac.id=ap.record_id
where
ac.end_status in('SUCCESS','INIT','FAILD')
<if
test=
"seatList.size() > 0"
>
and (ac.create_by in
<foreach
item=
"item"
collection=
"seatList"
separator=
","
open=
"("
close=
")"
index=
""
>
#{item.id}
</foreach>
or
ap.user_id in
<foreach
item=
"item"
collection=
"seatList"
separator=
","
open=
"("
close=
")"
index=
""
>
#{item.id}
</foreach>
)
</if>
<if
test=
"callNo != null and callNo != ''"
>
AND ac.create_phone LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{callNo}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{callNo}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{callNo}, '%')
</if>
</if>
<if
test=
"callName != null and callName != ''"
>
AND ac.create_name LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{callName}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{callName}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{callName}, '%')
</if>
</if>
<if
test=
"acceptNo != null and acceptNo != ''"
>
AND ap.phone LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{acceptNo}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{acceptNo}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{acceptNo}, '%')
</if>
</if>
<if
test=
'acceptName != null and acceptName != ""'
>
AND ap.username LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{acceptName}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{acceptName}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{acceptName}, '%')
</if>
</if>
<if
test=
'endStatus !=null and endStatus!= ""'
>
AND ac.end_status = #{endStatus}
</if>
<if
test=
'beginTime != null and beginTime != ""'
>
AND ac.start_time
<
= #{endTime} and ac.start_time
>
= #{beginTime}
AND ac.start_time
>
#{beginTime}
</if>
<if
test=
'endTime != null and endTime != ""'
>
AND ( ac.end_time
<
#{endTime} OR ac.end_time is NULL)
</if>
ORDER BY ac.start_time desc
</select>
</mapper>
\ No newline at end of file
src/com/ejweb/core/persistence/CrudDao.java
View file @
f62245ea
...
...
@@ -35,6 +35,14 @@ public interface CrudDao<T> extends BaseDao {
* @return
*/
public
List
<
T
>
findList
(
T
entity
);
/**
* 查询数据列表,如果需要分页,请设置分页对象,如:entity.setPage(new Page<T>());
* 2021/8/9新加的接口。和上面的findList有区别
* @param entity
* @return
*/
public
List
<
T
>
findNewList
(
T
entity
);
/**
* 查询所有数据列表
...
...
src/com/ejweb/core/service/CrudService.java
View file @
f62245ea
...
...
@@ -5,8 +5,10 @@ package com.ejweb.core.service;
import
java.util.List
;
import
com.ejweb.modules.aircraft.entity.AircraftEntity
;
import
com.ejweb.modules.chat.entity.GroupChatEntity
;
import
com.ejweb.modules.chat.entity.GroupMemberEntity
;
import
com.ejweb.modules.contact.entity.SoundRecordingEntity
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -68,6 +70,18 @@ public abstract class CrudService<D extends CrudDao<T>, T extends DataEntity<T>>
}
/**
* 通话录音管理新的查询分页数据
* @param page 分页对象
* @param entity
* @return
*/
public
Page
<
T
>
findNewPage
(
Page
<
T
>
page
,
T
entity
)
{
entity
.
setPage
(
page
);
page
.
setList
(
dao
.
findNewList
(
entity
));
return
page
;
}
/**
* 保存数据(插入或更新)
* @param entity
*/
...
...
src/com/ejweb/core/utils/TimeUtils.java
View file @
f62245ea
...
...
@@ -3,8 +3,12 @@
*/
package
com
.
ejweb
.
core
.
utils
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.apache.commons.lang3.time.DateFormatUtils
;
...
...
@@ -320,5 +324,33 @@ public class TimeUtils {
}
return
true
;
}
/**
* 计算2个时间相隔几天
* @param beginTime
* @param endTime
* @return
*/
public
static
Map
<
String
,
Long
>
timeInterval
(
String
beginTime
,
String
endTime
)
throws
ParseException
{
Map
<
String
,
Long
>
map
=
new
HashMap
<>();
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd hh:mm:ss"
);
Long
beginDate
=
format
.
parse
(
beginTime
).
getTime
();
Long
endDate
=
format
.
parse
(
endTime
).
getTime
();
// 得到2个时间的时间之差(s/秒)
Long
timeIntervalNum
=
(
endDate
-
beginDate
)
/
1000
;
Long
day
;
Long
hour
;
day
=
timeIntervalNum
/
(
60
*
60
*
24
);
hour
=
(
timeIntervalNum
-
(
day
*
(
60
*
60
*
24
)))
/
(
60
*
60
);
map
.
put
(
"day"
,
day
);
map
.
put
(
"hour"
,
hour
);
return
map
;
}
public
static
void
main
(
String
[]
args
)
throws
ParseException
{
TimeUtils
.
timeInterval
(
"2021-08-17 00:00:00"
,
"2021-08-20 15:00:00"
);
}
}
\ No newline at end of file
src/com/ejweb/modules/airline/dao/VerifyDao.java
View file @
f62245ea
...
...
@@ -10,6 +10,7 @@ public interface VerifyDao extends CrudDao<VerifyEntity>{
public
VerifyEntity
getverifyByVerifNo
(
VerifyEntity
verifyEntity
);
public
List
<
VerifyEntity
>
findValidator
(
VerifyEntity
verifyEntity
);
public
List
<
VerifyEntity
>
findverifNo
(
VerifyEntity
verifyEntity
);
public
String
findOldVerifNo
(
VerifyEntity
verifyEntity
);
public
VerifyEntity
getConnect
(
VerifyEntity
verifyEntity
);
public
VerifyEntity
getVerify
(
String
id
);
public
VerifyEntity
get2
(
String
id
);
...
...
src/com/ejweb/modules/airline/dao/VerifyUpdateUserDao.java
View file @
f62245ea
...
...
@@ -4,6 +4,7 @@ import com.ejweb.core.persistence.CrudDao;
import
com.ejweb.modules.airline.entity.VerifyEntity
;
import
com.ejweb.modules.airline.entity.VerifyUpdateUserEntity
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.poi.ss.formula.functions.T
;
import
java.util.List
;
...
...
src/com/ejweb/modules/airline/service/VerifyService.java
View file @
f62245ea
...
...
@@ -128,10 +128,14 @@ public class VerifyService extends CrudService<VerifyDao, VerifyEntity> {
public
String
saveVerify
(
VerifyEntity
verifyEntity
)
{
String
verifNo
=
verifyEntity
.
getVerifNo
();
if
(
null
!=
verifNo
&&
""
!=
verifNo
)
{
String
oldVerifNo
=
verifyDao
.
findOldVerifNo
(
verifyEntity
);
List
<
VerifyEntity
>
validator
=
verifyDao
.
findverifNo
(
verifyEntity
);
if
(
validator
.
size
()
!=
0
)
{
if
(!
oldVerifNo
.
equals
(
verifyEntity
.
getVerifNo
())
&&
validator
.
size
()
!=
0
)
{
return
"1"
;
}
/*if (validator.size() != 0) {
return "1";
}*/
}
VerifyUpdateUserEntity
vue
=
new
VerifyUpdateUserEntity
();
VerifyEntity
verifyDao2
=
verifyDao
.
get2
(
verifyEntity
.
getId
());
...
...
src/com/ejweb/modules/airline/web/VerifyController.java
View file @
f62245ea
...
...
@@ -30,6 +30,7 @@ import javax.servlet.http.HttpServletResponse;
import
javax.validation.ConstraintViolationException
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Objects
;
/**
...
...
@@ -59,7 +60,12 @@ public class VerifyController extends BaseController {
VerifyEntity
verifyEntity
=
null
;
if
(
StringUtils
.
isNotBlank
(
id
))
{
verifyEntity
=
verifyService
.
get
(
id
);
LOG
.
info
(
verifyEntity
.
getVerifNo
());
if
(!
Objects
.
isNull
(
verifyEntity
)){
LOG
.
info
(
verifyEntity
.
getVerifNo
());
}
else
{
LOG
.
info
(
"未获取到相关论证数据"
);
}
}
if
(
verifyEntity
==
null
)
{
LOG
.
info
(
"未获取到相关论证数据"
);
...
...
src/com/ejweb/modules/contact/dao/SoundRecordingDao.java
View file @
f62245ea
...
...
@@ -4,11 +4,19 @@ import java.util.List;
import
com.ejweb.core.persistence.CrudDao
;
import
com.ejweb.core.persistence.annotation.MyBatisDao
;
import
com.ejweb.modules.contact.entity.ShowSoundRecordingVO
;
import
com.ejweb.modules.contact.entity.SoundRecordingEntity
;
import
com.ejweb.modules.contact.entity.SoundRecordingStatisticsInfoVO
;
@MyBatisDao
public
interface
SoundRecordingDao
extends
CrudDao
<
SoundRecordingEntity
>
{
List
<
SoundRecordingEntity
>
findRecordingList
(
SoundRecordingEntity
entityTmp
);
List
<
SoundRecordingEntity
>
findNewRecordingList
(
SoundRecordingEntity
entityTmp
);
List
<
ShowSoundRecordingVO
>
getListShowInfo
(
SoundRecordingEntity
entityTmp
);
List
<
SoundRecordingStatisticsInfoVO
>
getListStatisticsInfo
(
SoundRecordingEntity
entityTmp
);
}
src/com/ejweb/modules/contact/entity/ShowSoundRecordingVO.java
0 → 100644
View file @
f62245ea
package
com
.
ejweb
.
modules
.
contact
.
entity
;
/**
* @author yz
* @since 2021-08-10
*/
public
class
ShowSoundRecordingVO
{
//@ApiModelProperty("呼叫方电话")
private
String
callNo
;
//@ApiModelProperty("呼叫方名称")
private
String
callName
;
//@ApiModelProperty("接收方电话")
private
String
acceptNo
;
//@ApiModelProperty("接收方名称")
private
String
acceptName
;
//@ApiModelProperty("呼叫总次数")
private
Integer
callTotalNum
;
//@ApiModelProperty("未接听次数")
private
Integer
noAnswerNum
;
//@ApiModelProperty("未接听时间")
private
String
noAnswerDuration
;
//@ApiModelProperty("占线未接听次数")
private
Integer
initNum
;
//@ApiModelProperty("占线未接听时间")
private
String
initTime
;
//@ApiModelProperty("通话成功时间")
private
String
succeedDuration
;
//@ApiModelProperty("通话成功次数")
private
Integer
succeedNum
;
// 临时code,由callNo-acceptNo组合而成
private
String
tempCode
;
public
String
getCallNo
()
{
return
callNo
;
}
public
void
setCallNo
(
String
callNo
)
{
this
.
callNo
=
callNo
;
}
public
String
getCallName
()
{
return
callName
;
}
public
void
setCallName
(
String
callName
)
{
this
.
callName
=
callName
;
}
public
String
getAcceptNo
()
{
return
acceptNo
;
}
public
void
setAcceptNo
(
String
acceptNo
)
{
this
.
acceptNo
=
acceptNo
;
}
public
String
getAcceptName
()
{
return
acceptName
;
}
public
void
setAcceptName
(
String
acceptName
)
{
this
.
acceptName
=
acceptName
;
}
public
Integer
getCallTotalNum
()
{
return
callTotalNum
;
}
public
void
setCallTotalNum
(
Integer
callTotalNum
)
{
this
.
callTotalNum
=
callTotalNum
;
}
public
Integer
getNoAnswerNum
()
{
return
noAnswerNum
;
}
public
void
setNoAnswerNum
(
Integer
noAnswerNum
)
{
this
.
noAnswerNum
=
noAnswerNum
;
}
public
String
getNoAnswerDuration
()
{
return
noAnswerDuration
;
}
public
void
setNoAnswerDuration
(
String
noAnswerDuration
)
{
this
.
noAnswerDuration
=
noAnswerDuration
;
}
public
Integer
getInitNum
()
{
return
initNum
;
}
public
void
setInitNum
(
Integer
initNum
)
{
this
.
initNum
=
initNum
;
}
public
String
getInitTime
()
{
return
initTime
;
}
public
void
setInitTime
(
String
initTime
)
{
this
.
initTime
=
initTime
;
}
public
String
getSucceedDuration
()
{
return
succeedDuration
;
}
public
void
setSucceedDuration
(
String
succeedDuration
)
{
this
.
succeedDuration
=
succeedDuration
;
}
public
Integer
getSucceedNum
()
{
return
succeedNum
;
}
public
void
setSucceedNum
(
Integer
succeedNum
)
{
this
.
succeedNum
=
succeedNum
;
}
public
String
getTempCode
()
{
return
tempCode
;
}
public
void
setTempCode
(
String
tempCode
)
{
this
.
tempCode
=
tempCode
;
}
@Override
public
String
toString
()
{
return
"ShowSoundRecordingVO{"
+
"callNo='"
+
callNo
+
'\''
+
", callName='"
+
callName
+
'\''
+
", acceptNo='"
+
acceptNo
+
'\''
+
", acceptName='"
+
acceptName
+
'\''
+
", callTotalNum="
+
callTotalNum
+
", noAnswerNum="
+
noAnswerNum
+
", noAnswerDuration='"
+
noAnswerDuration
+
'\''
+
", initNum="
+
initNum
+
", initTime='"
+
initTime
+
'\''
+
", succeedDuration='"
+
succeedDuration
+
'\''
+
", succeedNum="
+
succeedNum
+
'}'
;
}
}
src/com/ejweb/modules/contact/entity/SoundRecordingEntity.java
View file @
f62245ea
...
...
@@ -24,6 +24,7 @@ public class SoundRecordingEntity extends DataEntity<SoundRecordingEntity> {
private
String
duration
;
private
String
result
;
private
String
downloadUrl
;
private
String
endStatus
;
private
List
<
SeatEntity
>
seatList
;
public
String
getCallNo
()
{
return
callNo
;
...
...
@@ -129,5 +130,12 @@ public class SoundRecordingEntity extends DataEntity<SoundRecordingEntity> {
this
.
b
=
b
;
}
public
String
getEndStatus
()
{
return
endStatus
;
}
public
void
setEndStatus
(
String
endStatus
)
{
this
.
endStatus
=
endStatus
;
}
}
src/com/ejweb/modules/contact/entity/SoundRecordingStatisticsInfoVO.java
0 → 100644
View file @
f62245ea
package
com
.
ejweb
.
modules
.
contact
.
entity
;
/**
* @author yz
* @since 2021-08-10
*/
public
class
SoundRecordingStatisticsInfoVO
{
private
String
callNo
;
private
String
callName
;
private
String
acceptNo
;
private
String
acceptName
;
private
String
beginTime
;
private
String
endTime
;
private
String
duration
;
private
String
result
;
// 临时code,由callNo-acceptNo组合而成
private
String
tempCode
;
public
String
getCallNo
()
{
return
callNo
;
}
public
void
setCallNo
(
String
callNo
)
{
this
.
callNo
=
callNo
;
}
public
String
getCallName
()
{
return
callName
;
}
public
void
setCallName
(
String
callName
)
{
this
.
callName
=
callName
;
}
public
String
getAcceptNo
()
{
return
acceptNo
;
}
public
void
setAcceptNo
(
String
acceptNo
)
{
this
.
acceptNo
=
acceptNo
;
}
public
String
getAcceptName
()
{
return
acceptName
;
}
public
void
setAcceptName
(
String
acceptName
)
{
this
.
acceptName
=
acceptName
;
}
public
String
getBeginTime
()
{
return
beginTime
;
}
public
void
setBeginTime
(
String
beginTime
)
{
this
.
beginTime
=
beginTime
;
}
public
String
getEndTime
()
{
return
endTime
;
}
public
void
setEndTime
(
String
endTime
)
{
this
.
endTime
=
endTime
;
}
public
String
getDuration
()
{
return
duration
;
}
public
void
setDuration
(
String
duration
)
{
this
.
duration
=
duration
;
}
public
String
getResult
()
{
return
result
;
}
public
void
setResult
(
String
result
)
{
this
.
result
=
result
;
}
public
String
getTempCode
()
{
return
tempCode
;
}
public
void
setTempCode
(
String
tempCode
)
{
this
.
tempCode
=
tempCode
;
}
@Override
public
String
toString
()
{
return
"SoundRecordingStatisticsInfoVO{"
+
"callNo='"
+
callNo
+
'\''
+
", callName='"
+
callName
+
'\''
+
", acceptNo='"
+
acceptNo
+
'\''
+
", acceptName='"
+
acceptName
+
'\''
+
", beginTime='"
+
beginTime
+
'\''
+
", endTime='"
+
endTime
+
'\''
+
", duration='"
+
duration
+
'\''
+
", result='"
+
result
+
'\''
+
'}'
;
}
}
src/com/ejweb/modules/contact/service/SoundRecordingService.java
View file @
f62245ea
...
...
@@ -6,13 +6,26 @@ import com.ejweb.core.persistence.Page;
import
com.ejweb.core.service.CrudService
;
import
com.ejweb.core.utils.StringUtils
;
import
com.ejweb.modules.contact.dao.SoundRecordingDao
;
import
com.ejweb.modules.contact.entity.ShowSoundRecordingVO
;
import
com.ejweb.modules.contact.entity.SoundRecordingEntity
;
import
com.ejweb.modules.contact.entity.SoundRecordingResponseEntity
;
import
com.ejweb.modules.contact.entity.SoundRecordingStatisticsInfoVO
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.google.gson.Gson
;
import
org.apache.poi.hssf.usermodel.HSSFCellStyle
;
import
org.apache.poi.ss.usermodel.CellStyle
;
import
org.apache.poi.ss.usermodel.IndexedColors
;
import
org.apache.poi.xssf.usermodel.*
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
javax.servlet.ServletOutputStream
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.net.URLEncoder
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -71,7 +84,263 @@ public class SoundRecordingService extends CrudService<SoundRecordingDao, SoundR
}
public
List
<
SoundRecordingEntity
>
findRecordingList
(
SoundRecordingEntity
entityTmp
)
{
// TODO Auto-generated method stub
return
dao
.
findRecordingList
(
entityTmp
);
}
public
List
<
SoundRecordingEntity
>
findNewRecordingList
(
SoundRecordingEntity
entityTmp
)
{
return
dao
.
findNewRecordingList
(
entityTmp
);
}
public
List
<
ShowSoundRecordingVO
>
getListShowInfo
(
SoundRecordingEntity
entityTmp
)
{
return
dao
.
getListShowInfo
(
entityTmp
);
}
public
List
<
SoundRecordingStatisticsInfoVO
>
getListStatisticsInfo
(
SoundRecordingEntity
entityTmp
)
{
return
dao
.
getListStatisticsInfo
(
entityTmp
);
}
/**
* 整理未接听次数和未接听时间
* FAILD表示未接听
*
* @param objs 用来接收处理成功后的数据,并且最终展示的数据
* @param list 所有的数据,包括需要处理的重复行
*/
public
void
faildNumAndTime
(
List
<
ShowSoundRecordingVO
>
objs
,
List
<
SoundRecordingStatisticsInfoVO
>
list
)
{
// 存放唯一的未接听次数
Map
<
String
,
Integer
>
mapNum
=
new
HashMap
<>(
16
);
// 存放唯一的未接听时间
Map
<
String
,
String
>
mapTime
=
new
HashMap
<>(
16
);
for
(
SoundRecordingStatisticsInfoVO
vo
:
list
)
{
if
(
vo
.
getResult
().
equals
(
"FAILD"
)
&&
mapNum
.
containsKey
(
vo
.
getTempCode
()))
{
// FAILD数据重复进入
mapNum
.
put
(
vo
.
getTempCode
(),
mapNum
.
get
(
vo
.
getTempCode
())
+
1
);
String
oldTime
=
mapTime
.
get
(
vo
.
getTempCode
());
String
strTime
=
vo
.
getBeginTime
().
substring
(
0
,
19
)
+
"~"
+
vo
.
getEndTime
().
substring
(
0
,
19
);
if
(
oldTime
.
equals
(
""
))
{
mapTime
.
put
(
vo
.
getTempCode
(),
strTime
);
continue
;
}
String
newTime
=
oldTime
+
" , "
+
strTime
;
mapTime
.
put
(
vo
.
getTempCode
(),
newTime
);
}
else
if
(
vo
.
getResult
().
equals
(
"FAILD"
))
{
// FAILD数据第一次进入map容器
mapNum
.
put
(
vo
.
getTempCode
(),
1
);
String
strTime
=
vo
.
getBeginTime
().
substring
(
0
,
19
)
+
"~"
+
vo
.
getEndTime
().
substring
(
0
,
19
);
mapTime
.
put
(
vo
.
getTempCode
(),
strTime
);
}
else
{
// 前一次faild状态,第二次非Faild进入
if
(
mapNum
.
containsKey
(
vo
.
getTempCode
()))
{
continue
;
}
else
{
// 非FAILD进入
mapNum
.
put
(
vo
.
getTempCode
(),
0
);
mapTime
.
put
(
vo
.
getTempCode
(),
""
);
}
}
}
for
(
ShowSoundRecordingVO
vo
:
objs
)
{
if
(
mapNum
.
containsKey
(
vo
.
getTempCode
()))
{
vo
.
setNoAnswerNum
(
mapNum
.
get
(
vo
.
getTempCode
()));
vo
.
setNoAnswerDuration
(
mapTime
.
get
(
vo
.
getTempCode
()));
}
}
}
/**
* 占线未接听时间和占线未接听次数
* init表示占线未接听
*
* @param objs 用来接收处理成功后的数据,并且最终展示的数据
* @param list 所有的数据,包括需要处理的重复行
*/
public
void
initNumAndTime
(
List
<
ShowSoundRecordingVO
>
objs
,
List
<
SoundRecordingStatisticsInfoVO
>
list
)
{
// 存放唯一的占线未接听次数
Map
<
String
,
Integer
>
mapNum
=
new
HashMap
<>(
16
);
// 存放唯一的占线未接听时间
Map
<
String
,
String
>
mapTime
=
new
HashMap
<>(
16
);
for
(
SoundRecordingStatisticsInfoVO
vo
:
list
)
{
if
(
vo
.
getResult
().
equals
(
"INIT"
)
&&
mapNum
.
containsKey
(
vo
.
getTempCode
()))
{
// INIT数据重复进入
mapNum
.
put
(
vo
.
getTempCode
(),
mapNum
.
get
(
vo
.
getTempCode
())
+
1
);
String
oldTime
=
mapTime
.
get
(
vo
.
getTempCode
());
String
strTime
=
vo
.
getBeginTime
().
substring
(
0
,
19
)
+
"~"
+
vo
.
getEndTime
().
substring
(
0
,
19
);
if
(
oldTime
.
equals
(
""
))
{
mapTime
.
put
(
vo
.
getTempCode
(),
strTime
);
continue
;
}
String
newTime
=
oldTime
+
" , "
+
strTime
;
mapTime
.
put
(
vo
.
getTempCode
(),
newTime
);
}
else
if
(
vo
.
getResult
().
equals
(
"INIT"
))
{
// INIT数据第一次进入
mapNum
.
put
(
vo
.
getTempCode
(),
1
);
String
strTime
=
vo
.
getBeginTime
().
substring
(
0
,
19
)
+
"~"
+
vo
.
getEndTime
().
substring
(
0
,
19
);
mapTime
.
put
(
vo
.
getTempCode
(),
strTime
);
}
else
{
// 前一次INIT状态,第二次非INIT进入
if
(
mapNum
.
containsKey
(
vo
.
getTempCode
()))
{
continue
;
}
else
{
// 非INIT数据
mapNum
.
put
(
vo
.
getTempCode
(),
0
);
mapTime
.
put
(
vo
.
getTempCode
(),
""
);
}
}
}
for
(
ShowSoundRecordingVO
vo
:
objs
)
{
if
(
mapNum
.
containsKey
(
vo
.
getTempCode
()))
{
vo
.
setInitNum
(
mapNum
.
get
(
vo
.
getTempCode
()));
vo
.
setInitTime
(
mapTime
.
get
(
vo
.
getTempCode
()));
}
}
}
/**
* 通话成功时长和次数
* SUCCESS表示通话成功
*
* @param objs 用来接收处理成功后的数据,并且最终展示的数据
* @param list 所有的数据,包括需要处理的重复行
*/
public
void
successNumAndTime
(
List
<
ShowSoundRecordingVO
>
objs
,
List
<
SoundRecordingStatisticsInfoVO
>
list
)
{
// 存放唯一的占线未接听次数
Map
<
String
,
Integer
>
mapNum
=
new
HashMap
<>(
16
);
// 存放唯一的占线未接听时间
Map
<
String
,
String
>
mapTime
=
new
HashMap
<>(
16
);
for
(
SoundRecordingStatisticsInfoVO
vo
:
list
)
{
if
(
vo
.
getResult
().
equals
(
"SUCCESS"
)
&&
mapNum
.
containsKey
(
vo
.
getTempCode
()))
{
// SUCCESS数据重复进入
mapNum
.
put
(
vo
.
getTempCode
(),
mapNum
.
get
(
vo
.
getTempCode
())
+
1
);
String
oldTime
=
mapTime
.
get
(
vo
.
getTempCode
());
String
strTime
=
vo
.
getBeginTime
().
substring
(
0
,
19
)
+
"~"
+
vo
.
getEndTime
().
substring
(
0
,
19
);
if
(
oldTime
.
equals
(
""
))
{
mapTime
.
put
(
vo
.
getTempCode
(),
strTime
);
continue
;
}
String
newTime
=
oldTime
+
" , "
+
strTime
;
mapTime
.
put
(
vo
.
getTempCode
(),
newTime
);
}
else
if
(
vo
.
getResult
().
equals
(
"SUCCESS"
))
{
// SUCCESS数据第一次进入
mapNum
.
put
(
vo
.
getTempCode
(),
1
);
String
strTime
=
vo
.
getBeginTime
().
substring
(
0
,
19
)
+
"~"
+
vo
.
getEndTime
().
substring
(
0
,
19
);
mapTime
.
put
(
vo
.
getTempCode
(),
strTime
);
}
else
{
// 前一次SUCCESS状态,第二次非SUCCESS进入
if
(
mapNum
.
containsKey
(
vo
.
getTempCode
()))
{
continue
;
}
else
{
// 非SUCCESS数据
mapNum
.
put
(
vo
.
getTempCode
(),
0
);
mapTime
.
put
(
vo
.
getTempCode
(),
""
);
}
}
}
for
(
ShowSoundRecordingVO
vo
:
objs
)
{
if
(
mapNum
.
containsKey
(
vo
.
getTempCode
()))
{
vo
.
setSucceedNum
(
mapNum
.
get
(
vo
.
getTempCode
()));
vo
.
setSucceedDuration
(
mapTime
.
get
(
vo
.
getTempCode
()));
}
}
}
/**
* 导出统计数据
*
* @param objs
* @throws IOException
*/
public
void
exportExcel
(
List
<
ShowSoundRecordingVO
>
objs
,
HttpServletResponse
response
,
SoundRecordingEntity
soundRecordingEntity
)
throws
IOException
,
ParseException
{
SimpleDateFormat
transformFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyyMMddHHmmss"
);
String
timeName
=
format
.
format
(
transformFormat
.
parse
(
soundRecordingEntity
.
getBeginTime
()))
+
'~'
+
format
.
format
(
transformFormat
.
parse
(
soundRecordingEntity
.
getEndTime
()));
timeName
=
timeName
+
"用户录音统计.xls"
;
timeName
=
URLEncoder
.
encode
(
timeName
,
"UTF-8"
);
timeName
=
timeName
.
replaceAll
(
"\\+"
,
"%20"
);
// 设置响应输出的头类型
response
.
setHeader
(
"content-Type"
,
"application/vnd.ms-excel;charset=urf-8"
);
// 下载文件的默认名称
//response.setHeader("Content-Disposition", "attachment;filename="+ time +"用户录音统计表.xls");
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
timeName
);
XSSFWorkbook
workbook
=
new
XSSFWorkbook
();
XSSFSheet
sheet
=
workbook
.
createSheet
(
"统计表"
);
XSSFRow
row
=
sheet
.
createRow
(
0
);
// 单元格样式
XSSFCellStyle
cellStyle
=
workbook
.
createCellStyle
();
cellStyle
.
setFillForegroundColor
(
IndexedColors
.
YELLOW
.
getIndex
());
cellStyle
.
setAlignment
(
HSSFCellStyle
.
ALIGN_CENTER
);
cellStyle
.
setFillPattern
(
CellStyle
.
ALIGN_CENTER
);
sheet
.
setDefaultColumnWidth
(
15
);
// 表头
XSSFCell
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
"呼叫方名称"
);
cell
.
setCellStyle
(
cellStyle
);
XSSFCell
cell1
=
row
.
createCell
(
1
);
cell1
.
setCellValue
(
"呼叫方电话"
);
cell1
.
setCellStyle
(
cellStyle
);
XSSFCell
cell2
=
row
.
createCell
(
2
);
cell2
.
setCellValue
(
"接收方名称"
);
cell2
.
setCellStyle
(
cellStyle
);
XSSFCell
cell3
=
row
.
createCell
(
3
);
cell3
.
setCellValue
(
"接收方电话"
);
cell3
.
setCellStyle
(
cellStyle
);
XSSFCell
cell4
=
row
.
createCell
(
4
);
cell4
.
setCellValue
(
"呼入总次数"
);
cell4
.
setCellStyle
(
cellStyle
);
XSSFCell
cell5
=
row
.
createCell
(
5
);
cell5
.
setCellValue
(
"无人接听次数"
);
cell5
.
setCellStyle
(
cellStyle
);
XSSFCell
cell6
=
row
.
createCell
(
6
);
cell6
.
setCellValue
(
"无人接听时间"
);
cell6
.
setCellStyle
(
cellStyle
);
XSSFCell
cell7
=
row
.
createCell
(
7
);
cell7
.
setCellValue
(
"占线未接听次数"
);
cell7
.
setCellStyle
(
cellStyle
);
XSSFCell
cell8
=
row
.
createCell
(
8
);
cell8
.
setCellValue
(
"占线未接听时间"
);
cell8
.
setCellStyle
(
cellStyle
);
XSSFCell
cell9
=
row
.
createCell
(
9
);
cell9
.
setCellValue
(
"通话成功次数"
);
cell9
.
setCellStyle
(
cellStyle
);
XSSFCell
cell10
=
row
.
createCell
(
10
);
cell10
.
setCellValue
(
"通话成功时间"
);
cell10
.
setCellStyle
(
cellStyle
);
// 内容
for
(
int
i
=
1
;
i
<=
objs
.
size
();
i
++)
{
XSSFRow
newRow
=
sheet
.
createRow
(
i
);
newRow
.
createCell
(
0
).
setCellValue
(
objs
.
get
(
i
-
1
).
getCallName
());
newRow
.
createCell
(
1
).
setCellValue
(
objs
.
get
(
i
-
1
).
getCallNo
());
newRow
.
createCell
(
2
).
setCellValue
(
objs
.
get
(
i
-
1
).
getAcceptName
());
newRow
.
createCell
(
3
).
setCellValue
(
objs
.
get
(
i
-
1
).
getAcceptNo
());
newRow
.
createCell
(
4
).
setCellValue
(
objs
.
get
(
i
-
1
).
getCallTotalNum
());
newRow
.
createCell
(
5
).
setCellValue
(
objs
.
get
(
i
-
1
).
getNoAnswerNum
());
newRow
.
createCell
(
6
).
setCellValue
(
objs
.
get
(
i
-
1
).
getNoAnswerDuration
());
newRow
.
createCell
(
7
).
setCellValue
(
objs
.
get
(
i
-
1
).
getInitNum
());
newRow
.
createCell
(
8
).
setCellValue
(
objs
.
get
(
i
-
1
).
getInitTime
());
newRow
.
createCell
(
9
).
setCellValue
(
objs
.
get
(
i
-
1
).
getSucceedNum
());
newRow
.
createCell
(
10
).
setCellValue
(
objs
.
get
(
i
-
1
).
getSucceedDuration
());
}
// 创建文件输出流
ServletOutputStream
outputStream
=
response
.
getOutputStream
();
workbook
.
write
(
outputStream
);
outputStream
.
flush
();
//关闭资源
outputStream
.
close
();
}
}
src/com/ejweb/modules/contact/web/SoundRecordingController.java
View file @
f62245ea
...
...
@@ -4,7 +4,9 @@ import com.ejweb.core.base.BaseController;
import
com.ejweb.core.conf.GConstants
;
import
com.ejweb.core.persistence.Page
;
import
com.ejweb.modules.contact.entity.SeatEntity
;
import
com.ejweb.modules.contact.entity.ShowSoundRecordingVO
;
import
com.ejweb.modules.contact.entity.SoundRecordingEntity
;
import
com.ejweb.modules.contact.entity.SoundRecordingStatisticsInfoVO
;
import
com.ejweb.modules.contact.service.SoundRecordingService
;
import
com.ejweb.modules.contact.service.UserProfileServce
;
import
com.ejweb.modules.sys.entity.Role
;
...
...
@@ -19,6 +21,7 @@ import org.springframework.stereotype.Controller;
import
org.springframework.ui.Model
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.servlet.mvc.support.RedirectAttributes
;
import
javax.servlet.ServletOutputStream
;
...
...
@@ -27,9 +30,8 @@ import javax.servlet.http.HttpServletResponse;
import
java.io.*
;
import
java.net.HttpURLConnection
;
import
java.net.URL
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.text.ParseException
;
import
java.util.*
;
/**
* 录音管理Controller
...
...
@@ -74,7 +76,7 @@ public class SoundRecordingController extends BaseController {
soundRecordingEntity
.
setEndTime
(
DateFormatUtils
.
format
(
current
,
"yyyy-MM-dd 23:59:59"
));
}
soundRecordingEntity
.
setSeatList
(
list
);
Page
<
SoundRecordingEntity
>
page
=
soundRecordingService
.
findPage
(
new
Page
<
SoundRecordingEntity
>(
request
,
response
),
soundRecordingEntity
);
Page
<
SoundRecordingEntity
>
page
=
soundRecordingService
.
find
New
Page
(
new
Page
<
SoundRecordingEntity
>(
request
,
response
),
soundRecordingEntity
);
if
(
page
!=
null
&&
!
CollectionUtils
.
isEmpty
(
page
.
getList
()))
{
...
...
@@ -87,21 +89,23 @@ public class SoundRecordingController extends BaseController {
if
(
StringUtils
.
isNotBlank
(
entityTmp
.
getDownloadUrl
()))
{
entityTmp
.
setDownloadUrl
(
entityTmp
.
getDownloadUrl
().
replaceAll
(
".{4,5}://.*?(/|\\\\)"
,
proxy
).
replaceAll
(
"\\\\"
,
"/"
));
}
List
<
SoundRecordingEntity
>
entity
=
soundRecordingService
.
find
RecordingList
(
entityTmp
);
/*List<SoundRecordingEntity> entity = soundRecordingService.findNew
RecordingList(entityTmp);
if(entity.size()>0){
templist.add(entityTmp);
}
}
*/
}
if
(
templist
.
size
()>
0
){
/*
if(templist.size()>0){
page.getList().removeAll(templist);
}
}
*/
}
model
.
addAttribute
(
"page"
,
page
);
model
.
addAttribute
(
"endStatus"
,
soundRecordingEntity
.
getEndStatus
());
model
.
addAttribute
(
"flag"
,
"success"
);
return
"modules/contact/soundRecordingList"
;
}
@RequiresPermissions
(
"im:soundRecording:view"
)
@RequestMapping
(
value
=
"download"
)
public
void
download
(
HttpServletRequest
request
,
HttpServletResponse
response
,
SoundRecordingEntity
soundRecordingEntity
,
RedirectAttributes
redirectAttributes
)
{
public
void
download
(
Model
model
,
HttpServletRequest
request
,
HttpServletResponse
response
,
SoundRecordingEntity
soundRecordingEntity
,
RedirectAttributes
redirectAttributes
)
{
if
(
soundRecordingEntity
==
null
||
StringUtils
.
isBlank
(
soundRecordingEntity
.
getDownloadUrl
()))
{
addMessage
(
redirectAttributes
,
"下载路径有问题"
);
return
;
...
...
@@ -137,4 +141,54 @@ public class SoundRecordingController extends BaseController {
}
}
}
/**
* 导出查询的数据,并且做一个整理
*/
@RequiresPermissions
(
"im:soundRecording:view"
)
@RequestMapping
(
value
=
"exportNewList"
,
method
=
RequestMethod
.
POST
)
public
void
exportNewList
(
Model
model
,
HttpServletRequest
request
,
HttpServletResponse
response
,
SoundRecordingEntity
soundRecordingEntity
)
throws
IOException
{
User
user
=
UserUtils
.
getUser
();
//查询录音权限
List
<
SeatEntity
>
list
=
userProfileService
.
getSeatList
(
user
.
getId
());
if
(
StringUtils
.
isEmpty
(
soundRecordingEntity
.
getBeginTime
())){
Date
current
=
new
Date
();
Date
startTime
=
new
Date
(
current
.
getTime
()-
36
*
60
*
60
*
1000
);
soundRecordingEntity
.
setBeginTime
(
DateFormatUtils
.
format
(
startTime
,
"yyyy-MM-dd HH:mm:ss"
));
soundRecordingEntity
.
setEndTime
(
DateFormatUtils
.
format
(
current
,
"yyyy-MM-dd 23:59:59"
));
}
String
beginTime
=
soundRecordingEntity
.
getBeginTime
();
String
endTime
=
soundRecordingEntity
.
getEndTime
();
soundRecordingEntity
.
setSeatList
(
list
);
// 展示数据
List
<
ShowSoundRecordingVO
>
showList
=
soundRecordingService
.
getListShowInfo
(
soundRecordingEntity
);
// 待统计数据
List
<
SoundRecordingStatisticsInfoVO
>
StatisticsList
=
soundRecordingService
.
getListStatisticsInfo
(
soundRecordingEntity
);
// 整理 未接听次数-未接听时间
soundRecordingService
.
faildNumAndTime
(
showList
,
StatisticsList
);
// 整理 占线未接听次数-占线未接听时间
soundRecordingService
.
initNumAndTime
(
showList
,
StatisticsList
);
// 整理 通话成功次数-通话成功时间
soundRecordingService
.
successNumAndTime
(
showList
,
StatisticsList
);
// 导出统计表
try
{
soundRecordingService
.
exportExcel
(
showList
,
response
,
soundRecordingEntity
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
}
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