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"); var connectionString = configuration.GetConnectionString("DefaultConnection");
services.AddSingleton<ISqlSugarClient>(s => services.AddSingleton<ISqlSugarClient>(s =>
{ {
#if RELEASE //#if RELEASE
SqlSugarScope sqlSugar = new SqlSugarScope(new ConnectionConfig() SqlSugarScope sqlSugar = new SqlSugarScope(new ConnectionConfig()
{ {
DbType = DbType.SqlServer, DbType = DbType.SqlServer,
@ -24,16 +24,16 @@ public static class ServiceExtensions
IsAutoCloseConnection = true, IsAutoCloseConnection = true,
} }
); );
#elif DEBUG //#elif DEBUG
SqlSugarScope sqlSugar = new SqlSugarScope(new ConnectionConfig() //SqlSugarScope sqlSugar = new SqlSugarScope(new ConnectionConfig()
{ // {
DbType = DbType.Sqlite, // DbType = DbType.Sqlite,
ConnectionString = "Data Source=hyosung.db", // ConnectionString = "Data Source=hyosung.db",
IsAutoCloseConnection = true, // IsAutoCloseConnection = true,
InitKeyType = InitKeyType.Attribute // InitKeyType = InitKeyType.Attribute
} // }
); //);
#endif //#endif
return sqlSugar; return sqlSugar;
}); });
services.AddScoped(typeof(IRepository<>), typeof(Repository<>)); 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) 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 checkCode = $"02025{grade}{variety.Lot.ToString().Substring(1, 3)}";
var x = await _db.Queryable<MST_BOXNO_SEQ_NON_DATE>().Where(x => var x = await _db.Queryable<MST_BOXNO_SEQ_NON_DATE>().Where(x =>
x.BeId == "2240" && x.ItemCode == variety.Code && x.CheckCode == checkCode).FirstAsync(); 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" <TextBox Grid.Column="1" Margin="10" Grid.Row="3" IsEnabled="False"
Foreground="White" Foreground="White"
Text="{Binding ViewModel.SelectedVariety.TotalCount}" /> 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" <Button x:Name="ChangeVarietyButton"
materialDesign:ButtonProgressAssist.IsIndeterminate="True" materialDesign:ButtonProgressAssist.IsIndeterminate="True"
Click="ChangeVarietyButton_OnClick" Click="ChangeVarietyButton_OnClick"

View File

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