Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
task2.0
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
首航-临时账号
task2.0
Commits
16f7b23a
Commit
16f7b23a
authored
Jul 30, 2020
by
java-李谡
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交测试
parent
7e1470db
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
32 deletions
+21
-32
SoundRecordingEntity.java
src/com/foc/sound/entity/SoundRecordingEntity.java
+11
-0
SoundService.java
src/com/foc/sound/service/SoundService.java
+6
-28
SoundDbTaskMain.java
src/com/foc/task/SoundDbTaskMain.java
+2
-1
SoundTaskMain.java
src/com/foc/task/SoundTaskMain.java
+2
-0
Util.java
src/com/foc/util/Util.java
+0
-3
No files found.
src/com/foc/sound/entity/SoundRecordingEntity.java
View file @
16f7b23a
...
...
@@ -19,6 +19,7 @@ public class SoundRecordingEntity {
@JSONField
(
format
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
endTime
;
// 通话结束时间
private
String
result
;
// 0 通话成功 其它通话失败,未接通为通话失败
private
String
channelId
;
private
int
duration
;
// 通话时长,单位(请安科备注)
private
String
downloadUrl
;
// 录音文件下载地址
private
Long
downloadSize
=
0L
;
// 录音文件大小(byte)
...
...
@@ -145,14 +146,24 @@ public class SoundRecordingEntity {
public
String
getCallType
()
{
return
callType
;
}
public
void
setCallType
(
String
callType
)
{
this
.
callType
=
callType
;
}
public
String
getRecordId
()
{
return
recordId
;
}
public
void
setRecordId
(
String
recordId
)
{
this
.
recordId
=
recordId
;
}
public
String
getChannelId
()
{
return
channelId
;
}
public
void
setChannelId
(
String
channelId
)
{
this
.
channelId
=
channelId
;
}
}
src/com/foc/sound/service/SoundService.java
View file @
16f7b23a
...
...
@@ -428,26 +428,6 @@ public class SoundService {
*/
public
void
updateRecordsAndPhone
(
SoundRecordingEntity
entity
,
List
<
CallRecordsEntity
>
ls
,
String
flag
)
{
/*
* UserInfo callUser = new UserInfo();
* if(StringUtils.isNoneBlank(entity.getCallNo())){ callUser =
* GetIdByPhone(entity.getCallNo());
*
* if(callUser ==null){ callUser = new UserInfo(); callUser.setId("1");
* callUser.setName(entity.getCallNo()); }
*
* }else{ return; }
*
* String callId = callUser.getId()==null?"1":callUser.getId(); UserInfo
* acceptUser = new UserInfo();
* if(StringUtils.isNoneBlank(entity.getAcceptNo())){ acceptUser =
* GetIdByPhone(entity.getAcceptNo()); if(acceptUser ==null){ acceptUser
* = new UserInfo(); acceptUser.setId(""); acceptUser.setName(""); }
* }else{ return; }
*
* String acceptId = acceptUser.getId();
* if(StringUtils.isBlank(acceptId)){ acceptId=""; }
*/
if
(
StringUtils
.
isBlank
(
entity
.
getCallNo
())
||
StringUtils
.
isBlank
(
entity
.
getAcceptNo
()))
{
return
;
}
...
...
@@ -505,28 +485,22 @@ public class SoundService {
UserInfo
callUser
=
new
UserInfo
();
if
(
StringUtils
.
isNoneBlank
(
entity
.
getCallNo
()))
{
callUser
=
GetIdByPhone
(
entity
.
getCallNo
());
System
.
out
.
println
(
"主叫号码:"
+
entity
.
getCallNo
());
if
(
callUser
==
null
)
{
System
.
out
.
println
(
"未查询到主叫号码用户信息"
);
callUser
=
new
UserInfo
();
callUser
.
setId
(
"1"
);
callUser
.
setName
(
entity
.
getCallNo
());
}
System
.
out
.
println
(
"主叫号码用户信息:"
+
callUser
.
getId
());
}
else
{
return
;
}
UserInfo
acceptUser
=
new
UserInfo
();
if
(
StringUtils
.
isNoneBlank
(
entity
.
getAcceptNo
()))
{
System
.
out
.
println
(
"被叫号码:"
+
entity
.
getAcceptNo
());
acceptUser
=
GetIdByPhone
(
entity
.
getAcceptNo
());
if
(
acceptUser
==
null
)
{
System
.
out
.
println
(
"未查询到主叫号码用户信息"
);
acceptUser
=
new
UserInfo
();
acceptUser
.
setId
(
"1"
);
acceptUser
.
setName
(
entity
.
getAcceptNo
());
}
System
.
out
.
println
(
"被叫号码用户信息:"
+
acceptUser
.
getId
());
}
else
{
return
;
}
...
...
@@ -638,13 +612,17 @@ public class SoundService {
columnMap
.
put
(
"channel_type"
,
"ANKE"
);
columnMap
.
put
(
"call_type"
,
"USER"
);
columnMap
.
put
(
"user_count"
,
"2"
);
columnMap
.
put
(
"
end_status"
,
"FAILD"
);
columnMap
.
put
(
"
channel_id"
,
entity
.
getChannelId
()
);
if
(
"0"
.
equals
(
entity
.
getResult
()))
{
columnMap
.
put
(
"end_status"
,
"SUCCESS"
);
}
else
if
(
"117"
.
equals
(
entity
.
getResult
())){
columnMap
.
put
(
"end_status"
,
"FAILD"
);
}
else
if
(
"118"
.
equals
(
entity
.
getResult
())){
}
else
if
(
"118"
.
equals
(
entity
.
getResult
()))
{
if
(
"-1"
.
equals
(
entity
.
getChannelId
()))
{
columnMap
.
put
(
"end_status"
,
"INIT"
);
}
else
{
columnMap
.
put
(
"end_status"
,
"UNLISTEN"
);
}
}
columnMap
.
put
(
"create_by"
,
callUser
.
getId
());
columnMap
.
put
(
"create_name"
,
callUser
.
getName
());
...
...
src/com/foc/task/SoundDbTaskMain.java
View file @
16f7b23a
...
...
@@ -135,7 +135,8 @@ public class SoundDbTaskMain {
recordingEntity
.
setDownloadUrl
(
downLoadUrl
);
recordingEntity
.
setDownloadSize
(
rs
.
getLong
(
"filesize"
));
recordingEntity
.
setResult
(
rs
.
getString
(
"callresult"
));
recordingEntity
.
setChannelId
(
rs
.
getString
(
"chanelid"
));
System
.
out
.
println
(
"查询sql获得信道id:"
+
rs
.
getString
(
"chanelid"
));
Map
<
String
,
Object
>
row
=
new
HashMap
<>(
10
);
row
.
put
(
"id"
,
rs
.
getObject
(
"id"
));
row
.
put
(
"caller"
,
rs
.
getObject
(
"caller"
));
...
...
src/com/foc/task/SoundTaskMain.java
View file @
16f7b23a
...
...
@@ -140,6 +140,7 @@ public class SoundTaskMain {
recordingEntity
.
setDownloadUrl
(
rs
.
getString
(
"recfile"
));
recordingEntity
.
setDownloadSize
(
rs
.
getLong
(
"filesize"
));
recordingEntity
.
setResult
(
rs
.
getString
(
"callresult"
));
recordingEntity
.
setChannelId
(
rs
.
getString
(
"channelid"
));
recordingEntities
.
add
(
recordingEntity
);
System
.
out
.
println
(
"id:"
+
rs
.
getInt
(
"id"
)
+
"callNo:"
+
rs
.
getString
(
"caller"
)
...
...
@@ -149,6 +150,7 @@ public class SoundTaskMain {
+
"Duration:"
+
rs
.
getInt
(
"elapsed"
)
+
"DownloadUrl:"
+
rs
.
getString
(
"recfile"
)
+
"DownloadSize:"
+
rs
.
getLong
(
"filesize"
)
+
"ChannelId:"
+
rs
.
getLong
(
"channelid"
)
+
"Result:"
+
rs
.
getString
(
"callresult"
));
}
rs
.
close
();
...
...
src/com/foc/util/Util.java
View file @
16f7b23a
...
...
@@ -23,7 +23,6 @@ public class Util {
try
{
StringBuilder
url
=
new
StringBuilder
(
GConstants
.
getValue
(
"foc.api.url"
,
"http://127.0.0.1:8080/"
))
.
append
(
uri
);
System
.
out
.
println
(
"请求地址:"
+
url
);
JSONObject
content
=
new
JSONObject
();
content
.
put
(
"platform"
,
"PC"
);
content
.
put
(
"deviceToken"
,
""
);
...
...
@@ -38,11 +37,9 @@ public class Util {
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"content"
,
JSON
.
toJSONString
(
content
));
System
.
out
.
println
(
"content:"
+
JSON
.
toJSONString
(
content
));
String
sign
=
GlobalUtil
.
getParamsSignStr
(
GConstants
.
SIGN_PRIVATE_KEY
,
String
.
valueOf
(
params
.
get
(
"content"
)));
params
.
put
(
"sign"
,
sign
);
String
res
=
HttpClientUtil
.
doPost
(
url
.
toString
(),
params
,
"UTF-8"
);
System
.
out
.
println
(
"请求结果:"
+
res
);
if
(
res
==
null
)
{
res
=
HttpClientUtil
.
doPost
(
url
.
toString
(),
params
,
"UTF-8"
);
if
(
res
==
null
)
{
...
...
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