修改骑手投诉功能
This commit is contained in:
@@ -252,19 +252,30 @@ func GetComplaintReasons() (complaintReasonList []*dadaapi.ComplaintReason) {
|
||||
return complaintReasonList
|
||||
}
|
||||
|
||||
func ComplaintRider(ctx *jxcontext.Context, vendorOrderID string, waybillVendorID string, complaintID int) (err error) {
|
||||
wayBillList, err := dao.GetComplaintList(dao.GetDB(), vendorOrderID, "")
|
||||
func ComplaintRider(ctx *jxcontext.Context, vendorOrderID string, waybillVendorID string, complaintID int, waybillID string) (err error) {
|
||||
wayBillList, err := dao.GetComplaintList(dao.GetDB(), vendorOrderID, waybillID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(wayBillList) != model.YES {
|
||||
return fmt.Errorf("订单所属运单不存在,或运单为分配骑手,无法投诉")
|
||||
}
|
||||
|
||||
if err == nil && len(wayBillList) > 0 {
|
||||
for _, v := range wayBillList {
|
||||
if utils.Int2Str(v.WaybillVendorID) == waybillVendorID {
|
||||
p := partner.GetDeliveryPlatformFromVendorID(wayBillList[0].WaybillVendorID).Handler
|
||||
err = p.ComplaintRider(v, complaintID, complaintReasonsMap[complaintID])
|
||||
switch wayBillList[0].WaybillVendorID {
|
||||
case model.VendorIDFengNiao, model.VendorIDDada, model.VendorIDMTPS, model.VendorIDUUPT, model.VendorIDSFPS:
|
||||
tripartiteDelivery := partner.GetDeliveryPlatformFromVendorID(wayBillList[0].WaybillVendorID)
|
||||
if tripartiteDelivery != nil {
|
||||
err = tripartiteDelivery.Handler.ComplaintRider(wayBillList[0], complaintID, complaintReasonsMap[complaintID])
|
||||
} else {
|
||||
err = fmt.Errorf("投诉三方配送获取运单失败")
|
||||
}
|
||||
case model.VendorIDMTWM, model.VendorIDDD, model.VendorIDJD, model.VendorIDEBAI, model.VendorIDTaoVegetable:
|
||||
platformDelivery := partner.GetPurchaseOrderHandlerFromVendorID(wayBillList[0].WaybillVendorID)
|
||||
if platformDelivery != nil {
|
||||
err = platformDelivery.ComplaintRider(wayBillList[0].VendorOrderID, complaintID, complaintReasonsMap[complaintID])
|
||||
} else {
|
||||
err = fmt.Errorf("投诉平台配送获取运单失败")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user