|
|
@@ -76,7 +76,7 @@ namespace YSAI.Core.handler
|
|
|
else
|
|
|
{
|
|
|
//数据质量
|
|
|
- Quality = DataTypeConvert(addressDetails.AddressDataType, value?.ToString(), out object? outValue);
|
|
|
+ Quality = DataTypeConvert(addressDetails.AddressDataType, value.ToString(), out object? outValue);
|
|
|
|
|
|
//判断数据质量
|
|
|
if (Quality == 1)
|
|
|
@@ -88,7 +88,7 @@ namespace YSAI.Core.handler
|
|
|
Value = outValue;
|
|
|
|
|
|
//进行解析
|
|
|
- (int Q, object? V) resData = Parse(addressDetails, Value);
|
|
|
+ Parse(addressDetails, Value, out (int Q, object? V) resData);
|
|
|
|
|
|
//解析后的结果
|
|
|
Value = resData.V;
|
|
|
@@ -138,12 +138,11 @@ namespace YSAI.Core.handler
|
|
|
public static int DataTypeConvert(DataType dataType, string value, out object? outValue)
|
|
|
{
|
|
|
//数据质量
|
|
|
- int Quality = -1;
|
|
|
+ int Quality = 1;
|
|
|
//转换后的值
|
|
|
outValue = null;
|
|
|
try
|
|
|
{
|
|
|
- Quality = 1;
|
|
|
//数据类型判断
|
|
|
switch (dataType)
|
|
|
{
|
|
|
@@ -256,7 +255,7 @@ namespace YSAI.Core.handler
|
|
|
/// <param name="addressDetails">地址详情</param>
|
|
|
/// <param name="value">当前值</param>
|
|
|
/// <returns>解析后的值(数据质量,值)</returns>
|
|
|
- private static (int Q, object? V) Parse(AddressDetails addressDetails, object value)
|
|
|
+ private static void Parse(AddressDetails addressDetails, object value, out (int Q, object? V) result)
|
|
|
{
|
|
|
//最新值
|
|
|
object? NewValue = null;
|
|
|
@@ -330,12 +329,12 @@ namespace YSAI.Core.handler
|
|
|
if (NewValue is null || string.IsNullOrWhiteSpace(NewValue.ToString()))
|
|
|
{
|
|
|
//为空返回空字符串,并设置数据质量为4
|
|
|
- return (4, string.Empty);
|
|
|
+ result = (4, string.Empty);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
//不为空返回解析到的数据,并设置数据质量为3
|
|
|
- return (3, NewValue);
|
|
|
+ result = (3, NewValue);
|
|
|
}
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
@@ -344,7 +343,7 @@ namespace YSAI.Core.handler
|
|
|
}
|
|
|
}
|
|
|
//没有使用解析
|
|
|
- return (1, value);
|
|
|
+ result = (1, value);
|
|
|
}
|
|
|
}
|
|
|
}
|