Compare commits
	
		
			No commits in common. "044f79575c3a24d9e323815373b2ad27080020c4" and "5e2fa0e7a091bc54cd1e566e87111e3703db49e2" have entirely different histories.
		
	
	
		
			044f79575c
			...
			5e2fa0e7a0
		
	
		
| @ -112,8 +112,3 @@ func (b *BundleProvider) OnlyAddValueListByOrderNo(_ context.Context, req *bundl | |||||||
| func (b *BundleProvider) UpdateReconciliationStatusBySerialNumber(_ context.Context, req *bundle.UpdateStatusAndPayTimeBySerialNumber) (res *bundle.CommonResponse, err error) { | func (b *BundleProvider) UpdateReconciliationStatusBySerialNumber(_ context.Context, req *bundle.UpdateStatusAndPayTimeBySerialNumber) (res *bundle.CommonResponse, err error) { | ||||||
| 	return logic.UpdateReconciliationStatusBySerialNumber(req) | 	return logic.UpdateReconciliationStatusBySerialNumber(req) | ||||||
| } | } | ||||||
| 
 |  | ||||||
| // 删除订单
 |  | ||||||
| func (b *BundleProvider) DeleteValueAddService(_ context.Context, req *bundle.DeleteValueAddServiceRequest) (res *bundle.CommonResponse, err error) { |  | ||||||
| 	return logic.DeleteValueAddService(req) |  | ||||||
| } |  | ||||||
|  | |||||||
| @ -673,41 +673,6 @@ func UpdateReconciliation(req *bundle.ReconciliationInfo) (res *bundle.CommonRes | |||||||
| 	// 返回成功响应
 | 	// 返回成功响应
 | ||||||
| 	return &bundle.CommonResponse{Msg: "更新成功"}, nil | 	return &bundle.CommonResponse{Msg: "更新成功"}, nil | ||||||
| } | } | ||||||
| func DeleteValueAddService(req *bundle.DeleteValueAddServiceRequest) (res *bundle.CommonResponse, err error) { |  | ||||||
| 	res = new(bundle.CommonResponse) |  | ||||||
| 	var paidServices []*model.BundleOrderValueAdd |  | ||||||
| 	if err = app.ModuleClients.BundleDB.Model(&model.BundleOrderValueAdd{}). |  | ||||||
| 		Where("order_no = ? AND payment_status = 2 and customer_id = ?", req.OrderNo, req.UserID). |  | ||||||
| 		Find(&paidServices).Error; err != nil { |  | ||||||
| 		res.Msg = msg.ErrorUpdateOrderInfo |  | ||||||
| 		return res, commonErr.ReturnError(err, msg.ErrorUpdateOrderInfo, "查询增值服务支付状态失败: ") |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	if len(paidServices) > 0 { |  | ||||||
| 		res.Msg = "订单已支付,无法删除" |  | ||||||
| 		return res, nil |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	if err = app.ModuleClients.BundleDB.Where("order_no = ?", req.OrderNo). |  | ||||||
| 		Delete(&model.BundleOrderValueAdd{}).Error; err != nil { |  | ||||||
| 		res.Msg = msg.ErrorDeleteOrderInfo |  | ||||||
| 		return res, commonErr.ReturnError(err, msg.ErrorDeleteOrderInfo, "删除增值服务失败: ") |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	var order model.BundleOrderRecords |  | ||||||
| 	if err = app.ModuleClients.BundleDB.Model(&model.BundleOrderRecords{}). |  | ||||||
| 		Where("order_no = ? and customer_id = ?", req.OrderNo, req.UserID). |  | ||||||
| 		First(&order).Error; err != nil { |  | ||||||
| 		if !errors.Is(err, gorm.ErrRecordNotFound) { |  | ||||||
| 		} |  | ||||||
| 	} else if order.PayType == 2 { |  | ||||||
| 		res.Msg = "订单已支付,无法删除" |  | ||||||
| 		return res, nil |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	res.Msg = msg.SuccessDeletedOrderInfo |  | ||||||
| 	return res, nil |  | ||||||
| } |  | ||||||
| func OnlyAddValueListByOrderNo(req *bundle.OnlyAddValueListByOrderNoRequest) (res *bundle.OnlyAddValueListByOrderNoResp, err error) { | func OnlyAddValueListByOrderNo(req *bundle.OnlyAddValueListByOrderNoRequest) (res *bundle.OnlyAddValueListByOrderNoResp, err error) { | ||||||
| 	response := new(bundle.OnlyAddValueListByOrderNoResp) | 	response := new(bundle.OnlyAddValueListByOrderNoResp) | ||||||
| 	response.AddBundleInfos = make([]*bundle.AddBundleInfo, 0) | 	response.AddBundleInfos = make([]*bundle.AddBundleInfo, 0) | ||||||
|  | |||||||
| @ -156,9 +156,3 @@ func UpdateReconciliationStatusBySerialNumber(req *bundle.UpdateStatusAndPayTime | |||||||
| 	res, err = dao.UpdateReconciliationStatusBySerialNumber(req) | 	res, err = dao.UpdateReconciliationStatusBySerialNumber(req) | ||||||
| 	return | 	return | ||||||
| } | } | ||||||
| 
 |  | ||||||
| func DeleteValueAddService(req *bundle.DeleteValueAddServiceRequest) (res *bundle.CommonResponse, err error) { |  | ||||||
| 	res = new(bundle.CommonResponse) |  | ||||||
| 	res, err = dao.DeleteValueAddService(req) |  | ||||||
| 	return |  | ||||||
| } |  | ||||||
|  | |||||||
| @ -46,7 +46,7 @@ service Bundle { | |||||||
|   rpc ValueAddServiceLangByUuidAndLanguage(ValueAddServiceDetailRequest)returns (ValueAddServiceLang) {} |   rpc ValueAddServiceLangByUuidAndLanguage(ValueAddServiceDetailRequest)returns (ValueAddServiceLang) {} | ||||||
|   rpc CalculatePrice(CalculatePriceRequest) returns (CalculatePriceResponse) {} |   rpc CalculatePrice(CalculatePriceRequest) returns (CalculatePriceResponse) {} | ||||||
|   rpc BatchGetValueAddServiceLang(BatchGetValueAddServiceLangRequest) returns (BatchGetValueAddServiceLangResponse) {} |   rpc BatchGetValueAddServiceLang(BatchGetValueAddServiceLangRequest) returns (BatchGetValueAddServiceLangResponse) {} | ||||||
|   rpc DeleteValueAddService(DeleteValueAddServiceRequest) returns (CommonResponse) {} | 
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|   // 余量管理 |   // 余量管理 | ||||||
| @ -71,10 +71,7 @@ service Bundle { | |||||||
|   rpc UpdateReconciliation(ReconciliationInfo) returns (CommonResponse) {} // 更新对账单 |   rpc UpdateReconciliation(ReconciliationInfo) returns (CommonResponse) {} // 更新对账单 | ||||||
|   rpc UpdateReconciliationStatusBySerialNumber(UpdateStatusAndPayTimeBySerialNumber) returns (CommonResponse) {} // 更新对账单 |   rpc UpdateReconciliationStatusBySerialNumber(UpdateStatusAndPayTimeBySerialNumber) returns (CommonResponse) {} // 更新对账单 | ||||||
| } | } | ||||||
| message DeleteValueAddServiceRequest{ | 
 | ||||||
|   string orderNo = 1; |  | ||||||
|   uint64 userID = 2; |  | ||||||
| } |  | ||||||
| message GetReconciliationListReq{ | message GetReconciliationListReq{ | ||||||
|   string userName = 1; |   string userName = 1; | ||||||
|   string bundleName = 2; |   string bundleName = 2; | ||||||
|  | |||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -7,8 +7,8 @@ import ( | |||||||
| 	fmt "fmt" | 	fmt "fmt" | ||||||
| 	math "math" | 	math "math" | ||||||
| 	proto "github.com/golang/protobuf/proto" | 	proto "github.com/golang/protobuf/proto" | ||||||
| 	_ "google.golang.org/protobuf/types/descriptorpb" |  | ||||||
| 	_ "github.com/mwitkow/go-proto-validators" | 	_ "github.com/mwitkow/go-proto-validators" | ||||||
|  | 	_ "google.golang.org/protobuf/types/descriptorpb" | ||||||
| 	github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators" | 	github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| @ -17,9 +17,6 @@ var _ = proto.Marshal | |||||||
| var _ = fmt.Errorf | var _ = fmt.Errorf | ||||||
| var _ = math.Inf | var _ = math.Inf | ||||||
| 
 | 
 | ||||||
| func (this *DeleteValueAddServiceRequest) Validate() error { |  | ||||||
| 	return nil |  | ||||||
| } |  | ||||||
| func (this *GetReconciliationListReq) Validate() error { | func (this *GetReconciliationListReq) Validate() error { | ||||||
| 	return nil | 	return nil | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,7 +1,7 @@ | |||||||
| // Code generated by protoc-gen-go-triple. DO NOT EDIT.
 | // Code generated by protoc-gen-go-triple. DO NOT EDIT.
 | ||||||
| // versions:
 | // versions:
 | ||||||
| // - protoc-gen-go-triple v1.0.8
 | // - protoc-gen-go-triple v1.0.8
 | ||||||
| // - protoc             v4.24.0--rc1
 | // - protoc             v3.20.3
 | ||||||
| // source: pb/bundle.proto
 | // source: pb/bundle.proto
 | ||||||
| 
 | 
 | ||||||
| package bundle | package bundle | ||||||
| @ -59,7 +59,6 @@ type BundleClient interface { | |||||||
| 	ValueAddServiceLangByUuidAndLanguage(ctx context.Context, in *ValueAddServiceDetailRequest, opts ...grpc_go.CallOption) (*ValueAddServiceLang, common.ErrorWithAttachment) | 	ValueAddServiceLangByUuidAndLanguage(ctx context.Context, in *ValueAddServiceDetailRequest, opts ...grpc_go.CallOption) (*ValueAddServiceLang, common.ErrorWithAttachment) | ||||||
| 	CalculatePrice(ctx context.Context, in *CalculatePriceRequest, opts ...grpc_go.CallOption) (*CalculatePriceResponse, common.ErrorWithAttachment) | 	CalculatePrice(ctx context.Context, in *CalculatePriceRequest, opts ...grpc_go.CallOption) (*CalculatePriceResponse, common.ErrorWithAttachment) | ||||||
| 	BatchGetValueAddServiceLang(ctx context.Context, in *BatchGetValueAddServiceLangRequest, opts ...grpc_go.CallOption) (*BatchGetValueAddServiceLangResponse, common.ErrorWithAttachment) | 	BatchGetValueAddServiceLang(ctx context.Context, in *BatchGetValueAddServiceLangRequest, opts ...grpc_go.CallOption) (*BatchGetValueAddServiceLangResponse, common.ErrorWithAttachment) | ||||||
| 	DeleteValueAddService(ctx context.Context, in *DeleteValueAddServiceRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) |  | ||||||
| 	// 余量管理
 | 	// 余量管理
 | ||||||
| 	BundleExtend(ctx context.Context, in *BundleExtendRequest, opts ...grpc_go.CallOption) (*BundleExtendResponse, common.ErrorWithAttachment) | 	BundleExtend(ctx context.Context, in *BundleExtendRequest, opts ...grpc_go.CallOption) (*BundleExtendResponse, common.ErrorWithAttachment) | ||||||
| 	BundleExtendRecordsList(ctx context.Context, in *BundleExtendRecordsListRequest, opts ...grpc_go.CallOption) (*BundleExtendRecordsListResponse, common.ErrorWithAttachment) | 	BundleExtendRecordsList(ctx context.Context, in *BundleExtendRecordsListRequest, opts ...grpc_go.CallOption) (*BundleExtendRecordsListResponse, common.ErrorWithAttachment) | ||||||
| @ -114,7 +113,6 @@ type BundleClientImpl struct { | |||||||
| 	ValueAddServiceLangByUuidAndLanguage     func(ctx context.Context, in *ValueAddServiceDetailRequest) (*ValueAddServiceLang, error) | 	ValueAddServiceLangByUuidAndLanguage     func(ctx context.Context, in *ValueAddServiceDetailRequest) (*ValueAddServiceLang, error) | ||||||
| 	CalculatePrice                           func(ctx context.Context, in *CalculatePriceRequest) (*CalculatePriceResponse, error) | 	CalculatePrice                           func(ctx context.Context, in *CalculatePriceRequest) (*CalculatePriceResponse, error) | ||||||
| 	BatchGetValueAddServiceLang              func(ctx context.Context, in *BatchGetValueAddServiceLangRequest) (*BatchGetValueAddServiceLangResponse, error) | 	BatchGetValueAddServiceLang              func(ctx context.Context, in *BatchGetValueAddServiceLangRequest) (*BatchGetValueAddServiceLangResponse, error) | ||||||
| 	DeleteValueAddService                    func(ctx context.Context, in *DeleteValueAddServiceRequest) (*CommonResponse, error) |  | ||||||
| 	BundleExtend                             func(ctx context.Context, in *BundleExtendRequest) (*BundleExtendResponse, error) | 	BundleExtend                             func(ctx context.Context, in *BundleExtendRequest) (*BundleExtendResponse, error) | ||||||
| 	BundleExtendRecordsList                  func(ctx context.Context, in *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error) | 	BundleExtendRecordsList                  func(ctx context.Context, in *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error) | ||||||
| 	GetBundleBalanceList                     func(ctx context.Context, in *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error) | 	GetBundleBalanceList                     func(ctx context.Context, in *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error) | ||||||
| @ -318,12 +316,6 @@ func (c *bundleClient) BatchGetValueAddServiceLang(ctx context.Context, in *Batc | |||||||
| 	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BatchGetValueAddServiceLang", in, out) | 	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BatchGetValueAddServiceLang", in, out) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (c *bundleClient) DeleteValueAddService(ctx context.Context, in *DeleteValueAddServiceRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) { |  | ||||||
| 	out := new(CommonResponse) |  | ||||||
| 	interfaceKey := ctx.Value(constant.InterfaceKey).(string) |  | ||||||
| 	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/DeleteValueAddService", in, out) |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| func (c *bundleClient) BundleExtend(ctx context.Context, in *BundleExtendRequest, opts ...grpc_go.CallOption) (*BundleExtendResponse, common.ErrorWithAttachment) { | func (c *bundleClient) BundleExtend(ctx context.Context, in *BundleExtendRequest, opts ...grpc_go.CallOption) (*BundleExtendResponse, common.ErrorWithAttachment) { | ||||||
| 	out := new(BundleExtendResponse) | 	out := new(BundleExtendResponse) | ||||||
| 	interfaceKey := ctx.Value(constant.InterfaceKey).(string) | 	interfaceKey := ctx.Value(constant.InterfaceKey).(string) | ||||||
| @ -449,7 +441,6 @@ type BundleServer interface { | |||||||
| 	ValueAddServiceLangByUuidAndLanguage(context.Context, *ValueAddServiceDetailRequest) (*ValueAddServiceLang, error) | 	ValueAddServiceLangByUuidAndLanguage(context.Context, *ValueAddServiceDetailRequest) (*ValueAddServiceLang, error) | ||||||
| 	CalculatePrice(context.Context, *CalculatePriceRequest) (*CalculatePriceResponse, error) | 	CalculatePrice(context.Context, *CalculatePriceRequest) (*CalculatePriceResponse, error) | ||||||
| 	BatchGetValueAddServiceLang(context.Context, *BatchGetValueAddServiceLangRequest) (*BatchGetValueAddServiceLangResponse, error) | 	BatchGetValueAddServiceLang(context.Context, *BatchGetValueAddServiceLangRequest) (*BatchGetValueAddServiceLangResponse, error) | ||||||
| 	DeleteValueAddService(context.Context, *DeleteValueAddServiceRequest) (*CommonResponse, error) |  | ||||||
| 	// 余量管理
 | 	// 余量管理
 | ||||||
| 	BundleExtend(context.Context, *BundleExtendRequest) (*BundleExtendResponse, error) | 	BundleExtend(context.Context, *BundleExtendRequest) (*BundleExtendResponse, error) | ||||||
| 	BundleExtendRecordsList(context.Context, *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error) | 	BundleExtendRecordsList(context.Context, *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error) | ||||||
| @ -563,9 +554,6 @@ func (UnimplementedBundleServer) CalculatePrice(context.Context, *CalculatePrice | |||||||
| func (UnimplementedBundleServer) BatchGetValueAddServiceLang(context.Context, *BatchGetValueAddServiceLangRequest) (*BatchGetValueAddServiceLangResponse, error) { | func (UnimplementedBundleServer) BatchGetValueAddServiceLang(context.Context, *BatchGetValueAddServiceLangRequest) (*BatchGetValueAddServiceLangResponse, error) { | ||||||
| 	return nil, status.Errorf(codes.Unimplemented, "method BatchGetValueAddServiceLang not implemented") | 	return nil, status.Errorf(codes.Unimplemented, "method BatchGetValueAddServiceLang not implemented") | ||||||
| } | } | ||||||
| func (UnimplementedBundleServer) DeleteValueAddService(context.Context, *DeleteValueAddServiceRequest) (*CommonResponse, error) { |  | ||||||
| 	return nil, status.Errorf(codes.Unimplemented, "method DeleteValueAddService not implemented") |  | ||||||
| } |  | ||||||
| func (UnimplementedBundleServer) BundleExtend(context.Context, *BundleExtendRequest) (*BundleExtendResponse, error) { | func (UnimplementedBundleServer) BundleExtend(context.Context, *BundleExtendRequest) (*BundleExtendResponse, error) { | ||||||
| 	return nil, status.Errorf(codes.Unimplemented, "method BundleExtend not implemented") | 	return nil, status.Errorf(codes.Unimplemented, "method BundleExtend not implemented") | ||||||
| } | } | ||||||
| @ -1480,35 +1468,6 @@ func _Bundle_BatchGetValueAddServiceLang_Handler(srv interface{}, ctx context.Co | |||||||
| 	return interceptor(ctx, in, info, handler) | 	return interceptor(ctx, in, info, handler) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func _Bundle_DeleteValueAddService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { |  | ||||||
| 	in := new(DeleteValueAddServiceRequest) |  | ||||||
| 	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("DeleteValueAddService", 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_BundleExtend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { | func _Bundle_BundleExtend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { | ||||||
| 	in := new(BundleExtendRequest) | 	in := new(BundleExtendRequest) | ||||||
| 	if err := dec(in); err != nil { | 	if err := dec(in); err != nil { | ||||||
| @ -2067,10 +2026,6 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{ | |||||||
| 			MethodName: "BatchGetValueAddServiceLang", | 			MethodName: "BatchGetValueAddServiceLang", | ||||||
| 			Handler:    _Bundle_BatchGetValueAddServiceLang_Handler, | 			Handler:    _Bundle_BatchGetValueAddServiceLang_Handler, | ||||||
| 		}, | 		}, | ||||||
| 		{ |  | ||||||
| 			MethodName: "DeleteValueAddService", |  | ||||||
| 			Handler:    _Bundle_DeleteValueAddService_Handler, |  | ||||||
| 		}, |  | ||||||
| 		{ | 		{ | ||||||
| 			MethodName: "BundleExtend", | 			MethodName: "BundleExtend", | ||||||
| 			Handler:    _Bundle_BundleExtend_Handler, | 			Handler:    _Bundle_BundleExtend_Handler, | ||||||
|  | |||||||
| @ -52,9 +52,7 @@ const ( | |||||||
| 	SuccessCreateOrderInfo = "创建订单信息成功" | 	SuccessCreateOrderInfo = "创建订单信息成功" | ||||||
| 
 | 
 | ||||||
| 	ErrorUpdateOrderInfo   = "更新订单信息失败" | 	ErrorUpdateOrderInfo   = "更新订单信息失败" | ||||||
| 	ErrorDeleteOrderInfo    = "删除增值服务失败" |  | ||||||
| 	SuccessUpdateOrderInfo = "更新订单信息成功" | 	SuccessUpdateOrderInfo = "更新订单信息成功" | ||||||
| 	SuccessDeletedOrderInfo = "删除订单信息成功" |  | ||||||
| 
 | 
 | ||||||
| 	ErrorGetOrderInfo = "获取订单信息失败" | 	ErrorGetOrderInfo = "获取订单信息失败" | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user