Compare commits

..

No commits in common. "483314d2c420ffe48e78ddce0e6ba1f1604bf76b" and "947651ea3f34c65c468ac77057707ce58d7f789f" have entirely different histories.

View File

@ -5,11 +5,10 @@ import (
"micro-bundle/internal/model"
"micro-bundle/pkg/app"
commonErr "micro-bundle/pkg/err"
"strings"
"time"
"strings"
"github.com/google/uuid"
"go.uber.org/zap"
"gorm.io/gorm"
)
@ -494,46 +493,22 @@ func UpdateTaskProgress(req *CompleteTaskRequest) error {
case "video":
newCompleteCount := assignRecord.CompleteVideoCount + req.CompleteCount
if newCompleteCount > assignRecord.AssignVideoCount {
// 记录超限日志,但不返回错误
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),
)
tx.Rollback()
return commonErr.ReturnError(nil, "完成数量超出限制", "视频完成数量不能超过指派数量")
}
updateData["complete_video_count"] = newCompleteCount
case "post":
newCompleteCount := assignRecord.CompletePostCount + req.CompleteCount
if newCompleteCount > assignRecord.AssignPostCount {
// 记录超限日志,但不返回错误
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),
)
tx.Rollback()
return commonErr.ReturnError(nil, "完成数量超出限制", "图文完成数量不能超过指派数量")
}
updateData["complete_post_count"] = newCompleteCount
case "data":
newCompleteCount := assignRecord.CompleteDataCount + req.CompleteCount
if newCompleteCount > assignRecord.AssignDataCount {
// 记录超限日志,但不返回错误
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),
)
tx.Rollback()
return commonErr.ReturnError(nil, "完成数量超出限制", "数据完成数量不能超过指派数量")
}
updateData["complete_data_count"] = newCompleteCount
default: