From 5db9603be2bd64b591b5f0130b26b9232029c4d2 Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Mon, 27 Nov 2023 10:54:33 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PrdManage/PrdInstockRecordUpListOutPut.cs | 39 ++++++ .../Entity/PrdInstockH.cs | 10 ++ .../PrdInstockRecordDownServicecs.cs | 80 +++++++++++++ .../PrdInstockRecordUpServicecs.cs | 113 ++++++++++++++++++ .../Tnb.ProductionMgr/PrdInstockService.cs | 20 +++- 5 files changed, 260 insertions(+), 2 deletions(-) create mode 100644 ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdInstockRecordUpListOutPut.cs create mode 100644 ProductionMgr/Tnb.ProductionMgr/PrdInstockRecordDownServicecs.cs create mode 100644 ProductionMgr/Tnb.ProductionMgr/PrdInstockRecordUpServicecs.cs diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdInstockRecordUpListOutPut.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdInstockRecordUpListOutPut.cs new file mode 100644 index 00000000..faf6e012 --- /dev/null +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdInstockRecordUpListOutPut.cs @@ -0,0 +1,39 @@ +namespace Tnb.ProductionMgr.Entities.Dto +{ + public class PrdInstockRecordUpListOutPut + { + public string id { get; set; } + public string mo_task_code { get; set; } + public string mo_task_status { get; set; } + public string mo_id { get; set; } + public string material_id { get; set; } + public string workstation_id { get; set; } + public string workline_id { get; set; } + public string act_start_date { get; set; } + public List tablefield102 { get; set; } = new List(); + } + + public class PrdInstockRecordUpListChildOutPut + { + public string id { get; set; } + public string bill_code { get; set; } + public string bill_type { get; set; } + public string carry_code { get; set; } + public string create_id { get; set; } + public string bill_date { get; set; } + } + + public class PrdInstockRecordUpListDownOutPut + { + public string id { get; set; } + public string material_id { get; set; } + public string material_code { get; set; } + public string unit_id { get; set; } + public string quantity { get; set; } + public string code_batch { get; set; } + /// + /// 条码编号 + /// + public string barcode { get; set; } = string.Empty; + } +} \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdInstockH.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdInstockH.cs index 720f5d24..488366d5 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdInstockH.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdInstockH.cs @@ -75,5 +75,15 @@ public partial class PrdInstockH : BaseEntity /// 状态 0 申请入库 1 已入库 /// public int? status { get; set; } + + /// + /// 生产任务单id + /// + public string? mo_task_id { get; set; } + + /// + /// 入库单编号 + /// + public string? code { get; set; } } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdInstockRecordDownServicecs.cs b/ProductionMgr/Tnb.ProductionMgr/PrdInstockRecordDownServicecs.cs new file mode 100644 index 00000000..09ca70e7 --- /dev/null +++ b/ProductionMgr/Tnb.ProductionMgr/PrdInstockRecordDownServicecs.cs @@ -0,0 +1,80 @@ +using JNPF.Common.Core.Manager; +using JNPF.Common.Filter; +using JNPF.DependencyInjection; +using JNPF.DynamicApiController; +using JNPF.Systems.Entitys.Permission; +using JNPF.Systems.Entitys.System; +using JNPF.Systems.Interfaces.Permission; +using JNPF.VisualDev; +using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using SqlSugar; +using Tnb.BasicData; +using Tnb.BasicData.Entities; +using Tnb.EquipMgr.Entities; +using Tnb.ProductionMgr.Entities; +using Tnb.ProductionMgr.Entities.Dto; +using Tnb.WarehouseMgr.Entities; + +namespace Tnb.ProductionMgr +{ + /// + /// 物料签收记录pc端 + /// + [ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 700)] + [Route("api/[area]/[controller]/[action]")] + [OverideVisualDev(ModuleId)] + public class PrdInstockRecordDownServicecs : IDynamicApiController, ITransient, IOverideVisualDevService + { + private readonly ISqlSugarRepository _repository; + private readonly IUserManager _userManager; + private readonly IOrganizeService _organizeService; + private const string ModuleId = "30374696689685"; + public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc(); + + public PrdInstockRecordDownServicecs( + ISqlSugarRepository repository, + IOrganizeService organizeService, + IUserManager userManager + ) + { + _repository = repository; + _organizeService = organizeService; + _userManager = userManager; + OverideFuncs.GetListAsync = GetList; + } + + private async Task GetList(VisualDevModelListQueryInput input) + { + var db = _repository.AsSugarClient(); + Dictionary? queryJson = !string.IsNullOrEmpty(input.queryJson) ? JsonConvert.DeserializeObject>(input.queryJson) : new Dictionary(); + string instock_id = queryJson.ContainsKey("instock_id") ? queryJson["instock_id"].ToString() : ""; + if (string.IsNullOrEmpty(instock_id)) + { + return new + { + pagination = new PageResult(), + list = Array.Empty() + }; + } + + var result = await db.Queryable() + .LeftJoin((a, b) => a.material_id == b.id) + .LeftJoin((a,b,c)=>c.EnCode==DictConst.MeasurementUnit) + .LeftJoin((a,b,c,d)=>a.unit_id==d.EnCode && c.Id==d.DictionaryTypeId) + .WhereIF(!string.IsNullOrEmpty(instock_id),a=>a.instock_id==instock_id) + .Select((a, b, c,d) => new PrdInstockRecordUpListDownOutPut + { + id = a.id, + material_id = b.name, + material_code = b.code, + unit_id = d.FullName, + code_batch = a.code_batch, + barcode = a.barcode, + quantity = a.quantity.ToString(), + }).ToPagedListAsync(input.currentPage, input.pageSize); + return PageResult.SqlSugarPageResult(result); + } + } +} \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdInstockRecordUpServicecs.cs b/ProductionMgr/Tnb.ProductionMgr/PrdInstockRecordUpServicecs.cs new file mode 100644 index 00000000..ba412c09 --- /dev/null +++ b/ProductionMgr/Tnb.ProductionMgr/PrdInstockRecordUpServicecs.cs @@ -0,0 +1,113 @@ +using JNPF.Common.Core.Manager; +using JNPF.Common.Filter; +using JNPF.DependencyInjection; +using JNPF.DynamicApiController; +using JNPF.Systems.Entitys.Permission; +using JNPF.Systems.Entitys.System; +using JNPF.Systems.Interfaces.Permission; +using JNPF.VisualDev; +using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using SqlSugar; +using Tnb.BasicData; +using Tnb.BasicData.Entities; +using Tnb.EquipMgr.Entities; +using Tnb.ProductionMgr.Entities; +using Tnb.ProductionMgr.Entities.Dto; +using Tnb.WarehouseMgr.Entities; + +namespace Tnb.ProductionMgr +{ + /// + /// 生产入库记录pc端 + /// + [ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 700)] + [Route("api/[area]/[controller]/[action]")] + [OverideVisualDev(ModuleId)] + public class PrdInstockRecordUpServicecs : IDynamicApiController, ITransient, IOverideVisualDevService + { + private readonly ISqlSugarRepository _repository; + private readonly IUserManager _userManager; + private readonly IOrganizeService _organizeService; + private const string ModuleId = "30374667217173"; + public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc(); + + public PrdInstockRecordUpServicecs( + ISqlSugarRepository repository, + IOrganizeService organizeService, + IUserManager userManager + ) + { + _repository = repository; + _organizeService = organizeService; + _userManager = userManager; + OverideFuncs.GetListAsync = GetList; + } + + private async Task GetList(VisualDevModelListQueryInput input) + { + var db = _repository.AsSugarClient(); + Dictionary? queryJson = !string.IsNullOrEmpty(input.queryJson) ? JsonConvert.DeserializeObject>(input.queryJson) : new Dictionary(); + string mo_task_code = queryJson.ContainsKey("mo_task_code") ? queryJson["mo_task_code"].ToString() : ""; + string mo_code = queryJson.ContainsKey("mo_id") ? queryJson["mo_id"].ToString() : ""; + // string workstation_id_str = queryJson.ContainsKey("workstation_id") ? queryJson["workstation_id"].ToString() : ""; + // string workstation_id = ""; + // if (!string.IsNullOrEmpty(workstation_id_str)) + // { + // string[] workstation_arr = JsonConvert.DeserializeObject(workstation_id_str); + // if (workstation_arr != null && workstation_arr.Length > 0) + // { + // workstation_id = workstation_arr[workstation_arr.Length - 1]; + // } + // } + + if (string.IsNullOrEmpty(input.sidx)) + { + input.sidx = "a.create_time"; + input.sort = "desc"; + } + else + { + input.sidx = "a." + input.sidx; + } + + + var result = await db.Queryable() + .LeftJoin((a, b) => a.material_id == b.id) + .LeftJoin((a,b,c)=>a.workstation_id==c.Id) + .LeftJoin((a,b,c,d)=>a.mo_id==d.id) + .LeftJoin((a,b,c,d,e)=>e.DictionaryTypeId==DictConst.PrdTaskStatusTypeId && a.mo_task_status==e.EnCode) + .LeftJoin((a,b,c,d,e,f)=>a.workline_id==f.Id) + .WhereIF(!string.IsNullOrEmpty(mo_task_code),a=>a.mo_task_code.Contains(mo_task_code)) + .WhereIF(!string.IsNullOrEmpty(mo_code),(a,b,c,d,e)=>d.mo_code.Contains(mo_code)) + .Where(a=>a.act_start_date!=null) + .OrderBy($"{input.sidx} {input.sort}") + .Select((a, b, c, d,e,f) => new PrdInstockRecordUpListOutPut() + { + id = a.id, + mo_task_code = a.mo_task_code, + mo_id = d.mo_code, + material_id = b.name, + workstation_id = c.FullName, + mo_task_status = e.FullName, + workline_id = f.FullName, + act_start_date = a.act_start_date==null ? "" : a.act_start_date.Value.ToString(DbTimeFormat.SS), + tablefield102 = SqlFunc.Subqueryable() + .LeftJoin((x,y)=>x.create_id==y.Id) + .LeftJoin((x,y,z)=>x.bill_type==z.Id) + .Where(x=>x.mo_task_id==a.id).ToList((x,y,z)=>new PrdInstockRecordUpListChildOutPut() + { + id = x.id, + bill_code = x.code, + bill_type = z.FullName, + carry_code = x.carry_code, + create_id = y.RealName, + bill_date = x.bill_date==null ? "" : x.bill_date.ToString(DbTimeFormat.SS), + + }), + }).ToPagedListAsync(input.currentPage, input.pageSize); + return PageResult.SqlSugarPageResult(result); + } + } +} \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs index c2e89f24..ffe40a86 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs @@ -11,6 +11,7 @@ using JNPF.FriendlyException; using JNPF.Logging; using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Interfaces.Permission; +using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; using Microsoft.AspNetCore.Authorization; @@ -40,18 +41,22 @@ namespace Tnb.ProductionMgr private readonly ISqlSugarRepository _repository; private readonly IUserManager _userManager; private readonly IOrganizeService _organizeService; + private readonly IBillRullService _billRuleService; + private const string ModuleId = "25572529329173"; public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc(); public PrdInstockService( ISqlSugarRepository repository, IOrganizeService organizeService, + IBillRullService billRullService, IUserManager userManager ) { _repository = repository; _organizeService = organizeService; _userManager = userManager; + _billRuleService= billRullService; OverideFuncs.GetListAsync = GetList; } @@ -327,8 +332,10 @@ namespace Tnb.ProductionMgr OrganizeEntity workline = await _organizeService.GetAnyParentByWorkstationId(prdReport.station, DictConst.RegionCategoryWorklineCode); OrganizeEntity workshop = await _organizeService.GetAnyParentByWorkstationId(prdReport.station, DictConst.RegionCategoryWorkshopCode); + string code = await _billRuleService.GetBillNumber(CodeTemplateConst.PRDINSTOCK_CODE); prdInstockH = new PrdInstockH() { + code = code, bill_type = DictConst.CHANCHENGPINRUKUDAN, bill_date = DateTime.Now, create_id = create_id, @@ -342,6 +349,7 @@ namespace Tnb.ProductionMgr // warehouse_id = basLocation?.wh_id, warehouse_id = warehouse_id, status = 0, + mo_task_id = prdReport.mo_task_id, }; prdInstockDs.Add(new PrdInstockD() @@ -600,9 +608,11 @@ namespace Tnb.ProductionMgr { OrganizeEntity workline = await _organizeService.GetAnyParentByWorkstationId(prdReport.station, DictConst.RegionCategoryWorklineCode); OrganizeEntity workshop = await _organizeService.GetAnyParentByWorkstationId(prdReport.station, DictConst.RegionCategoryWorkshopCode); - + string code = await _billRuleService.GetBillNumber(CodeTemplateConst.PRDINSTOCK_CODE); + prdInstockH = new PrdInstockH() { + code = code, bill_type = DictConst.CHANCHENGPINRUKUDAN, bill_date = DateTime.Now, create_id = create_id, @@ -615,6 +625,7 @@ namespace Tnb.ProductionMgr org_id = org_id, warehouse_id = warehouse_id, status = 0, + mo_task_id = prdReport.mo_task_id, }; prdInstockDs.Add(new PrdInstockD() @@ -731,6 +742,7 @@ namespace Tnb.ProductionMgr org_id = org_id, warehouse_id = warehouse_id, status = 0, + mo_task_id = prdReport.mo_task_id, }; prdInstockDs.Add(new PrdInstockD() @@ -886,6 +898,7 @@ namespace Tnb.ProductionMgr string create_id = prdReports[0].create_id; UserEntity user = await db.Queryable().SingleAsync(x => x.Id == create_id); string org_id = user.OrganizeId; + string mo_task_id = prdReports[0].mo_task_id; PrdInstockH? prdInstockH = null; List prdInstockDs = new() { }; @@ -896,9 +909,11 @@ namespace Tnb.ProductionMgr { OrganizeEntity workline = await _organizeService.GetAnyParentByWorkstationId(station.Id, DictConst.RegionCategoryWorklineCode); OrganizeEntity workshop = await _organizeService.GetAnyParentByWorkstationId(station.Id, DictConst.RegionCategoryWorkshopCode); - + string code = await _billRuleService.GetBillNumber(CodeTemplateConst.PRDINSTOCK_CODE); + prdInstockH = new PrdInstockH() { + code = code, bill_type = DictConst.CHANCHENGPINRUKUDAN, bill_date = DateTime.Now, create_id = create_id, @@ -912,6 +927,7 @@ namespace Tnb.ProductionMgr // warehouse_id = basLocation?.wh_id, warehouse_id = warehouse_id, status = 0, + mo_task_id = mo_task_id, }; foreach (var prdReport in prdReports) From 53536526f4d2431b171b6c2027906005f999d3b6 Mon Sep 17 00:00:00 2001 From: hlb <894797954@qq.com> Date: Mon, 27 Nov 2023 10:59:45 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=A7=84=E6=A0=BC?= =?UTF-8?q?=E5=9E=8B=E5=8F=B7=E5=92=8C=E7=AE=B1=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.cs | 9 ++++++++- .../Tnb.WarehouseMgr.Entities/Entity/WmsCarryMat.cs | 8 ++++++++ .../Tnb.WarehouseMgr.Entities/Entity/WmsDistaskCode.cs | 8 ++++++++ .../Tnb.WarehouseMgr.Entities/Entity/WmsInstockCode.cs | 8 ++++++++ .../Tnb.WarehouseMgr.Entities/Entity/WmsInstockD.cs | 9 ++++++++- .../Entity/WmsOutstockCode.cs | 8 ++++++++ .../Tnb.WarehouseMgr.Entities/Entity/WmsOutstockD.cs | 9 ++++++++- .../Tnb.WarehouseMgr.Entities/Entity/WmsPretaskCode.cs | 9 ++++++++- .../Tnb.WarehouseMgr.Entities/Entity/WmsSaleD.cs | 10 ++++++++-- .../Tnb.WarehouseMgr.Entities/Entity/WmsTempCode.cs | 8 ++++++++ 10 files changed, 80 insertions(+), 6 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.cs index 01aa48a3..84a30b26 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.cs @@ -112,5 +112,12 @@ public partial class WmsCarryCode : BaseEntity, IWmsCarryEntity /// 仓库ID /// public string? warehouse_id { get; set; } - + /// + /// 规格型号 + /// + public string? material_specification { get; set; } + /// + /// 规格型号 + /// + public string? container_no { get; set; } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryMat.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryMat.cs index 94b3480d..21d6be10 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryMat.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryMat.cs @@ -103,5 +103,13 @@ public partial class WmsCarryMat : BaseEntity, IWmsCarryEntity /// 修改时间 /// public DateTime? modify_time { get; set; } + /// + /// 规格型号 + /// + public string? material_specification { get; set; } + /// + /// 规格型号 + /// + public string? container_no { get; set; } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsDistaskCode.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsDistaskCode.cs index 40606a87..37cacc8e 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsDistaskCode.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsDistaskCode.cs @@ -108,5 +108,13 @@ public partial class WmsDistaskCode : BaseEntity /// 子载具编号 /// public string? membercarry_code { get; set; } + /// + /// 规格型号 + /// + public string? material_specification { get; set; } + /// + /// 规格型号 + /// + public string? container_no { get; set; } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockCode.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockCode.cs index fa4662f2..00ec48c2 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockCode.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockCode.cs @@ -159,6 +159,14 @@ public partial class WmsInstockCode : BaseEntity, IInOutStockCode /// 生产工单BOM明细Id /// public string? mo_bom_detail_id { get; set; } + /// + /// 规格型号 + /// + public string? material_specification { get; set; } + /// + /// 规格型号 + /// + public string? container_no { get; set; } public void Create(string orgId) { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockD.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockD.cs index cc4c7996..69d82dcd 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockD.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockD.cs @@ -183,5 +183,12 @@ public partial class WmsInstockD : BaseEntity /// 打印模板ID /// public string? print_id { get; set; } - + /// + /// 规格型号 + /// + public string? material_specification { get; set; } + /// + /// 规格型号 + /// + public string? container_no { get; set; } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockCode.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockCode.cs index 02c10a93..e5de8f8a 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockCode.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockCode.cs @@ -108,5 +108,13 @@ public partial class WmsOutstockCode : BaseEntity /// 修改时间 /// public DateTime? modify_time { get; set; } + /// + /// 规格型号 + /// + public string? material_specification { get; set; } + /// + /// 规格型号 + /// + public string? container_no { get; set; } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockD.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockD.cs index 27334e79..fcbc6cab 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockD.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockD.cs @@ -188,5 +188,12 @@ public partial class WmsOutstockD : BaseEntity /// 载具编号 /// public string? carry_code { get; set; } - + /// + /// 规格型号 + /// + public string? material_specification { get; set; } + /// + /// 规格型号 + /// + public string? container_no { get; set; } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsPretaskCode.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsPretaskCode.cs index e55014cf..58b5e63e 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsPretaskCode.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsPretaskCode.cs @@ -104,5 +104,12 @@ public partial class WmsPretaskCode : BaseEntity /// 子载具编号 /// public string? membercarry_code { get; set; } - + /// + /// 规格型号 + /// + public string? material_specification { get; set; } + /// + /// 规格型号 + /// + public string? container_no { get; set; } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsSaleD.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsSaleD.cs index 850e0e4c..a271a5c7 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsSaleD.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsSaleD.cs @@ -83,6 +83,12 @@ public partial class WmsSaleD : BaseEntity /// 流程引擎Id /// public string? f_flowid { get; set; } - - + /// + /// 规格型号 + /// + public string? material_specification { get; set; } + /// + /// 规格型号 + /// + public string? container_no { get; set; } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsTempCode.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsTempCode.cs index 48e68b9a..1b4ddc83 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsTempCode.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsTempCode.cs @@ -103,5 +103,13 @@ public partial class WmsTempCode : BaseEntity /// 时间戳 /// public DateTime? time_stamp { get; set; } + /// + /// 规格型号 + /// + public string? material_specification { get; set; } + /// + /// 规格型号 + /// + public string? container_no { get; set; } } From 14138b2ad91469eedaadfd34273a2757a08611ff Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Mon, 27 Nov 2023 11:17:51 +0800 Subject: [PATCH 3/7] 1 --- .../Tnb.BasicData.Entities/Consts/CodeTemplateConst.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BasicData/Tnb.BasicData.Entities/Consts/CodeTemplateConst.cs b/BasicData/Tnb.BasicData.Entities/Consts/CodeTemplateConst.cs index eedf0c86..a758ff30 100644 --- a/BasicData/Tnb.BasicData.Entities/Consts/CodeTemplateConst.cs +++ b/BasicData/Tnb.BasicData.Entities/Consts/CodeTemplateConst.cs @@ -38,7 +38,12 @@ namespace Tnb.BasicData /// /// 设备维修单 /// - public const string EQPREPAIR_CODE = "EqpRepair"; + public const string EQPREPAIR_CODE = "EqpRepair"; + + /// + /// 生产入库单 + /// + public const string PRDINSTOCK_CODE = "PrdInStock"; } From 6106263c8a2d50fd5560e0b1a9060f489e80d218 Mon Sep 17 00:00:00 2001 From: hlb <894797954@qq.com> Date: Mon, 27 Nov 2023 11:43:00 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E5=87=BA=E5=BA=93=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=9E=8B=E5=8F=B7=E8=A7=84=E6=A0=BC=E5=92=8C?= =?UTF-8?q?=E7=AE=B1=E5=8F=B7=E7=9A=84=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dto/Queries/OutStockStrategyQuery.cs | 9 ++++++++- .../Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.cs | 2 +- .../Tnb.WarehouseMgr.Entities/Entity/WmsCarryMat.cs | 2 +- .../Tnb.WarehouseMgr.Entities/Entity/WmsInstockCode.cs | 2 +- .../Tnb.WarehouseMgr.Entities/Entity/WmsInstockD.cs | 2 +- .../Tnb.WarehouseMgr.Entities/Entity/WmsOutstockCode.cs | 2 +- .../Tnb.WarehouseMgr.Entities/Entity/WmsOutstockD.cs | 2 +- .../Tnb.WarehouseMgr.Entities/Entity/WmsPretaskCode.cs | 2 +- .../Tnb.WarehouseMgr.Entities/Entity/WmsPurchaseD.cs | 9 ++++++++- .../Tnb.WarehouseMgr.Entities/Entity/WmsSaleD.cs | 2 +- WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs | 2 ++ WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs | 8 ++++---- 12 files changed, 30 insertions(+), 14 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Queries/OutStockStrategyQuery.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Queries/OutStockStrategyQuery.cs index cd4df518..d4728162 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Queries/OutStockStrategyQuery.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Queries/OutStockStrategyQuery.cs @@ -28,6 +28,13 @@ public int BllType { get; set; } public int Size { get; set; } - + /// + /// 规格型号 + /// + public string? material_specification { get; set; } + /// + /// 箱号 + /// + public string? container_no { get; set; } } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.cs index 84a30b26..e3d01c04 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.cs @@ -117,7 +117,7 @@ public partial class WmsCarryCode : BaseEntity, IWmsCarryEntity /// public string? material_specification { get; set; } /// - /// 规格型号 + /// 箱号 /// public string? container_no { get; set; } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryMat.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryMat.cs index 21d6be10..da773d19 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryMat.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryMat.cs @@ -108,7 +108,7 @@ public partial class WmsCarryMat : BaseEntity, IWmsCarryEntity /// public string? material_specification { get; set; } /// - /// 规格型号 + /// 箱号 /// public string? container_no { get; set; } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockCode.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockCode.cs index 00ec48c2..c6eb1351 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockCode.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockCode.cs @@ -164,7 +164,7 @@ public partial class WmsInstockCode : BaseEntity, IInOutStockCode /// public string? material_specification { get; set; } /// - /// 规格型号 + /// 箱号 /// public string? container_no { get; set; } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockD.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockD.cs index 69d82dcd..ac4aec92 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockD.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockD.cs @@ -188,7 +188,7 @@ public partial class WmsInstockD : BaseEntity /// public string? material_specification { get; set; } /// - /// 规格型号 + /// 箱号 /// public string? container_no { get; set; } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockCode.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockCode.cs index e5de8f8a..1700d8c8 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockCode.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockCode.cs @@ -113,7 +113,7 @@ public partial class WmsOutstockCode : BaseEntity /// public string? material_specification { get; set; } /// - /// 规格型号 + /// 箱号 /// public string? container_no { get; set; } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockD.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockD.cs index fcbc6cab..e15c082f 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockD.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockD.cs @@ -193,7 +193,7 @@ public partial class WmsOutstockD : BaseEntity /// public string? material_specification { get; set; } /// - /// 规格型号 + /// 箱号 /// public string? container_no { get; set; } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsPretaskCode.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsPretaskCode.cs index 58b5e63e..dd301c8d 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsPretaskCode.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsPretaskCode.cs @@ -109,7 +109,7 @@ public partial class WmsPretaskCode : BaseEntity /// public string? material_specification { get; set; } /// - /// 规格型号 + /// 箱号 /// public string? container_no { get; set; } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsPurchaseD.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsPurchaseD.cs index 17082d0a..0e09271f 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsPurchaseD.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsPurchaseD.cs @@ -98,5 +98,12 @@ public partial class WmsPurchaseD : BaseEntity /// 本次到货数量 /// public decimal purchase_arriveqty { get; set; } - + /// + /// 规格型号 + /// + public string? material_specification { get; set; } + /// + /// 箱号 + /// + public string? container_no { get; set; } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsSaleD.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsSaleD.cs index a271a5c7..d035a196 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsSaleD.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsSaleD.cs @@ -88,7 +88,7 @@ public partial class WmsSaleD : BaseEntity /// public string? material_specification { get; set; } /// - /// 规格型号 + /// 箱号 /// public string? container_no { get; set; } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs index 1c8b1275..7335e8e2 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs @@ -196,6 +196,8 @@ namespace Tnb.WarehouseMgr .And((a, b, c) => c.wh_id == input.warehouse_id) .AndIF(!string.IsNullOrEmpty(input.material_id), (a, b, c) => b.material_id == input.material_id) .AndIF(!string.IsNullOrEmpty(input.code_batch), (a, b, c) => b.code_batch == input.code_batch) + .AndIF(!string.IsNullOrEmpty(input.material_specification), (a, b, c) => b.material_specification == input.material_specification) + .AndIF(!string.IsNullOrEmpty(input.container_no), (a, b, c) => b.container_no == input.container_no) .AndIF(!string.IsNullOrEmpty(input.carrystd_id), (a, b, c) => a.carrystd_id == input.carrystd_id); Expression> carryStatusFilterExp = !input.material_id.IsNullOrWhiteSpace() ? (a, b, c) => a.carry_status == ((int)EnumCarryStatus.占用).ToString() diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs index 804bdde7..08bf1185 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs @@ -210,7 +210,7 @@ namespace Tnb.WarehouseMgr if (carryMats.Count > 0) { carryMats.ForEach(x => x.id = SnowflakeIdHelper.NextId()); - carryMats = carryMats.OrderBy(o => o.create_time).GroupBy(g => new { g.carry_id, g.material_id, g.code_batch }) + carryMats = carryMats.OrderBy(o => o.create_time).GroupBy(g => new { g.carry_id, g.material_id, g.code_batch , g.material_specification,g.container_no }) .Select(x => { WmsCarryMat[] arr = x.ToArray(); @@ -842,10 +842,10 @@ namespace Tnb.WarehouseMgr outStockCodes.ForEach(x => { - string? billDId = otds?.Find(xx => xx.material_id == x.material_id && xx.code_batch == x.code_batch)?.id; + string? billDId = otds?.Find(xx => xx.material_id == x.material_id && xx.code_batch == x.code_batch && xx.material_specification == x.material_specification && xx.container_no == x.container_no)?.id; if (billDId.IsNullOrEmpty()) { - billDId = otds?.Find(xx => xx.material_id == x.material_id)?.id; + billDId = otds?.Find(xx => xx.material_id == x.material_id )?.id; } x.id = SnowflakeIdHelper.NextId(); x.bill_id = input.requireId; @@ -891,7 +891,7 @@ namespace Tnb.WarehouseMgr List osCodes = input.distaskCodes.Adapt>(); osCodes.ForEach(x => { - string? billDId = otds?.Find(xx => xx.material_id == x.material_id && xx.code_batch == x.code_batch)?.id; + string? billDId = otds?.Find(xx => xx.material_id == x.material_id && xx.code_batch == x.code_batch && xx.material_specification == x.material_specification && xx.container_no == x.container_no )?.id; if (billDId.IsNullOrEmpty()) { billDId = otds?.Find(xx => xx.material_id == x.material_id)?.id; From fe0ba1a46a1348ab23218a1f724946a81c40b1ea Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Mon, 27 Nov 2023 11:59:27 +0800 Subject: [PATCH 5/7] 1 --- .../Dto/PrdManage/PrdInstockRecordUpListOutPut.cs | 6 +++++- .../Tnb.ProductionMgr/PrdInstockRecordUpServicecs.cs | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdInstockRecordUpListOutPut.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdInstockRecordUpListOutPut.cs index faf6e012..840d50a8 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdInstockRecordUpListOutPut.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdInstockRecordUpListOutPut.cs @@ -16,11 +16,15 @@ namespace Tnb.ProductionMgr.Entities.Dto public class PrdInstockRecordUpListChildOutPut { public string id { get; set; } - public string bill_code { get; set; } + public string code { get; set; } public string bill_type { get; set; } public string carry_code { get; set; } public string create_id { get; set; } public string bill_date { get; set; } + /// + /// 起始库位编号 + /// + public string location_code { get; set; } = string.Empty; } public class PrdInstockRecordUpListDownOutPut diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdInstockRecordUpServicecs.cs b/ProductionMgr/Tnb.ProductionMgr/PrdInstockRecordUpServicecs.cs index ba412c09..2f9af12a 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdInstockRecordUpServicecs.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdInstockRecordUpServicecs.cs @@ -99,9 +99,10 @@ namespace Tnb.ProductionMgr .Where(x=>x.mo_task_id==a.id).ToList((x,y,z)=>new PrdInstockRecordUpListChildOutPut() { id = x.id, - bill_code = x.code, + code = x.code, bill_type = z.FullName, carry_code = x.carry_code, + location_code = x.location_code, create_id = y.RealName, bill_date = x.bill_date==null ? "" : x.bill_date.ToString(DbTimeFormat.SS), From e70c91a7546e889f52def605bd0ad480fedd3cce Mon Sep 17 00:00:00 2001 From: hlb <894797954@qq.com> Date: Mon, 27 Nov 2023 14:09:07 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E9=87=87=E8=B4=AD=E5=88=B0=E8=B4=A7?= =?UTF-8?q?=E5=90=8E=E7=94=9F=E6=88=90=E7=9A=84=E5=85=A5=E5=BA=93=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E5=8D=95=20=E5=8D=95=E6=8D=AE=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E8=87=AA=E5=B7=B1=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WarehouseMgr/Tnb.WarehouseMgr/WmsPurchaseService.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPurchaseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPurchaseService.cs index 1fe6279c..d6348e64 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPurchaseService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPurchaseService.cs @@ -9,6 +9,7 @@ using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.FriendlyException; using JNPF.Logging; +using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; using Mapster; using Microsoft.AspNetCore.Mvc; @@ -35,6 +36,7 @@ namespace Tnb.WarehouseMgr [OverideVisualDev(ModuleConsts.MODULE_WMSPURCHASE_ID)] public class WmsPurchaseService : WmsPurchaseAndSaleCommonService, IWmsPurchaseService { + private readonly IBillRullService _billRullService; private readonly ISqlSugarClient _db; private readonly IUserManager _userManager; public WmsPurchaseService(ISqlSugarRepository repo, IUserManager userManager, IQcCheckPlanService qcCheckPlanService) @@ -72,6 +74,7 @@ namespace Tnb.WarehouseMgr { instock = input.Adapt(); instock.id = SnowflakeIdHelper.NextId(); + instock.bill_code = await _billRullService.GetBillNumber(WmsWareHouseConst.WMS_INSTOCK_ENCODE); instock.create_id = _userManager.UserId; instock.create_time = DateTime.Now; instock.org_id = _userManager.User.OrganizeId; From a400c2a3d27ff60864a69cbd60f2034baf46a7ee Mon Sep 17 00:00:00 2001 From: hlb <894797954@qq.com> Date: Mon, 27 Nov 2023 14:57:10 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E5=90=84=E6=A8=A1=E5=9D=97=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E8=A7=84=E6=A0=BC=E5=9E=8B=E5=8F=B7=E5=92=8C=E7=AE=B1?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Consts/WmsWareHouseConst.cs | 4 ++++ .../Entity/WmsHandleCode.cs | 8 ++++++++ WarehouseMgr/Tnb.WarehouseMgr/WmsInStockService.cs | 10 ++++++++-- .../Tnb.WarehouseMgr/WmsPDAInStockService.cs | 4 ++++ .../Tnb.WarehouseMgr/WmsPDAScanInStockService.cs | 12 +++++++++--- 5 files changed, 33 insertions(+), 5 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs index 825c64f7..07c1ed9b 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs @@ -10,6 +10,10 @@ /// 中储仓ID /// public const string WAREHOUSE_ZC_ID = "2"; + /// + /// 成品仓库ID + /// + public const string WAREHOUSE_CP_ID = "26103372441637"; /// /// 出入库单据状态TypeID diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsHandleCode.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsHandleCode.cs index 591b7576..6a66c097 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsHandleCode.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsHandleCode.cs @@ -94,4 +94,12 @@ public partial class WmsHandleCode : BaseEntity /// public DateTime? modify_time { get; set; } + /// + /// 规格型号 + /// + public string? material_specification { get; set; } + /// + /// 箱号 + /// + public string? container_no { get; set; } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsInStockService.cs index 6e52bfdb..a9a17487 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsInStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsInStockService.cs @@ -177,6 +177,8 @@ namespace Tnb.WarehouseMgr material_code = detail.material_code, barcode = code, code_batch = detail.code_batch, + material_specification= detail.material_specification, + container_no =detail.container_no, codeqty = detail.pr_qty!.Value, unit_id = detail.unit_id, is_lock = 0, @@ -335,12 +337,14 @@ namespace Tnb.WarehouseMgr instockcode.id = SnowflakeIdHelper.NextId(); string materialCode = instockcode.material_code; string? codeBatch = instockcode.code_batch; - WmsInstockCode? b = items.Find(x => x.material_code == materialCode && x.code_batch == codeBatch); + string? materialSpecification = instockcode.material_specification; + string? containerNo = instockcode.container_no; + WmsInstockCode? b = items.Find(x => x.material_code == materialCode && x.code_batch == codeBatch && x.material_specification == materialSpecification && x.container_no == containerNo); if (b != null) { WmsInstockCode c = DeepCopyHelper.DeepCopy(b); c.id = SnowflakeIdHelper.NextId(); - c.bill_d_id = instockds?.Find(x => x.material_code == materialCode && x.code_batch == codeBatch)?.id ?? ""; + c.bill_d_id = instockds?.Find(x => x.material_code == materialCode && x.code_batch == codeBatch && x.material_specification == materialSpecification && x.container_no == containerNo)?.id ?? ""; c.barcode = instockcode.barcode; c.codeqty = instockcode.codeqty; c.is_end = 0;// 未结束 @@ -411,6 +415,8 @@ namespace Tnb.WarehouseMgr ptc.codeqty = jo.codeqty; ptc.unit_id = jo.unit_id!; ptc.code_batch = jo.code_batch; + ptc.material_specification = jo.material_specification; + ptc.container_no = jo.container_no; pretaskCodes.Add(ptc); } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs index 1ba5f236..cc9bd7a3 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs @@ -160,6 +160,8 @@ namespace Tnb.WarehouseMgr ptc.codeqty = jo.Value(nameof(WmsPretaskCode.codeqty)); ptc.unit_id = jo.Value(nameof(WmsPretaskCode.unit_id))!; ptc.code_batch = jo.Value(nameof(WmsPretaskCode.code_batch)); + ptc.material_specification = jo.Value(nameof(WmsPretaskCode.material_specification))!; + ptc.container_no = jo.Value(nameof(WmsPretaskCode.container_no)); pretaskCodes.Add(ptc); } } @@ -208,6 +210,8 @@ namespace Tnb.WarehouseMgr material_code = jo.Value(nameof(WmsHandleCode.material_code))!, barcode = jo.Value(nameof(WmsHandleCode.barcode))!, code_batch = jo.Value(nameof(WmsHandleCode.code_batch)), + material_specification = jo.Value(nameof(WmsPretaskCode.material_specification))!, + container_no = jo.Value(nameof(WmsPretaskCode.container_no)), codeqty = jo.Value(nameof(WmsHandleCode.codeqty)), unit_id = _db.Queryable().Single(it => it.id == materialId).unit_id, create_id = _userManager.UserId, diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAScanInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAScanInStockService.cs index 86b3c6ac..5ace7920 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAScanInStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAScanInStockService.cs @@ -105,7 +105,7 @@ namespace Tnb.WarehouseMgr bill_type = WmsWareHouseConst.BILLTYPE_MATERIALINSTOCK_ID, biz_type = WmsWareHouseConst.BIZTYPE_WMSINSTOCK_ID, bill_date = DateTime.Today, - warehouse_id = whId?.ToString() ?? "26103372441637", + warehouse_id = whId?.ToString() ?? WmsWareHouseConst.WAREHOUSE_CP_ID, status = WmsWareHouseConst.BILLSTATUS_ADD_ID, generate_type = "0", sync_status = WmsWareHouseConst.SYNC_STATUS_NONEEDSYNC, @@ -130,7 +130,9 @@ namespace Tnb.WarehouseMgr pr_qty = item.codeqty, qty = 0, code_batch = item.code_batch, - warehouse_id = "26103372441637", + material_specification = item.material_specification, + container_no = item.container_no, + warehouse_id = WmsWareHouseConst.WAREHOUSE_CP_ID, print_qty = item.codeqty, scan_qty = item.codeqty, print_id = "", @@ -163,6 +165,8 @@ namespace Tnb.WarehouseMgr unit_id = mat.unit_id, barcode = carryCode, code_batch = item.code_batch, + material_specification = item.material_specification, + container_no = item.container_no, codeqty = item.codeqty, is_lock = 0, is_end = 0, @@ -179,7 +183,7 @@ namespace Tnb.WarehouseMgr } - InStockStrategyQuery inStockStrategyInput = new() { warehouse_id = "26103372441637", Size = 1 }; + InStockStrategyQuery inStockStrategyInput = new() { warehouse_id = WmsWareHouseConst.WAREHOUSE_CP_ID, Size = 1 }; List endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput); WmsPointH sPoint = new(); WmsPointH ePoint = new(); @@ -250,6 +254,8 @@ namespace Tnb.WarehouseMgr ptc.material_code = instockCode.material_code; ptc.barcode = instockCode.barcode; ptc.codeqty = instockCode.codeqty; + ptc.material_specification = instockCode.material_specification; + ptc.container_no = instockCode.container_no; ptc.unit_id = instockCode.unit_id; ptc.code_batch = instockCode.code_batch; pretaskCodes.Add(ptc);