This commit is contained in:
zhangzhuo 2025-03-17 02:52:27 +08:00
parent d1631df129
commit 8e881058f7
4 changed files with 18 additions and 13 deletions

View File

@ -16,7 +16,7 @@ public static class ServiceExtensions
var connectionString = configuration.GetConnectionString("DefaultConnection");
services.AddSingleton<ISqlSugarClient>(s =>
{
#if RELEASE
//#if RELEASE
SqlSugarScope sqlSugar = new SqlSugarScope(new ConnectionConfig()
{
DbType = DbType.SqlServer,
@ -24,16 +24,16 @@ public static class ServiceExtensions
IsAutoCloseConnection = true,
}
);
#elif DEBUG
SqlSugarScope sqlSugar = new SqlSugarScope(new ConnectionConfig()
{
DbType = DbType.Sqlite,
ConnectionString = "Data Source=hyosung.db",
IsAutoCloseConnection = true,
InitKeyType = InitKeyType.Attribute
}
);
#endif
//#elif DEBUG
//SqlSugarScope sqlSugar = new SqlSugarScope(new ConnectionConfig()
// {
// DbType = DbType.Sqlite,
// ConnectionString = "Data Source=hyosung.db",
// IsAutoCloseConnection = true,
// InitKeyType = InitKeyType.Attribute
// }
//);
//#endif
return sqlSugar;
});
services.AddScoped(typeof(IRepository<>), typeof(Repository<>));

View File

@ -16,6 +16,8 @@ public class HyosungWmsService : IHyosungWmsService
public async Task<int> GetControlNo(Variety variety, string grade)
{
if (grade == "AA")
grade = "1";
var checkCode = $"02025{grade}{variety.Lot.ToString().Substring(1, 3)}";
var x = await _db.Queryable<MST_BOXNO_SEQ_NON_DATE>().Where(x =>
x.BeId == "2240" && x.ItemCode == variety.Code && x.CheckCode == checkCode).FirstAsync();

View File

@ -182,7 +182,7 @@
<TextBox Grid.Column="1" Margin="10" Grid.Row="3" IsEnabled="False"
Foreground="White"
Text="{Binding ViewModel.SelectedVariety.TotalCount}" />
<TextBlock Grid.Row="4" Foreground="White" Grid.Column="0" Text="{Binding ViewModel.SelectedVariety.ControlNo,StringFormat='控制号: {0}'}" VerticalAlignment="Center" Margin="10"/>
<TextBlock x:Name="ControlNoTextBlock" Grid.Row="4" Foreground="White" Grid.Column="0" Text="控制号: " VerticalAlignment="Center" Margin="10"/>
<Button x:Name="ChangeVarietyButton"
materialDesign:ButtonProgressAssist.IsIndeterminate="True"
Click="ChangeVarietyButton_OnClick"

View File

@ -68,7 +68,10 @@ namespace Seyounth.Hyosung.Views.Pages
var variety = selectedItem as Variety;
var info = await _wmsService.GetItemInfoByItemCode(variety.Code);
var controlNo = await _wmsService.GetControlNo(variety, info.GRADE);
variety.ControlNo = controlNo;
await Dispatcher.InvokeAsync(() =>
{
ControlNoTextBlock.Text = $"控制号: {controlNo}";
});
}
}
}