Browse Source

bug修改

yandaniu 4 days ago
parent
commit
a8463d9157
100 changed files with 201 additions and 23 deletions
  1. BIN
      .vs/ProjectEvaluation/ropin.inspection.api.metadata.v6.1
  2. BIN
      .vs/ProjectEvaluation/ropin.inspection.api.projects.v6.1
  3. BIN
      .vs/Ropin.Inspection.Api/DesignTimeBuild/.dtbcache.v2
  4. BIN
      .vs/Ropin.Inspection.Api/FileContentIndex/0354955f-d894-4211-a0bd-ee09bd279936.vsidx
  5. BIN
      .vs/Ropin.Inspection.Api/FileContentIndex/182cbdfa-6684-4b66-996e-7d6a59e0e7a9.vsidx
  6. BIN
      .vs/Ropin.Inspection.Api/FileContentIndex/5d50e9e9-bc2f-43d9-a701-14bb1588746d.vsidx
  7. BIN
      .vs/Ropin.Inspection.Api/FileContentIndex/5ef02804-9299-4152-9ead-155016bcc1e0.vsidx
  8. BIN
      .vs/Ropin.Inspection.Api/FileContentIndex/72fe1397-a48f-463d-a33b-44dc1b4a8849.vsidx
  9. BIN
      .vs/Ropin.Inspection.Api/FileContentIndex/7e613506-ab52-425a-8f8f-ef641eace347.vsidx
  10. BIN
      .vs/Ropin.Inspection.Api/FileContentIndex/7f02d622-7ee6-4c49-9019-84ec6e560b51.vsidx
  11. BIN
      .vs/Ropin.Inspection.Api/FileContentIndex/8746401a-d6c0-4645-b14e-5f76724f0e5e.vsidx
  12. BIN
      .vs/Ropin.Inspection.Api/FileContentIndex/9eaf3ec7-a104-4f9e-bc1e-3ed7760dc957.vsidx
  13. BIN
      .vs/Ropin.Inspection.Api/FileContentIndex/a68678a8-2980-42ab-aa28-4e73cca27cc0.vsidx
  14. BIN
      .vs/Ropin.Inspection.Api/FileContentIndex/b3f10d97-b95f-49b0-99fb-93e569702fd8.vsidx
  15. BIN
      .vs/Ropin.Inspection.Api/FileContentIndex/bd7015a5-9762-4f6e-8105-68dd54ae8250.vsidx
  16. BIN
      .vs/Ropin.Inspection.Api/FileContentIndex/c813da2f-255e-47b0-a004-135f5b1805d1.vsidx
  17. BIN
      .vs/Ropin.Inspection.Api/FileContentIndex/ead4cd8a-18f6-4323-9e01-b4be5c20ea5b.vsidx
  18. BIN
      .vs/Ropin.Inspection.Api/FileContentIndex/ec7aa74c-5cd2-499b-8dc8-59fcb7af56c8.vsidx
  19. BIN
      .vs/Ropin.Inspection.Api/v17/.futdcache.v2
  20. BIN
      .vs/Ropin.Inspection.Api/v17/.suo
  21. BIN
      .vs/Ropin.Inspection.Api/v17/fileList.bin
  22. BIN
      Ropin.Core.Extensions/bin/Debug/net5.0/Ropin.Core.Extensions.dll
  23. BIN
      Ropin.Core.Extensions/bin/Debug/net5.0/Ropin.Core.Extensions.pdb
  24. BIN
      Ropin.Core.Extensions/bin/Debug/net5.0/Ropin.Inspection.Model.dll
  25. BIN
      Ropin.Core.Extensions/bin/Debug/net5.0/Ropin.Inspection.Model.pdb
  26. BIN
      Ropin.Core.Extensions/bin/Debug/net5.0/Ropin.Inspection.Repository.dll
  27. BIN
      Ropin.Core.Extensions/bin/Debug/net5.0/Ropin.Inspection.Repository.pdb
  28. BIN
      Ropin.Core.Extensions/bin/Debug/net5.0/Ropin.Inspection.Service.dll
  29. BIN
      Ropin.Core.Extensions/bin/Debug/net5.0/Ropin.Inspection.Service.pdb
  30. BIN
      Ropin.Core.Extensions/bin/Debug/net5.0/Ropin.Inspection.Tasks.dll
  31. BIN
      Ropin.Core.Extensions/bin/Debug/net5.0/Ropin.Inspection.Tasks.pdb
  32. BIN
      Ropin.Core.Extensions/obj/Debug/net5.0/Ropin.Core.Extensions.csproj.AssemblyReference.cache
  33. BIN
      Ropin.Core.Extensions/obj/Debug/net5.0/Ropin.Core.Extensions.dll
  34. BIN
      Ropin.Core.Extensions/obj/Debug/net5.0/Ropin.Core.Extensions.pdb
  35. BIN
      Ropin.Environmentally.AlarmService/obj/Debug/net5.0/Ropin.Environmentally.AlarmService.csproj.AssemblyReference.cache
  36. BIN
      Ropin.Environmentally.DcsService/obj/Debug/net5.0/Ropin.Environmentally.DcsService.csproj.AssemblyReference.cache
  37. BIN
      Ropin.Environmentally.LedgeService1/obj/Debug/net5.0/Ropin.Environmentally.LedgeService1.csproj.AssemblyReference.cache
  38. BIN
      Ropin.Environmentally.VideoService/obj/Debug/net5.0/Ropin.Environmentally.VideoService.csproj.AssemblyReference.cache
  39. BIN
      Ropin.Environmentally.WebScada/obj/Debug/net5.0/Ropin.Environmentally.WebScada.csproj.AssemblyReference.cache
  40. BIN
      Ropin.IOT.MqttService/obj/Debug/net5.0/Ropin.IOT.MqttService.csproj.AssemblyReference.cache
  41. 134 0
      Ropin.Inspection.Api/Controllers/SYS/TsysMessageController.cs
  42. 1 1
      Ropin.Inspection.Api/Properties/launchSettings.json
  43. BIN
      Ropin.Inspection.Api/bin/Debug/net5.0/Ropin.Core.Extensions.dll
  44. BIN
      Ropin.Inspection.Api/bin/Debug/net5.0/Ropin.Core.Extensions.pdb
  45. BIN
      Ropin.Inspection.Api/bin/Debug/net5.0/Ropin.Inspection.Api.dll
  46. BIN
      Ropin.Inspection.Api/bin/Debug/net5.0/Ropin.Inspection.Api.pdb
  47. 7 0
      Ropin.Inspection.Api/bin/Debug/net5.0/Ropin.Inspection.Api.xml
  48. BIN
      Ropin.Inspection.Api/bin/Debug/net5.0/Ropin.Inspection.Model.dll
  49. BIN
      Ropin.Inspection.Api/bin/Debug/net5.0/Ropin.Inspection.Model.pdb
  50. BIN
      Ropin.Inspection.Api/bin/Debug/net5.0/Ropin.Inspection.Repository.dll
  51. BIN
      Ropin.Inspection.Api/bin/Debug/net5.0/Ropin.Inspection.Repository.pdb
  52. BIN
      Ropin.Inspection.Api/bin/Debug/net5.0/Ropin.Inspection.Service.dll
  53. BIN
      Ropin.Inspection.Api/bin/Debug/net5.0/Ropin.Inspection.Service.pdb
  54. BIN
      Ropin.Inspection.Api/bin/Debug/net5.0/Ropin.Inspection.Tasks.dll
  55. BIN
      Ropin.Inspection.Api/bin/Debug/net5.0/Ropin.Inspection.Tasks.pdb
  56. 0 0
      Ropin.Inspection.Api/bin/Debug/net5.0/logs/2025/202505/20250526.txt
  57. 0 0
      Ropin.Inspection.Api/bin/Debug/net5.0/logs/2025/202505/20250526_error.txt
  58. 0 0
      Ropin.Inspection.Api/bin/Debug/net5.0/logs/2025/202505/20250527.txt
  59. 0 0
      Ropin.Inspection.Api/bin/Debug/net5.0/logs/2025/202505/20250527_error.txt
  60. BIN
      Ropin.Inspection.Api/obj/Debug/net5.0/Ropin.Inspection.Api.csproj.AssemblyReference.cache
  61. BIN
      Ropin.Inspection.Api/obj/Debug/net5.0/Ropin.Inspection.Api.dll
  62. BIN
      Ropin.Inspection.Api/obj/Debug/net5.0/Ropin.Inspection.Api.pdb
  63. 7 0
      Ropin.Inspection.Api/obj/Debug/net5.0/Ropin.Inspection.Api.xml
  64. BIN
      Ropin.Inspection.Api/obj/Debug/net5.0/ref/Ropin.Inspection.Api.dll
  65. BIN
      Ropin.Inspection.Api/obj/Debug/net5.0/refint/Ropin.Inspection.Api.dll
  66. 1 0
      Ropin.Inspection.Model/TdevDevSpotViewModel.cs
  67. 5 0
      Ropin.Inspection.Model/ViewModel/SYS/TsysMessageSearchModel.cs
  68. BIN
      Ropin.Inspection.Model/bin/Debug/net5.0/Ropin.Inspection.Model.dll
  69. BIN
      Ropin.Inspection.Model/bin/Debug/net5.0/Ropin.Inspection.Model.pdb
  70. BIN
      Ropin.Inspection.Model/obj/Debug/net5.0/Ropin.Inspection.Model.dll
  71. BIN
      Ropin.Inspection.Model/obj/Debug/net5.0/Ropin.Inspection.Model.pdb
  72. BIN
      Ropin.Inspection.Model/obj/Debug/net5.0/ref/Ropin.Inspection.Model.dll
  73. BIN
      Ropin.Inspection.Model/obj/Debug/net5.0/refint/Ropin.Inspection.Model.dll
  74. 3 1
      Ropin.Inspection.Repository/ITdevDevSpotRepository.cs
  75. 36 1
      Ropin.Inspection.Repository/TdevDevSpotRepository.cs
  76. 1 1
      Ropin.Inspection.Repository/TmtnRepairOrderRepository.cs
  77. BIN
      Ropin.Inspection.Repository/bin/Debug/net5.0/Ropin.Inspection.Model.dll
  78. BIN
      Ropin.Inspection.Repository/bin/Debug/net5.0/Ropin.Inspection.Model.pdb
  79. BIN
      Ropin.Inspection.Repository/bin/Debug/net5.0/Ropin.Inspection.Repository.dll
  80. BIN
      Ropin.Inspection.Repository/bin/Debug/net5.0/Ropin.Inspection.Repository.pdb
  81. BIN
      Ropin.Inspection.Repository/obj/Debug/net5.0/Ropin.Inspection.Repository.csproj.AssemblyReference.cache
  82. BIN
      Ropin.Inspection.Repository/obj/Debug/net5.0/Ropin.Inspection.Repository.dll
  83. BIN
      Ropin.Inspection.Repository/obj/Debug/net5.0/Ropin.Inspection.Repository.pdb
  84. BIN
      Ropin.Inspection.Repository/obj/Debug/net5.0/ref/Ropin.Inspection.Repository.dll
  85. BIN
      Ropin.Inspection.Repository/obj/Debug/net5.0/refint/Ropin.Inspection.Repository.dll
  86. 5 0
      Ropin.Inspection.Service/TAIC/TaicAIBoxTemplateService.cs
  87. 1 19
      Ropin.Inspection.Service/TdevDevSpotService.cs
  88. BIN
      Ropin.Inspection.Service/bin/Debug/net5.0/Ropin.Inspection.Model.dll
  89. BIN
      Ropin.Inspection.Service/bin/Debug/net5.0/Ropin.Inspection.Model.pdb
  90. BIN
      Ropin.Inspection.Service/bin/Debug/net5.0/Ropin.Inspection.Repository.dll
  91. BIN
      Ropin.Inspection.Service/bin/Debug/net5.0/Ropin.Inspection.Repository.pdb
  92. BIN
      Ropin.Inspection.Service/bin/Debug/net5.0/Ropin.Inspection.Service.dll
  93. BIN
      Ropin.Inspection.Service/bin/Debug/net5.0/Ropin.Inspection.Service.pdb
  94. BIN
      Ropin.Inspection.Service/obj/Debug/net5.0/Ropin.Inspection.Service.csproj.AssemblyReference.cache
  95. BIN
      Ropin.Inspection.Service/obj/Debug/net5.0/Ropin.Inspection.Service.dll
  96. BIN
      Ropin.Inspection.Service/obj/Debug/net5.0/Ropin.Inspection.Service.pdb
  97. BIN
      Ropin.Inspection.Service/obj/Debug/net5.0/ref/Ropin.Inspection.Service.dll
  98. BIN
      Ropin.Inspection.Service/obj/Debug/net5.0/refint/Ropin.Inspection.Service.dll
  99. BIN
      Ropin.Inspection.Tasks/bin/Debug/net5.0/Ropin.Inspection.Model.dll
  100. BIN
      Ropin.Inspection.Tasks/bin/Debug/net5.0/Ropin.Inspection.Model.pdb

