添加打印
This commit is contained in:
@@ -35,6 +35,7 @@ type UserVendorOrder struct {
|
|||||||
OrderStatus int `orm:"size(8);column(order_status)" json:"orderType"` // 订单状态(2-待支付,3-支付失败,4-支付成功,10预下单11待取件12运输中15已签收16取消订单17终止揽收,150取消)
|
OrderStatus int `orm:"size(8);column(order_status)" json:"orderType"` // 订单状态(2-待支付,3-支付失败,4-支付成功,10预下单11待取件12运输中15已签收16取消订单17终止揽收,150取消)
|
||||||
Img string `orm:"size(1024);column(img)" json:"img"` // 包裹图片
|
Img string `orm:"size(1024);column(img)" json:"img"` // 包裹图片
|
||||||
IsForward int `orm:"column(is_forward)" json:"isForward"` // 1否,2是 转寄单
|
IsForward int `orm:"column(is_forward)" json:"isForward"` // 1否,2是 转寄单
|
||||||
|
ErrorMsg string `orm:"size(1024);column(error_msg)" json:"errorMsg"` // 平台错误
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -386,11 +386,12 @@ func CreateOrder2QBiDa(order *model.UserVendorOrder) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
globals.SugarLogger.Debug("err==========", err)
|
globals.SugarLogger.Debug("err==========", err)
|
||||||
}
|
}
|
||||||
order.Remark = fmt.Sprintf("%s", err.Error())
|
globals.SugarLogger.Debug("otherId==========", otherId)
|
||||||
|
order.ErrorMsg = err.Error()
|
||||||
order.OtherWayBill = otherId
|
order.OtherWayBill = otherId
|
||||||
order.OrderStatus = model.OrderStatusWaitPickup
|
order.OrderStatus = model.OrderStatusWaitPickup
|
||||||
order.UpdatedAt = time.Now()
|
order.UpdatedAt = time.Now()
|
||||||
if _, err = dao.UpdateEntity(dao.GetDB(), order, "OtherWayBill", "OrderStatus", "UpdatedAt"); err != nil {
|
if _, err = dao.UpdateEntity(dao.GetDB(), order, "OtherWayBill", "OrderStatus", "UpdatedAt", "ErrorMsg"); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
@@ -527,7 +528,7 @@ func DeleteOrderByLocalId(userId, localId string) (int64, error) {
|
|||||||
|
|
||||||
// UpdateOrderStatus 查询所有支付成功的订单
|
// UpdateOrderStatus 查询所有支付成功的订单
|
||||||
func UpdateOrderStatus() {
|
func UpdateOrderStatus() {
|
||||||
globals.SugarLogger.Debug("没十分钟更新一下订单,定时任务")
|
globals.SugarLogger.Debug("每十分钟更新一下订单,定时任务")
|
||||||
// 查询状态值为【4-支付成功,10预下单11待取件12运输中17终止揽收】//2,3 15已签收16取消订单 完成订单
|
// 查询状态值为【4-支付成功,10预下单11待取件12运输中17终止揽收】//2,3 15已签收16取消订单 完成订单
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
sql := `SELECT * FROM user_vendor_order WHERE order_status IN (4,10,11,12,17) AND deleted_at = ?`
|
sql := `SELECT * FROM user_vendor_order WHERE order_status IN (4,10,11,12,17) AND deleted_at = ?`
|
||||||
@@ -539,11 +540,11 @@ func UpdateOrderStatus() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, v := range data {
|
for _, v := range data {
|
||||||
if v.LocalWayBill == v.OtherWayBill {
|
if v.LocalWayBill == v.OtherWayBill && v.OrderStatus == model.OrderStatusSuccessPay {
|
||||||
globals.SugarLogger.Debug("ERROR ", "第三方订单Id写入错误,")
|
globals.SugarLogger.Debug("ERROR ", "第三方订单Id写入错误,")
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if v.OrderStatus == 2 || v.OrderStatus == 3 || v.OrderStatus == 15 || v.OrderStatus == 16 {
|
if v.OrderStatus == 2 || v.OrderStatus == 3 || v.OrderStatus == 15 || v.OrderStatus == 16 || v.OrderStatus == 115 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
otherOrder, err := QueryOrderDetail(v.Type, v.OtherWayBill)
|
otherOrder, err := QueryOrderDetail(v.Type, v.OtherWayBill)
|
||||||
|
|||||||
Reference in New Issue
Block a user