From c9b520f0b85f689531c56ce0ae0451b610b81ed3 Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Mon, 9 Nov 2020 14:14:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=9A=E5=91=98=E5=AE=A1=E6=A0=B8=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E4=B8=8D=E5=8F=91=E7=AB=99=E5=86=85=E4=BF=A1=E5=92=8C?= =?UTF-8?q?=E8=AE=A2=E9=98=85=E4=BF=A1=E6=81=AF=E6=9C=89=E8=AF=AF=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxmpMessageServiceImpl.java | 19 ++++++++++++------- .../impl/PartyMemberConfirmServiceImpl.java | 3 ++- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java index f14f65ed64..ca8aa468dc 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java @@ -155,22 +155,27 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { if (WxmpMessageConstant.RESI.equals(clientType)) { UserBasicInfoFormDTO userBasicInfoFormDTO = new UserBasicInfoFormDTO(); userBasicInfoFormDTO.setUserId(userId); - UserBasicInfo data = epmetUserOpenFeignClient.getUserBasicInfo(userBasicInfoFormDTO).getData(); - if (data != null){ - openId = data.getOpenId(); + Result userBasicInfo = epmetUserOpenFeignClient.getUserBasicInfo(userBasicInfoFormDTO); + if (userBasicInfo.getCode() != 0){ + throw new Exception(userBasicInfo.getInternalMsg()); + }else { + openId = userBasicInfo.getData().getOpenId(); } } else if (WxmpMessageConstant.GOV_DB.equals(clientType)) { StaffBasicInfoFormDTO staffBasicInfoFormDTO = new StaffBasicInfoFormDTO(); staffBasicInfoFormDTO.setStaffId(userId); - StaffBasicInfo data = epmetUserOpenFeignClient.getStaffBasicInfo(staffBasicInfoFormDTO).getData(); - if (data != null){ - openId = data.getOpenId(); + Result staffBasicInfo = epmetUserOpenFeignClient.getStaffBasicInfo(staffBasicInfoFormDTO);; + if (staffBasicInfo.getCode() != 0){ + throw new Exception(staffBasicInfo.getInternalMsg()); + }else { + openId = staffBasicInfo.getData().getOpenId(); } } else { throw new WxSubscribeException("clientType有误", "", openId); } } catch (Exception e) { - throw new WxSubscribeException("连接User服务失败" + e.getMessage(), "", ""); + e.printStackTrace(); + throw new WxSubscribeException("获取openId失败:" + e.getMessage(), "", ""); } if (StringUtils.isBlank(openId)) { diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java index 40a823af98..5962ea22a2 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java @@ -645,6 +645,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService String messageContent = String.format(userMsg, gridName); userMessageFormDTO.setMessageContent(messageContent); userMessageFormDTO.setReadFlag(ReadFlagConstant.UN_READ); + userMessageFormDTO.setUserId(formDTO.getUserId()); //发送微信订阅消息 WxSubscribeMessageFormDTO wxSubscribeMessageFormDTO = new WxSubscribeMessageFormDTO(); @@ -652,7 +653,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService wxSubscribeMessageFormDTO.setUserId(formDTO.getUserId()); wxSubscribeMessageFormDTO.setClientType(AppClientConstant.APP_RESI); wxSubscribeMessageFormDTO.setGridId(formDTO.getGridId()); - wxSubscribeMessageFormDTO.setBehaviorType(ResiWarmUserMessageConstant.WX_WARMHEARTED_BEHAVIOR); + wxSubscribeMessageFormDTO.setBehaviorType(PartyMemberMessageConstant.WX_PARTY_AUTH_BEHAVIOR); wxSubscribeMessageFormDTO.setMessageContent(messageContent); wxSubscribeMessageFormDTO.setMessageTime(new Date()); List msgList = new ArrayList<>();