Merge branch 'master' of http://222.71.245.114:9086/r/HIA24016N_PipeLineDemo
| | |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\CMS.Plugin.HIAWms.Domain.Shared\CMS.Plugin.HIAWms.Domain.Shared.csproj" /> |
| | | <ProjectReference Include="..\CMS.Plugin.HIAWms.Domain\CMS.Plugin.HIAWms.Domain.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial; |
| | | using Volo.Abp.Application.Services; |
| | | using CmsQueryExtensions.Entitys; |
| | | using System.Linq.Expressions; |
| | | using CMS.Plugin.HIAWms.Domain.WmsMaterial; |
| | | |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | |
| | | /// <summary> |
| | | /// ç©æåºç¡ä¿¡æ¯è¡¨åºç¨æå¡æ¥å£ |
| | | /// </summary> |
| | | public interface IWmsMaterialAppService : ICrudAppService<WmsMaterialDto, Guid, GetWmsMaterialInput, WmsMaterialCreateDto, WmsMaterialUpdateDto> |
| | | { |
| | | public interface IWmsMaterialAppService : ICrudAppService<WmsMaterialDto, Guid, GetWmsMaterialInput, WmsMaterialCreateDto, WmsMaterialUpdateDto> |
| | | { |
| | | /// <summary> |
| | | /// å
éç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | Task<List<WmsMaterialDto>> CloneAsync(IEnumerable<Guid> ids); |
| | | |
| | | Task<List<WmsMaterialDto>> CloneAsync(IEnumerable<Guid> ids); |
| | | |
| | | /// <summary> |
| | | /// å é¤ç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWmsMaterialInput input); |
| | | } |
| | | Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWmsMaterialInput input); |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æ¡ä»¶è·åç©æåºç¡ä¿¡æ¯è¡¨å表 |
| | | /// </summary> |
| | | /// <param name="whereConditions"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | Task<List<WmsMaterial>> GetListByFilterAsync(Expression<Func<WmsMaterial, bool>> whereConditions, CancellationToken cancellationToken = default); |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æ¡ä»¶è·ååä¸ªç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="whereConditions"></param> |
| | | /// <param name="isMultipleThrowException">æ¯å¦æ¥è¯¢åºå¤æ¡å°±æ¥é</param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | Task<WmsMaterial> GetSingleByFilterAsync(Expression<Func<WmsMaterial, bool>> whereConditions, bool isâMultipleThrowException = false, CancellationToken cancellationToken = default); |
| | | |
| | | } |
| | |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public async Task ImportAsync(WmsMaterialsImportModel input, MyCurrentUser myCurrentUser) |
| | | { |
| | | |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | var wmsMaterialCreateDtos = new List<(int RowIndex, WmsMaterialCreateDto Item)>(); |
| | |
| | | |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æ¡ä»¶è·åç©æåºç¡ä¿¡æ¯è¡¨å表 |
| | | /// </summary> |
| | | /// <param name="whereConditions"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public async Task<List<WmsMaterial>> GetListByFilterAsync(Expression<Func<WmsMaterial, bool>> whereConditions, CancellationToken cancellationToken = default) |
| | | { |
| | | return await wmsMaterialRepository.GetListByFilterAsync(whereConditions); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æ¡ä»¶è·ååä¸ªç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="whereConditions"></param> |
| | | /// <param name="isMultipleThrowException">æ¯å¦æ¥è¯¢åºå¤æ¡å°±æ¥é</param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public async Task<WmsMaterial> GetSingleByFilterAsync(Expression<Func<WmsMaterial, bool>> whereConditions, bool isâMultipleThrowException = false, CancellationToken cancellationToken = default) |
| | | { |
| | | return await wmsMaterialRepository.GetSingleByFilterAsync(whereConditions, isâMultipleThrowException); |
| | | } |
| | | } |
| | |
| | | using CmsQueryExtensions.Extension; |
| | | using System.Linq.Expressions; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Domain.Repositories; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsMaterial; |
| | |
| | | /// <returns></returns> |
| | | Task BatchDeletePermanentlyAsync(IEnumerable<Guid> ids, CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æ¡ä»¶è·åç©æåºç¡ä¿¡æ¯è¡¨å表 |
| | | /// </summary> |
| | | /// <param name="whereConditions"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | Task<List<WmsMaterial>> GetListByFilterAsync(Expression<Func<WmsMaterial, bool>> whereConditions, CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æ¡ä»¶è·ååä¸ªç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="whereConditions"></param> |
| | | /// <param name="isMultipleThrowException">æ¯å¦æ¥è¯¢åºå¤æ¡å°±æ¥é</param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | Task<WmsMaterial> GetSingleByFilterAsync(Expression<Func<WmsMaterial, bool>> whereConditions, bool isâMultipleThrowException = false, CancellationToken cancellationToken = default); |
| | | |
| | | |
| | | } |
| | |
| | | using RestSharp; |
| | | using System.Linq.Dynamic.Core; |
| | | using System.Linq.Expressions; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
| | | using Volo.Abp.EntityFrameworkCore; |
| | | |
| | |
| | | var sql = $"DELETE FROM scms_wmsmaterials WHERE Id IN ({string.Join(",", idsToDelete.Select(id => $"'{id}'"))})"; |
| | | await dbContext.Database.ExecuteSqlRawAsync(sql, cancellationToken); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æ¡ä»¶è·åç©æåºç¡ä¿¡æ¯è¡¨å表 |
| | | /// </summary> |
| | | /// <param name="whereConditions"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public async Task<List<WmsMaterial>> GetListByFilterAsync(Expression<Func<WmsMaterial, bool>> whereConditions, CancellationToken cancellationToken = default) |
| | | { |
| | | return await (await GetDbSetAsync()) |
| | | .WhereIf(whereConditions != null, whereConditions) |
| | | .Where(x => !x.IsDeleted) |
| | | .OrderByDescending(x => x.CreationTime) |
| | | .ToListAsync(GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æ¡ä»¶è·ååä¸ªç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="whereConditions"></param> |
| | | /// <param name="isMultipleThrowException">æ¯å¦æ¥è¯¢åºå¤æ¡å°±æ¥é</param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public async Task<WmsMaterial> GetSingleByFilterAsync(Expression<Func<WmsMaterial, bool>> whereConditions, bool isâMultipleThrowException = false, CancellationToken cancellationToken = default) |
| | | { |
| | | if (isâMultipleThrowException) |
| | | { |
| | | var entitys = await (await GetDbSetAsync()) |
| | | .WhereIf(whereConditions != null, whereConditions) |
| | | .Where(x => !x.IsDeleted) |
| | | .OrderByDescending(x => x.CreationTime) |
| | | .ToListAsync(GetCancellationToken(cancellationToken)); |
| | | if (entitys?.Count > 1) |
| | | { |
| | | throw new UserFriendlyException("æ¥è¯¢å°å¤æ¡è®°å½"); |
| | | } |
| | | return entitys?.FirstOrDefault(); |
| | | } |
| | | else |
| | | { |
| | | return await (await GetDbSetAsync()) |
| | | .WhereIf(whereConditions != null, whereConditions) |
| | | .Where(x => !x.IsDeleted) |
| | | .OrderByDescending(x => x.CreationTime) |
| | | .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); |
| | | } |
| | | } |
| | | } |