From b674ec171725dee1911483f0a1dbc0b3b9ad4ce5 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期三, 08 五月 2024 17:01:54 +0800 Subject: [PATCH] SMT更新 --- Tiger.Business/MES/SMT/Biz.SmtTool.cs | 35 +++++++++++++++++++++++++++-------- 1 files changed, 27 insertions(+), 8 deletions(-) diff --git a/Tiger.Business/MES/SMT/Biz.SmtTool.cs b/Tiger.Business/MES/SMT/Biz.SmtTool.cs index 0827d74..a9cccb2 100644 --- a/Tiger.Business/MES/SMT/Biz.SmtTool.cs +++ b/Tiger.Business/MES/SMT/Biz.SmtTool.cs @@ -12,6 +12,7 @@ using Tiger.IBusiness; using static Tiger.Business.Biz; using Microsoft.AspNetCore.Http; +using System.Collections; namespace Tiger.Business { @@ -25,16 +26,34 @@ /// <summary> /// 鑾峰彇鏈笂鏂欏垪琛� /// </summary> - /// <param name="itemCode"></param> - /// <param name="lineCode"></param> - /// <param name="pcbSurface"></param> - /// <param name="moCode"></param> - /// <param name="machineCode"></param> + /// <param name="paras"></param> /// <returns></returns> - /// <exception cref="NotImplementedException"></exception> - public Task<ApiAction<SMT_PROD_TABLE>> GetNotLoadingMaterial(string itemCode, string lineCode, string pcbSurface, string moCode, string machineCode = null) + public async Task<ApiAction<List<SMT_WO_TABLE>>> GetNotLoadingMaterial(smtWoTableParams paras) { - throw new NotImplementedException(); + var res = new ApiAction<List<SMT_WO_TABLE>>(); + List<SMT_WO_TABLE> sList = new List<SMT_WO_TABLE>(); + try + { + sList = Db.Queryable<SMT_WO_TABLE, SMT_LOADING>((t, l) => + new JoinQueryInfos( + JoinType.Left, + t.WORK_ORDER == l.WORK_ORDER + && t.PROD_CODE == l.PROD_CODE + && t.PCB_SURFACE == l.PCB_SURFACE + && t.LINE_CODE == l.LINE_CODE + && t.SLOT_NO == l.SLOT_NO + )) + .Where((t, l) => SqlFunc.IsNullOrEmpty(l.WORK_ORDER) && t.WORK_ORDER == paras.moCode && t.PROD_CODE == paras.prodCode && t.LINE_CODE == paras.lineCode && t.PCB_SURFACE == paras.pcbSurface) + .WhereIF(SqlFunc.IsNullOrEmpty(paras.machineCode), (t, l) => t.SMT_CODE == paras.machineCode) + .Select((t, l) => t) + .ToList(); + } + catch (Exception ex) + { + res.CatchExceptionWithLog(ex, "鏌ヨ寮傚父"); + } + res.Data = sList; + return await Task.FromResult(res); } } } -- Gitblit v1.9.3