Browse Source

APP登录修复

Michael 8 years ago
parent
commit
ba2d3c767e

+ 2 - 0
src/main/java/com/goafanti/common/mapper/MessageFromSystemMapper.xml

@@ -465,9 +465,11 @@
 			message_from_system c on a.message_id = c.id
 		where
 			a.consumer_id = #{uid,jdbcType=VARCHAR}
+		 	and b.registration_id is not null
 			and a.send_time is null <!-- 未发送 -->
 			and c.is_draft = 0 <!-- 非草稿 -->
 			and c.delete_sign = 0 <!-- 未删除 -->
+		
    </select>
    
    <update id="updateJpushEasemobAccount">

+ 4 - 2
src/main/java/com/goafanti/message/JGMessageHelper.java

@@ -56,6 +56,8 @@ public class JGMessageHelper implements InitializingBean, DisposableBean{
         try {
             URI uri = new URI(host + clientConfig.get(ClientConfig.PUSH_PATH));
             PushPayload payload = messageAdapter.getPushPayload();
+           if(payload == null) System.out.println("*******************shit*********************");
+            System.out.println(payload.toJSON());
             client.sendRequest(HttpMethod.POST, payload.toString(), uri, new NettyHttpClient.BaseCallback() {
                 @Override
                 public void onSucceed(ResponseWrapper responseWrapper) {
@@ -94,8 +96,8 @@ public class JGMessageHelper implements InitializingBean, DisposableBean{
 					.setTitle(mb.getMessageTitle())
 					.setMsgContent(mb.getMessageBody())
 					.addExtra(MESSAGE_ID,mb.getMessageId())
-					.addExtra(RESOURCE_ID,mb.getResourceId())
-					.addExtra(RESOURCE_TYPE, mb.getResourceType())
+					.addExtra(RESOURCE_ID,mb.getResourceId() == null ? "" : mb.getResourceId())
+					.addExtra(RESOURCE_TYPE, mb.getResourceType()== null ? "": mb.getResourceType())
 					.build())
 			.build());
 		send(ma);