weiximei 6 gadus atpakaļ
vecāks
revīzija
1606e153c1

+ 14
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/MessageController.java Parādīt failu

@@ -111,4 +111,18 @@ public class MessageController extends BaseController {
111 111
 		messageService.updateMessageReadStatus(communityId, userId);
112 112
 		return responseBean;
113 113
 	}
114
+
115
+
116
+	@ApiOperation(value = "根据消息id进行已读", notes = "根据消息id进行已读")
117
+	@ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "String", name = "messageId", value = "消息id"),
118
+			@ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")})
119
+	@RequestMapping(value = "/messageIdreadStatus/{messageId}",method = RequestMethod.PUT)
120
+	public ResponseBean updateMessageByIdReadStatus(HttpSession session, @PathVariable("messageId") Integer messageId) {
121
+		ResponseBean responseBean = new ResponseBean();
122
+		UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
123
+		responseBean = messageService.updateMessageByIdReadStatus(userElement, messageId);
124
+		return responseBean;
125
+	}
126
+
127
+
114 128
 }

+ 7
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpMessageMapper.java Parādīt failu

@@ -53,4 +53,11 @@ public interface TpMessageMapper {
53 53
      * @return
54 54
      */
55 55
     TpMessage selectConditionsTpMessage(Map<String, Object> map);
56
+
57
+    /**
58
+     * 根据条件查询 消息代办
59
+     * @param map
60
+     * @return
61
+     */
62
+    TpMessage selectBillinvoiceMessage(Map<String, Object> map);
56 63
 }

+ 11
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/MessageServiceI.java Parādīt failu

@@ -1,5 +1,8 @@
1 1
 package com.community.huiju.service;
2 2
 
3
+import com.community.commom.mode.ResponseBean;
4
+import com.community.commom.session.UserElement;
5
+
3 6
 import java.util.Map;
4 7
 
