Updata:解决冲突

This commit is contained in:
jiaji.H 2026-02-02 13:42:44 +08:00
commit 6b1f03a42a
7 changed files with 880 additions and 983 deletions

View File

View File

@ -24,7 +24,7 @@ func CreatePaperInvoiceAddress(req *bundle.CreatePaperInvoiceAddressReq) (res *b
//更新主表状态 //更新主表状态
err = app.ModuleClients.BundleDB.Model(&model.Invoice{}).Where("order_no = ?", req.OrderNo).Updates( err = app.ModuleClients.BundleDB.Model(&model.Invoice{}).Where("order_no = ?", req.OrderNo).Updates(
&map[string]interface{}{ &map[string]interface{}{
"paper_invocie_status": 1, "paper_invocie_status": 2,
}).Error }).Error
if err != nil { if err != nil {
return nil, err return nil, err
@ -52,8 +52,15 @@ func GetInvoiceList(req *bundle.GetInvoiceListReq) (data []*model.InvoiceInfo, t
Joins("LEFT JOIN `micro-account`.`user` AS user ON invoice.user_id = user.id and user.deleted_at = 0"). Joins("LEFT JOIN `micro-account`.`user` AS user ON invoice.user_id = user.id and user.deleted_at = 0").
Joins("LEFT JOIN `micro-account`.real_name AS rn ON user.real_name_id = rn.id and rn.deleted_at = 0") Joins("LEFT JOIN `micro-account`.real_name AS rn ON user.real_name_id = rn.id and rn.deleted_at = 0")
if req.PaperInvocieStatus != "" { if req.IsExpress != 0 {
query = query.Where("invoice.paper_invocie_status = ?", req.PaperInvocieStatus) query = query.Where("invoice.paper_invocie_status = ?", req.IsExpress)
} else {
if req.IsApplyInvocice == 2 {
query = query.Where("invoice.paper_invocie_status >= ?", req.IsApplyInvocice)
} else if req.IsApplyInvocice == 1 {
query = query.Where("invoice.paper_invocie_status = ?", req.IsApplyInvocice)
} else {
}
} }
if req.ApplyTimeStart != "" { if req.ApplyTimeStart != "" {
// 使用 COALESCE 后的 apply_time 进行筛选 // 使用 COALESCE 后的 apply_time 进行筛选
@ -100,7 +107,7 @@ func UpdateInvoiceExpressInfo(req *bundle.UpdateInvoiceExpressInfoReq) (res *bun
//更新主表状态 //更新主表状态
err = app.ModuleClients.BundleDB.Model(&model.Invoice{}).Where("order_no = ?", req.OrderNo).Updates( err = app.ModuleClients.BundleDB.Model(&model.Invoice{}).Where("order_no = ?", req.OrderNo).Updates(
&map[string]interface{}{ &map[string]interface{}{
"paper_invocie_status": 2, "paper_invocie_status": 3,
}).Error }).Error
if err != nil { if err != nil {
return nil, err return nil, err
@ -148,6 +155,7 @@ func GetInvoiceInfoByOrderNo(req *bundle.GetInvoiceInfoByOrderNoReq) (data []*mo
invoice.invoice_no AS invoice_no, invoice.invoice_no AS invoice_no,
invoice.invoice_url AS invoice_url, invoice.invoice_url AS invoice_url,
bor.bundle_name AS bundle_name, bor.bundle_name AS bundle_name,
bor.amount_type AS amount_type,
bor.total_amount AS total_amount, bor.total_amount AS total_amount,
bor.pay_time AS pay_time, bor.pay_time AS pay_time,
invoice.paper_invocie_status AS paper_invocie_status invoice.paper_invocie_status AS paper_invocie_status

View File

@ -80,7 +80,7 @@ func GetOrderInfoByOrderNo(req *bundle.GetOrderInfoByOrderNoReq) (*bundle.GetOrd
UserNum: orderRecord.UserNum, UserNum: orderRecord.UserNum,
TotalAmount: strconv.FormatFloat(float64(orderRecord.TotalAmount), 'f', -1, 64), TotalAmount: strconv.FormatFloat(float64(orderRecord.TotalAmount), 'f', -1, 64),
BundleName: orderRecord.BundleName, BundleName: orderRecord.BundleName,
AmountType: strconv.FormatInt(orderRecord.AmountType, 10), AmountType: orderRecord.AmountType,
Address: orderRecord.Address, Address: orderRecord.Address,
Phone: orderRecord.Phone, Phone: orderRecord.Phone,
} }
@ -98,9 +98,10 @@ func GetInvoiceInfoByOrderNo(req *bundle.GetInvoiceInfoByOrderNoReq) (*bundle.Ge
InvoiceNo: m.InvoiceNo, InvoiceNo: m.InvoiceNo,
InvoiceUrl: m.InvoiceUrl, InvoiceUrl: m.InvoiceUrl,
BundleName: m.BundleName, BundleName: m.BundleName,
AmountType: m.AmountType,
TotalAmount: strconv.FormatFloat(float64(m.TotalAmount), 'f', -1, 64), TotalAmount: strconv.FormatFloat(float64(m.TotalAmount), 'f', -1, 64),
PayTime: m.PayTime.Format("2006-01-02 15:04:05"), PayTime: m.PayTime.Format("2006-01-02 15:04:05"),
PaperInvocieStatus: strconv.FormatInt(int64(m.PaperInvocieStatus), 10), PaperInvocieStatus: m.PaperInvocieStatus,
} }
}) })
return res, nil return res, nil

View File

@ -20,7 +20,7 @@ type Invoice struct {
InvoiceType int `gorm:"column:invoice_type;comment:发票类型"` InvoiceType int `gorm:"column:invoice_type;comment:发票类型"`
InvoiceNo string `gorm:"column:invoice_no;comment:发票编号"` InvoiceNo string `gorm:"column:invoice_no;comment:发票编号"`
InvoiceUrl string `gorm:"column:invoice_url;comment:发票URL"` InvoiceUrl string `gorm:"column:invoice_url;comment:发票URL"`
PaperInvocieStatus int `gorm:"column:paper_invocie_status;default:0;comment:纸质发票状态0未申请 1已申请 2已邮寄"` PaperInvocieStatus int `gorm:"column:paper_invocie_status;default:1;comment:纸质发票状态1未申请 2已申请 3已邮寄"`
Remark string `gorm:"column:remark;comment:备注"` Remark string `gorm:"column:remark;comment:备注"`
} }
@ -63,7 +63,7 @@ type InvoiceInfo struct {
OrderNo string `gorm:"column:order_no;comment:订单编号"` OrderNo string `gorm:"column:order_no;comment:订单编号"`
InvoiceNo string `gorm:"column:invoice_no;comment:发票编号"` InvoiceNo string `gorm:"column:invoice_no;comment:发票编号"`
InvoiceUrl string `gorm:"column:invoice_url;comment:发票URL"` InvoiceUrl string `gorm:"column:invoice_url;comment:发票URL"`
PaperInvocieStatus string `gorm:"column:paper_invocie_status;comment:纸质发票状态"` PaperInvocieStatus int64 `gorm:"column:paper_invocie_status;comment:纸质发票状态"`
} }
type InvoiceOrderInfo struct { type InvoiceOrderInfo struct {
@ -82,7 +82,8 @@ type InvoiceInfoByOrderNo struct {
InvoiceNo string `gorm:"column:invoice_no;comment:发票编号"` InvoiceNo string `gorm:"column:invoice_no;comment:发票编号"`
InvoiceUrl string `gorm:"column:invoice_url;comment:发票URL"` InvoiceUrl string `gorm:"column:invoice_url;comment:发票URL"`
BundleName string `gorm:"column:bundle_name;comment:套餐名称"` BundleName string `gorm:"column:bundle_name;comment:套餐名称"`
AmountType int64 `gorm:"column:amount_type;comment:金额类型 1:人民币 2:美元"`
TotalAmount float32 `gorm:"column:total_amount;comment:总金额"` TotalAmount float32 `gorm:"column:total_amount;comment:总金额"`
PayTime time.Time `gorm:"column:pay_time;comment:支付时间"` PayTime time.Time `gorm:"column:pay_time;comment:支付时间"`
PaperInvocieStatus int `gorm:"column:paper_invocie_status;comment:纸质发票状态"` PaperInvocieStatus int64 `gorm:"column:paper_invocie_status;comment:纸质发票状态 1:未申请 2:已申请 3:已邮寄"`
} }

View File

@ -2166,15 +2166,6 @@ message CreatePaperInvoiceAddressReq{
message CreatePaperInvoiceAddressResp{ message CreatePaperInvoiceAddressResp{
} }
message InvoiceLimit{
string paperInvocieStatus = 1;
string applyTimeStart = 2;
string applyTimeEnd = 3;
string name = 4;
string phone = 5;
string country = 6;
string userName = 7;
}
message InvoiceInfo{ message InvoiceInfo{
string name = 1; string name = 1;
@ -2187,19 +2178,20 @@ message InvoiceInfo{
string orderNo = 8; string orderNo = 8;
string invoiceNo = 9; string invoiceNo = 9;
string invoiceUrl = 10; string invoiceUrl = 10;
string paperInvocieStatus = 11; int64 paperInvocieStatus = 11;
} }
message GetInvoiceListReq{ message GetInvoiceListReq{
int64 size = 1; int64 size = 1;
int64 page = 2; int64 page = 2;
string paperInvocieStatus = 3; int64 isApplyInvocice = 3;
string applyTimeStart = 4; int64 isExpress = 4;
string applyTimeEnd = 5; string applyTimeStart = 5;
string name = 6; string applyTimeEnd = 6;
string phone = 7; string name = 7;
string country = 8; string phone = 8;
string userName = 9; string country = 9;
string userName = 10;
} }
message GetInvoiceListResp{ message GetInvoiceListResp{
@ -2239,7 +2231,7 @@ message GetOrderInfoByOrderNoResp{
string userNum = 3; string userNum = 3;
string totalAmount = 4; string totalAmount = 4;
string bundleName = 5; string bundleName = 5;
string AmountType = 6; int64 AmountType = 6;
string address = 7; string address = 7;
string phone = 8; string phone = 8;
} }
@ -2274,9 +2266,10 @@ message InvoiceInfoByOrderNo{
string invoiceNo = 1; string invoiceNo = 1;
string invoiceUrl = 2; string invoiceUrl = 2;
string bundleName = 3; string bundleName = 3;
string totalAmount = 4; int64 amountType = 4;
string payTime = 5; string totalAmount = 5;
string paperInvocieStatus = 6; string payTime = 6;
int64 paperInvocieStatus = 7;
} }
message GetInvoiceInfoByOrderNoResp{ message GetInvoiceInfoByOrderNoResp{

File diff suppressed because it is too large Load Diff

View File

@ -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"
) )
@ -999,9 +999,6 @@ func (this *CreatePaperInvoiceAddressReq) Validate() error {
func (this *CreatePaperInvoiceAddressResp) Validate() error { func (this *CreatePaperInvoiceAddressResp) Validate() error {
return nil return nil
} }
func (this *InvoiceLimit) Validate() error {
return nil
}
func (this *InvoiceInfo) Validate() error { func (this *InvoiceInfo) Validate() error {
return nil return nil
} }