Browse Source

假删除

master
cgx 4 months ago
parent
commit
c650867ad3
1 changed files with 11 additions and 2 deletions
  1. +11
    -2
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/product/controller/TbProductController.java

+ 11
- 2
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/product/controller/TbProductController.java View File

@ -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<TbProduct, ITbProductSe
@ApiOperation(value="产品报价表-通过id删除", notes="产品报价表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> 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<TbProduct, ITbProductSe
@ApiOperation(value="产品报价表-批量删除", notes="产品报价表-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.tbProductService.removeByIds(Arrays.asList(ids.split(",")));
List<TbProduct> tbProducts = tbProductService.listByIds(Arrays.asList(ids.split(",")));
for (TbProduct tbProduct : tbProducts) {
tbProduct.setDelFlag(1);
}
this.tbProductService.updateBatchById(tbProducts);
return Result.OK("批量删除成功!");
}


Loading…
Cancel
Save