Commit 730b3361 by zhangzhendong

好办消息中心修改

parent 45a17047
......@@ -65,18 +65,19 @@ public enum NoticeMessageTypeEnum {
CUSTOMER_SUCCESS_ORDER_REFUND(4006, "客户成功退单通知", NoticeMessageCategoryTypeEnum.CUSTOMER.getType(), "customer_success_order_refund", "/pages/route/index?pageType=", "hbapp_user_bill_detail", "customerChargebackOrderSuccess", "haobanNotice"),
// 订单- 待发货订单提醒
ORDER_TAKE(5000, "待自提订单提醒", NoticeMessageCategoryTypeEnum.ORDER.getType(), "order_take", "/pages/route/index?pageType=", "hbapp_order_verfication", "", ""),
ORDER_PAY(5001, "待发货订单提醒", NoticeMessageCategoryTypeEnum.ORDER.getType(), "order_pay", "/pages/route/index?pageType=", "hbapp_order_center", "", ""),
REFUND_AUDIT(5010, "售后待审核提醒", NoticeMessageCategoryTypeEnum.REFUND.getType(), "refund_audit", "/pages/route/index?pageType=", "hbapp_order_center", "", ""),
REFUND_MEMBER_CANCEL(5011, "买家取消售后提醒", NoticeMessageCategoryTypeEnum.REFUND.getType(), "refund_member_cancel", "/pages/route/index?pageType=", "hbapp_order_center", "", ""),
REFUND_DELIVER(5013, "买家寄出退换货提醒", NoticeMessageCategoryTypeEnum.REFUND.getType(), "refund_deliver", "/pages/route/index?pageType=", "hbapp_order_center", "", ""),
ORDER_TAKE(5000, "待自提订单提醒", NoticeMessageCategoryTypeEnum.ORDER.getType(), "order_take", "/pages/route/index?pageType=", "hbapp_order_verfication", "toBePickUpOrderRemind", "haobanNotice"),
ORDER_PAY(5001, "待发货订单提醒", NoticeMessageCategoryTypeEnum.ORDER.getType(), "order_pay", "/pages/route/index?pageType=", "hbapp_order_center", "reminderForPendingOrders", "haobanNotice"),
REFUND_AUDIT(5010, "新增售后提醒", NoticeMessageCategoryTypeEnum.REFUND.getType(), "refund_audit", "/pages/route/index?pageType=", "hbapp_order_center", "afterSalesReviewReminder", "haobanNotice"),
REFUND_MEMBER_CANCEL(5011, "买家取消售后提醒", NoticeMessageCategoryTypeEnum.REFUND.getType(), "refund_member_cancel", "/pages/route/index?pageType=", "hbapp_order_center", "afterSalesCancelReminder", "haobanNotice"),
REFUND_DELIVER(5013, "买家寄出退换货提醒", NoticeMessageCategoryTypeEnum.REFUND.getType(), "refund_deliver", "/pages/route/index?pageType=", "hbapp_order_center", "buyerSendsBackRemind", "haobanNotice"),
//
MATERIAL_NEW_NOTIFY(6001, "素材上新通知", NoticeMessageCategoryTypeEnum.MATERIAL.getType(), "material_new_notify", "/pages/route/index?pageType=", "hbapp_material_center", "", ""),
MATERIAL_REPORT_NOTIFY(6002, "素材周报/月报通知", NoticeMessageCategoryTypeEnum.MATERIAL.getType(), "material_week_notify", "/pages/route/index?pageType=", "hbapp_mate_report", "", ""),
MATERIAL_NEW_NOTIFY(6001, "素材上新通知", NoticeMessageCategoryTypeEnum.MATERIAL.getType(), "material_new_notify", "/pages/route/index?pageType=", "hbapp_material_center", "materialsNotice", "haobanNotice"),
MATERIAL_REPORT_NOTIFY_WEEK(6002, "素材周报通知", NoticeMessageCategoryTypeEnum.MATERIAL.getType(), "material_week_notify", "/pages/route/index?pageType=", "hbapp_mate_report", "materialWeek", "haobanNotice"),
MATERIAL_REPORT_NOTIFY_MONTH(6002, "素材月报通知", NoticeMessageCategoryTypeEnum.MATERIAL.getType(), "material_week_notify", "/pages/route/index?pageType=", "hbapp_mate_report", "materialMonth", "haobanNotice"),
POTENTIAL_CUSTOMER_NOTIFY(6003, "销售线索通知", NoticeMessageCategoryTypeEnum.POTENTIAL_CUSTOMER.getType(), "potential_customer_notify", "/pages/route/index?pageType=", "hbapp_sales_clue_center", "", "");
POTENTIAL_CUSTOMER_NOTIFY(6003, "销售线索通知", NoticeMessageCategoryTypeEnum.POTENTIAL_CUSTOMER.getType(), "potential_customer_notify", "/pages/route/index?pageType=", "hbapp_sales_clue_center", "salesLeadNotice", "haobanNotice");
/**
......
......@@ -2,8 +2,10 @@ package com.gic.haoban.manage.service.pojo.bo.content.context;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import com.gic.haoban.manage.api.enums.content.MaterialReportType;
import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.pojo.bo.NoticeMessageBO;
......@@ -13,11 +15,11 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import static com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY;
/**
* @Author MUSI
......@@ -101,16 +103,22 @@ public class MaterialReportContext {
log.info("成员 {} 没有主门店数据, 区经角色不发送小程序消息通知 ", this.staffId);
return Collections.emptyList();
}
final NoticeMessageTypeEnum noticeMessageTypeEnum = MaterialReportType.WEEK.getCode().equals(this.getReportType()) ? NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY_WEEK : NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY_MONTH;
if (ObjectUtil.isNull(noticeMessageTypeEnum)){
return new ArrayList<>();
}
return this.staffClerkRelations
.stream()
.map(item -> {
NoticeMessageBO noticeMessageBO = new NoticeMessageBO();
noticeMessageBO.setCategoryType(MATERIAL_REPORT_NOTIFY.getCategory());
noticeMessageBO.setMessageType(MATERIAL_REPORT_NOTIFY.getType());
noticeMessageBO.setCategoryType(noticeMessageTypeEnum.getCategory());
noticeMessageBO.setMessageType(noticeMessageTypeEnum.getType());
noticeMessageBO.setClerkId(StringUtils.isNotBlank(item.getClerkId()) ? item.getClerkId() : "-1");
noticeMessageBO.setStoreId(StringUtils.isNotBlank(item.getStoreId()) ? item.getStoreId() : "-1");
noticeMessageBO.setTitle(this.getMessageTitle());
noticeMessageBO.setTemplateCode(MATERIAL_REPORT_NOTIFY.getTemplateCode());
noticeMessageBO.setTemplateCode(noticeMessageTypeEnum.getTemplateCode());
noticeMessageBO.setDescription(this.getMessageDesc());
noticeMessageBO.setEnterpriseId(this.enterpriseId);
noticeMessageBO.setRelationId(this.clerkId);
......
package com.gic.haoban.manage.service.service.content.adaptor;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
......@@ -22,6 +23,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
......@@ -188,7 +190,9 @@ public class MaterialReportBuilder {
articleInfo.setAppid(config.getAppid());
articleInfo.setTitle(context.getMessageTitle());
articleInfo.setDescription(context.getMessageDesc());
articleInfo.setPagepath(NoticeMessageUtil.buildMiniAppUrl(NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY, context.extendParams(context.getMainStoreId())));
final NoticeMessageTypeEnum noticeMessageTypeEnum = MaterialReportType.WEEK.getCode().equals(context.getReportType()) ? NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY_WEEK : NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY_MONTH;
articleInfo.setPagepath(NoticeMessageUtil.buildMiniAppUrl(noticeMessageTypeEnum, context.extendParams(context.getMainStoreId())));
articleInfo.setPicurl(context.getMaterialReportUrl());
newsSendMessage.setArticleMessages(Collections.singletonList(articleInfo));
return newsSendMessage;
......
package com.gic.haoban.manage.service.service.content.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.commons.util.UniqueIdUtils;
import com.gic.enterprise.api.dto.EnterpriseDTO;
import com.gic.enterprise.api.service.EnterpriseService;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import com.gic.haoban.manage.api.enums.content.MaterialReportType;
import com.gic.haoban.manage.api.util.notify.NoticeMessageUtil;
import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.entity.TabHaobanStaff;
......@@ -100,9 +103,10 @@ public class MaterialReportServiceImpl implements MaterialReportService {
materialReportBuilder.buildMaterialReportData(context);
// 保存小程序消息
List<NoticeMessageBO> noticeMessageBos = context.buildNotifyMessageBos();
/*消息中心修改此处
if (CollectionUtils.isNotEmpty(noticeMessageBos)) {
noticeMessageService.addNoticeMessageBatch(noticeMessageBos);
}
}*/
// 发送企微消息
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(staffInfo.getWxEnterpriseId());
QywxNewsSendMessageDTO newsSendMessageDTO = materialReportBuilder.buildQywxNewsMessage(context, qwDTO);
......@@ -121,9 +125,21 @@ public class MaterialReportServiceImpl implements MaterialReportService {
variableMap.put("page", qywxNewsArticleMessageDTO.getPagepath());
variableMap.put("templateTitle", qywxNewsArticleMessageDTO.getTitle());
variableMap.put("templateDescription", qywxNewsArticleMessageDTO.getDescription());
variableMap.put("haobanNoticeMessageList", JSONObject.toJSONString(noticeMessageBos));
NoticeMessageTypeEnum noticeMessageTypeEnum = null;
if (MaterialReportType.WEEK.getCode().equals(context.getReportType())) {
noticeMessageTypeEnum = NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY_WEEK;
} else if (MaterialReportType.MONTH.getCode().equals(context.getReportType())) {
noticeMessageTypeEnum = NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY_MONTH;
}
if (ObjectUtil.isNull(noticeMessageTypeEnum)){
log.info("枚举不存在 context:{}", JSONObject.toJSONString(context));
return;
}
noticeMessageHandler.sendMessage(NoticeMessageForm.builder()
.messageCode(NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY.getMessageCode())
.mqRouterCode(NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY.getRouterCode())
.messageCode(noticeMessageTypeEnum.getMessageCode())
.mqRouterCode(noticeMessageTypeEnum.getRouterCode())
.businessId("-1")
.createTime(new Date())
.enterpriseId(context.getEnterpriseId())
......
......@@ -103,7 +103,7 @@ public class MaterialReportServiceTest {
// params.put("t", 1);
// params.put("d", "04");
String s = params.toJSONString();
String s1 = NoticeMessageUtil.buildMiniAppUrl(NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY, s);
String s1 = NoticeMessageUtil.buildMiniAppUrl(NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY_MONTH, s);
System.out.println("/pages/route/index?pageType=hbapp_material_report&data=".length());
System.out.println(s1);
System.out.println(s1.length());
......
......@@ -69,7 +69,7 @@ public class test {
// params.put("t", 1);
// params.put("d", "04");
String s = params.toJSONString();
String s1 = NoticeMessageUtil.buildMiniAppUrl(NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY, s);
String s1 = NoticeMessageUtil.buildMiniAppUrl(NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY_MONTH, s);
System.out.println("/pages/route/index?pageType=hbapp_material_report&data=".length());
System.out.println(s1);
System.out.println(s1.length());
......
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