yandaniu пре 5 дана
родитељ
комит
fb4e37915c
31 измењених фајлова са 468 додато и 472 уклоњено
  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/9022cb7d-33ca-4b5f-85e7-69b09d919f21.vsidx
  5. BIN
      .vs/Ropin.Inspection.Api/FileContentIndex/c6ad1a7a-c1ae-4942-8de8-7a0adae1df3a.vsidx
  6. BIN
      .vs/Ropin.Inspection.Api/v17/.suo
  7. 1 1
      Ropin.Environmentally.LedgeService1/appsettings.Production.json
  8. 7 6
      Ropin.Inspection.Api/Controllers/MTN/TmtnAlarmOrderController.cs
  9. 30 6
      Ropin.Inspection.Api/Controllers/TAIC/TAIC_AIBoxTemplateController.cs
  10. 0 8
      Ropin.Inspection.Api/Properties/PublishProfiles/FolderProfile.pubxml.user
  11. 0 11
      Ropin.Inspection.Api/Properties/PublishProfiles/FolderProfile.pubxml.user.mine
  12. 0 11
      Ropin.Inspection.Api/Properties/PublishProfiles/FolderProfile.pubxml.user.r1412
  13. 0 11
      Ropin.Inspection.Api/Properties/PublishProfiles/FolderProfile.pubxml.user.r1415
  14. 250 82
      Ropin.Inspection.Api/TdevDevOpeAccountController.cs
  15. 3 3
      Ropin.Inspection.Api/TmtnDevOpsController.cs
  16. 3 3
      Ropin.Inspection.Api/TmtnRepairOrderController.cs
  17. 1 1
      Ropin.Inspection.Api/TmtnRepairOrderItemController.cs
  18. 32 42
      Ropin.Inspection.Common/DataDictionaryHelper.cs
  19. 6 1
      Ropin.Inspection.Common/Helper/WeChatHelper.cs
  20. 0 1
      Ropin.Inspection.Model/Entities/TSYS_Message.cs
  21. 3 0
      Ropin.Inspection.Model/TaicTemplateModel.cs
  22. 0 1
      Ropin.Inspection.Model/ViewModel/SYS/TsysMessageUpdateModel.cs
  23. 0 2
      Ropin.Inspection.Model/ViewModel/SYS/TsysMessageViewModel.cs
  24. 1 1
      Ropin.Inspection.Service/IPushMsgService.cs
  25. 2 1
      Ropin.Inspection.Service/ITmtnDevOpsService.cs
  26. 2 1
      Ropin.Inspection.Service/ITmtnRepairOrderService.cs
  27. 83 276
      Ropin.Inspection.Service/PushMsgService.cs
  28. 3 0
      Ropin.Inspection.Service/TAIC/Interface/ITaicAIBoxTemplateService.cs
  29. 35 1
      Ropin.Inspection.Service/TAIC/TaicAIBoxTemplateService.cs
  30. 3 1
      Ropin.Inspection.Service/TmtnDevOpsService.cs
  31. 3 1
      Ropin.Inspection.Service/TmtnRepairOrderService.cs

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/57f6f515-01d5-4b6e-be89-aa0c3a55fe4e.vsidx → .vs/Ropin.Inspection.Api/FileContentIndex/9022cb7d-33ca-4b5f-85e7-69b09d919f21.vsidx


BIN
.vs/Ropin.Inspection.Api/FileContentIndex/39e4c180-24a2-45d5-b189-dac349320b11.vsidx → .vs/Ropin.Inspection.Api/FileContentIndex/c6ad1a7a-c1ae-4942-8de8-7a0adae1df3a.vsidx


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


+ 1 - 1
Ropin.Environmentally.LedgeService1/appsettings.Production.json

@@ -16,7 +16,7 @@
     "RedisConnection": "60.204.212.71,defaultDatabase=1,password=1234566,connectTimeout=15000,syncTimeout=5000,abortConnect=false"
   },
   "IniInflux": {
-    "infuxUrl": "http://124.71.132.255:8085/",
+    "infuxUrl": "http://60.204.212.71:8085/",
     "infuxUser": "admin",
     "infuxPwd": "123456"
   },

+ 7 - 6
Ropin.Inspection.Api/Controllers/MTN/TmtnAlarmOrderController.cs

@@ -106,7 +106,7 @@ namespace Ropin.Inspection.Api.Controllers.MTN
                         {
                             C_DevStoreCode = PushMsg.C_DevStoreCode,
                             C_MsgTypeCode = "MSG_TYPE_019",
-                            Msg = content.C_Record,//content.C_Name + "  " + content.C_Remark,
+                            Msg = string.IsNullOrEmpty(content.C_Record)? "上报处理报警" : content.C_Record,//content.C_Name + "  " + content.C_Remark,
                             Subject = content.C_Name,//"上报报警," + content.C_Name,
                             DevNumber = PushMsg.C_DevStoreCode,
                             DevName = "",
@@ -169,13 +169,13 @@ namespace Ropin.Inspection.Api.Controllers.MTN
                     {
                         C_DevStoreCode = content.C_DevStoreCode,
                         C_MsgTypeCode = "MSG_TYPE_020",
-                        Msg = updateModel.C_Remark,//content.C_Name + "  " + updateModel.C_Remark,
+                        Msg = string.IsNullOrEmpty(updateModel.C_Remark)? "报警取消": updateModel.C_Remark,//content.C_Name + "  " + updateModel.C_Remark,
                         Subject = content.C_Name,//"报警取消," + content.C_Name,
                         DevNumber = content.C_DevStoreCode,
                         DevName = content.C_DevName,
                         GenerationType = 2,
                         msgStatus = 0,
-                    },"设备报警工单");
+                    },"设备报警工单",null, id,updateModel.C_Status);
                 }
                 log.Info($"更新报警工单-保存数据END");
             }
@@ -205,7 +205,7 @@ namespace Ropin.Inspection.Api.Controllers.MTN
                 log.Info($"报警工单-流程-保存数据成功【id={id};数据=[{JsonConvert.SerializeObject(updateModel)}]】");
                 // 0 = 禁用(删除);1 = 上报报警(报警上报);5 = 报警取消;2 = 报警确认;
                 // 3 = 正在处理报警;4 = 处理报警完成;6 = 报警处理维保返工; 7 = 报警处理完成确认
-                if (updateModel.C_Status=="2"|| updateModel.C_Status=="4" || updateModel.C_Status == "7")
+                if (updateModel.C_Status=="2"|| updateModel.C_Status=="4" || updateModel.C_Status == "5" || updateModel.C_Status == "6" || updateModel.C_Status == "7")
                 {
                     var content = await _repository.GetByIdAsync(id);
                     if (content != null && !string.IsNullOrEmpty(content.C_DevStoreCode))
@@ -214,6 +214,7 @@ namespace Ropin.Inspection.Api.Controllers.MTN
                         switch (updateModel.C_Status)
                         {
                             case "2": title = "报警确认,"; code = "MSG_TYPE_021"; break;
+                            case "6": title = "报警返工处理,"; code = "MSG_TYPE_021"; break;
                             case "7": title = "报警完成确认,"; code = "MSG_TYPE_021"; break;
                             case "4": title = "报警完成,"; code = "MSG_TYPE_022"; break;
                             case "5": title = "报警取消,"; code = "MSG_TYPE_020"; break;
@@ -222,13 +223,13 @@ namespace Ropin.Inspection.Api.Controllers.MTN
                         {
                             C_DevStoreCode = content.C_DevStoreCode,
                             C_MsgTypeCode = code,
-                            Msg = updateModel.C_Record,//content.C_Name + "  " + updateModel.C_Remark,
+                            Msg = string.IsNullOrEmpty(updateModel.C_Record)?title: updateModel.C_Record,//content.C_Name + "  " + updateModel.C_Remark,
                             Subject = content.C_Name,// title + content.C_Name,
                             DevNumber = content.C_DevStoreCode,
                             DevName = content.C_DevName,
                             GenerationType = 2,
                             msgStatus = 0,
-                        }, "设备报警工单");
+                        }, "设备报警工单",null, id, updateModel.C_Status);
                     }                    
                 }
                 log.Info($"报警工单-流程-保存数据END");

+ 30 - 6
Ropin.Inspection.Api/Controllers/TAIC/TAIC_AIBoxTemplateController.cs

@@ -28,7 +28,7 @@ namespace Ropin.Inspection.Api.Controllers.TAIC
         [HttpPost("GetTemplatePage")]
         public async Task<ApiResult> GetTemplatePage(TaicTemplateSearchModel searchModel)
         {
-            var taicTemplates =await _taicAIBoxTemplateService.GetTemplatePage(searchModel);
+            var taicTemplates = await _taicAIBoxTemplateService.GetTemplatePage(searchModel);
             PagesModel<TaicTemplateModel> datas = new PagesModel<TaicTemplateModel>(taicTemplates, searchModel);
             return new ApiResult<PagesModel<TaicTemplateModel>>(datas);
         }
@@ -73,8 +73,8 @@ namespace Ropin.Inspection.Api.Controllers.TAIC
         [HttpPost("UpdateTemplate/{id}")]
         public async Task<ApiResult> UpdateTemplate(string id, TaicTemplateModel templateModel)
         {
-            await _taicAIBoxTemplateService.UpdateTemplate(id,templateModel);
-            return new ApiResult<bool>(true,ReturnCode.Success);
+            await _taicAIBoxTemplateService.UpdateTemplate(id, templateModel);
+            return new ApiResult<bool>(true, ReturnCode.Success);
         }
 
         /// <summary>
@@ -105,8 +105,8 @@ namespace Ropin.Inspection.Api.Controllers.TAIC
         [HttpPost("AddAiBox")]
         public async Task<ApiResult> AddAiBox(AiBoxModel aiBoxModel)
         {
-            var result =await _taicAIBoxTemplateService.AddAiBox(aiBoxModel);
-            return new ApiResult<bool>(result,ReturnCode.Success);
+            var result = await _taicAIBoxTemplateService.AddAiBox(aiBoxModel);
+            return new ApiResult<bool>(result, ReturnCode.Success);
         }
 
         /// <summary>
@@ -130,7 +130,7 @@ namespace Ropin.Inspection.Api.Controllers.TAIC
         [HttpPost("UpdateAiBox/{id}")]
         public async Task<ApiResult> UpdateAiBox(string id, AiBoxModel aiBoxModel)
         {
-            var result=await _taicAIBoxTemplateService.UpdateAiBox(id, aiBoxModel);
+            var result = await _taicAIBoxTemplateService.UpdateAiBox(id, aiBoxModel);
             return new ApiResult<bool>(result, ReturnCode.Success);
         }
 
@@ -145,5 +145,29 @@ namespace Ropin.Inspection.Api.Controllers.TAIC
             var result = await _taicAIBoxTemplateService.AddDevAIBox(devAiboxModel);
             return new ApiResult<bool>(result, ReturnCode.Success);
         }
