图库列表视图

This commit is contained in:
Jimmy 2021-01-11 18:17:33 +08:00
parent ede3793a5d
commit d1fd0125fc
18 changed files with 223 additions and 6434 deletions

View File

@ -7,6 +7,6 @@ namespace MineTec.ProManager.GalleryInformation.Dto
{
public class GalleryInformationOutPut : OutputBase
{
public List<GalleryInformationDto> data { get; set; }
public List<ViewGalleryInformationDto> data { get; set; }
}
}

View File

@ -0,0 +1,55 @@
using Abp.Application.Services.Dto;
using Abp.AutoMapper;
using System;
using System.ComponentModel.DataAnnotations;
namespace MineTec.ProManager.GalleryInformation.Dto
{
[AutoMapFrom(typeof(Entitys.Graphic.GalleryInformation.ViewGalleryInformation))]
public class ViewGalleryInformationDto : EntityDto<Guid>
{
/// <summary>
/// 创建日期
/// </summary>
public DateTime? CreateTime { get; set; }
/// <summary>
/// 创建人ID
/// </summary>
[StringLength(50)]
public string CreateUserID { get; set; }
/// <summary>
/// 创建人姓名
/// </summary>
[StringLength(50)]
public string CreateUserName { get; set; }
/// <summary>
/// 修改日期
/// </summary>
public DateTime? UpdateTime { get; set; }
/// <summary>
/// 修改人ID
/// </summary>
[StringLength(50)]
public string UpdateUserID { get; set; }
/// <summary>
/// 修改人名称
/// </summary>
[StringLength(50)]
public string UpdateUserName { get; set; }
/// <summary>
/// 图库编号
/// </summary>
public string GalleryNum { get; set; }
/// <summary>
/// 备注信息
/// </summary>
[StringLength(300)]
public string Remark { get; set; }
/// <summary>
///是否删除0 否, 1 是
/// </summary>
public int IsDelete { get; set; }
public DateTime CreationTime { get; set; }
}
}

View File

