|
@@ -1,6 +1,7 @@
|
|
|
-using Procurement.Enums;
|
|
|
|
|
-using Procurement.FileManagement.Dto;
|
|
|
|
|
-using Procurement.Models;
|
|
|
|
|
|
|
+using DigitalManufacturing.Core;
|
|
|
|
|
+using DigitalManufacturing.Enums;
|
|
|
|
|
+using DigitalManufacturing.FileManagement.Dto;
|
|
|
|
|
+using DigitalManufacturing.Models;
|
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Http;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore;
|
|
@@ -14,21 +15,25 @@ using System.Threading.Tasks;
|
|
|
using Volo.Abp;
|
|
using Volo.Abp;
|
|
|
using Volo.Abp.Application.Dtos;
|
|
using Volo.Abp.Application.Dtos;
|
|
|
using Volo.Abp.Application.Services;
|
|
using Volo.Abp.Application.Services;
|
|
|
|
|
+using Volo.Abp.DependencyInjection;
|
|
|
using Volo.Abp.Domain.Repositories;
|
|
using Volo.Abp.Domain.Repositories;
|
|
|
-using FileInfo = Procurement.Models.FileInfo;
|
|
|
|
|
|
|
+using Volo.Abp.MultiTenancy;
|
|
|
|
|
+using FileInfo = DigitalManufacturing.Models.FileInfo;
|
|
|
|
|
|
|
|
namespace DigitalManufacturing.DigitalManufacturingManagement
|
|
namespace DigitalManufacturing.DigitalManufacturingManagement
|
|
|
{
|
|
{
|
|
|
- public class DigitalManufacturingAppService : ApplicationService, IDigitalManufacturingAppService
|
|
|
|
|
|
|
+ public class DigitalManufacturingAppService : ApplicationService, IDigitalManufacturingAppService, ITransientDependency
|
|
|
{
|
|
{
|
|
|
|
|
+ private readonly ICurrentTenant _currentTenant;
|
|
|
private readonly IRepository<FileInfo, Guid> _repository;
|
|
private readonly IRepository<FileInfo, Guid> _repository;
|
|
|
private readonly FileManager _fileManager;
|
|
private readonly FileManager _fileManager;
|
|
|
string[] pictureFormatArray = { ".png", ".jpg", ".jpeg", ".gif", ".PNG", ".JPG", ".JPEG", ".GIF" };
|
|
string[] pictureFormatArray = { ".png", ".jpg", ".jpeg", ".gif", ".PNG", ".JPG", ".JPEG", ".GIF" };
|
|
|
|
|
|
|
|
- public DigitalManufacturingAppService(IRepository<FileInfo, Guid> repository, FileManager fileManager)
|
|
|
|
|
|
|
+ public DigitalManufacturingAppService(IRepository<FileInfo, Guid> repository, FileManager fileManager, ICurrentTenant currentTenant)
|
|
|
{
|
|
{
|
|
|
_repository = repository;
|
|
_repository = repository;
|
|
|
_fileManager = fileManager;
|
|
_fileManager = fileManager;
|
|
|
|
|
+ _currentTenant = currentTenant;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public async Task<PagedResultDto<FileInfoDto>> GetAll(GetFileInputDto input)
|
|
public async Task<PagedResultDto<FileInfoDto>> GetAll(GetFileInputDto input)
|
|
@@ -52,6 +57,8 @@ namespace DigitalManufacturing.DigitalManufacturingManagement
|
|
|
//限制100M
|
|
//限制100M
|
|
|
if (file.Length > 104857600)
|
|
if (file.Length > 104857600)
|
|
|
{
|
|
{
|
|
|
|
|
+ NLogHelper.Default.WriteLog("GetAll", "上传文件过大", _currentTenant.Id.ToString());
|
|
|
|
|
+ new NLogHelper("DigitalManufacturingAppService").WriteLog("GetAll", "自定义logger", _currentTenant.Id.ToString());
|
|
|
throw new BusinessException("上传文件过大");
|
|
throw new BusinessException("上传文件过大");
|
|
|
}
|
|
}
|
|
|
//文件格式
|
|
//文件格式
|