diff --git a/ZR.Admin.WebApi/Controllers/mes/andon/AndonAlarmRecordController.cs b/ZR.Admin.WebApi/Controllers/mes/andon/AndonAlarmRecordController.cs index a5a5de74..8a5dc725 100644 --- a/ZR.Admin.WebApi/Controllers/mes/andon/AndonAlarmRecordController.cs +++ b/ZR.Admin.WebApi/Controllers/mes/andon/AndonAlarmRecordController.cs @@ -41,6 +41,7 @@ namespace ZR.Admin.WebApi.Controllers.andon //TODO 导出excel [HttpGet("exportData")] + [ActionPermissionFilter(Permission = "business:andonalarmrecord:list")] public IActionResult Export([FromQuery] AndonAlarmRecordQueryDto parm) { parm.PageNum = 1; @@ -94,16 +95,6 @@ namespace ZR.Admin.WebApi.Controllers.andon public IActionResult UpdateAndonAlarmRecord([FromBody] AndonAlarmRecordDto parm) { var modal = parm.Adapt().ToUpdate(HttpContext); - //if (parm.Area != null && parm.Area.Length > 0) - //{ - // modal.Area1 = parm.Area.Length > 0 ? parm.Area[0] : string.Empty; - // modal.Area2 = parm.Area.Length > 1 ? parm.Area[1] : string.Empty; - //} - //else - //{ - // modal.Area1 = string.Empty; - // modal.Area2 = string.Empty; - //} var response = _AndonAlarmRecordService.UpdateAndonAlarmRecord(modal); return ToResponse(response); @@ -189,16 +180,6 @@ namespace ZR.Admin.WebApi.Controllers.andon public IActionResult CreateAndonAlarmRecord([FromBody] AndonAlarmRecordDto parm) { var modal = parm.Adapt().ToCreate(HttpContext); - //if (parm.Area != null && parm.Area.Length > 0) - //{ - // modal.Area1 = parm.Area.Length > 0 ? parm.Area[0] : string.Empty; - // modal.Area2 = parm.Area.Length > 1 ? parm.Area[1] : string.Empty; - //} - //else - //{ - // modal.Area1 = string.Empty; - // modal.Area2 = string.Empty; - //} var response = _AndonAlarmRecordService.CreateAndonAlarmRecord(modal); return SUCCESS(response); diff --git a/ZR.Admin.WebApi/wwwroot/export/任务执行01-06-192028.xlsx b/ZR.Admin.WebApi/wwwroot/export/任务执行01-06-192028.xlsx new file mode 100644 index 00000000..3f5e0066 Binary files /dev/null and b/ZR.Admin.WebApi/wwwroot/export/任务执行01-06-192028.xlsx differ diff --git a/ZR.Admin.WebApi/wwwroot/export/任务执行01-06-192135.xlsx b/ZR.Admin.WebApi/wwwroot/export/任务执行01-06-192135.xlsx new file mode 100644 index 00000000..fae45cac Binary files /dev/null and b/ZR.Admin.WebApi/wwwroot/export/任务执行01-06-192135.xlsx differ diff --git a/ZR.Admin.WebApi/wwwroot/export/任务执行01-06-194345.xlsx b/ZR.Admin.WebApi/wwwroot/export/任务执行01-06-194345.xlsx new file mode 100644 index 00000000..fd82e9d7 Binary files /dev/null and b/ZR.Admin.WebApi/wwwroot/export/任务执行01-06-194345.xlsx differ diff --git a/ZR.Service/mes/andon/AndonAlarmRecordService.cs b/ZR.Service/mes/andon/AndonAlarmRecordService.cs index c258f149..8e5f6807 100644 --- a/ZR.Service/mes/andon/AndonAlarmRecordService.cs +++ b/ZR.Service/mes/andon/AndonAlarmRecordService.cs @@ -376,7 +376,11 @@ namespace ZR.Service.mes.andon { } - return ApiResult.Success("成功", andonAlarmRecordProcess); + AndonAlarmRecordProcessQueryDto parmP = new AndonAlarmRecordProcessQueryDto(); + parmP.AlarmCode = andonAlarmRecordProcess.AlarmCode; + var processList = andonAlarmRecordProcessService.GetList(parmP); + + return ApiResult.Success("成功", processList); } } else @@ -444,7 +448,11 @@ namespace ZR.Service.mes.andon { } - return ApiResult.Success("成功", andonAlarmRecordProcess); + AndonAlarmRecordProcessQueryDto parmP = new AndonAlarmRecordProcessQueryDto(); + parmP.AlarmCode = andonAlarmRecordProcess.AlarmCode; + var processList = andonAlarmRecordProcessService.GetList(parmP); + + return ApiResult.Success("成功", processList); } else { @@ -594,10 +602,13 @@ namespace ZR.Service.mes.andon // 3.1 手表呼叫报警(注释保留,仅做异常隔离) if (!string.IsNullOrEmpty(model.Receiver1)) { - string strWatchAddress = GetReceiverWatchAddress(model.Receiver1); - if (!string.IsNullOrEmpty(strWatchAddress)) + List WatchAddressList = GetReceiverWatchAddress(model.Receiver1); + if (WatchAddressList.Any()) { - Watchup.StartPush(strMessage, _socketGateway, strWatchAddress); + foreach (string strWatchAddress in WatchAddressList) + { + Watchup.StartPush(strMessage, _socketGateway, strWatchAddress); + } } } } @@ -622,17 +633,21 @@ namespace ZR.Service.mes.andon } //根据报警联系人获取对应人的手表地址 - private string GetReceiverWatchAddress(string receiverId) + private List GetReceiverWatchAddress(string receiverIds) { - string strWatchAddress = ""; - var query = andonAlarmReceiverWatchDicService.Queryable() - .Where(a => a.Receiverid == receiverId) - .ToList().FirstOrDefault(); - if (query != null) + string[] receiverIdArr = receiverIds.Split(','); + List watchAddressList = new List(); + foreach (string receiverId in receiverIdArr) { - strWatchAddress = query.Watchip; + var query = andonAlarmReceiverWatchDicService.Queryable() + .Where(a => a.Receiverid == receiverId) + .ToList().FirstOrDefault(); + if (query != null) + { + watchAddressList.Add(query.Watchip); + } } - return strWatchAddress; + return watchAddressList; } /// @@ -728,13 +743,15 @@ namespace ZR.Service.mes.andon try { //手表发送提醒上报领导 - string strWatchAddress = ""; if (!string.IsNullOrEmpty(ReceiveId)) { - strWatchAddress = GetReceiverWatchAddress(ReceiveId); - if (!string.IsNullOrEmpty(strWatchAddress)) + List WatchAddressList = GetReceiverWatchAddress(ReceiveId); + if (WatchAddressList.Any()) { - Watchup.StartPush(strWatchMessage, _socketGateway, strWatchAddress); + foreach (string strWatchAddress in WatchAddressList) + { + Watchup.StartPush(strWatchMessage, _socketGateway, strWatchAddress); + } } } }