fix 根据营业点号获取餐次名称为null
This commit is contained in:
@@ -98,10 +98,10 @@ public class BusinessPlaceShiftService : IBusinessPlaceShiftService
|
|||||||
var tenantInfo = tenantResult.Data;
|
var tenantInfo = tenantResult.Data;
|
||||||
|
|
||||||
var list = new List<BusinessPlaceShiftTinyResponse>();
|
var list = new List<BusinessPlaceShiftTinyResponse>();
|
||||||
foreach (var shiftinfo in shifts)
|
foreach (CanteenBusinessShiftEntity shiftinfo in shifts)
|
||||||
{
|
{
|
||||||
var name = _dbContext.Queryable<BasicTypeEntity>()
|
var name = _dbContext.Queryable<BasicTypeEntity>()
|
||||||
.Where(x => x.Code == shiftinfo.Code.ToString())
|
.Where(x => x.Code == shiftinfo.CustomCode.ToString())
|
||||||
.Select(x => x.Display)
|
.Select(x => x.Display)
|
||||||
.First();
|
.First();
|
||||||
var shift = new BusinessPlaceShiftTinyResponse
|
var shift = new BusinessPlaceShiftTinyResponse
|
||||||
|
|||||||
35
Src/Dlhis.Common/Controllers/ApkFIileController.cs
Normal file
35
Src/Dlhis.Common/Controllers/ApkFIileController.cs
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
using Dlhis.Common.Request;
|
||||||
|
using Dlhis.Common.Response;
|
||||||
|
using Dlhis.Common.Services;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace Dlhis.Common.Controllers;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 文件上传/下载
|
||||||
|
/// </summary>
|
||||||
|
[Authorize]
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[ApiController]
|
||||||
|
public class ApkFIileController : ControllerBase
|
||||||
|
{
|
||||||
|
private IApkFIileService _apkFIileService;
|
||||||
|
|
||||||
|
public ApkFIileController(IApkFIileService apkFIileService)
|
||||||
|
{
|
||||||
|
_apkFIileService = apkFIileService;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 文件上传
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task FormSingleFileUpload(ApkRequest request)
|
||||||
|
{
|
||||||
|
await _apkFIileService.FormSingleFileUpload(request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.5.2" />
|
<PackageReference Include="Kurisu.AspNetCore" Version="0.5.2" />
|
||||||
|
<PackageReference Include="Minio" Version="6.0.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
22
Src/Dlhis.Common/Packs/MinioPack.cs
Normal file
22
Src/Dlhis.Common/Packs/MinioPack.cs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
using Kurisu.AspNetCore.Startup;
|
||||||
|
using Kurisu.SqlSugar.Extensions;
|
||||||
|
using Minio;
|
||||||
|
|
||||||
|
namespace Dlhis.Common.Packs
|
||||||
|
{
|
||||||
|
public class MinioPack : BaseAppPack
|
||||||
|
{
|
||||||
|
public override bool IsBeforeUseRouting { get; }
|
||||||
|
|
||||||
|
public override void ConfigureServices(IServiceCollection services)
|
||||||
|
{
|
||||||
|
//注入minioClient
|
||||||
|
var minioClient = (MinioClient)new MinioClient()
|
||||||
|
.WithEndpoint(Configuration["MinIO:Endpoint"])
|
||||||
|
.WithCredentials(Configuration["MinIO:AccessKey"], Configuration["MinIO:SecretKey"])
|
||||||
|
.WithSSL()
|
||||||
|
.Build();
|
||||||
|
services.AddSingleton(minioClient);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
20
Src/Dlhis.Common/Request/ApkRequest.cs
Normal file
20
Src/Dlhis.Common/Request/ApkRequest.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
namespace Dlhis.Common.Request
|
||||||
|
{
|
||||||
|
public class ApkRequest
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 文件
|
||||||
|
/// </summary>
|
||||||
|
public IFormFile formFile { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 版本号
|
||||||
|
/// </summary>
|
||||||
|
public int VersionCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改信息
|
||||||
|
/// </summary>
|
||||||
|
public string UpdateMessage { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
22
Src/Dlhis.Common/Response/ApkFileResponse.cs
Normal file
22
Src/Dlhis.Common/Response/ApkFileResponse.cs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace Dlhis.Common.Response
|
||||||
|
{
|
||||||
|
public class ApkFileResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 地址
|
||||||
|
/// </summary>
|
||||||
|
public string Url { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 版本号
|
||||||
|
/// </summary>
|
||||||
|
public int VersionCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改信息
|
||||||
|
/// </summary>
|
||||||
|
public string UpdateMessage { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
17
Src/Dlhis.Common/Services/IApkFIileService.cs
Normal file
17
Src/Dlhis.Common/Services/IApkFIileService.cs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
using Dlhis.Common.Request;
|
||||||
|
using Dlhis.Common.Response;
|
||||||
|
|
||||||
|
namespace Dlhis.Common.Services;
|
||||||
|
|
||||||
|
public interface IApkFIileService : IScopeDependency
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 文件上传
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task FormSingleFileUpload(ApkRequest request);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
66
Src/Dlhis.Common/Services/Implements/ApkFIileService.cs
Normal file
66
Src/Dlhis.Common/Services/Implements/ApkFIileService.cs
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
using Dlhis.Common.Request;
|
||||||
|
using Dlhis.Common.Response;
|
||||||
|
using Dlhis.Entity.Common;
|
||||||
|
using Kurisu.SqlSugar.Services;
|
||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Minio;
|
||||||
|
using Minio.DataModel;
|
||||||
|
using Minio.DataModel.Args;
|
||||||
|
using Minio.Exceptions;
|
||||||
|
using System.Xml.Linq;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Dlhis.Common.Services.Implements;
|
||||||
|
|
||||||
|
public class ApkFIileService : IApkFIileService
|
||||||
|
{
|
||||||
|
|
||||||
|
private readonly IDbContext _dbContext;
|
||||||
|
private readonly MinioClient _client;
|
||||||
|
|
||||||
|
public ApkFIileService(IDbContext dbContext, MinioClient client)
|
||||||
|
{
|
||||||
|
_dbContext = dbContext;
|
||||||
|
_client = client;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 文件上传
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task FormSingleFileUpload(ApkRequest request)
|
||||||
|
{
|
||||||
|
//上传文件返回地址
|
||||||
|
var url = "https://raw.githubusercontent.com/feicien/android-auto-update/develop/extras/android-auto-update-v1.3.apk";
|
||||||
|
|
||||||
|
var apkInfo = new ApkFIileEntity
|
||||||
|
{
|
||||||
|
Url = url,
|
||||||
|
VersionCode = request.VersionCode,
|
||||||
|
UpdateMessage = request.UpdateMessage,
|
||||||
|
};
|
||||||
|
await _dbContext.InsertAsync(apkInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task UploadFile(IFormFile formFile,string bucketName = "test")
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//文件下载
|
||||||
|
[HttpGet]
|
||||||
|
public IActionResult RequestDownloadFile(string filename)
|
||||||
|
{
|
||||||
|
|
||||||
|
var FilePath =" ";
|
||||||
|
|
||||||
|
return new FileStreamResult(new FileStream(FilePath, FileMode.Open), "application/octet-stream") { FileDownloadName = filename };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -27,5 +27,16 @@
|
|||||||
"ClientId": "reference",
|
"ClientId": "reference",
|
||||||
"ClientSecret": "123456"
|
"ClientSecret": "123456"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
//minIO配置
|
||||||
|
"MinIO": {
|
||||||
|
//服务器IP
|
||||||
|
"Endpoint": "http://192.168.199.124:9001",
|
||||||
|
//账号
|
||||||
|
"AccessKey": "Zbjj05OFtR19e5TJopQU",
|
||||||
|
//密码
|
||||||
|
"SecretKey": "UMXtNdZhufhAAyYJ3XND4cEgZNUsgOWtbUzksizK",
|
||||||
|
//默认存储桶
|
||||||
|
"Bucket": "tests"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
35
Src/Dlhis.Entity/Common/ApkFIileEntity.cs
Normal file
35
Src/Dlhis.Entity/Common/ApkFIileEntity.cs
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
using Kurisu.SqlSugar;
|
||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Dlhis.Entity.Common
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Apk文件表
|
||||||
|
/// </summary>
|
||||||
|
[SugarTable(TableName = "ApkFIile", TableDescription = "Apk文件表")]
|
||||||
|
public class ApkFIileEntity : SugarBaseEntity
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 地址
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnDescription = "地址")]
|
||||||
|
public string Url { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 版本号
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnDescription = "版本号")]
|
||||||
|
public int VersionCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改信息
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnDescription = "修改信息")]
|
||||||
|
public string UpdateMessage { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user