Commit 93f9db80 authored by 黄奎's avatar 黄奎

页面修改

parent 934d0810
......@@ -36,7 +36,7 @@ namespace Edu.Model.Entity.StudyAbroad
/// <summary>
/// 国家编号
/// </summary>
public int CountryId { get; set; }
public string CountryId { get; set; }
/// <summary>
/// 集团编号
......
......@@ -94,5 +94,10 @@ namespace Edu.Model.ViewModel.StudyAbroad
/// 产品类型名称
/// </summary>
public string ProductTypeName { get; set; }
/// <summary>
/// 留学就业分类配置国家编号
/// </summary>
public string TypeCountryId { get; set; }
}
}
......@@ -24,5 +24,21 @@ namespace Edu.Model.ViewModel.StudyAbroad
/// 留学国家名称
/// </summary>
public string CountryName { get; set; }
/// <summary>
/// 国家编号
/// </summary>
public List<int> CountryIdList
{
get
{
List<int> list = new List<int>();
if (!string.IsNullOrEmpty(this.CountryId))
{
list = Common.ConvertHelper.StringToList(this.CountryId);
}
return list;
}
}
}
}
......@@ -61,7 +61,7 @@ namespace Edu.Module.StudyAbroad
if (list != null && list.Count > 0)
{
string ids = string.Join(",", list.Select(qitem => qitem.Id));
string countryIds = string.Join(",", list.Select(qitem => qitem.StudyCountryId));
string countryIds = string.Join(",", list.Select(qitem => qitem.TypeCountryId));
List<RB_StudyaBroad_Preferential_ViewModel> preferentialList = new List<RB_StudyaBroad_Preferential_ViewModel>();
if (query.IsQPrice == 1)
{
......@@ -81,7 +81,19 @@ namespace Edu.Module.StudyAbroad
foreach (var item in list)
{
item.StudyCountryName = areaList?.Where(qitem => qitem.ID == item.StudyCountryId)?.FirstOrDefault()?.Name ?? "";
string tempCountryName = "";
if (!string.IsNullOrEmpty(item.TypeCountryId))
{
var countryList = Common.ConvertHelper.StringToList(item.TypeCountryId);
if (countryList != null && countryList.Count > 0)
{
foreach (var subItem in countryList)
{
tempCountryName += (areaList?.Where(qitem => qitem.ID == subItem)?.FirstOrDefault()?.Name ?? "") + ",";
}
}
}
item.StudyCountryName = tempCountryName.TrimEnd(',');
item.PreferentialList = preferentialList?.Where(qitem => qitem.StudyabroadId == item.Id)?.ToList() ?? new List<RB_StudyaBroad_Preferential_ViewModel>();
}
}
......@@ -471,7 +483,15 @@ namespace Edu.Module.StudyAbroad
}
foreach (var item in list)
{
item.CountryName = countryList?.FirstOrDefault(qitem => qitem.ID == item.CountryId)?.Name ?? "";
string tempStr = "";
if (item.CountryIdList != null && item.CountryIdList.Count > 0)
{
foreach (var subItem in item.CountryIdList)
{
tempStr+= (countryList?.FirstOrDefault(qitem => qitem.ID == subItem)?.Name ?? "")+",";
}
}
item.CountryName = tempStr.TrimEnd(',');
}
}
return list;
......
......@@ -29,7 +29,7 @@ namespace Edu.Repository.StudyAbroad
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,IFNULL(B.`Name`,'') AS SupplierName,IFNULL(B.ContractUrl,'') AS ContractUrl,IFNULL(c.SName,'') AS SchoolName,IFNULL(D.`Name`,'') AS ProductTypeName
SELECT A.*,IFNULL(B.`Name`,'') AS SupplierName,IFNULL(B.ContractUrl,'') AS ContractUrl,IFNULL(c.SName,'') AS SchoolName,IFNULL(D.`Name`,'') AS ProductTypeName,IFNULL(D.CountryId,'') AS TypeCountryId
FROM RB_StudyAbroad AS A LEFT JOIN rb_supplier AS B ON A.SupplierId=B.Id
LEFT JOIN rb_school AS C ON A.School_Id=C.SId
LEFT JOIN rb_studyabroad_type AS D ON A.ProductType=D.Id
......@@ -67,6 +67,7 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1}", nameof(RB_StudyAbroad_ViewModel.StudyCountryId), query.StudyCountryId);
}
builder.Append(" ORDER BY A.Id DESC ");
return GetPage<RB_StudyAbroad_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
}
......
......@@ -42,9 +42,9 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Studyabroad_Type_Extend.Type), query.Type);
}
if (query.CountryId > 0)
if (!string.IsNullOrEmpty(query.CountryId))
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Studyabroad_Type_Extend.CountryId), query.CountryId);
builder.AppendFormat(" AND FIND_IN_SET('{0}', A.CountryId) ", query.CountryId);
}
if (!string.IsNullOrEmpty(query.Name))
{
......@@ -83,9 +83,9 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Studyabroad_Type_Extend.Type), query.Type);
}
if (query.CountryId > 0)
if (!string.IsNullOrEmpty(query.CountryId))
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Studyabroad_Type_Extend.CountryId), query.CountryId);
builder.AppendFormat(" AND FIND_IN_SET('{0}',A.CountryId ) ", query.CountryId);
}
if (!string.IsNullOrEmpty(query.Name))
{
......
......@@ -704,7 +704,7 @@ namespace Edu.WebApi.Controllers.StudyAbroad
{
Name = base.ParmJObj.GetStringValue("Name"),
Type = base.ParmJObj.GetInt("Type"),
CountryId = base.ParmJObj.GetInt("CountryId"),
CountryId = base.ParmJObj.GetStringValue("CountryId"),
};
query.Group_Id = base.UserInfo.Group_Id;
List<object> result = new List<object>();
......@@ -726,6 +726,7 @@ namespace Edu.WebApi.Controllers.StudyAbroad
item.Type,
item.Name,
item.CountryId,
item.CountryIdList,
item.CountryName,
item.CreateBy,
item.CreateByName,
......@@ -753,7 +754,7 @@ namespace Edu.WebApi.Controllers.StudyAbroad
{
Name = base.ParmJObj.GetStringValue("Name"),
Type = base.ParmJObj.GetInt("Type"),
CountryId = base.ParmJObj.GetInt("CountryId"),
CountryId = base.ParmJObj.GetStringValue("CountryId"),
};
query.Group_Id = base.UserInfo.Group_Id;
var list = studyAbroadModule.GetStudyabroadTypeListModule(query);
......@@ -772,9 +773,16 @@ namespace Edu.WebApi.Controllers.StudyAbroad
Id = base.ParmJObj.GetInt("Id"),
Type = base.ParmJObj.GetInt("Type"),
Name = base.ParmJObj.GetStringValue("Name"),
CountryId = base.ParmJObj.GetInt("CountryId"),
Num = base.ParmJObj.GetInt("Num"),
};
List<int> countryList = new List<int>();
var idList = base.ParmJObj.GetStringValue("CountryIdList");
if (!string.IsNullOrEmpty(idList))
{
countryList = JsonHelper.DeserializeObject<List<int>>(idList);
}
extModel.CountryId = string.Join(",", countryList);
extModel.CreateBy = base.UserInfo.Id;
extModel.CreateTime = DateTime.Now;
extModel.UpdateBy = base.UserInfo.Id;
......
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