Merge branch 'feat-cjy-taskBench' into dev

This commit is contained in:
cjy 2025-09-03 16:26:02 +08:00
commit 7af0704d49
7 changed files with 6929 additions and 2085 deletions

File diff suppressed because it is too large Load Diff

View File

@ -466,3 +466,72 @@ func (this *UnfinishedInfo) Validate() error {
func (this *SoftDeleteUnfinishedInfoRequest) Validate() error {
return nil
}
func (this *TaskQueryRequest) Validate() error {
return nil
}
func (this *TaskQueryResponse) Validate() error {
for _, item := range this.Tasks {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Tasks", err)
}
}
}
return nil
}
func (this *TaskManagementInfo) Validate() error {
return nil
}
func (this *TaskAssignRequest) Validate() error {
return nil
}
func (this *UpdatePendingCountRequest) Validate() error {
return nil
}
func (this *RecentAssignRecordsRequest) Validate() error {
return nil
}
func (this *RecentAssignRecordsResponse) Validate() error {
return nil
}
func (this *EmployeeTaskQueryRequest) Validate() error {
return nil
}
func (this *EmployeeTaskQueryResponse) Validate() error {
for _, item := range this.Records {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Records", err)
}
}
}
return nil
}
func (this *TaskAssignRecordInfo) Validate() error {
return nil
}
func (this *CompleteTaskManuallyRequest) Validate() error {
return nil
}
func (this *UpdateTaskProgressRequest) Validate() error {
return nil
}
func (this *TaskAssignRecordsQueryRequest) Validate() error {
return nil
}
func (this *TaskAssignRecordsQueryResponse) Validate() error {
for _, item := range this.Records {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Records", err)
}
}
}
return nil
}
func (this *ArtistBundleBalanceRequest) Validate() error {
return nil
}
func (this *ArtistBundleBalanceResponse) Validate() error {
return nil
}

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
// versions:
// - protoc-gen-go-triple v1.0.5
// - protoc v6.32.0
// - protoc-gen-go-triple v1.0.8
// - protoc v3.21.1
// source: pb/bundle.proto
package bundle
@ -83,6 +83,16 @@ type BundleClient interface {
// 查出没处理的数据
ListUnfinishedInfos(ctx context.Context, in *AutoCreateUserAndOrderRequest, opts ...grpc_go.CallOption) (*UnfinishedInfos, common.ErrorWithAttachment)
SoftDeleteUnfinishedInfo(ctx context.Context, in *SoftDeleteUnfinishedInfoRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
// 任务台
GetPendingTaskList(ctx context.Context, in *TaskQueryRequest, opts ...grpc_go.CallOption) (*TaskQueryResponse, common.ErrorWithAttachment)
AssignTask(ctx context.Context, in *TaskAssignRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
UpdatePendingCount(ctx context.Context, in *UpdatePendingCountRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
GetRecentAssignRecords(ctx context.Context, in *RecentAssignRecordsRequest, opts ...grpc_go.CallOption) (*RecentAssignRecordsResponse, common.ErrorWithAttachment)
GetEmployeeAssignedTasks(ctx context.Context, in *EmployeeTaskQueryRequest, opts ...grpc_go.CallOption) (*EmployeeTaskQueryResponse, common.ErrorWithAttachment)
CompleteTaskManually(ctx context.Context, in *CompleteTaskManuallyRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
UpdateTaskProgress(ctx context.Context, in *UpdateTaskProgressRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
GetTaskAssignRecordsList(ctx context.Context, in *TaskAssignRecordsQueryRequest, opts ...grpc_go.CallOption) (*TaskAssignRecordsQueryResponse, common.ErrorWithAttachment)
GetArtistBundleBalance(ctx context.Context, in *ArtistBundleBalanceRequest, opts ...grpc_go.CallOption) (*ArtistBundleBalanceResponse, common.ErrorWithAttachment)
}
type bundleClient struct {
@ -139,6 +149,15 @@ type BundleClientImpl struct {
UpdateReconciliationStatusBySerialNumber func(ctx context.Context, in *UpdateStatusAndPayTimeBySerialNumber) (*CommonResponse, error)
ListUnfinishedInfos func(ctx context.Context, in *AutoCreateUserAndOrderRequest) (*UnfinishedInfos, error)
SoftDeleteUnfinishedInfo func(ctx context.Context, in *SoftDeleteUnfinishedInfoRequest) (*CommonResponse, error)
GetPendingTaskList func(ctx context.Context, in *TaskQueryRequest) (*TaskQueryResponse, error)
AssignTask func(ctx context.Context, in *TaskAssignRequest) (*CommonResponse, error)
UpdatePendingCount func(ctx context.Context, in *UpdatePendingCountRequest) (*CommonResponse, error)
GetRecentAssignRecords func(ctx context.Context, in *RecentAssignRecordsRequest) (*RecentAssignRecordsResponse, error)
GetEmployeeAssignedTasks func(ctx context.Context, in *EmployeeTaskQueryRequest) (*EmployeeTaskQueryResponse, error)
CompleteTaskManually func(ctx context.Context, in *CompleteTaskManuallyRequest) (*CommonResponse, error)
UpdateTaskProgress func(ctx context.Context, in *UpdateTaskProgressRequest) (*CommonResponse, error)
GetTaskAssignRecordsList func(ctx context.Context, in *TaskAssignRecordsQueryRequest) (*TaskAssignRecordsQueryResponse, error)
GetArtistBundleBalance func(ctx context.Context, in *ArtistBundleBalanceRequest) (*ArtistBundleBalanceResponse, error)
}
func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient {
@ -447,6 +466,60 @@ func (c *bundleClient) SoftDeleteUnfinishedInfo(ctx context.Context, in *SoftDel
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/SoftDeleteUnfinishedInfo", in, out)
}
func (c *bundleClient) GetPendingTaskList(ctx context.Context, in *TaskQueryRequest, opts ...grpc_go.CallOption) (*TaskQueryResponse, common.ErrorWithAttachment) {
out := new(TaskQueryResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetPendingTaskList", in, out)
}
func (c *bundleClient) AssignTask(ctx context.Context, in *TaskAssignRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
out := new(CommonResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/AssignTask", in, out)
}
func (c *bundleClient) UpdatePendingCount(ctx context.Context, in *UpdatePendingCountRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
out := new(CommonResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdatePendingCount", in, out)
}
func (c *bundleClient) GetRecentAssignRecords(ctx context.Context, in *RecentAssignRecordsRequest, opts ...grpc_go.CallOption) (*RecentAssignRecordsResponse, common.ErrorWithAttachment) {
out := new(RecentAssignRecordsResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetRecentAssignRecords", in, out)
}
func (c *bundleClient) GetEmployeeAssignedTasks(ctx context.Context, in *EmployeeTaskQueryRequest, opts ...grpc_go.CallOption) (*EmployeeTaskQueryResponse, common.ErrorWithAttachment) {
out := new(EmployeeTaskQueryResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetEmployeeAssignedTasks", in, out)
}
func (c *bundleClient) CompleteTaskManually(ctx context.Context, in *CompleteTaskManuallyRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
out := new(CommonResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CompleteTaskManually", in, out)
}
func (c *bundleClient) UpdateTaskProgress(ctx context.Context, in *UpdateTaskProgressRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
out := new(CommonResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateTaskProgress", in, out)
}
func (c *bundleClient) GetTaskAssignRecordsList(ctx context.Context, in *TaskAssignRecordsQueryRequest, opts ...grpc_go.CallOption) (*TaskAssignRecordsQueryResponse, common.ErrorWithAttachment) {
out := new(TaskAssignRecordsQueryResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetTaskAssignRecordsList", in, out)
}
func (c *bundleClient) GetArtistBundleBalance(ctx context.Context, in *ArtistBundleBalanceRequest, opts ...grpc_go.CallOption) (*ArtistBundleBalanceResponse, common.ErrorWithAttachment) {
out := new(ArtistBundleBalanceResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetArtistBundleBalance", in, out)
}
// BundleServer is the server API for Bundle service.
// All implementations must embed UnimplementedBundleServer
// for forward compatibility
@ -506,6 +579,16 @@ type BundleServer interface {
// 查出没处理的数据
ListUnfinishedInfos(context.Context, *AutoCreateUserAndOrderRequest) (*UnfinishedInfos, error)
SoftDeleteUnfinishedInfo(context.Context, *SoftDeleteUnfinishedInfoRequest) (*CommonResponse, error)
// 任务台
GetPendingTaskList(context.Context, *TaskQueryRequest) (*TaskQueryResponse, error)
AssignTask(context.Context, *TaskAssignRequest) (*CommonResponse, error)
UpdatePendingCount(context.Context, *UpdatePendingCountRequest) (*CommonResponse, error)
GetRecentAssignRecords(context.Context, *RecentAssignRecordsRequest) (*RecentAssignRecordsResponse, error)
GetEmployeeAssignedTasks(context.Context, *EmployeeTaskQueryRequest) (*EmployeeTaskQueryResponse, error)
CompleteTaskManually(context.Context, *CompleteTaskManuallyRequest) (*CommonResponse, error)
UpdateTaskProgress(context.Context, *UpdateTaskProgressRequest) (*CommonResponse, error)
GetTaskAssignRecordsList(context.Context, *TaskAssignRecordsQueryRequest) (*TaskAssignRecordsQueryResponse, error)
GetArtistBundleBalance(context.Context, *ArtistBundleBalanceRequest) (*ArtistBundleBalanceResponse, error)
mustEmbedUnimplementedBundleServer()
}
@ -661,6 +744,33 @@ func (UnimplementedBundleServer) ListUnfinishedInfos(context.Context, *AutoCreat
func (UnimplementedBundleServer) SoftDeleteUnfinishedInfo(context.Context, *SoftDeleteUnfinishedInfoRequest) (*CommonResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SoftDeleteUnfinishedInfo not implemented")
}
func (UnimplementedBundleServer) GetPendingTaskList(context.Context, *TaskQueryRequest) (*TaskQueryResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetPendingTaskList not implemented")
}
func (UnimplementedBundleServer) AssignTask(context.Context, *TaskAssignRequest) (*CommonResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method AssignTask not implemented")
}
func (UnimplementedBundleServer) UpdatePendingCount(context.Context, *UpdatePendingCountRequest) (*CommonResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdatePendingCount not implemented")
}
func (UnimplementedBundleServer) GetRecentAssignRecords(context.Context, *RecentAssignRecordsRequest) (*RecentAssignRecordsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetRecentAssignRecords not implemented")
}
func (UnimplementedBundleServer) GetEmployeeAssignedTasks(context.Context, *EmployeeTaskQueryRequest) (*EmployeeTaskQueryResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetEmployeeAssignedTasks not implemented")
}
func (UnimplementedBundleServer) CompleteTaskManually(context.Context, *CompleteTaskManuallyRequest) (*CommonResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CompleteTaskManually not implemented")
}
func (UnimplementedBundleServer) UpdateTaskProgress(context.Context, *UpdateTaskProgressRequest) (*CommonResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateTaskProgress not implemented")
}
func (UnimplementedBundleServer) GetTaskAssignRecordsList(context.Context, *TaskAssignRecordsQueryRequest) (*TaskAssignRecordsQueryResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetTaskAssignRecordsList not implemented")
}
func (UnimplementedBundleServer) GetArtistBundleBalance(context.Context, *ArtistBundleBalanceRequest) (*ArtistBundleBalanceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetArtistBundleBalance not implemented")
}
func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) {
s.proxyImpl = impl
}
@ -2110,6 +2220,267 @@ func _Bundle_SoftDeleteUnfinishedInfo_Handler(srv interface{}, ctx context.Conte
return interceptor(ctx, in, info, handler)
}
func _Bundle_GetPendingTaskList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(TaskQueryRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("GetPendingTaskList", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_AssignTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(TaskAssignRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("AssignTask", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_UpdatePendingCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdatePendingCountRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("UpdatePendingCount", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_GetRecentAssignRecords_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(RecentAssignRecordsRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("GetRecentAssignRecords", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_GetEmployeeAssignedTasks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(EmployeeTaskQueryRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("GetEmployeeAssignedTasks", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_CompleteTaskManually_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CompleteTaskManuallyRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("CompleteTaskManually", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_UpdateTaskProgress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateTaskProgressRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("UpdateTaskProgress", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_GetTaskAssignRecordsList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(TaskAssignRecordsQueryRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("GetTaskAssignRecordsList", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_GetArtistBundleBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ArtistBundleBalanceRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("GetArtistBundleBalance", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
// Bundle_ServiceDesc is the grpc_go.ServiceDesc for Bundle service.
// It's only intended for direct use with grpc_go.RegisterService,
// and not to be introspected or modified (even as a copy)
@ -2313,6 +2684,42 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "SoftDeleteUnfinishedInfo",
Handler: _Bundle_SoftDeleteUnfinishedInfo_Handler,
},
{
MethodName: "GetPendingTaskList",
Handler: _Bundle_GetPendingTaskList_Handler,
},
{
MethodName: "AssignTask",
Handler: _Bundle_AssignTask_Handler,
},
{
MethodName: "UpdatePendingCount",
Handler: _Bundle_UpdatePendingCount_Handler,
},
{
MethodName: "GetRecentAssignRecords",
Handler: _Bundle_GetRecentAssignRecords_Handler,
},
{
MethodName: "GetEmployeeAssignedTasks",
Handler: _Bundle_GetEmployeeAssignedTasks_Handler,
},
{
MethodName: "CompleteTaskManually",
Handler: _Bundle_CompleteTaskManually_Handler,
},
{
MethodName: "UpdateTaskProgress",
Handler: _Bundle_UpdateTaskProgress_Handler,
},
{
MethodName: "GetTaskAssignRecordsList",
Handler: _Bundle_GetTaskAssignRecordsList_Handler,
},
{
MethodName: "GetArtistBundleBalance",
Handler: _Bundle_GetArtistBundleBalance_Handler,
},
},
Streams: []grpc_go.StreamDesc{},
Metadata: "pb/bundle.proto",

View File

@ -51,6 +51,7 @@ func NewRouter() *gin.Engine {
BundleRouter(privateGroup)
BundleOrderRouter(privateGroup)
ValueAddBundleRouter(privateGroup)
TaskBenchRouter(privateGroup) // 新增任务台路由
MediaRouter(privateGroup)
SecFilingRouter(privateGroup)
app.MediaAppRouter(privateGroup)

58
pkg/router/taskBench.go Normal file
View File

@ -0,0 +1,58 @@
package router
import (
"fonchain-fiee/pkg/middleware"
"fonchain-fiee/pkg/service"
"fonchain-fiee/pkg/service/taskbench"
"github.com/gin-gonic/gin"
)
// TaskBenchRouter 任务台路由
func TaskBenchRouter(r *gin.RouterGroup) {
// 创建任务台路由组
taskBenchRoute := r.Group("task-bench")
// 使用Web登录中间件进行权限验证
taskBenchRoute.Use(middleware.CheckWebLogin(service.AccountProvider))
// 任务台管理
{
// 查询待指派任务记录
taskBenchRoute.POST("pending-task-list", taskbench.GetPendingTaskList)
// 指派某位员工完成某个艺人的任务
taskBenchRoute.POST("assign-task", taskbench.AssignTask)
// 修改待发数量
taskBenchRoute.POST("update-pending-count", taskbench.UpdatePendingCount)
// 查询最近被指派记录
taskBenchRoute.POST("recent-assign-records", taskbench.GetRecentAssignRecords)
// 多条件查询操作记录表
taskBenchRoute.POST("task-assign-records-list", taskbench.GetTaskAssignRecordsList)
// 员工完成图片作品任务带任务UUID
taskBenchRoute.POST("update-work-image-with-task-uuid", taskbench.UpdateWorkImageWithTaskUUID)
// 员工完成视频作品任务带任务UUID
taskBenchRoute.POST("update-work-video-with-task-uuid", taskbench.UpdateWorkVideoWithUUID)
// 根据登录人信息查询被指派给该员工的任务
taskBenchRoute.POST("assigned-tasks", taskbench.GetEmployeeAssignedTasks)
// 员工手动点击完成任务
taskBenchRoute.POST("complete-manually", taskbench.CompleteTaskManually)
// 查询艺人套餐剩余数量
taskBenchRoute.POST("artist-bundle-balance", taskbench.GetArtistBundleBalance)
}
// 员工任务相关路由需要App登录验证
taskBenchAppRoute := r.Group("task-bench")
taskBenchAppRoute.Use(middleware.CheckLogin(service.AccountFieeProvider))
{
// 员工实际完成任务状态更新
taskBenchAppRoute.POST("update-progress", taskbench.UpdateTaskProgress)
}
}

View File

@ -57,6 +57,25 @@ func UpdateWorkImage(ctx *gin.Context) {
service.Error(ctx, err)
return
}
// 更新任务台的任务数量,调用员工实际任务状态更新
if service.BundleProvider != nil {
resp1, err := service.BundleProvider.UpdateTaskProgress(context.Background(), &bundle.UpdateTaskProgressRequest{
AssignRecordsUUID: "",
EmployeeName: infoResp.Name,
EmployeeNum: infoResp.TelNum,
TaskType: "post",
CompleteCount: 1,
})
if err != nil {
zap.L().Error("UpdateTaskProgress failed", zap.Error(err))
// 不直接返回错误,允许主要功能继续执行
} else {
zap.L().Info("UpdateTaskProgress", zap.Any("resp", resp1))
}
} else {
zap.L().Warn("BundleProvider is nil, skipping UpdateTaskProgress")
}
service.Success(ctx, resp)
return
}
@ -101,6 +120,25 @@ func UpdateWorkVideo(ctx *gin.Context) {
service.Error(ctx, err)
return
}
// 更新任务台的任务数量,调用员工实际任务状态更新
if service.BundleProvider != nil {
resp1, err := service.BundleProvider.UpdateTaskProgress(context.Background(), &bundle.UpdateTaskProgressRequest{
AssignRecordsUUID: "",
EmployeeName: infoResp.Name,
EmployeeNum: infoResp.TelNum,
TaskType: "video",
CompleteCount: 1,
})
if err != nil {
zap.L().Error("UpdateTaskProgress failed", zap.Error(err))
// 不直接返回错误,允许主要功能继续执行
} else {
zap.L().Info("UpdateTaskProgress", zap.Any("resp", resp1))
}
} else {
zap.L().Warn("BundleProvider is nil, skipping UpdateTaskProgress")
}
service.Success(ctx, resp)
return
}

View File

@ -0,0 +1,307 @@
package taskbench
import (
"context"
"fmt"
"fonchain-fiee/api/accountFiee"
"fonchain-fiee/api/bundle"
"fonchain-fiee/api/cast"
"fonchain-fiee/cmd/config"
modelCast "fonchain-fiee/pkg/model/cast"
"fonchain-fiee/pkg/service"
castService "fonchain-fiee/pkg/service/cast"
"strconv"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
// GetPendingTaskList 查询待指派任务记录
func GetPendingTaskList(c *gin.Context) {
var req bundle.TaskQueryRequest
if err := c.ShouldBindJSON(&req); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.GetPendingTaskList(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
// AssignTask 指派某位员工完成某个艺人的任务
func AssignTask(c *gin.Context) {
var req bundle.TaskAssignRequest
// userInfo := login.GetUserInfoFromC(c)
// req.OperatorNum = userInfo.TelNum
// req.Operator = userInfo.Name
if err := c.ShouldBindJSON(&req); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.AssignTask(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
// UpdatePendingCount 修改待发数量
func UpdatePendingCount(c *gin.Context) {
var req bundle.UpdatePendingCountRequest
if err := c.ShouldBindJSON(&req); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.UpdatePendingCount(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
// GetRecentAssignRecords 查询最近被指派记录
func GetRecentAssignRecords(c *gin.Context) {
var req bundle.RecentAssignRecordsRequest
if err := c.ShouldBindJSON(&req); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.GetRecentAssignRecords(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
// GetEmployeeAssignedTasks 根据登录人信息查询被指派给该员工的任务
func GetEmployeeAssignedTasks(c *gin.Context) {
var req bundle.EmployeeTaskQueryRequest
// userInfo := login.GetUserInfoFromC(c)
// req.TaskAssigneeNum = userInfo.TelNum
if err := c.ShouldBindJSON(&req); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.GetEmployeeAssignedTasks(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
// CompleteTaskManually 员工手动点击完成任务
func CompleteTaskManually(c *gin.Context) {
var req bundle.CompleteTaskManuallyRequest
// userInfo := login.GetUserInfoFromC(c)
// req.TaskAssigneeNum = userInfo.TelNum
if err := c.ShouldBindJSON(&req); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.CompleteTaskManually(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
// UpdateTaskProgress 员工实际完成任务状态更新
func UpdateTaskProgress(c *gin.Context) {
var req bundle.UpdateTaskProgressRequest
if err := c.ShouldBindJSON(&req); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.UpdateTaskProgress(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
// GetTaskAssignRecordsList 多条件查询操作记录表
func GetTaskAssignRecordsList(c *gin.Context) {
var req bundle.TaskAssignRecordsQueryRequest
if err := c.ShouldBindJSON(&req); err != nil {
service.Error(c, err)
return
}
// 添加空指针检查
if service.BundleProvider == nil {
service.Error(c, fmt.Errorf("BundleProvider is not initialized"))
return
}
res, err := service.BundleProvider.GetTaskAssignRecordsList(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
type UpdateWorkVideoWithUUIDReq struct {
*cast.UpdateWorkVideoReq
AssignRecordsUUID string `json:"assignRecordsUUID"`
}
type UpdateWorkImageWithTaskUUIDReq struct {
*cast.UpdateWorkImageReq
AssignRecordsUUID string `json:"assignRecordsUUID"`
}
func UpdateWorkImageWithTaskUUID(ctx *gin.Context) {
var req UpdateWorkImageWithTaskUUIDReq
var infoResp *accountFiee.UserInfoResponse
var err error
if err = ctx.ShouldBind(&req); err != nil {
service.Error(ctx, err)
return
}
if config.AppConfig.System.AppMode != "dev" {
artistId, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
infoResp, err = service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
ID: artistId,
Domain: "app",
})
if err != nil {
service.Error(ctx, err)
return
}
} else {
infoResp = &accountFiee.UserInfoResponse{
Name: "小波",
TelNum: "18288888888",
TelAreaCode: "86",
}
}
req.ArtistName = infoResp.Name
req.ArtistPhone = infoResp.TelNum
req.ArtistPhoneAreaCode = infoResp.TelAreaCode
artistID, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
if err = castService.CheckUserBundleBalance(int32(artistID), modelCast.BalanceTypeImageValue); err != nil {
service.Error(ctx, err)
return
}
newCtx := castService.NewCtxWithUserInfo(ctx)
req.Source = 1
resp, err := service.CastProvider.UpdateWorkImage(newCtx, req.UpdateWorkImageReq)
if err != nil {
service.Error(ctx, err)
return
}
// 调用员工实际任务状态更新
resp1, err := service.BundleProvider.UpdateTaskProgress(context.Background(), &bundle.UpdateTaskProgressRequest{
AssignRecordsUUID: req.AssignRecordsUUID,
EmployeeName: infoResp.Name,
EmployeeNum: infoResp.TelNum, // 需要根据实际业务逻辑填充员工工号
TaskType: "post",
CompleteCount: 1,
})
if err != nil {
service.Error(ctx, err)
return
}
zap.L().Info("UpdateTaskProgress", zap.Any("resp", resp1))
service.Success(ctx, resp)
return
}
func UpdateWorkVideoWithUUID(ctx *gin.Context) {
var req UpdateWorkVideoWithUUIDReq
var infoResp *accountFiee.UserInfoResponse
var err error
if err = ctx.ShouldBind(&req); err != nil {
service.Error(ctx, err)
return
}
if config.AppConfig.System.AppMode != "dev" {
artistId, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
infoResp, err = service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
ID: artistId,
Domain: "app",
})
if err != nil {
service.Error(ctx, err)
return
}
} else {
infoResp = &accountFiee.UserInfoResponse{
Name: "小波",
TelNum: "18288888888",
TelAreaCode: "86",
}
}
artistID, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
if err = castService.CheckUserBundleBalance(int32(artistID), modelCast.BalanceTypeVideoValue); err != nil {
service.Error(ctx, err)
return
}
req.ArtistName = infoResp.Name
req.ArtistPhone = infoResp.TelNum
req.ArtistPhoneAreaCode = infoResp.TelAreaCode
newCtx := castService.NewCtxWithUserInfo(ctx)
req.Source = 1
resp, err := service.CastProvider.UpdateWorkVideo(newCtx, req.UpdateWorkVideoReq)
if err != nil {
service.Error(ctx, err)
return
}
// 调用员工实际任务状态更新
resp1, err := service.BundleProvider.UpdateTaskProgress(context.Background(), &bundle.UpdateTaskProgressRequest{
AssignRecordsUUID: req.AssignRecordsUUID,
EmployeeName: infoResp.Name,
EmployeeNum: infoResp.TelNum, // 需要根据实际业务逻辑填充员工工号
TaskType: "video",
CompleteCount: 1,
})
if err != nil {
service.Error(ctx, err)
return
}
zap.L().Info("UpdateTaskProgress", zap.Any("resp", resp1))
service.Success(ctx, resp)
return
}
// GetArtistBundleBalance 查询艺人套餐剩余数量
func GetArtistBundleBalance(c *gin.Context) {
var req bundle.ArtistBundleBalanceRequest
if err := c.ShouldBindJSON(&req); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.GetArtistBundleBalance(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}