|  |  |  | 
|---|
|  |  |  | using Newtonsoft.Json; | 
|---|
|  |  |  | using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; | 
|---|
|  |  |  | using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup; | 
|---|
|  |  |  | using Org.BouncyCastle.Asn1.Ocsp; | 
|---|
|  |  |  | using SqlSugar; | 
|---|
|  |  |  | using System; | 
|---|
|  |  |  | using System.Collections; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | stockInfoDetails.Add(stockInfoDetail); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | notGroupDetail.ReceiptQuantity += model.Quantity; | 
|---|
|  |  |  | if (notGroupDetail.ReceiptQuantity>notGroupDetail.OrderQuantity) | 
|---|
|  |  |  | decimal decimalReceiptQuantity = Convert.ToDecimal(notGroupDetail.ReceiptQuantity); | 
|---|
|  |  |  | decimal decimalModelQuantity = Convert.ToDecimal(model.Quantity); | 
|---|
|  |  |  | decimal decimalOrderQuantity = Convert.ToDecimal(notGroupDetail.OrderQuantity); | 
|---|
|  |  |  | decimalReceiptQuantity += decimalModelQuantity; | 
|---|
|  |  |  | // æ£æ¥æ¯å¦è¶
åºè®¢åæ°é | 
|---|
|  |  |  | if (decimalReceiptQuantity > decimalOrderQuantity) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return WebResponseContent.Instance.Error($"ç»çæ°é溢åº{notGroupDetail.ReceiptQuantity - notGroupDetail.OrderQuantity}"); | 
|---|
|  |  |  | return WebResponseContent.Instance.Error($"ç»çæ°é溢åº{decimalReceiptQuantity - decimalOrderQuantity}"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // è½¬åfloatç±»ååå¨ï¼ä½æ¯è¾å计ç®é½ä½¿ç¨decimal宿 | 
|---|
|  |  |  | notGroupDetail.ReceiptQuantity = Convert.ToSingle(decimalReceiptQuantity); | 
|---|
|  |  |  | if (notGroupDetail.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt()) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | notGroupDetail.OrderDetailStatus = OrderDetailStatusEnum.GroupAndInbound.ObjToInt(); | 
|---|
|  |  |  | 
|---|
|  |  |  | WebResponseContent content = new WebResponseContent(); | 
|---|
|  |  |  | try | 
|---|
|  |  |  | { | 
|---|
|  |  |  | string SerNum = materielBoxCode.Substring(0, materielBoxCode.LastIndexOf("SC:")-1); | 
|---|
|  |  |  | string SerNum = ""; | 
|---|
|  |  |  | if (materielBoxCode.LastIndexOf("SC:")<0) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | SerNum = materielBoxCode; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else | 
|---|
|  |  |  | { | 
|---|
|  |  |  | SerNum = materielBoxCode.Substring(0, materielBoxCode.LastIndexOf("SC:") - 1); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | MatSerNumAnalysisModel model = CodeAnalysisHelper.CodeAnalysis<MatSerNumAnalysisModel>(AnalysisCodeEnum.MatSerNumAnalysis, SerNum); | 
|---|
|  |  |  | //éªè¯å¤ææ¶é´æ ¼å¼ | 
|---|
|  |  |  | WebResponseContent IsValidContent = IsValidMCDates(new List<MatSerNumAnalysisModel>() { model }); | 
|---|
|  |  |  | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return content.Error(IsValidContent.Message); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | string result = materielBoxCode.Substring(materielBoxCode.LastIndexOf("SC:") + 3); | 
|---|
|  |  |  | string result = ""; | 
|---|
|  |  |  | if (materielBoxCode.LastIndexOf("SC:") > 0) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | result = materielBoxCode.Substring(materielBoxCode.LastIndexOf("SC:") + 3); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //è·åå
¥åºåæç» | 
|---|
|  |  |  | Dt_InboundOrderDetail inboundOrderDetail = _inboundRepository.InboundOrderDetailRepository.QueryFirst(x=>x.BatchNo== model.LotNo && x.MaterielCode== model.MaterielCode); | 
|---|
|  |  |  | if (inboundOrderDetail == null) | 
|---|
|  |  |  | 
|---|
|  |  |  | PalletCode = model.LotNo, | 
|---|
|  |  |  | StockStatus = StockStatusEmun.ç»çæå.ObjToInt(), | 
|---|
|  |  |  | WarehouseId = inboundOrder.WarehouseId, | 
|---|
|  |  |  | PalletType = GetPalletTypeGMOrPP(warehouse, result.Split("*")[0]), | 
|---|
|  |  |  | StockLength = result.Split("*")[0].ObjToInt(), | 
|---|
|  |  |  | PalletType = GetPalletTypeGMOrPP(warehouse, result.IsNullOrEmpty() ? "" : result.Split("*")[0]), | 
|---|
|  |  |  | StockLength = result.IsNullOrEmpty() ? 0 : result.Split("*")[0].ObjToInt(), | 
|---|
|  |  |  | Details = new List<Dt_StockInfoDetail>() | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | PalletCode = model.LotNo, | 
|---|
|  |  |  | StockStatus = StockStatusEmun.ç»çæå.ObjToInt(), | 
|---|
|  |  |  | WarehouseId = warehouse.WarehouseId, | 
|---|
|  |  |  | PalletType = GetPalletTypeGMOrPP(warehouse, request.Split("*")[0]), | 
|---|
|  |  |  | StockLength = request.Split("*")[0].ObjToInt(), | 
|---|
|  |  |  | PalletType = GetPalletTypeGMOrPP(warehouse, request.IsNullOrEmpty() ?"":request.Split("*")[0]), | 
|---|
|  |  |  | StockLength = request.IsNullOrEmpty()?0:request.Split("*")[0].ObjToInt(), | 
|---|
|  |  |  | Details = new List<Dt_StockInfoDetail>() | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | if (warehouse.WarehouseCode == WarehouseEnum.HA152.ToString()) | 
|---|
|  |  |  | { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (boxWidth.ObjToInt() <= 690 && boxWidth.ObjToInt()>=515) | 
|---|
|  |  |  | if (boxWidth.ObjToInt() <= 690 && boxWidth.ObjToInt()>=520) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return 15; | 
|---|
|  |  |  | } | 
|---|