* Additional Functions added to services

* Changes in MaterialTransaction mapping
This commit is contained in:
2025-04-02 21:25:13 +02:00
parent 3f0da4ba79
commit 94c4586c35
9 changed files with 86 additions and 58 deletions

View File

@@ -2,40 +2,40 @@ namespace SytelineSaAppEfDataModel.Dtos;
public class MaterialTransactionDto
{
public string MTGroup { get; set; }
public string MTGroupNum { get; set; }
public long TransNum { get; set; }
public string Item { get; set; }
public string? MTGroup { get; set; }
public string? MTGroupNum { get; set; }
public decimal? TransNum { get; set; }
public string? Item { get; set; }
public DateTime? TransDate { get; set; }
public decimal? Qty { get; set; }
public decimal? Cost { get; set; }
public string Whse { get; set; }
public string Loc { get; set; }
public string RefNum { get; set; }
public string? Whse { get; set; }
public string? Loc { get; set; }
public string? RefNum { get; set; }
public short? RefLineSuf { get; set; }
public short? RefRelease { get; set; }
public string ReasonCode { get; set; }
public string TransType { get; set; }
public string RefType { get; set; }
public string MTReasonType { get; set; }
public string PrefixId { get; set; }
public string SequenceId { get; set; }
public string WhseSequenceId { get; set; }
public bool WhseSplit { get; set; }
public string? ReasonCode { get; set; }
public string? TransType { get; set; }
public string? RefType { get; set; }
public string? MTReasonType { get; set; }
public long? PrefixId { get; set; }
public long? SequenceId { get; set; }
public long? WhseSequenceId { get; set; }
public bool? WhseSplit { get; set; }
public Guid? VariableId { get; set; }
public string FormName { get; set; }
public bool InWorkflow { get; set; }
public bool NoteExistsFlag { get; set; }
public DateTime RecordDate { get; set; }
public Guid RowPointer { get; set; }
public string CreatedBy { get; set; }
public string UpdatedBy { get; set; }
public DateTime CreateDate { get; set; }
public string CustNum { get; set; }
public string VendNum { get; set; }
public string? FormName { get; set; }
public bool? InWorkflow { get; set; }
public bool? NoteExistsFlag { get; set; }
public DateTime? RecordDate { get; set; }
public Guid? RowPointer { get; set; }
public string? CreatedBy { get; set; }
public string? UpdatedBy { get; set; }
public DateTime? CreateDate { get; set; }
public string? CustNum { get; set; }
public string? VendNum { get; set; }
public int? RecipNum { get; set; }
public string Uf_FKR_internal_num_matltran_zn { get; set; }
public string? Uf_FKR_internal_num_matltran_zn { get; set; }
public Guid? Session_Id { get; set; }
public string Uf_MobileAppUser { get; set; }
public string NR_KARTY_KONTROLNEJ { get; set; }
public string? Uf_MobileAppUser { get; set; }
public string? NR_KARTY_KONTROLNEJ { get; set; }
}

View File

@@ -2,40 +2,40 @@ namespace SytelineSaAppEfDataModel.Entities;
public class MaterialTransaction
{
public string MTGroup { get; set; }
public string MTGroupNum { get; set; }
public long TransNum { get; set; }
public string Item { get; set; }
public string? MTGroup { get; set; }
public string? MTGroupNum { get; set; }
public decimal? TransNum { get; set; }
public string? Item { get; set; }
public DateTime? TransDate { get; set; }
public decimal? Qty { get; set; }
public decimal? Cost { get; set; }
public string Whse { get; set; }
public string Loc { get; set; }
public string RefNum { get; set; }
public string? Whse { get; set; }
public string? Loc { get; set; }
public string? RefNum { get; set; }
public short? RefLineSuf { get; set; }
public short? RefRelease { get; set; }
public string ReasonCode { get; set; }
public string TransType { get; set; }
public string RefType { get; set; }
public string MTReasonType { get; set; }
public string PrefixId { get; set; }
public string SequenceId { get; set; }
public string WhseSequenceId { get; set; }
public bool WhseSplit { get; set; }
public string? ReasonCode { get; set; }
public string? TransType { get; set; }
public string? RefType { get; set; }
public string? MTReasonType { get; set; }
public long? PrefixId { get; set; }
public long? SequenceId { get; set; }
public long? WhseSequenceId { get; set; }
public bool? WhseSplit { get; set; }
public Guid? VariableId { get; set; }
public string FormName { get; set; }
public bool InWorkflow { get; set; }
public bool NoteExistsFlag { get; set; }
public DateTime RecordDate { get; set; }
public Guid RowPointer { get; set; }
public string CreatedBy { get; set; }
public string UpdatedBy { get; set; }
public DateTime CreateDate { get; set; }
public string CustNum { get; set; }
public string VendNum { get; set; }
public string? FormName { get; set; }
public bool? InWorkflow { get; set; }
public bool? NoteExistsFlag { get; set; }
public DateTime? RecordDate { get; set; }
public Guid? RowPointer { get; set; }
public string? CreatedBy { get; set; }
public string? UpdatedBy { get; set; }
public DateTime? CreateDate { get; set; }
public string? CustNum { get; set; }
public string? VendNum { get; set; }
public int? RecipNum { get; set; }
public string Uf_FKR_internal_num_matltran_zn { get; set; }
public string? Uf_FKR_internal_num_matltran_zn { get; set; }
public Guid? Session_Id { get; set; }
public string Uf_MobileAppUser { get; set; }
public string NR_KARTY_KONTROLNEJ { get; set; }
public string? Uf_MobileAppUser { get; set; }
public string? NR_KARTY_KONTROLNEJ { get; set; }
}

View File

@@ -6,5 +6,6 @@ public interface IMaterialTransactionService
{
Task<IEnumerable<MaterialTransactionDto>> GetAll();
Task<MaterialTransactionDto?> GetByWzNumber(string wzNumber);
Task<IEnumerable<MaterialTransactionDto?>> GetByWzNumbers(ISet<string> wzNumbers);
Task<IEnumerable<MaterialTransactionDto?>> GetByOrderNumber(string orderNumber);
}

View File

@@ -17,6 +17,13 @@ public class MaterialTransactionService(SytelineSaAppDbContext context, IMapper
.Where(x => x.MTGroupNum == wzNumber)
.Select(x => mapper.Map<MaterialTransactionDto>(x)).FirstOrDefaultAsync();
}
public async Task<IEnumerable<MaterialTransactionDto?>> GetByWzNumbers(ISet<string> wzNumbers)
{
return await context.MaterialTransactions
.Where(x => !string.IsNullOrWhiteSpace(x.MTGroupNum) && wzNumbers.Contains(x.MTGroupNum))
.Select(x => mapper.Map<MaterialTransactionDto>(x)).ToListAsync();
}
public async Task<IEnumerable<MaterialTransactionDto?>> GetByOrderNumber(string orderNumber)
{

View File

@@ -714,7 +714,7 @@ namespace SytelineSaAppEfDataModel
entity.Property(e => e.TransNum)
.HasColumnName("trans_num")
.HasColumnType("bigint");
.HasColumnType("decimal");
entity.Property(e => e.Item)
.HasColumnName("item")
@@ -795,7 +795,8 @@ namespace SytelineSaAppEfDataModel
entity.Property(e => e.WhseSplit)
.HasColumnName("WhseSplit")
.HasColumnType("tinyint");
.HasColumnType("tinyint")
.IsRequired(false);;
entity.Property(e => e.VariableId)
.HasColumnName("VariableId")