| | |
| | | //} |
| | | if (workTpe.Equals("In")) |
| | | { |
| | | task = BaseDal.QueryData(v => v.TaskType == (int)TaskInboundTypeEnum.Inbound && v.TaskState == (int)TaskInStatusEnum.InNew).OrderByDescending(v => v.Grade).OrderBy(v => v.CreateDate).First(); |
| | | task = BaseDal.QueryData(v => (v.TaskType == (int)TaskInboundTypeEnum.TiChuRuKu || v.TaskType == (int)TaskInboundTypeEnum.Inbound) && v.TaskState == (int)TaskInStatusEnum.InNew).OrderByDescending(v => v.Grade).OrderBy(v => v.CreateDate).First(); |
| | | } |
| | | else if (workTpe.Equals("Out")) |
| | | { |
| | | task = BaseDal.QueryData(v => (v.TaskType == (int)TaskOutboundTypeEnum.Outbound || v.TaskType == (int)TaskOutboundTypeEnum.OutInventory) && v.TaskState == (int)TaskOutStatusEnum.OutNew).OrderBy(v => v.CreateDate).First(); |
| | | task = BaseDal.QueryData(v => (v.TaskType == (int)TaskOutboundTypeEnum.TiChuChuKu || v.TaskType == (int)TaskOutboundTypeEnum.TiChuZhiJieChuKu || v.TaskType == (int)TaskOutboundTypeEnum.Outbound || v.TaskType == (int)TaskOutboundTypeEnum.OutInventory) && v.TaskState == (int)TaskOutStatusEnum.OutNew).OrderBy(v => v.CreateDate).First(); |
| | | } |
| | | |
| | | } |
| | |
| | | try |
| | | { |
| | | Dt_Task task = BaseDal.QueryFirst(x => x.TaskId == taskNum); |
| | | if (status == 2 && task.TaskType == (int)TaskInboundTypeEnum.Inbound) |
| | | if (status == 2 && (task.TaskType == (int)TaskInboundTypeEnum.Inbound || task.TaskType == (int)TaskInboundTypeEnum.TiChuRuKu)) |
| | | { |
| | | task.TaskState = (int)TaskInStatusEnum.Line_InGrabExecuting; |
| | | } |
| | | else if (status == 2 && (task.TaskType == (int)TaskOutboundTypeEnum.Outbound || task.TaskType == (int)TaskOutboundTypeEnum.OutInventory)) |
| | | else if (status == 2 && (task.TaskType == (int)TaskOutboundTypeEnum.Outbound || task.TaskType == (int)TaskOutboundTypeEnum.OutInventory || task.TaskType == (int)TaskOutboundTypeEnum.TiChuChuKu || task.TaskType == (int)TaskOutboundTypeEnum.TiChuZhiJieChuKu)) |
| | | { |
| | | task.TaskState = (int)TaskOutStatusEnum.Line_OutGrabExecuting; |
| | | } |
| | | else if (status == 3 && task.TaskType == (int)TaskInboundTypeEnum.Inbound) |
| | | else if (status == 3 && (task.TaskType == (int)TaskInboundTypeEnum.Inbound || task.TaskType == (int)TaskInboundTypeEnum.TiChuRuKu)) |
| | | { |
| | | task.TaskState = (int)TaskInStatusEnum.Line_InDownExecuting; |
| | | } |
| | | else if (status == 3 && (task.TaskType == (int)TaskOutboundTypeEnum.Outbound || task.TaskType == (int)TaskOutboundTypeEnum.OutInventory)) |
| | | else if (status == 3 && (task.TaskType == (int)TaskOutboundTypeEnum.Outbound || task.TaskType == (int)TaskOutboundTypeEnum.OutInventory || task.TaskType == (int)TaskOutboundTypeEnum.TiChuChuKu || task.TaskType == (int)TaskOutboundTypeEnum.TiChuZhiJieChuKu)) |
| | | { |
| | | task.TaskState = (int)TaskOutStatusEnum.Line_OutWownExecuting; |
| | | } |
| | |
| | | throw new Exception(string.Format("天车æ¾è´§å®æä»»å¡æªæ¥è¯¢å°ä»»å¡å·{0}", taskNum)); |
| | | } |
| | | |
| | | if (nawtask.TaskType == (int)TaskInboundTypeEnum.Inbound) |
| | | if (nawtask.TaskType == (int)TaskInboundTypeEnum.Inbound || nawtask.TaskType == (int)TaskInboundTypeEnum.TiChuRuKu) |
| | | { |
| | | var station = _dt_stationInfoRepository.QueryFirst(v => v.msg == "å餿¶"); |
| | | string sourceAddress = station.Row + "-" + station.Column + "-1"; |
| | |
| | | _unitOfWorkManage.CommitTran(); |
| | | } |
| | | } |
| | | else if (nawtask.TaskType == (int)TaskOutboundTypeEnum.Outbound) |
| | | else if (nawtask.TaskType == (int)TaskOutboundTypeEnum.Outbound || nawtask.TaskType == (int)TaskOutboundTypeEnum.TiChuChuKu) |
| | | { |
| | | var station = _dt_stationInfoRepository.QueryFirst(v => v.msg == "西跨æ¶å"); |
| | | string targetAddress = station.Row + "-" + station.Column + "-1"; |
| | |
| | | taskhty.PalletCode = nawtask.PalletCode; |
| | | taskhty.NextAddress = nawtask.NextAddress; |
| | | taskhty.CurrentAddress = nawtask.CurrentAddress; |
| | | //å¼å§æ°æ®åºäºå¡ |
| | | |
| | | //妿æ¾è´§ä½ç½®è¡æ¯40ï¼åç«é©¬çæä¸æ¡ç§»å¨ä»»å¡ |
| | | //å¼å§åå»ºä»»å¡ |
| | | Dt_Task Movstask = new Dt_Task(); |
| | | Movstask.Roadway = "TC01"; |
| | | Movstask.TaskType = (int)TaskMoveEnum.Mowe; |
| | | Movstask.TaskState = (int)TaskMoveStatusEnum.OutNewMove; |
| | | Movstask.SourceAddress = "0"; |
| | | Movstask.TargetAddress = "8-5-1"; |
| | | Movstask.NextAddress = "text"; |
| | | Movstask.Grade = 1; |
| | | Movstask.WMSId = 3; |
| | | Movstask.Remark = 0; |
| | | Movstask.PalletCode = "text"; |
| | | Movstask.CurrentAddress = "text"; |
| | | |
| | | //å¼å§æ°æ®åºäºå¡ |
| | | BaseDal.AddData(Movstask); |
| | | _unitOfWorkManage.BeginTran(); |
| | | _stockRepository.DeleteData(stock); |
| | | _locationRepository.UpdateData(location); |
| | |
| | | _unitOfWorkManage.CommitTran(); |
| | | } |
| | | } |
| | | else if (nawtask.TaskType == (int)TaskOutboundTypeEnum.OutInventory || nawtask.TaskType == (int)TaskMoveEnum.Mowe) |
| | | else if (nawtask.TaskType == (int)TaskOutboundTypeEnum.OutInventory || nawtask.TaskType == (int)TaskMoveEnum.Mowe || nawtask.TaskType == (int)TaskOutboundTypeEnum.TiChuZhiJieChuKu) |
| | | { |
| | | //å¤çä»»å¡ä¿¡æ¯ |
| | | Dt_Task_hty taskhty = new Dt_Task_hty(); |
| | |
| | | taskhty.PalletCode = nawtask.PalletCode; |
| | | taskhty.NextAddress = nawtask.NextAddress; |
| | | taskhty.CurrentAddress = nawtask.CurrentAddress; |
| | | if (nawtask.TaskType == (int)TaskOutboundTypeEnum.OutInventory) |
| | | if (nawtask.TaskType == (int)TaskOutboundTypeEnum.OutInventory || nawtask.TaskType == (int)TaskOutboundTypeEnum.TiChuZhiJieChuKu) |
| | | { |
| | | //å¼å§åå»ºä»»å¡ |
| | | Dt_Task Movstask = new Dt_Task(); |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | Dt_Task nawtask = BaseDal.QueryFirst(v => v.TaskId == taskid); |
| | | //å
¥åº |
| | | if (nawtask.TaskType == (int)TaskInboundTypeEnum.Inbound) |
| | | if (nawtask.TaskType == (int)TaskInboundTypeEnum.Inbound || nawtask.TaskType == (int)TaskInboundTypeEnum.TiChuRuKu) |
| | | { |
| | | //åé¤å
¥åº |
| | | var station = _dt_stationInfoRepository.QueryFirst(v => v.msg == "å餿¶"); |
| | |
| | | } |
| | | } |
| | | //åºåº |
| | | else if (nawtask.TaskType == (int)TaskOutboundTypeEnum.Outbound) |
| | | else if (nawtask.TaskType == (int)TaskOutboundTypeEnum.Outbound || nawtask.TaskType == (int)TaskOutboundTypeEnum.TiChuChuKu) |
| | | { |
| | | //åé¤åºåº |
| | | var station = _dt_stationInfoRepository.QueryFirst(v => v.msg == "西跨æ¶å"); |
| | |
| | | location.LocationStatus = (int)LocationStatusEnum.Free; |
| | | //ä¿®æ¹è´§ä½ç¶æ |
| | | var locationTow = _locationRepository.QueryFirst(v => v.LocationCode == nawtask.NextAddress); |
| | | if (locationTow!=null) |
| | | { |
| | | locationTow.LocationStatus = (int)LocationStatusEnum.Free; |
| | | } |
| | | //åå¤åå²ä»»å¡æ°æ® |
| | | Dt_Task_hty taskhty = new Dt_Task_hty(); |
| | | taskhty.TaskNum = nawtask.TaskNum; |
| | |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | _stockRepository.DeleteData(stock); |
| | | _stockRepository.DeleteData(Towstock); |
| | | _locationRepository.UpdateData(location); |
| | | if (locationTow != null) |
| | | { |
| | | _locationRepository.UpdateData(locationTow); |
| | | _stockRepository.DeleteData(Towstock); |
| | | } |
| | | _taskhtyRepository.AddData(taskhty); |
| | | BaseDal.DeleteData(nawtask); |
| | | //æäº¤äºå¡ |
| | |
| | | location.LocationStatus = (int)LocationStatusEnum.InStock; |
| | | //ä¿®æ¹è´§ä½ä¿¡æ¯ |
| | | var locationtow = _locationRepository.QueryFirst(v => v.LocationCode == task.NextAddress); |
| | | locationtow.LocationStatus = (int)LocationStatusEnum.InStock; |
| | | Dt_StockInfo stockInfos = _stockRepository.QueryFirst(v => v.LocationCode == task.NextAddress); |
| | | |
| | | if (locationtow != null) |
| | | { |
| | | locationtow.LocationStatus = (int)LocationStatusEnum.InStock; |
| | | stockInfos.StockStatus = (int)stockEnum.Free; |
| | | } |
| | | Dt_StockInfo stockInfo = _stockRepository.QueryFirst(v => v.LocationCode == task.SourceAddress); |
| | | stockInfo.StockStatus = (int)stockEnum.Free; |
| | | Dt_StockInfo stockInfos = _stockRepository.QueryFirst(v => v.LocationCode == task.NextAddress); |
| | | stockInfos.StockStatus = (int)stockEnum.Free; |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | _locationRepository.UpdateData(location); |
| | | if (locationtow != null) |
| | | { |
| | | _locationRepository.UpdateData(locationtow); |
| | | _stockRepository.UpdateData(stockInfo); |
| | | _stockRepository.UpdateData(stockInfos); |
| | | } |
| | | _stockRepository.UpdateData(stockInfo); |
| | | BaseDal.DeleteData(task); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK("5"); |
| | |
| | | } |
| | | return content.OK("1"); |
| | | } |
| | | |
| | | public WebResponseContent zhijiechuku() |
| | | { |
| | | Dt_Task task = new Dt_Task(); |
| | | WebResponseContent content = new WebResponseContent(); |
| | | var isout = _outStockRepository.QueryFirst(v => v.Id == 1); |
| | | if (isout.isout == 0) |
| | | { |
| | | var oldtask = _dt_taskRepositiry.QueryFirst(v => v.TaskType == (int)TaskOutboundTypeEnum.Outbound); |
| | | if (oldtask != null) |
| | | { |
| | | throw new Exception($"å½å任塿± ä¸å·²åå¨ä¸æ¡åºåºä»»å¡"); |
| | | } |
| | | var station = _dt_stationInfoRepository.QueryFirst(v => v.msg == "西跨æ¶å"); |
| | | task.TargetAddress = station.Row + "-" + station.Column + "-1"; |
| | | var stations = _dt_stationInfoRepository.QueryFirst(v => v.msg == "å餿¶"); |
| | | task.SourceAddress = stations.Row + "-" + stations.Column + "-1"; |
| | | var oldhtytask = _dt_taskRepositiry.QueryFirst(v => v.SourceAddress == task.SourceAddress); |
| | | if (oldhtytask == null) |
| | | { |
| | | task.Grade = 3; |
| | | task.Remark = (int)MateTypeEnum.ZiChan; |
| | | task.NextAddress = "text"; |
| | | task.Roadway = "TC01"; |
| | | task.TaskType = (int)TaskOutboundTypeEnum.TiChuZhiJieChuKu; |
| | | task.TaskState = (int)TaskOutStatusEnum.OutNew; |
| | | task.PalletCode = "text"; |
| | | task.CurrentAddress = "text"; |
| | | task.WMSId = 2; |
| | | _dt_taskRepositiry.AddData(task); |
| | | return content.OK("2"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return content.OK("1"); |
| | | } |
| | | return content.OK("3"); |
| | | } |
| | | |
| | | public WebResponseContent tichuchuku(string wei) |
| | | { |
| | | Dt_Task task = new Dt_Task(); |
| | | WebResponseContent content = new WebResponseContent(); |
| | | //if (!OHTJob.oHTReadData.R_TCMode && !OHTJob.oHTReadData.R_TC_isready) |
| | | //{ |
| | | // throw new Exception($"è§æ´æºå餿¶å坿¾æ¿æåé¤ä¸ææ¨¡å¼ä¿¡å·ä¸ºfalse"); |
| | | //} |
| | | //æ¥è¯¢å½å任塿± 䏿¯å¦åå¨åºåºä»»å¡ï¼åºåºä»»å¡åªè½åå¨ä¸æ¡ |
| | | var isout = _outStockRepository.QueryFirst(v => v.Id == 1); |
| | | if (isout.isout == 0) |
| | | { |
| | | var oldtask = _dt_taskRepositiry.QueryFirst(v => v.TaskType == (int)TaskOutboundTypeEnum.Outbound); |
| | | if (oldtask != null) |
| | | { |
| | | throw new Exception($"å½å任塿± ä¸å·²åå¨ä¸æ¡åºåºä»»å¡"); |
| | | } |
| | | //æ¥è¯¢åºå |
| | | Dt_LocationInfo huo = _LocationInfoRepository.QueryFirst(v => v.LocationCode == wei); |
| | | if (huo.LocationStatus == 0) |
| | | { |
| | | return content.OK("4"); |
| | | } |
| | | huo.LocationStatus = 1; |
| | | Dt_StockInfo stockinfo = _StockInfoRepository.QueryFirst(v => v.LocationCode == wei); |
| | | if (stockinfo==null) |
| | | { |
| | | return content.OK("4"); |
| | | } |
| | | stockinfo.StockStatus = 1; |
| | | var station = _dt_stationInfoRepository.QueryFirst(v => v.msg == "西跨æ¶å"); |
| | | task.TargetAddress = station.Row + "-" + station.Column + "-1"; |
| | | var oldhtytask = _dt_taskRepositiry.QueryFirst(v => v.SourceAddress == task.SourceAddress); |
| | | if (oldhtytask == null) |
| | | { |
| | | task.SourceAddress = wei; |
| | | task.Grade = 3; |
| | | task.Remark = (int)MateTypeEnum.ZiChan; |
| | | task.NextAddress = "text"; |
| | | task.Roadway = "TC01"; |
| | | task.TaskType = (int)TaskOutboundTypeEnum.TiChuChuKu; |
| | | task.TaskState = (int)TaskOutStatusEnum.OutNew; |
| | | task.PalletCode = "text"; |
| | | task.CurrentAddress = "text"; |
| | | task.WMSId = 2; |
| | | _unitOfWorkManage.BeginTran(); |
| | | _dt_taskRepositiry.AddData(task); |
| | | _LocationInfoRepository.UpdateData(huo); |
| | | _StockInfoRepository.UpdateData(stockinfo); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK("2"); |
| | | } |
| | | } |
| | | return content.OK("3"); |
| | | } |
| | | |
| | | public WebResponseContent tichuruku(string wei) |
| | | { |
| | | Dt_Task task = new Dt_Task(); |
| | | WebResponseContent content = new WebResponseContent(); |
| | | //if (!OHTJob.oHTReadData.R_ZXJ_isWork) |
| | | //{ |
| | | // throw new Exception($"æ´å½¢æºæå
¥ä½¿ç¨ä¿¡å·ä¸ºfalse"); |
| | | //} |
| | | var isout = _outStockRepository.QueryFirst(v => v.Id == 1); |
| | | if (isout.isout == 0) |
| | | { |
| | | //夿åºåæ¯å¦æè´§ |
| | | //æ¥è¯¢è´§ä½ |
| | | Dt_LocationInfo huo = _LocationInfoRepository.QueryFirst(v => v.LocationCode == wei); |
| | | if (huo.LocationStatus!=0) |
| | | { |
| | | return content.OK("4"); |
| | | } |
| | | huo.LocationStatus = 1; |
| | | var station = _dt_stationInfoRepository.QueryFirst(v => v.msg == "å餿¶"); |
| | | task.SourceAddress = station.Row + "-" + station.Column + "-1"; |
| | | var oldhtytask = _dt_taskRepositiry.QueryFirst(v => v.SourceAddress == task.SourceAddress); |
| | | if (oldhtytask == null) |
| | | { |
| | | task.TargetAddress = wei; |
| | | task.Grade = 3; |
| | | task.Remark = (int)MateTypeEnum.ZiChan; |
| | | task.NextAddress = "text"; |
| | | task.Roadway = "TC01"; |
| | | task.TaskType = (int)TaskInboundTypeEnum.TiChuRuKu; |
| | | task.TaskState = (int)TaskInStatusEnum.InNew; |
| | | task.PalletCode = "text"; |
| | | task.CurrentAddress = "text"; |
| | | task.WMSId = 2; |
| | | _unitOfWorkManage.BeginTran(); |
| | | _dt_taskRepositiry.AddData(task); |
| | | _LocationInfoRepository.UpdateData(huo); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK("2"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return content.OK("1"); |
| | | } |
| | | return content.OK("3"); |
| | | } |
| | | } |
| | | } |