This commit is contained in:
2024-08-26 18:46:15 +08:00
parent 956fccaf6b
commit be00d09fac
6 changed files with 127 additions and 8 deletions

View File

@@ -20,6 +20,15 @@
public int? qty { get; set; }
public string bill_code { get; set; }
public string equip_name { get; set; }
/// <summary>
/// 物料规格
/// </summary>
public string? material_specification { get; set; }
/// <summary>
/// 物料型号
/// </summary>
public string? material_standard { get; set; }
}
public class CheckTaskOut
@@ -168,6 +177,7 @@
public string? result { get; set; }
public List<List<Checktype>>? checktypes { get; set; }
public CheckCarry carryInfo { get; set; }
}
public class Checktype
{
@@ -186,5 +196,15 @@
public PostItemForm? postItemForm { get; set; }
public string? result { get; set; }
}
public class CheckCarry
{
public string carry_name { get; set; }
public string location_id { get; set; }
public string location_code { get; set; }
public string is_check { get; set; }
public string material_name { get; set; }
public decimal qty { get; set; }
}
}

View File

@@ -41,7 +41,11 @@ namespace Tnb.QcMgr.Entities.Enums
[Remark("首检", "开工检")]
= 15,
[Remark("末检", "末检触发事件")]
= 16
= 16,
[Remark("巡检", "巡检")]
= 17,
[Remark("巡检", "巡检")]
= 18,
}
public class RemarkAttribute : Attribute
{

View File

@@ -15,6 +15,7 @@ using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using SqlSugar;
using Tnb.BasicData.Entities;
using Tnb.EquipMgr.Entities;
using Tnb.ProductionMgr.Entities.Dto.PrdManage;
using Tnb.QcMgr.Entities;
using Tnb.QcMgr.Interfaces;
@@ -83,11 +84,13 @@ namespace Tnb.QcMgr
.LeftJoin<OrganizeEntity>((a, b, c, d) => a.workid == d.Id)
.LeftJoin<UserEntity>((a, b, c, d, e) => a.execuser == e.Id)
.LeftJoin<PrdReport>((a,b,c,d,e,f)=>a.report_id==f.id)
.LeftJoin<PrdMoTask>((a,b,c,d,e,f,g)=>a.mo_task_code==g.mo_task_code)
.LeftJoin<EqpEquipment>((a,b,c,d,e,f,g,h)=>g.eqp_id==h.id)
.WhereIF(!string.IsNullOrEmpty(materialid), (a, b, c, d,e) => b.name.Contains(materialid))
.WhereIF(!string.IsNullOrEmpty(checktype), (a, b, c, d, e) => a.checktype == checktype)
.WhereIF(!string.IsNullOrEmpty(status), (a, b, c, d, e) => a.status == status)
.Where((a, b, c, d, e) => a.status == list.Where(p => p.FullName == "待执行").First().Id)
.Select((a, b, c, d, e,f) => new QcCheckExecHOut
.Select((a, b, c, d, e,f,g,h) => new QcCheckExecHOut
{
id = a.id,
materialid = b.name,
@@ -103,7 +106,10 @@ namespace Tnb.QcMgr
execuser = e.RealName ?? "",
mo_task_code = a.mo_task_code,
batch = a.batch,
qty = a.qty
qty = a.qty,
material_standard = b.material_standard,
material_specification = b.material_specification,
equip_name = h.name,
}).OrderByDescending(a => DateTime.Parse(a.tasktime)).ToPagedListAsync(input.currentPage, input.pageSize);
foreach (QcCheckExecHOut? item in result.list)
{
@@ -408,6 +414,21 @@ namespace Tnb.QcMgr
checktypes = new List<List<Checktype>>(),
result = QcCheckExecH.result
};
if (!string.IsNullOrEmpty(QcCheckExecH.carry_code))
{
WmsCarryH carryH = await db.Queryable<WmsCarryH>().FirstAsync(x => x.carry_code == QcCheckExecH.carry_code);
WmsCarryCode carryCode = await db.Queryable<WmsCarryCode>().FirstAsync(x => x.carry_id == carryH.id);
string materialId = carryCode?.id ?? "";
BasMaterial basMaterial = await db.Queryable<BasMaterial>().SingleAsync(x=>x.id==materialId);
Result.carryInfo = new CheckCarry()
{
carry_name = carryH.carry_name,
location_id = carryH.location_id,
location_code = carryH.location_code,
material_name = basMaterial?.name,
qty = carryCode?.codeqty ?? 0,
};
}
List<string?> groupkeys = QcCheckExecDs.Select(p => p.checkindex).Distinct().ToList();
foreach (string? key in groupkeys)
{