yanjinhui
5 天以前 79cea1bc2685b73f2f6a29379f37580ca1a38c79
优化提升机质检料箱接口,添加平库的修改库区以及查看
已修改3个文件
59 ■■■■■ 文件已修改
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_StationInfo.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TSJJob.cs 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_StationInfo.cs
@@ -35,6 +35,13 @@
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "站台名称")]
        public string StationName { get; set; }
        /// <summary>
        /// åŒºåŸŸ
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "区域")]
        public int StationRegion { get; set; }
        /// <summary>
        /// ç«™å°ç±»åž‹ <br/>
        /// 1:只入 <br/>
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -514,6 +514,7 @@
                var rgv = new List<Dt_RGVLocationInfo>();
                var kls = new List<Dt_KLSLocationInfo>();
                var hk = new List<Dt_HKLocationInfo>();
                var pk = new List<Dt_StationInfo>();
                if (wMSUpdateLocationArea.WarehouseId == 1)
                {
                    var rgvList = _rGVLocationInfoService.Repository.QueryData(x => wMSUpdateLocationArea.LocationCodes.Contains(x.LocationCode)).ToList();
@@ -541,6 +542,15 @@
                        item.WarehouseId = wMSUpdateLocationArea.UpdateAreaCode.ObjToInt();
                    }
                    hk.AddRange(hkList);
                }
                if (wMSUpdateLocationArea.WarehouseId == 4)
                {
                    var pkList = _stationInfo.Repository.QueryData(x => wMSUpdateLocationArea.LocationCodes.Contains(x.StationCode)).ToList();
                    foreach (var item in pk)
                    {
                        item.StationRegion = wMSUpdateLocationArea.UpdateAreaCode.ObjToInt();
                    }
                    pk.AddRange(pkList);
                }
                Db.Ado.BeginTran();
                _rGVLocationInfoService.UpdateData(rgv);
@@ -1207,6 +1217,25 @@
                    }
                    content.OK(data: list);
                }
                else if (getLocationInfo.WarehouseId == 6)
                {
                    List<Dt_StationInfo> StationInfo = new List<Dt_StationInfo>();
                    if (!string.IsNullOrEmpty(getLocationInfo.AreaCode))
                        StationInfo = _stationInfo.Repository.QueryData(x => x.StationRegion == getLocationInfo.AreaCode.ObjToInt());
                    else
                        StationInfo = _stationInfo.Repository.QueryData();
                    foreach (var item in StationInfo)
                    {
                        list.Add(new
                        {
                            LoctionCode = item.StationCode,
                            LocationStatus = item.StationStatus,
                            EnableStatus = item.IsOccupied,
                            PalletCode = item.PalletCode
                        });
                    }
                    content.OK(data: list);
                }
            }
            catch (Exception ex)
            {
@@ -1280,7 +1309,9 @@
                string dataJson = wMSReturn.result.ToString();
                Exists? exists = JsonConvert.DeserializeObject<Exists>(dataJson);
                if (exists == null) throw new Exception($"WMS返回结果的result转换失败");
                //如果成功就不返回
                if (exists.taskExists) return WebResponseContent.Instance.OK();
                //如果失败了就返回exists.errorAreaCode
                return WebResponseContent.Instance.OK(exists.errorAreaCode);
            }
            catch (Exception ex)
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TSJJob.cs
@@ -14,6 +14,7 @@
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common;
using WIDESEAWCS_Common.LocationEnum;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Communicator;
using WIDESEAWCS_Core.Helper;
@@ -33,10 +34,13 @@
    {
        private readonly ITaskService _taskService;
        private readonly IStationMangerService _stationMangerService;
        public TSJJob(ITaskService taskService, IStationMangerService stationMangerService)
        private readonly IStationInfoService _stationInfoService;
        public TSJJob(ITaskService taskService, IStationMangerService stationMangerService, IStationInfoService stationInfoService)
        {
            _taskService = taskService;//注入
            _stationMangerService = stationMangerService;
            _stationInfoService = stationInfoService;
        }
        public Task Execute(IJobExecutionContext context)
@@ -207,10 +211,19 @@
                                }
                                else
                                {
                                    //如果质检通过就不改变RK3FTask.TargetAddress的值,
                                    if (!string.IsNullOrEmpty(Verification.Message))
                                    {
                                        //寻找平库货位
                                        var Location = _stationInfoService.Repository.QueryFirst(x=>x.StationRegion==Verification.Message.ObjToInt()&&x.StationStatus==(int)LocationStatusEnum.Free&&x.FloorNumber=="CC"&&x.IsOccupied==(int)LocationStatusEnum.Free);
                                        RK3FTask.NextAddress = Location.StationCode;
                                        RK3FTask.TargetAddress = Location.StationCode;
                                    RK3FTask.CurrentAddress = RK3FTask.TargetAddress;
                                    if (!string.IsNullOrEmpty(Verification.Message)) RK3FTask.TargetAddress = Verification.Message;
                                    //如果料箱检验成功就写入读码器的值
                                    var result = _taskService.Hikvisiontaskscontinue(RK3FTask.WMSTaskNum, RK3FTask.TargetAddress);
                                        _taskService.UpdateData(RK3FTask);
                                    }
                                        //调用海康进行执行完成接口
                                        var result = _taskService.Hikvisiontaskscontinue(RK3FTask.WMSTaskNum, RK3FTask.NextAddress);
                                    if (result.Status)
                                    {
                                        RK3FTask.ExceptionMessage = "";