refactor: 迁移初始化参数缓存并优化等待界面
This commit is contained in:
@@ -1371,56 +1371,91 @@ namespace Lskj.Control
|
||||
{
|
||||
try
|
||||
{
|
||||
string billNo = this.SysModel.BillDocumentId;
|
||||
List<string> billNoItems = new List<string>();
|
||||
if (BaseAccraditModelObj.MuitlAuditFlag || BaseAccraditModelObj.MuitlAuditBackFlag)
|
||||
{
|
||||
foreach (TabPageObj tab in this._tabPageObjs)
|
||||
{
|
||||
if (tab.TabPage == this.tabMain.SelectedTabPage)
|
||||
{
|
||||
foreach (TabPageItemObj item in tab.TabPageItemObjs)
|
||||
{
|
||||
int[] mSelectRows = item.GridControlObj.GridView.GetSelectedRows();
|
||||
foreach (int itemIndex in mSelectRows)
|
||||
{
|
||||
DataRow selectRow = item.GridControlObj.GridView.GetDataRow(itemIndex);
|
||||
if (selectRow.Table.Columns.Contains(this.BillModelObj.PrimaryKey))
|
||||
{
|
||||
billNoItems.Add(selectRow[this.BillModelObj.PrimaryKey] + "");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
billNoItems.Add(this.SysModel.BillDocumentId);
|
||||
}
|
||||
|
||||
string printPath = PubUtil.PrintFileAbsolutelyPath;
|
||||
string printFile = e.Item.Tag + "";
|
||||
if (!string.IsNullOrEmpty(billNo))
|
||||
|
||||
foreach (string billNo in billNoItems)
|
||||
{
|
||||
DataRow masterRow = BillImpl.GetDataRowResult(ReplaceHelper.ReplaceParamToValue(this.BillModelObj.MasterSql, billNo));
|
||||
if (masterRow == null)
|
||||
//string billNo = this.SysModel.BillDocumentId;
|
||||
|
||||
if (!string.IsNullOrEmpty(billNo))
|
||||
{
|
||||
MessageUtil.Show(ResourceKeys.DataNotFount);
|
||||
return;
|
||||
}
|
||||
if (!ReplaceHelper.ReplaceRowParamCond(masterRow, this.BillModelObj.PrintCond))
|
||||
{
|
||||
MessageUtil.Show(ResourceKeys.DisSatisfyPrintCond);
|
||||
return;
|
||||
}
|
||||
|
||||
string tmpSql = ReplaceHelper.ReplaceRowParam(masterRow, this.BillModelObj.PrintSql);
|
||||
string tmpSql1 = ReplaceHelper.ReplaceRowParam(masterRow, this.BillModelObj.PrintSql1);
|
||||
string tmpSql2 = ReplaceHelper.ReplaceRowParam(masterRow, this.BillModelObj.PrintSql2);
|
||||
|
||||
|
||||
if (printFile.Contains(PrintUtil.TemplateFlag))
|
||||
{
|
||||
string mainSql = string.Empty;
|
||||
List<string> tmpSqls = new List<string>();
|
||||
if (_printSaveParams != null && _printSaveParams.Count > 0)
|
||||
DataRow masterRow = BillImpl.GetDataRowResult(ReplaceHelper.ReplaceParamToValue(this.BillModelObj.MasterSql, billNo));
|
||||
if (masterRow == null)
|
||||
{
|
||||
_printSaveParams[5] = mainSql = ReplaceHelper.ReplaceRowParam(masterRow, _mainPrintSql);
|
||||
_printSaveParams[3] = masterRow.Table.Columns.Contains(_printSaveParams[2] + "") ? masterRow[_printSaveParams[2]] + "" : masterRow[BillModelObj.PrimaryKey] + "";
|
||||
tmpSqls.Add(mainSql);
|
||||
tmpSqls.Add(tmpSql1);
|
||||
tmpSqls.AddRange(tmpSql2.Split(';').ToList());
|
||||
MessageUtil.Show(ResourceKeys.DataNotFount);
|
||||
return;
|
||||
}
|
||||
if (!ReplaceHelper.ReplaceRowParamCond(masterRow, this.BillModelObj.PrintCond))
|
||||
{
|
||||
MessageUtil.Show(ResourceKeys.DisSatisfyPrintCond);
|
||||
return;
|
||||
}
|
||||
|
||||
string tmpSql = ReplaceHelper.ReplaceRowParam(masterRow, this.BillModelObj.PrintSql);
|
||||
string tmpSql1 = ReplaceHelper.ReplaceRowParam(masterRow, this.BillModelObj.PrintSql1);
|
||||
string tmpSql2 = ReplaceHelper.ReplaceRowParam(masterRow, this.BillModelObj.PrintSql2);
|
||||
|
||||
|
||||
if (printFile.Contains(PrintUtil.TemplateFlag))
|
||||
{
|
||||
string mainSql = string.Empty;
|
||||
List<string> tmpSqls = new List<string>();
|
||||
if (_printSaveParams != null && _printSaveParams.Count > 0)
|
||||
{
|
||||
_printSaveParams[5] = mainSql = ReplaceHelper.ReplaceRowParam(masterRow, _mainPrintSql);
|
||||
_printSaveParams[3] = masterRow.Table.Columns.Contains(_printSaveParams[2] + "") ? masterRow[_printSaveParams[2]] + "" : masterRow[BillModelObj.PrimaryKey] + "";
|
||||
tmpSqls.Add(mainSql);
|
||||
tmpSqls.Add(tmpSql1);
|
||||
tmpSqls.AddRange(tmpSql2.Split(';').ToList());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(tmpSql)) tmpSqls.Add(tmpSql);
|
||||
if (!string.IsNullOrWhiteSpace(tmpSql1)) tmpSqls.Add(tmpSql1);
|
||||
if (!string.IsNullOrWhiteSpace(tmpSql2)) tmpSqls.AddRange(tmpSql2.Split(';').ToList());
|
||||
}
|
||||
PrintUtil.OnAfterPrint -= new EventHandler(OnReportPrintAfter);
|
||||
PrintUtil.OnAfterPrint += new EventHandler(OnReportPrintAfter);
|
||||
PrintUtil.FastReportPrint(tmpSqls, printFile, _isExcPrint);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(tmpSql)) tmpSqls.Add(tmpSql);
|
||||
if (!string.IsNullOrWhiteSpace(tmpSql1)) tmpSqls.Add(tmpSql1);
|
||||
if (!string.IsNullOrWhiteSpace(tmpSql2)) tmpSqls.AddRange(tmpSql2.Split(';').ToList());
|
||||
DelphiHelper.LoadDelphiDll(printPath, printPath, printFile, tmpSql, tmpSql1, this.BillModelObj.PrintFileType, tmpSql2);
|
||||
}
|
||||
PrintUtil.OnAfterPrint -= new EventHandler(OnReportPrintAfter);
|
||||
PrintUtil.OnAfterPrint += new EventHandler(OnReportPrintAfter);
|
||||
PrintUtil.FastReportPrint(tmpSqls, printFile, _isExcPrint);
|
||||
}
|
||||
else
|
||||
{
|
||||
DelphiHelper.LoadDelphiDll(printPath, printPath, printFile, tmpSql, tmpSql1, this.BillModelObj.PrintFileType, tmpSql2);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user