|  |  |  | 
|---|
|  |  |  | using iWareCommon.Utils; | 
|---|
|  |  |  | using iWareModel; | 
|---|
|  |  |  | using iWareSda.Model; | 
|---|
|  |  |  | using Newtonsoft.Json; | 
|---|
|  |  |  | using System; | 
|---|
|  |  |  | using System.Collections.Generic; | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 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; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// 写PLC bool | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | /// <param name="deviceId"></param> | 
|---|
|  |  |  | /// <param name="dbAddress"></param> | 
|---|
|  |  |  | /// <param name="value"></param> | 
|---|
|  |  |  | /// <returns></returns> | 
|---|
|  |  |  | public SdaResEntity WriteBoolPlcData(int deviceId, string dbAddress, bool value) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 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.WriteBoolPlcData(dbAddress, 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> | 
|---|
|  |  |  | /// <param name="value"></param> | 
|---|
|  |  |  | 
|---|
|  |  |  | /// <param name="deviceId"></param> | 
|---|
|  |  |  | /// <param name="value"></param> | 
|---|
|  |  |  | /// <returns></returns> | 
|---|
|  |  |  | public SdaResEntity InboundFinishConfirm(int deviceId, string stationCode) | 
|---|
|  |  |  | public SdaResEntity InboundFinishConfirm(int deviceId, bool value, string stationCode) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | SdaResEntity _SdaResEntity = new SdaResEntity(); | 
|---|
|  |  |  | try | 
|---|
|  |  |  | 
|---|
|  |  |  | var Station = StationResult.resData as StationEntity; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | string msg = ""; | 
|---|
|  |  |  | var result = Station.InboundFinishConfirm(stationCode, out msg); | 
|---|
|  |  |  | var result = Station.InboundFinishConfirm(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> | 
|---|
|  |  |  | /// <param name="value"></param> | 
|---|
|  |  |  | /// <returns></returns> | 
|---|
|  |  |  | public SdaResEntity OutboundFinishConfirm(int deviceId, bool value, string stationCode, bool isClearData) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 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.OutboundFinishConfirm(stationCode, value, out msg, isClearData); | 
|---|
|  |  |  | _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> | 
|---|
|  |  |  | /// <param name="value"></param> | 
|---|
|  |  |  | /// <param name="stationCode"></param> | 
|---|
|  |  |  | /// <returns></returns> | 
|---|
|  |  |  | public SdaResEntity ChangeMode(int deviceId, int 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.ChangeMode(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> | 
|---|
|  |  |  | /// <param name="value"></param> | 
|---|
|  |  |  | /// <param name="stationCode"></param> | 
|---|
|  |  |  | /// <returns></returns> | 
|---|
|  |  |  | public SdaResEntity PartClear(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.PartClear(stationCode, value, out msg); | 
|---|
|  |  |  | _SdaResEntity.result = result; | 
|---|
|  |  |  | _SdaResEntity.resMsg = msg; | 
|---|
|  |  |  | return _SdaResEntity; | 
|---|
|  |  |  | 
|---|
|  |  |  | /// <param name="deviceId"></param> | 
|---|
|  |  |  | /// <param name="value"></param> | 
|---|
|  |  |  | /// <returns></returns> | 
|---|
|  |  |  | public SdaResEntity WriteInStoreTaskInfo(int deviceId, string stationCode, string toPlaceNo, short length, short width, short height) | 
|---|
|  |  |  | public SdaResEntity WriteInStoreTaskInfo(int deviceId, string stationCode, string toPlaceNo, short length, short width, short height, int inbound_TaskID) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | SdaResEntity _SdaResEntity = new SdaResEntity(); | 
|---|
|  |  |  | try | 
|---|
|  |  |  | 
|---|
|  |  |  | var Station = StationResult.resData as StationEntity; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | string msg = ""; | 
|---|
|  |  |  | var result = Station.WriteInStoreTaskInfo(stationCode, toPlaceNo, length, width, height, out msg); | 
|---|
|  |  |  | var result = Station.WriteInStoreTaskInfo(stationCode, toPlaceNo, length, width, height, out msg, inbound_TaskID); | 
|---|
|  |  |  | _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> | 
|---|
|  |  |  | /// <param name="value"></param> | 
|---|
|  |  |  | /// <returns></returns> | 
|---|
|  |  |  | public SdaResEntity WritePalletizingTaskInfo(int deviceId, string stationCode, int taskID, short length, short width, short height, short rotate, short toplace, short placeX, short placeY, short placeZ, short lastnum) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 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.WritePalletizingTaskInfo(stationCode, taskID, length, width, height, rotate, toplace, placeX, placeY, placeZ, lastnum, 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> | 
|---|
|  |  |  | /// <param name="value"></param> | 
|---|
|  |  |  | /// <returns></returns> | 
|---|
|  |  |  | public SdaResEntity SetPalletizingTaskFinishAck(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_FinishACK(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> | 
|---|
|  |  |  | /// <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, bool isNgFlag) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 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.WriteSurroundTaskInfo(stationCode, taskID, length, width, cartonhigh, cartonwidth, placex, placey, out msg, isNgFlag); | 
|---|
|  |  |  | _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> | 
|---|
|  |  |  | /// <param name="value"></param> | 
|---|
|  |  |  | /// <returns></returns> | 
|---|
|  |  |  | public SdaResEntity SetSurroundTaskFinishAck(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.WriteSurround_FinishACK(stationCode, value, out msg); | 
|---|
|  |  |  | _SdaResEntity.result = result; | 
|---|
|  |  |  | _SdaResEntity.resMsg = msg; | 
|---|
|  |  |  | return _SdaResEntity; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | catch (Exception ex) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | _SdaResEntity.result = false; | 
|---|
|  |  |  | _SdaResEntity.resMsg = ex.Message; | 
|---|
|  |  |  | return _SdaResEntity; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | public SdaResEntity WriteStation_ACK(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_ACK(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> | 
|---|
|  |  |  | /// <param name="value"></param> | 
|---|
|  |  |  | /// <param name="stationCode"></param> | 
|---|
|  |  |  | /// <returns></returns> | 
|---|
|  |  |  | public SdaResEntity WriteStation_AllowIn(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_AllowIn(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> | 
|---|
|  |  |  | /// 写入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> | 
|---|
|  |  |  | /// <param name="value"></param> | 
|---|
|  |  |  | /// <param name="stationCode"></param> | 
|---|
|  |  |  | /// <returns></returns> | 
|---|
|  |  |  | public SdaResEntity WriteStation_PersonAllow(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_PersonAllow(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> | 
|---|
|  |  |  | /// <param name="stationCode"></param> | 
|---|
|  |  |  | /// <param name="sourcePlaceNo"></param> | 
|---|
|  |  |  | /// <param name="outbound_TaskID"></param> | 
|---|
|  |  |  | /// <returns></returns> | 
|---|
|  |  |  | public SdaResEntity WriteOutStoreTaskInfo(bool isResetData, int deviceId, string stationCode, string sourcePlaceNo, int outbound_TaskID) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 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.WriteOutStoreTaskInfo(isResetData, stationCode, sourcePlaceNo, out msg, outbound_TaskID); | 
|---|
|  |  |  | _SdaResEntity.result = result; | 
|---|
|  |  |  | _SdaResEntity.resMsg = msg; | 
|---|
|  |  |  | return _SdaResEntity; | 
|---|