From d8ee6434f86906fd6e02d4a4af493f7c6a32a2d8 Mon Sep 17 00:00:00 2001 From: sdhkjh <2450473462@qq.com> Date: Sun, 22 Sep 2024 14:30:44 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20StoreType=E8=A1=A8=E5=A2=9E=E5=8A=A0ena?= =?UTF-8?q?bled=E5=AD=97=E6=95=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/skyeye/type/controller/StoreTypeController.java | 4 +++- .../src/main/java/com/skyeye/type/entity/StoreType.java | 4 ++++ .../skyeye/type/service/impl/StoreTypeServiceImpl.java | 8 +++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/skyeye-shop/shop-store/src/main/java/com/skyeye/type/controller/StoreTypeController.java b/skyeye-shop/shop-store/src/main/java/com/skyeye/type/controller/StoreTypeController.java index 93ce33ae..4fa56c07 100644 --- a/skyeye-shop/shop-store/src/main/java/com/skyeye/type/controller/StoreTypeController.java +++ b/skyeye-shop/shop-store/src/main/java/com/skyeye/type/controller/StoreTypeController.java @@ -15,6 +15,7 @@ import com.skyeye.type.service.StoreTypeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; + /** * @ClassName: StoreTypeController * @Description: 门店商品分类管理控制类 @@ -65,7 +66,8 @@ public class StoreTypeController { */ @ApiOperation(id = "queryStoreTypeList", value = "获取门店商品分类信息", method = "POST", allUse = "2") @ApiImplicitParams({ - @ApiImplicitParam(id = "storeId", name = "storeId", value = "门店id")}) + @ApiImplicitParam(id = "storeId", name = "storeId", value = "门店id"), + @ApiImplicitParam(id = "enabled", name = "enabled", value = "状态1是0否")}) @RequestMapping("/post/StoreTypeController/queryStoreTypeList") public void queryStoreTypeList(InputObject inputObject, OutputObject outputObject) { storeTypeService.queryList(inputObject, outputObject); diff --git a/skyeye-shop/shop-store/src/main/java/com/skyeye/type/entity/StoreType.java b/skyeye-shop/shop-store/src/main/java/com/skyeye/type/entity/StoreType.java index 2d9571a3..c4d7ec9b 100644 --- a/skyeye-shop/shop-store/src/main/java/com/skyeye/type/entity/StoreType.java +++ b/skyeye-shop/shop-store/src/main/java/com/skyeye/type/entity/StoreType.java @@ -34,6 +34,10 @@ public class StoreType extends BaseGeneralInfo { @ApiModelProperty(value = "排序", required = "required") private Integer orderBy; + @TableField("enabled") + @ApiModelProperty(value = "启用状态1是0否,参考#WhetherEnum", required = "required") + private Integer enabled; + @TableField(value = "store_id") @ApiModelProperty(value = "门店id") private String storeId; diff --git a/skyeye-shop/shop-store/src/main/java/com/skyeye/type/service/impl/StoreTypeServiceImpl.java b/skyeye-shop/shop-store/src/main/java/com/skyeye/type/service/impl/StoreTypeServiceImpl.java index 71ac6977..55fe22c3 100644 --- a/skyeye-shop/shop-store/src/main/java/com/skyeye/type/service/impl/StoreTypeServiceImpl.java +++ b/skyeye-shop/shop-store/src/main/java/com/skyeye/type/service/impl/StoreTypeServiceImpl.java @@ -4,6 +4,7 @@ package com.skyeye.type.service.impl; +import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.skyeye.annotation.service.SkyeyeService; @@ -40,8 +41,13 @@ public class StoreTypeServiceImpl extends SkyeyeBusinessServiceImpl> queryDataList(InputObject inputObject) { + Map params = inputObject.getParams(); + System.out.println(params); QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq(MybatisPlusUtil.toColumns(StoreType::getStoreId), inputObject.getParams().get("storeId")); + queryWrapper.eq(MybatisPlusUtil.toColumns(StoreType::getStoreId), params.get("storeId").toString()); + if (params.containsKey("enabled") && StrUtil.isNotEmpty(params.get("enabled").toString())) { + queryWrapper.eq(MybatisPlusUtil.toColumns(StoreType::getEnabled), params.get("enabled").toString()); + } List beans = list(queryWrapper); shopStoreService.setDataMation(beans, StoreType::getStoreId); return JSONUtil.toList(JSONUtil.toJsonStr(beans), null);