订单添加 财务确认 状态 默认未确认
This commit is contained in:
parent
399b486d7e
commit
d14aa14601
@ -72,3 +72,8 @@ func (b *BundleProvider) ValueAddBundleList(_ context.Context, req *bundle.Value
|
|||||||
func (b *BundleProvider) ValueAddBundleDetail(_ context.Context, req *bundle.ValueAddBundleDetailRequest) (res *bundle.ValueAddBundleDetailResponse, err error) {
|
func (b *BundleProvider) ValueAddBundleDetail(_ context.Context, req *bundle.ValueAddBundleDetailRequest) (res *bundle.ValueAddBundleDetailResponse, err error) {
|
||||||
return logic.ValueAddBundleDetail(req)
|
return logic.ValueAddBundleDetail(req)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 财务确认
|
||||||
|
func (b *BundleProvider) UpdateFinancialConfirmationStatus(_ context.Context, req *bundle.FinancialConfirmationRequest) (res *bundle.CommonResponse, err error) {
|
||||||
|
return logic.UpdateFinancialConfirmationStatus(req)
|
||||||
|
}
|
||||||
|
@ -18,6 +18,7 @@ func CreateOrderRecord(req *bundle.OrderRecord) (res *bundle.CommonResponse, err
|
|||||||
orderRecord.OrderNo = utils.GetOrderNo()
|
orderRecord.OrderNo = utils.GetOrderNo()
|
||||||
orderRecord.BundleUUID = req.BundleUuid
|
orderRecord.BundleUUID = req.BundleUuid
|
||||||
orderRecord.ValueAddBundleUUID = req.ValueAddBundleUuid
|
orderRecord.ValueAddBundleUUID = req.ValueAddBundleUuid
|
||||||
|
orderRecord.FinancialConfirmation = model.ConfirmationNotConfirmed
|
||||||
|
|
||||||
res, err = dao.CreateOrderRecord(orderRecord)
|
res, err = dao.CreateOrderRecord(orderRecord)
|
||||||
return
|
return
|
||||||
@ -58,3 +59,14 @@ func OrderRecordsDetail(req *bundle.OrderRecordsDetailRequest) (res *bundle.Orde
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func UpdateFinancialConfirmationStatus(req *bundle.FinancialConfirmationRequest) (res *bundle.CommonResponse, err error) {
|
||||||
|
res = new(bundle.CommonResponse)
|
||||||
|
err = app.ModuleClients.BundleDB.Model(&model.BundleOrderRecords{}).Where("order_no = ?", req.OrderNo).Update("financial_confirmation", model.ConfirmationConfirmed).Error
|
||||||
|
if err != nil {
|
||||||
|
res.Msg = "更新财务确认状态失败"
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
|
res.Msg = "更新财务确认状态成功"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
@ -32,4 +32,11 @@ type BundleOrderRecords struct {
|
|||||||
ContractNo string `json:"contractNo" gorm:"column:contract_no;type:varchar(1024);comment:合同编号"`
|
ContractNo string `json:"contractNo" gorm:"column:contract_no;type:varchar(1024);comment:合同编号"`
|
||||||
BundleCommonUid string `json:"bundleCommonUid" gorm:"column:bundle_common_uid;type:text;comment:套餐公共ID"`
|
BundleCommonUid string `json:"bundleCommonUid" gorm:"column:bundle_common_uid;type:text;comment:套餐公共ID"`
|
||||||
AddBundleCommonUid string `json:"addBundleCommonUid" gorm:"column:add_bundle_common_uid;type:text;comment:附加套餐公共ID"`
|
AddBundleCommonUid string `json:"addBundleCommonUid" gorm:"column:add_bundle_common_uid;type:text;comment:附加套餐公共ID"`
|
||||||
|
FinancialConfirmation int32 `json:"financialConfirmation" gorm:"column:financial_confirmation;type:int;comment:财务确认 1:未确认 2:已确认"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 财务确认状态
|
||||||
|
const (
|
||||||
|
ConfirmationNotConfirmed = 1
|
||||||
|
ConfirmationConfirmed = 2
|
||||||
|
)
|
||||||
|
@ -20,6 +20,7 @@ service Bundle {
|
|||||||
rpc UpdateOrderRecordByOrderNo(OrderRecord) returns (CommonResponse) {}
|
rpc UpdateOrderRecordByOrderNo(OrderRecord) returns (CommonResponse) {}
|
||||||
rpc OrderRecordsList(OrderRecordsRequest) returns (OrderRecordsResponse) {}
|
rpc OrderRecordsList(OrderRecordsRequest) returns (OrderRecordsResponse) {}
|
||||||
rpc OrderRecordsDetail(OrderRecordsDetailRequest) returns (OrderRecordsDetailResponse) {}
|
rpc OrderRecordsDetail(OrderRecordsDetailRequest) returns (OrderRecordsDetailResponse) {}
|
||||||
|
rpc UpdateFinancialConfirmationStatus(FinancialConfirmationRequest) returns (CommonResponse) {}
|
||||||
|
|
||||||
//增值套餐
|
//增值套餐
|
||||||
rpc CreateValueAddBundle(CreateValueAddBundleRequest) returns (CreateValueAddBundleResponse) {}
|
rpc CreateValueAddBundle(CreateValueAddBundleRequest) returns (CreateValueAddBundleResponse) {}
|
||||||
@ -107,6 +108,7 @@ message OrderRecord {
|
|||||||
string groupPhoto = 30 [json_name = "groupPhoto"];
|
string groupPhoto = 30 [json_name = "groupPhoto"];
|
||||||
string bundleCommonUid = 31 [json_name = "bundleCommonUid"];
|
string bundleCommonUid = 31 [json_name = "bundleCommonUid"];
|
||||||
string addBundleCommonUid = 32 [json_name = "addBundleCommonUid"];
|
string addBundleCommonUid = 32 [json_name = "addBundleCommonUid"];
|
||||||
|
int32 financialConfirmation = 33 [json_name = "financialConfirmation"];
|
||||||
}
|
}
|
||||||
|
|
||||||
message OrderRecordsRequest {
|
message OrderRecordsRequest {
|
||||||
@ -196,3 +198,7 @@ message ValueAddBundleDetailResponse {
|
|||||||
string payTime = 2 [json_name = "payTime"];
|
string payTime = 2 [json_name = "payTime"];
|
||||||
string msg = 3 [json_name = "msg"];
|
string msg = 3 [json_name = "msg"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message FinancialConfirmationRequest {
|
||||||
|
string orderNo = 1 [json_name = "orderNo"];
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
@ -116,3 +116,6 @@ func (this *ValueAddBundleDetailResponse) Validate() error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (this *FinancialConfirmationRequest) Validate() error {
|
||||||
|
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.5
|
// - protoc-gen-go-triple v1.0.8
|
||||||
// - protoc v3.21.8
|
// - protoc v3.10.1
|
||||||
// source: pb/bundle.proto
|
// source: pb/bundle.proto
|
||||||
|
|
||||||
package bundle
|
package bundle
|
||||||
@ -38,6 +38,7 @@ type BundleClient interface {
|
|||||||
UpdateOrderRecordByOrderNo(ctx context.Context, in *OrderRecord, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
|
UpdateOrderRecordByOrderNo(ctx context.Context, in *OrderRecord, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
|
||||||
OrderRecordsList(ctx context.Context, in *OrderRecordsRequest, opts ...grpc_go.CallOption) (*OrderRecordsResponse, common.ErrorWithAttachment)
|
OrderRecordsList(ctx context.Context, in *OrderRecordsRequest, opts ...grpc_go.CallOption) (*OrderRecordsResponse, common.ErrorWithAttachment)
|
||||||
OrderRecordsDetail(ctx context.Context, in *OrderRecordsDetailRequest, opts ...grpc_go.CallOption) (*OrderRecordsDetailResponse, common.ErrorWithAttachment)
|
OrderRecordsDetail(ctx context.Context, in *OrderRecordsDetailRequest, opts ...grpc_go.CallOption) (*OrderRecordsDetailResponse, common.ErrorWithAttachment)
|
||||||
|
UpdateFinancialConfirmationStatus(ctx context.Context, in *FinancialConfirmationRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
|
||||||
//增值套餐
|
//增值套餐
|
||||||
CreateValueAddBundle(ctx context.Context, in *CreateValueAddBundleRequest, opts ...grpc_go.CallOption) (*CreateValueAddBundleResponse, 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)
|
ValueAddBundleList(ctx context.Context, in *ValueAddBundleListRequest, opts ...grpc_go.CallOption) (*ValueAddBundleListResponse, common.ErrorWithAttachment)
|
||||||
@ -59,6 +60,7 @@ type BundleClientImpl struct {
|
|||||||
UpdateOrderRecordByOrderNo func(ctx context.Context, in *OrderRecord) (*CommonResponse, error)
|
UpdateOrderRecordByOrderNo func(ctx context.Context, in *OrderRecord) (*CommonResponse, error)
|
||||||
OrderRecordsList func(ctx context.Context, in *OrderRecordsRequest) (*OrderRecordsResponse, error)
|
OrderRecordsList func(ctx context.Context, in *OrderRecordsRequest) (*OrderRecordsResponse, error)
|
||||||
OrderRecordsDetail func(ctx context.Context, in *OrderRecordsDetailRequest) (*OrderRecordsDetailResponse, error)
|
OrderRecordsDetail func(ctx context.Context, in *OrderRecordsDetailRequest) (*OrderRecordsDetailResponse, error)
|
||||||
|
UpdateFinancialConfirmationStatus func(ctx context.Context, in *FinancialConfirmationRequest) (*CommonResponse, error)
|
||||||
CreateValueAddBundle func(ctx context.Context, in *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
|
CreateValueAddBundle func(ctx context.Context, in *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
|
||||||
ValueAddBundleList func(ctx context.Context, in *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
ValueAddBundleList func(ctx context.Context, in *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
||||||
ValueAddBundleDetail func(ctx context.Context, in *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error)
|
ValueAddBundleDetail func(ctx context.Context, in *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error)
|
||||||
@ -136,6 +138,12 @@ func (c *bundleClient) OrderRecordsDetail(ctx context.Context, in *OrderRecordsD
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OrderRecordsDetail", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OrderRecordsDetail", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *bundleClient) UpdateFinancialConfirmationStatus(ctx context.Context, in *FinancialConfirmationRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(CommonResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateFinancialConfirmationStatus", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
func (c *bundleClient) CreateValueAddBundle(ctx context.Context, in *CreateValueAddBundleRequest, opts ...grpc_go.CallOption) (*CreateValueAddBundleResponse, common.ErrorWithAttachment) {
|
func (c *bundleClient) CreateValueAddBundle(ctx context.Context, in *CreateValueAddBundleRequest, opts ...grpc_go.CallOption) (*CreateValueAddBundleResponse, common.ErrorWithAttachment) {
|
||||||
out := new(CreateValueAddBundleResponse)
|
out := new(CreateValueAddBundleResponse)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
@ -168,6 +176,7 @@ type BundleServer interface {
|
|||||||
UpdateOrderRecordByOrderNo(context.Context, *OrderRecord) (*CommonResponse, error)
|
UpdateOrderRecordByOrderNo(context.Context, *OrderRecord) (*CommonResponse, error)
|
||||||
OrderRecordsList(context.Context, *OrderRecordsRequest) (*OrderRecordsResponse, error)
|
OrderRecordsList(context.Context, *OrderRecordsRequest) (*OrderRecordsResponse, error)
|
||||||
OrderRecordsDetail(context.Context, *OrderRecordsDetailRequest) (*OrderRecordsDetailResponse, error)
|
OrderRecordsDetail(context.Context, *OrderRecordsDetailRequest) (*OrderRecordsDetailResponse, error)
|
||||||
|
UpdateFinancialConfirmationStatus(context.Context, *FinancialConfirmationRequest) (*CommonResponse, error)
|
||||||
//增值套餐
|
//增值套餐
|
||||||
CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
|
CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
|
||||||
ValueAddBundleList(context.Context, *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
ValueAddBundleList(context.Context, *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
||||||
@ -210,6 +219,9 @@ func (UnimplementedBundleServer) OrderRecordsList(context.Context, *OrderRecords
|
|||||||
func (UnimplementedBundleServer) OrderRecordsDetail(context.Context, *OrderRecordsDetailRequest) (*OrderRecordsDetailResponse, error) {
|
func (UnimplementedBundleServer) OrderRecordsDetail(context.Context, *OrderRecordsDetailRequest) (*OrderRecordsDetailResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method OrderRecordsDetail not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method OrderRecordsDetail not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedBundleServer) UpdateFinancialConfirmationStatus(context.Context, *FinancialConfirmationRequest) (*CommonResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateFinancialConfirmationStatus not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedBundleServer) CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error) {
|
func (UnimplementedBundleServer) CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method CreateValueAddBundle not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method CreateValueAddBundle not implemented")
|
||||||
}
|
}
|
||||||
@ -537,6 +549,35 @@ func _Bundle_OrderRecordsDetail_Handler(srv interface{}, ctx context.Context, de
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _Bundle_UpdateFinancialConfirmationStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(FinancialConfirmationRequest)
|
||||||
|
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("UpdateFinancialConfirmationStatus", 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_CreateValueAddBundle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
func _Bundle_CreateValueAddBundle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(CreateValueAddBundleRequest)
|
in := new(CreateValueAddBundleRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -671,6 +712,10 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "OrderRecordsDetail",
|
MethodName: "OrderRecordsDetail",
|
||||||
Handler: _Bundle_OrderRecordsDetail_Handler,
|
Handler: _Bundle_OrderRecordsDetail_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "UpdateFinancialConfirmationStatus",
|
||||||
|
Handler: _Bundle_UpdateFinancialConfirmationStatus_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "CreateValueAddBundle",
|
MethodName: "CreateValueAddBundle",
|
||||||
Handler: _Bundle_CreateValueAddBundle_Handler,
|
Handler: _Bundle_CreateValueAddBundle_Handler,
|
||||||
|
Loading…
Reference in New Issue
Block a user