|
|
@@ -68,9 +68,9 @@ public class MessageServiceImpl implements MessageService {
|
|
|
|
|
|
// private static final String TEL_REGEXP = "^((\\(\\d{3}\\))|(\\d{3}\\-))?(13|15|18|17)\\d{9}$";
|
|
|
|
|
|
- private static final String PROD_URL = "http://113.105.74.140:8092/tigase/baiduPush";
|
|
|
+ private static final String PROD_URL = "https://mobile.ubtob.com/tigase/baiduPush";
|
|
|
|
|
|
- private static final String SM_UU_URL= "?pagekind=B&id=%s&uu=%s";
|
|
|
+ private static final String PUBLIC_INQUIRY_IM_URL= "https://mobile.ubtob.com:8443/openapp/?pagekind=B&id=%s&uu=%s&telephone=%s";
|
|
|
/**
|
|
|
* 邮件服务主机地址
|
|
|
*/
|
|
|
@@ -188,7 +188,7 @@ public class MessageServiceImpl implements MessageService {
|
|
|
throw new IllegalOperatorException("接收应用不存在");
|
|
|
}
|
|
|
|
|
|
- // 获取改应用应接收的未读、未发送的需要推送的消息
|
|
|
+ // 获取改应用应接收的未读、未发送的需要推送的消息(取前500条)
|
|
|
List<Message> messages = messageDao.findByConsumerAppIdAndIsReadAndIsSentNeedToSend(
|
|
|
consumerAppExists.getId(), Constant.NO, Constant.NO);
|
|
|
logger.info("信息数量:" + messages.size());
|
|
|
@@ -427,13 +427,14 @@ public class MessageServiceImpl implements MessageService {
|
|
|
}
|
|
|
|
|
|
// 发送IM
|
|
|
-// if (message.getSmsType().contains(SMSType.IM)) {
|
|
|
-// sendIM(message, receiver, consumerApp);
|
|
|
-// }
|
|
|
+ if (message.getSmsType().contains(SMSType.IM)) {
|
|
|
+ sendIM(message, receiver, consumerApp);
|
|
|
+ }
|
|
|
} else {
|
|
|
logger.info("接收人姓名为空,uu:" + message.getReceiverUu() + ",enuu:" + message.getReceiverEnuu());
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
+ message.setIsSent(Constant.ERROR);
|
|
|
logger.info(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
@@ -539,18 +540,18 @@ public class MessageServiceImpl implements MessageService {
|
|
|
* @param receiver 接收人
|
|
|
* @param consumerApp 消费app
|
|
|
*/
|
|
|
- private void sendIM(Message message, User receiver, String consumerApp) {
|
|
|
+ private void sendIM(Message message, UserView receiver, String consumerApp) {
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
if (!StringUtils.isEmpty(receiver.getDialectUID())) {
|
|
|
-// TODO params.put("master", enterprise.getEnName()); // 账套 公司名称
|
|
|
+ params.put("master", receiver.getSpaceName()); // 账套 公司名称
|
|
|
params.put("userid", receiver.getDialectUID()); // 推送目标用户
|
|
|
-// TODO String title = "";
|
|
|
-// params.put("title", message.getType()); // 推送标题
|
|
|
+ params.put("title", message.getType() == null ? "" : message.getType()); // 推送标题
|
|
|
params.put("content", message.getContent()); // 正文
|
|
|
params.put("enUU", message.getReceiverEnuu()); // UU号
|
|
|
- params.put("url", ""); // 跳转链接地址
|
|
|
- // TODO
|
|
|
- params.put("platform", consumerApp); // 系统名称,ERP或
|
|
|
+ params.put("masterId", null);
|
|
|
+ params.put("url", String.format(PUBLIC_INQUIRY_IM_URL, message.getSourceId(), message.getReceiverEnuu(), receiver.getUid())); // 跳转链接地址
|
|
|
+ params.put("pageTitle", message.getType() == null ? "" : message.getType());
|
|
|
+ params.put("platform", "B2B"); // 系统名称,ERP或B2B
|
|
|
try {
|
|
|
ResponseWrap res = HttpUtil.doPost(PROD_URL, params);
|
|
|
if (!res.isSuccess()) {
|