响应处理
This commit is contained in:
parent
2c1aff677d
commit
e262528889
@ -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<AndonAlarmRecord>().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<AndonAlarmRecord>().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);
|
||||
|
||||
BIN
ZR.Admin.WebApi/wwwroot/export/任务执行01-06-192028.xlsx
Normal file
BIN
ZR.Admin.WebApi/wwwroot/export/任务执行01-06-192028.xlsx
Normal file
Binary file not shown.
BIN
ZR.Admin.WebApi/wwwroot/export/任务执行01-06-192135.xlsx
Normal file
BIN
ZR.Admin.WebApi/wwwroot/export/任务执行01-06-192135.xlsx
Normal file
Binary file not shown.
BIN
ZR.Admin.WebApi/wwwroot/export/任务执行01-06-194345.xlsx
Normal file
BIN
ZR.Admin.WebApi/wwwroot/export/任务执行01-06-194345.xlsx
Normal file
Binary file not shown.
@ -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<string> 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<string> GetReceiverWatchAddress(string receiverIds)
|
||||
{
|
||||
string strWatchAddress = "";
|
||||
var query = andonAlarmReceiverWatchDicService.Queryable()
|
||||
.Where(a => a.Receiverid == receiverId)
|
||||
.ToList().FirstOrDefault();
|
||||
if (query != null)
|
||||
string[] receiverIdArr = receiverIds.Split(',');
|
||||
List<string> watchAddressList = new List<string>();
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -728,13 +743,15 @@ namespace ZR.Service.mes.andon
|
||||
try
|
||||
{
|
||||
//手表发送提醒上报领导
|
||||
string strWatchAddress = "";
|
||||
if (!string.IsNullOrEmpty(ReceiveId))
|
||||
{
|
||||
strWatchAddress = GetReceiverWatchAddress(ReceiveId);
|
||||
if (!string.IsNullOrEmpty(strWatchAddress))
|
||||
List<string> WatchAddressList = GetReceiverWatchAddress(ReceiveId);
|
||||
if (WatchAddressList.Any())
|
||||
{
|
||||
Watchup.StartPush(strWatchMessage, _socketGateway, strWatchAddress);
|
||||
foreach (string strWatchAddress in WatchAddressList)
|
||||
{
|
||||
Watchup.StartPush(strWatchMessage, _socketGateway, strWatchAddress);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user