From 6342dc6e455db957383f2abedc5c4863b6515d85 Mon Sep 17 00:00:00 2001 From: bklLiudl <673013083@qq.com> Date: 星期四, 16 一月 2025 15:39:04 +0800 Subject: [PATCH] Merge branch 'master' into liudl --- Web/src/views/device/deviceInfo/index.vue | 14 +++++++ Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs | 5 ++ Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceInput.cs | 10 +++++ Admin.NET/WCS.Application/Job/LogClearJob.cs | 37 ++++++++++++++++++ 4 files changed, 66 insertions(+), 0 deletions(-) diff --git a/Admin.NET/WCS.Application/Job/LogClearJob.cs b/Admin.NET/WCS.Application/Job/LogClearJob.cs new file mode 100644 index 0000000..0c0f058 --- /dev/null +++ b/Admin.NET/WCS.Application/Job/LogClearJob.cs @@ -0,0 +1,37 @@ +锘縰sing Furion.Schedule; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WCS.Application; +/// <summary> +/// 鏃ュ織娓呯悊浠诲姟 +/// </summary> +[JobDetail("job_logClear", Description = "浠诲姟鏃ュ織娓呯悊浠诲姟", GroupName = "default", Concurrent = false)] +[Daily(TriggerId = "trigger_logClear", Description = "浠诲姟鏃ュ織娓呯悊浠诲姟")] +public class LogClearJob : IJob +{ + private readonly IServiceScopeFactory _scopeFactory; + private readonly ILogger _logger; + + public LogClearJob(IServiceScopeFactory scopeFactory, ILoggerFactory loggerFactory) + { + _scopeFactory = scopeFactory; + _logger = loggerFactory.CreateLogger(CommonConst.SysLogCategoryName); + } + + public async Task ExecuteAsync(JobExecutingContext context, CancellationToken stoppingToken) + { + using var serviceScope = _scopeFactory.CreateScope(); + + var rep = serviceScope.ServiceProvider.GetRequiredService<SqlSugarRepository<WcsTask>>(); + DateTime threeMonthsAgo = DateTime.Now.AddMonths(-3); + await rep.CopyNew().Context.Deleteable<WcsTask>().Where(s => s.CreateTime < threeMonthsAgo).ExecuteCommandAsync(stoppingToken); + await rep.CopyNew().Context.Deleteable<WcsTaskMonitor>().Where(s => s.CreateTime < threeMonthsAgo).ExecuteCommandAsync(stoppingToken); + threeMonthsAgo = DateTime.Now.AddMonths(-6); + await rep.CopyNew().Context.Deleteable<WcsAlarmLog>().Where(s => s.CreateTime < threeMonthsAgo).ExecuteCommandAsync(stoppingToken); + } +} diff --git a/Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceInput.cs b/Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceInput.cs index 8bcd3a2..9414df3 100644 --- a/Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceInput.cs +++ b/Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceInput.cs @@ -361,6 +361,16 @@ /// </summary> public string EndCeng { get; set; } + + /// <summary> + /// 缂犺啘浜や簰 + /// </summary> + public string ChanMo { get; set; } + /// <summary> + /// 鎷嗘ā浜や簰 + /// </summary> + public string ChaiMo { get; set; } + } public class WcsDeviceStartStop diff --git a/Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs b/Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs index c0c19d2..aef96fc 100644 --- a/Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs +++ b/Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs @@ -168,6 +168,11 @@ var (result11, value11) = modUtil.GetPlcDBValue(PLCDataTypeEnum.Short, DbNum, "48"); data.EndCeng = value11.ToString(); + var (result12, value12) = modUtil.GetPlcDBValue(PLCDataTypeEnum.Byte, DbNum, "50"); + data.ChanMo = value12.ToString(); + var (result13, value13) = modUtil.GetPlcDBValue(PLCDataTypeEnum.Byte, DbNum, "51"); + data.ChaiMo = value13.ToString(); + modUtil.Close(); return data; } diff --git a/Web/src/views/device/deviceInfo/index.vue b/Web/src/views/device/deviceInfo/index.vue index 4965b80..3dd560a 100644 --- a/Web/src/views/device/deviceInfo/index.vue +++ b/Web/src/views/device/deviceInfo/index.vue @@ -185,6 +185,16 @@ </el-form-item> </el-col> + <el-col :span="6"> + <el-form-item label="缂犺啘淇″彿"> + <el-input v-model="stationValue.chanMo" disabled style="width: 200px; margin-right: 10px;"></el-input> + </el-form-item> + </el-col> + <el-col :span="6"> + <el-form-item label="鎷嗚啘淇″彿"> + <el-input v-model="stationValue.chaiMo" disabled style="width: 200px; margin-right: 10px;"></el-input> + </el-form-item> + </el-col> </el-row> </el-form> </div> @@ -232,6 +242,10 @@ endPai:'', endLie:'', endCeng:'', + + chanMo:'', + chaiMo:'', + }); -- Gitblit v1.8.0