22
schangxiang@126.com
2024-12-09 b5d7c95fefb1c0df40a9623511237d4d4271e5e0
22
已添加1个文件
已修改1个文件
76 ■■■■■ 文件已修改
LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsCommonnQuery/Dto/QueryUpiListByUpiInput.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsCommonnQuery/WmsCommonnQueryService.cs 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsCommonnQuery/Dto/QueryUpiListByUpiInput.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
using Admin.NET.Core;
using System.ComponentModel.DataAnnotations;
namespace Admin.NET.Application;
public class QueryUpiListByUpiInput
{
    /// <summary>
    /// éƒ¨ä»¶æ¡ç 
    /// </summary>
    public virtual string Upi { get; set; }
}
LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsCommonnQuery/WmsCommonnQueryService.cs
@@ -645,5 +645,64 @@
        return package;
    }
    /// <summary>
    /// æ ¹æ®åŒ…号,查询某个包下的板件数据
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [HttpPost]
    [ApiDescriptionSettings(Name = "QueryUpiListByPackage")]
    [Description("WmsCommonnQuery/QueryUpiListByPackage")]
    public async Task<List<Mes_BatchOrderUPI_New>> QueryUpiListByPackage(QueryPackageInput input)
    {
        if (input == null || input.PackageCode == null)
        {
            throw Oops.Oh("参数不能为空");
        }
        var package = await _mesPackageGatherRep.AsQueryable().Where(x => x.PackageCode == input.PackageCode).FirstAsync();
        if (package == null)
        {
            throw Oops.Oh($"没有找到包号{input.PackageCode}的汇总数据");
        }
        var upiList = await _mesBatchOrderUpiRep.AsQueryable().Where(x => x.PackageCode == input.PackageCode).ToListAsync();
        return upiList;
    }
    /// <summary>
    /// æ ¹æ®æŸä¸ªUpi,查询某个包下的板件数据
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [HttpPost]
    [ApiDescriptionSettings(Name = "QueryUpiListByUpi")]
    [Description("WmsCommonnQuery/QueryUpiListByUpi")]
    public async Task<List<Mes_BatchOrderUPI_New>> QueryUpiListByUpi(QueryUpiListByUpiInput input)
    {
        if (input == null || input.Upi == null)
        {
            throw Oops.Oh("参数不能为空");
        }
        var singleUpi = await _mesBatchOrderUpiRep.AsQueryable().Where(x => x.UPI == input.Upi).FirstAsync();
        if (singleUpi == null)
        {
            throw Oops.Oh($"没有找到部件条码{input.Upi}的数据");
        }
        var package = await _mesPackageGatherRep.AsQueryable().Where(x => x.PackageCode == singleUpi.PackageCode).FirstAsync();
        if (package == null)
        {
            throw Oops.Oh($"没有找到包号{singleUpi.PackageCode}的汇总数据");
        }
        var upiList = await _mesBatchOrderUpiRep.AsQueryable().Where(x => x.PackageCode == singleUpi.PackageCode).ToListAsync();
        return upiList;
    }
}