Merge branch 'master' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu
| | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 鎵ц鎵嬪姩鎷嗗寘閫昏緫 - 淇鐗堟湰 |
| | | /// 鎵ц鎵嬪姩鎷嗗寘閫昏緫 |
| | | /// </summary> |
| | | private async Task<List<SplitResult>> ExecuteManualSplitLogic(Dt_OutStockLockInfo lockInfo, Dt_StockInfoDetail stockDetail, |
| | | decimal splitQuantity, string palletCode) |
| | |
| | | MaterielCode = stockDetail.MaterielCode, |
| | | OrderNo = stockDetail.OrderNo, |
| | | BatchNo = stockDetail.BatchNo, |
| | | StockQuantity = newStockQuantity, // 淇锛氫娇鐢ㄦ纭殑鎷嗗寘鏁伴噺 |
| | | OutboundQuantity = 0, // 鏂版潯鐮佸垵濮嬪嚭搴撴暟閲忎负0 |
| | | StockQuantity = newStockQuantity, |
| | | OutboundQuantity = 0, |
| | | Barcode = newBarcode, |
| | | Status = (int)StockStatusEmun.鍑哄簱閿佸畾, |
| | | SupplyCode = stockDetail.SupplyCode, |
| | |
| | | // 鎵ц鑷姩鎷嗗寘 |
| | | var splitResult = await ExecuteAutoSplitLogic(lockInfo, stockDetail, splitQuantity, palletCode); |
| | | |
| | | // 灏嗘媶鍖呮暟閲忎紶閫掔粰璋冪敤鏂癸紝鐢ㄤ簬楠岃瘉 |
| | | if (splitResult != null && splitResult.Any()) |
| | | { |
| | | // 鍦ㄨ繑鍥炵粨鏋滀腑鎼哄甫鎷嗗寘鏁伴噺淇℃伅 |
| | | foreach (var result in splitResult) |
| | | { |
| | | result.quantityTotal = splitQuantity.ToString("F2"); |
| | | } |
| | | } |
| | | |
| | | return splitResult; |
| | | } |
| | | |
| | |
| | | await RecordSplitHistory(lockInfo, stockDetail, splitQuantity, newBarcode, true, originalStockQty); |
| | | |
| | | // 鍒涘缓鎷嗗寘缁撴灉鍒楄〃 |
| | | var splitResults = CreateSplitResults(lockInfo, splitQuantity, lockInfo.AssignQuantity, newBarcode, stockDetail.Barcode); |
| | | var splitResults = CreateSplitResults(lockInfo, splitQuantity, stockDetail.StockQuantity, newBarcode, stockDetail.Barcode); |
| | | |
| | | _logger.LogInformation($"鑷姩鎷嗗寘閫昏緫鎵ц瀹屾垚 - 鍒涘缓浜嗘湭鍒嗛厤鐨勫簱瀛樺拰閿佸畾璁板綍"); |
| | | |
| | |
| | | |
| | | allocatefeedmodel.Details.Add(detailModel); |
| | | } |
| | | var groupedResult = allocatefeedmodel.Details.GroupBy(item => new |
| | | { |
| | | item.WarehouseCode, |
| | | item.MaterialCode, |
| | | item.Unit, |
| | | item.LineNo |
| | | }).Select(group => new AllocateDtoDetail |
| | | { |
| | | WarehouseCode = group.Key.WarehouseCode, |
| | | MaterialCode = group.Key.MaterialCode, |
| | | LineNo = group.Key.LineNo, |
| | | Qty = group.Sum(x => x.Qty), |
| | | Unit = group.Key.Unit, |
| | | Barcodes = group.SelectMany(x => x.Barcodes) |
| | | .GroupBy(b => b.Barcode) |
| | | .Select(b => new BarcodeInfo |
| | | { |
| | | Barcode = b.Key, |
| | | BatchNo = b.First().BatchNo, |
| | | SupplyCode = b.First().SupplyCode, |
| | | Qty = b.Max(x => x.Qty), |
| | | Unit = b.First().Unit |
| | | }) .ToList() |
| | | }) .ToList(); |
| | | allocatefeedmodel.Details = groupedResult; |
| | | |
| | | var result = await _invokeMESService.FeedbackAllocate(allocatefeedmodel); |
| | | if (result != null && result.code == 200) |
| | |
| | | } |
| | | feedmodel.details.Add(detailModel); |
| | | } |
| | | var groupedResult = feedmodel.details.GroupBy(item => new |
| | | { |
| | | item.warehouseCode, |
| | | item.materialCode, |
| | | item.unit, |
| | | item.lineNo |
| | | }).Select(group => new FeedbackOutboundDetailsModel |
| | | { |
| | | warehouseCode = group.Key.warehouseCode, |
| | | materialCode = group.Key.materialCode, |
| | | lineNo = group.Key.lineNo, |
| | | qty = group.Sum(x => x.qty), |
| | | unit = group.Key.unit, |
| | | barcodes = group.SelectMany(x => x.barcodes) |
| | | .GroupBy(b => b.barcode) |
| | | .Select(b => new WIDESEA_DTO.Outbound.BarcodesModel |
| | | { |
| | | barcode = b.Key, |
| | | batchNo = b.First().batchNo, |
| | | supplyCode = b.First().supplyCode, |
| | | qty = b.Max(x => x.qty), |
| | | unit = b.First().unit |
| | | }).ToList() |
| | | }).ToList(); |
| | | feedmodel.details = groupedResult; |
| | | |
| | | var result = await _invokeMESService.FeedbackOutbound(feedmodel); |
| | | if (result != null && result.code == 200) |
| | |
| | | [HttpPost, Route("Test"), AllowAnonymous, MethodParamsValidate] |
| | | public async Task<WebResponseContent> Test() |
| | | { |
| | | |
| | | //var originalTask = _taskRepository.Db.Queryable<Dt_Task>().First(); |
| | | |
| | | //var result = _task_HtyService.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.浜哄伐鍒犻櫎); |
| | |
| | | //var ddddssss = "WSLOT" + DateTime.Now.ToString("yyyyMMddHHmmss") + ssss.ToString().PadLeft(5, '0'); |
| | | //erpApiService.GetSuppliersAsync(); |
| | | |
| | | erpApiService.GetMaterialUnitAsync(); |
| | | // erpApiService.GetMaterialUnitAsync(); |
| | | |
| | | //var sss = await _invokeMESService.NewMaterielToMes(new WIDESEA_DTO.Basic.MaterielToMesDTO |
| | | //{ |