投诉骑手
This commit is contained in:
@@ -249,14 +249,14 @@ func GetComplaintReasons() (complaintReasonList []*dadaapi.ComplaintReason) {
|
|||||||
return complaintReasonList
|
return complaintReasonList
|
||||||
}
|
}
|
||||||
|
|
||||||
func ComplaintRider(ctx *jxcontext.Context, orderID string, vendorID, complaintID int) (err error) {
|
func ComplaintRider(ctx *jxcontext.Context, vendorOrderID string, vendorID, waybillVendorID, complaintID int) (err error) {
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
p := partner.GetDeliveryPlatformFromVendorID(vendorID).Handler
|
p := partner.GetDeliveryPlatformFromVendorID(vendorID).Handler
|
||||||
wayBillList, err := dao.GetWayBillByOrderID(db, model.OrderStatusFinished, vendorID, orderID)
|
wayBillList, err := dao.GetWayBillByOrderID(db, model.OrderStatusFinished, vendorID, waybillVendorID, vendorOrderID)
|
||||||
if err == nil && len(wayBillList) > 0 {
|
if err == nil && len(wayBillList) > 0 {
|
||||||
err = p.ComplaintRider(wayBillList[0], complaintID, complaintReasonsMap[complaintID])
|
err = p.ComplaintRider(wayBillList[0], complaintID, complaintReasonsMap[complaintID])
|
||||||
} else {
|
} else {
|
||||||
return fmt.Errorf("未查询到到相关订单,订单状态要求必须是完成!订单号:[%v] ,厂商:[%v]", orderID, vendorID)
|
return fmt.Errorf("未查询到到相关订单,订单状态要求必须是完成!订单号:[%v] ,厂商:[%v]", orderID, waybillVendorID)
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1028,14 +1028,18 @@ func LoadPendingOrders(db *DaoDB, orderCreatedAfter time.Time, beforStatus int)
|
|||||||
return orderList, err
|
return orderList, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetWayBillByOrderID(db *DaoDB, orderStatus, waybillVendorID int, vendorOrderID string) (wayBillList []*model.Waybill, err error) {
|
func GetWayBillByOrderID(db *DaoDB, orderStatus, vendorID, waybillVendorID int, vendorOrderID string) (wayBillList []*model.Waybill, err error) {
|
||||||
sql := `
|
sql := `
|
||||||
SELECT b.*
|
SELECT b.*
|
||||||
FROM goods_order a
|
FROM goods_order a
|
||||||
LEFT JOIN waybill b ON IF(a.waybill_vendor_id = -1,a.vendor_order_id,a.vendor_waybill_id) = b.vendor_waybill_id
|
LEFT JOIN waybill b ON IF(a.waybill_vendor_id = -1,a.vendor_order_id,a.vendor_waybill_id) = b.vendor_waybill_id AND b.vendor_id = a.vendor_id
|
||||||
WHERE a.vendor_order_id = ?
|
WHERE a.vendor_order_id = ?
|
||||||
|
AND a.vendor_id = ?
|
||||||
`
|
`
|
||||||
sqlParams := []interface{}{vendorOrderID}
|
sqlParams := []interface{}{
|
||||||
|
vendorOrderID,
|
||||||
|
vendorID,
|
||||||
|
}
|
||||||
if orderStatus > 0 {
|
if orderStatus > 0 {
|
||||||
sql += ` AND a.status = ?`
|
sql += ` AND a.status = ?`
|
||||||
sqlParams = append(sqlParams, orderStatus)
|
sqlParams = append(sqlParams, orderStatus)
|
||||||
|
|||||||
@@ -892,15 +892,16 @@ func (c *OrderController) GetComplaintReasons() {
|
|||||||
// @Title 投诉骑手(三方运送)
|
// @Title 投诉骑手(三方运送)
|
||||||
// @Description 投诉骑手(三方运送)
|
// @Description 投诉骑手(三方运送)
|
||||||
// @Param token header string true "认证token"
|
// @Param token header string true "认证token"
|
||||||
// @Param orderID formData string true "订单号"
|
// @Param vendorOrderID formData string true "订单ID"
|
||||||
// @Param vendorID formData int true "平台厂商ID"
|
// @Param vendorID formData int true "订单所属厂商ID"
|
||||||
|
// @Param waybillVendorID formData int true "运单所属厂商ID"
|
||||||
// @Param complaintID formData int true "投诉原因ID"
|
// @Param complaintID formData int true "投诉原因ID"
|
||||||
// @Success 200 {object} controllers.CallResult
|
// @Success 200 {object} controllers.CallResult
|
||||||
// @Failure 200 {object} controllers.CallResult
|
// @Failure 200 {object} controllers.CallResult
|
||||||
// @router /ComplaintRider [post]
|
// @router /ComplaintRider [post]
|
||||||
func (c *OrderController) ComplaintRider() {
|
func (c *OrderController) ComplaintRider() {
|
||||||
c.callComplaintRider(func(params *tOrderComplaintRiderParams) (retVal interface{}, errCode string, err error) {
|
c.callComplaintRider(func(params *tOrderComplaintRiderParams) (retVal interface{}, errCode string, err error) {
|
||||||
err = orderman.ComplaintRider(params.Ctx, params.OrderID,params.VendorID, params.ComplaintID)
|
err = orderman.ComplaintRider(params.Ctx, params.VendorOrderID, params.VendorID, params.WaybillVendorID, params.ComplaintID)
|
||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user