重新生成实体类

This commit is contained in:
2023-05-18 18:15:38 +08:00
parent 82c94d9707
commit 3033b9c66e
347 changed files with 36999 additions and 54700 deletions

View File

@@ -104,7 +104,7 @@ namespace Tnb.ProductionMgr
public async Task<dynamic> GetMoldListByItemId(string materialId)
{
var db = _repository.AsSugarClient();
var list = await db.Queryable<Molds>().InnerJoin<BasMaterial>((a, b) => a.material_id == b.id)
var list = await db.Queryable<Entities.ToolMolds>().InnerJoin<BasMaterial>((a, b) => a.material_id == b.id)
.Where((a, b) => a.material_id == materialId)
.Select((a, b) => new MoldListOutput
{
@@ -175,7 +175,7 @@ namespace Tnb.ProductionMgr
var list = await _repository.AsSugarClient().Queryable<PrdMoTask>()
.LeftJoin<PrdMo>((a, b) => a.mo_id == b.id)
.LeftJoin<BasMaterial>((a, b, c) => a.material_id == c.id)
.LeftJoin<Molds>((a, b, c, d) => a.mold_id == d.id)
.LeftJoin<Entities.ToolMolds>((a, b, c, d) => a.mold_id == d.id)
.Where((a, b, c, d) => a.eqp_id == eqpId)
.OrderBy((a, b, c, d) => a.estimated_start_date)
.Select((a, b, c, d) => new PrdTaskSortOutput
@@ -243,7 +243,7 @@ namespace Tnb.ProductionMgr
if (prdTask != null)
{
var eqp = await db.Queryable<EqpEquipment>().FirstAsync(it => it.id == prdTask.eqp_id);
var mold = await db.Queryable<Molds>().FirstAsync(it => it.id == prdTask.mold_id);
var mold = await db.Queryable<Entities.ToolMolds>().FirstAsync(it => it.id == prdTask.mold_id);
var material = await db.Queryable<BasMaterial>().FirstAsync(it => it.id == prdTask.material_id);
eqpCode = eqp != null ? eqp.code : "";
moldCode = mold != null ? mold.mold_code : "";
@@ -354,7 +354,7 @@ namespace Tnb.ProductionMgr
{
result = await _db.Queryable<PrdMoTask>().LeftJoin<PrdMo>((a, b) => a.mo_id == b.id)
.LeftJoin<BasMaterial>((a, b, c) => a.material_id == c.id)
.LeftJoin<Molds>((a, b, c, d) => a.mold_id == d.id)
.LeftJoin<Entities.ToolMolds>((a, b, c, d) => a.mold_id == d.id)
.LeftJoin<EqpEquipment>((a, b, c, d, e) => a.eqp_id == e.id)
.Where((a, b, c, d, e) => a.mo_id == moId)
.Select((a, b, c, d, e) => new PrdMoTaskOutput
@@ -557,7 +557,7 @@ namespace Tnb.ProductionMgr
taskLog.id = SnowflakeIdHelper.NextId();
taskLog.mo_code = (await db.Queryable<PrdMo>().FirstAsync(it => it.id == input.mo_id))?.mo_code!;
taskLog.eqp_code = (await db.Queryable<EqpEquipment>().FirstAsync(it => it.id == input.eqp_id))?.code!;
taskLog.mold_code = (await db.Queryable<Molds>().FirstAsync(it => it.id == input.mold_id))?.mold_code!;
taskLog.mold_code = (await db.Queryable<Entities.ToolMolds>().FirstAsync(it => it.id == input.mold_id))?.mold_code!;
taskLog.item_code = material?.code!;
taskLog.item_standard = material?.material_standard!;
taskLog.status = DictConst.ToBeScheduledEncode;
@@ -574,7 +574,7 @@ namespace Tnb.ProductionMgr
sacipRecord.material_code = material?.code!;
sacipRecord.material_name = material?.name!;
sacipRecord.eqp_code = (await db.Queryable<EqpEquipment>().FirstAsync(it => it.id == moTask.eqp_id))?.code!;
sacipRecord.mold_name = (await db.Queryable<Molds>().FirstAsync(it => it.id == moTask.mold_id))?.mold_name!;
sacipRecord.mold_name = (await db.Queryable<Entities.ToolMolds>().FirstAsync(it => it.id == moTask.mold_id))?.mold_name!;
sacipRecord.estimated_start_date = moTask.plan_start_date;
sacipRecord.estimated_end_date = moTask.plan_end_date;
sacipRecord.plan_qty = moTask.plan_qty;
@@ -894,7 +894,7 @@ namespace Tnb.ProductionMgr
}
if (taskItem.mold_id!.IsNotEmptyOrNull())
{
taskLog.mold_code = (await db.Queryable<Molds>().FirstAsync(it => it.id == taskItem.mold_id))?.mold_code!;
taskLog.mold_code = (await db.Queryable<Entities.ToolMolds>().FirstAsync(it => it.id == taskItem.mold_id))?.mold_code!;
}
if (taskItem.material_id!.IsNotEmptyOrNull())
{
@@ -962,7 +962,7 @@ namespace Tnb.ProductionMgr
case 2: //模具
if (icmoItem != null)
{
var moldItem = await db.Queryable<Molds>().FirstAsync(it => it.id == icmoItem.mold_id);
var moldItem = await db.Queryable<Entities.ToolMolds>().FirstAsync(it => it.id == icmoItem.mold_id);
icmoItem.mold_id = moldItem.id;
icmoItem.mold_code = moldItem.mold_code;
icmoItem.mold_name = moldItem.mold_name;
@@ -1113,7 +1113,7 @@ namespace Tnb.ProductionMgr
if (dic.ContainsKey("mold_id"))
{
var moldId = dic["mold_id"]?.ToString();
var mold = await db.Queryable<Molds>().FirstAsync(it => it.id == moldId);
var mold = await db.Queryable<Entities.ToolMolds>().FirstAsync(it => it.id == moldId);
if (mold != null)
{
row["mold_id"] = $"{mold.mold_code}/{mold.mold_name}";