Commit f24996eb authored by 黄奎's avatar 黄奎

页面修改

parent 8133a53d
...@@ -85,5 +85,10 @@ namespace Edu.Model.Entity.Duty ...@@ -85,5 +85,10 @@ namespace Edu.Model.Entity.Duty
/// 值班编号 /// 值班编号
/// </summary> /// </summary>
public int PlanId { get; set; } public int PlanId { get; set; }
/// <summary>
/// 到访时间
/// </summary>
public DateTime CreateTime { get; set; }
} }
} }
...@@ -39,5 +39,29 @@ namespace Edu.Model.ViewModel.Duty ...@@ -39,5 +39,29 @@ namespace Edu.Model.ViewModel.Duty
/// 班次 /// 班次
/// </summary> /// </summary>
public int QShift { get; set; } public int QShift { get; set; }
/// <summary>
/// 值班状态(0-未开始,1-值班中,2-值班完成)
/// </summary>
public int DutyStatus { get; set; }
/// <summary>
/// 值班状态字符串
/// </summary>
public string DutyStatusStr
{
get
{
string str = "";
switch (this.DutyStatus)
{
case 0: str = "未开始"; break;
case 1: str = "值班中"; break;
case 2: str = "值班完成"; break;
}
return str;
}
}
} }
} }
...@@ -329,7 +329,8 @@ namespace Edu.Module.Duty ...@@ -329,7 +329,8 @@ namespace Edu.Module.Duty
var c_workModel = currentPlanContetList?.Where(qitem => qitem.ItemId == item.Id)?.FirstOrDefault(); var c_workModel = currentPlanContetList?.Where(qitem => qitem.ItemId == item.Id)?.FirstOrDefault();
var pObj = new var pObj = new
{ {
item.Id, Id = c_workModel?.Id ?? 0,
ItemId =item.Id,
item.ItemName, item.ItemName,
item.ItemType, item.ItemType,
IsChecked = c_workModel?.WorkIsFinish ?? 0, IsChecked = c_workModel?.WorkIsFinish ?? 0,
...@@ -403,6 +404,19 @@ namespace Edu.Module.Duty ...@@ -403,6 +404,19 @@ namespace Edu.Module.Duty
public bool SetDutyContentModule(RB_Duty_Content_ViewModel model) public bool SetDutyContentModule(RB_Duty_Content_ViewModel model)
{ {
bool flag = false; bool flag = false;
if (model.PlanType == 1)
{
model.FileURL = "";
model.OtherContent = "";
model.OtherRemark = "";
}
else
{
model.WorkContent = "";
model.ItemId = 0;
model.WorkIsFinish = 0;
}
if (model.Id > 0) if (model.Id > 0)
{ {
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
...@@ -476,6 +490,9 @@ namespace Edu.Module.Duty ...@@ -476,6 +490,9 @@ namespace Edu.Module.Duty
{ nameof(RB_Visitor_ViewModel.CourseName), model.CourseName}, { nameof(RB_Visitor_ViewModel.CourseName), model.CourseName},
{ nameof(RB_Visitor_ViewModel.StudyTime), model.StudyTime}, { nameof(RB_Visitor_ViewModel.StudyTime), model.StudyTime},
{ nameof(RB_Visitor_ViewModel.LevelType), model.LevelType}, { nameof(RB_Visitor_ViewModel.LevelType), model.LevelType},
{ nameof(RB_Visitor_ViewModel.Evaluate), model.Evaluate},
{ nameof(RB_Visitor_ViewModel.Remark), model.Remark},
{ nameof(RB_Visitor_ViewModel.VisitorStatus), model.VisitorStatus},
}; };
flag = visitorRepository.Update(fileds, new WhereHelper(nameof(RB_Visitor_ViewModel.Id), model.Id)); flag = visitorRepository.Update(fileds, new WhereHelper(nameof(RB_Visitor_ViewModel.Id), model.Id));
} }
......
...@@ -66,7 +66,7 @@ WHERE 1=1 ...@@ -66,7 +66,7 @@ WHERE 1=1
SELECT A.ID,A.Date,IFNULL(C.SName,'') AS SchoolName,A.CreateBy,A.School_Id SELECT A.ID,A.Date,IFNULL(C.SName,'') AS SchoolName,A.CreateBy,A.School_Id
FROM RB_Duty_Plan AS A INNER JOIN rb_duty_plandetails AS B ON A.Id=B.PlanId FROM RB_Duty_Plan AS A INNER JOIN rb_duty_plandetails AS B ON A.Id=B.PlanId
INNER JOIN rb_school AS C ON A.School_Id=C.SId INNER JOIN rb_school AS C ON A.School_Id=C.SId
WHERE 1=1 AND A.`Status`=0 AND B.`Status`=0 WHERE 1=1 AND A.`Status`=0
"); ");
if (query == null) if (query == null)
{ {
......
...@@ -84,7 +84,7 @@ namespace Edu.WebApi.Controllers.Duty ...@@ -84,7 +84,7 @@ namespace Edu.WebApi.Controllers.Duty
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString()); var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Duty_Plan_ViewModel() var query = new RB_Duty_Plan_ViewModel()
{ {
School_Id = base.ParmJObj.GetInt("School_Id") School_Id = base.ParmJObj.GetInt("School_Id"),
}; };
query.QDutyMan = base.UserInfo.Id; query.QDutyMan = base.UserInfo.Id;
query.Group_Id = base.UserInfo.Group_Id; query.Group_Id = base.UserInfo.Group_Id;
...@@ -124,6 +124,21 @@ namespace Edu.WebApi.Controllers.Duty ...@@ -124,6 +124,21 @@ namespace Edu.WebApi.Controllers.Duty
nextModel = item.PlanDetails[nextIndex]; nextModel = item.PlanDetails[nextIndex];
} }
} }
var dutyStartTime = Convert.ToDateTime(Common.ConvertHelper.FormatDate(item.Date) + " " + currentModel.StartTime);
var dutyEndTime = Convert.ToDateTime(Common.ConvertHelper.FormatDate(item.Date) + " " + currentModel.EndTime);
if (DateTime.Now > dutyEndTime)
{
item.DutyStatus = 2;
}
else if (DateTime.Now >= dutyStartTime && DateTime.Now <= dutyEndTime)
{
item.DutyStatus = 1;
}
else
{
item.DutyStatus = 0;
}
result.Add(new result.Add(new
{ {
item.Id, item.Id,
...@@ -137,6 +152,8 @@ namespace Edu.WebApi.Controllers.Duty ...@@ -137,6 +152,8 @@ namespace Edu.WebApi.Controllers.Duty
ReciveMan = nextModel?.DutyManName ?? "", ReciveMan = nextModel?.DutyManName ?? "",
GiveMan = previousModel?.DutyManName ?? "", GiveMan = previousModel?.DutyManName ?? "",
item.CreateByName, item.CreateByName,
item.DutyStatus,
item.DutyStatusStr,
}); });
} }
pageModel.Count = rowsCount; pageModel.Count = rowsCount;
...@@ -236,15 +253,15 @@ namespace Edu.WebApi.Controllers.Duty ...@@ -236,15 +253,15 @@ namespace Edu.WebApi.Controllers.Duty
var model = new RB_Duty_Content_ViewModel() var model = new RB_Duty_Content_ViewModel()
{ {
Id = base.ParmJObj.GetInt("Id"), Id = base.ParmJObj.GetInt("Id"),
PlanShift=base.ParmJObj.GetInt("PlanShift"), PlanShift = base.ParmJObj.GetInt("PlanShift"),
PlanType=base.ParmJObj.GetInt("PlanType"), PlanType = base.ParmJObj.GetInt("PlanType"),
PlanId=base.ParmJObj.GetInt("PlanId"), PlanId = base.ParmJObj.GetInt("PlanId"),
FileURL = base.ParmJObj.GetStringValue("FileURL"), FileURL = base.ParmJObj.GetStringValue("FileURL"),
OtherContent=base.ParmJObj.GetStringValue("OtherContent"), OtherContent = base.ParmJObj.GetStringValue("OtherContent"),
OtherRemark=base.ParmJObj.GetStringValue("OtherRemark"), OtherRemark = base.ParmJObj.GetStringValue("OtherRemark"),
WorkContent=base.ParmJObj.GetStringValue("WorkContent"), WorkContent = base.ParmJObj.GetStringValue("WorkContent"),
WorkIsFinish = base.ParmJObj.GetInt("WorkIsFinish"), WorkIsFinish = base.ParmJObj.GetInt("WorkIsFinish"),
ItemId=base.ParmJObj.GetInt("ItemId"), ItemId = base.ParmJObj.GetInt("ItemId"),
}; };
model.Group_Id = base.UserInfo.Group_Id; model.Group_Id = base.UserInfo.Group_Id;
model.Status = Common.Enum.DateStateEnum.Normal; model.Status = Common.Enum.DateStateEnum.Normal;
...@@ -304,7 +321,8 @@ namespace Edu.WebApi.Controllers.Duty ...@@ -304,7 +321,8 @@ namespace Edu.WebApi.Controllers.Duty
item.VisitorStatusStr, item.VisitorStatusStr,
item.Evaluate, item.Evaluate,
item.VisitTimes, item.VisitTimes,
item.Remark item.Remark,
CreateTimeStr = Common.ConvertHelper.FormatDate(item.CreateTime)
}); });
} }
pageModel.Count = rowsCount; pageModel.Count = rowsCount;
...@@ -329,12 +347,15 @@ namespace Edu.WebApi.Controllers.Duty ...@@ -329,12 +347,15 @@ namespace Edu.WebApi.Controllers.Duty
CourseName = base.ParmJObj.GetStringValue("CourseName"), CourseName = base.ParmJObj.GetStringValue("CourseName"),
StudyTime = base.ParmJObj.GetStringValue("StudyTime"), StudyTime = base.ParmJObj.GetStringValue("StudyTime"),
LevelType = base.ParmJObj.GetStringValue("LevelType"), LevelType = base.ParmJObj.GetStringValue("LevelType"),
PlanId=base.ParmJObj.GetInt("PlanId"), PlanId = base.ParmJObj.GetInt("PlanId"),
Remark = base.ParmJObj.GetStringValue("Remark"),
Evaluate = base.ParmJObj.GetStringValue("Evaluate"),
VisitorStatus = base.ParmJObj.GetInt("VisitorStatus")
}; };
model.Group_Id = base.UserInfo.Group_Id; model.Group_Id = base.UserInfo.Group_Id;
model.Status = Common.Enum.DateStateEnum.Normal; model.Status = Common.Enum.DateStateEnum.Normal;
model.CreateBy = base.UserInfo.Id; model.CreateBy = base.UserInfo.Id;
model.VisitorStatus = 1; model.CreateTime = DateTime.Now;
bool flag = dutyPlanModule.SetVisitorModule(model); bool flag = dutyPlanModule.SetVisitorModule(model);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
...@@ -348,7 +369,7 @@ namespace Edu.WebApi.Controllers.Duty ...@@ -348,7 +369,7 @@ namespace Edu.WebApi.Controllers.Duty
{ {
var Id = base.ParmJObj.GetInt("Id"); var Id = base.ParmJObj.GetInt("Id");
int Status = base.ParmJObj.GetInt("Status"); int Status = base.ParmJObj.GetInt("Status");
var model = dutyPlanModule.RemoveVisitorModule(Id,Status); var model = dutyPlanModule.RemoveVisitorModule(Id, Status);
return ApiResult.Success(data: model); return ApiResult.Success(data: model);
} }
......
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