Ver código fonte

考勤规则编辑

黑艺新账号
liangkun 1 ano atrás
pai
commit
e89f5e7afa
9 arquivos alterados com 94 adições e 51 exclusões
  1. +12
    -8
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Form.cshtml
  2. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Form.js
  3. +12
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Index.js
  4. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/AttendanceApi.cs
  5. +12
    -4
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ADR_Record/ADR_RecordEntity.cs
  6. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionBLL.cs
  7. +5
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionEntity.cs
  8. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionIBLL.cs
  9. +48
    -34
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionService.cs

+ 12
- 8
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Form.cshtml Ver arquivo

@@ -19,11 +19,11 @@
</div>
<div class="col-xs-6 lr-form-item" data-table="ADR_Restriction">
<div class="lr-form-item-title">上午签到有效时间<font face="宋体">*</font></div>
<input id="SignInStartTime" type="text" class="form-control " isvalid="yes" checkexpession="NotNull" />
<input id="SignInStartTime" type="text" class="form-control " isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-6 lr-form-item" data-table="ADR_Restriction">
<div class="lr-form-item-title">-<font face="宋体">*</font></div>
<input id="SignInEndTime" type="text" class="form-control " isvalid="yes" checkexpession="NotNull" />
<input id="SignInEndTime" type="text" class="form-control " isvalid="yes" checkexpession="NotNull" />
</div>

<div class="col-xs-12 lr-form-item" data-table="ADR_Restriction">
@@ -32,11 +32,11 @@
</div>
<div class="col-xs-6 lr-form-item" data-table="ADR_Restriction">
<div class="lr-form-item-title">下午签退有效时间<font face="宋体">*</font></div>
<input id="SignOutStartTime" type="text" class="form-control " isvalid="yes" checkexpession="NotNull" />
<input id="SignOutStartTime" type="text" class="form-control " isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-6 lr-form-item" data-table="ADR_Restriction">
<div class="lr-form-item-title">-<font face="宋体">*</font></div>
<input id="SignOutEndTime" type="text" class="form-control " isvalid="yes" checkexpession="NotNull" />
<input id="SignOutEndTime" type="text" class="form-control " isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-12 lr-form-item" data-table="ADR_Restriction">
<div class="lr-form-item-title">打卡次数<font face="宋体">*</font></div>
@@ -48,11 +48,11 @@
</div>
<div class="col-xs-6 lr-form-item" data-table="ADR_Restriction">
<div class="lr-form-item-title">中午签退有效时间<font face="宋体">*</font></div>
<input id="SignOutStartTime2" type="text" class="form-control " isvalid="yes" checkexpession="NotNull" />
<input id="SignOutStartTime2" type="text" class="form-control " isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-6 lr-form-item" data-table="ADR_Restriction">
<div class="lr-form-item-title">-<font face="宋体">*</font></div>
<input id="SignOutEndTime2" type="text" class="form-control " isvalid="yes" checkexpession="NotNull" />
<input id="SignOutEndTime2" type="text" class="form-control " isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-12 lr-form-item" data-table="ADR_Restriction">
<div class="lr-form-item-title">中午上班时间<font face="宋体">*</font></div>
@@ -60,11 +60,11 @@
</div>
<div class="col-xs-6 lr-form-item" data-table="ADR_Restriction">
<div class="lr-form-item-title">中午签到有效时间<font face="宋体">*</font></div>
<input id="SignInStartTime2" type="text" class="form-control " isvalid="yes" checkexpession="NotNull" />
<input id="SignInStartTime2" type="text" class="form-control " isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-6 lr-form-item" data-table="ADR_Restriction">
<div class="lr-form-item-title">-<font face="宋体">*</font></div>
<input id="SignInEndTime2" type="text" class="form-control " isvalid="yes" checkexpession="NotNull" />
<input id="SignInEndTime2" type="text" class="form-control " isvalid="yes" checkexpession="NotNull" />
</div>

<div class="col-xs-12 lr-form-item" data-table="ADR_Restriction">
@@ -82,6 +82,10 @@
<div class="col-xs-12 lr-form-item" data-table="ADR_Restriction">
<div class="lr-form-item-title">未签退,记为<font face="宋体">*</font></div>
<div id="NoSignOut" isvalid="yes" checkexpession="NotNull"></div>
</div>
<div class="col-xs-12 lr-form-item" data-table="ADR_Restriction">
<div class="lr-form-item-title">考勤人员类型<font face="宋体">*</font></div>
<div id="AType" isvalid="yes" checkexpession="NotNull"></div>
</div>
</div>
@Html.AppendJsFile("/Areas/PersonnelManagement/Views/ADR_Restriction/Form.js")

