| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Diagnostics.CodeAnalysis; |
| | | using System.Linq; |
| | | using System.Reflection.Metadata; |
| | | using System.Text; |
| | |
| | | |
| | | if (stationCode.IsNullOrEmpty()) |
| | | { |
| | | #region å¤çéè´ç»å®RFIDé»è¾ |
| | | Dt_YLInboundCache? yLInboundCache = _inboundRepository.YLInboundCacheRepository.QueryData(x => x.InvOrg == MaterielInvOrgEnum.èå.ToString()).FirstOrDefault(); |
| | | if (yLInboundCache == null) |
| | | //æ°åRFIDç»å®é»è¾ |
| | | if (palletCode.StartsWith("A")) |
| | | { |
| | | return content.Error("æªæ¾å°åæç¼åæ¡ç ä¿¡æ¯"); |
| | | } |
| | | if (yLInboundCache.BindStatus == WhetherEnum.True.ObjToInt()) |
| | | { |
| | | return content.Error($"åæç¼åæ¡ç {yLInboundCache.BarCode}å·²ç»å®RFID{yLInboundCache.RfidCode}"); |
| | | } |
| | | else |
| | | { |
| | | Dt_StockInfo ExistStockInfo = _stockRepository.StockInfoRepository.QueryFirst(x => x.PalletCode == yLInboundCache.BarCode); |
| | | if (ExistStockInfo != null && ExistStockInfo.MaterielInvOrgId == MaterielInvOrgEnum.èå.ObjToInt() && ExistStockInfo.StockStatus == StockStatusEmun.åæéç»çæå.ObjToInt()) |
| | | #region å¤çéè´ç»å®RFIDé»è¾ |
| | | Dt_YLInboundCache? yLInboundCache = _inboundRepository.YLInboundCacheRepository.QueryData(x => x.InvOrg == MaterielInvOrgEnum.æ°å.ToString()).FirstOrDefault(); |
| | | if (yLInboundCache == null) |
| | | { |
| | | yLInboundCache.RfidCode = palletCode; |
| | | yLInboundCache.BindStatus = WhetherEnum.True.ObjToInt(); |
| | | ExistStockInfo.RfidCode = palletCode; |
| | | _unitOfWorkManage.BeginTran(); |
| | | //æ´æ°ç»çä¿¡æ¯ |
| | | UpdateStock(ExistStockInfo, weight, thickness, wide); |
| | | _inboundRepository.YLInboundCacheRepository.UpdateData(yLInboundCache); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK($"åæéåºå转å{ExistStockInfo.RfidCode}"); |
| | | return content.Error("æªæ¾å°åæç¼åæ¡ç ä¿¡æ¯"); |
| | | } |
| | | else if(ExistStockInfo != null && ExistStockInfo.MaterielInvOrgId == MaterielInvOrgEnum.èå.ObjToInt() && ExistStockInfo.StockStatus == StockStatusEmun.ç»çæå.ObjToInt()) |
| | | if (yLInboundCache.BindStatus == WhetherEnum.True.ObjToInt()) |
| | | { |
| | | //è·åéè´ä¿¡æ¯ |
| | | Dt_PurchaseBSTOrderDetail purchaseBSTOrderDetail = _inboundRepository.PurchaseBSTOrderDetailRepository.QueryFirst(x => x.Barcode == yLInboundCache.BarCode); |
| | | yLInboundCache.RfidCode = palletCode; |
| | | yLInboundCache.BindStatus = WhetherEnum.True.ObjToInt(); |
| | | ExistStockInfo.RfidCode = palletCode; |
| | | purchaseBSTOrderDetail.RfidCode= palletCode; |
| | | _unitOfWorkManage.BeginTran(); |
| | | UpdateStock(ExistStockInfo, weight, thickness, wide); |
| | | _inboundRepository.YLInboundCacheRepository.UpdateData(yLInboundCache); |
| | | _inboundRepository.PurchaseBSTOrderDetailRepository.UpdateData(purchaseBSTOrderDetail); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK($"éè´å
¥åº{ExistStockInfo.RfidCode}"); |
| | | return content.Error($"åæç¼åæ¡ç {yLInboundCache.BarCode}å·²ç»å®RFID{yLInboundCache.RfidCode}"); |
| | | } |
| | | else |
| | | { |
| | | throw new Exception("æªç¥é误"); |
| | | Dt_StockInfo ExistStockInfo = _stockRepository.StockInfoRepository.QueryFirst(x => x.PalletCode == yLInboundCache.BarCode); |
| | | if (ExistStockInfo != null && ExistStockInfo.MaterielInvOrgId == MaterielInvOrgEnum.æ°å.ObjToInt() && ExistStockInfo.StockStatus == StockStatusEmun.ç»çæå.ObjToInt()) |
| | | { |
| | | //è·åéè´ä¿¡æ¯ |
| | | yLInboundCache.RfidCode = palletCode; |
| | | yLInboundCache.BindStatus = WhetherEnum.True.ObjToInt(); |
| | | ExistStockInfo.RfidCode = palletCode; |
| | | _unitOfWorkManage.BeginTran(); |
| | | UpdateStock(ExistStockInfo, weight, thickness, wide); |
| | | _inboundRepository.YLInboundCacheRepository.UpdateData(yLInboundCache); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK($"éè´å
¥åº{ExistStockInfo.RfidCode}"); |
| | | } |
| | | else |
| | | { |
| | | throw new Exception("æªç¥é误"); |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | #endregion |
| | | else //èåRFIDç»å®é»è¾ |
| | | { |
| | | #region å¤çéè´ç»å®RFIDé»è¾ |
| | | Dt_YLInboundCache? yLInboundCache = _inboundRepository.YLInboundCacheRepository.QueryData(x => x.InvOrg == MaterielInvOrgEnum.èå.ToString()).FirstOrDefault(); |
| | | if (yLInboundCache == null) |
| | | { |
| | | return content.Error("æªæ¾å°åæç¼åæ¡ç ä¿¡æ¯"); |
| | | } |
| | | if (yLInboundCache.BindStatus == WhetherEnum.True.ObjToInt()) |
| | | { |
| | | return content.Error($"åæç¼åæ¡ç {yLInboundCache.BarCode}å·²ç»å®RFID{yLInboundCache.RfidCode}"); |
| | | } |
| | | else |
| | | { |
| | | Dt_StockInfo ExistStockInfo = _stockRepository.StockInfoRepository.QueryFirst(x => x.PalletCode == yLInboundCache.BarCode); |
| | | if (ExistStockInfo != null && ExistStockInfo.MaterielInvOrgId == MaterielInvOrgEnum.èå.ObjToInt() && ExistStockInfo.StockStatus == StockStatusEmun.åæéç»çæå.ObjToInt()) |
| | | { |
| | | yLInboundCache.RfidCode = palletCode; |
| | | yLInboundCache.BindStatus = WhetherEnum.True.ObjToInt(); |
| | | ExistStockInfo.RfidCode = palletCode; |
| | | _unitOfWorkManage.BeginTran(); |
| | | //æ´æ°ç»çä¿¡æ¯ |
| | | UpdateStock(ExistStockInfo, weight, thickness, wide); |
| | | _inboundRepository.YLInboundCacheRepository.UpdateData(yLInboundCache); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK($"åæéåºå转å{ExistStockInfo.RfidCode}"); |
| | | } |
| | | else if (ExistStockInfo != null && ExistStockInfo.MaterielInvOrgId == MaterielInvOrgEnum.èå.ObjToInt() && ExistStockInfo.StockStatus == StockStatusEmun.ç»çæå.ObjToInt()) |
| | | { |
| | | //è·åéè´ä¿¡æ¯ |
| | | Dt_PurchaseBSTOrderDetail purchaseBSTOrderDetail = _inboundRepository.PurchaseBSTOrderDetailRepository.QueryFirst(x => x.Barcode == yLInboundCache.BarCode); |
| | | yLInboundCache.RfidCode = palletCode; |
| | | yLInboundCache.BindStatus = WhetherEnum.True.ObjToInt(); |
| | | ExistStockInfo.RfidCode = palletCode; |
| | | purchaseBSTOrderDetail.RfidCode = palletCode; |
| | | _unitOfWorkManage.BeginTran(); |
| | | UpdateStock(ExistStockInfo, weight, thickness, wide); |
| | | _inboundRepository.YLInboundCacheRepository.UpdateData(yLInboundCache); |
| | | _inboundRepository.PurchaseBSTOrderDetailRepository.UpdateData(purchaseBSTOrderDetail); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK($"éè´å
¥åº{ExistStockInfo.RfidCode}"); |
| | | } |
| | | else |
| | | { |
| | | throw new Exception("æªç¥é误"); |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | | else if (!stationCode.IsNullOrEmpty() && stockInfoOld == null) |
| | | { |
| | |
| | | /// <param name="palletCode">çº¸å·æ¡ç </param> |
| | | /// <param name="rfidCode">纸å·RIFD</param> |
| | | /// <returns></returns> |
| | | public WebResponseContent PurchaseBoxing(string palletCode) |
| | | public WebResponseContent PurchaseBoxing(string palletCode, int orderType = 0) |
| | | { |
| | | WebResponseContent content=new WebResponseContent(); |
| | | try |
| | |
| | | Dt_StockInfo stockInfoOld = _stockRepository.StockInfoRepository.QueryFirst(x => x.PalletCode == palletCode); |
| | | if (stockInfoOld != null) |
| | | { |
| | | throw new Exception("æ¡ç ä¿¡æ¯åºåä¸å·²åå¨"); |
| | | throw new Exception($"æ¡ç ä¿¡æ¯{palletCode}åºåä¸å·²åå¨"); |
| | | } |
| | | //è·åéè´ä¿¡æ¯ |
| | | Dt_PurchaseBSTOrderDetail purchaseBSTOrderDetail = _inboundRepository.PurchaseBSTOrderDetailRepository.QueryFirst(x => x.Barcode == palletCode); |
| | | if (purchaseBSTOrderDetail == null) |
| | | if (orderType>0) //æ°å纸å·å¹³å°å
¥åº |
| | | { |
| | | BSTResponse<BSTStockInfoDTO> bSTResponse = _invokeERPService.BSTStockAsync(palletCode).DeserializeObject<BSTResponse<BSTStockInfoDTO>>(); |
| | | if (bSTResponse.Code == 500) |
| | | //è·å主å |
| | | Dt_InboundOrder inboundOrder = BaseDal.Db.Queryable<Dt_InboundOrder>().Where(x=>x.OrderType==orderType).Includes(x=>x.Details).Where(x=>x.Details.Any(v=>v.BarCode==palletCode)).First(); |
| | | if (inboundOrder==null) |
| | | { |
| | | throw new Exception($"æªæ¾å°æ¡ç {palletCode}éè´ä¿¡æ¯å¹¶ä¸æERPåºåä¹ä¸åå¨"); |
| | | throw new Exception($"æªæ¾å°æ¡ç {palletCode}å
¥åºåæ®ä¿¡æ¯"); |
| | | } |
| | | |
| | | BSTStockInfoDTO bSTStockInfoDTO=bSTResponse.Data ?? throw new Exception($"䏿ERPæªè¿å{palletCode}çåºåä¿¡æ¯"); |
| | | |
| | | Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x => x.MaterialSourceId == bSTStockInfoDTO.MaterialId) ?? throw new Exception($"æªæ¾å°æ¡ç {palletCode}ç©æä¿¡æ¯{bSTStockInfoDTO.MaterialNo}"); |
| | | |
| | | //çæåºåç»çä¿¡æ¯ |
| | | Dt_StockInfo stockInfo = new Dt_StockInfo() |
| | | Dt_InboundOrderDetail inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x=>x.BarCode == palletCode); |
| | | if (inboundOrderDetail==null) |
| | | { |
| | | MaterielInvOrgId = materielInfo.MaterielInvOrgId, |
| | | PalletCode = palletCode, |
| | | RfidCode = "", |
| | | LocationCode = "", |
| | | PalletType = 1, |
| | | WarehouseId = materielInfo.WarehouseId, |
| | | StockAttribute = materielInfo.MaterielSourceType, |
| | | StockStatus = StockStatusEmun.åæéç»çæå.ObjToInt(), |
| | | MaterielSpec = materielInfo.MaterielSpec, |
| | | Unit = materielInfo.MaterielUnit, |
| | | MaterielThickness = bSTStockInfoDTO.Thick, |
| | | MaterielWide = bSTStockInfoDTO.W, |
| | | MaterielWeight = bSTStockInfoDTO.Qty, |
| | | MaterielCode = materielInfo.MaterielCode, |
| | | MaterielName = materielInfo.MaterielName, |
| | | StockLength = bSTStockInfoDTO.StockMeter, |
| | | MaterielId = materielInfo.MaterialSourceId |
| | | }; |
| | | if (bSTStockInfoDTO.W > 1200) |
| | | { |
| | | stockInfo.PalletType = 2; |
| | | throw new Exception($"æªæ¾å°å
¥åºåå·ä¸º{inboundOrder.UpperOrderNo}æ¡ç {palletCode}åæ®ä¿¡æ¯"); |
| | | } |
| | | Dt_YLInboundCache? yLInboundCache = _inboundRepository.YLInboundCacheRepository.QueryData(x => x.InvOrg == MaterielInvOrgEnum.èå.ToString()).FirstOrDefault() ?? throw new Exception("æªæ¾å°åææ¡ç ç¼åä¿¡æ¯"); |
| | | int Id = yLInboundCache.Id; |
| | | if (yLInboundCache.BarCode == palletCode) |
| | | if (inboundOrderDetail.MaterialWide < 700) |
| | | { |
| | | throw new Exception($"æ¡ç {palletCode}å·²æ«ç "); |
| | | return content.Error("æ°åç©æå¹
宽éå¶ä¸º700-2700mm"); |
| | | } |
| | | else if (yLInboundCache.BarCode != palletCode && yLInboundCache.BindStatus == WhetherEnum.True.ObjToInt()) |
| | | if (inboundOrderDetail.MaterialThick<=0) |
| | | { |
| | | yLInboundCache = _mapper.Map<Dt_YLInboundCache>(stockInfo); |
| | | yLInboundCache.Id = Id; |
| | | _unitOfWorkManage.BeginTran(); |
| | | //æ°å¢ç»çä¿¡æ¯ |
| | | _stockRepository.StockInfoRepository.AddData(stockInfo); |
| | | _inboundRepository.YLInboundCacheRepository.UpdateData(yLInboundCache); |
| | | //å¯å¨çº¿ä½ |
| | | WebResponseContent webResponse = YLPurchasePush(); |
| | | if (!webResponse.Status) |
| | | { |
| | | throw new Exception(webResponse.Message); |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK("æå", yLInboundCache); |
| | | return content.Error("ç©æç´å¾éè¦å¤§äº0"); |
| | | } |
| | | else |
| | | if (inboundOrderDetail.OrderDetailStatus != InOrderStatusEnum.æªå¼å§.ObjToInt()) |
| | | { |
| | | throw new Exception($"ä¸å·æ¡ç {yLInboundCache.BarCode}è¿æªè¿è¡ç»å®"); |
| | | throw new Exception($"æ¡ç {palletCode}ä¿¡æ¯å·²å
¥åºæå
¥åºä¸"); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | if (purchaseBSTOrderDetail.PurchaseBSTOrderDetailStatus != InOrderStatusEnum.æªå¼å§.ObjToInt()) |
| | | { |
| | | throw new Exception($"æ¡ç {palletCode}éè´ä¿¡æ¯å·²å
¥åºæå
¥åºä¸"); |
| | | } |
| | | Dt_YLInboundCache? yLInboundCache = _inboundRepository.YLInboundCacheRepository.QueryData(x => x.InvOrg == MaterielInvOrgEnum.èå.ToString()).FirstOrDefault(); |
| | | Dt_YLInboundCache? yLInboundCache = _inboundRepository.YLInboundCacheRepository.QueryData(x => x.InvOrg == MaterielInvOrgEnum.æ°å.ToString()).FirstOrDefault(); |
| | | if (yLInboundCache == null) |
| | | { |
| | | throw new Exception("æªæ¾å°åææ¡ç ç¼åä¿¡æ¯"); |
| | |
| | | } |
| | | else if (yLInboundCache.BarCode != palletCode && yLInboundCache.BindStatus == WhetherEnum.True.ObjToInt()) |
| | | { |
| | | yLInboundCache = _mapper.Map<Dt_YLInboundCache>(purchaseBSTOrderDetail); |
| | | yLInboundCache = _mapper.Map<Dt_YLInboundCache>(inboundOrderDetail); |
| | | yLInboundCache.Id = Id; |
| | | //è·åéè´ä¸»å |
| | | Dt_PurchaseBSTOrder purchaseBSTOrder = _inboundRepository.PurchaseBSTOrderRepository.QueryFirst(x => x.Id == purchaseBSTOrderDetail.PurchaseBSTOrderId); |
| | | |
| | | //è·åç©æ |
| | | Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x => x.MaterialSourceId == purchaseBSTOrderDetail.MaterialId); |
| | | Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x => x.MaterielCode == inboundOrderDetail.MaterialCode); |
| | | //çæåºåç»çä¿¡æ¯ |
| | | Dt_StockInfo stockInfo = new Dt_StockInfo() |
| | | { |
| | | MaterielInvOrgId = materielInfo.MaterielInvOrgId, |
| | | PalletCode = purchaseBSTOrderDetail.Barcode, |
| | | PalletCode = inboundOrderDetail.BarCode, |
| | | RfidCode = "", |
| | | LocationCode = "", |
| | | PalletType = 1, |
| | |
| | | StockStatus = StockStatusEmun.ç»çæå.ObjToInt(), |
| | | MaterielSpec = materielInfo.MaterielSpec, |
| | | Unit = materielInfo.MaterielUnit, |
| | | MaterielThickness = purchaseBSTOrderDetail.MaterialThick, |
| | | MaterielWide = purchaseBSTOrderDetail.MaterialWide, |
| | | MaterielWeight = purchaseBSTOrderDetail.DeliveryQty, |
| | | MaterielThickness = inboundOrderDetail.MaterialThick, |
| | | MaterielWide = inboundOrderDetail.MaterialWide, |
| | | MaterielWeight = inboundOrderDetail.MaterialWeight, |
| | | MaterielCode = materielInfo.MaterielCode, |
| | | MaterielName = materielInfo.MaterielName, |
| | | StockLength = purchaseBSTOrderDetail.ProcurementLength, |
| | | MaterielId = purchaseBSTOrderDetail.MaterialId |
| | | BatchNo=inboundOrderDetail.MaterialLot, |
| | | StockLength = inboundOrderDetail.OrderQuantity |
| | | }; |
| | | if (purchaseBSTOrderDetail.MaterialWide > 1200) |
| | | if (inboundOrderDetail.MaterialWide > 1200) |
| | | { |
| | | stockInfo.PalletType = 2; |
| | | } |
| | | purchaseBSTOrderDetail.PurchaseBSTOrderDetailStatus = InOrderStatusEnum.å
¥åºä¸.ObjToInt(); |
| | | inboundOrderDetail.OrderDetailStatus = InOrderStatusEnum.å
¥åºä¸.ObjToInt(); |
| | | _unitOfWorkManage.BeginTran(); |
| | | _inboundRepository.YLInboundCacheRepository.UpdateData(yLInboundCache); |
| | | //æ°å¢ç»çä¿¡æ¯ |
| | | _stockRepository.StockInfoRepository.AddData(stockInfo); |
| | | if (purchaseBSTOrder.PurchaseOrderStatus == InOrderStatusEnum.æªå¼å§.ObjToInt()) |
| | | if (inboundOrder.InboundOrderStatus == InOrderStatusEnum.æªå¼å§.ObjToInt()) |
| | | { |
| | | purchaseBSTOrder.PurchaseOrderStatus = InOrderStatusEnum.å
¥åºä¸.ObjToInt(); |
| | | _inboundRepository.PurchaseBSTOrderRepository.UpdateData(purchaseBSTOrder); |
| | | inboundOrder.InboundOrderStatus = InOrderStatusEnum.å
¥åºä¸.ObjToInt(); |
| | | _inboundRepository.InboundOrderRepository.UpdateData(inboundOrder); |
| | | } |
| | | _inboundRepository.PurchaseBSTOrderDetailRepository.UpdateData(purchaseBSTOrderDetail); |
| | | _inboundRepository.InboundOrderDetailRepository.UpdateData(inboundOrderDetail); |
| | | //å¯å¨çº¿ä½ |
| | | WebResponseContent webResponse = YLPurchasePush(); |
| | | if (!webResponse.Status) |
| | |
| | | throw new Exception(webResponse.Message); |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | Dt_StockInfo stockInfoAdd = _stockRepository.StockInfoRepository.QueryFirst(x => x.PalletCode == stockInfo.PalletCode); |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfoAdd, 0, stockInfoAdd.StockLength, StockChangeTypeEnum.MaterielGroup); |
| | | return content.OK("æå", yLInboundCache); |
| | | } |
| | | else |
| | | { |
| | | throw new Exception($"ä¸å·æ¡ç {yLInboundCache.BarCode}è¿æªè¿è¡ç»å®"); |
| | | throw new Exception($"ä¸å·æ¡ç {yLInboundCache.BarCode}è¿æªè¿è¡ç»å®"); |
| | | } |
| | | } |
| | | |
| | | else //èå纸å·å¹³å°å
¥åº |
| | | { |
| | | //è·åéè´ä¿¡æ¯ |
| | | Dt_PurchaseBSTOrderDetail purchaseBSTOrderDetail = _inboundRepository.PurchaseBSTOrderDetailRepository.QueryFirst(x => x.Barcode == palletCode); |
| | | if (purchaseBSTOrderDetail == null) |
| | | { |
| | | BSTResponse<BSTStockInfoDTO> bSTResponse = _invokeERPService.BSTStockAsync(palletCode).DeserializeObject<BSTResponse<BSTStockInfoDTO>>(); |
| | | if (bSTResponse.Code == 500) |
| | | { |
| | | throw new Exception($"æªæ¾å°æ¡ç {palletCode}éè´ä¿¡æ¯å¹¶ä¸æERPåºåä¹ä¸åå¨"); |
| | | } |
| | | |
| | | BSTStockInfoDTO bSTStockInfoDTO = bSTResponse.Data ?? throw new Exception($"䏿ERPæªè¿å{palletCode}çåºåä¿¡æ¯"); |
| | | |
| | | Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x => x.MaterialSourceId == bSTStockInfoDTO.MaterialId) ?? throw new Exception($"æªæ¾å°æ¡ç {palletCode}ç©æä¿¡æ¯{bSTStockInfoDTO.MaterialNo}"); |
| | | |
| | | //çæåºåç»çä¿¡æ¯ |
| | | Dt_StockInfo stockInfo = new Dt_StockInfo() |
| | | { |
| | | MaterielInvOrgId = materielInfo.MaterielInvOrgId, |
| | | PalletCode = palletCode, |
| | | RfidCode = "", |
| | | LocationCode = "", |
| | | PalletType = 1, |
| | | WarehouseId = materielInfo.WarehouseId, |
| | | StockAttribute = materielInfo.MaterielSourceType, |
| | | StockStatus = StockStatusEmun.åæéç»çæå.ObjToInt(), |
| | | MaterielSpec = materielInfo.MaterielSpec, |
| | | Unit = materielInfo.MaterielUnit, |
| | | MaterielThickness = bSTStockInfoDTO.Thick, |
| | | MaterielWide = bSTStockInfoDTO.W, |
| | | MaterielWeight = bSTStockInfoDTO.Qty, |
| | | MaterielCode = materielInfo.MaterielCode, |
| | | MaterielName = materielInfo.MaterielName, |
| | | StockLength = bSTStockInfoDTO.StockMeter, |
| | | MaterielId = materielInfo.MaterialSourceId |
| | | }; |
| | | if (bSTStockInfoDTO.W > 1200) |
| | | { |
| | | stockInfo.PalletType = 2; |
| | | } |
| | | Dt_YLInboundCache? yLInboundCache = _inboundRepository.YLInboundCacheRepository.QueryData(x => x.InvOrg == MaterielInvOrgEnum.èå.ToString()).FirstOrDefault() ?? throw new Exception("æªæ¾å°åææ¡ç ç¼åä¿¡æ¯"); |
| | | int Id = yLInboundCache.Id; |
| | | if (yLInboundCache.BarCode == palletCode) |
| | | { |
| | | throw new Exception($"æ¡ç {palletCode}å·²æ«ç "); |
| | | } |
| | | else if (yLInboundCache.BarCode != palletCode && yLInboundCache.BindStatus == WhetherEnum.True.ObjToInt()) |
| | | { |
| | | yLInboundCache = _mapper.Map<Dt_YLInboundCache>(stockInfo); |
| | | yLInboundCache.Id = Id; |
| | | _unitOfWorkManage.BeginTran(); |
| | | //æ°å¢ç»çä¿¡æ¯ |
| | | _stockRepository.StockInfoRepository.AddData(stockInfo); |
| | | _inboundRepository.YLInboundCacheRepository.UpdateData(yLInboundCache); |
| | | //å¯å¨çº¿ä½ |
| | | WebResponseContent webResponse = YLPurchasePush(); |
| | | if (!webResponse.Status) |
| | | { |
| | | throw new Exception(webResponse.Message); |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | Dt_StockInfo stockInfoAdd = _stockRepository.StockInfoRepository.QueryFirst(x => x.PalletCode == stockInfo.PalletCode); |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfoAdd, 0, stockInfoAdd.StockLength, StockChangeTypeEnum.MaterielGroup); |
| | | return content.OK("æå", yLInboundCache); |
| | | } |
| | | else |
| | | { |
| | | throw new Exception($"ä¸å·æ¡ç {yLInboundCache.BarCode}è¿æªè¿è¡ç»å®"); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | if (purchaseBSTOrderDetail.PurchaseBSTOrderDetailStatus != InOrderStatusEnum.æªå¼å§.ObjToInt()) |
| | | { |
| | | throw new Exception($"æ¡ç {palletCode}éè´ä¿¡æ¯å·²å
¥åºæå
¥åºä¸"); |
| | | } |
| | | Dt_YLInboundCache? yLInboundCache = _inboundRepository.YLInboundCacheRepository.QueryData(x => x.InvOrg == MaterielInvOrgEnum.èå.ToString()).FirstOrDefault(); |
| | | if (yLInboundCache == null) |
| | | { |
| | | throw new Exception("æªæ¾å°åææ¡ç ç¼åä¿¡æ¯"); |
| | | } |
| | | int Id = yLInboundCache.Id; |
| | | if (yLInboundCache.BarCode == palletCode) |
| | | { |
| | | throw new Exception($"æ¡ç {palletCode}å·²æ«ç "); |
| | | } |
| | | else if (yLInboundCache.BarCode != palletCode && yLInboundCache.BindStatus == WhetherEnum.True.ObjToInt()) |
| | | { |
| | | yLInboundCache = _mapper.Map<Dt_YLInboundCache>(purchaseBSTOrderDetail); |
| | | yLInboundCache.Id = Id; |
| | | //è·åéè´ä¸»å |
| | | Dt_PurchaseBSTOrder purchaseBSTOrder = _inboundRepository.PurchaseBSTOrderRepository.QueryFirst(x => x.Id == purchaseBSTOrderDetail.PurchaseBSTOrderId); |
| | | //è·åç©æ |
| | | Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x => x.MaterialSourceId == purchaseBSTOrderDetail.MaterialId); |
| | | //çæåºåç»çä¿¡æ¯ |
| | | Dt_StockInfo stockInfo = new Dt_StockInfo() |
| | | { |
| | | MaterielInvOrgId = materielInfo.MaterielInvOrgId, |
| | | PalletCode = purchaseBSTOrderDetail.Barcode, |
| | | RfidCode = "", |
| | | LocationCode = "", |
| | | PalletType = 1, |
| | | WarehouseId = materielInfo.WarehouseId, |
| | | StockAttribute = materielInfo.MaterielSourceType, |
| | | StockStatus = StockStatusEmun.ç»çæå.ObjToInt(), |
| | | MaterielSpec = materielInfo.MaterielSpec, |
| | | Unit = materielInfo.MaterielUnit, |
| | | MaterielThickness = purchaseBSTOrderDetail.MaterialThick, |
| | | MaterielWide = purchaseBSTOrderDetail.MaterialWide, |
| | | MaterielWeight = purchaseBSTOrderDetail.DeliveryQty, |
| | | MaterielCode = materielInfo.MaterielCode, |
| | | MaterielName = materielInfo.MaterielName, |
| | | StockLength = purchaseBSTOrderDetail.ProcurementLength, |
| | | MaterielId = purchaseBSTOrderDetail.MaterialId |
| | | }; |
| | | if (purchaseBSTOrderDetail.MaterialWide > 1200) |
| | | { |
| | | stockInfo.PalletType = 2; |
| | | } |
| | | purchaseBSTOrderDetail.PurchaseBSTOrderDetailStatus = InOrderStatusEnum.å
¥åºä¸.ObjToInt(); |
| | | _unitOfWorkManage.BeginTran(); |
| | | _inboundRepository.YLInboundCacheRepository.UpdateData(yLInboundCache); |
| | | //æ°å¢ç»çä¿¡æ¯ |
| | | _stockRepository.StockInfoRepository.AddData(stockInfo); |
| | | if (purchaseBSTOrder.PurchaseOrderStatus == InOrderStatusEnum.æªå¼å§.ObjToInt()) |
| | | { |
| | | purchaseBSTOrder.PurchaseOrderStatus = InOrderStatusEnum.å
¥åºä¸.ObjToInt(); |
| | | _inboundRepository.PurchaseBSTOrderRepository.UpdateData(purchaseBSTOrder); |
| | | } |
| | | _inboundRepository.PurchaseBSTOrderDetailRepository.UpdateData(purchaseBSTOrderDetail); |
| | | //å¯å¨çº¿ä½ |
| | | WebResponseContent webResponse = YLPurchasePush(); |
| | | if (!webResponse.Status) |
| | | { |
| | | throw new Exception(webResponse.Message); |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | Dt_StockInfo stockInfoAdd = _stockRepository.StockInfoRepository.QueryFirst(x => x.PalletCode == stockInfo.PalletCode); |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfoAdd, 0, stockInfoAdd.StockLength, StockChangeTypeEnum.MaterielGroup); |
| | | return content.OK("æå", yLInboundCache); |
| | | } |
| | | else |
| | | { |
| | | throw new Exception($"ä¸å·æ¡ç {yLInboundCache.BarCode}è¿æªè¿è¡ç»å®"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | if (stockInfo.MaterielThickness >= 300 && stockInfo.MaterielThickness <= 1300 && stockInfo.MaterielWide >= 700 && stockInfo.MaterielWide <= 2700) |
| | | { |
| | | //è·ååé
|
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.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) }).ToList(); |
| | | 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) }).ToList(); |
| | | |
| | | roadwayNo = HandleRoadway(locationCounts, warehouse); |
| | | } |
| | |
| | | LayerLimit = true; |
| | | } |
| | | //è·ååé
|
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.RoadwayNo.Contains("YL") && !x.RoadwayNo.Contains("YLDual") && (LayerLimit ? x.Columns>=56 : x.Columns<=55)).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | 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("YL") && !x.RoadwayNo.Contains("YLDual") && (LayerLimit ? x.Columns>=56 : x.Columns<=55)).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | if (stockInfo.MaterielWide > 2200) |
| | | { |
| | | locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.RoadwayNo == "SC02_YL" && (LayerLimit ? x.Columns >= 56 : x.Columns <= 55)).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.RoadwayNo == "SC02_YL" && (LayerLimit ? x.Columns >= 56 : x.Columns <= 55)).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | } |
| | | |
| | | roadwayNo = HandleRoadway(locationCounts, warehouse); |
| | |
| | | { |
| | | return content.Error($"æªæ¾å°å¯¹åºçç»ç¹è´§ä½ä¿¡æ¯"); |
| | | } |
| | | Dt_AGVStationInfo agvstation = _basicRepository.AGVStationInfoRepository.QueryFirst(x => x.AGVStationCode == task.SourceAddress && ( x.StationArea == nameof(AGVStationAreaEnum.䏿¥¼æå°ç 头) || x.StationArea == nameof(AGVStationAreaEnum.䏿¥¼æ 纺ç»å¸) || x.StationArea == nameof(AGVStationAreaEnum.䏿¥¼æ 纺æ·è) || x.StationArea == nameof(AGVStationAreaEnum.䏿¥¼æ 纺æ·è))); |
| | | Dt_AGVStationInfo agvstation = _basicRepository.AGVStationInfoRepository.QueryFirst(x => x.AGVStationCode == task.SourceAddress && ( x.StationArea == nameof(StationAreaEnum.䏿¥¼æå°ç 头) || x.StationArea == nameof(StationAreaEnum.䏿¥¼æ 纺ç»å¸) || x.StationArea == nameof(StationAreaEnum.䏿¥¼æ 纺æ·è) || x.StationArea == nameof(StationAreaEnum.䏿¥¼æ 纺æ·è))); |
| | | if (agvstation != null) |
| | | { |
| | | agvstation.IsOccupied = WhetherEnum.False.ObjToInt(); |
| | |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? WIDESEA_Core.Enums.OperateTypeEnum.äººå·¥å®æ : WIDESEA_Core.Enums.OperateTypeEnum.èªå¨å®æ); |
| | | _unitOfWorkManage.CommitTran(); |
| | | } |
| | | else if (proStockInfo != null && proStockInfo.StockStatus == StockStatusEmun.æå¨ç»çå
¥åºç¡®è®¤.ObjToInt()) |
| | | else if (proStockInfo != null &&( proStockInfo.StockStatus == StockStatusEmun.æå¨ç»çå
¥åºç¡®è®¤.ObjToInt() || proStockInfo.StockStatus == StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt())) |
| | | { |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | proStockInfo.proStockInfoDetails.ForEach(x => |
| | |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfoEnd, proStockInfo.PalletType, LocationStatusEnum.InStock, proStockInfo.WarehouseId); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? WIDESEA_Core.Enums.OperateTypeEnum.äººå·¥å®æ : WIDESEA_Core.Enums.OperateTypeEnum.èªå¨å®æ); |
| | | _unitOfWorkManage.CommitTran(); |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(proStockInfo, 0, proStockInfo.proStockInfoDetails.Sum(x => x.StockQty), StockChangeTypeEnum.MaterielGroup); |
| | | } |
| | | else |
| | | { |
| | |
| | | content.Message = bSTResponse.Msg; |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.StockLength, 0, StockChangeTypeEnum.Inbound,taskNum:task.TaskNum); |
| | | } |
| | | return content.OK(); |
| | | } |
| | |
| | | { |
| | | string roadwayNo = ""; |
| | | //è·åå··éå¯åé
çè´§ä½æ°é |
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == WarehouseEnum.LLDCP.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.RoadwayNo.Contains("CP")).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == WarehouseEnum.LLDCP.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.RoadwayNo.Contains("CP")).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | //çéå½åå
¥åºä»»å¡ä¸å·²åé
å··é任塿°é |
| | | List<LocationCount> useLocationCounts = Db.Queryable<Dt_Task>().Where(x => (x.WarehouseId == WarehouseEnum.LLDCP.ObjToInt()|| x.WarehouseId == WarehouseEnum.LLDFL.ObjToInt()) |
| | | && locationCounts.Select(j=>j.RoadwayNo).Distinct().Contains(x.Roadway) |
| | |
| | | LocationStatusEnum lastStatus = (LocationStatusEnum)locationInfo.LocationStatus; |
| | | //æ´æ°éå®è´§ä½ |
| | | _unitOfWorkManage.BeginTran(); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, lastStatus, LocationStatusEnum.Lock, LocationChangeType.InboundAssignLocation); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, lastStatus, LocationStatusEnum.Lock, LocationChangeType.InboundAssignLocation,taskNum: taskNum); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, task.PalletType, LocationStatusEnum.Lock, task.WarehouseId); |
| | | BaseDal.UpdateData(task); |
| | | _unitOfWorkManage.CommitTran(); |
| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 空æ¡ååº |
| | | /// æå空æååº |
| | | /// </summary> |
| | | public WebResponseContent EmptyBackTask(string barCode, string startPoint) |
| | | { |
| | |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// è¾
æ(æå)éè´/æåå
¥åº |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent InboundOrderInTask(string bindCode,string barCode,string startPoint, int orderType = 0) |
| | | { |
| | | WebResponseContent content=new WebResponseContent(); |
| | | try |
| | | { |
| | | //è·å主å |
| | | Dt_InboundOrder inboundOrder = BaseDal.Db.Queryable<Dt_InboundOrder>().Where(x => x.OrderType == orderType).Includes(x => x.Details).Where(x => x.Details.Any(v => v.BarCode == bindCode)).First(); |
| | | if (inboundOrder == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°æ¡ç {bindCode}å
¥åºåæ®ä¿¡æ¯"); |
| | | } |
| | | Dt_InboundOrderDetail inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x => x.BarCode == bindCode); |
| | | if (inboundOrderDetail == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°å
¥åºåå·ä¸º{inboundOrder.UpperOrderNo}æ¡ç {bindCode}åæ®ä¿¡æ¯"); |
| | | } |
| | | if (inboundOrderDetail.OrderDetailStatus != InOrderStatusEnum.æªå¼å§.ObjToInt()) |
| | | { |
| | | throw new Exception($"æ¡ç {bindCode}ä¿¡æ¯å·²å
¥åºæå
¥åºä¸"); |
| | | } |
| | | Dt_AGVStationInfo agvstation = _basicRepository.AGVStationInfoRepository.QueryFirst(x => x.AGVStationCode == startPoint); |
| | | if (agvstation == null) |
| | | { |
| | | return content.Error($"èµ·ç¹é误{startPoint}"); |
| | | } |
| | | //夿å½åç¹ä½æ¯å¦éå¤ |
| | | Dt_Task taskOldPoint = BaseDal.QueryFirst(x => x.SourceAddress == startPoint && (x.TaskStatus == TaskStatusEnum.New.ObjToInt() || x.TaskStatus == TaskStatusEnum.AGV_Executing.ObjToInt())); |
| | | if (taskOldPoint != null) |
| | | { |
| | | return content.Error($"ç«ç¹{startPoint}å·²åå¨ä»»å¡"); |
| | | } |
| | | Dt_Task taskOld = BaseDal.QueryFirst(x => x.PalletCode == barCode); |
| | | if (taskOld != null) |
| | | { |
| | | return content.Error($"æç{barCode}ä»»å¡å·²åå¨"); |
| | | } |
| | | Dt_ProStockInfo proStockInfoOld = _stockRepository.ProStockInfoRepository.QueryFirst(x => x.PalletCode == barCode); |
| | | if (proStockInfoOld != null) |
| | | { |
| | | return content.Error($"æç{barCode}å·²åå¨"); |
| | | } |
| | | //åé
å··é |
| | | string roadWay = AssignCPRoadwayNo(); |
| | | //è·åç©æ |
| | | Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x =>x.WarehouseId==inboundOrder.WarehouseId && x.MaterielCode == inboundOrderDetail.MaterialCode); |
| | | Dt_ProStockInfoDetail proStockInfoDetail = new Dt_ProStockInfoDetail() |
| | | { |
| | | ProductCode = materielInfo.MaterielCode, |
| | | ProductNo=bindCode, |
| | | ProductName = materielInfo.MaterielName, |
| | | ProductSpec = materielInfo.MaterielSpec, |
| | | LotNumber = inboundOrderDetail.MaterialLot, |
| | | ProductUnit = materielInfo.MaterielUnit, |
| | | StockQty = inboundOrderDetail.OrderQuantity, |
| | | ProStockDetailStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt() |
| | | }; |
| | | Dt_ProStockInfo proStockInfo = new Dt_ProStockInfo() |
| | | { |
| | | PalletCode = barCode, |
| | | ProStockAttribute = materielInfo.MaterielSourceType, |
| | | PalletType = 1, |
| | | LocationCode = "", |
| | | WarehouseId = materielInfo.WarehouseId, |
| | | StockStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(), |
| | | proStockInfoDetails = new List<Dt_ProStockInfoDetail> { proStockInfoDetail } |
| | | }; |
| | | |
| | | Dt_Task newTask = new Dt_Task() |
| | | { |
| | | CurrentAddress = startPoint, |
| | | Grade = 0, |
| | | NextAddress = "", |
| | | PalletCode = barCode, |
| | | Roadway = roadWay, |
| | | SourceAddress = startPoint, |
| | | TargetAddress = "", |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = inboundOrder.WarehouseId, |
| | | PalletType = 1, |
| | | Remark="åæå
¥åº" |
| | | }; |
| | | inboundOrderDetail.OrderDetailStatus=InOrderStatusEnum.å
¥åºä¸.ObjToInt(); |
| | | _unitOfWorkManage.BeginTran(); |
| | | if (inboundOrder.InboundOrderStatus==InOrderStatusEnum.æªå¼å§.ObjToInt()) |
| | | { |
| | | inboundOrder.InboundOrderStatus = InOrderStatusEnum.å
¥åºä¸.ObjToInt(); |
| | | _inboundRepository.InboundOrderRepository.UpdateData(inboundOrder); |
| | | } |
| | | _inboundRepository.InboundOrderDetailRepository.UpdateData(inboundOrderDetail); |
| | | int taskId = BaseDal.AddData(newTask); |
| | | BaseDal.Db.InsertNav(proStockInfo).Include(x => x.proStockInfoDetails).ExecuteCommand(); |
| | | newTask.TaskId = taskId; |
| | | _unitOfWorkManage.CommitTran(); |
| | | //æ¨éä»»å¡ |
| | | PushTasksToWCS(new List<Dt_Task> { newTask }, "AGV"); |
| | | content.OK("åéæå"); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// å°å·ä½æéæä»»å¡ |
| | |
| | | }; |
| | | TaskTypeEnum taskTypeEnum = CheckPointCode.StationArea switch |
| | | { |
| | | nameof(AGVStationAreaEnum.䏿¥¼å°å·) => TaskTypeEnum.PrintYLInbound, |
| | | nameof(StationAreaEnum.䏿¥¼å°å·) => TaskTypeEnum.PrintYLInbound, |
| | | _ => throw new Exception("æªæ¾å°å¯¹åºä»»å¡") |
| | | }; |
| | | newTask.TaskType = taskTypeEnum.ObjToInt(); |