Compare commits
No commits in common. "d56346e4aee8d3e6dba18d0b3ef679d5dbea3ad5" and "4b8db96a36117cd3c44e0b416c15ece74c1b8b20" have entirely different histories.
d56346e4ae
...
4b8db96a36
@ -46,20 +46,16 @@ type TaskAssignRequest struct {
|
|||||||
func GetPendingTaskLayout() (string, error) {
|
func GetPendingTaskLayout() (string, error) {
|
||||||
var rec model.TaskPendingLayout
|
var rec model.TaskPendingLayout
|
||||||
if err := app.ModuleClients.TaskBenchDB.Model(&model.TaskPendingLayout{}).Where("id = ?", 1).First(&rec).Error; err != nil {
|
if err := app.ModuleClients.TaskBenchDB.Model(&model.TaskPendingLayout{}).Where("id = ?", 1).First(&rec).Error; err != nil {
|
||||||
return "", commonErr.ReturnError(err, "查询待指派布局失败", "查询待指派布局失败: ")
|
return "nil", err
|
||||||
}
|
}
|
||||||
return rec.Data, nil
|
return rec.Data, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetPendingTaskLayout(data string) error {
|
func SetPendingTaskLayout(data string) error {
|
||||||
err := app.ModuleClients.TaskBenchDB.Clauses(clause.OnConflict{
|
return app.ModuleClients.TaskBenchDB.Clauses(clause.OnConflict{
|
||||||
Columns: []clause.Column{{Name: "id"}},
|
Columns: []clause.Column{{Name: "id"}},
|
||||||
DoUpdates: clause.AssignmentColumns([]string{"data"}),
|
DoUpdates: clause.AssignmentColumns([]string{"data"}),
|
||||||
}).Create(&model.TaskPendingLayout{ID: 1, Data: data}).Error
|
}).Create(&model.TaskPendingLayout{ID: 1, Data: data}).Error
|
||||||
if err != nil {
|
|
||||||
return commonErr.ReturnError(err, "保存待指派布局失败", "保存待指派布局失败: ")
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// BatchAssignItem 批量指派项(仅写入指派记录,不更新任务管理表)
|
// BatchAssignItem 批量指派项(仅写入指派记录,不更新任务管理表)
|
||||||
@ -1376,7 +1372,7 @@ func UpdateTaskProgress(req *CompleteTaskRequest) error {
|
|||||||
query = query.Where("pending_video_script_count > 0 AND complete_video_script_count < assign_video_script_count")
|
query = query.Where("pending_video_script_count > 0 AND complete_video_script_count < assign_video_script_count")
|
||||||
default:
|
default:
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
return commonErr.ReturnError(nil, "无效的任务类型", "任务类型必须是视频、图文、数据或脚本")
|
return commonErr.ReturnError(nil, "无效的任务类型", "任务类型必须是video、post、data或script")
|
||||||
}
|
}
|
||||||
|
|
||||||
err = query.
|
err = query.
|
||||||
@ -1570,7 +1566,7 @@ func UpdateTaskProgress(req *CompleteTaskRequest) error {
|
|||||||
updateData["pending_video_script_count"] = newPending
|
updateData["pending_video_script_count"] = newPending
|
||||||
default:
|
default:
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
return commonErr.ReturnError(nil, "无效的任务类型", "任务类型必须是视频、图文、数据或脚本")
|
return commonErr.ReturnError(nil, "无效的任务类型", "任务类型必须是video、post、data或script")
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. 更新指派记录
|
// 3. 更新指派记录
|
||||||
|
|||||||
@ -350,7 +350,7 @@ func CompleteTaskManually(assignRecordsUUID string, taskAssigneeNum string) erro
|
|||||||
// UpdateTaskProgress 员工实际完成任务状态更新
|
// UpdateTaskProgress 员工实际完成任务状态更新
|
||||||
func UpdateTaskProgress(req *dao.CompleteTaskRequest) error {
|
func UpdateTaskProgress(req *dao.CompleteTaskRequest) error {
|
||||||
if req.UUID == "" {
|
if req.UUID == "" {
|
||||||
return commonErr.ReturnError(nil, "作品UUID不能为空", "UUID不能为空")
|
return commonErr.ReturnError(nil, "cast work 的UUID不能为空", "UUID不能为空")
|
||||||
}
|
}
|
||||||
return dao.UpdateTaskProgress(req)
|
return dao.UpdateTaskProgress(req)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user