+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Form.js Ver arquivo

@@ -17,6 +17,7 @@ var bootstrap = function ($, learun) {
bind: function () {
$('#NoSignIn').lrDataItemSelect({ code: 'ADStatus' });
$('#NoSignOut').lrDataItemSelect({ code: 'ADStatus' });
$('#AType').lrDataItemSelect({ code: 'AType' });
$('#ClockTime').lrselect({
data: [{ 'value': '二次打卡', text: '二次打卡' }, { 'value': '四次打卡', text: '四次打卡' }],
value: "value",


+ 12
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Index.js Ver arquivo

@@ -76,7 +76,7 @@ var bootstrap = function ($, learun) {
},
// 初始化列表
initGird: function () {
$('#gridtable').lrAuthorizeJfGrid({
$('#gridtable').jfGrid({
url: top.$.rootUrl + '/PersonnelManagement/ADR_Restriction/GetPageList',
headData: [
{ label: "上班时间", name: "WorkTime", width: 100, align: "left" },
@@ -118,6 +118,17 @@ var bootstrap = function ($, learun) {
});
}
},
{
label: "考勤人员类型", name: "AType", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('dataItem', {
key: value,
code: 'AType',
callback: function (_data) {
callback(_data.text);
}
});
}
},
{
label: "是否启用", name: "REnable", width: 100, align: "left", formatter: function (val) {
return val ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/AttendanceApi.cs Ver arquivo

@@ -62,7 +62,7 @@ namespace Learun.Application.WebApi.Modules
{
Attendance parameter = this.GetReqData<Attendance>();

adr_RestrictionBLL.ClockIn();
adr_RestrictionBLL.ClockIn(parameter.ALon, parameter.ALat, parameter.AIsOut, parameter.ARemark,parameter.ADPhoto,parameter.ClockPlace);

return Success("打卡成功");
}


+ 12
- 4
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ADR_Record/ADR_RecordEntity.cs Ver arquivo

@@ -79,16 +79,24 @@ 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; }

/// <summary>
/// 是否外勤
/// </summary>
[Column("AISOUT")]
public bool AIsOut { get; set; }

/// <summary>
/// 备注
/// </summary>
[Column("AREMARK")]
public string ARemark { get; set; }
#endregion


+ 2
- 2
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionBLL.cs Ver arquivo

@@ -147,11 +147,11 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
/// 考勤打卡
/// </summary>
/// <returns></returns>
public bool ClockIn()
public bool ClockIn(decimal ALon, decimal ALat,bool AIsOut,string ARemark,string ADPhoto,string ClockPlace)
{
try
{
return aDR_RestrictionService.ClockIn();
return aDR_RestrictionService.ClockIn(ALon,ALat,AIsOut,ARemark,ADPhoto,ClockPlace);
}
catch (Exception ex)
{


+ 5
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionEntity.cs Ver arquivo

@@ -141,6 +141,11 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement

[Column("BLUETOOTHID")]
public string BlueToothId { get; set; }
/// <summary>
/// 考勤类型(1正常,2全天考勤)
/// </summary>
[Column("ATYPE")]
public int AType { get; set; }

#endregion



+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionIBLL.cs Ver arquivo

@@ -53,7 +53,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
/// 考勤打卡
/// </summary>
/// <returns></returns>
bool ClockIn();
bool ClockIn(decimal ALon, decimal ALat, bool AIsOut, string ARemark, string ADPhoto, string ClockPlace);

string IsAttendance();
#endregion


+ 48
- 34
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionService.cs Ver arquivo

@@ -33,28 +33,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
try
{
var strSql = new StringBuilder();
strSql.Append("SELECT ");
strSql.Append(@"
t.ID,
t.WorkTime,
t.CloseTime,
t.SignInStartTime,
t.SignInEndTime,
t.SignOutStartTime,
t.SignOutEndTime,
t.LateOvertime,
t.LeaveOverTime,
t.NoSignIn,
t.REnable,
t.ClockTime,
t.SignInStartTime2,
t.SignInEndTime2,
t.NoonWorkTime,
t.NoonCloseTime,
t.SignOutStartTime2,
t.SignOutEndTime2,
t.NoSignOut
");
strSql.Append("SELECT * ");
strSql.Append(" FROM ADR_Restriction t ");
strSql.Append(" WHERE 1=1 ");
var queryParam = queryJson.ToJObject();
@@ -135,8 +114,8 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
var db = this.BaseRepository("CollegeMIS").BeginTrans();
try
{
var sql = "UPDATE dbo.ADR_Restriction SET REnable='false'";
db.ExecuteBySql(sql);
//var sql = "UPDATE dbo.ADR_Restriction SET REnable='false'";
//db.ExecuteBySql(sql);
var entity = db.FindEntity<ADR_RestrictionEntity>(a => a.ID == keyValue);
entity.REnable = true;
db.Update(entity);
@@ -193,7 +172,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
/// 考勤打卡
/// </summary>
/// <returns></returns>
public bool ClockIn()
public bool ClockIn(decimal ALon, decimal ALat, bool AIsOut, string ARemark, string ADPhoto, string ClockPlace)
{
try
{
@@ -418,6 +397,12 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
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;
////记录日志
//ADR_DeviceLogEntity adrDeviceLogEntity = new ADR_DeviceLogEntity();
//adrDeviceLogEntity.Create();
@@ -454,10 +439,10 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
return true;
}
//考勤记录
this.BaseRepository("CollegeMIS").ExecuteBySql("insert into ADR_Record(ID, UserNo, ADType, ADTime, ClockTime, ClockStatus, ClockPlace, ADYear, ADMonth, ADDay, ADPhoto) values(" +
this.BaseRepository("CollegeMIS").ExecuteBySql("insert into ADR_Record(ID, UserNo, ADType, ADTime, ClockTime, ClockStatus, ClockPlace, ADYear, ADMonth, ADDay, ADPhoto,ALon,ALat,AIsOut,ARemark) values(" +
"'" + adrRecordEntity.ID + "','" + adrRecordEntity.UserNo + "','" + adrRecordEntity.ADType + "','" + adrRecordEntity.ADTime + "'," +
"'" + adrRecordEntity.ClockTime + "','" + adrRecordEntity.ClockStatus + "','" + adrRecordEntity.ClockPlace + "','" + adrRecordEntity.ADYear + "'," +
"'" + adrRecordEntity.ADMonth + "','" + adrRecordEntity.ADDay + "','" + adrRecordEntity.ADPhoto + "')");
"'" + adrRecordEntity.ADMonth + "','" + adrRecordEntity.ADDay + "','" + adrRecordEntity.ADPhoto + "',"+adrRecordEntity.ALon+","+adrRecordEntity.ALat+","+adrRecordEntity.AIsOut+",'"+adrRecordEntity.ARemark+"')");
return true;
}
#endregion
@@ -533,6 +518,12 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
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;
////记录日志
//ADR_DeviceLogEntity adrDeviceLogEntity = new ADR_DeviceLogEntity();
//adrDeviceLogEntity.Create();
@@ -563,10 +554,10 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
}
else
{
this.BaseRepository("CollegeMIS").ExecuteBySql("insert into ADR_Record(ID, UserNo, ADType, ADTime, ClockTime, ClockStatus, ClockPlace, ADYear, ADMonth, ADDay, ADPhoto) values(" +
this.BaseRepository("CollegeMIS").ExecuteBySql("insert into ADR_Record(ID, UserNo, ADType, ADTime, ClockTime, ClockStatus, ClockPlace, ADYear, ADMonth, ADDay, ADPhoto,ALon,ALat,AIsOut,ARemark) values(" +
"'" + adrRecordEntity.ID + "','" + adrRecordEntity.UserNo + "','" + adrRecordEntity.ADType + "','" + adrRecordEntity.ADTime + "'," +
"'" + adrRecordEntity.ClockTime + "','" + adrRecordEntity.ClockStatus + "','" + adrRecordEntity.ClockPlace + "','" + adrRecordEntity.ADYear + "'," +
"'" + adrRecordEntity.ADMonth + "','" + adrRecordEntity.ADDay + "','" + adrRecordEntity.ADPhoto + "')");
"'" + adrRecordEntity.ADMonth + "','" + adrRecordEntity.ADDay + "','" + adrRecordEntity.ADPhoto + "'," + adrRecordEntity.ALon + "," + adrRecordEntity.ALat + "," + adrRecordEntity.AIsOut + ",'" + adrRecordEntity.ARemark + "')");
return true;
}
}
@@ -627,6 +618,12 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
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;
////记录日志
//ADR_DeviceLogEntity adrDeviceLogEntity = new ADR_DeviceLogEntity();
//adrDeviceLogEntity.Create();
@@ -647,10 +644,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();
if (attendancerecordlist.Count(m => m.ADType == "7") == 0)
{
this.BaseRepository("CollegeMIS").ExecuteBySql("insert into ADR_Record(ID, UserNo, ADType, ADTime, ClockTime, ClockStatus, ClockPlace, ADYear, ADMonth, ADDay, ADPhoto) values(" +
this.BaseRepository("CollegeMIS").ExecuteBySql("insert into ADR_Record(ID, UserNo, ADType, ADTime, ClockTime, ClockStatus, ClockPlace, ADYear, ADMonth, ADDay, ADPhoto,ALon,ALat,AIsOut,ARemark) values(" +
"'" + adrRecordEntity.ID + "','" + adrRecordEntity.UserNo + "','" + adrRecordEntity.ADType + "','" + adrRecordEntity.ADTime + "'," +
"'" + adrRecordEntity.ClockTime + "','" + adrRecordEntity.ClockStatus + "','" + adrRecordEntity.ClockPlace + "','" + adrRecordEntity.ADYear + "'," +
"'" + adrRecordEntity.ADMonth + "','" + adrRecordEntity.ADDay + "','" + adrRecordEntity.ADPhoto + "')");
"'" + adrRecordEntity.ADMonth + "','" + adrRecordEntity.ADDay + "','" + adrRecordEntity.ADPhoto + "'," + adrRecordEntity.ALon + "," + adrRecordEntity.ALat + "," + adrRecordEntity.AIsOut + ",'" + adrRecordEntity.ARemark + "')");
}
return true;
}
@@ -975,6 +972,12 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
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.ADPhoto = str;
////记录日志
//ADR_DeviceLogEntity adrDeviceLogEntitylateorleave = new ADR_DeviceLogEntity();
@@ -1030,10 +1033,10 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
return true;
}
//考勤记录
this.BaseRepository("CollegeMIS").ExecuteBySql("insert into ADR_Record(ID, UserNo, ADType, ADTime, ClockTime, ClockStatus, ClockPlace, ADYear, ADMonth, ADDay, ADPhoto) values(" +
this.BaseRepository("CollegeMIS").ExecuteBySql("insert into ADR_Record(ID, UserNo, ADType, ADTime, ClockTime, ClockStatus, ClockPlace, ADYear, ADMonth, ADDay, ADPhoto,ALon,ALat,AIsOut,ARemark) values(" +
"'" + adrRecordEntity.ID + "','" + adrRecordEntity.UserNo + "','" + adrRecordEntity.ADType + "','" + adrRecordEntity.ADTime + "'," +
"'" + adrRecordEntity.ClockTime + "','" + adrRecordEntity.ClockStatus + "','" + adrRecordEntity.ClockPlace + "','" + adrRecordEntity.ADYear + "'," +
"'" + adrRecordEntity.ADMonth + "','" + adrRecordEntity.ADDay + "','" + adrRecordEntity.ADPhoto + "')");
"'" + adrRecordEntity.ADMonth + "','" + adrRecordEntity.ADDay + "','" + adrRecordEntity.ADPhoto + "'," + adrRecordEntity.ALon + "," + adrRecordEntity.ALat + "," + adrRecordEntity.AIsOut + ",'" + adrRecordEntity.ARemark + "')");
return true;
}

@@ -1068,6 +1071,8 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
{
try
{
var userinfo = LoginUserInfo.Get();
var empinfo = BaseRepository("").FindEntity<EmpInfoEntity>(m=>m.EmpNo==userinfo.account);
//当前服务器日期
var datenow = DateTime.Now.ToString("yyyy-MM-dd");

@@ -1075,7 +1080,16 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
var EmpNo = LoginUserInfo.Get().account;

//首先获取考勤规则
var attendancerulEntity = this.BaseRepository("CollegeMIS").FindEntity<ADR_RestrictionEntity>(m => m.REnable == true);
ADR_RestrictionEntity attendancerulEntity =null;
//代课老师全天可以考勤
if (empinfo.IsHasLesson==true)
{
attendancerulEntity = this.BaseRepository("CollegeMIS").FindEntity<ADR_RestrictionEntity>(m => m.REnable == true&&m.AType==2);
}
else
{
attendancerulEntity = this.BaseRepository("CollegeMIS").FindEntity<ADR_RestrictionEntity>(m => m.REnable == true && m.AType == 1);
}
//上班时间
DateTime workDateTime = Convert.ToDateTime(datenow + " " + attendancerulEntity.WorkTime);
//上班考勤时间段


Carregando…
Cancelar
Salvar