+
+        /// <summary>
+        /// 获取关联的摄像头
+        /// </summary>
+        /// <param name="aiboxCode"></param>
+        /// <returns></returns>
+        [HttpGet("GetDevAibox/{aiboxCode}")]
+        public async Task<ApiResult> GetDevAibox(string aiboxCode)
+        {
+            var result = await _taicAIBoxTemplateService.GetDevAibox(aiboxCode);
+            return new ApiResult<object>(result, ReturnCode.Success);
+        }
+
+        /// <summary>
+        /// 删除关联的摄像头
+        /// </summary>
+        /// <param name="id"></param>
+        /// <returns></returns>
+        [HttpDelete("DelDevAibox/{id}")]
+        public async Task<ApiResult> DelDevAibox(string id)
+        {
+            var result = await _taicAIBoxTemplateService.DelDevAibox(id);
+            return new ApiResult<bool>(result, ReturnCode.Success);
+        }
     }
 }

+ 0 - 8
Ropin.Inspection.Api/Properties/PublishProfiles/FolderProfile.pubxml.user

@@ -4,16 +4,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
 -->
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
-<<<<<<< .mine
-    <_PublishTargetUrl>E:\Ropin\svn\SH_HB\Source_SQ\Ropin.Inspection.Api\Ropin.Inspection.Api\bin\Release\net5.0\publish\</_PublishTargetUrl>
-    <History>True|2024-08-01T07:58:22.8816570Z;True|2024-01-23T10:15:27.7778127+08:00;True|2024-01-23T09:52:10.2543696+08:00;True|2024-01-16T15:27:33.4623499+08:00;True|2024-01-16T15:27:08.9602734+08:00;True|2024-01-15T14:44:47.0043912+08:00;True|2024-01-12T13:09:14.0340670+08:00;True|2024-01-11T13:52:07.7642352+08:00;True|2024-01-10T09:49:03.4374848+08:00;True|2024-01-03T10:32:42.8629400+08:00;True|2023-05-09T09:54:34.1189277+08:00;True|2023-03-28T10:08:24.6390975+08:00;True|2023-03-17T10:16:39.5872259+08:00;True|2023-03-13T16:42:56.2217615+08:00;True|2023-03-08T15:52:33.6033482+08:00;True|2023-03-02T14:26:37.9095049+08:00;True|2023-02-02T14:42:26.7916225+08:00;True|2023-02-02T14:24:25.2237336+08:00;True|2023-02-02T13:58:55.3934884+08:00;True|2023-02-01T10:48:45.0791702+08:00;True|2023-02-01T10:33:21.9072586+08:00;True|2023-01-31T12:56:14.9073429+08:00;True|2023-01-30T14:41:28.4692501+08:00;True|2023-01-12T10:21:11.4927753+08:00;True|2022-11-23T13:48:41.9082930+08:00;True|2022-11-22T10:42:32.5556928+08:00;True|2022-11-18T13:03:45.2732819+08:00;True|2022-11-18T10:32:57.0310816+08:00;True|2022-11-18T10:32:33.4960678+08:00;True|2022-11-18T10:25:08.5214095+08:00;True|2022-11-17T17:52:42.0969357+08:00;True|2022-11-07T18:49:23.2583784+08:00;True|2022-10-31T18:27:45.8083537+08:00;True|2022-10-23T11:43:53.2906112+08:00;True|2022-08-22T15:57:17.7096003+08:00;True|2022-08-19T15:24:03.8948501+08:00;True|2022-08-18T10:32:15.4408153+08:00;</History>
-||||||| .r1412
-    <_PublishTargetUrl>D:\项目代码\汽轮机厂\Ropin.Inspection.Api\Ropin.Inspection.Api\bin\Release\net5.0\publish\</_PublishTargetUrl>
-    <History>True|2024-01-23T02:15:27.7778127Z;True|2024-01-23T09:52:10.2543696+08:00;True|2024-01-16T15:27:33.4623499+08:00;True|2024-01-16T15:27:08.9602734+08:00;True|2024-01-15T14:44:47.0043912+08:00;True|2024-01-12T13:09:14.0340670+08:00;True|2024-01-11T13:52:07.7642352+08:00;True|2024-01-10T09:49:03.4374848+08:00;True|2024-01-03T10:32:42.8629400+08:00;True|2023-05-09T09:54:34.1189277+08:00;True|2023-03-28T10:08:24.6390975+08:00;True|2023-03-17T10:16:39.5872259+08:00;True|2023-03-13T16:42:56.2217615+08:00;True|2023-03-08T15:52:33.6033482+08:00;True|2023-03-02T14:26:37.9095049+08:00;True|2023-02-02T14:42:26.7916225+08:00;True|2023-02-02T14:24:25.2237336+08:00;True|2023-02-02T13:58:55.3934884+08:00;True|2023-02-01T10:48:45.0791702+08:00;True|2023-02-01T10:33:21.9072586+08:00;True|2023-01-31T12:56:14.9073429+08:00;True|2023-01-30T14:41:28.4692501+08:00;True|2023-01-12T10:21:11.4927753+08:00;True|2022-11-23T13:48:41.9082930+08:00;True|2022-11-22T10:42:32.5556928+08:00;True|2022-11-18T13:03:45.2732819+08:00;True|2022-11-18T10:32:57.0310816+08:00;True|2022-11-18T10:32:33.4960678+08:00;True|2022-11-18T10:25:08.5214095+08:00;True|2022-11-17T17:52:42.0969357+08:00;True|2022-11-07T18:49:23.2583784+08:00;True|2022-10-31T18:27:45.8083537+08:00;True|2022-10-23T11:43:53.2906112+08:00;True|2022-08-22T15:57:17.7096003+08:00;True|2022-08-19T15:24:03.8948501+08:00;True|2022-08-18T10:32:15.4408153+08:00;</History>
-=======
     <_PublishTargetUrl>D:\项目代码\环保\Ropin.Inspection.Api\bin\Release\net5.0\publish\</_PublishTargetUrl>
     <History>True|2025-04-10T09:20:11.5298934Z||;True|2025-04-10T14:10:10.2705541+08:00||;True|2024-01-23T10:15:27.7778127+08:00||;True|2024-01-23T09:52:10.2543696+08:00||;True|2024-01-16T15:27:33.4623499+08:00||;True|2024-01-16T15:27:08.9602734+08:00||;True|2024-01-15T14:44:47.0043912+08:00||;True|2024-01-12T13:09:14.0340670+08:00||;True|2024-01-11T13:52:07.7642352+08:00||;True|2024-01-10T09:49:03.4374848+08:00||;True|2024-01-03T10:32:42.8629400+08:00||;True|2023-05-09T09:54:34.1189277+08:00||;True|2023-03-28T10:08:24.6390975+08:00||;True|2023-03-17T10:16:39.5872259+08:00||;True|2023-03-13T16:42:56.2217615+08:00||;True|2023-03-08T15:52:33.6033482+08:00||;True|2023-03-02T14:26:37.9095049+08:00||;True|2023-02-02T14:42:26.7916225+08:00||;True|2023-02-02T14:24:25.2237336+08:00||;True|2023-02-02T13:58:55.3934884+08:00||;True|2023-02-01T10:48:45.0791702+08:00||;True|2023-02-01T10:33:21.9072586+08:00||;True|2023-01-31T12:56:14.9073429+08:00||;True|2023-01-30T14:41:28.4692501+08:00||;True|2023-01-12T10:21:11.4927753+08:00||;True|2022-11-23T13:48:41.9082930+08:00||;True|2022-11-22T10:42:32.5556928+08:00||;True|2022-11-18T13:03:45.2732819+08:00||;True|2022-11-18T10:32:57.0310816+08:00||;True|2022-11-18T10:32:33.4960678+08:00||;True|2022-11-18T10:25:08.5214095+08:00||;True|2022-11-17T17:52:42.0969357+08:00||;True|2022-11-07T18:49:23.2583784+08:00||;True|2022-10-31T18:27:45.8083537+08:00||;True|2022-10-23T11:43:53.2906112+08:00||;True|2022-08-22T15:57:17.7096003+08:00||;True|2022-08-19T15:24:03.8948501+08:00||;True|2022-08-18T10:32:15.4408153+08:00||;</History>
->>>>>>> .r1415
     <LastFailureDetails />
   </PropertyGroup>
 </Project>

+ 0 - 11
Ropin.Inspection.Api/Properties/PublishProfiles/FolderProfile.pubxml.user.mine

@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-https://go.microsoft.com/fwlink/?LinkID=208121. 
--->
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <_PublishTargetUrl>E:\Ropin\svn\SH_HB\Source_SQ\Ropin.Inspection.Api\Ropin.Inspection.Api\bin\Release\net5.0\publish\</_PublishTargetUrl>
-    <History>True|2024-08-01T07:58:22.8816570Z;True|2024-01-23T10:15:27.7778127+08:00;True|2024-01-23T09:52:10.2543696+08:00;True|2024-01-16T15:27:33.4623499+08:00;True|2024-01-16T15:27:08.9602734+08:00;True|2024-01-15T14:44:47.0043912+08:00;True|2024-01-12T13:09:14.0340670+08:00;True|2024-01-11T13:52:07.7642352+08:00;True|2024-01-10T09:49:03.4374848+08:00;True|2024-01-03T10:32:42.8629400+08:00;True|2023-05-09T09:54:34.1189277+08:00;True|2023-03-28T10:08:24.6390975+08:00;True|2023-03-17T10:16:39.5872259+08:00;True|2023-03-13T16:42:56.2217615+08:00;True|2023-03-08T15:52:33.6033482+08:00;True|2023-03-02T14:26:37.9095049+08:00;True|2023-02-02T14:42:26.7916225+08:00;True|2023-02-02T14:24:25.2237336+08:00;True|2023-02-02T13:58:55.3934884+08:00;True|2023-02-01T10:48:45.0791702+08:00;True|2023-02-01T10:33:21.9072586+08:00;True|2023-01-31T12:56:14.9073429+08:00;True|2023-01-30T14:41:28.4692501+08:00;True|2023-01-12T10:21:11.4927753+08:00;True|2022-11-23T13:48:41.9082930+08:00;True|2022-11-22T10:42:32.5556928+08:00;True|2022-11-18T13:03:45.2732819+08:00;True|2022-11-18T10:32:57.0310816+08:00;True|2022-11-18T10:32:33.4960678+08:00;True|2022-11-18T10:25:08.5214095+08:00;True|2022-11-17T17:52:42.0969357+08:00;True|2022-11-07T18:49:23.2583784+08:00;True|2022-10-31T18:27:45.8083537+08:00;True|2022-10-23T11:43:53.2906112+08:00;True|2022-08-22T15:57:17.7096003+08:00;True|2022-08-19T15:24:03.8948501+08:00;True|2022-08-18T10:32:15.4408153+08:00;</History>
-    <LastFailureDetails />
-  </PropertyGroup>
-</Project>

+ 0 - 11
Ropin.Inspection.Api/Properties/PublishProfiles/FolderProfile.pubxml.user.r1412

