You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

62 lines
2.4 KiB

using System;
using System.Collections.Generic;
using Pingchuan.BeijingSafeguard.DAL;
using Pingchuan.BeijingSafeguard.Model;
namespace Pingchuan.BeijingSafeguard.BLL
{
public class TaskBLL
{
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(orgId, userId, taskId, region, longitude, latitude, height, simulatedDuration, simulatedInterval, releaseTime, resultState, resultMessage);
TaskDAL.Add(task);
}
public static List<TaskDTO> GetList(DateTime startTime, DateTime endTime)
{
return TaskDAL.GetList(startTime, endTime.AddDays(1));
}
public static List<Task> GetList(int userId, string region, DateTime startTime, DateTime endTime, List<string> tags)
{
return TaskDAL.GetList(userId, region, startTime, endTime, tags);
}
public static void Delete(string id)
{
TaskDAL.Delete(id);
TagBLL.DeleteByTaskId(id);
}
public static List<Task> GetTaskIdByRegion(string region)
{
return TaskDAL.GetTaskIdByRegion(region);
}
public static Pagination<Statistic> Statistics(string typeCode, DateTime fromTime, DateTime toTime, int pageIndex, int pageSize)
{
toTime = toTime.AddDays(1);
return TaskDAL.Statistics(typeCode, fromTime, toTime, pageIndex, pageSize);
}
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,
Latitude = latitude,
Height = height,
SimulatedDuration = simulatedDuration,
SimulatedInterval = simulatedInterval,
ReleaseTime = releaseTime,
CreateTime = DateTime.Now
};
}
}
}