BIN
.vs/ProjectEvaluation/ropin.inspection.api.metadata.v6.1


BIN
.vs/ProjectEvaluation/ropin.inspection.api.projects.v6.1


BIN
.vs/Ropin.Inspection.Api/DesignTimeBuild/.dtbcache.v2


BIN
.vs/Ropin.Inspection.Api/FileContentIndex/272fa97f-151d-42d7-9b30-a5b721f0e12e.vsidx → .vs/Ropin.Inspection.Api/FileContentIndex/0354955f-d894-4211-a0bd-ee09bd279936.vsidx


BIN
.vs/Ropin.Inspection.Api/FileContentIndex/b2818a66-640a-4243-bf10-84c08bc1cbaf.vsidx → .vs/Ropin.Inspection.Api/FileContentIndex/182cbdfa-6684-4b66-996e-7d6a59e0e7a9.vsidx


BIN
.vs/Ropin.Inspection.Api/FileContentIndex/1a436f50-4237-4733-a22c-195a9c4c5240.vsidx → .vs/Ropin.Inspection.Api/FileContentIndex/5d50e9e9-bc2f-43d9-a701-14bb1588746d.vsidx


BIN
.vs/Ropin.Inspection.Api/FileContentIndex/ae8531a7-7acc-4e11-b033-39919e638061.vsidx → .vs/Ropin.Inspection.Api/FileContentIndex/5ef02804-9299-4152-9ead-155016bcc1e0.vsidx


