库位表重新生成,一些数据使用enum type status
加上数据权限zoneCode
This commit is contained in:
1 parent
b0a6dcc035
commit
b005422b01
25 files changed
+302
-482
No files matched your search
@@ -30,14 +30,12 @@ namespace HHWMS.Web
|
|||||||
private readonly IMapper _mapper;
|
private readonly IMapper _mapper;
|
||||||
private readonly IMemoryCache _cache;
|
private readonly IMemoryCache _cache;
|
||||||
private const int DEBOUNCE_INTERVAL_MS = 1000; // 防抖间隔1秒
|
private const int DEBOUNCE_INTERVAL_MS = 1000; // 防抖间隔1秒
|
||||||
private readonly PLCHelper _plcHelper;
|
|
||||||
|
|
||||||
public IWCSController(IUnitWork unitWork, IMapper mapper, IMemoryCache cache, PLCHelper plcHelper)
|
public IWCSController(IUnitWork unitWork, IMapper mapper, IMemoryCache cache)
|
||||||
{
|
{
|
||||||
_unitWork = unitWork;
|
_unitWork = unitWork;
|
||||||
_mapper = mapper;
|
_mapper = mapper;
|
||||||
_cache = cache;
|
_cache = cache;
|
||||||
_plcHelper = plcHelper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -108,14 +106,6 @@ namespace HHWMS.Web
|
|||||||
private async Task ProcessRequestIn(WcsRequest request)
|
private async Task ProcessRequestIn(WcsRequest request)
|
||||||
{
|
{
|
||||||
// TODO: 实现具体的入库处理逻辑
|
// TODO: 实现具体的入库处理逻辑
|
||||||
var t = 0;
|
|
||||||
var plc = new SiemensS7Net( SiemensPLCS.S1200, "10.211.55.4" );
|
|
||||||
var read = await plc.ReadInt32Async( "V2634" );
|
|
||||||
if (read.IsSuccess)
|
|
||||||
{
|
|
||||||
t = read.Content;
|
|
||||||
}
|
|
||||||
var write = await plc.WriteAsync( "V2634", t + 1 );
|
|
||||||
await Task.Delay(1000); // 模拟异步处理
|
await Task.Delay(1000); // 模拟异步处理
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,19 +140,36 @@ namespace HHWMS.Web
|
|||||||
var code = vm.GetLocation(request);
|
var code = vm.GetLocation(request);
|
||||||
if (code.Status)
|
if (code.Status)
|
||||||
{
|
{
|
||||||
UpdateLocationAndContainer(code.Data.LocationCode, request.PalletNo);
|
var updateResult = UpdateLocationAndContainer(code.Data.LocationCode, request.PalletNo);
|
||||||
return Task.FromResult<IActionResult>(ApiResult(code.Data));
|
return Task.FromResult<IActionResult>(updateResult);
|
||||||
}
|
}
|
||||||
return Task.FromResult<IActionResult>(ApiResultError("没有符合条件的可用库位"));
|
return Task.FromResult<IActionResult>(ApiResultError("没有符合条件的可用库位"));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新库位和容器
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="locationCode"></param>
|
||||||
|
/// <param name="palletNo"></param>
|
||||||
|
/// <returns></returns>
|
||||||
private IActionResult UpdateLocationAndContainer(string locationCode, string palletNo)
|
private IActionResult UpdateLocationAndContainer(string locationCode, string palletNo)
|
||||||
{
|
{
|
||||||
var location = _unitWork.Find<Location>(x => x.Code == locationCode).FirstOrDefault();
|
var location = _unitWork.Find<Location>(x => x.Code == locationCode).FirstOrDefault();
|
||||||
location.ContainerCode = palletNo;
|
var resultNum = _unitWork.BatchUpdate<Location>(x => x.Code == locationCode && x.Version == location.Version,
|
||||||
location.Status = LocationStatus.任务锁;
|
x => new Location()
|
||||||
_unitWork.Update(location);
|
{
|
||||||
|
ContainerCode = palletNo,
|
||||||
|
// Status = LocationStatus.任务锁,
|
||||||
|
UpdateTime = DateTime.Now,
|
||||||
|
UpdateBy = "WMS",
|
||||||
|
Version = Guid.NewGuid()
|
||||||
|
});
|
||||||
|
if (resultNum == 0)
|
||||||
|
{
|
||||||
|
//失败
|
||||||
|
return ApiResult(ApiResultError("更新仓位失败!请重新请求!"));
|
||||||
|
}
|
||||||
|
|
||||||
var container = _unitWork.Find<Container>(x => x.Code == palletNo).FirstOrDefault();
|
var container = _unitWork.Find<Container>(x => x.Code == palletNo).FirstOrDefault();
|
||||||
if (container != null)
|
if (container != null)
|
||||||
@@ -173,117 +180,5 @@ namespace HHWMS.Web
|
|||||||
|
|
||||||
return ApiResult(new { LocationCode = location.Code });
|
return ApiResult(new { LocationCode = location.Code });
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// PLC通信测试接口
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request">通信参数</param>
|
|
||||||
[HttpPost]
|
|
||||||
public async Task<IActionResult> CommunicateWithPLC(PlcCommunicationRequest request)
|
|
||||||
{
|
|
||||||
if (request == null)
|
|
||||||
{
|
|
||||||
return ApiResultError("请求参数不能为空");
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// 连接PLC
|
|
||||||
if (!_plcHelper.Connect(PlcType.Siemens, request.IpAddress))
|
|
||||||
{
|
|
||||||
return ApiResultError(msg:"PLC连接失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// 根据操作类型执行不同的读写操作
|
|
||||||
switch (request.OperationType)
|
|
||||||
{
|
|
||||||
case "ReadInt32":
|
|
||||||
var value = _plcHelper.ReadInt32(request.Address);
|
|
||||||
return ApiResult(new { Value = value });
|
|
||||||
|
|
||||||
case "WriteInt16":
|
|
||||||
if (!short.TryParse(request.Value, out short shortValue))
|
|
||||||
{
|
|
||||||
return ApiResultError(msg: "无效的数值");
|
|
||||||
}
|
|
||||||
var writeResult = _plcHelper.WriteInt16(request.Address, shortValue);
|
|
||||||
return ApiResult(new { Success = writeResult });
|
|
||||||
|
|
||||||
case "ReadBool":
|
|
||||||
var boolValue = _plcHelper.ReadBool(request.Address);
|
|
||||||
return ApiResult(new { Value = boolValue });
|
|
||||||
|
|
||||||
case "WriteBool":
|
|
||||||
if (!bool.TryParse(request.Value, out bool boolWriteValue))
|
|
||||||
{
|
|
||||||
return ApiResultError("无效的布尔值");
|
|
||||||
}
|
|
||||||
var boolWriteResult = _plcHelper.WriteBool(request.Address, boolWriteValue);
|
|
||||||
return ApiResult(new { Success = boolWriteResult });
|
|
||||||
|
|
||||||
case "ReadString":
|
|
||||||
if (!ushort.TryParse(request.StringLength, out ushort length))
|
|
||||||
{
|
|
||||||
return ApiResultError("无效的字符串长度");
|
|
||||||
}
|
|
||||||
var stringValue = _plcHelper.ReadString(request.Address, length);
|
|
||||||
return ApiResult(new { Value = stringValue });
|
|
||||||
|
|
||||||
case "WriteString":
|
|
||||||
if (!ushort.TryParse(request.StringLength, out ushort writeLength))
|
|
||||||
{
|
|
||||||
return ApiResultError("无效的字符串长度");
|
|
||||||
}
|
|
||||||
var stringWriteResult = _plcHelper.WriteString(request.Address, request.Value, writeLength);
|
|
||||||
return ApiResult(new { Success = stringWriteResult });
|
|
||||||
|
|
||||||
default:
|
|
||||||
return ApiResultError("不支持的操作类型");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
// 确保操作完成后断开连接
|
|
||||||
_plcHelper.Disconnect();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
return ApiResultError($"PLC操作失败: {ex.Message}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// PLC通信请求参数类
|
|
||||||
/// </summary>
|
|
||||||
public class PlcCommunicationRequest
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// PLC的IP地址
|
|
||||||
/// </summary>
|
|
||||||
public string IpAddress { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 操作类型(ReadInt16, WriteInt16, ReadBool, WriteBool, ReadString, WriteString)
|
|
||||||
/// </summary>
|
|
||||||
public string OperationType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// PLC地址(例如"DB1.0")
|
|
||||||
/// </summary>
|
|
||||||
public string Address { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 要写入的值(用于写操作)
|
|
||||||
/// </summary>
|
|
||||||
public string Value { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 字符串长度(用于字符串操作)
|
|
||||||
/// </summary>
|
|
||||||
public string StringLength { get; set; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using WalkingTec.Mvvm.Core;
|
using WalkingTec.Mvvm.Core;
|
||||||
using WalkingTec.Mvvm.Mvc;
|
using WalkingTec.Mvvm.Mvc;
|
||||||
using WalkingTec.Mvvm.Core.Extensions;
|
using WalkingTec.Mvvm.Core.Extensions;
|
||||||
using HHWMS.Web;
|
using HHWMS.Web;
|
||||||
using System.Collections.Generic;
|
|
||||||
using HHWMS.Web.Models;
|
using HHWMS.Web.Models;
|
||||||
|
|
||||||
namespace HHWMS.Web.Controllers
|
namespace HHWMS.Web.Controllers
|
||||||
@@ -14,11 +14,13 @@ namespace HHWMS.Web.Controllers
|
|||||||
[ActionDescription("库位管理")]
|
[ActionDescription("库位管理")]
|
||||||
public partial class LocationController : BaseController
|
public partial class LocationController : BaseController
|
||||||
{
|
{
|
||||||
private readonly IUnitWork _unitwork;
|
private readonly IUnitWork _unitWork;
|
||||||
|
|
||||||
public LocationController(IUnitWork unitWork)
|
public LocationController(IUnitWork unitWork)
|
||||||
{
|
{
|
||||||
_unitwork = unitWork;
|
_unitWork = unitWork;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Search
|
#region Search
|
||||||
[ActionDescription("Sys.Search")]
|
[ActionDescription("Sys.Search")]
|
||||||
public ActionResult Index()
|
public ActionResult Index()
|
||||||
@@ -140,7 +142,6 @@ namespace HHWMS.Web.Controllers
|
|||||||
public ActionResult Details(string id)
|
public ActionResult Details(string id)
|
||||||
{
|
{
|
||||||
var vm = Wtm.CreateVM<LocationVM>(id);
|
var vm = Wtm.CreateVM<LocationVM>(id);
|
||||||
vm.Inventorys.SearcherMode = ListVMSearchModeEnum.MasterDetail;
|
|
||||||
return PartialView(vm);
|
return PartialView(vm);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@@ -259,16 +260,16 @@ namespace HHWMS.Web.Controllers
|
|||||||
locationList.Add(new Location
|
locationList.Add(new Location
|
||||||
{
|
{
|
||||||
Code = $"{vm.Entity.Type}{vm.Entity.RoadWay.ToString().PadLeft(2, '0')}-{row.ToString().PadLeft(2, '0')}-{line.ToString().PadLeft(2, '0')}-{layer.ToString().PadLeft(2, '0')}",
|
Code = $"{vm.Entity.Type}{vm.Entity.RoadWay.ToString().PadLeft(2, '0')}-{row.ToString().PadLeft(2, '0')}-{line.ToString().PadLeft(2, '0')}-{layer.ToString().PadLeft(2, '0')}",
|
||||||
ZoneCode = vm.Entity.ZoneCode,
|
LocationZoneId = vm.Entity.LocationZoneId,
|
||||||
Type = vm.Entity.Type,
|
Type = vm.Entity.Type,
|
||||||
RoadWay = vm.Entity.RoadWay,
|
RoadWay = vm.Entity.RoadWay,
|
||||||
Row = row,
|
Row = row,
|
||||||
Line = line,
|
Line = line,
|
||||||
Layer = layer,
|
Layer = layer,
|
||||||
RowFlag = (short?)(vm.RoadwayType == 1 || vm.RoadwayType == 2 ? 0 : (row == 1 || row == 4 ? 1 : 0)),
|
RowFlag = (vm.RoadwayType == 1 || vm.RoadwayType == 2 ? RowFlagEnum.Outer : (row == 1 || row == 4 ? RowFlagEnum.Inner : RowFlagEnum.Outer)),
|
||||||
ContiguousCode = vm.RoadwayType == 4 ? $"{vm.Entity.Type}{vm.Entity.RoadWay.ToString().PadLeft(2, '0')}-{(row % 2 == 0?row-1:row+1) .ToString().PadLeft(2, '0')}-{line.ToString().PadLeft(2, '0')}-{layer.ToString().PadLeft(2, '0')}" : null,
|
ContiguousCode = vm.RoadwayType == 4 ? $"{vm.Entity.Type}{vm.Entity.RoadWay.ToString().PadLeft(2, '0')}-{(row % 2 == 0?row-1:row+1) .ToString().PadLeft(2, '0')}-{line.ToString().PadLeft(2, '0')}-{layer.ToString().PadLeft(2, '0')}" : null,
|
||||||
IsStop = false,
|
IsStop = false,
|
||||||
Status = LocationStatus.空仓位,
|
Status = LocationStatusEnum.Empty,
|
||||||
Length = vm.Entity.Length,
|
Length = vm.Entity.Length,
|
||||||
Width = vm.Entity.Width,
|
Width = vm.Entity.Width,
|
||||||
Height = vm.Entity.Height
|
Height = vm.Entity.Height
|
||||||
@@ -276,16 +277,11 @@ namespace HHWMS.Web.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_unitwork.BatchAdd(locationList.ToArray());
|
_unitWork.BatchAdd(locationList.ToArray());
|
||||||
return FFResult().CloseDialog().RefreshGrid();
|
return FFResult().CloseDialog().RefreshGrid();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion 新增库位
|
#endregion 新增库位
|
||||||
[ActionDescription("Sys.Print")]
|
|
||||||
public ActionResult Print()
|
|
||||||
{
|
|
||||||
return Ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,12 @@
|
|||||||
using HHWMS.Web.Models;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using WalkingTec.Mvvm.Core;
|
using WalkingTec.Mvvm.Core;
|
||||||
|
using WalkingTec.Mvvm.Core.Extensions;
|
||||||
|
using HHWMS.Web.Models;
|
||||||
|
|
||||||
|
|
||||||
namespace HHWMS.Web
|
namespace HHWMS.Web
|
||||||
{
|
{
|
||||||
@@ -10,6 +17,7 @@ namespace HHWMS.Web
|
|||||||
ListVM = new LocationListVM();
|
ListVM = new LocationListVM();
|
||||||
LinkedVM = new Location_BatchEdit();
|
LinkedVM = new Location_BatchEdit();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -17,8 +25,11 @@ namespace HHWMS.Web
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class Location_BatchEdit : BaseVM
|
public class Location_BatchEdit : BaseVM
|
||||||
{
|
{
|
||||||
|
|
||||||
protected override void InitVM()
|
protected override void InitVM()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,59 +1,58 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using HHWMS.Web.Models;
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using WalkingTec.Mvvm.Core;
|
using WalkingTec.Mvvm.Core;
|
||||||
|
using WalkingTec.Mvvm.Core.Extensions;
|
||||||
|
using HHWMS.Web.Models;
|
||||||
|
|
||||||
|
|
||||||
namespace HHWMS.Web
|
namespace HHWMS.Web
|
||||||
{
|
{
|
||||||
public partial class LocationTemplateVM : BaseTemplateVM
|
public partial class LocationTemplateVM : BaseTemplateVM
|
||||||
{
|
{
|
||||||
|
public ExcelPropety LocationZone_Excel = ExcelPropety.CreateProperty<Location>(x => x.LocationZoneId);
|
||||||
[Display(Name = "Location.Code")]
|
[Display(Name = "Location.Code")]
|
||||||
public ExcelPropety Code_Excel = ExcelPropety.CreateProperty<Location>(x => x.Code);
|
public ExcelPropety Code_Excel = ExcelPropety.CreateProperty<Location>(x => x.Code);
|
||||||
|
|
||||||
[Display(Name = "Location.Type")]
|
[Display(Name = "Location.Type")]
|
||||||
public ExcelPropety Type_Excel = ExcelPropety.CreateProperty<Location>(x => x.Type);
|
public ExcelPropety Type_Excel = ExcelPropety.CreateProperty<Location>(x => x.Type);
|
||||||
|
|
||||||
[Display(Name = "Location.Status")]
|
[Display(Name = "Location.Status")]
|
||||||
public ExcelPropety Status_Excel = ExcelPropety.CreateProperty<Location>(x => x.Status);
|
public ExcelPropety Status_Excel = ExcelPropety.CreateProperty<Location>(x => x.Status);
|
||||||
|
|
||||||
[Display(Name = "Location.Row")]
|
|
||||||
public ExcelPropety Row_Excel = ExcelPropety.CreateProperty<Location>(x => x.Row);
|
|
||||||
|
|
||||||
[Display(Name = "Location.Line")]
|
|
||||||
public ExcelPropety Line_Excel = ExcelPropety.CreateProperty<Location>(x => x.Line);
|
|
||||||
|
|
||||||
[Display(Name = "Location.Layer")]
|
|
||||||
public ExcelPropety Layer_Excel = ExcelPropety.CreateProperty<Location>(x => x.Layer);
|
|
||||||
|
|
||||||
[Display(Name = "Location.RoadWay")]
|
[Display(Name = "Location.RoadWay")]
|
||||||
public ExcelPropety RoadWay_Excel = ExcelPropety.CreateProperty<Location>(x => x.RoadWay);
|
public ExcelPropety RoadWay_Excel = ExcelPropety.CreateProperty<Location>(x => x.RoadWay);
|
||||||
|
[Display(Name = "Location.Row")]
|
||||||
|
public ExcelPropety Row_Excel = ExcelPropety.CreateProperty<Location>(x => x.Row);
|
||||||
|
[Display(Name = "Location.Line")]
|
||||||
|
public ExcelPropety Line_Excel = ExcelPropety.CreateProperty<Location>(x => x.Line);
|
||||||
|
[Display(Name = "Location.Layer")]
|
||||||
|
public ExcelPropety Layer_Excel = ExcelPropety.CreateProperty<Location>(x => x.Layer);
|
||||||
|
[Display(Name = "Location.RowFlag")]
|
||||||
|
public ExcelPropety RowFlag_Excel = ExcelPropety.CreateProperty<Location>(x => x.RowFlag);
|
||||||
[Display(Name = "Location.ContainerCode")]
|
[Display(Name = "Location.ContainerCode")]
|
||||||
public ExcelPropety ContainerCode_Excel = ExcelPropety.CreateProperty<Location>(x => x.ContainerCode);
|
public ExcelPropety ContainerCode_Excel = ExcelPropety.CreateProperty<Location>(x => x.ContainerCode);
|
||||||
|
|
||||||
[Display(Name = "Location.ZoneCode")]
|
|
||||||
public ExcelPropety ZoneCode_Excel = ExcelPropety.CreateProperty<Location>(x => x.ZoneCode);
|
|
||||||
|
|
||||||
[Display(Name = "Location.IsStop")]
|
[Display(Name = "Location.IsStop")]
|
||||||
public ExcelPropety IsStop_Excel = ExcelPropety.CreateProperty<Location>(x => x.IsStop);
|
public ExcelPropety IsStop_Excel = ExcelPropety.CreateProperty<Location>(x => x.IsStop);
|
||||||
|
|
||||||
[Display(Name = "System.Length")]
|
[Display(Name = "System.Length")]
|
||||||
public ExcelPropety Length_Excel = ExcelPropety.CreateProperty<Location>(x => x.Length);
|
public ExcelPropety Length_Excel = ExcelPropety.CreateProperty<Location>(x => x.Length);
|
||||||
|
|
||||||
[Display(Name = "System.Width")]
|
[Display(Name = "System.Width")]
|
||||||
public ExcelPropety Width_Excel = ExcelPropety.CreateProperty<Location>(x => x.Width);
|
public ExcelPropety Width_Excel = ExcelPropety.CreateProperty<Location>(x => x.Width);
|
||||||
|
|
||||||
[Display(Name = "System.Height")]
|
[Display(Name = "System.Height")]
|
||||||
public ExcelPropety Height_Excel = ExcelPropety.CreateProperty<Location>(x => x.Height);
|
public ExcelPropety Height_Excel = ExcelPropety.CreateProperty<Location>(x => x.Height);
|
||||||
|
|
||||||
[Display(Name = "Location.ContiguousCode")]
|
[Display(Name = "Location.ContiguousCode")]
|
||||||
public ExcelPropety ContiguousCode_Excel = ExcelPropety.CreateProperty<Location>(x => x.ContiguousCode);
|
public ExcelPropety ContiguousCode_Excel = ExcelPropety.CreateProperty<Location>(x => x.ContiguousCode);
|
||||||
|
|
||||||
protected override void InitVM()
|
protected override void InitVM()
|
||||||
{
|
{
|
||||||
|
LocationZone_Excel.DataType = ColumnDataType.ComboBox;
|
||||||
|
LocationZone_Excel.ListItems = DC.Set<LocationZone>().GetSelectListItems(Wtm, y => y.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class LocationImportVM : BaseImportVM<LocationTemplateVM, Location>
|
public class LocationImportVM : BaseImportVM<LocationTemplateVM, Location>
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,25 +1,18 @@
|
|||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using HHWMS.Web.Models;
|
using System.Threading.Tasks;
|
||||||
using WalkingTec.Mvvm.Core;
|
using WalkingTec.Mvvm.Core;
|
||||||
using WalkingTec.Mvvm.Core.Extensions;
|
using WalkingTec.Mvvm.Core.Extensions;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using HHWMS.Web.Models;
|
||||||
|
|
||||||
|
|
||||||
namespace HHWMS.Web
|
namespace HHWMS.Web
|
||||||
{
|
{
|
||||||
public partial class LocationListVM : BasePagedListVM<Location_View, LocationSearcher>
|
public partial class LocationListVM : BasePagedListVM<Location_View, LocationSearcher>
|
||||||
{
|
{
|
||||||
public List<ComboSelectListItem> ZoneCodes { get; set; }
|
|
||||||
public List<ComboSelectListItem> Types { get; set; }
|
|
||||||
public List<ComboSelectListItem> LocationStatus { get; set; }
|
|
||||||
|
|
||||||
protected override void InitVM()
|
|
||||||
{
|
|
||||||
var vm = Wtm.CreateVM<LocationVM>();
|
|
||||||
ZoneCodes = vm.ZoneCodes;
|
|
||||||
Types = vm.Types;
|
|
||||||
LocationStatus = vm.LocationStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override List<GridAction> InitGridAction()
|
protected override List<GridAction> InitGridAction()
|
||||||
{
|
{
|
||||||
return new List<GridAction>
|
return new List<GridAction>
|
||||||
@@ -33,40 +26,25 @@ namespace HHWMS.Web
|
|||||||
this.MakeStandardAction("Location", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "configs", dialogWidth: 800),
|
this.MakeStandardAction("Location", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "configs", dialogWidth: 800),
|
||||||
this.MakeStandardAction("Location", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "configs"),
|
this.MakeStandardAction("Location", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "configs"),
|
||||||
this.MakeAction("Location","AddLocation",Localizer["Location.AddLocation"],Localizer["Location.AddLocation"],GridActionParameterTypesEnum.NoId,"configs"),
|
this.MakeAction("Location","AddLocation",Localizer["Location.AddLocation"],Localizer["Location.AddLocation"],GridActionParameterTypesEnum.NoId,"configs"),
|
||||||
this.MakeAction("Location","Print",Localizer["Sys.Print"],Localizer["Sys.Print"],GridActionParameterTypesEnum.MultiIds,"configs")
|
this.MakeAction("Location","Print",Localizer["Sys.Print"],"",GridActionParameterTypesEnum.MultiIds,"configs")
|
||||||
.SetShowDialog(false).SetOnClickScript("print"),
|
.SetShowDialog(false).SetOnClickScript("print"),
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected override IEnumerable<IGridColumn<Location_View>> InitGridHeader()
|
protected override IEnumerable<IGridColumn<Location_View>> InitGridHeader()
|
||||||
{
|
{
|
||||||
InitVM();
|
|
||||||
return new List<GridColumn<Location_View>>{
|
return new List<GridColumn<Location_View>>{
|
||||||
this.MakeGridHeader(x => x.ZoneCode)
|
this.MakeGridHeader(x => x.Name_view),
|
||||||
.SetFormat((a, b) =>
|
this.MakeGridHeader(x => x.Code),
|
||||||
{
|
this.MakeGridHeader(x => x.Type),
|
||||||
var data = ZoneCodes.FirstOrDefault(x => x.Value.ToString() == a.ZoneCode);
|
this.MakeGridHeader(x => x.Status),
|
||||||
return data?.Text ?? a.ZoneCode;
|
|
||||||
}),
|
|
||||||
this.MakeGridHeader(x => x.Code, 120),
|
|
||||||
this.MakeGridHeader(x => x.Type)
|
|
||||||
.SetFormat((a, b) =>
|
|
||||||
{
|
|
||||||
var data = Types.FirstOrDefault(x => x.Value.ToString() == a.Type);
|
|
||||||
return data?.Text ?? a.Type;
|
|
||||||
}),
|
|
||||||
this.MakeGridHeader(x => x.Status)
|
|
||||||
.SetFormat((a, b) =>
|
|
||||||
{
|
|
||||||
var data = LocationStatus.FirstOrDefault(x => x.Value.ToString() == a.Status);
|
|
||||||
return data?.Text ?? a.Status;
|
|
||||||
}),
|
|
||||||
this.MakeGridHeader(x => x.Row),
|
|
||||||
this.MakeGridHeader(x => x.Line),
|
|
||||||
this.MakeGridHeader(x => x.Layer),
|
|
||||||
this.MakeGridHeader(x => x.RoadWay).SetHide(),
|
|
||||||
this.MakeGridHeader(x => x.ContainerCode),
|
this.MakeGridHeader(x => x.ContainerCode),
|
||||||
|
this.MakeGridHeader(x => x.RoadWay),
|
||||||
|
this.MakeGridHeader(x => x.Row).SetHide(),
|
||||||
|
this.MakeGridHeader(x => x.Line).SetHide(),
|
||||||
|
this.MakeGridHeader(x => x.Layer).SetHide(),
|
||||||
|
this.MakeGridHeader(x => x.RowFlag).SetHide(),
|
||||||
this.MakeGridHeader(x => x.IsStop),
|
this.MakeGridHeader(x => x.IsStop),
|
||||||
this.MakeGridHeader(x => x.Length).SetHide(),
|
this.MakeGridHeader(x => x.Length).SetHide(),
|
||||||
this.MakeGridHeader(x => x.Width).SetHide(),
|
this.MakeGridHeader(x => x.Width).SetHide(),
|
||||||
@@ -79,29 +57,27 @@ namespace HHWMS.Web
|
|||||||
public override IOrderedQueryable<Location_View> GetSearchQuery()
|
public override IOrderedQueryable<Location_View> GetSearchQuery()
|
||||||
{
|
{
|
||||||
var query = DC.Set<Location>()
|
var query = DC.Set<Location>()
|
||||||
|
.CheckEqual(Searcher.LocationZoneId, x=>x.LocationZoneId)
|
||||||
.CheckContain(Searcher.Code, x=>x.Code)
|
.CheckContain(Searcher.Code, x=>x.Code)
|
||||||
.CheckContain(Searcher.Type, x => x.Type)
|
.CheckEqual(Searcher.Type, x=>x.Type)
|
||||||
.CheckContain(Searcher.Status, x => x.Status)
|
.CheckEqual(Searcher.Status, x=>x.Status)
|
||||||
.CheckEqual(Searcher.Row, x => x.Row)
|
|
||||||
.CheckEqual(Searcher.Line, x => x.Line)
|
|
||||||
.CheckEqual(Searcher.Layer, x => x.Layer)
|
|
||||||
.CheckEqual(Searcher.RoadWay, x=>x.RoadWay)
|
.CheckEqual(Searcher.RoadWay, x=>x.RoadWay)
|
||||||
|
.CheckEqual(Searcher.RowFlag, x=>x.RowFlag)
|
||||||
.CheckContain(Searcher.ContainerCode, x=>x.ContainerCode)
|
.CheckContain(Searcher.ContainerCode, x=>x.ContainerCode)
|
||||||
.CheckContain(Searcher.ZoneCode, x => x.ZoneCode)
|
|
||||||
.CheckEqual(Searcher.IsStop, x=>x.IsStop)
|
.CheckEqual(Searcher.IsStop, x=>x.IsStop)
|
||||||
.CheckContain(Searcher.ContiguousCode, x => x.ContiguousCode)
|
|
||||||
.Select(x => new Location_View
|
.Select(x => new Location_View
|
||||||
{
|
{
|
||||||
ID = x.ID,
|
ID = x.ID,
|
||||||
|
Name_view = x.LocationZone.Name,
|
||||||
Code = x.Code,
|
Code = x.Code,
|
||||||
Type = x.Type,
|
Type = x.Type,
|
||||||
Status = x.Status,
|
Status = x.Status,
|
||||||
|
RoadWay = x.RoadWay,
|
||||||
Row = x.Row,
|
Row = x.Row,
|
||||||
Line = x.Line,
|
Line = x.Line,
|
||||||
Layer = x.Layer,
|
Layer = x.Layer,
|
||||||
RoadWay = x.RoadWay,
|
RowFlag = x.RowFlag,
|
||||||
ContainerCode = x.ContainerCode,
|
ContainerCode = x.ContainerCode,
|
||||||
ZoneCode = x.ZoneCode,
|
|
||||||
IsStop = x.IsStop,
|
IsStop = x.IsStop,
|
||||||
Length = x.Length,
|
Length = x.Length,
|
||||||
Width = x.Width,
|
Width = x.Width,
|
||||||
@@ -111,9 +87,12 @@ namespace HHWMS.Web
|
|||||||
.OrderBy(x => x.ID);
|
.OrderBy(x => x.ID);
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Location_View : Location
|
public class Location_View : Location{
|
||||||
{
|
[Display(Name = "Location.ZoneCode")]
|
||||||
|
public String Name_view { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,46 +1,39 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using WalkingTec.Mvvm.Core;
|
using WalkingTec.Mvvm.Core;
|
||||||
|
using WalkingTec.Mvvm.Core.Extensions;
|
||||||
|
using HHWMS.Web.Models;
|
||||||
|
|
||||||
|
|
||||||
namespace HHWMS.Web
|
namespace HHWMS.Web
|
||||||
{
|
{
|
||||||
public partial class LocationSearcher : BaseSearcher
|
public partial class LocationSearcher : BaseSearcher
|
||||||
{
|
{
|
||||||
|
public List<ComboSelectListItem> AllLocationZones { get; set; }
|
||||||
|
[Display(Name = "Location.ZoneCode")]
|
||||||
|
public int? LocationZoneId { get; set; }
|
||||||
[Display(Name = "Location.Code")]
|
[Display(Name = "Location.Code")]
|
||||||
public String Code { get; set; }
|
public String Code { get; set; }
|
||||||
|
|
||||||
[Display(Name = "Location.Type")]
|
[Display(Name = "Location.Type")]
|
||||||
public String Type { get; set; }
|
public LocationTypeEnum? Type { get; set; }
|
||||||
|
|
||||||
[Display(Name = "Location.Status")]
|
[Display(Name = "Location.Status")]
|
||||||
public String Status { get; set; }
|
public LocationStatusEnum? Status { get; set; }
|
||||||
|
|
||||||
[Display(Name = "Location.Row")]
|
|
||||||
public Int16? Row { get; set; }
|
|
||||||
|
|
||||||
[Display(Name = "Location.Line")]
|
|
||||||
public Int16? Line { get; set; }
|
|
||||||
|
|
||||||
[Display(Name = "Location.Layer")]
|
|
||||||
public Int16? Layer { get; set; }
|
|
||||||
|
|
||||||
[Display(Name = "Location.RoadWay")]
|
[Display(Name = "Location.RoadWay")]
|
||||||
public Int16? RoadWay { get; set; }
|
public Int16? RoadWay { get; set; }
|
||||||
|
[Display(Name = "Location.RowFlag")]
|
||||||
|
public RowFlagEnum? RowFlag { get; set; }
|
||||||
[Display(Name = "Location.ContainerCode")]
|
[Display(Name = "Location.ContainerCode")]
|
||||||
public String ContainerCode { get; set; }
|
public String ContainerCode { get; set; }
|
||||||
|
|
||||||
[Display(Name = "Location.ZoneCode")]
|
|
||||||
public String ZoneCode { get; set; }
|
|
||||||
|
|
||||||
[Display(Name = "Location.IsStop")]
|
[Display(Name = "Location.IsStop")]
|
||||||
public Boolean? IsStop { get; set; }
|
public Boolean? IsStop { get; set; }
|
||||||
|
|
||||||
[Display(Name = "Location.ContiguousCode")]
|
|
||||||
public String ContiguousCode { get; set; }
|
|
||||||
|
|
||||||
protected override void InitVM()
|
protected override void InitVM()
|
||||||
{
|
{
|
||||||
|
AllLocationZones = DC.Set<LocationZone>().GetSelectListItems(Wtm, y => y.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,75 +1,48 @@
|
|||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using HHWMS.Web.Models;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Microsoft.EntityFrameworkCore.SqlServer.Query.Internal;
|
|
||||||
using WalkingTec.Mvvm.Core;
|
using WalkingTec.Mvvm.Core;
|
||||||
using WalkingTec.Mvvm.Core.Extensions;
|
using WalkingTec.Mvvm.Core.Extensions;
|
||||||
|
using HHWMS.Web.Models;
|
||||||
|
|
||||||
|
|
||||||
namespace HHWMS.Web
|
namespace HHWMS.Web
|
||||||
{
|
{
|
||||||
public partial class LocationVM : BaseCRUDVM<Location>
|
public partial class LocationVM : BaseCRUDVM<Location>
|
||||||
{
|
{
|
||||||
public LocationVM()
|
public List<ComboSelectListItem> AllLocationZones { get; set; }
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public InventoryListVM Inventorys { get; set; } = new InventoryListVM();
|
|
||||||
|
|
||||||
[Display(Name = "Location.BeginLine", Description = "起始列")]
|
[Display(Name = "Location.BeginLine", Description = "起始列")]
|
||||||
[Required(ErrorMessage = "Validate.{0}required")]
|
|
||||||
public short BeginLine { get; set; }
|
public short BeginLine { get; set; }
|
||||||
|
|
||||||
[Display(Name = "Location.BeginLayer", Description = "起始层")]
|
[Display(Name = "Location.BeginLayer", Description = "起始层")]
|
||||||
[Required(ErrorMessage = "Validate.{0}required")]
|
|
||||||
public short BeginLayer { get; set; }
|
public short BeginLayer { get; set; }
|
||||||
|
|
||||||
[Display(Name = "Location.RoadwayType", Description = "巷道类型")]
|
[Display(Name = "Location.RoadwayType", Description = "巷道类型")]
|
||||||
[Required(ErrorMessage = "Validate.{0}required")]
|
[Required(ErrorMessage = "Validate.{0}required")]
|
||||||
public short RoadwayType { get; set; }
|
public short RoadwayType { get; set; }
|
||||||
|
|
||||||
private IUnitWork _unitWork { get; set; }
|
|
||||||
|
|
||||||
public List<ComboSelectListItem> RoadwayTypes { get; set; }
|
public List<ComboSelectListItem> RoadwayTypes { get; set; }
|
||||||
public List<ComboSelectListItem> ZoneCodes { get; set; }
|
|
||||||
public List<ComboSelectListItem> Types { get; set; }
|
|
||||||
public List<ComboSelectListItem> LocationStatus { get; set; }
|
public LocationVM()
|
||||||
|
{
|
||||||
|
SetInclude(x => x.LocationZone);
|
||||||
|
}
|
||||||
|
|
||||||
protected override void InitVM()
|
protected override void InitVM()
|
||||||
{
|
{
|
||||||
Inventorys.CopyContext(this);
|
AllLocationZones = DC.Set<LocationZone>().GetSelectListItems(Wtm, y => y.Name);
|
||||||
Inventorys.Searcher.LocationCode = Entity.Code;
|
|
||||||
|
|
||||||
//var tt = DC.Set<TaskHeader>().Where(x => x.ID > 1).Include(x => x.TaskDetails);
|
var currentCulture = Wtm.CurrentCulture;
|
||||||
//_unitWork = new UnitWork(Wtm);
|
var dictData = DC.Set<SysDictData>().ToList();
|
||||||
//var task = _unitWork.Find<TaskHeader>(x => x.ID > 1)
|
RoadwayTypes = dictData.Where(x => x.DictType == "RoadwayType").Select(x => new ComboSelectListItem
|
||||||
// .Include(x => x.TaskDetails)
|
{
|
||||||
// .FirstOrDefault();
|
Text = currentCulture == "zh" ? x.DictLabel : x.DictLabelUs,
|
||||||
//var details = task.TaskDetails;
|
Value = x.DictValue
|
||||||
|
}).ToList();
|
||||||
|
|
||||||
var CurrentCulture = Wtm.CurrentCulture;
|
|
||||||
var dictDatas = DC.Set<SysDictData>().ToList();
|
|
||||||
RoadwayTypes = dictDatas.Where(x => x.DictType == "RoadwayType").Select(x => new ComboSelectListItem
|
|
||||||
{
|
|
||||||
Text = CurrentCulture == "zh" ? x.DictLabel : x.DictLabelUs,
|
|
||||||
Value = x.DictValue
|
|
||||||
}).ToList();
|
|
||||||
ZoneCodes = dictDatas.Where(x => x.DictType == "ZoneCode").Select(x => new ComboSelectListItem
|
|
||||||
{
|
|
||||||
Text = CurrentCulture == "zh" ? x.DictLabel : x.DictLabelUs,
|
|
||||||
Value = x.DictValue
|
|
||||||
}).ToList();
|
|
||||||
Types = dictDatas.Where(x => x.DictType == "LocationType").Select(x => new ComboSelectListItem
|
|
||||||
{
|
|
||||||
Text = CurrentCulture == "zh" ? x.DictLabel : x.DictLabelUs,
|
|
||||||
Value = x.DictValue
|
|
||||||
}).ToList();
|
|
||||||
LocationStatus = dictDatas.Where(x => x.DictType == "LocationStatus").Select(x => new ComboSelectListItem
|
|
||||||
{
|
|
||||||
Text = CurrentCulture == "zh" ? x.DictLabel : x.DictLabelUs,
|
|
||||||
Value = x.DictValue
|
|
||||||
}).ToList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DoAdd()
|
public override void DoAdd()
|
||||||
@@ -94,7 +67,7 @@ namespace HHWMS.Web
|
|||||||
{
|
{
|
||||||
var locations = DC.Set<Location>()
|
var locations = DC.Set<Location>()
|
||||||
.Where(l => l.RoadWay == roadway
|
.Where(l => l.RoadWay == roadway
|
||||||
&& l.Status == "empty"
|
&& l.Status == LocationStatusEnum.Empty
|
||||||
&& l.RowFlag == 0) // 单伸位只查找外仓位
|
&& l.RowFlag == 0) // 单伸位只查找外仓位
|
||||||
.OrderBy(l => l.Layer)
|
.OrderBy(l => l.Layer)
|
||||||
.ThenBy(l => l.Line)
|
.ThenBy(l => l.Line)
|
||||||
@@ -124,10 +97,10 @@ namespace HHWMS.Web
|
|||||||
|
|
||||||
// 1. 优先查找里外仓位都为空的里仓位
|
// 1. 优先查找里外仓位都为空的里仓位
|
||||||
var emptyInnerLocation = locationPairs.Values
|
var emptyInnerLocation = locationPairs.Values
|
||||||
.Where(l => l.RowFlag == 1
|
.Where(l => l.RowFlag == RowFlagEnum.Inner
|
||||||
&& l.Status == "empty"
|
&& l.Status == LocationStatusEnum.Empty
|
||||||
&& locationPairs.TryGetValue(l.ContiguousCode, out var outer)
|
&& locationPairs.TryGetValue(l.ContiguousCode, out var outer)
|
||||||
&& outer.Status == "empty")
|
&& outer.Status == LocationStatusEnum.Empty)
|
||||||
.OrderBy(l => l.Layer)
|
.OrderBy(l => l.Layer)
|
||||||
.ThenBy(l => l.Line)
|
.ThenBy(l => l.Line)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
@@ -140,9 +113,9 @@ namespace HHWMS.Web
|
|||||||
// 2. 查找里仓位有货,外仓位为空的外仓位
|
// 2. 查找里仓位有货,外仓位为空的外仓位
|
||||||
var availableOuterLocation = locationPairs.Values
|
var availableOuterLocation = locationPairs.Values
|
||||||
.Where(l => l.RowFlag == 0
|
.Where(l => l.RowFlag == 0
|
||||||
&& l.Status == "empty"
|
&& l.Status == LocationStatusEnum.Empty
|
||||||
&& locationPairs.TryGetValue(l.ContiguousCode, out var inner)
|
&& locationPairs.TryGetValue(l.ContiguousCode, out var inner)
|
||||||
&& inner.Status == "some")
|
&& inner.Status == LocationStatusEnum.Some)
|
||||||
.OrderBy(l => l.Layer)
|
.OrderBy(l => l.Layer)
|
||||||
.ThenBy(l => l.Line)
|
.ThenBy(l => l.Line)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
@@ -240,8 +213,7 @@ namespace HHWMS.Web
|
|||||||
l.RowFlag,
|
l.RowFlag,
|
||||||
l.Layer,
|
l.Layer,
|
||||||
l.Line,
|
l.Line,
|
||||||
l.RoadWay,
|
l.RoadWay
|
||||||
l.ZoneCode
|
|
||||||
})
|
})
|
||||||
.ToDictionary(l => l.Code);
|
.ToDictionary(l => l.Code);
|
||||||
|
|
||||||
@@ -265,13 +237,12 @@ namespace HHWMS.Web
|
|||||||
{
|
{
|
||||||
case "2": // 单伸位
|
case "2": // 单伸位
|
||||||
var singleLocations = roadwayLocations
|
var singleLocations = roadwayLocations
|
||||||
.Where(l => l.RowFlag == 0 && l.Status == "empty")
|
.Where(l => l.RowFlag == 0 && l.Status == LocationStatusEnum.Empty)
|
||||||
.OrderBy(l => l.Layer)
|
.OrderBy(l => l.Layer)
|
||||||
.ThenBy(l => l.Line)
|
.ThenBy(l => l.Line)
|
||||||
.Select(l => new
|
.Select(l => new
|
||||||
{
|
{
|
||||||
LocationCode = l.Code,
|
LocationCode = l.Code,
|
||||||
l.ZoneCode,
|
|
||||||
l.RoadWay,
|
l.RoadWay,
|
||||||
l.Layer,
|
l.Layer,
|
||||||
l.Line,
|
l.Line,
|
||||||
@@ -283,16 +254,15 @@ namespace HHWMS.Web
|
|||||||
case "4": // 双伸位
|
case "4": // 双伸位
|
||||||
// 1. 查找里外都为空的里仓位
|
// 1. 查找里外都为空的里仓位
|
||||||
var emptyInnerLocations = roadwayLocations
|
var emptyInnerLocations = roadwayLocations
|
||||||
.Where(l => l.RowFlag == 1
|
.Where(l => l.RowFlag == RowFlagEnum.Inner
|
||||||
&& l.Status == "empty"
|
&& l.Status == LocationStatusEnum.Empty
|
||||||
&& allLocations.TryGetValue(l.ContiguousCode, out var outer)
|
&& allLocations.TryGetValue(l.ContiguousCode, out var outer)
|
||||||
&& outer.Status == "empty")
|
&& outer.Status == LocationStatusEnum.Empty)
|
||||||
.OrderBy(l => l.Layer)
|
.OrderBy(l => l.Layer)
|
||||||
.ThenBy(l => l.Line)
|
.ThenBy(l => l.Line)
|
||||||
.Select(l => new
|
.Select(l => new
|
||||||
{
|
{
|
||||||
LocationCode = l.Code,
|
LocationCode = l.Code,
|
||||||
l.ZoneCode,
|
|
||||||
l.RoadWay,
|
l.RoadWay,
|
||||||
l.Layer,
|
l.Layer,
|
||||||
l.Line,
|
l.Line,
|
||||||
@@ -303,15 +273,14 @@ namespace HHWMS.Web
|
|||||||
// 2. 查找里仓位有货,外仓位为空的外仓位
|
// 2. 查找里仓位有货,外仓位为空的外仓位
|
||||||
var availableOuterLocations = roadwayLocations
|
var availableOuterLocations = roadwayLocations
|
||||||
.Where(l => l.RowFlag == 0
|
.Where(l => l.RowFlag == 0
|
||||||
&& l.Status == "empty"
|
&& l.Status == LocationStatusEnum.Empty
|
||||||
&& allLocations.TryGetValue(l.ContiguousCode, out var inner)
|
&& allLocations.TryGetValue(l.ContiguousCode, out var inner)
|
||||||
&& inner.Status == "some")
|
&& inner.Status == LocationStatusEnum.Some)
|
||||||
.OrderBy(l => l.Layer)
|
.OrderBy(l => l.Layer)
|
||||||
.ThenBy(l => l.Line)
|
.ThenBy(l => l.Line)
|
||||||
.Select(l => new
|
.Select(l => new
|
||||||
{
|
{
|
||||||
LocationCode = l.Code,
|
LocationCode = l.Code,
|
||||||
l.ZoneCode,
|
|
||||||
l.RoadWay,
|
l.RoadWay,
|
||||||
l.Layer,
|
l.Layer,
|
||||||
l.Line,
|
l.Line,
|
||||||
|
|||||||
@@ -3,9 +3,10 @@
|
|||||||
|
|
||||||
<wt:form vm="@Model">
|
<wt:form vm="@Model">
|
||||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||||
<wt:combobox field="Entity.ZoneCode" items="ZoneCodes" />
|
<wt:combobox field="Entity.LocationZoneId" items="AllLocationZones" empty-text="@Localizer["Sys.All"]"/>
|
||||||
<wt:combobox field="RoadwayType" items="RoadwayTypes" />
|
|
||||||
<wt:combobox field="Entity.Type" items="Types" />
|
<wt:combobox field="RoadwayType" items="RoadwayTypes" empty-text="@Localizer["Sys.All"]"/>
|
||||||
|
<wt:combobox field="Entity.Type" empty-text="@Localizer["Sys.All"]"/>
|
||||||
<wt:textbox field="BeginLine"/>
|
<wt:textbox field="BeginLine"/>
|
||||||
<wt:textbox field="Entity.Line" label-text=@Localizer["Location.EndLine"]/>
|
<wt:textbox field="Entity.Line" label-text=@Localizer["Location.EndLine"]/>
|
||||||
<wt:textbox field="BeginLayer"/>
|
<wt:textbox field="BeginLayer"/>
|
||||||
|
|||||||
@@ -3,15 +3,16 @@
|
|||||||
|
|
||||||
<wt:form vm="@Model">
|
<wt:form vm="@Model">
|
||||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||||
|
<wt:combobox field="Entity.LocationZoneId" items="AllLocationZones"/>
|
||||||
<wt:textbox field="Entity.Code" />
|
<wt:textbox field="Entity.Code" />
|
||||||
<wt:textbox field="Entity.Type" />
|
<wt:combobox field="Entity.Type" />
|
||||||
<wt:textbox field="Entity.Status" />
|
<wt:combobox field="Entity.Status" />
|
||||||
|
<wt:textbox field="Entity.RoadWay" />
|
||||||
<wt:textbox field="Entity.Row" />
|
<wt:textbox field="Entity.Row" />
|
||||||
<wt:textbox field="Entity.Line" />
|
<wt:textbox field="Entity.Line" />
|
||||||
<wt:textbox field="Entity.Layer" />
|
<wt:textbox field="Entity.Layer" />
|
||||||
<wt:textbox field="Entity.RoadWay" />
|
<wt:combobox field="Entity.RowFlag" />
|
||||||
<wt:textbox field="Entity.ContainerCode" />
|
<wt:textbox field="Entity.ContainerCode" />
|
||||||
<wt:textbox field="Entity.ZoneCode" />
|
|
||||||
<wt:switch field="Entity.IsStop" />
|
<wt:switch field="Entity.IsStop" />
|
||||||
<wt:textbox field="Entity.Length" />
|
<wt:textbox field="Entity.Length" />
|
||||||
<wt:textbox field="Entity.Width" />
|
<wt:textbox field="Entity.Width" />
|
||||||
|
|||||||
@@ -4,15 +4,16 @@
|
|||||||
<wt:form vm="@Model">
|
<wt:form vm="@Model">
|
||||||
<wt:quote>@Localizer["Sys.DeleteConfirm"]</wt:quote>
|
<wt:quote>@Localizer["Sys.DeleteConfirm"]</wt:quote>
|
||||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||||
|
<wt:display field="Entity.LocationZone.Name" />
|
||||||
<wt:display field="Entity.Code" />
|
<wt:display field="Entity.Code" />
|
||||||
<wt:display field="Entity.Type" />
|
<wt:display field="Entity.Type" />
|
||||||
<wt:display field="Entity.Status" />
|
<wt:display field="Entity.Status" />
|
||||||
|
<wt:display field="Entity.RoadWay" />
|
||||||
<wt:display field="Entity.Row" />
|
<wt:display field="Entity.Row" />
|
||||||
<wt:display field="Entity.Line" />
|
<wt:display field="Entity.Line" />
|
||||||
<wt:display field="Entity.Layer" />
|
<wt:display field="Entity.Layer" />
|
||||||
<wt:display field="Entity.RoadWay" />
|
<wt:display field="Entity.RowFlag" />
|
||||||
<wt:display field="Entity.ContainerCode" />
|
<wt:display field="Entity.ContainerCode" />
|
||||||
<wt:display field="Entity.ZoneCode" />
|
|
||||||
<wt:display field="Entity.IsStop" />
|
<wt:display field="Entity.IsStop" />
|
||||||
<wt:display field="Entity.Length" />
|
<wt:display field="Entity.Length" />
|
||||||
<wt:display field="Entity.Width" />
|
<wt:display field="Entity.Width" />
|
||||||
|
|||||||
@@ -1,26 +1,24 @@
|
|||||||
@model HHWMS.Web.LocationVM
|
@model HHWMS.Web.LocationVM
|
||||||
@inject IStringLocalizer<Program> Localizer;
|
@inject IStringLocalizer<Program> Localizer;
|
||||||
|
|
||||||
<wt:form vm="@Model">
|
<wt:form vm="@Model">
|
||||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||||
|
<wt:display field="Entity.LocationZone.Name" />
|
||||||
<wt:display field="Entity.Code" />
|
<wt:display field="Entity.Code" />
|
||||||
@* <wt:display field="Entity.Type" />
|
<wt:display field="Entity.Type" />
|
||||||
<wt:display field="Entity.Status" />
|
<wt:display field="Entity.Status" />
|
||||||
|
<wt:display field="Entity.RoadWay" />
|
||||||
<wt:display field="Entity.Row" />
|
<wt:display field="Entity.Row" />
|
||||||
<wt:display field="Entity.Line" />
|
<wt:display field="Entity.Line" />
|
||||||
<wt:display field="Entity.Layer" />
|
<wt:display field="Entity.Layer" />
|
||||||
<wt:display field="Entity.RoadWay" />
|
<wt:display field="Entity.RowFlag" />
|
||||||
<wt:display field="Entity.ContainerCode" />
|
<wt:display field="Entity.ContainerCode" />
|
||||||
<wt:display field="Entity.ZoneCode" />
|
|
||||||
<wt:display field="Entity.IsStop" />
|
<wt:display field="Entity.IsStop" />
|
||||||
<wt:display field="Entity.Length" />
|
<wt:display field="Entity.Length" />
|
||||||
<wt:display field="Entity.Width" />
|
<wt:display field="Entity.Width" />
|
||||||
<wt:display field="Entity.Height" />
|
<wt:display field="Entity.Height" />
|
||||||
<wt:display field="Entity.ContiguousCode" /> *@
|
<wt:display field="Entity.ContiguousCode" />
|
||||||
</wt:row>
|
</wt:row>
|
||||||
|
|
||||||
<wt:grid vm="@Model.Inventorys" height="300" hidden-checkbox="true" hidden-grid-index="true" use-local-data="true" hidden-panel="true"/>
|
|
||||||
|
|
||||||
<wt:row align="AlignEnum.Right">
|
<wt:row align="AlignEnum.Right">
|
||||||
<wt:closebutton />
|
<wt:closebutton />
|
||||||
</wt:row>
|
</wt:row>
|
||||||
|
|||||||
@@ -1,17 +1,18 @@
|
|||||||
@model HHWMS.Web.LocationVM
|
@model HHWMS.Web.LocationVM
|
||||||
@inject IStringLocalizer<Program> Localizer;
|
@inject IStringLocalizer<Program> Localizer;
|
||||||
|
|
||||||
<wt:form vm="@Model">
|
<wt:form vm="@Model">
|
||||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||||
|
<wt:combobox field="Entity.LocationZoneId" items="AllLocationZones"/>
|
||||||
<wt:textbox field="Entity.Code" />
|
<wt:textbox field="Entity.Code" />
|
||||||
<wt:combobox field="Entity.Type" items="Types" />
|
<wt:combobox field="Entity.Type" />
|
||||||
<wt:combobox field="Entity.Status" items="LocationStatus" />
|
<wt:combobox field="Entity.Status" />
|
||||||
|
<wt:textbox field="Entity.RoadWay" />
|
||||||
<wt:textbox field="Entity.Row" />
|
<wt:textbox field="Entity.Row" />
|
||||||
<wt:textbox field="Entity.Line" />
|
<wt:textbox field="Entity.Line" />
|
||||||
<wt:textbox field="Entity.Layer" />
|
<wt:textbox field="Entity.Layer" />
|
||||||
<wt:textbox field="Entity.RoadWay" />
|
<wt:combobox field="Entity.RowFlag" />
|
||||||
<wt:textbox field="Entity.ContainerCode" />
|
<wt:textbox field="Entity.ContainerCode" />
|
||||||
<wt:combobox field="Entity.ZoneCode" items="ZoneCodes"/>
|
|
||||||
<wt:switch field="Entity.IsStop" />
|
<wt:switch field="Entity.IsStop" />
|
||||||
<wt:textbox field="Entity.Length" />
|
<wt:textbox field="Entity.Length" />
|
||||||
<wt:textbox field="Entity.Width" />
|
<wt:textbox field="Entity.Width" />
|
||||||
|
|||||||
@@ -1,22 +1,20 @@
|
|||||||
@model HHWMS.Web.LocationListVM
|
@model HHWMS.Web.LocationListVM
|
||||||
@inject IStringLocalizer<Program> Localizer;
|
@inject IStringLocalizer<Program> Localizer;
|
||||||
|
|
||||||
<wt:searchpanel vm="@Model" reset-btn="true">
|
<wt:searchpanel vm="@Model" reset-btn="true">
|
||||||
<wt:row items-per-row="ItemsPerRowEnum.Three">
|
<wt:row items-per-row="ItemsPerRowEnum.Three">
|
||||||
<wt:combobox field="Searcher.ZoneCode" items="ZoneCodes" />
|
<wt:combobox field="Searcher.LocationZoneId" items="Searcher.AllLocationZones" empty-text="@Localizer["Sys.All"]" />
|
||||||
<wt:textbox field="Searcher.Code" />
|
<wt:textbox field="Searcher.Code" />
|
||||||
@* <wt:combobox field="Searcher.Type" items="Types" />
|
|
||||||
<wt:combobox field="Searcher.Status" items="LocationStatus" />
|
|
||||||
<wt:textbox field="Searcher.Row" />
|
|
||||||
<wt:textbox field="Searcher.Line" />
|
|
||||||
<wt:textbox field="Searcher.Layer" />
|
|
||||||
<wt:textbox field="Searcher.RoadWay" />
|
|
||||||
<wt:textbox field="Searcher.ContainerCode" />
|
<wt:textbox field="Searcher.ContainerCode" />
|
||||||
<wt:combobox field="Searcher.IsStop" empty-text="@Localizer["Sys.All"]" /> *@
|
<wt:combobox field="Searcher.Type" empty-text="@Localizer["Sys.All"]" />
|
||||||
@*<wt:textbox field="Searcher.ContiguousCode" />*@
|
<wt:combobox field="Searcher.Status" empty-text="@Localizer["Sys.All"]" />
|
||||||
|
<wt:textbox field="Searcher.RoadWay" />
|
||||||
|
<wt:combobox field="Searcher.IsStop" empty-text="@Localizer["Sys.All"]" />
|
||||||
|
<wt:combobox field="Searcher.RowFlag" empty-text="@Localizer["Sys.All"]" />
|
||||||
</wt:row>
|
</wt:row>
|
||||||
</wt:searchpanel>
|
</wt:searchpanel>
|
||||||
<wt:grid vm="@Model" url="/configs/Location/Search"/>
|
<wt:grid vm="@Model" url="/configs/Location/Search"/>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
let template = {
|
let template = {
|
||||||
"panels": [
|
"panels": [
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ namespace HHWMS.Web.Controllers
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return FFResult().CloseDialog().RefreshGridRow(vm.Entity.ID);
|
return FFResult().CloseDialog().RefreshGrid(index: 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ namespace HHWMS.Web
|
|||||||
|
|
||||||
protected override void InitVM()
|
protected override void InitVM()
|
||||||
{
|
{
|
||||||
var vm = Wtm.CreateVM<LocationVM>();
|
|
||||||
ZoneCodes = vm.ZoneCodes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DoAdd()
|
public override void DoAdd()
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ namespace HHWMS.Web.Controllers
|
|||||||
data.Add(new ChartData
|
data.Add(new ChartData
|
||||||
{
|
{
|
||||||
Value = item.count,
|
Value = item.count,
|
||||||
Category = item.status,
|
Category = item.status.ToString(),
|
||||||
Series = "locations"
|
Series = "locations"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ namespace HHWMS.Web
|
|||||||
public DbSet<ReportDesign> ReportDesigns { get; set; }
|
public DbSet<ReportDesign> ReportDesigns { get; set; }
|
||||||
public DbSet<Material> Materials { get; set; }
|
public DbSet<Material> Materials { get; set; }
|
||||||
public DbSet<PrintConfig> PrintConfigs { get; set; }
|
public DbSet<PrintConfig> PrintConfigs { get; set; }
|
||||||
|
public DbSet<LocationZone> LocationZones { get; set; }
|
||||||
public override async Task<bool> DataInit(object allModules, bool IsSpa)
|
public override async Task<bool> DataInit(object allModules, bool IsSpa)
|
||||||
{
|
{
|
||||||
var state = await base.DataInit(allModules, IsSpa);
|
var state = await base.DataInit(allModules, IsSpa);
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="..\common.props" />
|
<Import Project="..\common.props" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Folder Include="Areas\Configs\ViewModels\LocationVMs\" />
|
||||||
|
<Folder Include="Areas\Configs\Views\Location\" />
|
||||||
<Folder Include="wwwroot\layuiadmin\lib\extend\" />
|
<Folder Include="wwwroot\layuiadmin\lib\extend\" />
|
||||||
<Folder Include="wwwroot\upload\" />
|
<Folder Include="wwwroot\upload\" />
|
||||||
<Folder Include="IOT\" />
|
<Folder Include="IOT\" />
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ using System.ComponentModel.DataAnnotations;
|
|||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using WalkingTec.Mvvm.Core;
|
using WalkingTec.Mvvm.Core;
|
||||||
|
|
||||||
namespace HHWMS.Web.Models
|
namespace HHWMS.Web.Models;
|
||||||
{
|
|
||||||
[Table("Location")]
|
[Table("Location")]
|
||||||
public class Location : BasePoco
|
public class Location : BasePoco
|
||||||
{
|
{
|
||||||
@@ -12,18 +12,23 @@ namespace HHWMS.Web.Models
|
|||||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
public new int ID { get; set; }
|
public new int ID { get; set; }
|
||||||
|
|
||||||
|
public LocationZone LocationZone { get; set; }
|
||||||
|
[Display(Name = "Location.ZoneCode", Description = "库位编码")]
|
||||||
|
public int LocationZoneId { get; set; }
|
||||||
|
|
||||||
[Display(Name = "Location.Code", Description = "库位编码")]
|
[Display(Name = "Location.Code", Description = "库位编码")]
|
||||||
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||||
public string Code { get; set; }
|
public string Code { get; set; }
|
||||||
|
|
||||||
[Display(Name = "Location.Type", Description = "库位类型")]
|
[Display(Name = "Location.Type", Description = "库位类型")]
|
||||||
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
public LocationTypeEnum Type { get; set; }
|
||||||
[Required(ErrorMessage = "Validate.{0}required")]
|
|
||||||
public string Type { get; set; }
|
|
||||||
|
|
||||||
[Display(Name = "Location.Status", Description = "库位状态")]
|
[Display(Name = "Location.Status", Description = "库位状态")]
|
||||||
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
public LocationStatusEnum Status { get; set; }
|
||||||
public string Status { get; set; }
|
|
||||||
|
[Display(Name = "Location.RoadWay", Description = "巷道")]
|
||||||
|
[Required(ErrorMessage = "Validate.{0}required")]
|
||||||
|
public short? RoadWay { get; set; }
|
||||||
|
|
||||||
[Display(Name = "Location.Row", Description = "行")]
|
[Display(Name = "Location.Row", Description = "行")]
|
||||||
public short Row { get; set; }
|
public short Row { get; set; }
|
||||||
@@ -36,21 +41,13 @@ namespace HHWMS.Web.Models
|
|||||||
[Required(ErrorMessage = "Validate.{0}required")]
|
[Required(ErrorMessage = "Validate.{0}required")]
|
||||||
public short Layer { get; set; }
|
public short Layer { get; set; }
|
||||||
|
|
||||||
[Display(Name = "Location.RoadWay", Description = "巷道")]
|
|
||||||
[Required(ErrorMessage = "Validate.{0}required")]
|
|
||||||
public short? RoadWay { get; set; }
|
|
||||||
|
|
||||||
[Display(Name = "Location.RowFlag", Description = "内外标识,0:外仓位,1:里仓位")]
|
[Display(Name = "Location.RowFlag", Description = "内外标识,0:外仓位,1:里仓位")]
|
||||||
public short? RowFlag { get; set; }
|
public RowFlagEnum RowFlag { get; set; }
|
||||||
|
|
||||||
[Display(Name = "Location.ContainerCode", Description = "容器编码")]
|
[Display(Name = "Location.ContainerCode", Description = "容器编码")]
|
||||||
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||||
public string ContainerCode { get; set; }
|
public string ContainerCode { get; set; }
|
||||||
|
|
||||||
[Display(Name = "Location.ZoneCode", Description = "库区")]
|
|
||||||
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
|
||||||
public string ZoneCode { get; set; }
|
|
||||||
|
|
||||||
[Display(Name = "Location.IsStop", Description = "是否禁用")]
|
[Display(Name = "Location.IsStop", Description = "是否禁用")]
|
||||||
public bool IsStop { get; set; }
|
public bool IsStop { get; set; }
|
||||||
|
|
||||||
@@ -72,4 +69,44 @@ namespace HHWMS.Web.Models
|
|||||||
|
|
||||||
public Guid? Version { get; set; }
|
public Guid? Version { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum LocationTypeEnum : short
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 立库
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "LocationTypeEnum.L")]
|
||||||
|
L = 0,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 模具库
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "LocationTypeEnum.M")]
|
||||||
|
M = 1,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 线边库
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "LocationTypeEnum.X")]
|
||||||
|
X = 2
|
||||||
|
}
|
||||||
|
public enum LocationStatusEnum : short
|
||||||
|
{
|
||||||
|
[Display(Name = "LocationStatusEnum.Empty")]
|
||||||
|
Empty = 0,
|
||||||
|
[Display(Name = "LocationStatusEnum.EmptyContainer")]
|
||||||
|
EmptyContainer = 1,
|
||||||
|
[Display(Name = "LocationStatusEnum.Some")]
|
||||||
|
Some = 2,
|
||||||
|
[Display(Name = "LocationStatusEnum.Full")]
|
||||||
|
Full = 3,
|
||||||
|
[Display(Name = "LocationStatusEnum.Locked")]
|
||||||
|
Locked = 4,
|
||||||
|
}
|
||||||
|
public enum RowFlagEnum : short
|
||||||
|
{
|
||||||
|
[Display(Name = "RowFlagEnum.Outer")]
|
||||||
|
Outer = 0,
|
||||||
|
[Display(Name = "RowFlagEnum.Inner")]
|
||||||
|
Inner = 1,
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using WalkingTec.Mvvm.Core;
|
||||||
|
|
||||||
|
namespace HHWMS.Web.Models
|
||||||
|
{
|
||||||
|
[Table("LocationZone")]
|
||||||
|
public class LocationZone : BasePoco
|
||||||
|
{
|
||||||
|
[Key]
|
||||||
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
public new int ID { get; set; }
|
||||||
|
|
||||||
|
[Display(Name = "Location.ZoneCode", Description = "库区")]
|
||||||
|
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||||
|
public string ZoneCode { get; set; }
|
||||||
|
|
||||||
|
[Display(Name = "Location.ZoneName", Description = "名称")]
|
||||||
|
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||||
|
public string Name { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -274,118 +274,4 @@ namespace HHWMS.Web.Models
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 区域
|
|
||||||
/// </summary>
|
|
||||||
public static class ZoneCodeEnum
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 盘料库 = "L";
|
|
||||||
/// </summary>
|
|
||||||
public const string 盘料库 = "L";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 散料库 = "C";
|
|
||||||
/// </summary>
|
|
||||||
public const string 散料库 = "C";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 货架库 = "P";
|
|
||||||
/// </summary>
|
|
||||||
public const string 货架库 = "P";
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 区域
|
|
||||||
/// </summary>
|
|
||||||
public static class LocationTypeEnum
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 盘料库位 = "L";
|
|
||||||
/// </summary>
|
|
||||||
public const string 盘料库位 = "L";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 料塔 = "T";
|
|
||||||
/// </summary>
|
|
||||||
public const string 料塔 = "T";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 机械臂工位 = "G2";
|
|
||||||
/// </summary>
|
|
||||||
public const string 机械臂工位 = "G2";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 堆垛机工位 = "G1";
|
|
||||||
/// </summary>
|
|
||||||
public const string 堆垛机工位 = "G1";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 散料库 = "C";
|
|
||||||
/// </summary>
|
|
||||||
public const string 散料库位 = "C";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 散料库站台 = "C1";
|
|
||||||
/// </summary>
|
|
||||||
public const string 散料库站台 = "C1";
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 站台类型
|
|
||||||
/// </summary>
|
|
||||||
public static class StationCode
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 散料库左抽屉 = "C02-02-18-03";
|
|
||||||
/// </summary>
|
|
||||||
public const string 散料库左抽屉 = "C02-02-18-03";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 散料库右抽屉 = "C02-01-18-03";
|
|
||||||
/// </summary>
|
|
||||||
public const string 散料库右抽屉 = "C02-01-18-03";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 盘料库左工位 = "L01-02-34-02";
|
|
||||||
/// </summary>
|
|
||||||
public const string 盘料库左工位 = "L01-02-34-02";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 盘料库右工位 = "L01-01-34-02";
|
|
||||||
/// </summary>
|
|
||||||
public const string 盘料库右工位 = "L01-01-34-02";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 左料塔 = "L01";
|
|
||||||
/// </summary>
|
|
||||||
public const string 左料塔 = "L01";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 右料塔 = "L02";
|
|
||||||
/// </summary>
|
|
||||||
public const string 右料塔 = "L02";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 左料塔工位 = "L01-01";
|
|
||||||
/// </summary>
|
|
||||||
public const string 左料塔工位 = "L01-01";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 右料塔工位 = "L01-02";
|
|
||||||
/// </summary>
|
|
||||||
public const string 右料塔工位 = "L01-02";
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 料塔类型
|
|
||||||
/// </summary>
|
|
||||||
public enum LiaoTaTypeEnum : int
|
|
||||||
{
|
|
||||||
// 1: 20层料塔类型1; 2:16层料塔类型1; 3:20层料塔类型2 4:16层料塔类型2
|
|
||||||
L01 = 1,
|
|
||||||
L02 = 2
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -13,10 +13,13 @@ using WalkingTec.Mvvm.Core.Support.FileHandlers;
|
|||||||
using WalkingTec.Mvvm.Mvc;
|
using WalkingTec.Mvvm.Mvc;
|
||||||
using HHWMS.Web.Support;
|
using HHWMS.Web.Support;
|
||||||
using HHWMS.Web;
|
using HHWMS.Web;
|
||||||
|
using HHWMS.Web.Models;
|
||||||
|
using Microsoft.CodeAnalysis;
|
||||||
using Quartz;
|
using Quartz;
|
||||||
using SoapCore;
|
using SoapCore;
|
||||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||||
using WebService;
|
using WebService;
|
||||||
|
using Location = HHWMS.Web.Models.Location;
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
builder.Logging.ClearProviders();
|
builder.Logging.ClearProviders();
|
||||||
@@ -130,6 +133,7 @@ app.Run();
|
|||||||
{
|
{
|
||||||
List<IDataPrivilege> pris = new List<IDataPrivilege>();
|
List<IDataPrivilege> pris = new List<IDataPrivilege>();
|
||||||
//Add data privilege to specific type
|
//Add data privilege to specific type
|
||||||
|
pris.Add(new DataPrivilegeInfo<LocationZone>("库区",x => x.ZoneCode));
|
||||||
return pris;
|
return pris;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -924,4 +924,7 @@
|
|||||||
<data name="_Admin.ZipCode" xml:space="preserve">
|
<data name="_Admin.ZipCode" xml:space="preserve">
|
||||||
<value>Zip</value>
|
<value>Zip</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="LocationStatusEnum.Locked" xml:space="preserve">
|
||||||
|
<value />
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -1141,7 +1141,7 @@
|
|||||||
<value>容器编码</value>
|
<value>容器编码</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Location.ZoneCode" xml:space="preserve">
|
<data name="Location.ZoneCode" xml:space="preserve">
|
||||||
<value>库区</value>
|
<value>库区编码</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Location.IsStop" xml:space="preserve">
|
<data name="Location.IsStop" xml:space="preserve">
|
||||||
<value>是否禁用</value>
|
<value>是否禁用</value>
|
||||||
@@ -1407,4 +1407,40 @@
|
|||||||
<data name="MenuKey.InterfaceLog" xml:space="preserve">
|
<data name="MenuKey.InterfaceLog" xml:space="preserve">
|
||||||
<value>接口日志</value>
|
<value>接口日志</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="LocationTypeEnum.M" xml:space="preserve">
|
||||||
|
<value>模具库</value>
|
||||||
|
</data>
|
||||||
|
<data name="LocationTypeEnum.L" xml:space="preserve">
|
||||||
|
<value>立库</value>
|
||||||
|
</data>
|
||||||
|
<data name="LocationTypeEnum.X" xml:space="preserve">
|
||||||
|
<value>线边库</value>
|
||||||
|
</data>
|
||||||
|
<data name="LocationStatusEnum.Empty" xml:space="preserve">
|
||||||
|
<value>空仓位</value>
|
||||||
|
</data>
|
||||||
|
<data name="LocationStatusEnum.EmptyContainer" xml:space="preserve">
|
||||||
|
<value>空容器</value>
|
||||||
|
</data>
|
||||||
|
<data name="LocationStatusEnum.Some" xml:space="preserve">
|
||||||
|
<value>有货</value>
|
||||||
|
</data>
|
||||||
|
<data name="LocationStatusEnum.Full" xml:space="preserve">
|
||||||
|
<value>满货</value>
|
||||||
|
</data>
|
||||||
|
<data name="RowFlagEnum.Outer" xml:space="preserve">
|
||||||
|
<value>外仓位</value>
|
||||||
|
</data>
|
||||||
|
<data name="RowFlagEnum.Inner" xml:space="preserve">
|
||||||
|
<value>里仓位</value>
|
||||||
|
</data>
|
||||||
|
<data name="Location.RowFlag" xml:space="preserve">
|
||||||
|
<value>仓位标志</value>
|
||||||
|
</data>
|
||||||
|
<data name="LocationStatusEnum.Locked" xml:space="preserve">
|
||||||
|
<value>锁定</value>
|
||||||
|
</data>
|
||||||
|
<data name="Location.ZoneName" xml:space="preserve">
|
||||||
|
<value>库区</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -26,19 +26,7 @@
|
|||||||
"Key": "default",
|
"Key": "default",
|
||||||
"Value": "Server=127.0.0.1;Port=3306;Database=WMS2;Uid=root;Password=abc123*;Character Set=utf8mb4;",
|
"Value": "Server=127.0.0.1;Port=3306;Database=WMS2;Uid=root;Password=abc123*;Character Set=utf8mb4;",
|
||||||
"DBType": "mysql"
|
"DBType": "mysql"
|
||||||
},
|
}
|
||||||
// {
|
|
||||||
// "Key": "default",
|
|
||||||
// "Value": "Data Source=.;Initial Catalog=WMS;User=sa;Password=abc123*;Persist Security Info=True",
|
|
||||||
// "DbContext": "DataContext",
|
|
||||||
// "DBType": "sqlserver" //DataBase, you can choose mysql,sqlserver,pgsql,sqlite,oracle
|
|
||||||
// }
|
|
||||||
//{
|
|
||||||
// "Key": "default",
|
|
||||||
// "Value": "Data Source=10.18.106.4;Initial Catalog=8357wms;User=wms;Password=abc123*;Persist Security Info=True",
|
|
||||||
// "DbContext": "DataContext",
|
|
||||||
// "DBType": "sqlserver" //DataBase, you can choose mysql,sqlserver,pgsql,sqlite,oracle
|
|
||||||
//}
|
|
||||||
],
|
],
|
||||||
"CookiePre": "HHWMS", //cookie前缀
|
"CookiePre": "HHWMS", //cookie前缀
|
||||||
"IsQuickDebug": true, //是否启用debug模式
|
"IsQuickDebug": true, //是否启用debug模式
|
||||||
|
|||||||
Reference in new issue
Block a user