Merge remote-tracking branch 'origin/cc_partner_init' into cc_partner_init

This commit is contained in:
bianyadong
2024-05-08 15:16:33 +08:00
16 changed files with 203 additions and 90 deletions

View File

@@ -1,5 +1,13 @@
package com.cool.store.enums;
import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.Objects;
/**
* @author zhangchenbiao
* @FileName: MessageEnum
@@ -8,21 +16,21 @@ package com.cool.store.enums;
*/
public enum MessageEnum {
MESSAGE_1("您有一份加盟意向申请,请查收。", "##### 加盟商姓名:{0}\n##### 手机号码:{1}\n##### 意向加盟区域:{2}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_2("您收到一份邀约面谈预约,请查收", "##### 加盟商姓名:{0}\n##### 预约时间:{1}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_3("您收到一份一次面审预约,请查收", "##### 加盟商姓名:{0}\n##### 预约时间:{1}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_4("您有线索未通过面审,请查收", "##### 加盟商姓名:{0}\n##### 面审时间:{1}\n##### 面审官:{2}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_5("您收到一份缴纳意向金审核,请查收", "##### 加盟商姓名:{0}\n##### 缴费时间:{1}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_6("您收到一份加盟意向协议信息审核,请查收", "##### 加盟商姓名:{0}\n##### 手机号码:{1}\n##### 信息提交时间:{2}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_7("您提交的一份加盟意向协议OA审核未通过请查收", "##### 加盟商姓名:{0}\n##### 审批提交时间:{1}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_8("您有一位加盟商待安排体验门店及体验时间,请查收", "##### 加盟商姓名:{0}\n##### 手机号码:{1}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_9("您有一位加盟商已放弃门店体验,请查收", "##### 加盟商姓名:{0}\n##### 手机号码:{1}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_10("您收到一份二次面审预约,请查收", "##### 加盟商姓名:{0}\n##### 预约时间:{1}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_11("您的一个铺位已审核通过,请查收", "##### 铺位名称:{0}\n##### 铺位地址:{1}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_12("您的一个铺位审核未通过,请查收", "##### 铺位名称:{0}\n##### 铺位地址:{1}\n##### 未通过原因:{2}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_13("您有一个铺位需要审核,请查收", "##### 铺位名称:{0}\n##### 铺位地址:{1}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_14("已为您分配一位加盟商,请查收", "##### 加盟商姓名:{0}\n##### 手机号码:{1}\n##### 意向加盟区域:{2}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_15("您有一份加盟商上传的租赁合同待审核,请查收", "##### 加盟商姓名:{0}\n##### 提交时间:{1}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_1("您有一份加盟意向申请,请查收。", "##### 加盟商姓名:${partnerUsername}\n##### 手机号码:${partnerMobile}\n##### 意向加盟区域:${wantShopName}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_2("您收到一份邀约面谈预约,请查收", "##### 加盟商姓名:${partnerUsername}\n##### 预约时间:${appointmentTime}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_3("您收到一份一次面审预约,请查收", "##### 加盟商姓名:${partnerUsername}\n##### 预约时间:${appointmentTime}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_4("您有线索未通过面审,请查收", "##### 加盟商姓名:${partnerUsername}\n##### 面审时间:${interviewTime}\n##### 面审官:${interviewUsername}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_5("您收到一份缴纳意向金审核,请查收", "##### 加盟商姓名:${partnerUsername}\n##### 缴费时间:${payTime}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_6("您收到一份加盟意向协议信息审核,请查收", "##### 加盟商姓名:${partnerUsername}\n##### 手机号码:${partnerMobile}\n##### 信息提交时间:{submitTime}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_7("您提交的一份加盟意向协议OA审核未通过请查收", "##### 加盟商姓名:${partnerUsername}\n##### 审批提交时间:${submitTime}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_8("您有一位加盟商待安排体验门店及体验时间,请查收", "##### 加盟商姓名:${partnerUsername}\n##### 手机号码:${partnerMobile}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_9("您有一位加盟商已放弃门店体验,请查收", "##### 加盟商姓名:${partnerUsername}\n##### 手机号码:${partnerMobile}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_10("您收到一份二次面审预约,请查收", "##### 加盟商姓名:${partnerUsername}\n##### 预约时间:${appointmentTime}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_11("您的一个铺位已审核通过,请查收", "##### 铺位名称:${pointName}\n##### 铺位地址:${pointAddress}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_12("您的一个铺位审核未通过,请查收", "##### 铺位名称:${pointName}\n##### 铺位地址:${pointAddress}\n##### 未通过原因:${reason}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_13("您有一个铺位需要审核,请查收", "##### 铺位名称:${pointName}\n##### 铺位地址:${pointAddress}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_14("已为您分配一位加盟商,请查收", "##### 加盟商姓名:${partnerUsername}\n##### 手机号码:${partnerMobile}\n##### 意向加盟区域:${wantShopName}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
MESSAGE_15("您有一份加盟商上传的租赁合同待审核,请查收", "##### 加盟商姓名:${partnerUsername}\n##### 提交时间:${submitTime}\n", "https://oss.coolcollege.cn/53c11d2f4ec94d4fa7edd7a96e40e2d6.png"),
;
private String title;
@@ -45,7 +53,57 @@ public enum MessageEnum {
return content;
}
public String getContent(Map<String, String> paramMap){
String result = this.content;
for (String key : paramMap.keySet()) {
result = result.replace("${" + key + "}", paramMap.get(key));
}
return result;
}
public String getImageUrl() {
return imageUrl;
}
public String getMessageUrl(String domainUrl, String appId, String corpId, Map<String, String> paramMap){
if(StringUtils.isAnyBlank(domainUrl, appId, corpId) || Objects.isNull(paramMap)){
return "";
}
try {
switch (this) {
case MESSAGE_1:
case MESSAGE_2:
case MESSAGE_4:
case MESSAGE_5:
case MESSAGE_6:
case MESSAGE_7:
case MESSAGE_8:
case MESSAGE_9:
case MESSAGE_15:
return domainUrl + "/dd-noticemsg?appId=" + appId + "&corpId="+ corpId + "&appUrl=" +
URLEncoder.encode("pages/common-web-view/index?noticeType=xfsg&routerUrl=notice&target=clue&lineId=" + paramMap.get("lineId"), StandardCharsets.UTF_8.name());
case MESSAGE_3:
case MESSAGE_10:
return domainUrl + "/dd-noticemsg?appId=" + appId + "&corpId="+ corpId + "&appUrl=" +
URLEncoder.encode("pages/common-web-view/index?noticeType=xfsg&routerUrl=notice&target=interview&lineId=" + paramMap.get("lineId"), StandardCharsets.UTF_8.name());
case MESSAGE_11:
case MESSAGE_12:
return domainUrl + "/dd-noticemsg?appId=" + appId + "&corpId="+ corpId + "&appUrl=" +
URLEncoder.encode("pages/common-web-view/index?noticeType=xfsg&routerUrl=notice&target=point&pointId=" + paramMap.get("pointId"), StandardCharsets.UTF_8.name());
case MESSAGE_13:
return "dingtalk://dingtalkclient/action/open_micro_app?appId="+ appId +"&corpId=" + corpId + "&page=" +
URLEncoder.encode("pages/common-web-view/index?noticeType=xfsg&routerUrl=notice&target=point&pointId="+ paramMap.get("pointId"), StandardCharsets.UTF_8.name());
case MESSAGE_14:
return "dingtalk://dingtalkclient/action/open_micro_app?appId="+appId+"&corpId="+corpId+"&page=" +
URLEncoder.encode("pages/common-web-view/index?noticeType=xfsg&routerUrl=notice&target=pointPush&lineId="+ paramMap.get("lineId"), StandardCharsets.UTF_8.name());
default:
return "";
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return null;
}
}