weiximei 6 년 전
부모
커밋
19e7a7725d

+ 29
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/MessageServiceImpl.java 파일 보기

@@ -1,5 +1,6 @@
1 1
 package com.community.huiju.service.impl;
2 2
 
3
+import com.community.commom.constant.Constant;
3 4
 import com.community.huiju.dao.TpMessageMapper;
4 5
 import com.community.huiju.model.TpMessage;
5 6
 import com.community.huiju.service.MessageServiceI;
@@ -49,7 +50,8 @@ public class MessageServiceImpl implements MessageServiceI {
49 50
 		List<TpMessage> messageList = tpMessageMapper.getMessages(userId,communityId, modelType);
50 51
 		messageList.stream().forEach(tpMessage -> {
51 52
 			if (!StringUtils.isEmpty(tpMessage.getMessageDetailUrl())){
52
-				tpMessage.setMessageDetailUrl(tpMessage.getMessageDetailUrl() + "&id=" + tpMessage.getTicketId());
53
+				Integer id = getMessageIdByType(tpMessage);
54
+				tpMessage.setMessageDetailUrl(tpMessage.getMessageDetailUrl() + "&id=" + id);
53 55
 			}
54 56
 		});
55 57
 		Map<String,Object> map = new HashMap<>();
@@ -57,7 +59,32 @@ public class MessageServiceImpl implements MessageServiceI {
57 59
 		map.put("total",page.getTotal());
58 60
 		return map;
59 61
 	}
60
-
62
+	
63
+	/**
64
+	 * 根据不同的类型取不同的id
65
+	 * @param tpMessage
66
+	 */
67
+	private Integer getMessageIdByType(TpMessage tpMessage) {
68
+		Integer id = tpMessage.getTicketId();
69
+		switch (tpMessage.getMessageType()){
70
+			case Constant.MESSAGE_TYPE_VISITOR:
71
+				break;
72
+			case Constant.MESSAGE_TYPE_ANNOUNCEMENT:
73
+				id = tpMessage.getAnnouncementId();
74
+				break;
75
+			case Constant.MESSAGE_TYPE_SYS:
76
+				break;
77
+			case Constant.MESSAGE_TYPE_BILL:
78
+				id = tpMessage.getBillId();
79
+				break;
80
+			case Constant.MESSAGE_TYPE_ACTIVITY:
81
+				id = tpMessage.getActivityId();
82
+				break;
83
+		}
84
+		
85
+		return id;
86
+	}
87
+	
61 88
 	/**
62 89
 	 * 消息全部已读
63 90
 	 */

+ 28
- 0
CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java 파일 보기

@@ -125,6 +125,9 @@ public class Constant {
125 125
 	
126 126
     public static final String SUCCESS = "success";
127 127
     
128
+    /**
129
+     * 直辖市
130
+     */
128 131
 	public static final Integer Beijing = 2;
129 132
 	
130 133
 	public static final Integer Tianjin = 19;
@@ -132,4 +135,29 @@ public class Constant {
132 135
 	public static final Integer Shanghai = 857;
133 136
 	
134 137
 	public static final Integer Chongqing = 2459;
138
+    
139
+    /**
140
+     * 访客消息
141
+     */
142
+    public static final String MESSAGE_TYPE_VISITOR = "4";
143
+    
144
+    /**
145
+     * 公告
146
+     */
147
+    public static final String MESSAGE_TYPE_ANNOUNCEMENT = "5";
148
+    
149
+    /**
150
+     * 系统通知
151
+     */
152
+    public static final String MESSAGE_TYPE_SYS = "6";
153
+    
154
+    /**
155
+     * 收费单
156
+     */
157
+    public static final String MESSAGE_TYPE_BILL = "7";
158
+    
159
+    /**
160
+     * 收费单
161
+     */
162
+    public static final String MESSAGE_TYPE_ACTIVITY = "8";
135 163
 }

+ 205
- 169
文档/MYSQL/smartCommunity.pdb
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
파일 보기


+ 205
- 169
文档/MYSQL/smartCommunity.pdm
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
파일 보기