@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-https://go.microsoft.com/fwlink/?LinkID=208121. 
--->
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <_PublishTargetUrl>D:\项目代码\汽轮机厂\Ropin.Inspection.Api\Ropin.Inspection.Api\bin\Release\net5.0\publish\</_PublishTargetUrl>
-    <History>True|2024-01-23T02:15:27.7778127Z;True|2024-01-23T09:52:10.2543696+08:00;True|2024-01-16T15:27:33.4623499+08:00;True|2024-01-16T15:27:08.9602734+08:00;True|2024-01-15T14:44:47.0043912+08:00;True|2024-01-12T13:09:14.0340670+08:00;True|2024-01-11T13:52:07.7642352+08:00;True|2024-01-10T09:49:03.4374848+08:00;True|2024-01-03T10:32:42.8629400+08:00;True|2023-05-09T09:54:34.1189277+08:00;True|2023-03-28T10:08:24.6390975+08:00;True|2023-03-17T10:16:39.5872259+08:00;True|2023-03-13T16:42:56.2217615+08:00;True|2023-03-08T15:52:33.6033482+08:00;True|2023-03-02T14:26:37.9095049+08:00;True|2023-02-02T14:42:26.7916225+08:00;True|2023-02-02T14:24:25.2237336+08:00;True|2023-02-02T13:58:55.3934884+08:00;True|2023-02-01T10:48:45.0791702+08:00;True|2023-02-01T10:33:21.9072586+08:00;True|2023-01-31T12:56:14.9073429+08:00;True|2023-01-30T14:41:28.4692501+08:00;True|2023-01-12T10:21:11.4927753+08:00;True|2022-11-23T13:48:41.9082930+08:00;True|2022-11-22T10:42:32.5556928+08:00;True|2022-11-18T13:03:45.2732819+08:00;True|2022-11-18T10:32:57.0310816+08:00;True|2022-11-18T10:32:33.4960678+08:00;True|2022-11-18T10:25:08.5214095+08:00;True|2022-11-17T17:52:42.0969357+08:00;True|2022-11-07T18:49:23.2583784+08:00;True|2022-10-31T18:27:45.8083537+08:00;True|2022-10-23T11:43:53.2906112+08:00;True|2022-08-22T15:57:17.7096003+08:00;True|2022-08-19T15:24:03.8948501+08:00;True|2022-08-18T10:32:15.4408153+08:00;</History>
-    <LastFailureDetails />
-  </PropertyGroup>
-</Project>

+ 0 - 11
Ropin.Inspection.Api/Properties/PublishProfiles/FolderProfile.pubxml.user.r1415

@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-https://go.microsoft.com/fwlink/?LinkID=208121. 
--->
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <_PublishTargetUrl>D:\项目代码\环保\Ropin.Inspection.Api\bin\Release\net5.0\publish\</_PublishTargetUrl>
-    <History>True|2025-04-10T09:20:11.5298934Z||;True|2025-04-10T14:10:10.2705541+08:00||;True|2024-01-23T10:15:27.7778127+08:00||;True|2024-01-23T09:52:10.2543696+08:00||;True|2024-01-16T15:27:33.4623499+08:00||;True|2024-01-16T15:27:08.9602734+08:00||;True|2024-01-15T14:44:47.0043912+08:00||;True|2024-01-12T13:09:14.0340670+08:00||;True|2024-01-11T13:52:07.7642352+08:00||;True|2024-01-10T09:49:03.4374848+08:00||;True|2024-01-03T10:32:42.8629400+08:00||;True|2023-05-09T09:54:34.1189277+08:00||;True|2023-03-28T10:08:24.6390975+08:00||;True|2023-03-17T10:16:39.5872259+08:00||;True|2023-03-13T16:42:56.2217615+08:00||;True|2023-03-08T15:52:33.6033482+08:00||;True|2023-03-02T14:26:37.9095049+08:00||;True|2023-02-02T14:42:26.7916225+08:00||;True|2023-02-02T14:24:25.2237336+08:00||;True|2023-02-02T13:58:55.3934884+08:00||;True|2023-02-01T10:48:45.0791702+08:00||;True|2023-02-01T10:33:21.9072586+08:00||;True|2023-01-31T12:56:14.9073429+08:00||;True|2023-01-30T14:41:28.4692501+08:00||;True|2023-01-12T10:21:11.4927753+08:00||;True|2022-11-23T13:48:41.9082930+08:00||;True|2022-11-22T10:42:32.5556928+08:00||;True|2022-11-18T13:03:45.2732819+08:00||;True|2022-11-18T10:32:57.0310816+08:00||;True|2022-11-18T10:32:33.4960678+08:00||;True|2022-11-18T10:25:08.5214095+08:00||;True|2022-11-17T17:52:42.0969357+08:00||;True|2022-11-07T18:49:23.2583784+08:00||;True|2022-10-31T18:27:45.8083537+08:00||;True|2022-10-23T11:43:53.2906112+08:00||;True|2022-08-22T15:57:17.7096003+08:00||;True|2022-08-19T15:24:03.8948501+08:00||;True|2022-08-18T10:32:15.4408153+08:00||;</History>
-    <LastFailureDetails />
-  </PropertyGroup>
-</Project>

+ 250 - 82
Ropin.Inspection.Api/TdevDevOpeAccountController.cs

@@ -184,7 +184,7 @@ namespace Ropin.Inspection.Api
                     if (dict.ContainsKey("RunWhetherNormal"))
                     {
                         var RunWhetherNormal = dict["RunWhetherNormal"].ToString();
-                        dict["RunWhetherNormal"] = RunWhetherNormal.ToLower() == "true" ? "是" : "否";
+                        dict["RunWhetherNormal"] = RunWhetherNormal.ToLower() == "true" ? "异常" : "正常";
                     }
                     var trueList = tabs?.Where(t => t.BReadDevSpot == true);
                     foreach (var item in trueList)
@@ -391,8 +391,9 @@ namespace Ropin.Inspection.Api
                             }
                             if (tabs[j].Name== "RunWhetherNormal")
                             {
-                                cels[j] = itemVal?.ToLower() == "true" ? "是" : "否";
-                            }else if (tabs[j].Name == "Date")
+                                cels[j] = itemVal?.ToLower() == "true" ? "异常" : "正常";
+                            }
+                            else if (tabs[j].Name == "Date")
                             {
                                 cels[j] = Convert.ToDateTime(itemVal).ToString("yyyy-MM-dd");
                             }
@@ -577,104 +578,271 @@ namespace Ropin.Inspection.Api
             try
             {
                 var devOpeAccountList = await _TdevDevOpeAccountService.GetConditionAsync(searchModel);
-                var contentList = from c in devOpeAccountList.Select(t => t.C_Content)
-                                  select JsonConvert.DeserializeObject<TdevDevOpeContentViewModel>(c);
-
                 IWorkbook workbook = new XSSFWorkbook();
-                ISheet sheet = workbook.CreateSheet("sheet1");
-                sheet.AddMergedRegion(new NPOI.SS.Util.CellRangeAddress(0, 0, 0, 12));
-                var titleRow = sheet.CreateRow(0);
-                titleRow.Height = 20 * 25;
-                ICell titleCell = titleRow.CreateCell(0);
-                titleCell.SetCellValue("设各台账记录");
-                //第一行字体样式
+                ISheet sheet = workbook.CreateSheet();
+                #region
+                //标题加粗居中.
                 IFont font = workbook.CreateFont();
                 font.IsBold = true;
-                font.FontHeightInPoints = 16;
+                font.FontHeightInPoints = 25;
                 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(0).SetCellValue("日期");
-                headRow.CreateCell(1).SetCellValue("排污口编号");
-                headRow.CreateCell(2).SetCellValue("设备名称");
-                headRow.CreateCell(3).SetCellValue("参数名称");
-                headRow.CreateCell(4).SetCellValue("设计值");
-                headRow.CreateCell(5).SetCellValue("单位");
-                headRow.CreateCell(6).SetCellValue("污染因子");
-                headRow.CreateCell(7).SetCellValue("数据来源");
-                headRow.CreateCell(8).SetCellValue("烟气筒高度(m)");
-                headRow.CreateCell(9).SetCellValue("排放温度(°C)");
-                headRow.CreateCell(10).SetCellValue("压力");
-                headRow.CreateCell(11).SetCellValue("开机时间");
-                headRow.CreateCell(12).SetCellValue("关机时间");
-                //第二行,列名
+                titleCellStyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
+                titleCellStyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
+                titleCellStyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
+                titleCellStyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
+                titleCellStyle.WrapText = true;
+                #endregion
+                #region
+                //标题加粗居中.
                 IFont font1 = workbook.CreateFont();
                 font1.IsBold = true;
-                font1.FontHeightInPoints = 12;
+                font1.FontHeightInPoints = 14;
                 font1.FontName = "宋体";
                 ICellStyle headCellStyle = workbook.CreateCellStyle();
                 headCellStyle.SetFont(font1);
+                headCellStyle.Alignment = HorizontalAlignment.Center;  //字体左右居中
+                headCellStyle.VerticalAlignment = VerticalAlignment.Center;//字体上下居中
                 //边框
-                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;
-                }
+                headCellStyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
+                headCellStyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
+                headCellStyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
+                headCellStyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
+                headCellStyle.WrapText = true;
+                #endregion
+                #region
+                //标题加粗居中.
+                IFont font2 = workbook.CreateFont();
+                font2.IsBold = false;
+                font2.FontHeightInPoints = 12;
+                font2.FontName = "宋体";
+                ICellStyle rowCellStyle = workbook.CreateCellStyle();
+                rowCellStyle.SetFont(font2);
+                rowCellStyle.Alignment = HorizontalAlignment.Center;  //字体居中
+                                                                      //边框
+                rowCellStyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
+                rowCellStyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
+                rowCellStyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
+                rowCellStyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
+                rowCellStyle.WrapText = true;
+                #endregion
 
-                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 contentList)
+                IRow title = sheet.CreateRow(0);
+                title.Height = 30 * 25;
+                title.CreateCell(0).SetCellValue("VOCs治理设施基本信息与维保管理信息表");
+                foreach (var item in title.Cells)
                 {
-                    var row = sheet.CreateRow(start);
-                    row.CreateCell(0).SetCellValue(item.Date.ToString("yyyy-MM-dd hh:mm:ss"));
-                    row.CreateCell(1).SetCellValue(item.DrainOutletNumber);
-                    row.CreateCell(2).SetCellValue(item.DevStoreName);
-                    row.CreateCell(3).SetCellValue(item.DevStoreType);
-                    row.CreateCell(4).SetCellValue(item.SpecificationsParameterName);
-                    row.CreateCell(5).SetCellValue(item.SpecificationsDesignValue);
-                    row.CreateCell(6).SetCellValue(item.PollutionFactor);
-                    row.CreateCell(7).SetCellValue(item.DataSources);
-                    row.CreateCell(8).SetCellValue(item.HeightOfFlue);
-                    row.CreateCell(9).SetCellValue(item.DischargeTemperature);
-                    row.CreateCell(10).SetCellValue(item.Pressure);
-                    row.CreateCell(11).SetCellValue(item.RunStartTime.ToString("yyyy-MM-dd hh:mm:ss"));
-                    row.CreateCell(12).SetCellValue(item.RunEndTime.ToString("yyyy-MM-dd hh:mm:ss"));
-                    start++;
-                    foreach (var cell in row.Cells)
-                    {
-                        cell.CellStyle = contentCellStyle;
-                    }
+                    item.CellStyle = titleCellStyle;
                 }
