|
@@ -139,6 +139,51 @@ namespace WCS.WorkEngineering.Extensions
|
|
|
public static void Updateable(this WCS_TaskInfo taskInfo, SqlSugarScopeProvider db)
|
|
|
{
|
|
|
}
|
|
|
+ /// <summary>
|
|
|
+ /// 添加异常信息
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="db">db</param>
|
|
|
+ /// <param name="error"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public static void AddBaseErrorInfo(this BaseErrorInfo error,SqlSugarScopeProvider db)
|
|
|
+ {
|
|
|
+ var errorinfoWcs = db.Queryable<BaseErrorInfo>().With(SqlWith.NoLock)
|
|
|
+ .Where(v => v.BusName == error.BusName && v.Message == error.Message&& v.BarCode == error.BarCode).First();
|
|
|
+ if (errorinfoWcs != null && (error.AddTime-errorinfoWcs.AddTime).TotalMinutes<1)
|
|
|
+ {
|
|
|
+ errorinfoWcs.Count += 1;
|
|
|
+ db.Updateable(errorinfoWcs).ExecuteCommand();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ db.Insertable(error).ExecuteCommand();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 添加异常信息
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="db">db</param>
|
|
|
+ /// <param name="error"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public static void AddBaseErrorInfo(this BaseErrorInfo error)
|
|
|
+ {
|
|
|
+ SqlSugarHelper.Do(_db =>
|
|
|
+ {
|
|
|
+ var db = _db.Default;
|
|
|
+ var errorinfoWcs = db.Queryable<BaseErrorInfo>().With(SqlWith.NoLock)
|
|
|
+ .Where(v => v.BusName == error.BusName && v.Message == error.Message&& v.BarCode == error.BarCode).First();
|
|
|
+ if (errorinfoWcs != null && (error.AddTime-errorinfoWcs.AddTime).TotalMinutes<1)
|
|
|
+ {
|
|
|
+ errorinfoWcs.Count += 1;
|
|
|
+ db.Updateable(errorinfoWcs).ExecuteCommand();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ db.Insertable(error).ExecuteCommand();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
///// <summary>
|
|
|
///// 获取出库任务
|
|
@@ -640,4 +685,54 @@ namespace WCS.WorkEngineering.Extensions
|
|
|
[SugarColumn(IsNullable = true, ColumnDescription = "是否在桁架进行码垛")]
|
|
|
public bool IsTruss { get; set; }
|
|
|
}
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 异常信息
|
|
|
+ /// </summary>
|
|
|
+ [Tenant("fj")]
|
|
|
+ [SugarTable("Base_ErrorInfo")]
|
|
|
+ public class BaseErrorInfo
|
|
|
+ {
|
|
|
+ /// <summary>
|
|
|
+ /// ID
|
|
|
+ /// </summary>
|
|
|
+ [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "ID")]
|
|
|
+ public int ID { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 业务名称
|
|
|
+ /// </summary>
|
|
|
+ [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = false)]
|
|
|
+ public string BusName { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 业务名称
|
|
|
+ /// </summary>
|
|
|
+ [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = true)]
|
|
|
+ public string BarCode { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 异常描述信息
|
|
|
+ /// </summary>
|
|
|
+ [SugarColumn(ColumnDataType = "nvarchar", Length = 250, IsNullable = true)]
|
|
|
+ public string Message { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 次数
|
|
|
+ /// </summary>
|
|
|
+ [SugarColumn(ColumnDataType = "int", IsNullable = true)]
|
|
|
+ public int Count { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// memo
|
|
|
+ /// </summary>
|
|
|
+ [SugarColumn(ColumnDataType = "nvarchar", Length = 250, IsNullable = true)]
|
|
|
+ public string Memo { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// AddTime
|
|
|
+ /// </summary>
|
|
|
+ [SugarColumn(ColumnDataType = "datetime", IsNullable = false)]
|
|
|
+ public DateTime AddTime { get; set; } = DateTime.Now;
|
|
|
+ }
|
|
|
}
|