diff --git a/pigx-common/pigx-common-bom/pom.xml b/pigx-common/pigx-common-bom/pom.xml
index 258f3a850..006eaecb6 100644
--- a/pigx-common/pigx-common-bom/pom.xml
+++ b/pigx-common/pigx-common-bom/pom.xml
@@ -38,13 +38,14 @@
2.3.0
3.0.52.ALL
1.11.543
+ 6.10.0
1.6.1
7.1
2.17.1
0.0.23
0.33.0
1.0.0
- 1.8.4
+ 1.8.4
@@ -54,6 +55,11 @@
pigx-common-core
${pigx.version}
+
+ com.pig4cloud
+ pigx-common-audit
+ ${pigx.version}
+
com.pig4cloud
pigx-common-data
@@ -150,23 +156,23 @@
${pigx.version}
-
- com.pig4cloud
- pigx-app-server-api
- ${pigx.version}
-
+
+ com.pig4cloud
+ pigx-app-server-api
+ ${pigx.version}
+
-
- org.ow2.asm
- asm
- ${asm.version}
-
-
-
- io.seata
- seata-serializer-kryo
- ${seata.version}
-
+
+ org.ow2.asm
+ asm
+ ${asm.version}
+
+
+
+ io.seata
+ seata-serializer-kryo
+ ${seata.version}
+
com.baomidou
@@ -225,6 +231,12 @@
fastjson
${fastjson.version}
+
+
+ org.javers
+ javers-core
+ ${javers.version}
+
org.springdoc
@@ -317,41 +329,41 @@
pom
import
-
- com.alibaba.csp
- sentinel-core
- ${sentinel.version}
- pom
- import
-
-
- com.alibaba.csp
- sentinel-web-servlet
- ${sentinel.version}
- pom
- import
-
-
- com.alibaba.csp
- sentinel-transport-simple-http
- ${sentinel.version}
- pom
- import
-
-
- com.alibaba.csp
- sentinel-parameter-flow-control
- ${sentinel.version}
- pom
- import
-
-
- com.alibaba.csp
- sentinel-api-gateway-adapter-common
- ${sentinel.version}
- pom
- import
-
+
+ com.alibaba.csp
+ sentinel-core
+ ${sentinel.version}
+ pom
+ import
+
+
+ com.alibaba.csp
+ sentinel-web-servlet
+ ${sentinel.version}
+ pom
+ import
+
+
+ com.alibaba.csp
+ sentinel-transport-simple-http
+ ${sentinel.version}
+ pom
+ import
+
+
+ com.alibaba.csp
+ sentinel-parameter-flow-control
+ ${sentinel.version}
+ pom
+ import
+
+
+ com.alibaba.csp
+ sentinel-api-gateway-adapter-common
+ ${sentinel.version}
+ pom
+ import
+
diff --git a/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/component/PigxBearerTokenExtractor.java b/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/component/PigxBearerTokenExtractor.java
index 01f7d2992..03b547165 100644
--- a/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/component/PigxBearerTokenExtractor.java
+++ b/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/component/PigxBearerTokenExtractor.java
@@ -53,7 +53,6 @@ public class PigxBearerTokenExtractor implements BearerTokenResolver {
this.urlProperties = urlProperties;
}
-
@Override
public String resolve(HttpServletRequest request) {
boolean match = urlProperties.getIgnoreUrls().stream()
diff --git a/pigx-common/pom.xml b/pigx-common/pom.xml
index 161b6bb80..eef4827a2 100644
--- a/pigx-common/pom.xml
+++ b/pigx-common/pom.xml
@@ -33,6 +33,7 @@
pigx 公共聚合模块
+ pigx-common-audit
pigx-common-bom
pigx-common-core
pigx-common-data
diff --git a/pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/entity/SysAuditLog.java b/pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/entity/SysAuditLog.java
new file mode 100644
index 000000000..271e4a64c
--- /dev/null
+++ b/pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/entity/SysAuditLog.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2018-2025, lengleng All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: lengleng (wangiegie@gmail.com)
+ */
+
+package com.pig4cloud.pigx.admin.api.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.time.LocalDateTime;
+
+/**
+ * 审计记录表
+ *
+ * @author pigx code generator
+ * @date 2023-02-27 22:33:30
+ */
+@Data
+@TableName("sys_audit_log")
+@EqualsAndHashCode(callSuper = true)
+@Schema(description = "审计记录表")
+public class SysAuditLog extends Model {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 主键
+ */
+ @TableId(type = IdType.ASSIGN_ID)
+ @Schema(description = "主键")
+ private Long id;
+
+ /**
+ * 审计名称
+ */
+ @Schema(description = "审计名称")
+ private String auditName;
+
+ /**
+ * 字段名称
+ */
+ @Schema(description = "字段名称")
+ private String auditField;
+
+ /**
+ * 变更前值
+ */
+ @Schema(description = "变更前值")
+ private String beforeVal;
+
+ /**
+ * 变更后值
+ */
+ @Schema(description = "变更后值")
+ private String afterVal;
+
+ /**
+ * 操作人
+ */
+ @Schema(description = "操作人")
+ private String createBy;
+
+ /**
+ * 操作时间
+ */
+ @Schema(description = "操作时间")
+ @TableField(fill = FieldFill.INSERT)
+ private LocalDateTime createTime;
+
+ /**
+ * 删除标记
+ */
+ @TableLogic
+ @Schema(description = "删除标记")
+ @TableField(fill = FieldFill.INSERT)
+ private String delFlag;
+
+ /**
+ * 租户ID
+ */
+ @Schema(description = "租户ID", hidden = true)
+ private Long tenantId;
+
+}
diff --git a/pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/feign/RemoteAuditLogService.java b/pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/feign/RemoteAuditLogService.java
new file mode 100644
index 000000000..37acdf46b
--- /dev/null
+++ b/pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/feign/RemoteAuditLogService.java
@@ -0,0 +1,49 @@
+/*
+ *
+ * Copyright (c) 2018-2025, lengleng All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: lengleng (wangiegie@gmail.com)
+ *
+ */
+
+package com.pig4cloud.pigx.admin.api.feign;
+
+import com.pig4cloud.pigx.admin.api.entity.SysAuditLog;
+import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
+import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
+import com.pig4cloud.pigx.common.core.util.R;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestHeader;
+
+import java.util.List;
+
+/**
+ * @author lengleng
+ * @date 2023-02-27
+ */
+@FeignClient(contextId = "remoteAuditLogService", value = ServiceNameConstants.UPMS_SERVICE)
+public interface RemoteAuditLogService {
+
+ /**
+ * 保存日志
+ * @param auditLogList 日志实体 列表
+ * @param from 是否内部调用
+ * @return succes、false
+ */
+ @PostMapping("/audit")
+ R saveLog(@RequestBody List auditLogList, @RequestHeader(SecurityConstants.FROM) String from);
+
+}
diff --git a/pigx-upms/pigx-upms-api/src/main/resources/META-INF/spring.factories b/pigx-upms/pigx-upms-api/src/main/resources/META-INF/spring.factories
index 00df1d113..e2e005862 100755
--- a/pigx-upms/pigx-upms-api/src/main/resources/META-INF/spring.factories
+++ b/pigx-upms/pigx-upms-api/src/main/resources/META-INF/spring.factories
@@ -7,4 +7,5 @@ com.pig4cloud.pigx.common.feign.PigxFeignAutoConfiguration=\
com.pig4cloud.pigx.admin.api.feign.RemoteTenantService,\
com.pig4cloud.pigx.admin.api.feign.RemoteTokenService,\
com.pig4cloud.pigx.admin.api.feign.RemoteUserService,\
- com.pig4cloud.pigx.admin.api.feign.RemoteDictService
+ com.pig4cloud.pigx.admin.api.feign.RemoteDictService,\
+ com.pig4cloud.pigx.admin.api.feign.RemoteAuditLogService
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/controller/SysAuditLogController.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/controller/SysAuditLogController.java
new file mode 100644
index 000000000..4915ec179
--- /dev/null
+++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/controller/SysAuditLogController.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2018-2025, lengleng All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: lengleng (wangiegie@gmail.com)
+ */
+
+package com.pig4cloud.pigx.admin.controller;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.pig4cloud.pigx.common.core.util.R;
+import com.pig4cloud.pigx.common.log.annotation.SysLog;
+import com.pig4cloud.pigx.admin.api.entity.SysAuditLog;
+import com.pig4cloud.pigx.admin.service.SysAuditLogService;
+import com.pig4cloud.pigx.common.security.annotation.Inner;
+import org.springframework.security.access.prepost.PreAuthorize;
+import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
+import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import org.springframework.http.HttpHeaders;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 审计记录表
+ *
+ * @author pigx code generator
+ * @date 2023-02-27 22:33:30
+ */
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/audit")
+@Tag(description = "sysauditlog", name = "审计记录表管理")
+@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
+public class SysAuditLogController {
+
+ private final SysAuditLogService sysAuditLogService;
+
+ /**
+ * 分页查询
+ * @param page 分页对象
+ * @param sysAuditLog 审计记录表
+ * @return
+ */
+ @Operation(summary = "分页查询", description = "分页查询")
+ @GetMapping("/page")
+ @PreAuthorize("@pms.hasPermission('admin_sysauditlog_view')")
+ public R getSysAuditLogPage(Page page, SysAuditLog sysAuditLog) {
+ return R.ok(sysAuditLogService.page(page, Wrappers.query(sysAuditLog)));
+ }
+
+ /**
+ * 通过id查询审计记录表
+ * @param id id
+ * @return R
+ */
+ @Operation(summary = "通过id查询", description = "通过id查询")
+ @GetMapping("/{id}")
+ @PreAuthorize("@pms.hasPermission('admin_sysauditlog_view')")
+ public R getById(@PathVariable("id") Long id) {
+ return R.ok(sysAuditLogService.getById(id));
+ }
+
+ /**
+ * 新增审计记录表 (异步插入)
+ * @param auditLogList 审计记录
+ * @return R
+ */
+ @Inner
+ @PostMapping
+ @Operation(summary = "新增审计记录表", description = "新增审计记录表")
+ public R save(@RequestBody List auditLogList) {
+ return R.ok(sysAuditLogService.saveBatch(auditLogList));
+ }
+
+ /**
+ * 修改审计记录表
+ * @param sysAuditLog 审计记录表
+ * @return R
+ */
+ @Operation(summary = "修改审计记录表", description = "修改审计记录表")
+ @SysLog("修改审计记录表")
+ @PutMapping
+ @PreAuthorize("@pms.hasPermission('admin_sysauditlog_edit')")
+ public R updateById(@RequestBody SysAuditLog sysAuditLog) {
+ return R.ok(sysAuditLogService.updateById(sysAuditLog));
+ }
+
+ /**
+ * 通过id删除审计记录表
+ * @param id id
+ * @return R
+ */
+ @Operation(summary = "通过id删除审计记录表", description = "通过id删除审计记录表")
+ @SysLog("通过id删除审计记录表")
+ @DeleteMapping("/{id}")
+ @PreAuthorize("@pms.hasPermission('admin_sysauditlog_del')")
+ public R removeById(@PathVariable Long id) {
+ return R.ok(sysAuditLogService.removeById(id));
+ }
+
+ /**
+ * 导出excel 表格
+ * @param sysAuditLog 查询条件
+ * @return excel 文件流
+ */
+ @ResponseExcel
+ @GetMapping("/export")
+ @PreAuthorize("@pms.hasPermission('admin_sysauditlog_export')")
+ public List export(SysAuditLog sysAuditLog) {
+ return sysAuditLogService.list(Wrappers.query(sysAuditLog));
+ }
+
+}
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/mapper/SysAuditLogMapper.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/mapper/SysAuditLogMapper.java
new file mode 100644
index 000000000..d6eb0e457
--- /dev/null
+++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/mapper/SysAuditLogMapper.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2018-2025, lengleng All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: lengleng (wangiegie@gmail.com)
+ */
+
+package com.pig4cloud.pigx.admin.mapper;
+
+import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
+import com.pig4cloud.pigx.admin.api.entity.SysAuditLog;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 审计记录表
+ *
+ * @author pigx code generator
+ * @date 2023-02-27 22:33:30
+ */
+@Mapper
+public interface SysAuditLogMapper extends PigxBaseMapper {
+
+}
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysAuditLogService.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysAuditLogService.java
new file mode 100644
index 000000000..3c387ad7a
--- /dev/null
+++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysAuditLogService.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2018-2025, lengleng All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: lengleng (wangiegie@gmail.com)
+ */
+
+package com.pig4cloud.pigx.admin.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.pig4cloud.pigx.admin.api.entity.SysAuditLog;
+
+/**
+ * 审计记录表
+ *
+ * @author pigx code generator
+ * @date 2023-02-27 22:33:30
+ */
+public interface SysAuditLogService extends IService {
+
+}
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysAuditLogServiceImpl.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysAuditLogServiceImpl.java
new file mode 100644
index 000000000..0fdcbfb9c
--- /dev/null
+++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysAuditLogServiceImpl.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2018-2025, lengleng All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: lengleng (wangiegie@gmail.com)
+ */
+package com.pig4cloud.pigx.admin.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.pig4cloud.pigx.admin.api.entity.SysAuditLog;
+import com.pig4cloud.pigx.admin.mapper.SysAuditLogMapper;
+import com.pig4cloud.pigx.admin.service.SysAuditLogService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 审计记录表
+ *
+ * @author pigx code generator
+ * @date 2023-02-27 22:33:30
+ */
+@Service
+public class SysAuditLogServiceImpl extends ServiceImpl implements SysAuditLogService {
+
+}
diff --git a/pigx-upms/pigx-upms-biz/src/main/resources/mapper/SysAuditLogMapper.xml b/pigx-upms/pigx-upms-biz/src/main/resources/mapper/SysAuditLogMapper.xml
new file mode 100644
index 000000000..93dfa6042
--- /dev/null
+++ b/pigx-upms/pigx-upms-biz/src/main/resources/mapper/SysAuditLogMapper.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+