BIN
.vs/Ropin.Inspection.Api/FileContentIndex/c8298533-c07f-4e68-93d7-b41eef03b2a4.vsidx → .vs/Ropin.Inspection.Api/FileContentIndex/72fe1397-a48f-463d-a33b-44dc1b4a8849.vsidx


BIN
.vs/Ropin.Inspection.Api/FileContentIndex/2bb81cb6-9ed5-47de-9954-53d35c3bb603.vsidx → .vs/Ropin.Inspection.Api/FileContentIndex/7e613506-ab52-425a-8f8f-ef641eace347.vsidx


BIN
.vs/Ropin.Inspection.Api/FileContentIndex/7f02d622-7ee6-4c49-9019-84ec6e560b51.vsidx


BIN
.vs/Ropin.Inspection.Api/FileContentIndex/8746401a-d6c0-4645-b14e-5f76724f0e5e.vsidx


BIN
.vs/Ropin.Inspection.Api/FileContentIndex/9eaf3ec7-a104-4f9e-bc1e-3ed7760dc957.vsidx


BIN
.vs/Ropin.Inspection.Api/FileContentIndex/a68678a8-2980-42ab-aa28-4e73cca27cc0.vsidx


BIN
.vs/Ropin.Inspection.Api/FileContentIndex/9f467121-c0f9-45bf-8116-92a5e2507064.vsidx → .vs/Ropin.Inspection.Api/FileContentIndex/b3f10d97-b95f-49b0-99fb-93e569702fd8.vsidx


BIN
.vs/Ropin.Inspection.Api/FileContentIndex/bd7015a5-9762-4f6e-8105-68dd54ae8250.vsidx


BIN
.vs/Ropin.Inspection.Api/FileContentIndex/751d5c04-6495-4a06-956a-9eeaf72de663.vsidx → .vs/Ropin.Inspection.Api/FileContentIndex/c813da2f-255e-47b0-a004-135f5b1805d1.vsidx


