| | |
| | | // import { config } from 'vue/types/umd'; |
| | | axios.defaults.withCredentials=true; |
| | | axios.defaults.crossDomain=true; |
| | | axios.defaults.baseURL = 'http://127.0.0.1:7081';//'http://192.168.2.51:8099'; //'http://localhost:8099'; //'http://192.168.2.51:8099';// |
| | | axios.defaults.baseURL = 'http://10.30.4.92:7081';//'http://192.168.2.51:8099'; //'http://localhost:8099'; //'http://192.168.2.51:8099';// |
| | | axios.defaults.headers.post["Content-Type"]="application/json;charset=utf-8"; |
| | | // é误信æ¯å¤ç |
| | | const errorHandle = (status, other) => { |
| | |
| | | } |
| | | //æåè¿ä¸å¤©ä»»å¡ç»è®¡ |
| | | export function GetProWeekTasks (data) { |
| | | return axios.post('/api/Large/GetProWeekTasks', data)//è¿åçæ¶promieså¯¹è±¡ï¼æä»¥ç´æ¥returnåºå»å°±å¥½äº |
| | | return axios.post('/api/Large/GetProWeekTasks?id=7', data)//è¿åçæ¶promieså¯¹è±¡ï¼æä»¥ç´æ¥returnåºå»å°±å¥½äº |
| | | } |
| | |
| | | itemWidth: 10, |
| | | itemHeight: 10, |
| | | icon: 'circle', |
| | | data: ['æåå
¥åº', 'æååºåº', '空æ¡åæµ', 'æåååº'] |
| | | data: ['æåå
¥åº', 'æååºåº', 'æåè°æ¨', 'æåéåº'] |
| | | }, |
| | | grid: { |
| | | left: '8%', |
| | |
| | | } |
| | | }, |
| | | { |
| | | name: '空æ¡åæµ', |
| | | name: 'æåè°æ¨', |
| | | type: 'line', |
| | | data: [], |
| | | areaStyle: { |
| | |
| | | } |
| | | }, |
| | | { |
| | | name: 'æåååº', |
| | | name: 'æåéåº', |
| | | type: 'line', |
| | | data: [], |
| | | areaStyle: { |
| | |
| | | const seriesData = { |
| | | 'æåå
¥åº': [], |
| | | 'æååºåº': [], |
| | | '空æ¡åæµ': [], |
| | | 'æåååº': [] |
| | | 'æåè°æ¨': [], |
| | | 'æåéåº': [] |
| | | }; |
| | | |
| | | // æ ¹æ®å®é
æ°æ®æ ¼å¼è°æ´å段åï¼å°åå¼å¤´ï¼ |
| | | stats.forEach(day => { |
| | | seriesData['æåå
¥åº'].push(day.inProduct || 0); |
| | | seriesData['æååºåº'].push(day.outProduct || 0); |
| | | seriesData['空æ¡åæµ'].push(day.emptyProductBack || 0); |
| | | seriesData['æåååº'].push(day.inProductBack || 0); |
| | | seriesData['æåè°æ¨'].push(day.emptyProductBack || 0); |
| | | seriesData['æåéåº'].push(day.inProductBack || 0); |
| | | }); |
| | | |
| | | this.options = { |
| | |
| | | // }); |
| | | var rep = await ProductionRanking(); |
| | | var cityLists= rep.map((item,index) => { |
| | | return '#'+(index+1)+' 产å'+item.pCode; |
| | | return 'TOP'+(index+1)+' 产å'+item.pCode; |
| | | }); |
| | | var cityDatas= rep.map((item,index) => { |
| | | return item.qtys; |
| | |
| | | AGV_TakeError = 335, |
| | | |
| | | /// <summary> |
| | | /// AGVæ¾è´§åå
¥å¼å¸¸ |
| | | /// </summary> |
| | | [Description("AGVåè´§åå
¥å¼å¸¸")] |
| | | AGV_PutError = 340, |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å®æ |
| | | /// </summary> |
| | | [Description("ä»»å¡å®æ")] |
| | |
| | | { |
| | | var task = _taskRepository.QueryFirst(x => secureApplyModel.TaskCode == x.AgvTaskNum); |
| | | if (task == null) throw new Exception("æªæ¾å°ä»»å¡"); |
| | | if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt()) |
| | | { |
| | | var content = TakeRequest(task.CurrentAddress); |
| | | //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 (task.TaskType == TaskTypeEnum.Outbound.ObjToInt()) |
| | | //{ |
| | | // var content = TakeRequest(task.CurrentAddress); |
| | | // //if (!content.Status) |
| | | // //{ |
| | | // // throw new Exception(content.Message); |
| | | // //} |
| | | //} |
| | | //else |
| | | //{ |
| | | // var content = PutRequest(task.NextAddress, task.PalletType); |
| | | // //if (!content.Status) |
| | | // //{ |
| | | // // throw new Exception(content.Message); |
| | | // //} |
| | | //} |
| | | task.TaskState = TaskStatusEnum.AGV_WaitToExecute.ObjToInt(); |
| | | var up = _taskRepository.UpdateData(task); |
| | | agvResponseContent.Code = up ? "0" : "1"; |
| | |
| | | break; |
| | | case "getSafetySignal"://å®å
¨ä¿¡å·ç³è¯· |
| | | { |
| | | if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt()) |
| | | { |
| | | var content = TakeRequest(task.CurrentAddress); |
| | | //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 (task.TaskType == TaskTypeEnum.Outbound.ObjToInt()) |
| | | //{ |
| | | // var content = TakeRequest(task.CurrentAddress); |
| | | // //if (!content.Status) throw new Exception(content.Message); |
| | | //} |
| | | //else |
| | | //{ |
| | | // var content = PutRequest(task.NextAddress, task.PalletType); |
| | | // //if (!content.Status) throw new Exception(content.Message); |
| | | //} |
| | | task.TaskState = TaskStatusEnum.AGV_WaitToExecute.ObjToInt(); |
| | | var up = _taskRepository.UpdateData(task); |
| | | agvResponseContent.Code = up ? "0" : "1"; |
| | |
| | | if (task.TaskType != TaskTypeEnum.Outbound.ObjToInt()) |
| | | { |
| | | var content = PutFinish(task.NextAddress); |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | if (!content.Status) |
| | | { |
| | | task.TaskState = TaskStatusEnum.AGV_PutError.ObjToInt(); |
| | | _taskRepository.UpdateData(task); |
| | | throw new Exception(content.Message); |
| | | } |
| | | Dt_StationManger dt_Station = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == task.NextAddress); |
| | | if (dt_Station == null) |
| | | { |
| | |
| | | { |
| | | var task = _taskRepository.QueryFirst(x => secureApplyModel.TaskCode == x.AgvTaskNum); |
| | | if (task == null) throw new Exception("æªæ¾å°ä»»å¡"); |
| | | if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt()) |
| | | { |
| | | var content = TakeRequest(task.CurrentAddress); |
| | | //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 (task.TaskType == TaskTypeEnum.Outbound.ObjToInt()) |
| | | //{ |
| | | // var content = TakeRequest(task.CurrentAddress); |
| | | // //if (!content.Status) |
| | | // //{ |
| | | // // throw new Exception(content.Message); |
| | | // //} |
| | | //} |
| | | //else |
| | | //{ |
| | | // var content = PutRequest(task.NextAddress, task.PalletType); |
| | | // //if (!content.Status) |
| | | // //{ |
| | | // // throw new Exception(content.Message); |
| | | // //} |
| | | //} |
| | | task.TaskState = TaskStatusEnum.AGV_WaitToExecute.ObjToInt(); |
| | | var up = _taskRepository.UpdateData(task); |
| | | agvResponseContent.Code = up ? "0" : "1"; |
| | |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | var content = TakeFinish(task.CurrentAddress); |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | if (!content.Status) |
| | | { |
| | | task.TaskState = TaskStatusEnum.AGV_TakeError.ObjToInt(); |
| | | _taskRepository.UpdateData(task); |
| | | throw new Exception(content.Message); |
| | | } |
| | | task.TaskState = TaskStatusEnum.AGV_Finish.ObjToInt(); |
| | | var up = _taskRepository.DeleteAndMoveIntoHty(task, OperateTypeEnum.èªå¨å®æ); |
| | | _taskService.TaskCompleted(task.TaskNum); |
| | |
| | | break; |
| | | case "getSafetySignal"://å®å
¨ä¿¡å·ç³è¯· |
| | | { |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | var content = TakeRequest(task.CurrentAddress); |
| | | //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 (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | //{ |
| | | // var content = TakeRequest(task.CurrentAddress); |
| | | // //if (!content.Status) throw new Exception(content.Message); |
| | | //} |
| | | //else |
| | | //{ |
| | | // var content = PutRequest(task.NextAddress, task.PalletType); |
| | | // //if (!content.Status) throw new Exception(content.Message); |
| | | //} |
| | | task.TaskState = TaskStatusEnum.AGV_WaitToExecute.ObjToInt(); |
| | | var up = _taskRepository.UpdateData(task); |
| | | agvResponseContent.Code = up ? "0" : "1"; |
| | |
| | | if (task.TaskType != TaskTypeEnum.Outbound.ObjToInt()) |
| | | { |
| | | var content = PutFinish(task.NextAddress); |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | if (!content.Status) |
| | | { |
| | | task.TaskState = TaskStatusEnum.AGV_PutError.ObjToInt(); |
| | | _taskRepository.UpdateData(task); |
| | | throw new Exception(content.Message); |
| | | } |
| | | Dt_StationManger dt_Station = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == task.NextAddress); |
| | | if (dt_Station == null) |
| | | { |
| | |
| | | using WIDESEAWCS_DTO.Agv; |
| | | using SqlSugar; |
| | | using static Dm.net.buffer.ByteArrayBuffer; |
| | | using WIDESEAWCS_Core.Enums; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | |
| | | } |
| | | } |
| | | _taskService.UpdateData(WaitToTasks); |
| | | |
| | | //åæ¾è´§å®æåå
¥å¼å¸¸å¤ç |
| | | Dt_Task? TakeErroeTask = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskStatusEnum.AGV_TakeError.ObjToInt() && nameof(AGV_CSJJob).Contains(x.DeviceCode)).First(); |
| | | if (TakeErroeTask!=null) |
| | | { |
| | |
| | | otherDevice.SetValue(GroundStationDBName.W_TakeFinish, true, stationManger.StationCode); |
| | | Thread.Sleep(1000); |
| | | otherDevice.SetValue(GroundStationDBName.W_TakeFinish, false, stationManger.StationCode); |
| | | TakeErroeTask.TaskState = TaskStatusEnum.AGV_Finish.ObjToInt(); |
| | | var up = _taskRepository.DeleteAndMoveIntoHty(TakeErroeTask, OperateTypeEnum.èªå¨å®æ); |
| | | _taskService.TaskCompleted(TakeErroeTask.TaskNum); |
| | | } |
| | | Dt_Task? PutErroeTask = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskStatusEnum.AGV_PutError.ObjToInt() && nameof(AGV_CSJJob).Contains(x.DeviceCode)).First(); |
| | | if (PutErroeTask != null) |
| | | { |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == PutErroeTask.NextAddress); |
| | | if (stationManger == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°ç«å°é
ç½®"); |
| | | } |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); |
| | | if (device == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°ç«å°é
ç½®"); |
| | | } |
| | | OtherDevice otherDevice = (OtherDevice)device; |
| | | otherDevice.SetValue(GroundStationDBName.W_PutFinish, true, stationManger.StationCode); |
| | | PutErroeTask.CurrentAddress = stationManger.StationCode; |
| | | PutErroeTask.NextAddress = ""; |
| | | PutErroeTask.TaskState = TaskStatusEnum.AGV_Finish.ObjToInt(); |
| | | PutErroeTask.DeviceCode = "SC01_CSJ"; |
| | | var up = _taskRepository.UpdateData(PutErroeTask); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using WIDESEAWCS_IBasicInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob; |
| | |
| | | private readonly IRouterService _routerService; |
| | | private readonly IStationMangerRepository _stationMangerRepository; |
| | | private readonly IMapper _mapper; |
| | | private readonly ITaskRepository _taskRepository; |
| | | |
| | | public AGV_CSJJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IStationMangerRepository stationMangerRepository, IMapper mapper) |
| | | public AGV_CSJJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IStationMangerRepository stationMangerRepository, IMapper mapper, ITaskRepository taskRepository) |
| | | { |
| | | _taskService = taskService; |
| | | _taskExecuteDetailService = taskExecuteDetailService; |
| | | _routerService = routerService; |
| | | _stationMangerRepository = stationMangerRepository; |
| | | _mapper = mapper; |
| | | _taskRepository = taskRepository; |
| | | } |
| | | public Task Execute(IJobExecutionContext context) |
| | | { |
| | |
| | | _stationMangerRepository = stationMangerRepository; |
| | | _cacheService = cacheService; |
| | | _mapper=mapper; |
| | | |
| | | string? apiInfoStr = _cacheService.Get("apiInfos"); |
| | | if (!string.IsNullOrEmpty(apiInfoStr)) |
| | | { |
| | | List<Dt_ApiInfo>? infos = JsonConvert.DeserializeObject<List<Dt_ApiInfo>>(apiInfoStr); |
| | | if (infos == null || infos.Count == 0) |
| | | { |
| | | apiInfos = new List<Dt_ApiInfo>(); |
| | | } |
| | | else |
| | | { |
| | | apiInfos = infos; |
| | | } |
| | | } |
| | | } |
| | | |
| | | public Task Execute(IJobExecutionContext context) |
| | |
| | | { |
| | | try |
| | | { |
| | | var newTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => (x.TaskState == TaskStatusEnum.AGV_Execute.ObjToInt()|| x.TaskState == TaskStatusEnum.New.ObjToInt()) && nameof(AGV_CPJob).Contains(x.DeviceCode) && !string.IsNullOrEmpty(x.DeviceCode) && x.TaskType!=999).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList(); |
| | | |
| | | if (newTasks.Count>0) |
| | | var AllTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => (nameof(AGV_CPJob).Contains(x.DeviceCode))).ToList(); |
| | | var stationMangers = _stationMangerRepository.QueryData(); |
| | | #region å
¥åºä»»å¡æ¨é |
| | | { |
| | | foreach (var task in newTasks) |
| | | var newTasksIn = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.AGV_Execute.ObjToInt()) && x.TaskType>=TaskTypeEnum.Inbound.ObjToInt() && nameof(AGV_CPJob).Contains(x.DeviceCode) && !string.IsNullOrEmpty(x.DeviceCode) && x.TaskType!=999).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList(); |
| | | if (newTasksIn.Count>0) |
| | | { |
| | | try |
| | | foreach (var task in newTasksIn) |
| | | { |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | task.CurrentAddress = GetAGVAddress(task.CurrentAddress); |
| | | else |
| | | task.NextAddress = GetAGVAddress(task.NextAddress); |
| | | AgvTaskDTO taskDTO = new AgvTaskDTO() |
| | | try |
| | | { |
| | | TaskCode = task.AgvTaskNum, |
| | | ReqCode = DateTime.Now.ToString("yyMMdd") + task.AgvTaskNum, |
| | | TaskTyp = task.TaskType < TaskTypeEnum.Inbound.ObjToInt() ? "CPC" : "CPR", |
| | | ctnrCode = task.PalletCode, |
| | | PositionCodePath = new List<CodePath>() |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | task.CurrentAddress = GetAGVAddress(task.CurrentAddress); |
| | | else |
| | | task.NextAddress = GetAGVAddress(task.NextAddress); |
| | | AgvTaskDTO taskDTO = new AgvTaskDTO() |
| | | { |
| | | new CodePath() |
| | | TaskCode = task.AgvTaskNum, |
| | | ReqCode = DateTime.Now.ToString("yyMMdd") + task.AgvTaskNum, |
| | | TaskTyp = task.TaskType < TaskTypeEnum.Inbound.ObjToInt() ? "CPC" : "CPR", |
| | | ctnrCode = task.PalletCode, |
| | | PositionCodePath = new List<CodePath>() |
| | | { |
| | | type = "05", |
| | | positionCode = task.CurrentAddress |
| | | }, |
| | | new CodePath() |
| | | new CodePath() |
| | | { |
| | | type = "05", |
| | | positionCode = task.CurrentAddress |
| | | }, |
| | | new CodePath() |
| | | { |
| | | type = "05", |
| | | positionCode = task.NextAddress |
| | | } |
| | | } |
| | | }; |
| | | if (taskDTO.TaskTyp== "CPC") |
| | | { |
| | | taskDTO.Priority = task.Grade.ToString(); |
| | | } |
| | | if (task.GroupId.IsNotEmptyOrNull()) |
| | | { |
| | | taskDTO.GroupId=task.GroupId; |
| | | } |
| | | if (task.TaskType==TaskTypeEnum.OutMesRworkProduct.ObjToInt()) |
| | | { |
| | | taskDTO.Priority = "127"; |
| | | } |
| | | //åéAGVä»»å¡ |
| | | WebResponseContent content = _taskService.AgvSendTask(taskDTO, APIEnum.Agv_CPSendTask); |
| | | if (!content.Status) |
| | | throw new Exception(content.Message); |
| | | if (taskDTO.TaskTyp == "CPC") |
| | | { |
| | | task.Dispatchertime = DateTime.Now; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.AGV_Executing); |
| | | } |
| | | else |
| | | { |
| | | task.Dispatchertime = DateTime.Now; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.AGV_Takeing); |
| | | } |
| | | Thread.Sleep(500); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | task.TaskState = TaskStatusEnum.Exception.ObjToInt(); |
| | | task.ExceptionMessage = ex.Message; |
| | | } |
| | | } |
| | | if (newTasksIn.Count > 0) |
| | | { |
| | | _taskService.UpdateData(newTasksIn); |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | #region åºåºæ¨éä»»å¡1线 |
| | | { |
| | | var newTasksOut1 = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress=="5236").OrderBy(x => x.Grade).ThenBy(x => x.GroupId).Take(5).ToList(); |
| | | var downTasksOut1 = AllTasks.Where(x => (x.TaskState > TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5236").ToList(); |
| | | Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.AGVStationCode == "5236"); |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); |
| | | if (device != null) |
| | | { |
| | | OtherDevice otherDevice = (OtherDevice)device; |
| | | short stationCurrentStatus = device.Communicator.Read<short>("DB29.112"); |
| | | if (newTasksOut1.Count > 0 && downTasksOut1.Count <= 0 && stationCurrentStatus == 1) |
| | | { |
| | | foreach (var task in newTasksOut1) |
| | | { |
| | | try |
| | | { |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | task.CurrentAddress = GetAGVAddress(task.CurrentAddress); |
| | | else |
| | | task.NextAddress = GetAGVAddress(task.NextAddress); |
| | | AgvTaskDTO taskDTO = new AgvTaskDTO() |
| | | { |
| | | type = "05", |
| | | positionCode = task.NextAddress |
| | | TaskCode = task.AgvTaskNum, |
| | | ReqCode = DateTime.Now.ToString("yyMMdd") + task.AgvTaskNum, |
| | | TaskTyp = task.TaskType < TaskTypeEnum.Inbound.ObjToInt() ? "CPC" : "CPR", |
| | | ctnrCode = task.PalletCode, |
| | | PositionCodePath = new List<CodePath>() |
| | | { |
| | | new CodePath() |
| | | { |
| | | type = "05", |
| | | positionCode = task.CurrentAddress |
| | | }, |
| | | new CodePath() |
| | | { |
| | | type = "05", |
| | | positionCode = task.NextAddress |
| | | } |
| | | } |
| | | }; |
| | | if (taskDTO.TaskTyp == "CPC") |
| | | { |
| | | taskDTO.Priority = task.Grade.ToString(); |
| | | } |
| | | if (task.GroupId.IsNotEmptyOrNull()) |
| | | { |
| | | taskDTO.GroupId = task.GroupId; |
| | | } |
| | | if (task.TaskType == TaskTypeEnum.OutMesRworkProduct.ObjToInt()) |
| | | { |
| | | taskDTO.Priority = "127"; |
| | | } |
| | | //åéAGVä»»å¡ |
| | | WebResponseContent content = _taskService.AgvSendTask(taskDTO, APIEnum.Agv_CPSendTask); |
| | | if (!content.Status) |
| | | throw new Exception(content.Message); |
| | | if (taskDTO.TaskTyp == "CPC") |
| | | { |
| | | task.Dispatchertime = DateTime.Now; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.AGV_Executing); |
| | | } |
| | | else |
| | | { |
| | | task.Dispatchertime = DateTime.Now; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.AGV_Takeing); |
| | | } |
| | | } |
| | | }; |
| | | if (taskDTO.TaskTyp== "CPC") |
| | | { |
| | | taskDTO.Priority = task.Grade.ToString(); |
| | | catch (Exception ex) |
| | | { |
| | | task.TaskState = TaskStatusEnum.Exception.ObjToInt(); |
| | | task.ExceptionMessage = ex.Message; |
| | | } |
| | | } |
| | | if (task.GroupId.IsNotEmptyOrNull()) |
| | | if (newTasksOut1.Count > 0) |
| | | { |
| | | taskDTO.GroupId=task.GroupId; |
| | | _taskService.UpdateData(newTasksOut1); |
| | | } |
| | | if (task.TaskType==TaskTypeEnum.OutMesRworkProduct.ObjToInt()) |
| | | } |
| | | } |
| | | |
| | | } |
| | | #endregion |
| | | #region åºåºæ¨éä»»å¡2线 |
| | | { |
| | | var newTasksOut2 = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5243").OrderBy(x => x.Grade).ThenBy(x => x.GroupId).Take(5).ToList(); |
| | | var downTasksOut2 = AllTasks.Where(x => (x.TaskState > TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5243").ToList(); |
| | | Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.AGVStationCode == "5243"); |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); |
| | | if (device != null) |
| | | { |
| | | OtherDevice otherDevice = (OtherDevice)device; |
| | | short stationCurrentStatus = device.Communicator.Read<short>("DB29.126"); |
| | | if (newTasksOut2.Count > 0 && downTasksOut2.Count <= 0 && stationCurrentStatus == 1) |
| | | { |
| | | foreach (var task in newTasksOut2) |
| | | { |
| | | taskDTO.Priority = "127"; |
| | | try |
| | | { |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | task.CurrentAddress = GetAGVAddress(task.CurrentAddress); |
| | | else |
| | | task.NextAddress = GetAGVAddress(task.NextAddress); |
| | | AgvTaskDTO taskDTO = new AgvTaskDTO() |
| | | { |
| | | TaskCode = task.AgvTaskNum, |
| | | ReqCode = DateTime.Now.ToString("yyMMdd") + task.AgvTaskNum, |
| | | TaskTyp = task.TaskType < TaskTypeEnum.Inbound.ObjToInt() ? "CPC" : "CPR", |
| | | ctnrCode = task.PalletCode, |
| | | PositionCodePath = new List<CodePath>() |
| | | { |
| | | new CodePath() |
| | | { |
| | | type = "05", |
| | | positionCode = task.CurrentAddress |
| | | }, |
| | | new CodePath() |
| | | { |
| | | type = "05", |
| | | positionCode = task.NextAddress |
| | | } |
| | | } |
| | | }; |
| | | if (taskDTO.TaskTyp == "CPC") |
| | | { |
| | | taskDTO.Priority = task.Grade.ToString(); |
| | | } |
| | | if (task.GroupId.IsNotEmptyOrNull()) |
| | | { |
| | | taskDTO.GroupId = task.GroupId; |
| | | } |
| | | if (task.TaskType == TaskTypeEnum.OutMesRworkProduct.ObjToInt()) |
| | | { |
| | | taskDTO.Priority = "127"; |
| | | } |
| | | //åéAGVä»»å¡ |
| | | WebResponseContent content = _taskService.AgvSendTask(taskDTO, APIEnum.Agv_CPSendTask); |
| | | if (!content.Status) |
| | | throw new Exception(content.Message); |
| | | if (taskDTO.TaskTyp == "CPC") |
| | | { |
| | | task.Dispatchertime = DateTime.Now; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.AGV_Executing); |
| | | } |
| | | else |
| | | { |
| | | task.Dispatchertime = DateTime.Now; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.AGV_Takeing); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | task.TaskState = TaskStatusEnum.Exception.ObjToInt(); |
| | | task.ExceptionMessage = ex.Message; |
| | | } |
| | | } |
| | | //åéAGVä»»å¡ |
| | | WebResponseContent content = _taskService.AgvSendTask(taskDTO, APIEnum.Agv_CPSendTask); |
| | | if (!content.Status) |
| | | throw new Exception(content.Message); |
| | | if (taskDTO.TaskTyp == "CPC") |
| | | if (newTasksOut2.Count > 0) |
| | | { |
| | | task.Dispatchertime = DateTime.Now; |
| | | _taskService.UpdateData(newTasksOut2); |
| | | } |
| | | } |
| | | //else |
| | | //{ |
| | | // WriteInfo(nameof(AGV_CPJob), $"2线æ ä»»å¡ï¼ç¶æ{stationCurrentStatus}"); |
| | | //} |
| | | } |
| | | |
| | | } |
| | | #endregion |
| | | #region åºåºæ¨éä»»å¡3线 |
| | | { |
| | | var newTasksOut3 = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5250").OrderBy(x => x.Grade).ThenBy(x => x.GroupId).Take(5).ToList(); |
| | | var downTasksOut3 = AllTasks.Where(x => (x.TaskState > TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5250").ToList(); |
| | | Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.AGVStationCode == "5250"); |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); |
| | | if (device != null) |
| | | { |
| | | OtherDevice otherDevice = (OtherDevice)device; |
| | | short stationCurrentStatus = device.Communicator.Read<short>("DB29.140"); |
| | | if (newTasksOut3.Count > 0 && downTasksOut3.Count <= 0 && stationCurrentStatus == 1) |
| | | { |
| | | foreach (var task in newTasksOut3) |
| | | { |
| | | try |
| | | { |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | task.CurrentAddress = GetAGVAddress(task.CurrentAddress); |
| | | else |
| | | task.NextAddress = GetAGVAddress(task.NextAddress); |
| | | AgvTaskDTO taskDTO = new AgvTaskDTO() |
| | | { |
| | | TaskCode = task.AgvTaskNum, |
| | | ReqCode = DateTime.Now.ToString("yyMMdd") + task.AgvTaskNum, |
| | | TaskTyp = task.TaskType < TaskTypeEnum.Inbound.ObjToInt() ? "CPC" : "CPR", |
| | | ctnrCode = task.PalletCode, |
| | | PositionCodePath = new List<CodePath>() |
| | | { |
| | | new CodePath() |
| | | { |
| | | type = "05", |
| | | positionCode = task.CurrentAddress |
| | | }, |
| | | new CodePath() |
| | | { |
| | | type = "05", |
| | | positionCode = task.NextAddress |
| | | } |
| | | } |
| | | }; |
| | | if (taskDTO.TaskTyp == "CPC") |
| | | { |
| | | taskDTO.Priority = task.Grade.ToString(); |
| | | } |
| | | if (task.GroupId.IsNotEmptyOrNull()) |
| | | { |
| | | taskDTO.GroupId = task.GroupId; |
| | | } |
| | | if (task.TaskType == TaskTypeEnum.OutMesRworkProduct.ObjToInt()) |
| | | { |
| | | taskDTO.Priority = "127"; |
| | | } |
| | | //åéAGVä»»å¡ |
| | | WebResponseContent content = _taskService.AgvSendTask(taskDTO, APIEnum.Agv_CPSendTask); |
| | | if (!content.Status) |
| | | throw new Exception(content.Message); |
| | | if (taskDTO.TaskTyp == "CPC") |
| | | { |
| | | task.Dispatchertime = DateTime.Now; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.AGV_Executing); |
| | | } |
| | | else |
| | | { |
| | | task.Dispatchertime = DateTime.Now; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.AGV_Takeing); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | task.TaskState = TaskStatusEnum.Exception.ObjToInt(); |
| | | task.ExceptionMessage = ex.Message; |
| | | } |
| | | } |
| | | if (newTasksOut3.Count > 0) |
| | | { |
| | | _taskService.UpdateData(newTasksOut3); |
| | | } |
| | | } |
| | | //else |
| | | //{ |
| | | // WriteInfo(nameof(AGV_CPJob), $"3线æ ä»»å¡ï¼ç¶æ{stationCurrentStatus}"); |
| | | //} |
| | | } |
| | | |
| | | } |
| | | #endregion |
| | | #region ç©ºæ¡æ¬è¿ |
| | | { |
| | | var newTasksLocations = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskStatusEnum.New.ObjToInt() && nameof(AGV_CPJob).Contains(x.DeviceCode) && !string.IsNullOrEmpty(x.DeviceCode) && x.Remark == "æµè¯ç©ºæ¡").ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList(); |
| | | if (newTasksLocations.Count>0) |
| | | { |
| | | foreach (var task in newTasksLocations) |
| | | { |
| | | try |
| | | { |
| | | string CurrentAddress = GetAGVAddress(task.CurrentAddress); |
| | | string NextAddress = GetAGVAddress(task.NextAddress); |
| | | AgvTaskDTO taskDTO = new AgvTaskDTO() |
| | | { |
| | | TaskCode = task.AgvTaskNum, |
| | | ReqCode = DateTime.Now.ToString("yyMMdd") + task.AgvTaskNum, |
| | | TaskTyp = "CP", |
| | | ctnrCode = task.PalletCode, |
| | | PositionCodePath = new List<CodePath>() |
| | | { |
| | | new CodePath() |
| | | { |
| | | type="05", |
| | | positionCode=CurrentAddress |
| | | }, |
| | | new CodePath() |
| | | { |
| | | type="05", |
| | | positionCode=NextAddress |
| | | } |
| | | }, |
| | | }; |
| | | //åéAGVä»»å¡ |
| | | WebResponseContent content = _taskService.AgvSendTask(taskDTO, APIEnum.Agv_CPSendTask); |
| | | if (!content.Status) |
| | | throw new Exception(content.Message); |
| | | task.TaskState = TaskStatusEnum.AGV_Takeing.ObjToInt(); |
| | | task.CurrentAddress = CurrentAddress; |
| | | task.NextAddress = NextAddress; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.AGV_Executing); |
| | | } |
| | | else |
| | | catch (Exception ex) |
| | | { |
| | | task.Dispatchertime = DateTime.Now; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.AGV_Takeing); |
| | | task.TaskState = TaskStatusEnum.Exception.ObjToInt(); |
| | | task.ExceptionMessage = ex.Message; |
| | | } |
| | | Thread.Sleep(500); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | task.TaskState = TaskStatusEnum.Exception.ObjToInt(); |
| | | task.ExceptionMessage = ex.Message; |
| | | } |
| | | } |
| | | if (newTasks.Count > 0) |
| | | { |
| | | _taskService.UpdateData(newTasks); |
| | | } |
| | | } |
| | | var newTasksLocations = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskStatusEnum.New.ObjToInt() && nameof(AGV_CPJob).Contains(x.DeviceCode) && !string.IsNullOrEmpty(x.DeviceCode) && x.Remark == "æµè¯ç©ºæ¡").ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList(); |
| | | if (newTasksLocations.Count>0) |
| | | { |
| | | foreach (var task in newTasksLocations) |
| | | { |
| | | try |
| | | { |
| | | string CurrentAddress = GetAGVAddress(task.CurrentAddress); |
| | | string NextAddress = GetAGVAddress(task.NextAddress); |
| | | AgvTaskDTO taskDTO = new AgvTaskDTO() |
| | | { |
| | | TaskCode = task.AgvTaskNum, |
| | | ReqCode = DateTime.Now.ToString("yyMMdd") + task.AgvTaskNum, |
| | | TaskTyp = "CP", |
| | | ctnrCode = task.PalletCode, |
| | | PositionCodePath = new List<CodePath>() |
| | | { |
| | | new CodePath() |
| | | { |
| | | type="05", |
| | | positionCode=CurrentAddress |
| | | }, |
| | | new CodePath() |
| | | { |
| | | type="05", |
| | | positionCode=NextAddress |
| | | } |
| | | }, |
| | | }; |
| | | //åéAGVä»»å¡ |
| | | WebResponseContent content = _taskService.AgvSendTask(taskDTO, APIEnum.Agv_CPSendTask); |
| | | if (!content.Status) |
| | | throw new Exception(content.Message); |
| | | task.TaskState = TaskStatusEnum.AGV_Takeing.ObjToInt(); |
| | | task.CurrentAddress = CurrentAddress; |
| | | task.NextAddress = NextAddress; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.AGV_Executing); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | task.TaskState = TaskStatusEnum.Exception.ObjToInt(); |
| | | task.ExceptionMessage = ex.Message; |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | using WIDESEAWCS_Common.APIEnum; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.Enums; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob; |
| | |
| | | } |
| | | } |
| | | _taskService.UpdateData(WaitToTasks); |
| | | |
| | | //åæ¾è´§å®æåå
¥å¼å¸¸å¤ç |
| | | Dt_Task? TakeErroeTask = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskStatusEnum.AGV_TakeError.ObjToInt() && nameof(AGV_ZHJob).Contains(x.DeviceCode)).First(); |
| | | if (TakeErroeTask != null) |
| | | { |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == TakeErroeTask.CurrentAddress); |
| | | if (stationManger == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°ç«å°é
ç½®"); |
| | | } |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); |
| | | if (device == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°å¯¹åºè®¾å¤"); |
| | | } |
| | | OtherDevice otherDevice = (OtherDevice)device; |
| | | otherDevice.SetValue(GroundStationDBName.W_TakeFinish, true, stationManger.StationCode); |
| | | Thread.Sleep(1000); |
| | | otherDevice.SetValue(GroundStationDBName.W_TakeFinish, false, stationManger.StationCode); |
| | | TakeErroeTask.TaskState = TaskStatusEnum.AGV_Finish.ObjToInt(); |
| | | var up = _taskRepository.DeleteAndMoveIntoHty(TakeErroeTask, OperateTypeEnum.èªå¨å®æ); |
| | | _taskService.TaskCompleted(TakeErroeTask.TaskNum); |
| | | } |
| | | Dt_Task? PutErroeTask = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskStatusEnum.AGV_PutError.ObjToInt() && nameof(AGV_ZHJob).Contains(x.DeviceCode)).First(); |
| | | if (PutErroeTask != null) |
| | | { |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == PutErroeTask.NextAddress); |
| | | if (stationManger == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°ç«å°é
ç½®"); |
| | | } |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); |
| | | if (device == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°ç«å°é
ç½®"); |
| | | } |
| | | OtherDevice otherDevice = (OtherDevice)device; |
| | | otherDevice.SetValue(GroundStationDBName.W_PutFinish, true, stationManger.StationCode); |
| | | PutErroeTask.CurrentAddress = stationManger.StationCode; |
| | | PutErroeTask.NextAddress = ""; |
| | | PutErroeTask.TaskState = TaskStatusEnum.AGV_Finish.ObjToInt(); |
| | | PutErroeTask.DeviceCode = "SC01_ZH"; |
| | | var up = _taskRepository.UpdateData(PutErroeTask); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using WIDESEAWCS_IBasicInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob; |
| | |
| | | private readonly IRouterService _routerService; |
| | | private readonly IStationMangerRepository _stationMangerRepository; |
| | | private readonly IMapper _mapper; |
| | | private readonly ITaskRepository _taskRepository; |
| | | |
| | | public AGV_ZHJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IStationMangerRepository stationMangerRepository, IMapper mapper) |
| | | public AGV_ZHJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IStationMangerRepository stationMangerRepository, IMapper mapper, ITaskRepository taskRepository) |
| | | { |
| | | _taskService = taskService; |
| | | _taskExecuteDetailService = taskExecuteDetailService; |
| | | _routerService = routerService; |
| | | _stationMangerRepository = stationMangerRepository; |
| | | _mapper = mapper; |
| | | _taskRepository = taskRepository; |
| | | } |
| | | public Task Execute(IJobExecutionContext context) |
| | | { |
| | |
| | | name: "å æ¶ ä»» å¡", |
| | | icon: '', |
| | | class: '', |
| | | type: 'danger', |
| | | value: 'TaskHandCancel', |
| | | onClick: function () { |
| | | } |
| | |
| | | if (rows.length == 0) return this.$error("è¯·éæ©æ°æ®!"); |
| | | if (rows.length > 1) return this.$error("è¯·éæ©ä¸æ¡æ°æ®!"); |
| | | var param = rows[0].taskNum; |
| | | var warehouseId = rows[0].warehouseId; |
| | | this.http |
| | | .post("api/Task/TaskCancel?taskNum="+param, "æ°æ®å¤çä¸...") |
| | | .post("api/Task/TaskHandCancel?taskNum="+param+"&&warehouseId="+warehouseId, "æ°æ®å¤çä¸...") |
| | | .then((x) => { |
| | | if (x.status) { |
| | | this.$Message.success('ä»»å¡åæ¶æå.'); |
| | |
| | | { title: "å建æ¶é´", field: "createDate", type: "datetime" }, |
| | | { title: "æå±ä»åº", field: "warehouseId",type: "selectList",dataKey: "warehouses",data: [],} |
| | | ], |
| | | [ |
| | | { title: "ç©æç¼å·", field: "materielCode", type: "like" }, |
| | | { title: "æ¹æ¬¡å·", field: "batchNo", type: "like" }, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | | { |
| | |
| | | field: "inboundOrderNo", |
| | | title: "åæ®ç¼å·", |
| | | type: "string", |
| | | width: 120, |
| | | width: 180, |
| | | align: "left", |
| | | link: true, |
| | | }, |
| | |
| | | field: "batchNo", |
| | | title: "æ¹æ¬¡å·", |
| | | type: "decimal", |
| | | width: 90, |
| | | width: 130, |
| | | align: "left", |
| | | edit: { type: "" }, |
| | | required: true, |
| | |
| | | field: "overInQuantity", |
| | | title: "䏿¶æ°é", |
| | | type: "string", |
| | | width: 200, |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | |
| | | dataKey: "purchaseOrderStatus", |
| | | data: [], |
| | | }, |
| | | ], |
| | | [ |
| | | { title: "ç©æç¼å·", field: "materielCode", type: "like" }, |
| | | { |
| | | title: "æå±ä»åº", |
| | | field: "warehouseId", |
| | | type: "select", |
| | | dataKey: "warehouses", |
| | | data: [], |
| | | }, |
| | | ] |
| | | ]); |
| | | const columns = ref([ |
| | |
| | | dataKey: "receiveStatus", |
| | | data: [], |
| | | }, |
| | | {title: "ç©æç¼å·",field: "materielCode",type: "like"}, |
| | | ], |
| | | [ |
| | | { title: "ä¾åºå", field: "suppliersId", type: "select",dataKey:"suppliers",data:[]}, |
| | | {field: "lotNo",title: "æ¹æ¬¡å·",type: "like",}, |
| | | { title: "ä¾åºå", field: "suppliersId", type: "selectList",dataKey:"suppliers",data:[]}, |
| | | { title: "å建è
", field: "creater", type: "like" }, |
| | | { title: "æå±ä»åº", field: "warehouseId",type: "selectList",dataKey: "warehouses",data: [],} |
| | | ], |
| | | [ |
| | | {field: "purchaseOrderNo",title: "éè´åå·",type: "like",}, |
| | | ], |
| | | ]); |
| | | |
| | | const editFormFields = ref({ |
| | |
| | | { title: "å建æ¶é´", field: "createDate", type: "datetime" }, |
| | | { title: "æå±ä»åº", field: "warehouseId",type: "selectList",dataKey: "warehouses",data: [],} |
| | | ], |
| | | [ |
| | | { title: "ç©æç¼å·", field: "materielCode", type: "like" }, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | | { |
| | |
| | | { |
| | | field: "orderStatus", |
| | | title: "åæ®ç¶æ", |
| | | type: "decimal", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | bind: { key: "outboundStatusEnum", data: [] }, |
| | |
| | | { title: "䏿¸¸åæ®ç¼å·", field: "upperOrderNo", type: "like" }, |
| | | { |
| | | title: "åæ®ç±»å", |
| | | field: "orderType", |
| | | field: "proOrderType", |
| | | type: "select", |
| | | dataKey: "outOrderType", |
| | | dataKey: "proOutOrderTypeEnum", |
| | | data: [], |
| | | }, |
| | | { |
| | | title: "åæ®ç¶æ", |
| | | field: "orderStatus", |
| | | type: "select", |
| | | dataKey: "outboundStatusEnum", |
| | | data: [], |
| | | }, |
| | | |
| | | ], |
| | | [ |
| | | { |
| | | title: "å建æ¹å¼", |
| | | field: "createType", |
| | | title: "åæ®ç¶æ", |
| | | field: "proOrderStatus", |
| | | type: "select", |
| | | dataKey: "createType", |
| | | dataKey: "outboundStatusEnum", |
| | | data: [], |
| | | }, |
| | | { title: "å建è
", field: "creater", type: "like" }, |
| | |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "è¶æ¡å·", field: "palletCode",type: "like" }, |
| | | // { title: "è´§ä½ç¼å·", field: "locationCode",type: "like" }, |
| | | { title: "è´§ä½ç¶æ", field: "locationStatus" ,type: "selectList",dataKey: "locationStatusEnum",data: [],}, |
| | | { title: "åºåç¶æ", field: "stockStatus",type: "selectList",dataKey: "stockStatusEmun",data: [],}, |
| | | { title: "产åç¼ç ", field: "productCode",type: "like"}, |
| | | ], |
| | | [ |
| | | { title: "æ¹æ¬¡å·", field: "lotNumber",type: "like"}, |
| | | { title: "产åçæ¬", field: "productVersion",type: "like"}, |
| | | { title: "è´§ä½ç¼å·", field: "locationCode",type: "like" }, |
| | | { title: "ææ´¾çæ¬", field: "specifyVer",type: "like"}, |
| | | { title: "æå±ä»åº", field: "warehouseId",type: "selectList",dataKey: "warehouses",data: [],}, |
| | | ], |
| | | [ |
| | | { title: "产åçæ¬", field: "productVersion",type: "like"}, |
| | | ] |
| | | ]); |
| | | const columns = ref([ |
| | |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "ç©æç¼å·", field: "materielCode" }, |
| | | { title: "ç©æåç§°", field: "materielName" }, |
| | | { title: "åæ®ç¼å·", field: "orderNo" }, |
| | | { title: "ç©æç¼å·", field: "materielCode",type :"like"}, |
| | | { title: "ç©æåç§°", field: "materielName",type :"like"}, |
| | | { title: "åæ®ç¼å·", field: "orderNo",type :"like"}, |
| | | ], |
| | | [ |
| | | { title: "æ¹æ¬¡å·", field: "batchNo",type :"like"}, |
| | | {title: "åºåæç»ç¶æ",field: "status",type: "select",dataKey:"stockStatusEmun", data: []}, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "æçç¼å·", field: "palletCode",type: "like" }, |
| | | // { title: "è´§ä½ç¼å·", field: "locationCode",type: "like" }, |
| | | { title: "è´§ä½ç¼å·", field: "locationCode",type: "like" }, |
| | | { title: "è´§ä½ç¶æ", field: "locationStatus" ,type: "selectList",dataKey: "locationStatusEnum",data: [],}, |
| | | { title: "åºåç¶æ", field: "stockStatus",type: "selectList",dataKey: "stockStatusEmun",data: [],}, |
| | | ], |
| | |
| | | int maxDepth = locationInfos.Max(x => x.Depth); |
| | | if (beRelocation.Row <= maxDepth) |
| | | { |
| | | locationInfos = locationInfos.Where(x => x.Row <= maxDepth).ToList(); |
| | | //è¿æ»¤å½åç§»åºçåååå± |
| | | locationInfos = locationInfos.Where(x => x.Row <= maxDepth && x.Column!= beRelocation.Column && x.Layer!=beRelocation.Layer).ToList(); |
| | | } |
| | | else if (beRelocation.Row > maxDepth) |
| | | { |
| | | locationInfos = locationInfos.Where(x => x.Row > maxDepth).ToList(); |
| | | //è¿æ»¤å½åç§»åºçåååå± |
| | | locationInfos = locationInfos.Where(x => x.Row > maxDepth && x.Column != beRelocation.Column && x.Layer != beRelocation.Layer).ToList(); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | continue; |
| | | } |
| | | Dt_PalletTypeInfo palletTypeInfoDepth = _basicRepository.PalletTypeInfoRepository.QueryFirst(x => x.WarehouseId == locationInfoExist.WarehouseId && x.PalletType == locationInfoExist.LocationType); |
| | | if (palletTypeInfoDepth != null && palletTypeInfoDepth.LocaitonCount != palletTypeInfo.LocaitonCount) |
| | | if (locationInfoExist.LocationType>0) |
| | | { |
| | | continue; |
| | | Dt_PalletTypeInfo palletTypeInfoDepth = _basicRepository.PalletTypeInfoRepository.QueryFirst(x => x.WarehouseId == locationInfoExist.WarehouseId && x.PalletType == locationInfoExist.LocationType); |
| | | if (palletTypeInfoDepth != null && palletTypeInfoDepth.LocaitonCount != palletTypeInfo.LocaitonCount) |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | else |
| | | { |
| | | List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); |
| | | moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != emptyLocation.LocationType) == null;//æ¥è¯¢å¤§äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºæè´§çè´§ä½ï¼å¦ææ¯trueï¼åè¡¨ç¤ºæ·±è´§ä½ææªè¢«ä½¿ç¨çæ
åµ |
| | | moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())) == null;//æ¥è¯¢å¤§äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºæè´§çè´§ä½ï¼å¦ææ¯trueï¼åè¡¨ç¤ºæ·±è´§ä½ææªè¢«ä½¿ç¨çæ
åµ |
| | | |
| | | List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); |
| | | littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != emptyLocation.LocationType) == null; //æ¥è¯¢å°äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºç©ºï¼ä¸ç¦ç¨ç¶æä¸ä¸ºç¦ç¨ä»¥ååªå
¥çè´§ä½ï¼å¦ææ¯trueï¼å表示æµ
è´§ä½è¢«ä½¿ç¨æè
被ç¦ç¨çæ
åµ |
| | | littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())) == null; //æ¥è¯¢å°äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºç©ºï¼ä¸ç¦ç¨ç¶æä¸ä¸ºç¦ç¨ä»¥ååªå
¥çè´§ä½ï¼å¦ææ¯trueï¼å表示æµ
è´§ä½è¢«ä½¿ç¨æè
被ç¦ç¨çæ
åµ |
| | | } |
| | | //if (moreDepthFlag && littleDepthFlag) |
| | | //{ |
| | |
| | | else |
| | | { |
| | | List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); |
| | | moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != emptyLocation.LocationType) == null;//æ¥è¯¢å¤§äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºæè´§çè´§ä½ï¼å¦ææ¯trueï¼åè¡¨ç¤ºæ·±è´§ä½ææªè¢«ä½¿ç¨çæ
åµ |
| | | moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())) == null;//æ¥è¯¢å¤§äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºæè´§çè´§ä½ï¼å¦ææ¯trueï¼åè¡¨ç¤ºæ·±è´§ä½ææªè¢«ä½¿ç¨çæ
åµ |
| | | |
| | | List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); |
| | | littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != emptyLocation.LocationType) == null; //æ¥è¯¢å°äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºç©ºï¼ä¸ç¦ç¨ç¶æä¸ä¸ºç¦ç¨ä»¥ååªå
¥çè´§ä½ï¼å¦ææ¯trueï¼å表示æµ
è´§ä½è¢«ä½¿ç¨æè
被ç¦ç¨çæ
åµ |
| | | littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())) == null; //æ¥è¯¢å°äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºç©ºï¼ä¸ç¦ç¨ç¶æä¸ä¸ºç¦ç¨ä»¥ååªå
¥çè´§ä½ï¼å¦ææ¯trueï¼å表示æµ
è´§ä½è¢«ä½¿ç¨æè
被ç¦ç¨çæ
åµ |
| | | } |
| | | |
| | | //List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); |
| | |
| | | { |
| | | continue; |
| | | } |
| | | Dt_PalletTypeInfo palletTypeInfoDepth = _basicRepository.PalletTypeInfoRepository.QueryFirst(x => x.WarehouseId == locationInfoExist.WarehouseId && x.PalletType == locationInfoExist.LocationType); |
| | | if (palletTypeInfoDepth != null && palletTypeInfoDepth.LocaitonCount != palletTypeInfo.LocaitonCount) |
| | | if (locationInfoExist.LocationType > 0) |
| | | { |
| | | continue; |
| | | Dt_PalletTypeInfo palletTypeInfoDepth = _basicRepository.PalletTypeInfoRepository.QueryFirst(x => x.WarehouseId == locationInfoExist.WarehouseId && x.PalletType == locationInfoExist.LocationType); |
| | | if (palletTypeInfoDepth != null && palletTypeInfoDepth.LocaitonCount != palletTypeInfo.LocaitonCount) |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | if (locationInfoExist.LocationStatus != LocationStatusEnum.Free.ObjToInt() || locationInfoExist.EnableStatus != EnableStatusEnum.Normal.ObjToInt()) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | |
| | | } |
| | | locationCaches_GM.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now }); |
| | | return locationInfo; |
| | |
| | | throw new Exception($"æªæ¾å°è´§ä½ä¿¡æ¯"); |
| | | } |
| | | int maxDepth = locationInfos.Max(x => x.Depth); |
| | | int mathCurrentRow = beRelocation.Row - Convert.ToInt32(Math.Ceiling(beRelocation.Row / maxDepth / 2.0)) * maxDepth * 2; |
| | | if (mathCurrentRow <= maxDepth) |
| | | if (beRelocation.Row <= maxDepth) |
| | | { |
| | | locationInfos = locationInfos.Where(x => x.Row - Convert.ToInt32(Math.Ceiling(x.Row / maxDepth / 2.0)) * maxDepth * 2 <= maxDepth).ToList(); |
| | | //è¿æ»¤å½åç§»åºçåååå± |
| | | locationInfos = locationInfos.Where(x => x.Row <= maxDepth && x.Column != beRelocation.Column && x.Layer != beRelocation.Layer).ToList(); |
| | | } |
| | | else |
| | | else if (beRelocation.Row > maxDepth) |
| | | { |
| | | locationInfos = locationInfos.Where(x => x.Row - Convert.ToInt32(Math.Ceiling(x.Row / maxDepth / 2.0)) * maxDepth * 2 > maxDepth).ToList(); |
| | | //è¿æ»¤å½åç§»åºçåååå± |
| | | locationInfos = locationInfos.Where(x => x.Row > maxDepth && x.Column != beRelocation.Column && x.Layer != beRelocation.Layer).ToList(); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | continue; |
| | | } |
| | | Dt_PalletTypeInfo palletTypeInfoDepth = _basicRepository.PalletTypeInfoRepository.QueryFirst(x => x.WarehouseId == locationInfoExist.WarehouseId && x.PalletType == locationInfoExist.LocationType); |
| | | if (palletTypeInfoDepth != null && palletTypeInfoDepth.LocaitonCount != palletTypeInfo.LocaitonCount) |
| | | if (locationInfoExist.LocationType > 0) |
| | | { |
| | | continue; |
| | | Dt_PalletTypeInfo palletTypeInfoDepth = _basicRepository.PalletTypeInfoRepository.QueryFirst(x => x.WarehouseId == locationInfoExist.WarehouseId && x.PalletType == locationInfoExist.LocationType); |
| | | if (palletTypeInfoDepth != null && palletTypeInfoDepth.LocaitonCount != palletTypeInfo.LocaitonCount) |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | } |
| | | else |
| | |
| | | { |
| | | continue; |
| | | } |
| | | Dt_PalletTypeInfo palletTypeInfoDepth = _basicRepository.PalletTypeInfoRepository.QueryFirst(x => x.WarehouseId == locationInfoExist.WarehouseId && x.PalletType == locationInfoExist.LocationType); |
| | | if (palletTypeInfoDepth != null && palletTypeInfoDepth.LocaitonCount != palletTypeInfo.LocaitonCount) |
| | | if (locationInfoExist.LocationType > 0) |
| | | { |
| | | continue; |
| | | Dt_PalletTypeInfo palletTypeInfoDepth = _basicRepository.PalletTypeInfoRepository.QueryFirst(x => x.WarehouseId == locationInfoExist.WarehouseId && x.PalletType == locationInfoExist.LocationType); |
| | | if (palletTypeInfoDepth != null && palletTypeInfoDepth.LocaitonCount != palletTypeInfo.LocaitonCount) |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | if (locationInfoExist.LocationStatus != LocationStatusEnum.Free.ObjToInt() || locationInfoExist.EnableStatus != EnableStatusEnum.Normal.ObjToInt()) |
| | | { |
| | |
| | | for (int j = location.Depth + 1; j <= maxDepth; j++) |
| | | { |
| | | Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == (row + 1)); |
| | | if (j == 3 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 1 || row == 6)) |
| | | #region æµè¯æ¶ãPP夿åç»è´§ä½ |
| | | if (j == 3 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 2 || row == 5)) |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && (x.Row == row + 2 || x.Row == row - 2)); |
| | | if (row <= maxDepth) |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 1); |
| | | } |
| | | else |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 1); |
| | | } |
| | | } |
| | | if (j == 3 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 3 || row == 4)) |
| | | { |
| | | if (row <= maxDepth) |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 2); |
| | | } |
| | | else |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 2); |
| | | } |
| | | } |
| | | if (j == 2 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 1 || row == 6)) |
| | | { |
| | | if (row <= maxDepth) |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 1); |
| | | } |
| | | else |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 1); |
| | | } |
| | | } |
| | | if (j == 2 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 3 || row == 4)) |
| | | { |
| | | if (row <= maxDepth) |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 1); |
| | | } |
| | | else |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 1); |
| | | } |
| | | } |
| | | #endregion |
| | | if (locationInfo != null) |
| | | { |
| | | groupLocations.Add(locationInfo); |
| | |
| | | for (int j = location.Depth - 1; j >= 1; j--) |
| | | { |
| | | Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == (row -1)); |
| | | if (j == 1 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 3 || row == 4)) |
| | | #region æµè¯æ¶ãPP夿åç»è´§ä½ |
| | | if (j == 1 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 1 || row == 6)) |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && (x.Row == row + 2 || x.Row == row - 2)); |
| | | if (row <= maxDepth) |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 2); |
| | | } |
| | | else |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 2); |
| | | } |
| | | } |
| | | if (j == 1 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 2 || row == 5)) |
| | | { |
| | | if (row <= maxDepth) |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 1); |
| | | } |
| | | else |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 1); |
| | | } |
| | | } |
| | | if (j == 2 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 1 || row == 6)) |
| | | { |
| | | if (row <= maxDepth) |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 1); |
| | | } |
| | | else |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 1); |
| | | } |
| | | } |
| | | #endregion |
| | | if (locationInfo != null) |
| | | { |
| | | groupLocations.Add(locationInfo); |
| | |
| | | for (int j = location.Depth + 1; j <= maxDepth; j++) |
| | | { |
| | | Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && (x.Row == row + 1 || x.Row == row - 1)); |
| | | if (j == 3 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 1 || row == 6)) |
| | | #region æµè¯æ¶ãPP夿åç»è´§ä½ |
| | | if (j == 3 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 2 || row == 5)) |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && (x.Row == row + 2 || x.Row == row - 2)); |
| | | if (row <= maxDepth) |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 1); |
| | | } |
| | | else |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 1); |
| | | } |
| | | } |
| | | if (j == 3 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 3 || row == 4)) |
| | | { |
| | | if (row <= maxDepth) |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 2); |
| | | } |
| | | else |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 2); |
| | | } |
| | | } |
| | | if (j == 2 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 1 || row == 6)) |
| | | { |
| | | if (row <= maxDepth) |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 1); |
| | | } |
| | | else |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 1); |
| | | } |
| | | } |
| | | if (j == 2 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 3 || row == 4)) |
| | | { |
| | | if (row <= maxDepth) |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 1); |
| | | } |
| | | else |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 1); |
| | | } |
| | | } |
| | | #endregion |
| | | if (locationInfo != null) |
| | | { |
| | | groupLocations.Add(locationInfo); |
| | |
| | | for (int j = location.Depth - 1; j >= 1; j--) |
| | | { |
| | | Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && (x.Row == row + 1 || x.Row == row - 1)); |
| | | if (j == 1 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 3 || row == 4)) |
| | | #region æµè¯æ¶ãPP夿åç»è´§ä½ |
| | | if (j == 1 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 1 || row == 6)) |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && (x.Row == row + 2 || x.Row == row - 2)); |
| | | if (row <= maxDepth) |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 2); |
| | | } |
| | | else |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 2); |
| | | } |
| | | } |
| | | if (j == 1 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 2 || row == 5)) |
| | | { |
| | | if (row <= maxDepth) |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 1); |
| | | } |
| | | else |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 1); |
| | | } |
| | | } |
| | | if (j == 2 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 1 || row == 6)) |
| | | { |
| | | if (row <= maxDepth) |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 1); |
| | | } |
| | | else |
| | | { |
| | | locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 1); |
| | | } |
| | | } |
| | | #endregion |
| | | if (locationInfo != null) |
| | | { |
| | | groupLocations.Add(locationInfo); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Common.OrderEnum |
| | | { |
| | | public enum ProOutOrderTypeEnum |
| | | { |
| | | /// <summary> |
| | | /// 订ååºè´§ |
| | | /// </summary> |
| | | [Description("订ååºè´§")] |
| | | 订ååºè´§ = 1, |
| | | |
| | | /// <summary> |
| | | /// éå®åºåº |
| | | /// </summary> |
| | | [Description("éå®åºåº")] |
| | | éå®åºåº = 2, |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | public virtual PageGridData<TEntity> GetPageData(PageDataOptions options) |
| | | { |
| | | |
| | | string wheres = options.ValidatePageOptions(TProperties); |
| | | |
| | | |
| | |
| | | /// </summary> |
| | | public class ProInStaticDTO |
| | | { |
| | | /// <summary> |
| | | /// 产åç¼ç |
| | | /// </summary> |
| | | public string ProductCode { get; set; } |
| | | /// <summary> |
| | | /// 产åçæ¬ |
| | | /// </summary> |
| | | public string ProductVersion { get; set; } |
| | | /// <summary> |
| | | /// æ»PCSæ° |
| | | /// </summary> |
| | | public float SumPcs { get; set; } |
| | | /// <summary> |
| | | /// æ»é¢ç§¯ |
| | | /// </summary> |
| | | public float SumPcsArea { get; set; } |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | public float OKPCSQTY { get; set; } |
| | | /// <summary> |
| | | /// å
å
æ»é¢ç§¯ |
| | | /// </summary> |
| | | public float OKPCSArea { get; set; } |
| | | /// <summary> |
| | | /// 卿 |
| | | /// </summary> |
| | | public string DateCode { get; set; } |
| | |
| | | /// </summary> |
| | | WebResponseContent OutProductSelect(int orderDetailId, List<ProStockViewDTO> proStockViews); |
| | | WebResponseContent GetZHMesMaterialLot(string materialLot); |
| | | /// <summary> |
| | | /// ä»»å¡åæ¶ |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <param name="warehouseId"></param> |
| | | /// <returns></returns> |
| | | public Task<WebResponseContent> TaskHandCancel(int taskNum, int warehouseId); |
| | | } |
| | | } |
| | |
| | | _warehouseService = warehouseService; |
| | | _palletTypeInfoRepository = palletTypeInfoRepository; |
| | | } |
| | | |
| | | public override PageGridData<Dt_InboundOrder> GetPageData(PageDataOptions options) |
| | | { |
| | | PageGridData<Dt_InboundOrder> pageGridData = base.GetPageData(options); |
| | | |
| | | ISugarQueryable<Dt_InboundOrder> sugarQueryable1 = BaseDal.Db.Queryable<Dt_InboundOrder>().Includes(x => x.Details); |
| | | if (!string.IsNullOrEmpty(options.Wheres)) |
| | | { |
| | | |
| | | List<SearchParameters> searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>(); |
| | | int totalCount = 0; |
| | | if (searchParametersList.Count > 0) |
| | | { |
| | | { |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_InboundOrderDetail.MaterielCode).FirstLetterToLower()); |
| | | if (searchParameters != null) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.Details.Any(v => v.MaterielCode.Contains(searchParameters.Value))); |
| | | List<Dt_InboundOrder> dataList = sugarQueryable1.ToPageList(options.Page, options.Rows, ref totalCount); |
| | | return new PageGridData<Dt_InboundOrder>(totalCount, dataList); |
| | | } |
| | | } |
| | | |
| | | { |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_InboundOrderDetail.BatchNo).FirstLetterToLower()); |
| | | if (searchParameters != null) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.Details.Any(v => v.BatchNo.Contains(searchParameters.Value))); |
| | | List<Dt_InboundOrder> dataList = sugarQueryable1.ToPageList(options.Page, options.Rows, ref totalCount); |
| | | return new PageGridData<Dt_InboundOrder>(totalCount, dataList); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return pageGridData; |
| | | } |
| | | public override object GetDetailPage(PageDataOptions pageData) |
| | | { |
| | | Type t = typeof(Dt_InboundOrder); |
| | |
| | | } |
| | | return palletTypeInfo.PalletType; |
| | | } |
| | | else if (warehouse.WarehouseCode == WarehouseEnum.HA60.ObjToString()) |
| | | { |
| | | return 4; |
| | | } |
| | | return -1; |
| | | } |
| | | /// <summary> |
| | |
| | | _invokeERPService = invokeERPService; |
| | | _basicRepository = basicRepository; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿åæ°æ® |
| | | /// </summary> |
| | | public void SaveStatic(MesBagInfoModel mesBagInfoModel) |
| | | { |
| | | List<ProInStaticDTO> mESBagDetails = mesBagInfoModel.BagDetails.GroupBy(x=>new { x.ProductCode, x.ProductVersion }).Select(x=>new ProInStaticDTO |
| | | List<ProInStaticDTO> mESBagDetails = mesBagInfoModel.BagDetails.GroupBy(x => new { x.ProductCode, x.ProductVersion }).Select(x => new ProInStaticDTO |
| | | { |
| | | ProductCode= x.Key.ProductCode, |
| | | ProductVersion= x.Key.ProductVersion, |
| | | SumPcs=x.Sum(x => x.OKPCSQTY) |
| | | ProductCode = x.Key.ProductCode, |
| | | ProductVersion = x.Key.ProductVersion, |
| | | SumPcs = x.Sum(x => x.OKPCSQTY), |
| | | SumPcsArea = x.Sum(x=>x.OKPCSArea) |
| | | }).ToList(); |
| | | List<Dt_ProInStatistics> proInStatistics= new List<Dt_ProInStatistics>(); |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x=>x.WarehouseCode==mesBagInfoModel.WarehouseCode); |
| | | foreach (var m in mESBagDetails) |
| | | { |
| | | string response = _invokeERPService.InvokeProInErpStatic(m.ProductCode, m.ProductCode + m.ProductVersion); |
| | | ErpProInErpStaticResponseContent erpProInErpStatic = response.DeserializeObject<ErpProInErpStaticResponseContent>(); |
| | | if (erpProInErpStatic.Code != 200) |
| | | { |
| | | return; |
| | | } |
| | | float adjusted = (float)Math.Round(erpProInErpStatic.Data[0].UnitArea, 3); |
| | | Dt_ProInStatistics inStatistics = new Dt_ProInStatistics() |
| | | { |
| | | WarehouseId = warehouse.WarehouseId, |
| | | ProductCode = m.ProductCode, |
| | | ProductRev = m.ProductVersion, |
| | | PcsQty = m.SumPcs, |
| | | SquareMeter = (float)Math.Round((adjusted * m.SumPcs), 3), |
| | | SquareMeter = (float)Math.Round(m.SumPcsArea, 3), |
| | | Remark = mesBagInfoModel.BatchNo |
| | | }; |
| | | proInStatistics.Add(inStatistics); |
| | |
| | | using System; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | |
| | | _supplierInfoRepository = supplierInfoRepository; |
| | | _materielInfoRepository = materielInfoRepository; |
| | | } |
| | | |
| | | public override PageGridData<Dt_PurchaseOrder> GetPageData(PageDataOptions options) |
| | | { |
| | | PageGridData<Dt_PurchaseOrder> pageGridData = base.GetPageData(options); |
| | | |
| | | ISugarQueryable<Dt_PurchaseOrder> sugarQueryable1 = BaseDal.Db.Queryable<Dt_PurchaseOrder>().Includes(x => x.Details); |
| | | if (!string.IsNullOrEmpty(options.Wheres)) |
| | | { |
| | | |
| | | List<SearchParameters> searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>(); |
| | | int totalCount = 0; |
| | | if (searchParametersList.Count > 0) |
| | | { |
| | | { |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_PurchaseOrderDetail.MaterielCode).FirstLetterToLower()); |
| | | if (searchParameters != null) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.Details.Any(v => v.MaterielCode.Contains(searchParameters.Value))); |
| | | List<Dt_PurchaseOrder> dataList = sugarQueryable1.ToPageList(options.Page, options.Rows, ref totalCount); |
| | | return new PageGridData<Dt_PurchaseOrder>(totalCount, dataList); |
| | | } |
| | | } |
| | | |
| | | { |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_PurchaseOrderDetail.WarehouseId).FirstLetterToLower()); |
| | | if (searchParameters != null && int.TryParse(searchParameters.Value, out int warehouseId)) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x =>x.Details.Any(v => v.WarehouseId == warehouseId)); |
| | | List<Dt_PurchaseOrder> dataList = sugarQueryable1.ToPageList(options.Page, options.Rows, ref totalCount); |
| | | return new PageGridData<Dt_PurchaseOrder>(totalCount, dataList); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return pageGridData; |
| | | } |
| | | public WebResponseContent GetPurchaseOrderInfo(string purchaseOrderNo) |
| | | { |
| | | try |
| | |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_DTO.ERP; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_External.ERPService; |
| | | using WIDESEA_External.Model; |
| | | using WIDESEA_IBasicRepository; |
| | |
| | | public override PageGridData<Dt_ReceiveOrder> GetPageData(PageDataOptions options) |
| | | { |
| | | PageGridData<Dt_ReceiveOrder> pageGridData = base.GetPageData(options); |
| | | //foreach (var item in pageGridData.Rows) |
| | | //{ |
| | | // //è·åæ¶è´§æç» |
| | | // item.PurchaseOrderNo |
| | | //} |
| | | |
| | | ISugarQueryable<Dt_ReceiveOrder> sugarQueryable1 = BaseDal.Db.Queryable<Dt_ReceiveOrder>().Includes(x => x.Details); |
| | | if (!string.IsNullOrEmpty(options.Wheres)) |
| | | { |
| | | |
| | | List<SearchParameters> searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>(); |
| | | int totalCount = 0; |
| | | if (searchParametersList.Count > 0) |
| | | { |
| | | { |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_ReceiveOrderDetail.MaterielCode).FirstLetterToLower()); |
| | | if (searchParameters != null) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.Details.Any(v => v.MaterielCode.Contains(searchParameters.Value))); |
| | | List<Dt_ReceiveOrder> dataList = sugarQueryable1.ToPageList(options.Page, options.Rows, ref totalCount); |
| | | return new PageGridData<Dt_ReceiveOrder>(totalCount, dataList); |
| | | } |
| | | } |
| | | { |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_ReceiveOrderDetail.LotNo).FirstLetterToLower()); |
| | | if (searchParameters != null) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.Details.Any(v => v.LotNo.Contains(searchParameters.Value))); |
| | | List<Dt_ReceiveOrder> dataList = sugarQueryable1.ToPageList(options.Page, options.Rows, ref totalCount); |
| | | return new PageGridData<Dt_ReceiveOrder>(totalCount, dataList); |
| | | } |
| | | } |
| | | { |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_ReceiveOrderDetail.PurchaseOrderNo).FirstLetterToLower()); |
| | | if (searchParameters != null) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.Details.Any(v => v.PurchaseOrderNo.Contains(searchParameters.Value))); |
| | | List<Dt_ReceiveOrder> dataList = sugarQueryable1.ToPageList(options.Page, options.Rows, ref totalCount); |
| | | return new PageGridData<Dt_ReceiveOrder>(totalCount, dataList); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | return pageGridData; |
| | | } |
| | | public override WebResponseContent AddData(SaveModel saveModel) |
| | |
| | | _takeStockOrderDetailRepository.UpdateData(takeStockOrderDetail); |
| | | BaseDal.UpdateData(takeStockOrder); |
| | | //æäº¤ERPé»è¾ |
| | | //if (takeStockOrder.TakeStockStatus== TakeStockStatusEnum.çç¹å®æ.ObjToInt()) |
| | | //{ |
| | | // ERPTakeStockModel eRPTakeStock = new ERPTakeStockModel() |
| | | // { |
| | | // Way = 1, |
| | | // UniqueTag = takeStockOrder.Id.ToString(), |
| | | // Code = takeStockOrder.OrderNo, |
| | | // FiscalPeriotime = takeStockOrder.CreateDate.ToString("yyyy-MM-dd"), |
| | | // Name=takeStockOrder.OrderNo, |
| | | // WarehouseCode= warehouse.WarehouseCode, |
| | | // Createuser=takeStockOrder.Creater, |
| | | // Createtime= takeStockOrder.CreateDate.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | // Details=new List<TakeDetailsItem>() |
| | | // }; |
| | | // foreach (var item in takeStockOrderDetails) |
| | | // { |
| | | // TakeDetailsItem takeDetailsItem = new TakeDetailsItem() |
| | | // { |
| | | // MaterialsCode=item.MaterielCode, |
| | | // LocationCode=item.LocationCode, |
| | | // Lotno=item.BatchNo, |
| | | // Sysqty=item.SysQty.ObjToDecimal(), |
| | | // Qty=item.Qty.ObjToDecimal() |
| | | // }; |
| | | // eRPTakeStock.Details.Add(takeDetailsItem); |
| | | // } |
| | | // string response = _invokeERPService.InvokeTakeStockApi(eRPTakeStock); |
| | | // ErpRequestContent erpRequestContent = response.DeserializeObject<ErpRequestContent>(); |
| | | // if (erpRequestContent.res != 1) |
| | | // { |
| | | // throw new Exception("忥ERP失败,é误信æ¯:" + erpRequestContent.Data); |
| | | // } |
| | | //} |
| | | if (takeStockOrder.TakeStockStatus == TakeStockStatusEnum.çç¹å®æ.ObjToInt()) |
| | | { |
| | | ERPTakeStockModel eRPTakeStock = new ERPTakeStockModel() |
| | | { |
| | | Way = 1, |
| | | UniqueTag = takeStockOrder.Id.ToString(), |
| | | Code = takeStockOrder.OrderNo, |
| | | FiscalPeriotime = takeStockOrder.CreateDate.ToString("yyyy-MM-dd"), |
| | | Name = takeStockOrder.OrderNo, |
| | | WarehouseCode = warehouse.WarehouseCode, |
| | | Createuser = takeStockOrder.Creater, |
| | | Createtime = takeStockOrder.CreateDate.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | Details = new List<TakeDetailsItem>() |
| | | }; |
| | | foreach (var item in takeStockOrderDetails) |
| | | { |
| | | TakeDetailsItem takeDetailsItem = new TakeDetailsItem() |
| | | { |
| | | MaterialsCode = item.MaterielCode, |
| | | LocationCode = item.LocationCode, |
| | | Lotno = item.BatchNo, |
| | | Sysqty = item.SysQty.ObjToDecimal(), |
| | | Qty = item.Qty.ObjToDecimal() |
| | | }; |
| | | eRPTakeStock.Details.Add(takeDetailsItem); |
| | | } |
| | | string response = _invokeERPService.InvokeTakeStockApi(eRPTakeStock); |
| | | ErpRequestContent erpRequestContent = response.DeserializeObject<ErpRequestContent>(); |
| | | if (erpRequestContent.res != 1) |
| | | { |
| | | throw new Exception("忥ERP失败,é误信æ¯:" + erpRequestContent.Data); |
| | | } |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | content.OK("çç¹æå"); |
| | | } |
| | |
| | | [Navigate(NavigateType.OneToMany, nameof(Dt_ReceiveOrderDetail.ReceiveOrderId), nameof(ReceiveOrderId))] |
| | | public List<Dt_ReceiveOrderDetail> Details { get; set; } |
| | | |
| | | [SugarColumn(IsIgnore = true)] |
| | | public string? PurchaseOrderNo { get; set; } |
| | | } |
| | | } |
| | |
| | | _outStockLockInfoService = outStockLockInfoService; |
| | | _outboundOrderRepository = outboundOrderRepository; |
| | | } |
| | | public override PageGridData<Dt_OutboundOrder> GetPageData(PageDataOptions options) |
| | | { |
| | | PageGridData<Dt_OutboundOrder> pageGridData = base.GetPageData(options); |
| | | |
| | | ISugarQueryable<Dt_OutboundOrder> sugarQueryable1 = BaseDal.Db.Queryable<Dt_OutboundOrder>().Includes(x => x.Details); |
| | | if (!string.IsNullOrEmpty(options.Wheres)) |
| | | { |
| | | |
| | | List<SearchParameters> searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>(); |
| | | int totalCount = 0; |
| | | if (searchParametersList.Count > 0) |
| | | { |
| | | { |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_OutboundOrderDetail.MaterielCode).FirstLetterToLower()); |
| | | if (searchParameters != null) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.Details.Any(v => v.MaterielCode.Contains(searchParameters.Value))); |
| | | List<Dt_OutboundOrder> dataList = sugarQueryable1.ToPageList(options.Page, options.Rows, ref totalCount); |
| | | return new PageGridData<Dt_OutboundOrder>(totalCount, dataList); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return pageGridData; |
| | | } |
| | | public override WebResponseContent AddData(SaveModel saveModel) |
| | | { |
| | | if (saveModel.MainData.TryGetValue(nameof(Dt_OutboundOrder.UpperOrderNo).FirstLetterToLower(), out object? upperOrderNo) && upperOrderNo != null && !string.IsNullOrEmpty(upperOrderNo.ToString())) |
| | |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.proStockInfoDetails.Any(v => v.LotNumber.Contains(searchParameters.Value))); |
| | | } |
| | | } |
| | | { |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_ProStockInfo.LocationCode).FirstLetterToLower()); |
| | | if (searchParameters != null) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.LocationCode == searchParameters.Value); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.Details.Any(v => v.BatchNo.Contains(searchParameters.Value))); |
| | | } |
| | | } |
| | | { |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_StockInfo.LocationCode).FirstLetterToLower()); |
| | | if (searchParameters != null) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.LocationCode == searchParameters.Value); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "proOutOrderTypeEnum": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | { |
| | | Type type = typeof(ProOutOrderTypeEnum); |
| | | List<int> enums = Enum.GetValues(typeof(ProOutOrderTypeEnum)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(ProOutOrderTypeEnum).GetField(((ProOutOrderTypeEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | | data.Add(new { key = item.ToString(), value = description.Description }); |
| | | } |
| | | else |
| | | { |
| | | data.Add(new { key = item.ToString(), value = item.ToString() }); |
| | | } |
| | | index++; |
| | | } |
| | | } |
| | | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | } |
| | | return result; |
| | | } |
| | |
| | | /// <returns></returns> |
| | | public MesResponseContent SubstrateOut(SubstrateOutModel model) |
| | | { |
| | | MesResponseContent content = new MesResponseContent(); |
| | | try |
| | | { |
| | | string line = string.Empty; |
| | |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == line); |
| | | if (warehouse == null) |
| | | { |
| | | return MesResponseContent.Instance.Error($"ä»åºåºç¡ä¿¡æ¯æªé
ç½®"); |
| | | return content.Error($"ä»åºåºç¡ä¿¡æ¯æªé
ç½®"); |
| | | } |
| | | |
| | | Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x => x.MaterielCode == model.MaterialCode); |
| | | if (materielInfo == null) |
| | | { |
| | | return MesResponseContent.Instance.Error($"æªæ¾å°è¯¥ç©æä¿¡æ¯"); |
| | | return content.Error($"æªæ¾å°è¯¥ç©æä¿¡æ¯"); |
| | | } |
| | | |
| | | //çæMESæ¿æåºåºåæ® |
| | | Dt_MesOutboundOrder mesOutboundOrder = new Dt_MesOutboundOrder() |
| | | { |
| | | CreateType = OrderCreateTypeEnum.UpperSystemPush.ObjToInt(), |
| | |
| | | }; |
| | | |
| | | List<Dt_Task> tasks = new List<Dt_Task>(); |
| | | |
| | | List<Dt_StockInfo>? stockInfos = null; |
| | | List<Dt_OutStockLockInfo>? outStockLockInfos = null; |
| | | List<Dt_LocationInfo>? locationInfos = null; |
| | |
| | | _outboundService.MesOutboundOrderService.Repository.AddData(mesOutboundOrder); |
| | | if (stockInfos != null && stockInfos.Count > 0 && outStockLockInfos != null && outStockLockInfos.Count > 0 && locationInfos != null && locationInfos.Count > 0) |
| | | { |
| | | WebResponseContent content = _outboundService.MesOutboundOrderService.LockOutboundStockDataUpdate(stockInfos, outStockLockInfos, locationInfos, tasks: tasks); |
| | | WebResponseContent contentResponse = _outboundService.MesOutboundOrderService.LockOutboundStockDataUpdate(stockInfos, outStockLockInfos, locationInfos, tasks: tasks); |
| | | |
| | | if (!content.Status) |
| | | if (!contentResponse.Status) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return MesResponseContent.Instance.Error(content.Message); |
| | | return content.Error(contentResponse.Message); |
| | | } |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | PushTasksToWCS(tasks); |
| | | |
| | | |
| | | return MesResponseContent.Instance.OK(); |
| | | //å°å¼æåé
çåºåæçè¿åç»MES |
| | | content.Content = new |
| | | { |
| | | VehicleCode = stockInfos?.Select(x => x.PalletCode).ToList() |
| | | }; |
| | | return content.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return MesResponseContent.Instance.Error(ex.Message); |
| | | return content.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | public async Task<WebResponseContent> TaskHandCancel(int taskNum,int warehouseId) |
| | | { |
| | | try |
| | | { |
| | | Dt_Task task = await Repository.QueryFirstAsync(x => x.TaskNum == taskNum); |
| | | if (task == null) |
| | | { |
| | | return await Task.FromResult(WebResponseContent.Instance.Error($"æªæ¾å°ä»»å¡ä¿¡æ¯")); |
| | | } |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup) |
| | | { |
| | | return await Task.FromResult(InboundTaskCompleted(taskNum)); |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | return await Task.FromResult(OutboundTaskCompleted(taskNum)); |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup) |
| | | { |
| | | return await Task.FromResult(RelocationTaskCompleted(task)); |
| | | } |
| | | else |
| | | { |
| | | return await Task.FromResult(WebResponseContent.Instance.Error($"æªæ¾å°è¯¥ç±»åä»»å¡,ä»»å¡ç±»å:{task.TaskType}")); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return await Task.FromResult(WebResponseContent.Instance.Error(ex.Message)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | //è·åæµè¯æ¶ååºåä¿¡æ¯ |
| | | //è·åé»çåºåä¿¡æ¯ |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == WarehouseEnum.HA154.ToString()); |
| | | //è·ååºåè®°å½ |
| | | List<Dt_StockInfo> stockInfos = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => |
| | |
| | | { |
| | | return content.Error($"æçç±»åä¿¡æ¯ä¸åå¨"); |
| | | } |
| | | ////è·åé»çæ¹æ¬¡ |
| | | //WebResponseContent requestLotInfo = GetZHMesMaterialLot(materialLot); |
| | | //if (!requestLotInfo.Status) |
| | | //{ |
| | | // return content.Error($"请æ±é»çæ¹æ¬¡ä¿¡æ¯å¤±è´¥,{requestLotInfo.Message}"); |
| | | //} |
| | | //MesLotInfoModel mesLotInfo = JsonConvert.DeserializeObject<MesLotInfoModel>(requestLotInfo.Data.ToString()); |
| | | MesLotInfoModel mesLotInfo = new MesLotInfoModel() |
| | | //è·åé»çæ¹æ¬¡ |
| | | WebResponseContent requestLotInfo = GetZHMesMaterialLot(materialLot); |
| | | if (!requestLotInfo.Status) |
| | | { |
| | | Product="FH001", |
| | | ProductVersion="A1", |
| | | Qty=20, |
| | | LotNo= materialLot, |
| | | IsFullNumber=true |
| | | }; |
| | | return content.Error($"请æ±é»çæ¹æ¬¡ä¿¡æ¯å¤±è´¥,{requestLotInfo.Message}"); |
| | | } |
| | | MesLotInfoModel mesLotInfo = JsonConvert.DeserializeObject<MesLotInfoModel>(requestLotInfo.Data.ToString()); |
| | | //MesLotInfoModel mesLotInfo = new MesLotInfoModel() |
| | | //{ |
| | | // Product="FH001", |
| | | // ProductVersion="A1", |
| | | // Qty=20, |
| | | // LotNo= materialLot, |
| | | // IsFullNumber=true |
| | | //}; |
| | | Dt_StockInfoDetail stockInfoDetail = new Dt_StockInfoDetail() |
| | | { |
| | | MaterielSpec = mesLotInfo.ProductVersion, |
| | |
| | | TaskStatus = 0, |
| | | TaskType = TaskTypeEnum.Relocation.ObjToInt() |
| | | }; |
| | | string MaterielCode = stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.MaterielCode; |
| | | float Quantity = (float)stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).Sum(x => x.StockQuantity); |
| | | string BatchNo = stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.BatchNo; |
| | | if (MaterielCode != null && Quantity != null && BatchNo != null) |
| | | { |
| | | newTask.MaterielCode = MaterielCode; |
| | | newTask.Quantity = Quantity; |
| | | newTask.BatchNo = BatchNo; |
| | | } |
| | | if (stockInfo.StockLength>0) |
| | | { |
| | | newTask.TaskLength = stockInfo.StockLength; |
| | |
| | | return _taskService.BoxStockin(model.Content); |
| | | } |
| | | /// <summary> |
| | | /// MESæååºåºæ¥å£è°ç¨ |
| | | /// MWMS忥æååºåºä¿¡æ¯è³MES |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("ShipmentOrderSync"), AllowAnonymous] |
| | |
| | | return _taskService.ShipmentOrderSync(model); |
| | | } |
| | | /// <summary> |
| | | /// MESæååºåºæ¥å£è°ç¨ |
| | | /// WMS忥æååºåºä¿¡æ¯è³MESå¤å
è£
æº |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("ShipmentOrderMESSync"), AllowAnonymous] |
| | |
| | | { |
| | | return Service.TakeOutbound(stockViews); |
| | | } |
| | | /// <summary> |
| | | /// ä»»å¡åæ¶ |
| | | /// </summary> |
| | | /// <param name="taskNum">ä»»å¡å·</param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("TaskHandCancel"), AllowAnonymous] |
| | | public async Task<WebResponseContent> TaskHandCancel(int taskNum ,int warehouseId) |
| | | { |
| | | return await Service.TaskHandCancel(taskNum,warehouseId); |
| | | } |
| | | } |
| | | } |