Browse Source

解决手机端编辑多表表单出现from附近语法错误问题

娄底高职分支
liangkun 2 years ago
committed by ndbs
parent
commit
b774c35c6d
1 changed files with 92 additions and 1 deletions
  1. +92
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/Scheme/FormSchemeBLL.cs

+ 92
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/Scheme/FormSchemeBLL.cs View File

@@ -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>


Loading…
Cancel
Save