Browse Source

Update code

master
fanwensheng 3 years ago
parent
commit
9a0ed58449
  1. 2
      04.系统编码/App/App.csproj
  2. 5
      04.系统编码/BLL/TaskBLL.cs
  3. 9
      04.系统编码/DAL/TaskDAL.cs
  4. 1
      04.系统编码/Model/Model.csproj

2
04.系统编码/App/App.csproj

@ -135,6 +135,7 @@
<Compile Include="Controllers\PointController.cs" />
<Compile Include="Controllers\RegisterController.cs" />
<Compile Include="Controllers\StatisticAnalysisController.cs" />
<Compile Include="Controllers\TaskController.cs" />
<Compile Include="Controllers\TiananmenController.cs" />
<Compile Include="Controllers\BeijingController.cs" />
<Compile Include="Controllers\MengguController.cs" />
@ -327,6 +328,7 @@
<Folder Include="Models\" />
<Folder Include="Properties\PublishProfiles\" />
<Folder Include="Views\Config\" />
<Folder Include="Views\Task\" />
</ItemGroup>
<ItemGroup>
<Content Include="Content\scripts\beijing\wind-template.json" />

5
04.系统编码/BLL/TaskBLL.cs

@ -14,6 +14,11 @@ namespace Pingchuan.BeijingSafeguard.BLL
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);

9
04.系统编码/DAL/TaskDAL.cs

@ -13,6 +13,15 @@ namespace Pingchuan.BeijingSafeguard.DAL
db.Insert(task);
}
public static List<TaskDTO> GetList(DateTime startTime, DateTime endTime)
{
string sql = $@"select t.*, o.name org_name, u.real_name user_name from tasks t
left join orgs o on o.id = t.org_id
left join users u on u.id = t.user_id
where t.release_time >= @0 and t.release_time < @1 order by t.release_time desc";
return db.Fetch<TaskDTO>(sql, startTime, endTime);
}
public static List<Task> GetList(int userId, string regionCode, DateTime startTime, DateTime endTime, List<string> tags)
{
string sql = GetSql(userId, regionCode, startTime, endTime, tags);

1
04.系统编码/Model/Model.csproj

@ -55,6 +55,7 @@
<Compile Include="Statistic.cs" />
<Compile Include="Task.cs" />
<Compile Include="Tag.cs" />
<Compile Include="TaskDTO.cs" />
<Compile Include="User.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UserDTO.cs" />

Loading…
Cancel
Save