-                // 自适应单元格
-                for (int i = 0; i < sheet.LastRowNum; i++)
+                if (devOpeAccountList == null || devOpeAccountList.Count() == 0)
                 {
-                    sheet.AutoSizeRow(i);
+                    IRow content1 = sheet.CreateRow(1);
+                    content1.CreateCell(0).SetCellValue("暂无数据");
+                    content1.Cells[0].CellStyle = headCellStyle;
+                    sheet.AddMergedRegion(new NPOI.SS.Util.CellRangeAddress(1, 1, 0, 15));
+                    sheet.AddMergedRegion(new NPOI.SS.Util.CellRangeAddress(0, 0, 0, 15));
                 }
-                for (int i = 0; i < 12; i++)
+                else
                 {
-                    sheet.AutoSizeColumn(i, true);
+                    List<RunSpotConfigName> tabs = new List<RunSpotConfigName>();
+                    var confCode = searchModel.C_DevOpeAccountConfigCode;
+                    IRow head = sheet.CreateRow(1);
+                    IRow head2 = sheet.CreateRow(2);
+                    IRow head3 = sheet.CreateRow(3);
+                    head.Height = 30 * 20;
+                    head2.Height = 30 * 20;
+                    head3.Height = 30 * 20;
+                    if (!string.IsNullOrEmpty(confCode))
+                    {
+                        head.CreateCell(0).SetCellValue("日期");
+                        tabs.Add(new RunSpotConfigName { Label = "日期", Name = "Date", BReadDevSpot = false });
+                        sheet.AddMergedRegion(new CellRangeAddress(1, 3, 0, 0));
+                        int cel = 1;
+                        var content = await _devDevOpeAccountConfigService.GetEntityByID(confCode);
+                        if (content != null && !string.IsNullOrEmpty(content.C_Config))
+                        {
+                            var RunSpotConfig = JsonConvert.DeserializeObject<TdevDevOpeAccountConfigNameViewModel>(content.C_Config);
+                            List<RunSpotConfigName> CtabColumns = new List<RunSpotConfigName>();
+                            int headerNum = 1;
+                            foreach (var item in RunSpotConfig?.RunSpotConfigList.ToList())
+                            {
+                                if (item != null)
+                                {
+                                    headerNum = item.Label.Split("@").Count();
+                                    if (item.BReadDevSpot)
+                                    {
+                                        headerNum++;
+                                        tabs.Add(new RunSpotConfigName { Label = item.Label + "@平均值", Name = item.Name, BReadDevSpot = item.BReadDevSpot });
+                                        tabs.Add(new RunSpotConfigName { Label = item.Label + "@最大值", Name = item.Name + "_Max", BReadDevSpot = item.BReadDevSpot });
+                                        tabs.Add(new RunSpotConfigName { Label = item.Label + "@最小值", Name = item.Name + "_Min", BReadDevSpot = item.BReadDevSpot });
+
+                                        CtabColumns.Add(new RunSpotConfigName { Label = item.Label + "@平均值", Name = item.Name, BReadDevSpot = item.BReadDevSpot });
+                                        CtabColumns.Add(new RunSpotConfigName { Label = item.Label + "@最大值", Name = item.Name + "_Max", BReadDevSpot = item.BReadDevSpot });
+                                        CtabColumns.Add(new RunSpotConfigName { Label = item.Label + "@最小值", Name = item.Name + "_Min", BReadDevSpot = item.BReadDevSpot });
+
+                                    }
+                                    else
+                                    {
+                                        tabs.Add(item);
+                                        CtabColumns.Add(item);
+                                    }
+                                }
+                            }
+                            bool IsVal = false; int merge = 0;
+                            bool IsVal2 = false; int merge2 = 0;
+                            foreach (var tab in CtabColumns)
+                            {
+                                if (tab != null)
+                                {
+                                    var vals = tab.Label;
+                                    if (vals.Contains("@"))
+                                    {
+                                        string[] tmp = vals.Split('@');//按,分割字符串 
+                                        if (tmp.Count() == 3)
+                                        {
+                                            var getCel = sheet.GetRow(1).GetCell(cel - 1 - merge).ToString();
+                                            var getCel2 = sheet.GetRow(2).GetCell(cel - 1 - merge2).ToString();
+                                            if (getCel == tmp[0].ToString())
+                                            {
+                                                head.CreateCell(cel).SetCellValue("");
+                                                merge++;
+                                                IsVal = true;
+                                            }
+                                            else
+                                            {
+                                                IsVal = false;
+                                                head.CreateCell(cel).SetCellValue(tmp[0].ToString());
+                                            }
+                                            if (getCel2 == tmp[1].ToString())
+                                            {
+                                                head2.CreateCell(cel).SetCellValue("");
+                                                merge2++;
+                                                IsVal2 = true;
+                                            }
+                                            else
+                                            {
+                                                head2.CreateCell(cel).SetCellValue(tmp[1].ToString());
+                                                IsVal2 = false;
+                                            }
+                                            head3.CreateCell(cel).SetCellValue(tmp[2].ToString());
+                                        }
+                                        else
+                                        {
+                                            IsVal2 = false;
+                                            var getCel = sheet.GetRow(1).GetCell(cel - 1 - merge).ToString();
+                                            if (getCel == tmp[0].ToString())
+                                            {
+                                                head.CreateCell(cel).SetCellValue("");
+                                                merge++;
+                                                IsVal = true;
+                                            }
+                                            else
+                                            {
+                                                IsVal = false;
+                                                head.CreateCell(cel).SetCellValue(tmp[0].ToString());
+                                            }
+                                            head2.CreateCell(cel).SetCellValue(tmp[1].ToString());
+                                            head3.CreateCell(cel).SetCellValue("");
+                                            sheet.AddMergedRegion(new CellRangeAddress(2, 3, cel, cel));
+                                        }
+                                    }
+                                    else
+                                    {
+                                        IsVal = false;
+                                        IsVal2 = false;
+                                        head.CreateCell(cel).SetCellValue(vals);
+                                        head2.CreateCell(cel).SetCellValue("");
+                                        head3.CreateCell(cel).SetCellValue("");
+                                        sheet.AddMergedRegion(new CellRangeAddress(1, 3, cel, cel));
+                                    }
+                                    if (!IsVal && merge > 0)
+                                    {
+                                        sheet.AddMergedRegion(new CellRangeAddress(1, 1, cel - merge - 1, cel - 1));
+                                        merge = 0;
+                                    }
+                                    if (!IsVal2 && merge2 > 0)
+                                    {
+                                        sheet.AddMergedRegion(new CellRangeAddress(2, 2, cel - merge2 - 1, cel - 1));
+                                        merge2 = 0;
+                                    }
+                                    cel++;
+                                }
+                            }
+                            if (cel == CtabColumns.Count + 1 && merge > 0 && IsVal)
+                            {
+                                sheet.AddMergedRegion(new CellRangeAddress(1, 1, cel - merge - 1, cel - 1));
+                                merge = 0; IsVal = false;
+                            }
+                            if (cel == CtabColumns.Count + 1 && merge2 > 0 && IsVal2)
+                            {
+                                sheet.AddMergedRegion(new CellRangeAddress(1, 2, cel - merge2 - 1, cel - 1));
+                                merge2 = 0; IsVal2 = false;
+                            }
+                        }
+                    }
+                    foreach (var item in head.Cells)
+                    {
+                        item.CellStyle = headCellStyle;
+                    }
+                    foreach (var item in head2.Cells)
+                    {
+                        item.CellStyle = headCellStyle;
+                    }
+                    foreach (var item in head3.Cells)
+                    {
+                        item.CellStyle = headCellStyle;
+                    }
+                    int rowNumber = 4;
+                    var confData = devOpeAccountList.Select(t => t.C_Content).ToList();
+                    for (int i = 0; i < confData.Count; i++)
+                    {
+                        IRow content = sheet.CreateRow(rowNumber);
+                        Dictionary<string, object> dict = JsonConvert.DeserializeObject<Dictionary<string, object>>(confData[i]);
+                        int forCount = dict.Count + 1;
+                        if (tabs.Count() > dict.Count) { forCount = tabs.Count() + 1; }
+                        for (int j = 0; j < forCount; j++)
+                        {
+                            if (j < tabs.Count)
+                            {
+                                string celVal = "";
+                                if (dict.ContainsKey(tabs[j].Name))
+                                {
+                                    celVal = dict[tabs[j].Name]?.ToString();
+                                }
+                                if (tabs[j].Name == "RunWhetherNormal")
+                                {
+                                    celVal = celVal.ToLower() == "true" ? "异常" : "正常";
+                                    content.CreateCell(j).SetCellValue(celVal);
+                                }
+                                else if (tabs[j].Name == "Date")
+                                {
+                                    content.CreateCell(j).SetCellValue(Convert.ToDateTime(celVal).ToString("yyyy-MM-dd"));
+                                }
+                                else if (DateTime.TryParse(celVal, out DateTime dt) && celVal.Length >= 10)
+                                {
+                                    content.CreateCell(j).SetCellValue(dt.ToString("yyyy-MM-dd HH:mm:ss"));
+                                }
+                                else
+                                {
+                                    content.CreateCell(j).SetCellValue(celVal);
+                                }
+                            }
+                        }
+                        foreach (var item in content.Cells)
+                        {
+                            item.CellStyle = rowCellStyle;
+                        }
+                        rowNumber++;
+                    }
+
+                    sheet.AddMergedRegion(new NPOI.SS.Util.CellRangeAddress(0, 0, 0, tabs.Count - 1));
+                    for (int i = 0; i <= tabs.Count; i++)
+                    {
+                        sheet.SetColumnWidth(i, 5000);
+                    }
                 }
                 using (var stream = new NpoiMemoryStream())
                 {
@@ -938,7 +1106,7 @@ namespace Ropin.Inspection.Api
                                 }
                                 if (tabs[j].Name == "RunWhetherNormal")
                                 {
-                                    celVal = celVal.ToLower() == "true" ? "是" : "否";
+                                    celVal = celVal.ToLower() == "true" ? "异常" : "正常";
                                     content.CreateCell(j).SetCellValue(celVal);
                                 }else  if (tabs[j].Name == "Date")
                                 {

+ 3 - 3
Ropin.Inspection.Api/TmtnDevOpsController.cs

@@ -190,7 +190,7 @@ namespace Ropin.Inspection.Api
             }
             try
             {
-                await _TmtnDevOpsService.CreateDevOpsAsync(content);
+                var results =  await _TmtnDevOpsService.CreateDevOpsAsync(content);
                 await _pushMsgService.PushAlarmMsgAsync(new TpushMsgModel
                 {
                     C_DevStoreCode = content.C_DevStoreCode,
@@ -201,7 +201,7 @@ namespace Ropin.Inspection.Api
                     DevName = content.C_DevStoreName,
                     GenerationType = 2,
                     msgStatus = 0,
-                }, "设备维保");
+                }, "设备维保",null, results?.C_ID,"1");
             }
             catch (Exception ex)
             {
@@ -258,7 +258,7 @@ namespace Ropin.Inspection.Api
                     DevName = updateModel.C_DevStoreName,
                     GenerationType = 2,
                     msgStatus = 0,
-                }, "设备维保");
+                }, "设备维保",null,id,updateModel.C_Status);
             }
             catch (Exception ex)
             {

+ 3 - 3
Ropin.Inspection.Api/TmtnRepairOrderController.cs

@@ -266,7 +266,7 @@ namespace Ropin.Inspection.Api
             }
             try
             {
-                await _TmtnRepairOrderService.CreateRepairOrderAsync(content);
+                var results = await _TmtnRepairOrderService.CreateRepairOrderAsync(content);
                 //await _pushMsgService.PushAlarmMsgAsync(new TpushMsgModel { 
                 //    C_DevStoreCode = content.C_DevStoreCode, 
                 //    C_MsgTypeCode = "MSG_TYPE_001",
@@ -283,7 +283,7 @@ namespace Ropin.Inspection.Api
                     DevName = "",
                     GenerationType = 2,
                     msgStatus = 0,
-                },"设备维修");
+                },"设备维修",null, results?.C_ID,"1");
             }
             catch (Exception ex)
             {
@@ -358,7 +358,7 @@ namespace Ropin.Inspection.Api
                     DevName = "",
                     GenerationType = 2,
                     msgStatus = 0,
-                }, "设备维修");
+                }, "设备维修",null, id,updateModel.C_Status);
             }
             catch (Exception ex)
             {

+ 1 - 1
Ropin.Inspection.Api/TmtnRepairOrderItemController.cs

@@ -282,7 +282,7 @@ namespace Ropin.Inspection.Api
                     DevName = "",
                     GenerationType = 2,
                     msgStatus = 0,
-                },"设备维修");
+                },"设备维修",null, content.C_RepairCode, content.C_Status);
             }
             catch (Exception ex)
             {

+ 32 - 42
Ropin.Inspection.Common/DataDictionaryHelper.cs

@@ -2,6 +2,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Security.Policy;
 using System.Text;
 using System.Threading.Tasks;
 
@@ -106,58 +107,47 @@ namespace Ropin.Inspection.Common
         /// </summary>
         /// <param name="code"></param>
         /// <returns></returns>
-        public static string GetXCXPage(string code)
+        public static string GetXCXPage(string code,string messId,string dataId,string DevId,string status)
         {
             string val = "";
             try
             {
                 switch (code)
                 {
-                    //case "MSG_TYPE_001": //val = "通知维修"; break;
-                    //    val = WXConstModel.XCXLoginPage; break;
-                    //case "MSG_TYPE_002": //val = "通知运维"; break;
-                    //    val = WXConstModel.XCXLoginPage; break;
-                    //case "MSG_TYPE_003": //val = "通知巡检"; break;
-                    //    val = WXConstModel.XCXLoginPage; break;
-                    //case "MSG_TYPE_004": //val = "巡检异常"; break;
-                    //    val = WXConstModel.XCXLoginPage; break;
-                    //case "MSG_TYPE_005": //val = "异常消除"; break;
-                    //    val = WXConstModel.XCXLoginPage; break;
-                    //case "MSG_TYPE_006": //val = "维修确认"; break;
-                    //    val = WXConstModel.XCXLoginPage; break;
-                    //case "MSG_TYPE_007": //val = "维修取消"; break;
-                    //    val = WXConstModel.XCXLoginPage; break;
-                    //case "MSG_TYPE_008": //val = "维修完成"; break;
-                    //    val = WXConstModel.XCXLoginPage; break;
-                    //case "MSG_TYPE_009": //val = "运维审核"; break;
-                    //    val = WXConstModel.XCXLoginPage; break;
-                    //case "MSG_TYPE_010": //val = "异常确认"; break;
-                    //    val = WXConstModel.XCXLoginPage; break;
+                    case "MSG_TYPE_001": //val = "通知维修"; break;
+                    case "MSG_TYPE_006": //val = "维修确认"; break;
+                    case "MSG_TYPE_007": //val = "维修取消"; break;
+                    case "MSG_TYPE_008": //val = "维修完成"; break;
+                    case "MSG_TYPE_014": //val = "正在维修"; break;
+                    case "MSG_TYPE_015": //val = "维修返工"; break;
+                    case "MSG_TYPE_016": //val = "维修完成确认"; break;
+                        val = WXConstModel.XCXPublicPage + "?MessId=" + messId + "&msgType=" + code + "&Code=" + dataId;
+                        break;
+                    case "MSG_TYPE_002": //val = "通知运维"; break;
+                    case "MSG_TYPE_009": //val = "运维审核"; break;
+                        val = WXConstModel.XCXPublicPage + "?MessId=" + messId + "&msgType=" + code + "&Code=" + dataId;
+                        break;
+                    case "MSG_TYPE_003": //val = "通知巡检"; break;
+                    case "MSG_TYPE_004": //val = "巡检异常"; break;
+                    case "MSG_TYPE_005": //val = "异常消除"; break;
+                    case "MSG_TYPE_010": //val = "异常确认"; break;
                     //case "MSG_TYPE_011": //val = "设备启停"; break;
-                    //    val = WXConstModel.XCXLoginPage; break;
-                    //case "MSG_TYPE_012": //val = "设备点报警"; break;
-                    //    val = WXConstModel.XCXLoginPage; break;
+                    case "MSG_TYPE_012": //val = "设备点报警"; break;
                     //case "MSG_TYPE_013": //val = "设备点报警消除"; break;
-                    //    val = WXConstModel.XCXLoginPage; break;
-                    //case "MSG_TYPE_014": //val = "正在维修"; break;
-                    //    val = WXConstModel.XCXLoginPage; break;
-                    //case "MSG_TYPE_015": //val = "维修返工"; break;
-                    //    val = WXConstModel.XCXLoginPage; break;
-                    //case "MSG_TYPE_016": //val = "维修完成确认"; break;
-                    //    val = WXConstModel.XCXLoginPage; break;
-                    //case "MSG_TYPE_017": //val = "设备点预警"; break;
-                    //    val = WXConstModel.XCXLoginPage; break;
+                    case "MSG_TYPE_017": //val = "设备点预警"; break;
                     //case "MSG_TYPE_018": //val = "设备点预警消除"; break;
-                    //    val = WXConstModel.XCXLoginPage; break;
                     case "MSG_TYPE_019": //val = "报警上报"; break;
-                        val = WXConstModel.XCXAlarmSubmitPage; break;
-                    //case "MSG_TYPE_020": //val = "报警取消"; break;
-                    //case "MSG_TYPE_021": //val = "报警确认"; break;
-                    //case "MSG_TYPE_022": //val = "报警完成"; break;
-                    //case "MSG_TYPE_023": //val = "手动报警"; break;
-                    //    val = WXConstModel.XCXLoginPage; break;
-                    //case "MSG_TYPE_024": //val = "AI设备报警"; break;
-                    //    val = WXConstModel.XCXLoginPage; break;
+                        val = WXConstModel.XCXPublicPage + "?MessId=" + messId + "&msgType=" + code + "&Code=" + dataId ;
+                        break;
+                    case "MSG_TYPE_020": //val = "报警取消"; break;
+                    case "MSG_TYPE_021": //val = "报警确认"; break;
+                    case "MSG_TYPE_022": //val = "报警完成"; break;
+                        val = WXConstModel.XCXPublicPage + "?MessId=" + messId + "&msgType=" + code + "&Code=" + dataId + "&Status=" + status;
+                        break;
+                    case "MSG_TYPE_023": //val = "手动报警"; break;
+                    case "MSG_TYPE_024": //val = "AI设备报警"; break;
+                        val = WXConstModel.XCXPublicPage + "?MessId=" + messId + "&msgType=" + code + "&Code=" + messId; 
+                        break;
                     default:   val = ""; break;
                 }
             }

+ 6 - 1
Ropin.Inspection.Common/Helper/WeChatHelper.cs

@@ -363,11 +363,16 @@ namespace Ropin.Inspection.Common.Helper
     public static class WXConstModel
     {
         public const string XCXLoginPage = "pages/login/login";
+        public const string XCXPublicPage = "baoNet/PublicPage/index";
         /// <summary>
-        /// 报警上报
+        /// 报警上报-id=消息ID
         /// </summary>
         public const string XCXAlarmSubmitPage = "baoworlk/Alarm/Alarmdata?id=";
         /// <summary>
+        /// 报警上报确认 详情页面-id=报警工单id
+        /// </summary>
+        public const string XCXAlarmVerifyPage = "baoworlk/Alarmacknowledgement/Alarmdata?id=";
+        /// <summary>
         /// 手表健康告警提醒-模板ID-长期订阅模板
         /// </summary>
         public const string WatchHealthAlarm_TemplateId = "xVR2kPGC3lCaXqYlEmmlcPdgA8KFstXEC4eC8LWSz0I";

+ 0 - 1
Ropin.Inspection.Model/Entities/TSYS_Message.cs

@@ -19,7 +19,6 @@ namespace Ropin.Inspection.Model.Entities
         public string C_GenerationCode { get; set; }
         public int? I_GenerationType { get; set; } = 1;
         public int? I_MsgStatus { get; set; } = 0;
-        public string C_WxJumpURL { get; set; }
         public string C_Remark { get; set; }
         public string C_CreateBy { get; set; }
         public string C_Creator { get; set; }

+ 3 - 0
Ropin.Inspection.Model/TaicTemplateModel.cs

@@ -61,6 +61,9 @@ namespace Ropin.Inspection.Model
 
     public class AiBoxSearchModel : BaseSearchModel
     {
+        [Required]
+        public string CStoreCode { get; set; }
+        public int? CStatus { get; set; }
         public string Name { get; set; }
     }
 

+ 0 - 1
Ropin.Inspection.Model/ViewModel/SYS/TsysMessageUpdateModel.cs

@@ -18,7 +18,6 @@ namespace Ropin.Inspection.Model
         public string C_GenerationCode { get; set; }
         public int? I_GenerationType { get; set; } = 1;
         public int? I_MsgStatus { get; set; } = 0;
-        public string C_WxJumpURL { get; set; }
         public string C_Remark { get; set; }
         public string C_CreateBy { get; set; }
         public string C_Creator { get; set; }

+ 0 - 2
Ropin.Inspection.Model/ViewModel/SYS/TsysMessageViewModel.cs

@@ -23,7 +23,6 @@ namespace Ropin.Inspection.Model
         public int? I_MsgStatus { get; set; } = 0;
         public string C_Url {get;set;}
         public string C_StaticUrl{get;set; }
-        public string C_WxJumpURL { get; set; }
         public string C_Remark { get; set; }
         public string C_CreateBy { get; set; }
         public string C_Creator { get; set; }
@@ -50,7 +49,6 @@ namespace Ropin.Inspection.Model
         public string C_GenerationCode { get; set; }
         public int? I_GenerationType { get; set; } = 1;
         public int? I_MsgStatus { get; set; } = 0;
-        public string C_WxJumpURL { get; set; }
         public string C_Remark { get; set; }
         public string C_CreateBy { get; set; }
         public string C_Creator { get; set; }

+ 1 - 1
Ropin.Inspection.Service/IPushMsgService.cs

@@ -11,7 +11,7 @@ namespace Ropin.Inspection.Service
 {
     public interface IPushMsgService
     {
-        Task<bool> PushAlarmMsgAsync(TpushMsgModel pushModel, string Subject = null, RabbitMQModel rabbitMQModel = null, string UrlId = null);
+        Task<bool> PushAlarmMsgAsync(TpushMsgModel pushModel, string Subject = null, RabbitMQModel rabbitMQModel = null, string UrlId = null, string status = null);
         Task PushRecordMsgAsync(string type, TispRecordItemAlarmDetailViewModel viewModel);
     }
 }

+ 2 - 1
Ropin.Inspection.Service/ITmtnDevOpsService.cs

@@ -7,6 +7,7 @@ using System.Linq.Expressions;
 using System.Text;
 using System.Threading.Tasks;
 using Ropin.Inspection.Model.ViewModel;
+using Ropin.Inspection.Model.Entities;
 
 namespace Ropin.Inspection.Service
 {
@@ -17,7 +18,7 @@ namespace Ropin.Inspection.Service
         Task UpdateAsync(string code, TmtnDevOpsUpdateModel updateModel);
         Task<IEnumerable<TmtnDevOpsViewModel>> GetConditionAsync(TmtnDevOpsSearchModel searchModel);
         Task DeleteAsync(string code);
-        Task CreateDevOpsAsync(TmtnDevOpsViewModel content);
+        Task<TMTN_DevOps> CreateDevOpsAsync(TmtnDevOpsViewModel content);
         Task<IEnumerable<TmtnDevOpsWithImageViewModel>> GetDevOpsWithImageAsync(TmtnDevOpsOrderSearchModel searchModel);
         Task<TispRecord30DaysStatisticsViewModel> GetRecords30DaysStatisticsAsync(string storeCode);
         Task<IEnumerable<FullScreenRecordItem>> GetRecords30DaysStatisticsFullScreenAsync(string storeCode);

+ 2 - 1
Ropin.Inspection.Service/ITmtnRepairOrderService.cs

@@ -1,4 +1,5 @@
 using Ropin.Inspection.Model;
+using Ropin.Inspection.Model.Entities;
 using Ropin.Inspection.Model.ViewModel;
 using Ropin.Inspection.Service.Interface;
 using System;
@@ -17,7 +18,7 @@ namespace Ropin.Inspection.Service
         Task UpdateAsync(string code, TmtnRepairOrderUpdateModel updateModel);
         Task<IEnumerable<TmtnRepairOrderViewModel>> GetConditionAsync(TmtnRepairOrderSearchModel searchModel);
         Task DeleteAsync(string code);
-        Task CreateRepairOrderAsync(TmtnRepairOrderViewModel content);
+        Task<TMTN_RepairOrder> CreateRepairOrderAsync(TmtnRepairOrderViewModel content);
         Task<IEnumerable<TmtnRepairOrderWithImageViewModel>> GetRepairOrderWithImageAsync(TmtnRepairOrderSearchModel searchModel);
         Task<IEnumerable<TmtnRepairOrderRecordDetailViewMode>> GetRecordsConditionAsync(TmtnRepairOrderRecordSearchModel searchModel);
 

+ 83 - 276
Ropin.Inspection.Service/PushMsgService.cs

@@ -70,8 +70,9 @@ namespace Ropin.Inspection.Service
         /// <param name="Subject"></param>
         /// <param name="rabbitMQModel"></param>
         /// <param name="UrlId">跳转小程序URLID</param>
+        /// <param name="status">状态</param>
         /// <returns></returns>
-        public async Task<bool> PushAlarmMsgAsync(TpushMsgModel pushModel,string Subject=null,RabbitMQModel rabbitMQModel=null, string UrlId = null)
+        public async Task<bool> PushAlarmMsgAsync(TpushMsgModel pushModel,string Subject=null,RabbitMQModel rabbitMQModel=null, string UrlId = null,string status=null)
         {
             try
             {
@@ -81,16 +82,6 @@ namespace Ropin.Inspection.Service
                 log.Info($"发送消息-接收数据【{JsonConvert.SerializeObject(pushModel)}】");
                 int msgStatus = DataDictionaryHelper.GetMsgStatus(pushModel.C_MsgTypeCode);
                 pushModel.msgStatus = msgStatus;
-
-                string miniProgramAppId = "";//跳转小程序的Appid
-                //获取小程序页面
-                string miniProgramPagePath = DataDictionaryHelper.GetXCXPage(pushModel.C_MsgTypeCode);
-                if (!string.IsNullOrEmpty(miniProgramPagePath))
-                {
-                    miniProgramPagePath = miniProgramPagePath+ UrlId;
-                    miniProgramAppId = WXConstModel.XCXAppId;
-                }
-
                 string createBy = "6e864cbc-5252-11ec-8681-fa163e02b3e4";
                 var devStore = await _tdevDevStoreRepository.GetByIdAsync(pushModel.C_DevStoreCode);
                 if(devStore == null) return await Task.FromResult(false);
@@ -270,7 +261,6 @@ namespace Ropin.Inspection.Service
                     I_GenerationType = pushModel.GenerationType,
                     I_MsgStatus = pushModel.msgStatus,
                     C_DevStoreCode = pushModel.C_DevStoreCode,
-                    C_WxJumpURL = miniProgramPagePath,
                     C_Remark = "",
                     C_CreateBy = createBy,
                     C_Creator = "Api",
@@ -297,275 +287,93 @@ namespace Ropin.Inspection.Service
                         FileList.Add(mesFile);
                     }
                 }
-                if (sendUserWechatIDList.Any())
+
+                _messageRepository.Create(message);
+                bool messResult = await _messageRepository.SaveAsync();
+                if (messResult)
                 {
-                    try
+                    if (FileList != null && FileList.Count > 0)
                     {
-                        #region 一次性订阅 -不用了【2025-2-11】
-                        //switch (pushModel.C_MsgTypeCode)
-                        //{
-                        //    case "MSG_TYPE_001"://通知维修消息
-                        //                        //var MSG_TYPE_001 = new
-                        //                        //{
-                        //                        //    character_string19 = new { value = pushModel.DevNumber ?? "" },
-                        //                        //    name4 = new { value = pushModel.UserName ?? "" },
-                        //                        //    thing7 = new { value = pushModel.Subject ?? "" },
-                        //                        //    time15 = new { value = pushModel.DevName ?? "" },
-                        //                        //    thing16 = new { value = pushModel.Msg ?? "" }
-                        //                        //};
-                        //                        //new WeChatHelper(_httpClientFactory).PushMessageToUser(sendUserWechatIDList, MSG_TYPE_001, "jGFacWkS9keOmvN71DN-7qX-wR30NdqOuQaPSNIMfnk");//
-                        //        var MSG_TYPE_001 = new
-                        //        {
-                        //            character_string1 = new { value = pushModel.DevNumber ?? "" },
-                        //            thing2 = new { value = pushModel.DevName ?? "" },
-                        //            thing16 = new { value = pushModel.Subject ?? "" },
-                        //            time5 = new { value = DateTime.Now.ToString("yyyy-MM-dd hh:mm") },
-                        //            thing6 = new { value = pushModel.Msg ?? "" }
-                        //        };
-                        //        new WeChatHelper(_httpClientFactory).PushMessageToUser(sendUserWechatIDList, MSG_TYPE_001);//
-                        //        break;
-                        //    case "MSG_TYPE_002"://通知运维消息
-                        //                        //var MSG_TYPE_002 = new
-                        //                        //{
-                        //                        //    character_string19 = new { value = pushModel.DevNumber ?? "" },
-                        //                        //    name4 = new { value = pushModel.UserName ?? "" },
-                        //                        //    thing7 = new { value = pushModel.Subject ?? "" },
-                        //                        //    time15 = new { value = pushModel.DevName ?? "" },
-                        //                        //    thing16 = new { value = pushModel.Msg ?? "" }
-                        //                        //};
-                        //                        //new WeChatHelper(_httpClientFactory).PushMessageToUser(sendUserWechatIDList, MSG_TYPE_002, "jGFacWkS9keOmvN71DN-7qX-wR30NdqOuQaPSNIMfnk");//
-                        //        var MSG_TYPE_002 = new
-                        //        {
-                        //            character_string1 = new { value = pushModel.DevNumber ?? "" },
-                        //            thing2 = new { value = pushModel.DevName ?? "" },
-                        //            thing16 = new { value = pushModel.Subject ?? "" },
-                        //            time5 = new { value = DateTime.Now.ToString("yyyy-MM-dd hh:mm") },
-                        //            thing6 = new { value = pushModel.Msg ?? "" }
-                        //        };
-                        //        new WeChatHelper(_httpClientFactory).PushMessageToUser(sendUserWechatIDList, MSG_TYPE_002);//
-                        //        break;
-                        //    case "MSG_TYPE_003"://通知巡检消息
-                        //                        //var MSG_TYPE_003 = new
-                        //                        //{
-                        //                        //    character_string19 = new { value = pushModel.DevNumber ?? "" },
-                        //                        //    name4 = new { value = pushModel.UserName ?? "" },
-                        //                        //    thing7 = new { value = pushModel.Subject ?? "" },
-                        //                        //    time15 = new { value = pushModel.DevName ?? "" },
-                        //                        //    thing16 = new { value = pushModel.Msg ?? "" }
-                        //                        //};
-                        //                        //new WeChatHelper(_httpClientFactory).PushMessageToUser(sendUserWechatIDList, MSG_TYPE_003, "jGFacWkS9keOmvN71DN-7qX-wR30NdqOuQaPSNIMfnk");//
-                        //        var MSG_TYPE_003 = new
-                        //        {
-                        //            character_string1 = new { value = pushModel.DevNumber ?? "" },
-                        //            thing2 = new { value = pushModel.DevName ?? "" },
-                        //            thing16 = new { value = pushModel.Subject ?? "" },
-                        //            time5 = new { value = DateTime.Now.ToString("yyyy-MM-dd hh:mm") },
-                        //            thing6 = new { value = pushModel.Msg ?? "" }
-                        //        };
-                        //        new WeChatHelper(_httpClientFactory).PushMessageToUser(sendUserWechatIDList, MSG_TYPE_003);//
-                        //        break;
-                        //    case "MSG_TYPE_004"://巡检异常消息
-                        //        var MSG_TYPE_004 = new
-                        //        {
-                        //            character_string1 = new { value = pushModel.DevNumber ?? "" },
-                        //            thing2 = new { value = pushModel.DevName ?? "" },
-                        //            thing16 = new { value = pushModel.Subject ?? "" },
-                        //            time5 = new { value = DateTime.Now.ToString("yyyy-MM-dd hh:mm") },
-                        //            thing6 = new { value = pushModel.Msg ?? "" }
-                        //        };
-                        //        new WeChatHelper(_httpClientFactory).PushMessageToUser(sendUserWechatIDList, MSG_TYPE_004);
-                        //        break;
-                        //    case "MSG_TYPE_005"://异常消除消息
-                        //        var MSG_TYPE_005 = new
-                        //        {
-                        //            character_string1 = new { value = pushModel.DevNumber ?? "" },
-                        //            thing2 = new { value = pushModel.DevName ?? "" },
-                        //            thing16 = new { value = pushModel.Subject ?? "" },
-                        //            time5 = new { value = DateTime.Now.ToString("yyyy-MM-dd hh:mm") },
-                        //            thing6 = new { value = pushModel.Msg ?? "" }
-                        //        };
-                        //        new WeChatHelper(_httpClientFactory).PushMessageToUser(sendUserWechatIDList, MSG_TYPE_005);
-                        //        break;
-                        //    case "MSG_TYPE_006"://维修确认消息
-                        //        var MSG_TYPE_006 = new
-                        //        {
-                        //            character_string1 = new { value = pushModel.DevNumber ?? "" },
-                        //            thing2 = new { value = pushModel.DevName ?? "" },
-                        //            thing16 = new { value = pushModel.Subject ?? "" },
-                        //            time5 = new { value = DateTime.Now.ToString("yyyy-MM-dd hh:mm") },
-                        //            thing6 = new { value = pushModel.Msg ?? "" }
-                        //        };
-                        //        new WeChatHelper(_httpClientFactory).PushMessageToUser(sendUserWechatIDList, MSG_TYPE_006);
-                        //        break;
-                        //    case "MSG_TYPE_007"://维修取消消息
-                        //        var MSG_TYPE_007 = new
-                        //        {
-                        //            character_string1 = new { value = pushModel.DevNumber ?? "" },
-                        //            thing2 = new { value = pushModel.DevName ?? "" },
-                        //            thing16 = new { value = pushModel.Subject ?? "" },
-                        //            time5 = new { value = DateTime.Now.ToString("yyyy-MM-dd hh:mm") },
-                        //            thing6 = new { value = pushModel.Msg ?? "" }
-                        //        };
-                        //        new WeChatHelper(_httpClientFactory).PushMessageToUser(sendUserWechatIDList, MSG_TYPE_007);
-                        //        break;
-                        //    case "MSG_TYPE_008"://维修完成消息
-                        //    case "MSG_TYPE_014"://正在维修消息
-                        //    case "MSG_TYPE_015"://维修返工消息
-                        //    case "MSG_TYPE_016"://维修完成确认
-                        //        var MSG_TYPE_008 = new
-                        //        {
-                        //            character_string1 = new { value = pushModel.DevNumber ?? "" },
-                        //            thing2 = new { value = pushModel.DevName ?? "" },
-                        //            thing16 = new { value = pushModel.Subject ?? "" },
-                        //            time5 = new { value = DateTime.Now.ToString("yyyy-MM-dd hh:mm") },
-                        //            thing6 = new { value = pushModel.Msg ?? "" }
-                        //        };
-                        //        new WeChatHelper(_httpClientFactory).PushMessageToUser(sendUserWechatIDList, MSG_TYPE_008);
-                        //        break;
-                        //    case "MSG_TYPE_009"://运维取消消息
-                        //        var MSG_TYPE_009 = new
-                        //        {
-                        //            character_string1 = new { value = pushModel.DevNumber ?? "" },
-                        //            thing2 = new { value = pushModel.DevName ?? "" },
-                        //            thing16 = new { value = pushModel.Subject ?? "" },
-                        //            time5 = new { value = DateTime.Now.ToString("yyyy-MM-dd hh:mm") },
-                        //            thing6 = new { value = pushModel.Msg ?? "" }
-                        //        };
-                        //        new WeChatHelper(_httpClientFactory).PushMessageToUser(sendUserWechatIDList, MSG_TYPE_009);
-                        //        break;
-                        //    case "MSG_TYPE_010"://异常确认消息
-                        //        var MSG_TYPE_010 = new
-                        //        {
-                        //            character_string1 = new { value = pushModel.DevNumber ?? "" },
-                        //            thing2 = new { value = pushModel.DevName ?? "" },
-                        //            thing16 = new { value = pushModel.Subject ?? "" },
-                        //            time5 = new { value = DateTime.Now.ToString("yyyy-MM-dd hh:mm") },
-                        //            thing6 = new { value = pushModel.Msg ?? "" }
-                        //        };
-                        //        new WeChatHelper(_httpClientFactory).PushMessageToUser(sendUserWechatIDList, MSG_TYPE_010);
-                        //        break;
-                        //    case "MSG_TYPE_011"://设备启停消息
-                        //        var MSG_TYPE_011 = new
-                        //        {
-                        //            character_string1 = new { value = pushModel.DevNumber ?? "" },
-                        //            thing2 = new { value = pushModel.DevName ?? "" },
-                        //            thing16 = new { value = pushModel.Subject ?? "" },
-                        //            time5 = new { value = DateTime.Now.ToString("yyyy-MM-dd hh:mm") },
-                        //            thing6 = new { value = pushModel.Msg ?? "" }
-                        //        };
-                        //        new WeChatHelper(_httpClientFactory).PushMessageToUser(sendUserWechatIDList, MSG_TYPE_011);
-                        //        break;
-                        //    case "MSG_TYPE_012"://设备点报警
-                        //        var MSG_TYPE_012 = new
-                        //        {
-                        //            character_string1 = new { value = pushModel.DevNumber ?? "" },
-                        //            thing2 = new { value = pushModel.DevName ?? "" },
-                        //            thing16 = new { value = pushModel.Subject ?? "" },
-                        //            time5 = new { value = DateTime.Now.ToString("yyyy-MM-dd hh:mm") },
-                        //            thing6 = new { value = pushModel.Msg ?? "" }
-                        //        };
-                        //        new WeChatHelper(_httpClientFactory).PushMessageToUser(sendUserWechatIDList, MSG_TYPE_012);
-                        //        break;
-                        //    case "MSG_TYPE_013"://设备点报警取消
-                        //        var MSG_TYPE_013 = new
-                        //        {
-                        //            character_string1 = new { value = pushModel.DevNumber ?? "" },
-                        //            thing2 = new { value = pushModel.DevName ?? "" },
-                        //            thing16 = new { value = pushModel.Subject ?? "" },
-                        //            time5 = new { value = DateTime.Now.ToString("yyyy-MM-dd hh:mm") },
-                        //            thing6 = new { value = pushModel.Msg ?? "" }
-                        //        };
-                        //        new WeChatHelper(_httpClientFactory).PushMessageToUser(sendUserWechatIDList, MSG_TYPE_013);
-                        //        break;
-                        //    case "MSG_TYPE_019"://上报报警
-                        //    case "MSG_TYPE_020"://报警取消
-                        //    case "MSG_TYPE_021"://报警确认
-                        //    case "MSG_TYPE_022"://报警完成
-                        //        var MSG_TYPE_020 = new
-                        //        {
-                        //            character_string1 = new { value = pushModel.DevNumber ?? "" },
-                        //            thing2 = new { value = pushModel.DevName ?? "" },
-                        //            thing16 = new { value = pushModel.Subject ?? "" },
-                        //            time5 = new { value = DateTime.Now.ToString("yyyy-MM-dd hh:mm") },
-                        //            thing6 = new { value = pushModel.Msg ?? "" }
-                        //        };
-                        //        new WeChatHelper(_httpClientFactory).PushMessageToUser(sendUserWechatIDList, MSG_TYPE_020);
-                        //        break;
-                        //    default:
-                        //        break;
-                        //}
-                        #endregion
+                        int fileSaveResult = await _tsysMessageFileRepository.CreateRangeAsync(FileList);
+                    }
+                    string miniProgramAppId = "";//跳转小程序的Appid
+                    //获取小程序页面
+                    string miniProgramPagePath = DataDictionaryHelper.GetXCXPage(pushModel.C_MsgTypeCode, message.C_ID, UrlId, pushModel.C_DevStoreCode, status);
+                    if (!string.IsNullOrEmpty(miniProgramPagePath))
+                    {
+                        miniProgramAppId = WXConstModel.XCXAppId;
+                    }
+                    if (sendUserWechatIDList.Any())
+                    {
+                        try
+                        {
 
-                        string typeName = tBDMCodeDetailList.Where(i => i.C_Code == pushModel.C_MsgTypeCode).Select(x => x.C_Name).FirstOrDefault();
-                        #region 长期订阅 【2025-2-11】
-                        //var content = new
-                        //{
-                        //    character_string1 = new { value = devStore.C_NumberCode ?? "" },
-                        //    time2 = new { value = DateTime.Now.ToString("yyyy-MM-dd hh:mm") },
-                        //    short_thing3 = new { value = typeName ?? "" }
-                        //};
-                        //new WeChatHelper(_httpClientFactory).PushMessageToUser(sendUserWechatIDList, content, WXConstModel.WatchHealthAlarm_TemplateId);
-                        #endregion
+                            string typeName = tBDMCodeDetailList.Where(i => i.C_Code == pushModel.C_MsgTypeCode).Select(x => x.C_Name).FirstOrDefault();
+                            #region 长期订阅 【2025-2-11】
+                            //var content = new
+                            //{
+                            //    character_string1 = new { value = devStore.C_NumberCode ?? "" },
+                            //    time2 = new { value = DateTime.Now.ToString("yyyy-MM-dd hh:mm") },
+                            //    short_thing3 = new { value = typeName ?? "" }
+                            //};
+                            //new WeChatHelper(_httpClientFactory).PushMessageToUser(sendUserWechatIDList, content, WXConstModel.WatchHealthAlarm_TemplateId);
+                            #endregion
+
+                            #region 公众号模板【2025-3-5】
+                            string msg = pushModel.Msg;
+                            if (string.IsNullOrEmpty(msg))
+                            {
+                                msg = DataDictionaryHelper.GetValNameByCode(pushModel.C_MsgTypeCode);
+                            }
+                            if (msg.Length > 20)
+                            {
+                                msg = msg.Substring(0, 17) + "...";
+                            }
+                            string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
+                            if (!string.IsNullOrEmpty(pushModel.CreateOn))
+                            {
+                                time = Convert.ToDateTime(pushModel.CreateOn).ToString("yyyy-MM-dd HH:mm");
+                            }
+                            #region //_wP22WQxAlfYGfS8zlnHTl_-KgKS8j_FP5HDeqfsPtU
+                            //设备编号{ { character_string2.DATA} }
+                            //设备名称{ { thing1.DATA} }
+                            //关闭状态{ { thing3.DATA} }
+                            //关闭时间{ { time4.DATA} }
+                            //var data = new
+                            //{
+                            //    thing1 = new { value = devStore.C_Name }, //异常位置
+                            //    character_string2 = new { value = devStore.C_NumberCode },//异常点位
+                            //    thing3 = new { value = typeName }, //上报人
+                            //    time4 = new { value = pushModel.CreateOn}//上报时间
+                            //};
+                            #endregion
+
+                            #region 7eGjzIBAyysTOLfcn-oqkpOCEL_My5ItXHkd_DdniGw
+                            //设备名称{ { thing2.DATA} }
+                            //设备编号{ { character_string20.DATA} }
+                            //报警时间{ { time4.DATA} }
+                            //报警内容{ { thing5.DATA} }
+                            var data = new
+                            {
+                                thing2 = new { value = devStore.C_Name }, //设备名称
+                                character_string20 = new { value = devStore.C_NumberCode },//设备编号
+                                thing5 = new { value = msg }, //报警内容
+                                time4 = new { value = time }//报警时间
+                            };
+                            #endregion
+
+                            var row = new WeChatHelper(_httpClientFactory).PushGZHMessageToUser(sendUserWechatIDList, WXConstModel.GZHDevAlarmTemplateId, "", data, miniProgramAppId, miniProgramPagePath);
+                            #endregion
 
-                        #region 公众号模板【2025-3-5】
-                        string msg = pushModel.Msg;
-                        if (msg.Length>20)
-                        {
-                            msg=msg.Substring(0,17)+"...";
                         }
-                        string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
-                        if (!string.IsNullOrEmpty(pushModel.CreateOn))
+                        catch (Exception ex)
                         {
-                            time=Convert.ToDateTime(pushModel.CreateOn).ToString("yyyy-MM-dd HH:mm");
+                            log.Info($" 发送消息-WeChatHelper-发送异常【C_MsgTypeCode={pushModel.C_MsgTypeCode}】 异常信息:{ex.Message}");
+                            throw;
                         }
-                        #region //_wP22WQxAlfYGfS8zlnHTl_-KgKS8j_FP5HDeqfsPtU
-                        //设备编号{ { character_string2.DATA} }
-                        //设备名称{ { thing1.DATA} }
-                        //关闭状态{ { thing3.DATA} }
-                        //关闭时间{ { time4.DATA} }
-                        //var data = new
-                        //{
-                        //    thing1 = new { value = devStore.C_Name }, //异常位置
-                        //    character_string2 = new { value = devStore.C_NumberCode },//异常点位
-                        //    thing3 = new { value = typeName }, //上报人
-                        //    time4 = new { value = pushModel.CreateOn}//上报时间
-                        //};
-                        #endregion
-
-                        #region 7eGjzIBAyysTOLfcn-oqkpOCEL_My5ItXHkd_DdniGw
-                        //设备名称{ { thing2.DATA} }
-                        //设备编号{ { character_string20.DATA} }
-                        //报警时间{ { time4.DATA} }
-                        //报警内容{ { thing5.DATA} }
-                        var data = new
-                        {
-                            thing2 = new { value = devStore.C_Name }, //异常位置
-                            character_string20 = new { value = devStore.C_NumberCode },//异常点位
-                            thing5 = new { value = msg }, //上报人
-                            time4 = new { value = time }//上报时间
-                        };
-                        #endregion
-                        
-                        var row = new WeChatHelper(_httpClientFactory).PushGZHMessageToUser(sendUserWechatIDList, WXConstModel.GZHDevAlarmTemplateId, "", data, miniProgramAppId, miniProgramPagePath);
-                        #endregion
-
                     }
-                    catch (Exception ex)
+                    if (pushMsgResultList.Any())
                     {
-                        log.Info($" 发送消息-WeChatHelper-发送异常【C_MsgTypeCode={pushModel.C_MsgTypeCode}】 异常信息:{ex.Message}");
-                        throw;
-                    }
-                }
-                if (pushMsgResultList.Any())
-                {
-                    _messageRepository.Create(message);
-                    bool messResult = await _messageRepository.SaveAsync();
-                    if (messResult)
-                    {
-                        if (FileList!=null&& FileList.Count>0)
-                        {
-                            int fileSaveResult = await _tsysMessageFileRepository.CreateRangeAsync(FileList);
-                        }
                         //await _tmtnPushMsgResultRepository.CreateRangeAsync(pushMsgResultList);
                         foreach (var content in pushMsgResultList)
                         {
@@ -593,10 +401,9 @@ namespace Ropin.Inspection.Service
                             }
                         }
                     }
-                    else
-                    {
-                        log.Info($"发送消息-TSYS_Message 数据添加失败【{JsonConvert.SerializeObject(message)}】");
-                    }
+                }
+                else { 
+                    log.Info($"发送消息-TSYS_Message 数据添加失败【{JsonConvert.SerializeObject(message)}】"); 
                 }
                 log.Info($"发送消息-END");
                 return await Task.FromResult(true);

+ 3 - 0
Ropin.Inspection.Service/TAIC/Interface/ITaicAIBoxTemplateService.cs

@@ -28,5 +28,8 @@ namespace Ropin.Inspection.Service.TAIC.Interface
         Task<bool> UpdateAiBox(string id,AiBoxModel aiBoxModel);
 
         Task<bool> AddDevAIBox(DevAiboxModel devAiboxModel);
+
+        Task<object> GetDevAibox(string aiboxCode);
+        Task<bool> DelDevAibox(string id);
     }
 }

+ 35 - 1
Ropin.Inspection.Service/TAIC/TaicAIBoxTemplateService.cs

@@ -1,5 +1,7 @@
 using AutoMapper;
 using LinqKit;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Internal;
 using Ropin.Inspection.Common.Accessor.Interface;
 using Ropin.Inspection.Model;
 using Ropin.Inspection.Model.Entities;
@@ -10,6 +12,7 @@ using Ropin.Inspection.Service.TAIC.Interface;
 using System;
 using System.Collections.Generic;
 using System.Diagnostics.SymbolStore;
+using System.Linq;
 using System.Threading.Tasks;
 
 namespace Ropin.Inspection.Service.TAIC
@@ -121,12 +124,16 @@ namespace Ropin.Inspection.Service.TAIC
 
         public async Task<List<AiBoxModel>> GetAiBoxPage(AiBoxSearchModel searchModel)
         {
-            var predicate = PredicateBuilder.New<TaicAibox>(true);//查询条件,推荐后台使用这种方式灵活筛选
+            var predicate = PredicateBuilder.New<TaicAibox>(x=>x.CStoreCode==searchModel.CStoreCode);//查询条件,推荐后台使用这种方式灵活筛选
             #region 添加条件查询
             if (!string.IsNullOrEmpty(searchModel.Name))
             {
                 predicate = predicate.And(i => i.CName.Contains(searchModel.Name));
             }
+            if (searchModel.CStatus.HasValue)
+            {
+                predicate = predicate.And(i => i.CStatus == searchModel.CStatus);
+            }
             #endregion
             var pageData = await _taicAIBoxRepository.GetPageAsync(predicate, "I_Sort", true, searchModel.PageIndex, searchModel.PageSize);
             searchModel.TotalCount = pageData.Totals;
@@ -205,10 +212,37 @@ namespace Ropin.Inspection.Service.TAIC
                     DCreateOn = DateTime.Now,
                 });
             });
