Commit 6df481bf authored by liudong1993's avatar liudong1993

解决冲突

parents 7136a547 42a3ec01
...@@ -1109,7 +1109,7 @@ namespace Mall.Module.Product ...@@ -1109,7 +1109,7 @@ namespace Mall.Module.Product
/// <returns></returns> /// <returns></returns>
public RB_GuideCar_Site_Extend GetGuideCarSiteModel(RB_GuideCar_Site_Extend query) public RB_GuideCar_Site_Extend GetGuideCarSiteModel(RB_GuideCar_Site_Extend query)
{ {
RB_GuideCar_Site_Extend model = SiteRepository.GetLogisticsRulesList(query).FirstOrDefault(); RB_GuideCar_Site_Extend model = SiteRepository.GetGuideCarSiteList(query).FirstOrDefault();
if (model != null) if (model != null)
{ {
List<RB_GuideCar_SiteRegion_Extend> listLogisticsRulesRegion = SiteRegionRepository.GetListRepository(new RB_GuideCar_SiteRegion_Extend { TenantId = query.TenantId, SiteType = query.SiteType, MallBaseId = query.MallBaseId, SiteId = model.ID }); List<RB_GuideCar_SiteRegion_Extend> listLogisticsRulesRegion = SiteRegionRepository.GetListRepository(new RB_GuideCar_SiteRegion_Extend { TenantId = query.TenantId, SiteType = query.SiteType, MallBaseId = query.MallBaseId, SiteId = model.ID });
...@@ -1129,7 +1129,7 @@ namespace Mall.Module.Product ...@@ -1129,7 +1129,7 @@ namespace Mall.Module.Product
/// <returns></returns> /// <returns></returns>
public List<RB_GuideCar_Site_Extend> GetGuideCarSiteList(RB_GuideCar_Site_Extend query) public List<RB_GuideCar_Site_Extend> GetGuideCarSiteList(RB_GuideCar_Site_Extend query)
{ {
return SiteRepository.GetLogisticsRulesList(query); return SiteRepository.GetGuideCarSiteList(query);
} }
/// <summary> /// <summary>
...@@ -1337,11 +1337,21 @@ namespace Mall.Module.Product ...@@ -1337,11 +1337,21 @@ namespace Mall.Module.Product
/// <returns></returns> /// <returns></returns>
public RB_GuideCar_Guide_Extend GetGuideCarGuideModel(RB_GuideCar_Guide_Extend query) public RB_GuideCar_Guide_Extend GetGuideCarGuideModel(RB_GuideCar_Guide_Extend query)
{ {
RB_GuideCar_Guide_Extend model = GuideRepository.GetLogisticsRulesList(query).FirstOrDefault(); RB_GuideCar_Guide_Extend model = GuideRepository.GetGuideCarGuideList(query).FirstOrDefault();
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>
...@@ -1464,7 +1474,7 @@ namespace Mall.Module.Product ...@@ -1464,7 +1474,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;
...@@ -1501,7 +1511,22 @@ namespace Mall.Module.Product ...@@ -1501,7 +1511,22 @@ 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)
{ {
return GuideCarRepository.GetGuideCarCarList(query); var list = GuideCarRepository.GetGuideCarCarList(query);
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)) });
if (listCarColor != null && listCarColor.Any())
{
listCarColor.Where(x => !string.IsNullOrWhiteSpace(x.CarPic)).ToList().ForEach(x => x.PicList = JsonConvert.DeserializeObject<List<string>>(x.CarPic));
}
foreach (var item in list)
{
item.ColorList = new List<RB_GuideCar_CarColor_Extend>();
item.ColorList = listCarColor.Where(x => x.CarId == item.ID).ToList();
}
}
return list;
} }
/// <summary> /// <summary>
...@@ -1553,19 +1578,19 @@ namespace Mall.Module.Product ...@@ -1553,19 +1578,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())
......
...@@ -96,7 +96,7 @@ namespace Mall.Repository.GuideCar ...@@ -96,7 +96,7 @@ namespace Mall.Repository.GuideCar
/// <param name="rowCount">总条数</param> /// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param> /// <param name="query">查询条件</param>
/// <returns></returns> /// <returns></returns>
public List<RB_GuideCar_Guide_Extend> GetLogisticsRulesList(RB_GuideCar_Guide_Extend query) public List<RB_GuideCar_Guide_Extend> GetGuideCarGuideList(RB_GuideCar_Guide_Extend query)
{ {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.Append($" SELECT a.*,b.SiteName FROM {TableName} as a LEFT JOIN {SiteTableName} as b on a.SiteId=b.ID WHERE a.{nameof(RB_GuideCar_Guide_Extend.Status)}=0"); builder.Append($" SELECT a.*,b.SiteName FROM {TableName} as a LEFT JOIN {SiteTableName} as b on a.SiteId=b.ID WHERE a.{nameof(RB_GuideCar_Guide_Extend.Status)}=0");
......
...@@ -58,11 +58,11 @@ LEFT JOIN {DestinationTableName} as c on b.ParentID = c.ID WHERE a.{nameof(RB_ ...@@ -58,11 +58,11 @@ LEFT JOIN {DestinationTableName} as c on b.ParentID = c.ID WHERE a.{nameof(RB_
/// <summary> /// <summary>
/// 获取物流地区列表 /// 获取站点地区列表
/// </summary> /// </summary>
/// <param name="query">查询条件</param> /// <param name="query">查询条件</param>
/// <returns></returns> /// <returns></returns>
public List<RB_GuideCar_SiteRegion_Extend> GetListForSingle(RB_GuideCar_SiteRegion_Extend query) public List<RB_GuideCar_SiteRegion_Extend> GetListSiteRegion(RB_GuideCar_SiteRegion_Extend query)
{ {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.Append(@$" SELECT a.* FROM {TableName} as a WHERE a.{nameof(RB_GuideCar_SiteRegion_Extend.Status)}=0"); builder.Append(@$" SELECT a.* FROM {TableName} as a WHERE a.{nameof(RB_GuideCar_SiteRegion_Extend.Status)}=0");
......
...@@ -57,7 +57,7 @@ namespace Mall.Repository.GuideCar ...@@ -57,7 +57,7 @@ namespace Mall.Repository.GuideCar
/// <param name="rowCount">总条数</param> /// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param> /// <param name="query">查询条件</param>
/// <returns></returns> /// <returns></returns>
public List<RB_GuideCar_Site_Extend> GetList(RB_GuideCar_Site_Extend query) public List<RB_GuideCar_Site_Extend> GetGuideCarSiteList(RB_GuideCar_Site_Extend query)
{ {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.Append($" SELECT * FROM {TableName} WHERE {nameof(RB_GuideCar_Site_Extend.Status)}=0 "); builder.Append($" SELECT * FROM {TableName} WHERE {nameof(RB_GuideCar_Site_Extend.Status)}=0 ");
......
...@@ -933,6 +933,23 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -933,6 +933,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>
...@@ -1058,7 +1075,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1058,7 +1075,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, x.ColorList, 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