5 8
 public interface MessageServiceI {
@@ -24,4 +27,12 @@ public interface MessageServiceI {
24 27
 	 * 全部已读
25 28
 	 */
26 29
 	void updateMessageReadStatus(Integer communityId, Integer userId);
30
+
31
+	/**
32
+	 * 根据消息的id, 进行已读操作
33
+	 * @param userElement
34
+	 * @param messageId
35
+	 * @return
36
+	 */
37
+	ResponseBean updateMessageByIdReadStatus(UserElement userElement, Integer messageId);
27 38
 }

+ 24
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/MessageServiceImpl.java Parādīt failu

@@ -1,6 +1,8 @@
1 1
 package com.community.huiju.service.impl;
2 2
 
3 3
 import com.community.commom.constant.Constant;
4
+import com.community.commom.mode.ResponseBean;
5
+import com.community.commom.session.UserElement;
4 6
 import com.community.huiju.dao.TpBillInvoiceMapper;
5 7
 import com.community.huiju.dao.TpBillMapper;
6 8
 import com.community.huiju.dao.TpMessageMapper;
@@ -13,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
13 15
 import org.springframework.stereotype.Service;
14 16
 import org.springframework.util.StringUtils;
15 17
 
18
+import java.util.Date;
16 19
 import java.util.HashMap;
17 20
 import java.util.List;
18 21
 import java.util.Map;
@@ -112,4 +115,25 @@ public class MessageServiceImpl implements MessageServiceI {
112 115
 	public void updateMessageReadStatus(Integer communityId, Integer userId) {
113 116
 		tpMessageMapper.updateReadStatus(communityId, userId);
114 117
 	}
118
+
119
+	@Override
120
+	public ResponseBean updateMessageByIdReadStatus(UserElement userElement, Integer messageId) {
121
+		ResponseBean responseBean = new ResponseBean();
122
+
123
+		TpMessage tpMessage = tpMessageMapper.selectByPrimaryKey(messageId);
124
+		if (null == tpMessage) {
125
+			responseBean.addError("消息不存在!");
126
+			return responseBean;
127
+		}
128
+		tpMessage.setReadStatus("1");
129
+		tpMessage.setUpdateDate(new Date());
130
+		tpMessage.setUpdateUser(userElement.getId());
131
+		int row = tpMessageMapper.updateByPrimaryKeySelective(tpMessage);
132
+		if (row > 0) {
133
+			responseBean.addSuccess("操作成功!");
134
+			return responseBean;
135
+		}
136
+		responseBean.addError("操作失败!");
137
+		return responseBean;
138
+	}
115 139
 }

+ 14
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/WxPayServiceImpl.java Parādīt failu

@@ -8,6 +8,7 @@ import com.community.huiju.common.wxpay.WXPayUtil;
8 8
 import com.community.huiju.dao.*;
9 9
 import com.community.huiju.model.*;
10 10
 import com.community.huiju.service.WxPayServiceI;
11
+import com.google.common.collect.Maps;
11 12
 import org.slf4j.Logger;
12 13
 import org.slf4j.LoggerFactory;
13 14
 import org.springframework.beans.factory.annotation.Autowired;
@@ -43,6 +44,9 @@ public class WxPayServiceImpl implements WxPayServiceI {
43 44
 	@Autowired
44 45
 	private TaSysRoleMapper taSysRoleMapper;
45 46
 
47
+	@Autowired
48
+	private TpMessageMapper tpMessageMapper;
49
+
46 50
 	/**
47 51
 	 * 微信支付统一下单
48 52
 	 *
@@ -165,6 +169,16 @@ public class WxPayServiceImpl implements WxPayServiceI {
165 169
 		}
166 170
 		tpBillMapper.updateByPrimaryKeySelective(tpBill);
167 171
 
172
+
173
+		// 把相对应的APP端, 代办消息设置为无效
174
+		Map<String, Object> map = Maps.newHashMap();
175
+		map.put("communityId", tpBillInvoice.getCommunityId());
176
+		map.put("billInvoiceId", tpBillInvoice.getId());
177
+		map.put("userId", tpBillInvoice.getTaUserId());
178
+		TpMessage tpMessage = tpMessageMapper.selectBillinvoiceMessage(map);
179
+		tpMessage.setStatus("0");
180
+		tpMessageMapper.updateByPrimaryKeySelective(tpMessage);
181
+
168 182
 		return "success";
169 183
 	}
170 184
 	

+ 2
- 1
CODE/smart-community/app-api/src/main/resources/mapper/TpBillInvoiceMapper.xml Parādīt failu

@@ -265,7 +265,8 @@
265 265
         s.pay_name AS payName,
266 266
         s.pay_remark AS payRemark,
267 267
         s.pay_type AS payType,
268
-        s.create_time AS createTime
268
+        s.create_time AS createTime,
269
+        i.out_trade_no AS outTradeNo
269 270
     FROM
270 271
         tp_bill_invoice i
271 272
         LEFT JOIN tp_bill b ON b.id = i.bill_id

+ 14
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpMessageMapper.xml Parādīt failu

@@ -433,4 +433,18 @@
433 433
       </if>
434 434
     </trim>
435 435
   </select>
436
+
437
+  <select id="selectBillinvoiceMessage" resultMap="BaseResultMap" parameterType="map">
438
+    select
439
+    <include refid="Base_Column_List" />
440
+    from tp_message
441
+    where
442
+    community_id = #{map.communityId}
443
+    and bill_id = #{map.billInvoiceId}
444
+    and uuid_type = 1
445
+    and uuid = #{map.userId}
446
+    and message_type = 7
447
+    and advice_type = 1
448
+    and source = 2
449
+  </select>
436 450
 </mapper>

+ 14
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BillInvoiceServiceImpl.java Parādīt failu

@@ -201,6 +201,20 @@ public class BillInvoiceServiceImpl extends ServiceImpl<BillInvoiceMapper, BillI
201 201
                 }
202 202
                 billMapper.updateById(bill);
203 203
 
204
+                // 把相对应的 APP端用户的代办消息进行设置为无效
205
+                QueryWrapper<Message> messageQueryWrapper = new QueryWrapper<>();
206
+                messageQueryWrapper.eq("community_id", userElement.getCommunityId());
207
+                messageQueryWrapper.eq("bill_id", billInvoice.getId());
208
+                messageQueryWrapper.eq("uuid_type", "1");
209
+                messageQueryWrapper.eq("uuid", billInvoice.getTaUserId());
210
+                messageQueryWrapper.eq("message_type", "7");
211
+                messageQueryWrapper.eq("advice_type", "1");
212
+                messageQueryWrapper.eq("source", "2");
213
+
214
+                Message one = iMessageService.getOne(messageQueryWrapper);
215
+                one.setStatus("0");
216
+                iMessageService.updateById(one);
217
+
204 218
             }
205 219
         });
206 220