<add>[important]添加报警信息显示
This commit is contained in:
parent
bf6f171066
commit
ce51fe383a
|
|
@ -0,0 +1,21 @@
|
|||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace WcsMain.ApiServe.Controllers.Dto.WcsDto.Stacker;
|
||||
|
||||
|
||||
public class QueryErrInfoRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 区域
|
||||
/// </summary>
|
||||
[JsonPropertyName("area")]
|
||||
public string? Area { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 报警编号
|
||||
/// </summary>
|
||||
[JsonPropertyName("errNo")]
|
||||
public int? ErrNo { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -36,4 +36,11 @@ public class StackerController(StackerService stackerService) : ControllerBase
|
|||
[HttpPost("editStacker")]
|
||||
public WcsApiResponse EditStacker([FromBody] EditStackerRequest request) => stackerService.EditStacker(request);
|
||||
|
||||
/// <summary>
|
||||
/// 查询故障详细信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("queryErrInfo")]
|
||||
public WcsApiResponse<AppBaseErr> QueryErrInfo([FromBody] QueryErrInfoRequest request) => stackerService.QueryErrInfo(request);
|
||||
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using DataCheck;
|
||||
using Microsoft.VisualStudio.Web.CodeGenerators.Mvc.Dependency;
|
||||
using System.Collections.Generic;
|
||||
using WcsMain.ApiServe.Controllers.Dto;
|
||||
using WcsMain.ApiServe.Controllers.Dto.WcsDto.Stacker;
|
||||
|
|
@ -11,7 +12,7 @@ using WcsMain.WcsAttribute.AutoFacAttribute;
|
|||
namespace WcsMain.ApiServe.Service.WcsService;
|
||||
|
||||
[Service]
|
||||
public class StackerService(AppStackerDao stackerDao, StackerOperation stackerOperation)
|
||||
public class StackerService(AppStackerDao stackerDao, StackerOperation stackerOperation, AppBaseErrDao baseErrDao)
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询所有的 堆垛机信息
|
||||
|
|
@ -127,4 +128,19 @@ public class StackerService(AppStackerDao stackerDao, StackerOperation stackerOp
|
|||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询对应的报警信息
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public WcsApiResponse<AppBaseErr> QueryErrInfo(QueryErrInfoRequest request)
|
||||
{
|
||||
var queryResult = baseErrDao.Select(new AppBaseErr { Area = request.Area, ErrNo = request.ErrNo });
|
||||
if (queryResult == default) return WcsApiResponseFactory.DataBaseErr<AppBaseErr>();
|
||||
if (queryResult.Count() == 0) return WcsApiResponseFactory.Fail<AppBaseErr>(msg:"没有对应的报警资料");
|
||||
var errInfo = queryResult[0];
|
||||
return WcsApiResponseFactory.Success(errInfo);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ public class ReadScanCode(AppRouterMethodDao routerMethodDao, ConveyOperation co
|
|||
return; // 不读了,估计网断了
|
||||
}
|
||||
if (scanOk != (short)TrueFalseEnum.TRUE) { return; }
|
||||
if (!CheckCode(code, router.Area ?? "")) { return; }
|
||||
string clearErrText = conveyOperation.ClearScanStatus(router.Area);
|
||||
if (!string.IsNullOrEmpty(clearErrText))
|
||||
{
|
||||
|
|
@ -60,6 +61,35 @@ public class ReadScanCode(AppRouterMethodDao routerMethodDao, ConveyOperation co
|
|||
}
|
||||
|
||||
|
||||
Dictionary<string, DateTime>? codeData;
|
||||
DateTime firstTime = DateTime.Now;
|
||||
|
||||
private bool CheckCode(string codeIn, string area)
|
||||
{
|
||||
string code = codeIn + area;
|
||||
if(codeData == default) codeData = [];
|
||||
if ((DateTime.Now - firstTime).TotalSeconds > 5.5)
|
||||
{
|
||||
codeData.Clear();
|
||||
}
|
||||
firstTime = DateTime.Now;
|
||||
if (!codeData.TryGetValue(code, out DateTime value))
|
||||
{
|
||||
value = DateTime.Now;
|
||||
codeData.Add(code, value);
|
||||
return true;
|
||||
}
|
||||
DateTime dateTime = value;
|
||||
TimeSpan timeSpan = DateTime.Now - dateTime;
|
||||
if(timeSpan.TotalSeconds > 5)
|
||||
{
|
||||
codeData[code] = dateTime;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ public class ExeTaskDoubleFork(
|
|||
if (forkStatus.Length <= i || forkStatus[i] != '1') continue; // 获取数据失败或者货叉未开启
|
||||
var code = codes[i];
|
||||
if (string.IsNullOrEmpty(code)) continue; // 检查条码是否为空
|
||||
ConsoleLog.Warning($"【警告】{stackerId} 号堆垛机,入库位置:{i + 1} 返回:{code}");
|
||||
//ConsoleLog.Warning($"{stackerId} 号堆垛机,入库位置:{i + 1} 返回:{code}");
|
||||
if (code == "NoRead") // 检查条码是否为 NoRead
|
||||
{
|
||||
/* 检查卸货站台是否允许卸货 */
|
||||
|
|
|
|||
42
WcsMain/DataBase/Dao/AppBaseErrDao.cs
Normal file
42
WcsMain/DataBase/Dao/AppBaseErrDao.cs
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
using WcsMain.Common;
|
||||
using WcsMain.DataBase.TableEntity;
|
||||
using WcsMain.WcsAttribute.AutoFacAttribute;
|
||||
|
||||
namespace WcsMain.DataBase.Dao;
|
||||
|
||||
[Component]
|
||||
public class AppBaseErrDao
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 条件查询
|
||||
/// </summary>
|
||||
/// <param name="appBaseErr"></param>
|
||||
/// <returns></returns>
|
||||
public List<AppBaseErr>? Select(AppBaseErr appBaseErr)
|
||||
{
|
||||
try
|
||||
{
|
||||
var sqlFuc = CommonTool.DbServe.Queryable<AppBaseErr>()
|
||||
.WhereIF(appBaseErr.Area != default, w => w.Area == appBaseErr.Area)
|
||||
.WhereIF(appBaseErr.ErrNo != default, w => w.ErrNo == appBaseErr.ErrNo)
|
||||
.WhereIF(appBaseErr.ErrType != default, w => w.ErrType == appBaseErr.ErrType)
|
||||
.WhereIF(appBaseErr.ErrMsg != default, w => w.ErrMsg == appBaseErr.ErrMsg)
|
||||
.WhereIF(appBaseErr.Suggest != default, w => w.Suggest == appBaseErr.Suggest)
|
||||
.WhereIF(appBaseErr.Remark != default, w => w.Remark == appBaseErr.Remark)
|
||||
.OrderBy(o => new { o.Area, o.ErrNo });
|
||||
return sqlFuc.ToList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_ = ex;
|
||||
return default;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询全部
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<AppBaseErr>? Select() => Select(new AppBaseErr());
|
||||
}
|
||||
|
|
@ -38,7 +38,7 @@ public class TaskDao
|
|||
{
|
||||
TaskId = wcsTask.TaskId,
|
||||
TaskStatus = (int)WmsTaskStatusEnum.queuing,
|
||||
StartTime = dateTime
|
||||
//StartTime = dateTime
|
||||
}).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
57
WcsMain/DataBase/TableEntity/AppBaseErr.cs
Normal file
57
WcsMain/DataBase/TableEntity/AppBaseErr.cs
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
using SqlSugar;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace WcsMain.DataBase.TableEntity;
|
||||
|
||||
/// <summary>
|
||||
/// 基础报警资料
|
||||
/// </summary>
|
||||
[SugarTable("tbl_app_base_err")]
|
||||
public class AppBaseErr
|
||||
{
|
||||
/// <summary>
|
||||
/// 区域
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "area")]
|
||||
[JsonPropertyName("area")]
|
||||
public string? Area { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 报警代码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "err_no")]
|
||||
[JsonPropertyName("errNo")]
|
||||
public int? ErrNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 报警类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "err_type")]
|
||||
[JsonPropertyName("errType")]
|
||||
public int? ErrType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 报警信息
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "err_msg")]
|
||||
[JsonPropertyName("errMsg")]
|
||||
public string? ErrMsg { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 建议
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "suggest")]
|
||||
[JsonPropertyName("suggest")]
|
||||
public string? Suggest { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "remark")]
|
||||
[JsonPropertyName("remark")]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
"DBMssqlLocal": "Data Source=192.168.142.131;Initial Catalog=wcs_stacker;User Id=sa;Password=Sa123;",
|
||||
|
||||
"ApplicationConfig": {
|
||||
"ApiOnly": false,
|
||||
"ApiOnly": true,
|
||||
"Language": "zh-CN"
|
||||
},
|
||||
"UseUrls": [ "http://*:18990" ]
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user