@@ -74,43 +74,51 @@ namespace Learun.Application.WebApi.Modules | |||||
/// <returns></returns> | /// <returns></returns> | ||||
public Response WxUpload(dynamic _) | public Response WxUpload(dynamic _) | ||||
{ | { | ||||
var files = (List<HttpFile>)this.Context.Request.Files; | |||||
string folderId = Request.Form["folderId"]; | |||||
string filePath = Config.GetValue("AnnexesFile"); | |||||
string uploadDate = DateTime.Now.ToString("yyyyMMdd"); | |||||
string fileEextension = Path.GetExtension(files[0].Name); | |||||
string fileType = fileEextension.Replace(".", ""); | |||||
string fileGuid = Guid.NewGuid().ToString(); | |||||
string virtualPath = string.Format("{0}/{1}/{2}/{3}{4}", filePath, userInfo.userId, uploadDate, fileGuid, fileEextension); | |||||
//创建文件夹 | |||||
string path = Path.GetDirectoryName(virtualPath); | |||||
Directory.CreateDirectory(path); | |||||
AnnexesFileEntity fileAnnexesEntity = new AnnexesFileEntity(); | |||||
if (!System.IO.File.Exists(virtualPath)) | |||||
try | |||||
{ | { | ||||
byte[] bytes = new byte[files[0].Value.Length]; | |||||
files[0].Value.Read(bytes, 0, bytes.Length); | |||||
FileInfo file = new FileInfo(virtualPath); | |||||
FileStream fs = file.Create(); | |||||
fs.Write(bytes, 0, bytes.Length); | |||||
fs.Close(); | |||||
//文件信息写入数据库 | |||||
fileAnnexesEntity.F_Id = fileGuid; | |||||
fileAnnexesEntity.F_FileName = files[0].Name; | |||||
fileAnnexesEntity.F_FilePath = virtualPath; | |||||
fileAnnexesEntity.F_FileSize = files[0].Value.Length.ToString(); | |||||
fileAnnexesEntity.F_FileExtensions = fileEextension; | |||||
fileAnnexesEntity.F_FileType = fileType; | |||||
fileAnnexesEntity.F_CreateUserId = userInfo.userId; | |||||
fileAnnexesEntity.F_CreateUserName = userInfo.realName; | |||||
var files = (List<HttpFile>)this.Context.Request.Files; | |||||
string folderId = Request.Form["folderId"]; | |||||
string filePath = Config.GetValue("AnnexesFile"); | |||||
string uploadDate = DateTime.Now.ToString("yyyyMMdd"); | |||||
string fileEextension = Path.GetExtension(files[0].Name); | |||||
string fileType = fileEextension.Replace(".", ""); | |||||
string fileGuid = Guid.NewGuid().ToString(); | |||||
string virtualPath = string.Format("{0}/{1}/{2}/{3}{4}", filePath, userInfo.userId, uploadDate, fileGuid, fileEextension); | |||||
//创建文件夹 | |||||
string path = Path.GetDirectoryName(virtualPath); | |||||
Directory.CreateDirectory(path); | |||||
AnnexesFileEntity fileAnnexesEntity = new AnnexesFileEntity(); | |||||
if (!System.IO.File.Exists(virtualPath)) | |||||
{ | |||||
byte[] bytes = new byte[files[0].Value.Length]; | |||||
files[0].Value.Read(bytes, 0, bytes.Length); | |||||
FileInfo file = new FileInfo(virtualPath); | |||||
FileStream fs = file.Create(); | |||||
fs.Write(bytes, 0, bytes.Length); | |||||
fs.Close(); | |||||
//文件信息写入数据库 | |||||
fileAnnexesEntity.F_Id = fileGuid; | |||||
fileAnnexesEntity.F_FileName = files[0].Name; | |||||
fileAnnexesEntity.F_FilePath = virtualPath; | |||||
fileAnnexesEntity.F_FileSize = files[0].Value.Length.ToString(); | |||||
fileAnnexesEntity.F_FileExtensions = fileEextension; | |||||
fileAnnexesEntity.F_FileType = fileType; | |||||
fileAnnexesEntity.F_CreateUserId = userInfo.userId; | |||||
fileAnnexesEntity.F_CreateUserName = userInfo.realName; | |||||
annexesFileIBLL.SaveEntity(folderId, fileAnnexesEntity); | |||||
} | |||||
annexesFileIBLL.SaveEntity(folderId, fileAnnexesEntity); | |||||
return SuccessString(folderId); | |||||
} | } | ||||
catch (Exception e) | |||||
{ | |||||
return SuccessString(folderId); | |||||
return Fail($"上传失败({e.Message})"); | |||||
} | |||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -2276,6 +2276,8 @@ group by AcademicYearNo,Semester,DeptNo,MajorNo,LessonNo,TeachClassNo,EmpNo,Les | |||||
{ | { | ||||
int snum = 0; | int snum = 0; | ||||
int fnum = 0; | int fnum = 0; | ||||
//插入时间 | |||||
var Insertdate = DateTime.Now; | |||||
if (dt.Rows.Count > 0) | if (dt.Rows.Count > 0) | ||||
{ | { | ||||
DataTable failDt = new DataTable(); | DataTable failDt = new DataTable(); | ||||
@@ -2297,7 +2299,7 @@ group by AcademicYearNo,Semester,DeptNo,MajorNo,LessonNo,TeachClassNo,EmpNo,Les | |||||
#region 必填项空验证 | #region 必填项空验证 | ||||
if (dr["上课日期"].ToString().IsEmpty()) | if (dr["上课日期"].ToString().IsEmpty()) | ||||
{ | { | ||||
throw (new Exception("资上课日期不能为空")); | |||||
throw (new Exception("上课日期不能为空")); | |||||
} | } | ||||
if (dr["开始时间"].ToString().IsEmpty()) | if (dr["开始时间"].ToString().IsEmpty()) | ||||
{ | { | ||||
@@ -2313,68 +2315,124 @@ group by AcademicYearNo,Semester,DeptNo,MajorNo,LessonNo,TeachClassNo,EmpNo,Les | |||||
} | } | ||||
if (dr["学期"].ToString().IsEmpty()) | if (dr["学期"].ToString().IsEmpty()) | ||||
{ | { | ||||
throw (new Exception("学期入账日期不能为空")); | |||||
throw (new Exception("学期不能为空")); | |||||
} | } | ||||
if (dr["班级"].ToString().IsEmpty()) | |||||
if (dr["班级编号"].ToString().IsEmpty()) | |||||
{ | { | ||||
throw (new Exception("班级类型不能为空")); | |||||
throw (new Exception("班级编号不能为空")); | |||||
} | } | ||||
if (dr["课程"].ToString().IsEmpty()) | |||||
if (dr["班级名称"].ToString().IsEmpty()) | |||||
{ | { | ||||
throw (new Exception("课程不能为空")); | |||||
throw (new Exception("班级名称不能为空")); | |||||
} | } | ||||
if (dr["教师姓名"].ToString().IsEmpty()) | |||||
if (dr["课程编号"].ToString().IsEmpty()) | |||||
{ | { | ||||
throw (new Exception("教师姓名不能为空")); | |||||
throw (new Exception("课程编号不能为空")); | |||||
} | } | ||||
if (dr["上课时间"].ToString().IsEmpty()) | |||||
if (dr["课程名称"].ToString().IsEmpty()) | |||||
{ | { | ||||
throw (new Exception("上课时间不能为空")); | |||||
throw (new Exception("课程名称不能为空")); | |||||
} | |||||
if (dr["教师编号"].ToString().IsEmpty()) | |||||
{ | |||||
throw (new Exception("教师编号不能为空")); | |||||
} | |||||
if (dr["教师名称"].ToString().IsEmpty()) | |||||
{ | |||||
throw (new Exception("教师名称不能为空")); | |||||
} | |||||
if (dr["教室编号"].ToString().IsEmpty()) | |||||
{ | |||||
throw (new Exception("教室编号不能为空")); | |||||
} | |||||
if (dr["教室名称"].ToString().IsEmpty()) | |||||
{ | |||||
throw (new Exception("教室名称不能为空")); | |||||
} | |||||
if (dr["上课节次"].ToString().IsEmpty()) | |||||
{ | |||||
throw (new Exception("上课节次不能为空")); | |||||
} | } | ||||
if (dr["是否必修课"].ToString().IsEmpty()) | if (dr["是否必修课"].ToString().IsEmpty()) | ||||
{ | { | ||||
throw (new Exception("是否必修课不能为空")); | throw (new Exception("是否必修课不能为空")); | ||||
} | } | ||||
#endregion | #endregion | ||||
//插入时间 | |||||
var Insertdate = DateTime.Now; | |||||
var LessonName = dr["课程"].ToString(); | |||||
var ClassName = dr["班级"].ToString(); | |||||
var ClassroomName = dr["教室"].ToString(); | |||||
var EmpName = dr["教师姓名"].ToString(); | |||||
//var LessonName = dr["课程"].ToString(); | |||||
//var ClassName = dr["班级"].ToString(); | |||||
//var ClassroomName = dr["教室"].ToString(); | |||||
//var EmpName = dr["教师姓名"].ToString(); | |||||
//基础数据 | //基础数据 | ||||
var lessonEntity = BaseRepository("CollegeMIS").FindEntity<LessonInfoEntity>(x => x.LessonName == LessonName); | |||||
var classEntity = BaseRepository("CollegeMIS").FindEntity<ClassInfoEntity>(x => x.ClassName == ClassName); | |||||
var classroomEntity = BaseRepository("CollegeMIS").FindEntity<ClassroomInfoEntity>(x => x.ClassroomName == ClassroomName); | |||||
var lessonEntity = db.FindList<LessonInfoEntity>($"select * from Lessoninfo where LessonName='" + dr["课程名称"].ToString().Trim() + "' and LessonNo='" + dr["课程编号"].ToString().Trim() + "'"); | |||||
var classEntity = db.FindList<ClassInfoEntity>($"select * from ClassInfo where ClassName='" + dr["班级名称"].ToString().Trim() + "' and ClassNo='" + dr["班级编号"].ToString().Trim() + "'"); | |||||
var classroomEntity = db.FindList<ClassroomInfoEntity>($"select * from ClassroomInfo where ClassroomName='" + dr["教室名称"].ToString().Trim() + "' and ClassroomNo='" + dr["教室编号"].ToString().Trim() + "'"); | |||||
var empinfoEntity = db.FindList<EmpInfoEntity>($"select * from EmpInfo where EmpName='" + dr["教师名称"].ToString().Trim() + "' and EmpNo='" + dr["教师编号"].ToString().Trim() + "'"); | |||||
var CompanyEntity = BaseRepository().FindList<CompanyEntity>(x => x.F_EnabledMark == 1).ToList().FirstOrDefault(); | var CompanyEntity = BaseRepository().FindList<CompanyEntity>(x => x.F_EnabledMark == 1).ToList().FirstOrDefault(); | ||||
var empinfoEntity = BaseRepository("CollegeMIS").FindEntity<EmpInfoEntity>(x => x.EmpName == EmpName); | |||||
if (lessonEntity.Count() <= 0) | |||||
throw (new Exception("查无此课程")); | |||||
if (classEntity.Count() <= 0) | |||||
throw (new Exception("查无此班级")); | |||||
if (empinfoEntity.Count() <= 0) | |||||
throw (new Exception("查无此教师")); | |||||
if (classroomEntity.Count() <= 0) | |||||
throw (new Exception("查无此教室")); | |||||
//var lessonEntity = BaseRepository("CollegeMIS").FindEntity<LessonInfoEntity>(x => x.LessonName == dr["课程名称"].ToString() && x.LessonNo == dr["课程编号"].ToString()); | |||||
//var classEntity = BaseRepository("CollegeMIS").FindEntity<ClassInfoEntity>(x => x.ClassName == dr["班级名称"].ToString() && x.ClassNo == dr["班级编号"].ToString()); | |||||
//var classroomEntity = BaseRepository("CollegeMIS").FindEntity<ClassroomInfoEntity>(x => x.ClassroomName == dr["教室名称"].ToString() && x.ClassroomNo == dr["教室编号"].ToString()); | |||||
//var empinfoEntity = BaseRepository("CollegeMIS").FindEntity<EmpInfoEntity>(x => x.EmpName == dr["教师名称"].ToString() && x.EmpNo == dr["教室编号"].ToString()); | |||||
//写入要导入替换的数据 | //写入要导入替换的数据 | ||||
ArrangeLessonTermEntity arrangeLessonTermEntity = new ArrangeLessonTermEntity | |||||
{ | |||||
ALTId = Guid.NewGuid().ToString(), | |||||
LessonDate = dr["上课日期"].ToDate(), | |||||
StartTime = dr["开始时间"].ToString(), | |||||
EndTime = dr["结束时间"].ToString(), | |||||
AcademicYearNo = dr["学年"].ToString(), | |||||
Semester = dr["学期"].ToString(), | |||||
DeptNo = classEntity.DeptNo, | |||||
MajorNo = classEntity.MajorNo, | |||||
LessonNo = lessonEntity.LessonNo, | |||||
LessonName = lessonEntity.LessonName, | |||||
TeachClassNo = lessonEntity.LessonName + classEntity.ClassNo, | |||||
EmpNo = empinfoEntity.EmpNo, | |||||
EmpName = empinfoEntity.EmpName, | |||||
ClassroomNo = classroomEntity.ClassroomNo, | |||||
LessonTime = dr["上课时间"].ToString(), | |||||
LessonSortNo = dr["是否必修课"].ToString() == "是" ? "1" : "0", | |||||
//默认数据 | |||||
CheckMark = "1", | |||||
InsertDate = Insertdate, | |||||
IsImport = true, | |||||
F_SchoolId = CompanyEntity.F_CompanyId, | |||||
ArrangeLessonTermEntity arrangeLessonTermEntity = new ArrangeLessonTermEntity(); | |||||
//{ | |||||
// ALTId = Guid.NewGuid().ToString(), | |||||
// LessonDate = dr["上课日期"].ToDate(), | |||||
// StartTime = dr["开始时间"].ToString(), | |||||
// EndTime = dr["结束时间"].ToString(), | |||||
// AcademicYearNo = dr["学年"].ToString(), | |||||
// Semester = dr["学期"].ToString(), | |||||
// DeptNo = classEntity.FirstOrDefault().DeptNo, | |||||
// MajorNo = classEntity.FirstOrDefault().MajorNo, | |||||
// LessonNo = lessonEntity.FirstOrDefault().LessonNo, | |||||
// LessonName = lessonEntity.FirstOrDefault().LessonName, | |||||
// TeachClassNo = lessonEntity.FirstOrDefault().LessonName + classEntity.FirstOrDefault().ClassNo, | |||||
// EmpNo = empinfoEntity.FirstOrDefault().EmpNo, | |||||
// EmpName = empinfoEntity.FirstOrDefault().EmpName, | |||||
// ClassroomNo = classroomEntity.FirstOrDefault().ClassroomNo, | |||||
// LessonTime = dr["上课节次"].ToString(), | |||||
// LessonSortNo = dr["是否必修课"].ToString() == "是" ? "1" : "2", | |||||
// //默认数据 | |||||
// CheckMark = "1", | |||||
// InsertDate = Insertdate, | |||||
// IsImport = true, | |||||
// F_SchoolId = CompanyEntity.F_CompanyId, | |||||
//}; | |||||
arrangeLessonTermEntity.ALTId = Guid.NewGuid().ToString(); | |||||
arrangeLessonTermEntity.LessonDate = dr["上课日期"].ToString().ToDate(); | |||||
arrangeLessonTermEntity.StartTime = dr["开始时间"].ToString(); | |||||
arrangeLessonTermEntity.EndTime = dr["结束时间"].ToString(); | |||||
arrangeLessonTermEntity.AcademicYearNo = dr["学年"].ToString(); | |||||
arrangeLessonTermEntity.Semester = dr["学期"].ToString(); | |||||
arrangeLessonTermEntity.DeptNo = classEntity.FirstOrDefault().DeptNo; | |||||
arrangeLessonTermEntity.MajorNo = classEntity.FirstOrDefault().MajorNo; | |||||
arrangeLessonTermEntity.LessonNo = lessonEntity.FirstOrDefault().LessonNo; | |||||
arrangeLessonTermEntity.LessonName = lessonEntity.FirstOrDefault().LessonName; | |||||
arrangeLessonTermEntity.TeachClassNo = lessonEntity.FirstOrDefault().LessonName + classEntity.FirstOrDefault().ClassNo; | |||||
arrangeLessonTermEntity.EmpNo = empinfoEntity.FirstOrDefault().EmpNo; | |||||
arrangeLessonTermEntity.EmpName = empinfoEntity.FirstOrDefault().EmpName; | |||||
arrangeLessonTermEntity.ClassroomNo = classroomEntity.FirstOrDefault().ClassroomNo; | |||||
arrangeLessonTermEntity.LessonTime = dr["上课节次"].ToString(); | |||||
arrangeLessonTermEntity.LessonSortNo = dr["是否必修课"].ToString() == "是" ? "1" : "2"; | |||||
//默认数; | |||||
arrangeLessonTermEntity.CheckMark = "1"; | |||||
arrangeLessonTermEntity.InsertDate = Insertdate; | |||||
arrangeLessonTermEntity.IsImport = true; | |||||
arrangeLessonTermEntity.F_SchoolId = CompanyEntity.F_CompanyId; | |||||
}; | |||||
#region 判断是否重复 | #region 判断是否重复 | ||||
if (ArrangeLessonTermHistory.Count(m => m.AcademicYearNo == arrangeLessonTermEntity.AcademicYearNo && m.Semester == arrangeLessonTermEntity.Semester | if (ArrangeLessonTermHistory.Count(m => m.AcademicYearNo == arrangeLessonTermEntity.AcademicYearNo && m.Semester == arrangeLessonTermEntity.Semester | ||||
@@ -399,6 +399,10 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||||
adrRecordEntity.ADPhoto = ADPhoto; | adrRecordEntity.ADPhoto = ADPhoto; | ||||
adrRecordEntity.ClockPlace = ClockPlace; | adrRecordEntity.ClockPlace = ClockPlace; | ||||
adrRecordEntity.Img = img; | adrRecordEntity.Img = img; | ||||
if(AIsOut) | |||||
{ | |||||
adrRecordEntity.IsFit = true; | |||||
} | |||||
////记录日志 | ////记录日志 | ||||
//ADR_DeviceLogEntity adrDeviceLogEntity = new ADR_DeviceLogEntity(); | //ADR_DeviceLogEntity adrDeviceLogEntity = new ADR_DeviceLogEntity(); | ||||
//adrDeviceLogEntity.Create(); | //adrDeviceLogEntity.Create(); | ||||
@@ -441,10 +445,10 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||||
return true; | return true; | ||||
} | } | ||||
//考勤记录 | //考勤记录 | ||||
this.BaseRepository("CollegeMIS").ExecuteBySql("insert into ADR_Record(ID, UserNo, ADType, ADTime, ClockTime, ClockStatus, ClockPlace,Img, ADYear, ADMonth, ADDay, ADPhoto,ALon,ALat,AIsOut,ARemark) values(" + | |||||
this.BaseRepository("CollegeMIS").ExecuteBySql("insert into ADR_Record(ID, UserNo, ADType, ADTime, ClockTime, ClockStatus, ClockPlace,Img, ADYear, ADMonth, ADDay, ADPhoto,ALon,ALat,AIsOut,IsFit,ARemark) values(" + | |||||
"'" + adrRecordEntity.ID + "','" + adrRecordEntity.UserNo + "','" + adrRecordEntity.ADType + "','" + adrRecordEntity.ADTime + "'," + | "'" + adrRecordEntity.ID + "','" + adrRecordEntity.UserNo + "','" + adrRecordEntity.ADType + "','" + adrRecordEntity.ADTime + "'," + | ||||
"'" + adrRecordEntity.ClockTime + "','" + adrRecordEntity.ClockStatus + "','" + adrRecordEntity.ClockPlace + "','" + adrRecordEntity.Img + "','" + adrRecordEntity.ADYear + "'," + | "'" + adrRecordEntity.ClockTime + "','" + adrRecordEntity.ClockStatus + "','" + adrRecordEntity.ClockPlace + "','" + adrRecordEntity.Img + "','" + adrRecordEntity.ADYear + "'," + | ||||
"'" + adrRecordEntity.ADMonth + "','" + adrRecordEntity.ADDay + "','" + adrRecordEntity.ADPhoto + "'," + adrRecordEntity.ALon + "," + adrRecordEntity.ALat + ",'" + adrRecordEntity.AIsOut + "','" + adrRecordEntity.ARemark + "')"); | |||||
"'" + adrRecordEntity.ADMonth + "','" + adrRecordEntity.ADDay + "','" + adrRecordEntity.ADPhoto + "'," + adrRecordEntity.ALon + "," + adrRecordEntity.ALat + ",'" + adrRecordEntity.AIsOut + "','" + adrRecordEntity.IsFit + "','" + adrRecordEntity.ARemark + "')"); | |||||
//同步修改授课考勤打卡 | //同步修改授课考勤打卡 | ||||
ClockInModifyTeachAttendance(adrRecordEntity); | ClockInModifyTeachAttendance(adrRecordEntity); | ||||
return true; | return true; | ||||
@@ -529,6 +533,10 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||||
adrRecordEntity.ADPhoto = ADPhoto; | adrRecordEntity.ADPhoto = ADPhoto; | ||||
adrRecordEntity.ClockPlace = ClockPlace; | adrRecordEntity.ClockPlace = ClockPlace; | ||||
adrRecordEntity.Img = img; | adrRecordEntity.Img = img; | ||||
if(AIsOut) | |||||
{ | |||||
adrRecordEntity.IsFit = true; | |||||
} | |||||
////记录日志 | ////记录日志 | ||||
//ADR_DeviceLogEntity adrDeviceLogEntity = new ADR_DeviceLogEntity(); | //ADR_DeviceLogEntity adrDeviceLogEntity = new ADR_DeviceLogEntity(); | ||||
//adrDeviceLogEntity.Create(); | //adrDeviceLogEntity.Create(); | ||||
@@ -559,10 +567,10 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
this.BaseRepository("CollegeMIS").ExecuteBySql("insert into ADR_Record(ID, UserNo, ADType, ADTime, ClockTime, ClockStatus, ClockPlace,Img, ADYear, ADMonth, ADDay, ADPhoto,ALon,ALat,AIsOut,ARemark) values(" + | |||||
this.BaseRepository("CollegeMIS").ExecuteBySql("insert into ADR_Record(ID, UserNo, ADType, ADTime, ClockTime, ClockStatus, ClockPlace,Img, ADYear, ADMonth, ADDay, ADPhoto,ALon,ALat,AIsOut,IsFit,ARemark) values(" + | |||||
"'" + adrRecordEntity.ID + "','" + adrRecordEntity.UserNo + "','" + adrRecordEntity.ADType + "','" + adrRecordEntity.ADTime + "'," + | "'" + adrRecordEntity.ID + "','" + adrRecordEntity.UserNo + "','" + adrRecordEntity.ADType + "','" + adrRecordEntity.ADTime + "'," + | ||||
"'" + adrRecordEntity.ClockTime + "','" + adrRecordEntity.ClockStatus + "','" + adrRecordEntity.ClockPlace + "','" + adrRecordEntity.Img + "','" + adrRecordEntity.ADYear + "'," + | |||||
"'" + adrRecordEntity.ADMonth + "','" + adrRecordEntity.ADDay + "','" + adrRecordEntity.ADPhoto + "'," + adrRecordEntity.ALon + "," + adrRecordEntity.ALat + ",'" + adrRecordEntity.AIsOut + "','" + adrRecordEntity.ARemark + "')"); | |||||
"'" + adrRecordEntity.ClockTime + "','" + adrRecordEntity.ClockStatus + "','" + adrRecordEntity.ClockPlace + "','"+adrRecordEntity.Img+"','" + adrRecordEntity.ADYear + "'," + | |||||
"'" + adrRecordEntity.ADMonth + "','" + adrRecordEntity.ADDay + "','" + adrRecordEntity.ADPhoto + "'," + adrRecordEntity.ALon + "," + adrRecordEntity.ALat + ",'" + adrRecordEntity.AIsOut + "','" + adrRecordEntity.IsFit + "','" + adrRecordEntity.ARemark + "')"); | |||||
return true; | return true; | ||||
} | } | ||||
} | } | ||||
@@ -630,6 +638,10 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||||
adrRecordEntity.ADPhoto = ADPhoto; | adrRecordEntity.ADPhoto = ADPhoto; | ||||
adrRecordEntity.ClockPlace = ClockPlace; | adrRecordEntity.ClockPlace = ClockPlace; | ||||
adrRecordEntity.Img = img; | adrRecordEntity.Img = img; | ||||
if(AIsOut) | |||||
{ | |||||
adrRecordEntity.IsFit = true; | |||||
} | |||||
////记录日志 | ////记录日志 | ||||
//ADR_DeviceLogEntity adrDeviceLogEntity = new ADR_DeviceLogEntity(); | //ADR_DeviceLogEntity adrDeviceLogEntity = new ADR_DeviceLogEntity(); | ||||
//adrDeviceLogEntity.Create(); | //adrDeviceLogEntity.Create(); | ||||
@@ -650,10 +662,10 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||||
var attendancerecordlist = this.BaseRepository("CollegeMIS").FindList<ADR_RecordEntity>("select * from ADR_Record where ADYear='" + strTimeYear + "' and ADMonth='" + strTimeMonth + "' and ADDay='" + strTimeDay + "' and UserNo='" + EmpNo + "'").ToList(); | var attendancerecordlist = this.BaseRepository("CollegeMIS").FindList<ADR_RecordEntity>("select * from ADR_Record where ADYear='" + strTimeYear + "' and ADMonth='" + strTimeMonth + "' and ADDay='" + strTimeDay + "' and UserNo='" + EmpNo + "'").ToList(); | ||||
if (attendancerecordlist.Count(m => m.ADType == "7") == 0) | if (attendancerecordlist.Count(m => m.ADType == "7") == 0) | ||||
{ | { | ||||
this.BaseRepository("CollegeMIS").ExecuteBySql("insert into ADR_Record(ID, UserNo, ADType, ADTime, ClockTime, ClockStatus, ClockPlace,Img, ADYear, ADMonth, ADDay, ADPhoto,ALon,ALat,AIsOut,ARemark) values(" + | |||||
this.BaseRepository("CollegeMIS").ExecuteBySql("insert into ADR_Record(ID, UserNo, ADType, ADTime, ClockTime, ClockStatus, ClockPlace,Img, ADYear, ADMonth, ADDay, ADPhoto,ALon,ALat,AIsOut,IsFit,ARemark) values(" + | |||||
"'" + adrRecordEntity.ID + "','" + adrRecordEntity.UserNo + "','" + adrRecordEntity.ADType + "','" + adrRecordEntity.ADTime + "'," + | "'" + adrRecordEntity.ID + "','" + adrRecordEntity.UserNo + "','" + adrRecordEntity.ADType + "','" + adrRecordEntity.ADTime + "'," + | ||||
"'" + adrRecordEntity.ClockTime + "','" + adrRecordEntity.ClockStatus + "','" + adrRecordEntity.ClockPlace + "','" + adrRecordEntity.Img + "','" + adrRecordEntity.ADYear + "'," + | |||||
"'" + adrRecordEntity.ADMonth + "','" + adrRecordEntity.ADDay + "','" + adrRecordEntity.ADPhoto + "'," + adrRecordEntity.ALon + "," + adrRecordEntity.ALat + ",'" + adrRecordEntity.AIsOut + "','" + adrRecordEntity.ARemark + "')"); | |||||
"'" + adrRecordEntity.ClockTime + "','" + adrRecordEntity.ClockStatus + "','" + adrRecordEntity.ClockPlace + "','"+adrRecordEntity.Img+"','" + adrRecordEntity.ADYear + "'," + | |||||
"'" + adrRecordEntity.ADMonth + "','" + adrRecordEntity.ADDay + "','" + adrRecordEntity.ADPhoto + "'," + adrRecordEntity.ALon + "," + adrRecordEntity.ALat + ",'" + adrRecordEntity.AIsOut + "','" + adrRecordEntity.IsFit + "','" + adrRecordEntity.ARemark + "')"); | |||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
@@ -985,6 +997,10 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||||
adrRecordEntity.ADPhoto = ADPhoto; | adrRecordEntity.ADPhoto = ADPhoto; | ||||
adrRecordEntity.ClockPlace = ClockPlace; | adrRecordEntity.ClockPlace = ClockPlace; | ||||
adrRecordEntity.Img = img; | adrRecordEntity.Img = img; | ||||
if(AIsOut) | |||||
{ | |||||
adrRecordEntity.IsFit = true; | |||||
} | |||||
//adrRecordEntity.ADPhoto = str; | //adrRecordEntity.ADPhoto = str; | ||||
////记录日志 | ////记录日志 | ||||
//ADR_DeviceLogEntity adrDeviceLogEntitylateorleave = new ADR_DeviceLogEntity(); | //ADR_DeviceLogEntity adrDeviceLogEntitylateorleave = new ADR_DeviceLogEntity(); | ||||
@@ -1042,10 +1058,10 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||||
return true; | return true; | ||||
} | } | ||||
//考勤记录 | //考勤记录 | ||||
this.BaseRepository("CollegeMIS").ExecuteBySql("insert into ADR_Record(ID, UserNo, ADType, ADTime, ClockTime, ClockStatus, ClockPlace,Img, ADYear, ADMonth, ADDay, ADPhoto,ALon,ALat,AIsOut,ARemark) values(" + | |||||
this.BaseRepository("CollegeMIS").ExecuteBySql("insert into ADR_Record(ID, UserNo, ADType, ADTime, ClockTime, ClockStatus, ClockPlace,Img, ADYear, ADMonth, ADDay, ADPhoto,ALon,ALat,AIsOut,IsFit,ARemark) values(" + | |||||
"'" + adrRecordEntity.ID + "','" + adrRecordEntity.UserNo + "','" + adrRecordEntity.ADType + "','" + adrRecordEntity.ADTime + "'," + | "'" + adrRecordEntity.ID + "','" + adrRecordEntity.UserNo + "','" + adrRecordEntity.ADType + "','" + adrRecordEntity.ADTime + "'," + | ||||
"'" + adrRecordEntity.ClockTime + "','" + adrRecordEntity.ClockStatus + "','" + adrRecordEntity.ClockPlace + "','" + adrRecordEntity.Img + "','" + adrRecordEntity.ADYear + "'," + | "'" + adrRecordEntity.ClockTime + "','" + adrRecordEntity.ClockStatus + "','" + adrRecordEntity.ClockPlace + "','" + adrRecordEntity.Img + "','" + adrRecordEntity.ADYear + "'," + | ||||
"'" + adrRecordEntity.ADMonth + "','" + adrRecordEntity.ADDay + "','" + adrRecordEntity.ADPhoto + "'," + adrRecordEntity.ALon + "," + adrRecordEntity.ALat + ",'" + adrRecordEntity.AIsOut + "','" + adrRecordEntity.ARemark + "')"); | |||||
"'" + adrRecordEntity.ADMonth + "','" + adrRecordEntity.ADDay + "','" + adrRecordEntity.ADPhoto + "'," + adrRecordEntity.ALon + "," + adrRecordEntity.ALat + ",'" + adrRecordEntity.AIsOut + "','" + adrRecordEntity.IsFit + "','" + adrRecordEntity.ARemark + "')"); | |||||
//同步修改授课考勤打卡 | //同步修改授课考勤打卡 | ||||
ClockInModifyTeachAttendance(adrRecordEntity); | ClockInModifyTeachAttendance(adrRecordEntity); | ||||
return true; | return true; | ||||
@@ -774,7 +774,7 @@ export default { | |||||
//获取百度地图ak | //获取百度地图ak | ||||
GET_AK() { | GET_AK() { | ||||
let ak = ['zdBn8ZVlAELEK3rsBsxin7cXaYxjT1uE','Nx9VQtQEgzUm5GuBVt5SHoO5jt204xNo'] | |||||
let ak = ['zdBn8ZVlAELEK3rsBsxin7cXaYxjT1uE','78iR1wqm8cER7Gjt4tT26HrGGtGuk9LI'] | |||||
let current = this.GET_STORAGE('baiduAK') | let current = this.GET_STORAGE('baiduAK') | ||||
if(!current){ | if(!current){ | ||||
let ri = Math.floor(Math.random()*2); | let ri = Math.floor(Math.random()*2); | ||||
@@ -9,7 +9,8 @@ | |||||
<view v-if="ready" class="bg-white margin-tb padding" style="padding-top: 0; overflow: hidden;"> | <view v-if="ready" class="bg-white margin-tb padding" style="padding-top: 0; overflow: hidden;"> | ||||
<l-button v-if="edit" @click="action('save')" size="lg" color="green" class="block margin-top" block> | <l-button v-if="edit" @click="action('save')" size="lg" color="green" class="block margin-top" block> | ||||
确认打卡({{second}}s) | |||||
确认打卡 | |||||
<!-- ({{second}}s) --> | |||||
</l-button> | </l-button> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
@@ -102,15 +103,15 @@ | |||||
() => {} | () => {} | ||||
]) | ]) | ||||
await this.fetchForm() | await this.fetchForm() | ||||
this.timer = setInterval(()=>{ | |||||
this.second-- | |||||
if(this.second>0)return | |||||
this.TOAST('拍照超时,请重新打卡') | |||||
setTimeout(()=>{ | |||||
this.NAV_BACK() | |||||
},500) | |||||
return | |||||
},1000) | |||||
// this.timer = setInterval(()=>{ | |||||
// this.second-- | |||||
// if(this.second>0)return | |||||
// this.TOAST('拍照超时,请重新打卡') | |||||
// setTimeout(()=>{ | |||||
// this.NAV_BACK() | |||||
// },500) | |||||
// return | |||||
// },1000) | |||||
this.ready = true | this.ready = true | ||||
this.HIDE_LOADING() | this.HIDE_LOADING() | ||||
@@ -140,6 +141,10 @@ | |||||
const postData = await this.getPostData(this.id) | const postData = await this.getPostData(this.id) | ||||
console.log(postData) | console.log(postData) | ||||
let strEntity = JSON.parse(postData.strEntity) | let strEntity = JSON.parse(postData.strEntity) | ||||
if(!strEntity.Img){ | |||||
this.TOAST('图片上传失败') | |||||
return | |||||
} | |||||
// let strEntity_ = {...strEntity,...this.params} | // let strEntity_ = {...strEntity,...this.params} | ||||
this.HTTP_POST('learun/adms/attendance/clockin', JSON.stringify(strEntity), '打卡失败').then(success => { | this.HTTP_POST('learun/adms/attendance/clockin', JSON.stringify(strEntity), '打卡失败').then(success => { | ||||
this.HIDE_LOADING() | this.HIDE_LOADING() | ||||
@@ -177,7 +182,7 @@ | |||||
}, | }, | ||||
}, | }, | ||||
destroyed() { | destroyed() { | ||||
clearInterval(this.timer) | |||||
// clearInterval(this.timer) | |||||
} | } | ||||
} | } | ||||
</script> | </script> |
@@ -9,7 +9,8 @@ | |||||
<view v-if="ready" class="bg-white margin-tb padding" style="padding-top: 0; overflow: hidden;"> | <view v-if="ready" class="bg-white margin-tb padding" style="padding-top: 0; overflow: hidden;"> | ||||
<l-button v-if="edit" @click="action('save')" size="lg" color="green" class="block margin-top" block> | <l-button v-if="edit" @click="action('save')" size="lg" color="green" class="block margin-top" block> | ||||
确认打卡({{second}}s) | |||||
确认打卡 | |||||
<!-- ({{second}}s) --> | |||||
</l-button> | </l-button> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
@@ -102,15 +103,15 @@ | |||||
() => {} | () => {} | ||||
]) | ]) | ||||
await this.fetchForm() | await this.fetchForm() | ||||
this.timer = setInterval(()=>{ | |||||
this.second-- | |||||
if(this.second>0)return | |||||
this.TOAST('拍照超时,请重新打卡') | |||||
setTimeout(()=>{ | |||||
this.NAV_BACK() | |||||
},500) | |||||
return | |||||
},1000) | |||||
// this.timer = setInterval(()=>{ | |||||
// this.second-- | |||||
// if(this.second>0)return | |||||
// this.TOAST('拍照超时,请重新打卡') | |||||
// setTimeout(()=>{ | |||||
// this.NAV_BACK() | |||||
// },500) | |||||
// return | |||||
// },1000) | |||||
this.ready = true | this.ready = true | ||||
this.HIDE_LOADING() | this.HIDE_LOADING() | ||||
@@ -140,6 +141,10 @@ | |||||
const postData = await this.getPostData(this.id) | const postData = await this.getPostData(this.id) | ||||
console.log(postData) | console.log(postData) | ||||
let strEntity = JSON.parse(postData.strEntity) | let strEntity = JSON.parse(postData.strEntity) | ||||
if(!strEntity.Img){ | |||||
this.TOAST('图片上传失败') | |||||
return | |||||
} | |||||
// let strEntity_ = {...strEntity,...this.params} | // let strEntity_ = {...strEntity,...this.params} | ||||
this.HTTP_POST('learun/adms/attendance/clockinTeacher', JSON.stringify(strEntity), '打卡失败').then(success => { | this.HTTP_POST('learun/adms/attendance/clockinTeacher', JSON.stringify(strEntity), '打卡失败').then(success => { | ||||
this.HIDE_LOADING() | this.HIDE_LOADING() | ||||
@@ -177,7 +182,7 @@ | |||||
}, | }, | ||||
}, | }, | ||||
destroyed() { | destroyed() { | ||||
clearInterval(this.timer) | |||||
// clearInterval(this.timer) | |||||
} | } | ||||
} | } | ||||
</script> | </script> |