Commit 42a3ec01 authored by 吴春's avatar 吴春

导游下拉

parent ebf8d841
...@@ -1281,6 +1281,16 @@ namespace Mall.Module.Product ...@@ -1281,6 +1281,16 @@ namespace Mall.Module.Product
return model; return model;
} }
/// <summary>
/// 导游配置
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_GuideCar_Guide_Extend> GetGuideCarGuideList(RB_GuideCar_Guide_Extend query)
{
return GuideRepository.GetGuideCarGuideList(query);
}
/// <summary> /// <summary>
/// 新增/修改导游配置 /// 新增/修改导游配置
/// </summary> /// </summary>
...@@ -1403,7 +1413,7 @@ namespace Mall.Module.Product ...@@ -1403,7 +1413,7 @@ namespace Mall.Module.Product
{ {
item.ColorList = new List<RB_GuideCar_CarColor_Extend>(); item.ColorList = new List<RB_GuideCar_CarColor_Extend>();
item.ColorList = listCarColor.Where(x => x.CarId == item.ID).ToList(); item.ColorList = listCarColor.Where(x => x.CarId == item.ID).ToList();
} }
} }
return list; return list;
...@@ -1440,8 +1450,8 @@ namespace Mall.Module.Product ...@@ -1440,8 +1450,8 @@ namespace Mall.Module.Product
/// <returns></returns> /// <returns></returns>
public List<RB_GuideCar_Car_Extend> GetGuideCarList(RB_GuideCar_Car_Extend query) public List<RB_GuideCar_Car_Extend> GetGuideCarList(RB_GuideCar_Car_Extend query)
{ {
var list= GuideCarRepository.GetGuideCarCarList(query); var list = GuideCarRepository.GetGuideCarCarList(query);
if (list!=null&& list.Any()) if (list != null && list.Any())
{ {
List<RB_GuideCar_CarColor_Extend> listCarColor = CarColorRepository.GetCarColorList(new RB_GuideCar_CarColor_Extend { TenantId = query.TenantId, MallBaseId = query.MallBaseId, CardIds = string.Join(",", list.Select(x => x.ID)) }); List<RB_GuideCar_CarColor_Extend> listCarColor = CarColorRepository.GetCarColorList(new RB_GuideCar_CarColor_Extend { TenantId = query.TenantId, MallBaseId = query.MallBaseId, CardIds = string.Join(",", list.Select(x => x.ID)) });
if (listCarColor != null && listCarColor.Any()) if (listCarColor != null && listCarColor.Any())
...@@ -1507,19 +1517,19 @@ namespace Mall.Module.Product ...@@ -1507,19 +1517,19 @@ namespace Mall.Module.Product
//} //}
//else //else
//{ //全部删除 //{ //全部删除
foreach (var itemRegion in listLogisticsRulesRegion.Where(x => x.CarId == model.ID)) foreach (var itemRegion in listLogisticsRulesRegion.Where(x => x.CarId == model.ID))
{ {
IDictionary<string, object> filedsRegion = new Dictionary<string, object>()//删除价格下面对应的地区 IDictionary<string, object> filedsRegion = new Dictionary<string, object>()//删除价格下面对应的地区
{ {
{ nameof(RB_GuideCar_CarColor_Extend.Status),1}, { nameof(RB_GuideCar_CarColor_Extend.Status),1},
{ nameof(RB_GuideCar_CarColor_Extend.UpdateDate),System.DateTime.Now}, { nameof(RB_GuideCar_CarColor_Extend.UpdateDate),System.DateTime.Now},
}; };
IList<WhereHelper> whereHelpersRegion = new List<WhereHelper>() IList<WhereHelper> whereHelpersRegion = new List<WhereHelper>()
{ {
new WhereHelper (){ FiledName=nameof(RB_GuideCar_CarColor_Extend.ID),FiledValue=itemRegion.ID,OperatorEnum=OperatorEnum.Equal} new WhereHelper (){ FiledName=nameof(RB_GuideCar_CarColor_Extend.ID),FiledValue=itemRegion.ID,OperatorEnum=OperatorEnum.Equal}
}; };
CarColorRepository.Update(filedsRegion, whereHelpersRegion, trans); CarColorRepository.Update(filedsRegion, whereHelpersRegion, trans);
} }
//} //}
} }
if (model.ColorList != null && model.ColorList.Any()) if (model.ColorList != null && model.ColorList.Any())
......
...@@ -1017,6 +1017,23 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1017,6 +1017,23 @@ namespace Mall.WebApi.Controllers.MallBase
} }
/// <summary>
/// 获取全部导游
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetGuideCarGuideList()
{
var parms = RequestParm;
var query = JsonConvert.DeserializeObject<RB_GuideCar_Guide_Extend>(RequestParm.msg.ToString());
query.TenantId = UserInfo.TenantId;
query.MallBaseId = parms.MallBaseId;
var list = guideCarModule.GetGuideCarGuideList(query);
var result = list.Select(x => new { x.ID, x.Name, x.WorkYears, x.Score });
return ApiResult.Success("", result);
}
/// <summary> /// <summary>
/// 保存司导导游信息 /// 保存司导导游信息
/// </summary> /// </summary>
...@@ -1142,7 +1159,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1142,7 +1159,7 @@ namespace Mall.WebApi.Controllers.MallBase
query.TenantId = UserInfo.TenantId; query.TenantId = UserInfo.TenantId;
query.MallBaseId = parms.MallBaseId; query.MallBaseId = parms.MallBaseId;
var list = guideCarModule.GetGuideCarList(query); var list = guideCarModule.GetGuideCarList(query);
var result = list.Select(x => new { x.ID, x.Name, x.CarBrand, x.CarClass, x.CarLogo, ColorList= x.ColorList.Select(y=>new {y.ColorName,y.PicList }), x.CarType }); var result = list.Select(x => new { x.ID, x.Name, x.CarBrand, x.CarClass, x.CarLogo, ColorList = x.ColorList.Select(y => new { y.ColorName, y.PicList }), x.CarType });
return ApiResult.Success("", result); return ApiResult.Success("", result);
} }
......
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