update 浙里办代码闭环

This commit is contained in:
路 范
2021-09-10 13:51:30 +08:00
parent d550f22253
commit f157223a17
27 changed files with 349 additions and 115 deletions

View File

@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Http;
using Furion.FriendlyException;
using Microsoft.AspNetCore.Http;
using Microsoft.VisualBasic;
using Newtonsoft.Json.Linq;
using System;
@@ -900,12 +901,12 @@ namespace Ewide.NbzsZheliban.Tools
public static string GetJsonValue(this JObject jObject, string jsonName, bool isToLower = true, bool isThrowExp = false)
{
if (jObject == null)
throw new Exception("参数为空");
throw Oops.Oh("参数为空");
JToken token = jObject[isToLower ? jsonName.ToLower() : jsonName];
if (token == null)
{
if (isThrowExp)
throw new Exception(jsonName + "是必需的");
throw Oops.Oh(jsonName + "是必需的");
return string.Empty;
}
else
@@ -989,7 +990,7 @@ namespace Ewide.NbzsZheliban.Tools
if (jObject == null)
{
if (isThrowExp)
throw new Exception(jsonName + "是必需的");
throw Oops.Oh(jsonName + "是必需的");
return null;
}
string v = GetJsonValue(jObject, jsonName, isToLower);
@@ -1000,7 +1001,7 @@ namespace Ewide.NbzsZheliban.Tools
else
{
if (isThrowExp)
throw new Exception(jsonName + "是必需的");
throw Oops.Oh(jsonName + "是必需的");
return null;
}
}
@@ -1018,7 +1019,7 @@ namespace Ewide.NbzsZheliban.Tools
else
{
if (isThrowExp)
throw new Exception(jsonName + "是必需的");
throw Oops.Oh(jsonName + "是必需的");
return null;
}
}
@@ -1200,7 +1201,7 @@ namespace Ewide.NbzsZheliban.Tools
value = jobj.GetJsonBoolValue(pro.Name, isToLower);
break;
default:
throw new Exception("补充类型:" + propName);
throw Oops.Oh("补充类型:" + propName);
}
pro.SetValue(obj, value, null);
}