This commit is contained in:
DEVICE8\12494
2023-05-17 08:35:03 +08:00
74 changed files with 1457 additions and 158 deletions

View File

@@ -0,0 +1,174 @@
using System;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Tnb.BasicData.Entities
{
///<summary>
///客户信息
///</summary>
[SugarTable("bas_customer")]
public partial class BasCustomer
{
public BasCustomer(){
this.org_id =Convert.ToString("NULL::character varying");
this.short_name =Convert.ToString("NULL::character varying");
this.full_address =Convert.ToString("NULL::character varying");
this.postal_code =Convert.ToString("NULL::character varying");
this.country =Convert.ToString("NULL::character varying");
this.province =Convert.ToString("NULL::character varying");
this.city =Convert.ToString("NULL::character varying");
this.district =Convert.ToString("NULL::character varying");
this.street =Convert.ToString("NULL::character varying");
this.contact_name =Convert.ToString("NULL::character varying");
this.contact_phone =Convert.ToString("NULL::character varying");
this.contact_mobile =Convert.ToString("NULL::character varying");
this.create_id =Convert.ToString("NULL::character varying");
this.modify_id =Convert.ToString("NULL::character varying");
}
/// <summary>
/// Desc:编号
/// Default:
/// Nullable:False
/// </summary>
[SugarColumn(IsPrimaryKey=true)]
public string id {get;set;}
/// <summary>
/// Desc:客户代码
/// Default:
/// Nullable:False
/// </summary>
public string customer_code {get;set;}
/// <summary>
/// Desc:客户名称
/// Default:
/// Nullable:False
/// </summary>
public string customer_name {get;set;}
/// <summary>
/// Desc:所属组织
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string? org_id {get;set;}
/// <summary>
/// Desc:客户简称
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string? short_name {get;set;}
/// <summary>
/// Desc:详细地址
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string? full_address {get;set;}
/// <summary>
/// Desc:邮编
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string? postal_code {get;set;}
/// <summary>
/// Desc:国家
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string? country {get;set;}
/// <summary>
/// Desc:省
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string? province {get;set;}
/// <summary>
/// Desc:市
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string? city {get;set;}
/// <summary>
/// Desc:区
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string? district {get;set;}
/// <summary>
/// Desc:街道地址
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string? street {get;set;}
/// <summary>
/// Desc:联系人名称
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string? contact_name {get;set;}
/// <summary>
/// Desc:联系人电话
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string? contact_phone {get;set;}
/// <summary>
/// Desc:联系人手机
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string? contact_mobile {get;set;}
/// <summary>
/// Desc:创建用户
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string? create_id {get;set;}
/// <summary>
/// Desc:创建时间
/// Default:
/// Nullable:True
/// </summary>
public DateTime? create_time {get;set;}
/// <summary>
/// Desc:修改用户
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string? modify_id {get;set;}
/// <summary>
/// Desc:修改时间
/// Default:
/// Nullable:True
/// </summary>
public DateTime? modify_time {get;set;}
/// <summary>
/// Desc:扩展字段
/// Default:
/// Nullable:True
/// </summary>
public string? extras {get;set;}
}
}

View File

@@ -0,0 +1,25 @@
namespace Tnb.EquipMgr
{
/// <summary>
/// 设备生命周期
/// </summary>
public static class EquipmentLife
{
/// <summary>
/// 启用
/// </summary>
public const string ENABLE = "1";
/// <summary>
/// 停用
/// </summary>
public const string DISABLE = "2";
/// <summary>
/// 库存
/// </summary>
public const string STOCK = "3";
/// <summary>
/// 报废
/// </summary>
public const string SCRAP = "4";
}
}

View File

@@ -0,0 +1,150 @@
using SqlSugar;
using Tnb.Common.Contracts;
namespace Tnb.EquipMgr.Entities
{
///<summary>
///设备点巡检项目
///</summary>
[SugarTable("eqp_spot_ins_item")]
public class EqpSpotInsItem : BaseEntity<string>
{
public EqpSpotInsItem()
{
}
/// <summary>
/// Desc:创建时间
/// Default:
/// Nullable:True
/// </summary>
public DateTime? create_time { get; set; }
/// <summary>
/// Desc:修改时间
/// Default:
/// Nullable:True
/// </summary>
public DateTime? modify_time { get; set; }
/// <summary>
/// Desc:判断类型1数值2结果
/// Default:
/// Nullable:False
/// </summary>
public string judge_type { get; set; }
/// <summary>
/// Desc:上限值
/// Default:
/// Nullable:True
/// </summary>
public decimal? high_value { get; set; }
/// <summary>
/// Desc:是否包含上限值
/// Default:
/// Nullable:True
/// </summary>
public int? high_value_is_include { get; set; }
/// <summary>
/// Desc:下限值
/// Default:
/// Nullable:True
/// </summary>
public decimal? low_value { get; set; }
/// <summary>
/// Desc:是否包含下限值
/// Default:
/// Nullable:True
/// </summary>
public int? low_value_is_include { get; set; }
/// <summary>
/// Desc:标准值
/// Default:
/// Nullable:True
/// </summary>
public decimal? standard_value { get; set; }
/// <summary>
/// Desc:单位id
/// Default:
/// Nullable:False
/// </summary>
public string unit_id { get; set; }
/// <summary>
/// Desc:排序
/// Default:
/// Nullable:False
/// </summary>
public int ordinal { get; set; }
/// <summary>
/// Desc:类型 1 点检 2巡检
/// Default:
/// Nullable:False
/// </summary>
public string type { get; set; }
/// <summary>
/// Desc:创建用户
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string create_id { get; set; }
/// <summary>
/// Desc:修改用户
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string modify_id { get; set; }
/// <summary>
/// Desc:编码
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string code { get; set; }
/// <summary>
/// Desc:名称
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string name { get; set; }
/// <summary>
/// Desc:判断内容
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string judge_content { get; set; }
/// <summary>
/// Desc:点巡检方法
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string inspection_method { get; set; }
/// <summary>
/// Desc:备注
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string remark { get; set; }
/// <summary>
/// Desc:所属组织
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string org_id { get; set; }
}
}

View File

@@ -67,7 +67,7 @@ public partial class EqpSpotInsRecordD : BaseEntity<string>
/// Default:
/// Nullable:True
/// </summary>
public double? standard_value { get; set; }
public decimal? standard_value { get; set; }
/// <summary>
/// Desc:单位id
@@ -131,4 +131,11 @@ public partial class EqpSpotInsRecordD : BaseEntity<string>
/// Nullable:True
/// </summary>
public string remark { get; set; }
/// <summary>
/// Desc:点巡检设备模板id
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string spot_ins_tem_equip_id {get;set;}
}

View File

@@ -27,6 +27,7 @@ namespace Tnb.EquipMgr.Entities
/// </summary>
public DateTime? modify_time { get; set; }
/// <summary>
/// Desc:设备id
/// Default:
@@ -70,18 +71,18 @@ namespace Tnb.EquipMgr.Entities
public DateTime? send_date_time { get; set; }
/// <summary>
/// Desc:滞后推送时间
/// Desc:计划执行通知提前量
/// Default:
/// Nullable:True
/// </summary>
public DateTime? after_send_date_time { get; set; }
public int? plan_run_notice { get; set; }
/// <summary>
/// Desc:是否滞后推送
/// Desc:执行滞后推送时间
/// Default:
/// Nullable:True
/// </summary>
public int? is_after_send { get; set; }
public int? plan_delay { get; set; }
/// <summary>
/// Desc:创建用户
@@ -131,5 +132,81 @@ namespace Tnb.EquipMgr.Entities
/// Nullable:True
/// </summary>
public string send_id { get; set; }
/// <summary>
/// Desc:编码
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string code { get; set; }
/// <summary>
/// Desc:计划执行通知提前量单位 1 小时 2 天 3 周
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string plan_run_notice_unit { get; set; }
/// <summary>
/// Desc:执行滞后推送时间单位 1 小时 2 天 3 周
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string plan_delay_unit { get; set; }
/// <summary>
/// Desc:复核岗位id
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string repeat_post_info_user_id { get; set; }
/// <summary>
/// Desc:责任岗位id
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string send_post_info_user_id { get; set; }
/// <summary>
/// Desc:是否复核
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string is_repeat { get; set; }
/// <summary>
/// Desc:复核时间
/// Default:
/// Nullable:True
/// </summary>
public DateTime? repeat_time {get;set;}
/// <summary>
/// Desc:复核备注
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string repeat_remark {get;set;}
/// <summary>
/// Desc:复核人id
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public string repeat_user_id {get;set;}
/// <summary>
/// Desc:仅用于关联表字段查询用不存储数据
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="query_info")]
public string query_info {get;set;}
/// <summary>
/// 附件
/// </summary>
public string attachment { get; set; }
}
}

View File

@@ -0,0 +1,33 @@
using SqlSugar;
using Tnb.Common.Contracts;
namespace Tnb.EquipMgr.Entities
{
///<summary>
///点巡检设备模板子表
///</summary>
[SugarTable("eqp_spot_ins_tem_equip_d")]
public class EqpSpotInsTemEquipD : BaseEntity<string>
{
public EqpSpotInsTemEquipD(){
}
/// <summary>
/// Desc:设备模板id
/// Default:
/// Nullable:False
/// </summary>
public string spot_ins_tem_equip_id {get;set;}
/// <summary>
/// Desc:点巡检项id
/// Default:
/// Nullable:False
/// </summary>
public string spot_ins_item_id {get;set;}
}
}

View File

@@ -1,29 +1,11 @@
using System.Dynamic;
using System.Reflection.Emit;
using Aop.Api.Domain;
using JNPF.Common.Core.Manager;
using JNPF.Common.Enums;
using JNPF.Common.Extension;
using JNPF.Common.Security;
using JNPF.Common.Core.Manager;
using JNPF.DependencyInjection;
using JNPF.DynamicApiController;
using JNPF.Extensitions.EventBus;
using JNPF.FriendlyException;
using JNPF.Logging;
using JNPF.Systems.Interfaces.System;
using JNPF.VisualDev;
using JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
using Mapster;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Senparc.Weixin.Work.AdvancedAPIs.MailList;
using SqlSugar;
using Tnb.BasicData;
using Tnb.BasicData.Entitys.Entity;
using Tnb.EquipMgr.Entities;
using Tnb.ProductionMgr.Entities;
using Tnb.ProductionMgr.Entities.Dto;
using Tnb.ProductionMgr.Entities.Enums;
using Tnb.ProductionMgr.Interfaces;
namespace Tnb.ProductionMgr;

View File

@@ -59,6 +59,7 @@ public class JwtHandler : AppAuthorizeHandler
return true;
// 路由名称
if (httpContext.Request.Path.Value == null) return false;
var routeName = httpContext.Request.Path.Value[1..].Replace("/", ":");
if (httpContext.Request.Path.StartsWithSegments("/api"))
routeName = httpContext.Request.Path.Value[5..].Replace("/", ":");
@@ -76,6 +77,7 @@ public class JwtHandler : AppAuthorizeHandler
// 检查授权
//return permissionList.Contains(routeName);
await Task.CompletedTask;
return true;
}
}

View File

@@ -98,7 +98,7 @@ public class Startup : AppStartup
app.UseInject(string.Empty);
//app.MapWebSocketManager("/api/message/websocket", serviceProvider.GetService<IMHandler>());
app.MapWebSocketManager("/websocket", serviceProvider.GetService<IMHandler>());
app.MapWebSocketManager("/websocket", serviceProvider.GetRequiredService<IMHandler>());
app.UseEndpoints(endpoints =>
{

View File

@@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS8618;</NoWarn>
</PropertyGroup>
<ItemGroup>

View File

@@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS8600;CS8601;CS8602;CS8603;CS8604;CS8625;CS1572;CS1573;</NoWarn>
</PropertyGroup>
<ItemGroup>

View File

@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<NoWarn>$(NoWarn);CS1591;CA1307;CS8625;CS8600;CS8601;CS8604;CS8618;</NoWarn>
<NoWarn>$(NoWarn);CS1591;</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">

View File

@@ -112,7 +112,7 @@ public static class EnumExtensions
{
if (field.FieldType.IsEnum)
{
strValue = ((int)enumType.InvokeMember(field.Name, BindingFlags.GetField, null, null, null)).ToString();
strValue = ((int?)enumType.InvokeMember(field.Name, BindingFlags.GetField, null, null, null)).ToString();
object[] arr = field.GetCustomAttributes(typeDescription, true);
if (arr.Length > 0)
{

View File

@@ -253,7 +253,9 @@ public class ElemeAuthRequest : DefaultAuthRequest
{
//就是比string往后一直加要好的优化容器
StringBuilder sb = new StringBuilder();
#pragma warning disable SYSLIB0021 //MD5CryptoServiceProvider已过时
using (MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider())
#pragma warning disable SYSLIB0021 //MD5CryptoServiceProvider已过时
{
//将输入字符串转换为字节数组并计算哈希。
byte[] data = md5.ComputeHash(Encoding.UTF8.GetBytes(willMd5Str));

View File

@@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS8600;CS8601;CS8602;CS8603;CS8604;CS8618;CS8625;CS1572;CS1573;CS0168;</NoWarn>
</PropertyGroup>
<ItemGroup>

View File

@@ -4,6 +4,7 @@ using System.Text;
namespace JNPF.Extras.CollectiveOAuth.Utils;
#pragma warning disable SYSLIB0014 //WebRequest.Create已过时
public class HttpUtils
{
/// <summary>
@@ -269,4 +270,5 @@ public class HttpUtils
return result;
}
}
}
#pragma warning restore SYSLIB0014 //WebRequest.Create已过时

View File

@@ -52,7 +52,7 @@ public class TwitterBase
#region IComparer<QueryParameter> Members
public int Compare(QueryParameter x, QueryParameter y)
public int Compare(QueryParameter? x, QueryParameter? y)
{
if (x.Name == y.Name)
{

View File

@@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS8600;CS8601;CS8602;CS8603;CS8604;CS8618;CS8625;CS1572;CS1573;CS0168;CS1998;</NoWarn>
</PropertyGroup>
<ItemGroup>

View File

@@ -0,0 +1,350 @@
using JetBrains.Annotations;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace Tnb.Common;
[DebuggerStepThrough]
public static class Check
{
public static T NotNull<T>(T value, string parameterName)
{
if (value == null)
{
throw new ArgumentNullException(parameterName);
}
return value;
}
public static T NotNull<T>(
T value,
string parameterName,
string message)
{
if (value == null)
{
throw new ArgumentNullException(parameterName, message);
}
return value;
}
public static string NotNull(
string value,
string parameterName,
int maxLength = int.MaxValue,
int minLength = 0)
{
if (value == null)
{
throw new ArgumentException($"{parameterName} can not be null!", parameterName);
}
if (value.Length > maxLength)
{
throw new ArgumentException($"{parameterName} length must be equal to or lower than {maxLength}!", parameterName);
}
if (minLength > 0 && value.Length < minLength)
{
throw new ArgumentException($"{parameterName} length must be equal to or bigger than {minLength}!", parameterName);
}
return value;
}
public static string NotNullOrWhiteSpace(
string value,
string parameterName,
int maxLength = int.MaxValue,
int minLength = 0)
{
if (string.IsNullOrWhiteSpace(value))
{
throw new ArgumentException($"{parameterName} can not be null, empty or white space!", parameterName);
}
if (value.Length > maxLength)
{
throw new ArgumentException($"{parameterName} length must be equal to or lower than {maxLength}!", parameterName);
}
if (minLength > 0 && value.Length < minLength)
{
throw new ArgumentException($"{parameterName} length must be equal to or bigger than {minLength}!", parameterName);
}
return value;
}
public static string NotNullOrEmpty(
string value,
string parameterName,
int maxLength = int.MaxValue,
int minLength = 0)
{
if (string.IsNullOrEmpty(value))
{
throw new ArgumentException($"{parameterName} can not be null or empty!", parameterName);
}
if (value.Length > maxLength)
{
throw new ArgumentException($"{parameterName} length must be equal to or lower than {maxLength}!", parameterName);
}
if (minLength > 0 && value.Length < minLength)
{
throw new ArgumentException($"{parameterName} length must be equal to or bigger than {minLength}!", parameterName);
}
return value;
}
public static ICollection<T> NotNullOrEmpty<T>(ICollection<T> value, string parameterName)
{
if (value == null || value.Count <= 0)
{
throw new ArgumentException(parameterName + " can not be null or empty!", parameterName);
}
return value;
}
public static Type AssignableTo<TBaseType>(
Type type,
string parameterName)
{
NotNull(type, parameterName);
if (!type.IsAssignableTo(typeof(TBaseType)))
{
throw new ArgumentException($"{parameterName} (type of {type.AssemblyQualifiedName}) should be assignable to the {typeof(TBaseType).FullName}!");
}
return type;
}
public static string Length(
[AllowNull] string value,
string parameterName,
int maxLength,
int minLength = 0)
{
if (minLength > 0)
{
if (string.IsNullOrEmpty(value))
{
throw new ArgumentException(parameterName + " can not be null or empty!", parameterName);
}
if (value.Length < minLength)
{
throw new ArgumentException($"{parameterName} length must be equal to or bigger than {minLength}!", parameterName);
}
}
if (value != null && value.Length > maxLength)
{
throw new ArgumentException($"{parameterName} length must be equal to or lower than {maxLength}!", parameterName);
}
return value!;
}
public static short Positive(
short value,
string parameterName)
{
if(value == 0)
{
throw new ArgumentException($"{parameterName} is equal to zero");
}
else if(value < 0)
{
throw new ArgumentException($"{parameterName} is less than zero");
}
return value;
}
public static Int32 Positive(
Int32 value,
string parameterName)
{
if (value == 0)
{
throw new ArgumentException($"{parameterName} is equal to zero");
}
else if (value < 0)
{
throw new ArgumentException($"{parameterName} is less than zero");
}
return value;
}
public static Int64 Positive(
Int64 value,
string parameterName)
{
if (value == 0)
{
throw new ArgumentException($"{parameterName} is equal to zero");
}
else if (value < 0)
{
throw new ArgumentException($"{parameterName} is less than zero");
}
return value;
}
public static float Positive(
float value,
string parameterName)
{
if (value == 0)
{
throw new ArgumentException($"{parameterName} is equal to zero");
}
else if (value < 0)
{
throw new ArgumentException($"{parameterName} is less than zero");
}
return value;
}
public static double Positive(
double value,
string parameterName)
{
if (value == 0)
{
throw new ArgumentException($"{parameterName} is equal to zero");
}
else if (value < 0)
{
throw new ArgumentException($"{parameterName} is less than zero");
}
return value;
}
public static decimal Positive(
decimal value,
string parameterName)
{
if (value == 0)
{
throw new ArgumentException($"{parameterName} is equal to zero");
}
else if (value < 0)
{
throw new ArgumentException($"{parameterName} is less than zero");
}
return value;
}
public static Int16 Range(
Int16 value,
string parameterName,
Int16 minimumValue,
Int16 maximumValue = Int16.MaxValue)
{
if(value < minimumValue || value > maximumValue)
{
throw new ArgumentException($"{parameterName} is out of range min: {minimumValue} - max: {maximumValue}");
}
return value;
}
public static Int32 Range(
Int32 value,
string parameterName,
Int32 minimumValue,
Int32 maximumValue = Int32.MaxValue)
{
if (value < minimumValue || value > maximumValue)
{
throw new ArgumentException($"{parameterName} is out of range min: {minimumValue} - max: {maximumValue}");
}
return value;
}
public static Int64 Range(
Int64 value,
string parameterName,
Int64 minimumValue,
Int64 maximumValue = Int64.MaxValue)
{
if (value < minimumValue || value > maximumValue)
{
throw new ArgumentException($"{parameterName} is out of range min: {minimumValue} - max: {maximumValue}");
}
return value;
}
public static float Range(
float value,
string parameterName,
float minimumValue,
float maximumValue = float.MaxValue)
{
if (value < minimumValue || value > maximumValue)
{
throw new ArgumentException($"{parameterName} is out of range min: {minimumValue} - max: {maximumValue}");
}
return value;
}
public static double Range(
double value,
string parameterName,
double minimumValue,
double maximumValue = double.MaxValue)
{
if (value < minimumValue || value > maximumValue)
{
throw new ArgumentException($"{parameterName} is out of range min: {minimumValue} - max: {maximumValue}");
}
return value;
}
public static decimal Range(
decimal value,
string parameterName,
decimal minimumValue,
decimal maximumValue = decimal.MaxValue)
{
if (value < minimumValue || value > maximumValue)
{
throw new ArgumentException($"{parameterName} is out of range min: {minimumValue} - max: {maximumValue}");
}
return value;
}
public static T NotDefaultOrNull<T>(
T? value,
string parameterName)
where T : struct
{
if (value == null)
{
throw new ArgumentException($"{parameterName} is null!", parameterName);
}
if (value.Value.Equals(default(T)))
{
throw new ArgumentException($"{parameterName} has a default value!", parameterName);
}
return value.Value;
}
}

View File

@@ -31,7 +31,7 @@ public static class BooleanExtensions
/// </summary>
private static bool? GetBool(this object data)
{
switch (data.ToString().Trim().ToLower())
switch (data.ToString()?.Trim().ToLower())
{
case "0":
return false;

View File

@@ -16,7 +16,7 @@ public static class DictionaryExtensions
/// <param name="dictionary">要操作的字典.</param>
/// <param name="key">指定键名.</param>
/// <returns>获取到的值.</returns>
public static TValue GetOrDefault<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key)
public static TValue? GetOrDefault<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key)
{
return dictionary.TryGetValue(key, out TValue value) ? value : default(TValue);
}

View File

@@ -152,7 +152,7 @@ public static class EnumExtensions
/// <returns></returns>
public static string GetDescription(this System.Enum value)
{
return value.GetType().GetMember(value.ToString()).FirstOrDefault()?.GetCustomAttribute<DescriptionAttribute>()?.Description;
return value.GetType().GetMember(value.ToString()).FirstOrDefault()?.GetCustomAttribute<DescriptionAttribute>()?.Description ?? string.Empty;
}
/// <summary>
@@ -162,7 +162,7 @@ public static class EnumExtensions
/// <returns></returns>
public static string GetDescription(this object value)
{
return value.GetType().GetMember(value.ToString() ?? string.Empty).FirstOrDefault()?.GetCustomAttribute<DescriptionAttribute>()?.Description;
return value.GetType().GetMember(value.ToString() ?? string.Empty).FirstOrDefault()?.GetCustomAttribute<DescriptionAttribute>()?.Description ?? string.Empty;
}
/// <summary>

View File

@@ -219,7 +219,7 @@ public static partial class Extensions
/// </summary>
private static bool? GetBool(this object data)
{
switch (data.ToString().Trim().ToLower())
switch (data.ToString()?.Trim().ToLower())
{
case "0":
return false;
@@ -466,7 +466,7 @@ public static partial class Extensions
{
try
{
return obj == null ? string.Empty : obj.ToString();
return obj == null ? string.Empty : obj.ToString()!;
}
catch
{
@@ -489,7 +489,7 @@ public static partial class Extensions
return string.Join(",", list);
}
return obj.ToString();
return obj.ToString()!;
}
catch
{
@@ -608,7 +608,7 @@ public static partial class Extensions
/// 是否为空.
/// </summary>
/// <param name="value">值.</param>
public static bool IsEmpty(this string value)
public static bool IsEmpty(this string? value)
{
return string.IsNullOrWhiteSpace(value);
}
@@ -678,7 +678,7 @@ public static partial class Extensions
/// <returns></returns>
public static string ObjToString(this object thisValue)
{
if (thisValue != null) return thisValue.ToString().Trim();
if (thisValue != null) return thisValue.ToString()!.Trim();
return string.Empty;
}

View File

@@ -38,7 +38,7 @@ public static class RandomExtensions
Array array = System.Enum.GetValues(type);
int index = random.Next(array.GetLowerBound(0), array.GetUpperBound(0) + 1);
return (T)array.GetValue(index);
return (T)array.GetValue(index)!;
}
/// <summary>
@@ -67,7 +67,7 @@ public static class RandomExtensions
public static T NextItem<T>(this Random random, T[] items)
{
if (items == null || items.Length == 0)
return default(T);
return default(T)!;
return items[random.Next(items.Length)];
}

View File

@@ -950,4 +950,284 @@ public static class StringExtensions
}
#endregion
#region ,Abp
/// <summary>
/// Converts PascalCase string to camelCase string.
/// </summary>
/// <param name="str">String to convert</param>
/// <param name="useCurrentCulture">set true to use current culture. Otherwise, invariant culture will be used.</param>
/// <param name="handleAbbreviations">set true to if you want to convert 'XYZ' to 'xyz'.</param>
/// <returns>camelCase of the string</returns>
public static string ToCamelCase(this string str, bool useCurrentCulture = false, bool handleAbbreviations = false)
{
if (string.IsNullOrWhiteSpace(str))
{
return str;
}
if (str.Length == 1)
{
return useCurrentCulture ? str.ToLower() : str.ToLowerInvariant();
}
if (handleAbbreviations && IsAllUpperCase(str))
{
return useCurrentCulture ? str.ToLower() : str.ToLowerInvariant();
}
return (useCurrentCulture ? char.ToLower(str[0]) : char.ToLowerInvariant(str[0])) + str.Substring(1);
}
/// <summary>
/// Converts given PascalCase/camelCase string to sentence (by splitting words by space).
/// Example: "ThisIsSampleSentence" is converted to "This is a sample sentence".
/// </summary>
/// <param name="str">String to convert.</param>
/// <param name="useCurrentCulture">set true to use current culture. Otherwise, invariant culture will be used.</param>
public static string ToSentenceCase(this string str, bool useCurrentCulture = false)
{
if (string.IsNullOrWhiteSpace(str))
{
return str;
}
return useCurrentCulture
? Regex.Replace(str, "[a-z][A-Z]", m => m.Value[0] + " " + char.ToLower(m.Value[1]))
: Regex.Replace(str, "[a-z][A-Z]", m => m.Value[0] + " " + char.ToLowerInvariant(m.Value[1]));
}
/// <summary>
/// Converts given PascalCase/camelCase string to kebab-case.
/// </summary>
/// <param name="str">String to convert.</param>
/// <param name="useCurrentCulture">set true to use current culture. Otherwise, invariant culture will be used.</param>
public static string ToKebabCase(this string str, bool useCurrentCulture = false)
{
if (string.IsNullOrWhiteSpace(str))
{
return str;
}
str = str.ToCamelCase();
return useCurrentCulture
? Regex.Replace(str, "[a-z][A-Z]", m => m.Value[0] + "-" + char.ToLower(m.Value[1]))
: Regex.Replace(str, "[a-z][A-Z]", m => m.Value[0] + "-" + char.ToLowerInvariant(m.Value[1]));
}
/// <summary>
/// Converts given PascalCase/camelCase string to snake case.
/// Example: "ThisIsSampleSentence" is converted to "this_is_a_sample_sentence".
/// https://github.com/npgsql/npgsql/blob/dev/src/Npgsql/NameTranslation/NpgsqlSnakeCaseNameTranslator.cs#L51
/// </summary>
/// <param name="str">String to convert.</param>
/// <returns></returns>
public static string ToSnakeCase(this string str)
{
if (string.IsNullOrWhiteSpace(str))
{
return str;
}
var builder = new StringBuilder(str.Length + Math.Min(2, str.Length / 5));
var previousCategory = default(UnicodeCategory?);
for (var currentIndex = 0; currentIndex < str.Length; currentIndex++)
{
var currentChar = str[currentIndex];
if (currentChar == '_')
{
builder.Append('_');
previousCategory = null;
continue;
}
var currentCategory = char.GetUnicodeCategory(currentChar);
switch (currentCategory)
{
case UnicodeCategory.UppercaseLetter:
case UnicodeCategory.TitlecaseLetter:
if (previousCategory == UnicodeCategory.SpaceSeparator ||
previousCategory == UnicodeCategory.LowercaseLetter ||
previousCategory != UnicodeCategory.DecimalDigitNumber &&
previousCategory != null &&
currentIndex > 0 &&
currentIndex + 1 < str.Length &&
char.IsLower(str[currentIndex + 1]))
{
builder.Append('_');
}
currentChar = char.ToLower(currentChar);
break;
case UnicodeCategory.LowercaseLetter:
case UnicodeCategory.DecimalDigitNumber:
if (previousCategory == UnicodeCategory.SpaceSeparator)
{
builder.Append('_');
}
break;
default:
if (previousCategory != null)
{
previousCategory = UnicodeCategory.SpaceSeparator;
}
continue;
}
builder.Append(currentChar);
previousCategory = currentCategory;
}
return builder.ToString();
}
/// <summary>
/// Converts camelCase string to PascalCase string.
/// </summary>
/// <param name="str">String to convert</param>
/// <param name="useCurrentCulture">set true to use current culture. Otherwise, invariant culture will be used.</param>
/// <returns>PascalCase of the string</returns>
public static string ToPascalCase(this string str, bool useCurrentCulture = false)
{
if (string.IsNullOrWhiteSpace(str))
{
return str;
}
if (str.Length == 1)
{
return useCurrentCulture ? str.ToUpper() : str.ToUpperInvariant();
}
return (useCurrentCulture ? char.ToUpper(str[0]) : char.ToUpperInvariant(str[0])) + str.Substring(1);
}
/// <summary>
/// Removes first occurrence of the given prefixes from beginning of the given string.
/// </summary>
/// <param name="str">The string.</param>
/// <param name="preFixes">one or more prefix.</param>
/// <returns>Modified string or the same string if it has not any of given prefixes</returns>
public static string RemovePreFix(this string str, params string[] preFixes)
{
return str.RemovePreFix(StringComparison.Ordinal, preFixes);
}
/// <summary>
/// Removes first occurrence of the given prefixes from beginning of the given string.
/// </summary>
/// <param name="str">The string.</param>
/// <param name="comparisonType">String comparison type</param>
/// <param name="preFixes">one or more prefix.</param>
/// <returns>Modified string or the same string if it has not any of given prefixes</returns>
public static string RemovePreFix(this string str, StringComparison comparisonType, params string[] preFixes)
{
if (str.IsNullOrEmpty())
{
return str;
}
if (preFixes.IsNullOrEmpty())
{
return str;
}
foreach (var preFix in preFixes)
{
if (str.StartsWith(preFix, comparisonType))
{
return str.Right(str.Length - preFix.Length);
}
}
return str;
}
/// <summary>
/// Removes first occurrence of the given postfixes from end of the given string.
/// </summary>
/// <param name="str">The string.</param>
/// <param name="postFixes">one or more postfix.</param>
/// <returns>Modified string or the same string if it has not any of given postfixes</returns>
public static string RemovePostFix(this string str, params string[] postFixes)
{
return str.RemovePostFix(StringComparison.Ordinal, postFixes);
}
/// <summary>
/// Removes first occurrence of the given postfixes from end of the given string.
/// </summary>
/// <param name="str">The string.</param>
/// <param name="comparisonType">String comparison type</param>
/// <param name="postFixes">one or more postfix.</param>
/// <returns>Modified string or the same string if it has not any of given postfixes</returns>
public static string RemovePostFix(this string str, StringComparison comparisonType, params string[] postFixes)
{
if (str.IsNullOrEmpty())
{
return str;
}
if (postFixes.IsNullOrEmpty())
{
return str;
}
foreach (var postFix in postFixes)
{
if (str.EndsWith(postFix, comparisonType))
{
return str.Left(str.Length - postFix.Length);
}
}
return str;
}
/// <summary>
/// Gets a substring of a string from beginning of the string.
/// </summary>
/// <exception cref="ArgumentNullException">Thrown if <paramref name="str"/> is null</exception>
/// <exception cref="ArgumentException">Thrown if <paramref name="len"/> is bigger that string's length</exception>
public static string Left(this string str, int len)
{
if (str.Length < len)
{
throw new ArgumentException("len argument can not be bigger than given string's length!");
}
return str.Substring(0, len);
}
/// <summary>
/// Gets a substring of a string from end of the string.
/// </summary>
/// <exception cref="ArgumentNullException">Thrown if <paramref name="str"/> is null</exception>
/// <exception cref="ArgumentException">Thrown if <paramref name="len"/> is bigger that string's length</exception>
public static string Right(this string str, int len)
{
if (str.Length < len)
{
throw new ArgumentException("len argument can not be bigger than given string's length!");
}
return str.Substring(str.Length - len, len);
}
private static bool IsAllUpperCase(string input)
{
for (int i = 0; i < input.Length; i++)
{
if (Char.IsLetter(input[i]) && !Char.IsUpper(input[i]))
{
return false;
}
}
return true;
}
#endregion
}

View File

@@ -111,10 +111,10 @@ public class UserAgent : IUserAgent
private DeviceInfo _device;
private OSInfo _os;
private bool? _isBot;
//private bool? _isBot;
private bool? _isMobileDevice;
private bool? _isTablet;
private bool? _isPdfConverter;
//private bool? _isPdfConverter;
static UserAgent()
{
@@ -142,7 +142,7 @@ public class UserAgent : IUserAgent
}
}
return _rawValue;
return _rawValue ?? "";
}
set
@@ -151,10 +151,10 @@ public class UserAgent : IUserAgent
_userAgent = null;
_device = null;
_os = null;
_isBot = null;
//_isBot = null;
_isMobileDevice = null;
_isTablet = null;
_isPdfConverter = null;
//_isPdfConverter = null;
}
}

View File

@@ -54,7 +54,7 @@ public static class CodeGenExportDataHelper
var len = rowChildDatas.Select(x => x.Value.Count()).OrderByDescending(x => x).FirstOrDefault();
if (len != null && len > 0)
if (len > 0)
{
for (int i = 0; i < len; i++)
{

View File

@@ -190,7 +190,7 @@ public static class CodeGenHelper
field = entityInfo.Columns.Find(it => it.PropertyName.Equals(sort.ToUpperCase()))?.DbColumnName;
break;
}
return string.IsNullOrEmpty(field) ? null : field;
return string.IsNullOrEmpty(field) ? "" : field;
}
/// <summary>

View File

@@ -63,7 +63,7 @@ public static class ComparisonHelper<T>
/// <param name="x"></param>
/// <param name="y"></param>
/// <returns></returns>
public int Compare(T x, T y)
public int Compare(T? x, T? y)
{
return _comparer.Compare(_keySelector(x), _keySelector(y));
}

View File

@@ -1,4 +1,5 @@
using JNPF.DependencyInjection;
using System.Diagnostics.CodeAnalysis;
using JNPF.DependencyInjection;
namespace JNPF.Common.Security;
@@ -49,14 +50,14 @@ public static class EqualityHelper<T>
: this(keySelector, EqualityComparer<TV>.Default)
{ }
public bool Equals(T x, T y)
public bool Equals(T? x, T? y)
{
return _comparer.Equals(_keySelector(x), _keySelector(y));
}
public int GetHashCode(T obj)
public int GetHashCode([DisallowNull] T obj)
{
return _comparer.GetHashCode(_keySelector(obj));
return _comparer.GetHashCode(_keySelector(obj)!);
}
}
}

View File

@@ -1,6 +1,7 @@
using System.Drawing;
using System.Reflection;
using System.Text;
using JNPF.Common.Helper;
using JNPF.Common.Models.NPOI;
using JNPF.DependencyInjection;
using NPOI.HPSF;
@@ -8,9 +9,13 @@ using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using NPOI.SS.Util;
using NPOI.XSSF.UserModel;
using Spire.Doc;
using static Microsoft.AspNetCore.Razor.Language.TagHelperMetadata;
namespace JNPF.Common.Security;
#pragma warning disable CS0618, CA2200 //再次引发捕获到的异常会更改堆栈信息
/// <summary>
/// Excel导出操作类
/// 版 本V3.2.0
@@ -740,7 +745,7 @@ public class ExcelExportHelper<T>
}
catch (Exception ex)
{
throw;
throw ex;
}
}
@@ -1039,7 +1044,7 @@ public class ExcelExportHelper<T>
}
catch (Exception ex)
{
throw;
throw ex;
}
}
@@ -1168,4 +1173,5 @@ public class ExcelExportHelper<T>
}
#endregion
}
}
#pragma warning restore CS0618, CA2200 //再次引发捕获到的异常会更改堆栈信息

