- onWaybillNew中添加调试信息,以查找waybill.duplilcateCount与观察不符的问题

This commit is contained in:
gazebo
2019-04-21 20:13:31 +08:00
parent 2438670f61
commit d2c1a4e9d7

View File

@@ -46,15 +46,23 @@ func (w *OrderManager) onWaybillNew(bill2 *model.Waybill, db *dao.DaoDB) (isDupl
if !created {
bill.DuplicatedCount++
if bill2.VendorOrderID == bill2.VendorWaybillID { // 购物平台(比如京东)重新建的运单,单号始终是与订单相同的
globals.SugarLogger.Infof("onWaybillNew duplicated1, DuplicatedCount:%d, bill:%v msg received", bill2.DuplicatedCount, bill2)
bill2.ID = bill.ID
bill2.DuplicatedCount = bill.DuplicatedCount
db.Db.Update(bill2) //更新所有字段
err = utils.CallFuncLogError(func() error {
_, err = db.Db.Update(bill2) //更新所有字段
return err
}, "onWaybillNew Update1")
} else {
db.Db.Update(bill, "DuplicatedCount")
globals.SugarLogger.Infof("onWaybillNew duplicated2 DuplicatedCount:%d, bill:%v msg received", bill.DuplicatedCount, bill2)
isDuplicated = true
globals.SugarLogger.Infof("onWaybillNew duplicated bill:%v msg received", bill2)
err = utils.CallFuncLogError(func() error {
_, err = db.Db.Update(bill, "DuplicatedCount")
return err
}, "onWaybillNew Update2")
}
} else {
globals.SugarLogger.Debugf("onWaybillNew created bill:%v", bill2)
*bill2 = *bill
}
} else {