using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Opsoft.NetCore.O3App.Domain; using Opsoft.NetCore.O3App.Domain.Interface; using Opsoft.NetCore.O3App.Domain.UnitOfWork.Assets.IRepositories; using Opsoft.NetCore.O3App.Shared; using Opsoft.NetCore.O3App.Domain.UnitOfWork.Assets.IServices; using Opsoft.NetCore.O3App.Domain.UnitOfWork.Assets.Model; namespace Opsoft.NetCore.O3App.Services.Assets { [MapTo(typeof(IAssetInventoryService), ServiceLifetime.Transient)] public class AssetInventoryService : ServiceBase, IAssetInventoryService { public AssetInventoryService(IAssetInventoryRepository repository) : base(repository) { Init(repository); } /// /// 获取盘点方案信息及暂存信息 /// /// /// public async Task> GetAssetInventory(Inventory SData) { if (SData.FBILLNO==null) { throw new O3AppException("资产盘点方案条码信息错误,未定义!!",400); } return await (repository as IAssetInventoryRepository).GetAssetInventory(SData); } /// /// 获取资产信息 /// /// /// public async Task> GetAssets(Inventory SData) { if (SData.FBILLNO == null) { throw new O3AppException("资产条码信息错误,未定义!!", 400); } return await (repository as IAssetInventoryRepository).GetAssets(SData); } /// /// 资产盘点暂存 /// /// /// public async Task TemporaryStorage(Temporary SData) { if (SData.basicType.ToString() == "") { throw new O3AppException("资产盘点操作类型信息错误,未定义!!",400); } if (SData.FINTERID == null||SData.FBILLNO==null) { throw new O3AppException("资产盘点信息错误,未定义!!",400); } if (SData.SData.Count == 0) { throw new O3AppException("暂存资产信息错误,未定义!!", 400); } return await (repository as IAssetInventoryRepository).TemporaryStorage(SData); } } }