From 9710b321de6127ec90a01dd2d39db5404b0fdd57 Mon Sep 17 00:00:00 2001 From: liyj <1617420630@qq.com> Date: Wed, 24 Sep 2025 09:11:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E8=AE=A2=E9=98=85=E5=8F=91?= =?UTF-8?q?=E9=80=81=E4=BB=BB=E5=8A=A1=E4=BF=AE=E6=94=B9=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=9F=A5=E8=AF=A2-=E4=B8=8D=E4=BD=BF?= =?UTF-8?q?=E7=94=A8findOne?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/AccountUserBindConnectServiceImpl.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/mall-account/src/main/java/com/suisung/mall/account/service/impl/AccountUserBindConnectServiceImpl.java b/mall-account/src/main/java/com/suisung/mall/account/service/impl/AccountUserBindConnectServiceImpl.java index b4f12cfa..54fa1f54 100644 --- a/mall-account/src/main/java/com/suisung/mall/account/service/impl/AccountUserBindConnectServiceImpl.java +++ b/mall-account/src/main/java/com/suisung/mall/account/service/impl/AccountUserBindConnectServiceImpl.java @@ -542,20 +542,21 @@ public class AccountUserBindConnectServiceImpl extends BaseServiceImpl accountUserBindConnectList= list(queryWrapper); + if (!accountUserBindConnectList.isEmpty()) { + AccountUserBindConnect accountUserBindConnect=accountUserBindConnectList.get(0); JSONArray jsonArray= jsonObject.getJSONArray("List"); if (jsonArray != null) { JSONObject object= (JSONObject) jsonArray.get(0); String templateId= object.getStr("TemplateId");//模板id String SubscribeStatusString= object.getStr("SubscribeStatusString");//订阅结果(accept接收;reject拒收)参考地址https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message.html#%E8%AE%A2%E9%98%85%E6%B6%88%E6%81%AF%E8%AF%AD%E9%9F%B3%E6%8F%90%E9%86%92 if(SubscribeStatusString.equals("accept")){ - accountUserBindConnect.setBind_tmpl(templateId); - UpdateWrapper updateWrapper = new UpdateWrapper<>(accountUserBindConnect); - updateWrapper.set("bind_id",accountUserBindConnect.getBind_id()); - updateWrapper.set("bind_type",accountUserBindConnect.getBind_type()); - updateWrapper.set("user_id",accountUserBindConnect.getUser_id()); - updateWrapper.set("user_type",accountUserBindConnect.getUser_type()); + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.set("bind_tmpl",templateId); + updateWrapper.eq("bind_id",accountUserBindConnect.getBind_id()); + updateWrapper.eq("bind_type",accountUserBindConnect.getBind_type()); + updateWrapper.eq("user_id",accountUserBindConnect.getUser_id()); + updateWrapper.eq("user_type",accountUserBindConnect.getUser_type()); update(updateWrapper); } }