diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpDaq.cs b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpDaq.cs index 172fe79d..9751ecf4 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpDaq.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpDaq.cs @@ -89,9 +89,4 @@ public partial class EqpDaq : BaseEntity /// public string? f_flowid { get; set; } - /// - /// 库位号 - /// - public string? location_code { get; set; } - } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs index 84d3d343..be46cce0 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs @@ -281,7 +281,7 @@ namespace Tnb.ProductionMgr { equipment = await db.Queryable() .LeftJoin((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() .LeftJoin((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().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().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() .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) : "成功" ; } /// @@ -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 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) : "成功" ; } /// diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs index 98fd2342..8f442b57 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs @@ -420,7 +420,7 @@ namespace Tnb.ProductionMgr .LeftJoin((a, b, c, d, e, f, g, h, i) => a.process_id == i.process_id && i.enabled == 1) .LeftJoin((a, b, c, d, e, f, g, h, i, j) => a.mo_id == j.id) .LeftJoin((a, b, c, d, e, f, g, h, i, j, k) => a.material_id == k.material_id && k.auxiliary_unit_id == "kg") - .LeftJoin((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((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) diff --git a/ProductionMgr/Tnb.ProductionMgr/RedisBackGround.cs b/ProductionMgr/Tnb.ProductionMgr/RedisBackGround.cs index 26f84823..43b82cbd 100644 --- a/ProductionMgr/Tnb.ProductionMgr/RedisBackGround.cs +++ b/ProductionMgr/Tnb.ProductionMgr/RedisBackGround.cs @@ -92,7 +92,7 @@ namespace Tnb.ProductionMgr _prdInstockService.InstockTypeOne(instockInput); break; case EventType.挤出空满箱请求: - _prdInstockService.InstockTypeOne(instockInput); + _prdInstockService.InstockTubeOne(instockInput); break; case EventType.限位请求: _prdInstockService.InstockOutPack(instockInput);