BIN
.vs/Ropin.Inspection.Api/FileContentIndex/eec2ca37-12c9-4b76-a50b-e47c001a190a.vsidx → .vs/Ropin.Inspection.Api/FileContentIndex/ead4cd8a-18f6-4323-9e01-b4be5c20ea5b.vsidx


BIN
.vs/Ropin.Inspection.Api/FileContentIndex/8b8e09eb-1fd9-47af-b862-706794f10466.vsidx → .vs/Ropin.Inspection.Api/FileContentIndex/ec7aa74c-5cd2-499b-8dc8-59fcb7af56c8.vsidx


BIN
.vs/Ropin.Inspection.Api/v17/.futdcache.v2


BIN
.vs/Ropin.Inspection.Api/v17/.suo


BIN
.vs/Ropin.Inspection.Api/v17/fileList.bin


BIN
Ropin.Core.Extensions/bin/Debug/net5.0/Ropin.Core.Extensions.dll


BIN
Ropin.Core.Extensions/bin/Debug/net5.0/Ropin.Core.Extensions.pdb


BIN
Ropin.Core.Extensions/bin/Debug/net5.0/Ropin.Inspection.Model.dll


BIN
Ropin.Core.Extensions/bin/Debug/net5.0/Ropin.Inspection.Model.pdb


BIN
Ropin.Core.Extensions/bin/Debug/net5.0/Ropin.Inspection.Repository.dll


BIN
Ropin.Core.Extensions/bin/Debug/net5.0/Ropin.Inspection.Repository.pdb


BIN
Ropin.Core.Extensions/bin/Debug/net5.0/Ropin.Inspection.Service.dll


BIN
Ropin.Core.Extensions/bin/Debug/net5.0/Ropin.Inspection.Service.pdb


BIN
Ropin.Core.Extensions/bin/Debug/net5.0/Ropin.Inspection.Tasks.dll


BIN
Ropin.Core.Extensions/bin/Debug/net5.0/Ropin.Inspection.Tasks.pdb


BIN
Ropin.Core.Extensions/obj/Debug/net5.0/Ropin.Core.Extensions.csproj.AssemblyReference.cache


BIN
Ropin.Core.Extensions/obj/Debug/net5.0/Ropin.Core.Extensions.dll


BIN
Ropin.Core.Extensions/obj/Debug/net5.0/Ropin.Core.Extensions.pdb


BIN
Ropin.Environmentally.AlarmService/obj/Debug/net5.0/Ropin.Environmentally.AlarmService.csproj.AssemblyReference.cache


BIN
Ropin.Environmentally.DcsService/obj/Debug/net5.0/Ropin.Environmentally.DcsService.csproj.AssemblyReference.cache


BIN
Ropin.Environmentally.LedgeService1/obj/Debug/net5.0/Ropin.Environmentally.LedgeService1.csproj.AssemblyReference.cache


BIN
Ropin.Environmentally.VideoService/obj/Debug/net5.0/Ropin.Environmentally.VideoService.csproj.AssemblyReference.cache


BIN
Ropin.Environmentally.WebScada/obj/Debug/net5.0/Ropin.Environmentally.WebScada.csproj.AssemblyReference.cache


BIN
Ropin.IOT.MqttService/obj/Debug/net5.0/Ropin.IOT.MqttService.csproj.AssemblyReference.cache


+ 134 - 0
Ropin.Inspection.Api/Controllers/SYS/TsysMessageController.cs

@@ -1,11 +1,17 @@
 using Castle.Core.Internal;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.Logging;
+using NPOI.SS.UserModel;
+using NPOI.XSSF.UserModel;
 using Ropin.Inspection.Api.Common;
+using Ropin.Inspection.Common.Helper;
+using Ropin.Inspection.Common;
 using Ropin.Inspection.Model;
+using Ropin.Inspection.Model.Common;
 using Ropin.Inspection.Service;
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
 using System.Threading.Tasks;
 
@@ -204,6 +210,134 @@ namespace Ropin.Inspection.Api.Controllers
             return new ApiResult(ReturnCode.Success);
         }
 
