Kaynağa Gözat

移动端接口,实习、总结功能修改

和田中职
dao 2 hafta önce
ebeveyn
işleme
3dff260263
20 değiştirilmiş dosya ile 1174 ekleme ve 24 silme
  1. +3
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/InternShipSignUp/Form.cshtml
  2. +7
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/InternShipSignUp/Form.js
  3. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/InternShipSignUp/Index.js
  4. +4
    -3
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/InternShipSummary/Form.cshtml
  5. +7
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/InternShipSummary/Form.js
  6. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj
  7. +258
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/AttendanceApi.cs
  8. +101
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/Hetian/HeTianApi.cs
  9. +20
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/InternShipSignUp/InternShipSignUpBLL.cs
  10. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/InternShipSignUp/InternShipSignUpEntity.cs
  11. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/InternShipSignUp/InternShipSignUpIBLL.cs
  12. +32
    -11
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/InternShipSignUp/InternShipSignUpService.cs
  13. +19
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/InternShipSummary/InternShipSummaryBLL.cs
  14. +5
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/InternShipSummary/InternShipSummaryEntity.cs
  15. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/InternShipSummary/InternShipSummaryIBLL.cs
  16. +23
    -7
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/InternShipSummary/InternShipSummaryService.cs
  17. +10
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ADR_Record/ADR_RecordEntity.cs
  18. +22
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionBLL.cs
  19. +6
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionIBLL.cs
  20. +650
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionService.cs

+ 3
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/InternShipSignUp/Form.cshtml Dosyayı Görüntüle

@@ -3,9 +3,10 @@
Layout = "~/Views/Shared/_Form.cshtml";
}
<div class="lr-form-wrap">
<div class="col-xs-12 lr-form-item" data-table="InternShipSignUp" >
<div class="col-xs-12 lr-form-item" data-table="InternShipSignUp">
<div class="lr-form-item-title">学生名字</div>
<input id="StudentID" type="text" class="form-control" />
<div id="StudentID" class="form-control"></div>
<input id="StudentName" type="hidden" />
</div>
<div class="col-xs-12 lr-form-item" data-table="InternShipSignUp" >
<div class="lr-form-item-title">实习单位</div>


+ 7
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/InternShipSignUp/Form.js Dosyayı Görüntüle

