添加位置名称字段
This commit is contained in:
@ -41,7 +41,11 @@ namespace WCS.DAL.DbModels
|
||||
public string RcsStoreCode { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 位置名称 -用于存储RCS修改的库存别名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "location_name", Length = 64, IsNullable = false, ColumnDescription = "位置名称,用于存储和显示")]
|
||||
public string LocationName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 可放置货架类型
|
||||
|
@ -205,6 +205,45 @@ namespace WCS.BLL.Manager
|
||||
.ExecuteCommand();
|
||||
}
|
||||
Logs.Write($"【定时任务】定时同步货架绑定情况,更新0个货架", LogsType.Tasks);
|
||||
|
||||
#region 更新库位别名
|
||||
//获取当前所有库位
|
||||
var locationInfos = DbHelp.db.Queryable<LocationInfo>()
|
||||
.ToList();
|
||||
//RCS中位置的信息
|
||||
var rcsLocationDatas = result.data.Where(t => !string.IsNullOrEmpty(t.podCode))
|
||||
.Select(t => new
|
||||
{
|
||||
LocationCode = t.mapDataCode,
|
||||
LocationName = t.positionCode,
|
||||
})
|
||||
.Distinct()
|
||||
.ToList();
|
||||
var needUpdateLocationInfos = new List<LocationInfo>();
|
||||
foreach (var locationInfo in locationInfos)
|
||||
{
|
||||
//RCS中找寻同名库位
|
||||
var rcsLocationData = rcsLocationDatas.Where(t => t.LocationCode == locationInfo.LocationCode)
|
||||
.First();
|
||||
if (rcsLocationData == null)
|
||||
{
|
||||
Logs.Write($"【定时任务】定时同步库位别名,出现问题:RCS接口未返回同名库位{locationInfo.LocationCode}", LogsType.Tasks);
|
||||
continue;
|
||||
}
|
||||
if (locationInfo.LocationName != rcsLocationData.LocationName)
|
||||
{
|
||||
locationInfo.LocationName = rcsLocationData.LocationName;
|
||||
needUpdateLocationInfos.Add(locationInfo);
|
||||
}
|
||||
}
|
||||
if (needUpdateLocationInfos != null && needUpdateLocationInfos.Count > 0)
|
||||
{
|
||||
Logs.Write($"【定时任务】定时同步库位别名,更新{needUpdateLocationInfos.Count}个库位", LogsType.Tasks);
|
||||
DbHelp.db.Updateable(needUpdateLocationInfos)
|
||||
.UpdateColumns(t => new { t.LocationName})
|
||||
.ExecuteCommand();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -51,6 +51,7 @@ namespace WCS.BLL.Services.Service
|
||||
|
||||
LocationArea = li.LocationArea,
|
||||
LocationCode = li.LocationCode,
|
||||
LocationName = li.LocationName,
|
||||
|
||||
MatCode = mci.MatCode,
|
||||
MatName = mci.MatName,
|
||||
@ -137,6 +138,7 @@ namespace WCS.BLL.Services.Service
|
||||
|
||||
LocationArea = li.LocationArea,
|
||||
LocationCode = li.LocationCode,
|
||||
LocationName = li.LocationName,
|
||||
|
||||
MatCode = mci.MatCode,
|
||||
MatName = mci.MatName,
|
||||
@ -209,6 +211,7 @@ namespace WCS.BLL.Services.Service
|
||||
|
||||
LocationArea = li.LocationArea,
|
||||
LocationCode = li.LocationCode,
|
||||
LocationName = li.LocationName,
|
||||
|
||||
MatCode = mci.MatCode,
|
||||
MatName = mci.MatName,
|
||||
|
@ -18,6 +18,11 @@ namespace WCS.Model.ApiModel.StoreInfo
|
||||
/// </summary>
|
||||
public string LocationCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 位置名称
|
||||
/// </summary>
|
||||
public string LocationName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 库位区域
|
||||
/// </summary>
|
||||
|
@ -16,9 +16,13 @@ namespace WCS.Model.ApiModel.MatDetailCurrentInfo
|
||||
//货架位置的区域
|
||||
public string? LocationArea { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// 货架位置
|
||||
/// 货架位置 位置的编码
|
||||
/// </summary>
|
||||
public string? LocationCode { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// 位置名称 RCS对应位置的别名
|
||||
/// </summary>
|
||||
public string? LocationName { get; set; } = string.Empty;
|
||||
#endregion
|
||||
|
||||
#region 物料属性
|
||||
|
@ -82,6 +82,8 @@ namespace WCS.WebApi.Controllers
|
||||
new ExportableColumn("序号","RowNumber"),
|
||||
new ExportableColumn("位置区域","LocationArea"),
|
||||
new ExportableColumn("位置编号","LocationCode"),
|
||||
new ExportableColumn("位置名称","LocationName"),
|
||||
|
||||
new ExportableColumn("RCS库位编号","RcsStoreCode"),
|
||||
new ExportableColumn("可放置货架类型","AllowShelfTypesNameStr"),
|
||||
new ExportableColumn("启用状态","IsEnableStr"),
|
||||
|
@ -52,6 +52,8 @@ namespace WCS.WebApi.Controllers
|
||||
new ExportableColumn("货架编码","ShelfCode"),
|
||||
new ExportableColumn("位置区域","LocationArea"),
|
||||
new ExportableColumn("位置编号","LocationCode"),
|
||||
new ExportableColumn("位置名称","LocationName"),
|
||||
|
||||
new ExportableColumn("物料编码","MatCode"),
|
||||
new ExportableColumn("物料名称","MatName"),
|
||||
new ExportableColumn("物料批次","MatBatch"),
|
||||
|
@ -69,6 +69,7 @@ namespace 智慧物流软件系统.ViewModel
|
||||
}
|
||||
LocationCode = locationInfoModel.LocationCode;
|
||||
RcsStoreCode = locationInfoModel.RcsStoreCode;
|
||||
LocationName = locationInfoModel.LocationName;
|
||||
//comboBox.selec
|
||||
App.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
@ -89,6 +90,7 @@ namespace 智慧物流软件系统.ViewModel
|
||||
LocationAreaId = SelectedLocationAreaItem.Id,
|
||||
LocationArea = SelectedLocationAreaItem.LocationAreaName,
|
||||
LocationCode = LocationCode,
|
||||
LocationName = LocationName,
|
||||
RcsStoreCode = RcsStoreCode,
|
||||
ModifyUser = LocalStatic.CurrentUser,
|
||||
AllowShelfTypes = selectShelfTypes,
|
||||
@ -136,6 +138,16 @@ namespace 智慧物流软件系统.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
private string locationName;
|
||||
public string LocationName
|
||||
{
|
||||
get { return locationName; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref locationName, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 允许放置的货架类型
|
||||
/// </summary>
|
||||
|
@ -7,7 +7,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
mc:Ignorable="d"
|
||||
Height="320" Width="320" WindowStyle="None" BorderThickness="0" Background="{x:Null}" AllowsTransparency="True" WindowStartupLocation="CenterScreen" Opacity="1">
|
||||
Height="360" Width="320" WindowStyle="None" BorderThickness="0" Background="{x:Null}" AllowsTransparency="True" WindowStartupLocation="CenterScreen" Opacity="1">
|
||||
<Border BorderBrush="Gray" Background="WhiteSmoke" CornerRadius="5" BorderThickness="1">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
@ -47,7 +47,23 @@
|
||||
<TextBlock Text="*" Foreground="Red" VerticalAlignment="Center">
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Margin="5">
|
||||
<TextBlock Text="位置名称: "
|
||||
FontSize="15"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"></TextBlock>
|
||||
<TextBox MinWidth="200"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
FontSize="15"
|
||||
IsEnabled="False"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Stretch"
|
||||
Style="{StaticResource TextBoxExtend}"
|
||||
Text="{Binding LocationName}"></TextBox>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="5">
|
||||
<TextBlock Text="RCS库位编号: " FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
|
||||
<TextBox Name="txtRowCounts" MinWidth="200" Grid.Row="0" Grid.Column="1" FontSize="15"
|
||||
|
@ -148,6 +148,8 @@
|
||||
<DataGridTextColumn IsReadOnly="True" Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="位置区域" MaxWidth="150" Binding="{Binding LocationArea}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="位置编号" Binding="{Binding LocationCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="位置名称" Binding="{Binding LocationName}"></DataGridTextColumn>
|
||||
|
||||
<DataGridTextColumn Header="RCS库位编号" MaxWidth="150" Binding="{Binding RcsStoreCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="可放置货架类型" Binding="{Binding AllowShelfTypesName,Converter={StaticResource listToString}}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="启用状态" Binding="{Binding IsEnableStr}"></DataGridTextColumn>
|
||||
|
@ -177,7 +177,9 @@
|
||||
|
||||
<DataGridTextColumn Header="位置区域" MaxWidth="150" Binding="{Binding LocationArea}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="位置编号" Binding="{Binding LocationCode}"></DataGridTextColumn>
|
||||
|
||||
<!--rcs中用户取的别名-->
|
||||
<DataGridTextColumn Header="位置名称" Binding="{Binding LocationName}"></DataGridTextColumn>
|
||||
|
||||
<DataGridTextColumn Header="物料编码" Binding="{Binding MatCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="物料名称" Binding="{Binding MatName}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="物料批次" Binding="{Binding MatBatch}"></DataGridTextColumn>
|
||||
|
Reference in New Issue
Block a user