Commit 16f7b23a by java-李谡

提交测试

parent 7e1470db
......@@ -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;
}
}
......@@ -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());
......
......@@ -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"));
......
......@@ -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();
......
......@@ -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) {
......
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