解决配置文件冲突
This commit is contained in:
@@ -69,7 +69,7 @@ public class BusinessPlacesController : ControllerBase
|
||||
/// <param name="placeCustomCode"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("shifts")]
|
||||
public async Task<List<BusinessPlaceShiftResponse>> GetShiftsByPlaceCustomCodeAsync(string placeCustomCode)
|
||||
public async Task<BusinessPlaceWithShiftResponse> GetShiftsByPlaceCustomCodeAsync(string placeCustomCode)
|
||||
{
|
||||
return await _businessPlaceShiftService.GetShiftsByPlaceCustomCodeAsync(placeCustomCode);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
using Dlhis.Basic.BusinessShift.Response;
|
||||
|
||||
namespace Dlhis.Basic.BusinessPlace.Response;
|
||||
|
||||
public class BusinessPlaceWithShiftResponse
|
||||
{
|
||||
public string CustomCode { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
public List<BusinessPlaceShiftResponse> Shifts { get; set; }
|
||||
}
|
||||
@@ -14,6 +14,11 @@ public class BusinessPlaceShiftResponse
|
||||
/// </summary>
|
||||
public string BusinessPlaceCustomCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 营业点
|
||||
/// </summary>
|
||||
public string BusinessPlace { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 代号
|
||||
/// </summary>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Dlhis.Basic.BusinessShift.Request;
|
||||
using Dlhis.Basic.BusinessPlace.Response;
|
||||
using Dlhis.Basic.BusinessShift.Request;
|
||||
using Dlhis.Basic.BusinessShift.Response;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
@@ -10,5 +11,5 @@ public interface IBusinessPlaceShiftService : IScopeDependency
|
||||
|
||||
Task SaveAsync(BusinessPlaceShiftSaveRequest request);
|
||||
|
||||
Task<List<BusinessPlaceShiftResponse>> GetShiftsByPlaceCustomCodeAsync(string placeCustomCode);
|
||||
Task<BusinessPlaceWithShiftResponse> GetShiftsByPlaceCustomCodeAsync(string placeCustomCode);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Dlhis.Basic.BusinessShift.Request;
|
||||
using Dlhis.Basic.BusinessPlace.Response;
|
||||
using Dlhis.Basic.BusinessShift.Request;
|
||||
using Dlhis.Basic.BusinessShift.Response;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
@@ -29,6 +30,7 @@ public class BusinessPlaceShiftService : IBusinessPlaceShiftService
|
||||
Id = shift.Id,
|
||||
BusinessPlaceCode = place.Code,
|
||||
BusinessPlaceCustomCode = place.CustomCode,
|
||||
BusinessPlace = place.Name,
|
||||
Code = shift.Code,
|
||||
CustomCode = shift.CustomCode,
|
||||
Name = shift.Name,
|
||||
@@ -66,24 +68,36 @@ public class BusinessPlaceShiftService : IBusinessPlaceShiftService
|
||||
}
|
||||
|
||||
|
||||
public async Task<List<BusinessPlaceShiftResponse>> GetShiftsByPlaceCustomCodeAsync(string placeCustomCode)
|
||||
public async Task<BusinessPlaceWithShiftResponse> GetShiftsByPlaceCustomCodeAsync(string placeCustomCode)
|
||||
{
|
||||
return await _dbContext.Queryable<CanteenBusinessShiftEntity>()
|
||||
.LeftJoin<CanteenBusinessPlaceEntity>((shift, place) => shift.BusinessPlaceCode == place.Code)
|
||||
.Where((shift, place) => place.CustomCode == placeCustomCode)
|
||||
.OrderBy((shift, place) => shift.Start)
|
||||
.Select((shift, place) => new BusinessPlaceShiftResponse
|
||||
{
|
||||
Id = shift.Id,
|
||||
BusinessPlaceCode = place.Code,
|
||||
BusinessPlaceCustomCode = place.CustomCode,
|
||||
Code = shift.Code,
|
||||
CustomCode = shift.CustomCode,
|
||||
Name = shift.Name,
|
||||
Start = shift.Start,
|
||||
End = shift.End
|
||||
})
|
||||
.ToListAsync();
|
||||
var place = await _dbContext.Queryable<CanteenBusinessPlaceEntity>().Where(x => x.CustomCode == placeCustomCode).FirstAsync();
|
||||
if (place == null)
|
||||
{
|
||||
return new BusinessPlaceWithShiftResponse()
|
||||
{
|
||||
Shifts = new List<BusinessPlaceShiftResponse>()
|
||||
};
|
||||
}
|
||||
var shifts = await _dbContext.Queryable<CanteenBusinessShiftEntity>().Where(x => x.BusinessPlaceCode == place.Code).ToListAsync();
|
||||
|
||||
return new BusinessPlaceWithShiftResponse
|
||||
{
|
||||
CustomCode = placeCustomCode,
|
||||
Name = place.Name,
|
||||
Shifts = shifts.Select(shift => new BusinessPlaceShiftResponse
|
||||
{
|
||||
Id = shift.Id,
|
||||
BusinessPlaceCode = place.Code,
|
||||
BusinessPlaceCustomCode = place.CustomCode,
|
||||
BusinessPlace = place.Name,
|
||||
Code = shift.Code,
|
||||
CustomCode = shift.CustomCode,
|
||||
Name = shift.Name,
|
||||
Start = shift.Start,
|
||||
End = shift.End
|
||||
})
|
||||
.ToList()
|
||||
};
|
||||
}
|
||||
|
||||
//*********************************************** help methods ***************************************************//
|
||||
|
||||
@@ -9,4 +9,9 @@ public class DeviceResigterRequest
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "设备唯一编码不能为空")]
|
||||
public string UniqueNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 营业点手工号; 可为空,后续在后台中设置
|
||||
/// </summary>
|
||||
public string BusinessCustomCode { get; set; }
|
||||
}
|
||||
|
||||
@@ -2,4 +2,7 @@
|
||||
|
||||
public class DeviceNotSetBusinessPlaceResponse
|
||||
{
|
||||
public Guid Code { get; set; }
|
||||
|
||||
public string UniqueNo { get; set; }
|
||||
}
|
||||
|
||||
@@ -24,12 +24,17 @@ public class DeviceConnectService : IDeviceConnectService
|
||||
var device = await GetEnableDeviceAsync(request.UniqueNo);
|
||||
|
||||
var registry = await _dbContext.Queryable<DeviceRegistryEntity>().Where(x => x.DeviceUniqueNo == request.UniqueNo).FirstAsync();
|
||||
var businessPlace = await _dbContext.Queryable<CanteenBusinessPlaceEntity>().Where(x => x.CustomCode == request.BusinessCustomCode).FirstAsync();
|
||||
|
||||
if (registry == null)
|
||||
{
|
||||
registry = new DeviceRegistryEntity()
|
||||
{
|
||||
DeviceUniqueNo = request.UniqueNo,
|
||||
LastHeartbeatTime = DateTime.Now,
|
||||
RegisterTime = DateTime.Now,
|
||||
BusinessPlaceCode = businessPlace?.Code,
|
||||
BusinessPlaceCustomCode = businessPlace?.CustomCode,
|
||||
};
|
||||
await _dbContext.InsertAsync(registry);
|
||||
|
||||
@@ -41,7 +46,7 @@ public class DeviceConnectService : IDeviceConnectService
|
||||
|
||||
public async Task<List<DeviceNotSetBusinessPlaceResponse>> GetNotSetBusinessPlaceDevicesAsync()
|
||||
{
|
||||
var devices = await _dbContext.Queryable<DeviceEntity>().ToListAsync();
|
||||
var devices = await _dbContext.Queryable<DeviceEntity>().Where(x => x.Enable).ToListAsync();
|
||||
devices = devices.Where(x => x.Funcs.Any(item => item == DeviceFuncEnumType.Meal)).ToList();
|
||||
|
||||
return devices.Adapt<List<DeviceNotSetBusinessPlaceResponse>>();
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
using Dlhis.Basic.Organization.Response;
|
||||
using Dlhis.Basic.Organization.Services;
|
||||
using Kurisu.AspNetCore.MVC;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Dlhis.Basic.Organization.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// 部门
|
||||
/// sap部门
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
[ApiDefinition("SAP", Description = "晶科sap组织架构信息")]
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class DepartmentsController : ControllerBase
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Dlhis.Basic.Organization.Request;
|
||||
using Dlhis.Basic.Organization.Response;
|
||||
using Dlhis.Basic.Organization.Services;
|
||||
using Kurisu.AspNetCore.MVC;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -8,9 +9,10 @@ using Microsoft.AspNetCore.Mvc;
|
||||
namespace Dlhis.Basic.MealUser.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// 档案表
|
||||
/// sap档案表
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
[ApiDefinition("SAP", Description = "晶科sap组织架构信息")]
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class GainfosController : ControllerBase
|
||||
@@ -41,7 +43,6 @@ public class GainfosController : ControllerBase
|
||||
[HttpGet("page")]
|
||||
public async Task<Pagination<GainfoPageResponse>> GetPageAsync([FromQuery] GainfoPageRequest request)
|
||||
{
|
||||
//var enums = await _enumSettingApi.GetEnums();
|
||||
return await _gainfoService.GetPageAsync(request);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
using Dlhis.Basic.Organization.Response;
|
||||
using Dlhis.Basic.Organization.Services;
|
||||
using Kurisu.AspNetCore.MVC;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Dlhis.Basic.Organization.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// 人事范围
|
||||
/// sap人事范围 tenant
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
[ApiDefinition("SAP", Description = "晶科sap组织架构信息")]
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class WerksController : ControllerBase
|
||||
@@ -18,6 +22,10 @@ public class WerksController : ControllerBase
|
||||
_werkService = werkService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取人事范围列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
public async Task<List<WerkResponse>> GetListAsync()
|
||||
{
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Basic.Organization.Response;
|
||||
namespace Dlhis.Basic.Organization.Response;
|
||||
|
||||
public class DepartmentTreeResponse
|
||||
{
|
||||
@@ -17,5 +15,5 @@ public class DepartmentTreeResponse
|
||||
/// <summary>
|
||||
/// 下级部门
|
||||
/// </summary>
|
||||
public List<DepartmentTreeResponse> Next { get; set; }
|
||||
public List<DepartmentTreeResponse> Next { get; set; } = new List<DepartmentTreeResponse>();
|
||||
}
|
||||
|
||||
@@ -17,11 +17,11 @@ public class SqlSugarPack : BaseAppPack
|
||||
public override void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
#if DEBUG
|
||||
//using var scope = app.ApplicationServices.CreateScope();
|
||||
//var db = scope.ServiceProvider.GetService<ISqlSugarClient>();
|
||||
//var tables = App.ActiveTyps.Where(x => x.IsDefined(typeof(SugarTable), false)).ToArray();
|
||||
//db.DbMaintenance.CreateDatabase();
|
||||
//db.CodeFirst.InitTables(tables);
|
||||
using var scope = app.ApplicationServices.CreateScope();
|
||||
var db = scope.ServiceProvider.GetService<ISqlSugarClient>();
|
||||
var tables = App.ActiveTyps.Where(x => x.IsDefined(typeof(SugarTable), false)).ToArray();
|
||||
db.DbMaintenance.CreateDatabase();
|
||||
db.CodeFirst.InitTables(tables);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,13 +30,13 @@ public class DeviceRegistryEntity : SugarBaseEntity, ITenantId
|
||||
/// <summary>
|
||||
/// 营业点code(可为空)
|
||||
/// </summary>
|
||||
[SugarColumn(IsNullable = true, ColumnDescription = "注册时间")]
|
||||
public Guid BusinessPlaceCode { get; set; }
|
||||
[SugarColumn(IsNullable = true, ColumnDescription = "营业点code")]
|
||||
public Guid? BusinessPlaceCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 营业点手工号(可为空)
|
||||
/// </summary>
|
||||
[SugarColumn(IsNullable = true, ColumnDescription = "注册时间")]
|
||||
[SugarColumn(IsNullable = true, ColumnDescription = "营业点手工号")]
|
||||
public string BusinessPlaceCustomCode { get; set; }
|
||||
|
||||
public string TenantId { get; set; }
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.6" />
|
||||
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.7" />
|
||||
<PackageReference Include="Hangfire.Dashboard.BasicAuthorization" Version="1.0.2" />
|
||||
<PackageReference Include="Hangfire.MySqlStorage" Version="2.0.2" />
|
||||
<PackageReference Include="Hangfire.MySqlStorage" Version="2.0.3" />
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.7" />
|
||||
<PackageReference Include="log4net" Version="2.0.15" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.4" />
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Dlhis.ScheduledTask
|
||||
{
|
||||
public class HangfirePack : BaseAppPack
|
||||
{
|
||||
public override bool IsBeforeUseRouting { get; }
|
||||
public override bool IsBeforeUseRouting => true;
|
||||
|
||||
public override void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
@@ -29,26 +29,31 @@ namespace Dlhis.ScheduledTask
|
||||
|
||||
public override void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
//支持可视化界面 ---任何一个用户都能够来访问;所以需要加一道屏障
|
||||
app.UseHangfireDashboard("/hangfire", new DashboardOptions()
|
||||
app.UseHangfireDashboard("/hangfire", new DashboardOptions
|
||||
{
|
||||
Authorization = new BasicAuthAuthorizationFilter[] {
|
||||
new BasicAuthAuthorizationFilter(new BasicAuthAuthorizationFilterOptions(){
|
||||
SslRedirect=false,
|
||||
RequireSsl=false,
|
||||
Users=new BasicAuthAuthorizationUser[]{
|
||||
new BasicAuthAuthorizationUser(){
|
||||
Login="admin",
|
||||
PasswordClear="admin"
|
||||
}
|
||||
}
|
||||
})
|
||||
AppPath = null,
|
||||
DashboardTitle = "hangfire",
|
||||
Authorization = new[]
|
||||
{
|
||||
new BasicAuthAuthorizationFilter(new BasicAuthAuthorizationFilterOptions
|
||||
{
|
||||
RequireSsl = false,
|
||||
SslRedirect = false,
|
||||
Users = new []
|
||||
{
|
||||
new BasicAuthAuthorizationUser
|
||||
{
|
||||
Login ="admin",
|
||||
PasswordClear = "admin"
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
app.UseHangfireDashboard(); //使用hangfire面板
|
||||
|
||||
app.UseHangfireDashboard();
|
||||
BackgroundJob.Enqueue(() => Console.WriteLine("This is a background job."));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user