diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/product/controller/TbProductController.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/product/controller/TbProductController.java index d39a1d5..e4a590b 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/product/controller/TbProductController.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/product/controller/TbProductController.java @@ -1,6 +1,7 @@ package org.jeecg.modules.product.controller; import java.util.Arrays; +import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.jeecg.common.api.vo.Result; @@ -14,6 +15,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.extern.slf4j.Slf4j; import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.modules.productOrder.entity.TbProductOrder; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; @@ -97,7 +99,9 @@ public class TbProductController extends JeecgController delete(@RequestParam(name="id",required=true) String id) { - tbProductService.removeById(id); + TbProduct byId = tbProductService.getById(id); + byId.setDelFlag(1); + tbProductService.updateById(byId); return Result.OK("删除成功!"); } @@ -111,7 +115,12 @@ public class TbProductController extends JeecgController deleteBatch(@RequestParam(name="ids",required=true) String ids) { - this.tbProductService.removeByIds(Arrays.asList(ids.split(","))); + + List tbProducts = tbProductService.listByIds(Arrays.asList(ids.split(","))); + for (TbProduct tbProduct : tbProducts) { + tbProduct.setDelFlag(1); + } + this.tbProductService.updateBatchById(tbProducts); return Result.OK("批量删除成功!"); }