@ -12,13 +12,13 @@ using System.Threading.Tasks;
namespace MineTec.ProManager.GalleryInformation
{
public class GalleryInformationAppService : AsyncCrudAppService<Entitys.Graphic.GalleryInformation.GalleryInformation, GalleryInformationDto, Guid, PagedResultRequestDto,
public class GalleryInformationAppService : AsyncCrudAppService<Entitys.Graphic.GalleryInformation.ViewGalleryInformation, ViewGalleryInformationDto, Guid, PagedResultRequestDto,
CreateUpdateGalleryInformationDto, CreateUpdateGalleryInformationDto>, IGalleryInformationAppService
{
private readonly IRepository<Entitys.Graphic.GalleryInformation.GalleryInformation, Guid> _GalleryInformationRepository;
private readonly IRepository<Entitys.Graphic.GalleryInformation.ViewGalleryInformation, Guid> _GalleryInformationRepository;
public GalleryInformationAppService(IRepository<Entitys.Graphic.GalleryInformation.GalleryInformation, Guid> repository, IRepository<Entitys.Graphic.GalleryInformation.GalleryInformation, Guid> GalleryInformationRepository)
public GalleryInformationAppService(IRepository<Entitys.Graphic.GalleryInformation.ViewGalleryInformation, Guid> repository, IRepository<Entitys.Graphic.GalleryInformation.ViewGalleryInformation, Guid> GalleryInformationRepository)
: base(repository)
{
_GalleryInformationRepository = GalleryInformationRepository;
@ -59,7 +59,7 @@ namespace MineTec.ProManager.GalleryInformation
var query = base.CreateFilteredQuery(input).Where(t => t.IsDelete != 1).WhereIf(!string.IsNullOrEmpty(input.GalleryNum), t => t.GalleryNum.Contains(input.GalleryNum)).WhereIf(!string.IsNullOrEmpty(input.Remark), t => t.Remark.Contains(input.Remark));
var gallerycount = query.Count();
var gallerylist = query.ToList();
var list = ObjectMapper.Map<List<GalleryInformationDto>>(gallerylist);
var list = ObjectMapper.Map<List<ViewGalleryInformationDto>>(gallerylist);
result.code = 0;
result.count = gallerycount;
result.data = list;

View File

@ -2,13 +2,11 @@
using Abp.Application.Services.Dto;
using MineTec.ProManager.GalleryInformation.Dto;
using System;
using System.Collections.Generic;
using System.Text;
namespace MineTec.ProManager.GalleryInformation
{
public interface IGalleryInformationAppService : IAsyncCrudAppService<//定义了CRUD方法
GalleryInformationDto, //用来展示图库信息
ViewGalleryInformationDto, //用来展示图库信息
Guid, //FigureNumber实体的主键
PagedResultRequestDto, //获取图库编码信息的时候用于分页
CreateUpdateGalleryInformationDto, //用于创建图库信息

View File

@ -0,0 +1,60 @@
using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using System;
using System.ComponentModel.DataAnnotations;
namespace MineTec.ProManager.Entitys.Graphic.GalleryInformation
{
[System.ComponentModel.DataAnnotations.Schema.Table("ViewGalleryInformationList")]
public class ViewGalleryInformation : Entity<Guid>, IHasCreationTime
{
/// <summary>
/// 创建日期
/// </summary>
public DateTime? CreateTime { get; set; }
/// <summary>
/// 创建人ID
/// </summary>
[StringLength(50)]
public string CreateUserID { get; set; }
/// <summary>
/// 创建人姓名
/// </summary>
[StringLength(50)]
public string CreateUserName { get; set; }
/// <summary>
/// 修改日期
/// </summary>
public DateTime? UpdateTime { get; set; }
/// <summary>
/// 修改人ID
/// </summary>
[StringLength(50)]
public string UpdateUserID { get; set; }
/// <summary>
/// 修改人名称
/// </summary>
[StringLength(50)]
public string UpdateUserName { get; set; }
/// <summary>
/// 图库编号
/// </summary>
public string GalleryNum { get; set; }
/// <summary>
/// 备注信息
/// </summary>
[StringLength(300)]
public string Remark { get; set; }
/// <summary>
///是否删除0 否, 1 是
/// </summary>
public int IsDelete { get; set; }
/// <summary>
///包含文件数量
/// </summary>
public int FilesCount { get; set; }
public DateTime CreationTime { get; set; }
}
}

View File

@ -27,5 +27,15 @@ namespace MineTec.ProManager.EntityFrameworkCore
public DbSet<Entitys.Graphic.GalleryInformation.GalleryInformation> GalleryInformation { get; set; }
public DbSet<Entitys.Graphic.GalleryFiles.GalleryFiles> GalleryFiles { get; set; }
public DbSet<Entitys.Graphic.GalleryInformation.ViewGalleryInformation> ViewGalleryInformationList { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Ignore<Entitys.Graphic.GalleryInformation.ViewGalleryInformation>();
base.OnModelCreating(modelBuilder);
}
}
}

View File

@ -1,38 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace MineTec.ProManager.Migrations
{
public partial class AddGalleryInformation : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "GalleryInformation",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
CreateTime = table.Column<DateTime>(nullable: true),
CreateUserID = table.Column<string>(maxLength: 50, nullable: true),
CreateUserName = table.Column<string>(maxLength: 50, nullable: true),
UpdateTime = table.Column<DateTime>(nullable: true),
UpdateUserID = table.Column<string>(maxLength: 50, nullable: true),
UpdateUserName = table.Column<string>(maxLength: 50, nullable: true),
GalleryNum = table.Column<string>(nullable: true),
Remark = table.Column<string>(maxLength: 300, nullable: true),
IsDelete = table.Column<int>(nullable: false),
CreationTime = table.Column<DateTime>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_GalleryInformation", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "GalleryInformation");
}
}
}

View File

@ -1,40 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace MineTec.ProManager.Migrations
{
public partial class AddGalleryFiles : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "GalleryFiles",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
CreateTime = table.Column<DateTime>(nullable: true),
CreateUserID = table.Column<string>(maxLength: 50, nullable: true),
CreateUserName = table.Column<string>(maxLength: 50, nullable: true),
UpdateTime = table.Column<DateTime>(nullable: true),
UpdateUserID = table.Column<string>(maxLength: 50, nullable: true),
UpdateUserName = table.Column<string>(maxLength: 50, nullable: true),
FileNum = table.Column<string>(nullable: true),
Subcode = table.Column<string>(nullable: true),
FileName = table.Column<string>(maxLength: 300, nullable: true),
IsAnnex = table.Column<int>(nullable: false),
IsDelete = table.Column<int>(nullable: false),
CreationTime = table.Column<DateTime>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_GalleryFiles", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "GalleryFiles");
}
}
}

View File

@ -1,23 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace MineTec.ProManager.Migrations
{
public partial class UpdateGalleryFiles : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "GalleryInformationID",
table: "GalleryFiles",
maxLength: 50,
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "GalleryInformationID",
table: "GalleryFiles");
}
}
}

View File

