From c650867ad3deaca4b0aa0888d86661b7ae411262 Mon Sep 17 00:00:00 2001 From: cgx <2606784146@qq.com> Date: Tue, 10 Dec 2024 17:36:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=81=87=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/product/controller/TbProductController.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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("批量删除成功!"); }