tx
This commit is contained in:
@@ -95,6 +95,7 @@ func InitServiceInfo(version string, buildTime time.Time, gitCommit string) {
|
||||
"deliveryStatusName": model.DeliveryStatusName,
|
||||
"cashbackName": model.CashbackName,
|
||||
"consumeName": model.ConsumeName,
|
||||
"txWaybillNames": model.TxWaybillNames,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/txcloudapi"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/ddmsg"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/dingdingapi"
|
||||
@@ -1163,8 +1165,35 @@ func GetDeliveryDetail(ctx *jxcontext.Context, vendorWaybillID string) (queryDyn
|
||||
return api.JdEclpAPI.QueryDynamicTraceInfo(vendorWaybillID)
|
||||
}
|
||||
|
||||
func GetAllDeliveryDetail(ctx *jxcontext.Context, vendorWaybillID, comType string) (a string, err error) {
|
||||
return a, err
|
||||
func GetAllDeliveryDetail(ctx *jxcontext.Context, vendorWaybillID, comType string) (result interface{}, err error) {
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
)
|
||||
jobOrder := &model.JobOrder{
|
||||
VendorWaybillID: vendorWaybillID,
|
||||
}
|
||||
err = dao.GetEntity(db, jobOrder, "VendorWaybillID")
|
||||
if jobOrder == nil {
|
||||
return result, fmt.Errorf("运单号有误,无法查询!")
|
||||
}
|
||||
if jobOrder.WaybillStatus == model.OrderStatusFinished {
|
||||
return jobOrder.WaybillInfo, err
|
||||
}
|
||||
if jobOrder.WaybillQueryTime != utils.ZeroTimeValue {
|
||||
if time.Now().Sub(jobOrder.WaybillQueryTime) <= time.Hour*12 {
|
||||
return jobOrder.WaybillInfo, err
|
||||
}
|
||||
}
|
||||
getWaybillDetailInfoResult, err := api.TxAPI.GetWaybillDetailInfo(vendorWaybillID, comType)
|
||||
jobOrder.WaybillQueryTime = time.Now()
|
||||
if waybillInfo, err := json.Marshal(getWaybillDetailInfoResult); err == nil {
|
||||
jobOrder.WaybillInfo = string(waybillInfo)
|
||||
}
|
||||
if getWaybillDetailInfoResult.State == utils.Int2Str(txcloudapi.StatusFinished) {
|
||||
jobOrder.WaybillStatus = model.OrderStatusFinished
|
||||
}
|
||||
dao.UpdateEntity(db, jobOrder, "WaybillQueryTime", "WaybillInfo", "WaybillStatus")
|
||||
return result, err
|
||||
}
|
||||
|
||||
func CheckJdDeliveryWeight(ctx *jxcontext.Context) (err error) {
|
||||
|
||||
Reference in New Issue
Block a user