Commit 99a72f2b authored by 黄奎's avatar 黄奎

页面修改

parent c61157e8
......@@ -34,6 +34,11 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
public string CourseName { get; set; }
/// <summary>
/// 课程特色
/// </summary>
public string CourseFeature { get; set; }
/// <summary>
/// 课程分类
/// </summary>
......
......@@ -36,6 +36,11 @@ namespace Edu.Model.ViewModel.Duty
/// </summary>
public string CreateTimeStr { get { return Common.ConvertHelper.FormatTimeStr(this.CreateTime); } }
/// <summary>
/// 创建时间
/// </summary>
public string CreateTimeStr2 { get; set; }
/// <summary>
/// 值班事项名称
/// </summary>
......
......@@ -770,23 +770,47 @@ namespace Edu.Module.Duty
}
//当前班次
var currentModel = new RB_Duty_PlanDetails_ViewModel();
List<RB_Duty_Content_ViewModel> otherContentList = new List<RB_Duty_Content_ViewModel>();
if (model.PlanDetails != null && model.PlanDetails.Count > 0)
{
//查找当前人员索引
int currentIndex = CalcCurrentDutyManIndexModule_V2(model);
if (currentIndex == 0)
//currentIndex == 0 &&
if ( Common.ConvertHelper.FormatDate(model.Date)==Common.ConvertHelper.FormatDate(DateTime.Now))
{
var yestoday = model.Date.AddDays(-1);
var yestodayList= GetMyDutyPlanPageModule(1, 1, out _, new RB_Duty_Plan_ViewModel()
List<RB_Duty_PlanDetails_ViewModel> y_PlanDetails = new List<RB_Duty_PlanDetails_ViewModel>();
var yestodayList= GetMyDutyPlanPageModule(1, 1000, out _, new RB_Duty_Plan_ViewModel()
{
QStartDate = Common.ConvertHelper.FormatDate(yestoday),
QEndDate = Common.ConvertHelper.FormatDate(yestoday),
Group_Id = model.Group_Id
});
});
foreach (var yItem in yestodayList)
{
if (yItem.PlanDetails != null && yItem.PlanDetails.Count > 0)
{
y_PlanDetails.AddRange(yItem.PlanDetails);
}
}
if (y_PlanDetails != null && y_PlanDetails.Count > 0)
{
string maxTime = y_PlanDetails.Max(qitem => qitem.StartTime);
if (!string.IsNullOrEmpty(maxTime))
{
var tempContent = y_PlanDetails.Where(qitem => qitem.StartTime == maxTime)?.FirstOrDefault();
if (tempContent != null)
{
otherContentList = duty_ContentRepository.GetDutyContentListRepository(new RB_Duty_Content_ViewModel()
{
PlanId = Convert.ToInt32(tempContent.PlanId),
PlanShift = Convert.ToInt32(tempContent.Shift),
PlanType = 2
});
}
}
}
}
//当前班次
currentModel = model.PlanDetails[currentIndex];
}
......@@ -853,11 +877,21 @@ namespace Edu.Module.Duty
List<Employee_ViewModel> empList = new List<Employee_ViewModel>();
if (contentList != null)
{
var tempStr = "";
string accountIdStr = string.Join(",", contentList.Select(qitem => qitem.CreateBy));
string accountIdStr2 = string.Join(",", otherContentList.Select(qitem => qitem.CreateBy));
if (!string.IsNullOrEmpty(accountIdStr))
{
empList = accountRepository.GetEmployeeListRepository(new Model.ViewModel.User.Employee_ViewModel() { QIds = accountIdStr });
tempStr += accountIdStr;
}
if (!string.IsNullOrEmpty(accountIdStr2))
{
tempStr += "," + accountIdStr2;
}
if (!string.IsNullOrEmpty(tempStr))
{
empList = accountRepository.GetEmployeeListRepository(new Model.ViewModel.User.Employee_ViewModel() { QIds = tempStr });
}
}
foreach (var item in contentList)
{
......@@ -869,7 +903,7 @@ namespace Edu.Module.Duty
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "OnDutyModule_FileList");
Common.Plugin.LogHelper.Write(ex, "OnDutyModule_V2_FileList");
}
}
}
......@@ -1063,6 +1097,32 @@ namespace Edu.Module.Duty
}
}
}
//上一天最后一个班次交接内容
if (otherContentList != null && otherContentList.Count > 0)
{
foreach (var hItem in otherContentList)
{
try
{
if (!string.IsNullOrEmpty(hItem.FileURL))
{
hItem.FileList = Common.Plugin.JsonHelper.DeserializeObject<List<string>>(hItem.FileURL);
}
else
{
hItem.FileList = new List<string>();
}
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "OnDutyModule_V2_FileList");
}
hItem.IsOperate = 2;
hItem.CreateByName = empList?.Where(qitem => qitem.Id == hItem.CreateBy)?.FirstOrDefault()?.EmployeeName ?? "";
hItem.CreateTimeStr2 = Common.ConvertHelper.FormatDate(hItem.CreateTime) + " " + hItem.CreateTimeStr;
HandoverList.Insert(0,hItem);
}
}
result.Add("HandoverList", HandoverList);
result.Add("HandoverRuleList", dutyItemList.Where(qitem => qitem.DutyCategory == 3 && qitem.DutyType == 1).Select(qitem => new
{
......@@ -1070,7 +1130,6 @@ namespace Edu.Module.Duty
qitem.ItemImgList,
qitem.ItemName
}));
}
return result;
}
......
......@@ -280,7 +280,7 @@ WHERE A.ClassId={0}
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,B.CourseName,D.TeacherName,IFNULL(D.TeacherHead,'') AS TeacherHead,E.SName AS SchoolName,R.RoomName
SELECT A.*,B.CourseName,B.CourseFeature,D.TeacherName,IFNULL(D.TeacherHead,'') AS TeacherHead,E.SName AS SchoolName,R.RoomName
,IFNULL(t.GuestNum,0) AS OrderStudentCount,IFNULL(B.SellPrice,0) AS CourseSellPrice,IFNULL(B.OriginalPrice,0) AS CourseOriginalPrice
FROM rb_class AS A LEFT JOIN rb_course AS B ON A.CouseId=B.CourseId
LEFT JOIN rb_teacher AS D ON A.Teacher_Id=D.TId
......
......@@ -25,14 +25,14 @@ namespace Edu.Repository.Duty
{
rowsCount = 0;
string joinTable = "";
if (query != null && (!string.IsNullOrEmpty(query.QDutyMan)||query.QDutyStatus>-1 || query.QAttendanceStatus>0 ))
if (query != null && (!string.IsNullOrEmpty(query.QDutyMan) || query.QDutyStatus > -1 || query.QAttendanceStatus > 0))
{
string joinWhere = "";
if (!string.IsNullOrEmpty(query.QDutyMan))
{
joinWhere += string.Format(" AND DutyMan IN({0}) ", query.QDutyMan);
}
if (query.QDutyStatus >-1)
if (query.QDutyStatus > -1)
{
joinWhere += string.Format(" AND Status={0} ", query.QDutyStatus);
}
......@@ -66,7 +66,7 @@ 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
{0}
WHERE 1=1
",joinTable);
", joinTable);
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Duty_Plan_ViewModel.Status), (int)DateStateEnum.Normal);
if (query == null)
{
......@@ -162,7 +162,7 @@ WHERE 1=1 AND A.`Status`=0
{
builder.AppendFormat(@" AND B.{0}={1} ", nameof(RB_Duty_PlanDetails_ViewModel.DutyMan), query.QDutyMan);
}
if (query.QShift>0)
if (query.QShift > 0)
{
builder.AppendFormat(@" AND B.{0}={1} ", nameof(RB_Duty_PlanDetails_ViewModel.Shift), query.QShift);
}
......
......@@ -67,6 +67,7 @@ namespace Edu.WebApi.Controllers.Course
x.ClassId,
x.ClassName,
x.CourseName,
x.CourseFeature,
x.ClassHours,
x.TeacherName,
x.TeacherHead,
......
......@@ -432,10 +432,10 @@ namespace Edu.WebApi.Controllers.Duty
{
model.FileURL = "";
}
//if (model.PlanType == 1 && string.IsNullOrEmpty(model.WorkContent))
//{
// return ApiResult.Failed(message: "请填写完成内容!");
//}
if (model.PlanType == 1 && model.ItemType==2 && string.IsNullOrEmpty(model.WorkContent))
{
return ApiResult.Failed(message: "请填写完成内容!");
}
model.Group_Id = base.UserInfo.Group_Id;
model.Status = Common.Enum.DateStateEnum.Normal;
model.CreateBy = 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