diff --git a/internal/dao/taskDao.go b/internal/dao/taskDao.go index 177aa29..d8ce3d6 100644 --- a/internal/dao/taskDao.go +++ b/internal/dao/taskDao.go @@ -5,10 +5,11 @@ import ( "micro-bundle/internal/model" "micro-bundle/pkg/app" commonErr "micro-bundle/pkg/err" - "time" "strings" + "time" "github.com/google/uuid" + "go.uber.org/zap" "gorm.io/gorm" ) @@ -493,22 +494,46 @@ func UpdateTaskProgress(req *CompleteTaskRequest) error { case "video": newCompleteCount := assignRecord.CompleteVideoCount + req.CompleteCount if newCompleteCount > assignRecord.AssignVideoCount { - tx.Rollback() - return commonErr.ReturnError(nil, "完成数量超出限制", "视频完成数量不能超过指派数量") + // 记录超限日志,但不返回错误 + app.ModuleClients.Lg.Info("视频完成数量超出限制", + zap.String("assignRecordsUUID", assignRecord.AssignRecordsUUID), + zap.String("employeeName", req.EmployeeName), + zap.String("employeeNum", req.EmployeeNum), + zap.Int("currentCompleteCount", assignRecord.CompleteVideoCount), + zap.Int("requestCompleteCount", req.CompleteCount), + zap.Int("newCompleteCount", newCompleteCount), + zap.Int("assignVideoCount", assignRecord.AssignVideoCount), + ) } updateData["complete_video_count"] = newCompleteCount case "post": newCompleteCount := assignRecord.CompletePostCount + req.CompleteCount if newCompleteCount > assignRecord.AssignPostCount { - tx.Rollback() - return commonErr.ReturnError(nil, "完成数量超出限制", "图文完成数量不能超过指派数量") + // 记录超限日志,但不返回错误 + app.ModuleClients.Lg.Info("图文完成数量超出限制", + zap.String("assignRecordsUUID", assignRecord.AssignRecordsUUID), + zap.String("employeeName", req.EmployeeName), + zap.String("employeeNum", req.EmployeeNum), + zap.Int("currentCompleteCount", assignRecord.CompletePostCount), + zap.Int("requestCompleteCount", req.CompleteCount), + zap.Int("newCompleteCount", newCompleteCount), + zap.Int("assignPostCount", assignRecord.AssignPostCount), + ) } updateData["complete_post_count"] = newCompleteCount case "data": newCompleteCount := assignRecord.CompleteDataCount + req.CompleteCount if newCompleteCount > assignRecord.AssignDataCount { - tx.Rollback() - return commonErr.ReturnError(nil, "完成数量超出限制", "数据完成数量不能超过指派数量") + // 记录超限日志,但不返回错误 + app.ModuleClients.Lg.Info("数据完成数量超出限制", + zap.String("assignRecordsUUID", assignRecord.AssignRecordsUUID), + zap.String("employeeName", req.EmployeeName), + zap.String("employeeNum", req.EmployeeNum), + zap.Int("currentCompleteCount", assignRecord.CompleteDataCount), + zap.Int("requestCompleteCount", req.CompleteCount), + zap.Int("newCompleteCount", newCompleteCount), + zap.Int("assignDataCount", assignRecord.AssignDataCount), + ) } updateData["complete_data_count"] = newCompleteCount default: