This commit is contained in:
DEVICE8\12494
2023-05-28 21:17:49 +08:00
parent 56affbfd19
commit c6522831b4
14 changed files with 621 additions and 189 deletions

View File

@@ -23,6 +23,9 @@ using Microsoft.AspNetCore.Mvc;
using DbModels;
using JNPF.Common.Extension;
using Tnb.ProductionMgr.Entities.Dto.PrdManage;
using NPOI.OpenXmlFormats;
using JNPF.Systems.Entitys.Permission;
using Tnb.BasicData;
namespace Tnb.ProductionMgr
{
@@ -131,6 +134,7 @@ namespace Tnb.ProductionMgr
var materialProp = "";
if (prdTask != null)
{
var dic = await _dictionaryDataService.GetDicByTypeId(DictConst.PrdTaskStatusTypeId);
var eqp = await db.Queryable<EqpEquipment>().FirstAsync(it => it.id == prdTask.eqp_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);
@@ -139,6 +143,12 @@ namespace Tnb.ProductionMgr
materialCode = material != null ? material.code : "";
materialName = material != null ? material.name : "";
materialProp = material != null ? material.material_property : "";
prdTask.workline_code = (await db.Queryable<OrganizeEntity>().Where(it => it.Id == prdTask.workline_id && it.Category == "workline").FirstAsync())?.EnCode;
prdTask.process_code = (await db.Queryable<BasProcess>().Where(it => it.id == prdTask.process_id).FirstAsync())?.process_code;
if (dic.ContainsKey(prdTask.mo_task_status))
{
prdTask.mo_task_status = dic[prdTask.mo_task_status]?.ToString();
}
}
var res = await db.Queryable<PrdReport>().Where(it => it.mo_task_code == mo_task_code)
@@ -152,7 +162,9 @@ namespace Tnb.ProductionMgr
})
.Mapper(it =>
{
it.icmo_qty = it.icmo_qty ?? (db.Queryable<PrdTask>().First(it => it.icmo_code == mo_task_code)?.scheduled_qty < 1 ? 0 : it.icmo_qty ?? db.Queryable<PrdTask>().First(it => it.icmo_code == mo_task_code).scheduled_qty);
it.icmo_qty = it.icmo_qty ?? (
db.Queryable<PrdMoTask>().First(it => it.mo_task_code == mo_task_code)?.scheduled_qty < 1 ? 0 :
(it.icmo_qty ?? db.Queryable<PrdMoTask>().First(it => it.mo_task_code == mo_task_code)?.scheduled_qty ?? 0));
it.reported_work_qty = it.reported_work_qty ?? 0;
it.reported_qty = it.reported_qty ?? 0;
it.prd_qty = it.prd_qty ?? 0;
@@ -167,7 +179,8 @@ namespace Tnb.ProductionMgr
prdTask.reported_work_qty = res?.reported_work_qty ?? 0;
prdTask.reported_qty = res?.reported_qty ?? 0;
prdTask.prd_qty = res?.prd_qty ?? 0;
prdTask.scrap_qty = res?.scrap_qty ?? 0;
return prdTask;
}