参数模板管理--发布时发飞书消息
This commit is contained in:
+42
-2
@@ -6,20 +6,36 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
import com.jero.common.constant.enums.CutEnum;
|
import com.jero.common.constant.enums.CutEnum;
|
||||||
import com.jero.common.exception.JeroBootException;
|
import com.jero.common.exception.JeroBootException;
|
||||||
import com.jero.common.system.vo.LoginUser;
|
import com.jero.common.system.vo.LoginUser;
|
||||||
import com.jero.modules.cert.template.entity.*;
|
import com.jero.modules.cert.template.entity.CertCategoryParamsInfoEO;
|
||||||
|
import com.jero.modules.cert.template.entity.CertCategoryParamsInfoPublishEO;
|
||||||
|
import com.jero.modules.cert.template.entity.ParamsInfoEO;
|
||||||
|
import com.jero.modules.cert.template.entity.ParamsInfoPublishEO;
|
||||||
|
import com.jero.modules.cert.template.entity.ParamsTemplateEO;
|
||||||
|
import com.jero.modules.cert.template.entity.ParamsTemplateSubscribeEO;
|
||||||
import com.jero.modules.cert.template.mapper.ParamsInfoPublishEOMapper;
|
import com.jero.modules.cert.template.mapper.ParamsInfoPublishEOMapper;
|
||||||
import com.jero.modules.cert.template.service.*;
|
import com.jero.modules.cert.template.service.ICertCategoryParamsInfoEOService;
|
||||||
|
import com.jero.modules.cert.template.service.ICertCategoryParamsInfoPublishEOService;
|
||||||
|
import com.jero.modules.cert.template.service.IParamsInfoEOService;
|
||||||
|
import com.jero.modules.cert.template.service.IParamsInfoPublishEOService;
|
||||||
|
import com.jero.modules.cert.template.service.IParamsTemplateEOService;
|
||||||
|
import com.jero.modules.cert.template.service.IParamsTemplateSubscribeEOService;
|
||||||
|
import com.jero.modules.feishu.enums.TemplateInfoEnum2;
|
||||||
|
import com.jero.modules.feishu.service.IFeishuService;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.shiro.SecurityUtils;
|
import org.apache.shiro.SecurityUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Propagation;
|
import org.springframework.transaction.annotation.Propagation;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -46,6 +62,13 @@ public class ParamsInfoPublishEOServiceImpl extends ServiceImpl<ParamsInfoPublis
|
|||||||
private ICertCategoryParamsInfoPublishEOService certCategoryParamsInfoPublishEOService;
|
private ICertCategoryParamsInfoPublishEOService certCategoryParamsInfoPublishEOService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IParamsTemplateSubscribeEOService paramsTemplateSubscribeEOService;
|
private IParamsTemplateSubscribeEOService paramsTemplateSubscribeEOService;
|
||||||
|
@Resource
|
||||||
|
private IFeishuService iFeishuService;
|
||||||
|
@Value(value = "${jero.backUrl}")
|
||||||
|
private String backUrl;
|
||||||
|
|
||||||
|
@Value(value = "${jero.backUrlPhone}")
|
||||||
|
private String backUrlPhone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
@@ -199,6 +222,23 @@ public class ParamsInfoPublishEOServiceImpl extends ServiceImpl<ParamsInfoPublis
|
|||||||
if(ObjectUtils.isNotEmpty(paramsTemplateSubscribeEOList)){
|
if(ObjectUtils.isNotEmpty(paramsTemplateSubscribeEOList)){
|
||||||
List<String> userIdList = paramsTemplateSubscribeEOList
|
List<String> userIdList = paramsTemplateSubscribeEOList
|
||||||
.stream().map(ParamsTemplateSubscribeEO::getUserId).distinct().collect(Collectors.toList());
|
.stream().map(ParamsTemplateSubscribeEO::getUserId).distinct().collect(Collectors.toList());
|
||||||
|
//飞书消息
|
||||||
|
String url = backUrl + "/ParameterTemplateList?id=" + paramsTemplateId;
|
||||||
|
String contentInfoFeiShuCn = "参数模板" + source.getParamsTemplateName() + "已被修改,请及时查看确认修改影响。";
|
||||||
|
String contentInfoFeiShu = "Parameter template " + source.getParamsTemplateName() + " has been modified,has been modified, please check in time to confirm the impact of the modification.";
|
||||||
|
|
||||||
|
Map<String,Object> params = new HashMap<>();
|
||||||
|
params.put("contentInfoFeiCn",contentInfoFeiShuCn);
|
||||||
|
params.put("contentInfoFeiEn",contentInfoFeiShu);
|
||||||
|
params.put("userIdList",userIdList);
|
||||||
|
params.put("back_url",url);
|
||||||
|
params.put("back_url_phone",backUrlPhone + "ParameterTemplateList?id=" + paramsTemplateId);
|
||||||
|
params.put("titleCn",TemplateInfoEnum2.SUBSCRIPTION_INFORM.getNameCn());
|
||||||
|
params.put("titleEn",TemplateInfoEnum2.SUBSCRIPTION_INFORM.getNameEn());
|
||||||
|
iFeishuService.sendMessageSubscriptionNotification(TemplateInfoEnum2.SUBSCRIPTION_INFORM.getValue(),params);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
@@ -145,6 +145,9 @@ public enum TemplateInfoEnum2 {
|
|||||||
// 订阅通知
|
// 订阅通知
|
||||||
SUBSCRIPTION_INFORM("订阅通知","ctp_AArYnQds54ia","Subscription Notification"), // 已同步飞书开放平台
|
SUBSCRIPTION_INFORM("订阅通知","ctp_AArYnQds54ia","Subscription Notification"), // 已同步飞书开放平台
|
||||||
|
|
||||||
|
//志江飞书测试
|
||||||
|
// SUBSCRIPTION_INFORM("订阅通知","ctp_AAfvdg0Cy90I","Subscription Notification"),
|
||||||
|
|
||||||
// 转发推送
|
// 转发推送
|
||||||
TRANSPOND_PUSH("转发推送","","Share / Forward"),
|
TRANSPOND_PUSH("转发推送","","Share / Forward"),
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user