修复sql错误导致程序崩溃的问题

This commit is contained in:
2023-05-19 11:24:18 +08:00
parent 0670387658
commit 23dd5a7604
4 changed files with 40 additions and 18 deletions

View File

@@ -175,6 +175,8 @@ public class VisualDevService : IVisualDevService, IDynamicApiController, ITrans
public async Task<dynamic> GetFormDataFields(string id)
{
VisualDevEntity? templateEntity = await _visualDevRepository.AsQueryable().FirstAsync(v => v.Id == id && v.DeleteMark == null);
//modified by PhilPan
if (templateEntity == null) throw Oops.Oh(ErrorCode.D1418, id);
TemplateParsingBase? tInfo = new TemplateParsingBase(templateEntity); // 解析模板
List<FieldsModel>? fieldsModels = tInfo.SingleFormData.FindAll(x => x.__vModel__.IsNotEmptyOrNull() && !JnpfKeyConst.RELATIONFORM.Equals(x.__config__.jnpfKey));
List<VisualDevFormDataFieldsOutput>? output = fieldsModels.Select(x => new VisualDevFormDataFieldsOutput()
@@ -198,6 +200,8 @@ public class VisualDevService : IVisualDevService, IDynamicApiController, ITrans
if (!string.IsNullOrWhiteSpace(input.relationField) && !string.IsNullOrWhiteSpace(input.keyword)) queryDic.Add(input.relationField, input.keyword);
VisualDevEntity? templateEntity = await _visualDevRepository.AsQueryable().FirstAsync(v => v.Id == id && v.DeleteMark == null); // 取数据
//modified by PhilPan
if (templateEntity == null) throw Oops.Oh(ErrorCode.D1418, id);
TemplateParsingBase? tInfo = new TemplateParsingBase(templateEntity); // 解析模板
// 指定查询字段