@@ -15,6 +15,12 @@ var bootstrap = function ($, learun) {
page.initData();
},
bind: function () {
$('#StudentID').lrselect({
text: 'stuname',
value: 'stucode',
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=StuInfoBasic',
});
$('#Status').lrRadioCheckbox({
type: 'radio',
code: 'YesOrNoInt',
@@ -71,6 +77,7 @@ var bootstrap = function ($, learun) {
if (!$('body').lrValidform()) {
return false;
}
$("#StudentName").val($("#StudentID").find(".lr-select-placeholder").text());
var postData = {
strEntity: JSON.stringify($('body').lrGetFormData())
};


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/InternShipSignUp/Index.js Dosyayı Görüntüle

@@ -68,7 +68,7 @@ var bootstrap = function ($, learun) {
$('#gridtable').lrAuthorizeJfGrid({
url: top.$.rootUrl + '/EducationalAdministration/InternShipSignUp/GetPageList',
headData: [
{ label: "学生名字", name: "StudentID", width: 100, align: "left" },
{ label: "学生名字", name: "StudentName", width: 100, align: "left" },
{
label: "实习单位", name: "IUnit", width: 100, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {


+ 4
- 3
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/InternShipSummary/Form.cshtml Dosyayı Görüntüle

@@ -3,9 +3,10 @@
Layout = "~/Views/Shared/_Form.cshtml";
}
<div class="lr-form-wrap">
<div class="col-xs-12 lr-form-item" data-table="InternShipSummary" >
<div class="lr-form-item-title">学生名称</div>
<input id="Student" type="text" class="form-control" />
<div class="col-xs-12 lr-form-item" data-table="InternShipSummary">
<div class="lr-form-item-title">学生</div>
<div id="StudentNo" class="form-control"></div>
<input id="Student" type="hidden" />
</div>
<div class="col-xs-12 lr-form-item" data-table="InternShipSummary" >
<div class="lr-form-item-title">总结名称</div>


+ 7
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/InternShipSummary/Form.js Dosyayı Görüntüle

@@ -15,6 +15,12 @@ var bootstrap = function ($, learun) {
page.initData();
},
bind: function () {
$('#StudentNo').lrselect({
text: 'stuname',
value: 'stucode',
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=StuInfoBasic',

});
},
initData: function () {
if (!!keyValue) {
@@ -36,6 +42,7 @@ var bootstrap = function ($, learun) {
if (!$('body').lrValidform()) {
return false;
}
$("#Student").val($("#StudentNo").find(".lr-select-placeholder").text());
var postData = {
strEntity: JSON.stringify($('body').lrGetFormData())
};


+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj Dosyayı Görüntüle

@@ -190,10 +190,12 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Bootstraper.cs" />
<Compile Include="Modules\AttendanceApi.cs" />
<Compile Include="Modules\Echarts\EchartsApi.cs" />
<Compile Include="Modules\Echarts\StudentEchartsApi.cs" />
<Compile Include="Modules\EducationalAdministration\ArrangeExamTermApi.cs" />
<Compile Include="Modules\EducationalAdministration\ArrangeExamTermNewApi.cs" />
<Compile Include="Modules\Hetian\HeTianApi.cs" />
<Compile Include="Modules\SSOApi.cs" />
<Compile Include="Modules\StampPersonalApi.cs" />
<Compile Include="Modules\FundsApplyApi.cs" />


+ 258
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/AttendanceApi.cs Dosyayı Görüntüle

@@ -0,0 +1,258 @@
using Learun.Application.Base.SystemModule;
using Learun.Application.TwoDevelopment.EducationalAdministration;
using Learun.Application.TwoDevelopment.LogisticsManagement;
using Learun.Application.TwoDevelopment.PersonnelManagement;
using Learun.Util;
using Nancy;
using System;
using System.Collections.Generic;
using System.IO;

namespace Learun.Application.WebApi.Modules
{
/// <summary>
/// 考勤打卡功能
/// </summary>
public class AttendanceApi : BaseApi
{
public AttendanceApi()
: base("/learun/adms/attendance")
{
//判断当前时间是否可以打卡
//Get["/IsAttendance"] = IsAttendance;
//上下班打卡
Post["/clockin"] = ClockIn;
//获取考勤打卡记录
//Get["/getrecordpagelist"] = GetRecordPageList;
//判断学生当前打卡状态
//Get["IsAttendanceStudent"] = IsAttendanceStudent;
//学生打卡
//Post["/clockinStudent"] = ClockInStudent;
//打卡记录
//Get["/GetTeacherRecord"] = GetTeacherRecord;

//教师上下课打卡:判断当前打卡状态
//Get["IsAttendanceTeacher"] = IsAttendanceTeacher;
//教师上下课打卡
//Post["/clockinTeacher"] = ClockInTeacher;

//判断教师是否授课
//Get["JudgeTeacherIsHasLesson"] = JudgeTeacherIsHasLesson;
}
private ADR_RestrictionIBLL adr_RestrictionBLL = new ADR_RestrictionBLL();
private ADR_RecordIBLL adr_RecordBLL = new ADR_RecordBLL();
private EmpInfoIBLL empInfoIBLL = new EmpInfoBLL();


//public Response GetTeacherRecord(dynamic _)
//{
// ReqPageParam parameter = this.GetReqData<ReqPageParam>();
// var res = adr_RecordBLL.GetList(parameter.queryJson);
// var jsondata =
// new
// {
// data = res
// };
// return Success(jsondata);
//}

/// <summary>
/// 判断当前时间是否可以打卡
/// </summary>
/// <param name="_"></param>
/// <returns></returns>
//public Response IsAttendance(dynamic _)
//{
// var res = adr_RestrictionBLL.IsAttendance();
// var jsondata =
// new
// {
// data = res
// };
// return Success(jsondata);
//}
/// <summary>
/// 学生打卡判断
/// </summary>
/// <param name="_"></param>
/// <returns></returns>
//public Response IsAttendanceStudent(dynamic _)
//{
// var res = adr_RestrictionBLL.IsAttendanceStudent();
// var jsondata =
// new
// {
// data = res
// };
// return Success(jsondata);
//}

public class Attendance
{
public decimal ALon { get; set; }
public decimal ALat { get; set; }
public bool AIsOut { get; set; }
public string ARemark { get; set; }
public string ADPhoto { get; set; }
public string ClockPlace { get; set; }
public string LessonSortNo { get; set; }
public string ALTId { get; set; }
public string ALTOEId { get; set; }
public string Img { get; set; }
}

/// <summary>
/// 上下班打卡
/// </summary>
/// <param name="_"></param>
/// <returns></returns>
public Response ClockIn(dynamic _)
{

Attendance parameter = this.GetReqData<Attendance>();
var userinfo = LoginUserInfo.Get();
//员工账号
string EmpNo = userinfo.account;
string result = "0";
//if (parameter.AIsOut)
//{
// result = "1";
//}
//else
//{
//根据用户编号获取用户头像
var einfo = empInfoIBLL.GetEmpInfoEntityByEmpNo(EmpNo);
if (einfo == null)
{
return Fail("用户数据错误!");
}
string userimg = einfo.Photo;
string imgid = parameter.Img;


//}
if (result == "1")
{
adr_RestrictionBLL.ClockIn(parameter.ALon, parameter.ALat, parameter.AIsOut, parameter.ARemark, parameter.ADPhoto, parameter.ClockPlace, parameter.Img);

return Success("打卡成功");
}
else
{
return Fail("打卡照片异常,请重新拍照!");
}


}
/// <summary>
/// 学生打卡
/// </summary>
/// <param name="_"></param>
/// <returns></returns>
//public Response ClockInStudent(dynamic _)
//{
// Attendance parameter = this.GetReqData<Attendance>();

// adr_RestrictionBLL.ClockInStudent(parameter.ALon, parameter.ALat, parameter.AIsOut, parameter.ARemark, parameter.ADPhoto, parameter.ClockPlace, parameter.LessonSortNo, parameter.ALTId, parameter.ALTOEId);

// return Success("打卡成功");
//}
/// <summary>
/// 打卡
/// </summary>
/// <param name="_"></param>
/// <returns></returns>
//public Response GetRecordPageList(dynamic _)
//{
// ReqPageParam parameter = this.GetReqData<ReqPageParam>();
// var data = adr_RecordBLL.GetPageList(parameter.pagination, parameter.queryJson);
// var jsonData = new
// {
// rows = data,
// total = parameter.pagination.total,
// page = parameter.pagination.page,
// records = parameter.pagination.records
// };
// return Success(jsonData);
//}

/// <summary>
/// 教师上下课打卡:判断当前打卡状态
/// </summary>
/// <param name="_"></param>
/// <returns></returns>
//public Response IsAttendanceTeacher(dynamic _)
//{
// var res = adr_RestrictionBLL.IsAttendanceTeacher();
// var jsondata =
// new
// {
// data = res
// };
// return Success(jsondata);
//}
/// <summary>
/// 教师上下课打卡
/// </summary>
/// <param name="_"></param>
/// <returns></returns>
//public Response ClockInTeacher(dynamic _)
//{
// Attendance parameter = this.GetReqData<Attendance>();

// var userinfo = LoginUserInfo.Get();
// //员工账号
// string EmpNo = userinfo.account;

// //根据用户编号获取用户头像
// var einfo = empInfoIBLL.GetEmpInfoEntityByEmpNo(EmpNo);
// if (einfo == null)
// {
// return Fail("用户数据错误!");
// }
// string userimg = einfo.Photo;
// string imgid = parameter.Img;

// var url = Config.GetValue("FaceCheckApi");

// string result = Util.HttpMethods.HttpGet($"{url}{userimg}/{imgid}");
// if (result == "1")
// {
// adr_RestrictionBLL.ClockInTeacher(parameter.ALon, parameter.ALat, parameter.AIsOut, parameter.ARemark, parameter.ADPhoto, parameter.ClockPlace, parameter.LessonSortNo, parameter.ALTId, parameter.ALTOEId, parameter.Img);

// return Success("打卡成功");
// }
// else
// {
// return Fail("打卡照片异常,请重新拍照!");
// }


//}

/// <summary>
/// 判断教师是否授课
/// </summary>
/// <param name="_"></param>
/// <returns></returns>
//public Response JudgeTeacherIsHasLesson(dynamic _)
//{
// var jsondata =
// new
// {
// data = false
// };
// var empInfo = empInfoIBLL.GetEmpInfoEntityByEmpNo(userInfo.account);
// if (empInfo == null)
// {
// return Success(jsondata);
// }
// if (empInfo.IsHasLesson == true)//授课
// {
// jsondata = new { data = true };
// return Success(jsondata);
// }
// return Success(jsondata);
//}
}
}

+ 101
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/Hetian/HeTianApi.cs Dosyayı Görüntüle

@@ -0,0 +1,101 @@
using Learun.Application.Base.SystemModule;
using Learun.Application.TwoDevelopment.Ask;
using Learun.Application.TwoDevelopment.EducationalAdministration;
using Learun.Util;
using Nancy;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Learun.Application.WebApi.Modules.Hetian
{
public class HeTianApi : BaseApi
{
//ht 和田 sx 实习
public HeTianApi() : base("/api/ht/")
{
Get["/sx/comp"] = GetComp;// 实习单位列表
Get["/sx/pos"] = GetPos;// 实习岗位列表
Get["/sx/list"] = GetBaomin;// 获取报名列表
Post["/sx/bm"] = Baomin; //报名实习
Get["/zj/my"] = GetZongjie;// 获取总结
Post["/zj/sub"] = Zongjie; //提交总结
}
private InternShipSignUpIBLL internShipSignUpIBLL = new InternShipSignUpBLL();
private InternShipSummaryIBLL internShipSummaryIBLL = new InternShipSummaryBLL();
private DataSourceIBLL dataSourceIBLL = new DataSourceBLL();

/// <summary>
/// 实习单位
/// </summary>
/// <returns></returns>
public Response GetComp(dynamic _)
{
var data = dataSourceIBLL.GetDataTable("PracticeBase", "");
return Success(data);
}
/// <summary>
/// 实习岗位
/// </summary>
/// <returns></returns>
public Response GetPos(dynamic _)
{
var dw = GetReqData();
var data = dataSourceIBLL.GetDataTable("PBPost", "PBID='" + dw + "'");
return Success(data);
}

/// <summary>
/// 报名列表
/// </summary>
/// <param name="_"></param>
/// <returns></returns>
public Response GetBaomin(dynamic _)
{
var list = internShipSignUpIBLL.GetMyList(userInfo.account);

return Success(list);
}

/// <summary>
/// 报名
/// </summary>
/// <param name="_"></param>
/// <returns></returns>
public Response Baomin(dynamic _)
{
var queryJson = GetReqData();
var queryParam = queryJson.ToObject<InternShipSignUpEntity>();
internShipSignUpIBLL.SaveEntity("", queryParam);

return Success(true);
}
/// <summary>
/// 获取总结
/// </summary>
/// <param name="_"></param>
/// <returns></returns>
public Response GetZongjie(dynamic _)
{
var list = internShipSummaryIBLL.GetMy(userInfo.account);

return Success(list);
}
/// <summary>
/// 总结
/// </summary>
/// <param name="_"></param>
/// <returns></returns>
public Response Zongjie(dynamic _)
{
var queryJson = GetReqData();
var queryParam = queryJson.ToObject<InternShipSummaryEntity>();
internShipSummaryIBLL.SaveEntity("", queryParam);

return Success(true);
}

}
}

+ 20
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/InternShipSignUp/InternShipSignUpBLL.cs Dosyayı Görüntüle

@@ -2,6 +2,7 @@
using System;
using System.Data;
using System.Collections.Generic;
using static Dapper.SqlMapper;

namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
@@ -118,6 +119,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}

public IEnumerable<InternShipSignUpEntity> GetMyList(string acc)
{
try
{
return internShipSignUpService.GetMyList(acc);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

#endregion

}


+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/InternShipSignUp/InternShipSignUpEntity.cs Dosyayı Görüntüle

@@ -24,6 +24,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// </summary>
[Column("STUDENTID")]
public string StudentID { get; set; }
[Column("STUDENTNAME")]
public string StudentName { get; set; }
/// <summary>
/// 实习单位
/// </summary>


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/InternShipSignUp/InternShipSignUpIBLL.cs Dosyayı Görüntüle

@@ -45,5 +45,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
void SaveEntity(string keyValue, InternShipSignUpEntity entity);
#endregion

IEnumerable<InternShipSignUpEntity> GetMyList(string acc);
}
}

+ 32
- 11
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/InternShipSignUp/InternShipSignUpService.cs Dosyayı Görüntüle

@@ -31,15 +31,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
var strSql = new StringBuilder();
strSql.Append("SELECT ");
strSql.Append(@"
t.ID,
t.StudentID,
t.IUnit,
t.IPost,
t.ITime,
t.Mobile,
t.Cjhecker,
t.Status,
t.IContent
*
");
strSql.Append(" FROM InternShipSignUp t ");
strSql.Append(" WHERE 1=1 ");
@@ -49,7 +41,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
if (!queryParam["StudentID"].IsEmpty())
{
dp.Add("StudentID", "%" + queryParam["StudentID"].ToString() + "%", DbType.String);
strSql.Append(" AND t.StudentID Like @StudentID ");
strSql.Append(" AND t.StudentName Like @StudentID ");
}
if (!queryParam["Mobile"].IsEmpty())
{
@@ -157,6 +149,35 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}

#endregion

public IEnumerable<InternShipSignUpEntity> GetMyList(string acc)
{
try
{
// 虚拟参数
var dp = new DynamicParameters(new { });
dp.Add("StudentID", "" + acc + "", DbType.String);
var strSql = new StringBuilder();
strSql.Append("SELECT ");
strSql.Append(@"
*
");
strSql.Append(" FROM InternShipSignUp t ");
strSql.Append(" WHERE StudentID=@StudentID ");
return this.BaseRepository("CollegeMIS").FindList<InternShipSignUpEntity>(strSql.ToString(), dp);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
}
}

+ 19
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/InternShipSummary/InternShipSummaryBLL.cs Dosyayı Görüntüle

@@ -118,6 +118,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}

public InternShipSummaryEntity GetMy(string acc)
{
try
{
return internShipSummaryService.GetMy(acc);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

#endregion

}


+ 5
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/InternShipSummary/InternShipSummaryEntity.cs Dosyayı Görüntüle

@@ -25,6 +25,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
[Column("STUDENT")]
public string Student { get; set; }
/// <summary>
/// 学生编号
/// </summary>
[Column("STUDENTNO")]
public string StudentNo { get; set; }
/// <summary>
/// 总结名称
/// </summary>
[Column("SUMMARYNAME")]


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/InternShipSummary/InternShipSummaryIBLL.cs Dosyayı Görüntüle

@@ -45,5 +45,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
void SaveEntity(string keyValue, InternShipSummaryEntity entity);
#endregion

InternShipSummaryEntity GetMy(string acc);
}
}

+ 23
- 7
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/InternShipSummary/InternShipSummaryService.cs Dosyayı Görüntüle

@@ -4,6 +4,7 @@ using Learun.Util;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace Learun.Application.TwoDevelopment.EducationalAdministration
@@ -31,13 +32,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
var strSql = new StringBuilder();
strSql.Append("SELECT ");
strSql.Append(@"
t.ID,
t.Student,
t.SummaryName,
t.AddTime,
t.Mobile,
t.Remark,
t.SummaryContent
*
");
strSql.Append(" FROM InternShipSummary t ");
strSql.Append(" WHERE 1=1 ");
@@ -138,6 +133,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
else
{
entity.Create();
var c= this.BaseRepository("CollegeMIS").FindList<InternShipSummaryEntity>(x=>x.StudentNo==entity.StudentNo).Count();
if (c > 0) throw new Exception("实习总结已提交");
this.BaseRepository("CollegeMIS").Insert(entity);
}
}
@@ -156,5 +153,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration

#endregion


public InternShipSummaryEntity GetMy(string acc)
{
try
{
return this.BaseRepository("CollegeMIS").FindEntity<InternShipSummaryEntity>(x=>x.StudentNo==acc);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
}
}

+ 10
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ADR_Record/ADR_RecordEntity.cs Dosyayı Görüntüle

@@ -79,6 +79,16 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
/// </summary>
[Column("ADPHOTO")]
public string ADPhoto { get; set; }
/// <summary>
/// 经度
/// </summary>
[Column("ALON")]
public decimal ALon { get; set; }
/// <summary>
/// 纬度
/// </summary>
[Column("ALAT")]
public decimal ALat { get; set; }
#endregion

#region 扩展操作


+ 22
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionBLL.cs Dosyayı Görüntüle

@@ -162,5 +162,27 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement

#endregion

/// <summary>
/// 打卡
/// </summary>
/// <returns></returns>
public bool ClockIn(decimal ALon, decimal ALat, bool AIsOut, string ARemark, string ADPhoto, string ClockPlace, string img)
{
try
{
return aDR_RestrictionService.ClockIn(ALon, ALat, AIsOut, ARemark, ADPhoto, ClockPlace, img);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
}
}

+ 6
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionIBLL.cs Dosyayı Görüntüle

@@ -50,5 +50,11 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
#endregion

ADR_RestrictionEntity GetADR_RestrictionEntityEnabled();

/// <summary>
/// 打卡
/// </summary>
/// <returns></returns>
bool ClockIn(decimal ALon, decimal ALat, bool AIsOut, string ARemark, string ADPhoto, string ClockPlace, string Img);
}
}

+ 650
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionService.cs Dosyayı Görüntüle

@@ -1,9 +1,12 @@
using Dapper;
using Learun.Application.TwoDevelopment.EducationalAdministration;
using Learun.Application.TwoDevelopment.LogisticsManagement;
using Learun.DataBase.Repository;
using Learun.Util;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace Learun.Application.TwoDevelopment.PersonnelManagement
@@ -205,5 +208,652 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
}
}
}

/// <summary>
/// 打卡
/// </summary>
/// <returns></returns>
public bool ClockIn(decimal ALon, decimal ALat, bool AIsOut, string ARemark, string ADPhoto, string ClockPlace, string img)
{
try
{
// var attendancerulEntity = this.BaseRepository("CollegeMIS").FindEntity<ADR_RestrictionEntity>(m => m.REnable == true);
var userinfo = LoginUserInfo.Get();
//员工账号
string EmpNo = userinfo.account;
var empInfo = this.BaseRepository("CollegeMIS").FindEntity<StuInfoBasicEntity>(x => x.StuCode == EmpNo);
if (empInfo == null)
{
throw new Exception("未找到该同学");
}

//考勤状态
string ADType = "1";
//考勤结果
string ClockStatus = "1";
//当前服务器日期
var datenow = DateTime.Now.ToString("yyyy-MM-dd");

var datetimenow = DateTime.Now;

//当前时间年月日时分秒
string strTimeYear = (datetimenow.Year).ToString();
string strTimeMonth = (datetimenow.Month).ToString("d2");
string strTimeDay = (datetimenow.Day).ToString("d2");
string strTimeHour = (datetimenow.Hour).ToString("d2");
string strTimeMinute = (datetimenow.Minute).ToString("d2");
string strTimeSecond = (datetimenow.Second).ToString("d2");
string strTime = strTimeYear + "-" + strTimeMonth + "-" + strTimeDay + " " + strTimeHour + ":" +
strTimeMinute + ":" + strTimeSecond;

//设备事件时间(在这里,=当前时间)
DateTime devicetime = Convert.ToDateTime(strTime);

#region
//上班时间
//DateTime workDateTime = Convert.ToDateTime(datenow + " " + attendancerulEntity.WorkTime);
////上班考勤时间段
//DateTime signInStartTime = Convert.ToDateTime(datenow + " " + attendancerulEntity.SignInStartTime);
//DateTime signInEndTime = Convert.ToDateTime(datenow + " " + attendancerulEntity.SignInEndTime);

////下班时间
//DateTime offworkDateTime = Convert.ToDateTime(datenow + " " + attendancerulEntity.CloseTime);
////下班考勤时间段
//DateTime signOutStartTime = Convert.ToDateTime(datenow + " " + attendancerulEntity.SignOutStartTime);
//DateTime signOutEndTime = Convert.ToDateTime(datenow + " " + attendancerulEntity.SignOutEndTime);

////中午下班时间
//DateTime offworkDateTimelunch = Convert.ToDateTime(datenow + " " + attendancerulEntity.NoonCloseTime);
////中午上班时间
//DateTime workDateTimelunch = Convert.ToDateTime(datenow + " " + attendancerulEntity.NoonWorkTime);
////中午下班考勤时间段
//DateTime offworkstartlunch = Convert.ToDateTime(datenow + " " + attendancerulEntity.SignOutStartTime2);
//DateTime offworkendlunch = Convert.ToDateTime(datenow + " " + attendancerulEntity.SignOutEndTime2);
////中午上班考勤时间段
//DateTime workstartlunch = Convert.ToDateTime(datenow + " " + attendancerulEntity.SignInStartTime2);
//DateTime workendlunch = Convert.ToDateTime(datenow + " " + attendancerulEntity.SignInEndTime2);


//var leaveTime = attendancerulEntity.LeaveOverTime ?? 0;
//var overTime = attendancerulEntity.LateOvertime ?? 0;
#endregion

//2021.12.30 上下班设置时间段打卡
#region 二次打卡
//判断打卡次数
//if (attendancerulEntity.ClockTime == "二次打卡")
//{
//上下班正常打卡
//if (devicetime >= signInStartTime && devicetime <= signInEndTime)
//if (devicetime <= signInEndTime)
//{
//ADType = "1";//上班
//ClockStatus = "1";//正常
//}
//else if (devicetime >= signOutStartTime && devicetime <= signOutEndTime)
//else if (devicetime >= signOutStartTime)
//{
// ADType = "2";//下班
// ClockStatus = "1";//正常
//}
//else if (devicetime < signOutStartTime && devicetime > signInEndTime)//小于下班时间
//{
//首先判断是上班还是下班
//该用户当日有签到记录视为下班签退
var attendancerecord = this.BaseRepository("CollegeMIS").FindList<ADR_RecordEntity>(
"select * from ADR_Record where ADYear='" + strTimeYear + "' and ADMonth='" +
strTimeMonth + "' and ADDay='" + strTimeDay + "' and UserNo='" + EmpNo +
"' and ADType='1'").ToList();

if (attendancerecord.Count() > 0)//如果存在上班考勤记录
{
ADType = "2";//下班

//if (devicetime < workDateTimelunch)
//{
// DateTime offworkDateTimeFree1 = offworkstartlunch.AddMinutes(-leaveTime);
// if (devicetime < offworkDateTimeFree1)
// {
// ClockStatus = "3";
// }
// else
// {
// ClockStatus = "1";
// }

//}
//else
//{
// if (devicetime >= (signOutStartTime.AddMinutes(-leaveTime)))
// {
// ClockStatus = "1";
// }
// else
// {
// ClockStatus = "3";
// }
//}

}
//else//判断为上班迟到
//{
// if (devicetime < offworkstartlunch.AddMinutes(-leaveTime))
// {
// ADType = "1";
// ClockStatus = "2";
// }
// else if (devicetime >= offworkstartlunch.AddMinutes(-leaveTime) && devicetime <= offworkendlunch)
// {
// ADType = "2";
// ClockStatus = "1";
// }
// else if (devicetime >= workstartlunch && devicetime <= workendlunch.AddMinutes(overTime))
// {
// ADType = "1";
// ClockStatus = "1";
// }
// else
// {
// ADType = "1";
// ClockStatus = "2";
// }

//}
//}


ADR_RecordEntity adrRecordEntity = new ADR_RecordEntity();
adrRecordEntity.Create();
adrRecordEntity.UserName = userinfo.realName;
adrRecordEntity.UserNo = EmpNo;
adrRecordEntity.ADType = ADType;
adrRecordEntity.ADTime = datetimenow;
adrRecordEntity.ClockTime = devicetime;
adrRecordEntity.ClockStatus = ClockStatus;
//if (deviceEntity != null && !string.IsNullOrEmpty(deviceEntity.DName))
//{
// adrRecordEntity.ClockPlace = deviceEntity.DName;
//}
//else
//{
// adrRecordEntity.ClockPlace = "未知";
//}
adrRecordEntity.ADYear = strTimeYear;
adrRecordEntity.ADMonth = strTimeMonth;
adrRecordEntity.ADDay = strTimeDay;
adrRecordEntity.ALon = ALon;
adrRecordEntity.ALat = ALat;
//adrRecordEntity.AIsOut = AIsOut;
//adrRecordEntity.ARemark = ARemark;
adrRecordEntity.ADPhoto = ADPhoto;
adrRecordEntity.ClockPlace = ClockPlace;
//adrRecordEntity.Img = img;
//adrRecordEntity.IsFit = true;
////记录日志
//ADR_DeviceLogEntity adrDeviceLogEntity = new ADR_DeviceLogEntity();
//adrDeviceLogEntity.Create();
//if (deviceEntity != null && !string.IsNullOrEmpty(deviceEntity.Id))
//{
// adrDeviceLogEntity.DeviceId = deviceEntity.Id;
// stringAlarm += ",设备IP:" + deviceEntity.IpAddress;
//}

//adrDeviceLogEntity.LogData = stringAlarm;
//adrDeviceLogEntity.LogType = "0";
//connmis.Execute("insert into ADR_DeviceLog(LogId,DeviceId, LogType, LogData, F_CreateDate, F_CreateUserId, F_CreateUserName) values(" +
// "'" + adrDeviceLogEntity.LogId + "','" + adrDeviceLogEntity.DeviceId + "','" + adrDeviceLogEntity.LogType + "'," +
// "'" + adrDeviceLogEntity.LogData + "','" + adrDeviceLogEntity.F_CreateDate + "','system','自动化服务')");
//去重
//获取当日考勤记录
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 (adrRecordEntity.ADType == "1" && attendancerecordlist.Count(m => m.ADType == "1") > 0)//签过到了
{
//每日保留第一次签到记录
return true;
}
//签退去重
if (adrRecordEntity.ADType == "2" && attendancerecordlist.Count(m => m.ADType == "2") > 0)//签过退了
{
//更新签退时间,签退状态
var firstoffworkentity = attendancerecordlist.FirstOrDefault(m => m.ADType == "2");
firstoffworkentity.ADTime = datetimenow;
firstoffworkentity.ClockTime = devicetime;
firstoffworkentity.ClockStatus = ClockStatus;
//firstoffworkentity.ARemark = ARemark;
firstoffworkentity.ClockPlace = ClockPlace;
//firstoffworkentity.Img = img;
firstoffworkentity.ADPhoto = ADPhoto;
//firstoffworkentity.AIsOut = AIsOut;
this.BaseRepository("CollegeMIS").ExecuteBySql("update ADR_Record set ADTime='" + firstoffworkentity.ADTime + "',ClockTime='" + firstoffworkentity.ClockTime + "',ClockStatus='" + firstoffworkentity.ClockStatus + "',ADPhoto='" + firstoffworkentity.ADPhoto + "' where ID='" + firstoffworkentity.ID + "'");
//同步修改授课考勤打卡
//ClockInModifyTeachAttendance(adrRecordEntity);
return true;
}
//考勤记录
this.BaseRepository("CollegeMIS").ExecuteBySql("insert into ADR_Record(ID, UserNo, ADType, ADTime, ClockTime, ClockStatus, ClockPlace, ADYear, ADMonth, ADDay, ADPhoto,ALon,ALat) values('" + adrRecordEntity.ID + "','" + adrRecordEntity.UserNo + "','" + adrRecordEntity.ADType + "','" + adrRecordEntity.ADTime + "','" + adrRecordEntity.ClockTime + "','" + adrRecordEntity.ClockStatus + "','" + adrRecordEntity.ClockPlace + "','" + adrRecordEntity.ADYear + "','" + adrRecordEntity.ADMonth + "','" + adrRecordEntity.ADDay + "','" + adrRecordEntity.ADPhoto + "'," + adrRecordEntity.ALon + "," + adrRecordEntity.ALat + ")");
//同步修改授课考勤打卡
//ClockInModifyTeachAttendance(adrRecordEntity);
return true;
//}
#endregion

#region 四次打卡
//else//四次打卡
//{

// //首先判断是否在中午考勤时间段
// //如果在中午下班考勤时间段
// if (offworkstartlunch <= devicetime && devicetime <= offworkendlunch)
// {
// //早退判断
// if (devicetime < offworkDateTimelunch)
// {
// //早退
// //允许早退判断
// if (attendancerulEntity.LeaveOverTime.HasValue && attendancerulEntity.LeaveOverTime != 0)
// {
// //中午下班最早签退时间
// DateTime offworkDateTimeFree = offworkDateTimelunch.AddMinutes(-Convert.ToDouble(attendancerulEntity.LeaveOverTime));
// if (devicetime > offworkDateTimeFree)
// {
// //正常
// ADType = "8";//中午下班
// ClockStatus = "1";//正常
// }
// else
// {
// //早退
// ADType = "8";//中午下班
// ClockStatus = "3";//早退
// }
// }
// else
// {
// //早退
// ADType = "8";//中午下班
// ClockStatus = "3";//早退
// }
// }
// else
// {
// //正常
// ADType = "8";//中午下班
// ClockStatus = "1";//正常
// }
// //写入考勤数据
// ADR_RecordEntity adrRecordEntity = new ADR_RecordEntity();
// adrRecordEntity.Create();
// adrRecordEntity.UserNo = EmpNo;
// adrRecordEntity.ADType = ADType;
// adrRecordEntity.ADTime = datetimenow;
// adrRecordEntity.ClockTime = devicetime;
// adrRecordEntity.ClockStatus = ClockStatus;
// //if (deviceEntity != null && !string.IsNullOrEmpty(deviceEntity.DName))
// //{
// // adrRecordEntity.ClockPlace = deviceEntity.DName;
// //}
// //else
// //{
// // adrRecordEntity.ClockPlace = "未知";
// //}
// adrRecordEntity.ADYear = strTimeYear;
// adrRecordEntity.ADMonth = strTimeMonth;
// adrRecordEntity.ADDay = strTimeDay;
// adrRecordEntity.ALon = ALon;
// adrRecordEntity.ALat = ALat;
// adrRecordEntity.AIsOut = AIsOut;
// adrRecordEntity.ARemark = ARemark;
// adrRecordEntity.ADPhoto = ADPhoto;
// adrRecordEntity.ClockPlace = ClockPlace;
// adrRecordEntity.Img = img;
// adrRecordEntity.IsFit = true;
// ////记录日志
// //ADR_DeviceLogEntity adrDeviceLogEntity = new ADR_DeviceLogEntity();
// //adrDeviceLogEntity.Create();
// //if (deviceEntity != null && !string.IsNullOrEmpty(deviceEntity.Id))
// //{
// // adrDeviceLogEntity.DeviceId = deviceEntity.Id;
// // stringAlarm += ",设备IP:" + deviceEntity.IpAddress;
// //}

// //adrDeviceLogEntity.LogData = stringAlarm;
// //adrDeviceLogEntity.LogType = "0";
// //connmis.Execute("insert into ADR_DeviceLog(LogId,DeviceId, LogType, LogData, F_CreateDate, F_CreateUserId, F_CreateUserName) values(" +
// // "'" + adrDeviceLogEntity.LogId + "','" + adrDeviceLogEntity.DeviceId + "','" + adrDeviceLogEntity.LogType + "'," +
// // "'" + adrDeviceLogEntity.LogData + "','" + adrDeviceLogEntity.F_CreateDate + "','system','自动化服务')");

// //考勤记录
// //去重
// 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 == "8") > 0)//存在中午下班记录更新记录
// {
// var firstoffworkentity = attendancerecordlist.FirstOrDefault(m => m.ADType == "8");
// firstoffworkentity.ADTime = datetimenow;
// firstoffworkentity.ClockTime = devicetime;
// firstoffworkentity.ClockStatus = ClockStatus;

// this.BaseRepository("CollegeMIS").ExecuteBySql("update ADR_Record set ADTime='" + firstoffworkentity.ADTime + "',ClockTime='" + firstoffworkentity.ClockTime + "',ClockStatus='" + firstoffworkentity.ClockStatus + "',ADPhoto='" + firstoffworkentity.ADPhoto + "' where ID='" + firstoffworkentity.ID + "'");
// return true;
// }
// else
// {
// 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.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;
// }
// }
// //如果在中午上班考勤时间段
// else if (workstartlunch <= devicetime && devicetime <= workendlunch)
// {
// //迟到判断
// if (devicetime > workDateTimelunch)
// {
// //迟到
// //允许迟到判断
// if (attendancerulEntity.LateOvertime.HasValue && attendancerulEntity.LateOvertime != 0)
// {
// //中午上班最晚签到时间
// DateTime workDateTimeFree = workDateTimelunch.AddMinutes(Convert.ToDouble(attendancerulEntity.LateOvertime));
// if (devicetime < workDateTimeFree)
// {
// //正常
// ADType = "7";//中午上班
// ClockStatus = "1";//正常
// }
// else
// {
// //迟到
// ADType = "7";//中午上班
// ClockStatus = "2";//迟到
// }
// }
// else
// {
// //迟到
// ADType = "7";//中午上班
// ClockStatus = "2";//迟到
// }
// }
// else
// {
// //正常
// ADType = "7";//中午下班
// ClockStatus = "1";//正常
// }
// //写入考勤数据
// ADR_RecordEntity adrRecordEntity = new ADR_RecordEntity();
// adrRecordEntity.Create();
// adrRecordEntity.UserNo = EmpNo;
// adrRecordEntity.ADType = ADType;
// adrRecordEntity.ADTime = datetimenow;
// adrRecordEntity.ClockTime = devicetime;
// adrRecordEntity.ClockStatus = ClockStatus;
// //if (deviceEntity != null && !string.IsNullOrEmpty(deviceEntity.DName))
// //{
// // adrRecordEntity.ClockPlace = deviceEntity.DName;
// //}
// //else
// //{
// // adrRecordEntity.ClockPlace = "未知";
// //}
// adrRecordEntity.ADYear = strTimeYear;
// adrRecordEntity.ADMonth = strTimeMonth;
// adrRecordEntity.ADDay = strTimeDay;
// adrRecordEntity.ALon = ALon;
// adrRecordEntity.ALat = ALat;
// adrRecordEntity.AIsOut = AIsOut;
// adrRecordEntity.ARemark = ARemark;
// adrRecordEntity.ADPhoto = ADPhoto;
// adrRecordEntity.ClockPlace = ClockPlace;
// adrRecordEntity.Img = img;
// adrRecordEntity.IsFit = true;

// //考勤记录
// //去重
// 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)
// {
// 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.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;
// }
// else//不在中午考勤时间段判断迟到早退
// {

// if (devicetime <= signInEndTime)
// {
// ADType = "1";//上班
// ClockStatus = "1";//正常
// }
// else if (devicetime >= signOutStartTime)
// {
// ADType = "2";//下班
// ClockStatus = "1";//正常
// }
// else
// {
// //该用户当日有签到记录视为下班签退
// var attendancerecord = this.BaseRepository("CollegeMIS").FindList<ADR_RecordEntity>("select * from ADR_Record where ADYear='" + strTimeYear + "' and ADMonth='" + strTimeMonth + "' and ADDay='" + strTimeDay + "' and UserNo='" + EmpNo + "'");
// //首先判断上午考勤还是下午考勤
// //如果小于中午下班时间
// if (devicetime < offworkDateTimelunch)
// {
// //迟到
// //无上班记录视为迟到
// if (attendancerecord.Count(m => m.ADType == "1") == 0)
// {
// //上班迟到
// //获取迟到范围
// if (attendancerulEntity.LateOvertime.HasValue && attendancerulEntity.LateOvertime != 0)
// {
// DateTime workDateTimeFree = workDateTime.AddMinutes(Convert.ToDouble(attendancerulEntity.LateOvertime));
// if (devicetime <= workDateTimeFree)//在允许迟到范围内记为正常
// {
// ADType = "1";//上班
// ClockStatus = "1";//正常
// }
// else
// {
// ADType = "1";//上班
// ClockStatus = "2";//迟到
// }
// }
// else
// {
// ADType = "1";//上班
// ClockStatus = "2";//迟到
// }
// }
// //早退
// //有签到记录视为早退
// else
// {
// //获取早退范围
// if (attendancerulEntity.LeaveOverTime.HasValue && attendancerulEntity.LeaveOverTime != 0)
// {
// //最早签退时间
// DateTime offworkDateTimeFree = offworkDateTime.AddMinutes(-Convert.ToDouble(attendancerulEntity.LeaveOverTime));
// if (devicetime >= offworkDateTimeFree)//在允许早退范围内记为正常
// {
// ADType = "8";//中午下班
// ClockStatus = "1";//正常
// }
// else//超出早退范围视为早退
// {
// ADType = "8";//中午下班
// ClockStatus = "3";//早退
// }
// }
// else
// {
// ADType = "8";//中午下班
// ClockStatus = "3";//早退
// }

// }
// }
// else if (devicetime > workDateTimelunch)//如果大于中午上班时间,且上级if判断小于下班时间
// //判断为下午上班打卡迟到或早退
// {
// //如果存在中午签到记录
// //判断为下班早退
// if (attendancerecord.Count(m => m.ADType == "7") > 0)
// {
// //早退判断
// //获取早退范围
// if (attendancerulEntity.LeaveOverTime.HasValue && attendancerulEntity.LeaveOverTime != 0)
// {
// DateTime offworkDateTimeFree = offworkDateTime.AddMinutes(-Convert.ToDouble(attendancerulEntity.LeaveOverTime));
// if (devicetime >= offworkDateTimeFree)//在允许早退范围内记为正常
// {
// ADType = "2";//下班
// ClockStatus = "1";//正常
// }
// else//超出早退范围视为早退
// {
// ADType = "2";//下班
// ClockStatus = "3";//早退
// }
// }
// else
// {
// ADType = "2";//下班
// ClockStatus = "3";//早退
// }
// }
// else
// {
// //获取迟到范围
// if (attendancerulEntity.LateOvertime.HasValue && attendancerulEntity.LateOvertime != 0)
// {
// //最晚签到时间
// DateTime workDateTimeFree = workDateTimelunch.AddMinutes(Convert.ToDouble(attendancerulEntity.LateOvertime));
// if (devicetime <= workDateTimeFree)//在允许迟到范围内记为正常
// {
// ADType = "7";//中午上班
// ClockStatus = "1";//正常
// }
// else
// {
// ADType = "7";//中午上班
// ClockStatus = "2";//迟到
// }
// }
// else
// {
// ADType = "7";//中午上班
// ClockStatus = "2";//迟到
// }
// }
// }
// }

// ADR_RecordEntity adrRecordEntity = new ADR_RecordEntity();
// adrRecordEntity.Create();
// adrRecordEntity.UserNo = EmpNo;
// adrRecordEntity.ADType = ADType;
// adrRecordEntity.ADTime = datetimenow;
// adrRecordEntity.ClockTime = devicetime;
// adrRecordEntity.ClockStatus = ClockStatus;
// //if (deviceEntity != null && !string.IsNullOrEmpty(deviceEntity.DName))
// //{
// // adrRecordEntity.ClockPlace = deviceEntity.DName;
// //}
// //else
// //{
// // adrRecordEntity.ClockPlace = "未知";
// //}
// adrRecordEntity.ADYear = strTimeYear;
// adrRecordEntity.ADMonth = strTimeMonth;
// adrRecordEntity.ADDay = strTimeDay;
// adrRecordEntity.ALon = ALon;
// adrRecordEntity.ALat = ALat;
// adrRecordEntity.AIsOut = AIsOut;
// adrRecordEntity.ARemark = ARemark;
// adrRecordEntity.ADPhoto = ADPhoto;
// adrRecordEntity.ClockPlace = ClockPlace;
// adrRecordEntity.Img = img;
// adrRecordEntity.IsFit = true;


// //去重
// //获取当日考勤记录
// 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 (adrRecordEntity.ADType == "1" && attendancerecordlist.Count(m => m.ADType == "1") > 0)//签过到了
// {
// //每日保留第一次签到记录
// return true;
// }
// //中午签到去重
// if (adrRecordEntity.ADType == "7" && attendancerecordlist.Count(m => m.ADType == "7") > 0)//中午签过到了
// {
// //每日保留第一次中午签到记录
// return true;
// }
// //中午签退去重
// if (adrRecordEntity.ADType == "8" && attendancerecordlist.Count(m => m.ADType == "8") > 0)//中午签过退了
// {
// //更新签退时间,签退状态
// var firstoffworkentity = attendancerecordlist.FirstOrDefault(m => m.ADType == "8");
// firstoffworkentity.ADTime = datetimenow;
// firstoffworkentity.ClockTime = devicetime;
// firstoffworkentity.ClockStatus = ClockStatus;
// //firstoffworkentity.ADPhoto = str;
// this.BaseRepository("CollegeMIS").ExecuteBySql("update ADR_Record set ADTime='" + firstoffworkentity.ADTime + "',ClockTime='" + firstoffworkentity.ClockTime + "',ClockStatus='" + firstoffworkentity.ClockStatus + "',ADPhoto='" + firstoffworkentity.ADPhoto + "' where ID='" + firstoffworkentity.ID + "'");
// return true;
// }
// //签退去重
// if (adrRecordEntity.ADType == "2" && attendancerecordlist.Count(m => m.ADType == "2") > 0)//签过退了
// {
// //更新签退时间,签退状态
// var firstoffworkentity = attendancerecordlist.FirstOrDefault(m => m.ADType == "2");
// firstoffworkentity.ADTime = datetimenow;
// firstoffworkentity.ClockTime = devicetime;
// firstoffworkentity.ClockStatus = ClockStatus;
// //firstoffworkentity.ADPhoto = str;
// this.BaseRepository("CollegeMIS").ExecuteBySql("update ADR_Record set ADTime='" + firstoffworkentity.ADTime + "',ClockTime='" + firstoffworkentity.ClockTime + "',ClockStatus='" + firstoffworkentity.ClockStatus + "',ADPhoto='" + firstoffworkentity.ADPhoto + "' where ID='" + firstoffworkentity.ID + "'");
// //同步修改授课考勤打卡
// //ClockInModifyTeachAttendance(adrRecordEntity);
// 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,IsFit,ARemark) values(" +
// "'" + 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.IsFit + "','" + adrRecordEntity.ARemark + "')");
// //同步修改授课考勤打卡
// //ClockInModifyTeachAttendance(adrRecordEntity);
// return true;
// }

//}
#endregion


//}


//return true;

}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
}
}

Yükleniyor…
İptal
Kaydet