1
啊鑫
2024-10-08 1a586fff23913ff9ac8b5e9b62839ab5b767cb61
MES.Service/service/Warehouse/MesInvItemOutsManager.cs
@@ -14,13 +14,16 @@
    //当前类已经继承了 Repository 增、删、查、改的方法
    //这里面写的代码不会给覆盖,如果要重新生成请删除 MesInvItemOutsManager.cs
    public List<MesInvItemOuts> GetProductionPickPage(WarehouseQuery query)
    public (List<MesInvItemOuts> Items, int TotalCount) GetProductionPickPage(
        WarehouseQuery query)
    {
        return Db.Queryable<MesInvItemOuts, MesDepots>((a, o) =>
        var totalCount = 0; // 初始化 totalCount
        // 确保这里使用 'out' 来获取总行数
        var result = Db.Queryable<MesInvItemOuts, MesDepots>((a, o) =>
                new JoinQueryInfos(
                    JoinType.Left,
                    o.DepotCode == a.DepotCode && a.Company == o.Company &&
                    a.Factory == o.Factory
                    a.Factory == a.Factory
                ))
            .Where((a, o) => a.BillTypeId == 200 &&
                             a.TransactionNo == 201 &&
@@ -46,7 +49,10 @@
                ItemOutNo = a.ItemOutNo,
                DepotName = o.DepotName // 需要动态添加的字段
            })
            .ToPageList(query.PageIndex, query.Limit);
            .ToPageList(query.PageIndex, query.Limit,
                ref totalCount); // 确保这里使用 'out'
        return (result, totalCount);
    }
    public MaterialReceipt GetProductionPick(WarehouseQuery query)
@@ -55,9 +61,9 @@
        if (query.id != null)
        {
            var mesInvItemOutsList = GetProductionPickPage(query);
            if (mesInvItemOutsList.Count <= 0) return form;
            if (mesInvItemOutsList.TotalCount <= 0) return form;
            form.ItemOuts = mesInvItemOutsList[0];
            form.ItemOuts = mesInvItemOutsList.Items[0];
            form.ItemsList = getProductionItemsList(query);
            form.InvItemoutCDetails = GetProductionDetails(query);
        }
@@ -831,7 +837,7 @@
        throw new Exception("获取数据失败");
    }
    private MessageCenter ProductionMesToErpParam(WarehouseQuery query)
    public MessageCenter ProductionMesToErpParam(WarehouseQuery query)
    {
        var erpParameters = "";
        var title = "";
@@ -936,8 +942,8 @@
            {
                FMaterialId = item.ItemNo,
                FUnitID = C_ITEM_UNIT,
                FAppQty =  qty,
                FActualQty =  qty,
                FAppQty = qty,
                FActualQty = qty,
                FStockId = item.DepotCode,
                FPPBomEntryId = erpid,
                F_UNW_Text_xsddh = xsddh,