排产加模具状态 工单加物料清单版本
This commit is contained in:
@@ -30,5 +30,9 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int available_stations { get; set; }
|
public int available_stations { get; set; }
|
||||||
public string mold_id { get; set; }
|
public string mold_id { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 模具状态
|
||||||
|
/// </summary>
|
||||||
|
public string mold_status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ namespace Tnb.ProductionMgr.Entities.Dto
|
|||||||
public int? plan_qty { get; set; }
|
public int? plan_qty { get; set; }
|
||||||
public string unit_id { get; set; }
|
public string unit_id { get; set; }
|
||||||
public string mo_status { get; set; }
|
public string mo_status { get; set; }
|
||||||
|
public string ebom_version { get; set; }
|
||||||
public string? remark { get; set; }
|
public string? remark { get; set; }
|
||||||
public string combine_mo_code { get; set; }
|
public string combine_mo_code { get; set; }
|
||||||
public string material_id_id { get; set; }
|
public string material_id_id { get; set; }
|
||||||
|
|||||||
@@ -109,6 +109,11 @@ public partial class PrdMo : BaseEntity<string>
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string? bom_version { get; set; }
|
public string? bom_version { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料清单BOM版本
|
||||||
|
/// </summary>
|
||||||
|
public string? ebom_version { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 关联比例
|
/// 关联比例
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -164,6 +164,7 @@ namespace Tnb.ProductionMgr
|
|||||||
plan_qty = a.plan_qty,
|
plan_qty = a.plan_qty,
|
||||||
unit_id = d.FullName,
|
unit_id = d.FullName,
|
||||||
mo_status = e.FullName,
|
mo_status = e.FullName,
|
||||||
|
ebom_version = a.ebom_version,
|
||||||
remark = a.remark,
|
remark = a.remark,
|
||||||
children = SqlFunc.Subqueryable<PrdMo>()
|
children = SqlFunc.Subqueryable<PrdMo>()
|
||||||
.LeftJoin<BasMaterial>((aa, bb) => aa.material_id == bb.id)
|
.LeftJoin<BasMaterial>((aa, bb) => aa.material_id == bb.id)
|
||||||
@@ -241,7 +242,11 @@ namespace Tnb.ProductionMgr
|
|||||||
throw new ArgumentException($"{nameof(input.Behavior)},not be null or empty");
|
throw new ArgumentException($"{nameof(input.Behavior)},not be null or empty");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ISqlSugarClient db = _repository.AsSugarClient();
|
ISqlSugarClient db = _repository.AsSugarClient();
|
||||||
|
|
||||||
|
|
||||||
//获取同组工单的Id,一起下发
|
//获取同组工单的Id,一起下发
|
||||||
List<string?> combineMoCodes = await db.Queryable<PrdMo>().Where(it => input.WorkOrderIds.Contains(it.id)).Select(it => it.combine_mo_code).ToListAsync();
|
List<string?> combineMoCodes = await db.Queryable<PrdMo>().Where(it => input.WorkOrderIds.Contains(it.id)).Select(it => it.combine_mo_code).ToListAsync();
|
||||||
if (combineMoCodes?.Count > 0)
|
if (combineMoCodes?.Count > 0)
|
||||||
@@ -250,6 +255,16 @@ namespace Tnb.ProductionMgr
|
|||||||
input.WorkOrderIds = input.WorkOrderIds.Concat(moIds).ToList();
|
input.WorkOrderIds = input.WorkOrderIds.Concat(moIds).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<PrdMo> prdMos = await db.Queryable<PrdMo>().Where(x => input.WorkOrderIds.Contains(x.id)).ToListAsync();
|
||||||
|
|
||||||
|
foreach (var item in prdMos)
|
||||||
|
{
|
||||||
|
if (!await db.Queryable<BasEbomH>().AnyAsync(x => x.material_id == item.material_id && x.version == item.ebom_version))
|
||||||
|
{
|
||||||
|
throw Oops.Bah($"系统中无法找到{item.ebom_version}版本");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static string getMoStatus(MoBehavior behavior)
|
static string getMoStatus(MoBehavior behavior)
|
||||||
{
|
{
|
||||||
string status = "";
|
string status = "";
|
||||||
|
|||||||
@@ -108,8 +108,9 @@ namespace Tnb.ProductionMgr
|
|||||||
result = await _db.Queryable<ToolMoldsMaterial>()
|
result = await _db.Queryable<ToolMoldsMaterial>()
|
||||||
.InnerJoin<ToolMolds>((a, b) => a.mold_id == b.id)
|
.InnerJoin<ToolMolds>((a, b) => a.mold_id == b.id)
|
||||||
.InnerJoin<BasMaterial>((a, b, c) => a.material_id == c.id)
|
.InnerJoin<BasMaterial>((a, b, c) => a.material_id == c.id)
|
||||||
|
.LeftJoin<DictionaryDataEntity>((a,b,c,d)=>d.Id==b.mold_status)
|
||||||
.Where((a, b, c) => a.material_id == materialId)
|
.Where((a, b, c) => a.material_id == materialId)
|
||||||
.Select((a, b, c) => new Tnb.ProductionMgr.Entities.Dto.MoldListOutput
|
.Select((a, b, c,d) => new Tnb.ProductionMgr.Entities.Dto.MoldListOutput
|
||||||
{
|
{
|
||||||
mold_id = b.id,
|
mold_id = b.id,
|
||||||
mold_code = b.mold_code,
|
mold_code = b.mold_code,
|
||||||
@@ -117,6 +118,7 @@ namespace Tnb.ProductionMgr
|
|||||||
mold_type_code = b.mold_type_code,
|
mold_type_code = b.mold_type_code,
|
||||||
material_name = c.name,
|
material_name = c.name,
|
||||||
material_code = c.code,
|
material_code = c.code,
|
||||||
|
mold_status = d.FullName,
|
||||||
available_stations = SqlFunc.Subqueryable<EqpEquipment>().Where(it => it.mold_id == a.id).Count(),
|
available_stations = SqlFunc.Subqueryable<EqpEquipment>().Where(it => it.mold_id == a.id).Count(),
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in New Issue
Block a user