package com.train.service; import com.train.common.Result; import java.util.Map; /** * 四层评价服务(M3 评价晋升域) * * 四层:E1 客户服务评价 / E2 机构绩效考核 / E3 培训考核成绩 / E4 综合评级沉淀。 * - E1 ★only-after-confirmed:order.status==confirmed 且 userId==order.worker_id;uk(order_id) 幂等 once-per-order * - E2/E3:RoleGuard.requireOrgOrTeacher(任一机构 active 成员 或 平台 teacher/assistant) * - E4 综合评级聚合:默认权重 客户40/机构30/培训30,按「有数据层」归一;幂等重算覆盖写 profile.rating(不累加) * - 学时一律分钟整数;评分禁浮点(int) */ public interface EvalService { /** E1 客户服务评价(★only-after-confirmed;uk(order_id) 幂等) */ Result> submitClient(Long userId, Long orderId, Integer score, String comment); /** E2 机构绩效评价(requireOrgOrTeacher;score 1-100) */ Result> submitOrg(Long operatorId, Long targetUserId, Integer score, String dimension, String comment); /** * E2 机构绩效(train.eval.performance / TC-1030):带 replay 重放标识与幂等键的提交入口。 * 绩效落 train_eval_record(eval_type=org)并与评级/晋升评定联动; * 支持同键异载荷 C4092 / 被评人不存在 C404 / 并发冲突 C422 / 越权 C403。 */ Result> submitOrgPerformance(Long operatorId, Long targetUserId, Integer score, String dimension, String comment, Boolean replay, String idempotencyKey); /** E3 培训考核成绩(requireOrgOrTeacher;examScore 0-100;双达标自动触发 CertService 发证) */ Result> submitTraining(Long operatorId, Long targetUserId, Integer examScore, Integer creditHours); /** * 带教/督导对实习学员考核(train.eval.coach / TC-1029)。 * 考核落 train_eval_record(eval_type=coach),ref_id 关联实习记录; * 支持 replay 重放与幂等键(同键异载荷 C4092 / 落库 0 行 C422)。 */ Result> submitCoach(Long operatorId, Long targetUserId, Long internshipRefId, Integer score, String dimension, String comment, Boolean replay, String idempotencyKey); /** E4 我的四层评价汇总 + 综合评级(幂等重算覆盖写 profile.rating) */ Result> mine(Long userId); /** admin:评价记录分页视角(requireAdmin) */ Result> adminList(Long operatorId, Boolean isAdmin, Map body); }