From 06a02f3a5c9139e1a4be7114337c769aa4d486fc Mon Sep 17 00:00:00 2001 From: "Stormeye.Wu" Date: Mon, 27 Aug 2018 05:25:07 +0800 Subject: [PATCH] =?UTF-8?q?[B=E7=AB=AF=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E6=A3=80=E6=9F=A5][=E6=96=B0=E5=A2=9E]:=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E5=90=8C=E4=B8=80=E4=B8=AAappId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxMerchantBUserServiceImpl.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mallinkService/src/main/java/com/simple/service/impl/WxMerchantBUserServiceImpl.java b/mallinkService/src/main/java/com/simple/service/impl/WxMerchantBUserServiceImpl.java index 2a2b30a57..c586099bd 100644 --- a/mallinkService/src/main/java/com/simple/service/impl/WxMerchantBUserServiceImpl.java +++ b/mallinkService/src/main/java/com/simple/service/impl/WxMerchantBUserServiceImpl.java @@ -95,6 +95,7 @@ public class WxMerchantBUserServiceImpl implements WxMerchantBUserService { @Override public ResultData updatepwd(String appId, String phone, String code, String pwd) { + WxAppinfo appinfo = wxAppinfoMapper.findByAppId(appId); WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); wxMsgValidationcode.setPhone(phone); wxMsgValidationcode.setCode(code); @@ -105,15 +106,13 @@ public class WxMerchantBUserServiceImpl implements WxMerchantBUserService { if(wxmsgvalidationcodelist.size()>0){ //更新 WxMerchantBUser bUser = new WxMerchantBUser(); + bUser.setTenantId(appinfo.getTenantId()); bUser.setPhone(phone); + bUser.setAppId(appId); List list = wxMerchantBUserMapper.findList(bUser); if(list.size()>0){ bUser = list.get(0); - if (bUser.getAppId().equalsIgnoreCase(appId)) - { - logger.error("B端用户不是这个app的用户:" + appId); - throw new MallinkException(ErrorCode.BUSER_NOT_IN_APP); - } + bUser.setBUserPwd(pwd); try{ wxMerchantBUserMapper.updateByPrimaryKeySelective(bUser); @@ -121,6 +120,9 @@ public class WxMerchantBUserServiceImpl implements WxMerchantBUserService { logger.error("db failed: 商户-" + bUser.getId() + ", e:" + e.getMessage()); throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); } + } else { + logger.error("B端用户不是这个app的用户:" + appId); + throw new MallinkException(ErrorCode.BUSER_NOT_IN_APP); } } return new ResultData();