View File

@@ -108,7 +108,7 @@ namespace JNPF.Common.Helper
//}
//else
//{
dataRow[j] = cell.ToString().Trim();
dataRow[j] = cell.ToString()?.Trim();
//}
}
}

View File

@@ -494,7 +494,9 @@ public class FileHelper
}
catch (Exception ex)
{
#pragma warning disable CA2200 //再次引发捕获到的异常会更改堆栈信息
throw ex;
#pragma warning disable CA2200 //再次引发捕获到的异常会更改堆栈信息
}
finally
{
@@ -505,6 +507,7 @@ public class FileHelper
#endregion
#pragma warning disable CA1416 // 验证平台兼容性
#region
/// <summary>
@@ -669,6 +672,7 @@ public class FileHelper
}
#endregion
#pragma warning restore CA1416 // 验证平台兼容性
#region
@@ -712,7 +716,8 @@ public class FileHelper
if (selectFiles.Count > 0)
{
return selectFiles.FirstOrDefault().FullName;
//modified by PhilPan
return selectFiles.First().FullName;
}
return Path.Combine(folderPath, $@"{prefix}_{DateTime.Now.ParseToUnixTime()}.log");
@@ -737,7 +742,7 @@ public class FileHelper
Microsoft.AspNetCore.Http.HttpContext? httpContext = App.HttpContext;
httpContext.Response.ContentType = "application/octet-stream";
httpContext.Response.Headers.Add("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(fileName, Encoding.UTF8));
httpContext.Response.Headers.Add("Content-Length", buff.Length.ToString());
httpContext.Response.Headers.Add("Content-Length", buff?.Length.ToString());
httpContext.Response.Body.WriteAsync(buff);
httpContext.Response.Body.Flush();
httpContext.Response.Body.Close();

View File

@@ -46,7 +46,7 @@ public static class JsonHelper
/// <returns></returns>
public static T ToObject<T>(this string json)
{
return _ = _jsonSerializer.Deserialize<T>(json) ?? default(T);
return _jsonSerializer.Deserialize<T>(json);
}
/// <summary>
@@ -58,7 +58,7 @@ public static class JsonHelper
/// <returns></returns>
public static T ToObject<T>(this string json, object jsonSerializerOptions = default)
{
return _ = _jsonSerializer.Deserialize<T>(json, jsonSerializerOptions) ?? default(T);
return _jsonSerializer.Deserialize<T>(json, jsonSerializerOptions);
}
/// <summary>
@@ -69,7 +69,7 @@ public static class JsonHelper
/// <returns></returns>
public static T ToObject<T>(this object json)
{
return _ = ToJsonString(json).ToObject<T>() ?? default(T);
return ToJsonString(json).ToObject<T>();
}
/// <summary>
@@ -81,7 +81,7 @@ public static class JsonHelper
/// <returns></returns>
public static T ToObject<T>(this object json, object jsonSerializerOptions = default)
{
return _ = ToJsonString(json, jsonSerializerOptions).ToObject<T>(jsonSerializerOptions) ?? default(T);
return ToJsonString(json, jsonSerializerOptions).ToObject<T>(jsonSerializerOptions);
}
/// <summary>
@@ -92,7 +92,7 @@ public static class JsonHelper
/// <returns></returns>
public static List<T> ToList<T>(this string json)
{
return _ = _jsonSerializer.Deserialize<List<T>>(json) ?? null;
return _jsonSerializer.Deserialize<List<T>>(json);
}
/// <summary>
@@ -104,7 +104,7 @@ public static class JsonHelper
/// <returns></returns>
public static List<T> ToList<T>(this string json, object jsonSerializerOptions = default)
{
return _ = _jsonSerializer.Deserialize<List<T>>(json, jsonSerializerOptions) ?? null;
return _jsonSerializer.Deserialize<List<T>>(json, jsonSerializerOptions);
}
/// <summary>

View File

@@ -217,6 +217,7 @@ public static class MachineHelper
}
#endregion
#pragma warning disable CA1416 // 验证平台兼容性
#region Windows
/// <summary>
@@ -364,4 +365,6 @@ public static class MachineHelper
}
#endregion
#pragma warning restore CA1416 // 验证平台兼容性
}

