| | |
| | | using AutoMapper; |
| | | using Microsoft.AspNetCore.Mvc.ApiExplorer; |
| | | using Newtonsoft.Json; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Math; |
| | | using SqlSugar; |
| | | using System.Reflection.Emit; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.CommonEnum; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Common.MaterielEnum; |
| | | using WIDESEA_Common.OrderEnum; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Common.TaskEnum; |
| | |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_DTO.ERP; |
| | | using WIDESEA_DTO.Inbound; |
| | | using WIDESEA_DTO.Outbound; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_DTO.Task; |
| | | using WIDESEA_External.ERPService; |
| | |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¯ç¨ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent EnableStatus(int[] keys) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | List<Dt_Task> tasks = BaseDal.QueryData(x => x.TaskType < TaskTypeEnum.Inbound.ObjToInt()); |
| | | List<Dt_AGVStationInfo> stationInfos = _basicRepository.AGVStationInfoRepository.QueryData(x => keys.Contains(x.Id)); |
| | | foreach (var station in stationInfos) |
| | | { |
| | | Dt_Task? taskOld = tasks.FirstOrDefault(x => x.TargetAddress == station.AGVStationCode); |
| | | if (taskOld!=null) |
| | | { |
| | | content.Message+= $"{station.AGVStationCode}åºåº{taskOld.TaskNum}任塿§è¡ä¸;"; |
| | | continue; |
| | | } |
| | | if (station.StationArea==StationAreaEnum.䏿¥¼æåæ¶.ToString()) |
| | | { |
| | | Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.QueryFirst(x=>x.LocationCode==station.AGVStationCode); |
| | | if (stockInfo!=null) |
| | | { |
| | | content.Message += $"{station.AGVStationCode}{stockInfo.PalletCode}åºåç»å®;"; |
| | | continue; |
| | | } |
| | | } |
| | | station.IsOccupied = WhetherEnum.False.ObjToInt(); |
| | | } |
| | | _basicRepository.AGVStationInfoRepository.UpdateData(stationInfos); |
| | | content.OK(content.Message.IsNullOrEmpty() ? "æå" : $"é¨åæåå¯ç¨!{content.Message}æ æ³å¯ç¨"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// ç¦ç¨ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent DisableStatus(int[] keys) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | List<Dt_AGVStationInfo> stationInfos = _basicRepository.AGVStationInfoRepository.QueryData(x => keys.Contains(x.Id)); |
| | | stationInfos.ForEach(x => |
| | | { |
| | | x.IsOccupied = WhetherEnum.True.ObjToInt(); |
| | | }); |
| | | _basicRepository.AGVStationInfoRepository.UpdateData(stationInfos); |
| | | content.OK("æå"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | } |