From 1e684b933fdcde5f313043f28979050bcf7dd6dc Mon Sep 17 00:00:00 2001 From: ljh <1192263352@qq.com> Date: Sat, 6 Jul 2024 22:34:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=91=E8=B4=A7=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E5=8D=95=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin.NET.Application/Entity/Invoice.cs | 8 +- .../Entity/PrintCodeDetail.cs | 8 +- .../Entity/ReportTable.cs | 10 +- .../Service/Invoice/Dto/InvoiceInput.cs | 13 + .../Service/Invoice/InvoiceService.cs | 34 ++ .../Dto/PrintCodeDetailInput.cs | 5 + .../Dto/PrintCodeDetailOutput.cs | 9 +- .../Dto/AddProductCodeInput.cs | 5 + .../ReportDetailTableService.cs | 38 ++- .../ReportTable/Dto/PrintCodeTreeData.cs | 11 + .../ReportTable/Dto/ReportTableInput.cs | 6 + .../ReportTable/Dto/ReportTableOutput.cs | 5 + .../Service/ReportTable/ReportTableService.cs | 3 +- .../invoice/component/editDialog.vue | 166 +++++----- .../inventoryManagement/invoice/index.vue | 82 +++-- .../printDataDetail/component/editDialog.vue | 32 +- .../component/editDialog.vue | 9 +- .../reportDetailTable/index.vue | 3 +- .../reportTable/component/codeDialog.vue | 266 ++++++++++++++++ .../productionCenter/reportTable/index.vue | 297 ++++++++++-------- 20 files changed, 737 insertions(+), 273 deletions(-) create mode 100644 Web/src/views/productionCenter/reportTable/component/codeDialog.vue diff --git a/Admin.NET/Admin.NET.Application/Entity/Invoice.cs b/Admin.NET/Admin.NET.Application/Entity/Invoice.cs index 478fde4..c020b32 100644 --- a/Admin.NET/Admin.NET.Application/Entity/Invoice.cs +++ b/Admin.NET/Admin.NET.Application/Entity/Invoice.cs @@ -105,5 +105,11 @@ public class Invoice : EntityTenant /// [SugarColumn(ColumnName = "WarehouseId", ColumnDescription = "仓库ID")] public long? WarehouseId { get; set; } - + + /// + /// 状态 + /// + [SugarColumn(ColumnName = "State", ColumnDescription = "状态")] + public int? State { get; set; } + } diff --git a/Admin.NET/Admin.NET.Application/Entity/PrintCodeDetail.cs b/Admin.NET/Admin.NET.Application/Entity/PrintCodeDetail.cs index 2c87e72..37a25be 100644 --- a/Admin.NET/Admin.NET.Application/Entity/PrintCodeDetail.cs +++ b/Admin.NET/Admin.NET.Application/Entity/PrintCodeDetail.cs @@ -66,7 +66,13 @@ public class PrintCodeDetail : EntityBase /// [SugarColumn(ColumnName = "ScanCodeTime", ColumnDescription = "扫码时间")] public DateTime? ScanCodeTime { get; set; } - + + /// + /// 扫码时间 + /// + [SugarColumn(ColumnName = "ScanCodeName", ColumnDescription = "扫码人")] + public string? ScanCodeName { get; set; } + /// /// 备注 /// diff --git a/Admin.NET/Admin.NET.Application/Entity/ReportTable.cs b/Admin.NET/Admin.NET.Application/Entity/ReportTable.cs index 330ca35..de0eb1e 100644 --- a/Admin.NET/Admin.NET.Application/Entity/ReportTable.cs +++ b/Admin.NET/Admin.NET.Application/Entity/ReportTable.cs @@ -16,9 +16,15 @@ public class ReportTable : EntityTenant /// /// 业务日期 /// - [SugarColumn(ColumnName = "StartDate", ColumnDescription = "业务日期")] + [SugarColumn(ColumnName = "StartDate", ColumnDescription = "生产开始时间")] public DateTime? StartDate { get; set; } - + + /// + /// 生产结束时间 + /// + [SugarColumn(ColumnName = "EndDate", ColumnDescription = "生产结束时间")] + public DateTime? EndDate { get; set; } + /// /// 状态 /// diff --git a/Admin.NET/Admin.NET.Application/Service/Invoice/Dto/InvoiceInput.cs b/Admin.NET/Admin.NET.Application/Service/Invoice/Dto/InvoiceInput.cs index 2f7a0bd..149466d 100644 --- a/Admin.NET/Admin.NET.Application/Service/Invoice/Dto/InvoiceInput.cs +++ b/Admin.NET/Admin.NET.Application/Service/Invoice/Dto/InvoiceInput.cs @@ -256,6 +256,19 @@ public class UpdateInvoiceInput : InvoiceBaseInput public List TableData { get; set; } } + +/// +/// 发货通知单更新状态输入参数 +/// +public class UpdateInvoiceStateInput : InvoiceBaseInput +{ + /// + /// 单号 + /// + public virtual string? CodeNum { get; set; } + +} + /// /// 发货通知单主键查询输入参数 /// diff --git a/Admin.NET/Admin.NET.Application/Service/Invoice/InvoiceService.cs b/Admin.NET/Admin.NET.Application/Service/Invoice/InvoiceService.cs index 328f3f3..e0a76de 100644 --- a/Admin.NET/Admin.NET.Application/Service/Invoice/InvoiceService.cs +++ b/Admin.NET/Admin.NET.Application/Service/Invoice/InvoiceService.cs @@ -105,6 +105,7 @@ public class InvoiceService : IDynamicApiController, ITransient public async Task Add(AddInvoiceInput input) { var entity = input.Adapt(); + entity.State = 0; await _rep.InsertAsync(entity); var id = entity.Id; if (input.TableData!=null&&input.TableData.Count>0) @@ -159,6 +160,17 @@ public class InvoiceService : IDynamicApiController, ITransient await _materialListService.Add(item); } } + else + { + var list = await _materialListService.ListBySourceId(input.Id); + if (list != null) + { + for (int i = 0; i < list.Count; i++) + { + await _materialListService.Delete(new DeleteMaterialListInput() { Id = list[i].Id }); + } + } + } } /// @@ -328,5 +340,27 @@ public class InvoiceService : IDynamicApiController, ITransient { return await _materialListService.ListBySourceId(id); } + + /// + /// 更新发货通知单状态 + /// + /// + /// + [HttpPost] + [ApiDescriptionSettings(Name = "UpdateState")] + public async Task UpdateState(UpdateInvoiceStateInput input) + { + var entity = await _rep.AsQueryable() + .Where(a => !a.IsDelete) + .Where(t=>t.CodeNum == input.CodeNum) + .FirstAsync(); + if (entity == null) + { + throw Oops.Oh($"数据不存在"); + } + entity.State = 1; + await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); + } + } 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 deef220..2b5e00c 100644 --- a/Admin.NET/Admin.NET.Application/Service/PrintCodeDetail/Dto/PrintCodeDetailInput.cs +++ b/Admin.NET/Admin.NET.Application/Service/PrintCodeDetail/Dto/PrintCodeDetailInput.cs @@ -83,6 +83,11 @@ public class PrintCodeDetailBaseInput /// public virtual DateTime? ScanCodeTime { get; set; } + /// + /// 扫码人 + /// + public virtual string ScanCodeName { 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 6d58d34..e6af0fb 100644 --- a/Admin.NET/Admin.NET.Application/Service/PrintCodeDetail/Dto/PrintCodeDetailOutput.cs +++ b/Admin.NET/Admin.NET.Application/Service/PrintCodeDetail/Dto/PrintCodeDetailOutput.cs @@ -79,12 +79,19 @@ public class PrintCodeDetailOutput /// 打码时间 /// public DateTime? PrintCodeTime { get; set; } + /// /// 扫码时间 /// public DateTime? ScanCodeTime { get; set; } - + + /// + /// 扫码人 + /// + + public string? ScanCodeName { get; set; } + /// /// 备注 /// diff --git a/Admin.NET/Admin.NET.Application/Service/ProductWarehousing/Dto/AddProductCodeInput.cs b/Admin.NET/Admin.NET.Application/Service/ProductWarehousing/Dto/AddProductCodeInput.cs index 9942ba2..b52f95f 100644 --- a/Admin.NET/Admin.NET.Application/Service/ProductWarehousing/Dto/AddProductCodeInput.cs +++ b/Admin.NET/Admin.NET.Application/Service/ProductWarehousing/Dto/AddProductCodeInput.cs @@ -29,5 +29,10 @@ public class AddProductCodeInput /// public List CodeDatas { get; set; } + /// + /// 结束时间 + /// + public DateTime? EndDt { get; set; } + } diff --git a/Admin.NET/Admin.NET.Application/Service/ReportDetailTable/ReportDetailTableService.cs b/Admin.NET/Admin.NET.Application/Service/ReportDetailTable/ReportDetailTableService.cs index 9298cb9..035d01f 100644 --- a/Admin.NET/Admin.NET.Application/Service/ReportDetailTable/ReportDetailTableService.cs +++ b/Admin.NET/Admin.NET.Application/Service/ReportDetailTable/ReportDetailTableService.cs @@ -177,9 +177,12 @@ public class ReportDetailTableService : IDynamicApiController, ITransient if (repeatCode.ReportTableId > 0) { var reportTable = await _reportTableService.Detail(new QueryByIdReportTableInput { Id = repeatCode.ReportTableId ?? 0 }); - if (string.IsNullOrWhiteSpace(reportTable.ProductType) || reportTable.ProductType.Equals("普通生产")) + if (reportTable != null) { - codesToKeep.Add(repeatCode); + if (string.IsNullOrWhiteSpace(reportTable.ProductType) || reportTable.ProductType.Equals("普通生产")) + { + codesToKeep.Add(repeatCode); + } } } else @@ -231,6 +234,7 @@ public class ReportDetailTableService : IDynamicApiController, ITransient CreateUserId = userId, CreateUserName = userName, StartDate = DateTime.Now, + EndDate = input.EndDt, SourceNumber = warehousing.SourceNumber, Unit = warehousing.Unit, Remarks = warehousing.Remarks @@ -249,15 +253,15 @@ public class ReportDetailTableService : IDynamicApiController, ITransient var code = CodeHelper.GetCode(item.BarCode, item.QrCode); var codeType = string.IsNullOrEmpty(item.BarCode) ? "二维码" : "条码"; var unit = units.Find(a => a.Name == item.PackageName); - var reportTable = await _reportTableService.Detail(new QueryByIdReportTableInput { Id = reprotId }); - if (reportTable.ProductType.Equals("返工生产")) + var upPrintCodeDetails = await _codeDetailService.GetByProductCodes(code); + foreach (var upPrintCodeDetail in upPrintCodeDetails.Where(t=>t.ReportTableId== reprotId)) { - var upPrintCodeDetails = await _codeDetailService.GetByProductCodes(code); - foreach (var upPrintCodeDetail in upPrintCodeDetails) + var reportTable = await _reportTableService.Detail(new QueryByIdReportTableInput { Id = upPrintCodeDetail.ReportTableId??0 }); + if (reportTable.ProductType.Equals("返工生产")) { if (!upPrintCodeDetail.Code.Contains("#")) { - upPrintCodeDetail.Code = new string('#', (upPrintCodeDetails.Where(t=>t.Code.Contains("#")).Count())+1)+upPrintCodeDetail.Code; + upPrintCodeDetail.Code = new string('#', (upPrintCodeDetails.Where(t => t.Code.Contains("#")).Count()) + 1) + upPrintCodeDetail.Code; await _codeDetailService.UpdateByEntity(upPrintCodeDetail); } } @@ -274,7 +278,9 @@ public class ReportDetailTableService : IDynamicApiController, ITransient BaseUnit = baseUnit, PrintCodeTime = DateTime.Now, CreateUserId = userId, - CreateUserName = userName + CreateUserName = userName, + ScanCodeTime = DateTime.Now, + ScanCodeName = userName }; var detailId = await _codeDetailService.Add(detail); list.Add(detail, detailId); @@ -298,7 +304,9 @@ public class ReportDetailTableService : IDynamicApiController, ITransient CreateUserId = userId, CreateUserName = userName, FatherCode = code, - FatherId = detailId + FatherId = detailId, + ScanCodeTime = DateTime.Now, + ScanCodeName = userName }; var detailId2 = await _codeDetailService.Add(detail2); list.Add(detail2, detailId2); @@ -322,7 +330,9 @@ public class ReportDetailTableService : IDynamicApiController, ITransient CreateUserId = userId, CreateUserName = userName, FatherCode = code2, - FatherId = detailId2 + FatherId = detailId2, + ScanCodeTime = DateTime.Now, + ScanCodeName = userName }; var detailId3 = await _codeDetailService.Add(detail3); list.Add(detail3, detailId3); @@ -347,7 +357,9 @@ public class ReportDetailTableService : IDynamicApiController, ITransient CreateUserId = userId, CreateUserName = userName, FatherCode = code3, - FatherId = detailId3 + FatherId = detailId3, + ScanCodeTime = DateTime.Now, + ScanCodeName = userName }; var detailId4 = await _codeDetailService.Add(detail4); list.Add(detail4, detailId4); @@ -372,7 +384,9 @@ public class ReportDetailTableService : IDynamicApiController, ITransient CreateUserId = userId, CreateUserName = userName, FatherCode = code4, - FatherId = detailId4 + FatherId = detailId4, + ScanCodeTime = DateTime.Now, + ScanCodeName = userName }; var detailId5 = await _codeDetailService.Add(detail5); list.Add(detail5, detailId5); 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 a3c56a3..8cd4ee0 100644 --- a/Admin.NET/Admin.NET.Application/Service/ReportTable/Dto/PrintCodeTreeData.cs +++ b/Admin.NET/Admin.NET.Application/Service/ReportTable/Dto/PrintCodeTreeData.cs @@ -49,6 +49,17 @@ public class PrintCodeTreeData /// public string? Remarks { get; set; } + /// + /// 扫码时间 + /// + public DateTime? ScanCodeTime { get; set; } + + /// + /// 扫码人 + /// + + public string? ScanCodeName { get; set; } + public List Children { get; set; } public bool HasChildren { get; set; } = true; } diff --git a/Admin.NET/Admin.NET.Application/Service/ReportTable/Dto/ReportTableInput.cs b/Admin.NET/Admin.NET.Application/Service/ReportTable/Dto/ReportTableInput.cs index 865f9e3..ecb5579 100644 --- a/Admin.NET/Admin.NET.Application/Service/ReportTable/Dto/ReportTableInput.cs +++ b/Admin.NET/Admin.NET.Application/Service/ReportTable/Dto/ReportTableInput.cs @@ -18,6 +18,12 @@ public class ReportTableBaseInput /// public virtual DateTime? StartDate { get; set; } + /// + /// 生产结束日期 + /// + public virtual DateTime? EndDate { 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 08d2194..98883b6 100644 --- a/Admin.NET/Admin.NET.Application/Service/ReportTable/Dto/ReportTableOutput.cs +++ b/Admin.NET/Admin.NET.Application/Service/ReportTable/Dto/ReportTableOutput.cs @@ -20,6 +20,11 @@ public class ReportTableOutput /// public DateTime? StartDate { get; set; } + /// + /// 结束时间 + /// + public DateTime? EndDate { get; set; } + /// /// 状态 /// diff --git a/Admin.NET/Admin.NET.Application/Service/ReportTable/ReportTableService.cs b/Admin.NET/Admin.NET.Application/Service/ReportTable/ReportTableService.cs index c399b40..0eec95f 100644 --- a/Admin.NET/Admin.NET.Application/Service/ReportTable/ReportTableService.cs +++ b/Admin.NET/Admin.NET.Application/Service/ReportTable/ReportTableService.cs @@ -76,6 +76,7 @@ public class ReportTableService : IDynamicApiController, ITransient Id = u.Id, OddNumber = u.OddNumber, StartDate = u.StartDate, + EndDate = u.EndDate, State = u.State, ProductType = u.ProductType, ProductionLine = u.ProductionLine, @@ -321,7 +322,7 @@ public class ReportTableService : IDynamicApiController, ITransient PrintCodeTime = DateTime.Now, CreateUserId = userId, MaterialsId = input.MaterialsId, - CreateUserName = userName + CreateUserName = userName, }; var detailId = await _codeDetailService.Add(detail); var treeData1 = detail.Adapt(); diff --git a/Web/src/views/inventoryManagement/invoice/component/editDialog.vue b/Web/src/views/inventoryManagement/invoice/component/editDialog.vue index a94811a..56c85d9 100644 --- a/Web/src/views/inventoryManagement/invoice/component/editDialog.vue +++ b/Web/src/views/inventoryManagement/invoice/component/editDialog.vue @@ -1,28 +1,22 @@  + + + + + diff --git a/Web/src/views/productionCenter/reportTable/index.vue b/Web/src/views/productionCenter/reportTable/index.vue index d82f896..9eca8da 100644 --- a/Web/src/views/productionCenter/reportTable/index.vue +++ b/Web/src/views/productionCenter/reportTable/index.vue @@ -1,5 +1,5 @@