| | |
| | | private readonly Idt_ErrormsginfoService _ErrormsginfoService; |
| | | private readonly IMapper _mapper; |
| | | private readonly IRepository<dt_stationInfo> _dt_stationInfoRepository; |
| | | private readonly IRepository<Dt_Task> _dt_taskRepositiry; |
| | | private readonly IRepository<Dt_LocationInfo> _LocationInfoRepository; |
| | | private readonly IRepository<Dt_StockInfo> _StockInfoRepository; |
| | | private readonly IRepository<dt_batchInfo> _batchInfoRepository; |
| | | private readonly IRepository<dt_outstockinfo> _outStockRepository; |
| | | |
| | | private Dictionary<string, OrderByType> _taskOrderBy = new() |
| | | { |
| | |
| | | IRepository<Dt_Task_hty> taskhtyRepository, |
| | | IRepository<dt_errormsgInfo> errorinfoRepository, |
| | | IRepository<dt_stationInfo> dt_stationInfoRepository, |
| | | IRepository<Dt_Task> dt_taskRepositiry, |
| | | Idt_ErrormsginfoService errormsginfoService, |
| | | IUnitOfWorkManage unitOfWorkManage, |
| | | IRepository<Dt_StockInfo> StockInfoRepository, |
| | | IRepository<dt_batchInfo> batchInfoRepository, |
| | | IRepository<Dt_LocationInfo> LocationInfoRepository, |
| | | IRepository<dt_outstockinfo> outStockRepository, |
| | | IMapper mapper) : base(BaseDal) |
| | | { |
| | | _routerService = routerService; |
| | |
| | | _ErrormsginfoService = errormsginfoService; |
| | | _mapper = mapper; |
| | | _dt_stationInfoRepository = dt_stationInfoRepository; |
| | | _dt_taskRepositiry = dt_taskRepositiry; |
| | | _StockInfoRepository = StockInfoRepository; |
| | | _LocationInfoRepository = LocationInfoRepository; |
| | | _batchInfoRepository = batchInfoRepository; |
| | | _outStockRepository = outStockRepository; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | Movstask.TaskType = (int)TaskMoveEnum.Mowe; |
| | | Movstask.TaskState = (int)TaskMoveStatusEnum.OutNewMove; |
| | | Movstask.SourceAddress = "0"; |
| | | Movstask.TargetAddress = "1-5-1"; |
| | | Movstask.TargetAddress = "8-5-1"; |
| | | Movstask.NextAddress = "text"; |
| | | Movstask.Grade = 1; |
| | | Movstask.WMSId = 3; |
| | |
| | | Movstask.TaskType = (int)TaskMoveEnum.Mowe; |
| | | Movstask.TaskState = (int)TaskMoveStatusEnum.OutNewMove; |
| | | Movstask.SourceAddress = "0"; |
| | | Movstask.TargetAddress = "1-5-1"; |
| | | Movstask.TargetAddress = "8-5-1"; |
| | | Movstask.NextAddress = "text"; |
| | | Movstask.Grade = 1; |
| | | Movstask.WMSId = 3; |
| | |
| | | } |
| | | return content.OK("宿"); |
| | | } |
| | | |
| | | public WebResponseContent speciadelete(Dt_Task task) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | if (task.TaskState == (int)TaskMoveStatusEnum.OutNewMove) |
| | | { |
| | | BaseDal.DeleteData(task); |
| | | } |
| | | else if (task.TaskState == (int)TaskInStatusEnum.InNew) |
| | | { |
| | | //åé¤å
¥åº |
| | | var station = _dt_stationInfoRepository.QueryFirst(v => v.msg == "å餿¶"); |
| | | string sourceAddress = station.Row + "-" + station.Column + "-1"; |
| | | if (task.SourceAddress.Equals(sourceAddress)) |
| | | { |
| | | Dt_LocationInfo locationinfo = _locationRepository.QueryFirst(v => v.LocationCode == task.TargetAddress); |
| | | locationinfo.LocationStatus = 0; |
| | | _unitOfWorkManage.BeginTran(); |
| | | _locationRepository.UpdateData(locationinfo); |
| | | BaseDal.DeleteData(task); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK("2"); |
| | | } |
| | | else |
| | | { |
| | | //ä¿®æ¹è´§ä½ä¿¡æ¯ |
| | | var location = _locationRepository.QueryFirst(v => v.LocationCode == task.TargetAddress); |
| | | location.LocationStatus = (int)LocationStatusEnum.Free; |
| | | //ä¿®æ¹è´§ä½ä¿¡æ¯ |
| | | var locationtow = _locationRepository.QueryFirst(v => v.LocationCode == task.NextAddress); |
| | | locationtow.LocationStatus = (int)LocationStatusEnum.Free; |
| | | _unitOfWorkManage.BeginTran(); |
| | | _locationRepository.UpdateData(location); |
| | | _locationRepository.UpdateData(locationtow); |
| | | BaseDal.DeleteData(task); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK("3"); |
| | | } |
| | | } |
| | | else if (task.TaskState == (int)TaskOutStatusEnum.OutNew) |
| | | { |
| | | //åé¤åºåº |
| | | var station = _dt_stationInfoRepository.QueryFirst(v => v.msg == "西跨æ¶å"); |
| | | string targetAddress = station.Row + "-" + station.Column + "-1"; |
| | | if (task.TargetAddress.Equals(targetAddress)) |
| | | { |
| | | //ä¿®æ¹è´§ä½ä¿¡æ¯ |
| | | var location = _locationRepository.QueryFirst(v => v.LocationCode == task.SourceAddress); |
| | | location.LocationStatus = (int)LocationStatusEnum.InStock; |
| | | Dt_StockInfo stockInfo = _stockRepository.QueryFirst(v => v.LocationCode == task.SourceAddress); |
| | | stockInfo.StockStatus = (int)stockEnum.Free; |
| | | _unitOfWorkManage.BeginTran(); |
| | | _locationRepository.UpdateData(location); |
| | | _stockRepository.UpdateData(stockInfo); |
| | | BaseDal.DeleteData(task); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK("4"); |
| | | } |
| | | else |
| | | { |
| | | //ä¿®æ¹è´§ä½ä¿¡æ¯ |
| | | var location = _locationRepository.QueryFirst(v => v.LocationCode == task.SourceAddress); |
| | | location.LocationStatus = (int)LocationStatusEnum.InStock; |
| | | //ä¿®æ¹è´§ä½ä¿¡æ¯ |
| | | var locationtow = _locationRepository.QueryFirst(v => v.LocationCode == task.NextAddress); |
| | | locationtow.LocationStatus = (int)LocationStatusEnum.InStock; |
| | | |
| | | 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); |
| | | _locationRepository.UpdateData(locationtow); |
| | | _stockRepository.UpdateData(stockInfo); |
| | | _stockRepository.UpdateData(stockInfos); |
| | | BaseDal.DeleteData(task); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK("5"); |
| | | } |
| | | } |
| | | return content.OK("1"); |
| | | } |
| | | |
| | | public WebResponseContent speciaupdate(Dt_Task task) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | if (task.TaskState == (int)TaskInStatusEnum.InNew) |
| | | { |
| | | task.TaskState = (int)TaskInStatusEnum.Line_Ingrab; |
| | | BaseDal.UpdateData(task); |
| | | } |
| | | else if (task.TaskState == (int)TaskInStatusEnum.Line_Ingrab) |
| | | { |
| | | task.TaskState = (int)TaskInStatusEnum.InNew; |
| | | BaseDal.UpdateData(task); |
| | | } |
| | | else if (task.TaskState == (int)TaskOutStatusEnum.OutNew) |
| | | { |
| | | task.TaskState = (int)TaskOutStatusEnum.SC_OutExecuting; |
| | | BaseDal.UpdateData(task); |
| | | } |
| | | else if (task.TaskState == (int)TaskOutStatusEnum.SC_OutExecuting) |
| | | { |
| | | task.TaskState = (int)TaskOutStatusEnum.OutNew; |
| | | BaseDal.UpdateData(task); |
| | | } |
| | | else |
| | | { |
| | | return content.OK("ç¶æä¸å
许"); |
| | | } |
| | | return content.OK("1"); |
| | | } |
| | | |
| | | public WebResponseContent banzidong(string wei,string weis) |
| | | { |
| | | 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) |
| | | { |
| | | //if (!OHTJob.oHTReadData.R_ZXJ_TCMode) |
| | | //{ |
| | | // throw new Exception($"æ´å½¢æºä¸å±äºå¤©è½¦ä¸ææ¨¡å¼æå¤©è½¦æ¾æ¿ä¿¡å·ä¸ºfalse"); |
| | | //} |
| | | //if (!OHTJob.oHTReadData.R_HC_isReadyWork) |
| | | //{ |
| | | // throw new Exception($"æ´å½¢æºå¤©è½¦æ¾æ¿ä¿¡å·ä¸ºfalse"); |
| | | //} |
| | | //æ¥è¯¢å½å任塿± 䏿¯å¦åå¨åºåºä»»å¡ï¼åºåºä»»å¡åªè½åå¨ä¸æ¡ |
| | | var oldtask = _dt_taskRepositiry.QueryFirst(v => v.TaskType == (int)TaskOutboundTypeEnum.Outbound); |
| | | if (oldtask != null) |
| | | { |
| | | throw new Exception($"å½å任塿± ä¸å·²åå¨ä¸æ¡åºåºä»»å¡"); |
| | | } |
| | | |
| | | //æ¥è¯¢åºå |
| | | Dt_StockInfo ku = _stockRepository.QueryFirst(v => v.LocationCode == wei); |
| | | if (ku == null) |
| | | { |
| | | return content.OK("3"); |
| | | } |
| | | //æ¥è¯¢ç¸é»åºå |
| | | Dt_StockInfo kus = _stockRepository.QueryFirst(v => v.LocationCode == weis); |
| | | ku.StockStatus = (int)stockEnum.Lock; |
| | | kus.StockStatus = (int)stockEnum.Lock; |
| | | //æ¥è¯¢è´§ä½ |
| | | Dt_LocationInfo huo = _LocationInfoRepository.QueryFirst(v => v.LocationCode == wei); |
| | | //æ¥è¯¢ç¸é»è´§ä½ |
| | | Dt_LocationInfo huos = _LocationInfoRepository.QueryFirst(v => v.LocationCode == weis); |
| | | huo.LocationStatus = (int)LocationStatusEnum.Lock; |
| | | huos.LocationStatus = (int)LocationStatusEnum.Lock; |
| | | //æ¥è¯¢ç»ç¹ç«å°ä¿¡æ¯ |
| | | var station = _dt_stationInfoRepository.QueryFirst(v => v.msg == "æ´å½¢æºæ¾æä½"); |
| | | //å¼å§åå»ºä»»å¡ |
| | | Dt_Task outtask = new Dt_Task(); |
| | | outtask.Roadway = "TC01"; |
| | | outtask.TaskType = (int)TaskOutboundTypeEnum.Outbound; |
| | | outtask.TaskState = (int)TaskOutStatusEnum.OutNew; |
| | | outtask.SourceAddress = ku.LocationCode; |
| | | outtask.TargetAddress = station.Row + "-" + station.Column + "-1"; |
| | | outtask.NextAddress = huos.LocationCode; |
| | | outtask.Grade = 2; |
| | | outtask.WMSId = 3; |
| | | outtask.Remark = kus.Remark; |
| | | outtask.PalletCode = "text"; |
| | | outtask.CurrentAddress = "text"; |
| | | _unitOfWorkManage.BeginTran(); |
| | | _LocationInfoRepository.UpdateData(huo); |
| | | _LocationInfoRepository.UpdateData(huos); |
| | | _StockInfoRepository.UpdateData(ku); |
| | | _dt_taskRepositiry.AddData(outtask); |
| | | _StockInfoRepository.UpdateData(kus); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK("2"); |
| | | } |
| | | return content.OK("1"); |
| | | } |
| | | } |
| | | } |