Kaynağa Gözat

:package: 搜索商品接口增加英文名称

Twelve615 1 yıl önce
ebeveyn
işleme
6281d70e5e

+ 7 - 2
jlsb/jeecg-boot-module-system/src/main/java/org/jeecg/modules/aa/controller/APIIndexenterController.java

@@ -181,9 +181,14 @@ public class APIIndexenterController {
     @ApiOperationSupport(order = 20)
     @ApiOperation(value = "搜索商品", notes = "按商品名称模糊搜索商品")
     @GetMapping(value = "/queryCommpdity")
-    public Result<List<AaCommodity>> getCommpdityD(@ApiParam(name="name",value="商品名称")String name) {
+    public Result<List<AaCommodity>> getCommpdityD(@ApiParam(name="name",value="商品名称")String name,@ApiParam(name="nameEnglish",value="商品名称英文") String nameEnglish) {
         LambdaQueryWrapper<AaCommodity> queryMapper = new LambdaQueryWrapper<>();
-        queryMapper.like(AaCommodity::getName,name);
+        if(!Strings.isNullOrEmpty(name)) {
+            queryMapper.like(AaCommodity::getName,name);
+        }
+        if(!Strings.isNullOrEmpty(nameEnglish)) {
+            queryMapper.like(AaCommodity::getNameEnglish,nameEnglish);
+        }
         List<AaCommodity> list = aaCommodityService.list(queryMapper);
         return Result.OK(list);
     }