1
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user