修复customerId为空时错误

This commit is contained in:
huangdeliang 2021-05-21 09:34:26 +08:00
parent 84e9236208
commit 562180c7d4

View File

@ -488,8 +488,17 @@ public class WechatAppletController extends BaseController {
} }
@GetMapping("/getRecipesPlans") @GetMapping("/getRecipesPlans")
public AjaxResult getRecipesPlans(@RequestParam String customerId) { public AjaxResult getRecipesPlans(@RequestParam String customerId, @RequestParam String openid) {
Long cusId = StringUtils.isNotEmpty(customerId) ? Long.parseLong(AesUtils.decrypt(customerId)) : 0L; 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<SysRecipesPlanListInfo> plans = sysRecipesPlanService.selectRecipesPlanListInfoByCusId(cusId); List<SysRecipesPlanListInfo> plans = sysRecipesPlanService.selectRecipesPlanListInfoByCusId(cusId);