fix(bug修复):1.如图四所示创建月度计划选择课程管理中的课程时下拉数据只能拉出自己部门课程
deploy-hxtesting / build-and-deploy (push) Successful in 1m12s
deploy-hxtesting / build-and-deploy (push) Successful in 1m12s
2.创建月度培训计划时选择课程默认展示出来的课程信息要能支持修改相关课件信息,及上传课件、试题,(修改上传后需要课长签核) 3.创建好月度计划培训后填写了授课地点但发布时一直提示如图2、3所示! 4.年度、月度培训计划列表中数据要按按计划培训时间来倒序排,创建月度计划培训时计划培训时间默认未授课培训月份!
This commit is contained in:
1 parent
102d94e6c8
commit
f88fce3673
5 files changed
+304
-12
No files matched your search
@@ -175,7 +175,33 @@ func (s *trainingService) ImportQuestionBankFromKnowledge(ctx context.Context, t
|
||||
libraryCourseID = oldLibraryCourseID
|
||||
}
|
||||
bank := &types.TrainingQuestionBank{Name: name, CourseID: courseID, LibraryCourseID: libraryCourseID, KnowledgeID: knowledgeID}
|
||||
return s.ImportQuestionBank(ctx, tenantID, bank, questions, updaterID)
|
||||
created, err := s.ImportQuestionBank(ctx, tenantID, bank, questions, updaterID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// 试题变更回待核验(000163):同课件「换课件即回待核验」口径,导入后须
|
||||
// 所属部门课长/经理重新签核,课程方可发布。
|
||||
s.resetLibraryCourseVerify(ctx, tenantID, created.LibraryCourseID)
|
||||
return created, nil
|
||||
}
|
||||
|
||||
// resetLibraryCourseVerify 课程管理条目试题变更后重置签核状态(000163):
|
||||
// 更换/导入题库同课件变更口径回「待核验」。fail-open:条目缺失或回写失败
|
||||
// 仅记日志,不阻断题库操作本身。
|
||||
func (s *trainingService) resetLibraryCourseVerify(ctx context.Context, tenantID uint64, libraryCourseID string) {
|
||||
if libraryCourseID == "" {
|
||||
return
|
||||
}
|
||||
item, err := s.repo.GetCourseLibraryItem(ctx, tenantID, libraryCourseID)
|
||||
if err != nil || item == nil {
|
||||
return
|
||||
}
|
||||
item.VerifyStatus = types.CourseLibraryVerifyPending
|
||||
item.ConfirmedBy = ""
|
||||
item.ConfirmedAt = nil
|
||||
if err := s.repo.UpdateCourseLibraryItem(ctx, item); err != nil {
|
||||
logger.Warnf(ctx, "[Training] reset library course verify failed, tenant=%d course=%s err=%v", tenantID, libraryCourseID, err)
|
||||
}
|
||||
}
|
||||
|
||||
// ListLibraryCourseQuestionBanks 课程管理条目下的题库列表(试题维护抽屉,000153)。
|
||||
@@ -188,6 +214,7 @@ func (s *trainingService) ListLibraryCourseQuestionBanks(ctx context.Context, te
|
||||
|
||||
// LinkQuestionBankToLibraryCourse 更换课程管理条目的试题(000156):所选题库整体
|
||||
// 替换该条目当前挂接的题库,回写课程管理资产(月计划侧更换入口)。
|
||||
// 更换后重置签核状态(000163):同课件变更口径,须课长/经理重新签核方可发布。
|
||||
func (s *trainingService) LinkQuestionBankToLibraryCourse(ctx context.Context, tenantID uint64, libraryCourseID, bankID string) error {
|
||||
if libraryCourseID == "" {
|
||||
return errors.NewBadRequestError("缺少课程管理条目")
|
||||
@@ -195,7 +222,11 @@ func (s *trainingService) LinkQuestionBankToLibraryCourse(ctx context.Context, t
|
||||
if _, err := s.repo.GetQuestionBank(ctx, tenantID, bankID); err != nil {
|
||||
return errors.NewNotFoundError("题库不存在")
|
||||
}
|
||||
return s.repo.RelinkQuestionBankToLibraryCourse(ctx, tenantID, libraryCourseID, bankID)
|
||||
if err := s.repo.RelinkQuestionBankToLibraryCourse(ctx, tenantID, libraryCourseID, bankID); err != nil {
|
||||
return err
|
||||
}
|
||||
s.resetLibraryCourseVerify(ctx, tenantID, libraryCourseID)
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeleteQuestionBank 删除题库(连带题目与缓存试卷;试题维护抽屉删除入口,000153)。
|
||||
|
||||
Reference in new issue
Block a user