Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
868c51ddcf | |||
a515beee31 | |||
3729649c99 | |||
28aa556f39 | |||
bb8264e155 | |||
e2ed03be90 | |||
6d6bee6c03 | |||
4290d78804 | |||
44a4ae8b7f | |||
34365d25bd | |||
d14aa14601 |
File diff suppressed because one or more lines are too long
2
clear.sh
Normal file
2
clear.sh
Normal file
@ -0,0 +1,2 @@
|
||||
ls pb/bundle/*.pb.go | xargs -n1 -IX bash -c 'sed s/,omitempty// X > X.tmp && mv X{.tmp,}';
|
||||
|
@ -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) {
|
||||
return logic.ValueAddBundleDetail(req)
|
||||
}
|
||||
|
||||
// 财务确认
|
||||
func (b *BundleProvider) UpdateFinancialConfirmationStatus(_ context.Context, req *bundle.FinancialConfirmationRequest) (res *bundle.CommonResponse, err error) {
|
||||
return logic.UpdateFinancialConfirmationStatus(req)
|
||||
}
|
||||
|
@ -72,6 +72,8 @@ func OrderRecordsList(req *bundle.OrderRecordsRequest) (res *bundle.OrderRecords
|
||||
|
||||
query := app.ModuleClients.BundleDB.Model(&model.BundleOrderRecords{})
|
||||
|
||||
query.Joins("left join `micro-account`.`user` on `micro-account`.`user`.`id` = `bundle_order_records`.`customer_id`")
|
||||
|
||||
if req.CustomerID != "" {
|
||||
query = query.Where("customer_id = ?", req.CustomerID)
|
||||
}
|
||||
@ -97,7 +99,7 @@ func OrderRecordsList(req *bundle.OrderRecordsRequest) (res *bundle.OrderRecords
|
||||
}
|
||||
|
||||
if req.Status != 0 {
|
||||
query = query.Where("status = ?", req.Status)
|
||||
query = query.Where("`bundle_order_records`.status = ?", req.Status)
|
||||
}
|
||||
|
||||
if req.StartSignedTime != "" {
|
||||
@ -122,6 +124,14 @@ func OrderRecordsList(req *bundle.OrderRecordsRequest) (res *bundle.OrderRecords
|
||||
query = query.Where("IFNULL(value_add_bundle_uuid,'') = ''")
|
||||
}
|
||||
|
||||
if req.FinancialConfirmation != 0 {
|
||||
query = query.Where("financial_confirmation = ?", req.FinancialConfirmation)
|
||||
}
|
||||
|
||||
if req.TelNum != "" {
|
||||
query = query.Where("`micro-account`.`user`.`tel_num` like ?", "%"+req.TelNum+"%")
|
||||
}
|
||||
|
||||
count := *query
|
||||
|
||||
if req.PageSize != 0 && req.Page != 0 {
|
||||
@ -165,6 +175,7 @@ func OrderRecordsList(req *bundle.OrderRecordsRequest) (res *bundle.OrderRecords
|
||||
Num: record.Num,
|
||||
BundleCommonUid: record.BundleCommonUid,
|
||||
AddBundleCommonUid: record.AddBundleCommonUid,
|
||||
FinancialConfirmation: record.FinancialConfirmation,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@ func CreateOrderRecord(req *bundle.OrderRecord) (res *bundle.CommonResponse, err
|
||||
orderRecord.OrderNo = utils.GetOrderNo()
|
||||
orderRecord.BundleUUID = req.BundleUuid
|
||||
orderRecord.ValueAddBundleUUID = req.ValueAddBundleUuid
|
||||
orderRecord.FinancialConfirmation = model.ConfirmationNotConfirmed
|
||||
|
||||
res, err = dao.CreateOrderRecord(orderRecord)
|
||||
return
|
||||
@ -58,3 +59,14 @@ func OrderRecordsDetail(req *bundle.OrderRecordsDetailRequest) (res *bundle.Orde
|
||||
}
|
||||
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:合同编号"`
|
||||
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"`
|
||||
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 OrderRecordsList(OrderRecordsRequest) returns (OrderRecordsResponse) {}
|
||||
rpc OrderRecordsDetail(OrderRecordsDetailRequest) returns (OrderRecordsDetailResponse) {}
|
||||
rpc UpdateFinancialConfirmationStatus(FinancialConfirmationRequest) returns (CommonResponse) {}
|
||||
|
||||
//增值套餐
|
||||
rpc CreateValueAddBundle(CreateValueAddBundleRequest) returns (CreateValueAddBundleResponse) {}
|
||||
@ -107,6 +108,8 @@ message OrderRecord {
|
||||
string groupPhoto = 30 [json_name = "groupPhoto"];
|
||||
string bundleCommonUid = 31 [json_name = "bundleCommonUid"];
|
||||
string addBundleCommonUid = 32 [json_name = "addBundleCommonUid"];
|
||||
int32 financialConfirmation = 33 [json_name = "financialConfirmation"];
|
||||
string telNum = 34 [json_name = "telNum"];
|
||||
}
|
||||
|
||||
message OrderRecordsRequest {
|
||||
@ -124,6 +127,8 @@ message OrderRecordsRequest {
|
||||
string endPayTime = 12 [json_name = "endPayTime"];
|
||||
string customerID = 13 [json_name = "customerID"];
|
||||
int64 isHaveValueAdd = 14 [json_name = "isHaveValueAdd"];//有无增值选项
|
||||
int32 financialConfirmation = 15 [json_name = "financialConfirmation"];
|
||||
string telNum = 16 [json_name = "telNum"];
|
||||
}
|
||||
|
||||
message OrderRecordsResponse {
|
||||
@ -195,4 +200,8 @@ message ValueAddBundleDetailResponse {
|
||||
ValueAddBundleProfile data = 1 [json_name = "data"];
|
||||
string payTime = 2 [json_name = "payTime"];
|
||||
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
|
||||
}
|
||||
func (this *FinancialConfirmationRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-triple v1.0.5
|
||||
// - protoc v3.21.8
|
||||
// - protoc-gen-go-triple v1.0.8
|
||||
// - protoc v3.10.1
|
||||
// source: pb/bundle.proto
|
||||
|
||||
package bundle
|
||||
@ -38,7 +38,8 @@ type BundleClient interface {
|
||||
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)
|
||||
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)
|
||||
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)
|
||||
@ -49,19 +50,20 @@ type bundleClient struct {
|
||||
}
|
||||
|
||||
type BundleClientImpl struct {
|
||||
CreateBundle func(ctx context.Context, in *BundleProfile) (*CommonResponse, error)
|
||||
UpdateBundle func(ctx context.Context, in *BundleProfile) (*CommonResponse, error)
|
||||
DeleteBundle func(ctx context.Context, in *DelBundleRequest) (*CommonResponse, error)
|
||||
BundleList func(ctx context.Context, in *BundleListRequest) (*BundleListResponse, error)
|
||||
BundleDetail func(ctx context.Context, in *BundleDetailRequest) (*BundleDetailResponse, error)
|
||||
CreateOrderRecord func(ctx context.Context, in *OrderRecord) (*CommonResponse, error)
|
||||
UpdateOrderRecord 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)
|
||||
OrderRecordsDetail func(ctx context.Context, in *OrderRecordsDetailRequest) (*OrderRecordsDetailResponse, error)
|
||||
CreateValueAddBundle func(ctx context.Context, in *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
|
||||
ValueAddBundleList func(ctx context.Context, in *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
||||
ValueAddBundleDetail func(ctx context.Context, in *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error)
|
||||
CreateBundle func(ctx context.Context, in *BundleProfile) (*CommonResponse, error)
|
||||
UpdateBundle func(ctx context.Context, in *BundleProfile) (*CommonResponse, error)
|
||||
DeleteBundle func(ctx context.Context, in *DelBundleRequest) (*CommonResponse, error)
|
||||
BundleList func(ctx context.Context, in *BundleListRequest) (*BundleListResponse, error)
|
||||
BundleDetail func(ctx context.Context, in *BundleDetailRequest) (*BundleDetailResponse, error)
|
||||
CreateOrderRecord func(ctx context.Context, in *OrderRecord) (*CommonResponse, error)
|
||||
UpdateOrderRecord 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)
|
||||
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)
|
||||
ValueAddBundleList func(ctx context.Context, in *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
||||
ValueAddBundleDetail func(ctx context.Context, in *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error)
|
||||
}
|
||||
|
||||
func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient {
|
||||
@ -136,6 +138,12 @@ func (c *bundleClient) OrderRecordsDetail(ctx context.Context, in *OrderRecordsD
|
||||
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) {
|
||||
out := new(CreateValueAddBundleResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
@ -168,7 +176,8 @@ type BundleServer interface {
|
||||
UpdateOrderRecordByOrderNo(context.Context, *OrderRecord) (*CommonResponse, error)
|
||||
OrderRecordsList(context.Context, *OrderRecordsRequest) (*OrderRecordsResponse, error)
|
||||
OrderRecordsDetail(context.Context, *OrderRecordsDetailRequest) (*OrderRecordsDetailResponse, error)
|
||||
// 增值套餐
|
||||
UpdateFinancialConfirmationStatus(context.Context, *FinancialConfirmationRequest) (*CommonResponse, error)
|
||||
//增值套餐
|
||||
CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
|
||||
ValueAddBundleList(context.Context, *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
||||
ValueAddBundleDetail(context.Context, *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error)
|
||||
@ -210,6 +219,9 @@ func (UnimplementedBundleServer) OrderRecordsList(context.Context, *OrderRecords
|
||||
func (UnimplementedBundleServer) OrderRecordsDetail(context.Context, *OrderRecordsDetailRequest) (*OrderRecordsDetailResponse, error) {
|
||||
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) {
|
||||
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)
|
||||
}
|
||||
|
||||
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) {
|
||||
in := new(CreateValueAddBundleRequest)
|
||||
if err := dec(in); err != nil {
|
||||
@ -671,6 +712,10 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
||||
MethodName: "OrderRecordsDetail",
|
||||
Handler: _Bundle_OrderRecordsDetail_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateFinancialConfirmationStatus",
|
||||
Handler: _Bundle_UpdateFinancialConfirmationStatus_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateValueAddBundle",
|
||||
Handler: _Bundle_CreateValueAddBundle_Handler,
|
||||
|
Loading…
Reference in New Issue
Block a user