+        /// <summary>
+        /// 发送邮件(附件为报警记录)
+        /// </summary>
+        /// <param name="searchModel"></param>
+        /// <returns></returns>
+        [HttpPost("SendMessageToEmail")]
+        public async Task SendMessageToEmail(SendMessageToEmailModel searchModel)
+        {
+            if (searchModel == null)
+            {
+                return;
+            }
+            try
+            {
+                TsysMessageSearchModel tsysMessage = new TsysMessageSearchModel
+                {
+                    IsPagination = false,
+                    C_PushMsgToCode= searchModel.C_PushMsgToCode,
+                    C_StoreCode = searchModel.C_StoreCode,
+                    C_DevCode = searchModel.C_DevCode,
+                    C_MsgTypeCode = searchModel.C_MsgTypeCode,
+                    MsgTypeList = searchModel.MsgTypeList,
+                    C_Content = searchModel.C_Content,
+                    I_GenerationType = searchModel.I_GenerationType,
+                    MsgStatus = searchModel.MsgStatus,
+                    C_Status = searchModel.C_Status,
+                    BeginTime = searchModel.BeginTime,
+                    EndTime = searchModel.EndTime,
+                };
+                var contentList = await _TsysMessageService.GetConditionScreenAsync(tsysMessage);
+                var pushMsg = contentList.Select(x => x.PushMsg).ToList();
+
+                IWorkbook workbook = new XSSFWorkbook();
+                ISheet sheet = workbook.CreateSheet("sheet1");
+                sheet.AddMergedRegion(new NPOI.SS.Util.CellRangeAddress(0, 0, 0, 6));
+                var titleRow = sheet.CreateRow(0);
+                titleRow.Height = 20 * 25;
+                ICell titleCell = titleRow.CreateCell(0);
+                titleCell.SetCellValue("设备报警记录");
+                //第一行字体样式
+                IFont font = workbook.CreateFont();
+                font.IsBold = true;
+                font.FontHeightInPoints = 16;
+                font.FontName = "宋体";
+                ICellStyle titleCellStyle = workbook.CreateCellStyle();
+                titleCellStyle.SetFont(font);
+                titleCellStyle.Alignment = HorizontalAlignment.Center;  //字体居中
+                                                                        //边框
+                titleCellStyle.BorderBottom = BorderStyle.Thin;
+                titleCellStyle.BorderLeft = BorderStyle.Thin;
+                titleCellStyle.BorderRight = BorderStyle.Thin;
+                titleCellStyle.BorderTop = BorderStyle.Thin;
+                titleCell.CellStyle = titleCellStyle;
+
+                var headRow = sheet.CreateRow(1);
+                headRow.CreateCell(0).SetCellValue("设备名称");
+                headRow.CreateCell(1).SetCellValue("设备编号");
+                headRow.CreateCell(2).SetCellValue("报警时间");
+                headRow.CreateCell(3).SetCellValue("报警类型");
+                headRow.CreateCell(4).SetCellValue("报警内容");
+                headRow.CreateCell(5).SetCellValue("报警来源");
+                //第二行,列名
+                IFont font1 = workbook.CreateFont();
+                font1.IsBold = true;
+                font1.FontHeightInPoints = 12;
+                font1.FontName = "宋体";
+                ICellStyle headCellStyle = workbook.CreateCellStyle();
+                headCellStyle.SetFont(font1);
+                //边框
+                headCellStyle.BorderBottom = BorderStyle.Thin;
+                headCellStyle.BorderLeft = BorderStyle.Thin;
+                headCellStyle.BorderRight = BorderStyle.Thin;
+                headCellStyle.BorderTop = BorderStyle.Thin;
+                foreach (var item in headRow.Cells)
+                {
+                    item.CellStyle = headCellStyle;
+                }
+
+                int start = 2;
+                IFont font3 = workbook.CreateFont();
+                font3.FontHeightInPoints = 9;
+                font3.FontName = "宋体";
+                ICellStyle contentCellStyle = workbook.CreateCellStyle();
+                contentCellStyle.SetFont(font3);
+                //边框
+                contentCellStyle.BorderBottom = BorderStyle.Thin;
+                contentCellStyle.BorderLeft = BorderStyle.Thin;
+                contentCellStyle.BorderRight = BorderStyle.Thin;
+                contentCellStyle.BorderTop = BorderStyle.Thin;
+                foreach (var item in pushMsg)
+                {
+                    var row = sheet.CreateRow(start);
+                    row.CreateCell(0).SetCellValue(item.DevName);
+                    row.CreateCell(1).SetCellValue(item.DevNumber);
+                    row.CreateCell(2).SetCellValue(item.CreateOn);
+                    row.CreateCell(3).SetCellValue(item.Subject);
+                    row.CreateCell(4).SetCellValue(item.Msg);
+                    row.CreateCell(5).SetCellValue(!string.IsNullOrEmpty(item.UserName) ? item.UserName : "");
+                    start++;
+                    foreach (var cell in row.Cells)
+                    {
+                        cell.CellStyle = contentCellStyle;
+                    }
+                }
+                // 自适应单元格
+                for (int i = 0; i < sheet.LastRowNum; i++)
+                {
+                    sheet.AutoSizeRow(i);
+                }
+                for (int i = 0; i < 7; i++)
+                {
+                    sheet.AutoSizeColumn(i, true);
+                }
+                using (var stream = new NpoiMemoryStream())
+                {
+
+                    workbook.Write(stream);
+                    stream.Seek(0, SeekOrigin.Begin);
+                    string emailName = $"{searchModel.DevName} 设备报警记录报表 {searchModel.BeginTime?.ToString("yyyy-MM-dd HH:mm:ss")}至{searchModel.EndTime?.ToString("yyyy-MM-dd HH:mm:ss")}";
+                    EmailHelper.SendEmail(searchModel.Mails, emailName, "", "报表见附件", $"{emailName}.xlsx", "application/vnd.ms-excel", stream);
+                }
+            }
+            catch (Exception ex)
+            {
+                throw;
+            }
+        }
+
     }
 }
 

+ 1 - 1
Ropin.Inspection.Api/Properties/launchSettings.json

@@ -13,7 +13,7 @@
       "launchBrowser": true,
       "launchUrl": "swagger",
       "environmentVariables": {
-        "ASPNETCORE_ENVIRONMENT": "Development" //Production
+        "ASPNETCORE_ENVIRONMENT": "Production" //Production
       },
       "dotnetRunMessages": "true",
       "applicationUrl": "http://localhost:5000"

BIN
Ropin.Inspection.Api/bin/Debug/net5.0/Ropin.Core.Extensions.dll


BIN
Ropin.Inspection.Api/bin/Debug/net5.0/Ropin.Core.Extensions.pdb


BIN
Ropin.Inspection.Api/bin/Debug/net5.0/Ropin.Inspection.Api.dll


BIN
Ropin.Inspection.Api/bin/Debug/net5.0/Ropin.Inspection.Api.pdb


