- bug fix.

This commit is contained in:
gazebo
2018-07-19 12:18:36 +08:00
parent bbed659c04
commit 3098740dce
6 changed files with 104 additions and 74 deletions

View File

@@ -130,7 +130,6 @@ func (c *OrderController) getOrderInfo(orderID string) (order *model.GoodsOrder,
order = &model.GoodsOrder{
VendorOrderID: orderID,
VendorID: model.VendorIDELM,
WaybillVendorID: model.VendorIDELM,
VendorStoreID: utils.Int64ToStr(utils.MustInterface2Int64(result["shopId"])),
StoreID: int(utils.Str2Int64WithDefault(utils.Interface2String(result["openId"]), 0)),
StoreName: result["shopName"].(string),

View File

@@ -68,7 +68,6 @@ func (c *OrderController) getOrderInfo(msg *jdapi.CallbackOrderMsg) (order *mode
order = &model.GoodsOrder{
VendorOrderID: msg.BillID,
VendorID: model.VendorIDJD,
WaybillVendorID: model.VendorIDJD,
VendorStoreID: result["produceStationNo"].(string),
StoreID: int(utils.Str2Int64WithDefault(utils.Interface2String(result["produceStationNoIsv"]), 0)),
StoreName: result["produceStationName"].(string),

View File

@@ -76,7 +76,7 @@ func (c *OrderController) saveOrder(order *model.GoodsOrder, isAdjust bool, db o
c.updateOrderOtherInfo(order, db)
db.Begin()
// globals.SugarLogger.Debugf("new order:%v", order)
// order.WaybillVendorID = model.VendorIDUnknown
order.WaybillVendorID = model.VendorIDUnknown
order.OrderFinishedAt = utils.DefaultTimeValue
order.ID = 0
created, _, err2 := db.ReadOrCreate(order, "VendorOrderID", "VendorID")
@@ -235,6 +235,10 @@ func (c *OrderController) UpdateWaybillVendorID(bill *model.Waybill) (err error)
params := orm.Params{
"waybill_vendor_id": bill.WaybillVendorID,
}
// 如果运单被取消,则要保持在已拣货状态
if bill.WaybillVendorID == model.VendorIDUnknown {
params["status"] = model.OrderStatusFinishedPickup
}
utils.CallFuncLogError(func() error {
_, err = db.QueryTable("goods_order").Filter("vendor_order_id", bill.VendorOrderID).Filter("vendor_id", bill.OrderVendorID).Update(params)
return err