1. 调整 e 办相关用户组织同步报文接受逻辑

2. 新增针对 e 办的接口日志记录功能

(cherry picked from commit 28aae25bef)
This commit is contained in:
chenbowen
2025-08-28 15:47:49 +08:00
committed by chenbowen
parent a53105088d
commit 4559f7268f
26 changed files with 1420 additions and 119 deletions

View File

@@ -24,7 +24,7 @@ public class DeptSaveReqVO {
@Size(max = 30, message = "部门名称长度不能超过 30 个字符")
private String name;
@Schema(description = "父部门 ID", example = "1024")
@Schema(description = "父部门 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024(顶级部门父级 Id 为 0)")
private Long parentId;
@Schema(description = "显示顺序", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
@@ -43,7 +43,7 @@ public class DeptSaveReqVO {
@Size(max = 50, message = "邮箱长度不能超过 50 个字符")
private String email;
@Schema(description = "状态,见 CommonStatusEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@Schema(description = "状态,见 CommonStatusEnum 枚举0 开启 1 关闭", requiredMode = Schema.RequiredMode.REQUIRED, example = "0 开启 1 关闭")
@InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}")
private Integer status;

View File

@@ -0,0 +1,52 @@
package cn.iocoder.yudao.module.system.controller.admin.sync;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.system.controller.admin.sync.vo.SyncLogPageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.sync.vo.SyncLogRespVO;
import cn.iocoder.yudao.module.system.dal.dataobject.sync.SyncLogDO;
import cn.iocoder.yudao.module.system.service.sync.SyncLogService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
/**
* 同步接口日志 Controller
*
* @author 芋道源码
*/
@Tag(name = "管理后台 - 同步接口日志")
@RestController
@RequestMapping("/system/sync-log")
@Validated
public class SyncLogController {
@Resource
private SyncLogService syncLogService;
@GetMapping("/get")
@Operation(summary = "获得同步接口日志")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('system:sync-log:query')")
public CommonResult<SyncLogRespVO> getSyncLog(@RequestParam("id") Long id) {
SyncLogDO syncLog = syncLogService.getSyncLog(id);
return success(BeanUtils.toBean(syncLog, SyncLogRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得同步接口日志分页")
@PreAuthorize("@ss.hasPermission('system:sync-log:query')")
public CommonResult<PageResult<SyncLogRespVO>> getSyncLogPage(@Valid SyncLogPageReqVO pageReqVO) {
PageResult<SyncLogDO> pageResult = syncLogService.getSyncLogPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, SyncLogRespVO.class));
}
}

View File

@@ -0,0 +1,44 @@
package cn.iocoder.yudao.module.system.controller.admin.sync.vo;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* 同步接口日志分页 Request VO
*
* @author 芋道源码
*/
@Schema(description = "管理后台 - 同步接口日志分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class SyncLogPageReqVO extends PageParam {
@Schema(description = "外部请求ID", example = "REQ_12345")
private String bimRequestId;
@Schema(description = "服务名称", example = "SchemaService")
private String serviceName;
@Schema(description = "响应状态", example = "0")
private Integer status;
@Schema(description = "客户端IP", example = "192.168.1.100")
private String clientIp;
@Schema(description = "认证用户", example = "admin")
private String authUser;
@Schema(description = "请求时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] requestTime;
}

View File

@@ -0,0 +1,92 @@
package cn.iocoder.yudao.module.system.controller.admin.sync.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 同步接口日志 Response VO
*
* @author 芋道源码
*/
@Schema(description = "管理后台 - 同步接口日志 Response VO")
@Data
public class SyncLogRespVO {
@Schema(description = "日志主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "外部请求ID", example = "REQ_12345")
private String bimRequestId;
@Schema(description = "服务名称", example = "SchemaService")
private String serviceName;
@Schema(description = "请求方法", example = "POST")
private String requestMethod;
@Schema(description = "请求URL", example = "/system/sync/SchemaService")
private String requestUrl;
@Schema(description = "客户端IP地址", example = "192.168.1.100")
private String clientIp;
@Schema(description = "用户代理字符串")
private String userAgent;
@Schema(description = "请求开始时间", example = "2024-01-01 12:00:00")
private LocalDateTime requestTime;
@Schema(description = "请求结束时间", example = "2024-01-01 12:00:01")
private LocalDateTime responseTime;
@Schema(description = "请求处理耗时(毫秒)", example = "1000")
private Long duration;
@Schema(description = "原始加密请求体")
private String encryptedRequest;
@Schema(description = "解密后的请求体")
private String decryptedRequest;
@Schema(description = "响应状态", example = "0")
private Integer status;
@Schema(description = "错误码", example = "SYNC_001")
private String errorCode;
@Schema(description = "错误信息", example = "解密失败")
private String errorMessage;
@Schema(description = "异常堆栈")
private String exceptionStack;
@Schema(description = "响应数据(加密前)")
private String responseData;
@Schema(description = "加密后的响应数据")
private String encryptedResponse;
@Schema(description = "认证用户", example = "admin")
private String authUser;
@Schema(description = "解密状态", example = "0")
private Integer decryptStatus;
@Schema(description = "签名验证状态", example = "0")
private Integer signatureVerifyStatus;
@Schema(description = "认证状态", example = "0")
private Integer authStatus;
@Schema(description = "业务处理结果", example = "200")
private String businessResult;
@Schema(description = "额外信息")
private String extra;
@Schema(description = "创建时间", example = "2024-01-01 12:00:00")
private LocalDateTime createTime;
}

View File

@@ -24,8 +24,6 @@ public class OrgCreateRequestVO {
private String email;
@Schema(description = "机构 状态", required = true)
private Integer status;
@Schema(description = "机构 是否公司")
private Boolean isCompany;
@Schema(description = "机构 是否集团")
private Boolean isGroup;
@Schema(description = "机构类型", required = true, example = "28=单位、26=部门")
private Integer deptType;
}

View File

@@ -30,8 +30,8 @@ public class OrgUpdateRequestVO extends DeptDO {
private String email;
@Schema(description = "机构 状态", required = true)
private Integer status;
@Schema(description = "机构 是否公司")
private Boolean isCompany;
@Schema(description = "机构类型", required = true, example = "28=单位、26=部门")
private Integer deptType;
@Schema(description = "机构 是否集团")
private Boolean isGroup;
}

View File

@@ -40,7 +40,7 @@ public class UserSaveReqVO {
@DiffLogField(name = "备注")
private String remark;
@Schema(description = "部门编号", example = "我是一个用户")
@Schema(description = "部门编号数组",requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@DiffLogField(name = "部门", function = DeptParseFunction.NAME)
private Set<Long> deptIds;

View File

@@ -0,0 +1,29 @@
package cn.iocoder.yudao.module.system.dal.mysql.sync;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.sync.SyncLogDO;
import cn.iocoder.yudao.module.system.controller.admin.sync.vo.SyncLogPageReqVO;
import org.apache.ibatis.annotations.Mapper;
/**
* 同步接口日志 Mapper
*
* @author 芋道源码
*/
@Mapper
public interface SyncLogMapper extends BaseMapperX<SyncLogDO> {
default PageResult<SyncLogDO> selectPage(SyncLogPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<SyncLogDO>()
.eqIfPresent(SyncLogDO::getBimRequestId, reqVO.getBimRequestId())
.eqIfPresent(SyncLogDO::getServiceName, reqVO.getServiceName())
.eqIfPresent(SyncLogDO::getStatus, reqVO.getStatus())
.eqIfPresent(SyncLogDO::getClientIp, reqVO.getClientIp())
.eqIfPresent(SyncLogDO::getAuthUser, reqVO.getAuthUser())
.betweenIfPresent(SyncLogDO::getRequestTime, reqVO.getRequestTime())
.orderByDesc(SyncLogDO::getId));
}
}

Some files were not shown because too many files have changed in this diff Show More