Compare commits
No commits in common. "a88cc56f24a4e8f61092bbe2a65e7e5c60b77aff" and "4687a172f295181e8868ae842c845d4f4a74d536" have entirely different histories.
a88cc56f24
...
4687a172f2
@ -182,7 +182,7 @@ func (b *BundleProvider) CompleteTaskManually(_ context.Context, req *bundle.Com
|
|||||||
}
|
}
|
||||||
|
|
||||||
return &bundle.CommonResponse{
|
return &bundle.CommonResponse{
|
||||||
Msg: "任务完成",
|
Msg: "任务完成状态更新成功",
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -282,32 +282,11 @@ func GetEmployeeAssignedTasks(req *dao.EmployeeTaskQueryRequest) ([]*dao.TaskAss
|
|||||||
|
|
||||||
// CompleteTaskManually 员工手动点击完成任务
|
// CompleteTaskManually 员工手动点击完成任务
|
||||||
func CompleteTaskManually(assignRecordsUUID string, taskAssigneeNum string) error {
|
func CompleteTaskManually(assignRecordsUUID string, taskAssigneeNum string) error {
|
||||||
// 第一步,查询指派记录,获取艺人编号
|
// // 第一步,批量更新记录被指派的员工为taskAssigneeNum的待完成任务数量和已经完成任务的数量
|
||||||
record, err := dao.GetAssignRecordByUUID(assignRecordsUUID)
|
// err := dao.UpdateTaskRecordsByAssigneeNum(taskAssigneeNum)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
return err
|
// return err
|
||||||
}
|
// }
|
||||||
if record == nil {
|
|
||||||
return commonErr.ReturnError(nil, "未找到任务记录", "未找到指派记录: ")
|
|
||||||
}
|
|
||||||
|
|
||||||
// 第二步,校验该艺人是否为有效艺人(套餐未过期且已激活)
|
|
||||||
validArtistList, err := GetValidArtistList()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
isValid := false
|
|
||||||
for _, a := range validArtistList {
|
|
||||||
if a.CustomerNum == record.SubNum {
|
|
||||||
isValid = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if !isValid {
|
|
||||||
return commonErr.ReturnError(nil, "该艺人套餐已过期,暂不能完成任务", "艺人套餐已过期,暂不能完成任务: ")
|
|
||||||
}
|
|
||||||
|
|
||||||
// 第三步,执行任务完成更新
|
|
||||||
return dao.CompleteTaskManually(assignRecordsUUID)
|
return dao.CompleteTaskManually(assignRecordsUUID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user