|
@@ -670,13 +670,13 @@ public class ImGroupServiceImpl extends ServiceImpl<ImGroupDao, ImGroup> impleme
|
|
|
//根据发送者分场景讨论
|
|
|
String id = i.getFromUserId();
|
|
|
String imUserId;
|
|
|
- if (id.contains(":student")){
|
|
|
+ if (id.contains(":student")) {
|
|
|
String[] split = id.split(":");
|
|
|
String userId = split[0];
|
|
|
String clientType = split[1];
|
|
|
- imUserId = getImUserId(userId,clientType);
|
|
|
+ imUserId = getImUserId(userId, clientType);
|
|
|
} else {
|
|
|
- imUserId = getImUserId(id,"teacher");
|
|
|
+ imUserId = getImUserId(id, "teacher");
|
|
|
}
|
|
|
|
|
|
privateImportMessage.setFromAccount(imUserId);
|
|
@@ -687,7 +687,7 @@ public class ImGroupServiceImpl extends ServiceImpl<ImGroupDao, ImGroup> impleme
|
|
|
|
|
|
//设置发送时间
|
|
|
String time = i.getDateTime();
|
|
|
- SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
try {
|
|
|
Date date = df.parse(time);
|
|
|
long dateTime = date.getTime();
|
|
@@ -701,10 +701,10 @@ public class ImGroupServiceImpl extends ServiceImpl<ImGroupDao, ImGroup> impleme
|
|
|
TencentRequest.MessageBody body = new TencentRequest.MessageBody();
|
|
|
List<TencentRequest.MessageBody> list = new ArrayList<>();
|
|
|
|
|
|
- if (i.getClassname().equals("RC:TxtMsg")){
|
|
|
+ if (i.getClassname().equals("RC:TxtMsg")) {
|
|
|
TencentRequest.MessageBody body1 = CustomerServiceBatchSendingServiceImpl.getTimTextElem(i.getContent());
|
|
|
list.add(body1);
|
|
|
- } else if (i.getClassname().equals("RC:ImgMsg")){
|
|
|
+ } else if (i.getClassname().equals("RC:ImgMsg")) {
|
|
|
JSONObject jsonObject = JSONObject.parseObject(i.getContent());
|
|
|
TencentRequest.MessageBody body1 = CustomerServiceBatchSendingServiceImpl.getTimImageElem(jsonObject.getJSONObject("user").getString("portraitUri"));
|
|
|
list.add(body1);
|
|
@@ -718,7 +718,7 @@ public class ImGroupServiceImpl extends ServiceImpl<ImGroupDao, ImGroup> impleme
|
|
|
item.setMsgContent(i.getContent());
|
|
|
item.setMsgType(i.getClassname());
|
|
|
});*/
|
|
|
- if (list.stream().map(TencentRequest.MessageBody::getMsgType).collect(Collectors.toList()).get(0).equals("RC:TxtMsg")){
|
|
|
+ if (list.stream().map(TencentRequest.MessageBody::getMsgType).collect(Collectors.toList()).get(0).equals("RC:TxtMsg")) {
|
|
|
//文本对象
|
|
|
list.stream().forEach(item -> item.setMsgType("TIMTextElem"));
|
|
|
} else if (list.stream().map(TencentRequest.MessageBody::getMsgType).collect(Collectors.toList()).get(0).equals("RC:ImgMsg")) {
|
|
@@ -744,13 +744,13 @@ public class ImGroupServiceImpl extends ServiceImpl<ImGroupDao, ImGroup> impleme
|
|
|
String imUserId;
|
|
|
String id = i.getFromUserId();
|
|
|
//根据发送者分场景讨论
|
|
|
- if (id.contains(":student")){
|
|
|
+ if (id.contains(":student")) {
|
|
|
String[] split = id.split(":");
|
|
|
String userId = split[0];
|
|
|
String clientType = split[1];
|
|
|
- imUserId = getImUserId(userId,clientType);
|
|
|
+ imUserId = getImUserId(userId, clientType);
|
|
|
} else {
|
|
|
- imUserId = getImUserId(id,"teacher");
|
|
|
+ imUserId = getImUserId(id, "teacher");
|
|
|
}
|
|
|
|
|
|
|
|
@@ -760,7 +760,7 @@ public class ImGroupServiceImpl extends ServiceImpl<ImGroupDao, ImGroup> impleme
|
|
|
//设置发送时间
|
|
|
|
|
|
String time = i.getDateTime();
|
|
|
- SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
try {
|
|
|
Date date = df.parse(time);
|
|
|
long dateTime = date.getTime();
|
|
@@ -773,10 +773,10 @@ public class ImGroupServiceImpl extends ServiceImpl<ImGroupDao, ImGroup> impleme
|
|
|
item.setMsgContent(i.getContent());
|
|
|
item.setMsgType(i.getClassname());
|
|
|
});*/
|
|
|
- if (i.getClassname().equals("RC:TxtMsg")){
|
|
|
+ if (i.getClassname().equals("RC:TxtMsg")) {
|
|
|
TencentRequest.MessageBody body1 = CustomerServiceBatchSendingServiceImpl.getTimTextElem(i.getContent());
|
|
|
bodyList.add(body1);
|
|
|
- } else if (i.getClassname().equals("RC:ImgMsg")){
|
|
|
+ } else if (i.getClassname().equals("RC:ImgMsg")) {
|
|
|
JSONObject jsonObject = JSONObject.parseObject(i.getContent());
|
|
|
TencentRequest.MessageBody body1 = CustomerServiceBatchSendingServiceImpl.getTimImageElem(jsonObject.getJSONObject("user").getString("portraitUri"));
|
|
|
bodyList.add(body1);
|
|
@@ -785,7 +785,7 @@ public class ImGroupServiceImpl extends ServiceImpl<ImGroupDao, ImGroup> impleme
|
|
|
body.setMsgType(i.getClassname());*/
|
|
|
|
|
|
//文本对象
|
|
|
- if (bodyList.stream().map(TencentRequest.MessageBody::getMsgType).collect(Collectors.toList()).get(0).equals("RC:TxtMsg")){
|
|
|
+ if (bodyList.stream().map(TencentRequest.MessageBody::getMsgType).collect(Collectors.toList()).get(0).equals("RC:TxtMsg")) {
|
|
|
bodyList.stream().forEach(item -> item.setMsgType("TIMTextElem"));
|
|
|
} else if (bodyList.stream().map(TencentRequest.MessageBody::getMsgType).collect(Collectors.toList()).get(0).equals("RC:ImgMsg")) {
|
|
|
//暂未支持图文对象
|