mm
This commit is contained in:
@@ -87,7 +87,8 @@ func InitServiceInfo(version string, buildTime time.Time, gitCommit string) {
|
||||
"id":` + utils.Int2Str(model.JobLimitCountTypeNoLimit) +
|
||||
`,"value": "不限次"
|
||||
}]`,
|
||||
"billTypeNames": model.BillTypeNames,
|
||||
"billTypeNames": model.BillTypeNames,
|
||||
"deliveryStatusName": model.DeliveryStatusName,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -771,6 +771,33 @@ func GetJdDelivery(ctx *jxcontext.Context, status int, fromTime, toTime string,
|
||||
if status != 0 {
|
||||
statuss = append(statuss, status)
|
||||
}
|
||||
pages, _ := dao.GetDeliveryOrders(db, []string{ctx.GetUserID()}, []int{model.OrderStatusNew, model.OrderStatusDelivering}, utils.ZeroTimeValue, utils.ZeroTimeValue, 9999, 0)
|
||||
for _, v := range pages.Data.([]*model.DeliveryOrder) {
|
||||
if v != nil && v.VendorWaybillID != "" {
|
||||
var (
|
||||
isDeliverying bool
|
||||
isFinished bool
|
||||
)
|
||||
if results, err := api.JdEclpAPI.QueryDynamicTraceInfo(v.VendorWaybillID); err == nil {
|
||||
for _, result := range results {
|
||||
if result.State == jdeclpapi.TraceInfoStateM640 {
|
||||
isDeliverying = true
|
||||
}
|
||||
if result.State == jdeclpapi.TraceInfoState150 {
|
||||
isFinished = true
|
||||
}
|
||||
}
|
||||
}
|
||||
if isFinished {
|
||||
v.Status = model.OrderStatusFinished
|
||||
} else if isDeliverying {
|
||||
v.Status = model.OrderStatusDelivering
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
dao.UpdateEntity(db, v, "Status")
|
||||
}
|
||||
}
|
||||
return dao.GetDeliveryOrders(db, []string{ctx.GetUserID()}, statuss, utils.Str2Time(fromTime), utils.Str2Time(toTime), pageSize, offset)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user