dingxin 6 年之前
父節點
當前提交
a25e26c560

+ 14
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/MessageController.java 查看文件

111
 		messageService.updateMessageReadStatus(communityId, userId);
111
 		messageService.updateMessageReadStatus(communityId, userId);
112
 		return responseBean;
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 查看文件

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

+ 11
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/MessageServiceI.java 查看文件

1
 package com.community.huiju.service;
1
 package com.community.huiju.service;
2
 
2
 
3
+import com.community.commom.mode.ResponseBean;
4
+import com.community.commom.session.UserElement;
5
+
3
 import java.util.Map;
6
 import java.util.Map;
4
 
7
 
5
 public interface MessageServiceI {
8
 public interface MessageServiceI {
24
 	 * 全部已读
27
 	 * 全部已读
25
 	 */
28
 	 */
26
 	void updateMessageReadStatus(Integer communityId, Integer userId);
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 查看文件

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.commom.constant.Constant;
4
+import com.community.commom.mode.ResponseBean;
5
+import com.community.commom.session.UserElement;
4
 import com.community.huiju.dao.TpBillInvoiceMapper;
6
 import com.community.huiju.dao.TpBillInvoiceMapper;
5
 import com.community.huiju.dao.TpBillMapper;
7
 import com.community.huiju.dao.TpBillMapper;
6
 import com.community.huiju.dao.TpMessageMapper;
8
 import com.community.huiju.dao.TpMessageMapper;
13
 import org.springframework.stereotype.Service;
15
 import org.springframework.stereotype.Service;
14
 import org.springframework.util.StringUtils;
16
 import org.springframework.util.StringUtils;
15
 
17
 
18
+import java.util.Date;
16
 import java.util.HashMap;
19
 import java.util.HashMap;
17
 import java.util.List;
20
 import java.util.List;
18
 import java.util.Map;
21
 import java.util.Map;
112
 	public void updateMessageReadStatus(Integer communityId, Integer userId) {
115
 	public void updateMessageReadStatus(Integer communityId, Integer userId) {
113
 		tpMessageMapper.updateReadStatus(communityId, userId);
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 查看文件

8
 import com.community.huiju.dao.*;
8
 import com.community.huiju.dao.*;
9
 import com.community.huiju.model.*;
9
 import com.community.huiju.model.*;
10
 import com.community.huiju.service.WxPayServiceI;
10
 import com.community.huiju.service.WxPayServiceI;
11
+import com.google.common.collect.Maps;
11
 import org.slf4j.Logger;
12
 import org.slf4j.Logger;
12
 import org.slf4j.LoggerFactory;
13
 import org.slf4j.LoggerFactory;
13
 import org.springframework.beans.factory.annotation.Autowired;
14
 import org.springframework.beans.factory.annotation.Autowired;
43
 	@Autowired
44
 	@Autowired
44
 	private TaSysRoleMapper taSysRoleMapper;
45
 	private TaSysRoleMapper taSysRoleMapper;
45
 
46
 
47
+	@Autowired
48
+	private TpMessageMapper tpMessageMapper;
49
+
46
 	/**
50
 	/**
47
 	 * 微信支付统一下单
51
 	 * 微信支付统一下单
48
 	 *
52
 	 *
165
 		}
169
 		}
166
 		tpBillMapper.updateByPrimaryKeySelective(tpBill);
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
 		return "success";
182
 		return "success";
169
 	}
183
 	}
170
 	
184
 	

+ 2
- 1
CODE/smart-community/app-api/src/main/resources/mapper/TpBillInvoiceMapper.xml 查看文件

265
         s.pay_name AS payName,
265
         s.pay_name AS payName,
266
         s.pay_remark AS payRemark,
266
         s.pay_remark AS payRemark,
267
         s.pay_type AS payType,
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
     FROM
270
     FROM
270
         tp_bill_invoice i
271
         tp_bill_invoice i
271
         LEFT JOIN tp_bill b ON b.id = i.bill_id
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 查看文件

433
       </if>
433
       </if>
434
     </trim>
434
     </trim>
435
   </select>
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
 </mapper>
450
 </mapper>

+ 14
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BillInvoiceServiceImpl.java 查看文件

201
                 }
201
                 }
202
                 billMapper.updateById(bill);
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