This commit is contained in:
2023-11-23 10:45:51 +08:00
parent 242ec34a9a
commit 1b5422c5ec
3 changed files with 16 additions and 17 deletions

View File

@@ -89,9 +89,4 @@ public partial class EqpDaq : BaseEntity<string>
/// </summary>
public string? f_flowid { get; set; }
/// <summary>
/// 库位号
/// </summary>
public string? location_code { get; set; }
}

View File

@@ -281,7 +281,7 @@ namespace Tnb.ProductionMgr
{
equipment = await db.Queryable<EqpEquipment>()
.LeftJoin<EqpDaq>((x,y)=>x.id==y.equip_id)
.Where((x,y) => y.equip_code==equip_code && y.label_name==label_code && y.label_point=="提报装箱称重点位")
.Where((x,y) => y.equip_code==equip_code && y.label_name==label_code && y.label_point=="注塑空满箱请求")
.Select((x,y)=>x)
.FirstAsync();
}
@@ -419,7 +419,7 @@ namespace Tnb.ProductionMgr
});
}
return !result2.IsSuccess ? throw Oops.Oh(ErrorCode.COM1008) : (dynamic)(result2.IsSuccess ? "申请成功" : result2.ErrorMessage);
return !result2.IsSuccess ? string.IsNullOrEmpty(result2.ErrorMessage) ? throw Oops.Oh(ErrorCode.COM1008) : throw Oops.Bah(result2.ErrorMessage) : "成功" ;
}
// [HttpPost]
@@ -560,7 +560,7 @@ namespace Tnb.ProductionMgr
{
equipment = await db.Queryable<EqpEquipment>()
.LeftJoin<EqpDaq>((x,y)=>x.id==y.equip_id)
.Where((x,y) => y.equip_code==equip_code && y.label_name==label_code && y.label_point=="提报装箱称重点位")
.Where((x,y) => y.equip_code==equip_code && y.label_name==label_code && y.label_point=="挤出空满箱请求")
.Select((x,y)=>x)
.FirstAsync();
}
@@ -574,15 +574,18 @@ namespace Tnb.ProductionMgr
throw Oops.Bah("未找到机台");
}
EqpDaq daq = await db.Queryable<EqpDaq>().Where(x =>
x.equip_id == equipment.id && x.label_name == label_code && x.label_point == "提报装箱称重点位").FirstAsync();
if (daq == null)
if (string.IsNullOrEmpty(equipment.as_location_id))
{
throw Oops.Bah("未找到数采信号");
throw Oops.Bah("未找到入库库位");
}
string location_code = daq.location_code;
BasLocation basLocation = await db.Queryable<BasLocation>().SingleAsync(x => x.id == equipment.as_location_id);
if (basLocation == null)
{
throw Oops.Bah("未找到入库库位");
}
string location_code = basLocation.location_code;
PrdReport prdReport = await db.Queryable<PrdReport>()
.Where(x => x.equip_id == equipment.id && x.status == 0).OrderByDescending(x => x.create_time)
@@ -685,7 +688,7 @@ namespace Tnb.ProductionMgr
});
}
return result2.IsSuccess ? "true" : "false";
return !result2.IsSuccess ? string.IsNullOrEmpty(result2.ErrorMessage) ? throw Oops.Oh(ErrorCode.COM1008) : throw Oops.Bah(result2.ErrorMessage) : "成功" ;
}
/// <summary>
@@ -779,6 +782,7 @@ namespace Tnb.ProductionMgr
});
// string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host;
string domain = "http://tnb.tuotong-tech.com";
// string domain = "http://localhost:9232";
Dictionary<string, object> header = new()
{
// ["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
@@ -799,7 +803,7 @@ namespace Tnb.ProductionMgr
});
}
return result2.IsSuccess ? "true" : "false";
return !result2.IsSuccess ? string.IsNullOrEmpty(result2.ErrorMessage) ? throw Oops.Oh(ErrorCode.COM1008) : throw Oops.Bah(result2.ErrorMessage) : "成功" ;
}
/// <summary>

View File

@@ -420,7 +420,7 @@ namespace Tnb.ProductionMgr
.LeftJoin<BasStandardTime>((a, b, c, d, e, f, g, h, i) => a.process_id == i.process_id && i.enabled == 1)
.LeftJoin<PrdMo>((a, b, c, d, e, f, g, h, i, j) => a.mo_id == j.id)
.LeftJoin<BasMaterialUnit>((a, b, c, d, e, f, g, h, i, j, k) => a.material_id == k.material_id && k.auxiliary_unit_id == "kg")
.LeftJoin<EqpDaq>((a, b, c, d, e, f, g, h, i, j, k, l) => a.eqp_id == l.equip_id && l.enabled == 1 && l.label_point == "提报装箱称重点位")
.LeftJoin<EqpDaq>((a, b, c, d, e, f, g, h, i, j, k, l) => a.eqp_id == l.equip_id && l.enabled == 1 && l.label_point == "注塑空满箱请求")
.Where((a, b) => a.workstation_id == input.stationId)
.WhereIF(!string.IsNullOrEmpty(mo_task_code), a => a.mo_task_code.Contains(mo_task_code))
//.WhereIF(!string.IsNullOrEmpty(mo_task_status),a=>a.mo_task_status==mo_task_status)