|
@@ -551,7 +551,98 @@ namespace Learun.Application.Form |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Dictionary<string, string> GetFolderKey(string schemeInfoId, string processIdName, string keyValue) |
|
|
|
|
|
{ |
|
|
|
|
|
Dictionary<string, DataTable> res = new Dictionary<string, DataTable>(); |
|
|
|
|
|
|
|
|
|
|
|
try |
|
|
|
|
|
{ |
|
|
|
|
|
FormSchemeInfoEntity formSchemeInfoEntity = GetSchemeInfoEntity(schemeInfoId); |
|
|
|
|
|
FormSchemeEntity formSchemeEntity = GetSchemeEntity(formSchemeInfoEntity.F_SchemeId); |
|
|
|
|
|
FormSchemeModel formSchemeModel = formSchemeEntity.F_Scheme.ToObject<FormSchemeModel>(); |
|
|
|
|
|
|
|
|
|
|
|
// 确定主从表之间的关系 |
|
|
|
|
|
List<TreeModelEx<FormTableModel>> TableTree = new List<TreeModelEx<FormTableModel>>();// 从表 |
|
|
|
|
|
foreach (var table in formSchemeModel.dbTable) |
|
|
|
|
|
{ |
|
|
|
|
|
TreeModelEx<FormTableModel> treeone = new TreeModelEx<FormTableModel>(); |
|
|
|
|
|
treeone.data = table; |
|
|
|
|
|
treeone.id = table.name; |
|
|
|
|
|
treeone.parentId = table.relationName; |
|
|
|
|
|
if (string.IsNullOrEmpty(table.relationName)) |
|
|
|
|
|
{ |
|
|
|
|
|
treeone.parentId = "0"; |
|
|
|
|
|
} |
|
|
|
|
|
TableTree.Add(treeone); |
|
|
|
|
|
} |
|
|
|
|
|
TableTree = TableTree.ToTree(); |
|
|
|
|
|
bool hasupload = false; |
|
|
|
|
|
|
|
|
|
|
|
// 确定表与组件之间的关系 |
|
|
|
|
|
Dictionary<string, List<FormCompontModel>> tableComponts = new Dictionary<string, List<FormCompontModel>>(); |
|
|
|
|
|
foreach (var tab in formSchemeModel.data) |
|
|
|
|
|
{ |
|
|
|
|
|
foreach (var compont in tab.componts) |
|
|
|
|
|
{ |
|
|
|
|
|
if (!string.IsNullOrEmpty(compont.table)) |
|
|
|
|
|
{ |
|
|
|
|
|
if (!tableComponts.ContainsKey(compont.table)) |
|
|
|
|
|
{ |
|
|
|
|
|
tableComponts[compont.table] = new List<FormCompontModel>(); |
|
|
|
|
|
} |
|
|
|
|
|
if (compont.type == "upload") |
|
|
|
|
|
{ |
|
|
|
|
|
hasupload = true; |
|
|
|
|
|
tableComponts[compont.table].Add(compont); |
|
|
|
|
|
} |
|
|
|
|
|
if (compont.type == "guid") |
|
|
|
|
|
{ |
|
|
|
|
|
tableComponts[compont.table].Add(compont); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
Dictionary<string, string> uploadfieldkeyvalue = new Dictionary<string, string>(); |
|
|
|
|
|
|
|
|
|
|
|
if (!hasupload) |
|
|
|
|
|
{ |
|
|
|
|
|
return uploadfieldkeyvalue; |
|
|
|
|
|
} |
|
|
|
|
|
GetInstanceTableData(TableTree, tableComponts, formSchemeModel.dbId, keyValue, processIdName, null, res); |
|
|
|
|
|
foreach (var itemCompont in tableComponts) |
|
|
|
|
|
{ |
|
|
|
|
|
foreach (FormCompontModel formitem in itemCompont.Value) |
|
|
|
|
|
{ |
|
|
|
|
|
if (formitem.type=="upload") |
|
|
|
|
|
{ |
|
|
|
|
|
foreach (var resitem in res) |
|
|
|
|
|
{ |
|
|
|
|
|
if (resitem.Value.Rows.Count>0) |
|
|
|
|
|
{ |
|
|
|
|
|
if (resitem.Value.Rows[0][formitem.field] != null) |
|
|
|
|
|
uploadfieldkeyvalue.Add(formitem.id, resitem.Value.Rows[0][formitem.field].ToString()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return uploadfieldkeyvalue; |
|
|
|
|
|
} |
|
|
|
|
|
catch (Exception ex) |
|
|
|
|
|
{ |
|
|
|
|
|
if (ex is ExceptionEx) |
|
|
|
|
|
{ |
|
|
|
|
|
throw; |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
throw ExceptionEx.ThrowBusinessException(ex); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/// <summary> |
|
|
/// <summary> |
|
|
/// 保存自定义表单数据 |
|
|
/// 保存自定义表单数据 |
|
|
/// </summary> |
|
|
/// </summary> |
|
|