From 67348f250a1b7970059698002949a5e0a5f3c52f Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期四, 14 八月 2025 08:51:04 +0800 Subject: [PATCH] 上传最新代码 --- 项目代码/WMS/WMSServices/WIDESEA_BasicService/Base/LocationInfoService.cs | 116 ---------------------------------------------------------- 1 files changed, 0 insertions(+), 116 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_BasicService/Base/LocationInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_BasicService/Base/LocationInfoService.cs" index b291525..b3f1bf3 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_BasicService/Base/LocationInfoService.cs" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_BasicService/Base/LocationInfoService.cs" @@ -94,122 +94,6 @@ { return LocationDisableStatus(new int[] { key }); } - - /// <summary> - /// 鑾峰彇杈呮枡浠撳簱瀛� - /// </summary> - /// <returns></returns> - public WebResponseContent GetContainerInfo() - { - try - { - SqlSugarClient TesugarClient = new SqlSugarClient(new ConnectionConfig - { - ConfigId = MainDb.CurrentDbConnId, - ConnectionString = AppSettings.Get("TeConnectionString").DecryptDES(AppSecret.DB), - IsAutoCloseConnection = true, - DbType = MainDb.DbType, - }); - - var ContainerInfos = TesugarClient.Queryable("ContainerInfo", "x").Where("WaId", "=", 8).Where("UpState", "=", 2).ToList(); - if (ContainerInfos != null) - { - List<Dt_StockInfo> stockInfos = new List<Dt_StockInfo>(); - foreach (var item in ContainerInfos) - { - dynamic ruleConfig = item; - int id = ruleConfig.CId;//涓婚敭 - string BoxNo = ruleConfig.BoxNo;//绠卞彿 - string LNo = ruleConfig.LNo;//璐т綅缂栧彿 - Dt_StockInfo stockInfo = new Dt_StockInfo() - { - LocationCode = LNo == "骞冲簱浣�" ? LNo : GetLocationCode(LNo), - PalletCode = BoxNo, - StockStatus = StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt(), - WarehouseId = 5, - PalletType = PalletTypeEnum.LargestPallet.ObjToInt(), - Details = new List<Dt_StockInfoDetail>() - }; - var ContainerDetailsInfos = TesugarClient.Queryable("ContainerDetailsInfo", "x").Where("CId", "=", id).ToList(); - if (ContainerDetailsInfos.Count < 1) stockInfo.PalletType = PalletTypeEnum.Empty.ObjToInt(); - foreach (var ContainerDetailsInfo in ContainerDetailsInfos) - { - dynamic ruleConfig1 = ContainerDetailsInfo; - string MaterialCode = ruleConfig1.MaterialCode;//鐗╂枡缂栧彿 - string MaterialName = ruleConfig1.MaterialName;//鐗╂枡鍚嶇О - string MaterialLot = ruleConfig1.MaterialLot;//鐗╂枡鎵瑰彿 - var PackQty = ruleConfig1.PackQty;//鏁伴噺 - string ProduceData = ruleConfig1.ProduceData;//鐢熸垚鏃ユ湡 - string ValidData = ruleConfig1.ValidData;//鏈夋晥鏈� - string Unit = ruleConfig1.Unit;//鍗曚綅 - string Standard = ruleConfig1.Standard;//澶囨敞 - int MId = ruleConfig1.MId;//鍏ュ簱鍗曟槑缁嗚鍙� - string Model = ruleConfig1.Model;//鍗曟嵁缂栧彿 - Dt_StockInfoDetail stockInfoDetail = new Dt_StockInfoDetail() - { - MaterielCode = MaterialCode, - MaterielName = MaterialName, - BatchNo = MaterialLot, - OrderNo = Model, - SerialNumber = "", - StockQuantity = (float)PackQty, - OutboundQuantity = 0, - Unit = Unit, - Status = StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt(), - ProductionDate = ProduceData, - EffectiveDate = ValidData ?? DateTime.Parse(ProduceData).AddYears(2).ToString("yyyy-MM-dd"), - Remark = Standard, - InboundOrderRowNo = MId, - }; - stockInfo.Details.Add(stockInfoDetail); - } - stockInfos.Add(stockInfo); - } - var LocationCodes = stockInfos.Where(x => x.LocationCode != "骞冲簱浣�").Select(stockInfo => stockInfo.LocationCode).ToList(); - List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => LocationCodes.Contains(x.LocationCode)); - locationInfos.ForEach(x => - { - x.LocationStatus = LocationStatusEnum.InStock.ObjToInt(); - x.EnableStatus = EnableStatusEnum.Normal.ObjToInt(); - }); - _unitOfWorkManage.BeginTran(); - _stockInfoRepository.Db.InsertNav(stockInfos).Include(x => x.Details).ExecuteCommand(); - Repository.UpdateData(locationInfos); - _unitOfWorkManage.CommitTran(); - } - } - catch (Exception ex) - { - _unitOfWorkManage.RollbackTran(); - return WebResponseContent.Instance.Error(ex.Message); - } - return WebResponseContent.Instance.OK(); - } - /// <summary> - /// 鑾峰彇璐т綅缂栧彿 - /// </summary> - /// <param name="locationCode"></param> - /// <returns></returns> - string GetLocationCode(string locationCode) - { - var a = locationCode.Substring(0, 1); - var Row = a switch - { - "A" => "001", - "B" => "002", - "C" => "003", - "D" => "004", - "E" => "005", - _ => throw new Exception($"鏈畾涔夌殑鎺�,鍦板潃:銆恵locationCode}銆�"), - }; - var Column = locationCode.Substring(4, 2); - if (locationCode.Length == 7) - Column = locationCode.Substring(5, 2); - var Layer = locationCode.Substring(2, 2); - locationCode = "AGV_FL-" + Row + "-0" + Column + "-0" + Layer + "-01"; - return locationCode; - } - /// <summary> /// 鍒濆鍖栬揣浣� /// </summary> -- Gitblit v1.9.3