22
schangxiang@126.com
2024-12-15 f8c3e66071ff442b25c17e13c91b0b6e1d1cbea5
SDA/iWareSda/Devices/4-Station/StationService/StationService.cs
@@ -1,5 +1,6 @@
using iWareCommon.Utils;
using iWareModel;
using iWareSda.Model;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
@@ -188,6 +189,22 @@
            }
            var Station = (StationResult.resData as StationEntity).View;
            return Station;
        }
        /// <summary>
        /// 获取当前正在报警的报警列表
        /// </summary>
        /// <param name="deviceId"></param>
        /// <returns></returns>
        public List<DeviceWarningInfo> GetWaringInfoList(int deviceId, List<WmsConfigDeviceWarning> configDeviceWarningList)
        {
            var StationResult = Station_CacheEntity.GetDeviceObj(deviceId);
            if (!StationResult.result)
            {
                return null;
            }
            var waringList = (StationResult.resData as StationEntity).GetStationAlertDatas(configDeviceWarningList);
            return waringList;
        }
@@ -667,7 +684,8 @@
        /// <param name="deviceId"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public SdaResEntity WriteSurroundTaskInfo(int deviceId, string stationCode, short taskID, short length, short width, short cartonhigh, short cartonwidth, short placex, short placey)
        public SdaResEntity WriteSurroundTaskInfo(int deviceId, string stationCode, short taskID, short length, short width,
            short cartonhigh, short cartonwidth, short placex, short placey, bool isNgFlag)
        {
            SdaResEntity _SdaResEntity = new SdaResEntity();
            try
@@ -680,7 +698,7 @@
                var Station = StationResult.resData as StationEntity;
                string msg = "";
                var result = Station.WriteSurroundTaskInfo(stationCode, taskID, length, width, cartonhigh, cartonwidth, placex, placey, out msg);
                var result = Station.WriteSurroundTaskInfo(stationCode, taskID, length, width, cartonhigh, cartonwidth, placex, placey, out msg, isNgFlag);
                _SdaResEntity.result = result;
                _SdaResEntity.resMsg = msg;
                return _SdaResEntity;
@@ -783,6 +801,39 @@
        }
        /// <summary>
        /// 写入NG包标记
        /// </summary>
        /// <param name="deviceId"></param>
        /// <param name="value"></param>
        /// <param name="stationCode"></param>
        /// <returns></returns>
        public SdaResEntity WriteStation_NgFlag(int deviceId, bool value, string stationCode)
        {
            SdaResEntity _SdaResEntity = new SdaResEntity();
            try
            {
                var StationResult = Station_CacheEntity.GetDeviceObj(deviceId);
                if (!StationResult.result)
                {
                    return StationResult;
                }
                var Station = StationResult.resData as StationEntity;
                string msg = "";
                var result = Station.WriteStation_NgFlag(stationCode, value, out msg);
                _SdaResEntity.result = result;
                _SdaResEntity.resMsg = msg;
                return _SdaResEntity;
            }
            catch (Exception ex)
            {
                _SdaResEntity.result = false;
                _SdaResEntity.resMsg = ex.Message;
                return _SdaResEntity;
            }
        }
        /// <summary>
        /// 写入 人工放行
        /// </summary>
        /// <param name="deviceId"></param>