| | |
| | | using WIDESEA_Core; |
| | | using WIDESEA_StorageBasicRepository; |
| | | using WIDESEAWCS_BasicInfoRepository; |
| | | using WIDESEA_IStoragIntegrationServices; |
| | | using WIDESEA.Common; |
| | | using WIDESEA_Common.ZY; |
| | | using Autofac.Core; |
| | | using NetTaste; |
| | | |
| | | namespace WIDESEA_StorageBasicService; |
| | | |
| | |
| | | { |
| | | private readonly IDt_WheelsStock_htyRepository _WheelsStock_HtyRepository; |
| | | private readonly IDt_SelectionStandardsRepository _SelectionStandardsRepository; |
| | | public Dt_WheelsStockService(IDt_WheelsStockRepository BaseDal, IDt_WheelsStock_htyRepository WheelsStock_HtyRepository, IDt_SelectionStandardsRepository selectionStandardsRepository) : base(BaseDal) |
| | | private readonly IToZYService _toZYService; |
| | | public Dt_WheelsStockService(IDt_WheelsStockRepository BaseDal, IDt_WheelsStock_htyRepository WheelsStock_HtyRepository, IDt_SelectionStandardsRepository selectionStandardsRepository, IToZYService toZYService) : base(BaseDal) |
| | | { |
| | | _SelectionStandardsRepository = selectionStandardsRepository; |
| | | _WheelsStock_HtyRepository = WheelsStock_HtyRepository; |
| | | _toZYService = toZYService; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | } |
| | | return WheelsList.OrderBy(x => x.CreateDate).FirstOrDefault(); |
| | | } |
| | | |
| | | |
| | | |
| | | public Dt_WheelsStock_Old GetSelectionWheels(List<Dt_WheelsStock_Old> wheelsStocks, Dt_SelectionStandards selectionStandards, Dt_CZInfo_mes CZInfo_Mes, string wheelsPosition, string newOrOld) |
| | | { |
| | | //è¿çéä¸é |
| | | decimal selectionUpperValue = selectionStandards.upperValue; |
| | | //è¿çéä¸é |
| | | decimal selectionLowerValue = selectionStandards.lowerValue; |
| | | |
| | | decimal mesStand = 0; |
| | | string level = string.Empty; |
| | | |
| | | |
| | | if ("left".Equals(wheelsPosition)) //å¹é
左轮座轮å |
| | | { |
| | | mesStand = decimal.Parse(CZInfo_Mes.ZLZZJ); |
| | | level = LevelChangeHelper.LevelChangeType(CZInfo_Mes.ZLZDJ); |
| | | wheelsStocks = wheelsStocks.Where(x => x.venderno == level && x.repair_item == newOrOld).ToList(); |
| | | } |
| | | else //å¦åå¹é
å³è½®åº§è½®å |
| | | { |
| | | mesStand = decimal.Parse(CZInfo_Mes.YLZZJ); |
| | | level = LevelChangeHelper.LevelChangeType(CZInfo_Mes.YLZDJ); |
| | | wheelsStocks = wheelsStocks.Where(x => x.venderno == level && x.repair_item == newOrOld).ToList(); |
| | | } |
| | | foreach (var item in wheelsStocks) |
| | | { |
| | | string Wheels_gkcc = ""; |
| | | string Wheels_gkzja = ""; |
| | | string Wheels_gkzjb = ""; |
| | | string Wheels_gkzjc = ""; |
| | | |
| | | SaveModel saveModel = new SaveModel(); |
| | | saveModel.MainData = new Dictionary<string, object> |
| | | { |
| | | { "cltm", item.wheel_code } |
| | | }; |
| | | WebResponseContent webResponse= _toZYService.ZY_GetCLInfo(saveModel); |
| | | if (webResponse.Status) |
| | | { |
| | | var dta = JsonConvert.DeserializeObject<CLInfo_ZY>(webResponse.Data.ToString()); |
| | | |
| | | Wheels_gkcc = dta.gkcc; |
| | | // æ¯åaçé¢åå¼ |
| | | Wheels_gkzja = dta.GKZJA; |
| | | //æ¯åbçé¢åå¼ |
| | | Wheels_gkzjb = dta.GKZJB; |
| | | //æ¯åcçé¢åå¼ |
| | | Wheels_gkzjc = dta.GKZJC; |
| | | } |
| | | |
| | | if(Wheels_gkcc !="" && Wheels_gkzja!="" && Wheels_gkzjb !="" && Wheels_gkzjc != "") |
| | | { |
| | | //æ¥åºæ¥å¨èå´ä¹å¤çè¿è¡å é¤ |
| | | if (mesStand - (decimal.Parse(Wheels_gkcc)) < selectionLowerValue && mesStand - (decimal.Parse(Wheels_gkcc)) > selectionUpperValue) |
| | | { |
| | | |
| | | wheelsStocks.Remove(item); |
| | | } |
| | | if (selectionStandards.isCantainGK) |
| | | { |
| | | //æªé¢è¿çéä¸é |
| | | decimal selectionUpperValue_gk = selectionStandards.upperValue_gk; |
| | | //æªé¢è¿çéä¸é |
| | | decimal selectionLowerValue_gk = selectionStandards.lowerValue_gk; |
| | | |
| | | if ("left".Equals(wheelsPosition)) |
| | | { |
| | | decimal ZLZA = decimal.Parse(CZInfo_Mes.ZLZA); |
| | | decimal ZLZB = decimal.Parse(CZInfo_Mes.ZLZB); |
| | | decimal ZLZC = decimal.Parse(CZInfo_Mes.ZLZC); |
| | | |
| | | //夿ååï¼è¿è¡å é¤ |
| | | if (ZLZA - (decimal.Parse(Wheels_gkzja)) < selectionLowerValue_gk && ZLZA - (decimal.Parse(Wheels_gkzja)) > selectionUpperValue_gk |
| | | && ZLZB - (decimal.Parse(Wheels_gkzjb)) < selectionLowerValue_gk && ZLZB - (decimal.Parse(Wheels_gkzjb)) > selectionUpperValue_gk |
| | | && ZLZC - (decimal.Parse(Wheels_gkzjc)) < selectionLowerValue_gk && ZLZC - (decimal.Parse(Wheels_gkzjc)) > selectionUpperValue_gk) |
| | | { |
| | | wheelsStocks.Remove(item); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | decimal YLZA = decimal.Parse(CZInfo_Mes.YLZA); |
| | | decimal YLZB = decimal.Parse(CZInfo_Mes.YLZB); |
| | | decimal YLZC = decimal.Parse(CZInfo_Mes.YLZC); |
| | | |
| | | if (YLZA - (decimal.Parse(Wheels_gkzja)) >= selectionLowerValue_gk && YLZA - (decimal.Parse(Wheels_gkzja)) <= selectionUpperValue_gk |
| | | && YLZB - (decimal.Parse(Wheels_gkzjb)) >= selectionLowerValue_gk && YLZB - (decimal.Parse(Wheels_gkzjb)) <= selectionUpperValue_gk |
| | | && YLZC - (decimal.Parse(Wheels_gkzjc)) >= selectionLowerValue_gk && YLZC - (decimal.Parse(Wheels_gkzjc)) <= selectionUpperValue_gk) |
| | | { |
| | | wheelsStocks.Remove(item); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | return wheelsStocks.OrderBy(x => x.dt_ins).FirstOrDefault(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |