Merge branch 'feat-cjy-taskBench2' into dev
This commit is contained in:
commit
0bb3edd373
File diff suppressed because it is too large
Load Diff
@ -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"
|
||||
)
|
||||
|
||||
@ -638,6 +638,18 @@ func (this *GetBundleBalanceLayoutReq) Validate() error {
|
||||
func (this *GetBundleBalanceLayoutResp) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *GetPendingTaskLayoutReq) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *GetPendingTaskLayoutResp) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *SetPendingTaskLayoutReq) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *SetPendingTaskLayoutResp) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *MetricsBusinessReq) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -108,6 +108,8 @@ type BundleClient interface {
|
||||
MetricsBundlePurchaseExport(ctx context.Context, in *MetricsBundlePurchaseExportReq, opts ...grpc_go.CallOption) (*MetricsBundlePurchaseExportResp, common.ErrorWithAttachment)
|
||||
MetricsArtistAccountExport(ctx context.Context, in *MetricsArtistAccountExportReq, opts ...grpc_go.CallOption) (*MetricsArtistAccountExportResp, common.ErrorWithAttachment)
|
||||
MetricsVideoSubmitExport(ctx context.Context, in *MetricsVideoSubmitExportReq, opts ...grpc_go.CallOption) (*MetricsVideoSubmitExportResp, common.ErrorWithAttachment)
|
||||
GetPendingTaskLayout(ctx context.Context, in *GetPendingTaskLayoutReq, opts ...grpc_go.CallOption) (*GetPendingTaskLayoutResp, common.ErrorWithAttachment)
|
||||
SetPendingTaskLayout(ctx context.Context, in *SetPendingTaskLayoutReq, opts ...grpc_go.CallOption) (*SetPendingTaskLayoutResp, common.ErrorWithAttachment)
|
||||
}
|
||||
|
||||
type bundleClient struct {
|
||||
@ -188,6 +190,8 @@ type BundleClientImpl struct {
|
||||
MetricsBundlePurchaseExport func(ctx context.Context, in *MetricsBundlePurchaseExportReq) (*MetricsBundlePurchaseExportResp, error)
|
||||
MetricsArtistAccountExport func(ctx context.Context, in *MetricsArtistAccountExportReq) (*MetricsArtistAccountExportResp, error)
|
||||
MetricsVideoSubmitExport func(ctx context.Context, in *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error)
|
||||
GetPendingTaskLayout func(ctx context.Context, in *GetPendingTaskLayoutReq) (*GetPendingTaskLayoutResp, error)
|
||||
SetPendingTaskLayout func(ctx context.Context, in *SetPendingTaskLayoutReq) (*SetPendingTaskLayoutResp, error)
|
||||
}
|
||||
|
||||
func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient {
|
||||
@ -640,6 +644,18 @@ func (c *bundleClient) MetricsVideoSubmitExport(ctx context.Context, in *Metrics
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MetricsVideoSubmitExport", in, out)
|
||||
}
|
||||
|
||||
func (c *bundleClient) GetPendingTaskLayout(ctx context.Context, in *GetPendingTaskLayoutReq, opts ...grpc_go.CallOption) (*GetPendingTaskLayoutResp, common.ErrorWithAttachment) {
|
||||
out := new(GetPendingTaskLayoutResp)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetPendingTaskLayout", in, out)
|
||||
}
|
||||
|
||||
func (c *bundleClient) SetPendingTaskLayout(ctx context.Context, in *SetPendingTaskLayoutReq, opts ...grpc_go.CallOption) (*SetPendingTaskLayoutResp, common.ErrorWithAttachment) {
|
||||
out := new(SetPendingTaskLayoutResp)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/SetPendingTaskLayout", in, out)
|
||||
}
|
||||
|
||||
// BundleServer is the server API for Bundle service.
|
||||
// All implementations must embed UnimplementedBundleServer
|
||||
// for forward compatibility
|
||||
@ -724,6 +740,8 @@ type BundleServer interface {
|
||||
MetricsBundlePurchaseExport(context.Context, *MetricsBundlePurchaseExportReq) (*MetricsBundlePurchaseExportResp, error)
|
||||
MetricsArtistAccountExport(context.Context, *MetricsArtistAccountExportReq) (*MetricsArtistAccountExportResp, error)
|
||||
MetricsVideoSubmitExport(context.Context, *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error)
|
||||
GetPendingTaskLayout(context.Context, *GetPendingTaskLayoutReq) (*GetPendingTaskLayoutResp, error)
|
||||
SetPendingTaskLayout(context.Context, *SetPendingTaskLayoutReq) (*SetPendingTaskLayoutResp, error)
|
||||
mustEmbedUnimplementedBundleServer()
|
||||
}
|
||||
|
||||
@ -951,6 +969,12 @@ func (UnimplementedBundleServer) MetricsArtistAccountExport(context.Context, *Me
|
||||
func (UnimplementedBundleServer) MetricsVideoSubmitExport(context.Context, *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method MetricsVideoSubmitExport not implemented")
|
||||
}
|
||||
func (UnimplementedBundleServer) GetPendingTaskLayout(context.Context, *GetPendingTaskLayoutReq) (*GetPendingTaskLayoutResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetPendingTaskLayout not implemented")
|
||||
}
|
||||
func (UnimplementedBundleServer) SetPendingTaskLayout(context.Context, *SetPendingTaskLayoutReq) (*SetPendingTaskLayoutResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SetPendingTaskLayout not implemented")
|
||||
}
|
||||
func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
||||
s.proxyImpl = impl
|
||||
}
|
||||
@ -3096,6 +3120,64 @@ func _Bundle_MetricsVideoSubmitExport_Handler(srv interface{}, ctx context.Conte
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Bundle_GetPendingTaskLayout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetPendingTaskLayoutReq)
|
||||
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("GetPendingTaskLayout", 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_SetPendingTaskLayout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SetPendingTaskLayoutReq)
|
||||
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("SetPendingTaskLayout", 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)
|
||||
@ -3395,6 +3477,14 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
||||
MethodName: "MetricsVideoSubmitExport",
|
||||
Handler: _Bundle_MetricsVideoSubmitExport_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetPendingTaskLayout",
|
||||
Handler: _Bundle_GetPendingTaskLayout_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SetPendingTaskLayout",
|
||||
Handler: _Bundle_SetPendingTaskLayout_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc_go.StreamDesc{},
|
||||
Metadata: "pb/bundle.proto",
|
||||
|
||||
@ -19,10 +19,14 @@ func TaskBenchRouter(r *gin.RouterGroup) {
|
||||
// 查询待指派任务记录
|
||||
taskBenchRoute.POST("pending-task-list", taskbench.GetPendingTaskList)
|
||||
|
||||
// 待指派任务布局
|
||||
taskBenchRoute.POST("pending-task-layout", taskbench.GetPendingTaskLayout)
|
||||
taskBenchRoute.POST("set-pending-task-layout", taskbench.SetPendingTaskLayout)
|
||||
|
||||
// 指派某位员工完成某个艺人的任务
|
||||
taskBenchRoute.POST("assign-task", taskbench.AssignTask)
|
||||
|
||||
// 批量指派任务(仅写入指派记录,不更新任务管理表)
|
||||
// 批量指派任务
|
||||
taskBenchRoute.POST("batch-assign-task", taskbench.BatchAssignTask)
|
||||
|
||||
// 中止指派任务(根据任务指派记录UUID)
|
||||
|
||||
@ -37,6 +37,38 @@ func GetPendingTaskList(c *gin.Context) {
|
||||
service.Success(c, res)
|
||||
}
|
||||
|
||||
func GetPendingTaskLayout(c *gin.Context) {
|
||||
var req bundle.GetPendingTaskLayoutReq
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
res, err := service.BundleProvider.GetPendingTaskLayout(context.Background(), &req)
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
service.Success(c, res)
|
||||
}
|
||||
|
||||
func SetPendingTaskLayout(c *gin.Context) {
|
||||
var req bundle.SetPendingTaskLayoutReq
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
res, err := service.BundleProvider.SetPendingTaskLayout(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
|
||||
@ -66,14 +98,14 @@ func BatchAssignTask(c *gin.Context) {
|
||||
}
|
||||
|
||||
// 从登录信息中补充操作者信息到每个批量项
|
||||
// userInfo := login.GetUserInfoFromC(c)
|
||||
userInfo := login.GetUserInfoFromC(c)
|
||||
for _, item := range req.Items {
|
||||
if item == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
// item.Operator = userInfo.Name
|
||||
// item.OperatorNum = userInfo.TelNum
|
||||
item.Operator = userInfo.Name
|
||||
item.OperatorNum = userInfo.TelNum
|
||||
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user