diff --git a/business/jxstore/cms/cms.go b/business/jxstore/cms/cms.go index da7dad751..fc8b5de61 100644 --- a/business/jxstore/cms/cms.go +++ b/business/jxstore/cms/cms.go @@ -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, }, } } diff --git a/business/jxstore/cms/job.go b/business/jxstore/cms/job.go index 8d13d25b5..c95d439eb 100644 --- a/business/jxstore/cms/job.go +++ b/business/jxstore/cms/job.go @@ -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) } diff --git a/business/model/job.go b/business/model/job.go index 33be2b6c7..cb9cfddba 100644 --- a/business/model/job.go +++ b/business/model/job.go @@ -32,7 +32,13 @@ const ( JobTypeJdDelivery = 2 //京东快递任务 ) -const () +var ( + DeliveryStatusName = map[int]string{ + OrderStatusNew: "上门取件中", + OrderStatusDelivering: "配送中", + OrderStatusFinished: "已妥投", + } +) type Job struct { ModelIDCULD diff --git a/controllers/user2_controller.go b/controllers/user2_controller.go index 829cc9fce..72f72a4a9 100644 --- a/controllers/user2_controller.go +++ b/controllers/user2_controller.go @@ -312,6 +312,20 @@ func (c *User2Controller) UpdateUser() { }) } +// @Title 获取用户管理城市 +// @Description 获取用户管理城市 +// @Param token header string true "认证token" +// @Param userID query string false "userID" +// @Param cityCode query int false "cityCode" +// @Success 200 {object} controllers.CallResult +// @Failure 200 {object} controllers.CallResult +// @router /GetUserCityManager [get] +func (c *User2Controller) GetUserCityManager() { + c.callGetUserCityManager(func(params *tUser2GetUserCityManagerParams) (retVal interface{}, errCode string, err error) { + return retVal, "", err + }) +} + // @Title 增加用户管理城市 // @Description 增加用户管理城市 // @Param token header string true "认证token"