From 50e1eb020efe8da670b718d865fa4c1eaa61ee7d Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期四, 20 五月 2021 19:51:09 +0800
Subject: [PATCH] 修改bug

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActMessageServiceImpl.java |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 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 94ccd4b..2934883 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
@@ -113,6 +113,11 @@
 		}
 		page.setSize(pageSize);
 		page.setCurrent(pageNum);
+		String phone = comActMessageVO.getPhone();
+		if(ObjectUtils.isEmpty(phone)) {
+			IPage<PageComActMessageVO> iPage=null;
+			return R.ok(iPage);
+		}
 		IPage<PageComActMessageVO> iPage = comActMessageDAO.pageSendMeMessageApplets(page, comActMessageVO);
 		List<PageComActMessageVO> records = iPage.getRecords();
 		if (!ObjectUtils.isEmpty(records)) {
@@ -149,6 +154,22 @@
             records.forEach(comActMessageVO1 -> {
                 Long id = comActMessageVO1.getId();
                 List<ComActMessageBackVO> list = comActMessageDAO.selectMsgBackList(id);
+                if(list!=null&& list.size()>0) {
+					list.forEach(vo -> {
+						Long type = comActMessageVO1.getType();
+						if (type == 1) {
+							ComPbServiceTeamVO team = comActMessageDAO.selectComPbServiceTeamById(comActMessageVO1.getSendtoUserId());
+							if (!ObjectUtils.isEmpty(team)) {
+								vo.setUserJob(team.getJob());
+							}
+						} else if (type == 2) {
+							PartyCommitteeVO party = comActMessageDAO.selectPartyCommitteeById(comActMessageVO1.getSendtoUserId());
+							if (!ObjectUtils.isEmpty(party)) {
+								vo.setUserJob(party.getPosition());
+							}
+						}
+					});
+				}
                 comActMessageVO1.setBackList(list);
             });
             iPage.setRecords(records);
@@ -189,6 +210,7 @@
             records.forEach(comActMessageVO1 -> {
                 Long id = comActMessageVO1.getId();
                 List<ComActMessageBackVO> list = comActMessageDAO.selectMsgBackList(id);
+
                 comActMessageVO1.setBackList(list);
             });
             iPage.setRecords(records);
@@ -220,4 +242,15 @@
 		return R.ok();
 	}
 
+	@Override
+	public R detailMessage(Long id) {
+		ComActMessageDO comActMessageDO = comActMessageDAO.selectById(id);
+		PageComActMessageVO vo=new PageComActMessageVO();
+		BeanUtils.copyProperties(comActMessageDO, vo);
+        List<ComActMessageBackVO> list = comActMessageDAO.selectMsgBackList(id);
+        vo.setBackList(list);
+		// TODO Auto-generated method stub
+		return R.ok(vo);
+	}
+
 }

--
Gitblit v1.7.1