22
schangxiang@126.com
2024-11-30 fe5dd3d5e16980a1fe722712e488875e34bc7455
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 Admin.NET.Core.Service;
using Admin.NET.Application.Entity;
using Microsoft.AspNetCore.Http;
using System.Data;
using System.Web;
using System.Text;
using DocumentFormat.OpenXml.Office.CustomUI;
using Microsoft.CodeAnalysis.Operations;
using Admin.NET.Application.Service.WmsTask.WmsRbLineTask.Dto;
 
namespace Admin.NET.Application;
/// <summary>
/// 通用查询服务
/// </summary>
[ApiDescriptionSettings(ApplicationConst.WmsCommonnQueryGroupName, Order = 100)]
public class WmsCommonnQueryService : IDynamicApiController, ITransient
{
    private readonly SqlSugarRepository<WmsRbLineTask> _rep;
    private readonly SqlSugarRepository<WmsStockQuan> _wmsStockQuanRep;
    private readonly SqlSugarRepository<Mes_Package_Gather> _mesPackageGatherRep;
    private readonly SqlSugarRepository<SysConfig> _sysConfigRep;
    private readonly SqlSugarRepository<Mes_BatchOrderUPI_New> _mesBatchOrderUpiRep;
    private readonly SqlSugarRepository<Mes_Order_Gather> _mesOrderGatherRep;
 
    public WmsCommonnQueryService(SqlSugarRepository<WmsRbLineTask> rep, SqlSugarRepository<WmsStockQuan> wmsStockQuanRep
        , SqlSugarRepository<Mes_Package_Gather> mesPackageGatherRep
        , SqlSugarRepository<SysConfig> sysConfigRep
        , SqlSugarRepository<Mes_BatchOrderUPI_New> mesBatchOrderUpiRep
        , SqlSugarRepository<Mes_Order_Gather> mesOrderGatherRep
        )
    {
        _sysConfigRep = sysConfigRep;
        _mesPackageGatherRep = mesPackageGatherRep;
        _rep = rep;
        _wmsStockQuanRep = wmsStockQuanRep;
        _mesBatchOrderUpiRep = mesBatchOrderUpiRep;
        _mesOrderGatherRep = mesOrderGatherRep;
    }
 
    /// <summary>
    /// 查询不齐套单据
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [HttpGet]
    [ApiDescriptionSettings(Name = "QueryNoKittingList")]
    [Description("WmsCommonnQuery/QueryNoKittingList")]
    public async Task<List<Mes_Order_Gather>> QueryNoKittingList([FromQuery] KittingListInput input)
    {
        var list = await _mesOrderGatherRep.AsQueryable()
            .WhereIF(!string.IsNullOrWhiteSpace(input.Info5), u => u.Info5.Contains(input.Info5.Trim()))
            .WhereIF(!string.IsNullOrWhiteSpace(input.Info5), u => u.Info5.Contains(input.Info5.Trim()))
            .Where(x => ((DateTime)x.CreateTime).ToString("yyyyMMdd") == DateTime.Now.ToString("yyyyMMdd"))
            .Where(x => x.IsKitting == false)
            .OrderBy(g => g.Id)
            .ToListAsync(); // 确保获取结果为 List
 
        return list; // 结果
    }
}