1
This commit is contained in:
@@ -99,7 +99,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<ToolMolds>().InnerJoin<BasMaterial>((a, b) => a.material_id == b.id)
|
||||
.Where((a, b) => a.material_id == materialId)
|
||||
.Select((a, b) => new MoldListOutput
|
||||
{
|
||||
@@ -170,7 +170,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<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
|
||||
@@ -238,7 +238,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<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 : "";
|
||||
@@ -349,7 +349,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<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
|
||||
@@ -559,7 +559,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<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;
|
||||
@@ -576,7 +576,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<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;
|
||||
@@ -896,7 +896,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<ToolMolds>().FirstAsync(it => it.id == taskItem.mold_id))?.mold_code!;
|
||||
}
|
||||
if (taskItem.material_id!.IsNotEmptyOrNull())
|
||||
{
|
||||
@@ -964,7 +964,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<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;
|
||||
@@ -1135,7 +1135,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<ToolMolds>().FirstAsync(it => it.id == moldId);
|
||||
if (mold != null)
|
||||
{
|
||||
row["mold_id"] = $"{mold.mold_code}/{mold.mold_name}";
|
||||
|
||||
Reference in New Issue
Block a user