+ 7 - 0
Ropin.Inspection.Api/bin/Debug/net5.0/Ropin.Inspection.Api.xml

@@ -2675,6 +2675,13 @@
             <param name="msgStstus"></param>
             <returns></returns>
         </member>
+        <member name="M:Ropin.Inspection.Api.Controllers.TsysMessageController.SendMessageToEmail(Ropin.Inspection.Model.SendMessageToEmailModel)">
+            <summary>
+            发送邮件(附件为报警记录)
+            </summary>
+            <param name="searchModel"></param>
+            <returns></returns>
+        </member>
         <member name="M:Ropin.Inspection.Api.Controllers.TsysOrganizeController.#ctor(Ropin.Inspection.Service.Interface.ITsysOrganizeService,Microsoft.Extensions.Logging.ILogger{Ropin.Inspection.Api.Controllers.TsysOrganizeController},Ropin.Inspection.Service.ITpntStoreOrgService,Ropin.Inspection.Service.Interface.ITsysUserService,Ropin.Inspection.Service.ITdevDevStoreService)">
             <summary>
             构造函数

BIN
Ropin.Inspection.Api/bin/Debug/net5.0/Ropin.Inspection.Model.dll


BIN
Ropin.Inspection.Api/bin/Debug/net5.0/Ropin.Inspection.Model.pdb


BIN
Ropin.Inspection.Api/bin/Debug/net5.0/Ropin.Inspection.Repository.dll


BIN
Ropin.Inspection.Api/bin/Debug/net5.0/Ropin.Inspection.Repository.pdb


BIN
Ropin.Inspection.Api/bin/Debug/net5.0/Ropin.Inspection.Service.dll


BIN
Ropin.Inspection.Api/bin/Debug/net5.0/Ropin.Inspection.Service.pdb


BIN
Ropin.Inspection.Api/bin/Debug/net5.0/Ropin.Inspection.Tasks.dll


BIN
Ropin.Inspection.Api/bin/Debug/net5.0/Ropin.Inspection.Tasks.pdb


+ 0 - 0
Ropin.Inspection.Api/bin/Debug/net5.0/logs/2025/202505/20250526.txt


+ 0 - 0
Ropin.Inspection.Api/bin/Debug/net5.0/logs/2025/202505/20250526_error.txt


+ 0 - 0
Ropin.Inspection.Api/bin/Debug/net5.0/logs/2025/202505/20250527.txt


+ 0 - 0
Ropin.Inspection.Api/bin/Debug/net5.0/logs/2025/202505/20250527_error.txt


BIN
Ropin.Inspection.Api/obj/Debug/net5.0/Ropin.Inspection.Api.csproj.AssemblyReference.cache


BIN
Ropin.Inspection.Api/obj/Debug/net5.0/Ropin.Inspection.Api.dll


BIN
Ropin.Inspection.Api/obj/Debug/net5.0/Ropin.Inspection.Api.pdb


+ 7 - 0
Ropin.Inspection.Api/obj/Debug/net5.0/Ropin.Inspection.Api.xml

@@ -2675,6 +2675,13 @@
             <param name="msgStstus"></param>
             <returns></returns>
         </member>
+        <member name="M:Ropin.Inspection.Api.Controllers.TsysMessageController.SendMessageToEmail(Ropin.Inspection.Model.SendMessageToEmailModel)">
+            <summary>
+            发送邮件(附件为报警记录)
+            </summary>
+            <param name="searchModel"></param>
+            <returns></returns>
+        </member>
         <member name="M:Ropin.Inspection.Api.Controllers.TsysOrganizeController.#ctor(Ropin.Inspection.Service.Interface.ITsysOrganizeService,Microsoft.Extensions.Logging.ILogger{Ropin.Inspection.Api.Controllers.TsysOrganizeController},Ropin.Inspection.Service.ITpntStoreOrgService,Ropin.Inspection.Service.Interface.ITsysUserService,Ropin.Inspection.Service.ITdevDevStoreService)">
             <summary>
             构造函数

BIN
Ropin.Inspection.Api/obj/Debug/net5.0/ref/Ropin.Inspection.Api.dll


BIN
Ropin.Inspection.Api/obj/Debug/net5.0/refint/Ropin.Inspection.Api.dll


+ 1 - 0
Ropin.Inspection.Model/TdevDevSpotViewModel.cs

@@ -11,6 +11,7 @@ namespace Ropin.Inspection.Model
         public string C_ID { get; set; }
         public string C_DevStoreCode { get; set; }
         public string C_SpotCode { get; set; }
+        public string C_SpotName { get; set; }
         public string C_Remark { get; set; }
         public Guid C_CreateBy { get; set; }
         public DateTime D_CreateOn { get; set; }

+ 5 - 0
Ropin.Inspection.Model/ViewModel/SYS/TsysMessageSearchModel.cs

@@ -28,4 +28,9 @@ namespace Ropin.Inspection.Model
         public string C_MessageCode { get; set; }
         public string C_Status { get; set; }
     }
+    public class SendMessageToEmailModel : TsysMessageSearchModel
+    {
+        public string DevName { get; set; }
+        public List<string> Mails { get; set; }
+    }
 }

BIN
Ropin.Inspection.Model/bin/Debug/net5.0/Ropin.Inspection.Model.dll


BIN
Ropin.Inspection.Model/bin/Debug/net5.0/Ropin.Inspection.Model.pdb


BIN
Ropin.Inspection.Model/obj/Debug/net5.0/Ropin.Inspection.Model.dll


BIN
Ropin.Inspection.Model/obj/Debug/net5.0/Ropin.Inspection.Model.pdb


