啊鑫
2024-09-19 30846c0d13ee4136d68ba509b05281378db951c6
MES.Service/service/WomdaaManager.cs
@@ -13,7 +13,7 @@
    //获取工单号
    public List<string> GetProductionPickDaa001(WarehouseQuery query)
    {
        string sql =
        var sql =
            "SELECT DAA001 FROM WOMDAA A LEFT JOIN (SELECT COUNT(1) UN_NUM, PID                     FROM WOMDAB                    WHERE DAB006 > DAB007                   GROUP BY PID) B ON A.ID = B.PID WHERE DAA001 LIKE '%" +
            query.daa001 +
            "%' and DAA018 != '完工' AND DAA022 = 1 AND UN_NUM > 0 AND ROWNUM <= 10 order by a.id desc";
@@ -24,10 +24,7 @@
    //根据工单号返回产品型号和待领物料
    public ProductionPickDto GetItemsByDaa001(WarehouseQuery query)
    {
        if (string.IsNullOrEmpty(query.daa001))
        {
            throw new Exception("工单号为空");
        }
        if (string.IsNullOrEmpty(query.daa001)) throw new Exception("工单号为空");
        var womdaa = Db.Queryable<Womdaa, MesItems>((a, i) =>
                new JoinQueryInfos(JoinType.Left,
@@ -38,10 +35,7 @@
                i.ItemModel
            }).First();
        if (womdaa?.ItemModel == null)
        {
            throw new Exception("工单号不存在");
        }
        if (womdaa?.ItemModel == null) throw new Exception("工单号不存在");
        var dto = new ProductionPickDto
        {
@@ -58,7 +52,7 @@
                ))
            .Where((a, b, c) =>
                a.Daa001 == query.daa001) // WHERE DAA001 = 'SCDD003681-1'
            .Select((a, b, c) => new Womdab()
            .Select((a, b, c) => new Womdab
            {
                Pid = b.Pid,
                Dab003 = b.Dab003,