Update:任务工作日志接入bundleTaskType,支持写入/查询过滤/返回

This commit is contained in:
cjy 2026-06-04 16:05:11 +08:00
parent 239b97b759
commit 235bea33ff
6 changed files with 2261 additions and 2204 deletions

View File

@ -464,6 +464,7 @@ func (b *BundleProvider) GetTaskWorkLogList(_ context.Context, req *bundle.TaskW
ArtistUUID: req.ArtistUUID,
SubNum: req.SubNum,
ArtistName: req.ArtistName,
BundleTaskType: int(req.BundleTaskType),
Page: int(req.Page),
PageSize: int(req.PageSize),
}
@ -493,6 +494,7 @@ func (b *BundleProvider) GetTaskWorkLogList(_ context.Context, req *bundle.TaskW
OperationTime: int64(record.OperationTime),
CreatedAt: int64(record.CreatedAt),
UpdatedAt: int64(record.UpdatedAt),
BundleTaskType: bundle.BundleTaskType(record.BundleTaskType),
})
}
@ -521,6 +523,7 @@ func (b *BundleProvider) CreateTaskWorkLog(_ context.Context, req *bundle.Create
Remark: req.Remark,
OperatorName: req.OperatorName,
OperatorNum: req.OperatorNum,
BundleTaskType: int(req.BundleTaskType),
}
// 调用logic层

View File

@ -1979,6 +1979,10 @@ func CreateTaskWorkLog(req *dto.CreateTaskWorkLogRequest) error {
now := int(time.Now().Unix())
// 构建日志记录
bundleTaskType := req.BundleTaskType
if bundleTaskType == 0 {
bundleTaskType = model.BundleTaskTypeNormal
}
workLog := &model.TaskWorkLog{
WorkLogUUID: workLogUUID,
AssignRecordsUUID: req.AssignRecordsUUID,
@ -1997,6 +2001,7 @@ func CreateTaskWorkLog(req *dto.CreateTaskWorkLogRequest) error {
OperationTime: now,
CreatedAt: now,
UpdatedAt: now,
BundleTaskType: bundleTaskType,
}
// 插入数据库
@ -2035,6 +2040,9 @@ func GetTaskWorkLogList(req *dto.TaskWorkLogQueryRequest) ([]*model.TaskWorkLog,
if req.ArtistName != "" {
query = query.Where("artist_name LIKE ?", "%"+req.ArtistName+"%")
}
if req.BundleTaskType != 0 {
query = query.Where("bundle_task_type = ?", req.BundleTaskType)
}
query.Count(&total)

View File

@ -93,7 +93,8 @@ type TaskAssignRecordsQueryRequest struct {
PageSize int `json:"pageSize"` // 每页数量
SortBy string `json:"sortBy"` // 排序字段(白名单)
SortType string `json:"sortType"` // 排序方式
BundleTaskType int `json:"bundleTaskType"` // 任务所属套餐类型 0:全部 1:基础套餐 2:先用后付套餐
BundleTaskType int `json:"bundleTaskType"` // 任务所属套餐类型 0:全部 1:基础套餐 2:先用后付套餐
}
// 任务记录表返回结构体
@ -249,6 +250,8 @@ type CreateTaskWorkLogRequest struct {
// 操作人信息
OperatorName string `json:"operatorName"` // 任务操作人姓名
OperatorNum string `json:"operatorNum"` // 任务操作人账号
BundleTaskType int `json:"bundleTaskType"` // 任务所属套餐类型 0:默认 1:基础套餐 2:先用后付套餐
}
type TaskWorkLogQueryRequest struct {
@ -258,6 +261,7 @@ type TaskWorkLogQueryRequest struct {
ArtistUUID string `json:"artistUUID"`
SubNum string `json:"subNum"`
ArtistName string `json:"artistName"`
BundleTaskType int `json:"bundleTaskType"` // 任务所属套餐类型 0:全部 1:基础套餐 2:先用后付套餐
Page int `json:"page"`
PageSize int `json:"pageSize"`
}

View File

@ -1745,6 +1745,7 @@ message TaskWorkLogQueryRequest {
string artistName = 6 [json_name = "artistName"];
int32 page = 7 [json_name = "page"];
int32 pageSize = 8 [json_name = "pageSize"];
BundleTaskType bundle_task_type = 9 [json_name = "bundleTaskType"]; //
}
message TaskWorkLogInfo {
@ -1765,6 +1766,7 @@ message TaskWorkLogInfo {
int64 operationTime = 15 [json_name = "taskOperationTime"];
int64 createdAt = 16 [json_name = "taskCreatedAt"];
int64 updatedAt = 17 [json_name = "taskUpdatedAt"];
BundleTaskType bundle_task_type = 18 [json_name = "bundleTaskType"]; //
}
message TaskWorkLogQueryResponse {
@ -1789,6 +1791,7 @@ message CreateTaskWorkLogRequest {
string remark = 11 [json_name = "remark"]; //
string operatorName = 12 [json_name = "operatorName"]; //
string operatorNum = 13 [json_name = "operatorNum"]; //
BundleTaskType bundle_task_type = 14 [json_name = "bundleTaskType"]; //
}
message MetricsBusinessReq{

File diff suppressed because it is too large Load Diff

View File

@ -7,8 +7,8 @@ import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
_ "google.golang.org/protobuf/types/descriptorpb"
_ "github.com/mwitkow/go-proto-validators"
_ "google.golang.org/protobuf/types/descriptorpb"
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
)