傅行帆 6 年 前
コミット
e2ae9be638

+ 29
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/MessageServiceImpl.java ファイルの表示

1
 package com.community.huiju.service.impl;
1
 package com.community.huiju.service.impl;
2
 
2
 
3
+import com.community.commom.constant.Constant;
3
 import com.community.huiju.dao.TpMessageMapper;
4
 import com.community.huiju.dao.TpMessageMapper;
4
 import com.community.huiju.model.TpMessage;
5
 import com.community.huiju.model.TpMessage;
5
 import com.community.huiju.service.MessageServiceI;
6
 import com.community.huiju.service.MessageServiceI;
49
 		List<TpMessage> messageList = tpMessageMapper.getMessages(userId,communityId, modelType);
50
 		List<TpMessage> messageList = tpMessageMapper.getMessages(userId,communityId, modelType);
50
 		messageList.stream().forEach(tpMessage -> {
51
 		messageList.stream().forEach(tpMessage -> {
51
 			if (!StringUtils.isEmpty(tpMessage.getMessageDetailUrl())){
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
 		Map<String,Object> map = new HashMap<>();
57
 		Map<String,Object> map = new HashMap<>();
57
 		map.put("total",page.getTotal());
59
 		map.put("total",page.getTotal());
58
 		return map;
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
 	
125
 	
126
     public static final String SUCCESS = "success";
126
     public static final String SUCCESS = "success";
127
     
127
     
128
+    /**
129
+     * 直辖市
130
+     */
128
 	public static final Integer Beijing = 2;
131
 	public static final Integer Beijing = 2;
129
 	
132
 	
130
 	public static final Integer Tianjin = 19;
133
 	public static final Integer Tianjin = 19;
132
 	public static final Integer Shanghai = 857;
135
 	public static final Integer Shanghai = 857;
133
 	
136
 	
134
 	public static final Integer Chongqing = 2459;
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
ファイル差分が大きすぎるため省略します
ファイルの表示