From 562180c7d4e516922429320ba66de88e3b7ad99c Mon Sep 17 00:00:00 2001 From: huangdeliang Date: Fri, 21 May 2021 09:34:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DcustomerId=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E6=97=B6=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/custom/WechatAppletController.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/WechatAppletController.java b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/WechatAppletController.java index afe347d0f..9b11f3091 100644 --- a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/WechatAppletController.java +++ b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/WechatAppletController.java @@ -488,8 +488,17 @@ public class WechatAppletController extends BaseController { } @GetMapping("/getRecipesPlans") - public AjaxResult getRecipesPlans(@RequestParam String customerId) { - Long cusId = StringUtils.isNotEmpty(customerId) ? Long.parseLong(AesUtils.decrypt(customerId)) : 0L; + public AjaxResult getRecipesPlans(@RequestParam String customerId, @RequestParam String openid) { + Long cusId = 0L; + if (StringUtils.isNull(customerId)) { + SysWxUserInfo wxUserInfo = sysWxUserInfoService.selectSysWxUserInfoById(openid); + cusId = StringUtils.isNotNull(wxUserInfo) ? wxUserInfo.getCusId() : 0L; + } else { + cusId = StringUtils.isNotEmpty(customerId) ? Long.parseLong(AesUtils.decrypt(customerId)) : 0L; + } + if (cusId == 0L) { + return AjaxResult.error(5000, "需要手机号进一步匹配"); + } List plans = sysRecipesPlanService.selectRecipesPlanListInfoByCusId(cusId);