| | |
| | | UpdateStock(stockInfoOld, weight, thickness, wide); |
| | | return content.OK($"临æ¶å
¥åº{stockInfoOld.RfidCode}"); |
| | | } |
| | | else if (stockInfoOld != null && stockInfoOld.MaterielInvOrgId == MaterielInvOrgEnum.èå.ObjToInt() && stockInfoOld.StockStatus == StockStatusEmun.åºåºå®æ.ObjToInt() && stockInfoOld.IsPick==WhetherEnum.False.ObjToInt() && stationCode.IsNotEmptyOrNull()) |
| | | else if (stockInfoOld != null && stockInfoOld.MaterielInvOrgId == MaterielInvOrgEnum.èå.ObjToInt() && stockInfoOld.StockStatus == StockStatusEmun.åºåºå®æ.ObjToInt() && stationCode.IsNotEmptyOrNull()) |
| | | { |
| | | decimal oldQty = stockInfoOld.StockLength; |
| | | //è°ç¨æ´æ°éæåºåå䏿¥éé |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | if (thickness < 400) |
| | | { |
| | | throw new Exception($"RFID{stockInfoOld.RfidCode}æ¡ç {stockInfoOld.PalletCode}ç´å¾å°äº400mm"); |
| | | } |
| | | BSTResponse<BSTStockInfoDTO> bSTResponse = _invokeERPService.BSTStockAsync(stockInfoOld.PalletCode).DeserializeObject<BSTResponse<BSTStockInfoDTO>>(); |
| | | if (bSTResponse.Code == 500) |
| | | { |
| | | throw new Exception($"æªæ¾å°æ¡ç {stockInfoOld.PalletCode}䏿ERPåºåä¸åå¨"); |
| | | } |
| | | |
| | | BSTStockInfoDTO bSTStockInfoDTO = bSTResponse.Data ?? throw new Exception($"䏿ERPæªè¿å{stockInfoOld.PalletCode}çåºåä¿¡æ¯"); |
| | | if (stockInfoOld.StockStatus == StockStatusEmun.èåéææå.ObjToInt()) |
| | | { |
| | | stockInfoOld.IsPick = WhetherEnum.False.ObjToInt(); |
| | | } |
| | | stockInfoOld.IsPick = WhetherEnum.False.ObjToInt(); |
| | | decimal stockLength = bSTStockInfoDTO.StockMeter; |
| | | if (weight != bSTStockInfoDTO.Qty && weight < stockInfoOld.InitialWeight) |
| | | { |
| | |
| | | stockInfoOld.StockLength = stockLength; |
| | | stockInfoOld.StockOutLength = 0; |
| | | stockInfoOld.WarehouseId = WarehouseEnum.LLDYL.ObjToInt(); |
| | | if (thickness < 400) |
| | | { |
| | | throw new Exception($"RFID{stockInfoOld.RfidCode}æ¡ç {stockInfoOld.PalletCode}ç´å¾å°äº400mm"); |
| | | } |
| | | content.OK("æå",data:stockInfoOld); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | bool RoadwayType = stockInfo.PalletType == LocationTypeEnum.MediumPallet.ObjToInt(); |
| | | //è·ååé
|
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.RoadwayNo.Contains("YLDual") && (stockInfo.PalletType == LocationTypeEnum.MediumPallet.ObjToInt() ? x.LocationType == LocationTypeEnum.MediumPallet.ObjToInt() : x.LocationType == LocationTypeEnum.SmallPallet.ObjToInt())).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).OrderBy(x => x.RoadwayNo).ToList(); |
| | | if (RoadwayType) |
| | | { |
| | | foreach (var item in locationCounts) |
| | | { |
| | | if (item.RoadwayNo.Contains("YLDual")) |
| | | { |
| | | int count = Db.Queryable<Dt_LocationInfo>() |
| | | .Where(x => x.WarehouseId == warehouse.WarehouseId |
| | | && x.LocationStatus == (int)LocationStatusEnum.Free |
| | | && x.EnableStatus == (int)EnableStatusEnum.Normal |
| | | && x.LocationType == LocationTypeEnum.MediumPallet.ObjToInt() |
| | | && x.RoadwayNo == item.RoadwayNo).Count(); |
| | | item.Count = count; |
| | | } |
| | | } |
| | | } |
| | | roadwayNo = HandleRoadway(locationCounts, warehouse, ErrorRoadway ? roadways : null); |
| | | } |
| | | } |
| | |
| | | return content.Error("ä¼ å
¥ä¿¡æ¯ä¸ºç©º"); |
| | | } |
| | | //è·åæææåï¼åæåä¿¡æ¯ |
| | | List<Dt_MESProInOrderInfo> proInOrderInfos = _inboundRepository.MESProInOrderInfoRepository.QueryData(); |
| | | List<Dt_MESProInOrderInfo> proInOrderInfosOld = _inboundRepository.MESProInOrderInfoRepository.QueryData(); |
| | | //è·åææç©æä¿¡æ¯ |
| | | List<Dt_MaterielInfo> materielInfos = _basicRepository.MaterielInfoRepository.QueryData(x => x.MaterielInvOrgId == MaterielInvOrgEnum.æ°å.ObjToInt()); |
| | | |
| | |
| | | List<Dt_AGVStationInfo> aGVStationInfos = _basicRepository.AGVStationInfoRepository.QueryData(x => !string.IsNullOrEmpty(x.MESPointCode)); |
| | | |
| | | //夿æ¯å¦åå¨éå¤ |
| | | MESProInDTO? proInDTO = proInDTOs.FirstOrDefault(x => x.IsMantissa == false && proInOrderInfos.Select(x => x.BarCode).Contains(x.BarCode)); |
| | | MESProInDTO? proInDTO = proInDTOs.FirstOrDefault(x => x.IsMantissa == false && proInOrderInfosOld.Select(x => x.BarCode).Contains(x.BarCode)); |
| | | if (proInDTO != null) |
| | | { |
| | | return content.Error($"{proInDTO.ProductOrderNo}ç产工å{proInDTO.BarCode}æ¡ç å·²åå¨"); |
| | | } |
| | | Dt_MESProInOrderInfo? proInOrderInfo = proInOrderInfos.FirstOrDefault(x => x.MESProInStatus == InOrderStatusEnum.å
³é.ObjToInt() && proInDTOs.Select(x => x.ProductOrderNo).Distinct().Contains(x.ProductOrderNo)); |
| | | Dt_MESProInOrderInfo? proInOrderInfo = proInOrderInfosOld.FirstOrDefault(x => x.MESProInStatus == InOrderStatusEnum.å
³é.ObjToInt() && proInDTOs.Select(x => x.ProductOrderNo).Distinct().Contains(x.ProductOrderNo)); |
| | | if (proInOrderInfo != null) |
| | | { |
| | | return content.Error($"{proInOrderInfo.ProductOrderNo}ç产工åå·²å
³é"); |
| | |
| | | foreach (var item in proInDTOs) |
| | | { |
| | | Dt_MaterielInfo materielInfo = materielInfos.FirstOrDefault(x => x.MaterielCode == item.MaterialCode); |
| | | //夿 |
| | | if ((item.Thickness <= 0 || item.Wide <= 0) && materielInfo.WarehouseId == WarehouseEnum.LLDYL.ObjToInt()) |
| | | { |
| | | return content.Error($"ç©æ{item.MaterialCode}æ¡ç {item.BarCode}ç´å¾æå¹
宽ä¸è½å°äº0"); |
| | | } |
| | | if (materielInfo.MaterielSourceType != MaterielTypeEnum.æå.ObjToInt()) |
| | | { |
| | | Dt_AGVStationInfo? CheckPointCode = aGVStationInfos.FirstOrDefault(x => x.MESPointCode == item?.PointCode); |
| | |
| | | Dt_MESProInOrderInfo AddproInOrderInfo = _mapper.Map<Dt_MESProInOrderInfo>(item); |
| | | AddproInOrderInfo.WarehouseId = materielInfo.WarehouseId; |
| | | AddproInOrderInfo.MESProOrderType = materielInfo.MaterielSourceType; |
| | | //å°äº550å¹
宽åä¸è½æ¬è¿ |
| | | if (item.Wide < 550 && materielInfo.WarehouseId == WarehouseEnum.LLDYL.ObjToInt()) |
| | | { |
| | | AddproInOrderInfo.MESProInStatus=InOrderStatusEnum.å
¥åºå®æ.ObjToInt(); |
| | | } |
| | | AddMESProInOrders.Add(AddproInOrderInfo); |
| | | } |
| | | List<Dt_Task> tasks = new List<Dt_Task>(); |
| | |
| | | PB_INV_PRODUCT_IN= pRODUCT_INItems |
| | | }) ?? throw new Exception("åæåå
¥åºæ¥å£è¯·æ±å¤±è´¥"); |
| | | //çæåæåå
¥åº |
| | | WebResponseContent webResponse = SemiProInbound(AddMESProInOrders.Where(x => x.MESProOrderType == MaterielTypeEnum.åæå.ObjToInt()).ToList()); |
| | | if (!webResponse.Status) |
| | | List<Dt_MESProInOrderInfo> semiProInOrderInfos = mESProInOrderInfos.Where(x => x.MESProInStatus == InOrderStatusEnum.æªå¼å§.ObjToInt()).ToList(); |
| | | if (semiProInOrderInfos.Count>0) |
| | | { |
| | | throw new Exception(webResponse.Message); |
| | | } |
| | | tasks = webResponse.Data as List<Dt_Task>; |
| | | WebResponseContent taskResponse = PushTasksToWCS(tasks); |
| | | if (!taskResponse.Status) |
| | | { |
| | | throw new Exception(taskResponse.Message); |
| | | WebResponseContent webResponse = SemiProInbound(AddMESProInOrders.Where(x => x.MESProOrderType == MaterielTypeEnum.åæå.ObjToInt()).ToList()); |
| | | if (!webResponse.Status) |
| | | { |
| | | throw new Exception(webResponse.Message); |
| | | } |
| | | tasks = webResponse.Data as List<Dt_Task>; |
| | | WebResponseContent taskResponse = PushTasksToWCS(tasks); |
| | | if (!taskResponse.Status) |
| | | { |
| | | throw new Exception(taskResponse.Message); |
| | | } |
| | | } |
| | | } |
| | | if (AddMESProInOrders.Where(x => x.MESProOrderType == MaterielTypeEnum.æå.ObjToInt()).Count() > 0) |
| | | List<Dt_MESProInOrderInfo> proInOrderInfos = AddMESProInOrders.Where(x => x.MESProOrderType == MaterielTypeEnum.æå.ObjToInt()).ToList(); |
| | | if (proInOrderInfos.Count > 0) |
| | | { |
| | | WebResponseContent webResponse = PushPackaxisTaskToWCS(AddMESProInOrders.Where(x => x.MESProOrderType == MaterielTypeEnum.æå.ObjToInt()).ToList()); |
| | | WebResponseContent webResponse = PushPackaxisTaskToWCS(proInOrderInfos); |
| | | if (!webResponse.Status) |
| | | { |
| | | throw new Exception(webResponse.Message); |