+ AcceptOrRefuseFailedGetOrder

+ CallPMCourier
+ ConfirmReceiveGoods
This commit is contained in:
gazebo
2019-04-22 17:59:55 +08:00
parent 4aca943156
commit f1e900dbd5
14 changed files with 271 additions and 38 deletions

View File

@@ -11,6 +11,15 @@ import (
"github.com/astaxie/beego/orm"
)
var (
waybillOrderStatusMap = map[int]int{
model.WaybillStatusApplyFailedGetGoods: model.WaybillStatusApplyFailedGetGoods,
model.WaybillStatusAgreeFailedGetGoods: model.WaybillStatusAgreeFailedGetGoods,
model.WaybillStatusRefuseFailedGetGoods: model.WaybillStatusRefuseFailedGetGoods,
model.WaybillStatusDeliverFailed: model.WaybillStatusDeliverFailed,
}
)
func (w *OrderManager) LoadPendingWaybills() []*model.Waybill {
db := orm.NewOrm()
var bills []*model.Waybill
@@ -108,6 +117,22 @@ func (w *OrderManager) OnWaybillStatusChanged(bill *model.Waybill) (err error) {
} else {
dao.Rollback(db)
}
if bill.VendorOrderID == bill.VendorWaybillID {
if status, ok := waybillOrderStatusMap[bill.Status]; ok {
fakeOrderStatus := &model.OrderStatus{
VendorOrderID: bill.VendorOrderID,
VendorID: bill.OrderVendorID,
OrderType: model.OrderTypeOrder,
RefVendorOrderID: bill.VendorOrderID,
RefVendorID: bill.OrderVendorID,
Status: status,
VendorStatus: bill.VendorStatus,
StatusTime: bill.StatusTime,
Remark: bill.Remark,
}
w.OnOrderStatusChanged(fakeOrderStatus)
}
}
return err
}