feat tickets

This commit is contained in:
2025-02-11 16:33:21 +08:00
parent c9df417799
commit 964e033583
33 changed files with 473 additions and 28 deletions

View File

@@ -1,4 +1,5 @@
using Dlhis.Entity.Basic.Entity;
using Dlhis.Constants;
using Dlhis.Entity.Basic.Entity;
using Dlhis.Entity.Basic.Enums;
using Dlhis.Entity.Device.Entities;
using Dlhis.Entity.Device.Enums;
@@ -95,7 +96,7 @@ public class DeviceUploadLogService : IDeviceUploadLogService
public async Task<List<DeviceUploadLogResponse>> GetMyRecordsAsync(DeviceUploadLogMyRecordRequest request)
{
var jinkoCode = _currentUser.GetUserClaim("jinko-code") ?? string.Empty;
var jinkoCode = _currentUser.GetUserClaim(UserClaimConstants.JinkoCode) ?? string.Empty;
return await _dbContext.Queryable<DeviceUploadLogEntity>()
.LeftJoin<DeviceEntity>((log, d) => log.DeviceUniqueNo == d.UniqueNo)

View File

@@ -20,10 +20,13 @@
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.7" />
<PackageReference Include="Hangfire.Dashboard.BasicAuthorization" Version="1.0.2" />
<PackageReference Include="Hangfire.Redis.StackExchange" Version="1.9.3" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Dlhis.Basic.Api\Dlhis.Basic.Api.csproj" />
<ProjectReference Include="..\Dlhis.Canteen.Api\Dlhis.Canteen.Api.csproj" />
<ProjectReference Include="..\Dlhis.Constants\Dlhis.Constants.csproj" />
<ProjectReference Include="..\Dlhis.Entity\Dlhis.Entity.csproj" />
<ProjectReference Include="..\Dlhis.Jip.Api\Dlhis.Jip.Api.csproj" />
<ProjectReference Include="..\Dlhis.Sys.Api\Dlhis.Sys.Api.csproj" />

View File

@@ -1,25 +1,34 @@
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
# 请参阅 https://aka.ms/customizecontainer 以了解如何自定义调试容器,以及 Visual Studio 如何使用此 Dockerfile 生成映像以更快地进行调试。
# 此阶段用于在快速模式(默认为调试配置)下从 VS 运行时
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
# 此阶段用于生成服务项目
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj", "Src/Dlhis.ScheduledTask/"]
COPY ["Src/Dlhis.Basic.Api/Dlhis.Basic.Api.csproj", "Src/Dlhis.Basic.Api/"]
COPY ["Src/Dlhis.Canteen.Api/Dlhis.Canteen.Api.csproj", "Src/Dlhis.Canteen.Api/"]
COPY ["Src/Dlhis.Constants/Dlhis.Constants.csproj", "Src/Dlhis.Constants/"]
COPY ["Src/Dlhis.Entity/Dlhis.Entity.csproj", "Src/Dlhis.Entity/"]
COPY ["Src/Dlhis.DataPermission.Model/Dlhis.DataPermission.Model.csproj", "Src/Dlhis.DataPermission.Model/"]
COPY ["Src/Dlhis.Jip.Api/Dlhis.Jip.Api.csproj", "Src/Dlhis.Jip.Api/"]
COPY ["Src/Dlhis.Sys.Api/Dlhis.Sys.Api.csproj", "Src/Dlhis.Sys.Api/"]
RUN dotnet restore "./Src/Dlhis.ScheduledTask/./Dlhis.ScheduledTask.csproj"
RUN dotnet restore "./Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj"
COPY . .
WORKDIR "/src/Src/Dlhis.ScheduledTask"
RUN dotnet build "./Dlhis.ScheduledTask.csproj" -c $BUILD_CONFIGURATION -o /app/build
# 此阶段用于发布要复制到最终阶段的服务项目
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./Dlhis.ScheduledTask.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
# 此阶段在生产中使用,或在常规模式下从 VS 运行时使用(在不使用调试配置时为默认值)
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .

View File

@@ -0,0 +1,22 @@
using Dlhis.Canteen.Api;
using Dlhis.Entity.Canteen.Enums;
using Dlhis.ScheduledTask.Attributes;
namespace Dlhis.ScheduledTask.Jobs;
/// <summary>
///
/// </summary>
[RecurringJob(nameof(CreateBirthdayTicketJob), "0 0 1 * * ?", Name = "生日券发放")]
public class CreateBirthdayTicketJob : BaseJob
{
public CreateBirthdayTicketJob(IServiceProvider serviceProvider) : base(serviceProvider)
{
}
/// <inheritdoc />
protected override async Task RunAsync(IServiceProvider serviceProvider)
{
await serviceProvider.GetService<ITicketApi>().CreateAsync(TicketEnumType.Birthday.ToString());
}
}

View File

@@ -7,7 +7,8 @@
},
"InternalRequest": {
"SysRequestUrl": "http://localhost:5003",
"BasicRequestUrl": "http://localhost:5002"
"BasicRequestUrl": "http://localhost:5002",
"CanteenRequestUrl": "http://localhost:5008"
},
"FaceUrlOptions": {
"Url": "http://192.168.199.115:5002/api/gainfos/face?token=",
@@ -36,18 +37,18 @@
"ClientSecret": "123456"
}
},
// "JinkoOptions": {
// "Jip": {
// "BaseUrl": "http://172.16.202.34:8000",
// "Key": "FACE-7409WIBX",
// "Secret": "be0a4b88-cd80-4509-b9b9-865205d0d3d8"
// }
// },
// "JinkoOptions": {
// "Jip": {
// "BaseUrl": "http://172.16.202.34:8000",
// "Key": "FACE-7409WIBX",
// "Secret": "be0a4b88-cd80-4509-b9b9-865205d0d3d8"
// }
// },
"JinkoOptions": {
"Jip": {
"BaseUrl": "http://jip.jinkosolar.com",
"Key": "FACE-CUOJG9N7",
"Secret": "130c2f2d-03a0-4720-8e25-538ffac7a7cb"
}
},
}
}

View File

@@ -7,7 +7,8 @@
},
"InternalRequest": {
"SysRequestUrl": "http://sys",
"BasicRequestUrl": "http://basic"
"BasicRequestUrl": "http://basic",
"CanteenRequestUrl": "http://canteen"
},
"DataProtectionOptions": {
"Enable": true,