Commit 0af0c655 authored by 黄奎's avatar 黄奎

页面修改

parent cd2d9c42
......@@ -36,5 +36,11 @@ namespace Edu.Common.Enum.Sale
/// </summary>
[EnumField("别科")]
OtherBranches = 5,
/// <summary>
/// 直通车
/// </summary>
[EnumField("直通车")]
Through = 6,
}
}
......@@ -31,6 +31,11 @@ namespace Edu.Model.ViewModel.Duty
/// </summary>
public string EndTime { get; set; }
/// <summary>
/// 值班人员
/// </summary>
public string QDutyMan { get; set; }
/// <summary>
/// 值班人员姓名
/// </summary>
......
......@@ -34,7 +34,9 @@ namespace Edu.Model.ViewModel.Duty
/// <summary>
/// 值班人员
/// </summary>
public int QDutyMan { get; set; }
public string QDutyMan { get; set; }
/// <summary>
/// 班次
......
......@@ -67,7 +67,8 @@ namespace Edu.Module.Duty
List<RB_Duty_PlanDetails_ViewModel> planDetails = new List<RB_Duty_PlanDetails_ViewModel>();
if (!string.IsNullOrEmpty(ids))
{
planDetails = GetDutyPlanDetailsListModule(new RB_Duty_PlanDetails_ViewModel() { QPlanIds = ids }, IsQueryDutyMan: true);
//QDutyMan=query.QDutyMan
planDetails = GetDutyPlanDetailsListModule(new RB_Duty_PlanDetails_ViewModel() { QPlanIds = ids ,}, IsQueryDutyMan: true);
}
foreach (var item in list)
{
......@@ -388,7 +389,7 @@ namespace Edu.Module.Duty
public object OnDutyModule(int Id, int Shift, UserInfo user)
{
object result = new object();
var model = GetMyDutyPlanPageModule(1, 1, out _, new RB_Duty_Plan_ViewModel() { Id = Id, QDutyMan = user.Id, QShift = Shift })?.FirstOrDefault();
var model = GetMyDutyPlanPageModule(1, 1, out _, new RB_Duty_Plan_ViewModel() { Id = Id, QDutyMan = user.Id.ToString(), QShift = Shift })?.FirstOrDefault();
if (model == null)
{
return result;
......
......@@ -39,6 +39,10 @@ WHERE 1=1
{
builder.AppendFormat(@" AND A.{0} IN({1}) ", nameof(RB_Duty_PlanDetails_ViewModel.PlanId), query.QPlanIds);
}
if (!string.IsNullOrEmpty(query.QDutyMan))
{
builder.AppendFormat(@" AND A.{0} IN({1}) ", nameof(RB_Duty_PlanDetails_ViewModel.DutyMan), query.QDutyMan);
}
}
builder.AppendFormat(" ORDER BY B.{0} ASC ", nameof(RB_Duty_Frequency_ViewModel.StartTime));
return Get<RB_Duty_PlanDetails_ViewModel>(builder.ToString()).ToList();
......
......@@ -24,12 +24,19 @@ namespace Edu.Repository.Duty
public List<RB_Duty_Plan_ViewModel> GetDutyPlanPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_Duty_Plan_ViewModel query)
{
rowsCount = 0;
string joinTable = "";
if (query != null && !string.IsNullOrEmpty(query.QDutyMan))
{
joinTable = string.Format(" INNER JOIN (SELECT PlanId,DutyMan FROM rb_duty_plandetails WHERE 1=1 AND DutyMan IN({0})) AS C ON A.Id=C.PlanId ", query.QDutyMan);
}
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.* ,IFNULL(B.SName,'') AS SchoolName
FROM RB_Duty_Plan AS A LEFT JOIN rb_school AS B ON A.School_Id=B.SId
FROM RB_Duty_Plan AS A LEFT JOIN rb_school AS B ON A.School_Id=B.SId
{0}
WHERE 1=1
");
",joinTable);
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Duty_Plan_ViewModel.Status), (int)DateStateEnum.Normal);
if (query == null)
{
......@@ -108,7 +115,7 @@ WHERE 1=1 AND A.`Status`=0
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Duty_Plan_ViewModel.Group_Id), query.Group_Id);
}
if (query.QDutyMan > 0)
if (!string.IsNullOrEmpty(query.QDutyMan))
{
builder.AppendFormat(@" AND B.{0}={1} ", nameof(RB_Duty_PlanDetails_ViewModel.DutyMan), query.QDutyMan);
}
......
......@@ -37,6 +37,11 @@ namespace Edu.WebApi.Controllers.Duty
QStartDate = base.ParmJObj.GetStringValue("StartDate"),
QEndDate = base.ParmJObj.GetStringValue("EndDate"),
};
var dutyManList = Common.Plugin.JsonHelper.DeserializeObject<List<int>>(base.ParmJObj.GetStringValue("EmployeeIds"));
if (dutyManList != null && dutyManList.Count > 0)
{
query.QDutyMan = string.Join(",", dutyManList);
}
query.SchoolIdList = Common.Plugin.JsonHelper.DeserializeObject<List<int>>(base.ParmJObj.GetStringValue("School_Ids"));
query.Group_Id = base.UserInfo.Group_Id;
List<object> result = new List<object>();
......@@ -92,7 +97,7 @@ namespace Edu.WebApi.Controllers.Duty
{
School_Id = base.ParmJObj.GetInt("School_Id"),
};
query.QDutyMan = base.UserInfo.Id;
query.QDutyMan = base.UserInfo.Id.ToString();
query.Group_Id = base.UserInfo.Group_Id;
List<object> result = new List<object>();
var list = dutyPlanModule.GetMyDutyPlanPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
......
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