Pārlūkot izejas kodu

板块操作修改为逻辑删除

y 2 gadi atpakaļ
vecāks
revīzija
27e2e297b6

+ 2 - 0
src/main/java/com/ydtech/modules/inv/model/InvAccountOp.java

@@ -33,5 +33,7 @@ public class InvAccountOp extends Model<InvAccountOp> {
     //操作id
     private String accountOperateId;
 
+    private String delFlag;
+
 }
 

+ 4 - 4
src/main/java/com/ydtech/modules/inv/service/impl/InvAccountIncoiceServiceImpl.java

@@ -279,9 +279,9 @@ public class InvAccountIncoiceServiceImpl extends ServiceImpl<InvAccountIncoiceM
         invAccountOperate.setUpdateTime(LocalDateTime.now());
         invAccountOperate.setDelFlag("1");
 
-        LambdaQueryWrapper<InvAccountOp> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-
-        lambdaQueryWrapper.eq(InvAccountOp::getInvoiceId, invAccountIncoice.getInvoiceId());
+        LambdaUpdateWrapper<InvAccountOp> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
+        lambdaUpdateWrapper.eq(InvAccountOp::getInvoiceId, invAccountIncoice.getInvoiceId());
+        lambdaUpdateWrapper.set(InvAccountOp::getDelFlag, "1");
 
 
         try {
@@ -290,7 +290,7 @@ public class InvAccountIncoiceServiceImpl extends ServiceImpl<InvAccountIncoiceM
 
             invAccountOperateService.updateOperateByIncoiceId(invAccountOperate);
 
-            invAccountOpService.remove(lambdaQueryWrapper);
+            invAccountOpService.update(lambdaUpdateWrapper);
         } catch (Exception e) {
             return HttpResult.error("撤销失败");
         }

+ 6 - 4
src/main/java/com/ydtech/modules/inv/service/impl/InvAccountOperateServiceImpl.java

@@ -4,6 +4,7 @@ package com.ydtech.modules.inv.service.impl;
 import cn.hutool.extra.spring.SpringUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -229,9 +230,10 @@ public class InvAccountOperateServiceImpl extends ServiceImpl<InvAccountOperateM
                 invAccountOperate1.setDelFlag("1");
             });
 
-            LambdaQueryWrapper<InvAccountOp> queryWrapper = new LambdaQueryWrapper<InvAccountOp>();
-            queryWrapper.in(InvAccountOp::getAccountOperateId, accountOperateIds);
-            List<InvAccountOp> list = invAccountOpService.list(queryWrapper);
+            LambdaUpdateWrapper<InvAccountOp> lambdaUpdateWrapper = new LambdaUpdateWrapper<InvAccountOp>();
+            lambdaUpdateWrapper.in(InvAccountOp::getAccountOperateId, accountOperateIds);
+            lambdaUpdateWrapper.set(InvAccountOp::getDelFlag,"1");
+
 
             if(invAccountOperate.getInvoiceId() != null){
                 InvAccountIncoice byId = invAccountIncoiceService.getById(invAccountOperate.getInvoiceId());
@@ -249,7 +251,7 @@ public class InvAccountOperateServiceImpl extends ServiceImpl<InvAccountOperateM
                 invAccountExcelService.updateById(invAccountExcel);
             }
 
-            invAccountOpService.removeBatchByIds(list);
+            invAccountOpService.update(lambdaUpdateWrapper);
             invAccountCardService.updateBatchById(invAccountCards);
             InvAccountOperateService invAccountOperateService = new InvAccountOperateServiceImpl();
             invAccountOperateService.updateBatchById(invAccountOperates);