diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/controller/ProductController.java b/src/main/java/com/chaozhanggui/system/cashierservice/controller/ProductController.java index 0c97755..3dc9fe1 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/controller/ProductController.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/ProductController.java @@ -2,6 +2,7 @@ package com.chaozhanggui.system.cashierservice.controller; import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONObject; import com.chaozhanggui.system.cashierservice.entity.dto.ChoseCountDTO; import com.chaozhanggui.system.cashierservice.entity.dto.ChoseEatModelDTO; @@ -42,8 +43,11 @@ public class ProductController { @RequestParam(required = false) String lat, @RequestParam(required = false) String lng, @RequestParam(required = false) String code, - @RequestParam Integer shopId + @RequestParam(required = false) Integer shopId ) { + if (shopId == null && StrUtil.isNotBlank(code)) { + return Result.fail("参数缺失"); + } return productService.queryShopIdByTableCode(userId, openId, code,lat,lng, shopId); }