【已解决】调用工作流批量处理窗体的问题!
金蝶云社区-Amoo
Amoo
0人赞赏了该文章 1,258次浏览 未经作者许可,禁止转载编辑于2014年11月06日 09:46:54

由于业务需要,需要做个批量审核平台,借助调用K3Cloud的批量处理窗体来实现,
但调用DealAssignBatch后,一直提示“所选待办任务状态已经更新,不允许处理”,

就是AssignmentServiceHelper.GetBatchAssignIds这个方法取不到值,assignIds传的是单据内码,

奇怪的是在K3Cloud待处理任务那里选择同样的任务,点批量处理就能弹出批量处理窗体!

我反编译看代码也就是调用this.DealAssignBatch(assignIds)来实现的啊,

请教一下,这个要怎么解决?

以下是我调用的代码
[code]public override void AfterDoOperation(AfterDoOperationEventArgs e)
{
if (e.Operation.Id.Equals("DoBatchAudit"))
{
if (assignIds.Count > 0)
{
this.DealAssignBatch(assignIds);
}
}
}

//调用批量处理
private void DealAssignBatch(IList assignIds)
{
GetBatchAssignIdsResult result = AssignmentServiceHelper.GetBatchAssignIds(this.Context, this.Context.UserId, assignIds);
if ((result == null) || (result.BatchAssignList.Count == 0))
{
this.View.ShowErrMessage(ResManager.LoadKDString("所选待办任务状态已经更新,不允许处理", "002406030017305", SubSystemType.BOS, new object[0]), ResManager.LoadKDString("待办任务批量处理失败", "002406030017308", SubSystemType.BOS, new object[0]), MessageBoxType.Notice);
this.View.Refresh();
}
else
{
var assignBatchParameter = this.GetAssignBatchParameter(result.BatchAssignList);
this.AssignmentListShowForm(assignBatchParameter, null);
}
}

private DynamicFormShowParameter GetAssignBatchParameter(List batchAssignList)
{
var parameter = new DynamicFormShowParameter();
if (batchAssignList[0].Assigns[0].ProcessType == 310)
{
parameter.FormId = "AF_ApprovalAssignBatchDeal";
}
else
{
parameter.FormId = WFDynamicFormConst.AssignmentApprovalBatchForm;
}
parameter.OpenStyle.ShowType = ShowType.MainNewTabPage;
this.View.Session["BatchAssignList"] = batchAssignList;
parameter.CustomParams.Add("BatchIndex", "0");
return parameter;
}

private void AssignmentListShowForm(DynamicFormShowParameter showParam, Action action = null)
{
if ((this.View.ParentFormView == null) || (this.View.ParentFormView.ParentFormView == null))
{
showParam.OpenStyle.ShowType = ShowType.Modal;
}
if (action == null)
{
this.View.ShowForm(showParam);
}
else
{
this.View.ShowForm(showParam, action);
}
}[/code]