服务端的TigerApi 框架,基于.NET6 2024 版本
Ben Lin
2024-05-08 b674ec171725dee1911483f0a1dbc0b3b9ad4ce5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using Tiger.Model;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using Rhea.Common;
using System.Net;
using System.Linq;
using Newtonsoft.Json;
using Tiger.IBusiness;
using static Tiger.Business.Biz;
using Microsoft.AspNetCore.Http;
using System.Collections;
 
namespace Tiger.Business
{
    public partial class Biz
    {
        /// <summary>
        /// 工具管理
        /// </summary>
        public partial class SmtTool : ISmtTool
        {
            /// <summary>
            /// 获取未上料列表
            /// </summary>
            /// <param name="paras"></param>
            /// <returns></returns>
            public async Task<ApiAction<List<SMT_WO_TABLE>>> GetNotLoadingMaterial(smtWoTableParams paras)
            {
                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);
            }
        }
    }
}