@@ -79,3 +79,5 @@ Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js | |||
/Learun.Framework.Ultimate V7/Learun.Application.Mobile/platforms/android/assets/www | |||
/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www.7z | |||
/Learun.Framework.Ultimate V7/Learun.Application.WebApi/bin.7z | |||
/Learun.Framework.Ultimate V7/Learun.Application.Web/Properties/PublishProfiles | |||
/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Properties/PublishProfiles |
@@ -6,16 +6,16 @@ | |||
// webapi: 'http://112.230.201.53:31173/', | |||
// web:"http://112.230.201.53/:8081/"//web地址,用于配置logo | |||
// }; | |||
var config = { | |||
webapi: 'http://10.30.0.10:9002/', | |||
web: "http://10.30.0.10:8000/"//web地址,用于配置logo | |||
}; | |||
// var config = { | |||
// webapi: 'http://10.30.0.10:9002/', | |||
// web: "http://10.30.0.10:8000/"//web地址,用于配置logo | |||
// }; | |||
//var config = { | |||
// webapi: 'http://localhost:8081/', | |||
// web: "http://localhost:8080/"//web地址,用于配置logo | |||
//}; | |||
var config = { | |||
webapi: 'http://localhost:31173/', | |||
web: "http://localhost:20472/"//web地址,用于配置logo | |||
}; | |||
//var config = { | |||
// webapi: 'http://123.57.209.16:31174/', | |||
// web: "http://123.57.209.16:31175/"//web地址,用于配置logo | |||
@@ -0,0 +1,11 @@ | |||
<div class="lr-page lr-ADRRecord-page"> | |||
<div class="lr-page-tool"> | |||
<div class="lr-tool-left"> | |||
总共<span class="lr-badge lr-badge-primary">0</span>条 | |||
</div> | |||
<div class="lr-tool-right"> | |||
</div> | |||
</div> | |||
<div class="lr-page-content" id="lr_ADRRecord_list"></div> | |||
</div> |
@@ -0,0 +1,126 @@ | |||
(function () { | |||
var begin = ''; | |||
var end = ''; | |||
var multipleData = null; | |||
var page = { | |||
grid: null, | |||
init: function ($page) { | |||
begin = ''; | |||
end = ''; | |||
multipleData = null; | |||
page.grid = $page.find('#lr_ADRRecord_list').lrpagination({ | |||
lclass: page.lclass, | |||
rows: 10, // 每页行数 | |||
getData: function (param, callback) {// 获取数据 param 分页参数,callback 异步回调 | |||
param.multipleData = multipleData; | |||
page.loadData(param, callback, $page); | |||
}, | |||
renderData: function (_index, _item, _$item) {// 渲染数据模板 | |||
return page.rowRender(_index, _item, _$item, $page); | |||
}, | |||
click: function (item, $item, $et) {// 列表行点击事件 | |||
// if ($et.hasClass('lr-btn-danger')) { | |||
// page.btnClick(item, $item, $page); | |||
// } | |||
// else { | |||
// page.rowClick(item, $item, $page); | |||
// } | |||
} | |||
}); | |||
}, | |||
lclass: 'lr-list', | |||
loadData: function (param, callback, $page) {// 列表加载后台数据 | |||
var _postParam = { | |||
pagination: { | |||
rows: param.rows, | |||
page: param.page, | |||
sidx: 'ClockTime', | |||
sord: 'DESC' | |||
}, | |||
queryJson: '{}' | |||
}; | |||
if (param.multipleData) { | |||
_postParam.queryJson = JSON.stringify(multipleData); | |||
} | |||
if (param.begin && param.end) { | |||
_postParam.queryJson = JSON.stringify({ StartTime: param.begin, EndTime: param.end }); | |||
} | |||
var baseUser = JSON.parse(localStorage.userinfo); | |||
_postParam.queryJson = JSON.stringify({ UserNo: baseUser.baseinfo.account }); | |||
learun.httpget(config.webapi + 'learun/adms/attendance/getrecordpagelist', _postParam, (data) => { | |||
$page.find('.lr-badge').text('0'); | |||
if (data) { | |||
$page.find('.lr-badge').text(data.records); | |||
callback(data.rows, parseInt(data.records)); | |||
} | |||
else { | |||
callback([], 0); | |||
} | |||
}); | |||
}, | |||
rowRender: function (_index, _item, _$item, $page) {// 渲染列表行数据 | |||
_$item.addClass('lr-list-item lr-list-item-multi'); | |||
var ADType=_item.ADType; | |||
var type=''; | |||
if(ADType=='0') | |||
{ | |||
type='未定义'; | |||
}else if(ADType=='1') | |||
{ | |||
type='上班'; | |||
}else if(ADType=='2') | |||
{ | |||
type='下班'; | |||
}else if(ADType=='3') | |||
{ | |||
type='开始休息'; | |||
}else if(ADType=='4') | |||
{ | |||
type='结束休息'; | |||
}else if(ADType=='5') | |||
{ | |||
type='开始加班'; | |||
}else if(ADType=='6') | |||
{ | |||
type='结束加班'; | |||
}else if(ADType=='7') | |||
{ | |||
type='中午上班'; | |||
}else if(ADType=='8') | |||
{ | |||
type='中午下班'; | |||
} | |||
var ClockStatus=_item.ClockStatus; | |||
var status=''; | |||
if(ClockStatus=='1') | |||
{ | |||
status='正常'; | |||
}else if(ClockStatus=='2') | |||
{ | |||
status='迟到'; | |||
}else if(ClockStatus=='3') | |||
{ | |||
status='早退'; | |||
}else if(ClockStatus=='4') | |||
{ | |||
status='上班补签'; | |||
}else if(ClockStatus=='5') | |||
{ | |||
status='下班补签'; | |||
}else if(ClockStatus=='6') | |||
{ | |||
status='缺勤'; | |||
} | |||
//var name=_item.UserName+'('+_item.UserNo+')' | |||
_$item.append($('<p class="lr-ellipsis"><span>打卡时间:</span></p>').dataFormatter({ value: _item.ClockTime })); | |||
_$item.append($('<p class="lr-ellipsis"><span>考勤类型:</span></p>').dataFormatter({ value: type })); | |||
_$item.append($('<p class="lr-ellipsis"><span>打卡结果:</span></p>').dataFormatter({ value: status })); | |||
//_$item.append($('<p class="lr-ellipsis"><span>用户:</span></p>').dataFormatter({ value: name })); | |||
return ''; | |||
} | |||
}; | |||
return page; | |||
})(); | |||
@@ -0,0 +1,85 @@ | |||
@charset "utf-8"; | |||
/* CSS Document */ | |||
body { | |||
font-family: "Microsoft YaHei", "微软雅黑" !important; | |||
width: 100%; | |||
height: 100%; | |||
} | |||
* { | |||
margin: 0; | |||
padding: 0; | |||
} | |||
html, | |||
body { | |||
width: 100%; | |||
height: 100%; | |||
} | |||
.f-page-body { | |||
background-color: #FFFFFF; | |||
} | |||
.contentBox { | |||
/* height: 500px; */ | |||
} | |||
.content { | |||
width: 48%; | |||
height: 50%; | |||
position: absolute; | |||
top: 15%; | |||
left: 50%; | |||
transform: translate(-50%, 10%); | |||
} | |||
.content p { | |||
text-align: center; | |||
height: 100px; | |||
font-size: 28px; | |||
} | |||
.pen { | |||
/* width: 48%; */ | |||
height: 48%; | |||
border-radius: 50%; | |||
background-color: #e7f5ff; | |||
display: flex; | |||
align-items: center; | |||
justify-content: center; | |||
} | |||
.pen2 { | |||
width: 91%; | |||
height: 91%; | |||
border-radius: 50%; | |||
background-color: #bde4ff; | |||
display: flex; | |||
align-items: center; | |||
justify-content: center; | |||
} | |||
.pen3 { | |||
width: 84%; | |||
height: 84%; | |||
border-radius: 50%; | |||
background-color: #0c86d8; | |||
text-align: center; | |||
font-size: 34px; | |||
display: flex; | |||
align-items: center; | |||
justify-content: center; | |||
color: #ffff; | |||
} | |||
.footer { | |||
width: 100%; | |||
/* height: 130px; */ | |||
/* background-image: url(./2.png); */ | |||
/* background-repeat: no-repeat; */ | |||
/* background-size: contain; */ | |||
position: fixed; | |||
left: 0; | |||
bottom: 0; | |||
overflow: hidden; | |||
} |
@@ -0,0 +1,17 @@ | |||
<div class="contentBox"> | |||
<div class="content" id="attendContent"> | |||
<p id="show"></p> | |||
<div class="pen"> | |||
<!-- <div class="pen2"> | |||
<div class="pen3"> | |||
打卡 | |||
</div> | |||
</div> --> | |||
<img id="attimg" src="" alt="" width="100%"> | |||
</div> | |||
</div> | |||
<div class="footer"> | |||
<img src="images/2.png" alt="" width="100%"> | |||
</div> | |||
</div> |
@@ -0,0 +1,59 @@ | |||
(function() { | |||
var page = { | |||
isScroll: false, | |||
init: function($page) { | |||
$(document).ready(function() { | |||
learun.layer.loading(true); | |||
//判断当前时间是否可以打卡 | |||
learun.httpget(config.webapi + 'learun/adms/attendance/IsAttendance', {}, ( | |||
data) => { | |||
learun.layer.loading(false); | |||
//console.log(data.data); | |||
if (data.data == "red") { | |||
$('#attimg').attr('src', 'images/dkred.png'); | |||
} else if (data.data == "yellow") { | |||
$('#attimg').attr('src', 'images/dkyellow.png'); | |||
}else { | |||
$('#attimg').attr('src', 'images/dk.png'); | |||
} | |||
}); | |||
$('#attendContent').on('tap', function(ev) { | |||
if((($('#attimg')[0].src).indexOf('dk.png')>0)||(($('#attimg')[0].src).indexOf('dkyellow.png')>0)){ | |||
var account = learun.storage.get('logininfo').account; | |||
learun.layer.loading(true); | |||
learun.httppost(config.webapi + 'learun/adms/attendance/clockin', {}, ( | |||
data) => { | |||
learun.layer.loading(false); | |||
if (data) { | |||
learun.layer.toast("打卡成功"); | |||
learun.nav.closeCurrent(); | |||
} else { | |||
learun.layer.toast("打卡失败!"); | |||
} | |||
}); | |||
} | |||
}); | |||
function setTime() { | |||
var date = new Date(); | |||
var HH = date.getHours(), | |||
MM = date.getMinutes(), | |||
SS = date.getSeconds(), | |||
date = date.getDate(); | |||
if (SS < 10) { | |||
SS = "0" + SS | |||
} | |||
$("#show").text(HH + ":" + MM + ":" + SS); | |||
} | |||
setInterval(setTime, 1000); | |||
}) | |||
}, | |||
}; | |||
return page; | |||
})(); |
@@ -681,44 +681,39 @@ namespace Learun.Application.Organization | |||
{ | |||
try | |||
{ | |||
Dictionary<string, UserModel> dic = cache.Read<Dictionary<string, UserModel>>(cacheKey + "dic", CacheId.user); | |||
if (dic == null) | |||
Dictionary<string, UserModel> dic = new Dictionary<string, UserModel>(); | |||
var list = userService.GetAllList(); | |||
foreach (var item in list) | |||
{ | |||
dic = new Dictionary<string, UserModel>(); | |||
var list = userService.GetAllList(); | |||
foreach (var item in list) | |||
UserModel model = new UserModel() | |||
{ | |||
companyId = item.F_CompanyId, | |||
departmentId = item.F_DepartmentId, | |||
name = item.F_RealName, | |||
}; | |||
string img = ""; | |||
if (!string.IsNullOrEmpty(item.F_HeadIcon)) | |||
{ | |||
UserModel model = new UserModel() | |||
string fileHeadImg = Config.GetValue("fileHeadImg"); | |||
string fileImg = string.Format("{0}/{1}{2}", fileHeadImg, item.F_UserId, item.F_HeadIcon); | |||
if (DirFileHelper.IsExistFile(fileImg)) | |||
{ | |||
companyId = item.F_CompanyId, | |||
departmentId = item.F_DepartmentId, | |||
name = item.F_RealName, | |||
}; | |||
string img = ""; | |||
if (!string.IsNullOrEmpty(item.F_HeadIcon)) | |||
img = item.F_HeadIcon; | |||
} | |||
} | |||
if (string.IsNullOrEmpty(img)) | |||
{ | |||
if (item.F_Gender == 0) | |||
{ | |||
string fileHeadImg = Config.GetValue("fileHeadImg"); | |||
string fileImg = string.Format("{0}/{1}{2}", fileHeadImg, item.F_UserId, item.F_HeadIcon); | |||
if (DirFileHelper.IsExistFile(fileImg)) | |||
{ | |||
img = item.F_HeadIcon; | |||
} | |||
img = "0"; | |||
} | |||
if (string.IsNullOrEmpty(img)) | |||
else | |||
{ | |||
if (item.F_Gender == 0) | |||
{ | |||
img = "0"; | |||
} | |||
else | |||
{ | |||
img = "1"; | |||
} | |||
img = "1"; | |||
} | |||
model.img = img; | |||
dic.Add(item.F_UserId, model); | |||
cache.Write(cacheKey + "dic", dic, CacheId.user); | |||
} | |||
model.img = img; | |||
dic.Add(item.F_UserId, model); | |||
} | |||
return dic; | |||
} | |||
@@ -1189,7 +1184,8 @@ namespace Learun.Application.Organization | |||
LoginOk = false | |||
}; | |||
return userEntity; | |||
}else if (userEntity.F_Description != "学生") | |||
} | |||
else if (userEntity.F_Description != "学生") | |||
{ | |||
userEntity = new UserEntity() | |||
{ | |||
@@ -1198,9 +1194,9 @@ namespace Learun.Application.Organization | |||
}; | |||
return userEntity; | |||
} | |||
else | |||
else | |||
{ | |||
} | |||
userEntity.LoginOk = false; | |||
@@ -1237,7 +1233,7 @@ namespace Learun.Application.Organization | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取用户头像 | |||
/// </summary> | |||
@@ -185,7 +185,7 @@ namespace Learun.Application.Organization | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(fieldSql.Replace("t.F_Password,", "").Replace("t.F_Secretkey,", "")); | |||
strSql.Append(",F_UserId as F_UserId_Log FROM LR_Base_User t WHERE t.F_DeleteMark = 0 AND t.F_CompanyId = @companyId "); | |||
strSql.Append(",F_UserId as F_UserId_Log,b.F_Order as DeptOrder FROM LR_Base_User t left join LR_Base_Department b on t.F_DepartmentId=b.F_DepartmentId WHERE t.F_DeleteMark = 0 AND t.F_CompanyId = @companyId "); | |||
if (!string.IsNullOrEmpty(departmentId)) | |||
{ | |||
@@ -208,7 +208,7 @@ namespace Learun.Application.Organization | |||
keyword = "%" + keyword + "%"; | |||
strSql.Append(" AND( t.F_Account like @keyword or t.F_RealName like @keyword or t.F_Mobile like @keyword ) "); | |||
} | |||
return this.BaseRepository().FindList<UserEntity>(strSql.ToString(), new { companyId, departmentId, keyword }, pagination); | |||
} | |||
catch (Exception ex) | |||
@@ -236,7 +236,7 @@ namespace Learun.Application.Organization | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(fieldSql.Replace("t.F_Password,", "").Replace("t.F_Secretkey,", "")); | |||
strSql.Append(" FROM LR_Base_User t WHERE t.F_DeleteMark = 0 ORDER BY t.F_CompanyId,t.F_DepartmentId,t.F_RealName "); | |||
strSql.Append(" FROM LR_Base_User t WHERE t.F_DeleteMark = 0 ORDER BY t.F_Order "); | |||
return this.BaseRepository().FindList<UserEntity>(strSql.ToString()); | |||
} | |||
catch (Exception ex) | |||
@@ -96,7 +96,11 @@ var bootstrap = function ($, learun) { | |||
headData: [ | |||
{ label: '学年', name: 'AcademicYearNo', width: 70, align: "left" }, | |||
{ label: '学期', name: 'Semester', width: 60, align: "left" }, | |||
{ label: '考试日期', name: 'ExamDate', width: 120, align: "left" }, | |||
{ | |||
label: '考试日期', name: 'ExamDate', width: 100, align: "left", formatter: function (v) { | |||
return learun.formatDate(v, "yyyy-MM-dd"); | |||
} | |||
}, | |||
{ label: '考试时间', name: 'ExamTime', width: 120, align: "left" }, | |||
{ label: '课程编号', name: 'LessonNo', width: 100, align: "left" }, | |||
{ label: '课程名称', name: 'LessonName', width: 200, align: "left" }, | |||
@@ -15,5 +15,9 @@ | |||
<div class="lr-form-item-title">学期<font face="宋体">*</font></div> | |||
<div id="Semester" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">同步内容<font face="宋体">*</font></div> | |||
<div id="SyncType" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/ArrangeLessonTerm/EmptyByConditionForm.js") |
@@ -30,6 +30,12 @@ var bootstrap = function ($, learun) { | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
$('#SyncType').lrselect({ | |||
placeholder: "请选择同步内容", | |||
data: [{ text: "课表", value: "1" }, { text: "开课计划", value: "2" }], | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
}, | |||
initData: function () { | |||
//if (!!selectedRow) { | |||
@@ -157,7 +157,7 @@ | |||
<div class="lr-form-item-title">系部</div> | |||
<div id="DeptNo"></div> | |||
</div>*@ | |||
<div class="col-xs-4 lr-form-item" data-table="EmpInfo"> | |||
@*<div class="col-xs-4 lr-form-item" data-table="EmpInfo"> | |||
<div class="lr-form-item-title">岗位类别</div> | |||
<div id="EmpSortNo"></div> | |||
</div> | |||
@@ -176,16 +176,16 @@ | |||
<div class="col-xs-4 lr-form-item" data-table="EmpInfo"> | |||
<div class="lr-form-item-title">聘任时间</div> | |||
<input id="InSchoolDate" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd',onpicked: function () { $('#InSchoolDate').trigger('change'); } })" /> | |||
</div> | |||
</div>*@ | |||
<div class="col-xs-4 lr-form-item" data-table="EmpInfo"> | |||
<div class="lr-form-item-title">人员身份</div> | |||
<div class="lr-form-item-title">编制类别</div> | |||
<div id="CompilationCategory"></div> | |||
</div> | |||
<div class="col-xs-4 lr-form-item" data-table="EmpInfo"> | |||
<div class="lr-form-item-title">参加工作时间</div> | |||
<input id="AddWorkDate" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd',onpicked: function () { $('#AddWorkDate').trigger('change'); } })" /> | |||
</div> | |||
<div class="col-xs-4 lr-form-item" data-table="EmpInfo"> | |||
@*<div class="col-xs-4 lr-form-item" data-table="EmpInfo"> | |||
<div class="lr-form-item-title">工龄偏移量(月)</div> | |||
<input id="AddWorkOffset" type="text" class="form-control" /> | |||
</div> | |||
@@ -204,24 +204,24 @@ | |||
<div class="col-xs-4 lr-form-item" data-table="EmpInfo"> | |||
<div class="lr-form-item-title">集团龄(减去偏移量)</div> | |||
<input id="GroupHours" type="text" class="form-control" /> | |||
</div> | |||
</div>*@ | |||
<div class="col-xs-4 lr-form-item" data-table="EmpInfo"> | |||
<div class="lr-form-item-title">进入教育系统时间</div> | |||
<input id="EducationalDate" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd',onpicked: function () { $('#EducationalDate').trigger('change'); } })" /> | |||
</div> | |||
<div class="col-xs-4 lr-form-item" data-table="EmpInfo"> | |||
@*<div class="col-xs-4 lr-form-item" data-table="EmpInfo"> | |||
<div class="lr-form-item-title">教龄偏移量(月)</div> | |||
<input id="EducationalOffset" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-4 lr-form-item" data-table="EmpInfo"> | |||
<div class="lr-form-item-title">教龄(减去偏移量)</div> | |||
<input id="EducationalHours" type="text" class="form-control" /> | |||
</div> | |||
</div>*@ | |||
<div class="col-xs-4 lr-form-item" data-table="EmpInfo"> | |||
<div class="lr-form-item-title">来校时间</div> | |||
<input id="SchoolDate" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd',onpicked: function () { $('#SchoolDate').trigger('change'); } })" /> | |||
</div> | |||
<div class="col-xs-4 lr-form-item" data-table="EmpInfo"> | |||
@*<div class="col-xs-4 lr-form-item" data-table="EmpInfo"> | |||
<div class="lr-form-item-title">校龄偏移量(月)</div> | |||
<input id="SchoolOffset" type="text" class="form-control" /> | |||
</div> | |||
@@ -240,15 +240,15 @@ | |||
<div class="col-xs-4 lr-form-item" data-table="EmpInfo"> | |||
<div class="lr-form-item-title">从教三十年表彰年度</div> | |||
<input id="CommendationYear" type="text" class="form-control" /> | |||
</div> | |||
</div>*@ | |||
<div class="col-xs-4 lr-form-item" data-table="EmpInfo"> | |||
<div class="lr-form-item-title">职称</div> | |||
<div id="ProfessionalTitle"></div> | |||
</div> | |||
<div class="col-xs-4 lr-form-item" data-table="EmpInfo"> | |||
@*<div class="col-xs-4 lr-form-item" data-table="EmpInfo"> | |||
<div class="lr-form-item-title">职称岗位等级</div> | |||
<div id="ProfessionalTitleLevel"></div> | |||
</div> | |||
</div>*@ | |||
<div class="col-xs-4 lr-form-item" data-table="EmpInfo"> | |||
<div class="lr-form-item-title">职称获得时间</div> | |||
<input id="ProfessionalTitleGetTime" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd',onpicked: function () { $('#ProfessionalTitleGetTime').trigger('change'); } })" /> | |||
@@ -276,10 +276,10 @@ | |||
<div class="lr-form-item-title">初始学历</div> | |||
<div id="CultureDegreeNo"></div> | |||
</div> | |||
<div class="col-xs-4 lr-form-item" data-table="EmpInfo"> | |||
@*<div class="col-xs-4 lr-form-item" data-table="EmpInfo"> | |||
<div class="lr-form-item-title">初始学历获取方式</div> | |||
<div id="ObtainWay"></div> | |||
</div> | |||
</div>*@ | |||
<div class="col-xs-4 lr-form-item" data-table="EmpInfo"> | |||
<div class="lr-form-item-title">最高学位</div> | |||
<div id="DegreeNo"></div> | |||
@@ -49,11 +49,11 @@ var bootstrap = function ($, learun) { | |||
$("#GraduateSchoolName").parent().hide(); | |||
$("#SubjectSpeciesNo").parent().hide(); | |||
$("#ForeignLanguageNo").parent().hide(); | |||
$("#EmpSortNo").parent().hide(); | |||
//$("#EmpSortNo").parent().hide(); | |||
$("#EmpFullTimeNo").parent().hide(); | |||
//$("#DeptNo").parent().hide(); | |||
$("#TitleOfTechPostNo").parent().hide(); | |||
$("#InSchoolDate").parent().hide(); | |||
//$("#TitleOfTechPostNo").parent().hide(); | |||
//$("#InSchoolDate").parent().hide(); | |||
$("#resume").parent().hide(); | |||
//$("#Photo").parent().hide(); | |||
} | |||
@@ -129,24 +129,27 @@ var bootstrap = function ($, learun) { | |||
$('#FamilyOriginNo').lrDataSourceSelect({ code: 'BCdFamilyOrigin', value: 'familyoriginno', text: 'familyorigin' }); | |||
$('#SubjectSpeciesNo').lrDataSourceSelect({ code: 'BCdSubjectSpecies', value: 'subjectspeciesno', text: 'subjectspecies' }); | |||
$('#ForeignLanguageNo').lrDataSourceSelect({ code: 'BCdForeignLanguage', value: 'foreignlanguageno', text: 'foreignlanguagename' }); | |||
$('#EmpSortNo').lrDataItemSelect({ code: 'jsgw' }); | |||
//$('#EmpSortNo').lrDataItemSelect({ code: 'jsgw' }); | |||
$('#EmpFullTimeNo').lrDataItemSelect({ code: 'EmpFullTime' }); | |||
$('#ObtainWay').lrDataItemSelect({ code: 'ObtainWay' }); | |||
//$('#ObtainWay').lrDataItemSelect({ code: 'ObtainWay' }); | |||
//$('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); | |||
$('#PostRank').lrDataSourceSelect({ code: 'BCdTitleOfTechPost', value: 'titleoftechpostno', text: 'titleoftechpost' }); | |||
//$('#PostRank').lrDataSourceSelect({ code: 'BCdTitleOfTechPost', value: 'titleoftechpostno', text: 'titleoftechpost' }); | |||
$('#Photo').lrUploader(); | |||
$('#HighestRecord').lrDataSourceSelect({ code: 'BCdCultureDegree', value: 'culturedegreeno', text: 'culturedegree' }); | |||
$('#ObtainWayOfHighestRecord').lrDataItemSelect({ code: 'ObtainWay' }); | |||
//$('#HighestRecord').lrDataSourceSelect({ code: 'BCdCultureDegree', value: 'culturedegreeno', text: 'culturedegree' }); | |||
$('#HighestRecord').lrDataItemSelect({ code: 'HighestEducation'}); | |||
//$('#ObtainWayOfHighestRecord').lrDataItemSelect({ code: 'ObtainWay' }); | |||
$('#ObtainWayOfHighestRecord').lrDataItemSelect({ code: 'HighestEducationAcquisitionMode' }); | |||
$('#InitialDegree').lrDataSourceSelect({ code: 'BCdDegree', value: 'degreeno', text: 'degreename' }); | |||
$('#ObtainWayOfInitialDegree').lrDataItemSelect({ code: 'ObtainWayOfDegree' }); | |||
$('#ObtainWayOfHighestDegree').lrDataItemSelect({ code: 'ObtainWayOfDegree' }); | |||
$('#PositionLevel').lrDataItemSelect({ code: 'PositionLevel' }); | |||
//$('#PositionLevel').lrDataItemSelect({ code: 'PositionLevel' }); | |||
$('#JobRank').lrDataItemSelect({ code: 'TechnicalPost' }); | |||
$('#WorkLevel').lrDataItemSelect({ code: 'TechnicalLevelOfWorker' }); | |||
$('#CompilationCategory').lrDataItemSelect({ code: 'CompilationCategory' }); | |||
$('#IsInActiveStatus').lrDataItemSelect({ code: 'JobStatus' }); | |||
$('#ProfessionalTitle').lrDataItemSelect({ code: 'jszc' }); | |||
$('#ProfessionalTitleLevel').lrDataItemSelect({ code: 'TeacherTitlePostLevel' }); | |||
//$('#ProfessionalTitleLevel').lrDataItemSelect({ code: 'TeacherTitlePostLevel' }); | |||
//内容编辑器 | |||
ue = UE.getEditor('editor'); | |||
@@ -50,7 +50,7 @@ var bootstrap = function ($, learun) { | |||
//政治面貌 | |||
$('#PartyFaceNo').lrDataSourceSelect({ code: 'BCdPartyFace', value: 'partyfaceno', text: 'partyface' }); | |||
//最高学历 | |||
$('#HighestRecord').lrDataSourceSelect({ code: 'BCdCultureDegree', value: 'culturedegreeno', text: 'culturedegree' }); | |||
$('#HighestRecord').lrDataItemSelect({ code: 'HighestEducation'}); | |||
//民族 | |||
@@ -464,12 +464,11 @@ var bootstrap = function ($, learun) { | |||
{ | |||
label: "最高学历", name: "HighestRecord", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdCultureDegree', | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
keyId: 'culturedegreeno', | |||
code: 'HighestEducation', | |||
callback: function (_data) { | |||
callback(_data['culturedegree']); | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
@@ -615,7 +614,7 @@ var bootstrap = function ($, learun) { | |||
], | |||
mainId: 'EmpId', | |||
sidx: 'F_Order asc', | |||
sidx: 'DeptOrder,F_Order', | |||
isPage: true, | |||
isMultiselect: true | |||
}); | |||
@@ -30,13 +30,13 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers | |||
public class NoticeController : MvcControllerBase | |||
{ | |||
private NoticeIBLL noticeIBLL = new NoticeBLL(); | |||
private DataItemIBLL dataItemIbll = new DataItemBLL(); | |||
private Sys_InformationPushIBLL sys_InformationPushIBLL = new Sys_InformationPushBLL(); | |||
private MessageRindIBLL messageRindIBLL = new MessageRindBLL(); | |||
private WeChatConfigIBLL weChatConfigIbll = new WeChatConfigBLL(); | |||
private WeChatTempletIBLL weChatTempletIbll = new WeChatTempletBLL(); | |||
private UserIBLL userIbll = new UserBLL(); | |||
private UserRelationIBLL userRelationIBLL = new UserRelationBLL(); | |||
private DataItemIBLL dataItemIbll = new DataItemBLL(); | |||
private DepartmentIBLL departmentIbll = new DepartmentBLL(); | |||
private Sys_InformationPushIBLL sys_InformationPushIBLL = new Sys_InformationPushBLL(); | |||
private DepartmentReleasePermissionsIBLL departmentReleasePermissionsIbll = | |||
new DepartmentReleasePermissionsBLL(); | |||
@@ -317,6 +317,17 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers | |||
{ | |||
entity.F_NewsContent = WebHelper.HtmlEncode(entity.F_NewsContent); | |||
noticeIBLL.SaveEntity(keyValue, entity); | |||
return Success("保存成功!"); | |||
} | |||
[HttpPost, ValidateAntiForgeryToken, AjaxOnly, ValidateInput(false)] | |||
public ActionResult SaveFormAndSubmit(string keyValue, NewsEntity entity) | |||
{ | |||
entity.F_NewsContent = WebHelper.HtmlEncode(entity.F_NewsContent); | |||
noticeIBLL.SaveFormAndSubmit(keyValue, entity); | |||
//推送通知 | |||
//读取信息推送管理-通知公告推送(01)的配置 | |||
var informationPushEntity = sys_InformationPushIBLL.GetEntityByPushItem("01"); | |||
if (informationPushEntity != null && informationPushEntity.Status == true) | |||
@@ -327,19 +338,17 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers | |||
if (entity.F_IsSendFX.HasValue && entity.F_IsSendFX == true) | |||
{ | |||
Task.Run(async () => | |||
{ | |||
using (var hubConnection = new HubConnection(ConfigurationManager.AppSettings["CommunicationServeraddress"])) | |||
{ | |||
var hubProxy = hubConnection.CreateHubProxy("SignalRHub"); | |||
await hubConnection.Start(); | |||
await hubProxy.Invoke("PushAnnouncement", entity.F_NewsId, entity.F_FullHead, Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(entity.F_NewsContent)).Length < 20 ? Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(entity.F_NewsContent)) : Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(entity.F_NewsContent)).Substring(0, 20), "news", entity.F_SendPostId, entity.F_SendDeptId); | |||
} | |||
}); | |||
{ | |||
using (var hubConnection = new HubConnection(ConfigurationManager.AppSettings["CommunicationServeraddress"])) | |||
{ | |||
var hubProxy = hubConnection.CreateHubProxy("SignalRHub"); | |||
await hubConnection.Start(); | |||
await hubProxy.Invoke("PushAnnouncement", entity.F_NewsId, entity.F_FullHead, Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(entity.F_NewsContent)).Length < 20 ? Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(entity.F_NewsContent)) : Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(entity.F_NewsContent)).Substring(0, 20), "news", entity.F_SendPostId, entity.F_SendDeptId); | |||
} | |||
}); | |||
} | |||
return Success("保存成功!"); | |||
} | |||
Task DoWeixinPush(NewsEntity entity) | |||
{ | |||
//微信推送 | |||
@@ -414,6 +423,9 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers | |||
} | |||
} | |||
PushWeixin(needpostuserlist, entity.F_FullHead); | |||
//消息提醒表 | |||
PushMessageRemind(needpostuserlist, entity); | |||
return Task.CompletedTask; | |||
} | |||
catch (Exception e) | |||
@@ -422,18 +434,6 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers | |||
} | |||
} | |||
/// <summary> | |||
/// 删除表单数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DeleteForm(string keyValue) | |||
{ | |||
noticeIBLL.DeleteEntity(keyValue); | |||
return Success("删除成功!"); | |||
} | |||
public void PushWeixin(List<UserEntity> needpostuserlist, string title) | |||
{ | |||
var WeChatConfigentity = weChatConfigIbll.GetEnableEntity(); | |||
@@ -490,6 +490,47 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 消息提醒 | |||
/// </summary> | |||
/// <param name="needpostuserlist"></param> | |||
/// <param name="title"></param> | |||
public void PushMessageRemind(List<UserEntity> needpostuserlist, NewsEntity model) | |||
{ | |||
foreach (UserEntity userinfo in needpostuserlist) | |||
{ | |||
MessageRemindEntity entity = new MessageRemindEntity(); | |||
entity.ReceiptId = userinfo.F_UserId; | |||
entity.ReceiptName = userinfo.F_RealName; | |||
entity.SenderId = model.F_CreateUserId; | |||
entity.SenderName = model.F_CreateUserName; | |||
entity.TheTitle = "通知公告"; | |||
entity.TheContent = model.F_FullHead; | |||
entity.InstanceId = model.F_NewsId; | |||
entity.ConnectionUrl = "/Utility/ListContentIndex?id="; | |||
entity.SendTime = DateTime.Now; | |||
entity.ReadSigns = false; | |||
messageRindIBLL.SaveEntity("", entity); | |||
} | |||
} | |||
/// <summary> | |||
/// 删除表单数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DeleteForm(string keyValue) | |||
{ | |||
noticeIBLL.DeleteEntity(keyValue); | |||
return Success("删除成功!"); | |||
} | |||
#endregion | |||
#region 流程 | |||
@@ -517,11 +558,8 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers | |||
public ActionResult GetFormDataByProcessId(string processId) | |||
{ | |||
NewsEntity OANewsData = noticeIBLL.GetEntityByProcessId(processId); | |||
var jsonData = new | |||
{ | |||
OANews = OANewsData, | |||
}; | |||
return Success(jsonData); | |||
OANewsData.F_NewsContent = WebHelper.HtmlDecode(OANewsData.F_NewsContent); | |||
return Success(OANewsData); | |||
} | |||
#endregion | |||
@@ -56,7 +56,7 @@ var bootstrap = function ($, learun) { | |||
var postData = $('#form').lrGetFormData(keyValue); | |||
postData["F_NewsContent"] = ue.getContent(null, null, true); | |||
$.lrSaveForm(top.$.rootUrl + '/LR_OAModule/Notice/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
$.lrSaveForm(top.$.rootUrl + '/LR_OAModule/Notice/SaveFormAndSubmit?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
@@ -61,17 +61,21 @@ var bootstrap = function ($, learun) { | |||
setFormData = function (processId) { | |||
if (!!processId) { | |||
$.lrSetForm(top.$.rootUrl + '/LR_OAModule/Notice/GetFormDataByProcessId?processId=' + processId, function (data) { | |||
for (var id in data) { | |||
if (!!data[id] && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
if (id == 'Sys_ReceiveFile') { | |||
keyValue = data[id].F_DeptRelationId; | |||
} | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
$('#form').lrSetFormData(data); | |||
setTimeout(function () { | |||
ue.setContent(data.F_NewsContent); | |||
}, 100); | |||
//for (var id in data) { | |||
// if (!!data[id] && data[id].length > 0) { | |||
// $('#' + id).jfGridSet('refreshdata', data[id]); | |||
// } | |||
// else { | |||
// if (id == 'Sys_ReceiveFile') { | |||
// keyValue = data[id].F_DeptRelationId; | |||
// } | |||
// $('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
// } | |||
//} | |||
}); | |||
} | |||
} | |||
@@ -84,17 +88,62 @@ var bootstrap = function ($, learun) { | |||
}; | |||
// 保存数据 | |||
save = function (processId, callBack, i) { | |||
if (!$('#form').lrValidform()) { | |||
return false; | |||
} | |||
var formData = $('body').lrGetFormData(); | |||
if (!!processId) { | |||
formData.RProcessId = processId; | |||
} | |||
$.lrSaveForm(top.$.rootUrl + '/LR_OAModule/Notice/SaveForm?keyValue=' + keyValue, formData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(res, formData, i); | |||
learun.clientdata.getAsync('dataItem', | |||
{ | |||
key: $("#F_CategoryId").lrselectGet(), | |||
code: 'NoticeCategory', | |||
callback: function (_data) { | |||
$("#F_Category").val(_data.text); | |||
var postData = $('#form').lrGetFormData(keyValue); | |||
postData["F_NewsContent"] = ue.getContent(null, null, true); | |||
$.lrSaveForm(top.$.rootUrl + '/LR_OAModule/Notice/SaveForm?keyValue=' + keyValue, | |||
postData, | |||
function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(res, formData, i); | |||
} | |||
}); | |||
} | |||
}); | |||
//$.lrSaveForm(top.$.rootUrl + '/LR_OAModule/Notice/SaveForm?keyValue=' + keyValue, formData, function (res) { | |||
// // 保存成功后才回调 | |||
// if (!!callBack) { | |||
// callBack(res, formData, i); | |||
// } | |||
//}); | |||
}; | |||
acceptClick = function (callBack) { | |||
if (!$('#form').lrValidform()) { | |||
return false; | |||
} | |||
learun.clientdata.getAsync('dataItem', { | |||
key: $("#F_CategoryId").lrselectGet(), | |||
code: 'NoticeCategory', | |||
callback: function (_data) { | |||
$("#F_Category").val(_data.text); | |||
var postData = $('#form').lrGetFormData(keyValue); | |||
postData["F_NewsContent"] = ue.getContent(null, null, true); | |||
$.lrSaveForm(top.$.rootUrl + '/LR_OAModule/Notice/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
} | |||
}); | |||
}; | |||
} | |||
page.init(); | |||
} | |||
@@ -60,14 +60,10 @@ var bootstrap = function ($, learun) { | |||
setFormData = function (processId, param, callback) { | |||
if (!!processId) { | |||
$.lrSetForm(top.$.rootUrl + '/LR_OAModule/Notice/GetFormDataByProcessId?processId=' + processId, function (data) { | |||
for (var id in data) { | |||
if (!!data[id] && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
$('#form').lrSetFormData(data); | |||
setTimeout(function () { | |||
ue.setContent(data.F_NewsContent); | |||
}, 100); | |||
}); | |||
} | |||
callback && callback(); | |||
@@ -68,14 +68,15 @@ var bootstrap = function ($, learun) { | |||
height: 650, | |||
maxmin: true, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
//return top[id].acceptClick(refreshGirdData); | |||
return top[id].save(refreshGirdData); | |||
} | |||
}); | |||
} | |||
}); | |||
// 查看 | |||
$('#lr_view').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('SFileId'); | |||
var keyValue = $('#gridtable').jfGridValue('F_NewsId'); | |||
if (learun.checkrow(keyValue)) { | |||
if (keyValue.indexOf(",") != -1) { | |||
learun.alert.warning("只能选择一条记录查看!"); | |||
@@ -85,8 +86,8 @@ var bootstrap = function ($, learun) { | |||
id: 'form', | |||
title: '查看', | |||
url: top.$.rootUrl + '/LR_OAModule/Notice/FormFlow?keyValue=' + keyValue, | |||
width: 800, | |||
height: 700, | |||
width: 1000, | |||
height: 650, | |||
btn: null | |||
}); | |||
} | |||
@@ -84,9 +84,7 @@ var bootstrap = function ($, learun) { | |||
url: top.$.rootUrl + '/Permission/DepartmentReleasePermissions/Index?departmentId=' + keyValue, | |||
width: 700, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
btn:null | |||
}); | |||
} | |||
}); | |||
@@ -373,7 +373,7 @@ var bootstrap = function ($, learun) { | |||
isPage: true, | |||
reloadSelected: true, | |||
mainId: 'F_UserId', | |||
sidx: 'F_Order asc', | |||
sidx: 'DeptOrder,F_Order,F_Account', | |||
isMultiselect: true | |||
}); | |||
}, | |||
@@ -17,27 +17,27 @@ | |||
<div class="lr-form-item-title">上班时间<font face="宋体">*</font></div> | |||
<input id="WorkTime" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
@*<div class="col-xs-6 lr-form-item" data-table="ADR_Restriction"> | |||
<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" /> | |||
</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" /> | |||
</div>*@ | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="ADR_Restriction"> | |||
<div class="lr-form-item-title">下班时间<font face="宋体">*</font></div> | |||
<input id="CloseTime" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
@*<div class="col-xs-6 lr-form-item" data-table="ADR_Restriction"> | |||
<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" /> | |||
</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" /> | |||
</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="ClockTime" class="form-control" isvalid="yes" checkexpession="NotNull"></div> | |||
@@ -80,11 +80,11 @@ var bootstrap = function ($, learun) { | |||
url: top.$.rootUrl + '/PersonnelManagement/ADR_Restriction/GetPageList', | |||
headData: [ | |||
{ label: "上班时间", name: "WorkTime", width: 100, align: "left" }, | |||
//{ label: "签到开始时间", name: "SignInStartTime", width: 100, align: "left" }, | |||
//{ label: "签到结束时间", name: "SignInEndTime", width: 100, align: "left" }, | |||
{ label: "签到开始时间", name: "SignInStartTime", width: 100, align: "left" }, | |||
{ label: "签到结束时间", name: "SignInEndTime", width: 100, align: "left" }, | |||
{ label: "下班时间", name: "CloseTime", width: 100, align: "left" }, | |||
//{ label: "签退开始时间", name: "SignOutStartTime", width: 100, align: "left" }, | |||
//{ label: "签退结束时间", name: "SignOutEndTime", width: 100, align: "left" }, | |||
{ label: "签退开始时间", name: "SignOutStartTime", width: 100, align: "left" }, | |||
{ label: "签退结束时间", name: "SignOutEndTime", width: 100, align: "left" }, | |||
{ label: "打卡次数", name: "ClockTime", width: 100, align: "left" }, | |||
{ label: "中午签退时间", name: "NoonCloseTime", width: 100, align: "left" }, | |||
{ label: "中午签退开始时间", name: "SignOutStartTime2", width: 150, align: "left" }, | |||
@@ -113,6 +113,7 @@ namespace Learun.Application.Web.Controllers | |||
#endregion | |||
public ActionResult Index() | |||
{ | |||
//判断登录状态码 | |||
string account = ""; | |||
if (!Request.Headers["account"].IsEmpty()) | |||
{ | |||
@@ -122,63 +123,48 @@ namespace Learun.Application.Web.Controllers | |||
var result = helper.IsOnLine(account); | |||
if (result.stateCode != 1) | |||
{ | |||
return Redirect("NoLogin"); | |||
} | |||
var userinfo = LoginUserInfo.Get(); | |||
var flowType = dataItemIBLL.GetDetailList("FlowSort", ""); | |||
var flowList = wfSchemeIBLL.GetWfSchemeStart().ToList(); | |||
var allCount = 0; | |||
foreach (var flow in flowType) | |||
{ | |||
var count = flowList.Count(a => a.F_Category == flow.F_ItemName); | |||
flow.FlowCount = count; | |||
allCount += count; | |||
} | |||
ViewBag.AllCount = allCount; | |||
ViewBag.FlowType = flowType; | |||
ViewBag.FlowList = JsonConvert.SerializeObject(flowList); | |||
List<ModuleEntity> list = new List<ModuleEntity>(); | |||
List<string> offenused = LogBLL.GetGroupLog(userinfo.userId).Select(m => m.F_Module).Take(20).ToList(); | |||
var data = moduleIBLL.GetModuleList().Where(m => m.F_EnabledMark == 1 && m.F_DeleteMark == 0 && !string.IsNullOrEmpty(m.F_UrlAddress)); | |||
foreach (var oitem in offenused) | |||
{ | |||
ModuleEntity fod = data.FirstOrDefault(m => m.F_FullName == oitem); | |||
if (fod != null) | |||
{ | |||
list.Add(fod); | |||
} | |||
} | |||
//常用服务 | |||
ViewBag.Offenused = list.Take(12); | |||
//内部邮件 | |||
//登录用户 | |||
var userInfo = LoginUserInfo.Get(); | |||
ViewBag.UserId = userInfo.userId; | |||
//桌面管理表、卡片块排序管理表增加默认数据 | |||
sSO_Drag_DesktopManageIBLL.AddDefaultData(userInfo.userId, "one"); | |||
//获取桌面、卡片块排序列表 | |||
ViewBag.DesktopList = sSO_Drag_DesktopManageIBLL.GetListByModelCode(userInfo.userId, "one").OrderByDescending(x => x.DefaultFlag).ThenBy(x => x.Sort).ThenBy(x => x.CreateDate); | |||
ViewBag.DesktopListStr = JsonConvert.SerializeObject(ViewBag.DesktopList); | |||
//分页查询条件设置 | |||
Pagination paginationobj = new Pagination() { rows = 5, page = 1, sidx = "readflag asc,SENDTIME desc ", sord = "desc" }; | |||
var maildata = sYS_ReceiveMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userinfo.userId + "\"}"); | |||
//邮件-收件箱 | |||
var maildata = sYS_ReceiveMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userInfo.userId + "\"}"); | |||
var maildataAll = sYS_ReceiveMessageIBLL.GetList("{\"userId\":\"" + userInfo.userId + "\"}"); | |||
ViewBag.LanMail = maildata; | |||
ViewBag.LanMailUnRead = maildata.Count(m => m.READFLAG == 0); | |||
//办公事项 | |||
paginationobj.sidx = "F_CreateDate"; | |||
//ViewBag.TaskList = wfTaskIBLL.GetActiveList(userinfo, paginationobj, "{}"); | |||
ViewBag.TaskList = nWFProcessIBLL.GetMyTaskPageList(userinfo, paginationobj, "{}"); | |||
ViewBag.LanMailStr = JsonConvert.SerializeObject(ViewBag.LanMail); | |||
ViewBag.LanMailUnReadCount = maildataAll.Count(m => m.READFLAG == 0); | |||
//邮件-已发送 | |||
paginationobj.sidx = "SENDTIME desc"; | |||
var mailsenddata = sYS_SendMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userInfo.userId + "\"}"); | |||
var mailsenddataAll = sYS_SendMessageIBLL.GetList2("{\"userId\":\"" + userInfo.userId + "\"}"); | |||
ViewBag.LanMailSend = mailsenddata; | |||
ViewBag.LanMailSendStr = JsonConvert.SerializeObject(ViewBag.LanMailSend); | |||
//来往邮件数量 | |||
ViewBag.LanMailTotalNum = maildataAll.Count() + mailsenddataAll.Count(); | |||
//公文 | |||
paginationobj.sidx = "SendTime"; | |||
ViewBag.ReceiveFileList = sys_ReceiveFileIBLL.GetPageList(paginationobj, "{\"ReceiverId\":\"" + userInfo.userId + "\"}"); | |||
ViewBag.ReceiveFileListStr = JsonConvert.SerializeObject(ViewBag.ReceiveFileList); | |||
//公告 | |||
List<NewsEntity> outnewslist = new List<NewsEntity>(); | |||
paginationobj.rows = 100; | |||
var newsList = newsIBLL.GetList("", userinfo.userId); | |||
var newsList = newsIBLL.GetList("", userInfo.userId); | |||
foreach (var newsitemEntity in newsList) | |||
{ | |||
if (!string.IsNullOrEmpty(newsitemEntity.F_SendPostId)) | |||
{ | |||
if (!string.IsNullOrEmpty(userinfo.postIds)) | |||
if (!string.IsNullOrEmpty(userInfo.postIds)) | |||
{ | |||
if (userinfo.postIds.Contains(",")) | |||
if (userInfo.postIds.Contains(",")) | |||
{ | |||
foreach (var postid in userinfo.postIds.Split(',')) | |||
foreach (var postid in userInfo.postIds.Split(',')) | |||
{ | |||
if (newsitemEntity.F_SendPostId.Contains(postid)) | |||
{ | |||
@@ -189,7 +175,7 @@ namespace Learun.Application.Web.Controllers | |||
} | |||
else | |||
{ | |||
if (newsitemEntity.F_SendPostId.Contains(userinfo.postIds)) | |||
if (newsitemEntity.F_SendPostId.Contains(userInfo.postIds)) | |||
{ | |||
outnewslist.Add(newsitemEntity); | |||
} | |||
@@ -200,7 +186,7 @@ namespace Learun.Application.Web.Controllers | |||
{ | |||
if (!string.IsNullOrEmpty(newsitemEntity.F_SendDeptId)) | |||
{ | |||
if (newsitemEntity.F_SendDeptId.Contains(userinfo.departmentId)) | |||
if (newsitemEntity.F_SendDeptId.Contains(userInfo.departmentId)) | |||
{ | |||
outnewslist.Add(newsitemEntity); | |||
} | |||
@@ -211,28 +197,233 @@ namespace Learun.Application.Web.Controllers | |||
} | |||
} | |||
} | |||
//公文 | |||
paginationobj.sidx = "SendTime"; | |||
paginationobj.rows = 5; | |||
ViewBag.ReceiveFileList = sys_ReceiveFileIBLL.GetPageList(paginationobj, "{\"ReceiverId\":\"" + userinfo.userId + "\"}"); | |||
ViewBag.NewsList = outnewslist; | |||
//底部办公事项 | |||
ViewBag.FunctionTypeList = perm_FunctionTypeIBLL.GetListByUserId(userinfo.userId).OrderBy(m => m.FTOrder).Take(7); | |||
var userfunctionlist = perm_FunctionIBLL.GetListByUserId(userinfo.userId); | |||
foreach (var ufitem in userfunctionlist) | |||
ViewBag.NewsList = outnewslist.Take(5); | |||
ViewBag.NewsListStr = JsonConvert.SerializeObject(ViewBag.NewsList); | |||
//宣传报道 | |||
var newsListOfxuanchuan = outnewslist.Where(x => x.F_CategoryId == "15").Take(4); | |||
foreach (var item in newsListOfxuanchuan) | |||
{ | |||
if (!string.IsNullOrEmpty(ufitem.FImage)) | |||
if (!string.IsNullOrEmpty(item.F_NewsImage)) | |||
{ | |||
var imagePath = annexesFileIBLL.GetEntityByFolderId(ufitem.FImage)?.F_FilePath; | |||
var imagePath = annexesFileIBLL.GetEntityByFolderId(item.F_NewsImage)?.F_FilePath; | |||
if (!string.IsNullOrEmpty(imagePath)) | |||
{ | |||
ufitem.FImage = imagePath.Substring(imagePath.IndexOf("Resource") - 1); | |||
item.F_NewsImage = imagePath.Substring(imagePath.IndexOf("Resource")); | |||
} | |||
else | |||
{ | |||
item.F_NewsImage = "/Content/images/DragSSO/noLogin.png"; | |||
} | |||
} | |||
} | |||
ViewBag.FunctionList = userfunctionlist; | |||
ViewBag.PublicKey = ConfigurationManager.AppSettings["SSOPublicSecret"]; | |||
return View(); | |||
ViewBag.NewsListOfxuanchuan = newsListOfxuanchuan; | |||
ViewBag.NewsListOfxuanchuanStr = JsonConvert.SerializeObject(ViewBag.NewsListOfxuanchuan); | |||
//智慧教育 | |||
ViewBag.NewsListOfzhihui = outnewslist.Where(x => x.F_CategoryId == "16").Take(6); | |||
ViewBag.NewsListOfzhihuiStr = JsonConvert.SerializeObject(ViewBag.NewsListOfzhihui); | |||
//专题推荐 | |||
var newsListOfzhuanti = outnewslist.Where(x => x.F_CategoryId == "17").Take(7); | |||
foreach (var item in newsListOfzhuanti) | |||
{ | |||
if (!string.IsNullOrEmpty(item.F_NewsImage)) | |||
{ | |||
var imagePath = annexesFileIBLL.GetEntityByFolderId(item.F_NewsImage)?.F_FilePath; | |||
if (!string.IsNullOrEmpty(imagePath)) | |||
{ | |||
item.F_NewsImage = imagePath.Substring(imagePath.IndexOf("Resource")); | |||
} | |||
else | |||
{ | |||
item.F_NewsImage = "/Content/images/DragSSO/noLogin.png"; | |||
} | |||
} | |||
} | |||
ViewBag.NewsListOfzhuanti = newsListOfzhuanti; | |||
ViewBag.NewsListOfzhuantiStr = JsonConvert.SerializeObject(ViewBag.NewsListOfzhuanti); | |||
//办公事项-待办任务 | |||
paginationobj.sidx = "F_CreateDate"; | |||
paginationobj.rows = 4; | |||
var taskListAll = nWFProcessIBLL.GetMyTaskPageList(userInfo, "{}"); | |||
ViewBag.TaskList = nWFProcessIBLL.GetMyTaskPageList(userInfo, paginationobj, "{}"); | |||
ViewBag.TaskListStr = JsonConvert.SerializeObject(ViewBag.TaskList); | |||
ViewBag.TaskTotalNum = taskListAll.Count(); | |||
//办公事项-已办任务 | |||
var finishTaskListAll = nWFProcessIBLL.GetMyFinishTaskPageList(userInfo, "{}"); | |||
ViewBag.FinishTaskList = nWFProcessIBLL.GetMyFinishTaskPageList(userInfo, paginationobj, "{}"); | |||
ViewBag.FinishTaskListStr = JsonConvert.SerializeObject(ViewBag.FinishTaskList); | |||
ViewBag.FinishTaskTotalNum = finishTaskListAll.Count(); | |||
//办公事项-我发起的 | |||
var myListAll = nWFProcessIBLL.GetMyPageList(userInfo.userId, "{}"); | |||
ViewBag.MyList = nWFProcessIBLL.GetMyPageList(userInfo.userId, paginationobj, "{}"); | |||
ViewBag.MyListStr = JsonConvert.SerializeObject(ViewBag.MyList); | |||
ViewBag.MyListTotalNum = myListAll.Count(); | |||
//常用服务 | |||
List<ModuleEntity> modulelist = new List<ModuleEntity>(); | |||
List<string> offenused = LogBLL.GetGroupLog(userInfo.userId).Select(m => m.F_Module).Take(20).ToList(); | |||
var moduledata = moduleIBLL.GetModuleList().Where(m => m.F_EnabledMark == 1 && m.F_DeleteMark == 0 && !string.IsNullOrEmpty(m.F_UrlAddress) && m.F_IsMenu == 1 && m.F_Target == "iframe" && !string.IsNullOrEmpty(m.F_ParentId)); | |||
foreach (var oitem in offenused) | |||
{ | |||
ModuleEntity fod = moduledata.FirstOrDefault(m => m.F_FullName == oitem); | |||
if (fod != null) | |||
{ | |||
//找父级 | |||
if (fod.F_ParentId == "0") | |||
{ | |||
fod.ParentName = fod.F_FullName; | |||
fod.F_ParentId = fod.F_ModuleId; | |||
} | |||
else | |||
{ | |||
var parent1 = moduleIBLL.GetModuleEntity(fod.F_ParentId); | |||
if (parent1 != null) | |||
{ | |||
if (parent1.F_ParentId == "0") | |||
{ | |||
fod.ParentName = parent1.F_FullName; | |||
fod.F_ParentId = parent1.F_ModuleId; | |||
} | |||
else | |||
{ | |||
//下一级 | |||
var parent2 = moduleIBLL.GetModuleEntity(parent1.F_ParentId); | |||
if (parent2 != null) | |||
{ | |||
if (parent2.F_ParentId == "0") | |||
{ | |||
fod.ParentName = parent2.F_FullName; | |||
fod.F_ParentId = parent2.F_ModuleId; | |||
} | |||
else | |||
{ | |||
//下一级 | |||
var parent3 = moduleIBLL.GetModuleEntity(parent2.F_ParentId); | |||
if (parent3 != null) | |||
{ | |||
if (parent3.F_ParentId == "0") | |||
{ | |||
fod.ParentName = parent3.F_FullName; | |||
fod.F_ParentId = parent3.F_ModuleId; | |||
} | |||
else | |||
{ | |||
//下一级 | |||
var parent4 = moduleIBLL.GetModuleEntity(parent3.F_ParentId); | |||
if (parent4 != null) | |||
{ | |||
if (parent4.F_ParentId == "0") | |||
{ | |||
fod.ParentName = parent4.F_FullName; | |||
fod.F_ParentId = parent4.F_ModuleId; | |||
} | |||
} | |||
} | |||
} | |||
} | |||
} | |||
} | |||
} | |||
} | |||
modulelist.Add(fod); | |||
} | |||
} | |||
ViewBag.OffenusedAll = modulelist; | |||
var mm = modulelist.GroupBy(x => x.F_ParentId).Select(x => new ModuleEntity() | |||
{ | |||
F_ParentId = x.Key, | |||
ParentName = x.FirstOrDefault().ParentName, | |||
ChildrenList = x.Select(y => new ModuleEntity() | |||
{ | |||
F_ModuleId = y.F_ModuleId, | |||
F_FullName = y.F_FullName | |||
}).ToList() | |||
}).ToList(); | |||
ViewBag.OffenusedGroup = mm; | |||
ViewBag.OffenusedGroupStr = JsonConvert.SerializeObject(ViewBag.OffenusedGroup); | |||
//查找服务 | |||
List<ModuleEntity> searchmodulelist = new List<ModuleEntity>(); | |||
foreach (var item in moduledata) | |||
{ | |||
if (moduleIBLL.GetColumnList(item.F_ModuleId).Any()) | |||
{ | |||
item.FirstLetter = Str.PinYin(item.F_FullName).Substring(0, 1); | |||
searchmodulelist.Add(item); | |||
} | |||
} | |||
ViewBag.SearchModule = searchmodulelist; | |||
//校园总览 | |||
//专业 | |||
var majorData = cdMajorIBLL.GetAllList(); | |||
ViewBag.MajorTotalNum = majorData.Count(); | |||
//班级 | |||
var classInfoData = classInfoIBLL.GetAllClass(); | |||
ViewBag.ClassInfoTotalNum = classInfoData.Count(); | |||
//学生 | |||
var stuInfoData = stuInfoBasicIBLL.GetAllList(); | |||
ViewBag.StuInfoTotalNum = stuInfoData.Count(); | |||
//教师 | |||
var teacherData = empInfoIBLL.GetAllList(); | |||
ViewBag.TeacherTotalNum = teacherData.Count(); | |||
//教室 | |||
var classRoomData = classroomInfoIBLL.GetAllList(); | |||
ViewBag.ClassRoomTotalNum = classRoomData.Count(); | |||
//课程 | |||
var lessonData = lessonInfoIBLL.GetAllList(); | |||
ViewBag.LessonTotalNum = lessonData.Count(); | |||
//专业总览 | |||
//专业学生 | |||
var stuByMajor = stuInfoData.GroupBy(x => x.MajorNo).Select(x => new | |||
{ | |||
value = x.Select(y => y.StuId).Count(), | |||
name = cdMajorIBLL.GetCdMajorEntityByMajorNo(x.Key)?.MajorName | |||
}); | |||
ViewBag.StuByMajorStr = JsonConvert.SerializeObject(stuByMajor); | |||
//流程 | |||
var flowType = dataItemIBLL.GetDetailList("FlowSort", ""); | |||
var flowList = wfSchemeIBLL.GetWfSchemeStart().ToList(); | |||
var allCount = 0; | |||
foreach (var flow in flowType) | |||
{ | |||
var count = flowList.Count(a => a.F_Category == flow.F_ItemName); | |||
flow.FlowCount = count; | |||
allCount += count; | |||
} | |||
ViewBag.AllCount = allCount; | |||
ViewBag.FlowType = flowType; | |||
ViewBag.FlowList = JsonConvert.SerializeObject(flowList); | |||
//校园一卡通余额 | |||
ViewBag.StuSaveRecordTotalNum = 0; | |||
var stuSaveRecordList = stuSaverecordIBLL.GetListByAccount(userInfo.account).OrderByDescending(x => x.UPLOADDATE); | |||
if (stuSaveRecordList.Any()) | |||
{ | |||
ViewBag.StuSaveRecordTotalNum = stuSaveRecordList.FirstOrDefault().ODDFARE; | |||
} | |||
//红湖付款码余额 | |||
ViewBag.StuConsumptionTotalNum = 0; | |||
var stuConsumptionList = stuConsumptionIBLL.GetListByAccount(userInfo.account); | |||
if (stuConsumptionList.Any()) | |||
{ | |||
ViewBag.StuConsumptionTotalNum = stuConsumptionList.Select(x => x.OPFARE.ToDecimal()).Sum(); | |||
} | |||
//常用链接 | |||
var userfunctionlist = perm_FunctionIBLL.GetListByUserId(userInfo.userId); | |||
var ff = userfunctionlist.GroupBy(x => x.FTName).Select(x => new Perm_FunctionEntity() | |||
{ | |||
FTName = x.Key, | |||
PFunctionList = x.Select(y => new Perm_FunctionEntity() | |||
{ | |||
FId = y.FId, | |||
FTId = y.FTId, | |||
FName = y.FName, | |||
UPId = DESEncrypt.Encrypt(y.FId, ConfigurationManager.AppSettings["SSOPublicSecret"]),//sysid | |||
UserId = DESEncrypt.Encrypt(userInfo.userId, ConfigurationManager.AppSettings["SSOPublicSecret"])//openid | |||
}).Take(8).ToList() | |||
}); | |||
ViewBag.FunctionList = ff; | |||
ViewBag.FunctionListStr = JsonConvert.SerializeObject(ViewBag.FunctionList); | |||
return View("DragModelOne"); | |||
} | |||
//public ActionResult NoLogin() | |||
@@ -16,7 +16,7 @@ | |||
<img style="height: 40px;" width="95%" src="~/LR_SystemModule/LogoImg/GetImg?code=headbg" alt="经典风格"> | |||
</div> | |||
<div> | |||
<iframe style="position: absolute; top: 18px; right: 150px; height: 25px;" id="fancybox-frame" name="fancybox-frame1591155087436" frameborder="0" scrolling="no" hspace="0" src="http://i.tianqi.com/index.php?c=code&a=getcode&id=34&h=25&w=280"></iframe> | |||
<iframe style="position: absolute; top: 18px; right: 150px; height: 25px;" id="fancybox-frame" name="fancybox-frame1591155087436" frameborder="0" scrolling="no" hspace="0" src="http://i.tianqi.com/index.php?c=code&py=akesu&a=getcode&id=34&h=25&w=280"></iframe> | |||
</div> | |||
</div> | |||
@*<div class="lr-lg-setting" id="lr_lg_setting"> | |||
@@ -1020,5 +1020,5 @@ var bootstrap = function ($, learun) { | |||
} | |||
}; | |||
im.init(); | |||
//im.init(); | |||
}; |
@@ -21,9 +21,10 @@ | |||
<div id="TitleColor" class="portal-panel-title"> | |||
<i class="fa fa-balance-scale"></i> 统计指标 | |||
</div> | |||
<div class="portal-panel-content" id="lr_target" > | |||
<div class="portal-panel-content" id="lr_target"> | |||
</div> | |||
</div> | |||
<audio id="sound" autoplay="autoplay"></audio> | |||
</div> | |||
@@ -270,13 +270,61 @@ | |||
}) | |||
} | |||
} | |||
} | |||
$(".lr-desktop-panel").lrscroll(); | |||
top.learun.clientdata.getAsync("desktop", { | |||
callback: function(g) { | |||
e(g.target || []); | |||
c(g.list || []); | |||
a(g.chart || []) | |||
} | |||
}) | |||
} | |||
//$(".lr-desktop-panel").lrscroll(); | |||
//top.learun.clientdata.getAsync("desktop", { | |||
// callback: function(g) { | |||
// e(g.target || []); | |||
// c(g.list || []); | |||
// a(g.chart || []) | |||
// } | |||
//}) | |||
setTimeout(onload(), 10000); | |||
function onload() { | |||
$(".lr-desktop-panel").lrscroll(); | |||
top.learun.clientdata.getAsync("desktop", | |||
{ | |||
callback: function(g) { | |||
e(g.target || []); | |||
c(g.list || []); | |||
a(g.chart || []); | |||
} | |||
}); | |||
funopen(); | |||
} | |||
window.setInterval(funopen, 60000); | |||
//消息提醒 | |||
function funopen() { | |||
$.ajax({ | |||
url: top.$.rootUrl + '/LR_Desktop/MessageRind/GetCountForUnread', | |||
type: "get", | |||
dataType: "json", | |||
async: false, | |||
success: function (data) { | |||
if (data.data != 0) { | |||
document.getElementById("sound").src = '/Resource/wav/收到新消息.wav'; | |||
top.learun.layeropen({ | |||
//id: 'form', | |||
type: 2, | |||
title: "消息提示", | |||
closeBtn: 0, //不显示关闭按钮 | |||
shade: [0], | |||
area: ['340px', '215px'], | |||
offset: 'rb', //右下角弹出 | |||
anim: 2, | |||
content: top.$.rootUrl + '/LR_Desktop/MessageRind/UnreadIndex', | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
} | |||
}); | |||
}; | |||
}); |
@@ -61,7 +61,12 @@ | |||
</div> | |||
</div> | |||
</div> | |||
<script> | |||
var Ip = "@ViewBag.Ip"; | |||
var ACIp = "@ViewBag.ACIp"; | |||
var ACIp2 = "@ViewBag.ACIp2"; | |||
</script> | |||
@Html.AppendJsFile("/Views/Home/AdminTop/index.js") | |||
@@ -212,6 +212,93 @@ | |||
} | |||
}); | |||
}, | |||
//页面弹窗 | |||
layeropen: function (op) { | |||
var dfop = { | |||
id: null, | |||
type: 2, | |||
title: '系统窗口', | |||
//url: 'error', | |||
//btn: ['确认', '关闭'], | |||
callBack: false, | |||
maxmin: false, | |||
end: false, | |||
}; | |||
$.extend(dfop, op || {}); | |||
/*适应窗口大小*/ | |||
//dfop.width = dfop.width > $(window).width() ? $(window).width() - 10 : dfop.width; | |||
//dfop.height = dfop.height > $(window).height() ? $(window).height() - 10 : dfop.height; | |||
var r = top.layer.open({ | |||
id: dfop.id, | |||
maxmin: dfop.maxmin, | |||
type: 2, //0(信息框,默认)1(页面层)2(iframe层)3(加载层)4(tips层) | |||
title: op.title, | |||
area: ['350px', '240px'], | |||
anim: 2, | |||
btn: dfop.btn, | |||
offset: 'rb', //右下角弹出 | |||
closeBtn: 1, //显示关闭按钮 | |||
shade: false,//[0], | |||
time: 60000, //60秒后自动关闭 | |||
content: op.content,//op.url, | |||
//skin: dfop.btn == null ? 'lr-layer-nobtn' : 'lr-layer', | |||
success: function (layero, index) { | |||
top['layer_' + dfop.id] = learun.iframe($(layero).find('iframe').attr('id'), top.frames); | |||
layero[0].learun_layerid = 'layer_' + dfop.id; | |||
//如果底部有按钮添加-确认并关闭窗口勾选按钮 | |||
if (!!dfop.btn && layero.find('.lr-layer-btn-cb').length == 0) { | |||
top.learun.language.get('确认并关闭窗口', | |||
function (text) { | |||
layero.find('.layui-layer-btn') | |||
.append('<div class="checkbox lr-layer-btn-cb" myIframeId="layer_' + | |||
dfop.id + | |||
'" ><label><input checked="checked" type="checkbox" >' + | |||
text + | |||
'</label></div>'); | |||
}); | |||
layero.find('.layui-layer-btn a').each(function () { | |||
var $this = $(this); | |||
var _text = $this.text(); | |||
top.learun.language.get(_text, | |||
function (text) { | |||
$this.text(text); | |||
}); | |||
}); | |||
} | |||
layero.find('.layui-layer-title').each(function () { | |||
var $this = $(this); | |||
var _text = $this.text(); | |||
top.learun.language.get(_text, | |||
function (text) { | |||
$this.text(text); | |||
}); | |||
}); | |||
}, | |||
yes: function (index) { | |||
var flag = true; | |||
if (!!dfop.callBack) { | |||
flag = dfop.callBack('layer_' + dfop.id); | |||
} | |||
if (dfop.id == 'formitem') { | |||
learun.layerClose('', index); | |||
} | |||
if (!!flag) { | |||
learun.layerClose('', index); | |||
} | |||
}, | |||
end: function () { | |||
top['layer_' + dfop.id] = null; | |||
if (!!dfop.end) { | |||
dfop.end(); | |||
} | |||
} | |||
}); | |||
}, | |||
// 关闭弹层 | |||
layerClose: function (name, index) { | |||
var _index; | |||
@@ -79,8 +79,8 @@ | |||
"/Views/LR_Content/plugin/workflow/lr-workflow-api.js", | |||
"/Views/LR_Content/plugin/contextmenu/lr-contextmenu.js", | |||
"/Views/LR_Content/script/lr-im.js", | |||
"/Views/LR_Content/script/pushmessage.js", | |||
//"/Views/LR_Content/script/lr-im.js", | |||
//"/Views/LR_Content/script/pushmessage.js", | |||
"/Views/LR_Content/script/lr-admin.js" | |||
) | |||
@@ -151,8 +151,8 @@ | |||
<add key="secret" value="55848ef07e0f4e0c991bc8b4426100b2" /> | |||
<add key="redirecturl" value="http://123.6.9.199:6060/Login/SSOLogin" /> | |||
<!-- 深信服ACIp --> | |||
<add key="ACIp" value="192.168.90.2"/> | |||
<add key="ACIp2" value="192.168.200.252"/> | |||
<add key="ACIp" value=""/> | |||
<add key="ACIp2" value=""/> | |||
<!-- 是否强制验证强密码 --> | |||
<add key="verifypwd" value="false"/> | |||
<!--疫情防控组角色Id--> | |||
@@ -160,7 +160,7 @@ | |||
<!--注册教师生成编号 金隅:jy;西昌:xc;大厂:dc--> | |||
<add key="EmpNoRule" value="jy"/> | |||
<!--考勤明细统计时查询的职工编号前缀 大厂:DCZZ--> | |||
<add key="ADR_RecordUserNoPrev" value="DCZZ"/> | |||
<add key="ADR_RecordUserNoPrev" value=""/> | |||
<!--第三方登录跳转地址(最后不加/)--> | |||
<add key="redirect_url" value="http://localhost:20472"/> | |||
<add key="QJUrl" value="www.qj.com"/> | |||
@@ -167,6 +167,8 @@ | |||
<Content Include="packages.config" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile1.pubxml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile2.pubxml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile3.pubxml" /> | |||
<None Include="Web.Debug.config"> | |||
<DependentUpon>Web.config</DependentUpon> | |||
</None> | |||
@@ -190,6 +192,7 @@ | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Compile Include="Bootstraper.cs" /> | |||
<Compile Include="Modules\AttendanceApi.cs" /> | |||
<Compile Include="Modules\AnnexesApiWx.cs" /> | |||
<Compile Include="Modules\BaseNoLoginApi.cs" /> | |||
<Compile Include="Modules\ArrangeLessonTermAttemperApi.cs" /> | |||
@@ -0,0 +1,75 @@ | |||
using Learun.Application.Base.SystemModule; | |||
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; | |||
} | |||
private ADR_RestrictionIBLL adr_RestrictionBLL = new ADR_RestrictionBLL(); | |||
private ADR_RecordIBLL adr_RecordBLL = new ADR_RecordBLL(); | |||
/// <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 ClockIn(dynamic _) | |||
{ | |||
adr_RestrictionBLL.ClockIn(); | |||
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); | |||
} | |||
} | |||
} |
@@ -225,7 +225,7 @@ namespace Learun.Application.OA | |||
this.F_CreateDate = DateTime.Now; | |||
this.F_ReleaseTime = DateTime.Now; | |||
this.F_DeleteMark = 0; | |||
this.F_EnabledMark = 1; | |||
this.F_EnabledMark = 0; | |||
this.F_PV = 0; | |||
UserInfo userInfo = LoginUserInfo.Get(); | |||
@@ -184,6 +184,10 @@ namespace Learun.Application.OA | |||
if (null != newEntity) | |||
{ | |||
newEntity.F_Status = status.ToString(); | |||
if (status==2) | |||
{ | |||
newEntity.F_EnabledMark = 1; | |||
} | |||
} | |||
this.BaseRepository().Update(newEntity); | |||
@@ -181,6 +181,25 @@ namespace Learun.Application.OA | |||
} | |||
} | |||
public void SaveFormAndSubmit(string keyValue, NewsEntity entity) | |||
{ | |||
try | |||
{ | |||
noticeService.SaveFormAndSubmit(keyValue, entity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -55,5 +55,6 @@ namespace Learun.Application.OA | |||
void ChangeStatusById(string keyValue, int i, string processId); | |||
NewsEntity GetEntityByProcessId(string processId); | |||
void SaveFormAndSubmit(string keyValue, NewsEntity entity); | |||
} | |||
} |
@@ -27,7 +27,7 @@ namespace Learun.Application.OA | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT * FROM LR_OA_News t WHERE t.F_TypeId = 2 "); | |||
strSql.Append("SELECT * FROM LR_OA_News t WHERE t.F_TypeId = 2 and F_DeleteMark=0 "); | |||
if (!string.IsNullOrEmpty(keyword)) | |||
{ | |||
strSql.Append(" AND F_FullHead like @keyword"); | |||
@@ -87,8 +87,13 @@ namespace Learun.Application.OA | |||
var entity = db.FindEntity<NewsEntity>(x => x.F_NewsId == item); | |||
if (entity != null) | |||
{ | |||
db.Delete(entity); | |||
entity.F_DeleteMark = 1; | |||
db.Update(entity); | |||
//db.Delete(entity); | |||
} | |||
string sql = $"delete MessageRemind where InstanceId='{entity.F_NewsId}'"; | |||
db.ExecuteBySql(sql); | |||
} | |||
db.Commit(); | |||
@@ -156,7 +161,7 @@ namespace Learun.Application.OA | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT t.*,r.RNewsId,r.RTime FROM LR_OA_News t "); | |||
strSql.Append(" left join LR_OA_NewsRead r on t.F_NewsId = r.NewsId and r.RUserId=@userId "); | |||
strSql.Append(" WHERE t.F_TypeId = 2 "); | |||
strSql.Append(" WHERE t.F_TypeId = 2 and t.F_DeleteMark=0 "); | |||
if (!string.IsNullOrEmpty(categoryId)) | |||
{ | |||
strSql.Append($" AND F_CategoryId = '{categoryId}'"); | |||
@@ -213,5 +218,35 @@ namespace Learun.Application.OA | |||
} | |||
} | |||
} | |||
public void SaveFormAndSubmit(string keyValue, NewsEntity entity) | |||
{ | |||
try | |||
{ | |||
entity.F_TypeId = 2; | |||
if (!string.IsNullOrEmpty(keyValue)) | |||
{ | |||
entity.Modify(keyValue); | |||
this.BaseRepository().Update(entity); | |||
} | |||
else | |||
{ | |||
entity.Create(); | |||
entity.F_EnabledMark = 1; | |||
this.BaseRepository().Insert(entity); | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
} | |||
} |
@@ -659,7 +659,7 @@ WHERE (AcademicYearNo = '" + strAcademicYear + "') and semester='" + strSemest | |||
} | |||
return result; | |||
} | |||
/// <summary> | |||
/// 按条件同步排课数据 | |||
/// </summary> | |||
@@ -686,7 +686,7 @@ WHERE (AcademicYearNo = '" + strAcademicYear + "') and semester='" + strSemest | |||
{ | |||
var oldArrangeLessonTermList = (await BaseRepository("CollegeMIS").FindListAsync<ArrangeLessonTermEntity>()).ToList(); | |||
var insertDataList = new List<ArrangeLessonTermEntity>(); | |||
foreach (var item in dataList) | |||
{ | |||
var classinfo = classData.FirstOrDefault(m => m.ClassId == item.clazzSid); | |||
@@ -941,7 +941,7 @@ WHERE (AcademicYearNo = '" + strAcademicYear + "') and semester='" + strSemest | |||
if (dataList.Any()) | |||
{ | |||
var insertDataList = new List<OpenLessonPlanEntity>(); | |||
var now = DateTime.Now; | |||
foreach (var item in dataList) | |||
{ | |||
@@ -1093,34 +1093,44 @@ WHERE (AcademicYearNo = '" + entity.AcademicYearNo + "') and semester='" + ent | |||
public async Task<bool> AsyncModifyArrangeLessonDataByCondition(ArrangeLessonTermEntity entity) | |||
{ | |||
bool result = false; | |||
var db = BaseRepository("CollegeMIS"); | |||
try | |||
{ | |||
HttpContent httpContent = new StringContent("{\"school\":\"" + entity.F_SchoolId + "\",\"year\":\"" + entity.AcademicYearNo + "\",\"number\":\"" + entity.Semester + "\"}"); | |||
httpContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json"); | |||
string apiData = await Client.PostAsync(Config.GetValue("ModifyArrangeLessonAPI"), httpContent).Result.Content.ReadAsStringAsync(); | |||
if (!string.IsNullOrEmpty(apiData)) | |||
if (entity.SyncType == "1") | |||
{ | |||
var data = JsonConvert.DeserializeObject<Root>(apiData); | |||
if (data.success) | |||
HttpContent httpContent = new StringContent("{\"school\":\"" + entity.F_SchoolId + "\",\"year\":\"" + entity.AcademicYearNo + "\",\"number\":\"" + entity.Semester + "\"}"); | |||
httpContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json"); | |||
string apiData = await Client.PostAsync(Config.GetValue("ModifyArrangeLessonAPI"), httpContent).Result.Content.ReadAsStringAsync(); | |||
if (!string.IsNullOrEmpty(apiData)) | |||
{ | |||
var executeResult = await BaseRepository("CollegeMIS").ExecuteAsyncBySql( | |||
$"delete from ArrangeLessonTerm where F_SchoolId='{entity.F_SchoolId}' and AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' "); | |||
await BaseRepository("CollegeMIS").ExecuteAsyncBySql( | |||
$"delete from TeachClass where F_SchoolId='{entity.F_SchoolId}' and AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' "); | |||
await BaseRepository("CollegeMIS").ExecuteAsyncBySql( | |||
$"delete from OpenLessonPlan where F_SchoolId='{entity.F_SchoolId}' and AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' "); | |||
await BaseRepository("CollegeMIS").ExecuteAsyncBySql( | |||
$"delete from StuSelectLessonList where F_SchoolId='{entity.F_SchoolId}' and AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' "); | |||
if (executeResult > 0) | |||
var data = JsonConvert.DeserializeObject<Root>(apiData); | |||
if (data.success) | |||
{ | |||
db.BeginTrans(); | |||
db.ExecuteBySql( | |||
$"delete from ArrangeLessonTerm where F_SchoolId='{entity.F_SchoolId}' and AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' "); | |||
db.Commit(); | |||
result = true; | |||
} | |||
} | |||
} | |||
else | |||
{ | |||
db.BeginTrans(); | |||
db.ExecuteBySql( | |||
$"delete from TeachClass where F_SchoolId='{entity.F_SchoolId}' and AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' "); | |||
db.ExecuteBySql( | |||
$"delete from OpenLessonPlan where F_SchoolId='{entity.F_SchoolId}' and AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' "); | |||
db.ExecuteBySql( | |||
$"delete from StuSelectLessonList where F_SchoolId='{entity.F_SchoolId}' and AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' "); | |||
db.Commit(); | |||
result = true; | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
db.Rollback(); | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
@@ -328,18 +328,18 @@ and s.Academicyearno='" + entity.AcademicYearNo + "' and s.Semester='" + entity. | |||
//dyy:20190722 | |||
//初始化教师成绩单提交表 | |||
string sql3 = @"insert into EmpReportCard | |||
(Id, LessonNo, LessonName, ClassNo, ClassName, EmpNo, EmpName, AcademicYearNo, Semester,LessonSortNo, CreateTime, ElectronicStatus, ElectronicTime, PaperStatus, PaperTime) | |||
select NEWID(),LessonNo,LessonName,ClassNo,ClassName,EmpNo,EmpName,AcademicYearNo,Semester,LessonSortNo,GETDATE(),0,null,0,null from | |||
(Id, LessonNo, LessonName, ClassNo, ClassName, EmpNo, EmpName, AcademicYearNo, Semester,LessonSortNo, CreateTime, ElectronicStatus, ElectronicTime, PaperStatus, PaperTime,F_SchoolId) | |||
select NEWID(),LessonNo,LessonName,ClassNo,ClassName,EmpNo,EmpName,AcademicYearNo,Semester,LessonSortNo,GETDATE(),0,null,0,null,F_SchoolId from | |||
( | |||
select distinct s.LessonNo,s.LessonName,s.TeachClassNo as ClassNo,c.ClassName,s.EmpNo,e.EmpName,s.AcademicYearNo,s.Semester,s.LessonSortNo | |||
select distinct s.LessonNo,s.LessonName,s.TeachClassNo as ClassNo,c.ClassName,s.EmpNo,e.EmpName,s.AcademicYearNo,s.Semester,s.LessonSortNo,s.F_SchoolId | |||
from stuscore s | |||
left join classinfo c on s.teachclassno=c.classno | |||
left join empinfo e on s.empno=e.empno | |||
where s.lessonsortno='1' | |||
) as bb | |||
where bb.EmpNo not in | |||
(select a.EmpNo from EmpReportCard a where a.AcademicYearNo=bb.AcademicYearNo and a.Semester=bb.Semester and a.LessonNo=bb.LessonNo and a.ClassNo=bb.ClassNo and a.LessonSortNo=bb.LessonSortNo and a.LessonSortNo='1' | |||
and a.Academicyearno='" + entity.AcademicYearNo + "' and a.Semester='" + entity.Semester + "') and bb.AcademicYearNo='" + entity.AcademicYearNo + "' and bb.Semester='" + entity.Semester + "' order by bb.EmpNo"; | |||
(select a.EmpNo from EmpReportCard a where a.AcademicYearNo=bb.AcademicYearNo and a.Semester=bb.Semester and a.LessonNo=bb.LessonNo and a.ClassNo=bb.ClassNo and a.LessonSortNo=bb.LessonSortNo and a.LessonSortNo='1' and a.F_SchoolId=bb.F_SchoolId | |||
and a.Academicyearno='" + entity.AcademicYearNo + "' and a.Semester='" + entity.Semester + "') and bb.AcademicYearNo='" + entity.AcademicYearNo + "' and bb.Semester='" + entity.Semester + "' and bb.F_SchoolId='"+entity.F_SchoolId+"' order by bb.EmpNo"; | |||
BaseRepository("CollegeMIS").ExecuteBySql(sql3); | |||
} | |||
//选修课 | |||
@@ -364,17 +364,17 @@ and s.Academicyearno='" + entity.AcademicYearNo + "' and s.Semester='" + entity. | |||
//初始化教师成绩单提交表【选修课】 | |||
string sql3OfElective = @"insert into EmpReportCard | |||
(Id, LessonNo, LessonName, EmpNo, EmpName, AcademicYearNo, Semester,LessonSortNo, LessonSection, ClassRoomNo, ClassRoomName, CreateTime, ElectronicStatus, ElectronicTime, PaperStatus, PaperTime) | |||
select NEWID(),LessonNo,LessonName,EmpNo,EmpName,AcademicYearNo,Semester,LessonSortNo, LessonSection, ClassRoomNo, ClassRoomName,GETDATE(),0,null,0,null from | |||
(Id, LessonNo, LessonName, EmpNo, EmpName, AcademicYearNo, Semester,LessonSortNo, LessonSection, ClassRoomNo, ClassRoomName, CreateTime, ElectronicStatus, ElectronicTime, PaperStatus, PaperTime,F_SchoolId) | |||
select NEWID(),LessonNo,LessonName,EmpNo,EmpName,AcademicYearNo,Semester,LessonSortNo, LessonSection, ClassRoomNo, ClassRoomName,GETDATE(),0,null,0,null,F_SchoolId from | |||
( | |||
select distinct s.LessonNo,s.LessonName,s.EmpNo,e.EmpName,s.AcademicYearNo,s.Semester,s.LessonSortNo,s.LessonSection,s.ClassRoomNo,s.ClassRoomName | |||
select distinct s.LessonNo,s.LessonName,s.EmpNo,e.EmpName,s.AcademicYearNo,s.Semester,s.LessonSortNo,s.LessonSection,s.ClassRoomNo,s.ClassRoomName,s.F_SchoolId | |||
from stuscore s | |||
left join empinfo e on s.empno=e.empno | |||
where s.lessonsortno='2' | |||
) as bb | |||
where bb.EmpNo not in | |||
(select a.EmpNo from EmpReportCard a where a.AcademicYearNo=bb.AcademicYearNo and a.Semester=bb.Semester and a.LessonNo=bb.LessonNo and a.LessonSection=bb.LessonSection and a.ClassRoomNo=bb.ClassRoomNo and a.LessonSortNo=bb.LessonSortNo and a.LessonSortNo='2' | |||
and a.Academicyearno='" + entity.AcademicYearNo + "' and a.Semester='" + entity.Semester + "') and bb.AcademicYearNo='" + entity.AcademicYearNo + "' and bb.Semester='" + entity.Semester + "' order by bb.EmpNo"; | |||
(select a.EmpNo from EmpReportCard a where a.AcademicYearNo=bb.AcademicYearNo and a.Semester=bb.Semester and a.LessonNo=bb.LessonNo and a.LessonSection=bb.LessonSection and a.ClassRoomNo=bb.ClassRoomNo and a.LessonSortNo=bb.LessonSortNo and a.LessonSortNo='2' and a.F_SchoolId=bb.F_SchoolId | |||
and a.Academicyearno='" + entity.AcademicYearNo + "' and a.Semester='" + entity.Semester + "') and bb.AcademicYearNo='" + entity.AcademicYearNo + "' and bb.Semester='" + entity.Semester + "' and bb.F_SchoolId='"+entity.F_SchoolId+"' order by bb.EmpNo"; | |||
BaseRepository("CollegeMIS").ExecuteBySql(sql3OfElective); | |||
} | |||
} | |||
@@ -37,8 +37,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT t.* "); | |||
strSql.Append(" FROM EmpInfo t "); | |||
strSql.Append("SELECT t.*,b.F_Order as DeptOrder "); | |||
strSql.Append(" FROM EmpInfo t left join "+BaseRepository().getDbConnection().Database+".dbo.LR_Base_Department b on t.F_DepartmentId=b.F_DepartmentId "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
@@ -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.LR_Desktop | |||
@@ -183,8 +184,12 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
} | |||
else | |||
{ | |||
entity.Create(); | |||
this.BaseRepository().Insert(entity); | |||
if (this.BaseRepository().FindList<MessageRemindEntity>(x => | |||
x.ReceiptId == entity.ReceiptId && x.InstanceId == entity.InstanceId).Count() <= 0) | |||
{ | |||
entity.Create(); | |||
this.BaseRepository().Insert(entity); | |||
} | |||
} | |||
} | |||
catch (Exception ex) | |||
@@ -35,7 +35,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
[Column("DEPARTMENT")] | |||
public string Department { get; set; } | |||
/// <summary> | |||
/// 考勤类型 0-未定义,1-上班,2-下班,3-开始休息,4-结束休息,5-开始加班,6-结束加班 | |||
/// 考勤类型 0-未定义,1-上班,2-下班,3-开始休息,4-结束休息,5-开始加班,6-结束加班,7-中午上班,8-中午下班 | |||
/// </summary> | |||
[Column("ADTYPE")] | |||
public string ADType { get; set; } | |||
@@ -47,7 +47,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
t.ADDay, | |||
t.ADPhoto | |||
"); | |||
strSql.Append($" FROM ADR_Record t RIGHT JOIN {baseDataName}.dbo.LR_Base_User emp ON t.UserNo=emp.F_Account"); | |||
strSql.Append($" FROM ADR_Record t left JOIN {baseDataName}.dbo.LR_Base_User emp ON t.UserNo=emp.F_Account"); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
@@ -83,6 +83,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
dp.Add("ADStatus", queryParam["ADStatus"].ToString(), DbType.String); | |||
strSql.Append(" AND t.ClockStatus = @ADStatus "); | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<ADR_RecordEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
@@ -67,6 +67,8 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
@@ -141,6 +143,48 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||
} | |||
} | |||
/// <summary> | |||
/// 考勤打卡 | |||
/// </summary> | |||
/// <returns></returns> | |||
public bool ClockIn() | |||
{ | |||
try | |||
{ | |||
return aDR_RestrictionService.ClockIn(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public string IsAttendance() | |||
{ | |||
try | |||
{ | |||
return aDR_RestrictionService.IsAttendance(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public ADR_RestrictionEntity GetADR_RestrictionEntityEnabled() | |||
{ | |||
try | |||
@@ -27,6 +27,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
ADR_RestrictionEntity GetADR_RestrictionEntity(string keyValue); | |||
#endregion | |||
#region 提交数据 | |||
@@ -47,6 +48,14 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
void SaveEntity(string keyValue, ADR_RestrictionEntity entity); | |||
/// <summary> | |||
/// 考勤打卡 | |||
/// </summary> | |||
/// <returns></returns> | |||
bool ClockIn(); | |||
string IsAttendance(); | |||
#endregion | |||
ADR_RestrictionEntity GetADR_RestrictionEntityEnabled(); | |||
@@ -77,6 +77,7 @@ | |||
<Reference Include="System.Configuration" /> | |||
<Reference Include="System.Core" /> | |||
<Reference Include="System.Runtime.Serialization" /> | |||
<Reference Include="System.Web" /> | |||
<Reference Include="System.Xml.Linq" /> | |||
<Reference Include="System.Data.DataSetExtensions" /> | |||
<Reference Include="Microsoft.CSharp" /> | |||
@@ -220,6 +221,10 @@ | |||
<Project>{81c03609-ae0d-414c-829b-16b990487add}</Project> | |||
<Name>Learun.Ioc</Name> | |||
</ProjectReference> | |||
<ProjectReference Include="..\..\Learun.Util\Learun.Util.Operat\Learun.Util.Operat.csproj"> | |||
<Project>{ad556b7a-e0d1-41bd-9d5b-18f8502e9f33}</Project> | |||
<Name>Learun.Util.Operat</Name> | |||
</ProjectReference> | |||
<ProjectReference Include="..\..\Learun.Util\Learun.Util\Learun.Util.csproj"> | |||
<Project>{cf8ae293-88ab-436c-9720-a8386ba5d7b7}</Project> | |||
<Name>Learun.Util</Name> | |||
@@ -1,9 +1,19 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Configuration; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using System.Web; | |||
using Learun.Application.Base.AuthorizeModule; | |||
using Learun.Application.Base.SystemModule; | |||
using Learun.Application.OA; | |||
using Learun.Application.Organization; | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using Learun.Application.TwoDevelopment.LR_Desktop; | |||
using Learun.Util.Operat; | |||
using Microsoft.AspNet.SignalR.Client; | |||
using Newtonsoft.Json; | |||
namespace Learun.Application.WorkFlow | |||
{ | |||
@@ -11,16 +21,211 @@ namespace Learun.Application.WorkFlow | |||
{ | |||
NewsIBLL newsIBLL=new NewsBLL(); | |||
private NoticeIBLL noticeIBLL = new NoticeBLL(); | |||
private WeChatConfigIBLL weChatConfigIbll = new WeChatConfigBLL(); | |||
private WeChatTempletIBLL weChatTempletIbll = new WeChatTempletBLL(); | |||
private UserIBLL userIbll = new UserBLL(); | |||
private UserRelationIBLL userRelationIBLL = new UserRelationBLL(); | |||
private Sys_InformationPushIBLL sys_InformationPushIBLL = new Sys_InformationPushBLL(); | |||
private MessageRindIBLL messageRindIBLL = new MessageRindBLL(); | |||
public void Execute(WfMethodParameter parameter) | |||
{ | |||
if (parameter.code == "agree") | |||
{ | |||
newsIBLL.ChangeStatusByProcessId(parameter.processId, 2); | |||
var entity = noticeIBLL.GetEntityByProcessId(parameter.processId); | |||
//推送通知 | |||
//读取信息推送管理-通知公告推送(01)的配置 | |||
var informationPushEntity = sys_InformationPushIBLL.GetEntityByPushItem("01"); | |||
if (informationPushEntity != null && informationPushEntity.Status == true) | |||
{ | |||
//推送微信 | |||
Task.Run(async () => { await DoWeixinPush(entity); }); | |||
} | |||
if (entity.F_IsSendFX.HasValue && entity.F_IsSendFX == true) | |||
{ | |||
Task.Run(async () => | |||
{ | |||
using (var hubConnection = new HubConnection(ConfigurationManager.AppSettings["CommunicationServeraddress"])) | |||
{ | |||
var hubProxy = hubConnection.CreateHubProxy("SignalRHub"); | |||
await hubConnection.Start(); | |||
await hubProxy.Invoke("PushAnnouncement", entity.F_NewsId, entity.F_FullHead, Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(entity.F_NewsContent)).Length < 20 ? Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(entity.F_NewsContent)) : Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(entity.F_NewsContent)).Substring(0, 20), "news", entity.F_SendPostId, entity.F_SendDeptId); | |||
} | |||
}); | |||
} | |||
} | |||
else | |||
{ | |||
newsIBLL.ChangeStatusByProcessId(parameter.processId, 0); | |||
} | |||
} | |||
Task DoWeixinPush(NewsEntity entity) | |||
{ | |||
//微信推送 | |||
try | |||
{ | |||
var allteacherlist = userIbll.GetAllList().Where(m => | |||
m.F_DeleteMark != 1 && m.F_EnabledMark == 1 && m.F_Description == "教师"); | |||
var userralationlist = userRelationIBLL.GetUserIdList("2"); | |||
var needpostuserlist = new List<UserEntity>(); | |||
if (!string.IsNullOrEmpty(entity.F_SendDeptId)) | |||
{ | |||
if (!entity.F_SendDeptId.Contains(",")) | |||
{ | |||
var departteacherlist = allteacherlist.Where(m => entity.F_SendDeptId == m.F_DepartmentId); | |||
needpostuserlist.AddRange(departteacherlist.ToList()); | |||
if (!string.IsNullOrEmpty(entity.F_SendPostId)) | |||
{ | |||
var newpostuserlist = new List<UserEntity>(); | |||
foreach (var uuitem in needpostuserlist) | |||
{ | |||
var postids = userralationlist?.Count(m => m.F_UserId == uuitem.F_UserId && entity.F_SendPostId.Contains(m.F_ObjectId)); | |||
if (postids > 0) | |||
{ | |||
newpostuserlist.Add(uuitem); | |||
} | |||
} | |||
needpostuserlist = newpostuserlist; | |||
} | |||
} | |||
else | |||
{ | |||
foreach (var senddeptid in entity.F_SendDeptId.Split(',')) | |||
{ | |||
var departteacherlist = allteacherlist.Where(m => senddeptid == m.F_DepartmentId); | |||
needpostuserlist.AddRange(departteacherlist.ToList()); | |||
if (!string.IsNullOrEmpty(entity.F_SendPostId)) | |||
{ | |||
var newpostuserlist = new List<UserEntity>(); | |||
foreach (var uuitem in needpostuserlist) | |||
{ | |||
var postids = userralationlist?.Count(m => m.F_UserId == uuitem.F_UserId && entity.F_SendPostId.Contains(m.F_ObjectId)); | |||
if (postids > 0) | |||
{ | |||
newpostuserlist.Add(uuitem); | |||
} | |||
} | |||
needpostuserlist = newpostuserlist; | |||
} | |||
} | |||
} | |||
} | |||
else | |||
{ | |||
if (!string.IsNullOrEmpty(entity.F_SendPostId)) | |||
{ | |||
//岗位下发 | |||
var newpostuserlist = new List<UserEntity>(); | |||
foreach (var uuitem in allteacherlist) | |||
{ | |||
var postids = userralationlist?.Count(m => m.F_UserId == uuitem.F_UserId && entity.F_SendPostId.Contains(m.F_ObjectId)); | |||
if (postids > 0) | |||
{ | |||
newpostuserlist.Add(uuitem); | |||
} | |||
} | |||
needpostuserlist = newpostuserlist; | |||
} | |||
else | |||
{ | |||
//全员下发 | |||
needpostuserlist = allteacherlist.ToList(); | |||
} | |||
} | |||
PushWeixin(needpostuserlist, entity.F_FullHead); | |||
//消息提醒表 | |||
PushMessageRemind(needpostuserlist, entity); | |||
return Task.CompletedTask; | |||
} | |||
catch (Exception e) | |||
{ | |||
return Task.FromException(e); | |||
} | |||
} | |||
public void PushWeixin(List<UserEntity> needpostuserlist, string title) | |||
{ | |||
var WeChatConfigentity = weChatConfigIbll.GetEnableEntity(); | |||
string appid = WeChatConfigentity.APPId; | |||
string secret = WeChatConfigentity.secret; | |||
var wechatemplete = weChatTempletIbll.GetWeChatTemplateEntityByCodeConfigId(WeChatConfigentity.ID, "task"); | |||
string weixintaskurl = wechatemplete.TUrl; | |||
string weixintasktempid = wechatemplete.TempId; | |||
var responsejson = Util.HttpMethods.HttpGet("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + appid + "&secret=" + secret); | |||
OperateLogModel operateLogModel = new OperateLogModel(); | |||
operateLogModel.title = title; | |||
operateLogModel.type = OperationType.Other; | |||
operateLogModel.url = "NoticeController"; | |||
operateLogModel.sourceObjectId = "002"; | |||
operateLogModel.sourceContentJson = responsejson; | |||
OperatorHelper.Instance.WriteOperateLog(operateLogModel); | |||
foreach (UserEntity userinfo in needpostuserlist) | |||
{ | |||
if (userinfo != null && !string.IsNullOrEmpty(userinfo.OpenIdForWeixin)) | |||
{ | |||
//执行推送任务 | |||
if (!string.IsNullOrEmpty(appid) && !string.IsNullOrEmpty(secret) && !string.IsNullOrEmpty(weixintaskurl) && !string.IsNullOrEmpty(weixintasktempid)) | |||
{ | |||
if (!string.IsNullOrEmpty(responsejson)) | |||
{ | |||
var weixintokenobj = JsonConvert.DeserializeObject<dynamic>(responsejson); | |||
if (string.IsNullOrEmpty(weixintokenobj.errcode)) | |||
{ | |||
string access_token = weixintokenobj.access_token; | |||
string jsondata = "{\"touser\":\"" + userinfo.OpenIdForWeixin + "\"," + | |||
"\"template_id\":\"" + weixintasktempid + "\"," + | |||
"\"url\":\"" + weixintaskurl + "\"," + | |||
"\"data\":{" + | |||
"\"first\": {\"value\":\"您有新的未读通知公告\",\"color\":\"#173177\"}," + | |||
"\"keyword1\":{\"value\":\"未读通知公告\",\"color\":\"#173177\"}," + | |||
"\"keyword2\": {\"value\":\"" + title + "\",\"color\":\"#173177\"}," + | |||
"\"keyword3\": {\"value\":\"待查看\",\"color\":\"#173177\"}," + | |||
"\"keyword4\": {\"value\":\"您有新的未读通知公告【" + title + "】\",\"color\":\"#173177\"}" + | |||
"}" + | |||
"}"; | |||
string pushresult = Util.HttpMethods.HttpPost("https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + access_token, jsondata); | |||
operateLogModel.title = title; | |||
operateLogModel.type = OperationType.Other; | |||
operateLogModel.url = "NoticeController"; | |||
operateLogModel.sourceObjectId = "002"; | |||
operateLogModel.sourceContentJson = pushresult; | |||
OperatorHelper.Instance.WriteOperateLog(operateLogModel); | |||
} | |||
} | |||
} | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 消息提醒 | |||
/// </summary> | |||
/// <param name="needpostuserlist"></param> | |||
/// <param name="title"></param> | |||
public void PushMessageRemind(List<UserEntity> needpostuserlist, NewsEntity model) | |||
{ | |||
foreach (UserEntity userinfo in needpostuserlist) | |||
{ | |||
MessageRemindEntity entity = new MessageRemindEntity(); | |||
entity.ReceiptId = userinfo.F_UserId; | |||
entity.ReceiptName = userinfo.F_RealName; | |||
entity.SenderId = model.F_CreateUserId; | |||
entity.SenderName = model.F_CreateUserName; | |||
entity.TheTitle = "通知公告"; | |||
entity.TheContent = model.F_FullHead; | |||
entity.InstanceId = model.F_NewsId; | |||
entity.ConnectionUrl = "/Utility/ListContentIndex?id="; | |||
entity.SendTime = DateTime.Now; | |||
entity.ReadSigns = false; | |||
messageRindIBLL.SaveEntity("", entity); | |||
} | |||
} | |||
} | |||
} |