diff --git a/04.系统编码/App/Content/scripts/beijing/realtime-panel.js b/04.系统编码/App/Content/scripts/beijing/realtime-panel.js index 67843e3..dd129c6 100644 --- a/04.系统编码/App/Content/scripts/beijing/realtime-panel.js +++ b/04.系统编码/App/Content/scripts/beijing/realtime-panel.js @@ -152,7 +152,7 @@ if (Config.InProductionMode) this.SubmitTask(this.TaskInfo.Id); else - this.SubmitTest('202111060851610', 100.9, 36.94); + this.SubmitTest(this.TaskInfo.Id, 39.917, 116.405); }; this.OnResetButtonClick = function () { @@ -288,7 +288,6 @@ this.GetTaskParams = function (taskId) { return { - userId: parseInt($('.admin span').attr('userid')), taskId: taskId, region: 'bj', longitude: $('#longitude').val(), @@ -340,6 +339,7 @@ this.TaskInfo.Result = result; this.Parent.Map.CenterMap(lat, lon); + this.AddTask(this.TaskInfo.Id); this.LoadData(result); }.bind(this) }); diff --git a/04.系统编码/App/Content/scripts/menggu/realtime-panel.js b/04.系统编码/App/Content/scripts/menggu/realtime-panel.js index faa41f0..196d5a2 100644 --- a/04.系统编码/App/Content/scripts/menggu/realtime-panel.js +++ b/04.系统编码/App/Content/scripts/menggu/realtime-panel.js @@ -151,7 +151,6 @@ this.GetTaskParams = function (taskId) { return { - userId: parseInt($('.admin span').attr('userid')), taskId: taskId, region: 'mg', longitude: $('#longitude').val(), diff --git a/04.系统编码/App/Controllers/BeijingController.cs b/04.系统编码/App/Controllers/BeijingController.cs index 7ed89b7..d22fac3 100644 --- a/04.系统编码/App/Controllers/BeijingController.cs +++ b/04.系统编码/App/Controllers/BeijingController.cs @@ -40,9 +40,10 @@ namespace BeijingSafeguard.Controllers } [HttpPost] - public void AddTask(int userId, string taskId, string region, decimal longitude, decimal latitude, decimal height, decimal simulatedDuration, decimal simulatedInterval, DateTime releaseTime, int resultState, string resultMessage) + public void AddTask(string taskId, string region, decimal longitude, decimal latitude, decimal height, decimal simulatedDuration, decimal simulatedInterval, DateTime releaseTime, int resultState, string resultMessage) { - TaskBLL.Add(userId, taskId, region, longitude, latitude, height, simulatedDuration, simulatedInterval, releaseTime, resultState, resultMessage); + User user = GetLoginUser(); + TaskBLL.Add(user.OrgId, user.Id, taskId, region, longitude, latitude, height, simulatedDuration, simulatedInterval, releaseTime, resultState, resultMessage); } [HttpPost] diff --git a/04.系统编码/App/Controllers/MengguController.cs b/04.系统编码/App/Controllers/MengguController.cs index 1fb3108..a720258 100644 --- a/04.系统编码/App/Controllers/MengguController.cs +++ b/04.系统编码/App/Controllers/MengguController.cs @@ -37,9 +37,10 @@ namespace Pingchuan.BeijingSafeguard.App.Controllers } [HttpPost] - public void AddTask(int userId, string taskId, string region, decimal longitude, decimal latitude, decimal height, decimal simulatedDuration, decimal simulatedInterval, DateTime releaseTime, int resultState, string resultMessage) + public void AddTask(string taskId, string region, decimal longitude, decimal latitude, decimal height, decimal simulatedDuration, decimal simulatedInterval, DateTime releaseTime, int resultState, string resultMessage) { - TaskBLL.Add(userId, taskId, region, longitude, latitude, height, simulatedDuration, simulatedInterval, releaseTime, resultState, resultMessage); + User user = GetLoginUser(); + TaskBLL.Add(user.OrgId, user.Id, taskId, region, longitude, latitude, height, simulatedDuration, simulatedInterval, releaseTime, resultState, resultMessage); } [HttpPost] diff --git a/04.系统编码/BLL/TaskBLL.cs b/04.系统编码/BLL/TaskBLL.cs index 00cb08c..8b02d2c 100644 --- a/04.系统编码/BLL/TaskBLL.cs +++ b/04.系统编码/BLL/TaskBLL.cs @@ -8,9 +8,9 @@ namespace Pingchuan.BeijingSafeguard.BLL { public class TaskBLL { - public static void Add(int userId, string taskId, string region, decimal longitude, decimal latitude, decimal height, decimal simulatedDuration, decimal simulatedInterval, DateTime releaseTime, int resultState, string resultMessage) + public static void Add(int orgId, int userId, string taskId, string region, decimal longitude, decimal latitude, decimal height, decimal simulatedDuration, decimal simulatedInterval, DateTime releaseTime, int resultState, string resultMessage) { - Task task = ToModel(userId, taskId, region, longitude, latitude, height, simulatedDuration, simulatedInterval, releaseTime, resultState, resultMessage); + Task task = ToModel(orgId, userId, taskId, region, longitude, latitude, height, simulatedDuration, simulatedInterval, releaseTime, resultState, resultMessage); TaskDAL.Add(task); } @@ -35,11 +35,12 @@ namespace Pingchuan.BeijingSafeguard.BLL return TaskDAL.Statistics(typeCode, fromTime, toTime, pageIndex, pageSize); } - public static Task ToModel(int userId, string taskId, string region, decimal longitude, decimal latitude, decimal height, decimal simulatedDuration, decimal simulatedInterval, DateTime releaseTime, int resultState, string resultMessage) + public static Task ToModel(int orgId, int userId, string taskId, string region, decimal longitude, decimal latitude, decimal height, decimal simulatedDuration, decimal simulatedInterval, DateTime releaseTime, int resultState, string resultMessage) { return new Task { Id = taskId, + OrgId = orgId, UserId = userId, Region = region, Longitude = longitude, diff --git a/04.系统编码/Model/Task.cs b/04.系统编码/Model/Task.cs index 10e5e68..99b80a4 100644 --- a/04.系统编码/Model/Task.cs +++ b/04.系统编码/Model/Task.cs @@ -4,12 +4,15 @@ using PetaPoco; namespace Pingchuan.BeijingSafeguard.Model { [TableName("tasks")] - [PrimaryKey("id", AutoIncrement=true)] + [PrimaryKey("id", AutoIncrement=false)] public class Task { [Column("id")] public string Id { get; set; } + [Column("org_id")] + public int OrgId { get; set; } + [Column("user_id")] public int UserId { get; set; }