From d47543bdc97a053fc1e9d4990b072bffd5a084b5 Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Fri, 2 Dec 2022 17:59:35 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E8=AF=BE?= =?UTF-8?q?=E8=A1=A8=E8=AF=B7=E5=81=87=E5=AE=A1=E6=A0=B8=E6=97=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StuAttendanceLeaveController.cs | 69 +++++++++--------- .../Modules/StuAttendanceLeaveApi.cs | 71 ++++++++++--------- 2 files changed, 74 insertions(+), 66 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuAttendanceLeaveController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuAttendanceLeaveController.cs index 29b5b984b..c2109c515 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuAttendanceLeaveController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuAttendanceLeaveController.cs @@ -142,40 +142,43 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { if (entity.IsCheck == "1") { - var gender = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(entity.StuNo)?.GenderNo; - StuAttendanceEntity stuAttendanceEntity = new StuAttendanceEntity(); - stuAttendanceEntity.AcademicYearNo = entity.AcademicYearNo; - stuAttendanceEntity.Semester = entity.Semester; - stuAttendanceEntity.StuNo = entity.StuNo; - stuAttendanceEntity.StuName = entity.StuName; - stuAttendanceEntity.Gender = Convert.ToBoolean(gender) ? "男" : "女"; - stuAttendanceEntity.Grade = entity.Grade; - stuAttendanceEntity.DeptNo = entity.DeptNo; - stuAttendanceEntity.DeptName = entity.DeptName; - stuAttendanceEntity.MajorNo = entity.MajorNo; - stuAttendanceEntity.MajorName = entity.MajorName; - stuAttendanceEntity.ClassNo = entity.ClassNo; - stuAttendanceEntity.ClassName = entity.ClassName; - stuAttendanceEntity.LessonNo = entity.LessonNo; - stuAttendanceEntity.LessonName = entity.LessonName; - stuAttendanceEntity.TeachClassNo = entity.TeachClassNo; - stuAttendanceEntity.LessonSortNo = entity.LessonSortNo; - stuAttendanceEntity.LessonSortName = entity.LessonSortName; - stuAttendanceEntity.LessonDate = entity.LessonDate; - stuAttendanceEntity.PlanWeek = null; - stuAttendanceEntity.LessonTime = entity.LessonTime; - stuAttendanceEntity.AttendOrNo = "否"; - stuAttendanceEntity.Sort = Convert.ToInt32(entity.LeaveType)==2?"病假":"事假"; - stuAttendanceEntity.EmpNo = entity.EmpNo; - stuAttendanceEntity.Remark = "属于PC端的学生课表请假审核"; - stuAttendanceEntity.CheckMarkDept = ""; - stuAttendanceEntity.CheckMark = ""; - stuAttendanceEntity.InertDate = DateTime.Now; - stuAttendanceEntity.ClassRoomNo = entity.ClassRoomNo; - stuAttendanceEntity.ClassRoomName = entity.ClassRoomName; - - stuAttendanceIBLL.SaveEntity("", stuAttendanceEntity); + var model = stuAttendanceLeaveIBLL.GetStuAttendanceLeaveEntity(keyValue); + if (model != null) + { + var gender = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(model.StuNo)?.GenderNo; + StuAttendanceEntity stuAttendanceEntity = new StuAttendanceEntity(); + stuAttendanceEntity.AcademicYearNo = model.AcademicYearNo; + stuAttendanceEntity.Semester = model.Semester; + stuAttendanceEntity.StuNo = model.StuNo; + stuAttendanceEntity.StuName = model.StuName; + stuAttendanceEntity.Gender = Convert.ToBoolean(gender) ? "男" : "女"; + stuAttendanceEntity.Grade = model.Grade; + stuAttendanceEntity.DeptNo = model.DeptNo; + stuAttendanceEntity.DeptName = model.DeptName; + stuAttendanceEntity.MajorNo = model.MajorNo; + stuAttendanceEntity.MajorName = model.MajorName; + stuAttendanceEntity.ClassNo = model.ClassNo; + stuAttendanceEntity.ClassName = model.ClassName; + stuAttendanceEntity.LessonNo = model.LessonNo; + stuAttendanceEntity.LessonName = model.LessonName; + stuAttendanceEntity.TeachClassNo = model.TeachClassNo; + stuAttendanceEntity.LessonSortNo = model.LessonSortNo; + stuAttendanceEntity.LessonSortName = model.LessonSortName; + stuAttendanceEntity.LessonDate = model.LessonDate; + stuAttendanceEntity.PlanWeek = null; + stuAttendanceEntity.LessonTime = model.LessonTime; + stuAttendanceEntity.AttendOrNo = "否"; + stuAttendanceEntity.Sort = Convert.ToInt32(model.LeaveType) == 2 ? "病假" : "事假"; + stuAttendanceEntity.EmpNo = model.EmpNo; + stuAttendanceEntity.Remark = "属于PC端的学生课表请假审核"; + stuAttendanceEntity.CheckMarkDept = ""; + stuAttendanceEntity.CheckMark = ""; + stuAttendanceEntity.InertDate = DateTime.Now; + stuAttendanceEntity.ClassRoomNo = model.ClassRoomNo; + stuAttendanceEntity.ClassRoomName = model.ClassRoomName; + stuAttendanceIBLL.SaveEntity("", stuAttendanceEntity); + } } } return Success("保存成功!"); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StuAttendanceLeaveApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StuAttendanceLeaveApi.cs index 9ccc8e208..b22dae569 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StuAttendanceLeaveApi.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StuAttendanceLeaveApi.cs @@ -139,39 +139,44 @@ namespace Learun.Application.WebApi { if (entity.IsCheck == "1") { - var gender = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(entity.StuNo)?.GenderNo; - StuAttendanceEntity stuAttendanceEntity = new StuAttendanceEntity(); - stuAttendanceEntity.AcademicYearNo = entity.AcademicYearNo; - stuAttendanceEntity.Semester = entity.Semester; - stuAttendanceEntity.StuNo = entity.StuNo; - stuAttendanceEntity.StuName = entity.StuName; - stuAttendanceEntity.Gender = Convert.ToBoolean(gender) ? "男" : "女"; - stuAttendanceEntity.Grade = entity.Grade; - stuAttendanceEntity.DeptNo = entity.DeptNo; - stuAttendanceEntity.DeptName = entity.DeptName; - stuAttendanceEntity.MajorNo = entity.MajorNo; - stuAttendanceEntity.MajorName = entity.MajorName; - stuAttendanceEntity.ClassNo = entity.ClassNo; - stuAttendanceEntity.ClassName = entity.ClassName; - stuAttendanceEntity.LessonNo = entity.LessonNo; - stuAttendanceEntity.LessonName = entity.LessonName; - stuAttendanceEntity.TeachClassNo = entity.TeachClassNo; - stuAttendanceEntity.LessonSortNo = entity.LessonSortNo; - stuAttendanceEntity.LessonSortName = entity.LessonSortName; - stuAttendanceEntity.LessonDate = entity.LessonDate; - stuAttendanceEntity.PlanWeek = null; - stuAttendanceEntity.LessonTime = entity.LessonTime; - stuAttendanceEntity.AttendOrNo = "否"; - stuAttendanceEntity.Sort = Convert.ToInt32(entity.LeaveType) == 2 ? "病假" : "事假"; - stuAttendanceEntity.EmpNo = entity.EmpNo; - stuAttendanceEntity.Remark = "属于移动端的学生课表请假审核"; - stuAttendanceEntity.CheckMark = ""; - stuAttendanceEntity.CheckMarkDept = ""; - stuAttendanceEntity.InertDate = DateTime.Now; - stuAttendanceEntity.ClassRoomNo = entity.ClassRoomNo; - stuAttendanceEntity.ClassRoomName = entity.ClassRoomName; - - stuAttendanceIBLL.SaveEntity("", stuAttendanceEntity); + var model = stuAttendanceLeaveIBLL.GetStuAttendanceLeaveEntity(parameter.keyValue); + if (model != null) + { + var gender = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(model.StuNo)?.GenderNo; + StuAttendanceEntity stuAttendanceEntity = new StuAttendanceEntity(); + stuAttendanceEntity.AcademicYearNo = model.AcademicYearNo; + stuAttendanceEntity.Semester = model.Semester; + stuAttendanceEntity.StuNo = model.StuNo; + stuAttendanceEntity.StuName = model.StuName; + stuAttendanceEntity.Gender = Convert.ToBoolean(gender) ? "男" : "女"; + stuAttendanceEntity.Grade = model.Grade; + stuAttendanceEntity.DeptNo = model.DeptNo; + stuAttendanceEntity.DeptName = model.DeptName; + stuAttendanceEntity.MajorNo = model.MajorNo; + stuAttendanceEntity.MajorName = model.MajorName; + stuAttendanceEntity.ClassNo = model.ClassNo; + stuAttendanceEntity.ClassName = model.ClassName; + stuAttendanceEntity.LessonNo = model.LessonNo; + stuAttendanceEntity.LessonName = model.LessonName; + stuAttendanceEntity.TeachClassNo = model.TeachClassNo; + stuAttendanceEntity.LessonSortNo = model.LessonSortNo; + stuAttendanceEntity.LessonSortName = model.LessonSortName; + stuAttendanceEntity.LessonDate = model.LessonDate; + stuAttendanceEntity.PlanWeek = null; + stuAttendanceEntity.LessonTime = model.LessonTime; + stuAttendanceEntity.AttendOrNo = "否"; + stuAttendanceEntity.Sort = Convert.ToInt32(model.LeaveType) == 2 ? "病假" : "事假"; + stuAttendanceEntity.EmpNo = model.EmpNo; + stuAttendanceEntity.Remark = "属于移动端的学生课表请假审核"; + stuAttendanceEntity.CheckMark = ""; + stuAttendanceEntity.CheckMarkDept = ""; + stuAttendanceEntity.InertDate = DateTime.Now; + stuAttendanceEntity.ClassRoomNo = model.ClassRoomNo; + stuAttendanceEntity.ClassRoomName = model.ClassRoomName; + + stuAttendanceIBLL.SaveEntity("", stuAttendanceEntity); + + } } }