This commit is contained in:
苏尹岚
2020-11-11 12:01:39 +08:00
parent 9290236ae8
commit 24b826e688
4 changed files with 50 additions and 2 deletions

View File

@@ -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,
},
}
}

View File

@@ -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)
}