@@ -0,0 +1,132 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using System.Web.Mvc; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-06-17 11:00 | |||
/// 描 述:体温上报 | |||
/// </summary> | |||
public class HealthPunchStuController : MvcControllerBase | |||
{ | |||
private HealthPunchStuIBLL healthPunchStuIBLL = new HealthPunchStuBLL(); | |||
#region 视图功能 | |||
/// <summary> | |||
/// 主页面 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Form() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetPageList(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = healthPunchStuIBLL.GetPageList(paginationobj, queryJson); | |||
var jsonData = new | |||
{ | |||
rows = data, | |||
total = paginationobj.total, | |||
page = paginationobj.page, | |||
records = paginationobj.records | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取表单数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetFormData(string keyValue) | |||
{ | |||
var HealthPunchStuData = healthPunchStuIBLL.GetHealthPunchStuEntity(keyValue); | |||
var jsonData = new | |||
{ | |||
HealthPunchStu = HealthPunchStuData, | |||
}; | |||
return Success(jsonData); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DeleteForm(string keyValue) | |||
{ | |||
healthPunchStuIBLL.DeleteEntity(keyValue); | |||
return Success("删除成功!"); | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="strEntity">实体</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveForm(string keyValue, string strEntity) | |||
{ | |||
HealthPunchStuEntity entity = strEntity.ToObject<HealthPunchStuEntity>(); | |||
healthPunchStuIBLL.SaveEntity(keyValue, entity); | |||
return Success("保存成功!"); | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="strEntity">实体</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult PunchCard(string keyValue, string strEntity) | |||
{ | |||
HealthPunchStuEntity entity = strEntity.ToObject<HealthPunchStuEntity>(); | |||
var result = healthPunchStuIBLL.PunchCard(keyValue, entity); | |||
return Success(result); | |||
} | |||
#endregion | |||
} | |||
} |
@@ -106,10 +106,22 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
public ActionResult SaveForm(string keyValue, string strEntity) | |||
{ | |||
HealthPunchTimeEntity entity = strEntity.ToObject<HealthPunchTimeEntity>(); | |||
healthPunchTimeIBLL.SaveEntity(keyValue, entity); | |||
var model = healthPunchTimeIBLL.GetTypeEntity(entity.Description); | |||
if (string.IsNullOrEmpty(keyValue)) | |||
{ | |||
if (model != null) | |||
{ | |||
return Fail("当前时间段已存在!"); | |||
} | |||
} | |||
else | |||
{ | |||
if (model != null && model.ID != keyValue) | |||
{ | |||
return Fail("当前时间段已存在!"); | |||
} | |||
} | |||
healthPunchTimeIBLL.SaveEntity(keyValue, entity); | |||
return Success("保存成功!"); | |||
} | |||
[HttpPost] | |||
@@ -0,0 +1,19 @@ | |||
@{ | |||
ViewBag.Title = "体温上报"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-6 lr-form-item" data-table="HealthPunchStu" > | |||
<div class="lr-form-item-title">学生姓名</div> | |||
<input id="StuNo" type="text" readonly class="form-control currentInfo lr-currentInfo-user" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="HealthPunchStu" > | |||
<div class="lr-form-item-title">体温上报<font face="宋体">*</font></div> | |||
<input id="Temperature" type="text" class="form-control" isvalid="yes" checkexpession="PositiveFloatint" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="HealthPunchStu" > | |||
<div class="lr-form-item-title">打卡所在地址<font face="宋体">*</font></div> | |||
<textarea id="Address" class="form-control" style="height:100px;" isvalid="yes" checkexpession="NotNull" ></textarea> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/HealthPunchStu/Form.js") |
@@ -0,0 +1,52 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-06-17 11:00 | |||
* 描 述:体温上报 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#StuNo')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; | |||
$('#StuNo').val(learun.clientdata.get(['userinfo']).realName); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/HealthPunchStu/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id ).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var postData = { | |||
strEntity: JSON.stringify($('body').lrGetFormData()) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/HealthPunchStu/PunchCard?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,26 @@ | |||
@{ | |||
ViewBag.Title = "体温上报"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout " > | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/HealthPunchStu/Index.js") |
@@ -0,0 +1,137 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-06-17 11:00 | |||
* 描 述:体温上报 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '新增', | |||
url: top.$.rootUrl + '/EducationalAdministration/HealthPunchStu/Form', | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
// 编辑 | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/EducationalAdministration/HealthPunchStu/Form?keyValue=' + keyValue, | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
}); | |||
// 删除 | |||
$('#lr_delete').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/HealthPunchStu/DeleteForm', { keyValue: keyValue }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/HealthPunchStu/GetPageList', | |||
headData: [ | |||
{ label: "学工号", name: "StuNo", width: 100, align: "left" }, | |||
{ label: "学生姓名", name: "StuName", width: 100, align: "left" }, | |||
{ | |||
label: "性别", name: "Sex", width: 100, align: "left", | |||
formatter: function (cellvalue) { | |||
return cellvalue == 1 ? "男" : "女"; | |||
} | |||
}, | |||
{ | |||
label: "所属院校", name: "F_School", width: 150, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', | |||
key: value, | |||
keyId: 'f_companyid', | |||
callback: function (_data) { | |||
callback(_data['f_fullname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "所属专业", name: "MajorNo", width: 150, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', | |||
key: value, | |||
keyId: 'majorno', | |||
callback: function (_data) { | |||
callback(_data['majorname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "所属班级", name: "ClassNo", width: 150, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', | |||
key: value, | |||
keyId: 'classno', | |||
callback: function (_data) { | |||
callback(_data['classname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "年级", name: "Grade", width: 100, align: "left" }, | |||
{ label: "联系方式", name: "Phone", width: 100, align: "left" }, | |||
{ label: "阶段", name: "Temperature", width: 100, align: "left" }, | |||
{ label: "打卡所在地址", name: "Address", width: 200, align: "left" }, | |||
{ label: "打卡时间", name: "CreateTime", width: 140, align: "left" }, | |||
{ label: "备注", name: "Remark", width: 200, align: "left" }, | |||
], | |||
mainId: 'ID', | |||
isPage: true, | |||
sidx: 'CreateTime desc', | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
$('#gridtable').jfGridSet('reload'); | |||
}; | |||
page.init(); | |||
} |
@@ -30,8 +30,8 @@ | |||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||
<a id="lr_lock" class="btn btn-default"><i class="fa fa-plus"></i> 启用</a> | |||
<a id="lr_unlock" class="btn btn-default"><i class="fa fa-plus"></i> 禁用</a> | |||
<a id="lr_lock" class="btn btn-default"><i class="fa fa-plus"></i> 禁/启用</a> | |||
@*<a id="lr_unlock" class="btn btn-default"><i class="fa fa-plus"></i> 禁用</a>*@ | |||
</div> | |||
</div> | |||
</div> | |||
@@ -39,6 +39,11 @@ var bootstrap = function ($, learun) { | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
var CheckMark = $('#gridtable').jfGridValue('CheckMark'); | |||
if (CheckMark !== 1) { | |||
learun.alert.warning("当前项目已启用不能编辑!"); | |||
return; | |||
} | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
@@ -55,10 +60,10 @@ var bootstrap = function ($, learun) { | |||
$('#lr_delete').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
var CheckMark = $('#gridtable').jfGridValue('CheckMark'); | |||
if (CheckMark == 1) { | |||
return | |||
if (CheckMark !== 1) { | |||
learun.alert.warning("当前项目已启用不能删除!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||
if (res) { | |||
@@ -83,19 +88,6 @@ var bootstrap = function ($, learun) { | |||
}); | |||
} | |||
}); | |||
// 禁用 | |||
$('#lr_unlock').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerConfirm('是否确认启用!', function (res) { | |||
if (res) { | |||
learun.postForm(top.$.rootUrl + '/EducationalAdministration/HealthPunchTime/EnableForm', { keyValue: keyValue }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
@@ -138,7 +130,9 @@ var bootstrap = function ($, learun) { | |||
{ label: "备注", name: "Remark", width: 100, align: "left" }, | |||
], | |||
mainId: 'ID', | |||
isPage: true | |||
isPage: true, | |||
sidx: 'Description asc', | |||
}); | |||
page.search(); | |||
}, | |||
@@ -834,6 +834,7 @@ | |||
<Compile Include="Areas\EducationalAdministration\Controllers\Sys_PsychologicalCounseController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\Exam_ExamTeacherTimeController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\HealthPunchTimeController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\HealthPunchStuController.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Content Include="Areas\AdmissionsPlatform\Views\AP_OnlineUserInfo\DropOutIndex.js" /> | |||
@@ -6556,6 +6557,10 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\HealthPunchTime\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\HealthPunchTime\Form.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\HealthPunchTime\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\HealthPunchStu\Index.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\HealthPunchStu\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\HealthPunchStu\Form.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\HealthPunchStu\Form.js" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Folder Include="Areas\EducationalAdministration\Views\HomeStatistics\" /> | |||
@@ -0,0 +1,29 @@ | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using System.Data.Entity.ModelConfiguration; | |||
namespace Learun.Application.Mapping | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-06-17 11:00 | |||
/// 描 述:体温上报 | |||
/// </summary> | |||
public class HealthPunchStuMap : EntityTypeConfiguration<HealthPunchStuEntity> | |||
{ | |||
public HealthPunchStuMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("HEALTHPUNCHSTU"); | |||
//主键 | |||
this.HasKey(t => t.ID); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -589,6 +589,7 @@ | |||
<Compile Include="EducationalAdministration\Sys_PsychologicalCounseMap.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamTeacherTimeMap.cs" /> | |||
<Compile Include="EducationalAdministration\HealthPunchTimeMap.cs" /> | |||
<Compile Include="EducationalAdministration\HealthPunchStuMap.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | |||
@@ -0,0 +1,143 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-06-17 11:00 | |||
/// 描 述:体温上报 | |||
/// </summary> | |||
public class HealthPunchStuBLL : HealthPunchStuIBLL | |||
{ | |||
private HealthPunchStuService healthPunchStuService = new HealthPunchStuService(); | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<HealthPunchStuEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return healthPunchStuService.GetPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取HealthPunchStu表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public HealthPunchStuEntity GetHealthPunchStuEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return healthPunchStuService.GetHealthPunchStuEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
healthPunchStuService.DeleteEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
/// <returns></returns> | |||
public void SaveEntity(string keyValue, HealthPunchStuEntity entity) | |||
{ | |||
try | |||
{ | |||
healthPunchStuService.SaveEntity(keyValue, entity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public string PunchCard(string keyValue, HealthPunchStuEntity entity) | |||
{ | |||
try | |||
{ | |||
return healthPunchStuService.PunchCard(keyValue, entity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,145 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.ComponentModel.DataAnnotations.Schema; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-06-17 11:00 | |||
/// 描 述:体温上报 | |||
/// </summary> | |||
public class HealthPunchStuEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// ID | |||
/// </summary> | |||
[Column("ID")] | |||
public string ID { get; set; } | |||
/// <summary> | |||
/// 打卡开始时间 | |||
/// </summary> | |||
[Column("STARTTIME")] | |||
public string StartTime { get; set; } | |||
/// <summary> | |||
/// 打卡结束时间 | |||
/// </summary> | |||
[Column("ENDRTIME")] | |||
public string EndRTime { get; set; } | |||
/// <summary> | |||
/// 学号 | |||
/// </summary> | |||
[Column("STUNO")] | |||
public string StuNo { get; set; } | |||
/// <summary> | |||
/// 学生名称 | |||
/// </summary> | |||
[Column("STUNAME")] | |||
public string StuName { get; set; } | |||
/// <summary> | |||
/// Sex | |||
/// </summary> | |||
[Column("SEX")] | |||
public int? Sex { get; set; } | |||
/// <summary> | |||
/// 温度 | |||
/// </summary> | |||
[Column("TEMPERATURE")] | |||
public string Temperature { get; set; } | |||
/// <summary> | |||
/// 年级 | |||
/// </summary> | |||
[Column("GRADE")] | |||
public string Grade { get; set; } | |||
/// <summary> | |||
/// ClassNo | |||
/// </summary> | |||
[Column("CLASSNO")] | |||
public string ClassNo { get; set; } | |||
/// <summary> | |||
/// DeptNo | |||
/// </summary> | |||
[Column("DEPTNO")] | |||
public string DeptNo { get; set; } | |||
/// <summary> | |||
/// MajorNo | |||
/// </summary> | |||
[Column("MAJORNO")] | |||
public string MajorNo { get; set; } | |||
/// <summary> | |||
/// F_School | |||
/// </summary> | |||
[Column("F_SCHOOL")] | |||
public string F_School { get; set; } | |||
/// <summary> | |||
/// Phone | |||
/// </summary> | |||
[Column("PHONE")] | |||
public string Phone { get; set; } | |||
/// <summary> | |||
/// Year | |||
/// </summary> | |||
[Column("YEAR")] | |||
public string Year { get; set; } | |||
/// <summary> | |||
/// DKDate | |||
/// </summary> | |||
[Column("DKDATE")] | |||
public DateTime? DKDate { get; set; } | |||
/// <summary> | |||
/// Moth | |||
/// </summary> | |||
[Column("MOTH")] | |||
public string Moth { get; set; } | |||
/// <summary> | |||
/// Day | |||
/// </summary> | |||
[Column("DAY")] | |||
public string Day { get; set; } | |||
/// <summary> | |||
/// DKType | |||
/// </summary> | |||
[Column("DKTYPE")] | |||
public string DKType { get; set; } | |||
/// <summary> | |||
/// Address | |||
/// </summary> | |||
[Column("ADDRESS")] | |||
public string Address { get; set; } | |||
/// <summary> | |||
/// 打卡时间 | |||
/// </summary> | |||
[Column("CREATETIME")] | |||
public DateTime? CreateTime { get; set; } | |||
/// <summary> | |||
/// Remark | |||
/// </summary> | |||
[Column("REMARK")] | |||
public string Remark { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
/// <summary> | |||
/// 新增调用 | |||
/// </summary> | |||
public void Create() | |||
{ | |||
this.ID = Guid.NewGuid().ToString(); | |||
} | |||
/// <summary> | |||
/// 编辑调用 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
public void Modify(string keyValue) | |||
{ | |||
this.ID = keyValue; | |||
} | |||
#endregion | |||
#region 扩展字段 | |||
#endregion | |||
} | |||
} | |||
@@ -0,0 +1,51 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-06-17 11:00 | |||
/// 描 述:体温上报 | |||
/// </summary> | |||
public interface HealthPunchStuIBLL | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<HealthPunchStuEntity> GetPageList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取HealthPunchStu表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
HealthPunchStuEntity GetHealthPunchStuEntity(string keyValue); | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
void DeleteEntity(string keyValue); | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
void SaveEntity(string keyValue, HealthPunchStuEntity entity); | |||
string PunchCard(string keyValue, HealthPunchStuEntity entity); | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,263 @@ | |||
using Dapper; | |||
using Learun.DataBase.Repository; | |||
using Learun.Util; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Data; | |||
using System.Text; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-06-17 11:00 | |||
/// 描 述:体温上报 | |||
/// </summary> | |||
public class HealthPunchStuService : RepositoryFactory | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">查询参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<HealthPunchStuEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(@"* "); | |||
strSql.Append(" FROM HealthPunchStu t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
return this.BaseRepository("CollegeMIS").FindList<HealthPunchStuEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取HealthPunchStu表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public HealthPunchStuEntity GetHealthPunchStuEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindEntity<HealthPunchStuEntity>(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
this.BaseRepository("CollegeMIS").Delete<HealthPunchStuEntity>(t => t.ID == keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
public void SaveEntity(string keyValue, HealthPunchStuEntity entity) | |||
{ | |||
try | |||
{ | |||
var userInfo = LoginUserInfo.Get(); | |||
var stuInfo = this.BaseRepository("CollegeMIS").FindEntity<StuInfoBasicEntity>(x => x.StuNo == userInfo.account); | |||
if (stuInfo != null) | |||
{ | |||
entity.StuNo = stuInfo.StuNo; | |||
entity.StuName = userInfo.realName; | |||
entity.Phone = stuInfo.mobile; | |||
entity.F_School = stuInfo.F_SchoolId; | |||
entity.DeptNo = stuInfo.DeptNo; | |||
entity.MajorNo = stuInfo.MajorNo; | |||
entity.ClassNo = stuInfo.ClassNo; | |||
entity.Grade = stuInfo.Grade; | |||
entity.Sex = Convert.ToInt32(stuInfo.GenderNo); | |||
entity.CreateTime = DateTime.Now; | |||
entity.DKDate = DateTime.Now; | |||
entity.Year = DateTime.Now.Year.ToString(); | |||
entity.Moth = DateTime.Now.Month.ToString(); | |||
entity.Day = DateTime.Now.Day.ToString(); | |||
} | |||
entity.Create(); | |||
this.BaseRepository("CollegeMIS").Insert(entity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
public string PunchCard(string keyValue, HealthPunchStuEntity entity) | |||
{ | |||
try | |||
{ | |||
//获取打卡规则 | |||
var dktime1 = this.BaseRepository("CollegeMIS").FindEntity<HealthPunchTimeEntity>(x => x.CheckMark == 0 && x.Description == "1"); | |||
var dktime2 = this.BaseRepository("CollegeMIS").FindEntity<HealthPunchTimeEntity>(x => x.CheckMark == 0 && x.Description == "2"); | |||
var dktime3 = this.BaseRepository("CollegeMIS").FindEntity<HealthPunchTimeEntity>(x => x.CheckMark == 0 && x.Description == "3"); | |||
var datenow = DateTime.Now.ToString("yyyy-MM-dd"); | |||
DateTime Nowdate = DateTime.Now; | |||
DateTime todyTime = DateTime.Now.Date; | |||
var userInfo = LoginUserInfo.Get(); | |||
if (dktime1 != null && dktime2 != null && dktime3 != null) | |||
{ | |||
DateTime Startime1 = Convert.ToDateTime(datenow + " " + dktime1.StarTime); | |||
DateTime Startime2 = Convert.ToDateTime(datenow + " " + dktime1.EndTime); | |||
DateTime Startime3 = Convert.ToDateTime(datenow + " " + dktime2.StarTime); | |||
DateTime Startime4 = Convert.ToDateTime(datenow + " " + dktime2.EndTime); | |||
DateTime Startime5 = Convert.ToDateTime(datenow + " " + dktime3.StarTime); | |||
DateTime Startime6 = Convert.ToDateTime(datenow + " " + dktime3.EndTime); | |||
#region 学生数据 | |||
var stuInfo = this.BaseRepository("CollegeMIS").FindEntity<StuInfoBasicEntity>(x => x.StuNo == userInfo.account); | |||
if (stuInfo != null) | |||
{ | |||
entity.StuNo = stuInfo.StuNo; | |||
entity.StuName = userInfo.realName; | |||
entity.Phone = stuInfo.mobile; | |||
entity.F_School = stuInfo.F_SchoolId; | |||
entity.DeptNo = stuInfo.DeptNo; | |||
entity.MajorNo = stuInfo.MajorNo; | |||
entity.ClassNo = stuInfo.ClassNo; | |||
entity.Grade = stuInfo.Grade; | |||
entity.Sex = Convert.ToInt32(stuInfo.GenderNo); | |||
entity.CreateTime = DateTime.Now; | |||
entity.DKDate = DateTime.Now; | |||
entity.Year = DateTime.Now.Year.ToString(); | |||
entity.Moth = DateTime.Now.Month.ToString(); | |||
entity.Day = DateTime.Now.Day.ToString(); | |||
} | |||
else | |||
{ | |||
return "学生数据不存在!"; | |||
} | |||
#endregion | |||
if (Startime1 <= Nowdate && Startime2 >= Nowdate) //早上打卡 | |||
{ | |||
var HealthPunchStu = this.BaseRepository("CollegeMIS").FindEntity<HealthPunchStuEntity>(x => x.DKDate == todyTime && x.DKType == "1" && x.StuNo == userInfo.account); | |||
if (HealthPunchStu == null) | |||
{ | |||
entity.DKType = "1"; | |||
} | |||
else | |||
{ | |||
return "请勿重复打卡!"; | |||
} | |||
} | |||
else if (Startime3 <= Nowdate && Startime4 >= Nowdate) | |||
{ | |||
var HealthPunchStu = this.BaseRepository("CollegeMIS").FindEntity<HealthPunchStuEntity>(x => x.DKDate == todyTime && x.DKType == "2" && x.StuNo == userInfo.account); | |||
if (HealthPunchStu == null) | |||
{ | |||
entity.DKType = "2"; | |||
} | |||
else | |||
{ | |||
return "请勿重复打卡!"; | |||
} | |||
} | |||
else if (Startime5 <= Nowdate && Startime6 >= Nowdate) | |||
{ | |||
var HealthPunchStu = this.BaseRepository("CollegeMIS").FindEntity<HealthPunchStuEntity>(x => x.DKDate == todyTime && x.DKType == "3" && x.StuNo == userInfo.account); | |||
if (HealthPunchStu == null) | |||
{ | |||
entity.DKType = "3"; | |||
} | |||
else | |||
{ | |||
return "请勿重复打卡"; | |||
} | |||
} | |||
else | |||
{ | |||
return "请在规定的时间段内打卡!"; | |||
} | |||
} | |||
else | |||
{ | |||
return "请先设置打卡时间"; | |||
} | |||
entity.Create(); | |||
this.BaseRepository("CollegeMIS").Insert(entity); | |||
return "保存成功"; | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -66,6 +66,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
} | |||
public HealthPunchTimeEntity GetTypeEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return healthPunchTimeService.GetTypeEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
@@ -27,6 +27,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
HealthPunchTimeEntity GetHealthPunchTimeEntity(string keyValue); | |||
HealthPunchTimeEntity GetTypeEntity(string Type); | |||
#endregion | |||
#region 提交数据 | |||
@@ -94,6 +94,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
} | |||
public HealthPunchTimeEntity GetTypeEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindEntity<HealthPunchTimeEntity>(x => x.Description == keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
@@ -1786,6 +1786,10 @@ | |||
<Compile Include="EducationalAdministration\HealthPunchTime\HealthPunchTimeService.cs" /> | |||
<Compile Include="EducationalAdministration\HealthPunchTime\HealthPunchTimeBLL.cs" /> | |||
<Compile Include="EducationalAdministration\HealthPunchTime\HealthPunchTimeIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\HealthPunchStu\HealthPunchStuEntity.cs" /> | |||
<Compile Include="EducationalAdministration\HealthPunchStu\HealthPunchStuService.cs" /> | |||
<Compile Include="EducationalAdministration\HealthPunchStu\HealthPunchStuBLL.cs" /> | |||
<Compile Include="EducationalAdministration\HealthPunchStu\HealthPunchStuIBLL.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | |||