Commit c8299b78 by 孙龙

up

parent 2dec3371
Showing with 13 additions and 0 deletions
......@@ -62,6 +62,7 @@ func InsertData(trackList OrderTrackList) error{
create_time int64
status_cn string
ok bool
currency int64
)
//开启事务
tx, _ := db.DB.Beginx()
......@@ -74,10 +75,22 @@ func InsertData(trackList OrderTrackList) error{
continue
}
err = db.DB.Get(&currency,"SELECT currency FROM lie_order WHERE order_id = ?",orderItems.OrderId)
if err != nil{
logger.Error("%s",fmt.Sprintf("没有找到订单信息 %d",orderItems.OrderId))
continue
}
create_time = util.ParseTimestrToTimestamp(data.BIZDATE,5)
if status_cn,ok = ORDER_TRACK_STATUS_CN[data.STATUS];!ok {
status_cn = ""
}
if data.STATUS == 110 && currency == 2{
status_cn = "香港已到货"
data.MSG = "香港仓库入库验收成功,等待出库通知"
}
sql := " INSERT INTO lie_order_items_tracking (rec_id,order_id,status,fqty,msg,status_cn,create_name,create_time) VALUES(?,?,?,?,?,?,?,?)"
_,err :=tx.Exec(sql, orderItems.RecId,orderItems.OrderId,data.STATUS,data.FQTY,data.MSG,status_cn,data.CREATOR,create_time)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment