From b5df4c2406b15de307ac14ca99d06736609bfab0 Mon Sep 17 00:00:00 2001 From: liulu Date: Fri, 1 Nov 2024 15:11:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=86=E9=92=A5=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/sunyard/chsm/model/entity/KeyInfo.java | 3 +-- .../chsm/service/impl/KeyInfoServiceImpl.java | 18 +++++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/chsm-common/src/main/java/com/sunyard/chsm/model/entity/KeyInfo.java b/chsm-common/src/main/java/com/sunyard/chsm/model/entity/KeyInfo.java index 6459483..4cabca9 100644 --- a/chsm-common/src/main/java/com/sunyard/chsm/model/entity/KeyInfo.java +++ b/chsm-common/src/main/java/com/sunyard/chsm/model/entity/KeyInfo.java @@ -1,7 +1,6 @@ package com.sunyard.chsm.model.entity; import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; @@ -31,7 +30,7 @@ public class KeyInfo { private LocalDateTime expiredTime; private String remark; - @TableLogic +// @TableLogic private Boolean deleted; private LocalDateTime createTime; private LocalDateTime updateTime; diff --git a/chsm-web-manage/src/main/java/com/sunyard/chsm/service/impl/KeyInfoServiceImpl.java b/chsm-web-manage/src/main/java/com/sunyard/chsm/service/impl/KeyInfoServiceImpl.java index 853c022..607a5a2 100644 --- a/chsm-web-manage/src/main/java/com/sunyard/chsm/service/impl/KeyInfoServiceImpl.java +++ b/chsm-web-manage/src/main/java/com/sunyard/chsm/service/impl/KeyInfoServiceImpl.java @@ -514,12 +514,16 @@ public class KeyInfoServiceImpl implements KeyInfoService { .collect(Collectors.toList()); Assert.isTrue(CollectionUtils.isEmpty(unNormalCodes), "密钥id: " + String.join(",", unNormalCodes) + "当前状态不支持销毁操作"); - keyInfoMapper.update( - new LambdaUpdateWrapper() - .set(KeyInfo::getStatus, KeyStatus.DESTROY.getCode()) - .set(KeyInfo::getDeleted, true) - .set(KeyInfo::getDeleteTime, now) - .in(KeyInfo::getId, ids) - ); + + keyInfoMapper.deleteBatchIds(ids); + spKeyRecordMapper.delete(new LambdaUpdateWrapper().in(KeyRecord::getKeyId, ids)); + +// keyInfoMapper.update( +// new LambdaUpdateWrapper() +// .set(KeyInfo::getStatus, KeyStatus.DESTROY.getCode()) +// .set(KeyInfo::getDeleted, true) +// .set(KeyInfo::getDeleteTime, now) +// .in(KeyInfo::getId, ids) +// ); } }