Commit 77b7430d by 王祖波

好办消息通知

parent ed8de6e4
......@@ -14,6 +14,8 @@ public class WxEnterpriseQwDTO implements Serializable {
private String memberCorpid;
// 第三方
private String thirdCorpid;
// 好办小程序应用id
private String agentId;
// 第三方使用的加密的userid
public boolean needOpenUserId3th() {
......@@ -63,4 +65,12 @@ public class WxEnterpriseQwDTO implements Serializable {
public void setThirdCorpid(String thirdCorpid) {
this.thirdCorpid = thirdCorpid;
}
public String getAgentId() {
return agentId;
}
public void setAgentId(String agentId) {
this.agentId = agentId;
}
}
......@@ -79,6 +79,7 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
Integer appType = app.getApplicationType() ;
if(appType==2) {
qw.setThirdCorpid(app.getCorpid());
qw.setAgentId(app.getAgentId());
}else if(appType.equals(3)) {
qw.setDkCorpid(app.getCorpid());
}else if(appType.equals(4)) {
......
......@@ -22,6 +22,7 @@ import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
import com.gic.haoban.manage.service.service.WxEnterpriseRelatedService;
import com.gic.wechat.api.dto.qywx.QywxTemplateCardSendMessageDTO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -240,15 +241,9 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
}
noticeMessageService.addNoticeMessageBatch(noticeMessageBOList);
QywxXcxSendMessageDTO messageDTO = new QywxXcxSendMessageDTO();
QywxTemplateCardSendMessageDTO messageDTO = new QywxTemplateCardSendMessageDTO();
String data = notifyMessageBatchQDTO.getExtendContent() != null ? JSONObject.toJSONString(notifyMessageBatchQDTO.getExtendContent()) : null;
String title = StringUtils.isNotBlank(notifyMessageBatchQDTO.getTitle()) ? notifyMessageBatchQDTO.getTitle() : messageTypeEnum.getName();
List<ItemDTO> items = contentList.stream().map(bo -> {
ItemDTO item = new ItemDTO();
item.setKey(bo.getKey());
item.setValue(bo.getVal());
return item;
}).collect(Collectors.toList());
if (StringUtils.isNotBlank(data)) {
try {
data = URLEncoder.encode(data, StandardCharsets.UTF_8.name());
......@@ -262,10 +257,11 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
}
appUrl += "&data=" + data;
messageDTO.setAppid(config.getAppid());
messageDTO.setAgentId(Integer.parseInt(qwDTO.getAgentId()));
messageDTO.setUserIds(wxUserIdList);
messageDTO.setPage(appUrl);
messageDTO.setTitle(StringUtils.isNotBlank(title)?title: messageTypeEnum.getName());
messageDTO.setItems(items);
messageDTO.setContent(contentList.get(0).getVal());
boolean sendMessage = qywxSuiteApiService.sendMessage(qwDTO.getThirdCorpid(), config.getWxSuiteid(), messageDTO);
NotifyMessageMQDTO mqdto = new NotifyMessageMQDTO();
List<String> clerkIdList = list.stream().map(StaffClerkRelationDTO::getClerkId).collect(Collectors.toList());
......
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