From c40f8e3d2e08e108780091776437242528bf61d6 Mon Sep 17 00:00:00 2001
From: 101captain <237651143@qq.com>
Date: 星期三, 20 七月 2022 17:44:56 +0800
Subject: [PATCH] bug修改
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActMessageServiceImpl.java | 27 +++++++++++++++++++++++++--
1 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActMessageServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActMessageServiceImpl.java
index f9a0851..82eae92 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActMessageServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActMessageServiceImpl.java
@@ -6,6 +6,12 @@
import javax.annotation.Resource;
+import com.panzhihua.common.model.vos.community.ComActDpcVO;
+import com.panzhihua.common.model.vos.user.SysTemplateConfigVO;
+import com.panzhihua.common.service.user.UserService;
+import com.panzhihua.service_community.dao.ComActDAO;
+import com.panzhihua.service_community.dao.ComActDpcDAO;
+import com.panzhihua.service_community.model.dos.ComActDO;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
@@ -30,6 +36,8 @@
import com.panzhihua.service_community.model.dos.ComActMessageDO;
import com.panzhihua.service_community.service.ComActMessageService;
+import static java.util.Objects.isNull;
+
@Service
public class ComActMessageServiceImpl extends ServiceImpl<ComActMessageDAO, ComActMessageDO>
implements ComActMessageService {
@@ -39,6 +47,12 @@
private ComActMessageBackDAO comActMessageBackDAO;
@Resource
private ComActActSignDAO comActActSignDAO;
+ @Resource
+ private ComActDAO comActDAO;
+ @Resource
+ private UserService userService;
+ @Resource
+ private ComActDpcDAO comActDpcDAO;
@Override
public R addMessage(ComActMessageVO comActMessageVO) {
@@ -58,6 +72,13 @@
return R.fail();
phone = party.getPhone();
sendtoUserName = party.getName();
+ } else if (type == 3) {
+ ComActDpcVO dpcVO = comActDpcDAO.detailDpc(comActMessageVO.getSendtoUserId());
+ if (isNull(dpcVO)) {
+ return R.fail();
+ }
+ phone = dpcVO.getPhone();
+ sendtoUserName = dpcVO.getName();
}
if (ObjectUtils.isEmpty(phone))
return R.fail("未找到联系方式");
@@ -198,9 +219,11 @@
if (map != null) {
String openid = map.get("openid");
WxXCXTempSend util = new WxXCXTempSend();
+ ComActDO comActDO=comActDAO.selectById(comActMessageBackVO.getCommunityId());
+ R<SysTemplateConfigVO> r=userService.selectTemplate(comActDO.getAreaCode(),2);
try {
- WxUtil.sendSubscribeLYHF(openid, util.getAppAccessToken(), comActMessageBackVO.getUserName(),
- DateUtils.format(new Date(), DateUtils.ymdhms_format), comActMessageBackVO.getMsgContent());
+ WxUtil.sendSubscribeLYHF(openid, util.getAccessToken(), comActMessageBackVO.getUserName(),
+ DateUtils.format(new Date(), DateUtils.ymdhms_format), comActMessageBackVO.getMsgContent(),r.getData().getTemplateId());
} catch (Exception e) {
log.error("消息推送失败,失败原因:" + e.getMessage());
}
--
Gitblit v1.7.1