|
|
|
|
@@ -1728,10 +1728,10 @@ func RefreshAllMatterOrderStatus(ctx *jxcontext.Context) (err error) {
|
|
|
|
|
}
|
|
|
|
|
if len(queryOrderStatus.OrderStatusList) > 0 {
|
|
|
|
|
if queryOrderStatus.OrderStatusList[len(queryOrderStatus.OrderStatusList)-1].SoStatusCode == jdeclpapi.SoStatusCode10034 {
|
|
|
|
|
dao.Begin(db)
|
|
|
|
|
txDB , _ := dao.Begin(db)
|
|
|
|
|
defer func() {
|
|
|
|
|
if r := recover(); r != nil {
|
|
|
|
|
dao.Rollback(db)
|
|
|
|
|
dao.Rollback(db, txDB)
|
|
|
|
|
panic(r)
|
|
|
|
|
}
|
|
|
|
|
}()
|
|
|
|
|
@@ -1742,7 +1742,7 @@ func RefreshAllMatterOrderStatus(ctx *jxcontext.Context) (err error) {
|
|
|
|
|
waybills[0].Status = model.WaybillStatusDelivered
|
|
|
|
|
dao.UpdateEntity(db, waybills[0], "Status")
|
|
|
|
|
}
|
|
|
|
|
dao.Commit(db)
|
|
|
|
|
dao.Commit(db, txDB)
|
|
|
|
|
changeOrderStatus(vv.VendorOrderID, model.OrderStatusFinished, "")
|
|
|
|
|
getTrackMessagePlusByOrderResult, _ := api.JdEclpAPI.GetTrackMessagePlusByOrder(vv.VendorOrderID)
|
|
|
|
|
updateJdWayBillInfo(db, vv, getTrackMessagePlusByOrderResult)
|
|
|
|
|
@@ -1755,10 +1755,10 @@ func RefreshAllMatterOrderStatus(ctx *jxcontext.Context) (err error) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if len(goodsList2) > 0 {
|
|
|
|
|
dao.Begin(db)
|
|
|
|
|
txDB , _ := dao.Begin(db)
|
|
|
|
|
defer func() {
|
|
|
|
|
if r := recover(); r != nil {
|
|
|
|
|
dao.Rollback(db)
|
|
|
|
|
dao.Rollback(db, txDB)
|
|
|
|
|
panic(r)
|
|
|
|
|
}
|
|
|
|
|
}()
|
|
|
|
|
@@ -1773,7 +1773,7 @@ func RefreshAllMatterOrderStatus(ctx *jxcontext.Context) (err error) {
|
|
|
|
|
v.Status = model.OrderStatusCanceled
|
|
|
|
|
}
|
|
|
|
|
dao.UpdateEntity(db, v, "Status")
|
|
|
|
|
dao.Commit(db)
|
|
|
|
|
dao.Commit(db, txDB)
|
|
|
|
|
changeOrderStatus(v.VendorOrderID, v.Status, "")
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
@@ -1844,10 +1844,10 @@ func GetMatterOrderStatus(ctx *jxcontext.Context, vendorOrderID string) (result
|
|
|
|
|
func updateMatterOrderStatus(db *dao.DaoDB, order *model.GoodsOrder, queryOrderStatus *jdeclpapi.QueryOrderStatusResult) {
|
|
|
|
|
code := queryOrderStatus.OrderStatusList[len(queryOrderStatus.OrderStatusList)-1].SoStatusCode
|
|
|
|
|
if code == jdeclpapi.SoStatusCode10034 || code == jdeclpapi.SoStatusCode10038 {
|
|
|
|
|
dao.Begin(db)
|
|
|
|
|
txDB , _ := dao.Begin(db)
|
|
|
|
|
defer func() {
|
|
|
|
|
if r := recover(); r != nil {
|
|
|
|
|
dao.Rollback(db)
|
|
|
|
|
dao.Rollback(db, txDB)
|
|
|
|
|
panic(r)
|
|
|
|
|
}
|
|
|
|
|
}()
|
|
|
|
|
@@ -1858,7 +1858,7 @@ func updateMatterOrderStatus(db *dao.DaoDB, order *model.GoodsOrder, queryOrderS
|
|
|
|
|
waybills[0].Status = model.WaybillStatusDelivered
|
|
|
|
|
dao.UpdateEntity(db, waybills[0], "Status")
|
|
|
|
|
}
|
|
|
|
|
dao.Commit(db)
|
|
|
|
|
dao.Commit(db, txDB)
|
|
|
|
|
changeOrderStatus(order.VendorOrderID, model.OrderStatusFinished, "")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -2330,10 +2330,10 @@ func UpdateCoupons(ctx *jxcontext.Context, payload map[string]interface{}, store
|
|
|
|
|
} else {
|
|
|
|
|
valid := dao.StrictMakeMapByStructObject(payload, coupons, ctx.GetUserName())
|
|
|
|
|
if len(valid) > 0 {
|
|
|
|
|
dao.Begin(db)
|
|
|
|
|
txDB , _ := dao.Begin(db)
|
|
|
|
|
defer func() {
|
|
|
|
|
if r := recover(); r != nil {
|
|
|
|
|
dao.Rollback(db)
|
|
|
|
|
dao.Rollback(db, txDB)
|
|
|
|
|
panic(r)
|
|
|
|
|
}
|
|
|
|
|
}()
|
|
|
|
|
@@ -2343,7 +2343,7 @@ func UpdateCoupons(ctx *jxcontext.Context, payload map[string]interface{}, store
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if _, err = dao.UpdateEntityByKV(db, coupons, valid, nil); err != nil {
|
|
|
|
|
dao.Rollback(db)
|
|
|
|
|
dao.Rollback(db, txDB)
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
if valid["isAll"] != nil {
|
|
|
|
|
@@ -2364,7 +2364,7 @@ func UpdateCoupons(ctx *jxcontext.Context, payload map[string]interface{}, store
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
dao.Commit(db)
|
|
|
|
|
dao.Commit(db, txDB)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return err
|
|
|
|
|
@@ -2481,16 +2481,16 @@ func CreateStoreAcctOrder(ctx *jxcontext.Context, orderType, storeID, price int,
|
|
|
|
|
GoodsVendorOrderID: goodsVendorOrderID,
|
|
|
|
|
}
|
|
|
|
|
dao.WrapAddIDCULEntity(order, ctx.GetUserName())
|
|
|
|
|
dao.Begin(db)
|
|
|
|
|
txDB , _ := dao.Begin(db)
|
|
|
|
|
defer func() {
|
|
|
|
|
if r := recover(); r != nil {
|
|
|
|
|
dao.Rollback(db)
|
|
|
|
|
dao.Rollback(db, txDB)
|
|
|
|
|
panic(r)
|
|
|
|
|
}
|
|
|
|
|
}()
|
|
|
|
|
if err = dao.CreateEntity(db, order); err != nil {
|
|
|
|
|
dao.Rollback(db)
|
|
|
|
|
dao.Rollback(db, txDB)
|
|
|
|
|
}
|
|
|
|
|
dao.Commit(db)
|
|
|
|
|
dao.Commit(db, txDB)
|
|
|
|
|
return order.VendorOrderID, err
|
|
|
|
|
}
|
|
|
|
|
|