去掉IDE1006警告,修改BaseEntity
This commit is contained in:
@@ -13,13 +13,6 @@ namespace Tnb.BasicData.Entitys.Entity
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
|
||||||
/// Desc:主键
|
|
||||||
/// Default:
|
|
||||||
/// Nullable:False
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(IsPrimaryKey=true,ColumnName="id")]
|
|
||||||
public string id {get;set;}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:父件物料ID
|
/// Desc:父件物料ID
|
||||||
|
|||||||
@@ -13,13 +13,6 @@ namespace Tnb.BasicData.Entitys.Entity
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
|
||||||
/// Desc:主键
|
|
||||||
/// Default:
|
|
||||||
/// Nullable:False
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(IsPrimaryKey=true,ColumnName="id")]
|
|
||||||
public string id {get;set;}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:创建时间
|
/// Desc:创建时间
|
||||||
|
|||||||
@@ -12,14 +12,6 @@ namespace Tnb.BasicData.Entitys.Entity
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
|
||||||
/// Desc:主键
|
|
||||||
/// Default:
|
|
||||||
/// Nullable:False
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(IsPrimaryKey=true,ColumnName="id")]
|
|
||||||
public string id {get;set;}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:物料代码
|
/// Desc:物料代码
|
||||||
/// Default:
|
/// Default:
|
||||||
|
|||||||
@@ -13,13 +13,6 @@ namespace Tnb.BasicData.Entitys.Entity
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
|
||||||
/// Desc:主键
|
|
||||||
/// Default:
|
|
||||||
/// Nullable:False
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(IsPrimaryKey=true,ColumnName="id")]
|
|
||||||
public string Id {get;set;}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:物料ID,BAS_MATERIAL.ID
|
/// Desc:物料ID,BAS_MATERIAL.ID
|
||||||
|
|||||||
@@ -17,13 +17,6 @@ namespace Tnb.BasicData.Entitys.Entity
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
|
||||||
/// Desc:主键
|
|
||||||
/// Default:
|
|
||||||
/// Nullable:False
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(IsPrimaryKey=true,ColumnName="id")]
|
|
||||||
public string Id {get;set;}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:编号
|
/// Desc:编号
|
||||||
|
|||||||
@@ -50,10 +50,10 @@ namespace Tnb.BasicData
|
|||||||
if (string.IsNullOrEmpty(queryInput.materialId))
|
if (string.IsNullOrEmpty(queryInput.materialId))
|
||||||
{
|
{
|
||||||
var data = await db.Queryable<BasEbomD>()
|
var data = await db.Queryable<BasEbomD>()
|
||||||
.LeftJoin<BasEbomH>((a,b)=>a.ebom_id==b.Id)
|
.LeftJoin<BasEbomH>((a,b)=>a.ebom_id==b.id)
|
||||||
.LeftJoin<BasMaterial>((a,b,c)=>a.material_id==c.Id)
|
.LeftJoin<BasMaterial>((a,b,c)=>a.material_id==c.id)
|
||||||
.LeftJoin<BasEbomH>((a,b,c,d)=>a.material_id==d.material_id)
|
.LeftJoin<BasEbomH>((a,b,c,d)=>a.material_id==d.material_id)
|
||||||
.LeftJoin<BasRoute>((a,b,c,d,e)=>d.route_id==e.Id)
|
.LeftJoin<BasRoute>((a,b,c,d,e)=>d.route_id==e.id)
|
||||||
.LeftJoin<BasMaterial>((a,b,c,d,e,f)=>a.substitute_material_id==f.id)
|
.LeftJoin<BasMaterial>((a,b,c,d,e,f)=>a.substitute_material_id==f.id)
|
||||||
.Where((a,b,c)=>a.ebom_id==queryInput.ebomId)
|
.Where((a,b,c)=>a.ebom_id==queryInput.ebomId)
|
||||||
.Select((a,b,c,d,e,f)=>new EbomTreeOutput
|
.Select((a,b,c,d,e,f)=>new EbomTreeOutput
|
||||||
@@ -79,12 +79,12 @@ namespace Tnb.BasicData
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
var data = await db.Queryable<BasEbomD>()
|
var data = await db.Queryable<BasEbomD>()
|
||||||
.LeftJoin<BasEbomH>((a,b)=>a.ebom_id==b.Id)
|
.LeftJoin<BasEbomH>((a,b)=>a.ebom_id==b.id)
|
||||||
.LeftJoin<BasMaterial>((a,b,c)=>a.material_id==c.Id)
|
.LeftJoin<BasMaterial>((a,b,c)=>a.material_id==c.id)
|
||||||
.LeftJoin<BasEbomH>((a,b,c,d)=>a.material_id==d.material_id)
|
.LeftJoin<BasEbomH>((a,b,c,d)=>a.material_id==d.material_id)
|
||||||
.LeftJoin<BasRoute>((a,b,c,d,e)=>d.route_id==e.Id)
|
.LeftJoin<BasRoute>((a,b,c,d,e)=>d.route_id==e.id)
|
||||||
.LeftJoin<BasMaterial>((a,b,c,d,e,f)=>a.substitute_material_id==f.id)
|
.LeftJoin<BasMaterial>((a,b,c,d,e,f)=>a.substitute_material_id==f.id)
|
||||||
.Where((a,b,c)=>b.material_id==queryInput.materialId && a.ebom_id==b.Id)
|
.Where((a,b,c)=>b.material_id==queryInput.materialId && a.ebom_id==b.id)
|
||||||
.Select((a,b,c,d,e,f)=>new EbomTreeOutput
|
.Select((a,b,c,d,e,f)=>new EbomTreeOutput
|
||||||
{
|
{
|
||||||
material_id = c.name,
|
material_id = c.name,
|
||||||
@@ -121,7 +121,7 @@ namespace Tnb.BasicData
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
var ebom = await db.Queryable<BasEbomH>()
|
var ebom = await db.Queryable<BasEbomH>()
|
||||||
.LeftJoin<BasRoute>((a,b)=>a.route_id==b.Id)
|
.LeftJoin<BasRoute>((a,b)=>a.route_id==b.id)
|
||||||
.Where((a,b) => a.material_id == materialId)
|
.Where((a,b) => a.material_id == materialId)
|
||||||
.Select((a,b)=>new
|
.Select((a,b)=>new
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ namespace Tnb.BasicData
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
var ebom = await db.Queryable<BasEbomH>()
|
var ebom = await db.Queryable<BasEbomH>()
|
||||||
.LeftJoin<BasRoute>((a,b)=>a.route_id==b.Id)
|
.LeftJoin<BasRoute>((a,b)=>a.route_id==b.id)
|
||||||
.Where((a,b) => a.material_id == materialId)
|
.Where((a,b) => a.material_id == materialId)
|
||||||
.Select((a,b)=>new
|
.Select((a,b)=>new
|
||||||
{
|
{
|
||||||
@@ -67,7 +67,7 @@ namespace Tnb.BasicData
|
|||||||
string typeId = type?.Id;
|
string typeId = type?.Id;
|
||||||
var queryable1 = db.Queryable<BasMaterial>()
|
var queryable1 = db.Queryable<BasMaterial>()
|
||||||
.LeftJoin<DictionaryDataEntity>((a,b)=>a.unit_id==b.EnCode && b.DictionaryTypeId==typeId)
|
.LeftJoin<DictionaryDataEntity>((a,b)=>a.unit_id==b.EnCode && b.DictionaryTypeId==typeId)
|
||||||
.Where((a,b) => a.Id == materialId)
|
.Where((a,b) => a.id == materialId)
|
||||||
.Select((a,b)=> new ElementSelectDto
|
.Select((a,b)=> new ElementSelectDto
|
||||||
{
|
{
|
||||||
value = b.EnCode,
|
value = b.EnCode,
|
||||||
@@ -75,7 +75,7 @@ namespace Tnb.BasicData
|
|||||||
});
|
});
|
||||||
var queryable2 = db.Queryable<BasMaterial>()
|
var queryable2 = db.Queryable<BasMaterial>()
|
||||||
.LeftJoin<DictionaryDataEntity>((a,b)=>a.pickunit_id==b.EnCode && b.DictionaryTypeId==typeId)
|
.LeftJoin<DictionaryDataEntity>((a,b)=>a.pickunit_id==b.EnCode && b.DictionaryTypeId==typeId)
|
||||||
.Where((a,b) => a.Id == materialId)
|
.Where((a,b) => a.id == materialId)
|
||||||
.Select((a,b)=> new ElementSelectDto
|
.Select((a,b)=> new ElementSelectDto
|
||||||
{
|
{
|
||||||
value = b.EnCode,
|
value = b.EnCode,
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace Tnb.ProductionMgr.Entitys.Dto
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备列表输出参数
|
/// 设备列表输出参数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class EquipmentListOutput : EqpEquipment
|
public class EquipmentListOutput //: EqpEquipment 不能直接继承实体类
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 任务单数量
|
/// 任务单数量
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ namespace Tnb.ProductionMgr
|
|||||||
foreach (var item in multi)
|
foreach (var item in multi)
|
||||||
{
|
{
|
||||||
MoldsEntity entity = new();
|
MoldsEntity entity = new();
|
||||||
entity.Id = SnowflakeIdHelper.NextId();
|
entity.id = SnowflakeIdHelper.NextId();
|
||||||
entity.MoldCode = $"m00{index}";
|
entity.MoldCode = $"m00{index}";
|
||||||
entity.MoldName = "磨具" + index;
|
entity.MoldName = "磨具" + index;
|
||||||
entity.ItemId = item.pId;
|
entity.ItemId = item.pId;
|
||||||
@@ -68,7 +68,7 @@ namespace Tnb.ProductionMgr
|
|||||||
var dic = new Dictionary<string, object>
|
var dic = new Dictionary<string, object>
|
||||||
{
|
{
|
||||||
{"id",item.EqpId },
|
{"id",item.EqpId },
|
||||||
{ "mold_id", item.Id}
|
{ "mold_id", item.id}
|
||||||
};
|
};
|
||||||
var row2 = await db.Updateable(dic).AS("eqp_equipment")
|
var row2 = await db.Updateable(dic).AS("eqp_equipment")
|
||||||
.WhereColumns("id").
|
.WhereColumns("id").
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ using SqlSugar;
|
|||||||
|
|
||||||
namespace Tnb.Common.Contracts
|
namespace Tnb.Common.Contracts
|
||||||
{
|
{
|
||||||
public class BaseEntity<TKey> : IEntity<TKey> where TKey : IEquatable<TKey>
|
public class BaseEntity<TKey> : IEntity where TKey : IEquatable<TKey>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置 编号.
|
/// 获取或设置 编号.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "id", ColumnDescription = "主键", IsPrimaryKey = true)]
|
[SugarColumn(ColumnName = "id", ColumnDescription = "主键", IsPrimaryKey = true)]
|
||||||
public TKey Id { get; set; }
|
public TKey id { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,15 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 实体类基类.
|
/// 实体类基类.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IEntity<TKey>
|
public interface IEntity<TKey> : IEntity
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置 实体唯一标识,主键.
|
/// 获取或设置 实体唯一标识,主键.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
TKey Id { get; set; }
|
TKey Id { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IEntity
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -52,6 +52,7 @@
|
|||||||
<Rule Id="IDE0007WithoutSuggestion" Action="None" />
|
<Rule Id="IDE0007WithoutSuggestion" Action="None" />
|
||||||
<Rule Id="IDE0008" Action="None" />
|
<Rule Id="IDE0008" Action="None" />
|
||||||
<Rule Id="IDE0079" Action="Hidden" />
|
<Rule Id="IDE0079" Action="Hidden" />
|
||||||
|
<Rule Id="IDE1006" Action="None" />
|
||||||
</Rules>
|
</Rules>
|
||||||
<Rules AnalyzerId="Microsoft.CodeAnalysis.NetAnalyzers" RuleNamespace="Microsoft.CodeAnalysis.NetAnalyzers">
|
<Rules AnalyzerId="Microsoft.CodeAnalysis.NetAnalyzers" RuleNamespace="Microsoft.CodeAnalysis.NetAnalyzers">
|
||||||
<Rule Id="CA1707" Action="None" />
|
<Rule Id="CA1707" Action="None" />
|
||||||
|
|||||||
Reference in New Issue
Block a user