@ -10,8 +10,8 @@ using MineTec.ProManager.EntityFrameworkCore;
namespace MineTec.ProManager.Migrations
{
[DbContext(typeof(ProManagerDbContext))]
[Migration("20210108153146_UpdateGalleryFiles")]
partial class UpdateGalleryFiles
[Migration("20210111101517_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{

View File

@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
namespace MineTec.ProManager.Migrations
{
public partial class Init : Migration
public partial class Initial : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
@ -463,6 +463,51 @@ namespace MineTec.ProManager.Migrations
table.PrimaryKey("PK_FigureNumber", x => x.Id);
});
migrationBuilder.CreateTable(
name: "GalleryFiles",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
CreateTime = table.Column<DateTime>(nullable: true),
CreateUserID = table.Column<string>(maxLength: 50, nullable: true),
CreateUserName = table.Column<string>(maxLength: 50, nullable: true),
UpdateTime = table.Column<DateTime>(nullable: true),
UpdateUserID = table.Column<string>(maxLength: 50, nullable: true),
UpdateUserName = table.Column<string>(maxLength: 50, nullable: true),
GalleryInformationID = table.Column<string>(maxLength: 50, nullable: true),
FileNum = table.Column<string>(nullable: true),
Subcode = table.Column<string>(nullable: true),
FileName = table.Column<string>(maxLength: 300, nullable: true),
IsAnnex = table.Column<int>(nullable: false),
IsDelete = table.Column<int>(nullable: false),
CreationTime = table.Column<DateTime>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_GalleryFiles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "GalleryInformation",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
CreateTime = table.Column<DateTime>(nullable: true),
CreateUserID = table.Column<string>(maxLength: 50, nullable: true),
CreateUserName = table.Column<string>(maxLength: 50, nullable: true),
UpdateTime = table.Column<DateTime>(nullable: true),
UpdateUserID = table.Column<string>(maxLength: 50, nullable: true),
UpdateUserName = table.Column<string>(maxLength: 50, nullable: true),
GalleryNum = table.Column<string>(nullable: true),
Remark = table.Column<string>(maxLength: 300, nullable: true),
IsDelete = table.Column<int>(nullable: false),
CreationTime = table.Column<DateTime>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_GalleryInformation", x => x.Id);
});
migrationBuilder.CreateTable(
name: "MaterialNumber",
columns: table => new
@ -1400,6 +1445,12 @@ namespace MineTec.ProManager.Migrations
migrationBuilder.DropTable(
name: "FigureNumber");
migrationBuilder.DropTable(
name: "GalleryFiles");
migrationBuilder.DropTable(
name: "GalleryInformation");
migrationBuilder.DropTable(
name: "MaterialNumber");

View File

@ -27,4 +27,7 @@
<ItemGroup>
<ProjectReference Include="..\MineTec.ProManager.Core\MineTec.ProManager.Core.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Migrations\" />
</ItemGroup>
</Project>

View File

@ -42,5 +42,5 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JsonSchema="https://jenkins-x.io/schemas/jx-requirements.json" /></VisualStudio></ProjectExtensions>
<ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JsonSchema="" /></VisualStudio></ProjectExtensions>
</Project>

View File

@ -3,4 +3,37 @@
--初始密码123456
insert into [dbo].[UserInfo] (id,CreateTime,CreateUserID,CreateUserName,Account,UserName,Sex,DeptID,DeptName,PostID,PostName,WorkNo,CellPhoneNum,TelPhoneNum,Remake,PassWord,IsAdmin,PowerLevel,IsLeaving,IsDelete,CreationTime) values ('816226B1-6FA4-43BB-8BC5-EE41BD521FC3','2020-12-20','816226B1-6FA4-43BB-8BC5-EE41BD521FC3','admin','admin','超级管理员','1','','','','','00000001','17858852533','','超级管理员','4QrcOUm6Wau+VuBX8g+IPg','1','','0','0','2020-12-20');
</sql>
<sql ver="2">
--创建图库列表的视图
CREATE VIEW ViewGalleryInformationList
AS
SELECT a.Id,
a.CreateTime,
a.CreateUserID,
a.CreateUserName,
a.UpdateTime,
a.UpdateUserID,
a.UpdateUserName,
a.GalleryNum,
a.Remark,
a.IsDelete,
a.CreationTime,
COUNT(b.Id) AS FilesCount
FROM GalleryInformation AS a
LEFT JOIN
(SELECT * FROM GalleryFiles WHERE IsDelete != 1) AS b
ON a.Id = b.GalleryInformationID
WHERE a.IsDelete != 1
GROUP BY a.Id,
a.CreateTime,
a.CreateUserID,
a.CreateUserName,
a.UpdateTime,
a.UpdateUserID,
a.UpdateUserName,
a.GalleryNum,
a.Remark,
a.IsDelete,
a.CreationTime;
</sql>
</BD>

View File

@ -86,6 +86,7 @@
{ field: 'id', hide: true, width: 300, title: 'ID' },
{ field: 'galleryNum', width: 200, title: '图库编号', sort: true, align: "center" },
{ field: 'remark', width: 350, title: '备注信息', align: "left" },
{ field: 'remark', width: 150, title: '图纸数量', align: "center" },
{ field: 'isDelete', width: 150, title: '状态', align: "center", templet: '#GalleryInformationList_isDelete' },
{ title: '操作', width: 200, toolbar: '#currentTableBar', align: "center" }
]],