diff --git a/Src/Dlhis.Basic/Appointment/Services/Implements/AppointmentAreaService.cs b/Src/Dlhis.Basic/Appointment/Services/Implements/AppointmentAreaService.cs index 34fd9041..aad83490 100644 --- a/Src/Dlhis.Basic/Appointment/Services/Implements/AppointmentAreaService.cs +++ b/Src/Dlhis.Basic/Appointment/Services/Implements/AppointmentAreaService.cs @@ -108,7 +108,6 @@ public class AppointmentAreaService : IAppointmentAreaService DeviceUniqueNo = devices.First(item => item.Code == x).UniqueNo, Status = DeviceTaskStatusEnumType.Wait, Version = 0, - CancellationId = 0, Source = "预约区域和设备组关系变更生成", Priority = 99 })); @@ -121,7 +120,6 @@ public class AppointmentAreaService : IAppointmentAreaService DeviceUniqueNo = devices.First(item => item.Code == x).UniqueNo, Status = DeviceTaskStatusEnumType.Wait, Version = 0, - CancellationId = 0, Source = "预约区域和设备组关系变更生成", Priority = 99 })); diff --git a/Src/Dlhis.Basic/Device/Services/Implements/BasePermissionAnalyzeService.cs b/Src/Dlhis.Basic/Device/Services/Implements/BasePermissionAnalyzeService.cs index 004cd6c5..3ec41f3b 100644 --- a/Src/Dlhis.Basic/Device/Services/Implements/BasePermissionAnalyzeService.cs +++ b/Src/Dlhis.Basic/Device/Services/Implements/BasePermissionAnalyzeService.cs @@ -83,7 +83,6 @@ public abstract class BasePermissionAnalyzeService : IPermissionAnalyzeService Status = DeviceTaskStatusEnumType.Wait, Version = 0, ResultMessage = null, - CancellationId = 0, Source = source, Priority = 0, TenantId = x.TenantId, @@ -99,7 +98,6 @@ public abstract class BasePermissionAnalyzeService : IPermissionAnalyzeService Status = DeviceTaskStatusEnumType.Wait, Version = 0, ResultMessage = null, - CancellationId = 0, Source = source, Priority = 0, TenantId = x.TenantId, diff --git a/Src/Dlhis.Basic/Device/Services/Implements/DeviceGroupService.cs b/Src/Dlhis.Basic/Device/Services/Implements/DeviceGroupService.cs index 24781f2f..e35a2b9f 100644 --- a/Src/Dlhis.Basic/Device/Services/Implements/DeviceGroupService.cs +++ b/Src/Dlhis.Basic/Device/Services/Implements/DeviceGroupService.cs @@ -225,7 +225,6 @@ public class DeviceGroupService : IDeviceGroupService Status = DeviceTaskStatusEnumType.Wait, Version = 0, ResultMessage = null, - CancellationId = 0, Source = "人员分组分配", Priority = 0, TenantId = x.TenantId @@ -259,7 +258,6 @@ public class DeviceGroupService : IDeviceGroupService Status = DeviceTaskStatusEnumType.Wait, Version = 0, ResultMessage = null, - CancellationId = 0, Source = "人员分组分配", Priority = 0, TenantId = x.TenantId, diff --git a/Src/Dlhis.Basic/Device/Services/Implements/DevicePermissionAnalyzeService.cs b/Src/Dlhis.Basic/Device/Services/Implements/DevicePermissionAnalyzeService.cs index 85b0ef7e..833f0f32 100644 --- a/Src/Dlhis.Basic/Device/Services/Implements/DevicePermissionAnalyzeService.cs +++ b/Src/Dlhis.Basic/Device/Services/Implements/DevicePermissionAnalyzeService.cs @@ -125,7 +125,6 @@ public class DevicePermissionAnalyzeService : IDevicePermissionAnalyzeService DeviceUniqueNo = devices.First(item => item.Code == x).UniqueNo, Status = DeviceTaskStatusEnumType.Wait, Type = DeviceTaskEnumType.Delete, - CancellationId = 0, DeviceType = devices.First(item => item.Code == x).Type, UserNo = userNo, Version = 0, diff --git a/Src/Dlhis.Basic/Device/Services/Implements/DevicePermissionService.cs b/Src/Dlhis.Basic/Device/Services/Implements/DevicePermissionService.cs index dc79662d..372e566f 100644 --- a/Src/Dlhis.Basic/Device/Services/Implements/DevicePermissionService.cs +++ b/Src/Dlhis.Basic/Device/Services/Implements/DevicePermissionService.cs @@ -101,7 +101,6 @@ public class DevicePermissionService : IDevicePermissionService Status = DeviceTaskStatusEnumType.Wait, Version = 0, ResultMessage = null, - CancellationId = 0, Source = "人员分配到设备unique", Priority = 0, TenantId = currentTenantId, @@ -131,7 +130,6 @@ public class DevicePermissionService : IDevicePermissionService Status = DeviceTaskStatusEnumType.Wait, Version = 0, ResultMessage = null, - CancellationId = 20, Source = "人员分配到设备unique", Priority = 0, TenantId = currentTenantId @@ -209,7 +207,6 @@ public class DevicePermissionService : IDevicePermissionService Status = DeviceTaskStatusEnumType.Wait, Version = 0, ResultMessage = null, - CancellationId = 0, Source = "人员分配到设备import", Priority = 0, TenantId = device.TenantId, @@ -399,7 +396,6 @@ public class DevicePermissionService : IDevicePermissionService DeviceUniqueNo = device.UniqueNo, Status = DeviceTaskStatusEnumType.Wait, Type = DeviceTaskEnumType.Delete, - CancellationId = 0, DeviceType = device.Type, UserNo = x, Version = 0, @@ -425,7 +421,6 @@ public class DevicePermissionService : IDevicePermissionService Type = taskType, DeviceType = x.Type, UserNo = userNo, - CancellationId = 0, Priority = 0, Version = 0, TenantId = x.TenantId, diff --git a/Src/Dlhis.Basic/Device/Services/Implements/DeviceTimePeriodService.cs b/Src/Dlhis.Basic/Device/Services/Implements/DeviceTimePeriodService.cs index 0f16b0f6..71997067 100644 --- a/Src/Dlhis.Basic/Device/Services/Implements/DeviceTimePeriodService.cs +++ b/Src/Dlhis.Basic/Device/Services/Implements/DeviceTimePeriodService.cs @@ -158,7 +158,6 @@ public class DeviceTimePeriodService : IDeviceTimePeriodService DeviceUniqueNo = deviceUniqueNo, Status = DeviceTaskStatusEnumType.Wait, Version = 0, - CancellationId = 0, Source = source, Priority = 90, TenantId = device.TenantId @@ -191,7 +190,6 @@ public class DeviceTimePeriodService : IDeviceTimePeriodService DeviceUniqueNo = deviceUniqueNo, Status = DeviceTaskStatusEnumType.Wait, Version = 0, - CancellationId = 0, Source = source, Priority = 90, TenantId = device.TenantId @@ -213,7 +211,7 @@ public class DeviceTimePeriodService : IDeviceTimePeriodService var devices = await _dbContext.Queryable() .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) .ToListAsync(); diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoGroupService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoGroupService.cs index 071b8647..6a302996 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoGroupService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoGroupService.cs @@ -189,7 +189,6 @@ public class GainfoGroupService : IGainfoGroupService Status = DeviceTaskStatusEnumType.Wait, Version = 0, ResultMessage = null, - CancellationId = 0, Source = "手动操作人员分组关系", Priority = 0, TenantId = device.TenantId @@ -209,7 +208,6 @@ public class GainfoGroupService : IGainfoGroupService Status = DeviceTaskStatusEnumType.Wait, Version = 0, ResultMessage = null, - CancellationId = 0, Source = "手动操作人员分组关系", Priority = 0, TenantId = device.TenantId diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs index d328f4c1..144508a2 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs @@ -305,7 +305,6 @@ public class GainfoService : IGainfoService Status = DeviceTaskStatusEnumType.Wait, Version = 0, ResultMessage = null, - CancellationId = 0, Source = "安全级别提高", Priority = 60, TenantId = x.TenantId diff --git a/Src/Dlhis.Basic/appsettings.Development.json b/Src/Dlhis.Basic/appsettings.Development.json index 47d1cb6f..c22992e5 100644 --- a/Src/Dlhis.Basic/appsettings.Development.json +++ b/Src/Dlhis.Basic/appsettings.Development.json @@ -22,7 +22,7 @@ "Timeout": 30, "SlowSqlTime": 1, "EnableSqlLog": true, - "Generate": false + "Generate": true }, "SwaggerOptions": { "Enable": true, diff --git a/Src/Dlhis.Entity/Basic/Entity/BusinessPlaceManagerRelationshipEntity.cs b/Src/Dlhis.Entity/Basic/Entity/BusinessPlaceManagerRelationshipEntity.cs index 45694dc3..4ac9f3f8 100644 --- a/Src/Dlhis.Entity/Basic/Entity/BusinessPlaceManagerRelationshipEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/BusinessPlaceManagerRelationshipEntity.cs @@ -15,16 +15,15 @@ public class BusinessPlaceManagerRelationshipEntity : SugarBaseEntity , ITenantI /// 管理人员 /// [AdaptIgnore(MemberSide.Destination)] - [SugarColumn(ColumnDescription = "管理人员", IsNullable = false)] + [SugarColumn(IsNullable = false, ColumnDescription = "管理人员")] public int ManagerUserId { get; set; } /// /// 营业点 /// - [SugarColumn(ColumnDescription = "营业点", IsNullable = false)] + [SugarColumn(IsNullable = false, ColumnDescription = "营业点")] public Guid BusinessPlaceCode { get; set; } - /// public string TenantId { get; set; } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Basic/Entity/DepartmentEntity.cs b/Src/Dlhis.Entity/Basic/Entity/DepartmentEntity.cs index 11db4561..270793d5 100644 --- a/Src/Dlhis.Entity/Basic/Entity/DepartmentEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/DepartmentEntity.cs @@ -12,19 +12,19 @@ namespace Dlhis.Entity.Basic.Entity /// /// 部门号 /// - [SugarColumn(ColumnDescription = "部门号", IsNullable = false, UniqueGroupNameList = new[] { "idx_Department_No" })] + [SugarColumn(IsNullable = false, ColumnDescription = "部门号", UniqueGroupNameList = new[] { "idx_Department_No" })] public string No { get; set; } /// /// 上级部门号 /// - [SugarColumn(ColumnDescription = "上级部门号")] + [SugarColumn(IsNullable = true, ColumnDescription = "上级部门号")] public string PNo { get; set; } /// /// 部门名称 /// - [SugarColumn(ColumnDescription = "部门名称", IsNullable = false)] + [SugarColumn(IsNullable = false, ColumnDescription = "部门名称")] public string Name { get; set; } } } \ No newline at end of file diff --git a/Src/Dlhis.Entity/Basic/Entity/DeviceEntity.cs b/Src/Dlhis.Entity/Basic/Entity/DeviceEntity.cs index 44bde49a..2a73f65f 100644 --- a/Src/Dlhis.Entity/Basic/Entity/DeviceEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/DeviceEntity.cs @@ -6,102 +6,101 @@ using Mapster; using SqlSugar; using SqlSugar.DbConvert; -namespace Dlhis.Entity.Basic.Entity +namespace Dlhis.Entity.Basic.Entity; + +/// +/// 设备 +/// +[SugarTable(TableName = "Device", TableDescription = "设备表")] +public class DeviceEntity : SugarBaseEntity, ITenantId { /// - /// 设备 + /// 设备code /// - [SugarTable(TableName = "Device", TableDescription = "设备表")] - public class DeviceEntity : SugarBaseEntity, ITenantId - { - /// - /// 设备code - /// - [DeviceCode] - [SugarColumn(ColumnDescription = "设备code")] - public Guid Code { get; set; } + [DeviceCode] + [SugarColumn(IsNullable = false, ColumnDescription = "设备code")] + public Guid Code { get; set; } - /// - /// 设备唯一码,IP/MAC/SNO - /// - [AdaptIgnore(MemberSide.Destination)] - [SugarColumn(ColumnDescription = "设备唯一码", IsNullable = false, UniqueGroupNameList = new[] { "Idx_Device_UniqueNo" })] - public string UniqueNo { get; set; } + /// + /// 设备唯一码,IP/MAC/SNO + /// + [AdaptIgnore(MemberSide.Destination)] + [SugarColumn(IsNullable = false, ColumnDescription = "设备唯一码", UniqueGroupNameList = new[] { "Idx_Device_UniqueNo" })] + public string UniqueNo { get; set; } - /// - /// 心跳间隔 - /// - [SugarColumn(ColumnDescription = "心跳检查间隔")] - public int HeartbeatInterval { get; set; } + /// + /// 心跳间隔 + /// + [SugarColumn(IsNullable = false, ColumnDescription = "心跳检查间隔")] + public int HeartbeatInterval { get; set; } = 30; - /// - /// 供应商 - /// - [SugarColumn(ColumnDescription = "供应商")] - public string Supplier { get; set; } + /// + /// 供应商 + /// + [SugarColumn(IsNullable = true, ColumnDescription = "供应商")] + public string Supplier { get; set; } - /// - /// 设备功能 - /// - [SugarColumn(ColumnDataType = "varchar(150)", IsJson = true, ColumnDescription = "设备功能", DefaultValue = "[]")] - public List Funcs { get; set; } + /// + /// 设备功能 + /// + [SugarColumn(IsNullable = false, ColumnDataType = "varchar(150)", IsJson = true, ColumnDescription = "设备功能", DefaultValue = "[]")] + public List Funcs { get; set; } - /// - /// 设备类型 - /// - [SugarColumn(ColumnDescription = "设备类型", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] - public DeviceTypeEnumType Type { get; set; } + /// + /// 设备类型 + /// + [SugarColumn(IsNullable = false, ColumnDescription = "设备类型", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] + public DeviceTypeEnumType Type { get; set; } - /// - /// 部署点 - /// - [SugarColumn(ColumnDescription = "部署点")] - public string DeployPlace { get; set; } + /// + /// 部署点 + /// + [SugarColumn(IsNullable = true, ColumnDescription = "部署点")] + public string DeployPlace { get; set; } - /// - /// 部署坐标 - /// - [SugarColumn(ColumnDescription = "部署坐标")] - public string DeployPosition { get; set; } + /// + /// 部署坐标 + /// + [SugarColumn(IsNullable = true, ColumnDescription = "部署坐标")] + public string DeployPosition { get; set; } - /// - /// 部署方向 - /// - [SugarColumn(ColumnDescription = "部署方向", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] - public DeviceDeployDirectionEnumType? DeployDirection { get; set; } + /// + /// 部署方向 + /// + [SugarColumn(IsNullable = true, ColumnDescription = "部署方向", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] + public DeviceDeployDirectionEnumType? DeployDirection { get; set; } - /// - /// 模板code - /// - [SugarColumn(ColumnDescription = "模板code")] - public Guid? TemplateCode { get; set; } + /// + /// 模板code + /// + [SugarColumn(IsNullable = false, ColumnDescription = "模板code")] + public Guid TemplateCode { get; set; } - /// - /// 连接信息 - /// - [SugarColumn(ColumnDescription = "连接信息")] - public string ConnectionInfo { get; set; } + /// + /// 连接信息 + /// + [SugarColumn(IsNullable = false, ColumnDescription = "连接信息")] + public string ConnectionInfo { get; set; } - /// - /// 是否启用 - /// - [SugarColumn(ColumnDataType = "bit", ColumnDescription = "是否启用")] - public bool Enable { get; set; } + /// + /// 是否启用 + /// + [SugarColumn(IsNullable = false, ColumnDataType = "bit", ColumnDescription = "是否启用")] + public bool Enable { get; set; } - /// - /// 是否作为考勤设备 - /// - [SugarColumn(ColumnDataType = "bit", ColumnDescription = "是否作为考勤设备")] - public bool AsAttendance { get; set; } + /// + /// 是否作为考勤设备 + /// + [SugarColumn(IsNullable = false, ColumnDataType = "bit", ColumnDescription = "是否作为考勤设备")] + public bool AsAttendance { get; set; } - /// - /// 是否启用时段码 - /// - [SugarColumn(ColumnDataType = "bit", ColumnDescription = "是否启用时段码", DefaultValue = "0")] - public bool EnableTimePeriod { get; set; } = false; + /// + /// 是否启用时段码 + /// + [SugarColumn(IsNullable = false, ColumnDataType = "bit", ColumnDescription = "是否启用时段码", DefaultValue = "0")] + public bool EnableTimePeriod { get; set; } = false; - public string TenantId { get; set; } - } + public string TenantId { get; set; } } \ No newline at end of file diff --git a/Src/Dlhis.Entity/Basic/Entity/GainfoEntity.cs b/Src/Dlhis.Entity/Basic/Entity/GainfoEntity.cs index c5ae6fa3..7cfb4bb2 100644 --- a/Src/Dlhis.Entity/Basic/Entity/GainfoEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/GainfoEntity.cs @@ -29,146 +29,146 @@ public class GainfoEntity : SugarBaseEntity /// 人员类型 /// [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; } /// /// 人员来源 /// - [SugarColumn(ColumnDescription = "人员来源", IsNullable = true)] + [SugarColumn(IsNullable = true, ColumnDescription = "人员来源")] public string Source { get; set; } /// /// 姓名 /// - [SugarColumn(ColumnDescription = "姓名")] + [SugarColumn(IsNullable = false, ColumnDescription = "姓名")] public string Name { get; set; } /// /// 学工号 /// - [SugarColumn(ColumnDescription = "学工号", UniqueGroupNameList = new[] { "idx_Gainfo_Code" })] + [SugarColumn(IsNullable = false, ColumnDescription = "学工号", UniqueGroupNameList = new[] { "idx_Gainfo_Code" })] public string Code { get; set; } /// /// 国家代码 /// - [SugarColumn(ColumnDescription = "国家代码")] + [SugarColumn(IsNullable = true, ColumnDescription = "国家代码")] public string CountryNo { get; set; } /// /// 证件类型代码 /// - [SugarColumn(ColumnDescription = "证件类型代码")] + [SugarColumn(IsNullable = true, ColumnDescription = "证件类型代码")] public string IdClass { get; set; } /// /// 身份证号 /// - [SugarColumn(ColumnDescription = "身份证号", UniqueGroupNameList = new[] { "idx_Gainfo_IdNo" })] + [SugarColumn(IsNullable = true, ColumnDescription = "身份证号", UniqueGroupNameList = new[] { "idx_Gainfo_IdNo" })] public string IdNo { get; set; } /// /// 身份证籍贯区域代码 /// - [SugarColumn(ColumnDescription = "身份证籍贯区域代码")] + [SugarColumn(IsNullable = true, ColumnDescription = "身份证籍贯区域代码")] public string Native { get; set; } /// /// 性别 /// - [SugarColumn(ColumnDescription = "性别", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] + [SugarColumn(IsNullable = false, ColumnDescription = "性别", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] public GenderEnumType Gender { get; set; } /// /// 生日 /// - [SugarColumn(ColumnDescription = "生日")] + [SugarColumn(IsNullable = true, ColumnDescription = "生日")] public DateTime Birthday { get; set; } /// /// 身份证地址 /// - [SugarColumn(ColumnDescription = "身份证地址")] + [SugarColumn(IsNullable = true, ColumnDescription = "身份证地址")] public string Address { get; set; } /// /// 部门编码 /// - [SugarColumn(ColumnDescription = "部门编码")] + [SugarColumn(IsNullable = true, ColumnDescription = "部门编码")] public string DepartmentNo { get; set; } /// /// 民族代码 /// - [SugarColumn(ColumnDescription = "民族代码")] + [SugarColumn(IsNullable = true, ColumnDescription = "民族代码")] public string Nation { get; set; } /// /// 手机号码 /// - [SugarColumn(ColumnDescription = "手机号码")] + [SugarColumn(IsNullable = true, ColumnDescription = "手机号码")] public string Phone { get; set; } /// /// 学历 /// - [SugarColumn(ColumnDescription = "学历")] + [SugarColumn(IsNullable = true, ColumnDescription = "学历")] public string Degree { get; set; } /// /// 岗位 /// - [SugarColumn(ColumnDescription = "岗位")] + [SugarColumn(IsNullable = true, ColumnDescription = "岗位")] public string PositionNo { get; set; } /// /// 职等 /// - [SugarColumn(ColumnDescription = "职等")] + [SugarColumn(IsNullable = true, ColumnDescription = "职等")] public string Grade { get; set; } /// /// 职级 /// - [SugarColumn(ColumnDescription = "职级")] + [SugarColumn(IsNullable = true, ColumnDescription = "职级")] public string Title { get; set; } /// /// 卡号 /// - [SugarColumn(ColumnDescription = "卡号", IndexGroupNameList = new[] { "idx_Gainfo_CardNo" })] + [SugarColumn(IsNullable = true, ColumnDescription = "卡号", IndexGroupNameList = new[] { "idx_Gainfo_CardNo" })] public string CardNo { get; set; } /// /// 备注 /// - [SugarColumn(ColumnDescription = "备注")] + [SugarColumn(IsNullable = true, ColumnDescription = "备注")] public string Remark { get; set; } /// /// 人事范围 /// - [SugarColumn(ColumnDescription = "人事范围")] + [SugarColumn(IsNullable = true, ColumnDescription = "人事范围")] public string Werks { get; set; } /// /// 工作地 /// - [SugarColumn(ColumnDescription = "工作地")] + [SugarColumn(IsNullable = false, ColumnDescription = "工作地")] public string Workplace { get; set; } /// /// 厂区 /// [TenantId] - [SugarColumn(ColumnDescription = "厂区")] + [SugarColumn(IsNullable = false, ColumnDescription = "厂区")] public string Factory { get; set; } /// /// 成本中心 /// - [SugarColumn(ColumnDescription = "成本中心")] + [SugarColumn(IsNullable = true, ColumnDescription = "成本中心")] public string CostId { get; set; } /// @@ -186,13 +186,13 @@ public class GainfoEntity : SugarBaseEntity /// /// 身份认证用户Id(如果为空匹配code) /// - [SugarColumn(ColumnDescription = "身份认证用户Id", IsNullable = true)] + [SugarColumn(IsNullable = true, ColumnDescription = "身份认证用户Id")] public int IdentityUserId { get; set; } /// /// 卡类型 /// - [SugarColumn(ColumnDescription = "卡类型", IsNullable = true)] + [SugarColumn(IsNullable = true, ColumnDescription = "卡类型")] public int? CardType { get; set; } } diff --git a/Src/Dlhis.Entity/Basic/Entity/GainfoGroupEntity.cs b/Src/Dlhis.Entity/Basic/Entity/GainfoGroupEntity.cs index 77aee1e4..46d940bc 100644 --- a/Src/Dlhis.Entity/Basic/Entity/GainfoGroupEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/GainfoGroupEntity.cs @@ -2,50 +2,50 @@ using Kurisu.AspNetCore.DataAccess.SqlSugar; using SqlSugar; -namespace Dlhis.Entity.Basic.Entity +namespace Dlhis.Entity.Basic.Entity; + +/// +/// 档案组 +/// +[SugarTable(TableName = "GainfoGroup", TableDescription = "档案组")] +public class GainfoGroupEntity : SugarBaseEntity, ITenantId { /// - /// 档案组 + /// 父级Code /// - [SugarTable(TableName = "GainfoGroup", TableDescription = "档案组")] - public class GainfoGroupEntity : SugarBaseEntity, ITenantId - { - /// - /// 父级Code - /// - public Guid? PCode { get; set; } + [SugarColumn(IsNullable = true)] + public Guid? PCode { get; set; } - /// - /// 分组code - /// - [SugarColumn(ColumnDescription = "分组code")] - public Guid Code { get; set; } + /// + /// 分组code + /// + [SugarColumn(IsNullable = false, ColumnDescription = "分组code")] + public Guid Code { get; set; } - /// - /// 名称 - /// - [SugarColumn(ColumnDescription = "名称")] - public string Name { get; set; } + /// + /// 名称 + /// + [SugarColumn(IsNullable = false, ColumnDescription = "名称")] + public string Name { get; set; } - /// - /// 备注 - /// - [SugarColumn(ColumnDescription = "备注")] - public string Remark { get; set; } + /// + /// 备注 + /// + [SugarColumn(IsNullable = true, ColumnDescription = "备注")] + public string Remark { get; set; } - /// - /// 是否默认分组 - /// - [SugarColumn(ColumnDescription = "是否默认分组", ColumnDataType = "bit", DefaultValue = "1")] - public bool IsDefault { get; set; } = true; + /// + /// 是否默认分组 + /// + [SugarColumn(IsNullable = false, ColumnDescription = "是否默认分组", ColumnDataType = "bit", DefaultValue = "1")] + public bool IsDefault { get; set; } = true; - /// - /// 是否可编辑 - /// - [SugarColumn(ColumnDescription = "是否可编辑", ColumnDataType = "bit", DefaultValue = "1")] - public bool Editable { get; set; } = true; + /// + /// 是否可编辑 + /// + [SugarColumn(IsNullable = false, ColumnDescription = "是否可编辑", ColumnDataType = "bit", DefaultValue = "1")] + public bool Editable { get; set; } = true; - - public string TenantId { get; set; } - } + [SugarColumn(IsNullable = true)] + public string TenantId { get; set; } } \ No newline at end of file diff --git a/Src/Dlhis.Entity/Basic/Entity/GainfoSapEntity.cs b/Src/Dlhis.Entity/Basic/Entity/GainfoSapEntity.cs index 39b143e6..d3207d59 100644 --- a/Src/Dlhis.Entity/Basic/Entity/GainfoSapEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/GainfoSapEntity.cs @@ -1,7 +1,9 @@ -using SqlSugar; +using Microsoft.Extensions.DependencyInjection; +using SqlSugar; namespace Dlhis.Entity.Basic.Entity { + [SkipScan] [SugarTable(TableName = "GainfoSap")] public class GainfoSapEntity { @@ -11,6 +13,7 @@ namespace Dlhis.Entity.Basic.Entity public string @class { get; set; } public string passwd { get; set; } + public string question { get; set; } public string answer { get; set; } @@ -25,6 +28,7 @@ namespace Dlhis.Entity.Basic.Entity public string sex { get; set; } public DateTime birthday { get; set; } public string address { get; set; } + public string postcode { get; set; } public string occupation { get; set; } public string appellation { get; set; } @@ -33,16 +37,24 @@ namespace Dlhis.Entity.Basic.Entity public string fax { get; set; } public string mobile { get; set; } public string email { get; set; } + public string web { get; set; } + public string vip { get; set; } + public string sec { get; set; } + public string cropsno { get; set; } + public string cropname { get; set; } + public string fancy { get; set; } public string remark { get; set; } public int amount { get; set; } + public int days { get; set; } + public decimal consume01 { get; set; } public decimal consume02 { get; set; } @@ -90,12 +102,17 @@ namespace Dlhis.Entity.Basic.Entity public string MASSN { get; set; } public string MNTXT { get; set; } + public string MASSG { get; set; } + public string MGTXT { get; set; } public DateTime? logdate { get; set; } + public DateTime? updatelogdate { get; set; } + public string guestno { get; set; } public string ZZ_KLX { get; set; } + public DateTime? DAT01 { get; set; } public string ZZ_COUNNM { get; set; } diff --git a/Src/Dlhis.Entity/Basic/Entity/WerkEntity.cs b/Src/Dlhis.Entity/Basic/Entity/WerkEntity.cs index d275d96d..01c21c42 100644 --- a/Src/Dlhis.Entity/Basic/Entity/WerkEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/WerkEntity.cs @@ -17,7 +17,7 @@ public class WerkEntity : SugarBaseEntity /// /// 名称 /// - [SugarColumn(IsNullable = false, ColumnDescription = "名称")] + [SugarColumn(ColumnDescription = "名称")] public string Name { get; set; } /// @@ -53,12 +53,12 @@ public class WerkEntity : SugarBaseEntity /// /// 结果 /// - [SugarColumn(IsNullable = false, ColumnDescription = "结果")] + [SugarColumn(IsNullable = true, ColumnDescription = "结果")] public string HandleMessage { get; set; } /// /// 是否启用 /// - [SugarColumn(ColumnDataType = "bit", DefaultValue = "1")] + [SugarColumn(IsNullable = false, ColumnDataType = "bit", DefaultValue = "1")] public bool Enable { get; set; } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Canteen/Entities/BalanceRecordEntity.cs b/Src/Dlhis.Entity/Canteen/Entities/BalanceRecordEntity.cs index a3fdedda..ed889f1a 100644 --- a/Src/Dlhis.Entity/Canteen/Entities/BalanceRecordEntity.cs +++ b/Src/Dlhis.Entity/Canteen/Entities/BalanceRecordEntity.cs @@ -15,138 +15,140 @@ public class BalanceRecordEntity : SugarBaseEntity, ISoftDeleted, ITenantId /// /// 流水号 /// - [SugarColumn(ColumnDescription = "流水号", UniqueGroupNameList = new[] { "Unique_BalanceRecord_No" })] + [SugarColumn(IsNullable = false, ColumnDescription = "流水号", UniqueGroupNameList = new[] { "Unique_BalanceRecord_No" })] public string No { get; set; } /// /// 档案号/QRCode /// - [SugarColumn(ColumnDescription = "档案号/QRCode")] + [SugarColumn(IsNullable = false, ColumnDescription = "档案号/QRCode")] public string UserNo { get; set; } /// /// 姓名 /// - [SugarColumn(ColumnDescription = "姓名")] + [SugarColumn(IsNullable = false, ColumnDescription = "姓名")] public string Name { get; set; } /// /// 学工号 /// - [SugarColumn(ColumnDescription = "学工号")] + [SugarColumn(IsNullable = false, ColumnDescription = "学工号")] public string UserCode { get; set; } /// /// 部门号 /// - [SugarColumn(ColumnDescription = "部门号")] + [SugarColumn(IsNullable = true, ColumnDescription = "部门号")] public string DepartmentNo { get; set; } /// /// 来源 /// - [SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "来源")] + [SugarColumn(IsNullable = false, ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "来源")] public BalanceRecordSourceEnumType Source { get; set; } /// /// 收入/支出 /// - [SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "收入/支出")] + [SugarColumn(IsNullable = false, ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "收入/支出")] public BalanceRecordTypeEnumType Type { get; set; } /// /// 金额 + - 表示 /// - [SugarColumn(ColumnDescription = "金额+-表示")] + [SugarColumn(IsNullable = false, ColumnDescription = "金额+-表示")] public decimal Amount { get; set; } /// /// 营业点 /// - [SugarColumn(ColumnDescription = "营业点", IsNullable = true)] + [SugarColumn(IsNullable = true, ColumnDescription = "营业点")] public Guid? BusinessPlaceCode { get; set; } /// /// 餐别 /// - [SugarColumn(ColumnDescription = "餐别", IsNullable = true)] + [SugarColumn(IsNullable = true, ColumnDescription = "餐别")] public Guid? BusinessShiftCode { get; set; } /// /// 餐次 /// - [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; } /// /// 所属成本日期 /// - [SugarColumn(ColumnDataType = "date", ColumnDescription = "所属成本日期")] + [SugarColumn(IsNullable = false, ColumnDataType = "date", ColumnDescription = "所属成本日期")] public DateTime CostDate { get; set; } /// /// 消费机器唯一信息 /// - [SugarColumn(ColumnDescription = "消费机器唯一信息", IsNullable = true)] + [SugarColumn(IsNullable = true, ColumnDescription = "消费机器唯一信息")] public string DeviceUniqueNo { get; set; } /// /// Ip /// - [SugarColumn(ColumnDescription = "IP")] + [SugarColumn(IsNullable = true, ColumnDescription = "IP")] public string IP { get; set; } /// /// 成本中心 /// - [SugarColumn(ColumnDescription = "成本中心")] + [SugarColumn(IsNullable = true, ColumnDescription = "成本中心")] public string CostId { get; set; } /// /// 消费者所在基地 /// - [SugarColumn(ColumnDescription = "消费者所在基地")] + [SugarColumn(IsNullable = false, ColumnDescription = "消费者所在基地")] public string OriginTenantId { get; set; } /// /// 成本计算是否允许跨基地范围 /// - [SugarColumn(ColumnDataType = "bit", ColumnDescription = "成本计算是否允许跨基地范围")] + [SugarColumn(IsNullable = false, ColumnDataType = "bit", ColumnDescription = "成本计算是否允许跨基地范围")] public bool IsCostCrossTenant { get; set; } /// /// 数据状态 /// - [SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "数据状态")] + [SugarColumn(IsNullable = false, ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "数据状态")] public BalanceRecordStatusEnumType Status { get; set; } /// /// 消费时间 /// - [SugarColumn(ColumnDescription = "消费时间")] + [SugarColumn(IsNullable = false, ColumnDescription = "消费时间")] public DateTime CostDateTime { get; set; } /// /// 备注 /// - [SugarColumn(ColumnDescription = "备注")] + [SugarColumn(IsNullable = true, ColumnDescription = "备注")] public string Remark { get; set; } /// /// 餐饮应用类型 /// - [SugarColumn(ColumnDescription = "餐饮应用类型", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] + [SugarColumn(IsNullable = false, ColumnDescription = "餐饮应用类型", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] public CanteenApplicationTypeEnumType ApplicationType { get; set; } + [SugarColumn(IsNullable = false)] public string TenantId { get; set; } /// /// 人事范围 /// + [SugarColumn(IsNullable = true)] public string Werks { get; set; } - [SugarColumn(ColumnDataType = "bit")] + [SugarColumn(IsNullable = false, ColumnDataType = "bit")] public bool IsDeleted { get; set; } } \ No newline at end of file diff --git a/Src/Dlhis.Entity/Canteen/Entities/CanteenOrderEntity.cs b/Src/Dlhis.Entity/Canteen/Entities/CanteenOrderEntity.cs index 4394049f..a9aa1fbc 100644 --- a/Src/Dlhis.Entity/Canteen/Entities/CanteenOrderEntity.cs +++ b/Src/Dlhis.Entity/Canteen/Entities/CanteenOrderEntity.cs @@ -13,36 +13,36 @@ public class CanteenOrderEntity : BalanceRecordEntity /// /// 请求json /// - [SugarColumn(ColumnDescription = "请求json",ColumnDataType = "varchar(2000)")] + [SugarColumn(IsNullable = true, ColumnDescription = "请求json", ColumnDataType = "varchar(2000)")] public string RequestJson { get; set; } /// /// 第三方订单号 /// - [SugarColumn(ColumnDescription = "第三方订单号")] + [SugarColumn(IsNullable = true,ColumnDescription = "第三方订单号")] public string ThirdNo { get; set; } /// /// 订单状态 /// - [SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "订单状态")] + [SugarColumn(IsNullable = false,ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "订单状态")] public CanteenOrderStatusEnumType OrderStatus { get; set; } /// /// 是否离线数据 /// - [SugarColumn(ColumnDataType = "bit", ColumnDescription = "请求json")] + [SugarColumn(IsNullable = false,ColumnDataType = "bit", ColumnDescription = "请求json")] public bool IsOffline { get; set; } /// /// 配送地址 /// - [SugarColumn(ColumnDescription = "配送地址")] + [SugarColumn(IsNullable = true,ColumnDescription = "配送地址")] public string DeliveryAddress { get; set; } /// /// 处理结果 /// - [SugarColumn(ColumnDescription = "处理结果")] + [SugarColumn(IsNullable = true,ColumnDescription = "处理结果")] public string Result { get; set; } } \ No newline at end of file diff --git a/Src/Dlhis.Entity/Canteen/Entities/DishesCategoryEntity.cs b/Src/Dlhis.Entity/Canteen/Entities/DishesCategoryEntity.cs index 1e980a86..13e2955e 100644 --- a/Src/Dlhis.Entity/Canteen/Entities/DishesCategoryEntity.cs +++ b/Src/Dlhis.Entity/Canteen/Entities/DishesCategoryEntity.cs @@ -16,6 +16,7 @@ public class DishesCategoryEntity : SugarBaseEntity, ITenantId /// /// PCode /// + [SugarColumn(IsNullable = true)] public Guid? PCode { get; set; } /// @@ -38,4 +39,4 @@ public class DishesCategoryEntity : SugarBaseEntity, ITenantId public string TenantId { get; set; } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Canteen/Entities/EMealVoucherDetailEntity.cs b/Src/Dlhis.Entity/Canteen/Entities/EMealVoucherDetailEntity.cs index f353f4e7..52816945 100644 --- a/Src/Dlhis.Entity/Canteen/Entities/EMealVoucherDetailEntity.cs +++ b/Src/Dlhis.Entity/Canteen/Entities/EMealVoucherDetailEntity.cs @@ -13,70 +13,70 @@ public class EMealVoucherDetailEntity : SugarBaseEntity, IVersion /// /// 主表id /// - [SugarColumn(ColumnDescription = "主表id")] + [SugarColumn(IsNullable = false, ColumnDescription = "主表id")] public long VoucherId { get; set; } /// /// 流水号 /// - [SugarColumn(ColumnDescription = "流水号", UniqueGroupNameList = new[] { "idx_EMealVoucherDetail_no_idno" })] + [SugarColumn(IsNullable = false, ColumnDescription = "流水号", UniqueGroupNameList = new[] { "idx_EMealVoucherDetail_no_idno" })] public string No { get; set; } /// /// 人员类型 /// - [SugarColumn(ColumnDescription = "人员类型(新员工/外来人员)")] + [SugarColumn(IsNullable = false, ColumnDescription = "人员类型(新员工/外来人员)")] public string UserType { get; set; } /// /// 身份证 /// - [SugarColumn(ColumnDescription = "证件号", UniqueGroupNameList = new[] { "idx_EMealVoucherDetail_no_idno" })] + [SugarColumn(IsNullable = false, ColumnDescription = "证件号", UniqueGroupNameList = new[] { "idx_EMealVoucherDetail_no_idno" })] public string IdNo { get; set; } /// /// 用餐人 /// - [SugarColumn(ColumnDescription = "用餐人")] + [SugarColumn(IsNullable = false, ColumnDescription = "用餐人")] public string Name { get; set; } /// /// 手机号 /// - [SugarColumn(ColumnDescription = "手机号")] + [SugarColumn(IsNullable = false, ColumnDescription = "手机号")] public string Phone { get; set; } /// /// 就餐开始 /// - [SugarColumn(ColumnDescription = "使用开始", ColumnDataType = "date")] + [SugarColumn(IsNullable = false, ColumnDescription = "使用开始", ColumnDataType = "date")] public DateTime Start { get; set; } /// /// 就餐结束 /// - [SugarColumn(ColumnDescription = "使用结束", ColumnDataType = "date")] + [SugarColumn(IsNullable = false, ColumnDescription = "使用结束", ColumnDataType = "date")] public DateTime End { get; set; } /// /// 金额 /// - [SugarColumn(ColumnDescription = "余额", ColumnDataType = "decimal(16,2)")] + [SugarColumn(IsNullable = false, ColumnDescription = "余额", ColumnDataType = "decimal(16,2)")] public decimal Balance { get; set; } - + /// /// 金额 /// - [SugarColumn(ColumnDescription = "原始余额", ColumnDataType = "decimal(16,2)")] + [SugarColumn(IsNullable = false, ColumnDescription = "原始余额", ColumnDataType = "decimal(16,2)")] public decimal OriginBalance { get; set; } /// /// 版本 /// - [SugarColumn(ColumnDescription = "版本")] + [SugarColumn(IsNullable = false, ColumnDescription = "版本")] public int Version { get; set; } - [SugarColumn(ColumnDataType = "varchar(255)")] + [SugarColumn(IsNullable = true, ColumnDataType = "varchar(255)")] public string Signature { get; set; } } \ No newline at end of file diff --git a/Src/Dlhis.Entity/Canteen/Entities/EMealVoucherEntity.cs b/Src/Dlhis.Entity/Canteen/Entities/EMealVoucherEntity.cs index c13e7ed1..e015507c 100644 --- a/Src/Dlhis.Entity/Canteen/Entities/EMealVoucherEntity.cs +++ b/Src/Dlhis.Entity/Canteen/Entities/EMealVoucherEntity.cs @@ -13,72 +13,72 @@ public class EMealVoucherEntity : SugarBaseEntity /// /// oa流程id /// - [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; } /// /// 标题 /// - [SugarColumn(ColumnDescription = "标题")] + [SugarColumn(IsNullable = false, ColumnDescription = "标题")] public string Title { get; set; } /// /// 申请人工号 /// - [SugarColumn(ColumnDescription = "申请人工号", IndexGroupNameList = new[] { "index_EMealVoucher_Code" })] + [SugarColumn(IsNullable = false, ColumnDescription = "申请人工号", IndexGroupNameList = new[] { "index_EMealVoucher_Code" })] public string Code { get; set; } /// /// 成本中心 /// - [SugarColumn(ColumnDescription = "成本中心")] + [SugarColumn(IsNullable = false, ColumnDescription = "成本中心")] public string CostId { get; set; } /// /// 来宾公司 /// - [SugarColumn(ColumnDescription = "来宾来源")] + [SugarColumn(IsNullable = false, ColumnDescription = "来宾来源")] public string Source { get; set; } /// /// 联系人 /// - [SugarColumn(ColumnDescription = "手机号")] + [SugarColumn(IsNullable = false, ColumnDescription = "手机号")] public string Phone { get; set; } /// /// 来宾人数 /// - [SugarColumn(ColumnDescription = "来宾人数")] + [SugarColumn(IsNullable = false, ColumnDescription = "来宾人数")] public int Number { get; set; } /// /// 就餐事由 /// - [SugarColumn(ColumnDescription = "申请事由")] + [SugarColumn(IsNullable = false, ColumnDescription = "申请事由")] public string Reason { get; set; } /// /// 就餐次 /// - [SugarColumn(ColumnDescription = "就餐次", ColumnDataType = "varchar(500)", IsJson = true)] + [SugarColumn(IsNullable = false, ColumnDescription = "就餐次", ColumnDataType = "varchar(500)", IsJson = true)] public List Shifts { get; set; } /// /// 可消费厂区 /// - [SugarColumn(ColumnDescription = "可消费厂区", ColumnDataType = "varchar(500)", IsJson = true)] + [SugarColumn(IsNullable = false, ColumnDescription = "可消费厂区", ColumnDataType = "varchar(500)", IsJson = true)] public List Factories { get; set; } /// /// 申请日期 /// - [SugarColumn(ColumnDescription = "申请日期")] + [SugarColumn(IsNullable = false, ColumnDescription = "申请日期")] public DateTime Date { get; set; } /// /// 厂区 /// - [SugarColumn(ColumnDescription = "厂区")] + [SugarColumn(IsNullable = false, ColumnDescription = "厂区")] public string Factory { get; set; } } \ No newline at end of file diff --git a/Src/Dlhis.Entity/Canteen/Entities/MealSupplementRecordEntity.cs b/Src/Dlhis.Entity/Canteen/Entities/MealSupplementRecordEntity.cs index 9292d21c..dfa72a6e 100644 --- a/Src/Dlhis.Entity/Canteen/Entities/MealSupplementRecordEntity.cs +++ b/Src/Dlhis.Entity/Canteen/Entities/MealSupplementRecordEntity.cs @@ -26,23 +26,22 @@ public class MealSupplementRecordEntity : MealSupplementRequestRecordEntity /// /// 餐补状态 /// - [SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] + [SugarColumn(IsNullable = false, ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] public MealSupplementStatusEnumtype Status { get; set; } /// /// 处理结果 /// - [SugarColumn(ColumnDescription = "处理结果", ColumnDataType = "varchar(2000)")] + [SugarColumn(IsNullable = true, ColumnDescription = "处理结果", ColumnDataType = "varchar(2000)")] public string Result { get; set; } /// /// 状态同步 /// - [SugarColumn(ColumnDataType = "bit")] + [SugarColumn(IsNullable = false, ColumnDataType = "bit")] public bool Sync { get; set; } } - /// /// 餐补请求记录 /// @@ -78,4 +77,4 @@ public class MealSupplementRequestRecordEntity : SugarBaseEntity /// [SugarColumn(IsNullable = false, ColumnDescription = "餐补")] public decimal Amount { get; set; } -} +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Canteen/Entities/UserBalanceEntity.cs b/Src/Dlhis.Entity/Canteen/Entities/UserBalanceEntity.cs index fe4196ec..1f897d8a 100644 --- a/Src/Dlhis.Entity/Canteen/Entities/UserBalanceEntity.cs +++ b/Src/Dlhis.Entity/Canteen/Entities/UserBalanceEntity.cs @@ -22,6 +22,7 @@ public class UserBalanceEntity : SugarBaseEntity, IVersion [SugarColumn(IsNullable = false, ColumnDescription = "余额")] public decimal Balance { get; set; } - /// + + [SugarColumn(IsNullable = false)] public int Version { get; set; } } \ No newline at end of file diff --git a/Src/Dlhis.Entity/Common/FileVersionEntity.cs b/Src/Dlhis.Entity/Common/FileVersionEntity.cs index 30699d36..006656ca 100644 --- a/Src/Dlhis.Entity/Common/FileVersionEntity.cs +++ b/Src/Dlhis.Entity/Common/FileVersionEntity.cs @@ -30,7 +30,7 @@ public class FileVersionEntity : SugarBaseEntity /// /// 描述信息 /// - [SugarColumn(ColumnDescription = "描述信息")] + [SugarColumn(IsNullable = false, ColumnDescription = "描述信息")] public string Description { get; set; } /// @@ -38,6 +38,4 @@ public class FileVersionEntity : SugarBaseEntity /// [SugarColumn(IsNullable = false, ColumnDescription = "文件地址")] public string Url { get; set; } -} - - +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Device/Entities/DeviceGroupEntity.cs b/Src/Dlhis.Entity/Device/Entities/DeviceGroupEntity.cs index 7aa96cba..16e6c55f 100644 --- a/Src/Dlhis.Entity/Device/Entities/DeviceGroupEntity.cs +++ b/Src/Dlhis.Entity/Device/Entities/DeviceGroupEntity.cs @@ -23,7 +23,7 @@ public class DeviceGroupEntity : SugarBaseEntity, ITenantId, ISoftDeleted /// /// 上级设备组code /// - [SugarColumn(ColumnDescription = "上级设备组code")] + [SugarColumn(IsNullable = true, ColumnDescription = "上级设备组code")] public Guid? PCode { get; set; } /// @@ -37,20 +37,20 @@ public class DeviceGroupEntity : SugarBaseEntity, ITenantId, ISoftDeleted /// /// 设备组名称 /// - [SugarColumn(ColumnDescription = "设备组名称")] + [SugarColumn(IsNullable = false, ColumnDescription = "设备组名称")] public string Name { get; set; } /// /// 是否可编辑 /// - [SugarColumn(ColumnDataType = "bit", DefaultValue = "1", ColumnDescription = "是否可编辑")] + [SugarColumn(IsNullable = false, ColumnDataType = "bit", DefaultValue = "1", ColumnDescription = "是否可编辑")] public bool Editable { get; set; } = true; /// /// 可设置下级 /// - [SugarColumn(ColumnDataType = "bit", DefaultValue = "1")] + [SugarColumn(IsNullable = false, ColumnDataType = "bit", DefaultValue = "1")] public bool AbleSetNext { get; set; } = true; /// @@ -62,16 +62,17 @@ public class DeviceGroupEntity : SugarBaseEntity, ITenantId, ISoftDeleted /// /// 可作为预约分组 /// - [SugarColumn(ColumnDataType = "bit", DefaultValue = "0")] + [SugarColumn(IsNullable = false, ColumnDataType = "bit", DefaultValue = "0")] public bool AsAppointment { get; set; } = false; /// /// 是否为出差分组 /// - [SugarColumn(ColumnDataType = "bit", DefaultValue = "0")] + [SugarColumn(IsNullable = false, ColumnDataType = "bit", DefaultValue = "0")] public bool IsBusinessTrip { get; set; } = false; + [SugarColumn(IsNullable = true)] public string TenantId { get; set; } diff --git a/Src/Dlhis.Entity/Device/Entities/DeviceTaskEntity.cs b/Src/Dlhis.Entity/Device/Entities/DeviceTaskEntity.cs index 79ca66e0..41d69385 100644 --- a/Src/Dlhis.Entity/Device/Entities/DeviceTaskEntity.cs +++ b/Src/Dlhis.Entity/Device/Entities/DeviceTaskEntity.cs @@ -15,7 +15,7 @@ public class DeviceTaskEntity : SugarBaseEntity, ITenantId, IVersion /// /// 任务类型 /// - [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; } /// @@ -44,27 +44,22 @@ public class DeviceTaskEntity : SugarBaseEntity, ITenantId, IVersion /// /// 任务下发状态 /// - [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; } /// /// 数据版本 /// + [SugarColumn(IsNullable = false)] public int Version { get; set; } /// /// 处理结果 /// - [SugarColumn(ColumnDataType = "longtext")] + [SugarColumn(IsNullable = true, ColumnDataType = "longtext")] public string ResultMessage { get; set; } - /// - /// 取消id - /// - [SugarColumn(DefaultValue = "0")] - public long CancellationId { get; set; } = 0; - /// /// 任务来源 /// @@ -74,7 +69,7 @@ public class DeviceTaskEntity : SugarBaseEntity, ITenantId, IVersion /// /// 优先级 /// - [SugarColumn(IsNullable = true, DefaultValue = "0")] + [SugarColumn(IsNullable = false, DefaultValue = "0")] public int Priority { get; set; } = 0; diff --git a/Src/Dlhis.Entity/Device/Entities/DeviceUploadLogEntity.cs b/Src/Dlhis.Entity/Device/Entities/DeviceUploadLogEntity.cs index ffa5a474..10471948 100644 --- a/Src/Dlhis.Entity/Device/Entities/DeviceUploadLogEntity.cs +++ b/Src/Dlhis.Entity/Device/Entities/DeviceUploadLogEntity.cs @@ -49,6 +49,6 @@ public class DeviceUploadLogEntity : SugarBaseEntity, ITenantId public bool Status { get; set; } - [SugarColumn(IndexGroupNameList = new string[] { "idx_DeviceUploadLog_TenantId" })] + [SugarColumn(IndexGroupNameList = new[] { "idx_DeviceUploadLog_TenantId" })] public string TenantId { get; set; } } diff --git a/Src/Dlhis.Entity/Device/Entities/DeviceUploadLogManuallyEntity.cs b/Src/Dlhis.Entity/Device/Entities/DeviceUploadLogManuallyEntity.cs new file mode 100644 index 00000000..6be6f3a0 --- /dev/null +++ b/Src/Dlhis.Entity/Device/Entities/DeviceUploadLogManuallyEntity.cs @@ -0,0 +1,24 @@ +using Kurisu.AspNetCore.DataAccess.Entity; +using Kurisu.AspNetCore.DataAccess.SqlSugar; +using SqlSugar; + +namespace Dlhis.Entity.Device.Entities; + +[SugarTable(TableName = "DeviceUploadLogManually", TableDescription = "设备上传记录")] +public class DeviceUploadLogManuallyEntity : SugarBaseEntity, ITenantId +{ + [SugarColumn(IsNullable = false, IndexGroupNameList = new[] { "idx_DeviceUploadLogManually_deviceNo" })] + public string DeviceNo { get; set; } + + [SugarColumn(IsNullable = false)] + public DateTime Start { get; set; } + + [SugarColumn(IsNullable = false)] + public DateTime End { get; set; } + + [SugarColumn(IsNullable = false, ColumnDataType = "bit")] + public bool IsFinished { get; set; } + + /// + public string TenantId { get; set; } +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/SqlSugarPack.cs b/Src/Dlhis.Entity/SqlSugarPack.cs index 82741972..efc5cd1c 100644 --- a/Src/Dlhis.Entity/SqlSugarPack.cs +++ b/Src/Dlhis.Entity/SqlSugarPack.cs @@ -1,4 +1,5 @@ using Dlhis.Entity.Basic.Entity; +using Dlhis.Entity.Device.Entities; using Kurisu.AspNetCore; using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; 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)) .Where(x => !x.IsDefined(typeof(SkipScanAttribute), false)) .ToArray(); - + db.Client.DbMaintenance.CreateDatabase(); db.Client.CodeFirst.InitTables(tables); diff --git a/Src/Dlhis.Entity/Sys/Entities/MenuEntity.cs b/Src/Dlhis.Entity/Sys/Entities/MenuEntity.cs index 10a70c6e..dd36c54d 100644 --- a/Src/Dlhis.Entity/Sys/Entities/MenuEntity.cs +++ b/Src/Dlhis.Entity/Sys/Entities/MenuEntity.cs @@ -14,76 +14,76 @@ public class MenuEntity : SugarBaseEntity /// /// code /// - [SugarColumn(ColumnDescription = "code")] + [SugarColumn(IsNullable = false, ColumnDescription = "code")] public string Code { get; set; } /// /// 上级 /// - [SugarColumn(ColumnDescription = "上级")] + [SugarColumn(IsNullable = true, ColumnDescription = "上级")] public string PCode { get; set; } /// /// 标题 /// - [SugarColumn(ColumnDescription = "标题")] + [SugarColumn(IsNullable = false, ColumnDescription = "标题")] public string Title { get; set; } /// /// 名称 /// - [SugarColumn(ColumnDescription = "名称")] + [SugarColumn(IsNullable = false, ColumnDescription = "名称")] public string Name { get; set; } /// /// 图标 /// - [SugarColumn(ColumnDescription = "图标")] + [SugarColumn(IsNullable = true, ColumnDescription = "图标")] public string Icon { get; set; } /// /// 路由地址 /// - [SugarColumn(ColumnDescription = "路由地址")] + [SugarColumn(IsNullable = true, ColumnDescription = "路由地址")] public string Route { get; set; } /// /// 权限标识 /// - [SugarColumn(ColumnDescription = "权限标识")] + [SugarColumn(IsNullable = true, ColumnDescription = "权限标识")] public string Permission { get; set; } /// /// 是否为外链 /// - [SugarColumn(ColumnDescription = "是否为外链")] + [SugarColumn(IsNullable = false, ColumnDescription = "是否为外链")] public bool IsLink { get; set; } /// /// 序号 /// - [SugarColumn(ColumnDescription = "序号")] + [SugarColumn(IsNullable = false, ColumnDescription = "序号")] public int Sequence { get; set; } /// /// 是否可见 /// - [SugarColumn(ColumnDescription = "是否可见")] + [SugarColumn(IsNullable = false, ColumnDescription = "是否可见")] public bool Visible { get; set; } /// /// 菜单类型 /// - [SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "菜单类型")] + [SugarColumn(IsNullable = false, ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "菜单类型")] public MenuEnumType MenuType { get; set; } /// /// 平台类型 /// - [SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "平台类型")] + [SugarColumn(IsNullable = false, ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "平台类型")] public PlatformEnumType Platform { get; set; } } \ No newline at end of file diff --git a/Src/Dlhis.Entity/Visitor/Entity/VisitorAppointmentDetailEntity.cs b/Src/Dlhis.Entity/Visitor/Entity/VisitorAppointmentDetailEntity.cs index bf94af3f..ce162ca4 100644 --- a/Src/Dlhis.Entity/Visitor/Entity/VisitorAppointmentDetailEntity.cs +++ b/Src/Dlhis.Entity/Visitor/Entity/VisitorAppointmentDetailEntity.cs @@ -26,11 +26,13 @@ public class VisitorAppointmentDetailEntity : SugarBaseEntity /// /// 证件类型 /// + [SugarColumn(IsNullable = false)] public string IdType { get; set; } /// /// 证件号 /// + [SugarColumn(IsNullable = false)] public string IdNo { get; set; } /// @@ -48,17 +50,19 @@ public class VisitorAppointmentDetailEntity : SugarBaseEntity /// /// 车牌 /// - [SugarColumn(ColumnDescription = "车牌")] + [SugarColumn(IsNullable = true, ColumnDescription = "车牌")] public string LicensePlate { get; set; } /// /// 进入门岗 /// + [SugarColumn(IsNullable = false)] public bool IsEnterDoorArea { get; set; } /// /// 预约门禁区域 /// + [SugarColumn(IsNullable = true)] public string ApplyDoorArea { get; set; } /// @@ -76,34 +80,37 @@ public class VisitorAppointmentDetailEntity : SugarBaseEntity /// /// 是否进入车间 /// + [SugarColumn(IsNullable = false)] public bool IsEnterWorkplace { get; set; } /// /// 申请车间区域 /// - [SugarColumn(ColumnDescription = "车间区域", IsJson = true, DefaultValue = "[]")] + [SugarColumn(IsNullable = true, ColumnDescription = "车间区域", IsJson = true, DefaultValue = "[]")] public List ApplyWorkplaceAreas { get; set; } /// /// 车间访问开始 /// + [SugarColumn(IsNullable = true)] public DateTime? WorkplaceStart { get; set; } /// /// 车间访问结束 /// + [SugarColumn(IsNullable = true)] public DateTime? WorkplaceEnd { get; set; } /// /// 社保照片url /// - [SugarColumn(ColumnDescription = "社保照片url")] + [SugarColumn(IsNullable = true, ColumnDescription = "社保照片url")] public string ImageUrl { get; set; } /// /// 备注 /// - [SugarColumn(ColumnDescription = "备注")] + [SugarColumn(IsNullable = true, ColumnDescription = "备注")] public string Remark { get; set; } /// @@ -117,7 +124,7 @@ public class VisitorAppointmentDetailEntity : SugarBaseEntity /// [SugarColumn(IsNullable = true)] public DateTime? ArrivedTime { get; set; } - + /// /// 强制离场时间 /// diff --git a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Controllers/DeviceUploadLogsController.cs b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Controllers/DeviceUploadLogsController.cs index 57b090ee..4b5233dc 100644 --- a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Controllers/DeviceUploadLogsController.cs +++ b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Controllers/DeviceUploadLogsController.cs @@ -79,4 +79,24 @@ public class DeviceUploadLogsController : ControllerBase { return await _deviceUploadLogService.GetDeviceUploadRecordSettingAsync(deviceNo); } + + /// + /// 手动上传考勤记录 + /// + /// + [HttpPost("manuallyUpload")] + public async Task ManuallyUploadAsync(List logIds) + { + await _deviceUploadLogService.ManuallyUploadAsync(logIds); + } + + /// + /// 手动设置上传考勤时间范围 + /// + /// + [HttpPost("manuallySetTimeInfo")] + public async Task ManuallySetTimeInfoAsync(DeviceUploadLogManuallySetTimeInfoRequest request) + { + await _deviceUploadLogService.ManuallySetTimeInfoAsync(request.DeviceNo, request.Start, request.End); + } } \ No newline at end of file diff --git a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Request/DeviceUploadLogManuallySetTimeInfoRequest.cs b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Request/DeviceUploadLogManuallySetTimeInfoRequest.cs new file mode 100644 index 00000000..884eb2f1 --- /dev/null +++ b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Request/DeviceUploadLogManuallySetTimeInfoRequest.cs @@ -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; } + + /// + public IEnumerable Validate(ValidationContext validationContext) + { + if (Start >= End) + { + yield return new ValidationResult("开始时间不可大于等于结束时间"); + } + } +} \ No newline at end of file diff --git a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Request/SetUploadLogsBeginDateTimeRequest.cs b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Request/SetUploadLogsBeginDateTimeRequest.cs deleted file mode 100644 index e5a65b58..00000000 --- a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Request/SetUploadLogsBeginDateTimeRequest.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Dlhis.ScheduledTask.DeviceUploadLog.Request; - -public class SetUploadLogsBeginDateTimeRequest -{ - /// - /// 设备号不能为空 - /// - [Required(ErrorMessage = "设备号不能为空")] - public string DeviceUniqueNo { get; set; } - - /// - /// 开始时间 - /// - public DateTime Begin { get; set; } -} diff --git a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/IDeviceUploadLogService.cs b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/IDeviceUploadLogService.cs index 1f1e9f4b..791e06ee 100644 --- a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/IDeviceUploadLogService.cs +++ b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/IDeviceUploadLogService.cs @@ -13,7 +13,7 @@ public interface IDeviceUploadLogService : IScopeDependency /// /// Task UploadLogsAsync(List requests); - + /// /// 查询通行记录分页 /// @@ -28,13 +28,30 @@ public interface IDeviceUploadLogService : IScopeDependency /// Task> GetMyRecordsAsync(DeviceUploadLogMyRecordRequest request); + Task QiaoqiaoGaoshiqingAsync(DeviceUploadLogSecretAddRequest request); - - + + /// /// 获取设备记录获取的开始-结束时间 /// /// /// Task GetDeviceUploadRecordSettingAsync(string deviceNo); -} + + /// + /// 手动上传考勤记录 + /// + /// + /// + Task ManuallyUploadAsync(List requestIds); + + /// + /// 手动设置获取记录时间范围 + /// + /// + /// + /// + /// + Task ManuallySetTimeInfoAsync(string deviceNo, DateTime start, DateTime end); +} \ No newline at end of file diff --git a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/Implements/DeviceUploadLogService.cs b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/Implements/DeviceUploadLogService.cs index df2acb6a..d4b38b00 100644 --- a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/Implements/DeviceUploadLogService.cs +++ b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/Implements/DeviceUploadLogService.cs @@ -1,12 +1,13 @@ using Dlhis.Entity.Basic.Entity; using Dlhis.Entity.Device.Entities; using Dlhis.Entity.Device.Enums; +using Dlhis.Jip.Api; +using Dlhis.Jip.Api.Requests; using Dlhis.ScheduledTask.DeviceUploadLog.Request; using Dlhis.ScheduledTask.DeviceUploadLog.Response; using Kurisu.AspNetCore.Authentication.Abstractions; using Kurisu.AspNetCore.CustomClass; using Kurisu.AspNetCore.DataAccess.Dto; -using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.Utils.Extensions; using SqlSugar; @@ -17,11 +18,13 @@ public class DeviceUploadLogService : IDeviceUploadLogService { private readonly IDbContext _dbContext; private readonly ICurrentUser _currentUser; + private readonly IJinkoJipApi _jinkoJipApi; - public DeviceUploadLogService(IDbContext dbContext, ICurrentUser currentUser) + public DeviceUploadLogService(IDbContext dbContext, ICurrentUser currentUser, IJinkoJipApi jinkoJipApi) { _dbContext = dbContext; _currentUser = currentUser; + _jinkoJipApi = jinkoJipApi; } public async Task UploadLogsAsync(List requests) @@ -104,6 +107,64 @@ public class DeviceUploadLogService : IDeviceUploadLogService .ToListAsync(); } + /// + public async Task ManuallyUploadAsync(List requestIds) + { + var existsOther = await _dbContext.Queryable() + .Where(x => requestIds.Contains(x.Id)) + .Where(x => x.Type != DeviceUploadLogTypeEnumType.Attendance) + .AnyAsync(); + + existsOther.ThrowIfTrue("存在非考勤通行记录,无法上传"); + + var requests = await _dbContext.Queryable() + .LeftJoin((x, device) => x.DeviceUniqueNo == device.UniqueNo) + .Where(x => x.Sync == false) + .Where(x => !string.IsNullOrEmpty(x.UserUniqueNo)) + .Where(x => SqlFunc.Subqueryable().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() + .SetColumns(x => x.Sync == true) + .SetColumns(x => x.ModifiedTime == DateTime.Now) + .Where(x => ids.Contains(x.Id)) + .ExecuteCommandAsync(); + } + } + } + } + + /// + public async Task ManuallySetTimeInfoAsync(string deviceNo, DateTime start, DateTime end) + { + var exists = await _dbContext.Queryable().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) { var device = await _dbContext.Queryable().Where(x => x.UniqueNo == request.DeviceUniqueNo).SingleAsync(); @@ -123,7 +184,7 @@ public class DeviceUploadLogService : IDeviceUploadLogService TenantId = device.TenantId, Status = true, CreatedBy = 1, - ModifiedBy = 1, + ModifiedBy = 1 }); } @@ -158,7 +219,7 @@ public class DeviceUploadLogService : IDeviceUploadLogService .LeftJoin((os, x, device) => x.DeviceUniqueNo == device.UniqueNo) .LeftJoin((os, x, device, ga) => os.Code == ga.Code) .LeftJoin((os, x, device, ga, gaSap) => gaSap.Code == os.SapCode) - .WhereIF(request.SearchDateTimePeriod.HasValue(), (os, x) => x.RaiseDateTime >= request.SearchDateTimePeriod.Start + .WhereIF(request.SearchDateTimePeriod.HasValue(), (os, x) => x.RaiseDateTime >= request.SearchDateTimePeriod.Start && x.RaiseDateTime <= request.SearchDateTimePeriod.End) .WhereIF(request.Search.IsPresent(), (os, x, device, ga, gaSap) => x.UserUniqueNo == request.Search @@ -200,7 +261,7 @@ public class DeviceUploadLogService : IDeviceUploadLogService .LeftJoin((x, device, ga) => x.UserUniqueNo == ga.Code) .LeftJoin((x, device, ga, os) => x.UserUniqueNo == os.Code) .LeftJoin((x, device, ga, os, gasap) => gasap.Code == os.SapCode) - .WhereIF(request.SearchDateTimePeriod.HasValue(), x => x.RaiseDateTime >= request.SearchDateTimePeriod.Start + .WhereIF(request.SearchDateTimePeriod.HasValue(), x => x.RaiseDateTime >= request.SearchDateTimePeriod.Start && x.RaiseDateTime <= request.SearchDateTimePeriod.End) .Where((x, device) => x.Type == type && !SqlFunc.IsNullOrEmpty(x.UserUniqueNo)) .WhereIF(request.Sync.HasValue, x => x.Sync == request.Sync) diff --git a/Src/Dlhis.ScheduledTask/Jobs/CreateGetUploadRecordJob.cs b/Src/Dlhis.ScheduledTask/Jobs/CreateGetUploadRecordJob.cs index f43ccec9..433ca81a 100644 --- a/Src/Dlhis.ScheduledTask/Jobs/CreateGetUploadRecordJob.cs +++ b/Src/Dlhis.ScheduledTask/Jobs/CreateGetUploadRecordJob.cs @@ -37,7 +37,6 @@ public class CreateGetUploadRecordJob : BaseJob TenantId = x.TenantId, Version = 0, Type = DeviceTaskEnumType.UploadRecord, - CancellationId = 0, Priority = 50, Source = "定时任务创建设备获取通行记录任务" }).ToList(); diff --git a/Src/Dlhis.ScheduledTask/Properties/launchSettings.json b/Src/Dlhis.ScheduledTask/Properties/launchSettings.json index a6ea1802..93731c83 100644 --- a/Src/Dlhis.ScheduledTask/Properties/launchSettings.json +++ b/Src/Dlhis.ScheduledTask/Properties/launchSettings.json @@ -2,10 +2,12 @@ "profiles": { "Dlhis.ScheduledTask": { "commandName": "Project", + "launchBrowser": true, + "launchUrl": "swagger/index.html", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, - "applicationUrl": "http://*:5010" + "applicationUrl": "http://localhost:5010;http://*:5010;" } } } \ No newline at end of file diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Services/Implements/AssignmentService.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Services/Implements/AssignmentService.cs index 71a7bcd9..1e147899 100644 --- a/Src/Dlhis.ScheduledTask/TaskAssignment/Services/Implements/AssignmentService.cs +++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Services/Implements/AssignmentService.cs @@ -12,7 +12,6 @@ using Newtonsoft.Json.Linq; using Kurisu.AspNetCore.Utils; using Dlhis.ScheduledTask.TaskAssignment.Dto; using Kurisu.AspNetCore.CustomClass; -using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions; using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; namespace Dlhis.ScheduledTask.TaskAssignment.Services.Implements; @@ -153,12 +152,13 @@ public class AssignmentService : IAssignmentService case DeviceTaskEnumType.UploadRecord: { + var timeInfo = deviceUploadInfos[d]; dto.Info = new UploadRecordToDeviceResponse { DateTimePeriod = new DateTimePeriod { - Start = deviceUploadInfos.TryGetValue(d, out var dt) ? (dt ?? DateTime.Now) : DateTime.Now, - End = DateTime.Now.AddDays(1) + Start = timeInfo.Item1, + End = timeInfo.Item2 } }; } @@ -328,15 +328,21 @@ public class AssignmentService : IAssignmentService /// /// /// - private async Task> GetDeviceUploadRecordInfosAsync(List data) + private async Task> GetDeviceUploadRecordInfosAsync(List data) { if (data.All(x => x.Type != DeviceTaskEnumType.UploadRecord)) { - return new Dictionary(); + return new Dictionary(); } var deviceNos = data.Select(x => x.DeviceUniqueNo).Distinct().ToList(); - var result = new Dictionary(deviceNos.Count); + var result = new Dictionary(deviceNos.Count); + + var manualSettings = await _dbContext.Queryable().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() .GroupBy(x => x.DeviceUniqueNo) @@ -347,12 +353,27 @@ public class AssignmentService : IAssignmentService }) .ToListAsync(); + var commonEnd = DateTime.Now.AddDays(1); foreach (var item in deviceNos) { - var logInfo = logInfos.FirstOrDefault(x => x.DeviceUniqueNo == item); - result.Add(item, logInfo?.RaiseDateTime); + var setting = manualSettings.FirstOrDefault(x => x.DeviceNo == item); + 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() + .SetColumns(x => x.IsFinished == true) + .Where(x => manualSettings.Select(p => p.Id).Contains(x.Id)) + .ExecuteCommandAsync(); + return result; }