diff --git a/internal/dao/orderRecordsDao.go b/internal/dao/orderRecordsDao.go index 9613156..7e6906e 100644 --- a/internal/dao/orderRecordsDao.go +++ b/internal/dao/orderRecordsDao.go @@ -279,6 +279,21 @@ func OrderRecordDetail(req *bundle.OrderRecordsDetailRequest) (res *bundle.Order } //_ = copier.CopyWithOption(&res, orderRecord, copier.Option{DeepCopy: true}) + addBundles := make([]model.BundleOrderValueAdd, 0) + err = app.ModuleClients.BundleDB.Model(model.BundleOrderValueAdd{}).Where("deleted is null and source = 1 and order_no = ?", req.OrderNo).Find(&addBundles).Error + if err != nil { + return res, commonErr.ReturnError(err, "增值订单信息", "获取增值订单信息失败: ") + } + addInfos := make([]*bundle.AddInfo, 0) + for _, addBundle := range addBundles { + addInfo := &bundle.AddInfo{ + OrderNo: addBundle.OrderNo, + Num: addBundle.Num, + ValueAddUUID: addBundle.ValueAddUUID, + } + addInfos = append(addInfos, addInfo) + } + res = &bundle.OrderRecord{ Uuid: orderRecord.UUID, OrderNo: orderRecord.OrderNo, @@ -303,6 +318,8 @@ func OrderRecordDetail(req *bundle.OrderRecordsDetailRequest) (res *bundle.Order TotalAmount: orderRecord.TotalAmount, ExpirationTime: orderRecord.ExpirationTime, } + res.AddInfos = make([]*bundle.AddInfo, 0) + res.AddInfos = addInfos return } func PackagePriceAndTime(orderRecord *bundle.OrderRecord) (res *bundle.PackagePriceAndTimeResponse, err error) { diff --git a/pb/bundle.proto b/pb/bundle.proto index 12a2f95..cf5e256 100644 --- a/pb/bundle.proto +++ b/pb/bundle.proto @@ -327,7 +327,14 @@ message OrderRecord { repeated PriceOptionsInfo priceOptionsInfo = 36 [json_name = "priceOptionsInfo"]; string expirationTime = 37 [json_name = "expirationTime"]; string snapshot = 38 [json_name = "snapshot"]; + repeated AddInfo addInfos = 39 [json_name = "addInfos"]; } +message AddInfo{ + string orderNo = 1 [json_name = "orderNo"]; + int32 num = 2 [json_name = "num"]; + string valueAddUUID = 3 [json_name = "valueAddUUID"]; +} + message OrderAddRecord{ string bundleUuid = 1 [json_name = "bundleUuid"]; repeated AddPriceOptionsInfo addPriceOptionsList = 2 [json_name = "addPriceOptionsList"]; diff --git a/pb/bundle/bundle.validator.pb.go b/pb/bundle/bundle.validator.pb.go index f717cf4..f89632c 100644 --- a/pb/bundle/bundle.validator.pb.go +++ b/pb/bundle/bundle.validator.pb.go @@ -5,11 +5,12 @@ package bundle import ( fmt "fmt" - math "math" proto "github.com/golang/protobuf/proto" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/protobuf/types/descriptorpb" github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators" + _ "google.golang.org/protobuf/types/descriptorpb" + math "math" ) // Reference imports to suppress errors if they are not otherwise used. @@ -156,6 +157,16 @@ func (this *OrderRecord) Validate() error { } } } + for _, item := range this.AddInfos { + if item != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("AddInfos", err) + } + } + } + return nil +} +func (this *AddInfo) Validate() error { return nil } func (this *OrderAddRecord) Validate() error { diff --git a/pb/bundle/bundle_triple.pb.go b/pb/bundle/bundle_triple.pb.go index bb56e31..0a303b3 100644 --- a/pb/bundle/bundle_triple.pb.go +++ b/pb/bundle/bundle_triple.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-triple. DO NOT EDIT. // versions: // - protoc-gen-go-triple v1.0.8 -// - protoc v4.24.0--rc1 +// - protoc v5.26.1 // source: pb/bundle.proto package bundle @@ -47,11 +47,11 @@ type BundleClient interface { PackagePriceAndTime(ctx context.Context, in *OrderRecord, opts ...grpc_go.CallOption) (*PackagePriceAndTimeResponse, common.ErrorWithAttachment) OrderRecordsListV2(ctx context.Context, in *OrderRecordsRequestV2, opts ...grpc_go.CallOption) (*OrderRecordsResponseV2, common.ErrorWithAttachment) OrderListByOrderNo(ctx context.Context, in *OrderInfoByOrderNoRequest, opts ...grpc_go.CallOption) (*OrderInfoByOrderNoResp, common.ErrorWithAttachment) - //增值套餐 + // 增值套餐 CreateValueAddBundle(ctx context.Context, in *CreateValueAddBundleRequest, opts ...grpc_go.CallOption) (*CreateValueAddBundleResponse, common.ErrorWithAttachment) ValueAddBundleList(ctx context.Context, in *ValueAddBundleListRequest, opts ...grpc_go.CallOption) (*ValueAddBundleListResponse, common.ErrorWithAttachment) ValueAddBundleDetail(ctx context.Context, in *ValueAddBundleDetailRequest, opts ...grpc_go.CallOption) (*ValueAddBundleDetailResponse, common.ErrorWithAttachment) - //新增值服务 + // 新增值服务 SaveValueAddService(ctx context.Context, in *ValueAddServiceLang, opts ...grpc_go.CallOption) (*SaveResponse, common.ErrorWithAttachment) ValueAddServiceList(ctx context.Context, in *ValueAddServiceListRequest, opts ...grpc_go.CallOption) (*ValueAddServiceListResponse, common.ErrorWithAttachment) ValueAddServiceDetail(ctx context.Context, in *ValueAddServiceDetailRequest, opts ...grpc_go.CallOption) (*ValueAddServiceDetailResponse, common.ErrorWithAttachment) @@ -69,7 +69,7 @@ type BundleClient interface { GetImageWorkDetail(ctx context.Context, in *GetImageWorkDetailReq, opts ...grpc_go.CallOption) (*GetImageWorkDetailResp, common.ErrorWithAttachment) GetVedioWorkDetail(ctx context.Context, in *GetVedioWorkDetailReq, opts ...grpc_go.CallOption) (*GetVedioeWorkDetailResp, common.ErrorWithAttachment) ToBeComfirmedWorks(ctx context.Context, in *ToBeComfirmedWorksReq, opts ...grpc_go.CallOption) (*ToBeComfirmedWorksResp, common.ErrorWithAttachment) - //对账单 + // 对账单 GetReconciliationList(ctx context.Context, in *GetReconciliationListReq, opts ...grpc_go.CallOption) (*GetReconciliationListResp, common.ErrorWithAttachment) CreateReconciliation(ctx context.Context, in *ReconciliationInfo, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) UpdateReconciliation(ctx context.Context, in *ReconciliationInfo, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) @@ -397,11 +397,11 @@ type BundleServer interface { PackagePriceAndTime(context.Context, *OrderRecord) (*PackagePriceAndTimeResponse, error) OrderRecordsListV2(context.Context, *OrderRecordsRequestV2) (*OrderRecordsResponseV2, error) OrderListByOrderNo(context.Context, *OrderInfoByOrderNoRequest) (*OrderInfoByOrderNoResp, error) - //增值套餐 + // 增值套餐 CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error) ValueAddBundleList(context.Context, *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error) ValueAddBundleDetail(context.Context, *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error) - //新增值服务 + // 新增值服务 SaveValueAddService(context.Context, *ValueAddServiceLang) (*SaveResponse, error) ValueAddServiceList(context.Context, *ValueAddServiceListRequest) (*ValueAddServiceListResponse, error) ValueAddServiceDetail(context.Context, *ValueAddServiceDetailRequest) (*ValueAddServiceDetailResponse, error) @@ -419,7 +419,7 @@ type BundleServer interface { GetImageWorkDetail(context.Context, *GetImageWorkDetailReq) (*GetImageWorkDetailResp, error) GetVedioWorkDetail(context.Context, *GetVedioWorkDetailReq) (*GetVedioeWorkDetailResp, error) ToBeComfirmedWorks(context.Context, *ToBeComfirmedWorksReq) (*ToBeComfirmedWorksResp, error) - //对账单 + // 对账单 GetReconciliationList(context.Context, *GetReconciliationListReq) (*GetReconciliationListResp, error) CreateReconciliation(context.Context, *ReconciliationInfo) (*CommonResponse, error) UpdateReconciliation(context.Context, *ReconciliationInfo) (*CommonResponse, error)