This commit is contained in:
邹宗楠
2023-06-01 12:47:35 +08:00
parent f38c6bcc4b
commit 2433cbd9f3
3 changed files with 26 additions and 23 deletions

View File

@@ -247,25 +247,23 @@ func GetComplaintReasons() (complaintReasonList []*dadaapi.ComplaintReason) {
return complaintReasonList
}
func ComplaintRider(ctx *jxcontext.Context, vendorOrderID string, vendorID, waybillVendorID, complaintID int) (err error) {
db := dao.GetDB()
p := partner.GetDeliveryPlatformFromVendorID(waybillVendorID).Handler
wayBillList, err := dao.GetWayBillByOrderID(db, 0, vendorID, waybillVendorID, vendorOrderID)
func ComplaintRider(ctx *jxcontext.Context, vendorOrderID string, vendorWaybillId string, complaintID int) (err error) {
wayBillList, err := dao.GetComplaintList(dao.GetDB(), vendorOrderID, vendorWaybillId)
if err != nil {
return err
}
if len(wayBillList) != model.YES {
return fmt.Errorf("订单所属运单不存在,或运单为分配骑手,无法投诉")
}
p := partner.GetDeliveryPlatformFromVendorID(wayBillList[0].WaybillVendorID).Handler
if err == nil && len(wayBillList) > 0 {
err = p.ComplaintRider(wayBillList[0], complaintID, complaintReasonsMap[complaintID])
} else {
return fmt.Errorf("未查询到到相关订单!订单号:[%v] ,厂商:[%v],运送厂商:[%v]", vendorOrderID, vendorID, waybillVendorID)
}
return err
}
// GetComplaintList 获取投诉列表
func GetComplaintList(orderId string) ([]*model.Waybill, error) {
return dao.GetComplaintList(dao.GetDB(), orderId)
}
func ComplaintRiderPlatform(ctx *jxcontext.Context, vendorOrderID string, vendorID, waybillVendorID, complaintID int) (err error) {
return fmt.Errorf("只支持三方配送投诉!")
//handler := partner.GetPurchaseOrderHandlerFromVendorID(vendorID)
//return handler.ComplaintRider(vendorOrderID, complaintID, "")
return dao.GetComplaintList(dao.GetDB(), orderId, "")
}