<add>[important]添加库前输送机信息的查询
This commit is contained in:
parent
c85b53ad46
commit
6469db09f6
|
|
@ -23,6 +23,7 @@ public class WcsAuthorizationAttribute : Attribute, IAuthorizationFilter
|
||||||
}
|
}
|
||||||
catch(Exception ex)
|
catch(Exception ex)
|
||||||
{
|
{
|
||||||
|
_ = ex;
|
||||||
context.Result = new Microsoft.AspNetCore.Mvc.UnauthorizedResult();
|
context.Result = new Microsoft.AspNetCore.Mvc.UnauthorizedResult();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using WcsMain.ApiServe.ControllerFilter.ExceptionFilter;
|
||||||
|
using WcsMain.ApiServe.ControllerFilter;
|
||||||
|
using WcsMain.ApiServe.Service.WcsService;
|
||||||
|
using WcsMain.ApiServe.Controllers.Dto;
|
||||||
|
using WcsMain.DataBase.TableEntity;
|
||||||
|
|
||||||
|
namespace WcsMain.ApiServe.Controllers.WcsController;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 库前输送线控制器
|
||||||
|
/// </summary>
|
||||||
|
[Route("api/wcs/stackerConvey")]
|
||||||
|
[ApiController]
|
||||||
|
[WcsExceptionFilter]
|
||||||
|
[WcsAuthorization]
|
||||||
|
public class StackerConveyController(StackerConveyService stackerConveyService) : ControllerBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 查询所有库前输送线信息
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("queryStackerConveyInfo")]
|
||||||
|
public WcsApiResponse<List<AppStackerConvey>>? QueryStackerConveyInfo() => stackerConveyService.QueryStackerConveyInfo();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
25
WcsMain/ApiServe/Service/WcsService/StackerConveyService.cs
Normal file
25
WcsMain/ApiServe/Service/WcsService/StackerConveyService.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
using WcsMain.ApiServe.Controllers.Dto;
|
||||||
|
using WcsMain.ApiServe.Factory;
|
||||||
|
using WcsMain.DataBase.Dao;
|
||||||
|
using WcsMain.DataBase.TableEntity;
|
||||||
|
using WcsMain.WcsAttribute.AutoFacAttribute;
|
||||||
|
|
||||||
|
namespace WcsMain.ApiServe.Service.WcsService;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 库前输送线的 Service
|
||||||
|
/// </summary>
|
||||||
|
[Service]
|
||||||
|
public class StackerConveyService(AppStackerConveyDao stackerConveyDao)
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查询所有的库前输送线信息
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public WcsApiResponse<List<AppStackerConvey>>? QueryStackerConveyInfo()
|
||||||
|
{
|
||||||
|
List<AppStackerConvey>? stackerConveys = stackerConveyDao.Query();
|
||||||
|
return stackerConveys == default ? WcsApiResponseFactory.DataBaseErr<List<AppStackerConvey>>() : WcsApiResponseFactory.Success(stackerConveys);
|
||||||
|
}
|
||||||
|
}
|
||||||
49
WcsMain/DataBase/Dao/AppStackerConveyDao.cs
Normal file
49
WcsMain/DataBase/Dao/AppStackerConveyDao.cs
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
using WcsMain.Common;
|
||||||
|
using WcsMain.DataBase.TableEntity;
|
||||||
|
using WcsMain.WcsAttribute.AutoFacAttribute;
|
||||||
|
|
||||||
|
namespace WcsMain.DataBase.Dao;
|
||||||
|
|
||||||
|
[Component]
|
||||||
|
public class AppStackerConveyDao
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 条件查询
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="queryEntity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<AppStackerConvey>? Query(AppStackerConvey queryEntity)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var sqlFuc = CommonTool.DbServe.Queryable<AppStackerConvey>()
|
||||||
|
.WhereIF(queryEntity.WcsLocation != default, it => it.WcsLocation == queryEntity.WcsLocation)
|
||||||
|
.WhereIF(queryEntity.WmsLocation != default, it => it.WmsLocation == queryEntity.WmsLocation)
|
||||||
|
.WhereIF(queryEntity.LocationName != default, it => it.LocationName == queryEntity.LocationName)
|
||||||
|
.WhereIF(queryEntity.PlcLocation != default, it => it.PlcLocation == queryEntity.PlcLocation)
|
||||||
|
.WhereIF(queryEntity.Area != default, it => it.Area == queryEntity.Area)
|
||||||
|
.WhereIF(queryEntity.LocationType != default, it => it.LocationType == queryEntity.LocationType)
|
||||||
|
.WhereIF(queryEntity.LocationStatus != default, it => it.LocationStatus == queryEntity.LocationStatus)
|
||||||
|
.WhereIF(queryEntity.WriteType != default, it => it.WriteType == queryEntity.WriteType)
|
||||||
|
.WhereIF(queryEntity.Remark != default, it => it.Remark == queryEntity.Remark);
|
||||||
|
return sqlFuc.ToList();
|
||||||
|
}
|
||||||
|
catch(Exception ex)
|
||||||
|
{
|
||||||
|
_ = ex;
|
||||||
|
return default;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查询所有
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<AppStackerConvey>? Query() => Query(new AppStackerConvey());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
80
WcsMain/DataBase/TableEntity/AppStackerConvey.cs
Normal file
80
WcsMain/DataBase/TableEntity/AppStackerConvey.cs
Normal file
|
|
@ -0,0 +1,80 @@
|
||||||
|
using SqlSugar;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace WcsMain.DataBase.TableEntity;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 库前输送机表
|
||||||
|
/// </summary>
|
||||||
|
[SugarTable("tbl_app_stacker_convey")]
|
||||||
|
public class AppStackerConvey
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// WCS 点位
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsPrimaryKey = true, ColumnName = "wcs_location")]
|
||||||
|
[JsonPropertyName("wcsLocation")]
|
||||||
|
public string? WcsLocation { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// WMS 点位
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "wms_location")]
|
||||||
|
[JsonPropertyName("wmsLocation")]
|
||||||
|
public string? WmsLocation { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 点位名称
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "location_name")]
|
||||||
|
[JsonPropertyName("locationName")]
|
||||||
|
public string? LocationName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// plc 的位置
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "plc_location")]
|
||||||
|
[JsonPropertyName("plcLocation")]
|
||||||
|
public string? PlcLocation { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 区域
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "area")]
|
||||||
|
[JsonPropertyName("area")]
|
||||||
|
public string? Area { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 点位类型
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "location_type")]
|
||||||
|
[JsonPropertyName("locationType")]
|
||||||
|
public int? LocationType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 点位状态
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "location_status")]
|
||||||
|
[JsonPropertyName("locationStatus")]
|
||||||
|
public int? LocationStatus { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 写入方式
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "write_type")]
|
||||||
|
[JsonPropertyName("writeType")]
|
||||||
|
public int? WriteType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 备注信息
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "remark")]
|
||||||
|
[JsonPropertyName("remark")]
|
||||||
|
public string? Remark { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user