From 892d758dbf9cef6baa1337eb31d66c2dced7f0a0 Mon Sep 17 00:00:00 2001 From: majian <780924089@qq.com> Date: Thu, 30 May 2024 11:32:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=BD=E5=85=B7=E7=BB=91=E5=AE=9A=E7=89=A9?= =?UTF-8?q?=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dto/Inputs/BindCarryCodeInput.cs | 4 +++ .../Tnb.WarehouseMgr/WareHouseService.cs | 6 ---- .../Tnb.WarehouseMgr/WmsCarryService.cs | 3 ++ .../WmsPDACarryBindService.cs | 33 +++++++++++-------- 4 files changed, 27 insertions(+), 19 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/BindCarryCodeInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/BindCarryCodeInput.cs index 59b0a9e2..6eecfef3 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/BindCarryCodeInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/BindCarryCodeInput.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tnb.WarehouseMgr.Entities.Consts; namespace Tnb.WarehouseMgr.Entities.Dto.Inputs { @@ -17,5 +18,8 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Inputs public string location_id { get; set; } = ""; public string location_code { get; set; } = ""; public string code_batch { get; set; } + public string unit_id { get; set; } + public string unit_code { get; set; } + public string create_id { get; set; } = WmsWareHouseConst.AdministratorUserId; } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs index bb5a1ff7..476591f3 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs @@ -288,12 +288,6 @@ namespace Tnb.WarehouseMgr SqlSugarClient cyDb = _db.CopyNew(); - string sss = cyDb.Queryable().LeftJoin((a, b) => a.id == b.carry_id) - .LeftJoin((a, b, c) => a.location_id == c.id) - .Where(whereExpr) - //.OrderByIF((a,b,c)=>SqlFunc.IsNullOrEmpty()) - .OrderBy("a.location_code,layers,loc_line,loc_column").ToSqlString(); - List> items = cyDb.Queryable().LeftJoin((a, b) => a.id == b.carry_id) .LeftJoin((a, b, c) => a.location_id == c.id) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs index 12bfc821..8a079e50 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs @@ -326,6 +326,9 @@ namespace Tnb.WarehouseMgr wmsCarryCode.location_id = input.location_id; wmsCarryCode.location_code = input.location_code; wmsCarryCode.code_batch = input.code_batch; + wmsCarryCode.unit_id = input.unit_id; + wmsCarryCode.unit_code = input.unit_code; + wmsCarryCode.create_id = input.create_id; await _db.Insertable(wmsCarryCode).ExecuteCommandAsync(); // todo 绑定记录表 diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryBindService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryBindService.cs index 3f9fc9f2..26eb00b7 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryBindService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryBindService.cs @@ -35,7 +35,10 @@ namespace Tnb.WarehouseMgr private readonly IBillRullService _billRullService; private readonly IWareHouseService _wareHouseService; private readonly IWmsCarryBindService _wmsCarryBindService; + private readonly IWmsCarryService _wmsCarryService; + + public WmsPDACarryBindService( ISqlSugarRepository repository, IRunService runService, @@ -43,7 +46,8 @@ namespace Tnb.WarehouseMgr IUserManager userManager, IWareHouseService wareHouseService, IBillRullService billRullService, - IWmsCarryBindService wmsCarryBindService) + IWmsCarryBindService wmsCarryBindService, + IWmsCarryService wmsCarryService) { _db = repository.AsSugarClient(); _runService = runService; @@ -52,6 +56,7 @@ namespace Tnb.WarehouseMgr _billRullService = billRullService; _wareHouseService = wareHouseService; _wmsCarryBindService = wmsCarryBindService; + _wmsCarryService = wmsCarryService; OverideFuncs.CreateAsync = PDACarryBind; } @@ -307,18 +312,20 @@ namespace Tnb.WarehouseMgr _ = await _db.Updateable().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => ids.Contains(it.id)).ExecuteCommandAsync(); BasMaterial basMaterial = await _db.Queryable().FirstAsync(it => it.id == input.material_id); - WmsCarryCode wmsCarryCode = new WmsCarryCode(); - wmsCarryCode.create_time = DateTime.Now; - wmsCarryCode.carry_id = wmsCarryH.id; - wmsCarryCode.barcode = wmsCarryH.carry_code; - wmsCarryCode.codeqty = input.qty; - wmsCarryCode.material_id = input.material_id; - wmsCarryCode.material_code = basMaterial.code; - wmsCarryCode.material_name = basMaterial.name; - wmsCarryCode.location_id = endLocations[0].id; - wmsCarryCode.location_code = endLocations[0].location_code; - wmsCarryCode.code_batch = wmsTransferInstockD.pi_code; - _ = await _db.Insertable(wmsCarryCode).ExecuteCommandAsync(); + + BindCarryCodeInput bindCarryCodeInput = new BindCarryCodeInput(); + + bindCarryCodeInput.carry_id = wmsCarryH.id; + bindCarryCodeInput.barcode = wmsCarryH.carry_code; + bindCarryCodeInput.codeqty = input.qty; + bindCarryCodeInput.material_id = input.material_id; + bindCarryCodeInput.material_code = basMaterial.code; + bindCarryCodeInput.material_name = basMaterial.name; + bindCarryCodeInput.location_id = endLocations[0].id; + bindCarryCodeInput.location_code = endLocations[0].location_code; + bindCarryCodeInput.code_batch = wmsTransferInstockD.pi_code; + + await _wmsCarryService.BindCarryMaterial(bindCarryCodeInput); } } }