From 71ed49e08b60b6760f97237abe2e70448056d4c7 Mon Sep 17 00:00:00 2001 From: hlb <894797954@qq.com> Date: Thu, 23 Nov 2023 15:51:31 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=BD=AC=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entity/WmsCheckstockH.part.cs | 114 ++++++++++++++++++ .../Tnb.WarehouseMgr/WmsCheckTaskService.cs | 14 ++- 2 files changed, 126 insertions(+), 2 deletions(-) create mode 100644 WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCheckstockH.part.cs diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCheckstockH.part.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCheckstockH.part.cs new file mode 100644 index 00000000..4d93f685 --- /dev/null +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCheckstockH.part.cs @@ -0,0 +1,114 @@ +using JNPF.Common.Contracts; +using JNPF.Common.Security; +using SqlSugar; + +namespace Tnb.WarehouseMgr.Entities; + +/// +/// 盘点任务主表 +/// +[SugarTable("wms_checkstock_h")] +public partial class WmsCheckstockH : BaseEntity +{ + public WmsCheckstockH() + { + id = SnowflakeIdHelper.NextId(); + } + /// + /// 所属组织 + /// + public string? org_id { get; set; } + + /// + /// 单号 + /// + public string? checkstock_code { get; set; } + + /// + /// 盘点计划ID + /// + public string? checkplan_id { get; set; } + + /// + /// 仓库ID + /// + public string? warehouse_id { get; set; } + + /// + /// 盘点状态 + /// + public string? status { get; set; } + + /// + /// 盘点类型 + /// + public string? checkstock_type { get; set; } + + /// + /// 盘点种类 + /// + public string? handle_kinds { get; set; } + + /// + /// 盘点开始时间 + /// + public DateTime? check_start_date { get; set; } + + /// + /// 盘点结束时间 + /// + public DateTime? check_end_date { get; set; } + + /// + /// 盘点人ID + /// + public string? checkstock_id { get; set; } + + /// + /// 扩展 + /// + public string? extras { get; set; } + + /// + /// 时间戳 + /// + public DateTime? timestamp { get; set; } + + /// + /// 创建用户 + /// + public string? create_id { get; set; } + + /// + /// 创建时间 + /// + public DateTime? create_time { get; set; } + + /// + /// 修改用户 + /// + public string? modify_id { get; set; } + + /// + /// 修改时间 + /// + public DateTime? modify_time { get; set; } + + /// + /// 流程任务Id + /// + public string? f_flowtaskid { get; set; } + + /// + /// 流程引擎Id + /// + public string? f_flowid { get; set; } + /// + /// 物料ID + /// + public string? material_id { get; set; } + /// + /// 区域ID + /// + public string area_id { get; set; } +} diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs index f31161e9..e1b6cb0f 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs @@ -42,6 +42,7 @@ namespace Tnb.WarehouseMgr private readonly IVisualDevService _visualDevService; private readonly IRunService _runService; private readonly IBillRullService _billRullService; + private readonly IDictionaryDataService _dataService; private static Dictionary _carryMap = new(); public WmsCheckTaskService( @@ -51,6 +52,7 @@ namespace Tnb.WarehouseMgr IRunService runService, IBillRullService billRullService, IUserManager userManager, + IDictionaryDataService dataService, IEventPublisher eventPublisher ) { @@ -59,6 +61,7 @@ namespace Tnb.WarehouseMgr _visualDevService = visualDevService; _runService = runService; _billRullService = billRullService; + _dataService = dataService; _userManager = userManager; OverideFuncs.CreateAsync = Create; @@ -421,9 +424,16 @@ namespace Tnb.WarehouseMgr [HttpGet("{carryCode}")] public async Task GetCheckTaskInfo(string carryCode) { + var checkTypeMap = await _dataService.GetDicByKey("CheckType"); + var checkSpeciesMap = await _dataService.GetDicByKey("CheckSpecies"); var result = await _db.Queryable().InnerJoin((a, b) => a.require_id == b.id) - .Where((a, b) => a.carry_code == carryCode) - .Select() + .InnerJoin((a, b, c) => b.warehouse_id == c.id) + .Where(a => a.carry_code == carryCode) + .Select((a, b, c) => new WmsCheckstockH { warehouse_name = c.whname }, true) + .Mapper(it => + { + it.checkstock_type = checkTypeMap.ContainsKey(it.checkstock_type) ? checkTypeMap[it.checkstock_type]?.ToString() ?? "" : ""; + }) .ToListAsync(); return result; } From a088c3aeb5e0c1ee8f9459e37181d98304a9ce3c Mon Sep 17 00:00:00 2001 From: hlb <894797954@qq.com> Date: Thu, 23 Nov 2023 15:51:38 +0800 Subject: [PATCH 2/4] 1 --- .../Entity/WmsCheckstockH.part.cs | 103 +----------------- 1 file changed, 3 insertions(+), 100 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCheckstockH.part.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCheckstockH.part.cs index 4d93f685..c039170e 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCheckstockH.part.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCheckstockH.part.cs @@ -7,108 +7,11 @@ namespace Tnb.WarehouseMgr.Entities; /// /// 盘点任务主表 /// -[SugarTable("wms_checkstock_h")] public partial class WmsCheckstockH : BaseEntity { - public WmsCheckstockH() - { - id = SnowflakeIdHelper.NextId(); - } /// - /// 所属组织 + /// 仓库名称 /// - public string? org_id { get; set; } - - /// - /// 单号 - /// - public string? checkstock_code { get; set; } - - /// - /// 盘点计划ID - /// - public string? checkplan_id { get; set; } - - /// - /// 仓库ID - /// - public string? warehouse_id { get; set; } - - /// - /// 盘点状态 - /// - public string? status { get; set; } - - /// - /// 盘点类型 - /// - public string? checkstock_type { get; set; } - - /// - /// 盘点种类 - /// - public string? handle_kinds { get; set; } - - /// - /// 盘点开始时间 - /// - public DateTime? check_start_date { get; set; } - - /// - /// 盘点结束时间 - /// - public DateTime? check_end_date { get; set; } - - /// - /// 盘点人ID - /// - public string? checkstock_id { get; set; } - - /// - /// 扩展 - /// - public string? extras { get; set; } - - /// - /// 时间戳 - /// - public DateTime? timestamp { get; set; } - - /// - /// 创建用户 - /// - public string? create_id { get; set; } - - /// - /// 创建时间 - /// - public DateTime? create_time { get; set; } - - /// - /// 修改用户 - /// - public string? modify_id { get; set; } - - /// - /// 修改时间 - /// - public DateTime? modify_time { get; set; } - - /// - /// 流程任务Id - /// - public string? f_flowtaskid { get; set; } - - /// - /// 流程引擎Id - /// - public string? f_flowid { get; set; } - /// - /// 物料ID - /// - public string? material_id { get; set; } - /// - /// 区域ID - /// - public string area_id { get; set; } + [SugarColumn(IsIgnore =true)] + public string warehouse_name { get; set; } } From 763b56dd91bddda682943f348f9a7059478986c9 Mon Sep 17 00:00:00 2001 From: "yang.lee" Date: Thu, 23 Nov 2023 15:55:52 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=9B=98=E7=82=B9?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E4=BF=A1=E6=81=AF=EF=BC=8C=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E4=BB=93=E5=BA=93=E5=90=8D=E7=A7=B0=EF=BC=8C?= =?UTF-8?q?=E7=9B=98=E7=82=B9=E7=8A=B6=E6=80=81=EF=BC=8C=E7=9B=98=E7=82=B9?= =?UTF-8?q?=E7=A7=8D=E7=B1=BB=20=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs index e1b6cb0f..40701195 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs @@ -432,7 +432,8 @@ namespace Tnb.WarehouseMgr .Select((a, b, c) => new WmsCheckstockH { warehouse_name = c.whname }, true) .Mapper(it => { - it.checkstock_type = checkTypeMap.ContainsKey(it.checkstock_type) ? checkTypeMap[it.checkstock_type]?.ToString() ?? "" : ""; + it.checkstock_type = checkTypeMap.ContainsKey(it.checkstock_type!) ? checkTypeMap[it.checkstock_type!]?.ToString() ?? "" : ""; + it.handle_kinds = checkTypeMap.ContainsKey(it.handle_kinds!) ? checkTypeMap[it.handle_kinds!]?.ToString() ?? "" : ""; }) .ToListAsync(); return result; From 31c4deb0e27ff462439944f3fbf03e091c4eeb24 Mon Sep 17 00:00:00 2001 From: "yang.lee" Date: Thu, 23 Nov 2023 16:29:26 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E9=85=8D=E9=80=81=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=EF=BC=8C=E7=94=9F=E6=88=90=E9=A2=84=E4=BB=BB=E5=8A=A1=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=EF=BC=8C=E8=B5=B7=E7=BB=88=E7=82=B9=E4=BD=8DId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs | 1 + WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs | 2 +- WarehouseMgr/Tnb.WarehouseMgr/WmsDeliveryService.cs | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs index 88a86f13..5cc5d655 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs @@ -370,6 +370,7 @@ namespace Tnb.WarehouseMgr await db.Ado.BeginTranAsync(); List endPointIds = disTasks.Where(t => t.area_code.StartsWith("ELE", StringComparison.OrdinalIgnoreCase)).Select(t => t.endpoint_id).ToList(); + Logger.Information($"endPointIds:{string.Join(",", endPointIds)}"); if (endPointIds?.Count > 0) { elevatorList = elevatorList.FindAll(x => endPointIds.Contains(x.point_id)); diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs index 40701195..5a870070 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs @@ -580,7 +580,7 @@ namespace Tnb.WarehouseMgr csCode.checkstock_d_id = checkStockDMap.ContainsKey($"{csCode.carry_id}{csCode.material_id}{csCode.code_batch}") ? checkStockDMap[$"{csCode.carry_id}{csCode.material_id}{csCode.code_batch}"] : ""; } //插入 盘点code表 - await _db.Insertable(checkStockCodes).ExecuteCommandAsync(); + _ = await _db.Insertable(checkStockCodes).ExecuteCommandAsync(); var detailIds = checkStockCodes.Select(x => x.checkstock_d_id).ToList(); var checkStockDs = await _db.Queryable().Where(it => detailIds.Contains(it.id)).ToListAsync(); foreach (var csd in checkStockDs) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsDeliveryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsDeliveryService.cs index 37d9f22b..86e185a3 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsDeliveryService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsDeliveryService.cs @@ -148,7 +148,9 @@ namespace Tnb.WarehouseMgr org_id = _userManager.User.OrganizeId, startlocation_id = sPoint?.location_id!, startlocation_code = sPoint?.location_code!, + startpoint_id = sPoint?.id, startpoint_code = sPoint?.point_code, + endpoint_id = ePoint?.id, endpoint_code = ePoint?.point_code, endlocation_id = ePoint?.location_id!, endlocation_code = ePoint?.location_code!,