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
18c2ff27
Commit
18c2ff27
authored
Sep 20, 2017
by
Java-金吉宝
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重复记录
parent
1d43b2c7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
220 additions
and
141 deletions
+220
-141
SoundRecordingDao.xml
resources/mappings/modules/contact/SoundRecordingDao.xml
+129
-59
SoundRecordingDao.java
src/com/ejweb/modules/contact/dao/SoundRecordingDao.java
+14
-10
SoundRecordingService.java
src/com/ejweb/modules/contact/service/SoundRecordingService.java
+77
-72
SoundRecordingController.java
src/com/ejweb/modules/contact/web/SoundRecordingController.java
+0
-0
No files found.
resources/mappings/modules/contact/SoundRecordingDao.xml
View file @
18c2ff27
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.ejweb.modules.contact.dao.SoundRecordingDao"
>
<mapper
namespace=
"com.ejweb.modules.contact.dao.SoundRecordingDao"
>
<select
id=
"findList"
resultType=
"com.ejweb.modules.contact.entity.SoundRecordingEntity"
>
<!-- <select id="findList" resultType="com.ejweb.modules.contact.entity.SoundRecordingEntity">
SELECT CONCAT(ac.create_name,ap.username,(UNIX_TIMESTAMP(ac.end_time)-ac.duration)) as b,
select *
create_phone AS callNo,ac.create_name AS callName,ap.phone AS acceptNo,ap.username AS acceptName,
from (
ac.start_time AS beginTime, ac.end_time AS endTime, ac.download_url ,ac.duration,end_status AS result
SELECT CONCAT(ac.create_name,ap.username,(UNIX_TIMESTAMP(ac.end_time)-ac.duration)) as b,
FROM foc_sound_records ac
create_phone AS callNo,ac.create_name AS callName,ap.phone AS acceptNo,ap.username AS acceptName,
LEFT JOIN foc_sound_phones ap ON ac.id=ap.record_id
ac.start_time AS beginTime, ac.end_time AS endTime, ac.download_url ,ac.duration,end_status AS result
<where>
FROM foc_sound_records ac
ac.end_status !='INIT'
LEFT JOIN foc_sound_phones ap ON ac.id=ap.record_id
<if
test=
"seatList.size() > 0"
>
where
and (ac.create_by in
ac.end_status !='INIT'
<foreach
item=
"item"
collection=
"seatList"
separator=
","
open=
"("
close=
")"
index=
""
>
<if test="seatList.size() > 0">
#{item.id}
and (ac.create_by in
</foreach>
<foreach item="item" collection="seatList" separator="," open="(" close=")" index="">
or
#{item.id}
ap.user_id in
</foreach>
<foreach
item=
"item"
collection=
"seatList"
separator=
","
open=
"("
close=
")"
index=
""
>
or
#{item.id}
ap.user_id in
</foreach>
<foreach item="item" collection="seatList" separator="," open="(" close=")" index="">
)
#{item.id}
</if>
</foreach>
<if
test=
"callNo != null and callNo != ''"
>
)
AND ac.create_phone LIKE
</if>
<if
test=
"dbName == 'oracle'"
>
'%'||#{callNo}||'%'
</if>
<if test="callNo != null and callNo != ''">
<if
test=
"dbName == 'mssql'"
>
'%'+#{callNo}+'%'
</if>
AND ac.create_phone LIKE
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{callNo}, '%')
</if>
<if test="dbName == 'oracle'">'%'||#{callNo}||'%'</if>
</if>
<if test="dbName == 'mssql'">'%'+#{callNo}+'%'</if>
<if
test=
"callName != null and callName != ''"
>
<if test="dbName == 'mysql'">CONCAT('%', #{callNo}, '%')</if>
AND ac.create_name LIKE
</if>
<if
test=
"dbName == 'oracle'"
>
'%'||#{callName}||'%'
</if>
<if test="callName != null and callName != ''">
<if
test=
"dbName == 'mssql'"
>
'%'+#{callName}+'%'
</if>
AND ac.create_name LIKE
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{callName}, '%')
</if>
<if test="dbName == 'oracle'">'%'||#{callName}||'%'</if>
</if>
<if test="dbName == 'mssql'">'%'+#{callName}+'%'</if>
<if
test=
"acceptNo != null and acceptNo != ''"
>
<if test="dbName == 'mysql'">CONCAT('%', #{callName}, '%')</if>
AND ap.phone LIKE
</if>
<if
test=
"dbName == 'oracle'"
>
'%'||#{acceptNo}||'%'
</if>
<if test="acceptNo != null and acceptNo != ''">
<if
test=
"dbName == 'mssql'"
>
'%'+#{acceptNo}+'%'
</if>
AND ap.phone LIKE
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{acceptNo}, '%')
</if>
<if test="dbName == 'oracle'">'%'||#{acceptNo}||'%'</if>
</if>
<if test="dbName == 'mssql'">'%'+#{acceptNo}+'%'</if>
<if
test=
"acceptName != null and acceptName != ''"
>
<if test="dbName == 'mysql'">CONCAT('%', #{acceptNo}, '%')</if>
AND ap.username LIKE
</if>
<if
test=
"dbName == 'oracle'"
>
'%'||#{acceptName}||'%'
</if>
<if test='acceptName != null and acceptName != ""'>
<if
test=
"dbName == 'mssql'"
>
'%'+#{acceptName}+'%'
</if>
AND ap.username LIKE
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{acceptName}, '%')
</if>
<if test="dbName == 'oracle'">'%'||#{acceptName}||'%'</if>
</if>
<if test="dbName == 'mssql'">'%'+#{acceptName}+'%'</if>
<if
test=
"beginTime != null and beginTime != ''"
>
<if test="dbName == 'mysql'">CONCAT('%', #{acceptName}, '%')</if>
AND (ac.start_time BETWEEN #{beginTime} AND #{endTime})
</if>
<!-- AND ac.start_time <![CDATA[>]]> #{beginTime} -->
<if test='beginTime != null and beginTime != ""'>
</if>
AND ac.start_time <![CDATA[<=]]>#{endTime} and ac.start_time <![CDATA[>=]]> #{beginTime}
<if
test=
"endTime != null and endTime != ''"
>
AND ac.start_time <![CDATA[>]]> #{beginTime}
AND ( ac.end_time
<![CDATA[<]]>
#{endTime} OR ac.end_time is NULL)
</if>
</if>
<if test='endTime != null and endTime != ""'>
</where>
AND ( ac.end_time <![CDATA[<]]> #{endTime} OR ac.end_time is NULL)
group by b
</if>
ORDER BY ac.start_time desc
</select>
GROUP BY b
) er
ORDER BY beginTime DESC
</select> -->
<select
id=
"findList"
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 !='INIT'
<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=
'beginTime != null and beginTime != ""'
>
AND ac.start_time
<![CDATA[<=]]>
#{endTime} and ac.start_time
<![CDATA[>=]]>
#{beginTime}
AND ac.start_time
<![CDATA[>]]>
#{beginTime}
</if>
<if
test=
'endTime != null and endTime != ""'
>
AND ( ac.end_time
<![CDATA[<]]>
#{endTime} OR ac.end_time is NULL)
</if>
ORDER BY beginTime DESC
</select>
<select
id=
"findRecordingList"
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 !='INIT'
and ac.create_name=#{callName}
and ap.username=#{acceptName}
and ac.start_time=#{endTime}
</select>
</mapper>
</mapper>
\ No newline at end of file
src/com/ejweb/modules/contact/dao/SoundRecordingDao.java
View file @
18c2ff27
package
com
.
ejweb
.
modules
.
contact
.
dao
;
package
com
.
ejweb
.
modules
.
contact
.
dao
;
import
com.ejweb.core.persistence.CrudDao
;
import
java.util.List
;
import
com.ejweb.core.persistence.annotation.MyBatisDao
;
import
com.ejweb.modules.contact.entity.SoundRecordingEntity
;
import
com.ejweb.core.persistence.CrudDao
;
import
com.ejweb.core.persistence.annotation.MyBatisDao
;
@MyBatisDao
import
com.ejweb.modules.contact.entity.SoundRecordingEntity
;
public
interface
SoundRecordingDao
extends
CrudDao
<
SoundRecordingEntity
>
{
@MyBatisDao
}
public
interface
SoundRecordingDao
extends
CrudDao
<
SoundRecordingEntity
>
{
List
<
SoundRecordingEntity
>
findRecordingList
(
SoundRecordingEntity
entityTmp
);
}
src/com/ejweb/modules/contact/service/SoundRecordingService.java
View file @
18c2ff27
package
com
.
ejweb
.
modules
.
contact
.
service
;
package
com
.
ejweb
.
modules
.
contact
.
service
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.ejweb.core.fetcher.HttpClientUtil
;
import
com.ejweb.core.fetcher.HttpClientUtil
;
import
com.ejweb.core.persistence.Page
;
import
com.ejweb.core.persistence.Page
;
import
com.ejweb.core.service.CrudService
;
import
com.ejweb.core.service.CrudService
;
import
com.ejweb.core.utils.StringUtils
;
import
com.ejweb.core.utils.StringUtils
;
import
com.ejweb.modules.contact.dao.SoundRecordingDao
;
import
com.ejweb.modules.contact.dao.SoundRecordingDao
;
import
com.ejweb.modules.contact.entity.SoundRecordingEntity
;
import
com.ejweb.modules.contact.entity.SoundRecordingEntity
;
import
com.ejweb.modules.contact.entity.SoundRecordingResponseEntity
;
import
com.ejweb.modules.contact.entity.SoundRecordingResponseEntity
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
* 聊天记录Service
* 聊天记录Service
* @author lyw
* @author lyw
*
*
*/
*/
@Service
@Service
public
class
SoundRecordingService
extends
CrudService
<
SoundRecordingDao
,
SoundRecordingEntity
>
{
public
class
SoundRecordingService
extends
CrudService
<
SoundRecordingDao
,
SoundRecordingEntity
>
{
@Value
(
"${foc.sound.records.url}"
)
@Value
(
"${foc.sound.records.url}"
)
private
String
soundRecordingUrl
;
private
String
soundRecordingUrl
;
public
Page
<
SoundRecordingEntity
>
getPage
(
Page
<
SoundRecordingEntity
>
page
,
SoundRecordingEntity
soundRecordingEntity
)
{
public
Page
<
SoundRecordingEntity
>
getPage
(
Page
<
SoundRecordingEntity
>
page
,
SoundRecordingEntity
soundRecordingEntity
)
{
soundRecordingEntity
.
setPage
(
page
);
soundRecordingEntity
.
setPage
(
page
);
String
url
=
soundRecordingUrl
;
String
url
=
soundRecordingUrl
;
Map
<
String
,
String
>
params
=
new
HashMap
<>();
Map
<
String
,
String
>
params
=
new
HashMap
<>();
params
.
put
(
"pageNo"
,
String
.
valueOf
(
soundRecordingEntity
.
getPage
().
getPageNo
()));
params
.
put
(
"pageNo"
,
String
.
valueOf
(
soundRecordingEntity
.
getPage
().
getPageNo
()));
params
.
put
(
"pageSize"
,
String
.
valueOf
(
soundRecordingEntity
.
getPage
().
getPageSize
()));
params
.
put
(
"pageSize"
,
String
.
valueOf
(
soundRecordingEntity
.
getPage
().
getPageSize
()));
if
(
StringUtils
.
isNotBlank
(
soundRecordingEntity
.
getBeginTime
()))
{
if
(
StringUtils
.
isNotBlank
(
soundRecordingEntity
.
getBeginTime
()))
{
params
.
put
(
"beginTime"
,
soundRecordingEntity
.
getBeginTime
());
params
.
put
(
"beginTime"
,
soundRecordingEntity
.
getBeginTime
());
}
}
if
(
StringUtils
.
isNotBlank
(
soundRecordingEntity
.
getEndTime
()))
{
if
(
StringUtils
.
isNotBlank
(
soundRecordingEntity
.
getEndTime
()))
{
params
.
put
(
"endTime"
,
soundRecordingEntity
.
getEndTime
());
params
.
put
(
"endTime"
,
soundRecordingEntity
.
getEndTime
());
}
}
if
(
StringUtils
.
isNotBlank
(
soundRecordingEntity
.
getCallName
()))
{
if
(
StringUtils
.
isNotBlank
(
soundRecordingEntity
.
getCallName
()))
{
params
.
put
(
"callUserName"
,
soundRecordingEntity
.
getCallName
());
params
.
put
(
"callUserName"
,
soundRecordingEntity
.
getCallName
());
}
}
if
(
StringUtils
.
isNotBlank
(
soundRecordingEntity
.
getAcceptName
()))
{
if
(
StringUtils
.
isNotBlank
(
soundRecordingEntity
.
getAcceptName
()))
{
params
.
put
(
"acceptUserName"
,
soundRecordingEntity
.
getAcceptName
());
params
.
put
(
"acceptUserName"
,
soundRecordingEntity
.
getAcceptName
());
}
}
if
(
StringUtils
.
isNotBlank
(
soundRecordingEntity
.
getCallUserNo
()))
{
if
(
StringUtils
.
isNotBlank
(
soundRecordingEntity
.
getCallUserNo
()))
{
params
.
put
(
"callUserNo"
,
soundRecordingEntity
.
getCallUserNo
());
params
.
put
(
"callUserNo"
,
soundRecordingEntity
.
getCallUserNo
());
}
}
if
(
StringUtils
.
isNotBlank
(
soundRecordingEntity
.
getAcceptUserNo
()))
{
if
(
StringUtils
.
isNotBlank
(
soundRecordingEntity
.
getAcceptUserNo
()))
{
params
.
put
(
"acceptUserNo"
,
soundRecordingEntity
.
getAcceptUserNo
());
params
.
put
(
"acceptUserNo"
,
soundRecordingEntity
.
getAcceptUserNo
());
}
}
String
res
=
HttpClientUtil
.
doPost
(
url
,
params
,
"UTF-8"
);
String
res
=
HttpClientUtil
.
doPost
(
url
,
params
,
"UTF-8"
);
HashMap
returnResult
=
JSON
.
parseObject
(
res
,
HashMap
.
class
);
HashMap
returnResult
=
JSON
.
parseObject
(
res
,
HashMap
.
class
);
// Page<SoundRecordingEntity> pageReturnResult = new Page<>();
// Page<SoundRecordingEntity> pageReturnResult = new Page<>();
if
(
"2000"
.
equals
(
returnResult
.
get
(
"status"
)))
{
if
(
"2000"
.
equals
(
returnResult
.
get
(
"status"
)))
{
SoundRecordingResponseEntity
responseEntity
=
JSON
.
parseObject
(
returnResult
.
get
(
"data"
).
toString
(),
SoundRecordingResponseEntity
.
class
);
SoundRecordingResponseEntity
responseEntity
=
JSON
.
parseObject
(
returnResult
.
get
(
"data"
).
toString
(),
SoundRecordingResponseEntity
.
class
);
if
(
responseEntity
!=
null
)
{
if
(
responseEntity
!=
null
)
{
page
.
setCount
(
responseEntity
.
getCount
());
page
.
setCount
(
responseEntity
.
getCount
());
page
.
setList
(
responseEntity
.
getList
());
page
.
setList
(
responseEntity
.
getList
());
page
.
setPageNo
(
responseEntity
.
getPageNo
());
page
.
setPageNo
(
responseEntity
.
getPageNo
());
page
.
setPageSize
(
responseEntity
.
getPageSize
());
page
.
setPageSize
(
responseEntity
.
getPageSize
());
}
}
}
}
System
.
out
.
print
(
res
);
System
.
out
.
print
(
res
);
return
page
;
return
page
;
}
}
}
public
List
<
SoundRecordingEntity
>
findRecordingList
(
SoundRecordingEntity
entityTmp
)
{
// TODO Auto-generated method stub
return
dao
.
findRecordingList
(
entityTmp
);
}
}
src/com/ejweb/modules/contact/web/SoundRecordingController.java
View file @
18c2ff27
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