Commit 45a17047 by zhangzhendong

好办消息中心修改

parent cd8c4792
......@@ -204,8 +204,8 @@ public class PotentialCustomerNotifyBuilder {
variableMap.put("memberNum", customerStaticsBOMap.get(staffClerkRelation.getClerkId()).getNum().toString());
variableMap.put("page", NoticeMessageUtil.buildMiniAppUrl(NoticeMessageTypeEnum.POTENTIAL_CUSTOMER_NOTIFY, context.buildExtendParams(staffClerkRelation.getStoreId(), staffClerkRelation.getClerkId())));
noticeMessageHandler.sendMessage(NoticeMessageForm.builder()
.messageCode("等模版code")
.mqRouterCode("等模版code")
.messageCode(NoticeMessageTypeEnum.POTENTIAL_CUSTOMER_NOTIFY.getMessageCode())
.mqRouterCode(NoticeMessageTypeEnum.POTENTIAL_CUSTOMER_NOTIFY.getRouterCode())
.businessId("-1")
.createTime(new Date())
.enterpriseId(context.getEnterpriseId())
......
......@@ -122,8 +122,8 @@ public class MaterialReportServiceImpl implements MaterialReportService {
variableMap.put("templateTitle", qywxNewsArticleMessageDTO.getTitle());
variableMap.put("templateDescription", qywxNewsArticleMessageDTO.getDescription());
noticeMessageHandler.sendMessage(NoticeMessageForm.builder()
.messageCode("等模版code")
.mqRouterCode("等模版code")
.messageCode(NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY.getMessageCode())
.mqRouterCode(NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY.getRouterCode())
.businessId("-1")
.createTime(new Date())
.enterpriseId(context.getEnterpriseId())
......
package com.gic.haoban.manage.service.service.message;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.gic.commons.util.GICMQClientUtil;
import com.gic.haoban.manage.service.service.notify.out.NoticeMessageApiServiceImpl;
import com.gic.message.center.api.subcribe.model.NoticeMessageForm;
import com.gic.mq.sdk.GicMQClient;
import org.slf4j.Logger;
import org.springframework.stereotype.Service;
......@@ -26,5 +29,15 @@ public class NoticeMessageHandler {
*/
public void sendMessage(NoticeMessageForm noticeMessageForm){
logger.info("消息中心发送消息实体:{}", JSONObject.toJSONString(noticeMessageForm));
if (ObjectUtil.isEmpty(noticeMessageForm.getMessageCode()) || ObjectUtil.isEmpty(noticeMessageForm.getMqRouterCode())) {
logger.info("消息中心发送消息实体 messageCode 或 mqRouterCode 不存在");
}
GicMQClient client = GICMQClientUtil.getClientInstance();
try {
client.sendMessage(noticeMessageForm.getMqRouterCode(), JSONObject.toJSONString(noticeMessageForm));
} catch (Exception e) {
logger.error("消息中心发送消息实体发送异常 ", e);
}
}
}
......@@ -9,6 +9,7 @@ import java.util.*;
import java.util.stream.Collectors;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.gic.clerk.api.dto.ClerkListDTO;
import com.gic.clerk.api.service.ClerkService;
......@@ -182,10 +183,13 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
variableMap.put("pageParams", JSONObject.toJSONString(messageQDTO.getExtendContent()));
variableMap.put("templateTitle", messageQDTO.getTitle());
NoticeMessageTypeEnum noticeMessageTypeEnum = NoticeMessageTypeEnum.getByType(messageQDTO.getMessageType());
if (ObjectUtil.isNull(noticeMessageTypeEnum)) {
return;
}
NoticeMessageForm build = NoticeMessageForm.builder()
.messageCode("等模版code")
.mqRouterCode("等模版code")
.messageCode(noticeMessageTypeEnum.getMessageCode())
.mqRouterCode(noticeMessageTypeEnum.getRouterCode())
.businessId(messageQDTO.getOptTargetId())
.createTime(new Date())
.enterpriseId(messageQDTO.getEnterpriseId())
......@@ -302,10 +306,13 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
variableMap.put("pageParams", JSONObject.toJSONString(notifyMessageBatchQDTO.getExtendContent()));
variableMap.put("templateTitle", notifyMessageBatchQDTO.getTitle());
NoticeMessageTypeEnum noticeMessageTypeEnum = NoticeMessageTypeEnum.getByType(notifyMessageBatchQDTO.getMessageType());
if (ObjectUtil.isNull(noticeMessageTypeEnum)) {
return ServiceResponse.failure("-1", "模版枚举不存在");
}
noticeMessageHandler.sendMessage(NoticeMessageForm.builder()
.messageCode("等模版code")
.mqRouterCode("等模版code")
.messageCode(noticeMessageTypeEnum.getMessageCode())
.mqRouterCode(noticeMessageTypeEnum.getRouterCode())
.businessId(notifyMessageBatchQDTO.getOptTargetId())
.createTime(new Date())
.enterpriseId(notifyMessageBatchQDTO.getEnterpriseId())
......
......@@ -672,7 +672,11 @@ public class MessageApiServiceImpl implements MessageApiService {
Map<String, String> map = new HashMap<>();
if (CollectionUtils.isNotEmpty(valueList)) {
for (int i = 0; i < valueList.size(); i++) {
map.put("" + (i + 1), valueList.get(i));
String key = "" + (i + 1);
map.put(key, valueList.get(i));
if (key.equals("1")) {
map.put("goodsName", valueList.get(i));
}
}
}
MemberDataDTO member = this.findMember(enterpriseId,memberId);
......
......@@ -212,7 +212,7 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
, NoticeMessageTypeEnum.CLERK_DEL_AGREE.getType(), null, params, jsonObject);
} else {
NoticeMessageUtil.sendNoticeMessage(tab.getEnterpriseId(), tab.getClerkId()
, NoticeMessageTypeEnum.CLERK_DEL_AGREE.getType(), null, params, jsonObject);
, NoticeMessageTypeEnum.CLERK_DEL_REFUSE.getType(), null, params, jsonObject);
}
}
......
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