This commit is contained in:
邹宗楠
2025-10-23 16:35:49 +08:00
parent 297bdd950d
commit 53fca43bec
2 changed files with 8 additions and 9 deletions

View File

@@ -8,10 +8,9 @@ import (
"time"
)
func GetInvoiceInfo(db *DaoDB, vendorOrderId string) (*model.InvoiceMsg, error) {
data := &model.InvoiceMsg{}
func GetInvoiceInfo(db *DaoDB, vendorOrderId string) (data *model.InvoiceMsg, err error) {
sql := ` SELECT * FROM invoice_msg WHERE order_id = ? OR remark LIKE ?`
err := GetRow(db, data, sql, []interface{}{vendorOrderId, "%" + fmt.Sprintf("%s", vendorOrderId) + "%"}...)
err = GetRow(db, &data, sql, []interface{}{vendorOrderId, "%" + fmt.Sprintf("%s", vendorOrderId) + "%"}...)
return data, err
}

View File

@@ -169,15 +169,15 @@ func pushIMToGyOrPet(msg *mtwmapi.ImCallbackMsg, serverType string) {
func InvoiceCallback(invoice *mtwmapi.InvoiceCallback) (err error) {
var db = dao.GetDB()
localOrder, _ := partner.CurOrderManager.LoadOrder(invoice.OrderId, model.VendorIDMTWM)
if localOrder == nil {
return fmt.Errorf("订单不存在:%s", invoice.OrderId)
}
//if localOrder == nil {
// return fmt.Errorf("订单不存在:%s", invoice.OrderId)
//}
invoiceData, _ := dao.GetInvoiceInfo(db, invoice.OrderId)
if invoiceData == nil {
invoiceObj := model.InvoiceMsg{
ModelIDCUL: model.ModelIDCUL{},
OrderId: invoice.OrderId,
StoreID: localOrder.JxStoreID,
ModelIDCUL: model.ModelIDCUL{},
OrderId: invoice.OrderId,
//StoreID: localOrder.JxStoreID,
VendorID: model.VendorIDMTWM,
Status: model.InvoiceStatusInit,
InvoiceTaskId: invoice.InvoiceTaskId,