✨ 认证审核接口支持修订版内容写入
- 新增 CertAuditRequest,audit 接口原地升级为 body 优先、query 兜底,缺 id/pass 返回 400 - 通过时同事务写入 audited_snapshot_json(驳回忽略修订);修订内容先校验可反序列化与关键字段再落库 - 写回档案与司机端「当前生效内容」改为修订版优先,为空回退 snapshot_json - 读不懂的历史快照不再静默跳过,改为抛错回滚,杜绝空内容被盖章通过 - 审核详情下发 auditedSnapshotJson;司机端 VO 增加 revised 标记,快照字段不随 VO 下发
This commit is contained in:
+64
@@ -0,0 +1,64 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.transport.pojo.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 管理端认证审核请求
|
||||
* <p>
|
||||
* 这个接口原本只有 query 参数({@code id} / {@code pass} / {@code rejectReason}),
|
||||
* 新增修订能力后改为「body 优先、query 兜底」:老前端不改代码仍然能用,
|
||||
* 新前端把修订内容放进 body。两者同时给出时以 body 为准,避免审核员的修订被旧值覆盖。
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "管理端认证审核请求")
|
||||
public class CertAuditRequest implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "认证记录主键")
|
||||
private Long id;
|
||||
@Schema(description = "true 通过,false 驳回")
|
||||
private Boolean pass;
|
||||
@Schema(description = "驳回原因;驳回时必填,≤200 字")
|
||||
private String rejectReason;
|
||||
/**
|
||||
* 审核员修订后的全量认证内容(JSON);空或空白表示不修订
|
||||
* <p>
|
||||
* 通过时才生效:它既是写回档案的依据,也会原样留痕到认证记录上。
|
||||
*/
|
||||
@Schema(description = "审核员修订后的全量认证内容JSON;空表示不修订")
|
||||
private String auditedSnapshotJson;
|
||||
|
||||
}
|
||||
+14
@@ -28,6 +28,7 @@ package org.springblade.transport.pojo.entity;
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -125,6 +126,19 @@ public class TransportCertRecord extends TenantEntity {
|
||||
@TableField(updateStrategy = FieldStrategy.NEVER)
|
||||
@Schema(description = "该次提交的全量认证内容JSON")
|
||||
private String snapshotJson;
|
||||
/**
|
||||
* 审核通过时确定的修订版内容(JSON)
|
||||
* <p>
|
||||
* 审核员可以在通过时直接改内容:司机提交的是 {@code snapshotJson}(永不可改),
|
||||
* 最终写回档案、司机端读到的「当前生效内容」以本字段优先,为 null 才回退到
|
||||
* {@code snapshotJson}。为 null 即「审核员没有修订」。
|
||||
* <p>
|
||||
* {@code @JsonIgnore}:司机端的 {@code TransportCertRecordVO} 继承本实体,
|
||||
* 修订版是审核过程的留痕,不该下发给司机。
|
||||
*/
|
||||
@JsonIgnore
|
||||
@Schema(description = "审核通过时确定的修订版内容JSON;null 表示未修订")
|
||||
private String auditedSnapshotJson;
|
||||
/**
|
||||
* 驳回原因,仅当审核状态为已驳回时有值
|
||||
*/
|
||||
|
||||
+7
@@ -81,6 +81,13 @@ public class CertAuditDetailVO implements Serializable {
|
||||
|
||||
@Schema(description = "待审快照:本次提交的全量内容")
|
||||
private String pendingSnapshotJson;
|
||||
/**
|
||||
* 审核员在本次审核中填写的修订版内容;未修订时为 null
|
||||
* <p>
|
||||
* 只在「通过」时才会落库,驳回不产生生效内容。审核页据此回显审核员改了什么。
|
||||
*/
|
||||
@Schema(description = "本次审核提交的修订版内容;未修订时为 null")
|
||||
private String auditedSnapshotJson;
|
||||
@Schema(description = "生效快照:该对象当前生效的全量内容;从未认证通过时为 null")
|
||||
private String effectiveSnapshotJson;
|
||||
@Schema(description = "生效快照记录ID;null 表示该对象从未认证通过")
|
||||
|
||||
+8
@@ -96,5 +96,13 @@ public class TransportCertRecordVO extends TransportCertRecord {
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "司机手机号")
|
||||
private String driverMobile;
|
||||
/**
|
||||
* 该条记录是否经过审核员修订
|
||||
* <p>
|
||||
* 由服务层按 {@code auditedSnapshotJson} 是否有内容算出,前端据此打「已修订」标记。
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "是否经过审核员修订")
|
||||
private Boolean revised;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user