diff --git a/Admin.NET/Admin.NET.Application/Entity/PrintCodeDetail.cs b/Admin.NET/Admin.NET.Application/Entity/PrintCodeDetail.cs index 37a25be..de90bbc 100644 --- a/Admin.NET/Admin.NET.Application/Entity/PrintCodeDetail.cs +++ b/Admin.NET/Admin.NET.Application/Entity/PrintCodeDetail.cs @@ -41,7 +41,7 @@ public class PrintCodeDetail : EntityBase /// 基本数量 /// [SugarColumn(ColumnName = "BaseCount", ColumnDescription = "基本数量")] - public int? BaseCount { get; set; } + public decimal? BaseCount { get; set; } /// /// 基本单位 diff --git a/Admin.NET/Admin.NET.Application/Service/DistributorInvoice/DistributorInvoiceService.cs b/Admin.NET/Admin.NET.Application/Service/DistributorInvoice/DistributorInvoiceService.cs index 9faab6c..57e1fc3 100644 --- a/Admin.NET/Admin.NET.Application/Service/DistributorInvoice/DistributorInvoiceService.cs +++ b/Admin.NET/Admin.NET.Application/Service/DistributorInvoice/DistributorInvoiceService.cs @@ -232,7 +232,7 @@ public class DistributorInvoiceService : IDynamicApiController, ITransient var report = await GetReport(item.ReportTableId); var retrospect1 = new AddProductRetrospectInput() { - BaseCount = item.BaseCount, + BaseCount = (int?)item.BaseCount, BaseUnit = item.BaseUnit, //Batch = report.Batch, BusinessType = report.ProductType, diff --git a/Admin.NET/Admin.NET.Application/Service/PrintCodeDetail/Dto/PrintCodeDetailInput.cs b/Admin.NET/Admin.NET.Application/Service/PrintCodeDetail/Dto/PrintCodeDetailInput.cs index 2b5e00c..27cd4e8 100644 --- a/Admin.NET/Admin.NET.Application/Service/PrintCodeDetail/Dto/PrintCodeDetailInput.cs +++ b/Admin.NET/Admin.NET.Application/Service/PrintCodeDetail/Dto/PrintCodeDetailInput.cs @@ -36,7 +36,7 @@ public class PrintCodeDetailBaseInput /// /// 基本数量 /// - public virtual int? BaseCount { get; set; } + public virtual decimal? BaseCount { get; set; } /// /// 基本单位 @@ -168,7 +168,7 @@ public class PrintCodeDetailInput : BasePageInput /// /// 基本数量 /// - public int? BaseCount { get; set; } + public decimal? BaseCount { get; set; } /// /// 基本单位 diff --git a/Admin.NET/Admin.NET.Application/Service/PrintCodeDetail/Dto/PrintCodeDetailOutput.cs b/Admin.NET/Admin.NET.Application/Service/PrintCodeDetail/Dto/PrintCodeDetailOutput.cs index e6af0fb..5f80f0f 100644 --- a/Admin.NET/Admin.NET.Application/Service/PrintCodeDetail/Dto/PrintCodeDetailOutput.cs +++ b/Admin.NET/Admin.NET.Application/Service/PrintCodeDetail/Dto/PrintCodeDetailOutput.cs @@ -38,7 +38,7 @@ public class PrintCodeDetailOutput /// /// 基本数量 /// - public int? BaseCount { get; set; } + public decimal? BaseCount { get; set; } /// /// 基本单位 diff --git a/Admin.NET/Admin.NET.Application/Service/PrintCodeDetail/PrintCodeDetailService.cs b/Admin.NET/Admin.NET.Application/Service/PrintCodeDetail/PrintCodeDetailService.cs index 6ca0c7f..a387e26 100644 --- a/Admin.NET/Admin.NET.Application/Service/PrintCodeDetail/PrintCodeDetailService.cs +++ b/Admin.NET/Admin.NET.Application/Service/PrintCodeDetail/PrintCodeDetailService.cs @@ -175,5 +175,12 @@ public class PrintCodeDetailService : IDynamicApiController, ITransient { return await _rep.AsQueryable().Where(a => !a.IsDelete && a.Code.Contains(productCode)).ToListAsync(); } + + [HttpGet] + [ApiDescriptionSettings(Name = "GetByReportTableId")] + public async Task> GetByReportTableId(long? reportTableId) + { + return await _rep.AsQueryable().Where(a => !a.IsDelete && a.ReportTableId == reportTableId).ToListAsync(); + } } diff --git a/Admin.NET/Admin.NET.Application/Service/ProductRetrospect/ProductRetrospectService.cs b/Admin.NET/Admin.NET.Application/Service/ProductRetrospect/ProductRetrospectService.cs index 6835ec8..e94dce9 100644 --- a/Admin.NET/Admin.NET.Application/Service/ProductRetrospect/ProductRetrospectService.cs +++ b/Admin.NET/Admin.NET.Application/Service/ProductRetrospect/ProductRetrospectService.cs @@ -206,7 +206,7 @@ public class ProductRetrospectService : IDynamicApiController, ITransient var userName = _userManager.RealName; var retrospect1 = new AddProductRetrospectInput() { - BaseCount = item.BaseCount, + BaseCount = (int?)item.BaseCount, BaseUnit = item.BaseUnit, Batch = report.Batch, BusinessType = report.ProductType, diff --git a/Admin.NET/Admin.NET.Application/Service/ReportDetailTable/ReportDetailTableService.cs b/Admin.NET/Admin.NET.Application/Service/ReportDetailTable/ReportDetailTableService.cs index c21f96e..251fb0b 100644 --- a/Admin.NET/Admin.NET.Application/Service/ReportDetailTable/ReportDetailTableService.cs +++ b/Admin.NET/Admin.NET.Application/Service/ReportDetailTable/ReportDetailTableService.cs @@ -518,7 +518,17 @@ public class ReportDetailTableService : IDynamicApiController, ITransient [ApiDescriptionSettings(Name = "List")] public async Task> List() { - return await _rep.AsQueryable().Where(a => !a.IsDelete && a.State==1).Select().ToListAsync(); + var list = await _rep.AsQueryable().Where(a => !a.IsDelete && a.State == 1).ToListAsync(); + foreach (var item in list) + { + var reportTable = await _reportTableService.GetBySource(item.Id); + if (reportTable != null && reportTable.BaseProductCount>item.ProductCount) + { + item.State = 2; + await _rep.AsUpdateable(item).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); + } + } + return await _rep.AsQueryable().Where(a => !a.IsDelete && a.State == 1).Select().ToListAsync(); } /// diff --git a/Admin.NET/Admin.NET.Application/Service/ReportTable/Dto/PrintCodeTreeData.cs b/Admin.NET/Admin.NET.Application/Service/ReportTable/Dto/PrintCodeTreeData.cs index 8cd4ee0..ceb0ef7 100644 --- a/Admin.NET/Admin.NET.Application/Service/ReportTable/Dto/PrintCodeTreeData.cs +++ b/Admin.NET/Admin.NET.Application/Service/ReportTable/Dto/PrintCodeTreeData.cs @@ -33,7 +33,7 @@ public class PrintCodeTreeData /// /// 基本数量 /// - public int? BaseCount { get; set; } + public decimal? BaseCount { get; set; } /// /// 基本单位 diff --git a/Admin.NET/Admin.NET.Application/Service/ReportTable/Dto/ReportTableOutput.cs b/Admin.NET/Admin.NET.Application/Service/ReportTable/Dto/ReportTableOutput.cs index 98883b6..d953a31 100644 --- a/Admin.NET/Admin.NET.Application/Service/ReportTable/Dto/ReportTableOutput.cs +++ b/Admin.NET/Admin.NET.Application/Service/ReportTable/Dto/ReportTableOutput.cs @@ -68,7 +68,7 @@ public class ReportTableOutput /// /// 基本完工数量 /// - public int? BaseProductCount { get; set; } + public decimal? BaseProductCount { get; set; } /// /// 单位 diff --git a/Web/src/views/productionCenter/reportDetailTable/index.vue b/Web/src/views/productionCenter/reportDetailTable/index.vue index 2fa2675..7c3e91a 100644 --- a/Web/src/views/productionCenter/reportDetailTable/index.vue +++ b/Web/src/views/productionCenter/reportDetailTable/index.vue @@ -109,7 +109,7 @@