diff --git a/Admin.NET/Admin.NET.Application/Entity/ReportTable.cs b/Admin.NET/Admin.NET.Application/Entity/ReportTable.cs index 56ac082..298b59d 100644 --- a/Admin.NET/Admin.NET.Application/Entity/ReportTable.cs +++ b/Admin.NET/Admin.NET.Application/Entity/ReportTable.cs @@ -4,7 +4,7 @@ namespace Admin.NET.Application.Entity; /// /// 汇报单 /// -[SugarTable("ReportTable","汇报单")] +[SugarTable("reporttable","汇报单")] public class ReportTable : EntityTenant { /// @@ -48,17 +48,23 @@ public class ReportTable : EntityTenant /// [SugarColumn(ColumnName = "SourceNumber", ColumnDescription = "源单号", Length = 32)] public string? SourceNumber { get; set; } - - /// - /// 物料ID - /// - [SugarColumn(ColumnName = "MaterialsId", ColumnDescription = "物料ID")] - public long? MaterialsId { get; set; } - + /// /// 备注 /// [SugarColumn(ColumnName = "Remarks", ColumnDescription = "备注", Length = 64)] public string? Remarks { get; set; } + /// + /// 物料ID + /// + [SugarColumn(ColumnName = "MaterialsId", ColumnDescription = "物料ID")] + public long? MaterialsId { get; set; } + + /// + /// 源单ID + /// + [SugarColumn(ColumnName = "SourceId", ColumnDescription = "源单ID")] + public long? SourceId { 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 35ee75d..0a590bd 100644 --- a/Admin.NET/Admin.NET.Application/Service/Invoice/InvoiceService.cs +++ b/Admin.NET/Admin.NET.Application/Service/Invoice/InvoiceService.cs @@ -10,9 +10,27 @@ namespace Admin.NET.Application; public class InvoiceService : IDynamicApiController, ITransient { private readonly SqlSugarRepository _rep; - public InvoiceService(SqlSugarRepository rep) + private readonly MaterialsService _materialsService; + private readonly SysUnitService _sysUnitService; + private readonly PrintCodeDetailService _codeDetailService; + private readonly ProductRetrospectService _productRetrospect; + private readonly ReportTableService _reportTableService; + private readonly UserManager _userManager; + public InvoiceService(SqlSugarRepository rep, + UserManager userManager, + MaterialsService materialsService, + SysUnitService sysUnitService, + PrintCodeDetailService codeDetailService, + ReportTableService reportTableService, + ProductRetrospectService productRetrospect) { _rep = rep; + _userManager = userManager; + _materialsService = materialsService; + _sysUnitService = sysUnitService; + _codeDetailService = codeDetailService; + _productRetrospect = productRetrospect; + _reportTableService = reportTableService; } /// @@ -136,6 +154,74 @@ public class InvoiceService : IDynamicApiController, ITransient } + /// + /// 商品出货 + /// + /// + /// + [HttpPost] + [ApiDescriptionSettings(Name = "ShipmentProduct")] + public async Task ShipmentProduct(AddProductCodeInput input) + { + if (input == null || input.WarehousingTableId == null || input.CodeDatas == null || input.CodeDatas.Count == 0) + { + throw Oops.Oh(ErrorCodeEnum.xg1002); + } + + var repeatCodes = await _codeDetailService.GetRepeat(input.CodeDatas); + + var invoice = await Detail(new QueryByIdInvoiceInput() { Id = input.WarehousingTableId.Value }); + if (invoice == null) + { + throw Oops.Oh(ErrorCodeEnum.xg1002); + } + + + + //var units = await _sysUnitService.ListByGroupId(materials.UnitGroupId); + //var baseUnit = units.FirstOrDefault().Name; + //var userId = _userManager.UserId; + //var userName = _userManager.RealName; + //var topDatas = input.CodeDatas.FindAll(a => string.IsNullOrEmpty(a.FatherCode)); + + //foreach (var dic in list) + //{ + // var item = dic.Key; + // var retrospect1 = new AddProductRetrospectInput() + // { + // BaseCount = item.BaseCount, + // BaseUnit = baseUnit, + // Batch = warehousing.Batch, + // BusinessType = "生产任务单", + // CodeType = item.CodeName, + // Department = warehousing.ProductionLine, + // //WarehouseID = input.WarehouseId, + // WarehousingDate = DateTime.Now, + // Count = 1, + // CreateTime = DateTime.Now, + // ScanCodeTime = DateTime.Now, + // CreateUserId = userId, + // CreateUserName = userName, + // MaterialsId = dic.Value, + // OddNumber = warehousing.OddNumber, + // Receipt = "汇报单", + // SourceId = warehousing.Id, + // Unit = item.Unit, + // Name = materials.Name, + // Code = item.Code + // };//Destination = warehousing.Supplier, + // await _productRetrospect.Add(retrospect1); + //} + + //var report = await _reportTableService.GetBySource(input.WarehousingTableId); + //if (report == null) + //{ + // var newReport = new AddReportTableInput() { CreateTime = DateTime.Now, IsDelete = false, OddNumber = warehousing.OddNumber, State = 0, MaterialsId = warehousing.MaterialsId, SourceId = input.WarehousingTableId, ProductType = warehousing.ProductType, ProductionLine = warehousing.ProductionLine }; + // var addReport = await _reportTableService.Add(newReport); + //} + + } + diff --git a/Admin.NET/Admin.NET.Application/Service/PrintCodeDetail/PrintCodeDetailService.cs b/Admin.NET/Admin.NET.Application/Service/PrintCodeDetail/PrintCodeDetailService.cs index 6f7c4ec..32e2f8d 100644 --- a/Admin.NET/Admin.NET.Application/Service/PrintCodeDetail/PrintCodeDetailService.cs +++ b/Admin.NET/Admin.NET.Application/Service/PrintCodeDetail/PrintCodeDetailService.cs @@ -135,6 +135,23 @@ public class PrintCodeDetailService : IDynamicApiController, ITransient return await _rep.AsQueryable().Where(a => !a.IsDelete).Select().ToListAsync(); } + + /// + /// 获取打印条码详情列表 + /// + /// + [HttpPost] + [ApiDescriptionSettings(Name = "GetRepeat")] + public async Task> GetRepeat(List printDatas) + { + if (printDatas.Count<1) + { + return new List(); + } + var codes = string.IsNullOrEmpty(printDatas[0].BarCode) ? printDatas.ConvertAll(a => a.QrCode) : printDatas.ConvertAll(a => a.BarCode); + return await _rep.AsQueryable().Where(a => !a.IsDelete && codes.Any(b => b == a.Code)).Select().ToListAsync(); + } + /// /// 获取打印条码详情 /// diff --git a/Admin.NET/Admin.NET.Application/Service/ReportDetailTable/ReportDetailTableService.cs b/Admin.NET/Admin.NET.Application/Service/ReportDetailTable/ReportDetailTableService.cs index 540f2a2..b21c92b 100644 --- a/Admin.NET/Admin.NET.Application/Service/ReportDetailTable/ReportDetailTableService.cs +++ b/Admin.NET/Admin.NET.Application/Service/ReportDetailTable/ReportDetailTableService.cs @@ -11,19 +11,21 @@ public class ReportDetailTableService : IDynamicApiController, ITransient { private readonly SqlSugarRepository _rep; //private readonly WarehouseDetailsService _warehouseDetails; - private readonly MaterialsService _materialsService; - private readonly SysUnitService _sysUnitService; //private readonly MaterialClassifyService _materialClassifyService; //private readonly WarehousingStatisticsService _warehousingStatisticsService; + private readonly MaterialsService _materialsService; + private readonly SysUnitService _sysUnitService; private readonly PrintCodeDetailService _codeDetailService; private readonly ProductRetrospectService _productRetrospect; - //private readonly ProductWarehousingService _productWarehousing; + private readonly ReportTableService _reportTableService; private readonly UserManager _userManager; + //private readonly ProductWarehousingService _productWarehousing; public ReportDetailTableService(SqlSugarRepository rep, UserManager userManager, MaterialsService materialsService, SysUnitService sysUnitService, PrintCodeDetailService codeDetailService, + ReportTableService reportTableService, ProductRetrospectService productRetrospect) { _rep = rep; @@ -32,6 +34,7 @@ public class ReportDetailTableService : IDynamicApiController, ITransient _sysUnitService = sysUnitService; _codeDetailService = codeDetailService; _productRetrospect = productRetrospect; + _reportTableService = reportTableService; //_warehouseDetails = warehouseDetails; //_materialClassifyService = materialClassifyService; //_warehousingStatisticsService = warehousingStatisticsService; @@ -162,6 +165,14 @@ public class ReportDetailTableService : IDynamicApiController, ITransient { throw Oops.Oh(ErrorCodeEnum.xg1002); } + + var repeatCodes = await _codeDetailService.GetRepeat(input.CodeDatas); + if (repeatCodes!=null&&repeatCodes.Count>0) + { + var repeats = repeatCodes.ConvertAll(a => a.Code).Distinct(); + throw Oops.Oh($"条码重复:{string.Join("、", repeats)}"); + } + var warehousing = await Detail(new QueryByIdReportDetailTableInput() { Id = input.WarehousingTableId.Value }); if (warehousing == null) { @@ -173,7 +184,7 @@ public class ReportDetailTableService : IDynamicApiController, ITransient throw Oops.Oh(ErrorCodeEnum.xg1002); } var units = await _sysUnitService.ListByGroupId(materials.UnitGroupId); - var baseUnit = units.LastOrDefault().Name; + var baseUnit = units.FirstOrDefault().Name; var userId = _userManager.UserId; var userName = _userManager.RealName; var topDatas = input.CodeDatas.FindAll(a => string.IsNullOrEmpty(a.FatherCode)); @@ -226,7 +237,7 @@ public class ReportDetailTableService : IDynamicApiController, ITransient list.Add(detail2, detailId2); var childs3 = input.CodeDatas.FindAll(a => a.FatherCode == code2); - foreach (var child3 in childs) + foreach (var child3 in childs3) { var code3 = string.IsNullOrEmpty(child3.BarCode) ? child3.QrCode : child3.BarCode; var unit3 = units.Find(a => a.Name == child3.PackageName); @@ -251,7 +262,7 @@ public class ReportDetailTableService : IDynamicApiController, ITransient if (input.CodeDatas.Any(a => a.FatherCode == code3)) { var childs4 = input.CodeDatas.FindAll(a => a.FatherCode == code3); - foreach (var child4 in childs) + foreach (var child4 in childs4) { var code4 = string.IsNullOrEmpty(child4.BarCode) ? child4.QrCode : child4.BarCode; var unit4 = units.Find(a => a.Name == child4.PackageName); @@ -276,7 +287,7 @@ public class ReportDetailTableService : IDynamicApiController, ITransient if (input.CodeDatas.Any(a => a.FatherCode == code4)) { var childs5 = input.CodeDatas.FindAll(a => a.FatherCode == code4); - foreach (var child5 in childs) + foreach (var child5 in childs5) { var code5 = string.IsNullOrEmpty(child5.BarCode) ? child5.QrCode : child5.BarCode; var unit5 = units.Find(a => a.Name == child5.PackageName); @@ -335,7 +346,13 @@ public class ReportDetailTableService : IDynamicApiController, ITransient await _productRetrospect.Add(retrospect1); } - + var report = await _reportTableService.GetBySource(input.WarehousingTableId); + if (report == null) + { + var newReport = new AddReportTableInput() { CreateTime = DateTime.Now, IsDelete = false, OddNumber = warehousing.OddNumber, State = 0, MaterialsId = warehousing.MaterialsId, SourceId = input.WarehousingTableId, ProductType = warehousing.ProductType, ProductionLine = warehousing.ProductionLine }; + var addReport = await _reportTableService.Add(newReport); + } + //var details = await _warehouseDetails.List(); //if (details != null && details.Any(a => a.MaterialsId == warehousing.MaterialsId && a.Unit == warehousing.Unit)) @@ -363,7 +380,6 @@ public class ReportDetailTableService : IDynamicApiController, ITransient } - /// /// 删除汇报单详情 /// diff --git a/Admin.NET/Admin.NET.Application/Service/ReportTable/Dto/ReportTableDto.cs b/Admin.NET/Admin.NET.Application/Service/ReportTable/Dto/ReportTableDto.cs index c011aab..e81e18d 100644 --- a/Admin.NET/Admin.NET.Application/Service/ReportTable/Dto/ReportTableDto.cs +++ b/Admin.NET/Admin.NET.Application/Service/ReportTable/Dto/ReportTableDto.cs @@ -50,6 +50,10 @@ public class ReportTableDto /// public long? MaterialsId { get; set; } + /// + /// 源单ID + /// + public long? SourceId { get; set; } /// /// 备注 /// 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 e62988b..97e07f3 100644 --- a/Admin.NET/Admin.NET.Application/Service/ReportTable/Dto/ReportTableInput.cs +++ b/Admin.NET/Admin.NET.Application/Service/ReportTable/Dto/ReportTableInput.cs @@ -43,6 +43,10 @@ public class ReportTableBaseInput /// public virtual string? SourceNumber { get; set; } + /// + /// 源单ID + /// + public long? SourceId { get; set; } /// /// 物料ID @@ -151,6 +155,10 @@ public class ReportTableInput : BasePageInput /// public long? MaterialsId { get; set; } + /// + /// 源单ID + /// + public long? SourceId { get; set; } /// /// 备注 /// @@ -196,5 +204,5 @@ public class UpdateReportTableInput : ReportTableBaseInput /// public class QueryByIdReportTableInput : DeleteReportTableInput { - + public string? Code { 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 983886e..982b313 100644 --- a/Admin.NET/Admin.NET.Application/Service/ReportTable/Dto/ReportTableOutput.cs +++ b/Admin.NET/Admin.NET.Application/Service/ReportTable/Dto/ReportTableOutput.cs @@ -45,6 +45,10 @@ public class ReportTableOutput /// public string? SourceNumber { get; set; } + /// + /// 源单ID + /// + public long? SourceId { get; set; } /// /// 物料ID diff --git a/Admin.NET/Admin.NET.Application/Service/ReportTable/ReportTableService.cs b/Admin.NET/Admin.NET.Application/Service/ReportTable/ReportTableService.cs index 2234038..3a053f1 100644 --- a/Admin.NET/Admin.NET.Application/Service/ReportTable/ReportTableService.cs +++ b/Admin.NET/Admin.NET.Application/Service/ReportTable/ReportTableService.cs @@ -17,7 +17,7 @@ public class ReportTableService : IDynamicApiController, ITransient private readonly SysUnitService _repUnit; private readonly SysUnitGroupService _repUnitGroup; private readonly PrintCodeDetailService _codeDetailService; - private readonly ReportDetailTableService _reportDetailTable; + //private readonly ReportDetailTableService _reportDetailTable; private readonly UserManager _userManager; private readonly PrintDataService _printDataService; @@ -26,14 +26,14 @@ public class ReportTableService : IDynamicApiController, ITransient SysUnitService repUnit, SysUnitGroupService repUnitGroup, PrintCodeDetailService codeDetailService, - ReportDetailTableService reportDetailTable, + //ReportDetailTableService reportDetailTable, PrintDataService printDataService) { _rep = rep; _repUnit = repUnit; _repUnitGroup = repUnitGroup; _codeDetailService = codeDetailService; - _reportDetailTable = reportDetailTable; + //_reportDetailTable = reportDetailTable; _userManager = userManager; _printDataService = printDataService; } @@ -86,25 +86,32 @@ public class ReportTableService : IDynamicApiController, ITransient [ApiDescriptionSettings(Name = "Add")] public async Task Add(AddReportTableInput input) { - //input.UpdateUserId - var details = await _codeDetailService.List(); - if (details == null || details.Count < 1) - { - return 0; - } - var printDetails = details.FindAll(a => a.TempListId == input.UpdateUserId); - if (printDetails.Count < 1) - { - return 0; - } var entity = input.Adapt(); - await _rep.InsertAsync(entity); - for (int i = 0; i < printDetails.Count; i++) + if (input.UpdateUserId > 0) { - var item = printDetails[i]; - item.ReportTableId = entity.Id; - await _codeDetailService.Update(item.Adapt()); + entity.SourceId = input.UpdateUserId; } + await _rep.InsertAsync(entity); + + if (input.UpdateUserId > 0) + { + var details = await _codeDetailService.List(); + if (details == null || details.Count < 1) + { + return 0; + } + var printDetails = details.FindAll(a => a.TempListId == input.UpdateUserId); + if (printDetails.Count > 0) + { + for (int i = 0; i < printDetails.Count; i++) + { + var item = printDetails[i]; + item.ReportTableId = entity.Id; + await _codeDetailService.Update(item.Adapt()); + } + } + } + return entity.Id; } @@ -147,6 +154,37 @@ public class ReportTableService : IDynamicApiController, ITransient return await _rep.GetFirstAsync(u => u.Id == input.Id); } + /// + /// 获取汇报单 + /// + /// + /// + [HttpGet] + [ApiDescriptionSettings(Name = "GetByCode")] + public async Task GetByCode([FromQuery] QueryByIdReportTableInput input) + { + var codeModel = await _codeDetailService.GetByProductCode(input.Code); + if (codeModel == null) + { + throw Oops.Oh(ErrorCodeEnum.D1002); + } + return await _rep.GetFirstAsync(u => u.SourceId == codeModel.ReportTableId); + } + + + + /// + /// 获取汇报单 + /// + /// + /// + [HttpGet] + [ApiDescriptionSettings(Name = "GetBySource")] + public async Task GetBySource(long? sourceId) + { + return await _rep.GetFirstAsync(u => u.SourceId == sourceId); + } + /// /// 获取汇报单列表 /// @@ -304,11 +342,6 @@ public class ReportTableService : IDynamicApiController, ITransient public async Task> GetPrintDetail(long? id) { var result = new List(); - //var report = await Detail(new QueryByIdReportTableInput() { Id = id }); - //if (report==null) - //{ - // return result; - //} var details = await _codeDetailService.List(); if (details == null || details.Count < 1) { diff --git a/Web/.env.development b/Web/.env.development index 78ced16..d854af8 100644 --- a/Web/.env.development +++ b/Web/.env.development @@ -2,4 +2,4 @@ ENV = development # 本地环境接口地址http://localhost:5005 http://139.199.191.197:9005 -VITE_API_URL = http://localhost:5005 \ No newline at end of file +VITE_API_URL = http://139.199.191.197:9005 \ No newline at end of file diff --git a/Web/src/api/main/reportTable.ts b/Web/src/api/main/reportTable.ts index 795cc85..efad568 100644 --- a/Web/src/api/main/reportTable.ts +++ b/Web/src/api/main/reportTable.ts @@ -7,6 +7,7 @@ enum Api { DetailReportTable = '/api/reportTable/detail', AddPrintDetail = '/api/reportTable/addPrintDetail', GetPrintDetail = '/api/reportTable/getPrintDetail', + GetByCode = '/api/reportTable/getByCode', } // 增加汇报单 @@ -63,4 +64,12 @@ export const getPrintDetail = (id: any) => url: Api.GetPrintDetail, method: 'get', data: { id }, + }); + +// 详情汇报单 +export const getByCodeReportTable = (code: any) => + request({ + url: Api.GetByCode, + method: 'get', + data: { code }, }); \ No newline at end of file diff --git a/Web/src/assets/login-icon-two.svg b/Web/src/assets/login-icon-two.svg index fb4e8dd..96d648a 100644 --- a/Web/src/assets/login-icon-two.svg +++ b/Web/src/assets/login-icon-two.svg @@ -1,8 +1,21 @@ - - - - - - - - \ No newline at end of file + + + + + + + + + + + + 一物一码·防伪防窜·数智营销·定制开发 + diff --git a/Web/src/assets/login-icon-two1.svg b/Web/src/assets/login-icon-two1.svg deleted file mode 100644 index fb4e8dd..0000000 --- a/Web/src/assets/login-icon-two1.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/Web/src/assets/login-icon-two2.svg b/Web/src/assets/login-icon-two2.svg deleted file mode 100644 index fb4e8dd..0000000 --- a/Web/src/assets/login-icon-two2.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/Web/src/assets/logo-mini.svg b/Web/src/assets/logo-mini.svg index fb4e8dd..6229680 100644 --- a/Web/src/assets/logo-mini.svg +++ b/Web/src/assets/logo-mini.svg @@ -1,8 +1,21 @@ - - - - - - - - \ No newline at end of file + + + + + + + + + + + + 一物一码·防伪防窜·数智营销·定制开发 + diff --git a/Web/src/assets/logo-nav.png b/Web/src/assets/logo-nav.png index 5080afb..8f51939 100644 Binary files a/Web/src/assets/logo-nav.png and b/Web/src/assets/logo-nav.png differ diff --git a/Web/src/assets/logo.png b/Web/src/assets/logo.png index 854f14f..5186a50 100644 Binary files a/Web/src/assets/logo.png and b/Web/src/assets/logo.png differ diff --git a/Web/src/assets/微信图片_20240228100037.png.svg b/Web/src/assets/微信图片_20240228100037.png.svg deleted file mode 100644 index fb4e8dd..0000000 --- a/Web/src/assets/微信图片_20240228100037.png.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/Web/src/views/inventoryManagement/productWarehousing/component/editDialog.vue b/Web/src/views/inventoryManagement/productWarehousing/component/editDialog.vue index e086753..2956587 100644 --- a/Web/src/views/inventoryManagement/productWarehousing/component/editDialog.vue +++ b/Web/src/views/inventoryManagement/productWarehousing/component/editDialog.vue @@ -154,7 +154,6 @@ - --> @@ -168,7 +167,6 @@ - --> @@ -180,13 +178,11 @@ - --> - diff --git a/Web/src/views/labelPrinting/printDataDetail/component/editDialog.vue b/Web/src/views/labelPrinting/printDataDetail/component/editDialog.vue index 0f4f091..b9bf8ae 100644 --- a/Web/src/views/labelPrinting/printDataDetail/component/editDialog.vue +++ b/Web/src/views/labelPrinting/printDataDetail/component/editDialog.vue @@ -8,6 +8,25 @@
+ + + + + + + + + + + + 条码查询 + + + + + + +