分类修改问题修复

This commit is contained in:
liyj 2025-07-14 11:28:30 +08:00
parent 64e180d293
commit 23deb53971
2 changed files with 14 additions and 1 deletions

View File

@ -1,6 +1,6 @@
package com.suisung.mall.shop.base.controller.admin; package com.suisung.mall.shop.base.controller.admin;
import cn.hutool.core.convert.Convert; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.suisung.mall.common.api.CommonResult; import com.suisung.mall.common.api.CommonResult;
import com.suisung.mall.common.modules.base.ShopBaseProductCategory; import com.suisung.mall.common.modules.base.ShopBaseProductCategory;
@ -107,6 +107,18 @@ public class ShopBaseProductCategoryController {
return CommonResult.failed("商品分类不存在"); return CommonResult.failed("商品分类不存在");
} }
oldShopBaseProductCategory.setStore_id(oldShopBaseProductCategory.getStore_id()); oldShopBaseProductCategory.setStore_id(oldShopBaseProductCategory.getStore_id());
if(ObjectUtil.equals(oldShopBaseProductCategory.getType_id(), 0)){
oldShopBaseProductCategory.setCategory_name(shopBaseProductCategory.getCategory_name());
oldShopBaseProductCategory.setCategory_image(shopBaseProductCategory.getCategory_image());
oldShopBaseProductCategory.setType_id(shopBaseProductCategory.getType_id());
oldShopBaseProductCategory.setCategory_virtual_enable(shopBaseProductCategory.getCategory_virtual_enable());
oldShopBaseProductCategory.setCategory_commission_rate(shopBaseProductCategory.getCategory_commission_rate());
oldShopBaseProductCategory.setPage_id(shopBaseProductCategory.getPage_id());
oldShopBaseProductCategory.setCategory_order(shopBaseProductCategory.getCategory_order());
}else {
oldShopBaseProductCategory.setCategory_order(shopBaseProductCategory.getCategory_order());
}
return CommonResult.success(shopBaseProductCategoryService.editCategory(oldShopBaseProductCategory));
} }
return CommonResult.success(shopBaseProductCategoryService.editCategory(shopBaseProductCategory)); return CommonResult.success(shopBaseProductCategoryService.editCategory(shopBaseProductCategory));

View File

@ -0,0 +1 @@
alter table shop_base_product_category modify `type_id` mediumint unsigned NOT NULL DEFAULT '0' COMMENT '商品类型编号';