View File

@@ -60,7 +60,7 @@ public class SuperQueryHelper
{
case JnpfKeyConst.COMINPUT:
case JnpfKeyConst.TEXTAREA:
item.fieldValue = item.fieldValue?.ToString().Replace("\r\n", string.Empty);
item.fieldValue = item.fieldValue?.ToString()?.Replace("\r\n", string.Empty);
switch (item.symbol)
{
case "==": // 等于
@@ -549,8 +549,9 @@ public class SuperQueryHelper
queryOr.mainWhere = true;
queryList.Add(queryOr);
}
//modified by PhilPan
continue;
}
continue;
switch (item.symbol)
{
case ">=": // 大于等于

View File

@@ -7,6 +7,7 @@
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS8600;CS8601;CS8602;CS8603;CS8604;CS8605;CS8618;CS8619;CS8625;CS1572;CS1573;</NoWarn>
</PropertyGroup>
<ItemGroup>

View File

@@ -18,7 +18,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="SqlSugarCore" Version="5.1.4.60" />
<PackageReference Include="SqlSugarCore" Version="5.1.4.73" />
<PackageReference Include="Tnb.Core" Version="2023.3.24.1010" />
<!--<ProjectReference Include="..\..\..\Tnb.Core\Tnb.Core\Tnb.Core.csproj" />-->
</ItemGroup>

View File

@@ -7,6 +7,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS8600;CS8601;CS8602;CS8603;CS8604;CS8618;CS8625;CS1572;CS1573;CS0168;CS0618;</NoWarn>
</PropertyGroup>
<ItemGroup>

View File

@@ -7,6 +7,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS8600;CS8601;CS8602;CS8603;CS8604;CS8618;CS1572;CS1573;CS1998;</NoWarn>
</PropertyGroup>
<ItemGroup>

View File

@@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS8618;</NoWarn>
</PropertyGroup>
<ItemGroup>

View File

@@ -44,12 +44,14 @@ public class OrderService : IDynamicApiController, ITransient
ISqlSugarRepository<OrderEntity> repository,
IUserManager userManager,
IUsersService usersService,
ICacheManager cacheManager)
ICacheManager cacheManager,
IFileManager fileManager)
{
_repository = repository;
_userManager = userManager;
_usersService = usersService;
_cacheManager = cacheManager;
_fileManager = fileManager;
}
#region GET

