| | |
| | | using WIDESEA_ITaskInfoService; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_TaskInfoRepository; |
| | | using static WIDESEA_ITaskInfoService.ITaskService; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode); |
| | | //æ¥è´§ä½ |
| | | Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress); |
| | | Dt_StockInfoDetail dt_StockInfodetail = _stockService.StockInfoDetailService.Repository.QueryFirst(x => x.StockId == stockInfo.Id); |
| | | Dt_StockInfoDetail dt_StockInfodetail = _stockService.StockInfoDetailService.Repository.QueryFirst(x => x.OrderNo == task.PalletCode); |
| | | CheckCompleted(stockInfo, locationInfo); |
| | | |
| | | if (stockInfo.MaterialType == (int)InventoryMaterialType.空æ) |
| | | { |
| | | string currentTime = DateTime.Now.ToString("HHmmss"); |
| | | stockInfo.PalletCode = "KTP" + currentTime; |
| | | } |
| | | stockInfo.LocationCode = task.TargetAddress; |
| | | stockInfo.StockStatus = StockStatusEmun.å·²å
¥åº.ObjToInt(); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | dt_StockInfodetail.Status = StockStatusEmun.å·²å
¥åº.ObjToInt(); |
| | | _stockService.StockInfoDetailService.Repository.UpdateData(dt_StockInfodetail); |
| | | |
| | | |
| | | if(dt_StockInfodetail != null) |
| | | { |
| | | dt_StockInfodetail.Status = StockStatusEmun.å·²å
¥åº.ObjToInt(); |
| | | _stockService.StockInfoDetailService.Repository.UpdateData(dt_StockInfodetail); |
| | | } |
| | | beforeQuantity = stockInfo.Details.Where(x => x.Id != 0).Sum(x => x.StockQuantity); |
| | | |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | | locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt(); |
| | | if (stockInfo.MaterialType == (int)InventoryMaterialType.空æ) |
| | | { |
| | | locationInfo.LocationStatus = LocationStatusEnum.Pallet.ObjToInt(); |
| | | } |
| | | else |
| | | { |
| | | locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt(); |
| | | } |
| | | _basicService.LocationInfoService.UpdateLocationFree(locationInfo, task.TaskNum, StockChangeType.Inbound.ObjToInt(), false); |
| | | |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | |
| | | return (false, "æªæ¾å°è´§ä½ä¿¡æ¯"); |
| | | } |
| | | |
| | | if (isCheckStockDetail && (stockInfo.Details == null || stockInfo.Details.Count == 0)) |
| | | /*if (isCheckStockDetail && (stockInfo.Details == null || stockInfo.Details.Count == 0)) |
| | | { |
| | | return (false, "æªæ¾å°ç»çæç»ä¿¡æ¯"); |
| | | } |
| | | }*/ |
| | | |
| | | return (true, "æå"); |
| | | } |
| | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | public WebResponseContent RelocationTaskCompleted(string PalletCode,string SourceAddress, string TargetAddress) |
| | | public WebResponseContent RelocationTaskCompleted(GenerateInv2 generate) |
| | | { |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(PalletCode); |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(generate.PalletCode); |
| | | |
| | | Dt_LocationInfo locationpoint = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == SourceAddress); |
| | | Dt_LocationInfo locationEnd = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == TargetAddress); |
| | | Dt_LocationInfo locationpoint = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == generate.SourceAddress); |
| | | Dt_LocationInfo locationEnd = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == generate.TargetAddress); |
| | | List<Dt_LocationInfo> loca = new List<Dt_LocationInfo>(); |
| | | |
| | | stockInfo.LocationCode = locationEnd.LocationCode; |