+            var dels = await _taicAIBoxRepository.DbContext.TaicDevAiboxes.Where(x => x.CAiboxCode == devAiboxModel.CAiboxCode).ToListAsync();
+            _taicAIBoxRepository.DbContext.TaicDevAiboxes.RemoveRange(dels);
             await _taicAIBoxRepository.DbContext.TaicDevAiboxes.AddRangeAsync(devAiboxes);
             var row =await _taicAIBoxRepository.SaveAsync();
             return row;
         }
+
+        public async Task<object> GetDevAibox(string aiboxCode)
+        {
+            var queryAble= from tda in _taicAIBoxRepository.DbContext.TaicDevAiboxes
+            join aibox in _taicAIBoxRepository.DbContext.TaicAiboxes on tda.CAiboxCode equals aibox.CId
+            join camera in _taicAIBoxRepository.DbContext.TVMC_Camera on tda.CCameraCode equals camera.C_ID
+            where tda.CAiboxCode == aiboxCode
+            select new
+            {
+                tda.CId,
+                camera.C_Name,
+                camera.C_CameraNo,
+                tda.DCreateOn
+            };
+            var result=await queryAble.ToListAsync();
+            return result;
+        }
+
+        public async Task<bool> DelDevAibox(string id)
+        {
+            var devAibox=_taicAIBoxRepository.DbContext.TaicDevAiboxes.Where(x => x.CId == id).FirstOrDefault();
+            _taicAIBoxRepository.DbContext.TaicDevAiboxes.Remove(devAibox);
+            var row = await _taicAIBoxRepository.SaveAsync();
+            return row;
+        }
         #endregion
     }
 }

