Compare commits

...

9 Commits

Author SHA1 Message Date
2edf4b82ae 修改 2025-07-16 19:01:04 +08:00
145486aec2 修改 2025-07-16 18:18:24 +08:00
b149446170 修改 2025-07-16 17:52:50 +08:00
24102eccbd 11 2025-07-08 16:16:04 +08:00
383a64077d 添加手续费 2025-07-08 16:12:16 +08:00
68dd832b32 fix: 处理pb冲突 2025-07-08 15:21:20 +08:00
346dcb1d94 Merge branch 'feat-zjy-issue-013' into main
# Conflicts:
#	pb/bundle/bundle.pb.go
2025-07-08 15:20:34 +08:00
lzh
841ec173c4 Merge branch 'dev-lzh' 2025-07-07 11:58:32 +08:00
lzh
87b7805c42 添加扩展记录的时间单位 2025-07-07 10:46:13 +08:00
5 changed files with 1482 additions and 1437 deletions

View File

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

View File

@ -116,6 +116,7 @@ type BundleExtendRecordItemPo struct {
OperatorName string OperatorName string
OperatorPhoneNumber string OperatorPhoneNumber string
AssociatedOrderNumber string `gorm:"column:associated_order_number;type:varchar(256);comment:关联订单号" json:"associatedOrderNumber"` 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 OrderUUID string
CreatedAt time.Time CreatedAt time.Time
} }

View File

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

View File

@ -120,6 +120,7 @@ message ReconciliationInfo{
int32 payStatus = 12; int32 payStatus = 12;
string serialNumber = 13; string serialNumber = 13;
uint64 userID = 14; uint64 userID = 14;
string handlingFee = 15;
} }
message OrderInfoByOrderNoRequest{ message OrderInfoByOrderNoRequest{
string orderNo = 1; string orderNo = 1;
@ -220,6 +221,7 @@ message OrderAddBundleRecordInfo{
string snapshot = 10; string snapshot = 10;
string CheckoutSessionId = 11; string CheckoutSessionId = 11;
string CustomerID = 12; string CustomerID = 12;
int32 videoNum = 13;
} }
message PackagePriceAndTimeResponse{ message PackagePriceAndTimeResponse{
float price = 1 [json_name = "price"]; float price = 1 [json_name = "price"];
@ -609,8 +611,9 @@ message BundleExtendRecordItem{
uint64 createdAt = 9; uint64 createdAt = 9;
string remark = 10; string remark = 10;
string associatedOrderNumber = 11; string associatedOrderNumber = 11;
string operatorName = 12; uint32 timeUnit = 12;
string operatorPhoneNumber = 13; string operatorName = 13;
string operatorPhoneNumber = 14;
} }
message GetBundleBalanceListReq{ message GetBundleBalanceListReq{

File diff suppressed because it is too large Load Diff