From 9455a484984506b9a0fb1d965dbfa9546893b0f4 Mon Sep 17 00:00:00 2001 From: liyj <1617420630@qq.com> Date: Thu, 10 Jul 2025 15:35:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E6=98=A0=E5=B0=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/common/modules/sync/ProductMapping.java | 1 + .../sync/controller/ProductMappingController.java | 12 +++++++++--- .../sync/controller/StoreDbConfigController.java | 4 ++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/mall-common/src/main/java/com/suisung/mall/common/modules/sync/ProductMapping.java b/mall-common/src/main/java/com/suisung/mall/common/modules/sync/ProductMapping.java index 25cb99e7..25d7308b 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/modules/sync/ProductMapping.java +++ b/mall-common/src/main/java/com/suisung/mall/common/modules/sync/ProductMapping.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/sync/controller/ProductMappingController.java b/mall-shop/src/main/java/com/suisung/mall/shop/sync/controller/ProductMappingController.java index 1de040c8..3317c076 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/sync/controller/ProductMappingController.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/sync/controller/ProductMappingController.java @@ -9,6 +9,7 @@ import com.google.gson.reflect.TypeToken; import com.suisung.mall.common.api.CommonResult; import com.suisung.mall.common.api.IErrorCode; import com.suisung.mall.common.domain.UserDto; +import com.suisung.mall.common.exception.ApiException; import com.suisung.mall.common.modules.store.ShopStoreBase; import com.suisung.mall.common.modules.sync.ProductMapping; import com.suisung.mall.common.pojo.res.ThirdApiRes; @@ -150,7 +151,7 @@ public class ProductMappingController extends BaseControllerImpl { return CommonResult.failed("更新失败:店铺不存在"); } productMapping.setStoreName(shopStoreBase.getStore_name()); - if(productMappingService.saveOrUpdate(productMapping)){ + if(productMappingService.updateById(productMapping)){ return CommonResult.success(true); } }else { @@ -227,8 +228,13 @@ public class ProductMappingController extends BaseControllerImpl { * @param response */ @PostMapping("/exportSelected") - public void exportSelectedData(@RequestBody List ids, HttpServletResponse response) { - List data = productMappingService.listByIds(ids); + public void exportSelectedData(@RequestParam("ids") List ids, HttpServletResponse response) { + if(ids==null||ids.isEmpty()){ + throw new ApiException("选择数据不能为空"); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.in("id", ids); + List data = productMappingService.list(queryWrapper); productMappingService.exportData(response, data); } diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/sync/controller/StoreDbConfigController.java b/mall-shop/src/main/java/com/suisung/mall/shop/sync/controller/StoreDbConfigController.java index 3a7da6dd..b11fbd06 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/sync/controller/StoreDbConfigController.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/sync/controller/StoreDbConfigController.java @@ -85,8 +85,8 @@ public class StoreDbConfigController extends BaseControllerImpl { * @return */ @ApiOperation(value = "更新-店铺数据库连接配置", notes = "更新-店铺数据库连接配置") - @RequestMapping(value = "/udpateStoreDbConfig", method = RequestMethod.PUT) - public CommonResult udpateStoreDbConfig(@RequestBody @Valid StoreDbConfig storeDbConfig) { + @RequestMapping(value = "/updateStoreDbConfig", method = RequestMethod.PUT) + public CommonResult updateStoreDbConfig(@RequestBody @Valid StoreDbConfig storeDbConfig) { return storeDbConfigService.updateStoreDbConfig(storeDbConfig); }