+ 3 - 1
Ropin.Inspection.Service/TmtnDevOpsService.cs

@@ -179,7 +179,7 @@ namespace Ropin.Inspection.Service
                 throw new Exception("创建失败");
             }
         }
-        public async Task CreateDevOpsAsync(TmtnDevOpsViewModel content)
+        public async Task<TMTN_DevOps> CreateDevOpsAsync(TmtnDevOpsViewModel content)
         {
             TMTN_DevOps record = new TMTN_DevOps();
             record.C_Name = content.C_Name;
@@ -269,8 +269,10 @@ namespace Ropin.Inspection.Service
             var result = await _repository.SaveAsync();
             if (!result)
             {
+                record = null;
                 throw new Exception("创建失败");
             }
+            return record;
         }
         public async Task DeleteAsync(Guid id)
         {

+ 3 - 1
Ropin.Inspection.Service/TmtnRepairOrderService.cs

@@ -95,7 +95,7 @@ namespace Ropin.Inspection.Service
             var contentDtoList = _mapper.Map<IEnumerable<TmtnRepairOrderViewModel>>(pagedList.Where(i => i.C_Status == "1").ToList());
             return contentDtoList.ToList();
         }
-        public async Task CreateRepairOrderAsync(TmtnRepairOrderViewModel content)
+        public async Task<TMTN_RepairOrder> CreateRepairOrderAsync(TmtnRepairOrderViewModel content)
         {
             //var contentDto = _mapper.Map<TmtnRepairOrderViewModel>(content);
             TMTN_RepairOrder record = new TMTN_RepairOrder();
@@ -171,8 +171,10 @@ namespace Ropin.Inspection.Service
             var result = await _repository.SaveAsync();
             if (!result)
             {
+                record = null;
                 throw new Exception("创建失败");
             }
+            return record;
         }
         public async Task<IEnumerable<TmtnRepairOrderViewModel>> GetConditionAsync(TmtnRepairOrderSearchModel searchModel)
         {