删除Npoi.Mapper包,SqlSugarCoreNoDrive升级至5.0.43
This commit is contained in:
parent
1263023c46
commit
01cd8aaf15
@ -3,7 +3,6 @@ using Infrastructure.Enums;
|
|||||||
using Infrastructure.Model;
|
using Infrastructure.Model;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Npoi.Mapper;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using ZR.Admin.WebApi.Filters;
|
using ZR.Admin.WebApi.Filters;
|
||||||
@ -167,42 +166,42 @@ namespace ZR.Admin.WebApi.Controllers.System
|
|||||||
return ToResponse(ToJson(result));
|
return ToResponse(ToJson(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 导入 ok
|
///// 导入 ok
|
||||||
/// </summary>
|
///// </summary>
|
||||||
/// <param name="formFile">使用IFromFile必须使用name属性否则获取不到文件</param>
|
///// <param name="formFile">使用IFromFile必须使用name属性否则获取不到文件</param>
|
||||||
/// <returns></returns>
|
///// <returns></returns>
|
||||||
[HttpPost("importData")]
|
//[HttpPost("importData")]
|
||||||
[Log(Title = "用户导入", BusinessType = BusinessType.IMPORT)]
|
//[Log(Title = "用户导入", BusinessType = BusinessType.IMPORT)]
|
||||||
[ActionPermissionFilter(Permission = "system:user:import")]
|
//[ActionPermissionFilter(Permission = "system:user:import")]
|
||||||
public IActionResult ImportData([FromForm(Name = "file")] IFormFile formFile)
|
//public IActionResult ImportData([FromForm(Name = "file")] IFormFile formFile)
|
||||||
{
|
//{
|
||||||
var mapper = new Mapper(formFile.OpenReadStream());// 从流获取
|
// var mapper = new Mapper(formFile.OpenReadStream());// 从流获取
|
||||||
//读取的sheet信息
|
// //读取的sheet信息
|
||||||
var rows = mapper.Take<SysUser>(0);
|
// var rows = mapper.Take<SysUser>(0);
|
||||||
foreach (var item in rows)
|
// foreach (var item in rows)
|
||||||
{
|
// {
|
||||||
SysUser u = item.Value;
|
// SysUser u = item.Value;
|
||||||
}
|
// }
|
||||||
//TODO 业务逻辑
|
// //TODO 业务逻辑
|
||||||
return SUCCESS(1);
|
// return SUCCESS(1);
|
||||||
}
|
//}
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 用户模板 ok
|
///// 用户模板 ok
|
||||||
/// </summary>
|
///// </summary>
|
||||||
/// <returns></returns>
|
///// <returns></returns>
|
||||||
[HttpGet("importTemplate")]
|
//[HttpGet("importTemplate")]
|
||||||
[Log(Title = "用户模板", BusinessType = BusinessType.EXPORT)]
|
//[Log(Title = "用户模板", BusinessType = BusinessType.EXPORT)]
|
||||||
[ActionPermissionFilter(Permission = "system:user:export")]
|
//[ActionPermissionFilter(Permission = "system:user:export")]
|
||||||
public IActionResult ImportTemplateExcel()
|
//public IActionResult ImportTemplateExcel()
|
||||||
{
|
//{
|
||||||
List<SysUser> user = new List<SysUser>();
|
// List<SysUser> user = new List<SysUser>();
|
||||||
var mapper = new Mapper();
|
// var mapper = new Mapper();
|
||||||
MemoryStream stream = new MemoryStream();
|
// MemoryStream stream = new MemoryStream();
|
||||||
mapper.Save(stream, user, "sheel1", overwrite: true, xlsx: true);
|
// mapper.Save(stream, user, "sheel1", overwrite: true, xlsx: true);
|
||||||
//Response.Headers.Append("content-disposition", "attachment;filename=sysUser.xlsx");
|
// //Response.Headers.Append("content-disposition", "attachment;filename=sysUser.xlsx");
|
||||||
return File(stream.ToArray(), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "sysUser.xlsx");
|
// return File(stream.ToArray(), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "sysUser.xlsx");
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.0.4" />
|
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.0.4.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@ -7,6 +7,5 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="MailKit" Version="2.15.0" />
|
<PackageReference Include="MailKit" Version="2.15.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
|
||||||
<PackageReference Include="Npoi.Mapper" Version="3.5.1" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Npoi.Mapper.Attributes;
|
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@ -18,13 +17,9 @@ namespace ZR.Model.System
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
|
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
|
||||||
public long UserId { get; set; }
|
public long UserId { get; set; }
|
||||||
[Column("用户名")]//对应Excel列名
|
|
||||||
//[Required]//校验必填
|
|
||||||
//[Duplication]//校验模板类该列数据是否重复
|
//[Duplication]//校验模板类该列数据是否重复
|
||||||
public string UserName { get; set; }
|
public string UserName { get; set; }
|
||||||
|
|
||||||
[Column("用户昵称")]
|
|
||||||
//[Required]
|
|
||||||
public string NickName { get; set; }
|
public string NickName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -11,8 +11,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||||
<PackageReference Include="Npoi.Mapper" Version="3.5.1" />
|
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.0.4.3" />
|
||||||
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.0.4" />
|
|
||||||
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
<PackageReference Include="MySql.Data" Version="8.0.25" />
|
<PackageReference Include="MySql.Data" Version="8.0.25" />
|
||||||
<PackageReference Include="NETCore.Encrypt" Version="2.0.9" />
|
<PackageReference Include="NETCore.Encrypt" Version="2.0.9" />
|
||||||
<PackageReference Include="SqlSugar.IOC" Version="1.7.0" />
|
<PackageReference Include="SqlSugar.IOC" Version="1.7.0" />
|
||||||
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.0.4" />
|
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.0.4.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user