View File

@@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS8600;CS8601;CS8602;CS8603;CS8604;CS8618;CS8625;CS1572;CS1573;CS0168;CS4014;</NoWarn>
</PropertyGroup>
<ItemGroup>

View File

@@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS8618;</NoWarn>
</PropertyGroup>
<ItemGroup>

View File

@@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS8625;</NoWarn>
</PropertyGroup>
<ItemGroup>

View File

@@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS8600;CS8601;CS8602;CS8603;CS8604;CS8625;CS1572;CS1573;CS0168;</NoWarn>
</PropertyGroup>
<ItemGroup>

View File

@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(SolutionDir)\common.props" />
<PropertyGroup>
@@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS8600;CS8601;CS8602;CS8603;CS8604;CS8618;CS8625;CS1572;CS1573;</NoWarn>
</PropertyGroup>
<ItemGroup>

View File

@@ -7,10 +7,11 @@ namespace JNPF.Systems.Entitys.Dto.OrganizeAdministrator;
/// </summary>
public class OrganizeAdminIsTratorUpInput : OrganizeAdminCrInput
{
/// <summary>
/// 主键.
/// </summary>
public string id { get; set; }
//modified by PhilPan
///// <summary>
///// 主键.
///// </summary>
//public string id { get; set; }
/// <summary>
/// 权限组织集合.

View File

@@ -44,11 +44,11 @@ public class AuthorizeEntity : CEntityBase
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
public override bool Equals(object obj)
public override bool Equals(object? obj)
{
if (obj is AuthorizeEntity)
if (obj is AuthorizeEntity authorizeEntity)
{
AuthorizeEntity authorizeEntity = obj as AuthorizeEntity;
//AuthorizeEntity authorizeEntity = obj as AuthorizeEntity;
return ItemType == authorizeEntity.ItemType && ItemId == authorizeEntity.ItemId && ObjectId == authorizeEntity.ObjectId && ObjectType == authorizeEntity.ObjectType;
}

View File

@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(SolutionDir)\common.props" />
<PropertyGroup>
@@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS8603;CS8618;</NoWarn>
</PropertyGroup>
<ItemGroup>

View File

@@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS8625;</NoWarn>
</PropertyGroup>
<ItemGroup>

View File

@@ -386,51 +386,39 @@ public class DataBaseService : IDynamicApiController, ITransient
sugarClient = _dataBaseManager.ChangeDataBase(link);
}
string CustomFormatName(string s)
var entityName = string.Join("", input.TableName.Split('_').Select(a => a.ToPascalCase()));
foreach (var item in sugarClient.DbMaintenance.GetTableInfoList().Where(t => t.Name == input.TableName))
{
var pos = 0;
if ((pos = s.IndexOf("_", StringComparison.Ordinal)) > -1)
{
var separatorStrings = Regex.Split(s, @"_", RegexOptions.Compiled);
if (separatorStrings.Length > 2)
{
var sb = new StringBuilder();
foreach (var item in separatorStrings)
{
sb.Append(item.ToUpperCase());
}
return sb.ToString();
}
else
{
var first = s.AsSpan().Slice(0, pos).ToString().ToUpperCase();
var second = s.AsSpan().Slice(pos + 1).ToString().ToUpperCase();
return $"{first}{second}";
}
}
else
{
return s.ToUpperCase();
}
}
foreach (var item in sugarClient!.DbMaintenance.GetTableInfoList().Where(t => t.Name == input.TableName))
{
string entityName = CustomFormatName(item.Name);/*实体名首字母大写*/
//string entityName = CustomFormatName(item.Name);/*实体名首字母大写*/
sugarClient.MappingTables.Add(entityName, item.Name);
foreach (var col in sugarClient.DbMaintenance.GetColumnInfosByTableName(item.Name))
{
//var colName = CustomFormatName(col.DbColumnName);
sugarClient.MappingColumns.Add(col.DbColumnName /*类的属性首字母大写*/, col.DbColumnName, entityName);
}
//foreach (var col in sugarClient.DbMaintenance.GetColumnInfosByTableName(item.Name))
//{
// //var colName = CustomFormatName(col.DbColumnName);
// sugarClient.MappingColumns.Add(col.DbColumnName /*类的属性首字母大写*/, col.DbColumnName, entityName);
//}
}
var prefix = input.TableName.Split('_')[0];
Dictionary<string, string> nsMapper = new()
{
{"bas", "Tnb.BasicData.Entities" },
{"prd", "Tnb.ProductionMgr.Entities" },
{"wms", "Tnb.WarehouseMgr.Entities" },
{"eqp", "Tnb.EquipMgr.Entities" },
{"tool", "Tnb.EquipMgr.Entities" },
{"qc", "Tnb.QcMgr.Entities" },
};
sugarClient.DbFirst.Where(input.TableName)
.FormatFileName(CustomFormatName)
.SettingConstructorTemplate(a =>
{
return a;
})
//.IsCreateDefaultValue(true)
.IsCreateAttribute()
.CreateClassFile(dir, "DbModels");
.StringNullable()
.CreateClassFile(dir, nsMapper.ContainsKey(prefix) ? nsMapper[prefix] : "Tnb.Entities");
var previewContent = "";
var codeFile = Path.Combine(dir, $"{CustomFormatName(input.TableName)}.cs");
var codeFile = Path.Combine(dir, $"{entityName}.cs");
if (File.Exists(codeFile))
{
using (var sr = File.OpenText(codeFile))

View File

@@ -143,7 +143,7 @@ public class ModuleDataAuthorizeSchemeService : IModuleDataAuthorizeSchemeServic
/// <param name="moduleId">功能主键.</param>
/// <returns></returns>
[NonAction]
public async Task<List<ModuleDataAuthorizeSchemeEntity>> GetList(string moduleId)
public async Task<List<ModuleDataAuthorizeSchemeEntity>> GetList(string? moduleId)
{
return await _repository.AsQueryable().Where(x => x.DeleteMark == null && x.ModuleId == moduleId).OrderBy(a => a.SortCode).OrderBy(a => a.CreatorTime, OrderByType.Desc).OrderBy(a => a.LastModifyTime, OrderByType.Desc).ToListAsync();
}

View File

@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(SolutionDir)\common.props" />
<PropertyGroup>
@@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS8600;CS8601;CS8602;CS8603;CS8604;CS8619;CS8625;CS8629;CS1572;CS1573;CS0168;CS4014;CS1998;</NoWarn>
</PropertyGroup>
<ItemGroup>

View File

@@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
<NoWarn>$(NoWarn)CS8604;CS8618;</NoWarn>
</PropertyGroup>
<ItemGroup>

View File

@@ -1,11 +1,186 @@
using JNPF.Common.Security;
using JNPF.Logging;
using Microsoft.AspNetCore.Components;
using SqlSugar;
using Tnb.EquipMgr.Entities;
namespace JNPF.TaskScheduler.Listener
{
/// <summary>
/// 生成点巡检计划
/// </summary>
public class GenerateSpotInspectionPlanTimeWorker : ISpareTimeWorker
{
[SpareTime("0 45 14 * * ? *", "生成点巡检计划", ExecuteType = SpareTimeExecuteTypes.Serial,StartNow = false)]
private ISqlSugarRepository<EqpSpotInsTemEquipH> _repository => App.GetService<ISqlSugarRepository<EqpSpotInsTemEquipH>>();
// public GenerateSpotInspectionPlanTimeWorker(ISqlSugarRepository<EqpSpotInsTemEquipH> repository)
// {
// _repository = repository;
// }
[SpareTime("0 0 0 * * ?", "生成点巡检计划", ExecuteType = SpareTimeExecuteTypes.Serial,StartNow = false)]
public void GenerateSpotInspectionPlan(SpareTimer timer, long count)
{
Console.WriteLine("hello world");
Log.Information("----------------------开始生成点巡检计划----------------------");
try
{
List<EqpSpotInsTemEquipH> eqpSpotInsTemEquipHsByOne = _repository.GetList(x => x.is_start=="1" && x.plan_cycle_unit == "1");
List<EqpSpotInsTemEquipH> eqpSpotInsTemEquipHsByCirculate = _repository.GetList(x => x.is_start=="1" && x.plan_cycle_unit == "2");
List<EqpSpotInsRecordH> tobeCreateList = new List<EqpSpotInsRecordH>();
List<EqpSpotInsTemEquipH> tobeCreateTemplets = new List<EqpSpotInsTemEquipH>();
var db = _repository.AsSugarClient();
foreach (var item in eqpSpotInsTemEquipHsByOne)
{
if (item.start_time.AddHours((double)item.plan_cycle).ToString("yyyy-MM-dd HH:mm") == DateTime.Now.ToString("yyyy-MM-dd HH:mm"))
{
tobeCreateTemplets.Add(item);
}
}
if (eqpSpotInsTemEquipHsByCirculate != null && eqpSpotInsTemEquipHsByCirculate.Count > 0)
{
//查询最后一条数据加上周期是否等于现在等于表示周期到了 已废除
// List<string> ids = eqpSpotInsTemEquipHsByCirculate.Select(x => x.id).ToList();
// List<SpotInsRecordLastDTO> lastPlans = db.Queryable<EqpSpotInsRecordH>()
// .GroupBy(a => new { a.spot_ins_tem_equip_id })
// .Where(a => ids.Contains(a.spot_ins_tem_equip_id))
// .Select(a => new SpotInsRecordLastDTO()
// {
// spot_ins_tem_equip_id = a.spot_ins_tem_equip_id,
// create_time = SqlFunc.AggregateMax(a.create_time.Value)
// }).ToList();
//
// foreach (var item in eqpSpotInsTemEquipHsByCirculate)
// {
// var lastPlan = lastPlans.FirstOrDefault(x => x.spot_ins_tem_equip_id == item.id);
// if (lastPlan == null || lastPlan.create_time == null || lastPlan.create_time.AddHours((double)item.plan_cycle).ToString("yyyy-MM-dd HH") == DateTime.Now.ToString("yyyy-MM-dd HH"))
// {
// tobeCreateTemplets.Add(item);
// }
// }
//整除表示一个周期到了
foreach (var item in eqpSpotInsTemEquipHsByCirculate)
{
TimeSpan ts1 = new TimeSpan(Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm")).Ticks);
TimeSpan ts2 = new TimeSpan(Convert.ToDateTime(item.start_time.ToString("yyyy-MM-dd HH:mm")).Ticks);
TimeSpan ts3 = ts1.Subtract(ts2).Duration();
if (ts3.TotalMinutes * 10 / 60 % (10 * (double)item.plan_cycle)==0)
{
tobeCreateTemplets.Add(item);
}
}
}
if (tobeCreateTemplets != null && tobeCreateTemplets.Count > 0)
{
List<EqpEquipment> equipments = db.Queryable<EqpEquipment>().Where(x => x.life==Tnb.EquipMgr.EquipmentLife.ENABLE).ToList();
int index = 1;
foreach (var item in tobeCreateTemplets)
{
//只有启用设备才生成计划
if (equipments.FirstOrDefault(x => x.id == item.equip_id) == null)
continue;
string code = $"{DateTime.Now.ToString("yyyyMMddHHmm")+(index++).ToString().PadLeft(3,'0')}";
tobeCreateList.Add(new EqpSpotInsRecordH()
{
id = SnowflakeIdHelper.NextId(),
code = code,
// equip_type_id = item.equip_type_id,
equip_id = item.equip_id,
spot_ins_tem_equip_id = item.id,
plan_run_notice = item.plan_run_notice,
plan_run_notice_unit = item.plan_run_notice_unit,
plan_delay = item.plan_delay,
plan_delay_unit = item.plan_delay_unit,
send_post_info_user_id = item.send_post_info_user_id,
is_repeat = item.is_repeat,
repeat_post_info_user_id = item.repeat_post_info_user_id,
is_send = item.is_send,
create_time = DateTime.Now,
});
}
}
if (tobeCreateList != null && tobeCreateList.Count > 0)
{
List<string> templetIDs = tobeCreateList.Select(x => x.spot_ins_tem_equip_id).ToList();
List<EqpSpotInsTemEquipD> spotInsTemEquipDs = db.Queryable<EqpSpotInsTemEquipD>().Where(x => templetIDs.Contains(x.spot_ins_tem_equip_id)).ToList();
List<string> spotInsItemIDs = spotInsTemEquipDs.Select(x => x.spot_ins_item_id).ToList();
List<EqpSpotInsItem> spotCheckItems = db.Queryable<EqpSpotInsItem>().Where(x => spotInsItemIDs.Contains(x.id)).ToList();
foreach (var tobeCreatePlan in tobeCreateList)
{
List<EqpSpotInsRecordD> spotInsRecordDs = new List<EqpSpotInsRecordD>();
List<string> spotInsItems = spotInsTemEquipDs
.Where(x => x.spot_ins_tem_equip_id == tobeCreatePlan.spot_ins_tem_equip_id)
.Select(x => x.spot_ins_item_id).ToList();
List<EqpSpotInsItem> tobeCreateItems = spotCheckItems.Where(x => spotInsItems.Contains(x.id)).ToList();
foreach (var tobeCreateItem in tobeCreateItems)
{
spotInsRecordDs.Add(new EqpSpotInsRecordD()
{
id = SnowflakeIdHelper.NextId(),
spot_ins_record_id = tobeCreatePlan.id,
spot_ins_tem_equip_id = tobeCreatePlan.spot_ins_tem_equip_id,
spot_ins_item_id = tobeCreateItem.id,
code = tobeCreateItem.code,
name = tobeCreateItem.name,
judge_type = tobeCreateItem.judge_type,
low_value = tobeCreateItem.low_value,
high_value = tobeCreateItem.high_value,
low_value_is_include = tobeCreateItem.low_value_is_include,
high_value_is_include = tobeCreateItem.high_value_is_include,
standard_value = tobeCreateItem.standard_value,
unit_id = tobeCreateItem.unit_id,
inspection_method = tobeCreateItem.inspection_method,
judge_content = tobeCreateItem.judge_content,
remark = tobeCreateItem.remark
});
}
var dbResult = db.Ado.UseTran(() =>
{
if (tobeCreateList != null && tobeCreateList.Count > 0)
{
db.Insertable<EqpSpotInsRecordH>(tobeCreateList).ExecuteCommand();
}
if (spotInsRecordDs != null && spotInsRecordDs.Count > 0)
{
db.Insertable<EqpSpotInsRecordD>(spotInsRecordDs).ExecuteCommand();
}
});
if (!dbResult.IsSuccess)
{
Console.WriteLine(dbResult.ErrorMessage);
Log.Error(dbResult.ErrorMessage);
}
Log.Information($"---------------生成{tobeCreateList.Count}个计划---------------");
}
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
Log.Error(e.Message);
}
Log.Information("----------------------结束生成点巡检计划----------------------");
}
/// <summary>
/// 最后一个点巡检记录
/// </summary>
private class SpotInsRecordLastDTO
{
public string spot_ins_tem_equip_id { get; set; }
public DateTime create_time { get; set; }
}
}
}

View File

@@ -86,7 +86,8 @@ public class SpareTimeListener : ISpareTimeListener, ISingleton
}
var taskEntity = await _sqlSugarClient.Queryable<TimeTaskEntity>().FirstAsync(x => x.Id == executer.Timer.WorkerName);
var nextRunTime = ((DateTimeOffset)SpareTime.GetCronNextOccurrence(taskEntity.ExecuteCycleJson)).DateTime;
//modified by PhilPan
var nextRunTime = SpareTime.GetCronNextOccurrence(taskEntity.ExecuteCycleJson)?.DateTime;
await _eventPublisher.PublishAsync(new TaskEventSource("Task:UpdateTask", connectionConfig, new TimeTaskEntity()
{

View File

@@ -324,11 +324,12 @@ public class TimeTaskService : ITimeTaskService, IDynamicApiController, ITransie
Action<SpareTimer, long>? action = null;
ContentModel? comtentModel = input.ExecuteContent.ToObject<ContentModel>();
input.ExecuteCycleJson = comtentModel.cron;
TaskMethodInfo? taskMethod = null;
switch (input.ExecuteType)
{
case "3":
// 查询符合条件的任务方法
TaskMethodInfo? taskMethod = GetTaskMethods()?.Result.FirstOrDefault(m => m.id == comtentModel.localHostTaskId);
taskMethod = GetTaskMethods()?.Result.FirstOrDefault(m => m.id == comtentModel.localHostTaskId);
if (taskMethod == null) break;
// 创建任务对象
@@ -354,20 +355,20 @@ public class TimeTaskService : ITimeTaskService, IDynamicApiController, ITransie
{
interval = (starTime.ParseToDateTime() - DateTime.Now).TotalMilliseconds.ParseToInt();
}
SpareTime.DoOnce(interval, action, "Once_" + input.Id);
SpareTime.Do(
() =>
{
var isRun = comtentModel.endTime.IsNullOrEmpty() ? DateTime.Now >= starTime : DateTime.Now >= starTime && DateTime.Now < endTime;
if (isRun)
{
return SpareTime.GetCronNextOccurrence(comtentModel.cron);
}
else
{
return null;
}
},
if (taskMethod.StartNow) //modifyby zhoukeda 20230516
{
SpareTime.DoOnce(interval, action, "Once_" + input.Id);
}
Func<DateTimeOffset?> nextHandle = null;
var isRun = comtentModel.endTime.IsNullOrEmpty() ? DateTime.Now >= starTime : DateTime.Now >= starTime && DateTime.Now < endTime;
if (isRun)
{
nextHandle = ()=>SpareTime.GetCronNextOccurrence(comtentModel.cron);
}
SpareTime.Do(nextHandle
,
action, input.Id, comtentModel.ConnectionConfig.ToJsonString(), true, executeType: SpareTimeExecuteTypes.Parallel, cancelInNoneNextTime: false);
}

View File

@@ -6,12 +6,18 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS8600;CS8601;CS8602;CS8603;CS8604;CS8625;CS1572;CS1573;</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\common\Tnb.Common.Core\Tnb.Common.Core.csproj" />
<ProjectReference Include="..\..\EquipMgr\Tnb.EquipMgr.Entities\Tnb.EquipMgr.Entities.csproj" />
<ProjectReference Include="..\..\system\Tnb.Systems.Interfaces\Tnb.Systems.Interfaces.csproj" />
<ProjectReference Include="..\Tnb.TaskScheduler.Interfaces\Tnb.TaskScheduler.Interfaces.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Tnb.Core" Version="2023.3.24.1010" />
</ItemGroup>
</Project>

View File

@@ -1269,7 +1269,6 @@ public class CodeGenWay
IsRelationForm = isRelationForm,
ChildTableStyle = columnDesignModel.childTableStyle,
};
break;
default:
return new FrontEndGenConfigModel()
{
@@ -1339,7 +1338,6 @@ public class CodeGenWay
ChildTableStyle = columnDesignModel.childTableStyle,
IsFixed = isFixed,
};
break;
}
}

View File

@@ -8,10 +8,11 @@ namespace JNPF.VisualDev.Engine;
[SuppressSniffer]
public class IndexGridFieldModel : IndexEachConfigBase
{
/// <summary>
/// 对齐.
/// </summary>
public string align { get; set; }
//modified by PhilPan
///// <summary>
///// 对齐.
///// </summary>
//public string align { get; set; }
/// <summary>
/// 固定.

View File

@@ -14,8 +14,9 @@ public class IndexSearchFieldModel : IndexEachConfigBase
/// </summary>
public string value { get; set; }
/// <summary>
/// 查询类型.
/// </summary>
public int? searchType { get; set; }
//modified by PhilPan
///// <summary>
///// 查询类型.
///// </summary>
//public int? searchType { get; set; }
}

View File

@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(SolutionDir)\common.props" />
<PropertyGroup>
@@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS8600;CS8601;CS8602;CS8603;CS8604;CS8618;CS8625;CS8629;CS1572;CS1573;CS0168;</NoWarn>
</PropertyGroup>
<ItemGroup>

View File

@@ -8,10 +8,11 @@ namespace JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
/// </summary>
public class VisualDevModelListQueryInput : PageInputBase
{
/// <summary>
/// 菜单ID.
/// </summary>
public string menuId { get; set; }
//modified by PhilPan
///// <summary>
///// 菜单ID.
///// </summary>
//public string menuId { get; set; }
/// <summary>
/// 选择导出数据key.

View File

@@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS8618;</NoWarn>
</PropertyGroup>
<ItemGroup>

View File

@@ -57,10 +57,10 @@ public class RunService : IRunService, ITransient
/// </summary>
private readonly IBillRullService _billRuleService;
/// <summary>
/// 缓存管理.
/// </summary>
private readonly ICacheManager _cacheManager;
///// <summary>
///// 缓存管理.
///// </summary>
//private readonly ICacheManager _cacheManager;
/// <summary>
/// 用户管理.

View File

@@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS8600;CS8601;CS8602;CS8603;CS8604;CS8625;CS8629;CS1572;CS1573;CS0168;</NoWarn>
</PropertyGroup>
<ItemGroup>

View File

@@ -872,7 +872,7 @@ namespace JNPF.VisualDev
var len = rowChildDatas.Select(x => x.Value.Count()).OrderByDescending(x => x).FirstOrDefault();
if (len != null && len > 0)
if (len > 0)
{
for (int i = 0; i < len; i++)
{

View File

@@ -1281,7 +1281,7 @@ public class VisualDevService : IVisualDevService, IDynamicApiController, ITrans
foreach (DbTableAndFieldModel? item in addTableList)
{
bool res = await _changeDataBase.Create(link, item, item.FieldList);
if (!res) throw null;
if (!res) Oops.Oh(ErrorCode.COM1008); // throw null;
}
if (await _visualDevRepository.IsAnyAsync(x => x.Id.Equals(vEntity.Id)))

View File

@@ -409,7 +409,7 @@ public class VisualdevModelAppService : IDynamicApiController, ITransient
var len = rowChildDatas.Select(x => x.Value.Count()).OrderByDescending(x => x).FirstOrDefault();
if (len != null && len > 0)
if (len > 0)
{
for (int i = 0; i < len; i++)
{

View File

@@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS8618;</NoWarn>
</PropertyGroup>
<ItemGroup>

View File

@@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS8625;</NoWarn>
</PropertyGroup>
<ItemGroup>

View File

@@ -361,7 +361,8 @@ public class FlowTaskOtherUtil
{
try
{
if (jobj[timeOutConfig.formField] is long)
//modified by PhilPan
if (jobj[timeOutConfig.formField].Type == Newtonsoft.Json.Linq.JTokenType.Integer)
{
dt = jobj[timeOutConfig.formField].ParseToLong().TimeStampToDateTime();
}

View File

@@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS8600;CS8601;CS8602;CS8603;CS8604;CS8619;CS8620;CS8625;CS8629;CS1572;CS1573;CS0168;CS4014;CS1998;</NoWarn>
</PropertyGroup>
<ItemGroup>