feat(培训推送):“资讯组 新导入7条年度培训需求(课程:A(培训课程测试1、AI培训课程测试2、AI培训课程测试3、AI培训课程测试4、AI培训课程测试5、AI培训课程测试6、AI培训课程测试7)。请登录和信智汇学院 → 企业培训 一 年培训计划,逐条核验并【确认】,确认后将自动转入月培训计划。”
deploy-hxtesting / build-and-deploy (push) Successful in 1m20s

This commit is contained in:
runny committed 2026-11-30 17:04:06 +08:00
1 parent 858c352991
commit 0a4471f5e4
7 files changed
+286 -11

No files matched your search

+12 -10
View File
@@ -600,6 +600,12 @@ func (h *Handler) SaveDemand(c *gin.Context) {
}
// 需求讲师回写课程管理(000156):在线改选讲师后课程管理同步追加(fail-open)。
h.syncDemandLecturerToLibrary(ctx, callerTenantID(c), callerUserID(c), []*types.TrainingDemand{demand})
// [2026-11 需求] 在线提报创建完成后同样推送部门经理核验提醒(与批量导入同
// 口径:按部门聚合并通知该部门经理核验【确认】;编辑不重复推;fail-open
// 不阻断保存)。
if req.ID == "" {
h.notifyDemandVerify(ctx, callerTenantID(c), []*types.TrainingDemand{demand})
}
c.JSON(http.StatusOK, gin.H{"success": true, "data": demand})
}
@@ -1008,11 +1014,9 @@ func (h *Handler) notifyDemandVerify(ctx context.Context, tenantID uint64, deman
if name == "" {
name = deptID
}
title := fmt.Sprintf("【年度培训需求核验】%d年度 %s 培训需求待核验", year, name)
content := fmt.Sprintf(
"%s 新导入 %d 条年度培训需求(课程:%s)。请登录和信智汇学院 → 企业培训 → 年培训计划,逐条核验并【确认】,确认后将自动转入月培训计划。",
name, len(courses), strings.Join(courses, "、"),
)
// 文案入配置中心「提醒推送文案」demand_verify_*(2026-11 需求,空字段回落默认):
// 占位符 {year}/{dept}/{count}/{courses}
title, content := h.svc.DemandVerifyNoticeText(ctx, tenantID, year, name, courses)
n, err := h.svc.BroadcastNotification(ctx, tenantID, recipients, "demand_verify", title, content, "plan", strconv.Itoa(year), "")
if err != nil {
logger.Error(ctx, "Failed to notify dept managers for demand verify", err)
@@ -1044,11 +1048,9 @@ func (h *Handler) notifyDemandConfirmed(ctx context.Context, tenantID uint64, op
if len(final) == 0 {
return
}
title := fmt.Sprintf("【培训计划维护】%s 已确认转入月培训计划", demand.CourseName)
content := fmt.Sprintf(
"%d年度需求「%s」已核验确认并自动转入月培训计划:请讲师维护课程信息(课件/试题),课长安排授课时间/地点与学员名单。入口:和信智汇学院 → 企业培训 → 月培训计划。",
demand.Year, demand.CourseName,
)
// 文案入配置中心「提醒推送文案」demand_confirmed_*(2026-11 需求,空字段回落默认):
// 占位符 {year}/{course}
title, content := h.svc.DemandConfirmedNoticeText(ctx, tenantID, demand.Year, demand.CourseName)
if _, err := h.svc.BroadcastNotification(ctx, tenantID, final, "demand_confirmed", title, content, "course", demand.ID, ""); err != nil {
logger.Error(ctx, "Failed to notify lecturer and supervisors after demand confirm", err)
}