fix(bug):和信智汇学院上线培训 · 2026/11/27 10:00对该课程扫码签到如图所示学员信息丢失了!请核对矫正!
deploy-hxtesting / build-and-deploy (push) Successful in 1m17s

This commit is contained in:
runny committed 2026-11-27 18:16:01 +08:00
1 parent 4f77907a8a
commit 0c471efb9f
8 files changed
+52 -11

No files matched your search

@@ -783,7 +783,12 @@ func (s *trainingService) CreateSignCode(ctx context.Context, tenantID uint64, s
if err != nil {
return nil, errors.NewNotFoundError("课程场次不存在")
}
if radius <= 0 {
// 半径兜底仅在真实圆心下生效:前端生成签到码不携带定位(圆心为零值)时
// 不启用围栏 —— 否则 (0,0)+300m 会把所有真实扫码判成定位异常(距离一万
// 公里级)。需要围栏时由生成方显式传 geo_lat/geo_lng。
if lat == 0 && lng == 0 {
radius = 0
} else if radius <= 0 {
radius = int(s.ruleFloat(ctx, tenantID, types.RuleKeySignPolicy, "geo_radius_m", 300))
}
now := time.Now()
@@ -982,9 +987,10 @@ func (s *trainingService) Checkin(ctx context.Context, tenantID uint64, userID s
status = types.TrainingSignLate
}
// 定位围栏判定。
// 定位围栏判定。圆心 (0,0) 视为未配置(生成签到码不带定位时圆心落零值):
// 距离按 0 记、不打 outside —— 否则圆心在几万公里外,全国任意扫码全是定位异常。
distance := 0.0
if code.GeoRadius > 0 {
if code.GeoRadius > 0 && (code.GeoLat != 0 || code.GeoLng != 0) {
distance = haversineMeters(lat, lng, code.GeoLat, code.GeoLng)
if distance > float64(code.GeoRadius) {
flags = append(flags, "outside")
@@ -139,7 +139,7 @@ const (
defaultWeeklyContent = "{month} 月已进入第 {week} 周({week_start} 至 {week_end}),您本月仍有 {count} 场培训未结束,请与人事约定培训时间并于月内完成课件、签到与评价。"
// 年培训计划收集推送默认文案(与前端收集弹窗历史硬编码逐字一致;{year} 渲染收集年度)
defaultDemandCollectTitle = "【培训需求收集】{year}年度培训计划收集"
defaultDemandCollectContent = "请各部门于 {year} 年 1 月 31 日前提报 {year} 年度培训需求:可点击消息中的「教育训练需求表模板」链接直接下载批量填写后导入,或登录 AIDO → 企业培训 → 培训计划 → 年度需求收集在线逐条提报。"
defaultDemandCollectContent = "请各部门于 {year} 年 1 月 31 日前提报 {year} 年度培训需求:可点击消息中的「教育训练需求表模板」链接直接下载批量填写后导入,或登录和信智汇学院 → 企业培训 → 培训计划 → 年度需求收集在线逐条提报。"
)
func defaultNotifyTextTemplates() notifyTextTemplates {