|
@ -871,16 +871,20 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
|
|
|
JSONObject orderInfoContent = this.queryOrderCardInfo(orderDO);
|
|
|
orderInfoContent.put("re_msg_type", 0);//居民预约
|
|
|
|
|
|
|
|
|
int flagCount = qucikSendIM(orderDO.getId(), "system", "智能助手", "2101", orderInfoContent.toJSONString());
|
|
|
|
|
|
|
|
|
//模拟一,重试3次
|
|
|
int tryCount = 3;
|
|
|
int flagCount = 0;
|
|
|
for (int i = 0; i < tryCount; i++) {
|
|
|
//发送消息
|
|
|
flagCount = qucikSendIM(orderDO.getId(), "system", "智能助手", "2101", orderInfoContent.toJSONString());
|
|
|
if (flagCount == 1) {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
// int tryCount = 3;
|
|
|
// int flagCount = 0;
|
|
|
// for (int i = 0; i < tryCount; i++) {
|
|
|
// //发送消息
|
|
|
// flagCount = qucikSendIM(orderDO.getId(), "system", "智能助手", "2101", orderInfoContent.toJSONString());
|
|
|
// if (flagCount == 1) {
|
|
|
// break;
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
// //模式2,睡眠1秒钟
|
|
|
// Thread.sleep(1000);
|
|
@ -2632,6 +2636,22 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
|
|
|
* @return
|
|
|
*/
|
|
|
public int qucikSendIM(String orderId, String sendId, String sendName, String contentType, String content) throws Exception {
|
|
|
int tryAgain = 3;
|
|
|
int flag = 0;
|
|
|
for (int i = 0; i < tryAgain; i++) {
|
|
|
flag = sendMsg(orderId, sendId, sendName, contentType, content);
|
|
|
if (flag == 1) {
|
|
|
break;
|
|
|
} else {
|
|
|
System.out.println("开始重试发送");
|
|
|
}
|
|
|
}
|
|
|
return flag;
|
|
|
}
|
|
|
|
|
|
|
|
|
public int sendMsg(String orderId, String sendId, String sendName, String contentType, String content) throws Exception {
|
|
|
|
|
|
int result = -1;
|
|
|
ConsultDo consult = consultDao.queryByRelationCode(orderId);
|
|
|
if (null == consult) {
|
|
@ -2665,6 +2685,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 判断消息订单是否已被取消
|
|
|
*
|