默认接口提交和返回值不序列化
This commit is contained in:
@@ -486,7 +486,8 @@ public class RunService : IRunService, ITransient
|
||||
/// <param name="templateEntity">模板实体.</param>
|
||||
/// <param name="isFlowTask"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<string> GetHaveTableInfoDetails(string id, VisualDevEntity templateEntity, bool isFlowTask = false)
|
||||
/// modified by pf 2023-04-12 返回值不序列化
|
||||
public async Task<Dictionary<string, object>?> GetHaveTableInfoDetails(string id, VisualDevEntity templateEntity, bool isFlowTask = false)
|
||||
{
|
||||
TemplateParsingBase? templateInfo = new TemplateParsingBase(templateEntity, isFlowTask); // 解析模板控件
|
||||
DbLinkEntity link = await GetDbLink(templateEntity.DbLinkId);
|
||||
@@ -496,7 +497,8 @@ public class RunService : IRunService, ITransient
|
||||
var sql = GetInfoQuerySql(id, mainPrimary, templateInfo, ref tableFieldKeyValue); // 获取查询Sql
|
||||
|
||||
Dictionary<string, object>? data = _databaseService.GetInterFaceData(link, sql).ToJsonString().ToObject<List<Dictionary<string, string>>>().ToObject<List<Dictionary<string, object>>>().FirstOrDefault();
|
||||
if (data == null) return id;
|
||||
// modified by pf 2023-04-12 返回值不序列化
|
||||
if (data == null) return data;
|
||||
|
||||
// 记录全部数据
|
||||
Dictionary<string, object> dataMap = new Dictionary<string, object>();
|
||||
@@ -573,7 +575,8 @@ public class RunService : IRunService, ITransient
|
||||
_formDataParsing.GetBARAndQR(templateInfo.FieldsModelList, newDataMap, dataMap); // 处理 条形码 、 二维码 控件
|
||||
|
||||
if (!newDataMap.ContainsKey("id")) newDataMap.Add("id", id);
|
||||
return newDataMap.ToJsonString();
|
||||
// modified by pf 2023-04-12 返回值不序列化
|
||||
return newDataMap;
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -623,7 +626,8 @@ public class RunService : IRunService, ITransient
|
||||
}
|
||||
public async Task<Dictionary<string, List<Dictionary<string, object>>>> GetCreateSqlByTemplate(TemplateParsingBase templateInfo, VisualDevModelDataCrInput dataInput, string mainId)
|
||||
{
|
||||
Dictionary<string, object>? allDataMap = dataInput.data.ToObject<Dictionary<string, object>>();
|
||||
// modified by PhilPan 2023-04-12 提交和返回值不序列化
|
||||
Dictionary<string, object>? allDataMap = dataInput.data;
|
||||
if (!templateInfo.VerifyTemplate()) throw Oops.Oh(ErrorCode.D1401); // 验证模板
|
||||
|
||||
// 处理系统控件(模板开启行编辑)
|
||||
@@ -794,15 +798,16 @@ public class RunService : IRunService, ITransient
|
||||
if (templateInfo.ColumnData.type.Equals(4) && _userManager.UserOrigin.Equals("pc"))
|
||||
{
|
||||
// 剔除 [增加前端回显字段 : key_name]
|
||||
Dictionary<string, object> oldDataMap = visualdevModelDataUpForm.data.ToObject<Dictionary<string, object>>();
|
||||
// modified by PhilPan 2023-04-12 提交和返回值不序列化
|
||||
Dictionary<string, object> oldDataMap = visualdevModelDataUpForm.data;
|
||||
Dictionary<string, object> newDataMap = new Dictionary<string, object>();
|
||||
foreach (var item in oldDataMap)
|
||||
{
|
||||
var key = item.Key.Replace("_name", string.Empty);
|
||||
if (!newDataMap.ContainsKey(key)) newDataMap.Add(key, oldDataMap[key]);
|
||||
}
|
||||
|
||||
if (newDataMap.Any()) visualdevModelDataUpForm.data = newDataMap.ToJsonString();
|
||||
// modified by PhilPan 2023-04-12 提交和返回值不序列化
|
||||
if (newDataMap.Any()) visualdevModelDataUpForm.data = newDataMap;
|
||||
}
|
||||
|
||||
DbLinkEntity link = await GetDbLink(templateEntity.DbLinkId);
|
||||
@@ -836,7 +841,8 @@ public class RunService : IRunService, ITransient
|
||||
}
|
||||
public async Task<List<string>> GetUpdateSqlByTemplate(TemplateParsingBase templateInfo, VisualDevModelDataUpInput visualdevModelDataUpForm, string id)
|
||||
{
|
||||
Dictionary<string, object>? allDataMap = visualdevModelDataUpForm.data.ToObject<Dictionary<string, object>>();
|
||||
// modified by PhilPan 2023-04-12 提交和返回值不序列化
|
||||
Dictionary<string, object>? allDataMap = visualdevModelDataUpForm.data;
|
||||
if (!templateInfo.VerifyTemplate()) throw Oops.Oh(ErrorCode.D1401); // 验证模板
|
||||
|
||||
// 处理系统控件(模板开启行编辑)
|
||||
@@ -1017,12 +1023,14 @@ public class RunService : IRunService, ITransient
|
||||
tInfo.DbLink = await GetDbLink(fEntity.DbLinkId);
|
||||
if (isUpdate)
|
||||
{
|
||||
var sqlList = await GetUpdateSqlByTemplate(tInfo, new VisualDevModelDataUpInput() { data = formData }, dataId);
|
||||
// modified by PhilPan 2023-04-12 提交和返回值不序列化
|
||||
var sqlList = await GetUpdateSqlByTemplate(tInfo, new VisualDevModelDataUpInput() { data = formData.ToObject<Dictionary<string, object>>() }, dataId);
|
||||
foreach (var item in sqlList) await _databaseService.ExecuteSql(tInfo.DbLink, item); // 修改功能数据
|
||||
}
|
||||
else
|
||||
{
|
||||
var sqlList = await GetCreateSqlByTemplate(tInfo, new VisualDevModelDataUpInput() { data = formData }, dataId);
|
||||
// modified by PhilPan 2023-04-12 提交和返回值不序列化
|
||||
var sqlList = await GetCreateSqlByTemplate(tInfo, new VisualDevModelDataUpInput() { data = formData.ToObject<Dictionary<string, object>>() }, dataId);
|
||||
|
||||
// 主表自增长Id.
|
||||
if (sqlList.ContainsKey("MainTableReturnIdentity")) sqlList.Remove("MainTableReturnIdentity");
|
||||
@@ -3196,12 +3204,10 @@ public class RunService : IRunService, ITransient
|
||||
var relationValueId = dataItem[item.__vModel__].ToString(); // 获取关联表单id
|
||||
var relationInfo = await _visualDevRepository.AsQueryable().FirstAsync(x => x.Id == item.modelId); // 获取 关联表单 转换后的数据
|
||||
var relationValueStr = string.Empty;
|
||||
relationValueStr = await GetHaveTableInfoDetails(relationValueId, relationInfo);
|
||||
|
||||
if (!relationValueStr.IsNullOrEmpty() && !relationValueStr.Equals(relationValueId))
|
||||
// modified by pf 2023-04-12 返回值不序列化
|
||||
var relationValue = await GetHaveTableInfoDetails(relationValueId, relationInfo);
|
||||
if (relationValue != null)
|
||||
{
|
||||
var relationValue = relationValueStr.ToObject<Dictionary<string, object>>();
|
||||
|
||||
// 添加到 子表 列
|
||||
model.__config__.children.Where(x => x.relationField.ReplaceRegex(@"_jnpfTable_(\w+)", string.Empty) == item.__vModel__).ToList().ForEach(citem =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user