商品映射问题修复

This commit is contained in:
liyj 2025-07-10 15:35:05 +08:00
parent 943eb54037
commit 9455a48498
3 changed files with 12 additions and 5 deletions

View File

@ -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;

View File

@ -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<Long> ids, HttpServletResponse response) {
List<ProductMapping> data = productMappingService.listByIds(ids);
public void exportSelectedData(@RequestParam("ids") List<Long> ids, HttpServletResponse response) {
if(ids==null||ids.isEmpty()){
throw new ApiException("选择数据不能为空");
}
QueryWrapper<ProductMapping> queryWrapper = new QueryWrapper<>();
queryWrapper.in("id", ids);
List<ProductMapping> data = productMappingService.list(queryWrapper);
productMappingService.exportData(response, data);
}

View File

@ -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);
}