@@ -160,20 +160,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
public ActionResult DepartmentForm(string keyValue, string strEntity) | public ActionResult DepartmentForm(string keyValue, string strEntity) | ||||
{ | { | ||||
SafetyCheckEntity entity = strEntity.ToObject<SafetyCheckEntity>(); | SafetyCheckEntity entity = strEntity.ToObject<SafetyCheckEntity>(); | ||||
if (entity.Status == 1) | |||||
{ | |||||
entity.Status = 2; | |||||
} | |||||
else if (entity.Status == 2) | |||||
{ | |||||
entity.Status = 3; | |||||
} | |||||
else | |||||
{ | |||||
entity.Status = 0; | |||||
} | |||||
safetyCheckIBLL.SaveEntity(keyValue, entity); | |||||
safetyCheckIBLL.CheckEntity(keyValue, entity); | |||||
return Success("操作成功!"); | return Success("操作成功!"); | ||||
} | } | ||||
} | } | ||||
} | } |
@@ -3,38 +3,40 @@ | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | Layout = "~/Views/Shared/_Form.cshtml"; | ||||
} | } | ||||
<div class="lr-form-wrap" id="form"> | <div class="lr-form-wrap" id="form"> | ||||
<div class="col-xs-6 lr-form-item" data-table="SafetyCheck"> | |||||
<div class="lr-form-item-title">网络格员</div> | |||||
<input id="Name" type="text" readonly class="form-control currentInfo lr-currentInfo-user" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="SafetyCheck"> | |||||
<div class="lr-form-item-title">处室部门</div> | |||||
<input id="Department" type="text" readonly class="form-control currentInfo lr-currentInfo-department" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="SafetyCheck"> | |||||
<div class="lr-form-item-title">责任区域<font face="宋体">*</font></div> | |||||
<input id="Area" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" readonly="readonly" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="SafetyCheck"> | |||||
<div class="lr-form-item-title">排查时间<font face="宋体">*</font></div> | |||||
<input id="CheckTime" type="text" class="form-control lr-input-wdatepicker" readonly="readonly" isvalid="yes" checkexpession="NotNull" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="SafetyCheck"> | |||||
<div class="lr-form-item-title">发现的隐患<font face="宋体">*</font></div> | |||||
<textarea id="Question" class="form-control" style="height:100px;" isvalid="yes" readonly="readonly" checkexpession="NotNull"></textarea> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="SafetyCheck"> | |||||
<div class="lr-form-item-title">整改措施及建议</div> | |||||
<textarea id="idea" class="form-control" style="height:100px;" readonly="readonly"></textarea> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="SafetyCheck"> | |||||
<div class="lr-form-item-title">附件上传</div> | |||||
<div id="Path"></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="SafetyCheck"> | |||||
<div class="lr-form-item-title">备注</div> | |||||
<textarea id="Remark" class="form-control" style="height:100px;" readonly="readonly"></textarea> | |||||
</div> | |||||
@*<div id="=allparameter"> | |||||
<div class="col-xs-6 lr-form-item" data-table="SafetyCheck"> | |||||
<div class="lr-form-item-title">网络格员</div> | |||||
<input id="Name" type="text" readonly class="form-control currentInfo lr-currentInfo-user" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="SafetyCheck"> | |||||
<div class="lr-form-item-title">处室部门</div> | |||||
<input id="Department" type="text" readonly class="form-control currentInfo lr-currentInfo-department" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="SafetyCheck"> | |||||
<div class="lr-form-item-title">责任区域<font face="宋体">*</font></div> | |||||
<input id="Area" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" readonly="readonly" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="SafetyCheck"> | |||||
<div class="lr-form-item-title">排查时间<font face="宋体">*</font></div> | |||||
<input id="CheckTime" type="text" class="form-control lr-input-wdatepicker" readonly="readonly" isvalid="yes" checkexpession="NotNull" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="SafetyCheck"> | |||||
<div class="lr-form-item-title">发现的隐患<font face="宋体">*</font></div> | |||||
<textarea id="Question" class="form-control" style="height:100px;" isvalid="yes" readonly="readonly" checkexpession="NotNull"></textarea> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="SafetyCheck"> | |||||
<div class="lr-form-item-title">整改措施及建议</div> | |||||
<textarea id="idea" class="form-control" style="height:100px;" readonly="readonly"></textarea> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="SafetyCheck"> | |||||
<div class="lr-form-item-title">附件上传</div> | |||||
<div id="Path"></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="SafetyCheck"> | |||||
<div class="lr-form-item-title">备注</div> | |||||
<textarea id="Remark" class="form-control" style="height:100px;" readonly="readonly"></textarea> | |||||
</div> | |||||
</div>*@ | |||||
<div class="col-xs-12 lr-form-item" data-table="SafetyCheck"> | <div class="col-xs-12 lr-form-item" data-table="SafetyCheck"> | ||||
<div class="lr-form-item-title">继续上报<font face="宋体">*</font></div> | <div class="lr-form-item-title">继续上报<font face="宋体">*</font></div> | ||||
<div id="Status" isvalid="yes" checkexpession="NotNull" ></div> | <div id="Status" isvalid="yes" checkexpession="NotNull" ></div> | ||||
@@ -15,16 +15,16 @@ var bootstrap = function ($, learun) { | |||||
page.initData(); | page.initData(); | ||||
}, | }, | ||||
bind: function () { | bind: function () { | ||||
$('#Name')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; | |||||
$('#Name').val(learun.clientdata.get(['userinfo']).realName); | |||||
$('#Department')[0].lrvalue = learun.clientdata.get(['userinfo']).departmentId; | |||||
learun.clientdata.getAsync('department', { | |||||
key: learun.clientdata.get(['userinfo']).departmentId, | |||||
callback: function (_data) { | |||||
$('#名称').val(_data.name); | |||||
} | |||||
}); | |||||
$('#Path').lrUploader({ isUpload: false }); | |||||
//$('#Name')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; | |||||
//$('#Name').val(learun.clientdata.get(['userinfo']).realName); | |||||
//$('#Department')[0].lrvalue = learun.clientdata.get(['userinfo']).departmentId; | |||||
//learun.clientdata.getAsync('department', { | |||||
// key: learun.clientdata.get(['userinfo']).departmentId, | |||||
// callback: function (_data) { | |||||
// $('#名称').val(_data.name); | |||||
// } | |||||
//}); | |||||
//$('#Path').lrUploader({ isUpload: false }); | |||||
$("#Status").lrselect({ | $("#Status").lrselect({ | ||||
data: [{ text: "继续上报", value: "1" }, { text: "退回", value: "0" }], | data: [{ text: "继续上报", value: "1" }, { text: "退回", value: "0" }], | ||||
text: "text", | text: "text", | ||||
@@ -32,18 +32,18 @@ var bootstrap = function ($, learun) { | |||||
}) | }) | ||||
}, | }, | ||||
initData: function () { | initData: function () { | ||||
if (!!keyValue) { | |||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/SafetyCheck/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]); | |||||
} | |||||
} | |||||
}); | |||||
} | |||||
//if (!!keyValue) { | |||||
// $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/SafetyCheck/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]); | |||||
// } | |||||
// } | |||||
// }); | |||||
//} | |||||
} | } | ||||
}; | }; | ||||
// 保存数据 | // 保存数据 | ||||
@@ -3,7 +3,7 @@ | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | Layout = "~/Views/Shared/_Form.cshtml"; | ||||
} | } | ||||
<div class="lr-form-wrap" id="form"> | <div class="lr-form-wrap" id="form"> | ||||
<div class="col-xs-6 lr-form-item" data-table="SafetyCheck"> | |||||
@*<div class="col-xs-6 lr-form-item" data-table="SafetyCheck"> | |||||
<div class="lr-form-item-title">网络格员</div> | <div class="lr-form-item-title">网络格员</div> | ||||
<input id="Name" type="text" readonly class="form-control currentInfo lr-currentInfo-user" /> | <input id="Name" type="text" readonly class="form-control currentInfo lr-currentInfo-user" /> | ||||
</div> | </div> | ||||
@@ -34,7 +34,7 @@ | |||||
<div class="col-xs-12 lr-form-item" data-table="SafetyCheck"> | <div class="col-xs-12 lr-form-item" data-table="SafetyCheck"> | ||||
<div class="lr-form-item-title">备注</div> | <div class="lr-form-item-title">备注</div> | ||||
<textarea id="Remark" class="form-control" style="height:100px;" readonly="readonly"></textarea> | <textarea id="Remark" class="form-control" style="height:100px;" readonly="readonly"></textarea> | ||||
</div> | |||||
</div>*@ | |||||
<div class="col-xs-12 lr-form-item" data-table="SafetyCheck"> | <div class="col-xs-12 lr-form-item" data-table="SafetyCheck"> | ||||
<div class="lr-form-item-title">审验提醒</div> | <div class="lr-form-item-title">审验提醒</div> | ||||
<textarea id="DepartmentRemark" class="form-control" style="height:100px;"></textarea> | <textarea id="DepartmentRemark" class="form-control" style="height:100px;"></textarea> | ||||
@@ -15,16 +15,16 @@ var bootstrap = function ($, learun) { | |||||
page.initData(); | page.initData(); | ||||
}, | }, | ||||
bind: function () { | bind: function () { | ||||
$('#Name')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; | |||||
$('#Name').val(learun.clientdata.get(['userinfo']).realName); | |||||
$('#Department')[0].lrvalue = learun.clientdata.get(['userinfo']).departmentId; | |||||
learun.clientdata.getAsync('department', { | |||||
key: learun.clientdata.get(['userinfo']).departmentId, | |||||
callback: function (_data) { | |||||
$('#名称').val(_data.name); | |||||
} | |||||
}); | |||||
$('#Path').lrUploader({ isUpload: false }); | |||||
//$('#Name')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; | |||||
//$('#Name').val(learun.clientdata.get(['userinfo']).realName); | |||||
//$('#Department')[0].lrvalue = learun.clientdata.get(['userinfo']).departmentId; | |||||
//learun.clientdata.getAsync('department', { | |||||
// key: learun.clientdata.get(['userinfo']).departmentId, | |||||
// callback: function (_data) { | |||||
// $('#名称').val(_data.name); | |||||
// } | |||||
//}); | |||||
//$('#Path').lrUploader({ isUpload: false }); | |||||
$("#Status").lrselect({ | $("#Status").lrselect({ | ||||
data: [{ text: "继续上报", value: "2" }, { text: "退回", value: "0" }], | data: [{ text: "继续上报", value: "2" }, { text: "退回", value: "0" }], | ||||
text: "text", | text: "text", | ||||
@@ -32,18 +32,18 @@ var bootstrap = function ($, learun) { | |||||
}) | }) | ||||
}, | }, | ||||
initData: function () { | initData: function () { | ||||
if (!!keyValue) { | |||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/SafetyCheck/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]); | |||||
} | |||||
} | |||||
}); | |||||
} | |||||
//if (!!keyValue) { | |||||
// $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/SafetyCheck/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]); | |||||
// } | |||||
// } | |||||
// }); | |||||
//} | |||||
} | } | ||||
}; | }; | ||||
// 保存数据 | // 保存数据 | ||||
@@ -66,19 +66,23 @@ var bootstrap = function ($, learun) { | |||||
}); | }); | ||||
// 编辑 | // 编辑 | ||||
$('#lr_edit').on('click', function () { | $('#lr_edit').on('click', function () { | ||||
var CreateUser = $('#gridtable').jfGridValue('CreateUser'); | |||||
var user = learun.clientdata.get(['userinfo']).userId; | |||||
if (CreateUser != user) { | |||||
learun.alert.warning("当前项暂不可编辑!"); | |||||
return; | |||||
} | |||||
var Status = $('#gridtable').jfGridValue('Status'); | |||||
if (Status != 0) { | |||||
learun.alert.warning("当前项目已提交不能不能编辑!"); | |||||
return; | |||||
} | |||||
var keyValue = $('#gridtable').jfGridValue('ID'); | var keyValue = $('#gridtable').jfGridValue('ID'); | ||||
if (learun.checkrow(keyValue)) { | if (learun.checkrow(keyValue)) { | ||||
if (keyValue.indexOf(',') != -1) { | |||||
learun.alert.warning("只能选择一条记录进行编辑!"); | |||||
return; | |||||
} | |||||
var CreateUser = $('#gridtable').jfGridValue('CreateUser'); | |||||
var user = learun.clientdata.get(['userinfo']).userId; | |||||
if (CreateUser != user) { | |||||
learun.alert.warning("当前项暂不可编辑!"); | |||||
return; | |||||
} | |||||
var Status = $('#gridtable').jfGridValue('Status'); | |||||
if (Status != 0) { | |||||
learun.alert.warning("当前项目已提交!不能编辑!"); | |||||
return; | |||||
} | |||||
learun.layerForm({ | learun.layerForm({ | ||||
id: 'form', | id: 'form', | ||||
title: '编辑', | title: '编辑', | ||||
@@ -93,20 +97,21 @@ var bootstrap = function ($, learun) { | |||||
}); | }); | ||||
// 删除 | // 删除 | ||||
$('#lr_delete').on('click', function () { | $('#lr_delete').on('click', function () { | ||||
var CreateUser = $('#gridtable').jfGridValue('CreateUser'); | |||||
var user = learun.clientdata.get(['userinfo']).userId; | |||||
if (CreateUser != user) { | |||||
learun.alert.warning("当前项暂不可删除!"); | |||||
return; | |||||
} | |||||
var Status = $('#gridtable').jfGridValue('Status'); | |||||
if (Status != 0) { | |||||
learun.alert.warning("当前项目已提交不能不能删除!"); | |||||
return; | |||||
} | |||||
var keyValue = $('#gridtable').jfGridValue('ID'); | var keyValue = $('#gridtable').jfGridValue('ID'); | ||||
if (learun.checkrow(keyValue)) { | if (learun.checkrow(keyValue)) { | ||||
var CheckMark = $('#gridtable').jfGridValue('Status'); | |||||
var CheckMarkArr = CheckMark.split(','); | |||||
if ($.inArray('1', CheckMarkArr) != -1 || $.inArray('2', CheckMarkArr) != -1 || $.inArray('3', CheckMarkArr) != -1) { | |||||
learun.alert.warning("选中记录中包含已提交项目!不可删除"); | |||||
return; | |||||
} | |||||
var CreateUser = $('#gridtable').jfGridValue('CreateUser'); | |||||
var user = learun.clientdata.get(['userinfo']).userId; | |||||
var CreateUserArr = CreateUser.split(','); | |||||
if (!CreateUserArr.every(item => item == user)) { | |||||
learun.alert.warning("选中项包含其他所属用户!暂不可删除!"); | |||||
return; | |||||
} | |||||
learun.layerConfirm('是否确认删除该项!', function (res) { | learun.layerConfirm('是否确认删除该项!', function (res) { | ||||
if (res) { | if (res) { | ||||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/SafetyCheck/DeleteForm', { keyValue: keyValue }, function () { | learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/SafetyCheck/DeleteForm', { keyValue: keyValue }, function () { | ||||
@@ -122,16 +127,21 @@ var bootstrap = function ($, learun) { | |||||
}); | }); | ||||
// 提交 | // 提交 | ||||
$('#lr_submit').on('click', function () { | $('#lr_submit').on('click', function () { | ||||
var CreateUser = $('#gridtable').jfGridValue('CreateUser'); | |||||
var user = learun.clientdata.get(['userinfo']).userId; | |||||
if (CreateUser != user) { | |||||
learun.alert.warning("当前项暂不可提交!"); | |||||
return; | |||||
} | |||||
var keyValue = $('#gridtable').jfGridValue('ID'); | var keyValue = $('#gridtable').jfGridValue('ID'); | ||||
if (learun.checkrow(keyValue)) { | if (learun.checkrow(keyValue)) { | ||||
if (keyValue.indexOf(',') != -1) { | |||||
learun.alert.warning("只能选择一条记录!"); | |||||
return; | |||||
} | |||||
var CreateUser = $('#gridtable').jfGridValue('CreateUser'); | |||||
var user = learun.clientdata.get(['userinfo']).userId; | |||||
if (CreateUser != user) { | |||||
learun.alert.warning("当前项暂不可提交!"); | |||||
return; | |||||
} | |||||
var Status = $('#gridtable').jfGridValue('Status'); | var Status = $('#gridtable').jfGridValue('Status'); | ||||
if (Status !== 0) { | |||||
console.log(Status) | |||||
if (Status != 0) { | |||||
learun.alert.warning("当前项目已提交,请耐心等待审批!"); | learun.alert.warning("当前项目已提交,请耐心等待审批!"); | ||||
return; | return; | ||||
} | } | ||||
@@ -147,6 +157,10 @@ var bootstrap = function ($, learun) { | |||||
// 查看 | // 查看 | ||||
$('#lr_view').on('click', function () { | $('#lr_view').on('click', function () { | ||||
var keyValue = $('#gridtable').jfGridValue('ID'); | var keyValue = $('#gridtable').jfGridValue('ID'); | ||||
if (keyValue.indexOf(',') != -1) { | |||||
learun.alert.warning("只能选择一条记录!"); | |||||
return; | |||||
} | |||||
if (learun.checkrow(keyValue)) { | if (learun.checkrow(keyValue)) { | ||||
learun.layerForm({ | learun.layerForm({ | ||||
id: 'formSafetyCheck', | id: 'formSafetyCheck', | ||||
@@ -162,12 +176,9 @@ var bootstrap = function ($, learun) { | |||||
$('#lr_department').on('click', function () { | $('#lr_department').on('click', function () { | ||||
var keyValue = $('#gridtable').jfGridValue('ID'); | var keyValue = $('#gridtable').jfGridValue('ID'); | ||||
var Status = $('#gridtable').jfGridValue('Status'); | var Status = $('#gridtable').jfGridValue('Status'); | ||||
if (Status != 1) { | |||||
learun.alert.warning("当前项目操作项不允许!"); | |||||
return; | |||||
} | |||||
if (Status == 2) { | |||||
learun.alert.warning("当前项目操作项不允许!"); | |||||
var CheckMarkArr = Status.split(','); | |||||
if (!CheckMarkArr.every(item => item == 1)) { | |||||
learun.alert.warning("选中项当前操作不允许!"); | |||||
return; | return; | ||||
} | } | ||||
if (learun.checkrow(keyValue)) { | if (learun.checkrow(keyValue)) { | ||||
@@ -175,8 +186,8 @@ var bootstrap = function ($, learun) { | |||||
id: 'formformcheck', | id: 'formformcheck', | ||||
title: '部门审查', | title: '部门审查', | ||||
url: top.$.rootUrl + '/EducationalAdministration/SafetyCheck/FormCheck?keyValue=' + keyValue, | url: top.$.rootUrl + '/EducationalAdministration/SafetyCheck/FormCheck?keyValue=' + keyValue, | ||||
width: 600, | |||||
height: 680, | |||||
width: 400, | |||||
height: 300, | |||||
callBack: function (id) { | callBack: function (id) { | ||||
return top[id].acceptClick(refreshGirdData); | return top[id].acceptClick(refreshGirdData); | ||||
} | } | ||||
@@ -186,12 +197,9 @@ var bootstrap = function ($, learun) { | |||||
// 分管领导 | // 分管领导 | ||||
$('#lr_leader').on('click', function () { | $('#lr_leader').on('click', function () { | ||||
var Status = $('#gridtable').jfGridValue('Status'); | var Status = $('#gridtable').jfGridValue('Status'); | ||||
if (Status != 2) { | |||||
learun.alert.warning("当前项目操作项不允许!"); | |||||
return; | |||||
} | |||||
if (Status == 3) { | |||||
learun.alert.warning("当前项目操作项不允许!"); | |||||
var CheckMarkArr = Status.split(','); | |||||
if (!CheckMarkArr.every(item => item == 2)) { | |||||
learun.alert.warning("选中项当前操作不允许!"); | |||||
return; | return; | ||||
} | } | ||||
var keyValue = $('#gridtable').jfGridValue('ID'); | var keyValue = $('#gridtable').jfGridValue('ID'); | ||||
@@ -200,8 +208,8 @@ var bootstrap = function ($, learun) { | |||||
id: 'formformleader', | id: 'formformleader', | ||||
title: '分管领导', | title: '分管领导', | ||||
url: top.$.rootUrl + '/EducationalAdministration/SafetyCheck/FormLeader?keyValue=' + keyValue, | url: top.$.rootUrl + '/EducationalAdministration/SafetyCheck/FormLeader?keyValue=' + keyValue, | ||||
width: 600, | |||||
height: 680, | |||||
width: 400, | |||||
height: 300, | |||||
callBack: function (id) { | callBack: function (id) { | ||||
return top[id].acceptClick(refreshGirdData); | return top[id].acceptClick(refreshGirdData); | ||||
} | } | ||||
@@ -260,6 +268,7 @@ var bootstrap = function ($, learun) { | |||||
], | ], | ||||
mainId: 'ID', | mainId: 'ID', | ||||
isPage: true, | isPage: true, | ||||
isMultiselect: true, | |||||
sidx: 'CheckTime desc ', | sidx: 'CheckTime desc ', | ||||
}); | }); | ||||
page.search(); | page.search(); | ||||
@@ -138,6 +138,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
public void CheckEntity(string keyValue, SafetyCheckEntity entity) | |||||
{ | |||||
try | |||||
{ | |||||
safetyCheckService.CheckEntity(keyValue, entity); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
} | } | ||||
@@ -47,6 +47,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// </summary> | /// </summary> | ||||
/// <param name="keyValue"></param> | /// <param name="keyValue"></param> | ||||
void SubmitEnity(string keyValue); | void SubmitEnity(string keyValue); | ||||
void CheckEntity(string keyValue, SafetyCheckEntity entity); | |||||
#endregion | #endregion | ||||
} | } | ||||
@@ -158,12 +158,19 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// <param name="keyValue">主键</param> | /// <param name="keyValue">主键</param> | ||||
public void DeleteEntity(string keyValue) | public void DeleteEntity(string keyValue) | ||||
{ | { | ||||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||||
try | try | ||||
{ | { | ||||
this.BaseRepository("CollegeMIS").Delete<SafetyCheckEntity>(t => t.ID == keyValue); | |||||
var id = keyValue.Split(','); | |||||
foreach (var item in id) | |||||
{ | |||||
db.Delete(item); | |||||
} | |||||
db.Commit(); | |||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
{ | { | ||||
db.Rollback(); | |||||
if (ex is ExceptionEx) | if (ex is ExceptionEx) | ||||
{ | { | ||||
throw; | throw; | ||||
@@ -184,9 +191,14 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
if (!string.IsNullOrEmpty(keyValue)) | if (!string.IsNullOrEmpty(keyValue)) | ||||
{ | { | ||||
entity.Modify(keyValue); | |||||
var id = keyValue.Split(','); | |||||
foreach (var item in id) | |||||
{ | |||||
entity.Modify(item); | |||||
} | |||||
this.BaseRepository("CollegeMIS").Update(entity); | this.BaseRepository("CollegeMIS").Update(entity); | ||||
} | } | ||||
else | else | ||||
@@ -214,19 +226,61 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// <param name="status"></param> | /// <param name="status"></param> | ||||
public void SubmitEnity(string keyValue) | public void SubmitEnity(string keyValue) | ||||
{ | { | ||||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||||
try | try | ||||
{ | { | ||||
var entity = BaseRepository("CollegeMIS").FindEntity<SafetyCheckEntity>(keyValue); | |||||
if (entity.Status != null) | |||||
var id = keyValue.Split(','); | |||||
foreach (var item in id) | |||||
{ | { | ||||
var entity = db.FindEntity<SafetyCheckEntity>(item); | |||||
entity.Status = 1; | entity.Status = 1; | ||||
entity.ModifyUser = LoginUserInfo.Get().userId; | entity.ModifyUser = LoginUserInfo.Get().userId; | ||||
entity.Modifytime = DateTime.Now; | entity.Modifytime = DateTime.Now; | ||||
db.Update(entity); | |||||
} | |||||
db.Commit(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
db.Rollback(); | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
public void CheckEntity(string keyValue, SafetyCheckEntity entity) | |||||
{ | |||||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||||
try | |||||
{ | |||||
if (entity.Status == 1) | |||||
{ | |||||
entity.Status = 2; | |||||
} | |||||
else if (entity.Status == 2) | |||||
{ | |||||
entity.Status = 3; | |||||
} | |||||
var id = keyValue.Split(','); | |||||
foreach (var item in id) | |||||
{ | |||||
var Newentity = db.FindEntity<SafetyCheckEntity>(item); | |||||
Newentity.Status = entity.Status; | |||||
Newentity.DepartmentRemark = entity.DepartmentRemark; | |||||
Newentity.ModifyUser = LoginUserInfo.Get().userId; | |||||
Newentity.Modifytime = DateTime.Now; | |||||
db.Update(Newentity); | |||||
} | } | ||||
BaseRepository("CollegeMIS").Update(entity); | |||||
db.Commit(); | |||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
{ | { | ||||
db.Rollback(); | |||||
if (ex is ExceptionEx) | if (ex is ExceptionEx) | ||||
{ | { | ||||
throw; | throw; | ||||