|
|
@@ -21,9 +21,13 @@ namespace Learun.Application.WebApi.Modules |
|
|
|
/// 注册接口 |
|
|
|
/// <summary> |
|
|
|
public DutyScheduleApi() |
|
|
|
: base("/Learun/adms/PersonnelManagement/DutySchedule") |
|
|
|
: base("/learun/adms/PersonnelManagement/DutySchedule") |
|
|
|
{ |
|
|
|
Get["/pagelist"] = GetPageList; |
|
|
|
Get["/list"] = GetList; |
|
|
|
Get["/form"] = GetForm; |
|
|
|
Post["/save"] = SaveForm; |
|
|
|
Post["/delete"] = DeleteForm; |
|
|
|
} |
|
|
|
#region 获取数据 |
|
|
|
|
|
|
@@ -45,6 +49,74 @@ namespace Learun.Application.WebApi.Modules |
|
|
|
}; |
|
|
|
return Success(jsonData); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 获取页面显示列表数据 |
|
|
|
/// <summary> |
|
|
|
/// <param name="_"></param> |
|
|
|
/// <returns></returns> |
|
|
|
public Response GetList(dynamic _) |
|
|
|
{ |
|
|
|
string queryJson = this.GetReqData(); |
|
|
|
var data = dutyScheduleIBLL.GetList(); |
|
|
|
return Success(data); |
|
|
|
} |
|
|
|
/// <summary> |
|
|
|
/// 获取表单数据 |
|
|
|
/// <summary> |
|
|
|
/// <param name="_"></param> |
|
|
|
/// <returns></returns> |
|
|
|
public Response GetForm(dynamic _) |
|
|
|
{ |
|
|
|
string keyValue = this.GetReqData(); |
|
|
|
var ScheduleData = dutyScheduleIBLL.GetDutyScheduleEntity(keyValue); |
|
|
|
//ScheduleData.StartTime = Convert.ToDateTime((ScheduleData.StartTime.ToDate().ToString("yyyy-MM-dd") + " " + ScheduleData.StartTime.Substring(0, 2) + ":" + ScheduleData.StartTime.Substring(2, 2)).ToDate().ToString("yyyy-MM-dd HH:mm")); |
|
|
|
//ScheduleData.EndTime = Convert.ToDateTime((ScheduleData.EndTime.ToDate().ToString("yyyy-MM-dd") + " " + ScheduleData.EndTime.Substring(0, 2) + ":" + ScheduleData.F_EndTime.Substring(2, 2)).ToDate().ToString("yyyy-MM-dd HH:mm")); |
|
|
|
var jsonData = new |
|
|
|
{ |
|
|
|
Schedule = ScheduleData, |
|
|
|
}; |
|
|
|
return Success(jsonData); |
|
|
|
} |
|
|
|
#endregion |
|
|
|
|
|
|
|
#region 提交数据 |
|
|
|
/// <summary> |
|
|
|
/// 保存实体数据(新增、修改) |
|
|
|
/// <param name="_"></param> |
|
|
|
/// <summary> |
|
|
|
/// <returns></returns> |
|
|
|
public Response SaveForm(dynamic _) |
|
|
|
{ |
|
|
|
ReqFormEntity parameter = this.GetReqData<ReqFormEntity>(); |
|
|
|
DutyScheduleEntity entity = parameter.strEntity.ToObject<DutyScheduleEntity>(); |
|
|
|
dutyScheduleIBLL.SaveEntity(parameter.keyValue, entity); |
|
|
|
return Success("保存成功!"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 删除实体数据 |
|
|
|
/// <param name="_"></param> |
|
|
|
/// <summary> |
|
|
|
/// <returns></returns> |
|
|
|
public Response DeleteForm(dynamic _) |
|
|
|
{ |
|
|
|
string keyValue = this.GetReqData(); |
|
|
|
dutyScheduleIBLL.DeleteEntity(keyValue); |
|
|
|
return Success("删除成功!"); |
|
|
|
} |
|
|
|
#endregion |
|
|
|
|
|
|
|
#region 私有类 |
|
|
|
/// <summary> |
|
|
|
/// 表单实体类 |
|
|
|
/// <summary> |
|
|
|
private class ReqFormEntity |
|
|
|
{ |
|
|
|
public string keyValue { get; set; } |
|
|
|
public string strEntity { get; set; } |
|
|
|
} |
|
|
|
#endregion |
|
|
|
} |
|
|
|
} |