Browse Source

Merge branch 'master' into storemanagement

storemanagement
zhaoy 7 months ago
parent
commit
cd940fa9b8
3 changed files with 20 additions and 13 deletions
  1. +17
    -11
      BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs
  2. +2
    -2
      BPA.SAAS.Manage.Application/Device/Services/ProductService.cs
  3. +1
    -0
      BPA.SAAS.Manage.Core/Device/BPA_TechnologyExportRecode.cs

+ 17
- 11
BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs View File

@@ -14,6 +14,7 @@ using BPA.SAAS.Manage.Core.Base;
using BPA.SAAS.Manage.Core.DataBase;
using BPA.SAAS.Manage.Core.Device;
using BPA.SAAS.Manage.Core.Product;
using Furion.ClayObject.Extensions;
using Newtonsoft.Json;
using Npoi.Mapper;
using NPOI.HSSF.UserModel;
@@ -956,7 +957,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services
var device = await _db.Queryable<BPA_DeviceInfo>().FirstAsync(x => x.Id == deviceId);

//设备类型
var dictData = await _db.Queryable<BPA_ProductVesion>().FirstAsync(x => x.Id == device.ProductVersionId);
var dictData = await _db.Queryable<BPA_TechnologyExportRecode>().FirstAsync(x => x.DeviceVersionId == device.ProductVersionId);

return dictData?.TemplatePath ?? "";
}
@@ -977,11 +978,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services
//}
//else
//{
var path = await _SystemConfigService.GetCosImgesURL(file);
await _db.Updateable<BPA_ProductVesion>()
.SetColumns(it => it.TemplatePath == path)
.Where(it => it.Id == inputDto.Id)
.ExecuteCommandAsync();
var source = file.OpenReadStream();
var mapper = new Mapper(source);
var deviceVersion = await _db.Queryable<BPA_ProductVesion>().FirstAsync(x => x.ProductId == inputDto.DeviceClientType && x.Vesion == inputDto.Version);
@@ -1081,22 +1078,31 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services
await _db.Insertable(item).ExecuteCommandAsync();
}
}
#endregion
var TechnologyExportRecode = _db.Queryable<BPA_TechnologyExportRecode>().Where(x=>x.DeviceVersionId == inputDto.Id).First();
#endregion
var path = await _SystemConfigService.GetCosImgesURL(file);
var TechnologyExportRecode = _db.Queryable<BPA_TechnologyExportRecode>().Where(x=>x.DeviceVersionId == inputDto.Id).First();
if (TechnologyExportRecode != null)
{
TechnologyExportRecode.CreateAt= DateTime.Now;
await _db.Updateable(TechnologyExportRecode).ExecuteCommandAsync();
TechnologyExportRecode.TemplatePath = path;
await _db.Updateable(TechnologyExportRecode).ExecuteCommandAsync();
}
else
{
BPA_TechnologyExportRecode _TechnologyExportRecode = new();
BPA_TechnologyExportRecode _TechnologyExportRecode = new();
_TechnologyExportRecode.Id = Guid.NewGuid().ToString();
_TechnologyExportRecode.CreateAt = DateTime.Now;
_TechnologyExportRecode.ProductId = inputDto.DeviceClientType;
_TechnologyExportRecode.DeviceVersionId = inputDto.Id;
_TechnologyExportRecode.TemplatePath= path;
await _db.Insertable(_TechnologyExportRecode).ExecuteCommandAsync();
}
//await _db.Updateable<BPA_TechnologyExportRecode>()
// .SetColumns(it => it.TemplatePath == path)
// .Where(it => it.Id == inputDto.Id)
// .ExecuteCommandAsync();
}
//}
_db.Ado.CommitTran();


+ 2
- 2
BPA.SAAS.Manage.Application/Device/Services/ProductService.cs View File

@@ -98,8 +98,8 @@ namespace BPA.SAAS.Manage.Application.Device.Services
public async Task<bool> UpdateProduct(ProductBaseDto inputDto)
{
var data = await _db.Queryable<BPA_Product>().Where(x => x.Id == inputDto.Id).FirstAsync();
var check = _db.Queryable<BPA_Product>().Where(x => x.Name == inputDto.Name || x.Code == inputDto.Code).Any();
if (check) throw Oops.Oh("产品名称和标识不能重复");
//var check = _db.Queryable<BPA_Product>().Where(x => x.Name == inputDto.Name || x.Code == inputDto.Code).Any();
//if (check) throw Oops.Oh("产品名称和标识不能重复");
if (data != null)
{
var res = _db.Updateable<BPA_Product>()


+ 1
- 0
BPA.SAAS.Manage.Core/Device/BPA_TechnologyExportRecode.cs View File

@@ -17,5 +17,6 @@ namespace BPA.SAAS.Manage.Core.Device
public string DeviceVersionId { get; set; }
public string ProductId { get; set; }
public DateTime CreateAt { get; set; }
public string TemplatePath { get; set; }
}
}

Loading…
Cancel
Save