Commit fabb9fbf authored by 黄奎's avatar 黄奎

页面修改

parent 59cd5795
......@@ -2,12 +2,15 @@
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Model.Entity.System
{
/// <summary>
/// 客户需求实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Needs
{
/// <summary>
......
......@@ -206,5 +206,10 @@ namespace Edu.Model.Entity.User
/// 客户类型
/// </summary>
public int StuType { get; set; }
/// <summary>
/// 客户需求
/// </summary>
public int StuNeeds { get; set; }
}
}
......@@ -10,6 +10,9 @@ namespace Edu.Model.ViewModel.System
/// </summary>
public class RB_Needs_Extend : RB_Needs
{
/// <summary>
/// 需求编号
/// </summary>
public string QNeedsId { get; set; }
}
}
......@@ -249,5 +249,10 @@ namespace Edu.Model.ViewModel.User
/// 学习目的名称
/// </summary>
public string StuPurposeName { get; set;}
/// <summary>
/// 客户需求名称
/// </summary>
public string StuNeedsName { get; set; }
}
}
\ No newline at end of file
......@@ -96,6 +96,11 @@ namespace Edu.Module.User
/// </summary>
private readonly RB_ChannelRepository channelRepository = new RB_ChannelRepository();
/// <summary>
/// 客户需求仓储层对象
/// </summary>
private readonly RB_NeedsRepository needsRepository = new RB_NeedsRepository();
/// <summary>
/// 获取学生列表
/// </summary>
......@@ -230,6 +235,11 @@ namespace Edu.Module.User
QChannelIds=channelIds
});
var needIds = string.Join(",", list.Select(qitem => qitem.StuNeeds));
var needList = needsRepository.GetNeedsListRepository(new Model.ViewModel.System.RB_Needs_Extend()
{
QNeedsId = needIds
});
foreach (var item in list)
{
var tempOrderList = stuOrderList?.Where(qitem => qitem.Student_Id == item.StuId)?.ToList();
......@@ -268,7 +278,7 @@ namespace Edu.Module.User
item.StuTypeName = stuTypeList?.FirstOrDefault(qitem => qitem.Id == item.StuType)?.Name ?? "";
item.StuChannelName = channelList?.FirstOrDefault(qitem => qitem.Id == item.StuChannel)?.Name ?? "";
item.StuPurposeName = goalList?.FirstOrDefault(qitem => qitem.Id == item.StuPurpose)?.Name ?? "";
item.StuNeedsName = needList?.FirstOrDefault(qitem => qitem.Id == item.StuNeeds)?.Name ?? "";
}
}
return list;
......@@ -410,6 +420,7 @@ namespace Edu.Module.User
extModel.StuTypeName = student_TypeRepository.GetEntity(extModel.StuType)?.Name ?? "";
extModel.StuPurposeName = learningGoalsRepository.GetLearningGoalsExtEntityRepository(extModel.StuPurpose)?.Name ?? "";
extModel.StuChannelName = channelRepository.GetChannelExtEntityRepository(extModel.StuChannel)?.Name ?? "";
extModel.StuNeedsName = needsRepository.GetNeedsExtEntityRepository(extModel.StuNeeds)?.Name ?? "";
}
return extModel;
}
......
......@@ -74,9 +74,9 @@ WHERE 1=1
builder.AppendFormat(" AND A.{0} LIKE @Name ", nameof(RB_Needs_Extend.Name));
parameters.Add("Name", "%" + query.Name.Trim() + "%");
}
if (!string.IsNullOrEmpty(query.QChannelIds))
if (!string.IsNullOrEmpty(query.QNeedsId))
{
builder.AppendFormat(@" AND A.{0} IN({1}) ", nameof(RB_Needs_Extend.Id), query.QChannelIds);
builder.AppendFormat(@" AND A.{0} IN({1}) ", nameof(RB_Needs_Extend.Id), query.QNeedsId);
}
}
return Get<RB_Needs_Extend>(builder.ToString(), parameters).ToList();
......
......@@ -58,6 +58,11 @@ namespace Edu.Repository.User
/// </summary>
private readonly RB_LearningGoalsRepository learningGoalsRepository = new RB_LearningGoalsRepository();
/// <summary>
/// 客户需求仓储层对象
/// </summary>
private readonly RB_NeedsRepository needsRepository = new RB_NeedsRepository();
/// <summary>
/// 获取学生列表
/// </summary>
......@@ -430,6 +435,12 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
string newName = student_TypeRepository.GetEntity(model.StuType)?.Name;
logContent += string.Format("客户类型:由【{0}】=>【{1}】,", oldName, newName);
}
if (oldModel.StuNeeds != model.StuNeeds)
{
string oldName = needsRepository.GetNeedsExtEntityRepository(oldModel.StuNeeds)?.Name;
string newName = needsRepository.GetNeedsExtEntityRepository(model.StuNeeds)?.Name;
logContent += string.Format("客户需求:由【{0}】=>【{1}】,", oldName, newName);
}
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_ViewModel.StuName),model.StuName.Trim() },
......@@ -457,6 +468,7 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
fileds.Add(nameof(RB_Student_ViewModel.StuStage), model.StuStage);
fileds.Add(nameof(RB_Student_ViewModel.StuChannel), model.StuChannel);
fileds.Add(nameof(RB_Student_ViewModel.PlatformName), model.PlatformName);
fileds.Add(nameof(RB_Student_ViewModel.StuNeeds), model.StuNeeds);
}
//App小程序操作
else
......
......@@ -103,10 +103,12 @@ namespace Edu.WebApi.Controllers.Customer
{
return ApiResult.ParamIsNull(message: "请填写客户名称!");
}
if (string.IsNullOrEmpty(model.ContactNumber))
if (string.IsNullOrEmpty(model.ContactNumber) && string.IsNullOrEmpty(model.QQ) && string.IsNullOrEmpty(model.WeChatNo))
{
return ApiResult.ParamIsNull(message: "请填写客户联系电话!");
return ApiResult.Failed("手机号码、QQ号码、微信号码至少填写一项!");
}
model.Status = Common.Enum.DateStateEnum.Normal;
model.CreateBy = base.UserInfo.Id;
model.CreateTime = DateTime.Now;
......
......@@ -752,6 +752,8 @@ namespace Edu.WebApi.Controllers.User
item.WeChatNo,
item.StuType,
item.StuTypeName,
item.StuNeeds,
item.StuNeedsName,
});
}
pageModel.Count = rowsCount;
......@@ -826,6 +828,7 @@ namespace Edu.WebApi.Controllers.User
WeChatNo = base.ParmJObj.GetStringValue("WeChatNo"),
QQ = base.ParmJObj.GetStringValue("QQ"),
StuType = base.ParmJObj.GetInt("StuType"),
StuNeeds=base.ParmJObj.GetInt("StuNeeds"),
};
if (string.IsNullOrEmpty(extModel.StuTel) && string.IsNullOrEmpty(extModel.QQ) && string.IsNullOrEmpty(extModel.WeChatNo))
{
......@@ -1201,6 +1204,8 @@ namespace Edu.WebApi.Controllers.User
extModel.WeChatNo,
extModel.StuType,
extModel.StuTypeName,
extModel.StuNeeds,
extModel.StuNeedsName,
};
return ApiResult.Success(data: obj);
}
......
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