diff --git a/DataVAPI.ServerDB/MongoDB/MongodbHelper.cs b/DataVAPI.ServerDB/MongoDB/MongodbHelper.cs index bdf4b72..5d9508b 100644 --- a/DataVAPI.ServerDB/MongoDB/MongodbHelper.cs +++ b/DataVAPI.ServerDB/MongoDB/MongodbHelper.cs @@ -79,7 +79,7 @@ namespace DataVAPI.ServerDB.MongoDB public void Modify(string id, string field, string value) { - var filter = Builders.Filter.Eq("IdStr", id); + var filter = Builders.Filter.Eq("Id", id); var updated = Builders.Update.Set(field, value); UpdateResult result = collection.UpdateOneAsync(filter, updated).Result; } @@ -115,13 +115,13 @@ namespace DataVAPI.ServerDB.MongoDB old.State = "y"; old.UpdateTime = DateTime.Now;//.ToString("yyyy-MM-dd HH:mm:ss"); - var filter = Builders.Filter.Eq("IdStr", entity.Id); + var filter = Builders.Filter.Eq("Id", entity.Id); ReplaceOneResult result = collection.ReplaceOneAsync(filter, old).Result; } public void Delete(string id) { - var filter = Builders.Filter.Eq("IdStr",id); + var filter = Builders.Filter.Eq("Id", id); collection.DeleteOneAsync(filter); } diff --git a/DataVAPI/Controllers/DeviceController.cs b/DataVAPI/Controllers/DeviceController.cs index c680ed9..36b0241 100644 --- a/DataVAPI/Controllers/DeviceController.cs +++ b/DataVAPI/Controllers/DeviceController.cs @@ -88,6 +88,24 @@ namespace DataVAPI.Controllers } } /// + /// 根据设备名称查询数据 + /// + /// ID + [HttpGet] + public JsonMsg QueryDeviceName(string DeviceName) + { + st = System.Reflection.MethodBase.GetCurrentMethod().Name; + try + { + DeviceTable device = mg.QueryDeviceName(DeviceName); + return JsonMsg.OK(device, st); + } + catch (Exception ex) + { + return JsonMsg.Error(null, st, ex.Message); + } + } + /// /// 根据客户端ID、设备ID、时间查询设备信息 /// /// 客户端ID diff --git a/DataVAPI/Controllers/OrderController.cs b/DataVAPI/Controllers/OrderController.cs index 1d2f0a5..1cf71c1 100644 --- a/DataVAPI/Controllers/OrderController.cs +++ b/DataVAPI/Controllers/OrderController.cs @@ -29,6 +29,27 @@ namespace DataVAPI.Controllers return JsonMsg.Error(null, st, ex.Message); } } + /// + /// + /// + /// + /// + [HttpGet] + public JsonMsg GetAllOrderDataState(int OrgId) + { + st = System.Reflection.MethodBase.GetCurrentMethod().Name; + try + { + FullScreenInput fullScreen = new FullScreenInput(); + fullScreen.OrgId = OrgId; + object retdata = orderProvider.GetAllOrderDataState(fullScreen); + return JsonMsg.OK(retdata, st); + } + catch (System.Exception ex) + { + return JsonMsg.Error(null, st, ex.Message); + } + } /// /// 折线图 diff --git a/DataVIOT.Help/MainWindow.xaml b/DataVIOT.Help/MainWindow.xaml index a219785..00ccc05 100644 --- a/DataVIOT.Help/MainWindow.xaml +++ b/DataVIOT.Help/MainWindow.xaml @@ -35,7 +35,7 @@ API查询地址: - http://111.9.47.105:21527/datav + https://bpa.black-pa.com:21527/datav diff --git a/DataVIOT.Help/ViewModel/MainViewModel.cs b/DataVIOT.Help/ViewModel/MainViewModel.cs index c7f0bba..1ec45b1 100644 --- a/DataVIOT.Help/ViewModel/MainViewModel.cs +++ b/DataVIOT.Help/ViewModel/MainViewModel.cs @@ -51,7 +51,7 @@ namespace DataVIOT.Help.ViewModel /// /// API 地址 /// - public string ApiURL = "http://192.168.1.90:6005"; + public string ApiURL = "https://bpa.black-pa.com:21527/datav"; #endregion #region 不需要监听