Commit 97f5affd authored by liudong1993's avatar liudong1993

司导订单客人取消

parent 70693ca3
......@@ -11109,6 +11109,29 @@ namespace Mall.Module.Product
}
return flag;
}
/// <summary>
/// 验证司导订单是否可以取消
/// </summary>
/// <param name="orderModel"></param>
/// <returns></returns>
public string ValidateSDOrderCanCancel(RB_Goods_Order_Extend orderModel)
{
var gbmodel = guideCar_BaseRepository.GetList(new Model.Extend.GuideCar.RB_GuideCar_Base_Extend() { TenantId = orderModel.TenantId, MallBaseId = orderModel.MallBaseId }).FirstOrDefault();
if (gbmodel == null || gbmodel.CancelHour <= 0)
{
return "";
}
var detailList = goods_OrderDetailRepository.GetOrderDetailList(new RB_Goods_OrderDetail_Extend() { OrderId = orderModel.OrderId });
foreach (var item in detailList)
{
if (Convert.ToDateTime(item.TripSTime.Value.ToString("yyyy-MM-dd")).AddHours(-gbmodel.CancelHour) > DateTime.Now)
{
return "订单取消超时,需出发日提前" + gbmodel.CancelHour + "小时";
}
}
return "";
}
#endregion
#region 订单评论
......
......@@ -653,11 +653,18 @@ namespace Mall.WebApi.Controllers.MallBase
{
return ApiResult.ParamIsNull();
}
//if (Type == 2) {
// if (string.IsNullOrEmpty(Remark)) {
// return ApiResult.ParamIsNull("请输入取消申请备注");
// }
//}
var omodel = orderModule.GetOrderInfo(OrderId);
if (omodel == null) {
return ApiResult.Failed("订单不存在");
}
if (omodel.OrderClassify == 1) {
//验证可提前取消时间
string msg = orderModule.ValidateSDOrderCanCancel(omodel);
if (msg != "")
{
return ApiResult.Failed(msg);
}
}
if (string.IsNullOrEmpty(Remark))
{
Remark = "无";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment