From 7bfa6a85ad6a6c537b0f7ddb9f6a8795c8e8c866 Mon Sep 17 00:00:00 2001
From: puhanshu <a9236326>
Date: 星期四, 09 六月 2022 16:44:24 +0800
Subject: [PATCH] 五社&社区企业&人大代表

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActMessageServiceImpl.java |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 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 d127ad1..12c821e 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,9 +6,11 @@
 
 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;
@@ -34,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 {
@@ -47,6 +51,8 @@
     private ComActDAO comActDAO;
     @Resource
     private UserService userService;
+    @Resource
+    private ComActDpcDAO comActDpcDAO;
 
     @Override
     public R addMessage(ComActMessageVO comActMessageVO) {
@@ -66,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("未找到联系方式");

--
Gitblit v1.7.1