添加库位监控

库存 库位 添加zone权限管控
This commit is contained in:
zhougf committed 2025-05-13 17:26:39 +08:00
1 parent b005422b01
commit e90e0db019
43 files changed
+536 -479

No files matched your search

@@ -0,0 +1,72 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Reflection;
using WalkingTec.Mvvm.Core;
using HHWMS.Web.Models;
namespace HHWMS.Web
{
public class LocationMonitor2DVM : BaseVM
{
public string Area { get; set; }
public string Row { get; set; }
public class LocationGridItem
{
public string Code { get; set; }
public short Row { get; set; }
public short Line { get; set; }
public short Layer { get; set; }
public LocationStatusEnum Status { get; set; }
public string ContainerCode { get; set; }
}
public IEnumerable<int> GetAreas()
{
return DC.Set<Location>()
.Select(x => x.ZoneId)
.Distinct()
.OrderBy(x => x)
.ToList();
}
public IEnumerable<short> GetRows(int area)
{
return DC.Set<Location>()
.Where(x => x.ZoneId == area)
.Select(x => x.Row)
.Distinct()
.OrderBy(x => x)
.ToList();
}
public IEnumerable<dynamic> GetLocationsByAreaAndRow(int area, short row)
{
var result = DC.Set<Location>()
.Where(x => x.ZoneId == area && x.Row == row)
.OrderBy(x => x.Line)
.Select(x => new
{
Code = x.Code,
Row = x.Row,
Line = x.Line,
Layer = x.Layer,
x.Status,
Status1 = x.Status.GetEnumDisplayName(),
ContainerCode = x.ContainerCode
}).ToList();
return result;
}
private string GetEnumDisplayName(Enum enumValue)
{
var fieldInfo = enumValue.GetType().GetField(enumValue.ToString());
var displayAttribute = fieldInfo.GetCustomAttributes(typeof(DisplayAttribute), false).FirstOrDefault() as DisplayAttribute;
return displayAttribute?.Name ?? enumValue.ToString();
}
}
}
@@ -12,7 +12,7 @@ namespace HHWMS.Web
{
public partial class LocationTemplateVM : BaseTemplateVM
{
public ExcelPropety LocationZone_Excel = ExcelPropety.CreateProperty<Location>(x => x.LocationZoneId);
public ExcelPropety LocationZone_Excel = ExcelPropety.CreateProperty<Location>(x => x.ZoneId);
[Display(Name = "Location.Code")]
public ExcelPropety Code_Excel = ExcelPropety.CreateProperty<Location>(x => x.Code);
[Display(Name = "Location.Type")]
@@ -57,7 +57,7 @@ namespace HHWMS.Web
public override IOrderedQueryable<Location_View> GetSearchQuery()
{
var query = DC.Set<Location>()
.CheckEqual(Searcher.LocationZoneId, x=>x.LocationZoneId)
.CheckEqual(Searcher.LocationZoneId, x=>x.ZoneId)
.CheckContain(Searcher.Code, x=>x.Code)
.CheckEqual(Searcher.Type, x=>x.Type)
.CheckEqual(Searcher.Status, x=>x.Status)
@@ -68,7 +68,7 @@ namespace HHWMS.Web
.Select(x => new Location_View
{
ID = x.ID,
Name_view = x.LocationZone.Name,
Name_view = x.Zone.Name,
Code = x.Code,
Type = x.Type,
Status = x.Status,
@@ -28,7 +28,7 @@ namespace HHWMS.Web
public LocationVM()
{
SetInclude(x => x.LocationZone);
SetInclude(x => x.Zone);
}
protected override void InitVM()