Merge branch 'development'
This commit is contained in:
@@ -1,9 +1,7 @@
|
|||||||
using Dlhis.Basic.Appointment.Request;
|
using Dlhis.Basic.Appointment.Request;
|
||||||
using Dlhis.Basic.Appointment.Response;
|
using Dlhis.Basic.Appointment.Response;
|
||||||
using Dlhis.Entity.Device.Enums;
|
|
||||||
using Dlhis.Entity.Visitor.Enums;
|
using Dlhis.Entity.Visitor.Enums;
|
||||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace Dlhis.Basic.Appointment.Services;
|
namespace Dlhis.Basic.Appointment.Services;
|
||||||
|
|
||||||
@@ -57,9 +55,15 @@ public interface IAppointmentService : IScopeDependency
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<List<AppointmentDetailResponse>> GetRecordListAsync(string factory, string search, VisitorAppointmentDetailStatusEnumType? status, DateTime start, DateTime end);
|
Task<List<AppointmentDetailResponse>> GetRecordListAsync(string factory, string search, VisitorAppointmentDetailStatusEnumType? status, DateTime start, DateTime end);
|
||||||
|
|
||||||
Task<Pagination<AppointmentDetailResponse>> GetRecordPageByIdNoAsync([FromQuery] AppointmentIdNoPageRequest request);
|
Task<Pagination<AppointmentDetailResponse>> GetRecordPageByIdNoAsync(AppointmentIdNoPageRequest request);
|
||||||
|
|
||||||
Task<AppointmentSummaryResponse> GetSummaryAsync(string factory, DateTime start, DateTime end);
|
Task<AppointmentSummaryResponse> GetSummaryAsync(string factory, DateTime start, DateTime end);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新人脸
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="detailId"></param>
|
||||||
|
/// <param name="base64"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task UpdateFaceAsync(long detailId, string base64);
|
Task UpdateFaceAsync(long detailId, string base64);
|
||||||
}
|
}
|
||||||
@@ -108,7 +108,6 @@ public class AppointmentAreaService : IAppointmentAreaService
|
|||||||
DeviceUniqueNo = devices.First(item => item.Code == x).UniqueNo,
|
DeviceUniqueNo = devices.First(item => item.Code == x).UniqueNo,
|
||||||
Status = DeviceTaskStatusEnumType.Wait,
|
Status = DeviceTaskStatusEnumType.Wait,
|
||||||
Version = 0,
|
Version = 0,
|
||||||
CancellationId = 0,
|
|
||||||
Source = "预约区域和设备组关系变更生成",
|
Source = "预约区域和设备组关系变更生成",
|
||||||
Priority = 99
|
Priority = 99
|
||||||
}));
|
}));
|
||||||
@@ -121,7 +120,6 @@ public class AppointmentAreaService : IAppointmentAreaService
|
|||||||
DeviceUniqueNo = devices.First(item => item.Code == x).UniqueNo,
|
DeviceUniqueNo = devices.First(item => item.Code == x).UniqueNo,
|
||||||
Status = DeviceTaskStatusEnumType.Wait,
|
Status = DeviceTaskStatusEnumType.Wait,
|
||||||
Version = 0,
|
Version = 0,
|
||||||
CancellationId = 0,
|
|
||||||
Source = "预约区域和设备组关系变更生成",
|
Source = "预约区域和设备组关系变更生成",
|
||||||
Priority = 99
|
Priority = 99
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
using Dlhis.Basic.Device.Request;
|
||||||
|
using Dlhis.Basic.Device.Response;
|
||||||
|
using Dlhis.Basic.Device.Services;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Device.Controllers;
|
||||||
|
|
||||||
|
[Authorize]
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[ApiController]
|
||||||
|
public class DevicePermissionManuallyController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly IDevicePermissionManuallyService _devicePermissionService;
|
||||||
|
|
||||||
|
public DevicePermissionManuallyController(IDevicePermissionManuallyService devicePermissionService)
|
||||||
|
{
|
||||||
|
_devicePermissionService = devicePermissionService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据分页
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="requestDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("page")]
|
||||||
|
[DataPermission]
|
||||||
|
public async Task<Pagination<DevicePermissionManuallyResponse>> GetPageAsync([FromQuery] PageDto requestDto)
|
||||||
|
{
|
||||||
|
return await _devicePermissionService.GetPageAsync(requestDto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 添加权限
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
[HttpPost("add")]
|
||||||
|
[Transactional]
|
||||||
|
public async Task AddAsync(DevicePermissionManuallyAddRequest request)
|
||||||
|
{
|
||||||
|
await _devicePermissionService.AddAsync(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除权限
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
[HttpGet("{id:long}")]
|
||||||
|
[Transactional]
|
||||||
|
public async Task DeleteAsync(long id)
|
||||||
|
{
|
||||||
|
await _devicePermissionService.DeleteAsync(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Device.Request;
|
||||||
|
|
||||||
|
public class DevicePermissionManuallyAddRequest
|
||||||
|
{
|
||||||
|
public Guid DeviceCode { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
public string UserNo { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
namespace Dlhis.Basic.Device.Response;
|
||||||
|
|
||||||
|
public class DevicePermissionManuallyResponse
|
||||||
|
{
|
||||||
|
public long Id { get; set; }
|
||||||
|
public Guid DeviceCode { get; set; }
|
||||||
|
public string DeviceUniqueNo { get; set; }
|
||||||
|
public string DeployPlace { get; set; }
|
||||||
|
public string UserNo { get; set; }
|
||||||
|
public string UserName { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
using Dlhis.Basic.Device.Request;
|
||||||
|
using Dlhis.Basic.Device.Response;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Device.Services;
|
||||||
|
|
||||||
|
public interface IDevicePermissionManuallyService : IScopeDependency
|
||||||
|
{
|
||||||
|
Task<Pagination<DevicePermissionManuallyResponse>> GetPageAsync(PageDto requestDto);
|
||||||
|
|
||||||
|
Task AddAsync(DevicePermissionManuallyAddRequest request);
|
||||||
|
|
||||||
|
Task DeleteAsync(long id);
|
||||||
|
}
|
||||||
@@ -83,7 +83,6 @@ public abstract class BasePermissionAnalyzeService : IPermissionAnalyzeService
|
|||||||
Status = DeviceTaskStatusEnumType.Wait,
|
Status = DeviceTaskStatusEnumType.Wait,
|
||||||
Version = 0,
|
Version = 0,
|
||||||
ResultMessage = null,
|
ResultMessage = null,
|
||||||
CancellationId = 0,
|
|
||||||
Source = source,
|
Source = source,
|
||||||
Priority = 0,
|
Priority = 0,
|
||||||
TenantId = x.TenantId,
|
TenantId = x.TenantId,
|
||||||
@@ -99,7 +98,6 @@ public abstract class BasePermissionAnalyzeService : IPermissionAnalyzeService
|
|||||||
Status = DeviceTaskStatusEnumType.Wait,
|
Status = DeviceTaskStatusEnumType.Wait,
|
||||||
Version = 0,
|
Version = 0,
|
||||||
ResultMessage = null,
|
ResultMessage = null,
|
||||||
CancellationId = 0,
|
|
||||||
Source = source,
|
Source = source,
|
||||||
Priority = 0,
|
Priority = 0,
|
||||||
TenantId = x.TenantId,
|
TenantId = x.TenantId,
|
||||||
|
|||||||
@@ -225,7 +225,6 @@ public class DeviceGroupService : IDeviceGroupService
|
|||||||
Status = DeviceTaskStatusEnumType.Wait,
|
Status = DeviceTaskStatusEnumType.Wait,
|
||||||
Version = 0,
|
Version = 0,
|
||||||
ResultMessage = null,
|
ResultMessage = null,
|
||||||
CancellationId = 0,
|
|
||||||
Source = "人员分组分配",
|
Source = "人员分组分配",
|
||||||
Priority = 0,
|
Priority = 0,
|
||||||
TenantId = x.TenantId
|
TenantId = x.TenantId
|
||||||
@@ -259,7 +258,6 @@ public class DeviceGroupService : IDeviceGroupService
|
|||||||
Status = DeviceTaskStatusEnumType.Wait,
|
Status = DeviceTaskStatusEnumType.Wait,
|
||||||
Version = 0,
|
Version = 0,
|
||||||
ResultMessage = null,
|
ResultMessage = null,
|
||||||
CancellationId = 0,
|
|
||||||
Source = "人员分组分配",
|
Source = "人员分组分配",
|
||||||
Priority = 0,
|
Priority = 0,
|
||||||
TenantId = x.TenantId,
|
TenantId = x.TenantId,
|
||||||
|
|||||||
@@ -125,7 +125,6 @@ public class DevicePermissionAnalyzeService : IDevicePermissionAnalyzeService
|
|||||||
DeviceUniqueNo = devices.First(item => item.Code == x).UniqueNo,
|
DeviceUniqueNo = devices.First(item => item.Code == x).UniqueNo,
|
||||||
Status = DeviceTaskStatusEnumType.Wait,
|
Status = DeviceTaskStatusEnumType.Wait,
|
||||||
Type = DeviceTaskEnumType.Delete,
|
Type = DeviceTaskEnumType.Delete,
|
||||||
CancellationId = 0,
|
|
||||||
DeviceType = devices.First(item => item.Code == x).Type,
|
DeviceType = devices.First(item => item.Code == x).Type,
|
||||||
UserNo = userNo,
|
UserNo = userNo,
|
||||||
Version = 0,
|
Version = 0,
|
||||||
|
|||||||
@@ -0,0 +1,103 @@
|
|||||||
|
using Dlhis.Basic.Device.Request;
|
||||||
|
using Dlhis.Basic.Device.Response;
|
||||||
|
using Dlhis.Entity.Basic.Entity;
|
||||||
|
using Dlhis.Entity.Device.Entities;
|
||||||
|
using Dlhis.Entity.Device.Enums;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Device.Services.Implements;
|
||||||
|
|
||||||
|
public class DevicePermissionManuallyService : IDevicePermissionManuallyService
|
||||||
|
{
|
||||||
|
private readonly IDbContext _dbContext;
|
||||||
|
|
||||||
|
public DevicePermissionManuallyService(IDbContext dbContext)
|
||||||
|
{
|
||||||
|
_dbContext = dbContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public async Task<Pagination<DevicePermissionManuallyResponse>> GetPageAsync(PageDto requestDto)
|
||||||
|
{
|
||||||
|
return await _dbContext.Queryable<DevicePermissionManuallyEntity>()
|
||||||
|
.LeftJoin<DeviceEntity>((x, d) => x.DeviceCode == d.Code)
|
||||||
|
.LeftJoin<GainfoEntity>((x, d, g) => x.UserNo == g.No)
|
||||||
|
.Select((x, d, g) => new DevicePermissionManuallyResponse
|
||||||
|
{
|
||||||
|
Id = x.Id,
|
||||||
|
DeviceCode = x.DeviceCode,
|
||||||
|
DeviceUniqueNo = d.UniqueNo,
|
||||||
|
DeployPlace = d.DeployPlace,
|
||||||
|
UserNo = x.UserNo,
|
||||||
|
UserName = g.Name
|
||||||
|
})
|
||||||
|
.ToPageListAsync(requestDto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public async Task AddAsync(DevicePermissionManuallyAddRequest request)
|
||||||
|
{
|
||||||
|
var device = await _dbContext.Queryable<DeviceEntity>().Where(x => x.Code == request.DeviceCode).SingleAsync();
|
||||||
|
device.ThrowIfNull("设备不存在");
|
||||||
|
|
||||||
|
var gainfo = await _dbContext.Queryable<GainfoEntity>().Where(x => x.No == request.UserNo).SingleAsync();
|
||||||
|
gainfo.ThrowIfNull("人员不存在");
|
||||||
|
|
||||||
|
|
||||||
|
await _dbContext.InsertAsync(new DevicePermissionManuallyEntity
|
||||||
|
{
|
||||||
|
DeviceCode = request.DeviceCode,
|
||||||
|
UserNo = request.UserNo
|
||||||
|
});
|
||||||
|
|
||||||
|
await _dbContext.InsertAsync(new DeviceTaskEntity
|
||||||
|
{
|
||||||
|
Type = DeviceTaskEnumType.Add,
|
||||||
|
DeviceType = device.Type,
|
||||||
|
UserId = null,
|
||||||
|
UserNo = request.UserNo,
|
||||||
|
DeviceUniqueNo = device.UniqueNo,
|
||||||
|
Status = DeviceTaskStatusEnumType.Wait,
|
||||||
|
Version = 0,
|
||||||
|
ResultMessage = null,
|
||||||
|
Source = "手动分配额外权限",
|
||||||
|
Priority = 0,
|
||||||
|
TenantId = device.TenantId
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public async Task DeleteAsync(long id)
|
||||||
|
{
|
||||||
|
var data = await _dbContext.Queryable<DevicePermissionManuallyEntity>().Where(x => x.Id == id).SingleAsync();
|
||||||
|
data.ThrowIfNull("数据不存在");
|
||||||
|
|
||||||
|
var device = await _dbContext.Queryable<DeviceEntity>().Where(x => x.Code == data.DeviceCode).SingleAsync();
|
||||||
|
if (device != null)
|
||||||
|
{
|
||||||
|
var userNo = await _dbContext.Queryable<GainfoEntity>().Where(x => x.No == data.UserNo).Select(x => x.No).SingleAsync();
|
||||||
|
if (userNo.IsPresent())
|
||||||
|
{
|
||||||
|
await _dbContext.InsertAsync(new DeviceTaskEntity
|
||||||
|
{
|
||||||
|
Type = DeviceTaskEnumType.Delete,
|
||||||
|
DeviceType = device.Type,
|
||||||
|
UserId = null,
|
||||||
|
UserNo = userNo,
|
||||||
|
DeviceUniqueNo = device.UniqueNo,
|
||||||
|
Status = DeviceTaskStatusEnumType.Wait,
|
||||||
|
Version = 0,
|
||||||
|
ResultMessage = null,
|
||||||
|
Source = "手动分配额外权限",
|
||||||
|
Priority = 0,
|
||||||
|
TenantId = device.TenantId
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await _dbContext.DeleteAsync(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -101,7 +101,6 @@ public class DevicePermissionService : IDevicePermissionService
|
|||||||
Status = DeviceTaskStatusEnumType.Wait,
|
Status = DeviceTaskStatusEnumType.Wait,
|
||||||
Version = 0,
|
Version = 0,
|
||||||
ResultMessage = null,
|
ResultMessage = null,
|
||||||
CancellationId = 0,
|
|
||||||
Source = "人员分配到设备unique",
|
Source = "人员分配到设备unique",
|
||||||
Priority = 0,
|
Priority = 0,
|
||||||
TenantId = currentTenantId,
|
TenantId = currentTenantId,
|
||||||
@@ -129,7 +128,6 @@ public class DevicePermissionService : IDevicePermissionService
|
|||||||
Status = DeviceTaskStatusEnumType.Wait,
|
Status = DeviceTaskStatusEnumType.Wait,
|
||||||
Version = 0,
|
Version = 0,
|
||||||
ResultMessage = null,
|
ResultMessage = null,
|
||||||
CancellationId = 20,
|
|
||||||
Source = "人员分配到设备unique",
|
Source = "人员分配到设备unique",
|
||||||
Priority = 0,
|
Priority = 0,
|
||||||
TenantId = currentTenantId
|
TenantId = currentTenantId
|
||||||
@@ -207,7 +205,6 @@ public class DevicePermissionService : IDevicePermissionService
|
|||||||
Status = DeviceTaskStatusEnumType.Wait,
|
Status = DeviceTaskStatusEnumType.Wait,
|
||||||
Version = 0,
|
Version = 0,
|
||||||
ResultMessage = null,
|
ResultMessage = null,
|
||||||
CancellationId = 0,
|
|
||||||
Source = "人员分配到设备import",
|
Source = "人员分配到设备import",
|
||||||
Priority = 0,
|
Priority = 0,
|
||||||
TenantId = device.TenantId,
|
TenantId = device.TenantId,
|
||||||
@@ -397,7 +394,6 @@ public class DevicePermissionService : IDevicePermissionService
|
|||||||
DeviceUniqueNo = device.UniqueNo,
|
DeviceUniqueNo = device.UniqueNo,
|
||||||
Status = DeviceTaskStatusEnumType.Wait,
|
Status = DeviceTaskStatusEnumType.Wait,
|
||||||
Type = DeviceTaskEnumType.Add,
|
Type = DeviceTaskEnumType.Add,
|
||||||
CancellationId = 0,
|
|
||||||
DeviceType = device.Type,
|
DeviceType = device.Type,
|
||||||
UserNo = x,
|
UserNo = x,
|
||||||
Version = 0,
|
Version = 0,
|
||||||
@@ -423,7 +419,6 @@ public class DevicePermissionService : IDevicePermissionService
|
|||||||
Type = taskType,
|
Type = taskType,
|
||||||
DeviceType = x.Type,
|
DeviceType = x.Type,
|
||||||
UserNo = userNo,
|
UserNo = userNo,
|
||||||
CancellationId = 0,
|
|
||||||
Priority = 0,
|
Priority = 0,
|
||||||
Version = 0,
|
Version = 0,
|
||||||
TenantId = x.TenantId,
|
TenantId = x.TenantId,
|
||||||
|
|||||||
@@ -158,7 +158,6 @@ public class DeviceTimePeriodService : IDeviceTimePeriodService
|
|||||||
DeviceUniqueNo = deviceUniqueNo,
|
DeviceUniqueNo = deviceUniqueNo,
|
||||||
Status = DeviceTaskStatusEnumType.Wait,
|
Status = DeviceTaskStatusEnumType.Wait,
|
||||||
Version = 0,
|
Version = 0,
|
||||||
CancellationId = 0,
|
|
||||||
Source = source,
|
Source = source,
|
||||||
Priority = 90,
|
Priority = 90,
|
||||||
TenantId = device.TenantId
|
TenantId = device.TenantId
|
||||||
@@ -191,7 +190,6 @@ public class DeviceTimePeriodService : IDeviceTimePeriodService
|
|||||||
DeviceUniqueNo = deviceUniqueNo,
|
DeviceUniqueNo = deviceUniqueNo,
|
||||||
Status = DeviceTaskStatusEnumType.Wait,
|
Status = DeviceTaskStatusEnumType.Wait,
|
||||||
Version = 0,
|
Version = 0,
|
||||||
CancellationId = 0,
|
|
||||||
Source = source,
|
Source = source,
|
||||||
Priority = 90,
|
Priority = 90,
|
||||||
TenantId = device.TenantId
|
TenantId = device.TenantId
|
||||||
@@ -213,7 +211,7 @@ public class DeviceTimePeriodService : IDeviceTimePeriodService
|
|||||||
|
|
||||||
var devices = await _dbContext.Queryable<DeviceEntity>()
|
var devices = await _dbContext.Queryable<DeviceEntity>()
|
||||||
.Where(x => !SqlFunc.IsNullOrEmpty(x.TemplateCode))
|
.Where(x => !SqlFunc.IsNullOrEmpty(x.TemplateCode))
|
||||||
.Where(x => templateCodes.Contains(x.TemplateCode.Value) || deviceCodes.Contains(x.Code))
|
.Where(x => templateCodes.Contains(x.TemplateCode) || deviceCodes.Contains(x.Code))
|
||||||
.Where(x => x.Enable && x.EnableTimePeriod)
|
.Where(x => x.Enable && x.EnableTimePeriod)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class SapPersonComparer : IEqualityComparer<SapPersonItem>
|
|||||||
&& (x.MASSN ?? string.Empty) == (y.MASSN ?? string.Empty)
|
&& (x.MASSN ?? string.Empty) == (y.MASSN ?? string.Empty)
|
||||||
&& (x.MNTXT ?? string.Empty) == (y.MNTXT ?? string.Empty)
|
&& (x.MNTXT ?? string.Empty) == (y.MNTXT ?? string.Empty)
|
||||||
&& (x.ZXUELI ?? string.Empty).Trim() == (y.ZXUELI ?? string.Empty).Trim()
|
&& (x.ZXUELI ?? string.Empty).Trim() == (y.ZXUELI ?? string.Empty).Trim()
|
||||||
&& (x.ZZ_KLX ?? string.Empty) == (y.ZZ_KLX ?? string.Empty)
|
//&& (x.ZZ_KLX ?? string.Empty) == (y.ZZ_KLX ?? string.Empty)
|
||||||
&& (x.ZZ_GZDJDNM ?? string.Empty) == (y.ZZ_GZDJDNM ?? string.Empty)
|
&& (x.ZZ_GZDJDNM ?? string.Empty) == (y.ZZ_GZDJDNM ?? string.Empty)
|
||||||
&& (x.ZZ_GZDCQNM ?? string.Empty) == (y.ZZ_GZDCQNM ?? string.Empty)
|
&& (x.ZZ_GZDCQNM ?? string.Empty) == (y.ZZ_GZDCQNM ?? string.Empty)
|
||||||
;
|
;
|
||||||
@@ -60,7 +60,7 @@ public class SapPersonComparer : IEqualityComparer<SapPersonItem>
|
|||||||
^ obj.MASSN.SafeGetHashCode()
|
^ obj.MASSN.SafeGetHashCode()
|
||||||
^ obj.MNTXT.SafeGetHashCode()
|
^ obj.MNTXT.SafeGetHashCode()
|
||||||
^ obj.ZXUELI.SafeGetHashCode()
|
^ obj.ZXUELI.SafeGetHashCode()
|
||||||
^ obj.ZZ_KLX.SafeGetHashCode()
|
//^ obj.ZZ_KLX.SafeGetHashCode()
|
||||||
^ obj.ZZ_GZDJDNM.SafeGetHashCode()
|
^ obj.ZZ_GZDJDNM.SafeGetHashCode()
|
||||||
^ obj.ZZ_GZDCQNM.SafeGetHashCode()
|
^ obj.ZZ_GZDCQNM.SafeGetHashCode()
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -1,6 +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.AspNetCore.CustomClass;
|
||||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
@@ -44,4 +45,14 @@ public class GainfoCardsController : ControllerBase
|
|||||||
{
|
{
|
||||||
return await _gainfoCardService.GetChangeRecordsAsync(userNo);
|
return await _gainfoCardService.GetChangeRecordsAsync(userNo);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
/// <summary>
|
||||||
|
/// 编辑卡类型
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
[HttpPost("cardType")]
|
||||||
|
public async Task EditCardTypeAsync(GainfoCardEditRequest request)
|
||||||
|
{
|
||||||
|
await _gainfoCardService.EditCardTypeAsync(request.UserCodes, request.CardType);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -51,7 +51,7 @@ public class GainfoPermissionsController : ControllerBase
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="request"></param>
|
/// <param name="request"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[Authorize(Roles = "admin,tenant-admin")]
|
//[Authorize(Roles = "admin,tenant-admin")]
|
||||||
[HttpPost("reset")]
|
[HttpPost("reset")]
|
||||||
public async Task<DevicePermissionAssignResponse> ResetPermissionsAsync(GainfoPermissionResetRequest request)
|
public async Task<DevicePermissionAssignResponse> ResetPermissionsAsync(GainfoPermissionResetRequest request)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Organization.Request;
|
||||||
|
|
||||||
|
public class GainfoCardEditRequest
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 工号
|
||||||
|
/// </summary>
|
||||||
|
[MinLength(1, ErrorMessage = "工号不能为空")]
|
||||||
|
public List<string> UserCodes { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 卡类型
|
||||||
|
/// </summary>
|
||||||
|
[Range(1, 100, ErrorMessage = "卡类型有误")]
|
||||||
|
public int CardType { get; set; }
|
||||||
|
}
|
||||||
@@ -45,7 +45,7 @@ public class GainfoDetailResponse
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 身份证号
|
/// 身份证号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonConverter(typeof(ObfuscateProviderJsonConverter), 6)]
|
[JsonConverter(typeof(ObfuscateProviderJsonConverter), 0)]
|
||||||
public string IdNo { get; set; }
|
public string IdNo { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -67,17 +67,20 @@ public class GainfoDetailResponse
|
|||||||
/// 身份证地址
|
/// 身份证地址
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Address { get; set; }
|
public string Address { get; set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public DateTime OriginalBirthday { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 出生日期
|
/// 出生日期
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonConverter(typeof(ToDateJsonConverter))]
|
[JsonConverter(typeof(ObfuscateProviderJsonConverter), 0)]
|
||||||
public DateTime Birthday { get; set; }
|
public string Birthday => OriginalBirthday.ToString("yyyy-MM-dd");
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 手机号码
|
/// 手机号码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonConverter(typeof(ObfuscateProviderJsonConverter), 4)]
|
[JsonConverter(typeof(ObfuscateProviderJsonConverter), 0)]
|
||||||
public string Phone { get; set; }
|
public string Phone { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -18,4 +18,12 @@ public interface IGainfoCardService : IScopeDependency
|
|||||||
/// <param name="userNo"></param>
|
/// <param name="userNo"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<List<ChangeCardResponse>> GetChangeRecordsAsync(string userNo);
|
Task<List<ChangeCardResponse>> GetChangeRecordsAsync(string userNo);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 编辑卡类型
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userCodes"></param>
|
||||||
|
/// <param name="typeId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task EditCardTypeAsync(List<string> userCodes, int typeId);
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
using Dlhis.Basic.Organization.Request;
|
using Dlhis.Basic.Device.Services;
|
||||||
|
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 Dlhis.Entity.Device.Enums;
|
||||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Mapster;
|
using Mapster;
|
||||||
@@ -11,11 +13,18 @@ public class GainfoCardService : IGainfoCardService
|
|||||||
{
|
{
|
||||||
private readonly IDbContext _dbContext;
|
private readonly IDbContext _dbContext;
|
||||||
private readonly IGainfoStore _gainfoStore;
|
private readonly IGainfoStore _gainfoStore;
|
||||||
|
private readonly IDevicePermissionAnalyzeService _devicePermissionAnalyzeService;
|
||||||
|
private readonly IGainfoPermissionService _gainfoPermissionService;
|
||||||
|
|
||||||
public GainfoCardService(IDbContext dbContext, IGainfoStore gainfoStore)
|
public GainfoCardService(IDbContext dbContext,
|
||||||
|
IGainfoStore gainfoStore,
|
||||||
|
IDevicePermissionAnalyzeService devicePermissionAnalyzeService,
|
||||||
|
IGainfoPermissionService gainfoPermissionService)
|
||||||
{
|
{
|
||||||
_dbContext = dbContext;
|
_dbContext = dbContext;
|
||||||
_gainfoStore = gainfoStore;
|
_gainfoStore = gainfoStore;
|
||||||
|
_devicePermissionAnalyzeService = devicePermissionAnalyzeService;
|
||||||
|
_gainfoPermissionService = gainfoPermissionService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task ChangeCardAsync(GainfoChangeCardRequest request)
|
public async Task ChangeCardAsync(GainfoChangeCardRequest request)
|
||||||
@@ -46,4 +55,29 @@ public class GainfoCardService : IGainfoCardService
|
|||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public async Task EditCardTypeAsync(List<string> userCodes, int typeId)
|
||||||
|
{
|
||||||
|
var gainfos = await _dbContext.Queryable<GainfoEntity>().Where(x => userCodes.Contains(x.Code)).ToListAsync();
|
||||||
|
(gainfos.Count == userCodes.Count).ThrowIfFalse("人员不存在");
|
||||||
|
|
||||||
|
var result = await _devicePermissionAnalyzeService.GetUserAssignDeviceCodesWithTypeInTenantAsync(gainfos.Select(x => x.No).ToList());
|
||||||
|
foreach (var gainfo in gainfos)
|
||||||
|
{
|
||||||
|
var userNo = gainfo.No;
|
||||||
|
var myDeviceCodes = result[userNo].SelectMany(x => x.AssignTypes.SelectMany(p => p.Codes)).Distinct().ToList();
|
||||||
|
|
||||||
|
var deviceCodes = await _dbContext.Queryable<DeviceEntity>()
|
||||||
|
.Where(x => myDeviceCodes.Contains(x.Code))
|
||||||
|
.Where(x => x.EnableTimePeriod)
|
||||||
|
.Select(x => x.Code)
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
await _gainfoPermissionService.ResetPermissionsAsync(userNo, DeviceTaskEnumType.Update, deviceCodes, "卡类型编辑下发");
|
||||||
|
gainfo.CardType = typeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
await _dbContext.UpdateAsync(gainfos);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -189,7 +189,6 @@ public class GainfoGroupService : IGainfoGroupService
|
|||||||
Status = DeviceTaskStatusEnumType.Wait,
|
Status = DeviceTaskStatusEnumType.Wait,
|
||||||
Version = 0,
|
Version = 0,
|
||||||
ResultMessage = null,
|
ResultMessage = null,
|
||||||
CancellationId = 0,
|
|
||||||
Source = "手动操作人员分组关系",
|
Source = "手动操作人员分组关系",
|
||||||
Priority = 0,
|
Priority = 0,
|
||||||
TenantId = device.TenantId
|
TenantId = device.TenantId
|
||||||
@@ -209,7 +208,6 @@ public class GainfoGroupService : IGainfoGroupService
|
|||||||
Status = DeviceTaskStatusEnumType.Wait,
|
Status = DeviceTaskStatusEnumType.Wait,
|
||||||
Version = 0,
|
Version = 0,
|
||||||
ResultMessage = null,
|
ResultMessage = null,
|
||||||
CancellationId = 0,
|
|
||||||
Source = "手动操作人员分组关系",
|
Source = "手动操作人员分组关系",
|
||||||
Priority = 0,
|
Priority = 0,
|
||||||
TenantId = device.TenantId
|
TenantId = device.TenantId
|
||||||
|
|||||||
@@ -170,6 +170,27 @@ 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("生成虚拟工号失败");
|
||||||
|
|
||||||
|
// var value = await _dbContext.Queryable<BasicTypeEntity>().Where(x => x.Type == "gainfoExternalMaxNum").Select(x => x.Code).SingleAsync();
|
||||||
|
// if (value.IsEmpty())
|
||||||
|
// {
|
||||||
|
// code = 1;
|
||||||
|
// await _dbContext.InsertAsync(new BasicTypeEntity
|
||||||
|
// {
|
||||||
|
// Type = "gainfoExternalMaxNum",
|
||||||
|
// Code = "1",
|
||||||
|
// Display = "外部人员序号",
|
||||||
|
// DisplayEn = "外部人员序号",
|
||||||
|
// Sequence = 1
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// code = int.Parse(value) + 1;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// return "EXT" + code.ToString().PadLeft(6, '0');
|
||||||
|
|
||||||
|
|
||||||
int code;
|
int code;
|
||||||
var entity = await _dbContext.Queryable<OutsourceEntity>().Where(x => x.Code.StartsWith("LS")).OrderBy(x => x.Id, OrderByType.Desc).FirstAsync();
|
var entity = await _dbContext.Queryable<OutsourceEntity>().Where(x => x.Code.StartsWith("LS")).OrderBy(x => x.Id, OrderByType.Desc).FirstAsync();
|
||||||
if (entity == null)
|
if (entity == null)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Dlhis.Basic.Device.Services;
|
using Dlhis.Basic.Appointment.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.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
@@ -8,6 +9,7 @@ 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 Dlhis.Entity.Visitor.Entity;
|
using Dlhis.Entity.Visitor.Entity;
|
||||||
|
using Dlhis.Entity.Visitor.Enums;
|
||||||
using Dlhis.Sys.Api;
|
using Dlhis.Sys.Api;
|
||||||
using Kurisu.AspNetCore.Authentication.Abstractions;
|
using Kurisu.AspNetCore.Authentication.Abstractions;
|
||||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||||
@@ -29,6 +31,7 @@ public class GainfoService : IGainfoService
|
|||||||
private readonly IJinkoSapService _jinkoSapService;
|
private readonly IJinkoSapService _jinkoSapService;
|
||||||
private readonly IDevicePermissionService _devicePermissionService;
|
private readonly IDevicePermissionService _devicePermissionService;
|
||||||
private readonly IGainfoPermissionService _gainfoPermissionService;
|
private readonly IGainfoPermissionService _gainfoPermissionService;
|
||||||
|
private readonly IAppointmentService _appointmentService;
|
||||||
private readonly ILogger<GainfoService> _logger;
|
private readonly ILogger<GainfoService> _logger;
|
||||||
|
|
||||||
public GainfoService(IGainfoStore gainfoStore,
|
public GainfoService(IGainfoStore gainfoStore,
|
||||||
@@ -39,6 +42,7 @@ public class GainfoService : IGainfoService
|
|||||||
IJinkoSapService jinkoSapService,
|
IJinkoSapService jinkoSapService,
|
||||||
IDevicePermissionService devicePermissionService,
|
IDevicePermissionService devicePermissionService,
|
||||||
IGainfoPermissionService gainfoPermissionService,
|
IGainfoPermissionService gainfoPermissionService,
|
||||||
|
IAppointmentService appointmentService,
|
||||||
ILogger<GainfoService> logger)
|
ILogger<GainfoService> logger)
|
||||||
{
|
{
|
||||||
_gainfoStore = gainfoStore;
|
_gainfoStore = gainfoStore;
|
||||||
@@ -49,6 +53,7 @@ public class GainfoService : IGainfoService
|
|||||||
_jinkoSapService = jinkoSapService;
|
_jinkoSapService = jinkoSapService;
|
||||||
_devicePermissionService = devicePermissionService;
|
_devicePermissionService = devicePermissionService;
|
||||||
_gainfoPermissionService = gainfoPermissionService;
|
_gainfoPermissionService = gainfoPermissionService;
|
||||||
|
_appointmentService = appointmentService;
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,16 +253,26 @@ public class GainfoService : IGainfoService
|
|||||||
var gainfo = await _dbContext.Queryable<GainfoEntity>().SingleAsync(x => x.Id == request.Id);
|
var gainfo = await _dbContext.Queryable<GainfoEntity>().SingleAsync(x => x.Id == request.Id);
|
||||||
gainfo.ThrowIfNull("档案数据不存在");
|
gainfo.ThrowIfNull("档案数据不存在");
|
||||||
|
|
||||||
if (request.IsOutsource)
|
if (gainfo.Type == GainfoUserTypeEnumType.External)
|
||||||
{
|
{
|
||||||
var outsource = await _dbContext.Queryable<OutsourceEntity>().SingleAsync(x => x.Code == gainfo.Code);
|
var visitorAppointmentDetails = await _dbContext.Queryable<VisitorAppointmentDetailEntity>()
|
||||||
(outsource == null).ThrowIfTrue("非外包人员不可手动离职");
|
.Where(x => x.UserNo == gainfo.No)
|
||||||
|
.Where(x => x.DoorStatus == VisitorAppointmentDetailStatusEnumType.Wait || x.WorkplaceStatus == VisitorAppointmentDetailStatusEnumType.Wait)
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
foreach (var visitorAppointment in visitorAppointmentDetails)
|
||||||
|
{
|
||||||
|
await _appointmentService.FocusLeaveAsync(visitorAppointment.Id, request.Reason);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
await _gainfoPermissionService.ResetPermissionsAsync(gainfo.No, DeviceTaskEnumType.Delete, null, request.Reason);
|
||||||
|
|
||||||
await _gainfoPermissionService.ResetPermissionsAsync(gainfo.No, DeviceTaskEnumType.Delete, null, request.Reason);
|
await _dbContext.Deleteable<GainfoGroupRelationshipEntity>().Where(x => x.UserNo == gainfo.No).ExecuteCommandAsync();
|
||||||
|
await _dbContext.Deleteable<DevicePermissionEntity>().Where(x => x.AssignType == AssignTypeEnumType.User && x.AssignValue == gainfo.No).ExecuteCommandAsync();
|
||||||
await _dbContext.Deleteable<GainfoGroupRelationshipEntity>().Where(x => x.UserNo == gainfo.No).ExecuteCommandAsync();
|
}
|
||||||
await _dbContext.Deleteable<DevicePermissionEntity>().Where(x => x.AssignType == AssignTypeEnumType.User && x.AssignValue == gainfo.No).ExecuteCommandAsync();
|
|
||||||
|
|
||||||
//先写入离职表
|
//先写入离职表
|
||||||
gainfo.IdentityUserId = (int)gainfo.Id; //记录原始id
|
gainfo.IdentityUserId = (int)gainfo.Id; //记录原始id
|
||||||
@@ -305,7 +320,6 @@ public class GainfoService : IGainfoService
|
|||||||
Status = DeviceTaskStatusEnumType.Wait,
|
Status = DeviceTaskStatusEnumType.Wait,
|
||||||
Version = 0,
|
Version = 0,
|
||||||
ResultMessage = null,
|
ResultMessage = null,
|
||||||
CancellationId = 0,
|
|
||||||
Source = "安全级别提高",
|
Source = "安全级别提高",
|
||||||
Priority = 60,
|
Priority = 60,
|
||||||
TenantId = x.TenantId
|
TenantId = x.TenantId
|
||||||
@@ -363,7 +377,7 @@ public class GainfoService : IGainfoService
|
|||||||
IdNo = ga.IdNo,
|
IdNo = ga.IdNo,
|
||||||
Gender = ga.Gender,
|
Gender = ga.Gender,
|
||||||
Address = ga.Address,
|
Address = ga.Address,
|
||||||
Birthday = ga.Birthday,
|
OriginalBirthday = ga.Birthday,
|
||||||
Phone = ga.Phone,
|
Phone = ga.Phone,
|
||||||
Grade = ga.Grade,
|
Grade = ga.Grade,
|
||||||
Title = ga.Title,
|
Title = ga.Title,
|
||||||
|
|||||||
@@ -182,7 +182,6 @@ public class GainfoUpdateService : IGainfoUpdateService
|
|||||||
{
|
{
|
||||||
await _dbContext.InsertAsync(info);
|
await _dbContext.InsertAsync(info);
|
||||||
await _identityUserSyncService.SyncAccountAsync(info.Code, info.Name, info.IdNo, info.Factory);
|
await _identityUserSyncService.SyncAccountAsync(info.Code, info.Name, info.IdNo, info.Factory);
|
||||||
await _gainfoPermissionService.ResetPermissionsAsync(info.No, DeviceTaskEnumType.Add, null, "入职生成");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -222,7 +221,6 @@ public class GainfoUpdateService : IGainfoUpdateService
|
|||||||
CostId = item.KOSTL,
|
CostId = item.KOSTL,
|
||||||
EntryDate = item.createdate,
|
EntryDate = item.createdate,
|
||||||
ResignationDate = item.ZLZRQ,
|
ResignationDate = item.ZLZRQ,
|
||||||
CardType = SafeParseCardType(item.ZZ_KLX),
|
|
||||||
Workplace = _tenants.LastOrDefault(x => x.Name == item.ZZ_GZDJDNM)?.Code ?? item.ZZ_GZDJDNM,
|
Workplace = _tenants.LastOrDefault(x => x.Name == item.ZZ_GZDJDNM)?.Code ?? item.ZZ_GZDJDNM,
|
||||||
Factory = _tenants.FirstOrDefault(x => x.Name == item.ZZ_GZDCQNM)?.Code ?? item.ZZ_GZDCQNM,
|
Factory = _tenants.FirstOrDefault(x => x.Name == item.ZZ_GZDCQNM)?.Code ?? item.ZZ_GZDCQNM,
|
||||||
};
|
};
|
||||||
@@ -252,7 +250,6 @@ public class GainfoUpdateService : IGainfoUpdateService
|
|||||||
ZSTATUS = item.ZSTATUS,
|
ZSTATUS = item.ZSTATUS,
|
||||||
ZLZRQ = item.ZLZRQ,
|
ZLZRQ = item.ZLZRQ,
|
||||||
STELL_NM = item.STELL_NM,
|
STELL_NM = item.STELL_NM,
|
||||||
ZZ_KLX = item.ZZ_KLX,
|
|
||||||
createdate = item.createdate,
|
createdate = item.createdate,
|
||||||
ZZ_GZDJDNM = item.ZZ_GZDJDNM,
|
ZZ_GZDJDNM = item.ZZ_GZDJDNM,
|
||||||
ZZ_GZDCQNM = item.ZZ_GZDCQNM,
|
ZZ_GZDCQNM = item.ZZ_GZDCQNM,
|
||||||
@@ -285,7 +282,6 @@ public class GainfoUpdateService : IGainfoUpdateService
|
|||||||
ResignationDate = item.ZLZRQ,
|
ResignationDate = item.ZLZRQ,
|
||||||
Workplace = workplace,
|
Workplace = workplace,
|
||||||
Factory = factory,
|
Factory = factory,
|
||||||
CardType = SafeParseCardType(item.ZZ_KLX)
|
|
||||||
}).Where(x => x.Code == item.ename).ExecuteCommandAsync();
|
}).Where(x => x.Code == item.ename).ExecuteCommandAsync();
|
||||||
|
|
||||||
await _identityUserSyncService.SyncAccountAsync(gainfo.Code, gainfo.Name, gainfo.IdNo, factory);
|
await _identityUserSyncService.SyncAccountAsync(gainfo.Code, gainfo.Name, gainfo.IdNo, factory);
|
||||||
@@ -356,7 +352,6 @@ public class GainfoUpdateService : IGainfoUpdateService
|
|||||||
ResignationDate = item.ZLZRQ,
|
ResignationDate = item.ZLZRQ,
|
||||||
Workplace = workplace,
|
Workplace = workplace,
|
||||||
Factory = factory,
|
Factory = factory,
|
||||||
CardType = SafeParseCardType(item.ZZ_KLX)
|
|
||||||
}).Where(x => x.Code == item.ename).ExecuteCommandAsync();
|
}).Where(x => x.Code == item.ename).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -386,7 +381,6 @@ public class GainfoUpdateService : IGainfoUpdateService
|
|||||||
ZWORKCODE = x.ename,
|
ZWORKCODE = x.ename,
|
||||||
ZZ_SFZH = x.idno,
|
ZZ_SFZH = x.idno,
|
||||||
GBDAT = x.birthday,
|
GBDAT = x.birthday,
|
||||||
ZZ_KLX = x.ZZ_KLX,
|
|
||||||
ZXUELI = x.email,
|
ZXUELI = x.email,
|
||||||
ORGEH = x.appellation,
|
ORGEH = x.appellation,
|
||||||
ZMOBILE = x.phone,
|
ZMOBILE = x.phone,
|
||||||
@@ -433,7 +427,6 @@ public class GainfoUpdateService : IGainfoUpdateService
|
|||||||
ename = person.ZWORKCODE,
|
ename = person.ZWORKCODE,
|
||||||
idno = person.ZZ_SFZH,
|
idno = person.ZZ_SFZH,
|
||||||
birthday = person.GBDAT,
|
birthday = person.GBDAT,
|
||||||
ZZ_KLX = person.ZZ_KLX,
|
|
||||||
email = person.ZXUELI,
|
email = person.ZXUELI,
|
||||||
appellation = person.ORGEH,
|
appellation = person.ORGEH,
|
||||||
phone = person.ZMOBILE,
|
phone = person.ZMOBILE,
|
||||||
@@ -478,14 +471,4 @@ public class GainfoUpdateService : IGainfoUpdateService
|
|||||||
idNo = idNo.TrimStart();
|
idNo = idNo.TrimStart();
|
||||||
return idNo[..6];
|
return idNo[..6];
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int? SafeParseCardType(string ZZ_KLX)
|
|
||||||
{
|
|
||||||
if (int.TryParse(ZZ_KLX, out var cardType))
|
|
||||||
{
|
|
||||||
return cardType;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
"Timeout": 30,
|
"Timeout": 30,
|
||||||
"SlowSqlTime": 1,
|
"SlowSqlTime": 1,
|
||||||
"EnableSqlLog": true,
|
"EnableSqlLog": true,
|
||||||
"Generate": false
|
"Generate": true
|
||||||
},
|
},
|
||||||
"SwaggerOptions": {
|
"SwaggerOptions": {
|
||||||
"Enable": true,
|
"Enable": true,
|
||||||
|
|||||||
@@ -15,16 +15,15 @@ public class BusinessPlaceManagerRelationshipEntity : SugarBaseEntity , ITenantI
|
|||||||
/// 管理人员
|
/// 管理人员
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[AdaptIgnore(MemberSide.Destination)]
|
[AdaptIgnore(MemberSide.Destination)]
|
||||||
[SugarColumn(ColumnDescription = "管理人员", IsNullable = false)]
|
[SugarColumn(IsNullable = false, ColumnDescription = "管理人员")]
|
||||||
public int ManagerUserId { get; set; }
|
public int ManagerUserId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 营业点
|
/// 营业点
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "营业点", IsNullable = false)]
|
[SugarColumn(IsNullable = false, ColumnDescription = "营业点")]
|
||||||
public Guid BusinessPlaceCode { get; set; }
|
public Guid BusinessPlaceCode { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public string TenantId { get; set; }
|
public string TenantId { get; set; }
|
||||||
}
|
}
|
||||||
@@ -12,19 +12,19 @@ namespace Dlhis.Entity.Basic.Entity
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 部门号
|
/// 部门号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "部门号", IsNullable = false, UniqueGroupNameList = new[] { "idx_Department_No" })]
|
[SugarColumn(IsNullable = false, ColumnDescription = "部门号", UniqueGroupNameList = new[] { "idx_Department_No" })]
|
||||||
public string No { get; set; }
|
public string No { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 上级部门号
|
/// 上级部门号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "上级部门号")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "上级部门号")]
|
||||||
public string PNo { get; set; }
|
public string PNo { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 部门名称
|
/// 部门名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "部门名称", IsNullable = false)]
|
[SugarColumn(IsNullable = false, ColumnDescription = "部门名称")]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,102 +6,101 @@ using Mapster;
|
|||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using SqlSugar.DbConvert;
|
using SqlSugar.DbConvert;
|
||||||
|
|
||||||
namespace Dlhis.Entity.Basic.Entity
|
namespace Dlhis.Entity.Basic.Entity;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设备
|
||||||
|
/// </summary>
|
||||||
|
[SugarTable(TableName = "Device", TableDescription = "设备表")]
|
||||||
|
public class DeviceEntity : SugarBaseEntity, ITenantId
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备
|
/// 设备code
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable(TableName = "Device", TableDescription = "设备表")]
|
[DeviceCode]
|
||||||
public class DeviceEntity : SugarBaseEntity, ITenantId
|
[SugarColumn(IsNullable = false, ColumnDescription = "设备code")]
|
||||||
{
|
public Guid Code { get; set; }
|
||||||
/// <summary>
|
|
||||||
/// 设备code
|
|
||||||
/// </summary>
|
|
||||||
[DeviceCode]
|
|
||||||
[SugarColumn(ColumnDescription = "设备code")]
|
|
||||||
public Guid Code { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备唯一码,IP/MAC/SNO
|
/// 设备唯一码,IP/MAC/SNO
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[AdaptIgnore(MemberSide.Destination)]
|
[AdaptIgnore(MemberSide.Destination)]
|
||||||
[SugarColumn(ColumnDescription = "设备唯一码", IsNullable = false, UniqueGroupNameList = new[] { "Idx_Device_UniqueNo" })]
|
[SugarColumn(IsNullable = false, ColumnDescription = "设备唯一码", UniqueGroupNameList = new[] { "Idx_Device_UniqueNo" })]
|
||||||
public string UniqueNo { get; set; }
|
public string UniqueNo { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 心跳间隔
|
/// 心跳间隔
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "心跳检查间隔")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "心跳检查间隔")]
|
||||||
public int HeartbeatInterval { get; set; }
|
public int HeartbeatInterval { get; set; } = 30;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 供应商
|
/// 供应商
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "供应商")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "供应商")]
|
||||||
public string Supplier { get; set; }
|
public string Supplier { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备功能
|
/// 设备功能
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDataType = "varchar(150)", IsJson = true, ColumnDescription = "设备功能", DefaultValue = "[]")]
|
[SugarColumn(IsNullable = false, ColumnDataType = "varchar(150)", IsJson = true, ColumnDescription = "设备功能", DefaultValue = "[]")]
|
||||||
public List<DeviceFuncEnumType> Funcs { get; set; }
|
public List<DeviceFuncEnumType> Funcs { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备类型
|
/// 设备类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "设备类型", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))]
|
[SugarColumn(IsNullable = false, ColumnDescription = "设备类型", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))]
|
||||||
public DeviceTypeEnumType Type { get; set; }
|
public DeviceTypeEnumType Type { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 部署点
|
/// 部署点
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "部署点")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "部署点")]
|
||||||
public string DeployPlace { get; set; }
|
public string DeployPlace { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 部署坐标
|
/// 部署坐标
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "部署坐标")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "部署坐标")]
|
||||||
public string DeployPosition { get; set; }
|
public string DeployPosition { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 部署方向
|
/// 部署方向
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "部署方向", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))]
|
[SugarColumn(IsNullable = true, ColumnDescription = "部署方向", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))]
|
||||||
public DeviceDeployDirectionEnumType? DeployDirection { get; set; }
|
public DeviceDeployDirectionEnumType? DeployDirection { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 模板code
|
/// 模板code
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "模板code")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "模板code")]
|
||||||
public Guid? TemplateCode { get; set; }
|
public Guid TemplateCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 连接信息
|
/// 连接信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "连接信息")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "连接信息")]
|
||||||
public string ConnectionInfo { get; set; }
|
public string ConnectionInfo { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否启用
|
/// 是否启用
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDataType = "bit", ColumnDescription = "是否启用")]
|
[SugarColumn(IsNullable = false, ColumnDataType = "bit", ColumnDescription = "是否启用")]
|
||||||
public bool Enable { get; set; }
|
public bool Enable { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否作为考勤设备
|
/// 是否作为考勤设备
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDataType = "bit", ColumnDescription = "是否作为考勤设备")]
|
[SugarColumn(IsNullable = false, ColumnDataType = "bit", ColumnDescription = "是否作为考勤设备")]
|
||||||
public bool AsAttendance { get; set; }
|
public bool AsAttendance { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否启用时段码
|
/// 是否启用时段码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDataType = "bit", ColumnDescription = "是否启用时段码", DefaultValue = "0")]
|
[SugarColumn(IsNullable = false, ColumnDataType = "bit", ColumnDescription = "是否启用时段码", DefaultValue = "0")]
|
||||||
public bool EnableTimePeriod { get; set; } = false;
|
public bool EnableTimePeriod { get; set; } = false;
|
||||||
|
|
||||||
public string TenantId { get; set; }
|
public string TenantId { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -29,146 +29,146 @@ public class GainfoEntity : SugarBaseEntity
|
|||||||
/// 人员类型
|
/// 人员类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[AdaptIgnore(MemberSide.Destination)]
|
[AdaptIgnore(MemberSide.Destination)]
|
||||||
[SugarColumn(ColumnDescription = "人员类型", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))]
|
[SugarColumn(IsNullable = false, ColumnDescription = "人员类型", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))]
|
||||||
public GainfoUserTypeEnumType Type { get; set; }
|
public GainfoUserTypeEnumType Type { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 人员来源
|
/// 人员来源
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "人员来源", IsNullable = true)]
|
[SugarColumn(IsNullable = true, ColumnDescription = "人员来源")]
|
||||||
public string Source { get; set; }
|
public string Source { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 姓名
|
/// 姓名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "姓名")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "姓名")]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 学工号
|
/// 学工号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "学工号", UniqueGroupNameList = new[] { "idx_Gainfo_Code" })]
|
[SugarColumn(IsNullable = false, ColumnDescription = "学工号", UniqueGroupNameList = new[] { "idx_Gainfo_Code" })]
|
||||||
public string Code { get; set; }
|
public string Code { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 国家代码
|
/// 国家代码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "国家代码")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "国家代码")]
|
||||||
public string CountryNo { get; set; }
|
public string CountryNo { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 证件类型代码
|
/// 证件类型代码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "证件类型代码")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "证件类型代码")]
|
||||||
public string IdClass { get; set; }
|
public string IdClass { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 身份证号
|
/// 身份证号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "身份证号", UniqueGroupNameList = new[] { "idx_Gainfo_IdNo" })]
|
[SugarColumn(IsNullable = true, ColumnDescription = "身份证号", UniqueGroupNameList = new[] { "idx_Gainfo_IdNo" })]
|
||||||
public string IdNo { get; set; }
|
public string IdNo { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 身份证籍贯区域代码
|
/// 身份证籍贯区域代码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "身份证籍贯区域代码")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "身份证籍贯区域代码")]
|
||||||
public string Native { get; set; }
|
public string Native { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 性别
|
/// 性别
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "性别", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))]
|
[SugarColumn(IsNullable = false, ColumnDescription = "性别", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))]
|
||||||
public GenderEnumType Gender { get; set; }
|
public GenderEnumType Gender { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 生日
|
/// 生日
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "生日")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "生日")]
|
||||||
public DateTime Birthday { get; set; }
|
public DateTime Birthday { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 身份证地址
|
/// 身份证地址
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "身份证地址")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "身份证地址")]
|
||||||
public string Address { get; set; }
|
public string Address { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 部门编码
|
/// 部门编码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "部门编码")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "部门编码")]
|
||||||
public string DepartmentNo { get; set; }
|
public string DepartmentNo { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 民族代码
|
/// 民族代码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "民族代码")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "民族代码")]
|
||||||
public string Nation { get; set; }
|
public string Nation { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 手机号码
|
/// 手机号码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "手机号码")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "手机号码")]
|
||||||
public string Phone { get; set; }
|
public string Phone { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 学历
|
/// 学历
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "学历")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "学历")]
|
||||||
public string Degree { get; set; }
|
public string Degree { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 岗位
|
/// 岗位
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "岗位")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "岗位")]
|
||||||
public string PositionNo { get; set; }
|
public string PositionNo { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 职等
|
/// 职等
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "职等")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "职等")]
|
||||||
public string Grade { get; set; }
|
public string Grade { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 职级
|
/// 职级
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "职级")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "职级")]
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 卡号
|
/// 卡号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "卡号", IndexGroupNameList = new[] { "idx_Gainfo_CardNo" })]
|
[SugarColumn(IsNullable = true, ColumnDescription = "卡号", IndexGroupNameList = new[] { "idx_Gainfo_CardNo" })]
|
||||||
public string CardNo { get; set; }
|
public string CardNo { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 备注
|
/// 备注
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "备注")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "备注")]
|
||||||
public string Remark { get; set; }
|
public string Remark { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 人事范围
|
/// 人事范围
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "人事范围")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "人事范围")]
|
||||||
public string Werks { get; set; }
|
public string Werks { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 工作地
|
/// 工作地
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "工作地")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "工作地")]
|
||||||
public string Workplace { get; set; }
|
public string Workplace { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 厂区
|
/// 厂区
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[TenantId]
|
[TenantId]
|
||||||
[SugarColumn(ColumnDescription = "厂区")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "厂区")]
|
||||||
public string Factory { get; set; }
|
public string Factory { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 成本中心
|
/// 成本中心
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "成本中心")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "成本中心")]
|
||||||
public string CostId { get; set; }
|
public string CostId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -186,13 +186,13 @@ public class GainfoEntity : SugarBaseEntity
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 身份认证用户Id(如果为空匹配code)
|
/// 身份认证用户Id(如果为空匹配code)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "身份认证用户Id", IsNullable = true)]
|
[SugarColumn(IsNullable = true, ColumnDescription = "身份认证用户Id")]
|
||||||
public int IdentityUserId { get; set; }
|
public int IdentityUserId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 卡类型
|
/// 卡类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "卡类型", IsNullable = true)]
|
[SugarColumn(IsNullable = true, ColumnDescription = "卡类型")]
|
||||||
public int? CardType { get; set; }
|
public int? CardType { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,50 +2,50 @@
|
|||||||
using Kurisu.AspNetCore.DataAccess.SqlSugar;
|
using Kurisu.AspNetCore.DataAccess.SqlSugar;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Dlhis.Entity.Basic.Entity
|
namespace Dlhis.Entity.Basic.Entity;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 档案组
|
||||||
|
/// </summary>
|
||||||
|
[SugarTable(TableName = "GainfoGroup", TableDescription = "档案组")]
|
||||||
|
public class GainfoGroupEntity : SugarBaseEntity, ITenantId
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 档案组
|
/// 父级Code
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable(TableName = "GainfoGroup", TableDescription = "档案组")]
|
[SugarColumn(IsNullable = true)]
|
||||||
public class GainfoGroupEntity : SugarBaseEntity, ITenantId
|
public Guid? PCode { get; set; }
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 父级Code
|
|
||||||
/// </summary>
|
|
||||||
public Guid? PCode { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 分组code
|
/// 分组code
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "分组code")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "分组code")]
|
||||||
public Guid Code { get; set; }
|
public Guid Code { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 名称
|
/// 名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "名称")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "名称")]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 备注
|
/// 备注
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "备注")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "备注")]
|
||||||
public string Remark { get; set; }
|
public string Remark { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否默认分组
|
/// 是否默认分组
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "是否默认分组", ColumnDataType = "bit", DefaultValue = "1")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "是否默认分组", ColumnDataType = "bit", DefaultValue = "1")]
|
||||||
public bool IsDefault { get; set; } = true;
|
public bool IsDefault { get; set; } = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否可编辑
|
/// 是否可编辑
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "是否可编辑", ColumnDataType = "bit", DefaultValue = "1")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "是否可编辑", ColumnDataType = "bit", DefaultValue = "1")]
|
||||||
public bool Editable { get; set; } = true;
|
public bool Editable { get; set; } = true;
|
||||||
|
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
public string TenantId { get; set; }
|
public string TenantId { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
using SqlSugar;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Dlhis.Entity.Basic.Entity
|
namespace Dlhis.Entity.Basic.Entity
|
||||||
{
|
{
|
||||||
|
[SkipScan]
|
||||||
[SugarTable(TableName = "GainfoSap")]
|
[SugarTable(TableName = "GainfoSap")]
|
||||||
public class GainfoSapEntity
|
public class GainfoSapEntity
|
||||||
{
|
{
|
||||||
@@ -11,6 +13,7 @@ namespace Dlhis.Entity.Basic.Entity
|
|||||||
public string @class { get; set; }
|
public string @class { get; set; }
|
||||||
|
|
||||||
public string passwd { get; set; }
|
public string passwd { get; set; }
|
||||||
|
|
||||||
public string question { get; set; }
|
public string question { get; set; }
|
||||||
|
|
||||||
public string answer { get; set; }
|
public string answer { get; set; }
|
||||||
@@ -25,6 +28,7 @@ namespace Dlhis.Entity.Basic.Entity
|
|||||||
public string sex { get; set; }
|
public string sex { get; set; }
|
||||||
public DateTime birthday { get; set; }
|
public DateTime birthday { get; set; }
|
||||||
public string address { get; set; }
|
public string address { get; set; }
|
||||||
|
|
||||||
public string postcode { get; set; }
|
public string postcode { get; set; }
|
||||||
public string occupation { get; set; }
|
public string occupation { get; set; }
|
||||||
public string appellation { get; set; }
|
public string appellation { get; set; }
|
||||||
@@ -33,16 +37,24 @@ namespace Dlhis.Entity.Basic.Entity
|
|||||||
public string fax { get; set; }
|
public string fax { get; set; }
|
||||||
public string mobile { get; set; }
|
public string mobile { get; set; }
|
||||||
public string email { get; set; }
|
public string email { get; set; }
|
||||||
|
|
||||||
public string web { get; set; }
|
public string web { get; set; }
|
||||||
|
|
||||||
public string vip { get; set; }
|
public string vip { get; set; }
|
||||||
|
|
||||||
public string sec { get; set; }
|
public string sec { get; set; }
|
||||||
|
|
||||||
public string cropsno { get; set; }
|
public string cropsno { get; set; }
|
||||||
|
|
||||||
public string cropname { get; set; }
|
public string cropname { get; set; }
|
||||||
|
|
||||||
public string fancy { get; set; }
|
public string fancy { get; set; }
|
||||||
public string remark { get; set; }
|
public string remark { get; set; }
|
||||||
|
|
||||||
public int amount { get; set; }
|
public int amount { get; set; }
|
||||||
|
|
||||||
public int days { get; set; }
|
public int days { get; set; }
|
||||||
|
|
||||||
public decimal consume01 { get; set; }
|
public decimal consume01 { get; set; }
|
||||||
|
|
||||||
public decimal consume02 { get; set; }
|
public decimal consume02 { get; set; }
|
||||||
@@ -90,12 +102,18 @@ namespace Dlhis.Entity.Basic.Entity
|
|||||||
public string MASSN { get; set; }
|
public string MASSN { get; set; }
|
||||||
|
|
||||||
public string MNTXT { get; set; }
|
public string MNTXT { get; set; }
|
||||||
|
|
||||||
public string MASSG { get; set; }
|
public string MASSG { get; set; }
|
||||||
|
|
||||||
public string MGTXT { get; set; }
|
public string MGTXT { get; set; }
|
||||||
public DateTime? logdate { get; set; }
|
public DateTime? logdate { get; set; }
|
||||||
|
|
||||||
public DateTime? updatelogdate { get; set; }
|
public DateTime? updatelogdate { get; set; }
|
||||||
|
|
||||||
public string guestno { get; set; }
|
public string guestno { get; set; }
|
||||||
public string ZZ_KLX { get; set; }
|
|
||||||
|
// public string ZZ_KLX { get; set; }不再同步
|
||||||
|
|
||||||
public DateTime? DAT01 { get; set; }
|
public DateTime? DAT01 { get; set; }
|
||||||
|
|
||||||
public string ZZ_COUNNM { get; set; }
|
public string ZZ_COUNNM { get; set; }
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public class WerkEntity : SugarBaseEntity
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 名称
|
/// 名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsNullable = false, ColumnDescription = "名称")]
|
[SugarColumn(ColumnDescription = "名称")]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -53,12 +53,12 @@ public class WerkEntity : SugarBaseEntity
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 结果
|
/// 结果
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsNullable = false, ColumnDescription = "结果")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "结果")]
|
||||||
public string HandleMessage { get; set; }
|
public string HandleMessage { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否启用
|
/// 是否启用
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDataType = "bit", DefaultValue = "1")]
|
[SugarColumn(IsNullable = false, ColumnDataType = "bit", DefaultValue = "1")]
|
||||||
public bool Enable { get; set; }
|
public bool Enable { get; set; }
|
||||||
}
|
}
|
||||||
@@ -15,138 +15,140 @@ public class BalanceRecordEntity : SugarBaseEntity, ISoftDeleted, ITenantId
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 流水号
|
/// 流水号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "流水号", UniqueGroupNameList = new[] { "Unique_BalanceRecord_No" })]
|
[SugarColumn(IsNullable = false, ColumnDescription = "流水号", UniqueGroupNameList = new[] { "Unique_BalanceRecord_No" })]
|
||||||
public string No { get; set; }
|
public string No { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 档案号/QRCode
|
/// 档案号/QRCode
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "档案号/QRCode")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "档案号/QRCode")]
|
||||||
public string UserNo { get; set; }
|
public string UserNo { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 姓名
|
/// 姓名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "姓名")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "姓名")]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 学工号
|
/// 学工号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "学工号")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "学工号")]
|
||||||
public string UserCode { get; set; }
|
public string UserCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 部门号
|
/// 部门号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "部门号")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "部门号")]
|
||||||
public string DepartmentNo { get; set; }
|
public string DepartmentNo { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 来源
|
/// 来源
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "来源")]
|
[SugarColumn(IsNullable = false, ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "来源")]
|
||||||
public BalanceRecordSourceEnumType Source { get; set; }
|
public BalanceRecordSourceEnumType Source { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 收入/支出
|
/// 收入/支出
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "收入/支出")]
|
[SugarColumn(IsNullable = false, ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "收入/支出")]
|
||||||
public BalanceRecordTypeEnumType Type { get; set; }
|
public BalanceRecordTypeEnumType Type { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 金额 + - 表示
|
/// 金额 + - 表示
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "金额+-表示")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "金额+-表示")]
|
||||||
public decimal Amount { get; set; }
|
public decimal Amount { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 营业点
|
/// 营业点
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "营业点", IsNullable = true)]
|
[SugarColumn(IsNullable = true, ColumnDescription = "营业点")]
|
||||||
public Guid? BusinessPlaceCode { get; set; }
|
public Guid? BusinessPlaceCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 餐别
|
/// 餐别
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "餐别", IsNullable = true)]
|
[SugarColumn(IsNullable = true, ColumnDescription = "餐别")]
|
||||||
public Guid? BusinessShiftCode { get; set; }
|
public Guid? BusinessShiftCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 餐次
|
/// 餐次
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "餐次", ColumnDataType = "varchar(50)", IsNullable = true, SqlParameterDbType = typeof(EnumToStringConvert))]
|
[SugarColumn(IsNullable = true, ColumnDescription = "餐次", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))]
|
||||||
public ShiftEnumType? ShiftType { get; set; }
|
public ShiftEnumType? ShiftType { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 所属成本日期
|
/// 所属成本日期
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDataType = "date", ColumnDescription = "所属成本日期")]
|
[SugarColumn(IsNullable = false, ColumnDataType = "date", ColumnDescription = "所属成本日期")]
|
||||||
public DateTime CostDate { get; set; }
|
public DateTime CostDate { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 消费机器唯一信息
|
/// 消费机器唯一信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "消费机器唯一信息", IsNullable = true)]
|
[SugarColumn(IsNullable = true, ColumnDescription = "消费机器唯一信息")]
|
||||||
public string DeviceUniqueNo { get; set; }
|
public string DeviceUniqueNo { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Ip
|
/// Ip
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "IP")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "IP")]
|
||||||
public string IP { get; set; }
|
public string IP { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 成本中心
|
/// 成本中心
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "成本中心")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "成本中心")]
|
||||||
public string CostId { get; set; }
|
public string CostId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 消费者所在基地
|
/// 消费者所在基地
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "消费者所在基地")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "消费者所在基地")]
|
||||||
public string OriginTenantId { get; set; }
|
public string OriginTenantId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 成本计算是否允许跨基地范围
|
/// 成本计算是否允许跨基地范围
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDataType = "bit", ColumnDescription = "成本计算是否允许跨基地范围")]
|
[SugarColumn(IsNullable = false, ColumnDataType = "bit", ColumnDescription = "成本计算是否允许跨基地范围")]
|
||||||
public bool IsCostCrossTenant { get; set; }
|
public bool IsCostCrossTenant { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 数据状态
|
/// 数据状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "数据状态")]
|
[SugarColumn(IsNullable = false, ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "数据状态")]
|
||||||
public BalanceRecordStatusEnumType Status { get; set; }
|
public BalanceRecordStatusEnumType Status { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 消费时间
|
/// 消费时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "消费时间")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "消费时间")]
|
||||||
public DateTime CostDateTime { get; set; }
|
public DateTime CostDateTime { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 备注
|
/// 备注
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "备注")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "备注")]
|
||||||
public string Remark { get; set; }
|
public string Remark { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 餐饮应用类型
|
/// 餐饮应用类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "餐饮应用类型", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))]
|
[SugarColumn(IsNullable = false, ColumnDescription = "餐饮应用类型", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))]
|
||||||
public CanteenApplicationTypeEnumType ApplicationType { get; set; }
|
public CanteenApplicationTypeEnumType ApplicationType { get; set; }
|
||||||
|
|
||||||
|
[SugarColumn(IsNullable = false)]
|
||||||
public string TenantId { get; set; }
|
public string TenantId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 人事范围
|
/// 人事范围
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
public string Werks { get; set; }
|
public string Werks { get; set; }
|
||||||
|
|
||||||
|
|
||||||
[SugarColumn(ColumnDataType = "bit")]
|
[SugarColumn(IsNullable = false, ColumnDataType = "bit")]
|
||||||
public bool IsDeleted { get; set; }
|
public bool IsDeleted { get; set; }
|
||||||
}
|
}
|
||||||
@@ -13,36 +13,36 @@ public class CanteenOrderEntity : BalanceRecordEntity
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 请求json
|
/// 请求json
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "请求json",ColumnDataType = "varchar(2000)")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "请求json", ColumnDataType = "varchar(2000)")]
|
||||||
public string RequestJson { get; set; }
|
public string RequestJson { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 第三方订单号
|
/// 第三方订单号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "第三方订单号")]
|
[SugarColumn(IsNullable = true,ColumnDescription = "第三方订单号")]
|
||||||
public string ThirdNo { get; set; }
|
public string ThirdNo { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 订单状态
|
/// 订单状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "订单状态")]
|
[SugarColumn(IsNullable = false,ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "订单状态")]
|
||||||
public CanteenOrderStatusEnumType OrderStatus { get; set; }
|
public CanteenOrderStatusEnumType OrderStatus { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否离线数据
|
/// 是否离线数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDataType = "bit", ColumnDescription = "请求json")]
|
[SugarColumn(IsNullable = false,ColumnDataType = "bit", ColumnDescription = "请求json")]
|
||||||
public bool IsOffline { get; set; }
|
public bool IsOffline { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 配送地址
|
/// 配送地址
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "配送地址")]
|
[SugarColumn(IsNullable = true,ColumnDescription = "配送地址")]
|
||||||
public string DeliveryAddress { get; set; }
|
public string DeliveryAddress { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 处理结果
|
/// 处理结果
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "处理结果")]
|
[SugarColumn(IsNullable = true,ColumnDescription = "处理结果")]
|
||||||
public string Result { get; set; }
|
public string Result { get; set; }
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,7 @@ public class DishesCategoryEntity : SugarBaseEntity, ITenantId
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// PCode
|
/// PCode
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
public Guid? PCode { get; set; }
|
public Guid? PCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -38,4 +39,4 @@ public class DishesCategoryEntity : SugarBaseEntity, ITenantId
|
|||||||
|
|
||||||
|
|
||||||
public string TenantId { get; set; }
|
public string TenantId { get; set; }
|
||||||
}
|
}
|
||||||
@@ -13,70 +13,70 @@ public class EMealVoucherDetailEntity : SugarBaseEntity, IVersion
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 主表id
|
/// 主表id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "主表id")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "主表id")]
|
||||||
public long VoucherId { get; set; }
|
public long VoucherId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 流水号
|
/// 流水号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "流水号", UniqueGroupNameList = new[] { "idx_EMealVoucherDetail_no_idno" })]
|
[SugarColumn(IsNullable = false, ColumnDescription = "流水号", UniqueGroupNameList = new[] { "idx_EMealVoucherDetail_no_idno" })]
|
||||||
public string No { get; set; }
|
public string No { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 人员类型
|
/// 人员类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "人员类型(新员工/外来人员)")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "人员类型(新员工/外来人员)")]
|
||||||
public string UserType { get; set; }
|
public string UserType { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 身份证
|
/// 身份证
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "证件号", UniqueGroupNameList = new[] { "idx_EMealVoucherDetail_no_idno" })]
|
[SugarColumn(IsNullable = false, ColumnDescription = "证件号", UniqueGroupNameList = new[] { "idx_EMealVoucherDetail_no_idno" })]
|
||||||
public string IdNo { get; set; }
|
public string IdNo { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用餐人
|
/// 用餐人
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "用餐人")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "用餐人")]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 手机号
|
/// 手机号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "手机号")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "手机号")]
|
||||||
public string Phone { get; set; }
|
public string Phone { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 就餐开始
|
/// 就餐开始
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "使用开始", ColumnDataType = "date")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "使用开始", ColumnDataType = "date")]
|
||||||
public DateTime Start { get; set; }
|
public DateTime Start { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 就餐结束
|
/// 就餐结束
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "使用结束", ColumnDataType = "date")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "使用结束", ColumnDataType = "date")]
|
||||||
public DateTime End { get; set; }
|
public DateTime End { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 金额
|
/// 金额
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "余额", ColumnDataType = "decimal(16,2)")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "余额", ColumnDataType = "decimal(16,2)")]
|
||||||
public decimal Balance { get; set; }
|
public decimal Balance { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 金额
|
/// 金额
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "原始余额", ColumnDataType = "decimal(16,2)")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "原始余额", ColumnDataType = "decimal(16,2)")]
|
||||||
public decimal OriginBalance { get; set; }
|
public decimal OriginBalance { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 版本
|
/// 版本
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "版本")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "版本")]
|
||||||
public int Version { get; set; }
|
public int Version { get; set; }
|
||||||
|
|
||||||
|
|
||||||
[SugarColumn(ColumnDataType = "varchar(255)")]
|
[SugarColumn(IsNullable = true, ColumnDataType = "varchar(255)")]
|
||||||
public string Signature { get; set; }
|
public string Signature { get; set; }
|
||||||
}
|
}
|
||||||
@@ -13,72 +13,72 @@ public class EMealVoucherEntity : SugarBaseEntity
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// oa流程id
|
/// oa流程id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "oa流程id", UniqueGroupNameList = new[] { "index_EMealVoucher_No" })]
|
[SugarColumn(IsNullable = false, ColumnDescription = "oa流程id", UniqueGroupNameList = new[] { "index_EMealVoucher_No" })]
|
||||||
public string No { get; set; }
|
public string No { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 标题
|
/// 标题
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "标题")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "标题")]
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 申请人工号
|
/// 申请人工号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "申请人工号", IndexGroupNameList = new[] { "index_EMealVoucher_Code" })]
|
[SugarColumn(IsNullable = false, ColumnDescription = "申请人工号", IndexGroupNameList = new[] { "index_EMealVoucher_Code" })]
|
||||||
public string Code { get; set; }
|
public string Code { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 成本中心
|
/// 成本中心
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "成本中心")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "成本中心")]
|
||||||
public string CostId { get; set; }
|
public string CostId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 来宾公司
|
/// 来宾公司
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "来宾来源")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "来宾来源")]
|
||||||
public string Source { get; set; }
|
public string Source { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 联系人
|
/// 联系人
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "手机号")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "手机号")]
|
||||||
public string Phone { get; set; }
|
public string Phone { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 来宾人数
|
/// 来宾人数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "来宾人数")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "来宾人数")]
|
||||||
public int Number { get; set; }
|
public int Number { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 就餐事由
|
/// 就餐事由
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "申请事由")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "申请事由")]
|
||||||
public string Reason { get; set; }
|
public string Reason { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 就餐次
|
/// 就餐次
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "就餐次", ColumnDataType = "varchar(500)", IsJson = true)]
|
[SugarColumn(IsNullable = false, ColumnDescription = "就餐次", ColumnDataType = "varchar(500)", IsJson = true)]
|
||||||
public List<ShiftEnumType> Shifts { get; set; }
|
public List<ShiftEnumType> Shifts { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 可消费厂区
|
/// 可消费厂区
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "可消费厂区", ColumnDataType = "varchar(500)", IsJson = true)]
|
[SugarColumn(IsNullable = false, ColumnDescription = "可消费厂区", ColumnDataType = "varchar(500)", IsJson = true)]
|
||||||
public List<string> Factories { get; set; }
|
public List<string> Factories { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 申请日期
|
/// 申请日期
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "申请日期")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "申请日期")]
|
||||||
public DateTime Date { get; set; }
|
public DateTime Date { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 厂区
|
/// 厂区
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "厂区")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "厂区")]
|
||||||
public string Factory { get; set; }
|
public string Factory { get; set; }
|
||||||
}
|
}
|
||||||
@@ -26,23 +26,22 @@ public class MealSupplementRecordEntity : MealSupplementRequestRecordEntity
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 餐补状态
|
/// 餐补状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))]
|
[SugarColumn(IsNullable = false, ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))]
|
||||||
public MealSupplementStatusEnumtype Status { get; set; }
|
public MealSupplementStatusEnumtype Status { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 处理结果
|
/// 处理结果
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "处理结果", ColumnDataType = "varchar(2000)")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "处理结果", ColumnDataType = "varchar(2000)")]
|
||||||
public string Result { get; set; }
|
public string Result { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 状态同步
|
/// 状态同步
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDataType = "bit")]
|
[SugarColumn(IsNullable = false, ColumnDataType = "bit")]
|
||||||
public bool Sync { get; set; }
|
public bool Sync { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 餐补请求记录
|
/// 餐补请求记录
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -78,4 +77,4 @@ public class MealSupplementRequestRecordEntity : SugarBaseEntity
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsNullable = false, ColumnDescription = "餐补")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "餐补")]
|
||||||
public decimal Amount { get; set; }
|
public decimal Amount { get; set; }
|
||||||
}
|
}
|
||||||
@@ -22,6 +22,7 @@ public class UserBalanceEntity : SugarBaseEntity, IVersion
|
|||||||
[SugarColumn(IsNullable = false, ColumnDescription = "余额")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "余额")]
|
||||||
public decimal Balance { get; set; }
|
public decimal Balance { get; set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
|
[SugarColumn(IsNullable = false)]
|
||||||
public int Version { get; set; }
|
public int Version { get; set; }
|
||||||
}
|
}
|
||||||
@@ -30,7 +30,7 @@ public class FileVersionEntity : SugarBaseEntity
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 描述信息
|
/// 描述信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "描述信息")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "描述信息")]
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -38,6 +38,4 @@ public class FileVersionEntity : SugarBaseEntity
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsNullable = false, ColumnDescription = "文件地址")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "文件地址")]
|
||||||
public string Url { get; set; }
|
public string Url { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ public class DeviceGroupEntity : SugarBaseEntity, ITenantId, ISoftDeleted
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 上级设备组code
|
/// 上级设备组code
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "上级设备组code")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "上级设备组code")]
|
||||||
public Guid? PCode { get; set; }
|
public Guid? PCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -37,20 +37,20 @@ public class DeviceGroupEntity : SugarBaseEntity, ITenantId, ISoftDeleted
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备组名称
|
/// 设备组名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "设备组名称")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "设备组名称")]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否可编辑
|
/// 是否可编辑
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDataType = "bit", DefaultValue = "1", ColumnDescription = "是否可编辑")]
|
[SugarColumn(IsNullable = false, ColumnDataType = "bit", DefaultValue = "1", ColumnDescription = "是否可编辑")]
|
||||||
public bool Editable { get; set; } = true;
|
public bool Editable { get; set; } = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 可设置下级
|
/// 可设置下级
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDataType = "bit", DefaultValue = "1")]
|
[SugarColumn(IsNullable = false, ColumnDataType = "bit", DefaultValue = "1")]
|
||||||
public bool AbleSetNext { get; set; } = true;
|
public bool AbleSetNext { get; set; } = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -62,16 +62,17 @@ public class DeviceGroupEntity : SugarBaseEntity, ITenantId, ISoftDeleted
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 可作为预约分组
|
/// 可作为预约分组
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDataType = "bit", DefaultValue = "0")]
|
[SugarColumn(IsNullable = false, ColumnDataType = "bit", DefaultValue = "0")]
|
||||||
public bool AsAppointment { get; set; } = false;
|
public bool AsAppointment { get; set; } = false;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否为出差分组
|
/// 是否为出差分组
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDataType = "bit", DefaultValue = "0")]
|
[SugarColumn(IsNullable = false, ColumnDataType = "bit", DefaultValue = "0")]
|
||||||
public bool IsBusinessTrip { get; set; } = false;
|
public bool IsBusinessTrip { get; set; } = false;
|
||||||
|
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
public string TenantId { get; set; }
|
public string TenantId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
using Dlhis.DataPermission.Model;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.Entity;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace Dlhis.Entity.Device.Entities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设备权限(手动)
|
||||||
|
/// </summary>
|
||||||
|
[SugarTable(TableName = "DevicePermissionManually")]
|
||||||
|
public class DevicePermissionManuallyEntity : SugarBaseEntity, ISoftDeleted
|
||||||
|
{
|
||||||
|
[DeviceCode]
|
||||||
|
[SugarColumn(IsNullable = false)]
|
||||||
|
public Guid DeviceCode { get; set; }
|
||||||
|
|
||||||
|
[SugarColumn(IsNullable = false)]
|
||||||
|
public string UserNo { get; set; }
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public bool IsDeleted { get; set; }
|
||||||
|
}
|
||||||
@@ -15,7 +15,7 @@ public class DeviceTaskEntity : SugarBaseEntity, ITenantId, IVersion
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 任务类型
|
/// 任务类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), IndexGroupNameList = new[] { "idx_DeviceTask_Type" })]
|
[SugarColumn(IsNullable = false, ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), IndexGroupNameList = new[] { "idx_DeviceTask_Type" })]
|
||||||
public DeviceTaskEnumType Type { get; set; }
|
public DeviceTaskEnumType Type { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -33,6 +33,7 @@ public class DeviceTaskEntity : SugarBaseEntity, ITenantId, IVersion
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用户档案号
|
/// 用户档案号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
public string UserNo { get; set; }
|
public string UserNo { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -44,27 +45,22 @@ public class DeviceTaskEntity : SugarBaseEntity, ITenantId, IVersion
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 任务下发状态
|
/// 任务下发状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), IndexGroupNameList = new[] { "idx_DeviceTask_Status" })]
|
[SugarColumn(IsNullable = false, ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), IndexGroupNameList = new[] { "idx_DeviceTask_Status" })]
|
||||||
public DeviceTaskStatusEnumType Status { get; set; }
|
public DeviceTaskStatusEnumType Status { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 数据版本
|
/// 数据版本
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = false)]
|
||||||
public int Version { get; set; }
|
public int Version { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 处理结果
|
/// 处理结果
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDataType = "longtext")]
|
[SugarColumn(IsNullable = true, ColumnDataType = "longtext")]
|
||||||
public string ResultMessage { get; set; }
|
public string ResultMessage { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 取消id
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(DefaultValue = "0")]
|
|
||||||
public long CancellationId { get; set; } = 0;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 任务来源
|
/// 任务来源
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -74,7 +70,7 @@ public class DeviceTaskEntity : SugarBaseEntity, ITenantId, IVersion
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 优先级
|
/// 优先级
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsNullable = true, DefaultValue = "0")]
|
[SugarColumn(IsNullable = false, DefaultValue = "0")]
|
||||||
public int Priority { get; set; } = 0;
|
public int Priority { get; set; } = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,6 @@ public class DeviceUploadLogEntity : SugarBaseEntity, ITenantId
|
|||||||
public bool Status { get; set; }
|
public bool Status { get; set; }
|
||||||
|
|
||||||
|
|
||||||
[SugarColumn(IndexGroupNameList = new string[] { "idx_DeviceUploadLog_TenantId" })]
|
[SugarColumn(IndexGroupNameList = new[] { "idx_DeviceUploadLog_TenantId" })]
|
||||||
public string TenantId { get; set; }
|
public string TenantId { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
using Kurisu.AspNetCore.DataAccess.Entity;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace Dlhis.Entity.Device.Entities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设备通行记录手动获取配置
|
||||||
|
/// </summary>
|
||||||
|
[SugarTable(TableName = "DeviceUploadLogManually", TableDescription = "设备通行记录手动获取配置")]
|
||||||
|
public class DeviceUploadLogManuallyEntity : SugarBaseEntity, ITenantId
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 设备号
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = false, IndexGroupNameList = new[] { "idx_DeviceUploadLogManually_deviceNo" })]
|
||||||
|
public string DeviceNo { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 开始时间
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = false)]
|
||||||
|
public DateTime Start { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 结束时间
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = false)]
|
||||||
|
public DateTime End { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否完成
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = false, ColumnDataType = "bit")]
|
||||||
|
public bool IsFinished { get; set; }
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public string TenantId { get; set; }
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
|
using Dlhis.Entity.Device.Entities;
|
||||||
using Kurisu.AspNetCore;
|
using Kurisu.AspNetCore;
|
||||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
@@ -94,7 +95,7 @@ public class SqlSugarPack : BaseAppPack
|
|||||||
var tables = App.ActiveTypes.Where(x => x.IsDefined(typeof(SugarTable), false))
|
var tables = App.ActiveTypes.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);
|
||||||
|
|
||||||
|
|||||||
@@ -14,76 +14,76 @@ public class MenuEntity : SugarBaseEntity
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// code
|
/// code
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "code")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "code")]
|
||||||
public string Code { get; set; }
|
public string Code { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 上级
|
/// 上级
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "上级")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "上级")]
|
||||||
public string PCode { get; set; }
|
public string PCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 标题
|
/// 标题
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "标题")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "标题")]
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 名称
|
/// 名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "名称")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "名称")]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 图标
|
/// 图标
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "图标")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "图标")]
|
||||||
public string Icon { get; set; }
|
public string Icon { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 路由地址
|
/// 路由地址
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "路由地址")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "路由地址")]
|
||||||
public string Route { get; set; }
|
public string Route { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 权限标识
|
/// 权限标识
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "权限标识")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "权限标识")]
|
||||||
public string Permission { get; set; }
|
public string Permission { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否为外链
|
/// 是否为外链
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "是否为外链")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "是否为外链")]
|
||||||
public bool IsLink { get; set; }
|
public bool IsLink { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 序号
|
/// 序号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "序号")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "序号")]
|
||||||
public int Sequence { get; set; }
|
public int Sequence { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否可见
|
/// 是否可见
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "是否可见")]
|
[SugarColumn(IsNullable = false, ColumnDescription = "是否可见")]
|
||||||
public bool Visible { get; set; }
|
public bool Visible { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 菜单类型
|
/// 菜单类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "菜单类型")]
|
[SugarColumn(IsNullable = false, ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "菜单类型")]
|
||||||
public MenuEnumType MenuType { get; set; }
|
public MenuEnumType MenuType { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 平台类型
|
/// 平台类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "平台类型")]
|
[SugarColumn(IsNullable = false, ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "平台类型")]
|
||||||
public PlatformEnumType Platform { get; set; }
|
public PlatformEnumType Platform { get; set; }
|
||||||
}
|
}
|
||||||
@@ -26,11 +26,13 @@ public class VisitorAppointmentDetailEntity : SugarBaseEntity
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 证件类型
|
/// 证件类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = false)]
|
||||||
public string IdType { get; set; }
|
public string IdType { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 证件号
|
/// 证件号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = false)]
|
||||||
public string IdNo { get; set; }
|
public string IdNo { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -48,17 +50,19 @@ public class VisitorAppointmentDetailEntity : SugarBaseEntity
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 车牌
|
/// 车牌
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "车牌")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "车牌")]
|
||||||
public string LicensePlate { get; set; }
|
public string LicensePlate { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 进入门岗
|
/// 进入门岗
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = false)]
|
||||||
public bool IsEnterDoorArea { get; set; }
|
public bool IsEnterDoorArea { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 预约门禁区域
|
/// 预约门禁区域
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
public string ApplyDoorArea { get; set; }
|
public string ApplyDoorArea { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -76,34 +80,37 @@ public class VisitorAppointmentDetailEntity : SugarBaseEntity
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否进入车间
|
/// 是否进入车间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = false)]
|
||||||
public bool IsEnterWorkplace { get; set; }
|
public bool IsEnterWorkplace { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 申请车间区域
|
/// 申请车间区域
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "车间区域", IsJson = true, DefaultValue = "[]")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "车间区域", IsJson = true, DefaultValue = "[]")]
|
||||||
public List<string> ApplyWorkplaceAreas { get; set; }
|
public List<string> ApplyWorkplaceAreas { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 车间访问开始
|
/// 车间访问开始
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
public DateTime? WorkplaceStart { get; set; }
|
public DateTime? WorkplaceStart { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 车间访问结束
|
/// 车间访问结束
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
public DateTime? WorkplaceEnd { get; set; }
|
public DateTime? WorkplaceEnd { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 社保照片url
|
/// 社保照片url
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "社保照片url")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "社保照片url")]
|
||||||
public string ImageUrl { get; set; }
|
public string ImageUrl { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 备注
|
/// 备注
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "备注")]
|
[SugarColumn(IsNullable = true, ColumnDescription = "备注")]
|
||||||
public string Remark { get; set; }
|
public string Remark { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -117,7 +124,7 @@ public class VisitorAppointmentDetailEntity : SugarBaseEntity
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsNullable = true)]
|
[SugarColumn(IsNullable = true)]
|
||||||
public DateTime? ArrivedTime { get; set; }
|
public DateTime? ArrivedTime { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 强制离场时间
|
/// 强制离场时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -4,5 +4,16 @@ namespace Dlhis.External.Appointment.Services;
|
|||||||
|
|
||||||
public interface IAppointmentService : IScopeDependency
|
public interface IAppointmentService : IScopeDependency
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 接收申请
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task ReceiveAsync(VisitorAppointmentReceiveRequest request);
|
Task ReceiveAsync(VisitorAppointmentReceiveRequest request);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取下一位外部人员工号
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<string> GetNextExternalCodeAsync();
|
||||||
}
|
}
|
||||||
@@ -7,7 +7,6 @@ using Kurisu.AspNetCore.Cache;
|
|||||||
using Kurisu.AspNetCore.CustomClass;
|
using Kurisu.AspNetCore.CustomClass;
|
||||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using SqlSugar;
|
|
||||||
|
|
||||||
namespace Dlhis.External.Appointment.Services.Implements;
|
namespace Dlhis.External.Appointment.Services.Implements;
|
||||||
|
|
||||||
@@ -70,7 +69,7 @@ public class AppointmentService : IAppointmentService
|
|||||||
gainfo = new GainfoEntity
|
gainfo = new GainfoEntity
|
||||||
{
|
{
|
||||||
No = Guid.NewGuid().ToString(),
|
No = Guid.NewGuid().ToString(),
|
||||||
Code = await GetExternalCodeAsync(),
|
Code = await GetNextExternalCodeAsync(),
|
||||||
Gender = GetGender(item.IdNo),
|
Gender = GetGender(item.IdNo),
|
||||||
Type = GainfoUserTypeEnumType.External,
|
Type = GainfoUserTypeEnumType.External,
|
||||||
IdNo = item.IdNo,
|
IdNo = item.IdNo,
|
||||||
@@ -131,7 +130,7 @@ public class AppointmentService : IAppointmentService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private GenderEnumType GetGender(string idNo)
|
private static GenderEnumType GetGender(string idNo)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -142,31 +141,40 @@ public class AppointmentService : IAppointmentService
|
|||||||
: GenderEnumType.Male;
|
: GenderEnumType.Male;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
//ignore
|
||||||
}
|
}
|
||||||
|
|
||||||
return GenderEnumType.Unknown;
|
return GenderEnumType.Unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<string> GetExternalCodeAsync()
|
public async Task<string> GetNextExternalCodeAsync()
|
||||||
{
|
{
|
||||||
await using var handler = await _redisCache.LockAsync("gainfo:external:code-generate", expiry: TimeSpan.FromSeconds(3), retryInterval: TimeSpan.FromSeconds(1), retryCount: 3);
|
await using var handler = await _redisCache.LockAsync("gainfo:external: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<GainfoEntity>()
|
|
||||||
.Where(x => x.Type == GainfoUserTypeEnumType.External && x.Code.StartsWith("EXT"))
|
|
||||||
.OrderBy(x => x.Id, OrderByType.Desc)
|
|
||||||
.FirstAsync();
|
|
||||||
|
|
||||||
|
var entity = await _dbContext.Queryable<BasicTypeEntity>().Where(x => x.Type == "gainfoExternalMaxNum").SingleAsync();
|
||||||
if (entity == null)
|
if (entity == null)
|
||||||
{
|
{
|
||||||
code = 1;
|
code = 1;
|
||||||
|
await _dbContext.InsertAsync(new BasicTypeEntity
|
||||||
|
{
|
||||||
|
Type = "gainfoExternalMaxNum",
|
||||||
|
Code = "1",
|
||||||
|
Display = "外部人员序号",
|
||||||
|
DisplayEn = "外部人员序号",
|
||||||
|
Remark = string.Empty,
|
||||||
|
Sequence = 1
|
||||||
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
code = int.Parse(entity.Code.Replace("EXT", "").TrimStart('0')) + 1;
|
code = int.Parse(entity.Code) + 1;
|
||||||
|
entity.Code = code.ToString();
|
||||||
|
await _dbContext.UpdateAsync(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
return "EXT" + code.ToString().PadLeft(6, '0');
|
return "EXT" + code.ToString().PadLeft(6, '0');
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public class SapPersonItem
|
|||||||
|
|
||||||
public string STELL_NM { get; set; }
|
public string STELL_NM { get; set; }
|
||||||
|
|
||||||
public string ZZ_KLX { get; set; }
|
//public string ZZ_KLX { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -79,4 +79,24 @@ public class DeviceUploadLogsController : ControllerBase
|
|||||||
{
|
{
|
||||||
return await _deviceUploadLogService.GetDeviceUploadRecordSettingAsync(deviceNo);
|
return await _deviceUploadLogService.GetDeviceUploadRecordSettingAsync(deviceNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 手动上传考勤记录
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="logIds"></param>
|
||||||
|
[HttpPost("manuallyUpload")]
|
||||||
|
public async Task ManuallyUploadAsync(List<long> logIds)
|
||||||
|
{
|
||||||
|
await _deviceUploadLogService.ManuallyUploadAsync(logIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 手动设置上传考勤时间范围
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
[HttpPost("manuallySetTimeInfo")]
|
||||||
|
public async Task ManuallySetTimeInfoAsync(DeviceUploadLogManuallySetTimeInfoRequest request)
|
||||||
|
{
|
||||||
|
await _deviceUploadLogService.ManuallySetTimeInfoAsync(request.DeviceNo, request.Start, request.End);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Dlhis.ScheduledTask.DeviceUploadLog.Request;
|
||||||
|
|
||||||
|
public class DeviceUploadLogManuallySetTimeInfoRequest : IValidatableObject
|
||||||
|
{
|
||||||
|
[Required(ErrorMessage = "设备号不能为空")]
|
||||||
|
public string DeviceNo { get; set; }
|
||||||
|
|
||||||
|
public DateTime Start { get; set; }
|
||||||
|
|
||||||
|
public DateTime End { get; set; }
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
if (Start >= End)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("开始时间不可大于等于结束时间");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
|
|
||||||
namespace Dlhis.ScheduledTask.DeviceUploadLog.Request;
|
|
||||||
|
|
||||||
public class SetUploadLogsBeginDateTimeRequest
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 设备号不能为空
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "设备号不能为空")]
|
|
||||||
public string DeviceUniqueNo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 开始时间
|
|
||||||
/// </summary>
|
|
||||||
public DateTime Begin { get; set; }
|
|
||||||
}
|
|
||||||
@@ -13,7 +13,7 @@ public interface IDeviceUploadLogService : IScopeDependency
|
|||||||
/// <param name="requests"></param>
|
/// <param name="requests"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task UploadLogsAsync(List<DeviceUploadLogUploadRequest> requests);
|
Task UploadLogsAsync(List<DeviceUploadLogUploadRequest> requests);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查询通行记录分页
|
/// 查询通行记录分页
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -28,13 +28,30 @@ public interface IDeviceUploadLogService : IScopeDependency
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<List<DeviceUploadLogResponse>> GetMyRecordsAsync(DeviceUploadLogMyRecordRequest request);
|
Task<List<DeviceUploadLogResponse>> GetMyRecordsAsync(DeviceUploadLogMyRecordRequest request);
|
||||||
|
|
||||||
|
|
||||||
Task QiaoqiaoGaoshiqingAsync(DeviceUploadLogSecretAddRequest request);
|
Task QiaoqiaoGaoshiqingAsync(DeviceUploadLogSecretAddRequest request);
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取设备记录获取的开始-结束时间
|
/// 获取设备记录获取的开始-结束时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="deviceNo"></param>
|
/// <param name="deviceNo"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<DateTimePeriod> GetDeviceUploadRecordSettingAsync(string deviceNo);
|
Task<DateTimePeriod> GetDeviceUploadRecordSettingAsync(string deviceNo);
|
||||||
}
|
|
||||||
|
/// <summary>
|
||||||
|
/// 手动上传考勤记录
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="requestIds"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task ManuallyUploadAsync(List<long> requestIds);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 手动设置获取记录时间范围
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="deviceNo"></param>
|
||||||
|
/// <param name="start"></param>
|
||||||
|
/// <param name="end"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task ManuallySetTimeInfoAsync(string deviceNo, DateTime start, DateTime end);
|
||||||
|
}
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
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 Dlhis.Jip.Api;
|
||||||
|
using Dlhis.Jip.Api.Requests;
|
||||||
using Dlhis.ScheduledTask.DeviceUploadLog.Request;
|
using Dlhis.ScheduledTask.DeviceUploadLog.Request;
|
||||||
using Dlhis.ScheduledTask.DeviceUploadLog.Response;
|
using Dlhis.ScheduledTask.DeviceUploadLog.Response;
|
||||||
using Kurisu.AspNetCore.Authentication.Abstractions;
|
using Kurisu.AspNetCore.Authentication.Abstractions;
|
||||||
@@ -16,11 +18,13 @@ public class DeviceUploadLogService : IDeviceUploadLogService
|
|||||||
{
|
{
|
||||||
private readonly IDbContext _dbContext;
|
private readonly IDbContext _dbContext;
|
||||||
private readonly ICurrentUser _currentUser;
|
private readonly ICurrentUser _currentUser;
|
||||||
|
private readonly IJinkoJipApi _jinkoJipApi;
|
||||||
|
|
||||||
public DeviceUploadLogService(IDbContext dbContext, ICurrentUser currentUser)
|
public DeviceUploadLogService(IDbContext dbContext, ICurrentUser currentUser, IJinkoJipApi jinkoJipApi)
|
||||||
{
|
{
|
||||||
_dbContext = dbContext;
|
_dbContext = dbContext;
|
||||||
_currentUser = currentUser;
|
_currentUser = currentUser;
|
||||||
|
_jinkoJipApi = jinkoJipApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task UploadLogsAsync(List<DeviceUploadLogUploadRequest> requests)
|
public async Task UploadLogsAsync(List<DeviceUploadLogUploadRequest> requests)
|
||||||
@@ -103,6 +107,66 @@ public class DeviceUploadLogService : IDeviceUploadLogService
|
|||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public async Task ManuallyUploadAsync(List<long> requestIds)
|
||||||
|
{
|
||||||
|
var existsOther = await _dbContext.Queryable<DeviceUploadLogEntity>()
|
||||||
|
.Where(x => requestIds.Contains(x.Id))
|
||||||
|
.Where(x => x.Type != DeviceUploadLogTypeEnumType.Attendance)
|
||||||
|
.AnyAsync();
|
||||||
|
|
||||||
|
existsOther.ThrowIfTrue("存在非考勤通行记录,无法上传");
|
||||||
|
|
||||||
|
var requests = await _dbContext.Queryable<DeviceUploadLogEntity>()
|
||||||
|
.LeftJoin<DeviceEntity>((x, device) => x.DeviceUniqueNo == device.UniqueNo)
|
||||||
|
.Where(x => x.Sync == false)
|
||||||
|
.Where(x => !string.IsNullOrEmpty(x.UserUniqueNo))
|
||||||
|
.Where(x => SqlFunc.Subqueryable<OutsourceEntity>().Where(p => p.Code == x.UserUniqueNo).NotAny())
|
||||||
|
.Where(x => requestIds.Contains(x.Id))
|
||||||
|
.Select((x, device) => new UploadAttendanceRequestItem
|
||||||
|
{
|
||||||
|
Id = x.Id,
|
||||||
|
RaiseDateTime = x.RaiseDateTime,
|
||||||
|
ZNOTE = device.DeployPlace,
|
||||||
|
ZWORKCODE = x.UserUniqueNo
|
||||||
|
})
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
if (requests.Any())
|
||||||
|
{
|
||||||
|
foreach (var items in requests.Chunk(500))
|
||||||
|
{
|
||||||
|
var ids = items.Select(x => x.Id).ToList();
|
||||||
|
var r = await _jinkoJipApi.UploadAttendancesAsync(new UploadAttendanceRequest { Data = items.ToList() });
|
||||||
|
if (r.OLX == "0")
|
||||||
|
{
|
||||||
|
await _dbContext.Updateable<DeviceUploadLogEntity>()
|
||||||
|
.SetColumns(x => x.Sync == true)
|
||||||
|
.SetColumns(x => x.ModifiedTime == DateTime.Now)
|
||||||
|
.Where(x => ids.Contains(x.Id))
|
||||||
|
.ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public async Task ManuallySetTimeInfoAsync(string deviceNo, DateTime start, DateTime end)
|
||||||
|
{
|
||||||
|
var device = await _dbContext.Queryable<DeviceEntity>().Where(x => x.UniqueNo == deviceNo).SingleAsync();
|
||||||
|
(device.Type != DeviceTypeEnumType.Attendance && device.Type != DeviceTypeEnumType.Door).ThrowIfTrue("不支持该设备类型");
|
||||||
|
var exists = await _dbContext.Queryable<DeviceUploadLogManuallyEntity>().Where(x => x.DeviceNo == deviceNo).Where(x => x.IsFinished == false).AnyAsync();
|
||||||
|
exists.ThrowIfTrue("已存在配置尚未完成");
|
||||||
|
|
||||||
|
await _dbContext.InsertAsync(new DeviceUploadLogManuallyEntity
|
||||||
|
{
|
||||||
|
DeviceNo = deviceNo,
|
||||||
|
Start = start,
|
||||||
|
End = end,
|
||||||
|
IsFinished = false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public async Task QiaoqiaoGaoshiqingAsync(DeviceUploadLogSecretAddRequest request)
|
public async Task QiaoqiaoGaoshiqingAsync(DeviceUploadLogSecretAddRequest request)
|
||||||
{
|
{
|
||||||
var device = await _dbContext.Queryable<DeviceEntity>().Where(x => x.UniqueNo == request.DeviceUniqueNo).SingleAsync();
|
var device = await _dbContext.Queryable<DeviceEntity>().Where(x => x.UniqueNo == request.DeviceUniqueNo).SingleAsync();
|
||||||
@@ -122,7 +186,7 @@ public class DeviceUploadLogService : IDeviceUploadLogService
|
|||||||
TenantId = device.TenantId,
|
TenantId = device.TenantId,
|
||||||
Status = true,
|
Status = true,
|
||||||
CreatedBy = 1,
|
CreatedBy = 1,
|
||||||
ModifiedBy = 1,
|
ModifiedBy = 1
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ public class CreateGetUploadRecordJob : BaseJob
|
|||||||
TenantId = x.TenantId,
|
TenantId = x.TenantId,
|
||||||
Version = 0,
|
Version = 0,
|
||||||
Type = DeviceTaskEnumType.UploadRecord,
|
Type = DeviceTaskEnumType.UploadRecord,
|
||||||
CancellationId = 0,
|
|
||||||
Priority = 50,
|
Priority = 50,
|
||||||
Source = "定时任务创建设备获取通行记录任务"
|
Source = "定时任务创建设备获取通行记录任务"
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|||||||
@@ -2,10 +2,12 @@
|
|||||||
"profiles": {
|
"profiles": {
|
||||||
"Dlhis.ScheduledTask": {
|
"Dlhis.ScheduledTask": {
|
||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
|
"launchBrowser": true,
|
||||||
|
"launchUrl": "swagger/index.html",
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
},
|
},
|
||||||
"applicationUrl": "http://*:5010"
|
"applicationUrl": "http://localhost:5010;http://*:5010;"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,6 @@ using Newtonsoft.Json.Linq;
|
|||||||
using Kurisu.AspNetCore.Utils;
|
using Kurisu.AspNetCore.Utils;
|
||||||
using Dlhis.ScheduledTask.TaskAssignment.Dto;
|
using Dlhis.ScheduledTask.TaskAssignment.Dto;
|
||||||
using Kurisu.AspNetCore.CustomClass;
|
using Kurisu.AspNetCore.CustomClass;
|
||||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
|
||||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||||
|
|
||||||
namespace Dlhis.ScheduledTask.TaskAssignment.Services.Implements;
|
namespace Dlhis.ScheduledTask.TaskAssignment.Services.Implements;
|
||||||
@@ -153,12 +152,13 @@ public class AssignmentService : IAssignmentService
|
|||||||
|
|
||||||
case DeviceTaskEnumType.UploadRecord:
|
case DeviceTaskEnumType.UploadRecord:
|
||||||
{
|
{
|
||||||
|
var timeInfo = deviceUploadInfos[d];
|
||||||
dto.Info = new UploadRecordToDeviceResponse
|
dto.Info = new UploadRecordToDeviceResponse
|
||||||
{
|
{
|
||||||
DateTimePeriod = new DateTimePeriod
|
DateTimePeriod = new DateTimePeriod
|
||||||
{
|
{
|
||||||
Start = deviceUploadInfos.TryGetValue(d, out var dt) ? (dt ?? DateTime.Now) : DateTime.Now,
|
Start = timeInfo.Item1,
|
||||||
End = DateTime.Now.AddDays(1)
|
End = timeInfo.Item2
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -262,8 +262,6 @@ public class AssignmentService : IAssignmentService
|
|||||||
.WhereIF(request.Brand.IsPresent(), (deviceTask, device, deviceTemplate) => deviceTemplate.Brand == request.Brand)
|
.WhereIF(request.Brand.IsPresent(), (deviceTask, device, deviceTemplate) => deviceTemplate.Brand == request.Brand)
|
||||||
.Where((deviceTask, device, deviceTemplate, ga, gaLeave, department, deviceRegistry) =>
|
.Where((deviceTask, device, deviceTemplate, ga, gaLeave, department, deviceRegistry) =>
|
||||||
device.HeartbeatInterval == 0 || SqlFunc.DateAdd(deviceRegistry.LastHeartbeatTime, device.HeartbeatInterval, DateType.Second) > DateTime.Now)
|
device.HeartbeatInterval == 0 || SqlFunc.DateAdd(deviceRegistry.LastHeartbeatTime, device.HeartbeatInterval, DateType.Second) > DateTime.Now)
|
||||||
#if !DEBUG
|
|
||||||
#endif
|
|
||||||
.OrderBy(deviceTask => new { deviceTask.CreateTime, Priority = SqlFunc.Desc(deviceTask.Priority) })
|
.OrderBy(deviceTask => new { deviceTask.CreateTime, Priority = SqlFunc.Desc(deviceTask.Priority) })
|
||||||
.Select((deviceTask, device, deviceTemplate, ga, gaLeave, department) => new TaskDto
|
.Select((deviceTask, device, deviceTemplate, ga, gaLeave, department) => new TaskDto
|
||||||
{
|
{
|
||||||
@@ -328,15 +326,21 @@ public class AssignmentService : IAssignmentService
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="data"></param>
|
/// <param name="data"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private async Task<Dictionary<string, DateTime?>> GetDeviceUploadRecordInfosAsync(List<TaskDto> data)
|
private async Task<Dictionary<string, (DateTime, DateTime)>> GetDeviceUploadRecordInfosAsync(List<TaskDto> data)
|
||||||
{
|
{
|
||||||
if (data.All(x => x.Type != DeviceTaskEnumType.UploadRecord))
|
if (data.All(x => x.Type != DeviceTaskEnumType.UploadRecord))
|
||||||
{
|
{
|
||||||
return new Dictionary<string, DateTime?>();
|
return new Dictionary<string, (DateTime, DateTime)>();
|
||||||
}
|
}
|
||||||
|
|
||||||
var deviceNos = data.Select(x => x.DeviceUniqueNo).Distinct().ToList();
|
var deviceNos = data.Select(x => x.DeviceUniqueNo).Distinct().ToList();
|
||||||
var result = new Dictionary<string, DateTime?>(deviceNos.Count);
|
var result = new Dictionary<string, (DateTime, DateTime)>(deviceNos.Count);
|
||||||
|
|
||||||
|
var manualSettings = await _dbContext.Queryable<DeviceUploadLogManuallyEntity>().Where(x => deviceNos.Contains(x.DeviceNo))
|
||||||
|
.Where(x => x.IsFinished == false)
|
||||||
|
.OrderBy(x => x.CreateTime)
|
||||||
|
.Select(x => new { x.Id, x.DeviceNo, x.Start, x.End })
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
var logInfos = await _dbContext.Queryable<DeviceUploadLogEntity>()
|
var logInfos = await _dbContext.Queryable<DeviceUploadLogEntity>()
|
||||||
.GroupBy(x => x.DeviceUniqueNo)
|
.GroupBy(x => x.DeviceUniqueNo)
|
||||||
@@ -347,12 +351,27 @@ public class AssignmentService : IAssignmentService
|
|||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
|
var commonEnd = DateTime.Now.AddDays(1);
|
||||||
foreach (var item in deviceNos)
|
foreach (var item in deviceNos)
|
||||||
{
|
{
|
||||||
var logInfo = logInfos.FirstOrDefault(x => x.DeviceUniqueNo == item);
|
var setting = manualSettings.FirstOrDefault(x => x.DeviceNo == item);
|
||||||
result.Add(item, logInfo?.RaiseDateTime);
|
if (setting != null)
|
||||||
|
{
|
||||||
|
result.Add(item, (setting.Start, setting.End));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var logInfo = logInfos.FirstOrDefault(x => x.DeviceUniqueNo == item);
|
||||||
|
result.Add(item, logInfo == null ? (DateTime.Now.AddMinutes(-10), commonEnd) : (logInfo.RaiseDateTime, commonEnd));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//更新为已处理
|
||||||
|
await _dbContext.Updateable<DeviceUploadLogManuallyEntity>()
|
||||||
|
.SetColumns(x => x.IsFinished == true)
|
||||||
|
.Where(x => manualSettings.Select(p => p.Id).Contains(x.Id))
|
||||||
|
.ExecuteCommandAsync();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user