Просмотр исходного кода

Merge branch 'master' into storemanagement

storemanagement
zhaoy 8 месяцев назад
Родитель
Сommit
cd940fa9b8
3 измененных файлов: 20 добавлений и 13 удалений
  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 Просмотреть файл

@@ -14,6 +14,7 @@ using BPA.SAAS.Manage.Core.Base;
using BPA.SAAS.Manage.Core.DataBase; using BPA.SAAS.Manage.Core.DataBase;
using BPA.SAAS.Manage.Core.Device; using BPA.SAAS.Manage.Core.Device;
using BPA.SAAS.Manage.Core.Product; using BPA.SAAS.Manage.Core.Product;
using Furion.ClayObject.Extensions;
using Newtonsoft.Json; using Newtonsoft.Json;
using Npoi.Mapper; using Npoi.Mapper;
using NPOI.HSSF.UserModel; 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 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 ?? ""; return dictData?.TemplatePath ?? "";
} }
@@ -977,11 +978,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services
//} //}
//else //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 source = file.OpenReadStream();
var mapper = new Mapper(source); var mapper = new Mapper(source);
var deviceVersion = await _db.Queryable<BPA_ProductVesion>().FirstAsync(x => x.ProductId == inputDto.DeviceClientType && x.Vesion == inputDto.Version); 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(); 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) if (TechnologyExportRecode != null)
{ {
TechnologyExportRecode.CreateAt= DateTime.Now; TechnologyExportRecode.CreateAt= DateTime.Now;
await _db.Updateable(TechnologyExportRecode).ExecuteCommandAsync();
TechnologyExportRecode.TemplatePath = path;
await _db.Updateable(TechnologyExportRecode).ExecuteCommandAsync();
} }
else else
{ {
BPA_TechnologyExportRecode _TechnologyExportRecode = new();
BPA_TechnologyExportRecode _TechnologyExportRecode = new();
_TechnologyExportRecode.Id = Guid.NewGuid().ToString(); _TechnologyExportRecode.Id = Guid.NewGuid().ToString();
_TechnologyExportRecode.CreateAt = DateTime.Now; _TechnologyExportRecode.CreateAt = DateTime.Now;
_TechnologyExportRecode.ProductId = inputDto.DeviceClientType; _TechnologyExportRecode.ProductId = inputDto.DeviceClientType;
_TechnologyExportRecode.DeviceVersionId = inputDto.Id; _TechnologyExportRecode.DeviceVersionId = inputDto.Id;
_TechnologyExportRecode.TemplatePath= path;
await _db.Insertable(_TechnologyExportRecode).ExecuteCommandAsync(); 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(); _db.Ado.CommitTran();


+ 2
- 2
BPA.SAAS.Manage.Application/Device/Services/ProductService.cs Просмотреть файл

@@ -98,8 +98,8 @@ namespace BPA.SAAS.Manage.Application.Device.Services
public async Task<bool> UpdateProduct(ProductBaseDto inputDto) public async Task<bool> UpdateProduct(ProductBaseDto inputDto)
{ {
var data = await _db.Queryable<BPA_Product>().Where(x => x.Id == inputDto.Id).FirstAsync(); 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) if (data != null)
{ {
var res = _db.Updateable<BPA_Product>() var res = _db.Updateable<BPA_Product>()


+ 1
- 0
BPA.SAAS.Manage.Core/Device/BPA_TechnologyExportRecode.cs Просмотреть файл

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

Загрузка…
Отмена
Сохранить