diff --git a/BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs b/BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs index 951cff0..b8d8567 100644 --- a/BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs +++ b/BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs @@ -138,9 +138,9 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services resEntity.IsAttrubute = Convert.ToBoolean(dto.IsAttrubute); resEntity.Code = GetNumber2(8); var data = _db.Queryable().Max(x => x.AutoKey); - if (data == 0) data = 1000; - else data = data + 1; - resEntity.AutoKey = data; + //if (data == 0) data = 1000; + //else data = data + 1; + // resEntity.AutoKey = data; var res = await _db.Insertable(resEntity).CallEntityMethod(m => m.Create()).ExecuteCommandAsync(); return res > 0; } @@ -940,7 +940,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services var device = await _db.Queryable().FirstAsync(x => x.Id == deviceId); //设备类型 - var dictData = await _db.Queryable().FirstAsync(x => x.Id == device.ProductVersionId); + var dictData = await _db.Queryable().FirstAsync(x => x.Id == device.ProductVersionId); return dictData?.TemplatePath ?? ""; } @@ -959,7 +959,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services { var path = await _SystemConfigService.GetCosImgesURL(file); - await _db.Updateable() + await _db.Updateable() .SetColumns(it => it.TemplatePath == path) .Where(it => it.Id == inputDto.Id) .ExecuteCommandAsync(); @@ -969,7 +969,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services var source = file.OpenReadStream(); var mapper = new Mapper(source); - var deviceVersion = await _db.Queryable().FirstAsync(x => x.ProductId == inputDto.DeviceClientType && x.Vesion == inputDto.Version); + var deviceVersion = await _db.Queryable().FirstAsync(x => x.ProductId == inputDto.DeviceClientType && x.Vesion == inputDto.Version); //添加 设备_烹饪工序模型 #region 添加 设备_烹饪工序模型 ReadExcel readGoodstechnologyExcel = new(); diff --git a/BPA.SAAS.Manage.Application/Device/DeviceVesionServices.cs b/BPA.SAAS.Manage.Application/Device/DeviceVesionServices.cs index d4cdb42..e7613ca 100644 --- a/BPA.SAAS.Manage.Application/Device/DeviceVesionServices.cs +++ b/BPA.SAAS.Manage.Application/Device/DeviceVesionServices.cs @@ -74,7 +74,7 @@ namespace BPA.SAAS.Manage.Application.Device /// /// [HttpGet("/api/devicevesion/getdevicevesion")] - public async Task> GetDeviceVesion(string productId) + public async Task> GetDeviceVesion(string productId) { return await _deviceVesionService.GetDeviceVesion(productId); } @@ -83,7 +83,7 @@ namespace BPA.SAAS.Manage.Application.Device /// /// [HttpGet("/api/devicevesion/getdevicevesionlist")] - public async Task> GetDeviceVesionList() + public async Task> GetDeviceVesionList() { return await _deviceVesionService.GetDeviceVesionList(); } diff --git a/BPA.SAAS.Manage.Application/Device/Interface/IDeviceVesionService.cs b/BPA.SAAS.Manage.Application/Device/Interface/IDeviceVesionService.cs index ec9ed74..5d27a9a 100644 --- a/BPA.SAAS.Manage.Application/Device/Interface/IDeviceVesionService.cs +++ b/BPA.SAAS.Manage.Application/Device/Interface/IDeviceVesionService.cs @@ -16,7 +16,7 @@ namespace BPA.SAAS.Manage.Application.Device.Interface Task DelDeviceVesionAsync(List inputList); Task UpdateDeviceVesionAsync(DeviceVesionBaseDto inputDto); Task UpdateDeviceVesionSatatus(DeviceVesionSatatusDto inputDto); - Task> GetDeviceVesion(string ProductId); - Task> GetDeviceVesionList(); + Task> GetDeviceVesion(string ProductId); + Task> GetDeviceVesionList(); } } diff --git a/BPA.SAAS.Manage.Application/Device/Services/DeviceService.cs b/BPA.SAAS.Manage.Application/Device/Services/DeviceService.cs index bf4ffcd..172ec41 100644 --- a/BPA.SAAS.Manage.Application/Device/Services/DeviceService.cs +++ b/BPA.SAAS.Manage.Application/Device/Services/DeviceService.cs @@ -48,7 +48,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services }) .Mapper(x => { - var Vesion = _db.Queryable().Where(c => c.Id == x.ProductVersionId).First(); + var Vesion = _db.Queryable().Where(c => c.Id == x.ProductVersionId).First(); x.ProductVersionName = Vesion?.Vesion; }) .ToPageListAsync(inputDto.Current, inputDto.PageSize, total); @@ -69,7 +69,8 @@ namespace BPA.SAAS.Manage.Application.Device.Services .Select(a=> new ListSelectQuery { Id = a.Id, - Name = a.DeviceName + Name = a.DeviceName, + AutoKey=a.AutoKey.ToString() }) .ToListAsync(); return data; } diff --git a/BPA.SAAS.Manage.Application/Device/Services/DeviceVesionService.cs b/BPA.SAAS.Manage.Application/Device/Services/DeviceVesionService.cs index 8c81f8e..1533d47 100644 --- a/BPA.SAAS.Manage.Application/Device/Services/DeviceVesionService.cs +++ b/BPA.SAAS.Manage.Application/Device/Services/DeviceVesionService.cs @@ -28,7 +28,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services public async Task GetDeviceVesionPageAsync(DeviceVesionQueryInputDto inputDto) { var total = new RefAsync(); - var data = await _db.Queryable((a, b) => new JoinQueryInfos(JoinType.Left, b.Id == a.ProductId)) + var data = await _db.Queryable((a, b) => new JoinQueryInfos(JoinType.Left, b.Id == a.ProductId)) .WhereIF(!string.IsNullOrWhiteSpace(inputDto.ProductId), x => x.ProductId.Contains(inputDto.ProductId)) .OrderBy(a => a.CreateAt, OrderByType.Desc) .Select((a,b)=>new DeviceVesionModel() @@ -54,7 +54,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services public async Task AddDeviceVesionAsync(DeviceVesionBaseDto inputDto) { - var res = await _db.Insertable(new BPA_DeviceVesion + var res = await _db.Insertable(new BPA_ProductVesion { Vesion = inputDto.Vesion, ProductId = inputDto.ProductId, @@ -75,7 +75,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services { throw Oops.Oh("当前设备类型已使用,无法删除"); } - var datas = await _db.Queryable() + var datas = await _db.Queryable() .Where(x => inputList.Contains(x.Id)) .ToListAsync(); _db.Deleteable(datas).ExecuteCommand(); @@ -87,11 +87,11 @@ namespace BPA.SAAS.Manage.Application.Device.Services /// public async Task UpdateDeviceVesionAsync(DeviceVesionBaseDto inputDto) { - var data = await _db.Queryable().Where(x => x.Id == inputDto.Id).FirstAsync(); + var data = await _db.Queryable().Where(x => x.Id == inputDto.Id).FirstAsync(); if (data != null) { - var res = _db.Updateable().SetColumns(t => t.Vesion == inputDto.Vesion) + var res = _db.Updateable().SetColumns(t => t.Vesion == inputDto.Vesion) .SetColumns(t => t.TemplatePath == inputDto.TemplatePath) .SetColumns(t => t.ProductId == inputDto.ProductId) .SetColumns(t => t.Status == (CommonStatus)inputDto.Status).Where(t => t.Id == inputDto.Id) @@ -109,11 +109,11 @@ namespace BPA.SAAS.Manage.Application.Device.Services /// public async Task UpdateDeviceVesionSatatus(DeviceVesionSatatusDto inputDto) { - var data = await _db.Queryable().Where(x => x.Id == inputDto.Id).FirstAsync(); + var data = await _db.Queryable().Where(x => x.Id == inputDto.Id).FirstAsync(); if (data != null) { - var res = _db.Updateable() + var res = _db.Updateable() .SetColumns(t => t.Status == (CommonStatus)inputDto.Status).Where(t => t.Id == inputDto.Id) .ExecuteCommandHasChange(); @@ -127,18 +127,18 @@ namespace BPA.SAAS.Manage.Application.Device.Services /// /// /// - public async Task> GetDeviceVesion(string ProductId) + public async Task> GetDeviceVesion(string ProductId) { - var resEntity =await _db.Queryable().Where(a => a.ProductId == ProductId && a.Status==0).Select(a => new BPA_DeviceVesion() { Id = a.Id.SelectAll() }).ToListAsync(); + var resEntity =await _db.Queryable().Where(a => a.ProductId == ProductId && a.Status==0).Select(a => new BPA_ProductVesion() { Id = a.Id.SelectAll() }).ToListAsync(); return resEntity; } /// /// 查询版本列表 /// /// - public async Task> GetDeviceVesionList() + public async Task> GetDeviceVesionList() { - var resEntity =await _db.Queryable().Select(a => new BPA_DeviceVesion() { Id = a.Id.SelectAll() }).ToListAsync(); + var resEntity =await _db.Queryable().Select(a => new BPA_ProductVesion() { Id = a.Id.SelectAll() }).ToListAsync(); return resEntity; } } diff --git a/BPA.SAAS.Manage.Application/Device/Services/ProductFunctionService.cs b/BPA.SAAS.Manage.Application/Device/Services/ProductFunctionService.cs index aa91228..f19eb46 100644 --- a/BPA.SAAS.Manage.Application/Device/Services/ProductFunctionService.cs +++ b/BPA.SAAS.Manage.Application/Device/Services/ProductFunctionService.cs @@ -32,7 +32,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services public async Task GetProductFunctionPage(ProductFunctionPageBase inputDto) { RefAsync total = 0; - var res = await _db.Queryable((x, b) => new JoinQueryInfos(JoinType.Left, b.Id == x.DeviceVersionKey)) + var res = await _db.Queryable((x, b) => new JoinQueryInfos(JoinType.Left, b.Id == x.DeviceVersionKey)) .Where((x,b)=>b.ProductId == inputDto.DeviceTypeKey) .WhereIF(!string.IsNullOrWhiteSpace(inputDto.Name), (x, b) => x.Name.Contains(inputDto.Name)) .WhereIF(!string.IsNullOrWhiteSpace(inputDto.Type), (x, b) => x.Type==Convert.ToInt32(inputDto.Type)) diff --git a/BPA.SAAS.Manage.Comm/Model/ListSelectQuery.cs b/BPA.SAAS.Manage.Comm/Model/ListSelectQuery.cs index 191e2d8..c0e379e 100644 --- a/BPA.SAAS.Manage.Comm/Model/ListSelectQuery.cs +++ b/BPA.SAAS.Manage.Comm/Model/ListSelectQuery.cs @@ -10,5 +10,6 @@ namespace BPA.SAAS.Manage.Comm.Model { public string Id { get; set; } public string Name { get; set; } + public string AutoKey { get; set; } } } diff --git a/BPA.SAAS.Manage.Core/Device/BPA_DeviceVesion.cs b/BPA.SAAS.Manage.Core/Device/BPA_ProductVesion.cs similarity index 88% rename from BPA.SAAS.Manage.Core/Device/BPA_DeviceVesion.cs rename to BPA.SAAS.Manage.Core/Device/BPA_ProductVesion.cs index 50a05af..959ec7c 100644 --- a/BPA.SAAS.Manage.Core/Device/BPA_DeviceVesion.cs +++ b/BPA.SAAS.Manage.Core/Device/BPA_ProductVesion.cs @@ -9,8 +9,8 @@ using System.Threading.Tasks; namespace BPA.SAAS.Manage.Core.Device { - [SugarTable("bpa_devicevesion")] - public class BPA_DeviceVesion : IBaseEntity, IGroupId + [SugarTable("bpa_productvesion")] + public class BPA_ProductVesion : IBaseEntity { public string Vesion { get; set; } ///