BIN
Ropin.Inspection.Model/obj/Debug/net5.0/ref/Ropin.Inspection.Model.dll


BIN
Ropin.Inspection.Model/obj/Debug/net5.0/refint/Ropin.Inspection.Model.dll


+ 3 - 1
Ropin.Inspection.Repository/ITdevDevSpotRepository.cs

@@ -1,4 +1,5 @@
-using Ropin.Inspection.Model.Entities;
+using Ropin.Inspection.Model;
+using Ropin.Inspection.Model.Entities;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -10,5 +11,6 @@ namespace Ropin.Inspection.Repository
     public interface ITdevDevSpotRepository : IRepositoryBase<TDEV_DevSpot>, IRepositoryBaseById<TDEV_DevSpot, Guid>
     {
         Task<int> DeleteByDevIdAsync(string devId);
+        Task<IEnumerable<TdevDevSpotViewModel>> GetList(TdevDevSpotSearchModel searchModel);
     }
 }

+ 36 - 1
Ropin.Inspection.Repository/TdevDevSpotRepository.cs

@@ -1,4 +1,5 @@
-using Ropin.Inspection.Model.Entities;
+using Ropin.Inspection.Model;
+using Ropin.Inspection.Model.Entities;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -20,5 +21,39 @@ namespace Ropin.Inspection.Repository
             return Task.FromResult(result);
         }
 
+        public Task<IEnumerable<TdevDevSpotViewModel>> GetList(TdevDevSpotSearchModel searchModel)
+        {
+            MySqlConnector.MySqlParameter[] parameters = new[] {
+                new MySqlConnector.MySqlParameter("devStoreCode", searchModel.C_DevStoreCode),
+                new MySqlConnector.MySqlParameter("spotCode", searchModel.C_SpotCode),
+                new MySqlConnector.MySqlParameter("Id", searchModel.C_ID)
+            };
+            StringBuilder sql = new StringBuilder();
+            sql.Append(@" SELECT * FROM (
+SELECT ds.*,s.C_Name as C_SpotName FROM TDEV_DevSpot ds
+LEFT JOIN TISP_Spot s ON (ds.C_SpotCode=s.C_Code)
+) tab WHERE 1=1
+");
+            if (!string.IsNullOrEmpty(searchModel.C_DevStoreCode))
+            {
+                sql.Append(" AND C_DevStoreCode=@devStoreCode ");
+            }
+            if (!string.IsNullOrEmpty(searchModel.C_SpotCode))
+            {
+                sql.Append(" AND C_SpotCode=@spotCode ");
+            }
+            if (!string.IsNullOrEmpty(searchModel.C_ID))
+            {
+                sql.Append(" AND C_ID=@Id ");
+            }
+            sql.Append(" order by D_CreateOn desc ");
+            IEnumerable<TdevDevSpotViewModel> recordItemlist = EntityFrameworkCoreExtensions.GetList<TdevDevSpotViewModel>(DbContext.Database, sql.ToString(), parameters);
+            searchModel.TotalCount = recordItemlist.First() != null ? recordItemlist.ToList().Count : 0;
+            if (searchModel.TotalCount == 0)
+            {
+                recordItemlist = new List<TdevDevSpotViewModel>();
+            }
+            return Task.FromResult(searchModel.IsPagination ? recordItemlist.Skip((searchModel.PageIndex - 1) * searchModel.PageSize).Take(searchModel.PageSize) : recordItemlist);
+        }
     }
 }

+ 1 - 1
Ropin.Inspection.Repository/TmtnRepairOrderRepository.cs

@@ -189,7 +189,7 @@ INNER JOIN TMTN_RepairOrder B ON B.C_DevStoreCode = A.C_ID WHERE A.C_StoreCode =
 SELECT A.*,F.C_Url AS DevStoreImage,F.C_Name AS DevName,F.C_NumberCode AS DevNumberCode,F.C_OpsTempCode,F.C_PlanTempCode,F.C_RepairTempCode,F.C_RunTempCode,E.C_ImagePath AS DevTempImage, E.C_Manufacturer,E.C_Parameter,E.C_Marker ,D.C_Name AS CreateByName,E.C_Name AS LastUpdatedByName 
 FROM TMTN_RepairOrder A  
 LEFT JOIN TDEV_DevStore F ON F.C_ID = A.C_DevStoreCode
-LEFT JOIN TDEV_DevSpot A0 ON A0.C_DevStoreCode = A.C_DevStoreCode  INNER JOIN TISP_Spot B0 ON A0.C_SpotCode = B0.C_Code 
+LEFT JOIN TDEV_DevSpot A0 ON A0.C_DevStoreCode = A.C_DevStoreCode  LEFT JOIN TISP_Spot B0 ON A0.C_SpotCode = B0.C_Code 
 LEFT JOIN TDEV_DeviceTemplate E ON E.C_ID = F.C_DevTempCode
 LEFT JOIN TSYS_User D ON D.C_UserID = A.C_CreateBy 
 LEFT JOIN TSYS_User C ON C.C_UserID = A.C_LastUpdatedBy 

BIN
Ropin.Inspection.Repository/bin/Debug/net5.0/Ropin.Inspection.Model.dll


BIN
Ropin.Inspection.Repository/bin/Debug/net5.0/Ropin.Inspection.Model.pdb


BIN
Ropin.Inspection.Repository/bin/Debug/net5.0/Ropin.Inspection.Repository.dll


BIN
Ropin.Inspection.Repository/bin/Debug/net5.0/Ropin.Inspection.Repository.pdb


