Commit 6d4399ef authored by 黄奎's avatar 黄奎

页面修改

parent c25842ab
using System;
using Edu.Common.Enum;
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
......@@ -35,7 +36,7 @@ namespace Edu.Model.Entity.System
/// <summary>
/// 创建时间
/// </summary>
public int CreateTime { get; set; }
public DateTime CreateTime { get; set; }
/// <summary>
/// 更新人
......@@ -45,7 +46,16 @@ namespace Edu.Model.Entity.System
/// <summary>
/// 更新时间
/// </summary>
public int UpdateTime { get; set; }
public DateTime UpdateTime { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public DateStateEnum Status { get; set;}
}
}
......@@ -9,6 +9,8 @@ using VT.FW.DB;
using System.Linq;
using Edu.Model.ViewModel.User;
using Edu.Common.Plugin;
using Edu.Repository.System;
using Edu.Model.Entity.System;
namespace Edu.Module.Customer
{
......@@ -62,6 +64,11 @@ namespace Edu.Module.Customer
/// </summary>
private readonly RB_Student_AssistRepository student_AssistRepository = new RB_Student_AssistRepository();
/// <summary>
/// 客户阶段仓储层对象
/// </summary>
private readonly RB_StageRepository stageRepository = new RB_StageRepository();
#region 学员约访
......@@ -230,7 +237,8 @@ namespace Edu.Module.Customer
flag = newId > 0;
logTitle = "新增跟进";
logContent = model.Remark;
if (flag) {
if (flag)
{
//获取学生信息
//var smodel = studentRepository.GetEntity(model.StuId);
//if (smodel != null && smodel.StuStage == Common.Enum.User.StuStageEnum.NewStu)
......@@ -422,7 +430,8 @@ namespace Edu.Module.Customer
flag = newId > 0;
logTitle = "新增到访";
logContent = model.Remark;
if (flag) {
if (flag)
{
//获取学生信息
//var smodel = studentRepository.GetEntity(model.StuId);
//if (smodel != null && smodel.StuStage == Common.Enum.User.StuStageEnum.NewStu)
......@@ -464,7 +473,7 @@ namespace Edu.Module.Customer
/// <param name="Id"></param>
/// <param name="OperateId"></param>
/// <returns></returns>
public bool SetStudentVisitFeedbackModule(string Feedback, int Id, int OperateId,int IsVisit)
public bool SetStudentVisitFeedbackModule(string Feedback, int Id, int OperateId, int IsVisit)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
......@@ -480,7 +489,7 @@ namespace Edu.Module.Customer
}
if (oldModel.IsVisit != IsVisit)
{
logContent += string.Format("到访状态:由【{0}】=>【{1}】", oldModel.IsVisitStr, (IsVisit==1?"已到访":"未到访"));
logContent += string.Format("到访状态:由【{0}】=>【{1}】", oldModel.IsVisitStr, (IsVisit == 1 ? "已到访" : "未到访"));
}
bool flag = student_VisitRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Visit_Extend.Id), Id));
student_LogRepository.AddStuLogRepository(oldModel.StuId, Common.Enum.Log.StudentLogTypeEnum.Visit, logTitle, logContent, OperateId);
......@@ -560,7 +569,7 @@ namespace Edu.Module.Customer
/// <param name="StuId"></param>
/// <param name="AssistList"></param>
/// <returns></returns>
public bool SetStudentAssistModule(int StuId, RB_Student_Assist_Extend model,int Uid)
public bool SetStudentAssistModule(int StuId, RB_Student_Assist_Extend model, int Uid)
{
bool flag = true;
string logTitle = "协助人员";
......@@ -589,9 +598,9 @@ namespace Edu.Module.Customer
}
if (oldModel.AssistType != model.AssistType)
{
logContent += string.Format("修改协同类型:【0】=>【{1}】", oldModel.AssistType.ToName(),model.AssistType.ToName());
logContent += string.Format("修改协同类型:【0】=>【{1}】", oldModel.AssistType.ToName(), model.AssistType.ToName());
}
flag= student_AssistRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Assist_Extend.Id), model.Id));
flag = student_AssistRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Assist_Extend.Id), model.Id));
}
else
{
......@@ -640,7 +649,7 @@ namespace Edu.Module.Customer
/// <returns></returns>
public List<RB_Student_Assist_Extend> GeStudentAssistListModule(int StuId)
{
var list= student_AssistRepository.GetStudentAssistListRepository(new RB_Student_Assist_Extend()
var list = student_AssistRepository.GetStudentAssistListRepository(new RB_Student_Assist_Extend()
{
StuId = StuId
});
......@@ -656,5 +665,60 @@ namespace Edu.Module.Customer
}
return list;
}
/// <summary>
/// 获取客户阶段列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Stage> GetStageListModule(RB_Stage query)
{
var list = stageRepository.GetStageListRepostory(query);
return list;
}
/// <summary>
/// 新增修改客户阶段
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetStageModule(RB_Stage model)
{
bool flag = false;
if (model.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Stage.No),model.No },
{nameof(RB_Stage.StageName),model.StageName },
{nameof(RB_Stage.UpdateBy),model.UpdateBy },
{nameof(RB_Stage.UpdateTime),model.UpdateTime },
};
flag = stageRepository.Update(fileds, new WhereHelper(nameof(RB_Stage.Id), model.Id));
}
else
{
var newId = stageRepository.Insert(model);
model.Id = newId;
flag = newId > 0;
}
return flag;
}
/// <summary>
/// 删除客户阶段
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public bool RemodeStageModule(int Id)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Stage.Status),(int)DateStateEnum.Delete },
};
bool flag = stageRepository.Update(fileds, new WhereHelper(nameof(RB_Stage.Id), Id));
return flag;
}
}
}
using Edu.Model.Entity.System;
using Edu.Common.Enum;
using Edu.Model.Entity.System;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -25,9 +26,13 @@ SELECT A.*
FROM RB_Stage AS A
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Stage.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Stage.Group_Id), query.Group_Id);
}
}
builder.AppendFormat(" ORDER BY A.{0} ASC ", nameof(RB_Stage.No));
return Get<RB_Stage>(builder.ToString()).ToList();
......
......@@ -2,6 +2,7 @@
using Edu.Common.API;
using Edu.Common.Enum.User;
using Edu.Common.Plugin;
using Edu.Model.Entity.System;
using Edu.Model.ViewModel.Customer;
using Edu.Model.ViewModel.User;
using Edu.Module.Customer;
......@@ -479,5 +480,63 @@ namespace Edu.WebApi.Controllers.Customer
}
return ApiResult.Success(data: list);
}
/// <summary>
/// 获取客户阶段
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetStageList()
{
var query = new RB_Stage()
{
Group_Id = base.UserInfo.Group_Id
};
var list = customerStudentModule.GetStageListModule(query);
return ApiResult.Success(data: list);
}
/// <summary>
/// 新增修改客户阶段
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetStage()
{
var model = new RB_Stage()
{
Id = base.ParmJObj.GetInt("Id"),
StageName=base.ParmJObj.GetStringValue("StageName"),
No=base.ParmJObj.GetInt("No"),
};
if (model.No <= 0)
{
return ApiResult.Failed(message: "请填写排序编号!");
}
if (string.IsNullOrEmpty(model.StageName))
{
return ApiResult.Failed(message: "请填写阶段名称!");
}
model.CreateBy = base.UserInfo.Id;
model.UpdateBy = base.UserInfo.Id;
model.CreateTime = DateTime.Now;
model.UpdateTime = DateTime.Now;
model.Group_Id = base.UserInfo.Group_Id;
model.Status = Common.Enum.DateStateEnum.Normal;
bool flag = customerStudentModule.SetStageModule(model);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 根据编号删除客户阶段
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult RemoveStage()
{
var Id = base.ParmJObj.GetInt("Id");
bool flag = customerStudentModule.RemodeStageModule(Id);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
}
}
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