Compare commits

...

13 Commits

Author SHA1 Message Date
lzh
ad089ca1aa 修改字段类型 2025-10-17 16:00:42 +08:00
lzh
03058ac4e4 1 2025-10-17 15:41:00 +08:00
lzh
bce901e2a4 1 2025-10-17 15:32:57 +08:00
lzh
e56cddb325 1 2025-10-17 15:32:55 +08:00
lzh
3711c5402a 1 2025-10-17 15:16:48 +08:00
lzh
fecc9faff0 1 2025-10-17 15:01:10 +08:00
lzh
ec49f60138 导出接口修订 2025-10-17 14:50:34 +08:00
lzh
226b170dce 1 2025-10-17 10:33:42 +08:00
lzh
127da23d69 布局接口 2025-10-17 10:23:28 +08:00
lzh
84f4637f09 1 2025-10-16 16:59:33 +08:00
lzh
8116303f05 excel导出 2025-10-16 16:37:06 +08:00
lzh
a989dae45a 添加激活接口 2025-10-16 09:18:17 +08:00
lzh
0d880d2999 proto更新 2025-10-15 15:58:26 +08:00
6 changed files with 6825 additions and 1733 deletions

File diff suppressed because it is too large Load Diff

View File

@ -95,6 +95,13 @@ func (this *BundleProfile) Validate() error {
}
}
}
for _, item := range this.SelectValueAdditionalService {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("SelectValueAdditionalService", err)
}
}
}
for _, item := range this.BundleProfileLang {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
@ -105,6 +112,16 @@ func (this *BundleProfile) Validate() error {
return nil
}
func (this *BundleProfileLang) Validate() error {
for _, item := range this.ServiceLangInfo {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("ServiceLangInfo", err)
}
}
}
return nil
}
func (this *ServiceLangInfo) Validate() error {
return nil
}
func (this *SaveResponse) Validate() error {
@ -113,6 +130,9 @@ func (this *SaveResponse) Validate() error {
func (this *SelectValueAddService) Validate() error {
return nil
}
func (this *SelectValueAdditionalService) Validate() error {
return nil
}
func (this *DelBundleRequest) Validate() error {
return nil
}
@ -350,6 +370,22 @@ func (this *GetBundleBalanceReq) Validate() error {
func (this *BundleBalanceItem) Validate() error {
return nil
}
func (this *BundleBalanceExportItem) Validate() error {
return nil
}
func (this *BundleBalanceExportReq) Validate() error {
return nil
}
func (this *BundleBalanceExportResp) Validate() error {
for _, item := range this.Data {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
}
return nil
}
func (this *GetBundleBalanceListResp) Validate() error {
for _, item := range this.Data {
if item != nil {
@ -466,3 +502,90 @@ func (this *UnfinishedInfo) Validate() error {
func (this *SoftDeleteUnfinishedInfoRequest) Validate() error {
return nil
}
func (this *BundleActivateReq) Validate() error {
return nil
}
func (this *BundleActivateResp) 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
}
func (this *SetBundleBalanceLayoutReq) Validate() error {
return nil
}
func (this *SetBundleBalanceLayoutResp) Validate() error {
return nil
}
func (this *GetBundleBalanceLayoutReq) Validate() error {
return nil
}
func (this *GetBundleBalanceLayoutResp) Validate() error {
return nil
}

View File

@ -69,6 +69,10 @@ type BundleClient interface {
GetBundleBalanceByUserId(ctx context.Context, in *GetBundleBalanceByUserIdReq, opts ...grpc_go.CallOption) (*GetBundleBalanceByUserIdResp, common.ErrorWithAttachment)
CreateBundleBalance(ctx context.Context, in *CreateBundleBalanceReq, opts ...grpc_go.CallOption) (*CreateBundleBalanceResp, common.ErrorWithAttachment)
AddBundleBalance(ctx context.Context, in *AddBundleBalanceReq, opts ...grpc_go.CallOption) (*AddBundleBalanceResp, common.ErrorWithAttachment)
BundleActivate(ctx context.Context, in *BundleActivateReq, opts ...grpc_go.CallOption) (*BundleActivateResp, common.ErrorWithAttachment)
BundleBalanceExport(ctx context.Context, in *BundleBalanceExportReq, opts ...grpc_go.CallOption) (*BundleBalanceExportResp, common.ErrorWithAttachment)
GetBundleBalanceLayout(ctx context.Context, in *GetBundleBalanceLayoutReq, opts ...grpc_go.CallOption) (*GetBundleBalanceLayoutResp, common.ErrorWithAttachment)
SetBundleBalanceLayout(ctx context.Context, in *SetBundleBalanceLayoutReq, opts ...grpc_go.CallOption) (*SetBundleBalanceLayoutResp, common.ErrorWithAttachment)
// 使用记录
GetUsedRecordList(ctx context.Context, in *GetUsedRecordListReq, opts ...grpc_go.CallOption) (*GetUsedRecordListResp, common.ErrorWithAttachment)
GetImageWorkDetail(ctx context.Context, in *GetImageWorkDetailReq, opts ...grpc_go.CallOption) (*GetImageWorkDetailResp, common.ErrorWithAttachment)
@ -83,6 +87,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 {
@ -128,6 +142,10 @@ type BundleClientImpl struct {
GetBundleBalanceByUserId func(ctx context.Context, in *GetBundleBalanceByUserIdReq) (*GetBundleBalanceByUserIdResp, error)
CreateBundleBalance func(ctx context.Context, in *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error)
AddBundleBalance func(ctx context.Context, in *AddBundleBalanceReq) (*AddBundleBalanceResp, error)
BundleActivate func(ctx context.Context, in *BundleActivateReq) (*BundleActivateResp, error)
BundleBalanceExport func(ctx context.Context, in *BundleBalanceExportReq) (*BundleBalanceExportResp, error)
GetBundleBalanceLayout func(ctx context.Context, in *GetBundleBalanceLayoutReq) (*GetBundleBalanceLayoutResp, error)
SetBundleBalanceLayout func(ctx context.Context, in *SetBundleBalanceLayoutReq) (*SetBundleBalanceLayoutResp, error)
GetUsedRecordList func(ctx context.Context, in *GetUsedRecordListReq) (*GetUsedRecordListResp, error)
GetImageWorkDetail func(ctx context.Context, in *GetImageWorkDetailReq) (*GetImageWorkDetailResp, error)
GetVedioWorkDetail func(ctx context.Context, in *GetVedioWorkDetailReq) (*GetVedioeWorkDetailResp, error)
@ -139,6 +157,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 {
@ -381,6 +408,30 @@ func (c *bundleClient) AddBundleBalance(ctx context.Context, in *AddBundleBalanc
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/AddBundleBalance", in, out)
}
func (c *bundleClient) BundleActivate(ctx context.Context, in *BundleActivateReq, opts ...grpc_go.CallOption) (*BundleActivateResp, common.ErrorWithAttachment) {
out := new(BundleActivateResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BundleActivate", in, out)
}
func (c *bundleClient) BundleBalanceExport(ctx context.Context, in *BundleBalanceExportReq, opts ...grpc_go.CallOption) (*BundleBalanceExportResp, common.ErrorWithAttachment) {
out := new(BundleBalanceExportResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BundleBalanceExport", in, out)
}
func (c *bundleClient) GetBundleBalanceLayout(ctx context.Context, in *GetBundleBalanceLayoutReq, opts ...grpc_go.CallOption) (*GetBundleBalanceLayoutResp, common.ErrorWithAttachment) {
out := new(GetBundleBalanceLayoutResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetBundleBalanceLayout", in, out)
}
func (c *bundleClient) SetBundleBalanceLayout(ctx context.Context, in *SetBundleBalanceLayoutReq, opts ...grpc_go.CallOption) (*SetBundleBalanceLayoutResp, common.ErrorWithAttachment) {
out := new(SetBundleBalanceLayoutResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/SetBundleBalanceLayout", in, out)
}
func (c *bundleClient) GetUsedRecordList(ctx context.Context, in *GetUsedRecordListReq, opts ...grpc_go.CallOption) (*GetUsedRecordListResp, common.ErrorWithAttachment) {
out := new(GetUsedRecordListResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
@ -447,6 +498,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
@ -492,6 +597,10 @@ type BundleServer interface {
GetBundleBalanceByUserId(context.Context, *GetBundleBalanceByUserIdReq) (*GetBundleBalanceByUserIdResp, error)
CreateBundleBalance(context.Context, *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error)
AddBundleBalance(context.Context, *AddBundleBalanceReq) (*AddBundleBalanceResp, error)
BundleActivate(context.Context, *BundleActivateReq) (*BundleActivateResp, error)
BundleBalanceExport(context.Context, *BundleBalanceExportReq) (*BundleBalanceExportResp, error)
GetBundleBalanceLayout(context.Context, *GetBundleBalanceLayoutReq) (*GetBundleBalanceLayoutResp, error)
SetBundleBalanceLayout(context.Context, *SetBundleBalanceLayoutReq) (*SetBundleBalanceLayoutResp, error)
// 使用记录
GetUsedRecordList(context.Context, *GetUsedRecordListReq) (*GetUsedRecordListResp, error)
GetImageWorkDetail(context.Context, *GetImageWorkDetailReq) (*GetImageWorkDetailResp, error)
@ -506,6 +615,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()
}
@ -628,6 +747,18 @@ func (UnimplementedBundleServer) CreateBundleBalance(context.Context, *CreateBun
func (UnimplementedBundleServer) AddBundleBalance(context.Context, *AddBundleBalanceReq) (*AddBundleBalanceResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method AddBundleBalance not implemented")
}
func (UnimplementedBundleServer) BundleActivate(context.Context, *BundleActivateReq) (*BundleActivateResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method BundleActivate not implemented")
}
func (UnimplementedBundleServer) BundleBalanceExport(context.Context, *BundleBalanceExportReq) (*BundleBalanceExportResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method BundleBalanceExport not implemented")
}
func (UnimplementedBundleServer) GetBundleBalanceLayout(context.Context, *GetBundleBalanceLayoutReq) (*GetBundleBalanceLayoutResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetBundleBalanceLayout not implemented")
}
func (UnimplementedBundleServer) SetBundleBalanceLayout(context.Context, *SetBundleBalanceLayoutReq) (*SetBundleBalanceLayoutResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetBundleBalanceLayout not implemented")
}
func (UnimplementedBundleServer) GetUsedRecordList(context.Context, *GetUsedRecordListReq) (*GetUsedRecordListResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetUsedRecordList not implemented")
}
@ -661,6 +792,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
}
@ -1791,6 +1949,122 @@ func _Bundle_AddBundleBalance_Handler(srv interface{}, ctx context.Context, dec
return interceptor(ctx, in, info, handler)
}
func _Bundle_BundleActivate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(BundleActivateReq)
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("BundleActivate", 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_BundleBalanceExport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(BundleBalanceExportReq)
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("BundleBalanceExport", 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_GetBundleBalanceLayout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetBundleBalanceLayoutReq)
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("GetBundleBalanceLayout", 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_SetBundleBalanceLayout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(SetBundleBalanceLayoutReq)
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("SetBundleBalanceLayout", 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_GetUsedRecordList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetUsedRecordListReq)
if err := dec(in); err != nil {
@ -2110,6 +2384,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)
@ -2269,6 +2804,22 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "AddBundleBalance",
Handler: _Bundle_AddBundleBalance_Handler,
},
{
MethodName: "BundleActivate",
Handler: _Bundle_BundleActivate_Handler,
},
{
MethodName: "BundleBalanceExport",
Handler: _Bundle_BundleBalanceExport_Handler,
},
{
MethodName: "GetBundleBalanceLayout",
Handler: _Bundle_GetBundleBalanceLayout_Handler,
},
{
MethodName: "SetBundleBalanceLayout",
Handler: _Bundle_SetBundleBalanceLayout_Handler,
},
{
MethodName: "GetUsedRecordList",
Handler: _Bundle_GetUsedRecordList_Handler,
@ -2313,6 +2864,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

@ -33,6 +33,10 @@ func BundleRouter(r *gin.RouterGroup) {
{
bundleBalance.POST("list", bundle.GetBundleBalance)
bundleBalance.POST("used-record", bundle.GetUsedRecordList)
bundleBalance.POST("activate", bundle.BundleActivate)
bundleBalance.POST("export", bundle.BundleExport)
bundleBalance.POST("layout-update", bundle.SetBalanceLayout)
bundleBalance.POST("layout", bundle.GetBalanceLayout)
}
}
bundleClientRouteV2 := bundleRoute.Group("system/v2")

View File

@ -197,7 +197,7 @@ func NewRouter() *gin.Engine {
importRoute.POST("data/confirm", imports.WorkConfirm)
}
//静态文件
r.StaticFS("/api/static", http.Dir("./runtime"))
r.StaticFS("/api/fiee/static", http.Dir("./runtime"))
r.NoRoute(func(c *gin.Context) {
c.JSON(http.StatusNotFound, gin.H{
"status": 1,

View File

@ -2,16 +2,23 @@ package bundle
import (
"context"
"encoding/json"
"errors"
"fmt"
"fonchain-fiee/api/bundle"
"fonchain-fiee/api/cast"
"fonchain-fiee/pkg/service"
"fonchain-fiee/pkg/utils"
"io"
"strconv"
"strings"
"time"
bundleModel "fonchain-fiee/pkg/model/bundle"
"fonchain-fiee/pkg/model/login"
"github.com/gin-gonic/gin"
"github.com/xuri/excelize/v2"
)
func BundleExtend(c *gin.Context) {
@ -248,3 +255,191 @@ func CastLogConfirm(ctx *gin.Context) {
}
service.Success(ctx, res)
}
func BundleActivate(ctx *gin.Context) {
var req bundle.BundleActivateReq
if err := ctx.ShouldBindJSON(&req); err != nil {
service.Error(ctx, err)
return
}
res, err := service.BundleProvider.BundleActivate(context.Background(), &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, res)
}
func BundleExport(ctx *gin.Context) {
var req bundle.BundleBalanceExportReq
if err := ctx.ShouldBindJSON(&req); err != nil {
service.Error(ctx, err)
return
}
userInfo := login.GetUserInfoFromC(ctx)
exportFileName := fmt.Sprintf("%d月份余量信息.xlsx", time.Now().Month())
filePath := fmt.Sprintf("./runtime/%d/%s", userInfo.ID, exportFileName)
utils.CheckDirPath("./runtime/"+fmt.Sprint(userInfo.ID), true)
res, err := service.BundleProvider.BundleBalanceExport(context.Background(), &req)
if err != nil {
service.Error(ctx, err)
return
}
if err := writeToExcel(filePath, res.Data); err != nil {
service.Error(ctx, err)
return
}
var scheme string
if ctx.GetHeader("X-Forwarded-Proto") == "https" {
scheme = "https"
} else {
scheme = "http"
}
var exportUrl string = fmt.Sprintf("%s:%s/api/fiee/static/%s", scheme, ctx.Request.Host, strings.Replace(filePath, "./runtime/", "", 1))
service.Success(ctx, gin.H{
"url": exportUrl,
})
}
func SetBalanceLayout(ctx *gin.Context) {
b, _ := io.ReadAll(ctx.Request.Body)
userInfo := login.GetUserInfoFromC(ctx)
var req = bundle.SetBundleBalanceLayoutReq{
Data: string(b),
UserId: uint32(userInfo.ID),
}
res, err := service.BundleProvider.SetBundleBalanceLayout(context.Background(), &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, res)
}
func GetBalanceLayout(ctx *gin.Context) {
userInfo := login.GetUserInfoFromC(ctx)
var req = bundle.GetBundleBalanceLayoutReq{
UserId: uint32(userInfo.ID),
}
res, err := service.BundleProvider.GetBundleBalanceLayout(context.Background(), &req)
if err != nil {
service.Error(ctx, err)
return
}
var j any
json.Unmarshal([]byte(res.Data), &j)
service.Success(ctx, j)
}
func writeToExcel(filename string, items []*bundle.BundleBalanceExportItem) error {
f := excelize.NewFile()
sheet := "Sheet1"
// 手动表头(顺序与写入字段顺序必须一致)
headers := []string{
"所属月份", "用户编号", "名字", "手机号", "支付时间",
"套餐金额", "增值服务金额", "支付金额", "币种", "手续费", "套餐视频单价", "增值视频单价",
"套餐账号总数", "增值账号总数", "套餐账号使用数", "增值账号使用数",
"当前可用套餐视频数", "当前可用增值视频数", "当前已用套餐视频数", "当前已用增值视频数", "当前作废套餐视频数", "当前作废增值视频数", "当月新增套餐视频数", "当月新增增值视频数", "当月作废套餐视频数", "当月作废增值视频数",
"当前可用套餐图文数", "当前可用增值图文数", "当前已用套餐图文数", "当前已用增值图文数", "当前作废套餐图文数", "当前作废增值图文数", "当月新增套餐图文数", "当月新增增值图文数", "当月作废套餐图文数", "当月作废增值图文数",
"当前可用套餐数据分析数", "当前可用增值数据分析数", "当前已用套餐数据分析数", "当前已用增值数据分析数", "当前作废套餐数据分析数", "当前作废增值数据分析数", "当月新增套餐数据分析数", "当月新增增值数据分析数", "当月作废套餐数据分析数", "当月作废增值数据分析数",
"当月手动扩展账号新增数", "当月手动扩展视频新增数", "当月手动扩展图文新增数", "当月手动扩展数据分析新增数", "当月新增手动扩展时长(天)", "当月手动扩展账号使用数", "当月手动扩展视频使用数", "当月手动扩展图文使用数", "当月手动扩展数据分析使用数",
}
// 写表头
for i, h := range headers {
col, _ := excelize.ColumnNumberToName(i + 1)
cell := col + "1"
if err := f.SetCellValue(sheet, cell, h); err != nil {
return err
}
}
// 从第2行开始写数据
for r, it := range items {
row := r + 2
// 逐列写入(注意顺序必须和 headers 一致)
write := func(colIdx int, v interface{}) error {
col, _ := excelize.ColumnNumberToName(colIdx)
cell := fmt.Sprintf("%s%d", col, row)
return f.SetCellValue(sheet, cell, v)
}
// 基本信息
_ = write(1, it.Month)
_ = write(2, it.CustomerNum)
_ = write(3, it.UserName)
_ = write(4, it.UserPhoneNumber)
_ = write(5, it.PayTime)
_ = write(6, float64(it.BundleAmount))
_ = write(7, float64(it.IncreaseAmount))
_ = write(8, float64(it.TotalPayAmount))
_ = write(9, it.Currency)
_ = write(10, it.Fee)
_ = write(11, float64(it.BundleVideoUnitPrice))
_ = write(12, float64(it.IncreaseVideoUnitPrice))
// 账号类
_ = write(13, int(it.BundleAccountNumber))
_ = write(14, int(it.IncreaseAccountNumber))
_ = write(15, int(it.BundleAccountConsumptionNumber))
_ = write(16, int(it.IncreaseAccountConsumptionNumber))
// 视频类
_ = write(17, int(it.BundleVideoNumber))
_ = write(18, int(it.IncreaseVideoNumber))
_ = write(19, int(it.BundleVideoConsumptionNumber))
_ = write(20, int(it.IncreaseVideoConsumptionNumber))
_ = write(21, int(it.InvalidBundleVideoNumber))
_ = write(22, int(it.InvalidIncreaseVideoNumber))
_ = write(23, int(it.MonthlyNewBundleVideoNumber))
_ = write(24, int(it.MonthlyNewIncreaseVideoNumber))
_ = write(25, int(it.MonthlyInvalidBundleVideoNumber))
_ = write(26, int(it.MonthlyInvalidIncreaseVideoNumber))
// 图文类
_ = write(27, int(it.BundleImageNumber))
_ = write(28, int(it.IncreaseImageNumber))
_ = write(29, int(it.BundleImageConsumptionNumber))
_ = write(30, int(it.IncreaseImageConsumptionNumber))
_ = write(31, int(it.InvalidBundleImageNumber))
_ = write(32, int(it.InvalidIncreaseImageNumber))
_ = write(33, int(it.MonthlyNewBundleImageNumber))
_ = write(34, int(it.MonthlyNewIncreaseImageNumber))
_ = write(35, int(it.MonthlyInvalidBundleImageNumber))
_ = write(36, int(it.MonthlyInvalidIncreaseImageNumber))
// 数据分析类
_ = write(37, int(it.BundleDataAnalysisNumber))
_ = write(38, int(it.IncreaseDataAnalysisNumber))
_ = write(39, int(it.BundleDataAnalysisConsumptionNumber))
_ = write(40, int(it.IncreaseDataAnalysisConsumptionNumber))
_ = write(41, int(it.InvalidBundleDataAnalysisNumber))
_ = write(42, int(it.InvalidIncreaseDataAnalysisNumber))
_ = write(43, int(it.MonthlyNewBundleDataAnalysisNumber))
_ = write(44, int(it.MonthlyNewIncreaseDataAnalysisNumber))
_ = write(45, int(it.MonthlyInvalidBundleDataAnalysisNumber))
_ = write(46, int(it.MonthlyInvalidIncreaseDataAnalysisNumber))
// 手动扩展类
_ = write(47, int(it.MonthlyNewManualAccountNumber))
_ = write(48, int(it.MonthlyNewManualVideoNumber))
_ = write(49, int(it.MonthlyNewManualImageNumber))
_ = write(50, int(it.MonthlyNewManualDataAnalysisNumber))
_ = write(51, int(it.MonthlyNewDurationNumber))
_ = write(52, int(it.MonthlyManualAccountConsumptionNumber))
_ = write(53, int(it.MonthlyManualVideoConsumptionNumber))
_ = write(54, int(it.MonthlyManualImageConsumptionNumber))
_ = write(55, int(it.MonthlyManualDataAnalysisConsumptionNumber))
}
// 可选:设置列宽,使表格更美观
_ = f.SetColWidth(sheet, "A", "AZ", 15)
// 保存文件
if err := f.SaveAs(filename); err != nil {
return err
}
return nil
}