feat: 包装管理和车次管理接口功能增强

- 新增包装分类获取接口
- 包装列表增加分类信息、包装内数量和车次关联筛选
- 保存包装支持分类字段
- 车次关联包装增加重复校验
This commit is contained in:
2026-04-15 23:41:05 +08:00
parent 22ad6c566c
commit 5809a5fb48
6 changed files with 71 additions and 7 deletions
@@ -1,4 +1,4 @@
using FastReport.DevComponents.DotNetBar;
using FastReport.DevComponents.DotNetBar;
using FineUIPro;
using Model;
using System;
@@ -15,7 +15,9 @@ namespace BLL
public static class HJGLPackagingmanageService
{
#region Fields
/// <summary>
/// 包装分类映射字典
/// </summary>
public static Dictionary<string, int> CategoryIntMap = new Dictionary<string, int>
{
{ "打捆" ,(int)CategoryInt.},
@@ -528,6 +530,20 @@ namespace BLL
{
baseQuery = baseQuery.Where(z => z.train.Id != null && z.train.Id.Contains(filter.TrainNumberId));
}
// 是否关联车次筛选
if (filter.HasTrainNumber.HasValue)
{
if (filter.HasTrainNumber.Value)
{
// 已关联车次:TrainNumberId 不为空
baseQuery = baseQuery.Where(z => z.x.TrainNumberId != null && z.x.TrainNumberId != "");
}
else
{
// 未关联车次:TrainNumberId 为空
baseQuery = baseQuery.Where(z => z.x.TrainNumberId == null || z.x.TrainNumberId == "");
}
}
}
baseQuery = baseQuery.OrderByDescending(z => (z.x.ReceiveDate ?? DateTime.MinValue)).ThenBy(z => z.x.PackagingCode);
@@ -545,6 +561,9 @@ namespace BLL
ReceiveMan = z.train.ContactName,
ReceiveDate = string.Format("{0:g}", z.x.ReceiveDate),
TrainNumber = z.train.TrainNumber,
ComponentCount = db.HJGL_PackagingManageDetail.Count(d => d.PackagingManageId == z.x.PackagingManageId),
CategoryInt = z.x.CategoryInt,
CategoryString = z.x.CategoryInt == 10 ? "打捆" : (z.x.CategoryInt == 20 ? "装箱" : (z.x.CategoryInt == 30 ? "散装" : ""))
}).Distinct();
totalCount = q.Count();