feat 外包人员,框架升级
This commit is contained in:
@@ -47,7 +47,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Message", "Message", "{65E7
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dlhis.Message", "Src\Dlhis.Message\Dlhis.Message.csproj", "{053BF7B2-B1A0-435F-9C77-2EF5622CC5C5}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dlhis.Message", "Src\Dlhis.Message\Dlhis.Message.csproj", "{053BF7B2-B1A0-435F-9C77-2EF5622CC5C5}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dlhis.InfoCheck", "Src\Dlhis.InfoCheck\Dlhis.InfoCheck.csproj", "{4D656761-8CE7-4316-A3DF-8C1722D69CCE}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dlhis.InfoCheck", "Src\Dlhis.InfoCheck\Dlhis.InfoCheck.csproj", "{4D656761-8CE7-4316-A3DF-8C1722D69CCE}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Kurisu.RemoteCall" Version="0.0.3" />
|
<PackageReference Include="Kurisu.RemoteCall" Version="0.4.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
7
Src/Dlhis.Basic.Api/Dto/BusinessPlaceDto.cs
Normal file
7
Src/Dlhis.Basic.Api/Dto/BusinessPlaceDto.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace Dlhis.Basic.Api.Dto;
|
||||||
|
|
||||||
|
public class BusinessPlaceDto
|
||||||
|
{
|
||||||
|
public Guid Code { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Dlhis.Basic.Api.Dtos;
|
namespace Dlhis.Basic.Api.Dto;
|
||||||
|
|
||||||
public class DishesMenuDetailDto
|
public class DishesMenuDetailDto
|
||||||
{
|
{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Dlhis.Basic.Api.Dtos;
|
namespace Dlhis.Basic.Api.Dto;
|
||||||
|
|
||||||
public class PermissionUsersInfoDto
|
public class PermissionUsersInfoDto
|
||||||
{
|
{
|
||||||
@@ -11,4 +11,4 @@ public class PermissionUsersInfoDto
|
|||||||
/// 用户对应的 [ 厂区--设备Code ]
|
/// 用户对应的 [ 厂区--设备Code ]
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Dictionary<string, List<UserTenantDeviceCodeDto>> PermissionInfos { get; set; }
|
public Dictionary<string, List<UserTenantDeviceCodeDto>> PermissionInfos { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Dlhis.Basic.Api.Dtos;
|
namespace Dlhis.Basic.Api.Dto;
|
||||||
|
|
||||||
public class UserTenantDeviceCodeDto
|
public class UserTenantDeviceCodeDto
|
||||||
{
|
{
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Dlhis.Basic.Api.Dtos
|
|
||||||
{
|
|
||||||
public class BusinessPlaceDto
|
|
||||||
{
|
|
||||||
public Guid Code { get; set; }
|
|
||||||
public string Name { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using Dlhis.Basic.Api.Dtos;
|
using Dlhis.Basic.Api.Dto;
|
||||||
using Dlhis.Basic.Api.Request;
|
using Dlhis.Basic.Api.Request;
|
||||||
using Kurisu.Core.Result;
|
|
||||||
using Kurisu.RemoteCall.Attributes;
|
using Kurisu.RemoteCall.Attributes;
|
||||||
|
using Kurisu.RemoteCall.Default;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Api;
|
namespace Dlhis.Basic.Api;
|
||||||
|
|
||||||
@@ -14,4 +14,4 @@ public interface IBusinessPlacePermissionsApi
|
|||||||
|
|
||||||
[Post("/api/gainfoPermissions/reset")]
|
[Post("/api/gainfoPermissions/reset")]
|
||||||
Task<DefaultApiResult> ResetAsync(GainfoPermissionResetRequest request);
|
Task<DefaultApiResult> ResetAsync(GainfoPermissionResetRequest request);
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Dlhis.Basic.Api.Response;
|
using Dlhis.Basic.Api.Response;
|
||||||
using Kurisu.Core.Result;
|
|
||||||
using Kurisu.RemoteCall.Attributes;
|
using Kurisu.RemoteCall.Attributes;
|
||||||
|
using Kurisu.RemoteCall.Default;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Api;
|
namespace Dlhis.Basic.Api;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Dlhis.Basic.Api.Dtos;
|
using Dlhis.Basic.Api.Dto;
|
||||||
using Kurisu.Core.Result;
|
|
||||||
using Kurisu.RemoteCall.Attributes;
|
using Kurisu.RemoteCall.Attributes;
|
||||||
|
using Kurisu.RemoteCall.Default;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Api;
|
namespace Dlhis.Basic.Api;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Dlhis.Basic.Api.Dtos;
|
using Dlhis.Basic.Api.Dto;
|
||||||
using Kurisu.Core.Result;
|
|
||||||
using Kurisu.RemoteCall.Attributes;
|
using Kurisu.RemoteCall.Attributes;
|
||||||
|
using Kurisu.RemoteCall.Default;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Api;
|
namespace Dlhis.Basic.Api;
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Dlhis.Basic.Api.Request
|
|
||||||
{
|
|
||||||
public class SaveBusinessPlacePermissionRequest
|
|
||||||
{
|
|
||||||
public long? Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 营业点
|
|
||||||
/// </summary>
|
|
||||||
public Guid BusinessPlaceCode { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
using Dlhis.Basic.BusinessShift.Request;
|
using Dlhis.Basic.BusinessShift.Request;
|
||||||
using Dlhis.Basic.BusinessShift.Response;
|
using Dlhis.Basic.BusinessShift.Response;
|
||||||
using Dlhis.Basic.BusinessShift.Services;
|
using Dlhis.Basic.BusinessShift.Services;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.BusinessShift.Request;
|
namespace Dlhis.Basic.BusinessShift.Request;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Dlhis.Entity.Canteen.Enums;
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
using Kurisu.Core.CustomClass;
|
using Kurisu.AspNetCore.CustomClass;
|
||||||
|
|
||||||
namespace Dlhis.Basic.BusinessShift.Request;
|
namespace Dlhis.Basic.BusinessShift.Request;
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using Dlhis.Basic.Places.Request;
|
using Dlhis.Basic.Places.Request;
|
||||||
using Dlhis.Basic.BusinessPlace.Response;
|
|
||||||
using Dlhis.Basic.BusinessShift.Request;
|
using Dlhis.Basic.BusinessShift.Request;
|
||||||
using Dlhis.Basic.BusinessShift.Response;
|
using Dlhis.Basic.BusinessShift.Response;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Dlhis.Basic.Places.Response;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.BusinessShift.Services;
|
namespace Dlhis.Basic.BusinessShift.Services;
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
using Dlhis.Basic.Places.Request;
|
using Dlhis.Basic.Places.Request;
|
||||||
using Dlhis.Basic.BusinessPlace.Response;
|
|
||||||
using Dlhis.Basic.BusinessShift.Request;
|
using Dlhis.Basic.BusinessShift.Request;
|
||||||
using Dlhis.Basic.BusinessShift.Response;
|
using Dlhis.Basic.BusinessShift.Response;
|
||||||
|
using Dlhis.Basic.Places.Response;
|
||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
using Dlhis.Entity.Device.Entities;
|
using Dlhis.Entity.Device.Entities;
|
||||||
using Dlhis.Sys.Api;
|
using Dlhis.Sys.Api;
|
||||||
|
using Kurisu.AspNetCore.CustomClass;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Kurisu.Core.CustomClass;
|
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Kurisu.Core.Result;
|
|
||||||
using Kurisu.SqlSugar.Extensions;
|
|
||||||
using Kurisu.SqlSugar.Services;
|
|
||||||
using Mapster;
|
using Mapster;
|
||||||
|
|
||||||
namespace Dlhis.Basic.BusinessShift.Services.Implements;
|
namespace Dlhis.Basic.BusinessShift.Services.Implements;
|
||||||
@@ -29,7 +28,7 @@ public class BusinessPlaceShiftService : IBusinessPlaceShiftService
|
|||||||
public async Task<Pagination<BusinessPlaceShiftResponse>> GetPageAsync(BusinessPlaceShiftPageRequest request)
|
public async Task<Pagination<BusinessPlaceShiftResponse>> GetPageAsync(BusinessPlaceShiftPageRequest request)
|
||||||
{
|
{
|
||||||
var page = await _dbContext.Queryable<BusinessShiftEntity>()
|
var page = await _dbContext.Queryable<BusinessShiftEntity>()
|
||||||
.WhereIF(request.Search.IsPresent(), (shift) => shift.CustomCode.Contains(request.Search) || shift.Name.Contains(request.Search))
|
.WhereIF(request.Search.IsPresent(), shift => shift.CustomCode.Contains(request.Search) || shift.Name.Contains(request.Search))
|
||||||
.Select<BusinessPlaceShiftResponse>()
|
.Select<BusinessPlaceShiftResponse>()
|
||||||
.ToPageListAsync(request);
|
.ToPageListAsync(request);
|
||||||
|
|
||||||
@@ -133,8 +132,7 @@ public class BusinessPlaceShiftService : IBusinessPlaceShiftService
|
|||||||
}
|
}
|
||||||
|
|
||||||
var tenantResult = await _tenantApi.GetTenantByCodeAsync(place.TenantId);
|
var tenantResult = await _tenantApi.GetTenantByCodeAsync(place.TenantId);
|
||||||
(tenantResult.Code == ApiStateCode.Success).ThrowIfFalse(tenantResult.Msg);
|
var tenantInfo = tenantResult.EnsureSuccessStatusCode();
|
||||||
var tenantInfo = tenantResult.Data;
|
|
||||||
|
|
||||||
var relationship = await _dbContext.Queryable<BusinessPlaceShiftRelationshipEntity>().Where(x => x.PlaceCode == place.Code).FirstAsync();
|
var relationship = await _dbContext.Queryable<BusinessPlaceShiftRelationshipEntity>().Where(x => x.PlaceCode == place.Code).FirstAsync();
|
||||||
if (relationship == null)
|
if (relationship == null)
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
using Kurisu.Core.CustomClass;
|
using Kurisu.AspNetCore.CustomClass;
|
||||||
|
|
||||||
namespace Dlhis.Basic.BusinessShift;
|
namespace Dlhis.Basic.BusinessShift;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 临时的扩展类 todo: 嵌入框架
|
/// 临时的扩展类 todo: 嵌入框架
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -38,4 +37,4 @@ public static class TimePeriodExtensions
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
using Dlhis.Basic.Device.Dtos;
|
using Dlhis.Basic.Device.Dtos;
|
||||||
using Dlhis.Basic.Device.Request;
|
using Dlhis.Basic.Device.Request;
|
||||||
using Dlhis.Basic.Device.Response;
|
|
||||||
using Dlhis.Basic.Device.Services;
|
using Dlhis.Basic.Device.Services;
|
||||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using Dlhis.Basic.Device.Request;
|
using Dlhis.Basic.Device.Request;
|
||||||
using Dlhis.Basic.Device.Response;
|
using Dlhis.Basic.Device.Response;
|
||||||
using Dlhis.Basic.Device.Services;
|
using Dlhis.Basic.Device.Services;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
@@ -186,7 +186,7 @@ public class DevicesController : ControllerBase
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet("attendancesoffline")]
|
[HttpGet("attendancesoffline")]
|
||||||
public async Task<Pagination<DevicePageResponse>> GetAttendanceOfflineAsync([FromQuery] DeviceOnlineAndofflineRequest request)
|
public async Task<Pagination<DevicePageResponse>> GetAttendanceOfflineAsync([FromQuery] DeviceOnlineAndOfflineRequest request)
|
||||||
{
|
{
|
||||||
return await _deviceService.GetAttendanceOfflineAsync(request);
|
return await _deviceService.GetAttendanceOfflineAsync(request);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Device.Request
|
namespace Dlhis.Basic.Device.Request
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Device.Request
|
namespace Dlhis.Basic.Device.Request
|
||||||
{
|
{
|
||||||
public class DeviceOnlineAndofflineRequest : PageDto
|
public class DeviceOnlineAndOfflineRequest : PageDto
|
||||||
{
|
{
|
||||||
public bool IsOnAndOff { get; set; }
|
public bool IsOnAndOff { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Dlhis.Entity.Device.Enums;
|
using Dlhis.Entity.Device.Enums;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Device.Request;
|
namespace Dlhis.Basic.Device.Request;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Device.Request;
|
namespace Dlhis.Basic.Device.Request;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Device.Response
|
namespace Dlhis.Basic.Device.Response
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
using Dlhis.Basic.Device.Dtos;
|
using Dlhis.Basic.Device.Dtos;
|
||||||
using Dlhis.Basic.Device.Request;
|
using Dlhis.Basic.Device.Request;
|
||||||
using Dlhis.Basic.Device.Response;
|
|
||||||
using Dlhis.Entity.Device.Enums;
|
using Dlhis.Entity.Device.Enums;
|
||||||
using Dlhis.Entity.Sys.Enums;
|
using Dlhis.Entity.Sys.Enums;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
|
|
||||||
namespace Dlhis.Basic.Device.Services;
|
namespace Dlhis.Basic.Device.Services;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using Dlhis.Basic.Device.Request;
|
using Dlhis.Basic.Device.Request;
|
||||||
using Dlhis.Basic.Device.Response;
|
using Dlhis.Basic.Device.Response;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace Dlhis.Basic.Device.Services;
|
namespace Dlhis.Basic.Device.Services;
|
||||||
|
|
||||||
@@ -21,7 +20,7 @@ public interface IDeviceService : IScopeDependency
|
|||||||
|
|
||||||
Task<Pagination<DevicePageResponse>> GetAttendanceTotalAsync(AttendanceTotalRequest request);
|
Task<Pagination<DevicePageResponse>> GetAttendanceTotalAsync(AttendanceTotalRequest request);
|
||||||
|
|
||||||
Task<Pagination<DevicePageResponse>> GetAttendanceOfflineAsync(DeviceOnlineAndofflineRequest request);
|
Task<Pagination<DevicePageResponse>> GetAttendanceOfflineAsync(DeviceOnlineAndOfflineRequest request);
|
||||||
|
|
||||||
Task<Pagination<DevicePageResponse>> GetDoorOfflineAsync(GetDoorOfflineRequest request);
|
Task<Pagination<DevicePageResponse>> GetDoorOfflineAsync(GetDoorOfflineRequest request);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Dlhis.Basic.Device.Request;
|
using Dlhis.Basic.Device.Request;
|
||||||
using Dlhis.Basic.Device.Response;
|
using Dlhis.Basic.Device.Response;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Device.Services;
|
namespace Dlhis.Basic.Device.Services;
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ using Dlhis.Basic.Device.Response;
|
|||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
using Dlhis.Entity.Device.Entities;
|
using Dlhis.Entity.Device.Entities;
|
||||||
using Dlhis.Entity.Device.Enums;
|
using Dlhis.Entity.Device.Enums;
|
||||||
|
using Kurisu.AspNetCore.CustomClass;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Kurisu.Core.CustomClass;
|
|
||||||
using Kurisu.SqlSugar.Services;
|
|
||||||
using Mapster;
|
using Mapster;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Device.Services.Implements;
|
namespace Dlhis.Basic.Device.Services.Implements;
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ using Dlhis.Basic.Device.Response;
|
|||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
using Dlhis.Entity.Device.Entities;
|
using Dlhis.Entity.Device.Entities;
|
||||||
using Dlhis.Entity.Device.Enums;
|
using Dlhis.Entity.Device.Enums;
|
||||||
|
using Kurisu.AspNetCore.Authentication.Abstractions;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Kurisu.Core.User.Abstractions;
|
|
||||||
using Kurisu.SqlSugar.Services;
|
|
||||||
using Mapster;
|
using Mapster;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Device.Services.Implements;
|
namespace Dlhis.Basic.Device.Services.Implements;
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ using Dlhis.Entity.Device.Entities;
|
|||||||
using Dlhis.Entity.Device.Enums;
|
using Dlhis.Entity.Device.Enums;
|
||||||
using Dlhis.Entity.Sys.Entities;
|
using Dlhis.Entity.Sys.Entities;
|
||||||
using Dlhis.Entity.Sys.Enums;
|
using Dlhis.Entity.Sys.Enums;
|
||||||
|
using Kurisu.AspNetCore.Authentication.Abstractions;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Entity;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Kurisu.Core.DataAccess.Entity;
|
|
||||||
using Kurisu.Core.User.Abstractions;
|
|
||||||
using Kurisu.SqlSugar.Services;
|
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Device.Services.Implements;
|
namespace Dlhis.Basic.Device.Services.Implements;
|
||||||
|
|||||||
@@ -7,13 +7,13 @@ using Dlhis.Entity.Canteen.Enums;
|
|||||||
using Dlhis.Entity.Device.Entities;
|
using Dlhis.Entity.Device.Entities;
|
||||||
using Dlhis.Entity.Device.Enums;
|
using Dlhis.Entity.Device.Enums;
|
||||||
using Dlhis.Sys.Api;
|
using Dlhis.Sys.Api;
|
||||||
|
using Kurisu.AspNetCore.Authentication.Abstractions;
|
||||||
|
using Kurisu.AspNetCore.CustomClass;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Entity;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Kurisu.Core.CustomClass;
|
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Kurisu.Core.DataAccess.Entity;
|
|
||||||
using Kurisu.Core.User.Abstractions;
|
|
||||||
using Kurisu.SqlSugar.Extensions;
|
|
||||||
using Kurisu.SqlSugar.Services;
|
|
||||||
using Mapster;
|
using Mapster;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
@@ -419,7 +419,7 @@ public class DeviceService : IDeviceService
|
|||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<Pagination<DevicePageResponse>> GetAttendanceOfflineAsync(DeviceOnlineAndofflineRequest request)
|
public async Task<Pagination<DevicePageResponse>> GetAttendanceOfflineAsync(DeviceOnlineAndOfflineRequest request)
|
||||||
{
|
{
|
||||||
var devices = await _dbContext.Queryable<DeviceEntity>().Where(x => x.Type == DeviceTypeEnumType.Attendance || (x.Type == DeviceTypeEnumType.Door && x.AsAttendance)).ToListAsync();
|
var devices = await _dbContext.Queryable<DeviceEntity>().Where(x => x.Type == DeviceTypeEnumType.Attendance || (x.Type == DeviceTypeEnumType.Door && x.AsAttendance)).ToListAsync();
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
using Dlhis.Basic.Device.Request;
|
using Dlhis.Basic.Device.Request;
|
||||||
using Dlhis.Basic.Device.Response;
|
using Dlhis.Basic.Device.Response;
|
||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
|
using Kurisu.AspNetCore.CustomClass;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Kurisu.Core.CustomClass;
|
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Kurisu.SqlSugar.Extensions;
|
|
||||||
using Kurisu.SqlSugar.Services;
|
|
||||||
using Mapster;
|
using Mapster;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ using Dlhis.Basic.Dishes.Request;
|
|||||||
using Dlhis.Basic.Dishes.Response;
|
using Dlhis.Basic.Dishes.Response;
|
||||||
using Dlhis.Basic.Dishes.Services;
|
using Dlhis.Basic.Dishes.Services;
|
||||||
using Dlhis.Entity.Canteen.Enums;
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ public class DishesMenusController : ControllerBase
|
|||||||
/// <param name="request"></param>
|
/// <param name="request"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet("page")]
|
[HttpGet("page")]
|
||||||
public async Task<Pagination<DishesMenuPageResponse>> GetDishesMenuPageAsync([FromQuery] DisheMenuPageRequest request)
|
public async Task<Pagination<DishesMenuPageResponse>> GetDishesMenuPageAsync([FromQuery] DishesMenuPageRequest request)
|
||||||
{
|
{
|
||||||
return await _dishesMenuService.GetDishesMenuPageAsync(request);
|
return await _dishesMenuService.GetDishesMenuPageAsync(request);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Kurisu.AspNetCore.CustomClass;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Kurisu.Core.CustomClass;
|
|
||||||
|
|
||||||
namespace Dlhis.Basic.Dishes.Request;
|
namespace Dlhis.Basic.Dishes.Request;
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Dishes.Request;
|
namespace Dlhis.Basic.Dishes.Request;
|
||||||
|
|
||||||
public class DisheMenuPageRequest : PageDto
|
public class DishesMenuPageRequest : PageDto
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 营业点code
|
/// 营业点code
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Dishes.Request;
|
namespace Dlhis.Basic.Dishes.Request;
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
using Dlhis.Entity.Canteen.Enums;
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Dlhis.Basic.Dishes.Request;
|
using Dlhis.Basic.Dishes.Request;
|
||||||
using Dlhis.Basic.Dishes.Dto;
|
using Dlhis.Basic.Dishes.Dto;
|
||||||
using Dlhis.Basic.Dishes.Response;
|
using Dlhis.Basic.Dishes.Response;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Dishes.Services;
|
namespace Dlhis.Basic.Dishes.Services;
|
||||||
|
|
||||||
public interface IDishesMenuService : IScopeDependency
|
public interface IDishesMenuService : IScopeDependency
|
||||||
{
|
{
|
||||||
Task<Pagination<DishesMenuPageResponse>> GetDishesMenuPageAsync(DisheMenuPageRequest request);
|
Task<Pagination<DishesMenuPageResponse>> GetDishesMenuPageAsync(DishesMenuPageRequest request);
|
||||||
|
|
||||||
Task<DishesMenuSaveRequest> GetDishesMenuDetailAsync(Guid businessPlaceCode, string customCode, DateTime startDate, DateTime endDate);
|
Task<DishesMenuSaveRequest> GetDishesMenuDetailAsync(Guid businessPlaceCode, string customCode, DateTime startDate, DateTime endDate);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Dlhis.Basic.Dishes.Request;
|
using Dlhis.Basic.Dishes.Request;
|
||||||
using Dlhis.Basic.Dishes.Response;
|
using Dlhis.Basic.Dishes.Response;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Dishes.Services;
|
namespace Dlhis.Basic.Dishes.Services;
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using Dlhis.Basic.BusinessPlace.Services;
|
using Dlhis.Basic.Dishes.Request;
|
||||||
using Dlhis.Basic.Dishes.Request;
|
|
||||||
using Dlhis.Basic.Dishes.Response;
|
using Dlhis.Basic.Dishes.Response;
|
||||||
|
using Dlhis.Basic.Places.Services;
|
||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
using Dlhis.Entity.Canteen.Entities;
|
using Dlhis.Entity.Canteen.Entities;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Kurisu.SqlSugar.Services;
|
|
||||||
using Mapster;
|
using Mapster;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Dishes.Services.Implements;
|
namespace Dlhis.Basic.Dishes.Services.Implements;
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
using Dlhis.Entity.Canteen.Entities;
|
using Dlhis.Entity.Canteen.Entities;
|
||||||
using Dlhis.Entity.Canteen.Enums;
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Kurisu.SqlSugar.Extensions;
|
|
||||||
using Kurisu.SqlSugar.Services;
|
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Dlhis.Basic.Dishes.Request;
|
using Dlhis.Basic.Dishes.Request;
|
||||||
using Dlhis.Basic.Dishes.Response;
|
using Dlhis.Basic.Dishes.Response;
|
||||||
using Dlhis.Basic.BusinessPlace.Services;
|
|
||||||
using Dlhis.Basic.Dishes.Dto;
|
using Dlhis.Basic.Dishes.Dto;
|
||||||
using Kurisu.Core.CustomClass;
|
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
|
using Dlhis.Basic.Places.Services;
|
||||||
|
using Kurisu.AspNetCore.CustomClass;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Dishes.Services.Implements;
|
namespace Dlhis.Basic.Dishes.Services.Implements;
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ public class DishesMenuService : IDishesMenuService
|
|||||||
_businessPlacePermissionsService = businessPlacePermissionsService;
|
_businessPlacePermissionsService = businessPlacePermissionsService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<Pagination<DishesMenuPageResponse>> GetDishesMenuPageAsync(DisheMenuPageRequest request)
|
public async Task<Pagination<DishesMenuPageResponse>> GetDishesMenuPageAsync(DishesMenuPageRequest request)
|
||||||
{
|
{
|
||||||
return await _dbContext.Queryable<DishesMenuEntity>()
|
return await _dbContext.Queryable<DishesMenuEntity>()
|
||||||
.Where(x => x.BusinessPlaceCode == request.BusinessPlaceCode)
|
.Where(x => x.BusinessPlaceCode == request.BusinessPlaceCode)
|
||||||
@@ -43,11 +43,11 @@ public class DishesMenuService : IDishesMenuService
|
|||||||
public async Task<DishesMenuSaveRequest> GetDishesMenuDetailAsync(Guid businessPlaceCode, string customCode, DateTime startDate, DateTime endDate)
|
public async Task<DishesMenuSaveRequest> GetDishesMenuDetailAsync(Guid businessPlaceCode, string customCode, DateTime startDate, DateTime endDate)
|
||||||
{
|
{
|
||||||
var data = await _dbContext.Queryable<DishesMenuEntity>()
|
var data = await _dbContext.Queryable<DishesMenuEntity>()
|
||||||
.Where(x => x.BusinessPlaceCode == businessPlaceCode)
|
.Where(x => x.BusinessPlaceCode == businessPlaceCode)
|
||||||
.Where(x => x.CustomCode == customCode)
|
.Where(x => x.CustomCode == customCode)
|
||||||
.Where(x => x.StartDate == startDate)
|
.Where(x => x.StartDate == startDate)
|
||||||
.Where(x => x.EndDate == endDate)
|
.Where(x => x.EndDate == endDate)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
if (data.IsEmpty())
|
if (data.IsEmpty())
|
||||||
{
|
{
|
||||||
@@ -71,7 +71,7 @@ public class DishesMenuService : IDishesMenuService
|
|||||||
Start = data[0].StartDate,
|
Start = data[0].StartDate,
|
||||||
End = data[0].EndDate,
|
End = data[0].EndDate,
|
||||||
},
|
},
|
||||||
ShiftTypes = data.GroupBy(x => x.ShiftType).Select(item =>
|
ShiftTypes = data.GroupBy(x => x.ShiftType).Select(item =>
|
||||||
{
|
{
|
||||||
var shiftType = item.Key;
|
var shiftType = item.Key;
|
||||||
|
|
||||||
@@ -85,7 +85,6 @@ public class DishesMenuService : IDishesMenuService
|
|||||||
Price = x.Price,
|
Price = x.Price,
|
||||||
}).ToList()
|
}).ToList()
|
||||||
};
|
};
|
||||||
|
|
||||||
}).ToList()
|
}).ToList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -168,10 +167,10 @@ public class DishesMenuService : IDishesMenuService
|
|||||||
keys.ForEach(x =>
|
keys.ForEach(x =>
|
||||||
{
|
{
|
||||||
deleteWhere = deleteWhere.Or(item => item.BusinessPlaceCode == request.BusinessPlaceCode
|
deleteWhere = deleteWhere.Or(item => item.BusinessPlaceCode == request.BusinessPlaceCode
|
||||||
&& item.CustomCode == x.CustomCode
|
&& item.CustomCode == x.CustomCode
|
||||||
//&& SqlFunc.DateIsSame(item.StartDate, x.StartDate, DateType.Day)
|
//&& SqlFunc.DateIsSame(item.StartDate, x.StartDate, DateType.Day)
|
||||||
//&& SqlFunc.DateIsSame(item.EndDate, x.EndDate, DateType.Day)
|
//&& SqlFunc.DateIsSame(item.EndDate, x.EndDate, DateType.Day)
|
||||||
&& item.ShiftType == x.ShiftType);
|
&& item.ShiftType == x.ShiftType);
|
||||||
});
|
});
|
||||||
|
|
||||||
await _dbContext.Client.Deleteable<DishesMenuEntity>().Where(deleteWhere).ExecuteCommandAsync();
|
await _dbContext.Client.Deleteable<DishesMenuEntity>().Where(deleteWhere).ExecuteCommandAsync();
|
||||||
@@ -182,7 +181,7 @@ public class DishesMenuService : IDishesMenuService
|
|||||||
request.Items.ForEach(p =>
|
request.Items.ForEach(p =>
|
||||||
{
|
{
|
||||||
whereCheck = whereCheck.Or(x => x.BusinessPlaceCode == request.BusinessPlaceCode
|
whereCheck = whereCheck.Or(x => x.BusinessPlaceCode == request.BusinessPlaceCode
|
||||||
&& !(x.EndDate < p.Period.Start || x.StartDate > p.Period.End)
|
&& !(x.EndDate < p.Period.Start || x.StartDate > p.Period.End)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -196,24 +195,24 @@ public class DishesMenuService : IDishesMenuService
|
|||||||
public async Task<DishesMenuDetailDto> GetBookingDishesDetailAsync(DateTime date, Guid businessPlaceCode, ShiftEnumType shiftType, string dishesCode)
|
public async Task<DishesMenuDetailDto> GetBookingDishesDetailAsync(DateTime date, Guid businessPlaceCode, ShiftEnumType shiftType, string dishesCode)
|
||||||
{
|
{
|
||||||
var detail = await _dbContext.Queryable<DishesMenuEntity>()
|
var detail = await _dbContext.Queryable<DishesMenuEntity>()
|
||||||
.LeftJoin<DishesEntity>((x, d) => x.DishesCode == d.CustomCode)
|
.LeftJoin<DishesEntity>((x, d) => x.DishesCode == d.CustomCode)
|
||||||
.Where(x => x.StartDate <= date && date <= x.EndDate)
|
.Where(x => x.StartDate <= date && date <= x.EndDate)
|
||||||
.Where(x => x.BusinessPlaceCode == businessPlaceCode)
|
.Where(x => x.BusinessPlaceCode == businessPlaceCode)
|
||||||
.Where(x => x.ShiftType == shiftType)
|
.Where(x => x.ShiftType == shiftType)
|
||||||
.Where(x => x.DishesCode == dishesCode)
|
.Where(x => x.DishesCode == dishesCode)
|
||||||
.Where((x, d) => d.Enable)
|
.Where((x, d) => d.Enable)
|
||||||
.Select((x, d) => new DishesMenuDetailDto
|
.Select((x, d) => new DishesMenuDetailDto
|
||||||
{
|
{
|
||||||
Date = date,
|
Date = date,
|
||||||
MenuId = x.Id,
|
MenuId = x.Id,
|
||||||
DishesId = d.Id,
|
DishesId = d.Id,
|
||||||
DishesCode = d.CustomCode,
|
DishesCode = d.CustomCode,
|
||||||
DishesName = d.Name,
|
DishesName = d.Name,
|
||||||
Price = x.Price == null || x.Price == 0 ? d.Price : x.Price.Value,
|
Price = x.Price == null || x.Price == 0 ? d.Price : x.Price.Value,
|
||||||
Number = x.Number,
|
Number = x.Number,
|
||||||
Version = x.Version,
|
Version = x.Version,
|
||||||
})
|
})
|
||||||
.SingleAsync();
|
.SingleAsync();
|
||||||
|
|
||||||
return detail;
|
return detail;
|
||||||
}
|
}
|
||||||
@@ -237,4 +236,4 @@ public class DishesMenuService : IDishesMenuService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
using Dlhis.Basic.BusinessPlace.Services;
|
using Dlhis.Basic.Dishes.Request;
|
||||||
using Dlhis.Basic.Dishes.Request;
|
|
||||||
using Dlhis.Basic.Dishes.Response;
|
using Dlhis.Basic.Dishes.Response;
|
||||||
|
using Dlhis.Basic.Places.Services;
|
||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
using Dlhis.Entity.Canteen.Entities;
|
using Dlhis.Entity.Canteen.Entities;
|
||||||
using Dlhis.Entity.Canteen.Enums;
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
|
using Kurisu.AspNetCore.Authentication.Abstractions;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Kurisu.Core.User.Abstractions;
|
|
||||||
using Kurisu.SqlSugar.Extensions;
|
|
||||||
using Kurisu.SqlSugar.Services;
|
|
||||||
using Mapster;
|
using Mapster;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Dishes.Services.Implements;
|
namespace Dlhis.Basic.Dishes.Services.Implements;
|
||||||
@@ -31,19 +31,18 @@ public class DishesService : IDishesService
|
|||||||
var myCodes = await GetMyBusinessPlaceCodesAsync();
|
var myCodes = await GetMyBusinessPlaceCodesAsync();
|
||||||
|
|
||||||
return await _dbContext.Queryable<DishesEntity>()
|
return await _dbContext.Queryable<DishesEntity>()
|
||||||
.LeftJoin<DishesCategoryEntity>((x, category) => x.CategoryCode == category.Code)
|
.LeftJoin<DishesCategoryEntity>((x, category) => x.CategoryCode == category.Code)
|
||||||
.WhereIF(request.Search.IsPresent(), x => x.CustomCode == request.Search || x.Name.Contains(request.Search))
|
.WhereIF(request.Search.IsPresent(), x => x.CustomCode == request.Search || x.Name.Contains(request.Search))
|
||||||
.WhereIF(request.BusinessPlaceCodes.IsPresent(), x => request.BusinessPlaceCodes.Contains(x.BusinessPlaceCode))
|
.WhereIF(request.BusinessPlaceCodes.IsPresent(), x => request.BusinessPlaceCodes.Contains(x.BusinessPlaceCode))
|
||||||
.Where(x => myCodes.Contains(x.BusinessPlaceCode))
|
.Where(x => myCodes.Contains(x.BusinessPlaceCode))
|
||||||
.OrderBy(x => x.CreateTime, SqlSugar.OrderByType.Desc)
|
.OrderBy(x => x.CreateTime, SqlSugar.OrderByType.Desc)
|
||||||
.Select((x, category) => new DishesResponse
|
.Select((x, category) => new DishesResponse
|
||||||
{
|
{
|
||||||
Id = x.Id,
|
Id = x.Id,
|
||||||
CurrnetUnits = x.Units.ToString(),
|
CurrnetUnits = x.Units.ToString(),
|
||||||
CategoryName = category.Name,
|
CategoryName = category.Name,
|
||||||
|
}, true)
|
||||||
}, true)
|
.ToPageListAsync(request);
|
||||||
.ToPageListAsync(request);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -85,13 +84,12 @@ public class DishesService : IDishesService
|
|||||||
deadline = new TimeOnly(8, 30);
|
deadline = new TimeOnly(8, 30);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var payTypes = new List<BalanceRecordSourceEnumDto>() { new() { Type = BalanceRecordSourceEnumType.Cash } };
|
var payTypes = new List<BalanceRecordSourceEnumDto>() { new() { Type = BalanceRecordSourceEnumType.Cash } };
|
||||||
|
|
||||||
var selectTenantId = await _dbContext.Queryable<BusinessPlaceEntity>()
|
var selectTenantId = await _dbContext.Queryable<BusinessPlaceEntity>()
|
||||||
.Where(x => x.Code == request.BusinessPlaceCode)
|
.Where(x => x.Code == request.BusinessPlaceCode)
|
||||||
.Select(x => x.TenantId)
|
.Select(x => x.TenantId)
|
||||||
.FirstAsync();
|
.FirstAsync();
|
||||||
|
|
||||||
if (gainfo.Factory == selectTenantId)
|
if (gainfo.Factory == selectTenantId)
|
||||||
{
|
{
|
||||||
@@ -115,8 +113,6 @@ public class DishesService : IDishesService
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取我的营业点
|
/// 获取我的营业点
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -125,5 +121,4 @@ public class DishesService : IDishesService
|
|||||||
{
|
{
|
||||||
return (await _businessPlacePermissionsService.GetMyAsync()).Select(x => x.Code).ToList();
|
return (await _businessPlacePermissionsService.GetMyAsync()).Select(x => x.Code).ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,12 +20,10 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.8.5" />
|
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
|
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Dlhis.Common.Api\Dlhis.Common.Api.csproj" />
|
|
||||||
<ProjectReference Include="..\Dlhis.Entity\Dlhis.Entity.csproj" />
|
<ProjectReference Include="..\Dlhis.Entity\Dlhis.Entity.csproj" />
|
||||||
<ProjectReference Include="..\Dlhis.Scheduled.Api\Dlhis.Scheduled.Api.csproj" />
|
<ProjectReference Include="..\Dlhis.Scheduled.Api\Dlhis.Scheduled.Api.csproj" />
|
||||||
<ProjectReference Include="..\Dlhis.Sys.Api\Dlhis.Sys.Api.csproj" />
|
<ProjectReference Include="..\Dlhis.Sys.Api\Dlhis.Sys.Api.csproj" />
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using Dlhis.Basic.Map.Request;
|
using Dlhis.Basic.Map.Request;
|
||||||
using Dlhis.Basic.Map.Response;
|
using Dlhis.Basic.Map.Response;
|
||||||
using Dlhis.Basic.Map.Services;
|
using Dlhis.Basic.Map.Services;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Dlhis.Basic.Map.Request;
|
using Dlhis.Basic.Map.Request;
|
||||||
using Dlhis.Basic.Map.Response;
|
using Dlhis.Basic.Map.Response;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Map.Services;
|
namespace Dlhis.Basic.Map.Services;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using Dlhis.Basic.Map.Request;
|
using Dlhis.Basic.Map.Request;
|
||||||
using Dlhis.Basic.Map.Response;
|
using Dlhis.Basic.Map.Response;
|
||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
using Kurisu.SqlSugar.Services;
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
using Mapster;
|
using Mapster;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Map.Services.Implements;
|
namespace Dlhis.Basic.Map.Services.Implements;
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using Dlhis.Basic.Map.Request;
|
using Dlhis.Basic.Map.Request;
|
||||||
using Dlhis.Basic.Map.Response;
|
using Dlhis.Basic.Map.Response;
|
||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Kurisu.SqlSugar.Extensions;
|
|
||||||
using Kurisu.SqlSugar.Services;
|
|
||||||
using Mapster;
|
using Mapster;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Map.Services.Implements;
|
namespace Dlhis.Basic.Map.Services.Implements;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Dlhis.Basic.MealUser.Response;
|
using Dlhis.Basic.MealUser.Response;
|
||||||
using Dlhis.Basic.MealUser.Services;
|
using Dlhis.Basic.MealUser.Services;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using Dlhis.Basic.MealUser.Response;
|
using Dlhis.Basic.MealUser.Response;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.MealUser.Services;
|
namespace Dlhis.Basic.MealUser.Services;
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
using Dlhis.Basic.MealUser.Response;
|
using Dlhis.Basic.MealUser.Response;
|
||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
|
using Kurisu.AspNetCore.Authentication.Abstractions;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Kurisu.Core.User.Abstractions;
|
|
||||||
using Kurisu.SqlSugar.Extensions;
|
|
||||||
using Kurisu.SqlSugar.Services;
|
|
||||||
using Microsoft.CodeAnalysis;
|
|
||||||
|
|
||||||
namespace Dlhis.Basic.MealUser.Services.Implements;
|
namespace Dlhis.Basic.MealUser.Services.Implements;
|
||||||
|
|
||||||
@@ -43,4 +42,4 @@ public class MealUserService : IMealUserService
|
|||||||
|
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
using Dlhis.Basic.Organization.Request;
|
|
||||||
using Dlhis.Basic.Organization.Services;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace Dlhis.Basic.Organization.Controllers;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 外包人员
|
|
||||||
/// </summary>
|
|
||||||
[Authorize]
|
|
||||||
[Route("api/[controller]")]
|
|
||||||
[ApiController]
|
|
||||||
public class GainfoOutSourceController : ControllerBase
|
|
||||||
{
|
|
||||||
private readonly IGainfoOutSourceService _gainfoOutSourceService;
|
|
||||||
|
|
||||||
public GainfoOutSourceController(IGainfoOutSourceService gainfoOutSourceService)
|
|
||||||
{
|
|
||||||
_gainfoOutSourceService = gainfoOutSourceService;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 入职
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
[HttpPost("entry")]
|
|
||||||
public async Task EntryAsync(GainfoOutEntryRequest request)
|
|
||||||
{
|
|
||||||
await _gainfoOutSourceService.EntryAsync(request);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 离职
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
[HttpPost("resign")]
|
|
||||||
public async Task ResignAsync(GainfoOutResignRequest request)
|
|
||||||
{
|
|
||||||
await _gainfoOutSourceService.ResignAsync(request);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 编辑
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
[HttpPost("edit")]
|
|
||||||
public async Task EditAsync(GainfoOutEntryRequest request)
|
|
||||||
{
|
|
||||||
await _gainfoOutSourceService.EditAsync(request);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
using Dlhis.Basic.Organization.Request;
|
||||||
|
using Dlhis.Basic.Organization.Services;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Organization.Controllers;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 外包人员
|
||||||
|
/// </summary>
|
||||||
|
[Authorize]
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[ApiController]
|
||||||
|
public class GainfoOutsourceController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly IGainfoOutsourceService _gainfoOutSourceService;
|
||||||
|
|
||||||
|
public GainfoOutsourceController(IGainfoOutsourceService gainfoOutSourceService)
|
||||||
|
{
|
||||||
|
_gainfoOutSourceService = gainfoOutSourceService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 入职
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
[HttpPost("entry")]
|
||||||
|
[Transactional]
|
||||||
|
public async Task EntryAsync(GainfoOutsourceRequest request)
|
||||||
|
{
|
||||||
|
await _gainfoOutSourceService.SaveAsync(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 编辑
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
[HttpPost("edit")]
|
||||||
|
[Transactional]
|
||||||
|
public async Task EditAsync(GainfoOutsourceRequest request)
|
||||||
|
{
|
||||||
|
await _gainfoOutSourceService.SaveAsync(request);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
using Dlhis.Basic.BusinessPlace.Response;
|
using Dlhis.Basic.Device.Response;
|
||||||
using Dlhis.Basic.Device.Response;
|
|
||||||
using Dlhis.Basic.Organization.Request;
|
using Dlhis.Basic.Organization.Request;
|
||||||
using Dlhis.Basic.Organization.Response;
|
using Dlhis.Basic.Organization.Response;
|
||||||
using Dlhis.Basic.Organization.Services;
|
using Dlhis.Basic.Organization.Services;
|
||||||
|
using Dlhis.Basic.Places.Response;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
using Dlhis.Basic.Organization.Request;
|
using Dlhis.Basic.Organization.Request;
|
||||||
using Dlhis.Basic.Organization.Response;
|
using Dlhis.Basic.Organization.Response;
|
||||||
using Dlhis.Basic.Organization.Services;
|
using Dlhis.Basic.Organization.Services;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
@@ -188,5 +188,16 @@ public class GainfosController : ControllerBase
|
|||||||
{
|
{
|
||||||
return await _gainfoService.CheckIdNoAndNameMatchAsync(request);
|
return await _gainfoService.CheckIdNoAndNameMatchAsync(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 离职
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
[HttpPost("resign")]
|
||||||
|
[Transactional]
|
||||||
|
public async Task ResignAsync(GainfoResignRequest request)
|
||||||
|
{
|
||||||
|
await _gainfoService.ResignAsync(request);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using Dlhis.Basic.Organization.Request;
|
using Dlhis.Basic.Organization.Request;
|
||||||
using Dlhis.Basic.Organization.Response;
|
using Dlhis.Basic.Organization.Response;
|
||||||
using Dlhis.Basic.Organization.Services;
|
using Dlhis.Basic.Organization.Services;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Organization.Dto;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 外包人员额外信息
|
||||||
|
/// </summary>
|
||||||
|
public class GainfoOutSourceExternalInfoDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 供应商
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "供应商不可为空")]
|
||||||
|
public string Supplier { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 对接人员工号
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "对接人工号不可为空")]
|
||||||
|
public string SapCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 对接人员手机号
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "对接人手机号不可为空")]
|
||||||
|
public string SapPhone { get; set; }
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using Kurisu.Core.Result;
|
using Kurisu.AspNetCore.UnifyResultAndValidation;
|
||||||
using Kurisu.Core.Result.Abstractions;
|
using Kurisu.AspNetCore.UnifyResultAndValidation.Abstractions;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc.Filters;
|
using Microsoft.AspNetCore.Mvc.Filters;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
@@ -43,4 +43,4 @@ public class IgnoreDataCaseAttribute : Attribute, IAsyncResultFilter
|
|||||||
//eg:过滤器直接响应结果,此处进行短路
|
//eg:过滤器直接响应结果,此处进行短路
|
||||||
//await next();
|
//await next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
using Kurisu.Core.Result;
|
using Kurisu.AspNetCore.UnifyResultAndValidation;
|
||||||
using Kurisu.Core.Result.Abstractions;
|
using Kurisu.AspNetCore.UnifyResultAndValidation.Abstractions;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc.Filters;
|
using Microsoft.AspNetCore.Mvc.Filters;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Dlhis.Entity.Device.Enums;
|
using Dlhis.Entity.Device.Enums;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Organization.Request;
|
namespace Dlhis.Basic.Organization.Request;
|
||||||
|
|
||||||
|
|||||||
@@ -1,36 +1,35 @@
|
|||||||
using Dlhis.Entity.Basic.Enums;
|
using Dlhis.Entity.Basic.Enums;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Organization.Request
|
namespace Dlhis.Basic.Organization.Request;
|
||||||
|
|
||||||
|
public class GainfoListRequest : PageDto
|
||||||
{
|
{
|
||||||
public class GainfoListRequest:PageDto
|
/// <summary>
|
||||||
{
|
/// 档案类型
|
||||||
/// <summary>
|
/// </summary>
|
||||||
/// 档案类型
|
[Required]
|
||||||
/// </summary>
|
[EnumDataType(typeof(GainfoStatusEnumType))]
|
||||||
[Required]
|
public GainfoStatusEnumType Status { get; set; }
|
||||||
[EnumDataType(typeof(GainfoStatusEnumType))]
|
|
||||||
public GainfoStatusEnumType Status { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 姓名
|
/// 姓名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 身份证号
|
/// 身份证号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string IdNo { get; set; }
|
public string IdNo { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 部门编码
|
/// 部门编码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string DepartmentNo { get; set; }
|
public string DepartmentNo { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 学工号
|
/// 学工号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Code { get; set; }
|
public string Code { get; set; }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -1,119 +0,0 @@
|
|||||||
using Dlhis.Entity.Basic.Enums;
|
|
||||||
using SqlSugar;
|
|
||||||
|
|
||||||
namespace Dlhis.Basic.Organization.Request;
|
|
||||||
|
|
||||||
public class GainfoOutEntryRequest
|
|
||||||
{
|
|
||||||
public long? Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 姓名
|
|
||||||
/// </summary>
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 证件类型代码
|
|
||||||
/// </summary>
|
|
||||||
public string IdClass { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 身份证号
|
|
||||||
/// </summary>
|
|
||||||
public string IdNo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 身份证籍贯区域代码
|
|
||||||
/// </summary>
|
|
||||||
public string Native { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 性别 GenderEnumType
|
|
||||||
/// </summary>
|
|
||||||
public GenderEnumType Gender { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 生日
|
|
||||||
/// </summary>
|
|
||||||
public DateTime Birthday { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 身份证地址
|
|
||||||
/// </summary>
|
|
||||||
public string Address { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 部门编码
|
|
||||||
/// </summary>
|
|
||||||
public string DepartmentNo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 民族代码
|
|
||||||
/// </summary>
|
|
||||||
public string Nation { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 手机号码
|
|
||||||
/// </summary>
|
|
||||||
public string Phone { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 学历
|
|
||||||
/// </summary>
|
|
||||||
public string Degree { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 岗位
|
|
||||||
/// </summary>
|
|
||||||
public string PositionNo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 职等
|
|
||||||
/// </summary>
|
|
||||||
public string Grade { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 职级
|
|
||||||
/// </summary>
|
|
||||||
public string Title { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 卡号
|
|
||||||
/// </summary>
|
|
||||||
public string CardNo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 备注
|
|
||||||
/// </summary>
|
|
||||||
public string Remark { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 人事范围
|
|
||||||
/// </summary>
|
|
||||||
public string Werks { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 工作地
|
|
||||||
/// </summary>
|
|
||||||
public string Workplace { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 厂区
|
|
||||||
/// </summary>
|
|
||||||
public string Factory { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 成本中心
|
|
||||||
/// </summary>
|
|
||||||
public string CostId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 入职日期
|
|
||||||
/// </summary>
|
|
||||||
public DateTime? EntryDate { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 离职日期
|
|
||||||
/// </summary>
|
|
||||||
public DateTime? ResignationDate { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
|
|
||||||
namespace Dlhis.Basic.Organization.Request
|
|
||||||
{
|
|
||||||
public class GainfoOutResignRequest : IValidatableObject
|
|
||||||
{
|
|
||||||
public long Id { get; set; }
|
|
||||||
|
|
||||||
[Required]
|
|
||||||
public string Reason { get; set; }
|
|
||||||
|
|
||||||
public DateTime Date { get; set; }
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
|
||||||
{
|
|
||||||
if (Date < DateTime.Now.Date)
|
|
||||||
{
|
|
||||||
yield return new ValidationResult("离职日期不能小于当前时间", new[] { nameof(Date) });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Dlhis.Basic.Organization.Dto;
|
||||||
|
using Dlhis.Entity.Basic.Enums;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Organization.Request;
|
||||||
|
|
||||||
|
public class GainfoOutsourceRequest
|
||||||
|
{
|
||||||
|
public long? Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 姓名
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "姓名不可为空")]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 证件类型代码
|
||||||
|
/// </summary>
|
||||||
|
public string IdClass { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 证件号
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "证件号不可为空")]
|
||||||
|
public string IdNo { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 性别 GenderEnumType
|
||||||
|
/// </summary>
|
||||||
|
public GenderEnumType Gender { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 生日
|
||||||
|
/// </summary>
|
||||||
|
public DateTime Birthday { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 手机号码
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "手机号不可为空")]
|
||||||
|
public string Phone { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 备注
|
||||||
|
/// </summary>
|
||||||
|
public string Remark { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 厂区
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "厂区不可为空")]
|
||||||
|
public string Factory { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 入职日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? EntryDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 离职日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? ResignationDate { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public GainfoOutSourceExternalInfoDto ExternalInfo { get; set; }
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using Dlhis.Entity.Basic.Enums;
|
using Dlhis.Entity.Basic.Enums;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Organization.Request;
|
namespace Dlhis.Basic.Organization.Request;
|
||||||
|
|
||||||
@@ -16,13 +16,13 @@ public class GainfoPageRequest : PageDto, IValidatableObject
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 部门选择
|
/// 部门选择
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<TenantDepartmentRequest> DepartmentSelections { get; set; } = new List<TenantDepartmentRequest>();
|
public List<TenantDepartmentRequest> DepartmentSelections { get; set; } = new();
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否为外包
|
/// 是否为外包
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool? IsOutSource { get; set; }
|
public bool? IsOutsource { get; set; }
|
||||||
|
|
||||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||||
{
|
{
|
||||||
@@ -36,7 +36,6 @@ public class GainfoPageRequest : PageDto, IValidatableObject
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
31
Src/Dlhis.Basic/Organization/Request/GainfoResignRequest.cs
Normal file
31
Src/Dlhis.Basic/Organization/Request/GainfoResignRequest.cs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Organization.Request;
|
||||||
|
|
||||||
|
public class GainfoResignRequest : IValidatableObject
|
||||||
|
{
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 离职原因
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "离职原因不能为空")]
|
||||||
|
public string Reason { get; set; }
|
||||||
|
|
||||||
|
public DateTime Date { get; set; } = DateTime.Now;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否外包
|
||||||
|
/// </summary>
|
||||||
|
public bool IsOutsource { get; set; } = true;
|
||||||
|
|
||||||
|
|
||||||
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
if (Date < DateTime.Now.Date)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("离职日期不能小于当前时间", new[] { nameof(Date) });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
|
|
||||||
namespace Dlhis.Basic.Organization.Request
|
|
||||||
{
|
|
||||||
public class WeekNumberRequest : PageDto
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
using Dlhis.Basic.Organization.Request;
|
|
||||||
|
|
||||||
namespace Dlhis.Basic.Organization.Services;
|
|
||||||
|
|
||||||
public interface IGainfoOutSourceService : IScopeDependency
|
|
||||||
{
|
|
||||||
Task EntryAsync(GainfoOutEntryRequest request);
|
|
||||||
|
|
||||||
Task ResignAsync(GainfoOutResignRequest request);
|
|
||||||
|
|
||||||
Task EditAsync(GainfoOutEntryRequest request);
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
using Dlhis.Basic.Organization.Request;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Organization.Services;
|
||||||
|
|
||||||
|
public interface IGainfoOutsourceService : IScopeDependency
|
||||||
|
{
|
||||||
|
Task SaveAsync(GainfoOutsourceRequest request);
|
||||||
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
using Dlhis.Basic.BusinessPlace.Response;
|
using Dlhis.Basic.Device.Response;
|
||||||
using Dlhis.Basic.Device.Response;
|
|
||||||
using Dlhis.Basic.Organization.Request;
|
using Dlhis.Basic.Organization.Request;
|
||||||
using Dlhis.Basic.Organization.Response;
|
using Dlhis.Basic.Organization.Response;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Dlhis.Basic.Places.Response;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Organization.Services;
|
namespace Dlhis.Basic.Organization.Services;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Dlhis.Basic.Organization.Request;
|
using Dlhis.Basic.Organization.Request;
|
||||||
using Dlhis.Basic.Organization.Response;
|
using Dlhis.Basic.Organization.Response;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Organization.Services;
|
namespace Dlhis.Basic.Organization.Services;
|
||||||
|
|
||||||
@@ -19,4 +19,6 @@ public interface IGainfoService : IScopeDependency
|
|||||||
Task MigrationAsync(MigrationRequest request);
|
Task MigrationAsync(MigrationRequest request);
|
||||||
|
|
||||||
Task<string> CheckIdNoAndNameMatchAsync(GainfoCheckIdNoAndNameRequest request);
|
Task<string> CheckIdNoAndNameMatchAsync(GainfoCheckIdNoAndNameRequest request);
|
||||||
|
|
||||||
|
Task ResignAsync(GainfoResignRequest request);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Dlhis.Basic.Organization.Request;
|
using Dlhis.Basic.Organization.Request;
|
||||||
using Dlhis.Basic.Organization.Response;
|
using Dlhis.Basic.Organization.Response;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Organization.Services;
|
namespace Dlhis.Basic.Organization.Services;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using Dlhis.Basic.Organization.Response;
|
using Dlhis.Basic.Organization.Response;
|
||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
using Dlhis.Sys.Api;
|
using Dlhis.Sys.Api;
|
||||||
using Kurisu.SqlSugar.Services;
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
using Mapster;
|
using Mapster;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Organization.Services.Implements;
|
namespace Dlhis.Basic.Organization.Services.Implements;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using Dlhis.Basic.Organization.Request;
|
using Dlhis.Basic.Organization.Request;
|
||||||
using Dlhis.Basic.Organization.Response;
|
using Dlhis.Basic.Organization.Response;
|
||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Kurisu.SqlSugar.Services;
|
|
||||||
|
|
||||||
namespace Dlhis.Basic.Organization.Services.Implements;
|
namespace Dlhis.Basic.Organization.Services.Implements;
|
||||||
|
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ using Dlhis.Basic.Organization.Request;
|
|||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
using Dlhis.Entity.Basic.Enums;
|
using Dlhis.Entity.Basic.Enums;
|
||||||
using Dlhis.Entity.Device.Enums;
|
using Dlhis.Entity.Device.Enums;
|
||||||
|
using Kurisu.AspNetCore.Authentication.Abstractions;
|
||||||
|
using Kurisu.AspNetCore.CustomClass;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
using Kurisu.AspNetCore.Utils;
|
using Kurisu.AspNetCore.Utils;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Kurisu.Core.CustomClass;
|
|
||||||
using Kurisu.Core.User.Abstractions;
|
|
||||||
using Kurisu.SqlSugar.Services;
|
|
||||||
using Microsoft.AspNetCore.DataProtection;
|
using Microsoft.AspNetCore.DataProtection;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
using Dlhis.Basic.Organization.Request;
|
using Dlhis.Basic.Organization.Request;
|
||||||
using Dlhis.Basic.Organization.Response;
|
using Dlhis.Basic.Organization.Response;
|
||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
|
using Kurisu.AspNetCore.Authentication.Abstractions;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Entity;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Kurisu.Core.DataAccess.Entity;
|
|
||||||
using Kurisu.Core.User.Abstractions;
|
|
||||||
using Kurisu.SqlSugar.Services;
|
|
||||||
using Mapster;
|
using Mapster;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Organization.Services.Implements;
|
namespace Dlhis.Basic.Organization.Services.Implements;
|
||||||
|
|||||||
@@ -1,37 +1,57 @@
|
|||||||
using Dlhis.Basic.Organization.Request;
|
using Dlhis.Basic.Organization.Request;
|
||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
using Kurisu.AspNetCore.Utils;
|
using Kurisu.AspNetCore.Utils;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Kurisu.SqlSugar.Services;
|
|
||||||
using Mapster;
|
using Mapster;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Organization.Services.Implements;
|
namespace Dlhis.Basic.Organization.Services.Implements;
|
||||||
|
|
||||||
public class GainfoOutSourceService : IGainfoOutSourceService
|
public class GainfoOutsourceService : IGainfoOutsourceService
|
||||||
{
|
{
|
||||||
private readonly IDbContext _dbContext;
|
private readonly IDbContext _dbContext;
|
||||||
private readonly RedisCache _redisCache;
|
private readonly RedisCache _redisCache;
|
||||||
|
|
||||||
public GainfoOutSourceService(IDbContext dbContext, RedisCache redisCache)
|
public GainfoOutsourceService(IDbContext dbContext, RedisCache redisCache )
|
||||||
{
|
{
|
||||||
_dbContext = dbContext;
|
_dbContext = dbContext;
|
||||||
_redisCache = redisCache;
|
_redisCache = redisCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task EntryAsync(GainfoOutEntryRequest request)
|
public async Task SaveAsync(GainfoOutsourceRequest request)
|
||||||
{
|
{
|
||||||
await SaveAsync(request);
|
await CheckIdNoDuplicate(request.IdNo);
|
||||||
}
|
|
||||||
|
|
||||||
public async Task ResignAsync(GainfoOutResignRequest request)
|
if (!request.Id.HasValue)
|
||||||
{
|
{
|
||||||
//todo 生成任务处理
|
var entity = request.Adapt<GainfoEntity>();
|
||||||
}
|
entity.No = Guid.NewGuid().ToString();
|
||||||
|
entity.Code = await GetOutSourceCodeAsync();
|
||||||
|
|
||||||
public async Task EditAsync(GainfoOutEntryRequest request)
|
await _dbContext.InsertAsync(entity);
|
||||||
{
|
await _dbContext.InsertAsync(new OutsourceEntity
|
||||||
await SaveAsync(request);
|
{
|
||||||
|
Code = entity.Code,
|
||||||
|
Supplier = request.ExternalInfo.Supplier,
|
||||||
|
SapCode = request.ExternalInfo.SapCode,
|
||||||
|
SapPhone = request.ExternalInfo.SapPhone
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var entity = await _dbContext.Queryable<GainfoEntity>().FirstAsync(x => x.Id == request.Id);
|
||||||
|
entity.ThrowIfNull("档案数据不存在");
|
||||||
|
|
||||||
|
var outsource = await _dbContext.Queryable<OutsourceEntity>().FirstAsync(x => x.Code == entity.Code);
|
||||||
|
(outsource == null).ThrowIfTrue("不可编辑非外包人员档案数据");
|
||||||
|
|
||||||
|
request.Adapt(entity);
|
||||||
|
request.ExternalInfo.Adapt(outsource);
|
||||||
|
|
||||||
|
await _dbContext.UpdateAsync(entity);
|
||||||
|
await _dbContext.UpdateAsync(outsource);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -41,45 +61,28 @@ public class GainfoOutSourceService : IGainfoOutSourceService
|
|||||||
{
|
{
|
||||||
await using var handler = await _redisCache.LockAsync("gainfo:outsource:code-generate", expiry: TimeSpan.FromSeconds(3), retryInterval: TimeSpan.FromSeconds(1), retryCount: 3);
|
await using var handler = await _redisCache.LockAsync("gainfo:outsource:code-generate", expiry: TimeSpan.FromSeconds(3), retryInterval: TimeSpan.FromSeconds(1), retryCount: 3);
|
||||||
handler.Acquired.ThrowIfFalse("生成虚拟工号失败");
|
handler.Acquired.ThrowIfFalse("生成虚拟工号失败");
|
||||||
|
|
||||||
int code;
|
int code;
|
||||||
var entity = await _dbContext.Queryable<OutSourceEntity>().OrderBy(x => x.Id, OrderByType.Desc).FirstAsync();
|
var entity = await _dbContext.Queryable<OutsourceEntity>().OrderBy(x => x.Id, OrderByType.Desc).FirstAsync();
|
||||||
if (entity == null)
|
if (entity == null)
|
||||||
{
|
{
|
||||||
code = 1;
|
code = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
code = int.Parse(entity.Code.Replace("LS", "").Replace("0", "")) + 1;
|
code = int.Parse(entity.Code.Replace("LS", "").TrimStart('0')) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return "LS" + code.ToString().PadLeft(6, '0');
|
return "LS" + code.ToString().PadLeft(6, '0');
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task SaveAsync(GainfoOutEntryRequest request)
|
/// <summary>
|
||||||
|
/// 检查证件号重复
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idNo"></param>
|
||||||
|
private async Task CheckIdNoDuplicate(string idNo)
|
||||||
{
|
{
|
||||||
if (!request.Id.HasValue)
|
var exists = await _dbContext.Queryable<GainfoEntity>().Where(x => x.IdNo == idNo).AnyAsync();
|
||||||
{
|
exists.ThrowIfTrue($"证件号{idNo}重复");
|
||||||
var entity = request.Adapt<GainfoEntity>();
|
|
||||||
entity.No = Guid.NewGuid().ToString();
|
|
||||||
entity.Code = await GetOutSourceCodeAsync();
|
|
||||||
|
|
||||||
await _dbContext.InsertAsync(entity);
|
|
||||||
await _dbContext.InsertAsync(new OutSourceEntity
|
|
||||||
{
|
|
||||||
Code = entity.Code
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var entity = await _dbContext.Queryable<GainfoEntity>().FirstAsync(x => x.Id == request.Id);
|
|
||||||
entity.ThrowIfNull("档案数据不存在");
|
|
||||||
|
|
||||||
(await _dbContext.Queryable<OutSourceEntity>().AnyAsync(x => x.Code == entity.Code)).ThrowIfFalse("不可编辑非外包人员档案数据");
|
|
||||||
|
|
||||||
request.Adapt(entity);
|
|
||||||
|
|
||||||
await _dbContext.UpdateAsync(entity);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
using Dlhis.Basic.BusinessPlace.Response;
|
using Dlhis.Basic.Device.Response;
|
||||||
using Dlhis.Basic.Device.Response;
|
|
||||||
using Dlhis.Basic.Device.Services;
|
using Dlhis.Basic.Device.Services;
|
||||||
using Dlhis.Basic.Organization.Request;
|
using Dlhis.Basic.Organization.Request;
|
||||||
using Dlhis.Basic.Organization.Response;
|
using Dlhis.Basic.Organization.Response;
|
||||||
|
using Dlhis.Basic.Places.Response;
|
||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
using Dlhis.Entity.Canteen.Entities;
|
using Dlhis.Entity.Canteen.Entities;
|
||||||
using Dlhis.Entity.Canteen.Enums;
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
using Dlhis.Entity.Device.Entities;
|
using Dlhis.Entity.Device.Entities;
|
||||||
using Dlhis.Entity.Device.Enums;
|
using Dlhis.Entity.Device.Enums;
|
||||||
using Dlhis.Entity.Sys.Enums;
|
using Dlhis.Entity.Sys.Enums;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Kurisu.SqlSugar.Extensions;
|
|
||||||
using Kurisu.SqlSugar.Services;
|
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Organization.Services.Implements;
|
namespace Dlhis.Basic.Organization.Services.Implements;
|
||||||
@@ -33,8 +33,8 @@ public class GainfoPermissionService : IGainfoPermissionService
|
|||||||
public async Task<Pagination<BusinessPlaceResponse>> GetPlaceByGainfoAsync(DeviceAssRequest request)
|
public async Task<Pagination<BusinessPlaceResponse>> GetPlaceByGainfoAsync(DeviceAssRequest request)
|
||||||
{
|
{
|
||||||
var gainfo = await _gainfoStore.Queryable()
|
var gainfo = await _gainfoStore.Queryable()
|
||||||
.Where(x => x.No == request.UserNo)
|
.Where(x => x.No == request.UserNo)
|
||||||
.FirstAsync();
|
.FirstAsync();
|
||||||
|
|
||||||
if (gainfo == null)
|
if (gainfo == null)
|
||||||
{
|
{
|
||||||
@@ -53,26 +53,26 @@ public class GainfoPermissionService : IGainfoPermissionService
|
|||||||
.Where(x => deviceCodes.Contains(x.Code))
|
.Where(x => deviceCodes.Contains(x.Code))
|
||||||
.Where((x, dr) => dr.BusinessPlaceCode.HasValue)
|
.Where((x, dr) => dr.BusinessPlaceCode.HasValue)
|
||||||
.Select((x, dr, place, ps, s) => new BusinessPlaceResponse
|
.Select((x, dr, place, ps, s) => new BusinessPlaceResponse
|
||||||
{
|
{
|
||||||
Id = place.Id,
|
Id = place.Id,
|
||||||
Code = place.Code,
|
Code = place.Code,
|
||||||
Status = place.Status,
|
Status = place.Status,
|
||||||
Name = place.Name,
|
Name = place.Name,
|
||||||
Catalog = place.Catalog,
|
Catalog = place.Catalog,
|
||||||
CustomCode = place.CustomCode,
|
CustomCode = place.CustomCode,
|
||||||
Source = place.Source,
|
Source = place.Source,
|
||||||
|
|
||||||
ShiftCode = s.Code,
|
ShiftCode = s.Code,
|
||||||
ShiftName = s.Name
|
ShiftName = s.Name
|
||||||
})
|
})
|
||||||
.Distinct()
|
.Distinct()
|
||||||
.ToPageListAsync(request);
|
.ToPageListAsync(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<GetDevicesUnderGroupByUserNoResponse>> GetDevicesUnderGroupByUserNoAsync(string userNo, Guid deviceGroupCode)
|
public async Task<List<GetDevicesUnderGroupByUserNoResponse>> GetDevicesUnderGroupByUserNoAsync(string userNo, Guid deviceGroupCode)
|
||||||
{
|
{
|
||||||
var deviceGroups = await _dbContext.Queryable<DeviceGroupEntity>().ToListAsync();
|
var deviceGroups = await _dbContext.Queryable<DeviceGroupEntity>().ToListAsync();
|
||||||
var currentGroup = deviceGroups.Where(x => x.Code == deviceGroupCode).FirstOrDefault();
|
var currentGroup = deviceGroups.FirstOrDefault(x => x.Code == deviceGroupCode);
|
||||||
if (currentGroup == null)
|
if (currentGroup == null)
|
||||||
{
|
{
|
||||||
return new List<GetDevicesUnderGroupByUserNoResponse>();
|
return new List<GetDevicesUnderGroupByUserNoResponse>();
|
||||||
@@ -87,46 +87,46 @@ public class GainfoPermissionService : IGainfoPermissionService
|
|||||||
foreach (var groupcode in groups)
|
foreach (var groupcode in groups)
|
||||||
{
|
{
|
||||||
var nos = await _dbContext.Queryable<DeviceGroupRelationshipEntity>()
|
var nos = await _dbContext.Queryable<DeviceGroupRelationshipEntity>()
|
||||||
.LeftJoin<DeviceEntity>((x, d) => x.DeviceCode == d.Code)
|
.LeftJoin<DeviceEntity>((x, d) => x.DeviceCode == d.Code)
|
||||||
.Where(x => groupcode == x.GroupCode)
|
.Where(x => groupcode == x.GroupCode)
|
||||||
.Select((x, d) => d.UniqueNo)
|
.Select((x, d) => d.UniqueNo)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
var page = await _dbContext.Queryable<DeviceEntity>()
|
var page = await _dbContext.Queryable<DeviceEntity>()
|
||||||
.LeftJoin<DeviceTemplateEntity>((d, dt) => d.TemplateCode == dt.Code)
|
.LeftJoin<DeviceTemplateEntity>((d, dt) => d.TemplateCode == dt.Code)
|
||||||
.LeftJoin<DeviceRegistryEntity>((d, dt, dr) => d.UniqueNo == dr.DeviceUniqueNo)
|
.LeftJoin<DeviceRegistryEntity>((d, dt, dr) => d.UniqueNo == dr.DeviceUniqueNo)
|
||||||
.LeftJoin<BusinessPlaceEntity>((d, dt, dr, bp) => dr.BusinessPlaceCode == bp.Code)
|
.LeftJoin<BusinessPlaceEntity>((d, dt, dr, bp) => dr.BusinessPlaceCode == bp.Code)
|
||||||
.Where(d => nos.Contains(d.UniqueNo))
|
.Where(d => nos.Contains(d.UniqueNo))
|
||||||
.Select((d, dt, dr, bp) => new DevicePageResponse
|
.Select((d, dt, dr, bp) => new DevicePageResponse
|
||||||
{
|
{
|
||||||
FuncsStr = d.Funcs.ToString(),
|
FuncsStr = d.Funcs.ToString(),
|
||||||
Brand = dt.Brand,
|
Brand = dt.Brand,
|
||||||
Type = d.Type,
|
Type = d.Type,
|
||||||
BusinessPlaceCode = bp.Code,
|
BusinessPlaceCode = bp.Code,
|
||||||
BusinessPlaceName = bp.Name,
|
BusinessPlaceName = bp.Name,
|
||||||
LastHeartbeatTime = dr.LastHeartbeatTime,
|
LastHeartbeatTime = dr.LastHeartbeatTime,
|
||||||
UniqueNo = d.UniqueNo,
|
UniqueNo = d.UniqueNo,
|
||||||
Supplier = d.Supplier,
|
Supplier = d.Supplier,
|
||||||
DeployPlace = d.DeployPlace,
|
DeployPlace = d.DeployPlace,
|
||||||
DeployPosition = d.DeployPosition,
|
DeployPosition = d.DeployPosition,
|
||||||
DeployDirection = d.DeployDirection,
|
DeployDirection = d.DeployDirection,
|
||||||
TemplateCode = dt.Code,
|
TemplateCode = dt.Code,
|
||||||
ConnectionInfo = d.ConnectionInfo,
|
ConnectionInfo = d.ConnectionInfo,
|
||||||
Enable = d.Enable,
|
Enable = d.Enable,
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
var deviceUniqueNos = page.Select(x => x.UniqueNo).ToList();
|
var deviceUniqueNos = page.Select(x => x.UniqueNo).ToList();
|
||||||
|
|
||||||
var balanceInfos = await _dbContext.Queryable<BalanceRecordEntity>().Where(x => x.Type == BalanceRecordTypeEnumType.Out)
|
var balanceInfos = await _dbContext.Queryable<BalanceRecordEntity>().Where(x => x.Type == BalanceRecordTypeEnumType.Out)
|
||||||
.Where(x => deviceUniqueNos.Contains(x.DeviceUniqueNo))
|
.Where(x => deviceUniqueNos.Contains(x.DeviceUniqueNo))
|
||||||
.Select(x => new
|
.Select(x => new
|
||||||
{
|
{
|
||||||
x.DeviceUniqueNo,
|
x.DeviceUniqueNo,
|
||||||
Amount = SqlFunc.AggregateSum(x.Amount),
|
Amount = SqlFunc.AggregateSum(x.Amount),
|
||||||
UserCount = SqlFunc.AggregateDistinctCount(x.UserCode)
|
UserCount = SqlFunc.AggregateDistinctCount(x.UserCode)
|
||||||
})
|
})
|
||||||
.GroupBy(x => x.DeviceUniqueNo)
|
.GroupBy(x => x.DeviceUniqueNo)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
page.ForEach(device =>
|
page.ForEach(device =>
|
||||||
{
|
{
|
||||||
@@ -145,6 +145,7 @@ public class GainfoPermissionService : IGainfoPermissionService
|
|||||||
};
|
};
|
||||||
lst.Add(res);
|
lst.Add(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
return lst;
|
return lst;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -153,21 +154,21 @@ public class GainfoPermissionService : IGainfoPermissionService
|
|||||||
var ids = await _devicePermissionService.GetAssignDeviceCodesAsync(request.UserNo);
|
var ids = await _devicePermissionService.GetAssignDeviceCodesAsync(request.UserNo);
|
||||||
|
|
||||||
var page = await _dbContext.Queryable<DeviceEntity>()
|
var page = await _dbContext.Queryable<DeviceEntity>()
|
||||||
.LeftJoin<DeviceTemplateEntity>((d, dt) => d.TemplateCode == dt.Code)
|
.LeftJoin<DeviceTemplateEntity>((d, dt) => d.TemplateCode == dt.Code)
|
||||||
.LeftJoin<DeviceRegistryEntity>((d, dt, dr) => d.UniqueNo == dr.DeviceUniqueNo)
|
.LeftJoin<DeviceRegistryEntity>((d, dt, dr) => d.UniqueNo == dr.DeviceUniqueNo)
|
||||||
.LeftJoin<BusinessPlaceEntity>((d, dt, dr, bp) => dr.BusinessPlaceCode == bp.Code)
|
.LeftJoin<BusinessPlaceEntity>((d, dt, dr, bp) => dr.BusinessPlaceCode == bp.Code)
|
||||||
.WhereIF(request.DeviceType.HasValue, d => d.Type == request.DeviceType)
|
.WhereIF(request.DeviceType.HasValue, d => d.Type == request.DeviceType)
|
||||||
.Where(d => ids.Contains(d.Code))
|
.Where(d => ids.Contains(d.Code))
|
||||||
.Select((d, dt, dr, bp) => new DevicePageResponse
|
.Select((d, dt, dr, bp) => new DevicePageResponse
|
||||||
{
|
{
|
||||||
FuncsStr = d.Funcs.ToString(),
|
FuncsStr = d.Funcs.ToString(),
|
||||||
Brand = dt.Brand,
|
Brand = dt.Brand,
|
||||||
Type = d.Type,
|
Type = d.Type,
|
||||||
BusinessPlaceCode = bp.Code,
|
BusinessPlaceCode = bp.Code,
|
||||||
BusinessPlaceName = bp.Name,
|
BusinessPlaceName = bp.Name,
|
||||||
LastHeartbeatTime = dr.LastHeartbeatTime
|
LastHeartbeatTime = dr.LastHeartbeatTime
|
||||||
}, true)
|
}, true)
|
||||||
.ToPageListAsync(request);
|
.ToPageListAsync(request);
|
||||||
|
|
||||||
var deviceUniqueNos = page.Data.Select(x => x.UniqueNo).ToList();
|
var deviceUniqueNos = page.Data.Select(x => x.UniqueNo).ToList();
|
||||||
|
|
||||||
@@ -193,7 +194,6 @@ public class GainfoPermissionService : IGainfoPermissionService
|
|||||||
});
|
});
|
||||||
|
|
||||||
return page;
|
return page;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -206,8 +206,8 @@ public class GainfoPermissionService : IGainfoPermissionService
|
|||||||
if (gainfo == null && request.IsLeave)
|
if (gainfo == null && request.IsLeave)
|
||||||
{
|
{
|
||||||
gainfo = await _dbContext.Queryable<GainfoEntity>().AS("GainfoLeave")
|
gainfo = await _dbContext.Queryable<GainfoEntity>().AS("GainfoLeave")
|
||||||
.Where(x => x.No == request.UserNo)
|
.Where(x => x.No == request.UserNo)
|
||||||
.SingleAsync();
|
.SingleAsync();
|
||||||
|
|
||||||
if (gainfo != null)
|
if (gainfo != null)
|
||||||
{
|
{
|
||||||
@@ -217,23 +217,24 @@ public class GainfoPermissionService : IGainfoPermissionService
|
|||||||
|
|
||||||
gainfo.ThrowIfNull("档案数据不存在");
|
gainfo.ThrowIfNull("档案数据不存在");
|
||||||
|
|
||||||
|
//获取人员的设备权限
|
||||||
var deviceCodes = await _devicePermissionService.GetAssignDeviceCodesAsync(request.UserNo);
|
var deviceCodes = await _devicePermissionService.GetAssignDeviceCodesAsync(request.UserNo);
|
||||||
var devices = await _dbContext.Queryable<DeviceEntity>().Where(x => deviceCodes.Contains(x.Code)).ToListAsync();
|
var devices = await _dbContext.Queryable<DeviceEntity>().Where(x => deviceCodes.Contains(x.Code)).ToListAsync();
|
||||||
|
|
||||||
var tasks = devices.Select(x => new DeviceTaskEntity
|
var tasks = devices.Select(x => new DeviceTaskEntity
|
||||||
{
|
{
|
||||||
UserId = gainfo.Id,
|
UserId = gainfo!.Id,
|
||||||
CancellationId = 0,
|
Source = null,
|
||||||
Version = 0,
|
|
||||||
DeviceUniqueNo = x.UniqueNo,
|
DeviceUniqueNo = x.UniqueNo,
|
||||||
Status = DeviceTaskStatusEnumType.Wait,
|
Status = DeviceTaskStatusEnumType.Wait,
|
||||||
UserNo = request.UserNo,
|
UserNo = request.UserNo,
|
||||||
Type = request.IsLeave ? DeviceTaskEnumType.Delete : DeviceTaskEnumType.Add,
|
Type = request.IsLeave
|
||||||
|
? DeviceTaskEnumType.Delete
|
||||||
|
: DeviceTaskEnumType.Add,
|
||||||
DeviceType = x.Type,
|
DeviceType = x.Type,
|
||||||
TenantId = gainfo.Factory,
|
TenantId = gainfo.Factory,
|
||||||
Priority = 10
|
Priority = 10
|
||||||
})
|
}).ToList();
|
||||||
.ToList();
|
|
||||||
|
|
||||||
await _dbContext.InsertAsync(tasks);
|
await _dbContext.InsertAsync(tasks);
|
||||||
}
|
}
|
||||||
@@ -258,4 +259,4 @@ public class GainfoPermissionService : IGainfoPermissionService
|
|||||||
|
|
||||||
yield return current.Code;
|
yield return current.Code;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,11 +5,11 @@ using Dlhis.Entity.Basic.Enums;
|
|||||||
using Dlhis.Scheduled.Api;
|
using Dlhis.Scheduled.Api;
|
||||||
using Dlhis.Scheduled.Api.Request;
|
using Dlhis.Scheduled.Api.Request;
|
||||||
using Dlhis.Sys.Api;
|
using Dlhis.Sys.Api;
|
||||||
|
using Kurisu.AspNetCore.Authentication.Abstractions;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Kurisu.Core.User.Abstractions;
|
|
||||||
using Kurisu.SqlSugar.Extensions;
|
|
||||||
using Kurisu.SqlSugar.Services;
|
|
||||||
using Microsoft.AspNetCore.DataProtection;
|
using Microsoft.AspNetCore.DataProtection;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
@@ -23,6 +23,7 @@ public class GainfoService : IGainfoService
|
|||||||
private readonly ICurrentUser _currentUser;
|
private readonly ICurrentUser _currentUser;
|
||||||
private readonly ITenantApi _tenantApi;
|
private readonly ITenantApi _tenantApi;
|
||||||
private readonly IHangfireApi _hangfireApi;
|
private readonly IHangfireApi _hangfireApi;
|
||||||
|
private readonly IGainfoPermissionService _gainfoPermissionService;
|
||||||
private readonly ILogger<GainfoService> _logger;
|
private readonly ILogger<GainfoService> _logger;
|
||||||
|
|
||||||
public GainfoService(IGainfoStore gainfoStore,
|
public GainfoService(IGainfoStore gainfoStore,
|
||||||
@@ -31,6 +32,7 @@ public class GainfoService : IGainfoService
|
|||||||
ICurrentUser currentUser,
|
ICurrentUser currentUser,
|
||||||
ITenantApi tenantApi,
|
ITenantApi tenantApi,
|
||||||
IHangfireApi hangfireApi,
|
IHangfireApi hangfireApi,
|
||||||
|
IGainfoPermissionService gainfoPermissionService,
|
||||||
ILogger<GainfoService> logger)
|
ILogger<GainfoService> logger)
|
||||||
{
|
{
|
||||||
_gainfoStore = gainfoStore;
|
_gainfoStore = gainfoStore;
|
||||||
@@ -39,6 +41,7 @@ public class GainfoService : IGainfoService
|
|||||||
_currentUser = currentUser;
|
_currentUser = currentUser;
|
||||||
_tenantApi = tenantApi;
|
_tenantApi = tenantApi;
|
||||||
_hangfireApi = hangfireApi;
|
_hangfireApi = hangfireApi;
|
||||||
|
_gainfoPermissionService = gainfoPermissionService;
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,18 +58,17 @@ public class GainfoService : IGainfoService
|
|||||||
var where = LinqExpressionExtensions.False<GainfoEntity>();
|
var where = LinqExpressionExtensions.False<GainfoEntity>();
|
||||||
foreach (var item in request.DepartmentSelections)
|
foreach (var item in request.DepartmentSelections)
|
||||||
{
|
{
|
||||||
var depts = await GetRecursionDepartmentNosAsync(item.DepartmentNos);
|
var searchDepartments = await GetRecursionDepartmentNosAsync(item.DepartmentNos);
|
||||||
if (depts.Any())
|
where = searchDepartments.Any()
|
||||||
where = where.Or(gainfo => gainfo.Factory == item.Tenant && depts.Contains(gainfo.DepartmentNo));
|
? where.Or(gainfo => gainfo.Factory == item.Tenant && searchDepartments.Contains(gainfo.DepartmentNo))
|
||||||
else
|
: where.Or(gainfo => gainfo.Factory == item.Tenant);
|
||||||
where = where.Or(gainfo => gainfo.Factory == item.Tenant);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var page = await _gainfoStore.Queryable(request.Status)
|
var page = await _gainfoStore.Queryable(request.Status)
|
||||||
.WhereIF(request.DepartmentSelections.IsPresent(), where)
|
.WhereIF(request.DepartmentSelections.IsPresent(), where)
|
||||||
.WhereIF(request.DepartmentSelections.IsEmpty(), gainfo => gainfo.Factory == currentTenantId)
|
.WhereIF(request.DepartmentSelections.IsEmpty(), gainfo => gainfo.Factory == currentTenantId)
|
||||||
.WhereIF(request.IsOutSource.HasValue && request.IsOutSource.Value, gainfo => SqlFunc.Subqueryable<OutSourceEntity>().Where(x => x.Code == gainfo.Code).Any())
|
.WhereIF(request.IsOutsource.HasValue && request.IsOutsource.Value, gainfo => SqlFunc.Subqueryable<OutsourceEntity>().Where(x => x.Code == gainfo.Code).Any())
|
||||||
.WhereIF(request.IsOutSource.HasValue && !request.IsOutSource.Value, gainfo => SqlFunc.Subqueryable<OutSourceEntity>().Where(x => x.Code == gainfo.Code).NotAny())
|
.WhereIF(request.IsOutsource.HasValue && !request.IsOutsource.Value, gainfo => SqlFunc.Subqueryable<OutsourceEntity>().Where(x => x.Code == gainfo.Code).NotAny())
|
||||||
.WhereIF(request.Search.IsPresent(), gainfo =>
|
.WhereIF(request.Search.IsPresent(), gainfo =>
|
||||||
gainfo.Name.Contains(request.Search)
|
gainfo.Name.Contains(request.Search)
|
||||||
|| gainfo.Code == request.Search
|
|| gainfo.Code == request.Search
|
||||||
@@ -106,7 +108,6 @@ public class GainfoService : IGainfoService
|
|||||||
}
|
}
|
||||||
|
|
||||||
var gainfo = await _gainfoStore.Queryable().Where(x => x.Code == code).SingleAsync();
|
var gainfo = await _gainfoStore.Queryable().Where(x => x.Code == code).SingleAsync();
|
||||||
|
|
||||||
if (gainfo == null)
|
if (gainfo == null)
|
||||||
{
|
{
|
||||||
//开启同步处理
|
//开启同步处理
|
||||||
@@ -132,21 +133,21 @@ public class GainfoService : IGainfoService
|
|||||||
{
|
{
|
||||||
Balance = mealUser.Balance
|
Balance = mealUser.Balance
|
||||||
}
|
}
|
||||||
})
|
}).SingleAsync();
|
||||||
.FirstAsync();
|
|
||||||
|
|
||||||
if (info != null)
|
if (info != null)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var tenantResult = await _tenantApi.GetTenantByCodeAsync(info.Factory);
|
var tenantResult = await _tenantApi.GetTenantByCodeAsync(info.Factory);
|
||||||
if (tenantResult != null && tenantResult.Data != null)
|
if (tenantResult is { Data: not null })
|
||||||
{
|
{
|
||||||
info.Factory = tenantResult.Data.Name;
|
info.Factory = tenantResult.Data.Name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
// ignored
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,6 +168,39 @@ public class GainfoService : IGainfoService
|
|||||||
return protector.Protect(request.IdNo);
|
return protector.Protect(request.IdNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public async Task ResignAsync(GainfoResignRequest request)
|
||||||
|
{
|
||||||
|
var gainfo = await _dbContext.Queryable<GainfoEntity>().FirstAsync(x => x.Id == request.Id);
|
||||||
|
gainfo.ThrowIfNull("档案数据不存在");
|
||||||
|
|
||||||
|
if (request.IsOutsource)
|
||||||
|
{
|
||||||
|
var outsource = await _dbContext.Queryable<OutsourceEntity>().FirstAsync(x => x.Code == gainfo.Code);
|
||||||
|
(outsource == null).ThrowIfTrue("非外包人员不可手动离职");
|
||||||
|
}
|
||||||
|
|
||||||
|
await _gainfoPermissionService.ResetPermissionsAsync(new GainfoPermissionResetRequest
|
||||||
|
{
|
||||||
|
UserNo = gainfo.No,
|
||||||
|
IsLeave = true
|
||||||
|
});
|
||||||
|
|
||||||
|
//先写入离职表
|
||||||
|
gainfo.IdentityUserId = (int)gainfo.Id; //记录原始id
|
||||||
|
gainfo.ResignationDate = request.Date;
|
||||||
|
gainfo.Remark = request.Reason;
|
||||||
|
gainfo.Id = 0;
|
||||||
|
|
||||||
|
if (!await _dbContext.Queryable<GainfoEntity>().AS("GainfoLeave").AnyAsync(x => x.Code == gainfo.Code))
|
||||||
|
{
|
||||||
|
await _dbContext.Client.Insertable(gainfo).AS("GainfoLeave").ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
gainfo.Id = gainfo.IdentityUserId;
|
||||||
|
await _dbContext.DeleteReallyAsync(gainfo);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 档案列表
|
/// 档案列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -192,6 +226,7 @@ public class GainfoService : IGainfoService
|
|||||||
DepartmentName = de.Name,
|
DepartmentName = de.Name,
|
||||||
Address = ga.Address,
|
Address = ga.Address,
|
||||||
}).ToPageListAsync(request);
|
}).ToPageListAsync(request);
|
||||||
|
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
using Dlhis.Entity.Basic.Enums;
|
using Dlhis.Entity.Basic.Enums;
|
||||||
using Kurisu.SqlSugar.Services;
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Organization.Services.Implements;
|
namespace Dlhis.Basic.Organization.Services.Implements;
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using Dlhis.Basic.Organization.Request;
|
using Dlhis.Basic.Organization.Request;
|
||||||
using Dlhis.Basic.Organization.Response;
|
using Dlhis.Basic.Organization.Response;
|
||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Kurisu.SqlSugar.Extensions;
|
|
||||||
using Kurisu.SqlSugar.Services;
|
|
||||||
using Mapster;
|
using Mapster;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Organization.Services.Implements;
|
namespace Dlhis.Basic.Organization.Services.Implements;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
using Kurisu.AspNetCore;
|
using Kurisu.AspNetCore;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
using Kurisu.AspNetCore.Startup;
|
using Kurisu.AspNetCore.Startup;
|
||||||
using Kurisu.SqlSugar.Extensions;
|
|
||||||
using Kurisu.SqlSugar.Services;
|
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Packs;
|
namespace Dlhis.Basic.Packs;
|
||||||
@@ -58,16 +58,16 @@ public class SqlSugarPack : BaseAppPack
|
|||||||
{
|
{
|
||||||
using var scope = app.ApplicationServices.CreateScope();
|
using var scope = app.ApplicationServices.CreateScope();
|
||||||
var db = scope.ServiceProvider.GetService<IDbContext>();
|
var db = scope.ServiceProvider.GetService<IDbContext>();
|
||||||
var tables = App.ActiveTyps.Where(x => x.IsDefined(typeof(SugarTable), false))
|
// var tables = App.ActiveTyps.Where(x => x.IsDefined(typeof(SugarTable), false))
|
||||||
.Where(x => !x.IsDefined(typeof(SkipScanAttribute), false))
|
// .Where(x => !x.IsDefined(typeof(SkipScanAttribute), false))
|
||||||
.ToArray();
|
// .ToArray();
|
||||||
|
//
|
||||||
db.Client.DbMaintenance.CreateDatabase();
|
// db.Client.DbMaintenance.CreateDatabase();
|
||||||
db.Client.CodeFirst.InitTables(tables);
|
// db.Client.CodeFirst.InitTables(tables);
|
||||||
|
//
|
||||||
var faceDb = db.ChangeDb("face");
|
// var faceDb = db.ChangeDb("face");
|
||||||
faceDb.Client.DbMaintenance.CreateDatabase();
|
// faceDb.Client.DbMaintenance.CreateDatabase();
|
||||||
faceDb.Client.CodeFirst.InitTables<GainfoFaceEntity>();
|
// faceDb.Client.CodeFirst.InitTables<GainfoFaceEntity>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,11 +2,10 @@
|
|||||||
using Dlhis.Basic.Places.Request;
|
using Dlhis.Basic.Places.Request;
|
||||||
using Dlhis.Basic.Places.Response;
|
using Dlhis.Basic.Places.Response;
|
||||||
using Dlhis.Basic.Places.Services;
|
using Dlhis.Basic.Places.Services;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Org.BouncyCastle.Asn1.Ocsp;
|
|
||||||
|
|
||||||
namespace Dlhis.Basic.Places.Controllers;
|
namespace Dlhis.Basic.Places.Controllers;
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
using Dlhis.Basic.Places.Request;
|
using Dlhis.Basic.Places.Dto;
|
||||||
using Dlhis.Basic.BusinessPlace.Response;
|
using Dlhis.Basic.Places.Request;
|
||||||
using Dlhis.Basic.BusinessPlace.Services;
|
using Dlhis.Basic.Places.Response;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Dlhis.Basic.Places.Services;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Dlhis.Basic.Places.Dtos;
|
|
||||||
|
|
||||||
namespace Dlhis.Basic.BusinessPlace.Controllers;
|
namespace Dlhis.Basic.Places.Controllers;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 营业点权限管理
|
/// 营业点权限管理
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
using Dlhis.Basic.Places.Request;
|
using Dlhis.Basic.BusinessShift.Services;
|
||||||
using Dlhis.Basic.BusinessPlace.Response;
|
using Dlhis.Basic.Places.Request;
|
||||||
using Dlhis.Basic.BusinessPlace.Services;
|
using Dlhis.Basic.Places.Response;
|
||||||
using Dlhis.Basic.BusinessShift.Services;
|
using Dlhis.Basic.Places.Services;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace Dlhis.Basic.BusinessPlace.Controllers;
|
namespace Dlhis.Basic.Places.Controllers;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 营业点
|
/// 营业点
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Dlhis.Basic.Places.Dtos;
|
namespace Dlhis.Basic.Places.Dto;
|
||||||
|
|
||||||
public class BusinessPlaceDto
|
public class BusinessPlaceDto
|
||||||
{
|
{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Places.Request;
|
namespace Dlhis.Basic.Places.Request;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using Kurisu.Core.DataAccess.Dto;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Places.Request
|
namespace Dlhis.Basic.Places.Request
|
||||||
{
|
{
|
||||||
@@ -11,4 +11,4 @@ namespace Dlhis.Basic.Places.Request
|
|||||||
[Required(ErrorMessage = "营业点号不能为空")]
|
[Required(ErrorMessage = "营业点号不能为空")]
|
||||||
public string Code { get; set; }
|
public string Code { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Dlhis.Entity.Canteen.Enums;
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Places.Request;
|
namespace Dlhis.Basic.Places.Request;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Places.Request;
|
namespace Dlhis.Basic.Places.Request;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Dlhis.Entity.Canteen.Enums;
|
namespace Dlhis.Basic.Places.Response;
|
||||||
|
|
||||||
namespace Dlhis.Basic.BusinessPlace.Response;
|
|
||||||
|
|
||||||
public class BusinessPlaceListResponse : BusinessPlaceResponse
|
public class BusinessPlaceListResponse : BusinessPlaceResponse
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Dlhis.Basic.BusinessPlace.Response;
|
namespace Dlhis.Basic.Places.Response;
|
||||||
|
|
||||||
public class BusinessPlacePermissionPageResponse
|
public class BusinessPlacePermissionPageResponse
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using Dlhis.Entity.Canteen.Enums;
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
|
|
||||||
namespace Dlhis.Basic.BusinessPlace.Response;
|
namespace Dlhis.Basic.Places.Response;
|
||||||
|
|
||||||
public class BusinessPlaceResponse
|
public class BusinessPlaceResponse
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Dlhis.Basic.BusinessShift.Response;
|
using Dlhis.Basic.BusinessShift.Response;
|
||||||
|
|
||||||
namespace Dlhis.Basic.BusinessPlace.Response;
|
namespace Dlhis.Basic.Places.Response;
|
||||||
|
|
||||||
public class BusinessPlaceWithShiftResponse
|
public class BusinessPlaceWithShiftResponse
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Dlhis.Basic.BusinessPlace.Response
|
namespace Dlhis.Basic.Places.Response
|
||||||
{
|
{
|
||||||
public class DeviceCodeNameDetail
|
public class DeviceCodeNameDetail
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Dlhis.Basic.Places.Request;
|
using Dlhis.Basic.Places.Request;
|
||||||
using Dlhis.Basic.Places.Response;
|
using Dlhis.Basic.Places.Response;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Places.Services;
|
namespace Dlhis.Basic.Places.Services;
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using Dlhis.Basic.Places.Request;
|
using Dlhis.Basic.Places.Dto;
|
||||||
using Dlhis.Basic.BusinessPlace.Response;
|
using Dlhis.Basic.Places.Request;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Dlhis.Basic.Places.Response;
|
||||||
using Dlhis.Basic.Places.Dtos;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.BusinessPlace.Services;
|
namespace Dlhis.Basic.Places.Services;
|
||||||
|
|
||||||
public interface IBusinessPlacePermissionsService : IScopeDependency
|
public interface IBusinessPlacePermissionsService : IScopeDependency
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using Dlhis.Basic.Places.Request;
|
using Dlhis.Basic.Places.Request;
|
||||||
using Dlhis.Basic.BusinessPlace.Response;
|
using Dlhis.Basic.Places.Response;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Basic.BusinessPlace.Services;
|
namespace Dlhis.Basic.Places.Services;
|
||||||
|
|
||||||
public interface IBusinessPlaceService : IScopeDependency
|
public interface IBusinessPlaceService : IScopeDependency
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using Dlhis.Basic.Places.Request;
|
using Dlhis.Basic.Places.Request;
|
||||||
using Dlhis.Basic.Places.Response;
|
using Dlhis.Basic.Places.Response;
|
||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Kurisu.SqlSugar.Extensions;
|
|
||||||
using Kurisu.SqlSugar.Services;
|
|
||||||
using Mapster;
|
using Mapster;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Places.Services.Implements;
|
namespace Dlhis.Basic.Places.Services.Implements;
|
||||||
@@ -46,8 +46,8 @@ public class BookingAddressService : IBookingAddressService
|
|||||||
public async Task<List<BookingAddressPageResponse>> GetAllAddressAsync(string tenant)
|
public async Task<List<BookingAddressPageResponse>> GetAllAddressAsync(string tenant)
|
||||||
{
|
{
|
||||||
return await _dbContext.Queryable<BookingAddressEntity>()
|
return await _dbContext.Queryable<BookingAddressEntity>()
|
||||||
.Where(x => x.TenantId == tenant)
|
.Where(x => x.TenantId == tenant)
|
||||||
.Select<BookingAddressPageResponse>()
|
.Select<BookingAddressPageResponse>()
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,17 +1,15 @@
|
|||||||
using Dlhis.Basic.Places.Request;
|
using System.Security.Claims;
|
||||||
using Dlhis.Basic.BusinessPlace.Response;
|
using Dlhis.Basic.Places.Dto;
|
||||||
|
using Dlhis.Basic.Places.Request;
|
||||||
|
using Dlhis.Basic.Places.Response;
|
||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Kurisu.Core.User.Abstractions;
|
|
||||||
using Kurisu.SqlSugar.Services;
|
|
||||||
using Mapster;
|
|
||||||
using Dlhis.Basic.Places.Dtos;
|
|
||||||
using Kurisu.SqlSugar.Extensions;
|
|
||||||
using Dlhis.Sys.Api;
|
using Dlhis.Sys.Api;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Kurisu.AspNetCore.Authentication.Abstractions;
|
||||||
using System.Security.Claims;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
|
|
||||||
namespace Dlhis.Basic.BusinessPlace.Services.Implements;
|
namespace Dlhis.Basic.Places.Services.Implements;
|
||||||
|
|
||||||
public class BusinessPlacePermissionsService : IBusinessPlacePermissionsService
|
public class BusinessPlacePermissionsService : IBusinessPlacePermissionsService
|
||||||
{
|
{
|
||||||
@@ -41,10 +39,7 @@ public class BusinessPlacePermissionsService : IBusinessPlacePermissionsService
|
|||||||
var usersResult = await _userApi.GetUserByIdsAsync(page.Data.Select(x => x.UserId).Distinct().ToList());
|
var usersResult = await _userApi.GetUserByIdsAsync(page.Data.Select(x => x.UserId).Distinct().ToList());
|
||||||
var users = usersResult.Data;
|
var users = usersResult.Data;
|
||||||
|
|
||||||
page.Data.ForEach(item =>
|
page.Data.ForEach(item => { item.UserName = users.FirstOrDefault(x => x.Id == item.UserId)?.UserName; });
|
||||||
{
|
|
||||||
item.UserName = users.FirstOrDefault(x => x.Id == item.UserId)?.UserName;
|
|
||||||
});
|
|
||||||
|
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
@@ -59,16 +54,16 @@ public class BusinessPlacePermissionsService : IBusinessPlacePermissionsService
|
|||||||
if (isAdmin)
|
if (isAdmin)
|
||||||
{
|
{
|
||||||
codes = await _dbContext.Queryable<BusinessPlaceEntity>()
|
codes = await _dbContext.Queryable<BusinessPlaceEntity>()
|
||||||
.Select(x => x.Code)
|
.Select(x => x.Code)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
codes = await _dbContext.Queryable<BusinessPlaceManagerRelationshipEntity>()
|
codes = await _dbContext.Queryable<BusinessPlaceManagerRelationshipEntity>()
|
||||||
.Where(x => x.ManagerUserId == userId)
|
.Where(x => x.ManagerUserId == userId)
|
||||||
.Select(x => x.BusinessPlaceCode)
|
.Select(x => x.BusinessPlaceCode)
|
||||||
.Distinct()
|
.Distinct()
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -80,11 +75,9 @@ public class BusinessPlacePermissionsService : IBusinessPlacePermissionsService
|
|||||||
|
|
||||||
public async Task SaveBusinessPlacePermissionAsync(BusinessPlacePermissionSaveRequest request)
|
public async Task SaveBusinessPlacePermissionAsync(BusinessPlacePermissionSaveRequest request)
|
||||||
{
|
{
|
||||||
var userId = _currentUser.GetIntSubjectId();
|
|
||||||
|
|
||||||
await _dbContext.Client.Deleteable<BusinessPlaceManagerRelationshipEntity>()
|
await _dbContext.Client.Deleteable<BusinessPlaceManagerRelationshipEntity>()
|
||||||
.Where(x => x.ManagerUserId == request.UserId)
|
.Where(x => x.ManagerUserId == request.UserId)
|
||||||
.ExecuteCommandAsync();
|
.ExecuteCommandAsync();
|
||||||
|
|
||||||
await _dbContext.InsertAsync(request.BusinessPlaceCodes.Select(x => new BusinessPlaceManagerRelationshipEntity
|
await _dbContext.InsertAsync(request.BusinessPlaceCodes.Select(x => new BusinessPlaceManagerRelationshipEntity
|
||||||
{
|
{
|
||||||
@@ -96,23 +89,20 @@ public class BusinessPlacePermissionsService : IBusinessPlacePermissionsService
|
|||||||
public async Task<List<BusinessPlacePermissionPageResponse>> GetBusinessPlacePermissionByUserIdAsyc(int id)
|
public async Task<List<BusinessPlacePermissionPageResponse>> GetBusinessPlacePermissionByUserIdAsyc(int id)
|
||||||
{
|
{
|
||||||
var infos = await _dbContext.Queryable<BusinessPlaceManagerRelationshipEntity>()
|
var infos = await _dbContext.Queryable<BusinessPlaceManagerRelationshipEntity>()
|
||||||
.LeftJoin<BusinessPlaceEntity>((x, bplace) => x.BusinessPlaceCode == bplace.Code)
|
.LeftJoin<BusinessPlaceEntity>((x, bplace) => x.BusinessPlaceCode == bplace.Code)
|
||||||
.Where(x => x.ManagerUserId == id)
|
.Where(x => x.ManagerUserId == id)
|
||||||
.Select((x, bplace) => new BusinessPlacePermissionPageResponse
|
.Select((x, bplace) => new BusinessPlacePermissionPageResponse
|
||||||
{
|
{
|
||||||
UserId = x.ManagerUserId,
|
UserId = x.ManagerUserId,
|
||||||
BusinessPlaceCode = x.BusinessPlaceCode,
|
BusinessPlaceCode = x.BusinessPlaceCode,
|
||||||
BusinessPlaceName = bplace.Name,
|
BusinessPlaceName = bplace.Name,
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
var userResult = await _userApi.GetUserByIdAsync(id);
|
var userResult = await _userApi.GetUserByIdAsync(id);
|
||||||
var user = userResult.Data;
|
var user = userResult.Data;
|
||||||
|
|
||||||
infos.ForEach(item =>
|
infos.ForEach(item => { item.UserName = user?.UserName; });
|
||||||
{
|
|
||||||
item.UserName = user?.UserName;
|
|
||||||
});
|
|
||||||
|
|
||||||
return infos;
|
return infos;
|
||||||
}
|
}
|
||||||
@@ -121,4 +111,4 @@ public class BusinessPlacePermissionsService : IBusinessPlacePermissionsService
|
|||||||
{
|
{
|
||||||
await _dbContext.Client.Deleteable<BusinessPlaceManagerRelationshipEntity>().Where(x => x.Id == id).ExecuteCommandAsync();
|
await _dbContext.Client.Deleteable<BusinessPlaceManagerRelationshipEntity>().Where(x => x.Id == id).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
using Dlhis.Basic.Places.Request;
|
using Dlhis.Basic.Places.Request;
|
||||||
using Dlhis.Basic.BusinessPlace.Response;
|
using Dlhis.Basic.Places.Response;
|
||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
using Dlhis.Entity.Canteen.Enums;
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Kurisu.SqlSugar.Extensions;
|
|
||||||
using Kurisu.SqlSugar.Services;
|
|
||||||
using Mapster;
|
using Mapster;
|
||||||
|
|
||||||
namespace Dlhis.Basic.BusinessPlace.Services.Implements;
|
namespace Dlhis.Basic.Places.Services.Implements;
|
||||||
|
|
||||||
public class BusinessPlaceService : IBusinessPlaceService
|
public class BusinessPlaceService : IBusinessPlaceService
|
||||||
{
|
{
|
||||||
@@ -28,26 +28,27 @@ public class BusinessPlaceService : IBusinessPlaceService
|
|||||||
var page = await _dbContext.Queryable<BusinessPlaceEntity>()
|
var page = await _dbContext.Queryable<BusinessPlaceEntity>()
|
||||||
.LeftJoin<BusinessPlaceShiftRelationshipEntity>((x, ps) => x.Code == ps.PlaceCode)
|
.LeftJoin<BusinessPlaceShiftRelationshipEntity>((x, ps) => x.Code == ps.PlaceCode)
|
||||||
.LeftJoin<BusinessShiftEntity>((x, ps, s) => s.Code == ps.ShiftCode)
|
.LeftJoin<BusinessShiftEntity>((x, ps, s) => s.Code == ps.ShiftCode)
|
||||||
.WhereIF(request.Search.IsPresent(), x => x.CustomCode.Contains(request.Search)
|
.WhereIF(request.Search.IsPresent(), x => x.CustomCode.Contains(request.Search)
|
||||||
|| x.Code.ToString().Contains(request.Search) || x.Name.Contains(request.Search))
|
|| x.Code.ToString().Contains(request.Search)
|
||||||
.WhereIF(request.Catalog.HasValue, x => x.Catalog == request.Catalog)
|
|| x.Name.Contains(request.Search))
|
||||||
.WhereIF(request.Status.HasValue, x => x.Status == request.Status)
|
.WhereIF(request.Catalog.HasValue, x => x.Catalog == request.Catalog)
|
||||||
.WhereIF(request.Source.HasValue, x => x.Source == request.Source)
|
.WhereIF(request.Status.HasValue, x => x.Status == request.Status)
|
||||||
.Where(x => myCodes.Contains(x.Code))
|
.WhereIF(request.Source.HasValue, x => x.Source == request.Source)
|
||||||
.Select((x, ps, s) => new BusinessPlaceResponse
|
.Where(x => myCodes.Contains(x.Code))
|
||||||
{
|
.Select((x, ps, s) => new BusinessPlaceResponse
|
||||||
Id = x.Id,
|
{
|
||||||
Code = x.Code,
|
Id = x.Id,
|
||||||
Status = x.Status,
|
Code = x.Code,
|
||||||
Name = x.Name,
|
Status = x.Status,
|
||||||
Catalog = x.Catalog,
|
Name = x.Name,
|
||||||
CustomCode = x.CustomCode,
|
Catalog = x.Catalog,
|
||||||
Source = x.Source,
|
CustomCode = x.CustomCode,
|
||||||
Supplier = x.Supplier,
|
Source = x.Source,
|
||||||
ShiftCode = s.Code,
|
Supplier = x.Supplier,
|
||||||
ShiftName = s.Name
|
ShiftCode = s.Code,
|
||||||
})
|
ShiftName = s.Name
|
||||||
.ToPageListAsync(request);
|
})
|
||||||
|
.ToPageListAsync(request);
|
||||||
|
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
@@ -56,25 +57,25 @@ public class BusinessPlaceService : IBusinessPlaceService
|
|||||||
public async Task<List<BusinessPlaceListResponse>> GetOpenedListAsync(Guid? placeCode = null, string tenant = null)
|
public async Task<List<BusinessPlaceListResponse>> GetOpenedListAsync(Guid? placeCode = null, string tenant = null)
|
||||||
{
|
{
|
||||||
var list = await _dbContext.Queryable<BusinessPlaceEntity>()
|
var list = await _dbContext.Queryable<BusinessPlaceEntity>()
|
||||||
.LeftJoin<BusinessPlaceShiftRelationshipEntity>((x, ps) => x.Code == ps.PlaceCode)
|
.LeftJoin<BusinessPlaceShiftRelationshipEntity>((x, ps) => x.Code == ps.PlaceCode)
|
||||||
.LeftJoin<BusinessShiftEntity>((x, ps, s) => s.Code == ps.ShiftCode)
|
.LeftJoin<BusinessShiftEntity>((x, ps, s) => s.Code == ps.ShiftCode)
|
||||||
.Where(x => x.Status == CanteenBusinessPlaceStatusEnumType.Opened)
|
.Where(x => x.Status == CanteenBusinessPlaceStatusEnumType.Opened)
|
||||||
.WhereIF(placeCode.HasValue, x => x.Code == placeCode)
|
.WhereIF(placeCode.HasValue, x => x.Code == placeCode)
|
||||||
.WhereIF(tenant.IsPresent(), x => x.TenantId == tenant)
|
.WhereIF(tenant.IsPresent(), x => x.TenantId == tenant)
|
||||||
.Select((x, ps, s) => new BusinessPlaceListResponse
|
.Select((x, ps, s) => new BusinessPlaceListResponse
|
||||||
{
|
{
|
||||||
Id = x.Id,
|
Id = x.Id,
|
||||||
Code = x.Code,
|
Code = x.Code,
|
||||||
Status = x.Status,
|
Status = x.Status,
|
||||||
Name = x.Name,
|
Name = x.Name,
|
||||||
Catalog = x.Catalog,
|
Catalog = x.Catalog,
|
||||||
CustomCode = x.CustomCode,
|
CustomCode = x.CustomCode,
|
||||||
Source = x.Source,
|
Source = x.Source,
|
||||||
Supplier = x.Supplier,
|
Supplier = x.Supplier,
|
||||||
ShiftCode = s.Code,
|
ShiftCode = s.Code,
|
||||||
ShiftName = s.Name,
|
ShiftName = s.Name,
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
var shiftCodes = list.Where(x => x.ShiftCode.HasValue).Select(x => x.ShiftCode.Value).ToList();
|
var shiftCodes = list.Where(x => x.ShiftCode.HasValue).Select(x => x.ShiftCode.Value).ToList();
|
||||||
|
|
||||||
@@ -88,8 +89,8 @@ public class BusinessPlaceService : IBusinessPlaceService
|
|||||||
if (item.ShiftCode.HasValue)
|
if (item.ShiftCode.HasValue)
|
||||||
{
|
{
|
||||||
item.ShiftTypes = shiftTypes.Where(x => x.ShiftCode == item.ShiftCode.Value)
|
item.ShiftTypes = shiftTypes.Where(x => x.ShiftCode == item.ShiftCode.Value)
|
||||||
.Select(x => new Dictionary<int, string>() { [(int)x.ShiftType] = x.ShiftType.GetDescription() })
|
.Select(x => new Dictionary<int, string>() { [(int)x.ShiftType] = x.ShiftType.GetDescription() })
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -149,9 +150,9 @@ public class BusinessPlaceService : IBusinessPlaceService
|
|||||||
private async Task CheckExistsCustomCodeAsync(BusinessPlaceSaveRequest request)
|
private async Task CheckExistsCustomCodeAsync(BusinessPlaceSaveRequest request)
|
||||||
{
|
{
|
||||||
var existsSameCustomCode = await _dbContext.Queryable<BusinessPlaceEntity>()
|
var existsSameCustomCode = await _dbContext.Queryable<BusinessPlaceEntity>()
|
||||||
.Where(x => x.CustomCode == request.CustomCode)
|
.Where(x => x.CustomCode == request.CustomCode)
|
||||||
.WhereIF(request.Id.HasValue, x => x.Id != request.Id)
|
.WhereIF(request.Id.HasValue, x => x.Id != request.Id)
|
||||||
.AnyAsync();
|
.AnyAsync();
|
||||||
|
|
||||||
existsSameCustomCode.ThrowIfTrue($"自定义手工号[{request.CustomCode}]存在重复,请检查.");
|
existsSameCustomCode.ThrowIfTrue($"自定义手工号[{request.CustomCode}]存在重复,请检查.");
|
||||||
}
|
}
|
||||||
@@ -164,4 +165,4 @@ public class BusinessPlaceService : IBusinessPlaceService
|
|||||||
{
|
{
|
||||||
return (await _businessPlacePermissionsService.GetMyAsync()).Select(x => x.Code).ToList();
|
return (await _businessPlacePermissionsService.GetMyAsync()).Select(x => x.Code).ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user