Compare commits

..

No commits in common. "main" and "feat-zjy-issue-013" have entirely different histories.

8 changed files with 3911 additions and 1939 deletions

View File

@ -1,4 +1,2 @@
protoc --proto_path=. --go_out=./pb --go-triple_out=./pb --govalidators_out=./pb ./pb/bundle.proto
ls pb/bundle/*.pb.go | xargs -n1 -IX bash -c 'sed s/,omitempty// X > X.tmp && mv X{.tmp,}';

2
go.mod
View File

@ -1,6 +1,6 @@
module micro-bundle
go 1.23.3
go 1.18
require (
dubbo.apache.org/dubbo-go/v3 v3.0.2

View File

@ -505,17 +505,10 @@ func OrderRecordsListV2(req *bundle.OrderRecordsRequestV2) (res *bundle.OrderRec
for _, sub := range record.BundleOrderValueAdd {
orderAddNo := sub.OrderNo
amount := float32(sub.Amount)
if existing, ok := addMap[orderAddNo]; ok {
existing.Amount += amount
// 仅当 VideoNum 尚未设置且当前是 ServiceType == 1 时赋值
if existing.VideoNum == 0 && sub.ServiceType == 1 {
existing.VideoNum = sub.Num
}
} else {
var videoNum int32
if sub.ServiceType == 1 {
videoNum = sub.Num
}
addMap[orderAddNo] = &bundle.OrderAddBundleRecordInfo{
OrderAddNo: orderAddNo,
Amount: amount,
@ -527,7 +520,6 @@ func OrderRecordsListV2(req *bundle.OrderRecordsRequestV2) (res *bundle.OrderRec
Snapshot: sub.Snapshot,
CheckoutSessionId: sub.CheckoutSessionId,
CustomerID: sub.CustomerID,
VideoNum: videoNum,
}
}
}
@ -671,7 +663,6 @@ func CreateReconciliation(req *bundle.ReconciliationInfo) (res *bundle.CommonRes
PayStatus: int(req.PayStatus),
SerialNumber: req.SerialNumber,
CreationTime: time.Now().Format("2006-01-02 15:04:05"),
HandlingFee: req.HandlingFee,
}
// 创建记录
@ -702,7 +693,6 @@ func UpdateReconciliation(req *bundle.ReconciliationInfo) (res *bundle.CommonRes
PayTime: req.PayTime,
PayStatus: int(req.PayStatus),
SerialNumber: req.SerialNumber,
HandlingFee: req.HandlingFee,
}
if err := app.ModuleClients.BundleDB.Model(&existing).Updates(updates).Error; err != nil {
return nil, fmt.Errorf("更新对账单失败: %v", err)

View File

@ -116,7 +116,6 @@ type BundleExtendRecordItemPo struct {
OperatorName string
OperatorPhoneNumber string
AssociatedOrderNumber string `gorm:"column:associated_order_number;type:varchar(256);comment:关联订单号" json:"associatedOrderNumber"`
TimeUnit uint `gorm:"column:time_unit;type:int(11) unsigned;comment:时间单位" json:"timeUnit"`
OrderUUID string
CreatedAt time.Time
}

View File

@ -17,5 +17,4 @@ type Reconciliation struct {
PayStatus int `gorm:"column:pay_status;comment:支付状态" json:"payStatus"`
SerialNumber string `gorm:"column:serial_number;comment:流水号" json:"serialNumber"`
CreationTime string `gorm:"column:creation_time;comment:创建时间" json:"creationTime"`
HandlingFee string `gorm:"column:handling_fee;comment:手续费" json:"handlingFee"`
}

View File

@ -120,8 +120,6 @@ message ReconciliationInfo{
int32 payStatus = 12;
string serialNumber = 13;
uint64 userID = 14;
string handlingFee = 15;
string subNum = 16;
}
message OrderInfoByOrderNoRequest{
string orderNo = 1;
@ -208,7 +206,6 @@ message OrderBundleRecordInfo{
repeated OrderAddBundleRecordInfo addBundleInfo = 8;
int64 customerId = 9;
string payTime = 10;
string subNum = 11;
}
message OrderAddBundleRecordInfo{
string orderAddNo = 1;
@ -223,7 +220,6 @@ message OrderAddBundleRecordInfo{
string snapshot = 10;
string CheckoutSessionId = 11;
string CustomerID = 12;
int32 videoNum = 13;
}
message PackagePriceAndTimeResponse{
float price = 1 [json_name = "price"];
@ -613,9 +609,8 @@ message BundleExtendRecordItem{
uint64 createdAt = 9;
string remark = 10;
string associatedOrderNumber = 11;
uint32 timeUnit = 12;
string operatorName = 13;
string operatorPhoneNumber = 14;
string operatorName = 12;
string operatorPhoneNumber = 13;
}
message GetBundleBalanceListReq{

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
// versions:
// - protoc-gen-go-triple v1.0.5
// - protoc v6.32.0
// - protoc-gen-go-triple v1.0.8
// - protoc v4.24.0--rc1
// source: pb/bundle.proto
package bundle
@ -50,11 +50,11 @@ type BundleClient interface {
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)
OnlyAddValueListByOrderNo(ctx context.Context, in *OnlyAddValueListByOrderNoRequest, opts ...grpc_go.CallOption) (*OnlyAddValueListByOrderNoResp, 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)
@ -75,7 +75,7 @@ type BundleClient interface {
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)
ConfirmWork(ctx context.Context, in *ConfirmWorkReq, opts ...grpc_go.CallOption) (*ConfirmWorkResp, 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)
@ -473,11 +473,11 @@ type BundleServer interface {
OrderRecordsListV2(context.Context, *OrderRecordsRequestV2) (*OrderRecordsResponseV2, error)
OrderListByOrderNo(context.Context, *OrderInfoByOrderNoRequest) (*OrderInfoByOrderNoResp, error)
OnlyAddValueListByOrderNo(context.Context, *OnlyAddValueListByOrderNoRequest) (*OnlyAddValueListByOrderNoResp, 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)
@ -498,7 +498,7 @@ type BundleServer interface {
GetVedioWorkDetail(context.Context, *GetVedioWorkDetailReq) (*GetVedioeWorkDetailResp, error)
ToBeComfirmedWorks(context.Context, *ToBeComfirmedWorksReq) (*ToBeComfirmedWorksResp, error)
ConfirmWork(context.Context, *ConfirmWorkReq) (*ConfirmWorkResp, error)
// 对账单
//对账单
GetReconciliationList(context.Context, *GetReconciliationListReq) (*GetReconciliationListResp, error)
CreateReconciliation(context.Context, *ReconciliationInfo) (*CommonResponse, error)
UpdateReconciliation(context.Context, *ReconciliationInfo) (*CommonResponse, error)