已删除10个文件
已修改16个文件
已添加2个文件
| | |
| | | AGV_Executing = 310, |
| | | |
| | | /// <summary> |
| | | /// AGV宿 |
| | | /// </summary> |
| | | [Description("AGV宿")] |
| | | AGV_Finish = 330, |
| | | |
| | | /// <summary> |
| | | /// AGVå¾
ç»§ç»æ§è¡ |
| | | /// </summary> |
| | | [Description("AGVå¾
ç»§ç»æ§è¡")] |
| | | AGV_WaitToExecute = 320, |
| | | |
| | | /// <summary> |
| | | /// AGV宿 |
| | | /// </summary> |
| | | [Description("AGV宿")] |
| | | AGV_Finish = 330, |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å®æ |
| | | /// </summary> |
| | | [Description("ä»»å¡å®æ")] |
| | |
| | | /// <param name="agvUpdateModel"></param> |
| | | /// <returns></returns> |
| | | AgvResponseContent AgvUpdateTask(AgvUpdateDTO agvUpdateModel); |
| | | |
| | | WebResponseContent SendSecureReplyToAgv(int taskNum); |
| | | } |
| | | } |
| | |
| | | _taskService = taskService; |
| | | _taskRepository = taskRepository; |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// å®å
¨ä¿¡å·ç³è¯· AGV-WCS |
| | | /// </summary> |
| | |
| | | if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt()) |
| | | { |
| | | var content = TakeRequest(task.CurrentAddress); |
| | | if (!content.Status) |
| | | { |
| | | throw new Exception(content.Message); |
| | | } |
| | | //if (!content.Status) |
| | | //{ |
| | | // throw new Exception(content.Message); |
| | | //} |
| | | } |
| | | else |
| | | { |
| | | var content = PutRequest(task.NextAddress, task.PalletType); |
| | | if (!content.Status) |
| | | { |
| | | throw new Exception(content.Message); |
| | | } |
| | | //if (!content.Status) |
| | | //{ |
| | | // throw new Exception(content.Message); |
| | | //} |
| | | } |
| | | task.TaskState = TaskStatusEnum.AGV_WaitToExecute.ObjToInt(); |
| | | var up = _taskRepository.UpdateData(task); |
| | |
| | | if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt()) |
| | | { |
| | | var content = TakeRequest(task.CurrentAddress); |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | //if (!content.Status) throw new Exception(content.Message); |
| | | } |
| | | else |
| | | { |
| | | var content = PutRequest(task.NextAddress, task.PalletType); |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | //if (!content.Status) throw new Exception(content.Message); |
| | | } |
| | | task.TaskState = TaskStatusEnum.AGV_WaitToExecute.ObjToInt(); |
| | | var up = _taskRepository.UpdateData(task); |
| | |
| | | } |
| | | task.CurrentAddress = dt_Station.StationCode; |
| | | task.NextAddress = ""; |
| | | task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); |
| | | task.TaskState = TaskStatusEnum.AGV_Finish.ObjToInt(); |
| | | task.DeviceCode = "SC01_CSJ"; |
| | | var up = _taskRepository.UpdateData(task); |
| | | agvResponseContent.Code = up ? "0" : "1"; |
| | |
| | | bool canPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode); |
| | | if (canPut) |
| | | { |
| | | otherDevice.SetValue(GroundStationDBName.W_PutRequest, true, stationManger.StationCode); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | else |
| | |
| | | bool canPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, stationManger.StationCode); |
| | | if (canPut) |
| | | { |
| | | otherDevice.SetValue(GroundStationDBName.W_TakeRequest, true, stationManger.StationCode); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | else |
| | |
| | | { |
| | | return Service.RollbackTaskStatusToLast(taskNum); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åå¤AGVå®å
¨ä¿¡å· |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("SendSecureReplyToAgv")] |
| | | public WebResponseContent SendSecureReplyToAgv(int taskNum) |
| | | { |
| | | return Service.SendSecureReplyToAgv(taskNum); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | public Task StartAsync(CancellationToken cancellationToken) |
| | | { |
| | | try |
| | | { |
| | | string connStr = AppSettings.GetValue("WMSConnectionStrings"); |
| | | if (string.IsNullOrEmpty(connStr)) |
| | | { |
| | |
| | | DbType = DbType.SqlServer |
| | | }); |
| | | |
| | | List<Dt_Warehouse> warehouses = sugarClient.Queryable<Dt_Warehouse>().ToList(); |
| | | //List<Dt_Warehouse> warehouses = sugarClient.Queryable<Dt_Warehouse>().ToList(); |
| | | |
| | | _dbContext.Db.Deleteable<Dt_Warehouse>().ExecuteCommand(); |
| | | //_dbContext.Db.Deleteable<Dt_Warehouse>().ExecuteCommand(); |
| | | |
| | | _dbContext.Db.Insertable(warehouses).ExecuteCommand(); |
| | | //_dbContext.Db.Insertable(warehouses).ExecuteCommand(); |
| | | |
| | | List<Dt_ApiInfo> apiInfos = _dbContext.Db.Queryable<Dt_ApiInfo>().ToList(); |
| | | |
| | | _cacheService.AddOrUpdate(nameof(apiInfos), apiInfos); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Console.WriteLine(ex.ToString()); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | public Task StopAsync(CancellationToken cancellationToken) |
| | | { |
| | | throw new NotImplementedException(); |
| | | return Task.CompletedTask; |
| | | } |
| | | } |
| | | } |
| | |
| | | using System.Reflection; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_DTO.Agv; |
| | | using WIDESEAWCS_Common.APIEnum; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core; |
| | |
| | | using WIDESEAWCS_QuartzJob.Models; |
| | | using WIDESEAWCS_QuartzJob.Repository; |
| | | using WIDESEAWCS_QuartzJob.Service; |
| | | using WIDESEAWCS_TaskInfoRepository; |
| | | using ICacheService = WIDESEAWCS_Core.Caches.ICacheService; |
| | | |
| | | namespace WIDESEAWCS_TaskInfoService |
| | |
| | | |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(tasks.Select(x => x.TaskNum).ToList(), "æ¥æ¶WMSä»»å¡"); |
| | | |
| | | content = WebResponseContent.Instance.OK("æå"); |
| | | content = tasks.Count > 0 ? WebResponseContent.Instance.OK("æå") : WebResponseContent.Instance.Error("失败"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | public WebResponseContent SendSecureReplyToAgv(int taskNum) |
| | | { |
| | | try |
| | | { |
| | | Dt_Task WaitToTask = BaseDal.QueryFirst(x => x.TaskState == TaskStatusEnum.AGV_WaitToExecute.ObjToInt() && x.TaskNum == taskNum); |
| | | AgvSecureReplyDTO replyDTO = new AgvSecureReplyDTO() |
| | | { |
| | | ReqCode = Guid.NewGuid().ToString().Replace("-", ""), //WaitToTask.TaskNum.ToString(), |
| | | taskCode = WaitToTask.AgvTaskNum, |
| | | }; |
| | | WebResponseContent content = AgvSecureReply(replyDTO); |
| | | if (content.Status) |
| | | { |
| | | WaitToTask.TaskState = TaskStatusEnum.AGV_Executing.ObjToInt(); |
| | | } |
| | | else |
| | | { |
| | | WaitToTask.TaskState = TaskStatusEnum.Exception.ObjToInt(); |
| | | WaitToTask.ExceptionMessage = content.Message; |
| | | } |
| | | UpdateData(WaitToTask); |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Reflection.Metadata; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_DTO.Agv; |
| | |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_Model.Models; |
| | | using static Dm.net.buffer.ByteArrayBuffer; |
| | | using WIDESEAWCS_QuartzJob; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | |
| | | { |
| | | var newTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskStatusEnum.AGV_Execute.ObjToInt()).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList(); |
| | | foreach (var agvTask in newTasks) |
| | | { |
| | | try |
| | | { |
| | | AgvTaskDTO taskDTO = new AgvTaskDTO() |
| | | { |
| | |
| | | agvTask.ExceptionMessage = content.Message; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | agvTask.TaskState = TaskStatusEnum.Exception.ObjToInt(); |
| | | //agvTask.Remark = content.Data.ObjToString(); |
| | | agvTask.ExceptionMessage = ex.Message; |
| | | WriteError(nameof(AGVJob), ex.Message, ex); |
| | | } |
| | | } |
| | | _taskService.UpdateData(newTasks); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Console.Out.WriteLine(nameof(AGVJob) + ":" + ex.Message); |
| | | WriteError(nameof(AGVJob), ex.Message, ex); |
| | | } |
| | | } |
| | | /// <summary> |
| | |
| | | var WaitToTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskStatusEnum.AGV_WaitToExecute.ObjToInt()).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList(); |
| | | foreach (var WaitToTask in WaitToTasks) |
| | | { |
| | | if(WaitToTask.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup) |
| | | { |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == WaitToTask.NextAddress); |
| | | if (stationManger == null) |
| | | { |
| | | continue; |
| | | } |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); |
| | | if (device == null) |
| | | { |
| | | continue; |
| | | } |
| | | OtherDevice otherDevice = (OtherDevice)device; |
| | | bool canPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode); |
| | | bool requestPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutRequest, stationManger.StationCode); |
| | | if(!requestPut) |
| | | { |
| | | otherDevice.SetValue(GroundStationDBName.W_PutRequest, true, stationManger.StationCode); |
| | | continue; |
| | | } |
| | | else if (!canPut) |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == WaitToTask.CurrentAddress); |
| | | if (stationManger == null) |
| | | { |
| | | continue; |
| | | } |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); |
| | | if (device == null) |
| | | { |
| | | continue; |
| | | } |
| | | OtherDevice otherDevice = (OtherDevice)device; |
| | | bool canTake = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, stationManger.StationCode); |
| | | bool requestTake = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeRequest, stationManger.StationCode); |
| | | if (!requestTake) |
| | | { |
| | | otherDevice.SetValue(GroundStationDBName.W_TakeRequest, true, stationManger.StationCode); |
| | | continue; |
| | | } |
| | | else if (!canTake) |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | AgvSecureReplyDTO replyDTO = new AgvSecureReplyDTO() |
| | | { |
| | | ReqCode = Guid.NewGuid().ToString().Replace("-", ""), //WaitToTask.TaskNum.ToString(), |
| | |
| | | else return "22"; |
| | | } |
| | | default: |
| | | throw new NotImplementedException(); |
| | | throw new Exception($"设å¤ç¼å·é误"); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt()) |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => (x.TargetAddress == item.StackerCraneCode || string.IsNullOrEmpty(x.TargetAddress) || x.NextAddress == item.StackerCraneCode || string.IsNullOrEmpty(x.NextAddress)) && (x.TaskState == TaskStatusEnum.New.ObjToInt() || x.TaskState == TaskStatusEnum.SC_Execute.ObjToInt()) && x.SourceAddress == item.StationCode || x.CurrentAddress==item.AGVStationCode); |
| | | Dt_Task task = _taskRepository.QueryFirst(x => (x.TargetAddress == item.StackerCraneCode || string.IsNullOrEmpty(x.TargetAddress) || x.NextAddress == item.StackerCraneCode || string.IsNullOrEmpty(x.NextAddress)) && (x.TaskState == TaskStatusEnum.New.ObjToInt() || x.TaskState == TaskStatusEnum.AGV_Finish.ObjToInt()) && (x.SourceAddress == item.StationCode || x.CurrentAddress == item.AGVStationCode || x.CurrentAddress == item.StationCode)); |
| | | if (task != null) |
| | | { |
| | | string oldAddress = task.NextAddress; |
| | |
| | | WriteInfo(item.StationName, $"请æ±åé
è´§ä½è¿åä¿¡æ¯é误,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); |
| | | break; |
| | | } |
| | | task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); |
| | | task.CurrentAddress = stationManger.StackerCraneStationCode; |
| | | task.TargetAddress = locationCode; |
| | | task.NextAddress = locationCode; |
| | |
| | | { |
| | | ILocationStatusChangeRecordRepository Repository { get; } |
| | | |
| | | void AddLocationStatusChangeRecord(Dt_LocationInfo locationInfo, LocationStatusEnum lastStatus, LocationChangeType changeType, string? orderNo = null, int? taskNum = null); |
| | | void AddLocationStatusChangeRecord(Dt_LocationInfo locationInfo, LocationStatusEnum lastStatus, LocationStatusEnum newStatus, LocationChangeType changeType, string? orderNo = null, int? taskNum = null); |
| | | |
| | | void AddLocationStatusChangeRecord(List<Dt_LocationInfo> locationInfos, LocationStatusEnum newStatus, LocationChangeType changeType, string? orderNo = null, List<int>? taskNums = null); |
| | | |
| | |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_DTO.ERP; |
| | | using WIDESEA_DTO.Inbound; |
| | | using WIDESEA_DTO.MES; |
| | | using WIDESEA_External.ERPService; |
| | | using WIDESEA_External.Model; |
| | | using WIDESEA_IBasicRepository; |
| | |
| | | using WIDESEA_IStockRepository; |
| | | using WIDESEA_IStockService; |
| | | using WIDESEA_ITaskInfoRepository; |
| | | using WIDESEA_ITaskInfoService; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_StockRepository; |
| | | |
| | |
| | | _inboundRepository.InboundOrderRepository.UpdateData(inboundOrder); |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfoDetails, beforeQuantity, totalQuantity, StockChangeTypeEnum.MaterielGroup); |
| | | _unitOfWorkManage.CommitTran(); |
| | | //if (warehouse.WarehouseCode==WarehouseEnum.HA153.ToString()) |
| | | //{ |
| | | // //忥æµè¯æ¶ä¿¡æ¯ |
| | | // foreach (var model in models) |
| | | // { |
| | | // _taskService.TestSynStock(new TestToolSynInfo() { ToolCode = model.LotNo, Life = Initiallife }); |
| | | // } |
| | | //} |
| | | content.OK(); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | } |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfoDetails, beforeQuantity, totalQuantity, StockChangeTypeEnum.MaterielGroup); |
| | | _unitOfWorkManage.CommitTran(); |
| | | //忥æµè¯æ¶ä¿¡æ¯ |
| | | //foreach (var model in models) |
| | | //{ |
| | | // _taskService.TestSynStock(new TestToolSynInfo() { ToolCode = model.LotNo, Life = Initiallife }); |
| | | //} |
| | | content.OK(); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | <ProjectReference Include="..\WIDESEA_IRecordService\WIDESEA_IRecordService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_IStockService\WIDESEA_IStockService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_ITaskInfoRepository\WIDESEA_ITaskInfoRepository.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_ITaskInfoService\WIDESEA_ITaskInfoService.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
| | |
| | | { |
| | | public partial class LocationStatusChangeRecordService : ServiceBase<Dt_LocationStatusChangeRecord, ILocationStatusChangeRecordRepository>, ILocationStatusChangeRecordService |
| | | { |
| | | public void AddLocationStatusChangeRecord(Dt_LocationInfo locationInfo, LocationStatusEnum lastStatus, LocationChangeType changeType, string? orderNo = null, int? taskNum = null) |
| | | public void AddLocationStatusChangeRecord(Dt_LocationInfo locationInfo, LocationStatusEnum lastStatus, LocationStatusEnum newStatus, LocationChangeType changeType, string? orderNo = null, int? taskNum = null) |
| | | { |
| | | try |
| | | { |
| | | Dt_LocationStatusChangeRecord locationStatusChangeRecord = new Dt_LocationStatusChangeRecord() |
| | | { |
| | | AfterStatus = locationInfo.LocationStatus, |
| | | AfterStatus = newStatus.ObjToInt(), |
| | | BeforeStatus = lastStatus.ObjToInt(), |
| | | ChangeType = changeType.ObjToInt(), |
| | | LocationCode = locationInfo.LocationCode, |
| | |
| | | { |
| | | public partial class TaskService |
| | | { |
| | | static object lock_out = new object(); |
| | | |
| | | /// <summary> |
| | | /// æµè¯æ¶åºä» |
| | | /// </summary> |
| | |
| | | /// <returns></returns> |
| | | public MesResponseContent TestToolOut(TestToolOutModel model) |
| | | { |
| | | lock (lock_out) |
| | | { |
| | | MesResponseContent responseContent = new MesResponseContent(); |
| | | try |
| | | { |
| | | Dt_Task exsit = Repository.QueryFirst(x => x.TargetAddress == model.TargetAddressCode); |
| | | if(exsit != null) |
| | | { |
| | | return responseContent.Error($"ç®æ å°åéå¤"); |
| | | } |
| | | |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == WarehouseEnum.HA64.ToString()); |
| | | //è·ååºåè®°å½ |
| | | List<Dt_StockInfo> stockInfos = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => |
| | |
| | | { |
| | | return responseContent.Error($"æµè¯æ¶:{model.ToolCode}æ å¯ç¨åºå"); |
| | | } |
| | | Dt_Task exsit2 = Repository.QueryFirst(x => x.PalletCode == stockInfo.PalletCode); |
| | | if (exsit2 != null) |
| | | { |
| | | return responseContent.Error($"æµè¯æ¶æ¹æ¬¡å·éå¤"); |
| | | } |
| | | |
| | | Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == stockInfo.LocationCode && |
| | | x.WarehouseId == stockInfo.WarehouseId && |
| | | x.LocationStatus == (int)LocationStatusEnum.InStock && |
| | |
| | | //æ°å»ºä»»å¡ |
| | | BaseDal.AddData(taskOut); |
| | | //å å
¥è´§ä½åå¨è®°å½ |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, locationStatus, LocationChangeType.OutboundAssignLocation, stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", taskOut.TaskNum); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, locationStatus, LocationStatusEnum.Lock, LocationChangeType.OutboundAssignLocation, stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", taskOut.TaskNum); |
| | | _unitOfWorkManage.CommitTran(); |
| | | //å°ä»»å¡æ¨éå°WCS |
| | | PushTasksToWCS(new List<Dt_Task>() { taskOut }, "AGV"); |
| | |
| | | } |
| | | return responseContent; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æµè¯æ¶éåº |
| | | /// </summary> |
| | |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_DTO.Inbound; |
| | | using WIDESEA_DTO.MES; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_DTO.Task; |
| | | using WIDESEA_External.ERPService; |
| | |
| | | return WebResponseContent.Instance.Error($"å
¥åºåæ¥Erp失败"); |
| | | } |
| | | } |
| | | |
| | | if ((stockInfo.StockStatus == StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt() || stockInfo.StockStatus == StockStatusEmun.æå¨ç»çå
¥åºç¡®è®¤.ObjToInt()) && warehouse.WarehouseCode == WarehouseEnum.HA64.ToString()) |
| | | { |
| | | foreach (var model in stockInfo.Details) |
| | | { |
| | | TestSynStock(new TestToolSynInfo() { ToolCode = model.BatchNo, Life = int.TryParse(model.Remark, out int val) ? val : 1000 }); |
| | | } |
| | | } |
| | | |
| | | //æµè¯æ¶å
¥åºåºåç¶æ |
| | | if (task.TaskType == TaskTypeEnum.Inbound.ObjToInt() && warehouse.WarehouseCode == WarehouseEnum.HA64.ToString() && stockInfo.StockStatus != StockStatusEmun.æå¨ç»çå
¥åºç¡®è®¤.ObjToInt()) |
| | | { |
| | |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, (PalletTypeEnum)stockInfo.PalletType, LocationStatusEnum.InStock, stockInfo.WarehouseId); |
| | | _stockRepository.StockInfoRepository.UpdateData(stockInfo); |
| | | _stockRepository.StockInfoDetailRepository.UpdateData(stockInfo.Details); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, lastStatus, LocationChangeType.InboundCompleted); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, lastStatus, LocationStatusEnum.InStock, LocationChangeType.InboundCompleted); |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, stockInfo.Details.Sum(x => x.StockQuantity), stockInfo.Details.Sum(x => x.StockQuantity), StockChangeTypeEnum.Inbound, taskNum); |
| | | if (inboundOrder != null) |
| | | { |
| | |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, (PalletTypeEnum)stockInfo.PalletType, LocationStatusEnum.Free, stockInfo.WarehouseId); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, (LocationStatusEnum)beforeStatus, LocationChangeType.OutboundCompleted, stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, (LocationStatusEnum)beforeStatus, LocationStatusEnum.Free, LocationChangeType.OutboundCompleted, stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum); |
| | | _unitOfWorkManage.CommitTran(); |
| | | |
| | | if (warehouse.WarehouseCode != WarehouseEnum.HA64.ToString()) |
| | |
| | | LocationStatusEnum lastStatus = (LocationStatusEnum)locationInfo.LocationStatus; |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, lastStatus, LocationChangeType.InboundAssignLocation); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, lastStatus, LocationStatusEnum.Lock, LocationChangeType.InboundAssignLocation); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, (PalletTypeEnum)task.PalletType, LocationStatusEnum.Lock, task.WarehouseId); |
| | | BaseDal.UpdateData(task); |
| | | _unitOfWorkManage.CommitTran(); |
| | |
| | | { |
| | | LocationStatusEnum lastStatus = (LocationStatusEnum)newLocation.LocationStatus; |
| | | _basicService.LocationInfoService.UpdateLocationStatus(newLocation, (PalletTypeEnum)task.PalletType, LocationStatusEnum.Lock, stockInfo.WarehouseId); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(newLocation, lastStatus, LocationChangeType.RelocationAssignLocation, taskNum: newTask.TaskNum); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(newLocation, lastStatus, LocationStatusEnum.Lock, LocationChangeType.RelocationAssignLocation, taskNum: newTask.TaskNum); |
| | | } |
| | | { |
| | | LocationStatusEnum lastStatus = (LocationStatusEnum)needRelocationItem.LocationStatus; |
| | | _basicService.LocationInfoService.UpdateLocationStatus(needRelocationItem, (PalletTypeEnum)task.PalletType, LocationStatusEnum.Lock, stockInfo.WarehouseId); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(needRelocationItem, lastStatus, LocationChangeType.RelocationAssignLocation, taskNum: newTask.TaskNum); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(needRelocationItem, lastStatus, LocationStatusEnum.Lock, LocationChangeType.RelocationAssignLocation, taskNum: newTask.TaskNum); |
| | | } |
| | | stockInfo.StockStatus = StockStatusEmun.ç§»åºéå®.ObjToInt(); |
| | | _stockRepository.StockInfoRepository.UpdateData(stockInfo); |