From b2b8d865943cebf1933209eef11d57f5f634ef5c Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期五, 10 一月 2025 09:50:49 +0800 Subject: [PATCH] 合并 --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/PalletCodeInfoService.cs | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 41 insertions(+), 2 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/PalletCodeInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/PalletCodeInfoService.cs" index 870efab..220c2a5 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/PalletCodeInfoService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/PalletCodeInfoService.cs" @@ -4,6 +4,8 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using WIDESEA_Common.CommonEnum; +using WIDESEA_Common.WareHouseEnum; using WIDESEA_Core; using WIDESEA_Core.BaseServices; using WIDESEA_Core.Helper; @@ -15,8 +17,10 @@ { public class PalletCodeInfoService : ServiceBase<Dt_PalletCodeInfo, IPalletCodeInfoRepository>, IPalletCodeInfoService { - public PalletCodeInfoService(IPalletCodeInfoRepository BaseDal) : base(BaseDal) + private readonly IWarehouseRepository _warehouseRepository; + public PalletCodeInfoService(IPalletCodeInfoRepository BaseDal, IWarehouseRepository warehouseRepository) : base(BaseDal) { + _warehouseRepository = warehouseRepository; } static object locker = new object(); @@ -47,12 +51,27 @@ { serialNo = 1; } + Dt_Warehouse _Warehouse = _warehouseRepository.QueryFirst(x=>x.WarehouseId== warehouseId); + + string uplen = _Warehouse.WarehouseCode switch + { + "HA57" => "B", + "HA58" => "P", + "HA152" => "G", + "HA64" => "S", + "闃荤剨浠�" => "Z", + "HA153" => "Y", + "HA71" => "C", + "HA60" => "F", + _ => "N" + }; for (int i = 0; i < count; i++) { + palletCodeInfos.Add(new Dt_PalletCodeInfo { SerialNo = serialNo, - PalletCode = now.ToString("yyyyMMdd") + serialNo.ToString().PadLeft(3, '0'), + PalletCode = uplen+now.ToString("yyyyMMdd") + serialNo.ToString().PadLeft(3, '0'), PalletType = 1, PalletTypeId = 0, WarehouseId = warehouseId, @@ -65,5 +84,25 @@ return base.AddData(palletCodeInfos); } } + public WebResponseContent PrintStatusUp(string printCode) + { + WebResponseContent content = new WebResponseContent(); + try + { + Dt_PalletCodeInfo palletCodeInfo = BaseDal.QueryFirst(x=>x.PalletCode==printCode); + if (palletCodeInfo==null) + { + return content.Error("鎵撳嵃鐨勬墭鐩樼爜涓嶅瓨鍦�"); + } + palletCodeInfo.Status = PrintStatusEnum.Printed.ObjToInt(); + BaseDal.UpdateData(palletCodeInfo); + return content.OK(); + } + catch (Exception ex) + { + content.Error("閿欒:"+ex.Message); + } + return content; + } } } -- Gitblit v1.9.3