@@ -3,6 +3,7 @@ using Learun.Util; | |||
using System.Collections.Generic; | |||
using System.Web.Mvc; | |||
using Learun.Application.Organization; | |||
using Learun.Application.Base.AuthorizeModule; | |||
namespace Learun.Application.Web.Areas.LR_NewWorkFlow.Controllers | |||
{ | |||
@@ -20,6 +21,7 @@ namespace Learun.Application.Web.Areas.LR_NewWorkFlow.Controllers | |||
private NWFSchemeIBLL nWFSchemeIBLL = new NWFSchemeBLL(); | |||
private NWFTaskIBLL nWFTaskIBLL = new NWFTaskBLL(); | |||
private UserIBLL userIbll = new UserBLL(); | |||
private UserRelationIBLL userRelationIBLL = new UserRelationBLL(); | |||
#region 视图功能 | |||
/// <summary> | |||
@@ -187,6 +189,15 @@ namespace Learun.Application.Web.Areas.LR_NewWorkFlow.Controllers | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 添加审核节点 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult AddTaskForm() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 批量审核页面 | |||
/// </summary> | |||
/// <returns></returns> | |||
@@ -476,9 +487,29 @@ namespace Learun.Application.Web.Areas.LR_NewWorkFlow.Controllers | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult SaveDraft(string processId, string schemeCode) | |||
public ActionResult SaveDraft(string processId, string schemeCode, string createUserId) | |||
{ | |||
UserInfo userInfo = LoginUserInfo.Get(); | |||
if (!string.IsNullOrEmpty(createUserId) && userInfo.userId != createUserId) | |||
{ | |||
var userEntity = userIbll.GetEntityByUserId(createUserId); | |||
userInfo.userId = userEntity.F_UserId; | |||
userInfo.enCode = userEntity.F_EnCode; | |||
userInfo.realName = userEntity.F_RealName; | |||
userInfo.nickName = userEntity.F_NickName; | |||
userInfo.headIcon = userEntity.F_HeadIcon; | |||
userInfo.gender = userEntity.F_Gender; | |||
userInfo.mobile = userEntity.F_Mobile; | |||
userInfo.telephone = userEntity.F_Telephone; | |||
userInfo.email = userEntity.F_Email; | |||
userInfo.oICQ = userEntity.F_OICQ; | |||
userInfo.weChat = userEntity.F_WeChat; | |||
userInfo.companyId = userEntity.F_CompanyId; | |||
userInfo.departmentId = userEntity.F_DepartmentId; | |||
userInfo.openId = userEntity.F_OpenId; | |||
userInfo.isSystem = userEntity.F_SecurityLevel == 1 ? true : false; | |||
} | |||
nWFProcessIBLL.SaveDraft(processId, schemeCode, userInfo); | |||
return Success("流程草稿保存成功"); | |||
} | |||
@@ -505,14 +536,51 @@ namespace Learun.Application.Web.Areas.LR_NewWorkFlow.Controllers | |||
/// <param name="title">流程进程自定义标题</param> | |||
/// <param name="level">流程进程等级</param> | |||
/// <param name="auditors">下一节点审核人</param> | |||
/// <param name="createUserId">流程创建人</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult CreateFlow(string schemeCode, string processId, string title, int level, string auditors) | |||
public ActionResult CreateFlow(string schemeCode, string processId, string title, int level, string auditors, string createUserId) | |||
{ | |||
UserInfo userInfo = LoginUserInfo.Get(); | |||
nWFProcessIBLL.CreateFlow(schemeCode, processId, title, level, auditors, userInfo); | |||
return Success("流程创建成功"); | |||
if (!string.IsNullOrEmpty(createUserId) && userInfo.userId != createUserId) | |||
{ | |||
if (title == null) | |||
{ | |||
title = ""; | |||
} | |||
title += "【" + userInfo.realName + "代发】"; | |||
var userEntity = userIbll.GetEntityByUserId(createUserId); | |||
userInfo.userId = userEntity.F_UserId; | |||
userInfo.enCode = userEntity.F_EnCode; | |||
userInfo.realName = userEntity.F_RealName; | |||
userInfo.nickName = userEntity.F_NickName; | |||
userInfo.headIcon = userEntity.F_HeadIcon; | |||
userInfo.gender = userEntity.F_Gender; | |||
userInfo.mobile = userEntity.F_Mobile; | |||
userInfo.telephone = userEntity.F_Telephone; | |||
userInfo.email = userEntity.F_Email; | |||
userInfo.oICQ = userEntity.F_OICQ; | |||
userInfo.weChat = userEntity.F_WeChat; | |||
userInfo.companyId = userEntity.F_CompanyId; | |||
userInfo.departmentId = userEntity.F_DepartmentId; | |||
userInfo.openId = userEntity.F_OpenId; | |||
userInfo.isSystem = userEntity.F_SecurityLevel == 1 ? true : false; | |||
userInfo.roleIds = userRelationIBLL.GetObjectIds(userEntity.F_UserId, 1); | |||
userInfo.postIds = userRelationIBLL.GetObjectIds(userEntity.F_UserId, 2); | |||
} | |||
try | |||
{ | |||
nWFProcessIBLL.CreateFlow(schemeCode, processId, title, level, auditors, userInfo); | |||
return Success("流程创建成功"); | |||
} | |||
catch (System.Exception ex) | |||
{ | |||
nWFProcessIBLL.SaveDraft(processId, schemeCode, userInfo); | |||
return Fail(ex.Message); | |||
} | |||
} | |||
/// <summary> | |||
@@ -541,9 +609,18 @@ namespace Learun.Application.Web.Areas.LR_NewWorkFlow.Controllers | |||
[AjaxOnly] | |||
public ActionResult AgainCreateFlow(string processId) | |||
{ | |||
UserInfo userInfo = LoginUserInfo.Get(); | |||
nWFProcessIBLL.AgainCreateFlow(processId, userInfo); | |||
return Success("流程重新创建成功"); | |||
try | |||
{ | |||
UserInfo userInfo = LoginUserInfo.Get(); | |||
nWFProcessIBLL.AgainCreateFlow(processId, userInfo); | |||
return Success("流程重新创建成功"); | |||
} | |||
catch (System.Exception ex) | |||
{ | |||
return Fail(ex.Message); | |||
} | |||
} | |||
/// <summary> | |||
/// 审批流程 | |||
@@ -726,6 +803,22 @@ namespace Learun.Application.Web.Areas.LR_NewWorkFlow.Controllers | |||
} | |||
} | |||
/// <summary> | |||
/// 添加任务 | |||
/// </summary> | |||
/// <param name="processId"></param> | |||
/// <param name="bNodeId"></param> | |||
/// <param name="eNodeId"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult AddTask(string processId, string bNodeId, string eNodeId) | |||
{ | |||
UserInfo userInfo = LoginUserInfo.Get(); | |||
nWFProcessIBLL.AddTask(processId, bNodeId, eNodeId, userInfo); | |||
return Success("添加成功"); | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,78 @@ | |||
@{ | |||
ViewBag.Title = "任务添加"; | |||
Layout = "~/Views/Shared/_WorkFlowNewForm.cshtml"; | |||
} | |||
<style> | |||
.lr-timeline { | |||
padding: 0; | |||
} | |||
.lr-item { | |||
position: relative; | |||
float: left; | |||
padding-top: 8px; | |||
padding-left:5px; | |||
line-height:28px; | |||
} | |||
.lr-item .btn | |||
{ | |||
position: relative; | |||
display: inline-block; | |||
height: 28px; | |||
margin-bottom: 1px; | |||
line-height: 14px; | |||
} | |||
.lr-item .lr-select { | |||
width:200px; | |||
} | |||
.lr-item .lr-field-error-info { | |||
top:9px; | |||
height:26px; | |||
} | |||
</style> | |||
<div style="position:relative;width:100%;height:100%;padding-top:40px;"> | |||
<div style="position:absolute;top:0;left:0;height:40px;width:100%;border-bottom:1px solid #ccc;" id="form1" > | |||
<div class="lr-item"> | |||
开始节点 | |||
</div> | |||
<div class="lr-item"> | |||
<div id="bNodeId" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="lr-item"> | |||
审核节点 | |||
</div> | |||
<div class="lr-item"> | |||
<div id="eNodeId" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
</div> | |||
<div class="lr-rblock"> | |||
<div class="lr-form-tabs" id="lr_form_tabs"> | |||
<ul class="nav nav-tabs"> | |||
<li class="active"><a data-value="workflowshcemeinfo">流程信息</a></li> | |||
<li><a data-value="auditinfo">流转记录</a></li> | |||
</ul> | |||
</div> | |||
<div class="tab-content" id="tab_content" style="position:relative;width:100%;height:100%;"> | |||
<div id="auditinfo" class="tab-pane " style="position:relative;padding:5px;width:100%;height:100%;"> | |||
<div style="position:relative;width:100%;height:100%;border:1px solid #ccc;" id="wf_timeline"> | |||
</div> | |||
</div> | |||
<div id="workflowshcemeinfo" class="tab-pane active" style="position:relative;padding:5px;width:100%;height:100%;"> | |||
<div style="position:relative;width:100%;height:100%;border:1px solid #ccc;padding-bottom:40px;"> | |||
<div id="wf_shcemeinfo"></div> | |||
<div style="position:absolute;left:0px;bottom:0;width:100%;height:40px;border-top:1px solid #ddd;line-height:39px;text-align:right;padding-right:10px;font-size:16px;"> | |||
<div style="display: inline-block;margin-left: 10px;"><i style="padding-right:5px;color:#5bc0de;" class="fa fa-square"></i><span>正在处理</span></div> | |||
<div style="display: inline-block;margin-left: 10px;"><i style="padding-right:5px;color:#5cb85c;" class="fa fa-square"></i><span>已处理</span></div> | |||
<div style="display: inline-block;margin-left: 10px;"><i style="padding-right:5px;color:#999;" class="fa fa-square"></i><span>未处理</span></div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/LR_NewWorkFlow/Views/NWFProcess/AddTaskForm.js") |
@@ -0,0 +1,235 @@ | |||
var processId = request('processId'); // 流程实例主键 | |||
var acceptClick; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
console.log('test') | |||
var schemeObj; | |||
var history; | |||
var currentIds; | |||
var page = { | |||
nodeMap: {}, | |||
init: function () { | |||
$('#lr_form_tabs').lrFormTab(); | |||
$('#wf_shcemeinfo').lrworkflow({ | |||
isPreview: true, | |||
openNode: function (node) { | |||
top.wflookNode = node; | |||
if (node.history) { | |||
learun.layerForm({ | |||
id: 'LookNodeForm', | |||
title: '审批记录查看【' + node.name + '】', | |||
url: top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/LookNodeForm', | |||
width: 600, | |||
height: 400, | |||
btn: null | |||
}); | |||
} | |||
} | |||
}); | |||
$('#bNodeId').lrselect({ | |||
title: 'name', | |||
text: 'name', | |||
value: 'id', | |||
allowSearch: true | |||
}); | |||
$('#eNodeId').lrselect({ | |||
title: 'name', | |||
text: 'name', | |||
value: 'id', | |||
allowSearch: true | |||
}); | |||
learun.httpAsync('GET', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/GetProcessDetails', { processId: processId }, function (data) { | |||
console.log(data) | |||
if (data) { | |||
console.log(data) | |||
var info = data.info; | |||
page.taskInfo = data.task; | |||
schemeObj = JSON.parse(info.Scheme); | |||
history = info.TaskLogList; | |||
currentIds = info.CurrentNodeIds; | |||
page.loadFlowInfo(); | |||
page.loadTimeLine(); | |||
$('#bNodeId').lrselectRefresh({ data: schemeObj.nodes }) | |||
$('#eNodeId').lrselectRefresh({ data: schemeObj.nodes }) | |||
} | |||
}); | |||
} | |||
,loadFlowInfo: function () { | |||
learun.clientdata.getAllAsync('department', { | |||
callback: function (departmentMap) { | |||
learun.clientdata.getAllAsync('user', { | |||
callback: function (userMap) { | |||
var nodeInfoes = {}; | |||
// 当前节点处理人信息 | |||
$.each(page.taskInfo, function (_index, _item) { | |||
var nameList = []; | |||
$.each(_item.nWFUserInfoList, function (_jindex, _jitem) { | |||
if (userMap[_jitem.Id]) { | |||
var name = userMap[_jitem.Id].name; | |||
var _department = departmentMap[userMap[_jitem.Id].departmentId]; | |||
if (_department) { | |||
name = '【' + _department.name + '】' + name; | |||
} | |||
nameList.push(name); | |||
} | |||
}); | |||
var point = { | |||
namelist: String(nameList) | |||
} | |||
nodeInfoes[_item.F_NodeId] = nodeInfoes[_item.F_NodeId] || []; | |||
nodeInfoes[_item.F_NodeId].push(point); | |||
}); | |||
// 初始化工作流节点历史处理信息 | |||
$.each(history, function (id, item) { | |||
nodeInfoes[item.F_NodeId] = nodeInfoes[item.F_NodeId] || []; | |||
nodeInfoes[item.F_NodeId].push(item); | |||
}); | |||
var strcurrentIds = String(currentIds); | |||
$.each(schemeObj.nodes, function (_index, _item) {//0正在处理 1 已处理同意 2 已处理不同意 3 未处理 | |||
_item.state = '3'; | |||
if (nodeInfoes[_item.id]) { | |||
_item.history = nodeInfoes[_item.id]; | |||
_item.state = '1'; | |||
} | |||
if (strcurrentIds.indexOf(_item.id) > -1) { | |||
_item.state = '0'; | |||
} | |||
if (_item.isAllAuditor == "2") { | |||
_item.name += '<br/>【多人审核:'; | |||
if (_item.auditorType == "1") { | |||
_item.name += '并行】'; | |||
} | |||
else { | |||
_item.name += '串行】'; | |||
} | |||
} | |||
page.nodeMap[_item.id] = _item; | |||
}); | |||
$('#wf_shcemeinfo').lrworkflowSet('set', { data: schemeObj }); | |||
} | |||
}); | |||
} | |||
}); | |||
}, | |||
loadTimeLine: function () { | |||
var nodelist = []; | |||
learun.clientdata.getAllAsync('department', { | |||
callback: function (departmentMap) { | |||
learun.clientdata.getAllAsync('user', { | |||
callback: function (userMap) { | |||
for (var i = 0, l = history.length; i < l; i++) { | |||
var item = history[i]; | |||
var name = (item.F_CreateUserName || '系统处理') + ':'; | |||
if (item.F_CreateUserId && userMap[item.F_CreateUserId]) { | |||
var _department = departmentMap[userMap[item.F_CreateUserId].departmentId]; | |||
if (_department) { | |||
name = '【' + _department.name + '】' + name; | |||
} | |||
} | |||
//F_TaskType //0创建1审批2传阅3加签审核4子流程5重新创建6.超时流转7会签审核8加签9催办10超时提醒 | |||
var content = item.F_OperationName; | |||
if (item.F_Des) { | |||
content += '【审批意见】' + item.F_Des; | |||
} | |||
var nodeName = ''; | |||
if (item.F_NodeId && page.nodeMap[item.F_NodeId]) { | |||
nodeName = page.nodeMap[item.F_NodeId].name; | |||
} | |||
var point = { | |||
title: item.F_NodeName || nodeName, | |||
people: name, | |||
content: content, | |||
time: item.F_CreateDate | |||
}; | |||
if (item.F_TaskType == 0 || item.F_TaskType == 1 || item.F_TaskType == 3 || item.F_TaskType == 5 || item.F_TaskType == 6 || item.F_TaskType == 8) { | |||
// 查看表单 | |||
point.content = content + ' <span class="lr-event" >查看表单</span>'; | |||
point.nodeId = item.F_NodeId; | |||
point.processId = item.F_ProcessId; | |||
point.callback = function (data) { | |||
top['lrwfschemeObj'] = schemeObj; | |||
learun.layerForm({ | |||
id: 'MonitorForm', | |||
title: '表单查看-' + data.title, | |||
url: top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/MonitorForm?nodeId=' + data.nodeId + '&processId=' + data.processId, | |||
width: 800, | |||
height: 700, | |||
maxmin: true, | |||
btn: null | |||
}); | |||
} | |||
} | |||
else if (item.F_OperationCode == 'createChild' || item.F_OperationCode == 'againCreateChild') { | |||
point.content = content + ' <span class="lr-event" >查看子流程</span>'; | |||
point.nodeId = item.F_NodeId; | |||
point.processId = item.F_ProcessId; | |||
point.callback = function (data) { | |||
learun.layerForm({ | |||
id: 'MonitorDetailsIndex', | |||
title: '子流程查看', | |||
url: top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/MonitorDetailsIndex?processId=' + data.processId + "&nodeId=" + data.nodeId, | |||
width: 1000, | |||
height: 900, | |||
maxmin: true, | |||
btn: null | |||
}); | |||
} | |||
} | |||
nodelist.push(point); | |||
} | |||
$('#wf_timeline').lrtimeline(nodelist); | |||
} | |||
}); | |||
} | |||
}); | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('#form1').lrValidform()) { | |||
return false; | |||
} | |||
var formData = $('#form1').lrGetFormData(); | |||
if (formData.bNodeId == formData.eNodeId) { | |||
learun.alert.error("开始和审核节点不能一样!"); | |||
} | |||
formData.processId = processId; | |||
$.lrSaveForm(top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/AddTask', formData, function (res) { | |||
// 保存成功后才回调 | |||
callBack && callBack(); | |||
}); | |||
console.log(formData) | |||
}; | |||
page.init(); | |||
} |
@@ -34,6 +34,7 @@ | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_eye" class="btn btn-default"><i class="fa fa-eye"></i> <span class="lrlg">查看</span></a> | |||
<a id="lr_appoint" class="btn btn-default"><i class="fa fa-magic"></i> <span class="lrlg">指派审核人</span></a> | |||
<a id="lr_add" class="btn btn-default"><i class="fa fa-magic"></i> <span class="lrlg">添加审核节点</span></a> | |||
<a id="lr_cancel" class="btn btn-default"><i class="fa fa-trash-o"></i> <span class="lrlg">作废</span></a> | |||
</div> | |||
</div> | |||
@@ -91,6 +91,24 @@ var bootstrap = function ($, learun) { | |||
}); | |||
} | |||
}); | |||
// 添加审核节点 | |||
$('#lr_add').on('click', function () { | |||
var processId = $('#gridtable').jfGridValue('F_Id') || ''; | |||
if (learun.checkrow(processId)) { | |||
learun.layerForm({ | |||
id: 'AppointForm', | |||
title: '添加审核节点', | |||
url: top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/AddTaskForm?processId=' + processId, | |||
height: 500, | |||
width: 800, | |||
callBack: function (id) { | |||
return top[id].acceptClick(function () { | |||
$('#gridtable').jfGridSet('reload'); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
}, | |||
initleft: function () { | |||
$('#lr_left_list li').on('click', function () { | |||
@@ -7,38 +7,85 @@ | |||
} | |||
@Html.AppendCssFile("/Areas/LR_NewWorkFlow/Views/NWFProcess/NWFContainerForm.css") | |||
<div class="lr-layout-panel"> | |||
<div class="lr-layout-panel-btn" style="display:none;"> | |||
<a id="eye" class="btn btn-warning">查看父流程</a> | |||
<a id="print" class="btn btn-primary">打印表单</a> | |||
<a id="confirm" class="btn btn-info">确认阅读</a> | |||
<a id="sign" class="btn btn-info">加签</a> | |||
<a id="savedraft" class="btn btn-default">保存草稿</a> | |||
<a id="release" class="btn btn-success">提交流程</a> | |||
@*<div class="lr-layout-panel-btn" style="display:none;"> | |||
<a id="eye" class="btn btn-warning">查看父流程</a> | |||
<a id="print" class="btn btn-primary">打印表单</a> | |||
<a id="confirm" class="btn btn-info">确认阅读</a> | |||
<a id="sign" class="btn btn-info">加签</a> | |||
<a id="savedraft" class="btn btn-default">保存草稿</a> | |||
<a id="release" class="btn btn-success">提交流程</a> | |||
</div> | |||
<ul class="nav nav-tabs lr-nav-tabs" id="tablist"> | |||
<li class="active"><a data-value="forminfo">表单信息</a></li> | |||
<li><a data-value="workflowshcemeinfo">流程信息</a></li> | |||
<li><a data-value="auditinfo">流转记录</a></li> | |||
</ul> | |||
<!-- Tab panes --> | |||
<div class="tab-content" id="tab_content"> | |||
<div class="tab-pane active" id="forminfo" style="padding-bottom:40px;"> | |||
<div class="form-list" id="form_list_iframes"> | |||
</div>*@ | |||
<div class="lr-rblock" style="padding-top:40px;"> | |||
<div class="flow-btn" style="position:absolute;top:4px;right:5px;"> | |||
<a id="print" class="btn btn-primary">打印表单</a> | |||
<a id="eye" class="btn btn-default">查看父流程</a> | |||
</div> | |||
<ul class="nav nav-tabs lr-nav-tabs" id="tablist"> | |||
<li class="active"><a data-value="forminfo">表单信息</a></li> | |||
<li><a data-value="workflowshcemeinfo">流程信息</a></li> | |||
<li><a data-value="auditinfo">流转记录</a></li> | |||
</ul> | |||
<!-- Tab panes --> | |||
<div class="tab-content" id="tab_content"> | |||
<div class="tab-pane active" id="forminfo" style="padding-bottom:40px;"> | |||
<div class="form-list" id="form_list_iframes"> | |||
</div> | |||
<div class="form-list-tabs" id="form_list_tabs_warp"> | |||
<ul class="nav nav-tabs" id="form_list_tabs"></ul> | |||
</div> | |||
</div> | |||
<div class="form-list-tabs" id="form_list_tabs_warp"> | |||
<ul class="nav nav-tabs" id="form_list_tabs"></ul> | |||
<div class="tab-pane" id="workflowshcemeinfo" style="padding-bottom:40px;"> | |||
<div id="flow"></div> | |||
<div style="position:absolute;left:0px;bottom:0;width:100%;height:40px;border-top:1px solid #ddd;line-height:39px;text-align:right;padding-right:10px;font-size:16px;"> | |||
<div style="display: inline-block;margin-left: 10px;"><i style="padding-right:5px;color:#5bc0de;" class="fa fa-square"></i><span>正在处理</span></div> | |||
<div style="display: inline-block;margin-left: 10px;"><i style="padding-right:5px;color:#5cb85c;" class="fa fa-square"></i><span>已处理</span></div> | |||
<div style="display: inline-block;margin-left: 10px;"><i style="padding-right:5px;color:#999;" class="fa fa-square"></i><span>未处理</span></div> | |||
</div> | |||
</div> | |||
<div class="tab-pane" id="auditinfo" style="overflow-y: auto;"></div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-panel-right" style="padding-top:40px;"> | |||
<div style="position:absolute;height:40px;border-bottom: 1px solid #eee;width:100%;top:0;left:0;font-weight:bold;color:#666;line-height:39px;padding-left:10px;"> | |||
审批信息 | |||
</div> | |||
<div class="tab-pane" id="workflowshcemeinfo" style="padding-bottom:40px;"> | |||
<div id="flow"></div> | |||
<div style="position:absolute;left:0px;bottom:0;width:100%;height:40px;border-top:1px solid #ddd;line-height:39px;text-align:right;padding-right:10px;font-size:16px;"> | |||
<div style="display: inline-block;margin-left: 10px;"><i style="padding-right:5px;color:#5bc0de;" class="fa fa-square"></i><span>正在处理</span></div> | |||
<div style="display: inline-block;margin-left: 10px;"><i style="padding-right:5px;color:#5cb85c;" class="fa fa-square"></i><span>已处理</span></div> | |||
<div style="display: inline-block;margin-left: 10px;"><i style="padding-right:5px;color:#999;" class="fa fa-square"></i><span>未处理</span></div> | |||
<div class="lr-rblock" style="overflow:auto;padding:10px 10px 0 10px;"> | |||
<div class="col-xs-12 lr-form-item flow-item" style="padding:0;" id="flow-title"> | |||
<div class="lr-form-item-title" style="position:relative;width:100%;text-align:left;">流程标题</div> | |||
<input id="F_Title" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item flow-item" style="padding:0;" id="flow-level"> | |||
<div class="lr-form-item-title" style="position:relative;width:100%;text-align:left;">重要等级</div> | |||
<div class="radio lr-radio" type="lr-radio" id="F_Level"> | |||
<label> | |||
<input name="processLevel" type="radio" value="0" checked="checked" /> | |||
普通 | |||
</label> | |||
<label> | |||
<input name="processLevel" type="radio" value="1" /> | |||
重要 | |||
</label> | |||
<label> | |||
<input name="processLevel" type="radio" value="2" /> | |||
紧急 | |||
</label> | |||
</div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item flow-item" style="padding:0;" id="flow-des"> | |||
<div class="lr-form-item-title" style="position:relative;width:100%;text-align:left;">审批意见</div> | |||
<textarea id="des" class="form-control" style="height: 120px;"></textarea> | |||
</div> | |||
<div class="col-xs-12 flow-btn"> | |||
<a id="release" class="btn btn-success">创建流程</a> | |||
<a id="savedraft" class="btn btn-default">保存草稿</a> | |||
<a id="sign" class="btn btn-info">加签</a> | |||
<a id="confirm" class="btn btn-info">确认阅读</a> | |||
</div> | |||
<div class="col-xs-12 tab-flow-audit"> | |||
</div><!-- 审批信息 --> | |||
</div> | |||
<div class="tab-pane" id="auditinfo" style="overflow-y: auto;"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/LR_NewWorkFlow/Views/NWFProcess/NWFContainerForm.js") | |||
@@ -11,17 +11,33 @@ | |||
left: 0; | |||
height: 41px; | |||
padding: 5px; | |||
border-bottom: 1px solid #ccc; | |||
/*border-bottom: 1px solid #ccc;*/ | |||
width: 100%; | |||
text-align: right; | |||
line-height: 26px; | |||
} | |||
.lr-layout-panel-btn .btn { | |||
/*.lr-layout-panel-btn .btn { | |||
display: block; | |||
padding: 4px 6px; | |||
margin-left: 5px; | |||
float: right; | |||
display: none; | |||
}*/ | |||
.flow-btn { | |||
z-index: 2; | |||
display: none; | |||
} | |||
.flow-btn .btn { | |||
padding: 4px 6px; | |||
display: none; | |||
} | |||
.flow-btn.col-xs-12 .btn { | |||
margin-top: 10px; | |||
margin-right: 5px; | |||
} | |||
.lr-form-bg { | |||
@@ -34,15 +50,28 @@ | |||
width: 100%; | |||
border: 1px solid #ccc; | |||
background: #fff; | |||
padding-top: 82px; | |||
/*padding-top: 82px;*/ | |||
padding-right: 400px; | |||
} | |||
.lr-layout-panel-right { | |||
position: absolute; | |||
top: 0; | |||
right: 0; | |||
height: 100%; | |||
border-left: 1px solid #ccc; | |||
width: 400px; | |||
} | |||
.lr-nav-tabs { | |||
position: absolute; | |||
top: 41px; | |||
/*top: 41px;*/ | |||
top: 0; | |||
height: 40px; | |||
width: 100%; | |||
border-bottom: 1px solid #eee; | |||
z-index: 1; | |||
/*border-top: 1px solid #ccc;*/ | |||
} | |||
.nav-tabs.lr-nav-tabs > li > a { | |||
@@ -81,6 +110,7 @@ | |||
height: 100%; | |||
display: none; | |||
} | |||
.form-list-iframe.active, .form-list-container.active { | |||
display: block; | |||
} | |||
@@ -141,3 +171,87 @@ | |||
.lr-workflow-work .lr-workflow-workinner { | |||
background-image: none; | |||
} | |||
.flow-item { | |||
display: none; | |||
} | |||
.lr-layout-panel-notright { | |||
padding-right: 0; | |||
} | |||
.lr-layout-panel-notright .lr-layout-panel-right { | |||
display: none; | |||
} | |||
.tab-flow-audit { | |||
margin-top: 8px; | |||
} | |||
.tab-flow-audit .auditinfo { | |||
position: relative; | |||
width: 100%; | |||
height: 100px; | |||
border: 1px solid #ccc; | |||
padding-left: 120px; | |||
border-top: none; | |||
} | |||
.tab-flow-audit .auditinfo:first-child { | |||
border-top: 1px solid #ccc; | |||
} | |||
.tab-flow-audit .auditinfo-h { | |||
position: absolute; | |||
top: 0; | |||
left: 0; | |||
height: 100%; | |||
width: 120px; | |||
border-right: 1px solid #ccc; | |||
padding: 4px 0 0 4px; | |||
} | |||
.tab-flow-audit .auditinfo-b { | |||
position: relative; | |||
width: 100%; | |||
height: 100%; | |||
padding: 4px; | |||
} | |||
.tab-flow-audit .auditinfo-d, .tab-flow-audit .auditinfo-n { | |||
position: absolute; | |||
bottom: 24px; | |||
right: 0px; | |||
width: 170px; | |||
text-align: left; | |||
} | |||
.tab-flow-audit .auditinfo-d { | |||
bottom: 4px; | |||
} | |||
.auditinfo-s { | |||
position: absolute; | |||
top: 0; | |||
right: 200px; | |||
height: 100px; | |||
} | |||
.auditinfo-s img { | |||
height: 100px; | |||
} | |||
.auditinfo-sg { | |||
position: absolute; | |||
top: 0; | |||
right: 0; | |||
height: 40px; | |||
} | |||
.auditinfo-sg img { | |||
height: 40px; | |||
} |
@@ -0,0 +1,21 @@ | |||
using Learun.Application.Base.SystemModule; | |||
using System.Web.Mvc; | |||
namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers | |||
{ | |||
public class ImgController : MvcControllerBase | |||
{ | |||
private ImgIBLL imgIBLL = new ImgBLL(); | |||
/// <summary> | |||
/// 获取图片 | |||
/// </summary> | |||
/// <param name="parentId"></param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult GetImg(string keyValue) | |||
{ | |||
imgIBLL.GetImg(keyValue); | |||
return Success("获取成功!"); | |||
} | |||
} | |||
} |
@@ -40,11 +40,15 @@ | |||
b.importCSS && (0 < a("link[media=print]").length ? a("link[media=print]").each(function () { | |||
d.write("<link type='text/css' rel='stylesheet' href='" + a(this).attr("href") + "' media='print' />") | |||
}) : a("link").each(function () { | |||
d.write("<link type='text/css' rel='stylesheet' href='" + a(this).attr("href") + "' />") | |||
if (a(this).attr("href") != '/favicon.ico') { | |||
d.write("<link type='text/css' rel='stylesheet' href='" + a(this).attr("href") + "' />") | |||
} | |||
}), d.write("<style>" + a("style").html() + "</style>")); | |||
b.printContainer ? d.write(f.outer()) : f.each(function () { | |||
d.write(a(this).html()) | |||
}); | |||
d.close(); | |||
(b.operaSupport && a.browser.opera ? c : e[0].contentWindow).focus(); | |||
setTimeout(function () { | |||
@@ -52,7 +56,6 @@ | |||
c && c.close() | |||
}, 1E3) | |||
}; | |||
a.fn.outer = function () { | |||
for (var b = this.clone(), c = a(this), b = a(b), d = 0; 100 > d; d++) { | |||
var e = c.parent().prop("nodeName").toLowerCase(), | |||
@@ -80,7 +83,7 @@ | |||
return a(a("<div></div>").html(b)).html() | |||
} | |||
// Learun智慧校园智能图表 | |||
// 力软信息扩展 | |||
a.fn.jqprintTable = function (f) { | |||
b = a.extend({}, a.fn.jqprint.defaults, f); | |||
f = this instanceof jQuery ? this : a(this); | |||
@@ -95,7 +98,7 @@ | |||
width: "0px", | |||
height: "0px", | |||
left: "-600px", | |||
top: "-600px" | |||
top: "-6000px" | |||
}); | |||
e.appendTo("body"); | |||
d = e[0].contentWindow.document | |||
@@ -103,7 +106,7 @@ | |||
d.write("<title></title><style>@page{size: auto;margin: 0mm;}html{background-color: #FFFFFF;margin: 0px;}body{border: solid 1px blue;margin: 10mm 15mm 10mm 15mm;}</style >"); | |||
d.write('<style>'); | |||
d.write('table{margin: 0px;border-collapse: collapse;width: 100%;border-left: 1px solid #ccc;}'); | |||
d.write('table{margin: 30px;border-collapse: collapse;width: 100%;border-left: 1px solid #ccc;}'); | |||
d.write('th{border-top: 1px solid #ccc;border-bottom: 1px solid #ccc;border-right: 1px solid #ccc;padding-top:5px;padding-bottom:5px;text-overflow:ellipsis;word-break:keep-all;overflow:hidden;font-weight:bold;padding-left:5px;padding-right:5px;font-size: 12px;}'); | |||
d.write('td{border-bottom: 1px solid #ccc;border-right: 1px solid #ccc;height:25px;line-height:25px;word-break: break-all;padding-left:5px;padding-right:5px;font-size: 12px;}'); | |||
d.write('</style>'); | |||
@@ -112,7 +115,7 @@ | |||
d.write("<link type='text/css' rel='stylesheet' href='" + a(this).attr("href") + "' media='print' />") | |||
}) : a("link").each(function () { | |||
d.write("<link type='text/css' rel='stylesheet' href='" + a(this).attr("href") + "' />") | |||
}), | |||
}), | |||
d.write("<style>" + a("style").html() + "</style>")); | |||
b.printContainer ? d.write(f.outerTable(b)) : f.each(function () { | |||
d.write(a(this).html()) | |||
@@ -128,15 +131,149 @@ | |||
a.fn.outerTable = function (b) { | |||
var $div = a('<div style="-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;padding:5px;width:100%;position:relative;"></div>'); | |||
if (!!b.title) | |||
{ | |||
$div.html('<div style="text-align:center;font-size: 22px;color: #444;width:100%;">' + b.title+'</div>'); | |||
if (!!b.title) { | |||
$div.html('<div style="text-align:center;font-size: 22px;color: #444;width:100%;">' + b.title + '</div>'); | |||
} | |||
$div.append(a(this).jfGridPrint()); | |||
return a('<div></div>').html($div).html(); | |||
}; | |||
//// 打印表单 | |||
a.jqprintForm = function (data) { | |||
b = a.fn.jqprint.defaults; | |||
if (b.operaSupport && a.browser.opera) { | |||
var c = window.open("", "jqPrint-preview"); | |||
c.document.open(); | |||
var d = c.document | |||
} else { | |||
var e = a("<iframe />"); | |||
b.debug || e.css({ | |||
position: "absolute", | |||
width: "0px", | |||
height: "0px", | |||
left: "-600px", | |||
top: "-600px" | |||
}); | |||
e.appendTo("body"); | |||
d = e[0].contentWindow.document | |||
} | |||
d.write("<title></title><style>@page{size: auto;margin: 0mm;}html{background-color: #FFFFFF;margin: 0px;}body{border: solid 1px blue;margin: 10mm 15mm 10mm 15mm;}</style >"); | |||
d.write("<link type='text/css' rel='stylesheet' href='" + top.$.rootUrl + "/Content/jquery/plugin/jqprint/jqprint.css' />"); | |||
var $table = a('<table></table>'); | |||
var num = 24; | |||
var $tr = a('<tr></tr>'); | |||
$.each(data, function (_index, _item) { | |||
if (_item.type == 'gird' && _item.data.length > 0) { | |||
if (num > 0 && num < 24) { | |||
$table.append($tr); | |||
$tr = a('<tr></tr>'); | |||
num = 24; | |||
} | |||
var _colp = parseInt(24 / _item.gridHead.length); | |||
var _colp_last = 24 - ((_item.gridHead.length - 1) * _colp); | |||
console.log(_colp_last); | |||
$.each(_item.gridHead, function (_i, _h) { | |||
if (_i == _item.gridHead.length - 1) { | |||
$tr.append('<th colspan="' + _colp_last + '">' + _h.label + '</th>'); | |||
} | |||
else { | |||
$tr.append('<th colspan="' + _colp + '">' + _h.label + '</th>'); | |||
} | |||
}); | |||
$table.append($tr); | |||
$.each(_item.data, function (_j, _b) { | |||
$tr = a('<tr></tr>'); | |||
$table.append($tr); | |||
$.each(_item.gridHead, function (_i, _h) { | |||
if (_i == _item.gridHead.length - 1) { | |||
$tr.append('<td colspan="' + _colp_last + '">' + _b[_h.name] + '</td>'); | |||
} | |||
else { | |||
$tr.append('<td colspan="' + _colp + '">' + _b[_h.name] + '</td>'); | |||
} | |||
}); | |||
}); | |||
$tr = a('<tr></tr>'); | |||
} | |||
else if (_item.type == 'input') { | |||
var colspan = _item.col * 2 - 1; | |||
var _text = _item.text; | |||
if (_item.textList) { | |||
_text = String(_item.textList); | |||
} | |||
var $td = a('<td class="input" >' + _text + '</td>'); | |||
$td.attr('colspan', colspan); | |||
$tr.append('<td class="input inputname" >' + _item.name + ':</td>'); | |||
$tr.append($td); | |||
num = num - colspan - 1; | |||
if (num <= 0) { | |||
num = 24; | |||
$table.append($tr); | |||
$tr = a('<tr></tr>'); | |||
} | |||
} | |||
else if (_item.type == 'anodeinfo') { | |||
if (num >= 0 && num < 24) { | |||
$table.append($tr); | |||
$tr = a('<tr></tr>'); | |||
num = 24; | |||
} | |||
$tr.append('<td class="input inputname" >' + _item.title + ':</td>'); | |||
var __$td = a('<td class="anodeinfo" colspan="23" ><div class="anodeinfod" >' + _item.content + '</div></td>'); | |||
var _$div = __$td.find('div'); | |||
_$div.append('<div class="tuser" >' + _item.user + '</div>'); | |||
_$div.append('<div class="tdate" >' + _item.date + '</div>'); | |||
if (_item.signImg) { | |||
_$div.append(_item.signImg); | |||
} | |||
if (_item.stampImg) { | |||
_$div.append(_item.stampImg); | |||
} | |||
$tr.append(__$td); | |||
$table.append($tr); | |||
$tr = a('<tr></tr>'); | |||
} | |||
else { | |||
var _colspan = _item.col * 2; | |||
var _$td = a('<td class="titletd" >' + _item.text + '</td>'); | |||
_$td.attr('colspan', _colspan); | |||
$tr.append(_$td); | |||
num = num - _colspan; | |||
if (num <= 0) { | |||
num = 24; | |||
$table.append($tr); | |||
$tr = a('<tr></tr>'); | |||
} | |||
} | |||
}); | |||
if (num > 0 && num < 24) { | |||
$table.append($tr); | |||
} | |||
d.write(a('<div></div>').html($table).html()); | |||
console.log(d); | |||
d.close(); | |||
(b.operaSupport && a.browser.opera ? c : e[0].contentWindow).focus(); | |||
setTimeout(function () { | |||
(b.operaSupport && a.browser.opera ? c : e[0].contentWindow).print(); | |||
c && c.close() | |||
}, 1E3) | |||
} | |||
a.fn.jqprint.defaults = { | |||
debug: !1, | |||
importCSS: !0, | |||
@@ -419,6 +419,7 @@ | |||
<Compile Include="Areas\LR_SystemModule\Controllers\DbFieldController.cs" /> | |||
<Compile Include="Areas\LR_SystemModule\Controllers\ExcelExportController.cs" /> | |||
<Compile Include="Areas\LR_SystemModule\Controllers\ExcelImportController.cs" /> | |||
<Compile Include="Areas\LR_SystemModule\Controllers\ImgController.cs" /> | |||
<Compile Include="Areas\LR_SystemModule\Controllers\InterfaceController.cs" /> | |||
<Compile Include="Areas\LR_SystemModule\Controllers\LogController.cs" /> | |||
<Compile Include="Areas\LR_SystemModule\Controllers\LogoImgController.cs" /> | |||
@@ -1147,6 +1148,7 @@ | |||
<Content Include="Areas\LR_LGManager\Views\StampApply\FormView.js" /> | |||
<Content Include="Areas\LR_LGManager\Views\StampApply\Form.js" /> | |||
<Content Include="Areas\LR_LGManager\Views\StampApply\Index.js" /> | |||
<Content Include="Areas\LR_NewWorkFlow\Views\NWFProcess\AddTaskForm.js" /> | |||
<Content Include="Areas\LR_NewWorkFlow\Views\NWFProcess\htPrint.css" /> | |||
<Content Include="Areas\LR_NewWorkFlow\Views\NWFProcess\ContractFiling.js" /> | |||
<Content Include="Areas\LR_NewWorkFlow\Views\NWFProcess\MonitorIndexZiChan.js" /> | |||
@@ -6482,6 +6484,7 @@ | |||
<Content Include="Areas\LR_NewWorkFlow\Views\StampInfo\Form.cshtml" /> | |||
<Content Include="Areas\LR_NewWorkFlow\Views\StampInfo\Index.cshtml" /> | |||
<Content Include="Areas\LR_NewWorkFlow\Views\StampInfo\StampDetailIndex.cshtml" /> | |||
<Content Include="Areas\LR_NewWorkFlow\Views\NWFProcess\AddTaskForm.cshtml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | |||
<Content Include="Views\Login\Default-beifen.cshtml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile1.pubxml" /> | |||
@@ -20,30 +20,44 @@ $.fn.lrtimeline = function (nodelist) { | |||
var $wrap = $('<div class="lr-timeline-allwrap"></div>'); | |||
var $ul = $('<ul></ul>'); | |||
// 开始节点 | |||
var $begin = $('<li class="lr-timeline-header"><div>当前</div></li>') | |||
$ul.append($begin); | |||
$.each(nodelist, function (_index, _item) { | |||
// 中间节点 | |||
var $li = $('<li class="lr-timeline-item" ><div class="lr-timeline-wrap" ></div></li>'); | |||
if (_index == 0) { | |||
$li.find('div').addClass('lr-timeline-current'); | |||
} | |||
var $itemwrap = $li.find('.lr-timeline-wrap'); | |||
var $itemcontent = $('<div class="lr-timeline-content"><span class="arrow"></span></div>'); | |||
$itemcontent.append('<div class="lr-timeline-title">' + _item.title + '</div>'); | |||
$itemcontent.append( | |||
'<div class="lr-timeline-body"><span>' + _item.people + '</span>' + _item.content + '</div>'); | |||
$itemwrap.append('<span class="lr-timeline-date">' + _item.time + '</span>'); | |||
$itemwrap.append($itemcontent); | |||
$itemwrap.find(".lr-event").on("click", function () { _item.callback(_item); }); | |||
$ul.append($li); | |||
}); | |||
// 结束节点 | |||
$ul.append('<li class="lr-timeline-ender"><div>开始</div></li>'); | |||
if (nodelist.length > 0) { | |||
// 开始节点 | |||
var $begin = $('<li class="lr-timeline-header"><div>当前</div></li>') | |||
$ul.append($begin); | |||
$.each(nodelist, function (_index, _item) { | |||
// 中间节点 | |||
var $li = $('<li class="lr-timeline-item" ><div class="lr-timeline-wrap" ></div></li>'); | |||
if (_index == 0) { | |||
$li.find('div').addClass('lr-timeline-current'); | |||
} | |||
var $itemwrap = $li.find('.lr-timeline-wrap'); | |||
var $itemcontent = $('<div class="lr-timeline-content"><span class="arrow"></span></div>'); | |||
$itemcontent.append('<div class="lr-timeline-title">' + _item.title + '</div>'); | |||
$itemcontent.append('<div class="lr-timeline-body"><span>' + _item.people + '</span>' + _item.content + '</div>') | |||
$itemwrap.append('<span class="lr-timeline-date">' + _item.time + '</span>'); | |||
$itemwrap.append($itemcontent); | |||
var $event = $itemcontent.find('.lr-event'); | |||
if ($event.length > 0) { | |||
$event[0].lrdata = _item; | |||
$itemcontent.find('.lr-event').on('click', function () { | |||
var data = $(this)[0].lrdata; | |||
data.callback && data.callback(data); | |||
}); | |||
} | |||
$ul.append($li); | |||
}); | |||
// 结束节点 | |||
$ul.append('<li class="lr-timeline-ender"><div>开始</div></li>'); | |||
} | |||
$wrap.html($ul); | |||
$self.html($wrap); | |||
@@ -1192,6 +1192,78 @@ namespace Learun.Application.WorkFlow | |||
} | |||
} | |||
/// <summary> | |||
/// 触发流程绑定的方法 | |||
/// </summary> | |||
/// <param name="line">线条信息</param> | |||
/// <param name="taskId">任务主键</param> | |||
/// <param name="nodeName">节点名称</param> | |||
/// <param name="paramConfig">配置方法</param> | |||
private void _TriggerMethodR(NWFLineInfo line, string taskId, string nodeName, NWFEngineParamConfig paramConfig) | |||
{ | |||
switch (line.operationType) | |||
{ | |||
case "sql": | |||
if (!string.IsNullOrEmpty(line.dbId) && !string.IsNullOrEmpty(line.strSqlR)) | |||
{ | |||
string strSql = line.strSqlR.Replace("{processId}", "@processId"); | |||
// 流程当前执行人 | |||
strSql = strSql.Replace("{userId}", "@userId"); | |||
strSql = strSql.Replace("{userAccount}", "@userAccount"); | |||
strSql = strSql.Replace("{companyId}", "@companyId"); | |||
strSql = strSql.Replace("{departmentId}", "@departmentId"); | |||
strSql = strSql.Replace("{code}", "@code"); | |||
var param = new | |||
{ | |||
processId = paramConfig.ProcessId, | |||
userId = paramConfig.CurrentUser.Id, | |||
userAccount = paramConfig.CurrentUser.Account, | |||
companyId = paramConfig.CurrentUser.CompanyId, | |||
departmentId = paramConfig.CurrentUser.DepartmentId, | |||
code = "RevokeAudit" | |||
}; | |||
databaseLinkIBLL.ExecuteBySql(line.dbId, strSql, param); | |||
} | |||
break; | |||
case "interface": | |||
if (!string.IsNullOrEmpty(line.strInterfaceR)) | |||
{ | |||
var postData = new | |||
{ | |||
processId = paramConfig.ProcessId, | |||
userId = paramConfig.CurrentUser.Id, | |||
userAccount = paramConfig.CurrentUser.Account, | |||
companyId = paramConfig.CurrentUser.CompanyId, | |||
departmentId = paramConfig.CurrentUser.DepartmentId, | |||
code = "RevokeAudit" | |||
}; | |||
HttpMethods.Post(line.strInterfaceR, postData.ToJson()); | |||
} | |||
break; | |||
case "ioc": | |||
if (!string.IsNullOrEmpty(line.iocNameR) && UnityIocHelper.WfInstance.IsResolve<IWorkFlowMethod>(line.iocNameR)) | |||
{ | |||
IWorkFlowMethod iWorkFlowMethod = UnityIocHelper.WfInstance.GetService<IWorkFlowMethod>(line.iocNameR); | |||
WfMethodParameter wfMethodParameter = new WfMethodParameter() | |||
{ | |||
processId = paramConfig.ProcessId, | |||
taskId = taskId, | |||
nodeName = nodeName, | |||
code = "RevokeAudit", | |||
userId = paramConfig.CurrentUser.Id, | |||
userAccount = paramConfig.CurrentUser.Account, | |||
companyId = paramConfig.CurrentUser.CompanyId, | |||
departmentId = paramConfig.CurrentUser.DepartmentId | |||
}; | |||
iWorkFlowMethod.Execute(wfMethodParameter); | |||
} | |||
break; | |||
} | |||
} | |||
/// <summary> | |||
/// 会签节点处理 | |||
/// </summary> | |||
@@ -2847,47 +2919,126 @@ namespace Learun.Application.WorkFlow | |||
var nodeEntity = nWFIEngine.GetNode(taskEntity.F_NodeId); | |||
var taskLogEntity = nWFTaskIBLL.GetLogEntity(taskId, userInfo.userId); | |||
if (string.IsNullOrEmpty(processId)) | |||
{ | |||
processId = taskEntity.F_ProcessId; | |||
} | |||
if (!nWFTaskIBLL.IsRevokeTask(processId, taskEntity.F_NodeId)) | |||
{ | |||
return false; | |||
} | |||
if (taskLogEntity.F_TaskType == 1) | |||
{// 普通审核才允许撤销审核 | |||
var taskList = nWFTaskIBLL.GetUnFinishTaskList(processId); | |||
List<string> deleteTaskList = new List<string>(); | |||
foreach (var taskItem in taskList) | |||
if (taskEntity.F_IsFinished == 0 && nodeEntity.isAllAuditor == "2") | |||
{ | |||
if (taskItem.F_PrevNodeId == taskEntity.F_NodeId && taskItem.F_IsFinished == 0) | |||
var taskUserList3 = (List<NWFTaskRelationEntity>)nWFTaskIBLL.GetTaskUserList(taskEntity.F_Id); | |||
var taskUserEntity3 = taskUserList3.Find(t => t.F_UserId == userInfo.userId); | |||
if (nodeEntity.auditorType == "1")// 并行 | |||
{ | |||
var taskUserList = (List<NWFTaskRelationEntity>)nWFTaskIBLL.GetTaskUserList(taskItem.F_Id); | |||
if (taskUserList.FindAll(t => t.F_Result != 0).Count == 0) | |||
// 创建任务日志信息 | |||
NWFTaskLogEntity nWFTaskLogEntity1 = new NWFTaskLogEntity() | |||
{ | |||
deleteTaskList.Add(taskItem.F_Id); | |||
F_ProcessId = processId, | |||
F_OperationCode = "revokeAudit", | |||
F_OperationName = "撤销审核", | |||
F_NodeId = taskEntity.F_NodeId, | |||
F_NodeName = taskEntity.F_NodeName, | |||
F_PrevNodeId = taskEntity.F_PrevNodeId, | |||
F_PrevNodeName = taskEntity.F_PrevNodeName, | |||
F_TaskId = taskId, | |||
F_TaskType = 100, | |||
F_CreateUserId = userInfo.userId, | |||
F_CreateUserName = userInfo.realName, | |||
F_TaskUserId = userInfo.userId, | |||
F_TaskUserName = userInfo.realName | |||
}; | |||
nWFTaskLogEntity1.Create(); | |||
nWFProcessSerive.RevokeAudit(null, taskUserEntity3, null, nWFTaskLogEntity1); | |||
return true; | |||
} | |||
else | |||
{ | |||
int sort = (int)taskUserEntity3.F_Sort + 1; | |||
var taskUserEntity4 = taskUserList3.Find(t => t.F_Sort == sort); | |||
if (taskUserEntity4 != null && taskUserEntity4.F_Result == 0) | |||
{ | |||
// 创建任务日志信息 | |||
NWFTaskLogEntity nWFTaskLogEntity2 = new NWFTaskLogEntity() | |||
{ | |||
F_ProcessId = processId, | |||
F_OperationCode = "revokeAudit", | |||
F_OperationName = "撤销审核", | |||
F_NodeId = taskEntity.F_NodeId, | |||
F_NodeName = taskEntity.F_NodeName, | |||
F_PrevNodeId = taskEntity.F_PrevNodeId, | |||
F_PrevNodeName = taskEntity.F_PrevNodeName, | |||
F_TaskId = taskId, | |||
F_TaskType = 100, | |||
F_CreateUserId = userInfo.userId, | |||
F_CreateUserName = userInfo.realName, | |||
F_TaskUserId = userInfo.userId, | |||
F_TaskUserName = userInfo.realName | |||
}; | |||
nWFTaskLogEntity2.Create(); | |||
nWFProcessSerive.RevokeAudit(null, taskUserEntity3, null, nWFTaskLogEntity2, taskUserEntity4); | |||
return true; | |||
} | |||
} | |||
} | |||
if (deleteTaskList.Count > 0) | |||
else | |||
{ | |||
taskEntity.F_IsFinished = 0; | |||
var taskUserList2 = (List<NWFTaskRelationEntity>)nWFTaskIBLL.GetTaskUserList(taskEntity.F_Id); | |||
var taskUserEntity = taskUserList2.Find(t => t.F_UserId == userInfo.userId); | |||
// 创建任务日志信息 | |||
NWFTaskLogEntity nWFTaskLogEntity = new NWFTaskLogEntity() | |||
var taskList = nWFTaskIBLL.GetUnFinishTaskList(processId); | |||
List<string> deleteTaskList = new List<string>(); | |||
// 撤销流程执行线段上绑定的相应方法 | |||
List<NWFLineInfo> lines = new List<NWFLineInfo>(); | |||
foreach (var taskItem in taskList) | |||
{ | |||
F_ProcessId = processId, | |||
F_OperationCode = "revokeAudit", | |||
F_OperationName = "撤销审核", | |||
F_NodeId = taskEntity.F_NodeId, | |||
F_NodeName = taskEntity.F_NodeName, | |||
F_PrevNodeId = taskEntity.F_PrevNodeId, | |||
F_PrevNodeName = taskEntity.F_PrevNodeName, | |||
F_TaskId = taskId, | |||
F_TaskType = 100, | |||
F_CreateUserId = userInfo.userId, | |||
F_CreateUserName = userInfo.realName, | |||
F_TaskUserId = userInfo.userId, | |||
F_TaskUserName = userInfo.realName | |||
}; | |||
nWFTaskLogEntity.Create(); | |||
if (taskItem.F_PrevNodeId == taskEntity.F_NodeId && taskItem.F_IsFinished == 0) | |||
{ | |||
var taskUserList = (List<NWFTaskRelationEntity>)nWFTaskIBLL.GetTaskUserList(taskItem.F_Id); | |||
if (taskUserList.FindAll(t => t.F_Result != 0).Count == 0) | |||
{ | |||
deleteTaskList.Add(taskItem.F_Id); | |||
} | |||
} | |||
} | |||
if (deleteTaskList.Count > 0) | |||
{ | |||
taskEntity.F_IsFinished = 0; | |||
var taskUserList2 = (List<NWFTaskRelationEntity>)nWFTaskIBLL.GetTaskUserList(taskEntity.F_Id); | |||
var taskUserEntity = taskUserList2.Find(t => t.F_UserId == userInfo.userId); | |||
// 创建任务日志信息 | |||
NWFTaskLogEntity nWFTaskLogEntity = new NWFTaskLogEntity() | |||
{ | |||
F_ProcessId = processId, | |||
F_OperationCode = "revokeAudit", | |||
F_OperationName = "撤销审核", | |||
F_NodeId = taskEntity.F_NodeId, | |||
F_NodeName = taskEntity.F_NodeName, | |||
F_PrevNodeId = taskEntity.F_PrevNodeId, | |||
F_PrevNodeName = taskEntity.F_PrevNodeName, | |||
F_TaskId = taskId, | |||
F_TaskType = 100, | |||
F_CreateUserId = userInfo.userId, | |||
F_CreateUserName = userInfo.realName, | |||
F_TaskUserId = userInfo.userId, | |||
F_TaskUserName = userInfo.realName | |||
}; | |||
nWFTaskLogEntity.Create(); | |||
nWFProcessSerive.RevokeAudit(deleteTaskList, taskUserEntity, taskEntity, nWFTaskLogEntity); | |||
nWFProcessSerive.RevokeAudit(deleteTaskList, taskUserEntity, taskEntity, nWFTaskLogEntity); | |||
return true; | |||
nWFIEngine.GetNextTaskNode(nodeEntity, taskLogEntity.F_OperationCode, false, lines); | |||
foreach (var line in lines) | |||
{ | |||
_TriggerMethodR(line, taskEntity.F_Id, taskEntity.F_NodeName, nWFIEngine.GetConfig()); | |||
} | |||
return true; | |||
} | |||
} | |||
} | |||
@@ -3336,6 +3487,26 @@ namespace Learun.Application.WorkFlow | |||
_TriggerMethod(scheme.closeDo, "2", nWFEngineParamConfig); | |||
} | |||
/// <summary> | |||
/// 给指定的流程添加审核节点 | |||
/// </summary> | |||
/// <param name="processId">流程实例ID</param> | |||
/// <param name="bNodeId">开始节点</param> | |||
/// <param name="eNodeId">结束节点(审核任务的节点)</param> | |||
public void AddTask(string processId, string bNodeId, string eNodeId, UserInfo userInfo) | |||
{ | |||
NWFIEngine nWFIEngine = _Bootstraper("", processId, "", userInfo); | |||
NWFNodeInfo bNodeInfo = nWFIEngine.GetNode(bNodeId); | |||
NWFNodeInfo eNodeInfo = nWFIEngine.GetNode(eNodeId); | |||
List<NWFNodeInfo> list = new List<NWFNodeInfo>(); | |||
list.Add(eNodeInfo); | |||
List<NWFTaskEntity> taskList = _CreateTask(list, bNodeInfo, nWFIEngine.GetConfig()); | |||
nWFProcessSerive.SaveTask(taskList); | |||
} | |||
#endregion | |||
@@ -269,6 +269,14 @@ namespace Learun.Application.WorkFlow | |||
/// <param name="processId">流程进程主键</param> | |||
/// <param name="userInfo">当前操作人信息</param> | |||
void DeleteFlow(string processId, UserInfo userInfo); | |||
/// <summary> | |||
/// 给指定的流程添加审核节点 | |||
/// </summary> | |||
/// <param name="processId">流程实例ID</param> | |||
/// <param name="bNodeId">开始节点</param> | |||
/// <param name="eNodeId">结束节点(审核任务的节点)</param> | |||
void AddTask(string processId, string bNodeId, string eNodeId, UserInfo userInfo); | |||
#endregion | |||
#region 获取sql语句 | |||
@@ -1459,24 +1459,47 @@ namespace Learun.Application.WorkFlow | |||
/// <param name="taskUser">当前处理人</param> | |||
/// <param name="taskEntity">当前任务</param> | |||
/// <param name="taskLogEntity">日志信息</param> | |||
public void RevokeAudit(List<string> taskList, NWFTaskRelationEntity taskUser, NWFTaskEntity taskEntity, NWFTaskLogEntity taskLogEntity) | |||
/// <param name="taskUserNew">当前任务节点的处理人(串行多人审核)</param> | |||
public void RevokeAudit(List<string> taskList, NWFTaskRelationEntity taskUser, NWFTaskEntity taskEntity, NWFTaskLogEntity taskLogEntity, NWFTaskRelationEntity taskUserNew = null) | |||
{ | |||
var db = this.BaseRepository().BeginTrans(); | |||
try | |||
{ | |||
foreach (var taskId in taskList) | |||
if (taskList != null) | |||
{ | |||
db.Delete<NWFTaskEntity>(t => t.F_Id == taskId); | |||
db.Delete<NWFTaskRelationEntity>(t => t.F_TaskId == taskId); | |||
db.Delete<NWFTaskMsgEntity>(t => t.F_TaskId == taskId); | |||
foreach (var taskId in taskList) | |||
{ | |||
db.Delete<NWFTaskEntity>(t => t.F_Id == taskId); | |||
db.Delete<NWFTaskRelationEntity>(t => t.F_TaskId == taskId); | |||
db.Delete<NWFTaskMsgEntity>(t => t.F_TaskId == taskId); | |||
} | |||
} | |||
if (taskEntity != null) | |||
{ | |||
db.Update(taskEntity); | |||
} | |||
db.Update(taskEntity); | |||
taskUser.F_Mark = 0; | |||
taskUser.F_Result = 0; | |||
db.Update(taskUser); | |||
db.Insert(taskLogEntity); | |||
if (taskUserNew != null) | |||
{ | |||
taskUserNew.F_Mark = 1; | |||
taskUserNew.F_Result = 0; | |||
db.Update(taskUserNew); | |||
} | |||
// 更新下流程实例(处理重新发起状态) | |||
NWFProcessEntity nWFProcessEntity = new NWFProcessEntity(); | |||
nWFProcessEntity.F_Id = taskLogEntity.F_ProcessId; | |||
nWFProcessEntity.F_IsAgain = 0; | |||
db.Update(nWFProcessEntity); | |||
db.Commit(); | |||
} | |||
catch (Exception ex) | |||
@@ -1492,6 +1515,49 @@ namespace Learun.Application.WorkFlow | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存任务 | |||
/// </summary> | |||
/// <param name="taskList">任务列表</param> | |||
public void SaveTask(List<NWFTaskEntity> taskList) | |||
{ | |||
var db = this.BaseRepository().BeginTrans(); | |||
try | |||
{ | |||
foreach (var task in taskList) | |||
{ | |||
task.F_ModifyDate = DateTime.Now; | |||
db.Insert(task); | |||
int num = 1; | |||
if (task.nWFUserInfoList != null) | |||
{ | |||
foreach (var taskUser in task.nWFUserInfoList) | |||
{ | |||
NWFTaskRelationEntity nWFTaskRelationEntity = new NWFTaskRelationEntity(); | |||
nWFTaskRelationEntity.Create(); | |||
nWFTaskRelationEntity.F_TaskId = task.F_Id; | |||
nWFTaskRelationEntity.F_UserId = taskUser.Id; | |||
nWFTaskRelationEntity.F_Mark = taskUser.Mark; | |||
nWFTaskRelationEntity.F_Result = 0; | |||
nWFTaskRelationEntity.F_Sort = num; | |||
db.Insert(nWFTaskRelationEntity); | |||
num++; | |||
} | |||
} | |||
} | |||
db.Commit(); | |||
} | |||
catch (Exception) | |||
{ | |||
db.Rollback(); | |||
throw; | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -126,9 +126,12 @@ namespace Learun.Application.WorkFlow | |||
if (!string.IsNullOrEmpty(keyValue)) | |||
{ | |||
NWFSchemeEntity oldNWFSchemeEntity = GetSchemeEntity(infoEntity.F_SchemeId); | |||
if (oldNWFSchemeEntity.F_Content == schemeEntity.F_Content && oldNWFSchemeEntity.F_Type == schemeEntity.F_Type) | |||
if (oldNWFSchemeEntity != null) | |||
{ | |||
schemeEntity = null; | |||
if (oldNWFSchemeEntity.F_Content == schemeEntity.F_Content && oldNWFSchemeEntity.F_Type == schemeEntity.F_Type) | |||
{ | |||
schemeEntity = null; | |||
} | |||
} | |||
} | |||
nWFSchemeService.SaveEntity(keyValue, infoEntity, schemeEntity, authList); | |||
@@ -41,6 +41,16 @@ namespace Learun.Application.WorkFlow | |||
return nWFTaskSerivce.GetUnFinishTaskList(); | |||
} | |||
/// <summary> | |||
/// 判断任务是否允许撤销 | |||
/// </summary> | |||
/// <param name="processId">流程实例</param> | |||
/// <param name="preNodeId">上一个节点(撤销任务节点)</param> | |||
/// <returns></returns> | |||
public bool IsRevokeTask(string processId, string preNodeId) | |||
{ | |||
return nWFTaskSerivce.IsRevokeTask(processId, preNodeId); | |||
} | |||
/// <summary> | |||
/// 获取流程任务实体 | |||
/// </summary> | |||
@@ -29,6 +29,14 @@ namespace Learun.Application.WorkFlow | |||
/// </summary> | |||
/// <returns></returns> | |||
IEnumerable<NWFTaskEntity> GetUnFinishTaskList(); | |||
/// <summary> | |||
/// 判断任务是否允许撤销 | |||
/// </summary> | |||
/// <param name="processId">流程实例</param> | |||
/// <param name="preNodeId">上一个节点(撤销任务节点)</param> | |||
/// <returns></returns> | |||
bool IsRevokeTask(string processId, string preNodeId); | |||
/// <summary> | |||
/// 获取流程任务实体 | |||
/// </summary> | |||
@@ -85,6 +85,50 @@ namespace Learun.Application.WorkFlow | |||
} | |||
} | |||
/// <summary> | |||
/// 判断任务是否允许撤销 | |||
/// </summary> | |||
/// <param name="processId">流程实例</param> | |||
/// <param name="preNodeId">上一个节点(撤销任务节点)</param> | |||
/// <returns></returns> | |||
public bool IsRevokeTask(string processId, string preNodeId) | |||
{ | |||
try | |||
{ | |||
bool res = true; | |||
var list = this.BaseRepository().FindList<NWFTaskEntity>(t => t.F_ProcessId == processId && t.F_PrevNodeId == preNodeId && t.F_Type == 1 && t.F_IsFinished == 1); | |||
var list2 = (List<NWFTaskEntity>)this.BaseRepository().FindList<NWFTaskEntity>(t => t.F_ProcessId == processId && t.F_PrevNodeId == preNodeId && (t.F_Type == 1 || t.F_Type == 5) && t.F_IsFinished == 0); | |||
if (list2.Count > 0) | |||
{ | |||
return res; | |||
} | |||
foreach (var item in list) | |||
{ | |||
string nodeId = item.F_NodeId; | |||
var entity = this.BaseRepository().FindEntity<NWFTaskEntity>(t => t.F_ProcessId == processId && t.F_NodeId == nodeId && t.F_IsFinished == 0); | |||
if (entity == null) | |||
{ | |||
res = false; | |||
break; | |||
} | |||
} | |||
return res; | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取流程任务实体 | |||
/// </summary> | |||
@@ -48,12 +48,25 @@ | |||
/// </summary> | |||
public string strSql { get; set; } | |||
/// <summary> | |||
/// 绑定的sql语句(撤销的时候执行) | |||
/// </summary> | |||
public string strSqlR { get; set; } | |||
/// <summary> | |||
/// 绑定的接口 | |||
/// </summary> | |||
public string strInterface { get; set; } | |||
/// <summary> | |||
/// 绑定的接口(撤销的时候执行) | |||
/// </summary> | |||
public string strInterfaceR { get; set; } | |||
/// <summary> | |||
/// <summary> | |||
/// 绑定的ioc名称 | |||
/// </summary> | |||
public string iocName { get; set; } | |||
/// <summary> | |||
/// 绑定的ioc名称(撤销的时候执行) | |||
/// </summary> | |||
public string iocNameR { get; set; } | |||
} | |||
} |