BIN
Ropin.Inspection.Repository/obj/Debug/net5.0/Ropin.Inspection.Repository.csproj.AssemblyReference.cache


BIN
Ropin.Inspection.Repository/obj/Debug/net5.0/Ropin.Inspection.Repository.dll


BIN
Ropin.Inspection.Repository/obj/Debug/net5.0/Ropin.Inspection.Repository.pdb


BIN
Ropin.Inspection.Repository/obj/Debug/net5.0/ref/Ropin.Inspection.Repository.dll


BIN
Ropin.Inspection.Repository/obj/Debug/net5.0/refint/Ropin.Inspection.Repository.dll


+ 5 - 0
Ropin.Inspection.Service/TAIC/TaicAIBoxTemplateService.cs

@@ -2,6 +2,7 @@
 using LinqKit;
 using Microsoft.EntityFrameworkCore;
 using Microsoft.EntityFrameworkCore.Internal;
+using Ropin.Core.Common;
 using Ropin.Inspection.Common.Accessor.Interface;
 using Ropin.Inspection.Model;
 using Ropin.Inspection.Model.Entities;
@@ -60,6 +61,8 @@ namespace Ropin.Inspection.Service.TAIC
         {
             var aiboxTemplate = _mapper.Map<TaicAiboxTemplate>(viewModel);
             aiboxTemplate.CId = Guid.NewGuid().ToString();
+            var path = QRCoderHelper.RenderQrCode(aiboxTemplate.CId, "M", _claims.Linsence);
+            aiboxTemplate.CQrcode = path;
             aiboxTemplate.CCreateBy = _claims.ApiUserId.ToString();
             _taicAIBoxTemplateRepository.Create(aiboxTemplate);
             var result = await _taicAIBoxTemplateRepository.SaveAsync();
@@ -156,6 +159,8 @@ namespace Ropin.Inspection.Service.TAIC
         {
             var taicAibox = _mapper.Map<TaicAibox>(aiBoxModel);
             taicAibox.CId = Guid.NewGuid().ToString();
+            var path = QRCoderHelper.RenderQrCode(taicAibox.CId, "M", _claims.Linsence);
+            taicAibox.CQrcode = path;
             taicAibox.CCreateBy = _claims.ApiUserId.ToString();
             _taicAIBoxRepository.Create(taicAibox);
             var result = await _taicAIBoxRepository.SaveAsync();

+ 1 - 19
Ropin.Inspection.Service/TdevDevSpotService.cs

@@ -115,25 +115,7 @@ namespace Ropin.Inspection.Service
         }
         public async Task<IEnumerable<TdevDevSpotViewModel>> GetConditionAsync(TdevDevSpotSearchModel searchModel)
         {
-            var predicate = PredicateBuilder.New<TDEV_DevSpot>(true);//查询条件,推荐后台使用这种方式灵活筛选
-            #region 添加条件查询
-            //predicate = predicate.And(i => i.C_Status.Equals("1"));
-            if (!string.IsNullOrEmpty(searchModel.C_SpotCode))
-            {
-                predicate = predicate.And(i => i.C_SpotCode.Equals(searchModel.C_SpotCode));
-            }
-            if (!string.IsNullOrEmpty(searchModel.C_DevStoreCode))
-            {
-                predicate = predicate.And(i => i.C_DevStoreCode.Equals(searchModel.C_DevStoreCode));
-            }
-            if (!string.IsNullOrEmpty(searchModel.C_ID))
-            {
-                predicate = predicate.And(i => i.C_ID.Equals(searchModel.C_ID));
-            }
-            #endregion
-            var list = await _repository.GetPageAsync(predicate, "-D_CreateOn", searchModel.IsPagination, searchModel.PageIndex, searchModel.PageSize);
-            searchModel.TotalCount = list.Totals;
-            var dtoList = _mapper.Map<List<TDEV_DevSpot>, List<TdevDevSpotViewModel>>(list.Rows);
+            var dtoList = await _repository.GetList(searchModel);
             return dtoList;
         }
 

BIN
Ropin.Inspection.Service/bin/Debug/net5.0/Ropin.Inspection.Model.dll


BIN
Ropin.Inspection.Service/bin/Debug/net5.0/Ropin.Inspection.Model.pdb


BIN
Ropin.Inspection.Service/bin/Debug/net5.0/Ropin.Inspection.Repository.dll


BIN
Ropin.Inspection.Service/bin/Debug/net5.0/Ropin.Inspection.Repository.pdb


BIN
Ropin.Inspection.Service/bin/Debug/net5.0/Ropin.Inspection.Service.dll


BIN
Ropin.Inspection.Service/bin/Debug/net5.0/Ropin.Inspection.Service.pdb


BIN
Ropin.Inspection.Service/obj/Debug/net5.0/Ropin.Inspection.Service.csproj.AssemblyReference.cache


BIN
Ropin.Inspection.Service/obj/Debug/net5.0/Ropin.Inspection.Service.dll


BIN
Ropin.Inspection.Service/obj/Debug/net5.0/Ropin.Inspection.Service.pdb


BIN
Ropin.Inspection.Service/obj/Debug/net5.0/ref/Ropin.Inspection.Service.dll


BIN
Ropin.Inspection.Service/obj/Debug/net5.0/refint/Ropin.Inspection.Service.dll


BIN
Ropin.Inspection.Tasks/bin/Debug/net5.0/Ropin.Inspection.Model.dll


BIN
Ropin.Inspection.Tasks/bin/Debug/net5.0/Ropin.Inspection.Model.pdb


Some files were not shown because too many files changed in this diff