EPPlus替换成miniExcel
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using SqlSugar;
|
||||
using OfficeOpenXml.Attributes;
|
||||
using Newtonsoft.Json;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace ZR.Model.Models
|
||||
{
|
||||
@@ -21,7 +20,6 @@ namespace ZR.Model.Models
|
||||
/// 空值 : false
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[EpplusTableColumn(Header = "id")]
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
|
||||
@@ -29,7 +27,7 @@ namespace ZR.Model.Models
|
||||
/// 描述 : 语言code
|
||||
/// 空值 : false
|
||||
/// </summary>
|
||||
[EpplusTableColumn(Header = "语言code")]
|
||||
[DisplayName("语言code")]
|
||||
[SugarColumn(ColumnName = "lang_code")]
|
||||
public string LangCode { get; set; }
|
||||
|
||||
@@ -37,7 +35,7 @@ namespace ZR.Model.Models
|
||||
/// 描述 : 语言key
|
||||
/// 空值 : true
|
||||
/// </summary>
|
||||
[EpplusTableColumn(Header = "语言key")]
|
||||
[DisplayName("语言key")]
|
||||
[SugarColumn(ColumnName = "lang_key")]
|
||||
public string LangKey { get; set; }
|
||||
|
||||
@@ -45,7 +43,7 @@ namespace ZR.Model.Models
|
||||
/// 描述 : 名称
|
||||
/// 空值 : false
|
||||
/// </summary>
|
||||
[EpplusTableColumn(Header = "名称")]
|
||||
[DisplayName("名称")]
|
||||
[SugarColumn(ColumnName = "lang_name")]
|
||||
public string LangName { get; set; }
|
||||
|
||||
@@ -53,7 +51,7 @@ namespace ZR.Model.Models
|
||||
/// 描述 : 添加时间
|
||||
/// 空值 : true
|
||||
/// </summary>
|
||||
[EpplusTableColumn(Header = "添加时间", NumberFormat = "yyyy-MM-dd HH:mm:ss")]
|
||||
[DisplayName("添加时间")]
|
||||
public DateTime? Addtime { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,60 +1,42 @@
|
||||
//using Dapper.Contrib.Extensions;
|
||||
using MiniExcelLibs.Attributes;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using SqlSugar;
|
||||
using OfficeOpenXml.Attributes;
|
||||
using System;
|
||||
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
[EpplusTable(PrintHeaders = true, AutofitColumns = true, AutoCalculate = true, ShowTotal = true)]
|
||||
//[EpplusTable(PrintHeaders = true, AutofitColumns = true, AutoCalculate = true, ShowTotal = true)]
|
||||
public class SysBase
|
||||
{
|
||||
[SugarColumn(IsOnlyIgnoreUpdate = true)]//设置后修改不会有此字段
|
||||
[SugarColumn(IsOnlyIgnoreUpdate = true)]
|
||||
[JsonProperty(propertyName: "CreateBy")]
|
||||
[EpplusIgnore]
|
||||
[ExcelIgnore]
|
||||
public string Create_by { get; set; }
|
||||
|
||||
[SugarColumn(IsOnlyIgnoreUpdate = true)]//设置后修改不会有此字段
|
||||
[SugarColumn(IsOnlyIgnoreUpdate = true)]
|
||||
[JsonProperty(propertyName: "CreateTime")]
|
||||
[EpplusTableColumn(NumberFormat = "yyyy-MM-dd HH:mm:ss")]
|
||||
[ExcelColumn(Format = "yyyy-MM-dd HH:mm:ss")]
|
||||
public DateTime Create_time { get; set; } = DateTime.Now;
|
||||
|
||||
[JsonIgnore]
|
||||
[JsonProperty(propertyName: "UpdateBy")]
|
||||
[SugarColumn(IsOnlyIgnoreInsert = true)]
|
||||
[EpplusIgnore]
|
||||
[ExcelIgnore]
|
||||
public string Update_by { get; set; }
|
||||
|
||||
//[JsonIgnore]
|
||||
[SugarColumn(IsOnlyIgnoreInsert = true)]//设置后插入数据不会有此字段
|
||||
[SugarColumn(IsOnlyIgnoreInsert = true)]
|
||||
[JsonProperty(propertyName: "UpdateTime")]
|
||||
[EpplusIgnore]
|
||||
[ExcelIgnore]
|
||||
public DateTime? Update_time { get; set; }
|
||||
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 搜索时间起始时间
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Write:需穿一个bool值,false时insert,update等操作会忽略此列(和Computed的作用差不多,看了源码也没发现与Computed有什么不一样的地方,有了解的朋友可以赐教下哈)
|
||||
/// ExplicitKey:指定此列为主键(不自动增长类型例如guid,ExplicitKey与Key地区别下面会详细讲)
|
||||
/// Key:指定此列为主键(自动增长主键),可忽略,忽略后默认查找
|
||||
/// [Computed]计算属性,打上此标签,对象地insert,update等操作会忽略此列
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
[JsonIgnore]
|
||||
[EpplusIgnore]
|
||||
[ExcelIgnore]
|
||||
public DateTime? BeginTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用于搜索使用
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
[JsonIgnore]
|
||||
[EpplusIgnore]
|
||||
[ExcelIgnore]
|
||||
public DateTime? EndTime { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using OfficeOpenXml.Attributes;
|
||||
using SqlSugar;
|
||||
using SqlSugar;
|
||||
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
@@ -26,7 +25,6 @@ namespace ZR.Model.System
|
||||
/// <summary>
|
||||
/// 状态 0、正常 1、停用
|
||||
/// </summary>
|
||||
[EpplusIgnore]
|
||||
public string Status { get; set; }
|
||||
/// <summary>
|
||||
/// 系统内置 Y是 N否
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using OfficeOpenXml.Attributes;
|
||||
using SqlSugar;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
|
||||
namespace ZR.Model.System
|
||||
@@ -52,7 +51,6 @@ namespace ZR.Model.System
|
||||
/// <summary>
|
||||
/// 访问时间
|
||||
/// </summary>
|
||||
[EpplusTableColumn(NumberFormat = "yyyy-MM-dd HH:mm:ss")]
|
||||
public DateTime LoginTime { get; set; } = DateTime.Now;
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public DateTime? BeginTime { get; set; }
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using OfficeOpenXml.Attributes;
|
||||
using MiniExcelLibs.Attributes;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
@@ -11,78 +12,79 @@ namespace ZR.Model.System
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
public long OperId { get; set; }
|
||||
/** 操作模块 */
|
||||
[EpplusTableColumn(Header = "操作模块")]
|
||||
[DisplayName("操作模块")]
|
||||
public string Title { get; set; }
|
||||
|
||||
/** 业务类型(0其它 1新增 2修改 3删除) */
|
||||
//@Excel(name = "业务类型", readConverterExp = "0=其它,1=新增,2=修改,3=删除,4=授权,5=导出,6=导入,7=强退,8=生成代码,9=清空数据")
|
||||
[EpplusTableColumn(Header = "业务类型")]
|
||||
[DisplayName("业务类型")]
|
||||
public int BusinessType { get; set; }
|
||||
|
||||
/** 业务类型数组 */
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
[EpplusIgnore]
|
||||
[ExcelIgnore]
|
||||
public int[] BusinessTypes { get; set; }
|
||||
|
||||
/** 请求方法 */
|
||||
[EpplusTableColumn(Header = "请求方法")]
|
||||
[DisplayName("请求方法")]
|
||||
public string Method { get; set; }
|
||||
|
||||
/** 请求方式 */
|
||||
[EpplusTableColumn(Header = "请求方式")]
|
||||
[DisplayName("请求方式")]
|
||||
public string RequestMethod { get; set; }
|
||||
|
||||
/** 操作类别(0其它 1后台用户 2手机端用户) */
|
||||
//@Excel(name = "操作类别", readConverterExp = "0=其它,1=后台用户,2=手机端用户")
|
||||
[EpplusTableColumn(Header = "操作类别")]
|
||||
[DisplayName("操作类别")]
|
||||
public int OperatorType { get; set; }
|
||||
|
||||
/** 操作人员 */
|
||||
[EpplusTableColumn(Header = "操作人员")]
|
||||
[DisplayName("操作人员")]
|
||||
public string OperName { get; set; }
|
||||
|
||||
/** 部门名称 */
|
||||
[EpplusTableColumn(Header = "部门名称")]
|
||||
[DisplayName("部门名称")]
|
||||
public string DeptName { get; set; }
|
||||
|
||||
/** 请求url */
|
||||
[EpplusTableColumn(Header = "请求地址")]
|
||||
[DisplayName("请求地址")]
|
||||
public string OperUrl { get; set; }
|
||||
|
||||
/** 操作地址 */
|
||||
[EpplusTableColumn(Header = "操作地址")]
|
||||
[DisplayName("操作地址")]
|
||||
public string OperIp { get; set; }
|
||||
|
||||
/** 操作地点 */
|
||||
[EpplusTableColumn(Header = "操作地点")]
|
||||
[DisplayName("操作地点")]
|
||||
public string OperLocation { get; set; }
|
||||
|
||||
/** 请求参数 */
|
||||
[EpplusTableColumn(Header = "请求参数")]
|
||||
[DisplayName("请求参数")]
|
||||
public string OperParam { get; set; }
|
||||
|
||||
/** 返回参数 */
|
||||
[EpplusTableColumn(Header = "返回结果")]
|
||||
[DisplayName("返回结果")]
|
||||
public string JsonResult { get; set; }
|
||||
|
||||
/** 操作状态(0正常 1异常) */
|
||||
[EpplusTableColumn(Header = "状态")]
|
||||
[DisplayName("状态")]
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 错误消息
|
||||
/// </summary>
|
||||
[EpplusTableColumn(Header = "错误消息")]
|
||||
[DisplayName("错误消息")]
|
||||
public string ErrorMsg { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作时间
|
||||
/// </summary>
|
||||
[EpplusTableColumn(Header = "操作时间", NumberFormat = "yyyy-MM-dd HH:mm:ss")]
|
||||
[DisplayName("操作时间")]
|
||||
public DateTime? OperTime { get; set; }
|
||||
/// <summary>
|
||||
/// 操作用时
|
||||
/// </summary>
|
||||
[DisplayName("操作用时")]
|
||||
public long Elapsed { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using OfficeOpenXml.Attributes;
|
||||
using SqlSugar;
|
||||
using SqlSugar;
|
||||
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
@@ -14,9 +13,7 @@ namespace ZR.Model.System
|
||||
public long PostId { get; set; }
|
||||
public string PostCode { get; set; }
|
||||
public string PostName { get; set; }
|
||||
[EpplusIgnore]
|
||||
public int PostSort { get; set; }
|
||||
[EpplusIgnore]
|
||||
public string Status { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using OfficeOpenXml.Attributes;
|
||||
using SqlSugar;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
|
||||
namespace ZR.Model.System
|
||||
@@ -39,7 +38,9 @@ namespace ZR.Model.System
|
||||
/// </summary>
|
||||
public string InvokeTarget { get; set; }
|
||||
|
||||
[EpplusTableColumn(NumberFormat = "yyyy-MM-dd HH:mm:ss")]
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 执行用时,毫秒
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using OfficeOpenXml.Attributes;
|
||||
using MiniExcelLibs.Attributes;
|
||||
using Newtonsoft.Json;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -28,12 +28,12 @@ namespace ZR.Model.System
|
||||
//[JsonProperty(propertyName: "userType")]
|
||||
//public string User_type { get; set; } = "";
|
||||
[SugarColumn(IsOnlyIgnoreInsert = true)]
|
||||
[EpplusIgnore]
|
||||
[ExcelIgnore]
|
||||
public string Avatar { get; set; }
|
||||
public string Email { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
[EpplusIgnore]
|
||||
[ExcelIgnore]
|
||||
public string Password { get; set; }
|
||||
/// <summary>
|
||||
/// 手机号
|
||||
@@ -47,7 +47,7 @@ namespace ZR.Model.System
|
||||
/// <summary>
|
||||
/// 帐号状态(0正常 1停用)
|
||||
/// </summary>
|
||||
[EpplusIgnore]
|
||||
[ExcelIgnore]
|
||||
public string Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -66,7 +66,7 @@ namespace ZR.Model.System
|
||||
/// 最后登录时间
|
||||
/// </summary>
|
||||
[SugarColumn(IsOnlyIgnoreInsert = true)]
|
||||
[EpplusTableColumn(NumberFormat = "yyyy-MM-dd HH:mm:ss")]
|
||||
[ExcelColumn(Name = "登录日期", Format = "yyyy-MM-dd HH:mm:ss")]
|
||||
public DateTime LoginDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -95,17 +95,17 @@ namespace ZR.Model.System
|
||||
/// 角色id集合
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
[EpplusIgnore]
|
||||
[ExcelIgnore]
|
||||
public long[] RoleIds { get; set; }
|
||||
/// <summary>
|
||||
/// 岗位集合
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
[EpplusIgnore]
|
||||
[ExcelIgnore]
|
||||
public int[] PostIds { get; set; }
|
||||
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
[EpplusIgnore]
|
||||
[ExcelIgnore]
|
||||
public List<SysRole> Roles { get; set; }
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string WelcomeMessage
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="EPPlus" Version="6.0.5" />
|
||||
<PackageReference Include="MiniExcel" Version="1.29.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.1.3.33" />
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
||||
|
||||
Reference in New Issue
Block a user