From f3181abf0a88a83b1c2b94ebf28fbb5af723e616 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Fri, 27 Jun 2025 19:34:24 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E5=8F=98=E6=9B=B4=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1440489562144768]增加数据库变更记录管理页面 http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1440489562144768 --- .../SearchChangeLogAuditListApi.java | 78 +++++++++++++++++++ .../dao/mapper/ChangelogAuditMapper.java | 30 +++++++ .../dao/mapper/ChangelogAuditMapper.xml | 67 ++++++++++++++++ 3 files changed, 175 insertions(+) create mode 100644 src/main/java/neatlogic/module/tenant/api/changelog/SearchChangeLogAuditListApi.java create mode 100644 src/main/java/neatlogic/module/tenant/dao/mapper/ChangelogAuditMapper.java create mode 100644 src/main/java/neatlogic/module/tenant/dao/mapper/ChangelogAuditMapper.xml diff --git a/src/main/java/neatlogic/module/tenant/api/changelog/SearchChangeLogAuditListApi.java b/src/main/java/neatlogic/module/tenant/api/changelog/SearchChangeLogAuditListApi.java new file mode 100644 index 00000000..75cefa33 --- /dev/null +++ b/src/main/java/neatlogic/module/tenant/api/changelog/SearchChangeLogAuditListApi.java @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2025 深圳极向量科技有限公司 All Rights Reserved. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package neatlogic.module.tenant.api.changelog; + +import com.alibaba.fastjson.JSONObject; +import neatlogic.framework.asynchronization.threadlocal.TenantContext; +import neatlogic.framework.common.constvalue.ApiParamType; +import neatlogic.framework.common.dto.BasePageVo; +import neatlogic.framework.dto.ChangelogAuditVo; +import neatlogic.framework.restful.annotation.*; +import neatlogic.framework.restful.constvalue.OperationTypeEnum; +import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase; +import neatlogic.framework.util.TableResultUtil; +import neatlogic.module.tenant.dao.mapper.ChangelogAuditMapper; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; + +@Service +@OperationType(type = OperationTypeEnum.SEARCH) +public class SearchChangeLogAuditListApi extends PrivateApiComponentBase { + + @Resource + private ChangelogAuditMapper changelogAuditMapper; + + @Override + public String getName() { + return "nmtac.searchchangelogauditlistapi.getname"; + } + + @Input({ + @Param(name = "keyword", type = ApiParamType.STRING, desc = "common.keyword"), + @Param(name = "moduleId", type = ApiParamType.STRING, desc = "term.cmdb.moduleid"), + @Param(name = "sqlStatus", type = ApiParamType.ENUM, rule = "0,1", desc = "common.status"), + @Param(name = "version", type = ApiParamType.STRING, desc = "common.versionnum"), + @Param(name = "currentPage", type = ApiParamType.INTEGER, desc = "common.currentpage"), + @Param(name = "pageSize", type = ApiParamType.INTEGER, desc = "common.pagesize"), + }) + @Output({ + @Param(explode = BasePageVo.class), + @Param(name = "tbodyList", type = ApiParamType.JSONARRAY, desc = "common.tbodylist") + }) + @Description(desc = "查询数据库变更记录列表") + @Override + public Object myDoService(JSONObject paramObj) throws Exception { + List changelogAuditList = new ArrayList<>(); + ChangelogAuditVo changelogAuditVo = paramObj.toJavaObject(ChangelogAuditVo.class); + changelogAuditVo.setTenantUuid(TenantContext.get().getTenantUuid()); + int rowNum = changelogAuditMapper.getChangelogAuditCount(changelogAuditVo); + if (rowNum > 0) { + changelogAuditVo.setRowNum(rowNum); + changelogAuditList = changelogAuditMapper.getChangelogAuditList(changelogAuditVo); + } + return TableResultUtil.getResult(changelogAuditList, changelogAuditVo); + } + + @Override + public String getToken() { + return "changelog/audit/search"; + } +} diff --git a/src/main/java/neatlogic/module/tenant/dao/mapper/ChangelogAuditMapper.java b/src/main/java/neatlogic/module/tenant/dao/mapper/ChangelogAuditMapper.java new file mode 100644 index 00000000..0bcf3239 --- /dev/null +++ b/src/main/java/neatlogic/module/tenant/dao/mapper/ChangelogAuditMapper.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2025 深圳极向量科技有限公司 All Rights Reserved. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package neatlogic.module.tenant.dao.mapper; + +import neatlogic.framework.dao.aop.UseMasterDatabase; +import neatlogic.framework.dto.ChangelogAuditVo; + +import java.util.List; + +@UseMasterDatabase +public interface ChangelogAuditMapper { + int getChangelogAuditCount(ChangelogAuditVo changelogAuditVo); + + List getChangelogAuditList(ChangelogAuditVo changelogAuditVo); +} diff --git a/src/main/java/neatlogic/module/tenant/dao/mapper/ChangelogAuditMapper.xml b/src/main/java/neatlogic/module/tenant/dao/mapper/ChangelogAuditMapper.xml new file mode 100644 index 00000000..5b84a0ce --- /dev/null +++ b/src/main/java/neatlogic/module/tenant/dao/mapper/ChangelogAuditMapper.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + \ No newline at end of file -- Gitee