新增报警记录
This commit is contained in:
parent
1db674e411
commit
c70b1831b3
@ -165,7 +165,16 @@ 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);
|
||||
|
||||
@ -115,7 +115,7 @@ builder.Services.Configure<ApiBehaviorOptions>((o) =>
|
||||
// 注册 SocketGatewayServer 为 Singleton(单例,整个应用生命周期一个实例)
|
||||
builder.Services.AddSingleton<SocketGatewayServer>(provider =>
|
||||
{
|
||||
var server = new SocketGatewayServer("192.168.1.10", 2325); // 你可以按需修改 IP 和端口
|
||||
var server = new SocketGatewayServer("192.168.1.48", 2325); // 你可以按需修改 IP 和端口
|
||||
server.Start(); // 项目启动时立即启动监听
|
||||
//server.StartReceiving();
|
||||
|
||||
|
||||
@ -140,5 +140,11 @@ namespace ZR.Model.MES.andon
|
||||
[SugarColumn(ColumnName = "updated_time")]
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "area1")]
|
||||
public string Area1 { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "area2")]
|
||||
public string Area2 { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@ -65,5 +65,6 @@ namespace ZR.Model.MES.andon.Dto
|
||||
public string UserId { get; set; }
|
||||
public string UserName { get; set; }
|
||||
|
||||
public string[] Area { get; set; }
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user