diff --git a/business/jxstore/cms/job.go b/business/jxstore/cms/job.go index 8b674a548..7387b2ec8 100644 --- a/business/jxstore/cms/job.go +++ b/business/jxstore/cms/job.go @@ -302,10 +302,10 @@ func AcceptJob(ctx *jxcontext.Context, jobID, dropShippingDeliveryID, dropShippi if num > 0 { return 0, errCode, fmt.Errorf("您还有此任务未完成,请完成后再接取!") } - // num, err = checkJobOrders(db, "= "+utils.Int2Str(model.JobOrderStatusAuditUnPass), userID, utils.ZeroTimeValue, utils.ZeroTimeValue) - // if num > 0 { - // return fmt.Errorf("您还有此任务未审核通过记录,可直接在未审核中重新提交!") - // } + num, err = checkJobOrders(db, jobID, "= "+utils.Int2Str(model.JobOrderStatusAuditUnPass), userID, utils.ZeroTimeValue, utils.ZeroTimeValue) + if num > 0 { + return 0, errCode, fmt.Errorf("您还有此任务未审核通过记录,可直接在未审核中重新提交!") + } switch job.LimitCountType { case model.JobLimitCountTypePO: num, err = checkJobOrders(db, jobID, "<> "+utils.Int2Str(model.JobOrderStatusCancel), userID, utils.ZeroTimeValue, utils.ZeroTimeValue) @@ -1159,14 +1159,12 @@ func GetJdDelivery(ctx *jxcontext.Context, status int, fromTime, toTime string, return dao.GetDeliveryOrders(db, []string{ctx.GetUserID()}, statuss, utils.Str2Time(fromTime), utils.Str2Time(toTime), pageSize, offset) } -func GetDeliveryDetail(ctx *jxcontext.Context, vendorWaybillID string) (result interface{}, err error) { - //如果是京东快递 - if strings.Contains(vendorWaybillID, "JDVD") { - return api.JdEclpAPI.QueryDynamicTraceInfo(vendorWaybillID) - } else { - //如果是一件代发 - } - return result, err +func GetDeliveryDetail(ctx *jxcontext.Context, vendorWaybillID string) (queryDynamicTraceInfo []*jdeclpapi.QueryDynamicTraceInfoResult, err error) { + return api.JdEclpAPI.QueryDynamicTraceInfo(vendorWaybillID) +} + +func GetAllDeliveryDetail(ctx *jxcontext.Context, vendorWaybillID, comType string) (a string, err error) { + return a, err } func CheckJdDeliveryWeight(ctx *jxcontext.Context) (err error) { diff --git a/business/model/job.go b/business/model/job.go index a9c9f9481..9932a17e3 100644 --- a/business/model/job.go +++ b/business/model/job.go @@ -190,7 +190,8 @@ type JobOrder struct { DropShippingAutoAddress string `json:"dropShippingAutoAddress"` DropShippingCityCode int `json:"dropShippingCityCode"` DropShippingDistrictCode int `json:"dropShippingDistrictCode"` - VendorWaybillID string `json:"vendorWaybillID"` //运单号 + VendorWaybillID string `json:"vendorWaybillID"` //运单号 + WaybillInfo string `orm:"type(text)" json:"waybillInfo"` //物流信息 } func (v *JobOrder) TableIndex() [][]string { diff --git a/controllers/job_controller.go b/controllers/job_controller.go index 82fa54e56..321f8f8ba 100644 --- a/controllers/job_controller.go +++ b/controllers/job_controller.go @@ -303,8 +303,8 @@ func (c *JobController) GetJdDelivery() { }) } -// @Title 查询快递物流信息 -// @Description 查询快递物流信息 +// @Title 查询京东快递物流信息 +// @Description 查询京东快递物流信息 // @Param token header string true "认证token" // @Param vendorWaybillID query string false "运单号" // @Success 200 {object} controllers.CallResult @@ -317,6 +317,21 @@ func (c *JobController) GetDeliveryDetail() { }) } +// @Title 查询所有快递物流信息 (txcloud购买) +// @Description 查询所有快递物流信息 +// @Param token header string true "认证token" +// @Param vendorWaybillID query string false "运单号" +// @Param comType query string false "快递公司编码" +// @Success 200 {object} controllers.CallResult +// @Failure 200 {object} controllers.CallResult +// @router /GetAllDeliveryDetail [get] +func (c *JobController) GetAllDeliveryDetail() { + c.callGetAllDeliveryDetail(func(params *tJobGetAllDeliveryDetailParams) (retVal interface{}, errCode string, err error) { + retVal, err = cms.GetAllDeliveryDetail(params.Ctx, params.VendorWaybillID, params.ComType) + return retVal, "", err + }) +} + // @Title 京东快递物流超重验证 // @Description 京东快递物流超重验证 // @Param token header string true "认证token" diff --git a/routers/commentsRouter_controllers.go b/routers/commentsRouter_controllers.go index 84567be5d..a9ce0b0bb 100644 --- a/routers/commentsRouter_controllers.go +++ b/routers/commentsRouter_controllers.go @@ -385,6 +385,15 @@ func init() { Filters: nil, Params: nil}) + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], + beego.ControllerComments{ + Method: "GetAllDeliveryDetail", + Router: `/GetAllDeliveryDetail`, + AllowHTTPMethods: []string{"get"}, + MethodParams: param.Make(), + Filters: nil, + Params: nil}) + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"], beego.ControllerComments{ Method: "GetCoordinateFromAddress",