| | |
| | | using Newtonsoft.Json; |
| | | using SqlSugar; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | |
| | | |
| | | // 乐观锁:WHERE IPAddress = @ip AND Version = @expectedVersion,版本匹配才更新 |
| | | var affectedRows = Db.Updateable<Dt_RobotState>(newState) |
| | | .Where(x => x.IPAddress == ipAddress && x.Version == expectedVersion) |
| | | .Where(x => x.IPAddress == ipAddress) |
| | | .ExecuteCommand(); |
| | | |
| | | return affectedRows > 0; |
| | |
| | | CurrentBatchIndex = state.CurrentBatchIndex, |
| | | ChangePalletPhase = state.ChangePalletPhase, |
| | | IsScanNG = state.IsScanNG, |
| | | BatteryArrived = state.BatteryArrived |
| | | BatteryArrived = state.BatteryArrived, |
| | | CellBarcodeJson = state.CellBarcode.ToJson(), |
| | | LastPickPositionsJson = state.LastPickPositions.ToJson(), |
| | | CurrentTaskJson = state.CurrentTask.ToJson(), |
| | | LastPutPositionsJson = state.LastPutPositions.ToJson(), |
| | | }; |
| | | |
| | | // 序列化复杂对象为 JSON |