Commit 16f7b23a by java-李谡

提交测试

parent 7e1470db
...@@ -19,6 +19,7 @@ public class SoundRecordingEntity { ...@@ -19,6 +19,7 @@ public class SoundRecordingEntity {
@JSONField(format="yyyy-MM-dd HH:mm:ss") @JSONField(format="yyyy-MM-dd HH:mm:ss")
private Date endTime;// 通话结束时间 private Date endTime;// 通话结束时间
private String result;// 0 通话成功 其它通话失败,未接通为通话失败 private String result;// 0 通话成功 其它通话失败,未接通为通话失败
private String channelId;
private int duration;// 通话时长,单位(请安科备注) private int duration;// 通话时长,单位(请安科备注)
private String downloadUrl;// 录音文件下载地址 private String downloadUrl;// 录音文件下载地址
private Long downloadSize=0L;// 录音文件大小(byte) private Long downloadSize=0L;// 录音文件大小(byte)
...@@ -145,14 +146,24 @@ public class SoundRecordingEntity { ...@@ -145,14 +146,24 @@ public class SoundRecordingEntity {
public String getCallType() { public String getCallType() {
return callType; return callType;
} }
public void setCallType(String callType) { public void setCallType(String callType) {
this.callType = callType; this.callType = callType;
} }
public String getRecordId() { public String getRecordId() {
return recordId; return recordId;
} }
public void setRecordId(String recordId) { public void setRecordId(String recordId) {
this.recordId = recordId; this.recordId = recordId;
} }
public String getChannelId() {
return channelId;
}
public void setChannelId(String channelId) {
this.channelId = channelId;
}
} }
...@@ -428,26 +428,6 @@ public class SoundService { ...@@ -428,26 +428,6 @@ public class SoundService {
*/ */
public void updateRecordsAndPhone(SoundRecordingEntity entity, List<CallRecordsEntity> ls, String flag) { 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())) { if (StringUtils.isBlank(entity.getCallNo()) || StringUtils.isBlank(entity.getAcceptNo())) {
return; return;
} }
...@@ -505,28 +485,22 @@ public class SoundService { ...@@ -505,28 +485,22 @@ public class SoundService {
UserInfo callUser = new UserInfo(); UserInfo callUser = new UserInfo();
if (StringUtils.isNoneBlank(entity.getCallNo())) { if (StringUtils.isNoneBlank(entity.getCallNo())) {
callUser = GetIdByPhone(entity.getCallNo()); callUser = GetIdByPhone(entity.getCallNo());
System.out.println("主叫号码:"+entity.getCallNo());
if (callUser == null) { if (callUser == null) {
System.out.println("未查询到主叫号码用户信息");
callUser = new UserInfo(); callUser = new UserInfo();
callUser.setId("1"); callUser.setId("1");
callUser.setName(entity.getCallNo()); callUser.setName(entity.getCallNo());
} }
System.out.println("主叫号码用户信息:"+callUser.getId());
} else { } else {
return; return;
} }
UserInfo acceptUser = new UserInfo(); UserInfo acceptUser = new UserInfo();
if (StringUtils.isNoneBlank(entity.getAcceptNo())) { if (StringUtils.isNoneBlank(entity.getAcceptNo())) {
System.out.println("被叫号码:"+entity.getAcceptNo());
acceptUser = GetIdByPhone(entity.getAcceptNo()); acceptUser = GetIdByPhone(entity.getAcceptNo());
if (acceptUser == null) { if (acceptUser == null) {
System.out.println("未查询到主叫号码用户信息");
acceptUser = new UserInfo(); acceptUser = new UserInfo();
acceptUser.setId("1"); acceptUser.setId("1");
acceptUser.setName(entity.getAcceptNo()); acceptUser.setName(entity.getAcceptNo());
} }
System.out.println("被叫号码用户信息:"+acceptUser.getId());
} else { } else {
return; return;
} }
...@@ -638,13 +612,17 @@ public class SoundService { ...@@ -638,13 +612,17 @@ public class SoundService {
columnMap.put("channel_type", "ANKE"); columnMap.put("channel_type", "ANKE");
columnMap.put("call_type", "USER"); columnMap.put("call_type", "USER");
columnMap.put("user_count", "2"); columnMap.put("user_count", "2");
columnMap.put("end_status", "FAILD"); columnMap.put("channel_id", entity.getChannelId());
if ("0".equals(entity.getResult())) { if ("0".equals(entity.getResult())) {
columnMap.put("end_status", "SUCCESS"); columnMap.put("end_status", "SUCCESS");
} else if("117".equals(entity.getResult())){ } else if("117".equals(entity.getResult())){
columnMap.put("end_status", "FAILD"); 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"); columnMap.put("end_status", "INIT");
} else {
columnMap.put("end_status", "UNLISTEN");
}
} }
columnMap.put("create_by", callUser.getId()); columnMap.put("create_by", callUser.getId());
columnMap.put("create_name", callUser.getName()); columnMap.put("create_name", callUser.getName());
......
...@@ -135,7 +135,8 @@ public class SoundDbTaskMain { ...@@ -135,7 +135,8 @@ public class SoundDbTaskMain {
recordingEntity.setDownloadUrl(downLoadUrl); recordingEntity.setDownloadUrl(downLoadUrl);
recordingEntity.setDownloadSize(rs.getLong("filesize")); recordingEntity.setDownloadSize(rs.getLong("filesize"));
recordingEntity.setResult(rs.getString("callresult")); 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); Map<String, Object> row = new HashMap<>(10);
row.put("id", rs.getObject("id")); row.put("id", rs.getObject("id"));
row.put("caller", rs.getObject("caller")); row.put("caller", rs.getObject("caller"));
......
...@@ -140,6 +140,7 @@ public class SoundTaskMain { ...@@ -140,6 +140,7 @@ public class SoundTaskMain {
recordingEntity.setDownloadUrl(rs.getString("recfile")); recordingEntity.setDownloadUrl(rs.getString("recfile"));
recordingEntity.setDownloadSize(rs.getLong("filesize")); recordingEntity.setDownloadSize(rs.getLong("filesize"));
recordingEntity.setResult(rs.getString("callresult")); recordingEntity.setResult(rs.getString("callresult"));
recordingEntity.setChannelId(rs.getString("channelid"));
recordingEntities.add(recordingEntity); recordingEntities.add(recordingEntity);
System.out.println("id:" + rs.getInt("id") System.out.println("id:" + rs.getInt("id")
+ "callNo:" + rs.getString("caller") + "callNo:" + rs.getString("caller")
...@@ -149,6 +150,7 @@ public class SoundTaskMain { ...@@ -149,6 +150,7 @@ public class SoundTaskMain {
+ "Duration:" + rs.getInt("elapsed") + "Duration:" + rs.getInt("elapsed")
+ "DownloadUrl:" + rs.getString("recfile") + "DownloadUrl:" + rs.getString("recfile")
+ "DownloadSize:" + rs.getLong("filesize") + "DownloadSize:" + rs.getLong("filesize")
+ "ChannelId:" + rs.getLong("channelid")
+ "Result:" + rs.getString("callresult")); + "Result:" + rs.getString("callresult"));
} }
rs.close(); rs.close();
......
...@@ -23,7 +23,6 @@ public class Util { ...@@ -23,7 +23,6 @@ public class Util {
try { try {
StringBuilder url = new StringBuilder(GConstants.getValue("foc.api.url", "http://127.0.0.1:8080/")) StringBuilder url = new StringBuilder(GConstants.getValue("foc.api.url", "http://127.0.0.1:8080/"))
.append(uri); .append(uri);
System.out.println("请求地址:" + url);
JSONObject content = new JSONObject(); JSONObject content = new JSONObject();
content.put("platform", "PC"); content.put("platform", "PC");
content.put("deviceToken", ""); content.put("deviceToken", "");
...@@ -38,11 +37,9 @@ public class Util { ...@@ -38,11 +37,9 @@ public class Util {
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("content", JSON.toJSONString(content)); 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"))); String sign = GlobalUtil.getParamsSignStr(GConstants.SIGN_PRIVATE_KEY, String.valueOf(params.get("content")));
params.put("sign", sign); params.put("sign", sign);
String res = HttpClientUtil.doPost(url.toString(), params, "UTF-8"); String res = HttpClientUtil.doPost(url.toString(), params, "UTF-8");
System.out.println("请求结果:"+ res);
if (res == null) { if (res == null) {
res = HttpClientUtil.doPost(url.toString(), params, "UTF-8"); res = HttpClientUtil.doPost(url.toString(), params, "UTF-8");
if (res == null) { if (res == null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment