写回卡片加「结果不明时谁去核实」:写回的目标能力没登记查询时,结果不明(请求发出去了、没拿到答复)平台查不了、也不自动重发,要有人去目标系统里核实;以前发布单报「写入结果不明时没人核实」「有一步还没指定谁来做」却在卡片上找不到地方改。

- 蓝图格式:写回卡片多一项 reconciler(一组人或组),旧蓝图没有这一项照旧可读;只收用户的操作(同「谁能看」),助手整张换写回卡片时留着用户选好的人
- 是否需要(templates/_common.needs_reconciler,和应用骨架加核实岗位同一个判断):模板用到写回卡片、选了目标能力、能力没登记查询;交给前端的蓝图带 reconciler_needed,界面不自己判
- 蓝图检查 bp.reconciler_unbound:试运行只提醒(待办派给试运行的人自己),发布挡住;发布单上应用检查说同一件事的 app.reconciler_unbound 和核实岗位的 app.slot_unbound 不再重复列
- 岗位绑定:选了的人绑到应用的核实岗位;能力补登了查询就不再要、也不再绑,卡片上留着的人照样摆出来、写明用不上
- 卡片:需要时摆这一项,标「缺」、写明为什么要人核实,选人控件只能选人或组;「缺」只挡发布;蓝图助手的提示词写明这一项由用户定
- 示例蓝图(核对写回)补上核实人,审批、核对写回的卡片说明写上这一项;测试和检查脚本跟上
This commit is contained in:
ThearchyHelios
2026-10-15 15:57:03 +08:00
parent 7fc3488b55
commit d2b398563b
17 changed files with 300 additions and 25 deletions
+5
View File
@@ -204,6 +204,7 @@ export const ITEM_LABEL: Record<string, string> = {
capability: '写到哪个系统',
mapping: '字段对应',
confirm: '要不要人确认',
reconciler: '结果不明时谁去核实',
cadence: '多久更新、统计哪一期',
use: '可以使用',
observe: '可以查看全部',
@@ -351,6 +352,10 @@ export const BP_EDIT_TEXT = {
addField: '加一个字段',
addFieldPrompt: '字段叫什么(例如「金额」)',
addWriteback: '要写回系统',
/** 写回卡片上「结果不明时谁去核实」的说明:目标能力没登记查询时才摆(服务端 Blueprint.reconciler_needed) */
reconcilerHint: '这项写入能力没登记查询:写回的结果不明时(请求发出去了、没拿到答复),平台查不了,也不会自动重发,'
+ '要有人去目标系统里看写进去没有。只能由你来选。',
reconcilerUnused: '这项写入能力已经登记了查询,结果不明时平台自己去查:这一项用不上了,发布时不会派给他们。',
removeTitle: (where: string) => `删掉${where}?`,
removeConfirm: '删掉',
template: '换一个场景',
@@ -6,6 +6,8 @@
* 条件这些选填的空着也是缺,只看项的状态会把它们都标成缺;「待确认」是助手、模板、目录提的、你还没看过的项。界面不自己判
* 哪些项必填(P7)。
*
* 写回卡片上「结果不明时谁去核实」只在目标能力没登记查询时摆(服务端 Blueprint.reconciler_needed),只能由人选(同「谁能看」)。
*
* 每一项可以点「修改」:改完发一个 bp_set(值是纯值,服务端记成来源「你」、已确认);待确认的可以直接点「确认」(只改状态,
* 来源不变),一张卡片上待确认的不止一项时卡头另有「确认全部」,一次修改带上这几项的状态(服务端整批落或整批不落)。
* 加一项是 bp_add(卡片字段写纯值),删一项是 bp_remove。对到数据的项写表、中文名、粒度、业务日期和
@@ -29,6 +31,9 @@ import type {
import { SELF_RECORDS, ValueEditor, valueText, type EditorKind, type EditorScope } from './editors'
import { isItem, missingPaths, visibleCards, type CardKey } from './shared'
/** 卡片上还没有的一项(旧蓝图的写回卡片没有「结果不明时谁去核实」):按缺摆出来,改了服务端才建 */
const UNSET: BpItem = { value: null, source: 'template', status: 'missing' }
const STATUS_COLOR: Record<ItemStatus, string> = {
confirmed: 'var(--st-done)', proposed: 'var(--st-waiting)', missing: 'var(--st-failed)',
}
@@ -207,8 +212,12 @@ function CardFor({ card, ctx, template }: { card: CardKey; ctx: CardCtx; templat
}
case 'writeback': {
const wb = spec.writeback
// 结果不明时谁去核实:目标能力没登记查询时才摆(服务端说要不要);以前选过、后来能力补登了查询的照样摆出来,写明用不上
const reconciler: BpItem = wb?.reconciler ?? UNSET
const chosen = Array.isArray(reconciler.value) && reconciler.value.length > 0
const askReconciler = !!wb && (!!ctx.bp.reconciler_needed || chosen)
const items: [string, BpItem][] = wb ? [['/writeback/capability', wb.capability], ['/writeback/mapping', wb.mapping],
['/writeback/confirm', wb.confirm]] : []
['/writeback/confirm', wb.confirm], ...(askReconciler ? [['/writeback/reconciler', reconciler] as [string, BpItem]] : [])] : []
return (
<Card card={card} note={note} issues={issues} status={cardStatus(ctx, card, items)}
actions={!wb ? (
@@ -222,6 +231,15 @@ function CardFor({ card, ctx, template }: { card: CardKey; ctx: CardCtx; templat
<ItemRow ctx={ctx} path="/writeback/capability" item={wb.capability} label={ITEM_LABEL.capability} kind="text" />
<ItemRow ctx={ctx} path="/writeback/mapping" item={wb.mapping} label={ITEM_LABEL.mapping} kind="mapping" />
<ItemRow ctx={ctx} path="/writeback/confirm" item={wb.confirm} label={ITEM_LABEL.confirm} kind="bool" />
{askReconciler && (
<>
<ItemRow ctx={ctx} path="/writeback/reconciler" item={reconciler} label={ITEM_LABEL.reconciler} kind="grantees" />
<p className="pl-[7.5rem] text-2xs leading-relaxed text-dim"
data-bp-reconciler-hint={ctx.bp.reconciler_needed ? 'needed' : 'unused'}>
{ctx.bp.reconciler_needed ? BP_EDIT_TEXT.reconcilerHint : BP_EDIT_TEXT.reconcilerUnused}
</p>
</>
)}
</SubBlock>
)}
</Card>
@@ -25,8 +25,11 @@ import { TrialSection } from './TrialSection'
import { blueprintPath, trialed } from './shared'
const SECTIONS = ['cards', 'trial'] as const
/** 只挡发布、不挡试运行的问题:待确认的项、岗位没人(试运行时人工步骤派给试运行的人自己,服务端 blueprints/ops) */
const PUBLISH_ONLY = new Set(['bp.unconfirmed', 'bp.people_unbound'])
/**
* 只挡发布、不挡试运行的问题:待确认的项、岗位没人、写回结果不明时没人核实(试运行时人工步骤派给试运行的人自己,写入走
* 测试环境或演练,服务端 blueprints/ops)
*/
const PUBLISH_ONLY = new Set(['bp.unconfirmed', 'bp.people_unbound', 'bp.reconciler_unbound'])
type Section = (typeof SECTIONS)[number]
/** 模板说明整站一份,进一次蓝图页取一次就够 */
+5 -3
View File
@@ -65,10 +65,12 @@ export function visibleCards(spec: BlueprintSpec | null | undefined, templateCar
}
/**
* 服务端蓝图检查(Blueprint.issues)里说「缺」的那几种:缺必填项、没对到表、岗位没人。卡片上的「缺」以它为准——项的状态
* 默认就是缺(单位、筛选条件这些可以不填),只看项的状态会把选填的都标成缺
* 服务端蓝图检查(Blueprint.issues)里说「缺」的那几种:缺必填项、没对到表、岗位没人、写回结果不明时没人核实。卡片上的
* 「缺」以它为准——项的状态默认就是缺(单位、筛选条件这些可以不填),只看项的状态会把选填的都标成缺
*/
export const MISSING_CODES = new Set(['bp.missing', 'bp.data_unmapped', 'bp.people_unbound', 'tpl.joint_unfilled'])
export const MISSING_CODES = new Set([
'bp.missing', 'bp.data_unmapped', 'bp.people_unbound', 'bp.reconciler_unbound', 'tpl.joint_unfilled',
])
/** 卡片上标「缺」的位置:服务端给了检查结果时按它;老服务端没给时退回项本身的状态(null) */
export function missingPaths(bp: Blueprint | null | undefined): Set<string> | null {
+10
View File
@@ -49,6 +49,11 @@ export interface BpWriteback {
capability: BpItem<string>
mapping: BpItem<Record<string, string>>
confirm: BpItem<boolean>
/**
* 结果不明时谁去核实(一组人或组):目标能力没登记查询时才要(Blueprint.reconciler_needed),发布时绑到应用的核实岗位。
* 只由用户定,助手的改动服务端不收。旧蓝图没有这一项
*/
reconciler?: BpItem<{ kind: 'user' | 'group'; name: string }[]>
}
export interface BpAccess {
@@ -122,6 +127,11 @@ export interface Blueprint {
graph_hash: string | null
joints: Record<string, JointState>
copied_from: string | null
/**
* 写回卡片上要不要摆「结果不明时谁去核实」:模板用到写回、选了目标能力、这项能力没登记查询(服务端
* templates/_common.needs_reconciler,界面不自己判)。老服务端不给时按不要
*/
reconciler_needed?: boolean
/** 蓝图检查(bp.* / tpl.*),带白话 */
issues?: PlainIssue[]
created_at: string