| | |
| | | /// <summary> |
| | | /// ä½ä¸è®¡åè¾å
¥åæ°æ¨¡å |
| | | /// </summary> |
| | | [Serializable] |
| | | public class WorkPlanInput |
| | | { |
| | | /// <summary> |
| | |
| | | using CMS.Plugin.FormulaManagement.Abstractions; |
| | | using CMS.Plugin.MesSuite.Abstractions.Events; |
| | | using CMS.Plugin.OrderManagement.Abstractions; |
| | | using CMS.Plugin.OrderManagement.Abstractions.Enums; |
| | | using CMS.Plugin.OrderManagement.Abstractions.Models; |
| | | using CMS.Plugin.OrderManagement.Abstractions; |
| | | using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.MyTestEntityNames; |
| | | using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan; |
| | | using CMS.Plugin.PipeLineLems.Application.Contracts.Services; |
| | | using CMS.Plugin.PipeLineLems.Domain.MyTestEntityNames; |
| | | using CMS.Plugin.PipeLineLems.Domain.Shared; |
| | | using CMS.Plugin.PipeLineLems.Domain.Shared.MyTestEntityNames; |
| | | using CMS.Plugin.PipeLineLems.Domain.WorkPlan; |
| | | using CMS.Plugin.ProductManagement.Abstractions; |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Dtos; |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.ObjectExtending; |
| | | using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan; |
| | | using Volo.Abp.EventBus; |
| | | |
| | | namespace CMS.Plugin.PipeLineLems.Application.Implements; |
| | | |
| | | public class MesAppService : IMesAppService |
| | | public class MesAppService : CMSPluginAppService, IMesAppService |
| | | { |
| | | private readonly IServiceProvider _serviceProvider; |
| | | private readonly IWorkPlanAppService _workPlanAppService; |
| | | |
| | | //private readonly IEventBus _eventBus; |
| | | |
| | | public MesAppService(IServiceProvider serviceProvider |
| | | , IWorkPlanAppService workPlanAppService |
| | | //, IEventBus eventBus |
| | | ) |
| | | { |
| | | _serviceProvider = serviceProvider; |
| | | // _eventBus = eventBus; |
| | | _workPlanAppService = workPlanAppService; |
| | | } |
| | | |
| | | public async Task<MesOrderResponse> CreateAsync(List<WorkPlanInput> input) |
| | |
| | | var order = await orderManager.GetByCodeAsync(taskCode); |
| | | if (order != null) |
| | | { |
| | | throw new UserFriendlyException($"å·¥å[{taskCode}]å·²åå¨"); |
| | | throw new UserFriendlyException($"ä»»å¡ç¼å·[{taskCode}]å·²åå¨"); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | //ä¿åå°è¡¨ä¸ |
| | | foreach (var item in input) |
| | | { |
| | | var insertObj = ObjectMapper.Map<WorkPlanInput, WorkPlanCreateDto>(item); |
| | | insertObj.OrgMaterialCode = "1111"; |
| | | insertObj.Sort = 1; |
| | | await _workPlanAppService.CreateAsync(insertObj); |
| | | } |
| | | |
| | | |
| | | // åå¸äºä»¶ |
| | | //await _eventBus.PublishAsync(new EntityChangedEto("MESCREATE", input, null, EntityChangeType.Add, true)); |
| | | |
| | |
| | | using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan; |
| | | using CMS.Plugin.PipeLineLems.Application.Contracts.Services; |
| | | using CMS.Plugin.PipeLineLems.Domain.Shared; |
| | | using CmsQueryExtensions; |
| | | using CMS.Plugin.PipeLineLems.Domain.WorkPlan; |
| | | using CmsQueryExtensions.Extension; |
| | | using System.Linq.Expressions; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Dtos; |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.ObjectExtending; |
| | | using Volo.Abp.ObjectMapping; |
| | | |
| | | namespace CMS.Plugin.PipeLineLems.Application.Implements; |
| | | |
| | | using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan; |
| | | using CMS.Plugin.PipeLineLems.Application.Contracts.Services; |
| | | using CMS.Plugin.PipeLineLems.Domain.Shared; |
| | | using CmsQueryExtensions; |
| | | using CMS.Plugin.PipeLineLems.Domain.WorkPlan; |
| | | using CmsQueryExtensions.Extension; |
| | | using System.Linq.Expressions; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Dtos; |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.ObjectExtending; |
| | | using Volo.Abp.ObjectMapping; |
| | | |
| | | namespace CMS.Plugin.PipeLineLems.Application.Implements; |
| | | |
| | | /// <summary> |
| | | /// ä½ä¸è®¡å表åºç¨æå¡ |
| | | /// </summary> |
| | | public class WorkPlanAppService : CMSPluginAppService, IWorkPlanAppService |
| | | { |
| | | private readonly IWorkPlanRepository workPlanRepository; |
| | | |
| | | public class WorkPlanAppService : CMSPluginAppService, IWorkPlanAppService |
| | | { |
| | | private readonly IWorkPlanRepository workPlanRepository; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WorkPlanAppService"/> class. |
| | | /// </summary> |
| | | /// <param name="WorkPlanRepository">The task job repository.</param> |
| | | public WorkPlanAppService(IWorkPlanRepository _WorkPlanRepository) |
| | | { |
| | | workPlanRepository = _WorkPlanRepository; |
| | | } |
| | | |
| | | public WorkPlanAppService(IWorkPlanRepository _WorkPlanRepository) |
| | | { |
| | | workPlanRepository = _WorkPlanRepository; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åæå®ä½ä¸è®¡å表 |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task<WorkPlanDto> GetAsync(Guid id) |
| | | { |
| | | return ObjectMapper.Map<WorkPlan, WorkPlanDto>(await workPlanRepository.GetAsync(id)); |
| | | } |
| | | |
| | | public virtual async Task<WorkPlanDto> GetAsync(Guid id) |
| | | { |
| | | return ObjectMapper.Map<WorkPlan, WorkPlanDto>(await workPlanRepository.GetAsync(id)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å页è·åä½ä¸è®¡å表 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task<PagedResultDto<WorkPlanDto>> GetListAsync(GetWorkPlanInput input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WorkPlan.Sort); |
| | | } |
| | | |
| | | public virtual async Task<PagedResultDto<WorkPlanDto>> GetListAsync(GetWorkPlanInput input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WorkPlan.Sort); |
| | | } |
| | | |
| | | #region 卿æé æ¥è¯¢æ¡ä»¶ |
| | | |
| | | |
| | | //卿æé æ¥è¯¢æ¡ä»¶ |
| | | var whereConditions = DynamicGetQueryParams(input); |
| | | |
| | | #endregion |
| | | |
| | | var count = await workPlanRepository.GetCountAsync(whereConditions); |
| | | var list = await workPlanRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount); |
| | | |
| | | return new PagedResultDto<WorkPlanDto>(count, ObjectMapper.Map<List<WorkPlan>, List<WorkPlanDto>>(list)); |
| | | } |
| | | |
| | | var whereConditions = DynamicGetQueryParams(input); |
| | | |
| | | #endregion |
| | | |
| | | var count = await workPlanRepository.GetCountAsync(whereConditions); |
| | | var list = await workPlanRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount); |
| | | |
| | | return new PagedResultDto<WorkPlanDto>(count, ObjectMapper.Map<List<WorkPlan>, List<WorkPlanDto>>(list)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 卿æé æ¥è¯¢æ¡ä»¶ |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥åæ°</param> |
| | | /// <returns></returns> |
| | | private FunReturnResultModel<Expression<Func<WorkPlan, bool>>> DynamicGetQueryParams(GetWorkPlanInput input) |
| | | { |
| | | private FunReturnResultModel<Expression<Func<WorkPlan, bool>>> DynamicGetQueryParams(GetWorkPlanInput input) |
| | | { |
| | | //卿æé æ¥è¯¢æ¡ä»¶ |
| | | var whereConditions = WhereConditionsExtensions.GetWhereConditions<WorkPlan, GetWorkPlanInput>(input); |
| | | if (!whereConditions.IsSuccess) |
| | | { |
| | | throw new Exception("卿æé æ¥è¯¢æ¡ä»¶å¤±è´¥:" + whereConditions.ErrMsg); |
| | | } |
| | | |
| | | var whereConditions = WhereConditionsExtensions.GetWhereConditions<WorkPlan, GetWorkPlanInput>(input); |
| | | if (!whereConditions.IsSuccess) |
| | | { |
| | | throw new Exception("卿æé æ¥è¯¢æ¡ä»¶å¤±è´¥:" + whereConditions.ErrMsg); |
| | | } |
| | | |
| | | //ä¹å¯å次èªå®ä¹æå»ºæ¥è¯¢æ¡ä»¶ |
| | | Expression<Func<WorkPlan, bool>> extendExpression = a => a.IsDeleted == false; |
| | | Expression<Func<WorkPlan, bool>> extendExpression = a => a.IsDeleted == false; |
| | | // ä½¿ç¨ System.Linq.PredicateBuilder ç And |
| | | var pres = (System.Linq.Expressions.Expression<Func<WorkPlan, bool>>)(whereConditions.data); |
| | | whereConditions.data = System.Linq.PredicateBuilder.And(pres, extendExpression); |
| | | |
| | | return whereConditions; |
| | | } |
| | | |
| | | var pres = (System.Linq.Expressions.Expression<Func<WorkPlan, bool>>)(whereConditions.data); |
| | | whereConditions.data = System.Linq.PredicateBuilder.And(pres, extendExpression); |
| | | |
| | | return whereConditions; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ°å»ºä½ä¸è®¡å表 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public virtual async Task<WorkPlanDto> CreateAsync(WorkPlanCreateDto input) |
| | | { |
| | | await CheckCreateOrUpdateDtoAsync(input); |
| | | |
| | | var exist = await workPlanRepository.NameExistAsync(input.TaskCode); |
| | | if (exist) |
| | | { |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.TaskCode]); |
| | | } |
| | | |
| | | var maxSort = await workPlanRepository.GetMaxSortAsync(); |
| | | var sort = input.Sort ?? maxSort; |
| | | |
| | | var insertObj = ObjectMapper.Map<WorkPlanCreateDto, WorkPlan>(input); |
| | | insertObj.Sort = sort; |
| | | input.MapExtraPropertiesTo(insertObj, MappingPropertyDefinitionChecks.None); |
| | | |
| | | await workPlanRepository.InsertAsync(insertObj); |
| | | |
| | | if (input.Sort.HasValue && insertObj.Sort != maxSort) |
| | | { |
| | | await AdjustSortAsync(insertObj.Id, insertObj.Sort); |
| | | } |
| | | |
| | | return ObjectMapper.Map<WorkPlan, WorkPlanDto>(insertObj); |
| | | } |
| | | |
| | | public virtual async Task<WorkPlanDto> CreateAsync(WorkPlanCreateDto input) |
| | | { |
| | | await CheckCreateOrUpdateDtoAsync(input); |
| | | |
| | | var exist = await workPlanRepository.NameExistAsync(input.TaskCode); |
| | | if (exist) |
| | | { |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.TaskCode]); |
| | | } |
| | | |
| | | var maxSort = await workPlanRepository.GetMaxSortAsync(); |
| | | var sort = input.Sort ?? maxSort; |
| | | |
| | | var insertObj = ObjectMapper.Map<WorkPlanCreateDto, WorkPlan>(input); |
| | | insertObj.Sort = sort; |
| | | input.MapExtraPropertiesTo(insertObj, MappingPropertyDefinitionChecks.None); |
| | | |
| | | await workPlanRepository.InsertAsync(insertObj); |
| | | |
| | | //if (input.Sort.HasValue && insertObj.Sort != maxSort) |
| | | //{ |
| | | // await AdjustSortAsync(insertObj.Id, insertObj.Sort); |
| | | //} |
| | | |
| | | return ObjectMapper.Map<WorkPlan, WorkPlanDto>(insertObj); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ´æ°ä½ä¸è®¡å表 |
| | | /// </summary> |
| | |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public virtual async Task<WorkPlanDto> UpdateAsync(Guid id, WorkPlanUpdateDto input) |
| | | { |
| | | await CheckCreateOrUpdateDtoAsync(input); |
| | | |
| | | var updateObj = await workPlanRepository.GetAsync(id); |
| | | var exist = await workPlanRepository.NameExistAsync(input.TaskCode, updateObj.Id); |
| | | if (exist) |
| | | { |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.TaskCode]); |
| | | } |
| | | |
| | | updateObj.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp); |
| | | input.MapExtraPropertiesTo(updateObj, MappingPropertyDefinitionChecks.None); |
| | | |
| | | updateObj.TaskCode = input.TaskCode; |
| | | public virtual async Task<WorkPlanDto> UpdateAsync(Guid id, WorkPlanUpdateDto input) |
| | | { |
| | | await CheckCreateOrUpdateDtoAsync(input); |
| | | |
| | | var updateObj = await workPlanRepository.GetAsync(id); |
| | | var exist = await workPlanRepository.NameExistAsync(input.TaskCode, updateObj.Id); |
| | | if (exist) |
| | | { |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.TaskCode]); |
| | | } |
| | | |
| | | updateObj.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp); |
| | | input.MapExtraPropertiesTo(updateObj, MappingPropertyDefinitionChecks.None); |
| | | |
| | | updateObj.TaskCode = input.TaskCode; |
| | | updateObj.OrgMaterialCode = input.OrgMaterialCode; |
| | | updateObj.FactoryCode = input.FactoryCode; |
| | | updateObj.ProductCode = input.ProductCode; |
| | |
| | | updateObj.RedundantField3 = input.RedundantField3; |
| | | updateObj.Remark = input.Remark; |
| | | updateObj.IsDisabled = input.IsDisabled; |
| | | |
| | | |
| | | await workPlanRepository.UpdateAsync(updateObj); |
| | | |
| | | return ObjectMapper.Map<WorkPlan, WorkPlanDto>(updateObj); |
| | | } |
| | | |
| | | |
| | | |
| | | await workPlanRepository.UpdateAsync(updateObj); |
| | | |
| | | return ObjectMapper.Map<WorkPlan, WorkPlanDto>(updateObj); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å
éä½ä¸è®¡å表 |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | public async Task<List<WorkPlanDto>> CloneAsync(IEnumerable<Guid> ids) |
| | | { |
| | | public async Task<List<WorkPlanDto>> CloneAsync(IEnumerable<Guid> ids) |
| | | { |
| | | //var workPlans = new List<WorkPlan>(); |
| | | //if (ids != null) |
| | | //{ |
| | |
| | | // name += WorkPlanConsts.CloneTag; |
| | | // continue; |
| | | // } |
| | | |
| | | |
| | | // notExist = true; |
| | | // } |
| | | |
| | | |
| | | // //WorkPlan = await workPlanRepository.InsertAsync(WorkPlan.Clone(GuidGenerator.Create(), name, sort++)); |
| | | // workPlans.Add(WorkPlan); |
| | | // } |
| | | // } |
| | | //} |
| | | |
| | | |
| | | //return ObjectMapper.Map<List<WorkPlan>, List<WorkPlanDto>>(workPlans); |
| | | return new List<WorkPlanDto>(); |
| | | } |
| | | |
| | | return new List<WorkPlanDto>(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å é¤å个ä½ä¸è®¡å表 |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public virtual Task DeleteAsync(Guid id) |
| | | { |
| | | return workPlanRepository.DeleteAsync(id); |
| | | } |
| | | |
| | | public virtual Task DeleteAsync(Guid id) |
| | | { |
| | | return workPlanRepository.DeleteAsync(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å é¤å¤ä¸ªä½ä¸è®¡å表 |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | public async Task DeleteManyAsync(IEnumerable<Guid> ids) |
| | | { |
| | | foreach (var id in ids) |
| | | { |
| | | await DeleteAsync(id); |
| | | } |
| | | } |
| | | |
| | | public async Task DeleteManyAsync(IEnumerable<Guid> ids) |
| | | { |
| | | foreach (var id in ids) |
| | | { |
| | | await DeleteAsync(id); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è°æ´æåºä½ä¸è®¡å表 |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <param name="sort"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task AdjustSortAsync(Guid id, int sort) |
| | | { |
| | | var list = await workPlanRepository.GetListAsync(null, nameof(WorkPlan.Sort)); |
| | | if (list != null && list.Any()) |
| | | { |
| | | var initSort = 1; |
| | | list.ForEach(x => x.AdjustSort(initSort++)); |
| | | var entity = list.FirstOrDefault(x => x.Id == id); |
| | | if (entity != null) |
| | | { |
| | | if (sort == 1) |
| | | { |
| | | list.Where(x => x.Id != id).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | } |
| | | else if (entity.Sort > sort) |
| | | { |
| | | list.Where(x => x.Id != id && x.Sort >= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | list.Where(x => x.Id != id && x.Sort < sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1)); |
| | | } |
| | | else if (entity.Sort < sort) |
| | | { |
| | | list.Where(x => x.Id != id && x.Sort > sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | list.Where(x => x.Id != id && x.Sort <= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1)); |
| | | } |
| | | |
| | | entity.AdjustSort(sort); |
| | | } |
| | | } |
| | | |
| | | await workPlanRepository.UpdateManyAsync(list); |
| | | } |
| | | |
| | | public virtual async Task AdjustSortAsync(Guid id, int sort) |
| | | { |
| | | var list = await workPlanRepository.GetListAsync(null, nameof(WorkPlan.Sort)); |
| | | if (list != null && list.Any()) |
| | | { |
| | | var initSort = 1; |
| | | list.ForEach(x => x.AdjustSort(initSort++)); |
| | | var entity = list.FirstOrDefault(x => x.Id == id); |
| | | if (entity != null) |
| | | { |
| | | if (sort == 1) |
| | | { |
| | | list.Where(x => x.Id != id).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | } |
| | | else if (entity.Sort > sort) |
| | | { |
| | | list.Where(x => x.Id != id && x.Sort >= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | list.Where(x => x.Id != id && x.Sort < sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1)); |
| | | } |
| | | else if (entity.Sort < sort) |
| | | { |
| | | list.Where(x => x.Id != id && x.Sort > sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | list.Where(x => x.Id != id && x.Sort <= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1)); |
| | | } |
| | | |
| | | entity.AdjustSort(sort); |
| | | } |
| | | } |
| | | |
| | | await workPlanRepository.UpdateManyAsync(list); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导å
¥ä½ä¸è®¡å表 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public async Task ImportAsync(WorkPlansImportModel input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | var workPlanCreateDtos = new List<(int RowIndex, WorkPlanCreateDto Item)>(); |
| | | var workPlanUpdateDtos = new List<(int RowIndex, Guid Id, WorkPlanUpdateDto Item)>(); |
| | | var importItems = input.WorkPlans; |
| | | |
| | | if (importItems != null && importItems.Any()) |
| | | { |
| | | public async Task ImportAsync(WorkPlansImportModel input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | var workPlanCreateDtos = new List<(int RowIndex, WorkPlanCreateDto Item)>(); |
| | | var workPlanUpdateDtos = new List<(int RowIndex, Guid Id, WorkPlanUpdateDto Item)>(); |
| | | var importItems = input.WorkPlans; |
| | | |
| | | if (importItems != null && importItems.Any()) |
| | | { |
| | | #region 导å
¥æ ¡éª |
| | | |
| | | |
| | | // 夿åç§°æ¯å¦éå¤ï¼å¹¶è¾åºç¬¬å è¡éå¤ |
| | | var duplicateWorkPlans = importItems.GroupBy(x => x.TaskCode).Where(x => x.Count() > 1).ToList(); |
| | | if (duplicateWorkPlans?.Any() == true) |
| | | { |
| | | var duplicateWorkPlanMsgs = duplicateWorkPlans.Select(x => $"第 {string.Join(",", x.Select(x => x.RowIndex))} è¡ï¼{x.Key} åç§°éå¤"); |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ {string.Join(",", duplicateWorkPlanMsgs)}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | foreach (var impItem in importItems) |
| | | { |
| | | if (impItem.TaskCode.IsNullOrWhiteSpace()) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if (impItem.TaskCode.IsNullOrWhiteSpace()) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{impItem.RowIndex}è¡ï¼WorkPlanåç§°ä¸è½ä¸ºç©º"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | |
| | | var oldWorkPlan = await workPlanRepository.FindByNameAsync(impItem.TaskCode); |
| | | if (oldWorkPlan != null) |
| | | { |
| | | var workPlanUpdateDto = new WorkPlanUpdateDto |
| | | { |
| | | var duplicateWorkPlans = importItems.GroupBy(x => x.TaskCode).Where(x => x.Count() > 1).ToList(); |
| | | if (duplicateWorkPlans?.Any() == true) |
| | | { |
| | | var duplicateWorkPlanMsgs = duplicateWorkPlans.Select(x => $"第 {string.Join(",", x.Select(x => x.RowIndex))} è¡ï¼{x.Key} åç§°éå¤"); |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ {string.Join(",", duplicateWorkPlanMsgs)}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | foreach (var impItem in importItems) |
| | | { |
| | | if (impItem.TaskCode.IsNullOrWhiteSpace()) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if (impItem.TaskCode.IsNullOrWhiteSpace()) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{impItem.RowIndex}è¡ï¼WorkPlanåç§°ä¸è½ä¸ºç©º"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | |
| | | var oldWorkPlan = await workPlanRepository.FindByNameAsync(impItem.TaskCode); |
| | | if (oldWorkPlan != null) |
| | | { |
| | | var workPlanUpdateDto = new WorkPlanUpdateDto |
| | | { |
| | | TaskCode = impItem.TaskCode, |
| | | OrgMaterialCode = impItem.OrgMaterialCode, |
| | | FactoryCode = impItem.FactoryCode, |
| | | ProductCode = impItem.ProductCode, |
| | | WorkstationCode = impItem.WorkstationCode, |
| | | EquipmentCode = impItem.EquipmentCode, |
| | | WorkpieceName = impItem.WorkpieceName, |
| | | ProcessName = impItem.ProcessName, |
| | | PipeFittingCode = impItem.PipeFittingCode, |
| | | PreSerialNumber = impItem.PreSerialNumber, |
| | | DataIdentifier = impItem.DataIdentifier, |
| | | PipeSpecCode = impItem.PipeSpecCode, |
| | | PipeSectionName = impItem.PipeSectionName, |
| | | OuterDiameter = impItem.OuterDiameter, |
| | | Bevel = impItem.Bevel, |
| | | Material = impItem.Material, |
| | | Length = impItem.Length, |
| | | DrillingPosition = impItem.DrillingPosition, |
| | | Intersecting = impItem.Intersecting, |
| | | InterfaceRequirement = impItem.InterfaceRequirement, |
| | | HasMainSignature = impItem.HasMainSignature, |
| | | Quantity = impItem.Quantity, |
| | | MarkingContent = impItem.MarkingContent, |
| | | CuttingFile = impItem.CuttingFile, |
| | | BranchOuterDiameter = impItem.BranchOuterDiameter, |
| | | BranchWallThickness = impItem.BranchWallThickness, |
| | | BranchMaterial = impItem.BranchMaterial, |
| | | BranchPortRadius = impItem.BranchPortRadius, |
| | | BranchPortAngle = impItem.BranchPortAngle, |
| | | BranchPortRequirement = impItem.BranchPortRequirement, |
| | | IntersectingLineType = impItem.IntersectingLineType, |
| | | IntersectingLineCategory = impItem.IntersectingLineCategory, |
| | | FinishedProductScale = impItem.FinishedProductScale, |
| | | FlangeThickness = impItem.FlangeThickness, |
| | | FlangeInnerDiameter = impItem.FlangeInnerDiameter, |
| | | WeldingHeatInput = impItem.WeldingHeatInput, |
| | | PipeAllowableStress = impItem.PipeAllowableStress, |
| | | PipeDiameter = impItem.PipeDiameter, |
| | | PipeWallThickness = impItem.PipeWallThickness, |
| | | VRData = impItem.VRData, |
| | | ProcessRouteNumber = impItem.ProcessRouteNumber, |
| | | PlannedStartTime = impItem.PlannedStartTime, |
| | | PlannedEndTime = impItem.PlannedEndTime, |
| | | TimeInfo = impItem.TimeInfo, |
| | | RedundantField1 = impItem.RedundantField1, |
| | | RedundantField2 = impItem.RedundantField2, |
| | | RedundantField3 = impItem.RedundantField3, |
| | | Remark = impItem.Remark, |
| | | IsDisabled = impItem.IsDisabled, |
| | | |
| | | }; |
| | | |
| | | workPlanUpdateDtos.Add((impItem.RowIndex, oldWorkPlan.Id, workPlanUpdateDto)); |
| | | } |
| | | else |
| | | { |
| | | var workPlanCreateDto = new WorkPlanCreateDto |
| | | { |
| | | OrgMaterialCode = impItem.OrgMaterialCode, |
| | | FactoryCode = impItem.FactoryCode, |
| | | ProductCode = impItem.ProductCode, |
| | | WorkstationCode = impItem.WorkstationCode, |
| | | EquipmentCode = impItem.EquipmentCode, |
| | | WorkpieceName = impItem.WorkpieceName, |
| | | ProcessName = impItem.ProcessName, |
| | | PipeFittingCode = impItem.PipeFittingCode, |
| | | PreSerialNumber = impItem.PreSerialNumber, |
| | | DataIdentifier = impItem.DataIdentifier, |
| | | PipeSpecCode = impItem.PipeSpecCode, |
| | | PipeSectionName = impItem.PipeSectionName, |
| | | OuterDiameter = impItem.OuterDiameter, |
| | | Bevel = impItem.Bevel, |
| | | Material = impItem.Material, |
| | | Length = impItem.Length, |
| | | DrillingPosition = impItem.DrillingPosition, |
| | | Intersecting = impItem.Intersecting, |
| | | InterfaceRequirement = impItem.InterfaceRequirement, |
| | | HasMainSignature = impItem.HasMainSignature, |
| | | Quantity = impItem.Quantity, |
| | | MarkingContent = impItem.MarkingContent, |
| | | CuttingFile = impItem.CuttingFile, |
| | | BranchOuterDiameter = impItem.BranchOuterDiameter, |
| | | BranchWallThickness = impItem.BranchWallThickness, |
| | | BranchMaterial = impItem.BranchMaterial, |
| | | BranchPortRadius = impItem.BranchPortRadius, |
| | | BranchPortAngle = impItem.BranchPortAngle, |
| | | BranchPortRequirement = impItem.BranchPortRequirement, |
| | | IntersectingLineType = impItem.IntersectingLineType, |
| | | IntersectingLineCategory = impItem.IntersectingLineCategory, |
| | | FinishedProductScale = impItem.FinishedProductScale, |
| | | FlangeThickness = impItem.FlangeThickness, |
| | | FlangeInnerDiameter = impItem.FlangeInnerDiameter, |
| | | WeldingHeatInput = impItem.WeldingHeatInput, |
| | | PipeAllowableStress = impItem.PipeAllowableStress, |
| | | PipeDiameter = impItem.PipeDiameter, |
| | | PipeWallThickness = impItem.PipeWallThickness, |
| | | VRData = impItem.VRData, |
| | | ProcessRouteNumber = impItem.ProcessRouteNumber, |
| | | PlannedStartTime = impItem.PlannedStartTime, |
| | | PlannedEndTime = impItem.PlannedEndTime, |
| | | TimeInfo = impItem.TimeInfo, |
| | | RedundantField1 = impItem.RedundantField1, |
| | | RedundantField2 = impItem.RedundantField2, |
| | | RedundantField3 = impItem.RedundantField3, |
| | | Remark = impItem.Remark, |
| | | IsDisabled = impItem.IsDisabled, |
| | | |
| | | }; |
| | | |
| | | workPlanUpdateDtos.Add((impItem.RowIndex, oldWorkPlan.Id, workPlanUpdateDto)); |
| | | } |
| | | else |
| | | { |
| | | var workPlanCreateDto = new WorkPlanCreateDto |
| | | { |
| | | TaskCode = impItem.TaskCode, |
| | | OrgMaterialCode = impItem.OrgMaterialCode, |
| | | FactoryCode = impItem.FactoryCode, |
| | | ProductCode = impItem.ProductCode, |
| | | WorkstationCode = impItem.WorkstationCode, |
| | | EquipmentCode = impItem.EquipmentCode, |
| | | WorkpieceName = impItem.WorkpieceName, |
| | | ProcessName = impItem.ProcessName, |
| | | PipeFittingCode = impItem.PipeFittingCode, |
| | | PreSerialNumber = impItem.PreSerialNumber, |
| | | DataIdentifier = impItem.DataIdentifier, |
| | | PipeSpecCode = impItem.PipeSpecCode, |
| | | PipeSectionName = impItem.PipeSectionName, |
| | | OuterDiameter = impItem.OuterDiameter, |
| | | Bevel = impItem.Bevel, |
| | | Material = impItem.Material, |
| | | Length = impItem.Length, |
| | | DrillingPosition = impItem.DrillingPosition, |
| | | Intersecting = impItem.Intersecting, |
| | | InterfaceRequirement = impItem.InterfaceRequirement, |
| | | HasMainSignature = impItem.HasMainSignature, |
| | | Quantity = impItem.Quantity, |
| | | MarkingContent = impItem.MarkingContent, |
| | | CuttingFile = impItem.CuttingFile, |
| | | BranchOuterDiameter = impItem.BranchOuterDiameter, |
| | | BranchWallThickness = impItem.BranchWallThickness, |
| | | BranchMaterial = impItem.BranchMaterial, |
| | | BranchPortRadius = impItem.BranchPortRadius, |
| | | BranchPortAngle = impItem.BranchPortAngle, |
| | | BranchPortRequirement = impItem.BranchPortRequirement, |
| | | IntersectingLineType = impItem.IntersectingLineType, |
| | | IntersectingLineCategory = impItem.IntersectingLineCategory, |
| | | FinishedProductScale = impItem.FinishedProductScale, |
| | | FlangeThickness = impItem.FlangeThickness, |
| | | FlangeInnerDiameter = impItem.FlangeInnerDiameter, |
| | | WeldingHeatInput = impItem.WeldingHeatInput, |
| | | PipeAllowableStress = impItem.PipeAllowableStress, |
| | | PipeDiameter = impItem.PipeDiameter, |
| | | PipeWallThickness = impItem.PipeWallThickness, |
| | | VRData = impItem.VRData, |
| | | ProcessRouteNumber = impItem.ProcessRouteNumber, |
| | | PlannedStartTime = impItem.PlannedStartTime, |
| | | PlannedEndTime = impItem.PlannedEndTime, |
| | | TimeInfo = impItem.TimeInfo, |
| | | RedundantField1 = impItem.RedundantField1, |
| | | RedundantField2 = impItem.RedundantField2, |
| | | RedundantField3 = impItem.RedundantField3, |
| | | Remark = impItem.Remark, |
| | | IsDisabled = impItem.IsDisabled, |
| | | |
| | | }; |
| | | |
| | | workPlanCreateDtos.Add((impItem.RowIndex, workPlanCreateDto)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | OrgMaterialCode = impItem.OrgMaterialCode, |
| | | FactoryCode = impItem.FactoryCode, |
| | | ProductCode = impItem.ProductCode, |
| | | WorkstationCode = impItem.WorkstationCode, |
| | | EquipmentCode = impItem.EquipmentCode, |
| | | WorkpieceName = impItem.WorkpieceName, |
| | | ProcessName = impItem.ProcessName, |
| | | PipeFittingCode = impItem.PipeFittingCode, |
| | | PreSerialNumber = impItem.PreSerialNumber, |
| | | DataIdentifier = impItem.DataIdentifier, |
| | | PipeSpecCode = impItem.PipeSpecCode, |
| | | PipeSectionName = impItem.PipeSectionName, |
| | | OuterDiameter = impItem.OuterDiameter, |
| | | Bevel = impItem.Bevel, |
| | | Material = impItem.Material, |
| | | Length = impItem.Length, |
| | | DrillingPosition = impItem.DrillingPosition, |
| | | Intersecting = impItem.Intersecting, |
| | | InterfaceRequirement = impItem.InterfaceRequirement, |
| | | HasMainSignature = impItem.HasMainSignature, |
| | | Quantity = impItem.Quantity, |
| | | MarkingContent = impItem.MarkingContent, |
| | | CuttingFile = impItem.CuttingFile, |
| | | BranchOuterDiameter = impItem.BranchOuterDiameter, |
| | | BranchWallThickness = impItem.BranchWallThickness, |
| | | BranchMaterial = impItem.BranchMaterial, |
| | | BranchPortRadius = impItem.BranchPortRadius, |
| | | BranchPortAngle = impItem.BranchPortAngle, |
| | | BranchPortRequirement = impItem.BranchPortRequirement, |
| | | IntersectingLineType = impItem.IntersectingLineType, |
| | | IntersectingLineCategory = impItem.IntersectingLineCategory, |
| | | FinishedProductScale = impItem.FinishedProductScale, |
| | | FlangeThickness = impItem.FlangeThickness, |
| | | FlangeInnerDiameter = impItem.FlangeInnerDiameter, |
| | | WeldingHeatInput = impItem.WeldingHeatInput, |
| | | PipeAllowableStress = impItem.PipeAllowableStress, |
| | | PipeDiameter = impItem.PipeDiameter, |
| | | PipeWallThickness = impItem.PipeWallThickness, |
| | | VRData = impItem.VRData, |
| | | ProcessRouteNumber = impItem.ProcessRouteNumber, |
| | | PlannedStartTime = impItem.PlannedStartTime, |
| | | PlannedEndTime = impItem.PlannedEndTime, |
| | | TimeInfo = impItem.TimeInfo, |
| | | RedundantField1 = impItem.RedundantField1, |
| | | RedundantField2 = impItem.RedundantField2, |
| | | RedundantField3 = impItem.RedundantField3, |
| | | Remark = impItem.Remark, |
| | | IsDisabled = impItem.IsDisabled, |
| | | |
| | | }; |
| | | |
| | | workPlanCreateDtos.Add((impItem.RowIndex, workPlanCreateDto)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // æ°å¢ |
| | | foreach (var workPlanDto in workPlanCreateDtos) |
| | | { |
| | | try |
| | | { |
| | | await CreateAsync(workPlanDto.Item); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{workPlanDto.RowIndex}è¡ï¼{e.Message}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | } |
| | | |
| | | foreach (var workPlanDto in workPlanCreateDtos) |
| | | { |
| | | try |
| | | { |
| | | await CreateAsync(workPlanDto.Item); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{workPlanDto.RowIndex}è¡ï¼{e.Message}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | } |
| | | |
| | | // æ´æ° |
| | | foreach (var workPlanDto in workPlanUpdateDtos) |
| | | { |
| | | try |
| | | { |
| | | await UpdateAsync(workPlanDto.Id, workPlanDto.Item); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{workPlanDto.RowIndex}è¡ï¼{e.Message}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | } |
| | | } |
| | | |
| | | foreach (var workPlanDto in workPlanUpdateDtos) |
| | | { |
| | | try |
| | | { |
| | | await UpdateAsync(workPlanDto.Id, workPlanDto.Item); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{workPlanDto.RowIndex}è¡ï¼{e.Message}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导åºä½ä¸è®¡å表 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public async Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWorkPlanInput input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WorkPlan.Sort); |
| | | } |
| | | |
| | | public async Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWorkPlanInput input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WorkPlan.Sort); |
| | | } |
| | | |
| | | #region 卿æé æ¥è¯¢æ¡ä»¶ |
| | | |
| | | |
| | | //卿æé æ¥è¯¢æ¡ä»¶ |
| | | var whereConditions = DynamicGetQueryParams(input); |
| | | |
| | | #endregion |
| | | |
| | | |
| | | var list = await workPlanRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount, includeDetails: true); |
| | | var result = ObjectMapper.Map<List<WorkPlan>, List<WorkPlanDto>>(list); |
| | | |
| | | var sheets = new Dictionary<string, object> |
| | | { |
| | | ["é
ç½®"] = ExportHelper.ConvertListToExportData(result), |
| | | }; |
| | | |
| | | var fileName = result.Count > 1 ? "ä½ä¸è®¡å表å表" : result.Count == 1 ? result[0]?.TaskCode : "WorkPlan模ç"; |
| | | return (sheets, fileName); |
| | | } |
| | | |
| | | var whereConditions = DynamicGetQueryParams(input); |
| | | |
| | | #endregion |
| | | |
| | | |
| | | var list = await workPlanRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount, includeDetails: true); |
| | | var result = ObjectMapper.Map<List<WorkPlan>, List<WorkPlanDto>>(list); |
| | | |
| | | var sheets = new Dictionary<string, object> |
| | | { |
| | | ["é
ç½®"] = ExportHelper.ConvertListToExportData(result), |
| | | }; |
| | | |
| | | var fileName = result.Count > 1 ? "ä½ä¸è®¡å表å表" : result.Count == 1 ? result[0]?.TaskCode : "WorkPlan模ç"; |
| | | return (sheets, fileName); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¡éªä½ä¸è®¡å表ï¼å½æ°å»ºææ´æ°æ¶ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | protected Task CheckCreateOrUpdateDtoAsync(WorkPlanCreateOrUpdateDtoBase input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | Check.NotNullOrWhiteSpace(input.TaskCode, "ä»»å¡ç¼ç ", 64); |
| | | protected Task CheckCreateOrUpdateDtoAsync(WorkPlanCreateOrUpdateDtoBase input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | Check.NotNullOrWhiteSpace(input.TaskCode, "ä»»å¡ç¼ç ", 64); |
| | | Check.NotNullOrWhiteSpace(input.OrgMaterialCode, "åæç¼å·", 64); |
| | | Check.NotNull(input.HasMainSignature, "æ¯å¦æä¸»ç¾"); |
| | | Check.NotNull(input.Quantity, "å
æ¬æ°é"); |
| | | |
| | | return Task.CompletedTask; |
| | | } |
| | | } |
| | | |
| | | return Task.CompletedTask; |
| | | } |
| | | } |
| | |
| | | * into multiple profile classes for a better organization. */ |
| | | CreateMap<WorkPlan, WorkPlanDto>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | CreateMap<WorkPlanCreateDto, WorkPlan>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | CreateMap<GetWorkPlanInput, WorkPlan>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | CreateMap<GetWorkPlanInput, WorkPlan>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | CreateMap<WorkPlanInput, WorkPlanCreateDto>(MemberList.None); |
| | | } |
| | | } |
| | |
| | | .IncludeDetails(includeDetails) |
| | | .WhereIf(whereConditions != null, whereConditions.data) |
| | | .Where(x => !x.IsDeleted) |
| | | .OrderBy(sorting.IsNullOrEmpty() ? nameof(WorkPlan.Sort) : sorting) |
| | | .OrderByDescending(x=>x.CreationTime) |
| | | .PageBy(skipCount, maxResultCount) |
| | | .ToListAsync(GetCancellationToken(cancellationToken)); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Extensions.Abp.AspNetCore.Mvc.Filters; |
| | | using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan; |
| | | using CMS.Plugin.PipeLineLems.Application.Contracts.Services; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using System.Reflection; |
| | | |
| | | namespace CMS.Plugin.PipeLineLems.Controller |
| | | { |
| | | /// <summary> |
| | | /// ä½ä¸è®¡åæå¡ |
| | | /// </summary> |
| | | [ApiController] |
| | | [TypeFilter(typeof(CMSLanguageFilter))] |
| | | [TypeFilter(typeof(CMSUowActionFilter))] |
| | | [TypeFilter(typeof(CMSAuditActionFilter))] |
| | | [TypeFilter(typeof(CMSExceptionFilter))] |
| | | [Route("api/v{version:apiVersion}/PipeLineLems/[controller]")] |
| | | public class WorkPlanPublicController : ControllerBase |
| | | { |
| | | |
| | | private readonly IMesAppService _mesAppService; |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="TestEntityNameController"/> class. |
| | | /// </summary> |
| | | /// <param name="testentitynameAppService">The testentityname application service.</param> |
| | | public WorkPlanPublicController(IMesAppService mesAppService) |
| | | { |
| | | _mesAppService = mesAppService; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åç产计å. |
| | | /// </summary> |
| | | /// <param name="input">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public virtual async Task<MesOrderResponse> GetWorkPlanAsync([FromBody] List<WorkPlanInput> input) |
| | | { |
| | | return await _mesAppService.CreateAsync(input); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project version="4"> |
| | | <component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" /> |
| | | </project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project version="4"> |
| | | <component name="UserContentModel"> |
| | | <attachedFolders /> |
| | | <explicitIncludes /> |
| | | <explicitExcludes /> |
| | | </component> |
| | | </project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project version="4"> |
| | | <component name="VcsDirectoryMappings"> |
| | | <mapping directory="$PROJECT_DIR$/../../../../.." vcs="Git" /> |
| | | </component> |
| | | </project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | |  |
| | | Microsoft Visual Studio Solution File, Format Version 12.00 |
| | | # Visual Studio Version 17 |
| | | VisualStudioVersion = 17.4.33110.190 |
| | | MinimumVisualStudioVersion = 10.0.40219.1 |
| | | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "è§£å³æ¹æ¡é¡¹", "è§£å³æ¹æ¡é¡¹", "{28C418E6-AF1D-4B74-ACDF-7B81FA4C256E}" |
| | | ProjectSection(SolutionItems) = preProject |
| | | .editorconfig = .editorconfig |
| | | .gitignore = .gitignore |
| | | common.props = common.props |
| | | common.test.props = common.test.props |
| | | configureawait.props = configureawait.props |
| | | delete-bin-obj-folders.bat = delete-bin-obj-folders.bat |
| | | Directory.Build.props = Directory.Build.props |
| | | NuGet.config = NuGet.config |
| | | package.reference.props = package.reference.props |
| | | publish.ps1 = publish.ps1 |
| | | README.md = README.md |
| | | stylecop.json = stylecop.json |
| | | EndProjectSection |
| | | EndProject |
| | | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{19F68F40-2A05-48EB-86F0-56928B3CCE9C}" |
| | | EndProject |
| | | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{5632E2B3-5592-4C6A-9493-768E5B04804D}" |
| | | EndProject |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CMS.Plugin.UtilityApi", "src\CMS.Plugin.HIAWms\CMS.Plugin.UtilityApi.csproj", "{9926DE4C-376D-487E-9C64-494913D94379}" |
| | | EndProject |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CMS.Plugin.HIAWms.EntityFrameworkCore", "src\CMS.Plugin.HIAWms.EntityFrameworkCore\CMS.Plugin.HIAWms.EntityFrameworkCore.csproj", "{0022A80F-6D52-4B58-B2B3-F029DB4AEC0A}" |
| | | EndProject |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CMS.Plugin.HIAWms.Domain", "src\CMS.Plugin.HIAWms.Domain\CMS.Plugin.HIAWms.Domain.csproj", "{8B2BED13-2B0E-49B5-8B0A-F272D27B2F37}" |
| | | EndProject |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CMS.Plugin.HIAWms.Domain.Shared", "src\CMS.Plugin.HIAWms.Domain.Shared\CMS.Plugin.HIAWms.Domain.Shared.csproj", "{F405C633-8100-49B8-A270-D5340A165742}" |
| | | EndProject |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CMS.Plugin.HIAWms.Application.Contracts", "src\CMS.Plugin.HIAWms.Application.Contracts\CMS.Plugin.HIAWms.Application.Contracts.csproj", "{D65BB57E-618A-468C-AA28-BD8C9EBF0AF2}" |
| | | EndProject |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CMS.Plugin.HIAWms.Application", "src\CMS.Plugin.HIAWms.Application\CMS.Plugin.HIAWms.Application.csproj", "{02CB86F3-E614-4193-8B7F-C2FB665C8A5A}" |
| | | EndProject |
| | | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{A68B3B6B-DDE8-431E-90F3-A9FEE1D14A53}" |
| | | ProjectSection(SolutionItems) = preProject |
| | | doc\Domain-Drive-Design.md = doc\Domain-Drive-Design.md |
| | | EndProjectSection |
| | | EndProject |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CMS.Plugin.HIAWms.TestBase", "test\CMS.Plugin.HIAWms.TestBase\CMS.Plugin.HIAWms.TestBase.csproj", "{33999EE8-73A1-4CF2-BDFD-CE353B05A727}" |
| | | EndProject |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CMS.Plugin.HIAWms.EntityFrameworkCore.Tests", "test\CMS.Plugin.HIAWms.EntityFrameworkCore.Tests\CMS.Plugin.HIAWms.EntityFrameworkCore.Tests.csproj", "{C6AFC427-C51D-4BD2-BBA6-8841D3495077}" |
| | | EndProject |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CMS.Plugin.HIAWms.Domain.Tests", "test\CMS.Plugin.HIAWms.Domain.Tests\CMS.Plugin.HIAWms.Domain.Tests.csproj", "{74E86B03-F185-47B2-A4C3-04C1CEC84F14}" |
| | | EndProject |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CMS.Plugin.HIAWms.Application.Tests", "test\CMS.Plugin.HIAWms.Application.Tests\CMS.Plugin.HIAWms.Application.Tests.csproj", "{731DE36F-27F5-48B8-865D-DA43C8910010}" |
| | | EndProject |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CMS.Plugin.HIAWms.Abstractions", "src\CMS.Plugin.HIAWms.Abstractions\CMS.Plugin.HIAWms.Abstractions.csproj", "{87D957E4-FE12-4432-9B7B-827A98DD41D1}" |
| | | EndProject |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CMS.Plugin.HIAWms.MySQL", "src\CMS.Plugin.HIAWms.MySQL\CMS.Plugin.HIAWms.MySQL.csproj", "{2F71D6DF-F19A-410C-BD79-F2F871E63902}" |
| | | EndProject |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CMS.Plugin.HIAWms.PostgreSql", "src\CMS.Plugin.HIAWms.PostgreSql\CMS.Plugin.HIAWms.PostgreSql.csproj", "{698D9FFA-080C-4F22-9FBF-B9509B28A954}" |
| | | EndProject |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CMS.Plugin.HIAWms.SqlServer", "src\CMS.Plugin.HIAWms.SqlServer\CMS.Plugin.HIAWms.SqlServer.csproj", "{521D17FF-BD3A-43B4-9BEE-183FDE3522F4}" |
| | | EndProject |
| | | Global |
| | | GlobalSection(SolutionConfigurationPlatforms) = preSolution |
| | | Debug|Any CPU = Debug|Any CPU |
| | | Release|Any CPU = Release|Any CPU |
| | | EndGlobalSection |
| | | GlobalSection(ProjectConfigurationPlatforms) = postSolution |
| | | {9926DE4C-376D-487E-9C64-494913D94379}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {9926DE4C-376D-487E-9C64-494913D94379}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {9926DE4C-376D-487E-9C64-494913D94379}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {9926DE4C-376D-487E-9C64-494913D94379}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {0022A80F-6D52-4B58-B2B3-F029DB4AEC0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {0022A80F-6D52-4B58-B2B3-F029DB4AEC0A}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {0022A80F-6D52-4B58-B2B3-F029DB4AEC0A}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {0022A80F-6D52-4B58-B2B3-F029DB4AEC0A}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {8B2BED13-2B0E-49B5-8B0A-F272D27B2F37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {8B2BED13-2B0E-49B5-8B0A-F272D27B2F37}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {8B2BED13-2B0E-49B5-8B0A-F272D27B2F37}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {8B2BED13-2B0E-49B5-8B0A-F272D27B2F37}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {F405C633-8100-49B8-A270-D5340A165742}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {F405C633-8100-49B8-A270-D5340A165742}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {F405C633-8100-49B8-A270-D5340A165742}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {F405C633-8100-49B8-A270-D5340A165742}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {D65BB57E-618A-468C-AA28-BD8C9EBF0AF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {D65BB57E-618A-468C-AA28-BD8C9EBF0AF2}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {D65BB57E-618A-468C-AA28-BD8C9EBF0AF2}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {D65BB57E-618A-468C-AA28-BD8C9EBF0AF2}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {02CB86F3-E614-4193-8B7F-C2FB665C8A5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {02CB86F3-E614-4193-8B7F-C2FB665C8A5A}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {02CB86F3-E614-4193-8B7F-C2FB665C8A5A}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {02CB86F3-E614-4193-8B7F-C2FB665C8A5A}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {33999EE8-73A1-4CF2-BDFD-CE353B05A727}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {33999EE8-73A1-4CF2-BDFD-CE353B05A727}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {33999EE8-73A1-4CF2-BDFD-CE353B05A727}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {33999EE8-73A1-4CF2-BDFD-CE353B05A727}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {C6AFC427-C51D-4BD2-BBA6-8841D3495077}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {C6AFC427-C51D-4BD2-BBA6-8841D3495077}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {C6AFC427-C51D-4BD2-BBA6-8841D3495077}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {C6AFC427-C51D-4BD2-BBA6-8841D3495077}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {74E86B03-F185-47B2-A4C3-04C1CEC84F14}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {74E86B03-F185-47B2-A4C3-04C1CEC84F14}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {74E86B03-F185-47B2-A4C3-04C1CEC84F14}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {74E86B03-F185-47B2-A4C3-04C1CEC84F14}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {731DE36F-27F5-48B8-865D-DA43C8910010}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {731DE36F-27F5-48B8-865D-DA43C8910010}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {731DE36F-27F5-48B8-865D-DA43C8910010}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {731DE36F-27F5-48B8-865D-DA43C8910010}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {87D957E4-FE12-4432-9B7B-827A98DD41D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {87D957E4-FE12-4432-9B7B-827A98DD41D1}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {87D957E4-FE12-4432-9B7B-827A98DD41D1}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {87D957E4-FE12-4432-9B7B-827A98DD41D1}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {2F71D6DF-F19A-410C-BD79-F2F871E63902}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {2F71D6DF-F19A-410C-BD79-F2F871E63902}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {2F71D6DF-F19A-410C-BD79-F2F871E63902}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {2F71D6DF-F19A-410C-BD79-F2F871E63902}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {698D9FFA-080C-4F22-9FBF-B9509B28A954}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {698D9FFA-080C-4F22-9FBF-B9509B28A954}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {698D9FFA-080C-4F22-9FBF-B9509B28A954}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {698D9FFA-080C-4F22-9FBF-B9509B28A954}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {521D17FF-BD3A-43B4-9BEE-183FDE3522F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {521D17FF-BD3A-43B4-9BEE-183FDE3522F4}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {521D17FF-BD3A-43B4-9BEE-183FDE3522F4}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {521D17FF-BD3A-43B4-9BEE-183FDE3522F4}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | EndGlobalSection |
| | | GlobalSection(SolutionProperties) = preSolution |
| | | HideSolutionNode = FALSE |
| | | EndGlobalSection |
| | | GlobalSection(NestedProjects) = preSolution |
| | | {9926DE4C-376D-487E-9C64-494913D94379} = {19F68F40-2A05-48EB-86F0-56928B3CCE9C} |
| | | {0022A80F-6D52-4B58-B2B3-F029DB4AEC0A} = {19F68F40-2A05-48EB-86F0-56928B3CCE9C} |
| | | {8B2BED13-2B0E-49B5-8B0A-F272D27B2F37} = {19F68F40-2A05-48EB-86F0-56928B3CCE9C} |
| | | {F405C633-8100-49B8-A270-D5340A165742} = {19F68F40-2A05-48EB-86F0-56928B3CCE9C} |
| | | {D65BB57E-618A-468C-AA28-BD8C9EBF0AF2} = {19F68F40-2A05-48EB-86F0-56928B3CCE9C} |
| | | {02CB86F3-E614-4193-8B7F-C2FB665C8A5A} = {19F68F40-2A05-48EB-86F0-56928B3CCE9C} |
| | | {33999EE8-73A1-4CF2-BDFD-CE353B05A727} = {5632E2B3-5592-4C6A-9493-768E5B04804D} |
| | | {C6AFC427-C51D-4BD2-BBA6-8841D3495077} = {5632E2B3-5592-4C6A-9493-768E5B04804D} |
| | | {74E86B03-F185-47B2-A4C3-04C1CEC84F14} = {5632E2B3-5592-4C6A-9493-768E5B04804D} |
| | | {731DE36F-27F5-48B8-865D-DA43C8910010} = {5632E2B3-5592-4C6A-9493-768E5B04804D} |
| | | {87D957E4-FE12-4432-9B7B-827A98DD41D1} = {19F68F40-2A05-48EB-86F0-56928B3CCE9C} |
| | | {2F71D6DF-F19A-410C-BD79-F2F871E63902} = {19F68F40-2A05-48EB-86F0-56928B3CCE9C} |
| | | {698D9FFA-080C-4F22-9FBF-B9509B28A954} = {19F68F40-2A05-48EB-86F0-56928B3CCE9C} |
| | | {521D17FF-BD3A-43B4-9BEE-183FDE3522F4} = {19F68F40-2A05-48EB-86F0-56928B3CCE9C} |
| | | EndGlobalSection |
| | | GlobalSection(ExtensibilityGlobals) = postSolution |
| | | SolutionGuid = {220123E7-A888-4DE7-8F9A-8FE271543889} |
| | | EndGlobalSection |
| | | EndGlobal |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Project> |
| | | <!-- C# compiler options (https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/) --> |
| | | <PropertyGroup> |
| | | <!-- Nullable (https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/language#nullable) --> |
| | | <Nullable>disable</Nullable> |
| | | <Deterministic>true</Deterministic> |
| | | <!-- report errors and warnings (https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/errors-warnings) --> |
| | | <WarningLevel>5</WarningLevel> |
| | | </PropertyGroup> |
| | | |
| | | <!-- Generated file properties (https://docs.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#generated-file-properties) --> |
| | | <PropertyGroup> |
| | | <ImplicitUsings>enable</ImplicitUsings> |
| | | </PropertyGroup> |
| | | |
| | | <!-- Code analysis properties (https://docs.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#code-analysis-properties) --> |
| | | <PropertyGroup> |
| | | <EnableNETAnalyzers>true</EnableNETAnalyzers> |
| | | <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild> |
| | | <AnalysisMode>All</AnalysisMode> |
| | | <AnalysisLevel>latest</AnalysisLevel> |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <AdditionalFiles Include="$([MSBuild]::GetPathOfFileAbove('stylecop.json'))" Visible="false" /> |
| | | </ItemGroup> |
| | | |
| | | <!-- Dependencies --> |
| | | <ItemGroup Condition="$(MSBuildProjectExtension) == '.csproj'" > |
| | | <PackageReference Include="SonarAnalyzer.CSharp" Version="8.32.0.39516" PrivateAssets="all" /> |
| | | <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" /> |
| | | <PackageReference Include="Roslynator.Analyzers" Version="3.3.0" PrivateAssets="all" /> |
| | | </ItemGroup> |
| | | |
| | | <PropertyGroup Condition=" '$(Configuration)' == 'Debug'"> |
| | | <DefineConstants>$(DefineConstants);DEBUG;TRACE</DefineConstants> |
| | | <Optimize>false</Optimize> |
| | | <NullableReferenceTypes>true</NullableReferenceTypes> |
| | | <!-- report errors and warnings (https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/errors-warnings) --> |
| | | <TreatWarningsAsErrors>false</TreatWarningsAsErrors> |
| | | <CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors> |
| | | </PropertyGroup> |
| | | |
| | | <PropertyGroup Condition="'$(Configuration)' == 'Release'"> |
| | | <DefineConstants>$(DefineConstants);RELEASE</DefineConstants> |
| | | <Optimize>true</Optimize> |
| | | <!-- report errors and warnings (https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/errors-warnings) --> |
| | | <TreatWarningsAsErrors>false</TreatWarningsAsErrors> |
| | | <CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors> |
| | | </PropertyGroup> |
| | | |
| | | <!-- Import reference package --> |
| | | <Import Project="package.reference.props" /> |
| | | |
| | | <!-- Test Project coverlet collector --> |
| | | <PropertyGroup> |
| | | <IsTestProject Condition="$(MSBuildProjectFullPath.Contains('test')) and ($(MSBuildProjectName.EndsWith('.Tests')) or $(MSBuildProjectName.EndsWith('.TestBase')))">true</IsTestProject> |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Condition="'$(IsTestProject)' == 'true'" Include="coverlet.collector" Version="3.1.0"> |
| | | <PrivateAssets>all</PrivateAssets> |
| | | <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> |
| | | </PackageReference> |
| | | </ItemGroup> |
| | | </Project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <configuration> |
| | | <packageSources> |
| | | <clear /> |
| | | <add key="nexus" value="https://nexus.sycdev.com/repository/nuget-group/index.json" /> |
| | | <add key="nuget" value="https://api.nuget.org/v3/index.json" /> |
| | | </packageSources> |
| | | </configuration> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Project> |
| | | <PropertyGroup> |
| | | <Company>SYC</Company> |
| | | <Copyright>Copyright © SYC. All rights reserved.</Copyright> |
| | | <NoWarn>$(NoWarn);CS1591</NoWarn> |
| | | <VersionMajor>1</VersionMajor> |
| | | <VersionMinor>0</VersionMinor> |
| | | <VersionPatch>0</VersionPatch> |
| | | <VersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix> |
| | | <!--<VersionSuffix>-preview1</VersionSuffix>--> |
| | | <Version>$(VersionPrefix)$(VersionSuffix)</Version> |
| | | <AssemblyVersion>$(VersionMajor).0.0.0</AssemblyVersion> |
| | | <LangVersion>latest</LangVersion> |
| | | <GenerateDocumentationFile>true</GenerateDocumentationFile> |
| | | <!-- Include symbol files (*.pdb) in the built .nupkg --> |
| | | <AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder> |
| | | </PropertyGroup> |
| | | </Project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Project> |
| | | <PropertyGroup> |
| | | <LangVersion>latest</LangVersion> |
| | | <NoWarn>$(NoWarn);CS1591</NoWarn> |
| | | <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles> |
| | | <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
| | | <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
| | | <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
| | | </PropertyGroup> |
| | | </Project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Project> |
| | | <ItemGroup> |
| | | <PackageReference Include="ConfigureAwait.Fody" Version="3.3.1" PrivateAssets="All" /> |
| | | <PackageReference Include="Fody" Version="6.6.1"> |
| | | <PrivateAssets>All</PrivateAssets> |
| | | <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> |
| | | </PackageReference> |
| | | </ItemGroup> |
| | | </Project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | @ECHO off |
| | | cls |
| | | |
| | | ECHO Deleting all BIN and OBJ folders... |
| | | ECHO. |
| | | |
| | | FOR /d /r . %%d in (bin,obj) DO ( |
| | | IF EXIST "%%d" ( |
| | | ECHO %%d | FIND /I "\node_modules\" > Nul && ( |
| | | ECHO.Skipping: %%d |
| | | ) || ( |
| | | ECHO.Deleting: %%d |
| | | rd /s/q "%%d" |
| | | ) |
| | | ) |
| | | ) |
| | | |
| | | ECHO. |
| | | ECHO.BIN and OBJ folders have been successfully deleted. Press any key to exit. |
| | | pause > nul |
¶Ô±ÈÐÂÎļþ |
| | |
| | | # é¢å模å设计 |
| | | |
| | | ## ä¸ãæ¯è¯ä¸å®ä¹ |
| | | |
| | | | è±æç¼©å | è±æå
¨ç§° | ä¸æç¿»è¯ | |
| | | | -------- | -------- | -------- | |
| | | | | | | |
| | | |
| | | ## äºãä¸å¡æµç¨ |
| | | |
| | | 䏿¶å |
| | | |
| | | ## ä¸ãæ°æ®ç±»å |
| | | |
| | | æ°æ®ç±»åéç¨çæ¯C#çæ°æ®ç±»åï¼ä¸»è¦æä¸é¢çä¸äºç±»åï¼ |
| | | |
| | | | æ°æ®ç±»å | å«ä¹ | æå°å¼/æå¤§å¼/精度 | å ç¨ç©ºé´ | 说æ | |
| | | | -------------- | -------------- | ------------------------------------------------------------ | ------------- | -------------------------------- | |
| | | | bool | å¸å°å¼ | false/true | 1åè | | |
| | | | sbyte | è¶
çæ´å | -128127 | 1åè | | |
| | | | byte | æ 符å·è¶
çæ´å | 0255 | 1åè | | |
| | | | short | çæ´å | -32,76832,767 | 2åè | | |
| | | | ushort | æ 符å·çæ´å | 065,535 | 2åè | | |
| | | | int | æ´å | -2,147,483,6482,147,483,647 | 4åè | | |
| | | | uint | æ ç¬¦å·æ´å | 04,294,967,295 | 4åè | | |
| | | | long | é¿æ´å | -9,223,372,036,854,775,8089,223,372,036,854,775,807 | 8åè | | |
| | | | ulong | æ 符å·é¿æ´å | 0/18,446,744,073,709,551,615 | 8åè | | |
| | | | float | åç²¾åº¦æµ®ç¹æ° | -3.40282347E+38/F3.40282347E+38F/6~7ä½æææ°å | 4åè | | |
| | | | double | åç²¾åº¦æµ®ç¹æ° | -1.7976931348623157E+308/1.7976931348623157E+308/15~16ä½æææ°å | 8åè | | |
| | | | DateTime | æ¥ææ¶é´ | 0000-01-01 00:00:00.0000000/9999-12-31 23:59:59.9999999/100ns | 8åè | ç»ä¸ä½¿ç¨UTCæ¶é´è¿è¡ä¼ è¾ååå¨ã | |
| | | | TimeSpan | æ¶é´è·¨åº¦ | -10,675,199.02:48:05.4775808/10,675,199.02:48:05.4775807100ns | 8åè | | |
| | | | string | å符串 | | nåè | ç»ä¸ä½¿ç¨UTF8ç¼ç è¿è¡ä¼ è¾ååå¨ã | |
| | | | Complex | 夿° | | 16åè | | |
| | | | IList<T> | å表 | [0]~[n-1] | n * sizeof(T) | | |
| | | | ICollection<T> | éå | | n * sizeof(T) | ä¸IList类似ï¼åªæ¯æ²¡æé¡ºåºå
³ç³»ã | |
| | | |
| | | ## åãå®ä½ï¼Entityï¼åèåæ ¹ï¼AggregateRootï¼ |
| | | |
| | | å®ä½æ¯æ¨¡åä¸éè¦åºå个ä½çå¯¹è±¡ï¼æ¥ææ è¯ãæ°æ®åè¡ä¸ºãå®ä½ææ è¯ï¼å
许ååï¼å¤æä¸¤ä¸ªå®ä½ç¸ççæ åæ¯æ è¯ç¸çãèåï¼Aggregateï¼è¡¨ç¤ºä¸ç»é¢å对象ï¼å
æ¬å®ä½åå¼å¯¹è±¡ï¼ï¼ç¨æ¥è¡¨è¿°ä¸ä¸ªå®æ´çé¢åæ¦å¿µãèæ¯ä¸ªèå齿ä¸ä¸ªæ ¹å®ä½ï¼è¿ä¸ªæ ¹å®ä½åå«åèåæ ¹ãèåæ ¹æ¯èåæè¡¨è¿°çé¢åæ¦å¿µç主ä½ï¼å¤é¨å¯¹è±¡éè¦è®¿é®èåå
çå®ä½æ¶ï¼åªè½éè¿èåæ ¹è¿è¡è®¿é®ï¼èä¸è½ç´æ¥è®¿é®ã |
| | | |
| | | ## äºãæä¸¾ |
| | | |
| | | |
| | | ## å
ãå¼å¯¹è±¡ï¼ValueObjectï¼ |
| | | |
| | | å¼å¯¹è±¡æ¯éè¿å±æ§æ¥è¯å«ç对象ï¼å®å°å¤ä¸ªç¸å
³å±æ§ç»å为ä¸ä¸ªæ¦å¿µæ´ä½ãå¼å¯¹è±¡æ²¡ææ è¯ï¼ä¸å
许ååï¼å¤æä¸¤ä¸ªå¼å¯¹è±¡ç¸ççæ åæ¯å¼å¯¹è±¡å
鍿æå±æ§å¼ç¸çã |
| | | |
| | | |
| | | ## å
ãé¢åæå¡ |
| | | |
| | | 䏿¶å |
| | | |
| | | ## ä¸ãé¢åäºä»¶ |
| | | |
| | | 䏿¶å |
| | | |
| | | ## å
«ãå
¶ä» |
| | | |
| | | 䏿¶å |
| | | |
| | | ## ä¹ãåèå¼ç¨ |
| | | |
| | | 䏿¶å |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Project> |
| | | <PropertyGroup> |
| | | <!-- All Microsoft packages --> |
| | | <MicrosoftPackageVersion>6.0.0</MicrosoftPackageVersion> |
| | | |
| | | <!-- All Abp packages --> |
| | | <ABPPackageVersion>6.0.0</ABPPackageVersion> |
| | | |
| | | <!-- All LMES packages --> |
| | | <LMESPackageVersion>2.3.*</LMESPackageVersion> |
| | | |
| | | <!-- Microsoft.NET.Test.Sdk https://www.nuget.org/packages/Microsoft.NET.Test.Sdk --> |
| | | <MicrosoftNETTestSdkPackageVersion>16.11.0</MicrosoftNETTestSdkPackageVersion> |
| | | |
| | | <!-- NSubstitute https://www.nuget.org/packages/NSubstitute --> |
| | | <NSubstitutePackageVersion>4.2.2</NSubstitutePackageVersion> |
| | | |
| | | <!-- Shouldly https://www.nuget.org/packages/Shouldly --> |
| | | <ShouldlyPackageVersion>4.0.3</ShouldlyPackageVersion> |
| | | |
| | | <!-- xunit https://www.nuget.org/packages/xUnit --> |
| | | <xUnitPackageVersion>2.4.1</xUnitPackageVersion> |
| | | |
| | | <!-- xunit.extensibility.execution https://www.nuget.org/packages/xunit.extensibility.execution --> |
| | | <xUnitExtensibilityExecutionPackageVersion>2.4.1</xUnitExtensibilityExecutionPackageVersion> |
| | | |
| | | <!-- xunit.runner.visualstudio https://www.nuget.org/packages/xunit.runner.visualstudio --> |
| | | <xUnitRunnerVisualstudioPackageVersion>2.4.3</xUnitRunnerVisualstudioPackageVersion> |
| | | </PropertyGroup> |
| | | </Project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | # publishFolder |
| | | $publishFolder= $args[0] |
| | | |
| | | # Paths |
| | | $rootFolder = (Get-Item -Path "./" -Verbose).FullName |
| | | if ([String]::IsNullOrEmpty($publishFolder)) { |
| | | $publishFolder = Join-Path $rootFolder "output/publish" |
| | | $hasPath = Test-Path($publishFolder) |
| | | if (-Not $hasPath) { |
| | | new-item -path $rootFolder -name "output/publish" -type directory |
| | | } |
| | | } |
| | | Write-Host ("Publish Output " + $publishFolder) |
| | | |
| | | # List of projects |
| | | $projects = ( |
| | | "src/CMS.Plugin.HIAWms" |
| | | ) |
| | | |
| | | # Rebuild solution |
| | | Set-Location $rootFolder |
| | | dotnet restore -s https://nexus.sycdev.com/repository/nuget-hosted/ --runtime win-x64 |
| | | # dotnet restore --configfile NuGet.config --runtime win-x64 |
| | | Write-Host ("Restore Completed ! ") |
| | | # Publish all projects |
| | | foreach($project in $projects) { |
| | | $projectFolder = Join-Path $rootFolder $project |
| | | $projectName = $project.Substring($project.LastIndexOf("/") + 1) |
| | | Set-Location $projectFolder |
| | | Write-Host ("Publish " + $projectName) |
| | | # & dotnet publish ($projectName + ".csproj ") --configuration Release --output (Join-Path $publishFolder ("/" + $projectName.ToLower())) --nologo --verbosity quiet --no-restore |
| | | & dotnet publish ($projectName + ".csproj ") --configuration Release --output (Join-Path $publishFolder ("/" + $projectName.ToLower())) --nologo --verbosity quiet --no-restore --runtime win-x64 |
| | | } |
| | | |
| | | Write-Host ("Publish Completed ! ") |
| | | |
| | | # Go back to the root folder |
| | | Set-Location $rootFolder |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | |
| | | <Import Project="../../common.props" /> |
| | | <Import Project="../../configureawait.props" /> |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | <EnableDynamicLoading>true</EnableDynamicLoading> |
| | | <ProduceReferenceAssembly>false</ProduceReferenceAssembly> |
| | | <GenerateDocumentationFile>true</GenerateDocumentationFile> |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="CMS.Plugin.FlowManagement.Abstractions" Version="$(LMESPackageVersion)" /> |
| | | <PackageReference Include="CMS.Plugin.BarcodeManagement.Abstractions" Version="$(LMESPackageVersion)" /> |
| | | <PackageReference Include="CMS.Plugin.FormulaManagement.Abstractions" Version="$(LMESPackageVersion)" /> |
| | | <PackageReference Include="CMS.Plugin.MaterialManagement.Abstractions" Version="$(LMESPackageVersion)" /> |
| | | <PackageReference Include="CMS.Plugin.ProductManagement.Abstractions" Version="$(LMESPackageVersion)" /> |
| | | <PackageReference Include="CMS.Plugin.ProductionManagement.Abstractions" Version="$(LMESPackageVersion)" /> |
| | | <PackageReference Include="CMS.Plugin.ProcessManagement.Abstractions" Version="$(LMESPackageVersion)" /> |
| | | <PackageReference Include="CMS.Plugin.ProductManagement.Abstractions" Version="$(LMESPackageVersion)" /> |
| | | <PackageReference Include="CMS.Plugin.QualityManagement.Abstractions" Version="$(LMESPackageVersion)" /> |
| | | <PackageReference Include="CMS.Plugin.OrderManagement.Abstractions" Version="$(LMESPackageVersion)" /> |
| | | <PackageReference Include="CMS.Plugin.TraceManagement.Abstractions" Version="$(LMESPackageVersion)" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Abstractions; |
| | | |
| | | /// <summary> |
| | | /// æµç¨ä¸å¡æ©å±æ¨¡å |
| | | /// </summary> |
| | | public class CMSPluginHIAWmsAbstractionsModule |
| | | { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Abstractions |
| | | { |
| | | /// <summary> |
| | | /// æ©å±æ¹æ³ |
| | | /// </summary> |
| | | public static class CMSPluginHIAWmsExtensions |
| | | { |
| | | /// <summary> |
| | | /// Tries the add setting management. |
| | | /// </summary> |
| | | /// <param name="services">The services.</param> |
| | | /// <param name="configureOptions">The configure options.</param> |
| | | /// <returns></returns> |
| | | public static IServiceCollection TryAddHIAWms(this IServiceCollection services, Action<CMSPluginHIAWmsOptions>? configureOptions = null) |
| | | { |
| | | if (configureOptions == null) |
| | | { |
| | | services.AddOptions().Configure<CMSPluginHIAWmsOptions>(options => {}); |
| | | } |
| | | else |
| | | { |
| | | services.AddOptions().PostConfigure(configureOptions); |
| | | } |
| | | |
| | | return services; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Abstractions |
| | | { |
| | | /// <summary> |
| | | /// åè½å®ä¹. |
| | | /// </summary> |
| | | public class CMSPluginHIAWmsFeatures |
| | | { |
| | | /// <summary> |
| | | /// The prefix |
| | | /// </summary> |
| | | private const string Prefix = "LMES"; |
| | | |
| | | /// <summary> |
| | | /// GroupName |
| | | /// </summary> |
| | | public const string GroupName = Prefix + ".HIAWms"; |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦å¼å¯ |
| | | /// </summary> |
| | | public const string Enable = GroupName + ".Enable"; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.MesSuite.Abstractions.Models; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Abstractions |
| | | { |
| | | public class CMSPluginHIAWmsOptions |
| | | { |
| | | public CMSPluginHIAWmsOptions() |
| | | { |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ©å±å±æ§ |
| | | /// </summary> |
| | | public List<ExtraProperty> ExtraProperties { get; set; } = new(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Abstractions |
| | | { |
| | | /// <summary> |
| | | /// CMSSettingNames |
| | | /// </summary> |
| | | public static class CMSPluginHIAWmsSettings |
| | | { |
| | | /// <summary> |
| | | /// The prefix |
| | | /// </summary> |
| | | private const string Prefix = "SCMS"; |
| | | |
| | | /// <summary> |
| | | /// The application settings prefix |
| | | /// </summary> |
| | | private const string AppSettingsPrefix = Prefix + ".AppSettings"; |
| | | |
| | | /// <summary> |
| | | /// ç»ä»¶ç¶æï¼0=å
³é,1=å¼å¯ |
| | | /// </summary> |
| | | public const string PluginState = AppSettingsPrefix + ".HIAWms.PluginState"; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
| | | <ConfigureAwait ContinueOnCapturedContext="false" /> |
| | | </Weavers> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.ComponentModel; |
| | | using System.Runtime.Serialization; |
| | | using CMS.Plugin.FlowManagement.Abstractions.Enums; |
| | | using CMS.Plugin.FlowManagement.Abstractions.FlowBusiness.Activitys; |
| | | using CMS.Plugin.MesSuite.Abstractions.Models; |
| | | using CMS.Plugin.OrderManagement.Abstractions.Models; |
| | | using CMS.Plugin.ProcessManagement.Abstractions.Models; |
| | | using CMS.Plugin.TraceManagement.Abstractions.Models.Traces; |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Microsoft.Extensions.Logging; |
| | | using SYC.Flow.Kernel; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Abstractions |
| | | { |
| | | /// <summary> |
| | | /// HIAWms ä¸å¡æ¥éª¤ |
| | | /// </summary> |
| | | [Design("HIAWms", "HIAWms ä¸å¡æ¥éª¤", Sort = 99), Category("å®å¶æ¥éª¤")] |
| | | [Serializable] |
| | | public class HIAWmsActivity : BusinessActivity |
| | | { |
| | | /// <summary> |
| | | /// é
ç½®å±æ§1 |
| | | /// </summary> |
| | | [Design("é
ç½®å±æ§1", "é
ç½®å±æ§1", Sort = 1), Category("é
置信æ¯")] |
| | | [DataMember] |
| | | public string MyProperty1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é
ç½®å±æ§2 |
| | | /// </summary> |
| | | [Design("é
ç½®å±æ§2", "é
ç½®å±æ§2", Sort = 2), Category("é
置信æ¯")] |
| | | [DataMember] |
| | | public int MyProperty2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æµç¨ä¸ä¸ææ è¯éå |
| | | /// </summary> |
| | | public override List<FlowItemKey> FlowItemKeys => GetFlowItemKeys(); |
| | | |
| | | /// <summary> |
| | | /// å·¥èºæµç¨å¤ç |
| | | /// </summary> |
| | | public override async Task ProcessAsync(ProcessflowEventArgs args) |
| | | { |
| | | // å·¥èºæ¨¡å |
| | | var processModel = Flow.DataItems.ApplicationData as ProcessModel; |
| | | |
| | | // 工忍¡å |
| | | var orderModel = Flow.DataItems[FlowItemCollection.OrderModel] as OrderModel; |
| | | |
| | | // äº§åæ¨¡å |
| | | var productModel = Flow.DataItems[FlowItemCollection.ProductModel] as AssociationProductModel; |
| | | |
| | | // 追溯模å |
| | | var traceModel = Flow.DataItems[FlowItemCollection.TraceModel] as TraceModel; |
| | | |
| | | Flow.Logger.LogInformation($"æ§è¡æµç¨ï¼å®ä¾={Flow.Instance.ProcID} -> {Flow.Name} -> {Name} HIAWmsActivity"); |
| | | |
| | | // ä¸å¡å¤ç |
| | | // ç±äºServiceProvideræ¥æºäºFlowç»ä»¶ï¼æ¤å¤éå
±äº«CMS.Plugin.HIAWms.Abstractionsç¨åºéï¼å¦åæ æ³è°ç¨ï¼ä¿®æ¹CMS.Plugin.HIAWms项ç®ä¸çCMSPluginModule.csæä»¶ï¼åæ¶æ³¨éGetSharedAssemblies()æ¹æ³ |
| | | var hiawmsFlowService = Flow.ServiceProvider.GetService<IHIAWmsFlowService>(); |
| | | if (hiawmsFlowService != null) |
| | | { |
| | | await hiawmsFlowService.ProcessAsync(args); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Gets the flow item keys. |
| | | /// </summary> |
| | | protected virtual List<FlowItemKey> GetFlowItemKeys() |
| | | { |
| | | var result = new List<FlowItemKey>(); |
| | | return result; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SYC.Flow.Kernel; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Abstractions |
| | | { |
| | | /// <summary> |
| | | /// HIAWms æµç¨æå¡ |
| | | /// </summary> |
| | | public interface IHIAWmsFlowService |
| | | { |
| | | /// <summary> |
| | | /// å·¥èºæµç¨å¤ç |
| | | /// </summary> |
| | | Task ProcessAsync(ProcessflowEventArgs args); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SYC.Flow.Kernel; |
| | | |
| | | [assembly: ProcessflowExtention(true)] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | |
| | | <Import Project="../../common.props" /> |
| | | <Import Project="../../configureawait.props" /> |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | <GenerateDocumentationFile>True</GenerateDocumentationFile> |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="$(ABPPackageVersion)" /> |
| | | <PackageReference Include="Volo.Abp.Authorization.Abstractions" Version="$(ABPPackageVersion)" /> |
| | | <PackageReference Include="MiniExcel" Version="1.31.3" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\CMS.Plugin.HIAWms.Domain.Shared\CMS.Plugin.HIAWms.Domain.Shared.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <Reference Include="CmsQueryExtensions"> |
| | | <HintPath>..\..\..\..\..\CommonDLL\CmsQueryExtensions.dll</HintPath> |
| | | </Reference> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared; |
| | | using Volo.Abp.Application; |
| | | using Volo.Abp.Modularity; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts; |
| | | |
| | | /// <summary> |
| | | /// æä»¶åºç¨æå¡å¥çº¦æ¨¡å |
| | | /// </summary> |
| | | [DependsOn( |
| | | typeof(CMSPluginDomainSharedModule), |
| | | typeof(AbpDddApplicationContractsModule) |
| | | )] |
| | | public class CMSPluginApplicationContractsModule : AbpModule |
| | | { |
| | | /// <inheritdoc /> |
| | | public override void PreConfigureServices(ServiceConfigurationContext context) |
| | | { |
| | | CMSPluginDtoExtensions.Configure(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Threading; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts; |
| | | |
| | | /// <summary> |
| | | /// Dtoæ©å± |
| | | /// </summary> |
| | | public static class CMSPluginDtoExtensions |
| | | { |
| | | private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); |
| | | |
| | | /// <summary> |
| | | /// Configures this instance. |
| | | /// </summary> |
| | | public static void Configure() |
| | | { |
| | | OneTimeRunner.Run(() => |
| | | { |
| | | /* You can add extension properties to DTOs |
| | | * defined in the depended modules. |
| | | * |
| | | * Example: |
| | | * |
| | | * ObjectExtensionManager.Instance |
| | | * .AddOrUpdateProperty<IdentityRoleDto, string>("Title"); |
| | | * |
| | | * See the documentation for more: |
| | | * https://docs.abp.io/en/abp/latest/Object-Extensions |
| | | */ |
| | | }); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsAreas; |
| | | |
| | | /// <summary> |
| | | /// WmsAreaæ¥è¯¢åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class GetWmsAreasInput : ExtensiblePagedAndSortedResultRequestDto |
| | | { |
| | | /// <summary> |
| | | /// Gets or sets the filter. |
| | | /// </summary> |
| | | public string Filter { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Gets or sets the name. |
| | | /// </summary> |
| | | public string Name { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºç¼å· |
| | | /// </summary> |
| | | public string AreaNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºåç§° |
| | | /// </summary> |
| | | public string AreaName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æè¿° |
| | | /// </summary> |
| | | public string? AreaDesc { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºç¶æ |
| | | /// </summary> |
| | | public AreaStatusEnum AreaStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºç±»å |
| | | /// </summary> |
| | | public AreaTypeEnum AreaType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºä»£ç |
| | | /// </summary> |
| | | public string? StoreCode { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsAreas; |
| | | |
| | | /// <summary> |
| | | /// WmsAreaåå»ºåæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsAreaCreateDto : WmsAreaCreateOrUpdateDtoBase |
| | | { |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public virtual int? Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public bool? IsDisabled { get; set; } = false; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsAreas; |
| | | |
| | | /// <summary> |
| | | /// WmsAreaåå»ºææ´æ°åºç±» |
| | | /// </summary> |
| | | public abstract class WmsAreaCreateOrUpdateDtoBase : ExtensibleEntityDto |
| | | { |
| | | /// <summary> |
| | | /// åºåºç¼å· |
| | | /// </summary> |
| | | public string AreaNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºåç§° |
| | | /// </summary> |
| | | public string AreaName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æè¿° |
| | | /// </summary> |
| | | public string? AreaDesc { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºç¶æ |
| | | /// </summary> |
| | | public AreaStatusEnum AreaStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºç±»å |
| | | /// </summary> |
| | | public AreaTypeEnum AreaType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºä»£ç |
| | | /// </summary> |
| | | public string? StoreCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºåç§° |
| | | /// </summary> |
| | | public string? StoreName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段1 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段2 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段3 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public virtual string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsAreaCreateOrUpdateDtoBase"/> class. |
| | | /// </summary> |
| | | public WmsAreaCreateOrUpdateDtoBase() : base(false) |
| | | { |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// åºåºå表 |
| | | /// </summary> |
| | | public class AreaForListOuptut |
| | | { |
| | | /// <summary> |
| | | /// åºåºç¼å· |
| | | /// </summary> |
| | | public string AreaNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºåç§° |
| | | /// </summary> |
| | | public string AreaName { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using Volo.Abp.Application.Dtos; |
| | | using Volo.Abp.Domain.Entities; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsAreas; |
| | | |
| | | /// <summary> |
| | | /// WmsAreaæ°æ®åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsAreaDto : ExtensibleEntityDto<Guid>, IHasConcurrencyStamp |
| | | { |
| | | /// <summary> |
| | | /// åºåºç¼å· |
| | | /// </summary> |
| | | public string AreaNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºåç§° |
| | | /// </summary> |
| | | public string AreaName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æè¿° |
| | | /// </summary> |
| | | public string? AreaDesc { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºç¶æ |
| | | /// </summary> |
| | | public AreaStatusEnum AreaStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºç¶æ |
| | | /// </summary> |
| | | public string AreaStatusDesc |
| | | { |
| | | get |
| | | { |
| | | return GetEnumDescriptionUtil.GetEnumDescription(AreaStatus); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åºåºç±»å |
| | | /// </summary> |
| | | public AreaTypeEnum AreaType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºç¶æ |
| | | /// </summary> |
| | | public string AreaTypeDesc |
| | | { |
| | | get |
| | | { |
| | | return GetEnumDescriptionUtil.GetEnumDescription(AreaType); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åä½å段1 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段2 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段3 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public virtual int Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public virtual string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public virtual bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¹¶åæ³ |
| | | /// </summary> |
| | | public string ConcurrencyStamp { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Gets the export data. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public Dictionary<string, object> GetExportData() |
| | | { |
| | | var exportData = new Dictionary<string, object>(); |
| | | foreach (var property in this.GetType().GetProperties()) |
| | | { |
| | | exportData.Add(property.Name, property.GetValue(this)); |
| | | } |
| | | |
| | | return exportData; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Domain.Entities; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsAreas; |
| | | |
| | | /// <summary> |
| | | /// WmsAreaæ´æ°åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsAreaUpdateDto : WmsAreaCreateOrUpdateDtoBase, IHasConcurrencyStamp |
| | | { |
| | | /// <summary> |
| | | /// å¹¶åæ³ |
| | | /// </summary> |
| | | public string ConcurrencyStamp { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using MiniExcelLibs.Attributes; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsAreas |
| | | { |
| | | /// <summary> |
| | | /// WmsAreaså¯¼åºæ¨¡å |
| | | /// </summary> |
| | | public class WmsAreasExportModel |
| | | { |
| | | /// <summary> |
| | | /// WmsAreaå¯¼åºæ¨¡å |
| | | /// </summary> |
| | | public class WorkSectionExportModel |
| | | { |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®åºåºç¼å· |
| | | /// </summary> |
| | | /// <example>WH-AREA-001</example> |
| | | [ExcelColumn(Name = "åºåºç¼å·", Width = 20)] |
| | | public string AreaNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®åºåºåç§° |
| | | /// </summary> |
| | | /// <example>åææAåº</example> |
| | | [ExcelColumn(Name = "åºåºåç§°", Width = 25)] |
| | | public string AreaName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®åºåºæè¿°ä¿¡æ¯ |
| | | /// </summary> |
| | | /// <example>åæ¾çµåå
å¨ä»¶</example> |
| | | [ExcelColumn(Name = "æè¿°", Width = 30)] |
| | | public string AreaDesc { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®åºåºç¶æ |
| | | /// </summary> |
| | | /// <example>Normal</example> |
| | | [ExcelColumn(Name = "åºåºç¶æ", Width = 15)] |
| | | public AreaStatusEnum AreaStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®åºåºç±»å |
| | | /// </summary> |
| | | /// <example>Storage</example> |
| | | [ExcelColumn(Name = "åºåºç±»å", Width = 15)] |
| | | public AreaTypeEnum AreaType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºä»£ç |
| | | /// </summary |
| | | [ExcelColumn(Name = "ä»åºä»£ç ", Width = 15)] |
| | | public string? StoreCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºåç§° |
| | | /// </summary> |
| | | [ExcelColumn(Name = "ä»åºåç§°", Width = 15)] |
| | | public string? StoreName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®é¢çæ©å±å段1 |
| | | /// </summary> |
| | | /// <example>èªå®ä¹ç¨é</example> |
| | | [ExcelColumn(Name = "æ©å±å段1", Width = 20)] |
| | | public string RedundantField1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®é¢çæ©å±å段2 |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æ©å±å段2", Width = 20)] |
| | | public string RedundantField2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®é¢çæ©å±å段3 |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æ©å±å段3", Width = 20)] |
| | | public string RedundantField3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "夿³¨", Width = 25)] |
| | | public virtual string Remark { get; set; } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using static CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsAreas.WmsAreasExportModel; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsAreas |
| | | { |
| | | /// <summary> |
| | | /// WmsAreas导å
¥æ¨¡å |
| | | /// </summary> |
| | | public class WmsAreasImportModel |
| | | { |
| | | private List<WmsAreaImportModel> _wmsareas = new(); |
| | | |
| | | public List<WmsAreaImportModel> WmsAreas |
| | | { |
| | | get => _wmsareas; |
| | | set |
| | | { |
| | | _wmsareas = value; |
| | | var rowIndex = 2; |
| | | _wmsareas?.ForEach(x => x.RowIndex = rowIndex++); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// WmsArea导å
¥æ¨¡å |
| | | /// </summary> |
| | | public class WmsAreaImportModel : WorkSectionExportModel |
| | | { |
| | | /// <summary> |
| | | /// è¡å· |
| | | /// </summary> |
| | | public int RowIndex { get; set; } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers; |
| | | |
| | | /// <summary> |
| | | /// WmsContaineræ¥è¯¢åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class GetWmsContainersInput : ExtensiblePagedAndSortedResultRequestDto |
| | | { |
| | | /// <summary> |
| | | /// Gets or sets the filter. |
| | | /// </summary> |
| | | public string Filter { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Gets or sets the name. |
| | | /// </summary> |
| | | public string Name { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç¼å· |
| | | /// </summary> |
| | | public string ContainerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç±»å |
| | | /// </summary> |
| | | public ContainerTypeEnum ContainerType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç¶æ |
| | | /// </summary> |
| | | public ContainerStatusEnum ContainerStatus { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers; |
| | | |
| | | /// <summary> |
| | | /// WmsContaineråå»ºåæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsContainerCreateDto : WmsContainerCreateOrUpdateDtoBase |
| | | { |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public virtual int? Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public bool? IsDisabled { get; set; } = false; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers; |
| | | |
| | | /// <summary> |
| | | /// WmsContaineråå»ºææ´æ°åºç±» |
| | | /// </summary> |
| | | public abstract class WmsContainerCreateOrUpdateDtoBase : ExtensibleEntityDto |
| | | { |
| | | |
| | | /// <summary> |
| | | /// æçç¼å· |
| | | /// </summary> |
| | | public string ContainerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç±»å |
| | | /// </summary> |
| | | public ContainerTypeEnum ContainerType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç¶æ |
| | | /// </summary> |
| | | public ContainerStatusEnum ContainerStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¿åº¦ |
| | | /// </summary> |
| | | public decimal? SpecLength { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 宽度 |
| | | /// </summary> |
| | | public decimal? SpecWidth { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é«åº¦ |
| | | /// </summary> |
| | | public decimal? SpecHeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éé¿ |
| | | /// </summary> |
| | | public decimal? LimitLength { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é宽 |
| | | /// </summary> |
| | | public decimal? LimitWidth { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éé« |
| | | /// </summary> |
| | | public decimal? LimitHeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è½½éä¸é |
| | | /// </summary> |
| | | public decimal? MaxWeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¼å¸¸æ°é |
| | | /// </summary> |
| | | public int? ExceptionNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | ///ç©ææ°é |
| | | /// </summary> |
| | | public int? MaterialNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段1 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段2 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段3 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField3 { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public virtual string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsContainerCreateOrUpdateDtoBase"/> class. |
| | | /// </summary> |
| | | public WmsContainerCreateOrUpdateDtoBase() : base(false) |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using Volo.Abp.Application.Dtos; |
| | | using Volo.Abp.Domain.Entities; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers; |
| | | |
| | | /// <summary> |
| | | /// WmsContaineræ°æ®åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsContainerDto : ExtensibleEntityDto<Guid>, IHasConcurrencyStamp |
| | | { |
| | | |
| | | /// <summary> |
| | | /// æçç¼å· |
| | | /// </summary> |
| | | public string ContainerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç±»å |
| | | /// </summary> |
| | | public ContainerTypeEnum ContainerType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç±»å |
| | | /// </summary> |
| | | public string ContainerTypeDesc |
| | | { |
| | | get |
| | | { |
| | | return GetEnumDescriptionUtil.GetEnumDescription(ContainerType); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æçç¶æ |
| | | /// </summary> |
| | | public ContainerStatusEnum ContainerStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç¶æ |
| | | /// </summary> |
| | | public string ContainerStatusDesc |
| | | { |
| | | get |
| | | { |
| | | return GetEnumDescriptionUtil.GetEnumDescription(ContainerStatus); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// é¿åº¦ |
| | | /// </summary> |
| | | public decimal? SpecLength { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 宽度 |
| | | /// </summary> |
| | | public decimal? SpecWidth { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é«åº¦ |
| | | /// </summary> |
| | | public decimal? SpecHeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éé¿ |
| | | /// </summary> |
| | | public decimal? LimitLength { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é宽 |
| | | /// </summary> |
| | | public decimal? LimitWidth { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éé« |
| | | /// </summary> |
| | | public decimal? LimitHeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è½½éä¸é |
| | | /// </summary> |
| | | public decimal? MaxWeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¼å¸¸æ°é |
| | | /// </summary> |
| | | public int? ExceptionNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | ///ç©ææ°é |
| | | /// </summary> |
| | | public int? MaterialNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段1 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段2 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段3 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField3 { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public virtual int Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public virtual string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public virtual bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¹¶åæ³ |
| | | /// </summary> |
| | | public string ConcurrencyStamp { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Gets the export data. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public Dictionary<string, object> GetExportData() |
| | | { |
| | | var exportData = new Dictionary<string, object>(); |
| | | foreach (var property in this.GetType().GetProperties()) |
| | | { |
| | | exportData.Add(property.Name, property.GetValue(this)); |
| | | } |
| | | |
| | | return exportData; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Domain.Entities; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers; |
| | | |
| | | /// <summary> |
| | | /// WmsContaineræ´æ°åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsContainerUpdateDto : WmsContainerCreateOrUpdateDtoBase, IHasConcurrencyStamp |
| | | { |
| | | /// <summary> |
| | | /// å¹¶åæ³ |
| | | /// </summary> |
| | | public string ConcurrencyStamp { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using MiniExcelLibs.Attributes; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers |
| | | { |
| | | /// <summary> |
| | | /// WmsContainerså¯¼åºæ¨¡å |
| | | /// </summary> |
| | | public class WmsContainersExportModel |
| | | { |
| | | /// <summary> |
| | | /// WmsContainerå¯¼åºæ¨¡å |
| | | /// </summary> |
| | | public class WorkSectionExportModel |
| | | { |
| | | /// <summary> |
| | | /// æçç¼å· |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æçç¼å·", Width = 25)] |
| | | public string ContainerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç±»å |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æçç±»å", Width = 25)] |
| | | public ContainerTypeEnum ContainerType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç¶æ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æçç¶æ", Width = 25)] |
| | | public ContainerStatusEnum ContainerStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¿åº¦ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "é¿åº¦", Width = 25)] |
| | | public decimal? SpecLength { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 宽度 |
| | | /// </summary> |
| | | [ExcelColumn(Name = "宽度", Width = 25)] |
| | | public decimal? SpecWidth { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é«åº¦ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "é«åº¦", Width = 25)] |
| | | public decimal? SpecHeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éé¿ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "éé¿", Width = 25)] |
| | | public decimal? LimitLength { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é宽 |
| | | /// </summary> |
| | | [ExcelColumn(Name = "é宽", Width = 25)] |
| | | public decimal? LimitWidth { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éé« |
| | | /// </summary> |
| | | [ExcelColumn(Name = "éé«", Width = 25)] |
| | | public decimal? LimitHeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è½½éä¸é |
| | | /// </summary> |
| | | [ExcelColumn(Name = "è½½éä¸é", Width = 25)] |
| | | public decimal? MaxWeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¼å¸¸æ°é |
| | | /// </summary> |
| | | [ExcelColumn(Name = "å¼å¸¸æ°é", Width = 25)] |
| | | public int? ExceptionNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©ææ°é |
| | | /// </summary> |
| | | [ExcelColumn(Name = "ç©ææ°é", Width = 25)] |
| | | public int? MaterialNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段1 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | [ExcelColumn(Name = "åä½å段1", Width = 25)] |
| | | public string RedundantField1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段2 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | [ExcelColumn(Name = "åä½å段2", Width = 25)] |
| | | public string RedundantField2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段3 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | [ExcelColumn(Name = "åä½å段3", Width = 25)] |
| | | public string RedundantField3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "夿³¨", Width = 25)] |
| | | public virtual string Remark { get; set; } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using static CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers.WmsContainersExportModel; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers |
| | | { |
| | | /// <summary> |
| | | /// WmsContainers导å
¥æ¨¡å |
| | | /// </summary> |
| | | public class WmsContainersImportModel |
| | | { |
| | | private List<WmsContainerImportModel> _wmscontainers = new(); |
| | | |
| | | public List<WmsContainerImportModel> WmsContainers |
| | | { |
| | | get => _wmscontainers; |
| | | set |
| | | { |
| | | _wmscontainers = value; |
| | | var rowIndex = 2; |
| | | _wmscontainers?.ForEach(x => x.RowIndex = rowIndex++); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// WmsContainer导å
¥æ¨¡å |
| | | /// </summary> |
| | | public class WmsContainerImportModel : WorkSectionExportModel |
| | | { |
| | | /// <summary> |
| | | /// è¡å· |
| | | /// </summary> |
| | | public int RowIndex { get; set; } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsEnumDto |
| | | { |
| | | /// <summary> |
| | | /// æä¸¾è¾å
¥åæ° |
| | | /// </summary> |
| | | public class WmsEnumInput |
| | | { |
| | | /// <summary> |
| | | /// æä¸¾ç±»ååç§° |
| | | /// </summary> |
| | | /// <example>AccountTypeEnum</example> |
| | | public string EnumName { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CmsQueryExtensions.Extension; |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsInOutStockRecord; |
| | | |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½è¡¨æ¥è¯¢åæ° |
| | | /// </summary> |
| | | public class GetWmsInOutStockRecordInput : ExtensiblePagedAndSortedResultRequestDto |
| | | { |
| | | |
| | | #region å
³é®åæ¥è¯¢ |
| | | |
| | | /// <summary> |
| | | /// å
³é®åæ¨¡ç³æ¥è¯¢ï¼æ³¨ææ¯å°åï¼ï¼ |
| | | /// </summary> |
| | | public string searchVal { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éç¨æ¥è¯¢é
ç½® (1:æ¨¡ç³æ¥è¯¢ , 2:ç²¾åæ¥è¯¢)ï¼æ³¨ææ¯å°åï¼ï¼ |
| | | /// </summary> |
| | | public SearchFilterModeEnum searchVal_FilterMode { get; set; } = SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// åæç´¢ç»ä»¶ä¼ éçéç¨æ¥è¯¢é
ç½®ç屿§åï¼æ³¨ææ¯å°åï¼ï¼ |
| | | /// </summary> |
| | | [NoAutoQuery] |
| | | public string str_searchFormInputAttrs { get; set; } |
| | | /// <summary> |
| | | /// åæç´¢ç»ä»¶ä¼ éçéç¨æ¥è¯¢é
ç½®ç屿§åï¼æ³¨ææ¯å°åï¼ï¼ |
| | | /// </summary> |
| | | public List<string> searchFormInputAttrs |
| | | { |
| | | get |
| | | { |
| | | if (!string.IsNullOrEmpty(str_searchFormInputAttrs)) |
| | | { |
| | | return str_searchFormInputAttrs.Split(',').ToList(); |
| | | } |
| | | return new List<string>(); |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// åæ®ç¼å· |
| | | /// </summary> |
| | | public string OrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ®ç¼å·-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum OrderNo_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// ç©æåç§° |
| | | /// </summary> |
| | | public string MaterialName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æåç§°-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum MaterialName_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// ç©æä»¶å· |
| | | /// </summary> |
| | | public string MaterialNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æä»¶å·-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum MaterialNo_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// æä½ç±»å |
| | | /// </summary> |
| | | public int? StockType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä½ç±»å-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum StockType_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// 容å¨ç¼å· |
| | | /// </summary> |
| | | public string ContainerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 容å¨ç¼å·-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum ContainerNo_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// æºå |
| | | /// </summary> |
| | | public string MaterialModel { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æºå-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum MaterialModel_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// æä½æ¶é´ |
| | | /// </summary> |
| | | //è¡¨ç¤ºæ¯ é«çº§æ¥è¯¢èå´æ¥è¯¢ç¹æ§ |
| | | [HighSearchRangeAttribute] |
| | | public List<string> OperateTime { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum Remark_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// ç©æID |
| | | /// </summary> |
| | | public string MaterialId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æID-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum MaterialId_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | public string TaskNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å·-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum TaskNo_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// èµ·å§åºä½ |
| | | /// </summary> |
| | | public string SourcePlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èµ·å§åºä½-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum SourcePlace_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// ç®æ åºä½ |
| | | /// </summary> |
| | | public string ToPlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ åºä½-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum ToPlace_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | //è¡¨ç¤ºæ¯ é«çº§æ¥è¯¢èå´æ¥è¯¢ç¹æ§ |
| | | [HighSearchRangeAttribute] |
| | | public List<string> CreationTime { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string CreatorId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// -æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum CreatorId_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | //è¡¨ç¤ºæ¯ é«çº§æ¥è¯¢èå´æ¥è¯¢ç¹æ§ |
| | | [HighSearchRangeAttribute] |
| | | public List<string> LastModificationTime { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string LastModifierId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// -æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum LastModifierId_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public bool? IsDeleted { get; set; } |
| | | |
| | | /// <summary> |
| | | /// -æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum IsDeleted_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string DeleterId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// -æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum DeleterId_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | //è¡¨ç¤ºæ¯ é«çº§æ¥è¯¢èå´æ¥è¯¢ç¹æ§ |
| | | [HighSearchRangeAttribute] |
| | | public List<string> DeletionTime { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum IsDisabled_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public int? Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåº-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum Sort_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsInOutStockRecord; |
| | | |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½è¡¨åå»ºåæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsInOutStockRecordCreateDto : WmsInOutStockRecordCreateOrUpdateDtoBase |
| | | { |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public virtual int? Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public bool? IsDisabled { get; set; } = false; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using System; |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsInOutStockRecord; |
| | | |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½è¡¨åå»ºææ´æ°åºç±» |
| | | /// </summary> |
| | | public abstract class WmsInOutStockRecordCreateOrUpdateDtoBase : ExtensibleEntityDto |
| | | { |
| | | /// <summary> |
| | | /// åæ®ç¼å· |
| | | /// </summary> |
| | | public string OrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æåç§° |
| | | /// </summary> |
| | | public string? MaterialName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æä»¶å· |
| | | /// </summary> |
| | | public string MaterialNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä½ç±»å |
| | | /// </summary> |
| | | public StockTypeEnum StockType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 容å¨ç¼å· |
| | | /// </summary> |
| | | public string? ContainerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æºå |
| | | /// </summary> |
| | | public string? MaterialModel { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä½æ¶é´ |
| | | /// </summary> |
| | | public DateTime? OperateTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public string? Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æID |
| | | /// </summary> |
| | | public string MaterialId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | public string TaskNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èµ·å§åºä½ |
| | | /// </summary> |
| | | public string? SourcePlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ åºä½ |
| | | /// </summary> |
| | | public string? ToPlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string? CreatorId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string? LastModifierId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public int Sort { get; set; } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsInOutStockRecordCreateOrUpdateDtoBase"/> class. |
| | | /// </summary> |
| | | public WmsInOutStockRecordCreateOrUpdateDtoBase() : base(false) |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using Volo.Abp.Application.Dtos; |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.Domain.Entities; |
| | | |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsInOutStockRecord; |
| | | |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½è¡¨æ°æ®åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsInOutStockRecordDto: ExtensibleEntityDto<Guid>, IHasConcurrencyStamp |
| | | { |
| | | /// <summary> |
| | | /// åæ®ç¼å· |
| | | /// </summary> |
| | | public string OrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æåç§° |
| | | /// </summary> |
| | | public string? MaterialName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æä»¶å· |
| | | /// </summary> |
| | | public string MaterialNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä½ç±»å |
| | | /// </summary> |
| | | public StockTypeEnum StockType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä½ç±»å |
| | | /// </summary> |
| | | public string StockTypeDesc |
| | | { |
| | | get |
| | | { |
| | | return GetEnumDescriptionUtil.GetEnumDescription(StockType); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 容å¨ç¼å· |
| | | /// </summary> |
| | | public string? ContainerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æºå |
| | | /// </summary> |
| | | public string? MaterialModel { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä½æ¶é´ |
| | | /// </summary> |
| | | public DateTime? OperateTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public string? Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æID |
| | | /// </summary> |
| | | public string MaterialId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | public string TaskNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èµ·å§åºä½ |
| | | /// </summary> |
| | | public string? SourcePlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ åºä½ |
| | | /// </summary> |
| | | public string? ToPlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public ExtraPropertyDictionary? ExtraProperties { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string? ConcurrencyStamp { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public DateTime CreationTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string? CreatorId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public DateTime? LastModificationTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string? LastModifierId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public bool IsDeleted { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string? DeleterId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public DateTime? DeletionTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public int Sort { get; set; } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// Gets the export data. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public Dictionary<string, object> GetExportData() |
| | | { |
| | | var exportData = new Dictionary<string, object>(); |
| | | foreach (var property in this.GetType().GetProperties()) |
| | | { |
| | | exportData.Add(property.Name, property.GetValue(this)); |
| | | } |
| | | |
| | | return exportData; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using MiniExcelLibs.Attributes; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using System; |
| | | using System.ComponentModel; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsInOutStockRecord; |
| | | |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½è¡¨å¯¼åºæ¨¡å |
| | | /// </summary> |
| | | public class WmsInOutStockRecordExportModel |
| | | { |
| | | /// <summary> |
| | | /// åæ®ç¼å· |
| | | /// </summary> |
| | | [ExcelColumn(Name = "åæ®ç¼å·", Width = 25)] |
| | | public string OrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æåç§° |
| | | /// </summary> |
| | | [ExcelColumn(Name = "ç©æåç§°", Width = 25)] |
| | | public string MaterialName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æä»¶å· |
| | | /// </summary> |
| | | [ExcelColumn(Name = "ç©æä»¶å·", Width = 25)] |
| | | public string MaterialNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä½ç±»å |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æä½ç±»å", Width = 25)] |
| | | public StockTypeEnum StockType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 容å¨ç¼å· |
| | | /// </summary> |
| | | [ExcelColumn(Name = "容å¨ç¼å·", Width = 25)] |
| | | public string ContainerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æºå |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æºå", Width = 25)] |
| | | public string MaterialModel { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä½æ¶é´ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æä½æ¶é´", Width = 25)] |
| | | public DateTime OperateTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "夿³¨", Width = 25)] |
| | | public string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æID |
| | | /// </summary> |
| | | [ExcelColumn(Name = "ç©æID", Width = 25)] |
| | | public string MaterialId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | [ExcelColumn(Name = "ä»»å¡å·", Width = 25)] |
| | | public string TaskNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èµ·å§åºä½ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "èµ·å§åºä½", Width = 25)] |
| | | public string SourcePlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ åºä½ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "ç®æ åºä½", Width = 25)] |
| | | public string ToPlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æ¯å¦ç¦ç¨", Width = 25)] |
| | | public bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æåº", Width = 25)] |
| | | public int Sort { get; set; } |
| | | |
| | | |
| | | |
| | | public Dictionary<string, object> GetExportData() |
| | | { |
| | | var exportData = new Dictionary<string, object>(); |
| | | foreach (var property in this.GetType().GetProperties()) |
| | | { |
| | | exportData.Add(property.Name, property.GetValue(this)); |
| | | } |
| | | |
| | | return exportData; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Domain.Entities; |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsInOutStockRecord; |
| | | |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½è¡¨æ´æ°åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsInOutStockRecordUpdateDto : WmsInOutStockRecordCreateOrUpdateDtoBase, IHasConcurrencyStamp |
| | | { |
| | | /// <summary> |
| | | /// å¹¶åæ³ |
| | | /// </summary> |
| | | public string ConcurrencyStamp { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsInOutStockRecord |
| | | { |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½è¡¨å¯¼å
¥æ¨¡å |
| | | /// </summary> |
| | | public class WmsInOutStockRecordsImportModel |
| | | { |
| | | private List<WmsInOutStockRecordImportModel> _WmsInOutStockRecords = new(); |
| | | |
| | | public List<WmsInOutStockRecordImportModel> WmsInOutStockRecords |
| | | { |
| | | get => _WmsInOutStockRecords; |
| | | set |
| | | { |
| | | _WmsInOutStockRecords = value; |
| | | var rowIndex = 2; |
| | | _WmsInOutStockRecords?.ForEach(x => x.RowIndex = rowIndex++); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½è¡¨å¯¼å
¥æ¨¡å |
| | | /// </summary> |
| | | public class WmsInOutStockRecordImportModel : WmsInOutStockRecordExportModel |
| | | { |
| | | /// <summary> |
| | | /// è¡å· |
| | | /// </summary> |
| | | public int RowIndex { get; set; } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CmsQueryExtensions.Extension; |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial; |
| | | |
| | | /// <summary> |
| | | /// ç©æåºç¡ä¿¡æ¯è¡¨æ¥è¯¢åæ° |
| | | /// </summary> |
| | | public class GetWmsMaterialInput : ExtensiblePagedAndSortedResultRequestDto |
| | | { |
| | | |
| | | #region å
³é®åæ¥è¯¢ |
| | | |
| | | /// <summary> |
| | | /// å
³é®åæ¨¡ç³æ¥è¯¢ï¼æ³¨ææ¯å°åï¼ï¼ |
| | | /// </summary> |
| | | public string searchVal { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éç¨æ¥è¯¢é
ç½® (1:æ¨¡ç³æ¥è¯¢ , 2:ç²¾åæ¥è¯¢)ï¼æ³¨ææ¯å°åï¼ï¼ |
| | | /// </summary> |
| | | public SearchFilterModeEnum searchVal_FilterMode { get; set; } = SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// åæç´¢ç»ä»¶ä¼ éçéç¨æ¥è¯¢é
ç½®ç屿§åï¼æ³¨ææ¯å°åï¼ï¼ |
| | | /// </summary> |
| | | [NoAutoQuery] |
| | | public string str_searchFormInputAttrs { get; set; } |
| | | /// <summary> |
| | | /// åæç´¢ç»ä»¶ä¼ éçéç¨æ¥è¯¢é
ç½®ç屿§åï¼æ³¨ææ¯å°åï¼ï¼ |
| | | /// </summary> |
| | | public List<string> searchFormInputAttrs |
| | | { |
| | | get |
| | | { |
| | | if (!string.IsNullOrEmpty(str_searchFormInputAttrs)) |
| | | { |
| | | return str_searchFormInputAttrs.Split(',').ToList(); |
| | | } |
| | | return new List<string>(); |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// ç©æç¼ç ï¼å¯ä¸æ è¯ï¼ |
| | | /// </summary> |
| | | public string MaterialCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç¼ç ï¼å¯ä¸æ è¯ï¼-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum MaterialCode_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// ç©æåç§° |
| | | /// </summary> |
| | | public string MaterialName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æåç§°-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum MaterialName_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// éè´ç±»åï¼æä¸¾å¼ï¼ |
| | | /// </summary> |
| | | public int? PurchaseType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éè´ç±»åï¼æä¸¾å¼ï¼-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum PurchaseType_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// ç©æç±»åï¼æä¸¾å¼ï¼ |
| | | /// </summary> |
| | | public int? MaterialType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç±»åï¼æä¸¾å¼ï¼-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum MaterialType_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// 主åä½ï¼å¦ï¼kgãmãä¸ªï¼ |
| | | /// </summary> |
| | | public string PrimaryUnit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 主åä½ï¼å¦ï¼kgãmã个ï¼-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum PrimaryUnit_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// è§æ ¼/æ åï¼å¦ï¼GB/T 8163-2018ï¼ |
| | | /// </summary> |
| | | public string Standard { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è§æ ¼/æ åï¼å¦ï¼GB/T 8163-2018ï¼-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum Standard_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// å¤å¾ï¼åä½ï¼mmï¼ |
| | | /// </summary> |
| | | public decimal? OuterDiameter { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¤å¾ï¼åä½ï¼mmï¼-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum OuterDiameter_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// å£åï¼åä½ï¼mmï¼ |
| | | /// </summary> |
| | | public decimal? WallThickness { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å£åï¼åä½ï¼mmï¼-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum WallThickness_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// æè´¨ï¼å¦ï¼304ä¸éé¢ï¼ |
| | | /// </summary> |
| | | public string MaterialQuality { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æè´¨ï¼å¦ï¼304ä¸éé¢ï¼-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum MaterialQuality_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// é¿åº¦ï¼åä½ï¼mï¼ |
| | | /// </summary> |
| | | public decimal? Length { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¿åº¦ï¼åä½ï¼mï¼-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum Length_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ä¸ºä¸»æ¯ç®¡ |
| | | /// </summary> |
| | | public int? IsMainBranch { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ä¸ºä¸»æ¯ç®¡-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum IsMainBranch_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// ç产工å |
| | | /// </summary> |
| | | public string Factory { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产工å-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum Factory_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// è¯ä¹¦ç¼å· |
| | | /// </summary> |
| | | public string Certification { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è¯ä¹¦ç¼å·-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum Certification_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// åä½å段1 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段1 - é¢çæ©å±ç¨é-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum RedundantField1_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// åä½å段2 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段2 - é¢çæ©å±ç¨é-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum RedundantField2_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// åä½å段3 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段3 - é¢çæ©å±ç¨é-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum RedundantField3_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public int? Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåº-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum Sort_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum Remark_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum IsDisabled_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | //è¡¨ç¤ºæ¯ é«çº§æ¥è¯¢èå´æ¥è¯¢ç¹æ§ |
| | | [HighSearchRangeAttribute] |
| | | public List<string> CreationTime { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string CreatorId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// -æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum CreatorId_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | //è¡¨ç¤ºæ¯ é«çº§æ¥è¯¢èå´æ¥è¯¢ç¹æ§ |
| | | [HighSearchRangeAttribute] |
| | | public List<string> LastModificationTime { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string LastModifierId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// -æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum LastModifierId_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public bool? IsDeleted { get; set; } |
| | | |
| | | /// <summary> |
| | | /// -æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum IsDeleted_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string DeleterId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// -æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum DeleterId_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | //è¡¨ç¤ºæ¯ é«çº§æ¥è¯¢èå´æ¥è¯¢ç¹æ§ |
| | | [HighSearchRangeAttribute] |
| | | public List<string> DeletionTime { get; set; } |
| | | |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial; |
| | | |
| | | /// <summary> |
| | | /// ç©æåºç¡ä¿¡æ¯è¡¨åå»ºåæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsMaterialCreateDto : WmsMaterialCreateOrUpdateDtoBase |
| | | { |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public virtual int? Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public bool? IsDisabled { get; set; } = false; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial; |
| | | |
| | | /// <summary> |
| | | /// ç©æåºç¡ä¿¡æ¯è¡¨åå»ºææ´æ°åºç±» |
| | | /// </summary> |
| | | public abstract class WmsMaterialCreateOrUpdateDtoBase : ExtensibleEntityDto |
| | | { |
| | | /// <summary> |
| | | /// ç©æç¼ç ï¼å¯ä¸æ è¯ï¼ |
| | | /// </summary> |
| | | public string MaterialCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æåç§° |
| | | /// </summary> |
| | | public string MaterialName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éè´ç±»åï¼æä¸¾å¼ï¼ |
| | | /// </summary> |
| | | public PurchaseTypeEnum PurchaseType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç±»åï¼æä¸¾å¼ï¼ |
| | | /// </summary> |
| | | public MaterialTypeEnum MaterialType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 主åä½ï¼å¦ï¼kgãmãä¸ªï¼ |
| | | /// </summary> |
| | | public string? PrimaryUnit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è§æ ¼/æ åï¼å¦ï¼GB/T 8163-2018ï¼ |
| | | /// </summary> |
| | | public string? Standard { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¤å¾ï¼åä½ï¼mmï¼ |
| | | /// </summary> |
| | | public decimal OuterDiameter { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å£åï¼åä½ï¼mmï¼ |
| | | /// </summary> |
| | | public decimal WallThickness { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æè´¨ï¼å¦ï¼304ä¸éé¢ï¼ |
| | | /// </summary> |
| | | public string? MaterialQuality { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¿åº¦ï¼åä½ï¼mï¼ |
| | | /// </summary> |
| | | public decimal Length { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ä¸ºä¸»æ¯ç®¡ |
| | | /// </summary> |
| | | public YesNoEnum IsMainBranch { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产工å |
| | | /// </summary> |
| | | public string? Factory { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è¯ä¹¦ç¼å· |
| | | /// </summary> |
| | | public string? Certification { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段1 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string? RedundantField1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段2 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string? RedundantField2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段3 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string? RedundantField3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public int Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public string? Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string? CreatorId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string? LastModifierId { get; set; } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsMaterialCreateOrUpdateDtoBase"/> class. |
| | | /// </summary> |
| | | public WmsMaterialCreateOrUpdateDtoBase() : base(false) |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using Volo.Abp.Application.Dtos; |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.Domain.Entities; |
| | | |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial; |
| | | |
| | | /// <summary> |
| | | /// ç©æåºç¡ä¿¡æ¯è¡¨æ°æ®åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsMaterialDto: ExtensibleEntityDto<Guid>, IHasConcurrencyStamp |
| | | { |
| | | /// <summary> |
| | | /// ç©æç¼ç ï¼å¯ä¸æ è¯ï¼ |
| | | /// </summary> |
| | | public string MaterialCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æåç§° |
| | | /// </summary> |
| | | public string MaterialName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éè´ç±»åï¼æä¸¾å¼ï¼ |
| | | /// </summary> |
| | | public PurchaseTypeEnum PurchaseType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éè´ç±»åï¼æä¸¾å¼ï¼ |
| | | /// </summary> |
| | | public string PurchaseTypeDesc |
| | | { |
| | | get |
| | | { |
| | | return GetEnumDescriptionUtil.GetEnumDescription(PurchaseType); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// ç©æç±»åï¼æä¸¾å¼ï¼ |
| | | /// </summary> |
| | | public MaterialTypeEnum MaterialType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç±»åï¼æä¸¾å¼ï¼ |
| | | /// </summary> |
| | | public string MaterialTypeDesc |
| | | { |
| | | get |
| | | { |
| | | return GetEnumDescriptionUtil.GetEnumDescription(MaterialType); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 主åä½ï¼å¦ï¼kgãmãä¸ªï¼ |
| | | /// </summary> |
| | | public string? PrimaryUnit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è§æ ¼/æ åï¼å¦ï¼GB/T 8163-2018ï¼ |
| | | /// </summary> |
| | | public string? Standard { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¤å¾ï¼åä½ï¼mmï¼ |
| | | /// </summary> |
| | | public decimal OuterDiameter { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å£åï¼åä½ï¼mmï¼ |
| | | /// </summary> |
| | | public decimal WallThickness { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æè´¨ï¼å¦ï¼304ä¸éé¢ï¼ |
| | | /// </summary> |
| | | public string? MaterialQuality { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¿åº¦ï¼åä½ï¼mï¼ |
| | | /// </summary> |
| | | public decimal Length { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ä¸ºä¸»æ¯ç®¡ |
| | | /// </summary> |
| | | public YesNoEnum IsMainBranch { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ä¸ºä¸»æ¯ç®¡ |
| | | /// </summary> |
| | | public string IsMainBranchDesc |
| | | { |
| | | get |
| | | { |
| | | return GetEnumDescriptionUtil.GetEnumDescription(IsMainBranch); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// ç产工å |
| | | /// </summary> |
| | | public string? Factory { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è¯ä¹¦ç¼å· |
| | | /// </summary> |
| | | public string? Certification { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段1 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string? RedundantField1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段2 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string? RedundantField2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段3 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string? RedundantField3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public int Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public string? Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public ExtraPropertyDictionary? ExtraProperties { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string? ConcurrencyStamp { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public DateTime CreationTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string? CreatorId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public DateTime? LastModificationTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string? LastModifierId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public bool IsDeleted { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string? DeleterId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public DateTime? DeletionTime { get; set; } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// Gets the export data. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public Dictionary<string, object> GetExportData() |
| | | { |
| | | var exportData = new Dictionary<string, object>(); |
| | | foreach (var property in this.GetType().GetProperties()) |
| | | { |
| | | exportData.Add(property.Name, property.GetValue(this)); |
| | | } |
| | | |
| | | return exportData; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using MiniExcelLibs.Attributes; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using System.ComponentModel; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial; |
| | | |
| | | /// <summary> |
| | | /// ç©æåºç¡ä¿¡æ¯è¡¨å¯¼åºæ¨¡å |
| | | /// </summary> |
| | | public class WmsMaterialExportModel |
| | | { |
| | | /// <summary> |
| | | /// ç©æç¼ç ï¼å¯ä¸æ è¯ï¼ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "ç©æç¼ç ï¼å¯ä¸æ è¯ï¼", Width = 25)] |
| | | public string MaterialCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æåç§° |
| | | /// </summary> |
| | | [ExcelColumn(Name = "ç©æåç§°", Width = 25)] |
| | | public string MaterialName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éè´ç±»åï¼æä¸¾å¼ï¼ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "éè´ç±»åï¼æä¸¾å¼ï¼", Width = 25)] |
| | | public PurchaseTypeEnum PurchaseType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç±»åï¼æä¸¾å¼ï¼ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "ç©æç±»åï¼æä¸¾å¼ï¼", Width = 25)] |
| | | public MaterialTypeEnum MaterialType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 主åä½ï¼å¦ï¼kgãmãä¸ªï¼ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "主åä½ï¼å¦ï¼kgãmã个ï¼", Width = 25)] |
| | | public string PrimaryUnit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è§æ ¼/æ åï¼å¦ï¼GB/T 8163-2018ï¼ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "è§æ ¼/æ åï¼å¦ï¼GB/T 8163-2018ï¼", Width = 25)] |
| | | public string Standard { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¤å¾ï¼åä½ï¼mmï¼ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "å¤å¾ï¼åä½ï¼mmï¼", Width = 25)] |
| | | public decimal OuterDiameter { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å£åï¼åä½ï¼mmï¼ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "å£åï¼åä½ï¼mmï¼", Width = 25)] |
| | | public decimal WallThickness { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æè´¨ï¼å¦ï¼304ä¸éé¢ï¼ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æè´¨ï¼å¦ï¼304ä¸éé¢ï¼", Width = 25)] |
| | | public string MaterialQuality { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¿åº¦ï¼åä½ï¼mï¼ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "é¿åº¦ï¼åä½ï¼mï¼", Width = 25)] |
| | | public decimal Length { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ä¸ºä¸»æ¯ç®¡ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æ¯å¦ä¸ºä¸»æ¯ç®¡", Width = 25)] |
| | | public YesNoEnum IsMainBranch { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产工å |
| | | /// </summary> |
| | | [ExcelColumn(Name = "ç产工å", Width = 25)] |
| | | public string Factory { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è¯ä¹¦ç¼å· |
| | | /// </summary> |
| | | [ExcelColumn(Name = "è¯ä¹¦ç¼å·", Width = 25)] |
| | | public string Certification { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段1 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | [ExcelColumn(Name = "åä½å段1 - é¢çæ©å±ç¨é", Width = 25)] |
| | | public string RedundantField1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段2 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | [ExcelColumn(Name = "åä½å段2 - é¢çæ©å±ç¨é", Width = 25)] |
| | | public string RedundantField2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段3 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | [ExcelColumn(Name = "åä½å段3 - é¢çæ©å±ç¨é", Width = 25)] |
| | | public string RedundantField3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æåº", Width = 25)] |
| | | public int Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "夿³¨", Width = 25)] |
| | | public string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æ¯å¦ç¦ç¨", Width = 25)] |
| | | public bool? IsDisabled { get; set; } |
| | | |
| | | |
| | | |
| | | public Dictionary<string, object> GetExportData() |
| | | { |
| | | var exportData = new Dictionary<string, object>(); |
| | | foreach (var property in this.GetType().GetProperties()) |
| | | { |
| | | exportData.Add(property.Name, property.GetValue(this)); |
| | | } |
| | | |
| | | return exportData; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Domain.Entities; |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial; |
| | | |
| | | /// <summary> |
| | | /// ç©æåºç¡ä¿¡æ¯è¡¨æ´æ°åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsMaterialUpdateDto : WmsMaterialCreateOrUpdateDtoBase, IHasConcurrencyStamp |
| | | { |
| | | /// <summary> |
| | | /// å¹¶åæ³ |
| | | /// </summary> |
| | | public string ConcurrencyStamp { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial |
| | | { |
| | | /// <summary> |
| | | /// ç©æåºç¡ä¿¡æ¯è¡¨å¯¼å
¥æ¨¡å |
| | | /// </summary> |
| | | public class WmsMaterialsImportModel |
| | | { |
| | | private List<WmsMaterialImportModel> _WmsMaterials = new(); |
| | | |
| | | public List<WmsMaterialImportModel> WmsMaterials |
| | | { |
| | | get => _WmsMaterials; |
| | | set |
| | | { |
| | | _WmsMaterials = value; |
| | | var rowIndex = 2; |
| | | _WmsMaterials?.ForEach(x => x.RowIndex = rowIndex++); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ç©æåºç¡ä¿¡æ¯è¡¨å¯¼å
¥æ¨¡å |
| | | /// </summary> |
| | | public class WmsMaterialImportModel : WmsMaterialExportModel |
| | | { |
| | | /// <summary> |
| | | /// è¡å· |
| | | /// </summary> |
| | | public int RowIndex { get; set; } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsPlaces; |
| | | |
| | | /// <summary> |
| | | /// WmsPlaceæ¥è¯¢åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class GetWmsPlacesInput : ExtensiblePagedAndSortedResultRequestDto |
| | | { |
| | | /// <summary> |
| | | /// Gets or sets the filter. |
| | | /// </summary> |
| | | public string Filter { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Gets or sets the name. |
| | | /// </summary> |
| | | public string Name { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsPlaces; |
| | | |
| | | /// <summary> |
| | | /// WmsPlaceåå»ºåæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsPlaceCreateDto : WmsPlaceCreateOrUpdateDtoBase |
| | | { |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public virtual int? Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public bool? IsDisabled { get; set; } = false; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsPlaces; |
| | | |
| | | /// <summary> |
| | | /// WmsPlaceåå»ºææ´æ°åºç±» |
| | | /// </summary> |
| | | public abstract class WmsPlaceCreateOrUpdateDtoBase : ExtensibleEntityDto |
| | | { |
| | | /// <summary> |
| | | /// ç¼å· |
| | | /// </summary> |
| | | public virtual string PlaceNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´§ä½ç±»å |
| | | /// </summary> |
| | | public PlaceTypeEnum StorageTypeNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´§ä½ç¶æ |
| | | /// </summary> |
| | | public PlaceStatusEnum PlaceStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æå¨åºåº |
| | | /// </summary> |
| | | public string AreaCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å··é |
| | | /// </summary> |
| | | public int Aisle { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ |
| | | /// </summary> |
| | | public int RowNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å |
| | | /// </summary> |
| | | public int ColumnNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å± |
| | | /// </summary> |
| | | public int LayerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦éå® |
| | | /// </summary> |
| | | public YesNoEnum Islock { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç©ºæ |
| | | /// </summary> |
| | | public YesNoEnum EmptyContainer { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段1 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段2 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段3 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public virtual string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsPlaceCreateOrUpdateDtoBase"/> class. |
| | | /// </summary> |
| | | public WmsPlaceCreateOrUpdateDtoBase() : base(false) |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using Volo.Abp.Application.Dtos; |
| | | using Volo.Abp.Domain.Entities; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsPlaces; |
| | | |
| | | /// <summary> |
| | | /// WmsPlaceæ°æ®åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsPlaceDto : ExtensibleEntityDto<Guid>, IHasConcurrencyStamp |
| | | { |
| | | /// <summary> |
| | | /// ç¼å· |
| | | /// </summary> |
| | | public virtual string PlaceNo { get; protected set; } |
| | | |
| | | /// <summary> |
| | | /// è´§ä½ç±»å |
| | | /// </summary> |
| | | public PlaceTypeEnum StorageTypeNo { get; protected set; } |
| | | |
| | | /// <summary> |
| | | /// è´§ä½ç±»å |
| | | /// </summary> |
| | | public string StorageTypeNoDesc |
| | | { |
| | | get |
| | | { |
| | | return GetEnumDescriptionUtil.GetEnumDescription(StorageTypeNo); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è´§ä½ç¶æ |
| | | /// </summary> |
| | | public PlaceStatusEnum PlaceStatus { get; protected set; } |
| | | |
| | | /// <summary> |
| | | /// è´§ä½ç¶æ |
| | | /// </summary> |
| | | public string PlaceStatusDesc |
| | | { |
| | | get |
| | | { |
| | | return GetEnumDescriptionUtil.GetEnumDescription(PlaceStatus); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æå¨åºåº |
| | | /// </summary> |
| | | public string AreaCode { get; protected set; } |
| | | |
| | | /// <summary> |
| | | /// å··é |
| | | /// </summary> |
| | | public int Aisle { get; protected set; } |
| | | |
| | | /// <summary> |
| | | /// æ |
| | | /// </summary> |
| | | public int RowNo { get; protected set; } |
| | | |
| | | /// <summary> |
| | | /// å |
| | | /// </summary> |
| | | public int ColumnNo { get; protected set; } |
| | | |
| | | /// <summary> |
| | | /// å± |
| | | /// </summary> |
| | | public int LayerNo { get; protected set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦éå® |
| | | /// </summary> |
| | | public YesNoEnum Islock { get; protected set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦éå® |
| | | /// </summary> |
| | | public string IslockDesc |
| | | { |
| | | get |
| | | { |
| | | return GetEnumDescriptionUtil.GetEnumDescription(Islock); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç©ºæ |
| | | /// </summary> |
| | | public YesNoEnum EmptyContainer { get; protected set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç©ºæ |
| | | /// </summary> |
| | | public string EmptyContainerDesc |
| | | { |
| | | get |
| | | { |
| | | return GetEnumDescriptionUtil.GetEnumDescription(EmptyContainer); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åä½å段1 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段2 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段3 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public virtual int Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public virtual string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public virtual bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¹¶åæ³ |
| | | /// </summary> |
| | | public string ConcurrencyStamp { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Gets the export data. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public Dictionary<string, object> GetExportData() |
| | | { |
| | | var exportData = new Dictionary<string, object>(); |
| | | foreach (var property in this.GetType().GetProperties()) |
| | | { |
| | | exportData.Add(property.Name, property.GetValue(this)); |
| | | } |
| | | |
| | | return exportData; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Domain.Entities; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsPlaces; |
| | | |
| | | /// <summary> |
| | | /// WmsPlaceæ´æ°åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsPlaceUpdateDto : WmsPlaceCreateOrUpdateDtoBase, IHasConcurrencyStamp |
| | | { |
| | | /// <summary> |
| | | /// å¹¶åæ³ |
| | | /// </summary> |
| | | public string ConcurrencyStamp { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using MiniExcelLibs.Attributes; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsPlaces |
| | | { |
| | | /// <summary> |
| | | /// WmsPlaceså¯¼åºæ¨¡å |
| | | /// </summary> |
| | | public class WmsPlacesExportModel |
| | | { |
| | | /// <summary> |
| | | /// WmsPlaceå¯¼åºæ¨¡å |
| | | /// </summary> |
| | | public class WorkSectionExportModel |
| | | { |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®è´§ä½ç¼å· |
| | | /// </summary> |
| | | /// <example>PL-001-01-01</example> |
| | | [ExcelColumn(Name = "è´§ä½ç¼å·", Width = 20)] |
| | | public string PlaceNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®è´§ä½ç±»å |
| | | /// </summary> |
| | | /// <example>Normal</example> |
| | | [ExcelColumn(Name = "è´§ä½ç±»å", Width = 15)] |
| | | public PlaceTypeEnum StorageTypeNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®è´§ä½ç¶æ |
| | | /// </summary> |
| | | /// <example>Available</example> |
| | | [ExcelColumn(Name = "è´§ä½ç¶æ", Width = 15)] |
| | | public PlaceStatusEnum PlaceStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®æå¨åºåºç¼å· |
| | | /// </summary> |
| | | /// <example>AREA-001</example> |
| | | [ExcelColumn(Name = "æå±åºåº", Width = 20)] |
| | | public string AreaCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®å··éç¼å· |
| | | /// </summary> |
| | | /// <example>1</example> |
| | | [ExcelColumn(Name = "å··é", Width = 10)] |
| | | public int Aisle { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®æå· |
| | | /// </summary> |
| | | /// <example>2</example> |
| | | [ExcelColumn(Name = "æ", Width = 10)] |
| | | public int RowNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®åå· |
| | | /// </summary> |
| | | /// <example>3</example> |
| | | [ExcelColumn(Name = "å", Width = 10)] |
| | | public int ColumnNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®å±å· |
| | | /// </summary> |
| | | /// <example>1</example> |
| | | [ExcelColumn(Name = "å±", Width = 10)] |
| | | public int LayerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®éå®ç¶æ |
| | | /// </summary> |
| | | /// <example>No</example> |
| | | [ExcelColumn(Name = "æ¯å¦éå®", Width = 12)] |
| | | public YesNoEnum Islock { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®ç©ºæç¶æ |
| | | /// </summary> |
| | | /// <example>Yes</example> |
| | | [ExcelColumn(Name = "æ¯å¦ç©ºæ", Width = 12)] |
| | | public YesNoEnum EmptyContainer { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®é¢çæ©å±å段1 |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æ©å±å段1", Width = 20)] |
| | | public string RedundantField1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®é¢çæ©å±å段2 |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æ©å±å段2", Width = 20)] |
| | | public string RedundantField2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®é¢çæ©å±å段3 |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æ©å±å段3", Width = 20)] |
| | | public string RedundantField3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "夿³¨", Width = 25)] |
| | | public virtual string Remark { get; set; } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using static CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsPlaces.WmsPlacesExportModel; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsPlaces |
| | | { |
| | | /// <summary> |
| | | /// WmsPlaces导å
¥æ¨¡å |
| | | /// </summary> |
| | | public class WmsPlacesImportModel |
| | | { |
| | | private List<WmsPlaceImportModel> _wmsplaces = new(); |
| | | |
| | | public List<WmsPlaceImportModel> WmsPlaces |
| | | { |
| | | get => _wmsplaces; |
| | | set |
| | | { |
| | | _wmsplaces = value; |
| | | var rowIndex = 2; |
| | | _wmsplaces?.ForEach(x => x.RowIndex = rowIndex++); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// WmsPlace导å
¥æ¨¡å |
| | | /// </summary> |
| | | public class WmsPlaceImportModel : WorkSectionExportModel |
| | | { |
| | | /// <summary> |
| | | /// è¡å· |
| | | /// </summary> |
| | | public int RowIndex { get; set; } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsStores; |
| | | |
| | | /// <summary> |
| | | /// WmsStoreæ¥è¯¢åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class GetWmsStoresInput : ExtensiblePagedAndSortedResultRequestDto |
| | | { |
| | | /// <summary> |
| | | /// Gets or sets the filter. |
| | | /// </summary> |
| | | public string Filter { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Gets or sets the name. |
| | | /// </summary> |
| | | public string Name { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºä»£ç |
| | | /// </summary> |
| | | public string? StoreCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºåç§° |
| | | /// </summary> |
| | | public string? StoreName { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsStores; |
| | | |
| | | /// <summary> |
| | | /// WmsStoreåå»ºåæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsStoreCreateDto : WmsStoreCreateOrUpdateDtoBase |
| | | { |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public virtual int? Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public bool? IsDisabled { get; set; } = false; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsStores; |
| | | |
| | | /// <summary> |
| | | /// WmsStoreåå»ºææ´æ°åºç±» |
| | | /// </summary> |
| | | public abstract class WmsStoreCreateOrUpdateDtoBase : ExtensibleEntityDto |
| | | { |
| | | /// <summary> |
| | | /// ä»åºä»£ç |
| | | /// </summary> |
| | | public string? StoreCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºåç§° |
| | | /// </summary> |
| | | public string? StoreName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段1 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段2 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段3 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public virtual string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsStoreCreateOrUpdateDtoBase"/> class. |
| | | /// </summary> |
| | | public WmsStoreCreateOrUpdateDtoBase() : base(false) |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Application.Dtos; |
| | | using Volo.Abp.Domain.Entities; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsStores; |
| | | |
| | | /// <summary> |
| | | /// WmsStoreæ°æ®åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsStoreDto : ExtensibleEntityDto<Guid>, IHasConcurrencyStamp |
| | | { |
| | | /// <summary> |
| | | /// ä»åºä»£ç |
| | | /// </summary> |
| | | public string? StoreCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºåç§° |
| | | /// </summary> |
| | | public string? StoreName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段1 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段2 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段3 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public virtual int Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public virtual string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public virtual bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¹¶åæ³ |
| | | /// </summary> |
| | | public string ConcurrencyStamp { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Gets the export data. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public Dictionary<string, object> GetExportData() |
| | | { |
| | | var exportData = new Dictionary<string, object>(); |
| | | foreach (var property in this.GetType().GetProperties()) |
| | | { |
| | | exportData.Add(property.Name, property.GetValue(this)); |
| | | } |
| | | |
| | | return exportData; |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// åä»åºéæ©ä½¿ç¨ |
| | | /// </summary> |
| | | public class WmsStoreForAreaOutpur |
| | | { |
| | | /// <summary> |
| | | /// ä»åºä»£ç |
| | | /// </summary> |
| | | public string? StoreCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºåç§° |
| | | /// </summary> |
| | | public string? StoreName { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Domain.Entities; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsStores; |
| | | |
| | | /// <summary> |
| | | /// WmsStoreæ´æ°åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsStoreUpdateDto : WmsStoreCreateOrUpdateDtoBase, IHasConcurrencyStamp |
| | | { |
| | | /// <summary> |
| | | /// å¹¶åæ³ |
| | | /// </summary> |
| | | public string ConcurrencyStamp { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using MiniExcelLibs.Attributes; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsStores |
| | | { |
| | | /// <summary> |
| | | /// WmsStoreså¯¼åºæ¨¡å |
| | | /// </summary> |
| | | public class WmsStoresExportModel |
| | | { |
| | | /// <summary> |
| | | /// WmsStoreå¯¼åºæ¨¡å |
| | | /// </summary> |
| | | public class WorkSectionExportModel |
| | | { |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®ä»åºä»£ç |
| | | /// </summary> |
| | | /// <example>WH-001</example> |
| | | [ExcelColumn(Name = "ä»åºä»£ç ", Width = 20)] |
| | | public string StoreCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®ä»åºåç§° |
| | | /// </summary> |
| | | /// <example>䏿µ·ä¸å¿ä»</example> |
| | | [ExcelColumn(Name = "ä»åºåç§°", Width = 25)] |
| | | public string StoreName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®é¢çæ©å±å段1 |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æ©å±å段1", Width = 20)] |
| | | public string RedundantField1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®é¢çæ©å±å段2 |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æ©å±å段2", Width = 20)] |
| | | public string RedundantField2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·åæè®¾ç½®é¢çæ©å±å段3 |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æ©å±å段3", Width = 20)] |
| | | public string RedundantField3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "夿³¨", Width = 25)] |
| | | public virtual string Remark { get; set; } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using static CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsStores.WmsStoresExportModel; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsStores |
| | | { |
| | | /// <summary> |
| | | /// WmsStores导å
¥æ¨¡å |
| | | /// </summary> |
| | | public class WmsStoresImportModel |
| | | { |
| | | private List<WmsStoreImportModel> _wmsstores = new(); |
| | | |
| | | public List<WmsStoreImportModel> WmsStores |
| | | { |
| | | get => _wmsstores; |
| | | set |
| | | { |
| | | _wmsstores = value; |
| | | var rowIndex = 2; |
| | | _wmsstores?.ForEach(x => x.RowIndex = rowIndex++); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// WmsStore导å
¥æ¨¡å |
| | | /// </summary> |
| | | public class WmsStoreImportModel : WorkSectionExportModel |
| | | { |
| | | /// <summary> |
| | | /// è¡å· |
| | | /// </summary> |
| | | public int RowIndex { get; set; } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
| | | <ConfigureAwait ContinueOnCapturedContext="false" /> |
| | | </Weavers> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Application.Services; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts; |
| | | |
| | | /// <summary> |
| | | /// æ¥è¯¢åºç¨æå¡ |
| | | /// </summary> |
| | | public interface ICMSPluginQueryAppService : IApplicationService |
| | | { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsAreas; |
| | | using Volo.Abp.Application.Services; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | |
| | | /// <summary> |
| | | /// WmsAreaåºç¨æå¡ |
| | | /// </summary> |
| | | public interface IWmsAreaAppService : ICrudAppService<WmsAreaDto, Guid, GetWmsAreasInput, WmsAreaCreateDto, WmsAreaUpdateDto> |
| | | { |
| | | /// <summary> |
| | | /// Clones the asynchronous. |
| | | /// </summary> |
| | | /// <param name="ids">The ids.</param> |
| | | /// <returns></returns> |
| | | Task<List<WmsAreaDto>> CloneAsync(IEnumerable<Guid> ids); |
| | | |
| | | /// <summary> |
| | | /// Deletes the many asynchronous. |
| | | /// </summary> |
| | | /// <param name="ids">The ids.</param> |
| | | /// <returns></returns> |
| | | Task DeleteManyAsync(IEnumerable<Guid> ids); |
| | | |
| | | /// <summary> |
| | | /// Adjusts the sort asynchronous. |
| | | /// </summary> |
| | | /// <param name="id">The identifier.</param> |
| | | /// <param name="sort">The sort.</param> |
| | | /// <returns></returns> |
| | | Task AdjustSortAsync(Guid id, int sort); |
| | | |
| | | /// <summary> |
| | | /// Imports the asynchronous. |
| | | /// </summary> |
| | | /// <param name="input">The input.</param> |
| | | /// <returns></returns> |
| | | Task ImportAsync(WmsAreasImportModel input); |
| | | |
| | | /// <summary> |
| | | /// Exports the asynchronous. |
| | | /// </summary> |
| | | /// <param name="input">The input.</param> |
| | | /// <returns></returns> |
| | | Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWmsAreasInput input); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers; |
| | | using Volo.Abp.Application.Services; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | |
| | | /// <summary> |
| | | /// WmsContaineråºç¨æå¡ |
| | | /// </summary> |
| | | public interface IWmsContainerAppService : ICrudAppService<WmsContainerDto, Guid, GetWmsContainersInput, WmsContainerCreateDto, WmsContainerUpdateDto> |
| | | { |
| | | /// <summary> |
| | | /// Clones the asynchronous. |
| | | /// </summary> |
| | | /// <param name="ids">The ids.</param> |
| | | /// <returns></returns> |
| | | Task<List<WmsContainerDto>> CloneAsync(IEnumerable<Guid> ids); |
| | | |
| | | /// <summary> |
| | | /// Deletes the many asynchronous. |
| | | /// </summary> |
| | | /// <param name="ids">The ids.</param> |
| | | /// <returns></returns> |
| | | Task DeleteManyAsync(IEnumerable<Guid> ids); |
| | | |
| | | /// <summary> |
| | | /// Adjusts the sort asynchronous. |
| | | /// </summary> |
| | | /// <param name="id">The identifier.</param> |
| | | /// <param name="sort">The sort.</param> |
| | | /// <returns></returns> |
| | | Task AdjustSortAsync(Guid id, int sort); |
| | | |
| | | /// <summary> |
| | | /// Imports the asynchronous. |
| | | /// </summary> |
| | | /// <param name="input">The input.</param> |
| | | /// <returns></returns> |
| | | Task ImportAsync(WmsContainersImportModel input); |
| | | |
| | | /// <summary> |
| | | /// Exports the asynchronous. |
| | | /// </summary> |
| | | /// <param name="input">The input.</param> |
| | | /// <returns></returns> |
| | | Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWmsContainersInput input); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsEnumDto; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsStores; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Util; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using static CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsAreas.WmsAreaCreateOrUpdateDtoBase; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Services |
| | | { |
| | | /// <summary> |
| | | /// æä¸¾æ¥å£ |
| | | /// </summary> |
| | | public interface IWmsEnumAppService |
| | | { |
| | | /// <summary> |
| | | /// è·åæä¸¾. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | List<EnumItem> GetEnumDataList(WmsEnumInput enumInput); |
| | | |
| | | /// <summary> |
| | | /// è·åä»åºå表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | Task<List<WmsStoreForAreaOutpur>> GetStreList(); |
| | | |
| | | /// <summary> |
| | | /// åºåºå表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | Task<List<AreaForListOuptut>> GetAreaListAsync(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsInOutStockRecord; |
| | | using Volo.Abp.Application.Services; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½è¡¨åºç¨æå¡æ¥å£ |
| | | /// </summary> |
| | | public interface IWmsInOutStockRecordAppService : ICrudAppService<WmsInOutStockRecordDto, Guid, GetWmsInOutStockRecordInput, WmsInOutStockRecordCreateDto, WmsInOutStockRecordUpdateDto> |
| | | { |
| | | /// <summary> |
| | | /// å
éåºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | Task<List<WmsInOutStockRecordDto>> CloneAsync(IEnumerable<Guid> ids); |
| | | |
| | | /// <summary> |
| | | /// å é¤åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | Task DeleteManyAsync(IEnumerable<Guid> ids); |
| | | |
| | | /// <summary> |
| | | /// è°æ´æåºåºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <param name="sort"></param> |
| | | /// <returns></returns> |
| | | Task AdjustSortAsync(Guid id, int sort); |
| | | |
| | | /// <summary> |
| | | /// 导å
¥åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | Task ImportAsync(WmsInOutStockRecordsImportModel input); |
| | | |
| | | /// <summary> |
| | | /// 导åºåºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWmsInOutStockRecordInput input); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial; |
| | | using Volo.Abp.Application.Services; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | |
| | | /// <summary> |
| | | /// ç©æåºç¡ä¿¡æ¯è¡¨åºç¨æå¡æ¥å£ |
| | | /// </summary> |
| | | public interface IWmsMaterialAppService : ICrudAppService<WmsMaterialDto, Guid, GetWmsMaterialInput, WmsMaterialCreateDto, WmsMaterialUpdateDto> |
| | | { |
| | | /// <summary> |
| | | /// å
éç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | Task<List<WmsMaterialDto>> CloneAsync(IEnumerable<Guid> ids); |
| | | |
| | | /// <summary> |
| | | /// å é¤ç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | Task DeleteManyAsync(IEnumerable<Guid> ids); |
| | | |
| | | /// <summary> |
| | | /// è°æ´æåºç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <param name="sort"></param> |
| | | /// <returns></returns> |
| | | Task AdjustSortAsync(Guid id, int sort); |
| | | |
| | | /// <summary> |
| | | /// 导å
¥ç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | Task ImportAsync(WmsMaterialsImportModel input); |
| | | |
| | | /// <summary> |
| | | /// 导åºç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWmsMaterialInput input); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsPlaces; |
| | | using Volo.Abp.Application.Services; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | |
| | | /// <summary> |
| | | /// WmsPlaceåºç¨æå¡ |
| | | /// </summary> |
| | | public interface IWmsPlaceAppService : ICrudAppService<WmsPlaceDto, Guid, GetWmsPlacesInput, WmsPlaceCreateDto, WmsPlaceUpdateDto> |
| | | { |
| | | /// <summary> |
| | | /// Clones the asynchronous. |
| | | /// </summary> |
| | | /// <param name="ids">The ids.</param> |
| | | /// <returns></returns> |
| | | Task<List<WmsPlaceDto>> CloneAsync(IEnumerable<Guid> ids); |
| | | |
| | | /// <summary> |
| | | /// Deletes the many asynchronous. |
| | | /// </summary> |
| | | /// <param name="ids">The ids.</param> |
| | | /// <returns></returns> |
| | | Task DeleteManyAsync(IEnumerable<Guid> ids); |
| | | |
| | | /// <summary> |
| | | /// Adjusts the sort asynchronous. |
| | | /// </summary> |
| | | /// <param name="id">The identifier.</param> |
| | | /// <param name="sort">The sort.</param> |
| | | /// <returns></returns> |
| | | Task AdjustSortAsync(Guid id, int sort); |
| | | |
| | | /// <summary> |
| | | /// Imports the asynchronous. |
| | | /// </summary> |
| | | /// <param name="input">The input.</param> |
| | | /// <returns></returns> |
| | | Task ImportAsync(WmsPlacesImportModel input); |
| | | |
| | | /// <summary> |
| | | /// Exports the asynchronous. |
| | | /// </summary> |
| | | /// <param name="input">The input.</param> |
| | | /// <returns></returns> |
| | | Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWmsPlacesInput input); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsStores; |
| | | using Volo.Abp.Application.Services; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | |
| | | /// <summary> |
| | | /// WmsStoreåºç¨æå¡ |
| | | /// </summary> |
| | | public interface IWmsStoreAppService : ICrudAppService<WmsStoreDto, Guid, GetWmsStoresInput, WmsStoreCreateDto, WmsStoreUpdateDto> |
| | | { |
| | | /// <summary> |
| | | /// Clones the asynchronous. |
| | | /// </summary> |
| | | /// <param name="ids">The ids.</param> |
| | | /// <returns></returns> |
| | | Task<List<WmsStoreDto>> CloneAsync(IEnumerable<Guid> ids); |
| | | |
| | | /// <summary> |
| | | /// Deletes the many asynchronous. |
| | | /// </summary> |
| | | /// <param name="ids">The ids.</param> |
| | | /// <returns></returns> |
| | | Task DeleteManyAsync(IEnumerable<Guid> ids); |
| | | |
| | | /// <summary> |
| | | /// Adjusts the sort asynchronous. |
| | | /// </summary> |
| | | /// <param name="id">The identifier.</param> |
| | | /// <param name="sort">The sort.</param> |
| | | /// <returns></returns> |
| | | Task AdjustSortAsync(Guid id, int sort); |
| | | |
| | | /// <summary> |
| | | /// Imports the asynchronous. |
| | | /// </summary> |
| | | /// <param name="input">The input.</param> |
| | | /// <returns></returns> |
| | | Task ImportAsync(WmsStoresImportModel input); |
| | | |
| | | /// <summary> |
| | | /// Exports the asynchronous. |
| | | /// </summary> |
| | | /// <param name="input">The input.</param> |
| | | /// <returns></returns> |
| | | Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWmsStoresInput input); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | |
| | | <Import Project="../../common.props" /> |
| | | <Import Project="../../configureawait.props" /> |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="Volo.Abp.Dapper" Version="$(ABPPackageVersion)" /> |
| | | <PackageReference Include="Volo.Abp.AutoMapper" Version="$(ABPPackageVersion)" /> |
| | | <PackageReference Include="Volo.Abp.Ddd.Application" Version="$(ABPPackageVersion)" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\CMS.Plugin.HIAWms.Application.Contracts\CMS.Plugin.HIAWms.Application.Contracts.csproj" /> |
| | | <ProjectReference Include="..\CMS.Plugin.HIAWms.Domain\CMS.Plugin.HIAWms.Domain.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <Reference Include="CmsQueryExtensions"> |
| | | <HintPath>..\..\..\..\..\CommonDLL\CmsQueryExtensions.dll</HintPath> |
| | | </Reference> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Localization; |
| | | using Volo.Abp.Application.Services; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application; |
| | | |
| | | /// <summary> |
| | | /// Inherit your application services from this class. |
| | | /// </summary> |
| | | public abstract class CMSPluginAppService : ApplicationService |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="CMSPluginAppService"/> class. |
| | | /// </summary> |
| | | protected CMSPluginAppService() |
| | | { |
| | | ObjectMapperContext = typeof(CMSPluginApplicationModule); |
| | | LocalizationResource = typeof(HIAWmsResource); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts; |
| | | using CMS.Plugin.HIAWms.Domain; |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Volo.Abp.Application; |
| | | using Volo.Abp.AutoMapper; |
| | | using Volo.Abp.EventBus; |
| | | using Volo.Abp.Modularity; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application; |
| | | |
| | | /// <summary> |
| | | /// æä»¶åºç¨æå¡æ¨¡å |
| | | /// </summary> |
| | | [DependsOn( |
| | | typeof(CMSPluginDomainModule), |
| | | typeof(CMSPluginApplicationContractsModule), |
| | | typeof(AbpAutoMapperModule), |
| | | typeof(AbpEventBusModule), |
| | | typeof(AbpDddApplicationModule) |
| | | )] |
| | | public class CMSPluginApplicationModule : AbpModule |
| | | { |
| | | public override void ConfigureServices(ServiceConfigurationContext context) |
| | | { |
| | | context.Services.AddAutoMapperObjectMapper<CMSPluginApplicationModule>(); |
| | | Configure<AbpAutoMapperOptions>(options => |
| | | { |
| | | options.AddMaps<CMSPluginApplicationModule>(validate: true); |
| | | }); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts; |
| | | using CMS.Plugin.HIAWms.Domain.Data; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application; |
| | | |
| | | /// <inheritdoc /> |
| | | public class CMSPluginQueryAppService : CMSPluginAppService, ICMSPluginQueryAppService |
| | | { |
| | | private readonly ICMSPluginDapperRepository _dapperRepository; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="CMSPluginQueryAppService"/> class. |
| | | /// </summary> |
| | | /// <param name="dapperRepository">The dapper repository.</param> |
| | | public CMSPluginQueryAppService(ICMSPluginDapperRepository dapperRepository) |
| | | { |
| | | _dapperRepository = dapperRepository; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
| | | <ConfigureAwait ContinueOnCapturedContext="false" /> |
| | | </Weavers> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsAreas; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | using CMS.Plugin.HIAWms.Domain.WmsAreas; |
| | | using CMS.Plugin.HIAWms.Domain.Shared; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsAreas; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Dtos; |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.ObjectExtending; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Util; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Implements; |
| | | |
| | | /// <inheritdoc /> |
| | | public class WmsAreaAppService : CMSPluginAppService, IWmsAreaAppService |
| | | { |
| | | private readonly IWmsAreaRepository _wmsareaRepository; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsAreaAppService"/> class. |
| | | /// </summary> |
| | | /// <param name="wmsareaRepository">The task job repository.</param> |
| | | public WmsAreaAppService(IWmsAreaRepository wmsareaRepository) |
| | | { |
| | | _wmsareaRepository = wmsareaRepository; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<WmsAreaDto> GetAsync(Guid id) |
| | | { |
| | | return ObjectMapper.Map<WmsArea, WmsAreaDto>(await _wmsareaRepository.GetAsync(id)); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<PagedResultDto<WmsAreaDto>> GetListAsync(GetWmsAreasInput input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WmsArea.Sort); |
| | | } |
| | | |
| | | var specification = new WmsAreaSpecification(input.Name); |
| | | var area = ObjectMapper.Map<GetWmsAreasInput, WmsArea>(input); |
| | | var count = await _wmsareaRepository.GetCountAsync(area,input.Filter, specification); |
| | | var list = await _wmsareaRepository.GetListAsync(area,input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification); |
| | | |
| | | return new PagedResultDto<WmsAreaDto>(count, ObjectMapper.Map<List<WmsArea>, List<WmsAreaDto>>(list)); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<WmsAreaDto> CreateAsync(WmsAreaCreateDto input) |
| | | { |
| | | await CheckCreateOrUpdateDtoAsync(input); |
| | | |
| | | var exist = await _wmsareaRepository.NameExistAsync(input.AreaNo); |
| | | if (exist) |
| | | { |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.AreaNo]); |
| | | } |
| | | |
| | | var maxSort = await _wmsareaRepository.GetMaxSortAsync(); |
| | | var sort = input.Sort ?? maxSort; |
| | | var wmsarea = ObjectMapper.Map<WmsAreaCreateDto, WmsArea>(input); |
| | | wmsarea.Sort = sort; |
| | | input.MapExtraPropertiesTo(wmsarea, MappingPropertyDefinitionChecks.None); |
| | | |
| | | await _wmsareaRepository.InsertAsync(wmsarea); |
| | | |
| | | if (input.Sort.HasValue && wmsarea.Sort != maxSort) |
| | | { |
| | | await AdjustSortAsync(wmsarea.Id, wmsarea.Sort); |
| | | } |
| | | |
| | | return ObjectMapper.Map<WmsArea, WmsAreaDto>(wmsarea); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<WmsAreaDto> UpdateAsync(Guid id, WmsAreaUpdateDto input) |
| | | { |
| | | await CheckCreateOrUpdateDtoAsync(input); |
| | | |
| | | var wmsarea = await _wmsareaRepository.GetAsync(id); |
| | | var exist = await _wmsareaRepository.NameExistAsync(input.AreaNo, wmsarea.Id); |
| | | if (exist) |
| | | { |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.AreaNo]); |
| | | } |
| | | |
| | | wmsarea.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp); |
| | | input.MapExtraPropertiesTo(wmsarea, MappingPropertyDefinitionChecks.None); |
| | | |
| | | wmsarea.AreaName = input.AreaName; |
| | | wmsarea.AreaDesc = input.AreaDesc; |
| | | wmsarea.AreaStatus = input.AreaStatus; |
| | | wmsarea.AreaType = input.AreaType; |
| | | wmsarea.StoreCode = input.StoreCode; |
| | | wmsarea.StoreName = input.StoreName; |
| | | |
| | | await _wmsareaRepository.UpdateAsync(wmsarea); |
| | | |
| | | return ObjectMapper.Map<WmsArea, WmsAreaDto>(wmsarea); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<List<WmsAreaDto>> CloneAsync(IEnumerable<Guid> ids) |
| | | { |
| | | var wmsareas = new List<WmsArea>(); |
| | | if (ids != null) |
| | | { |
| | | var sort = await _wmsareaRepository.GetMaxSortAsync(); |
| | | foreach (var id in ids) |
| | | { |
| | | var wmsarea = await _wmsareaRepository.FindAsync(id); |
| | | if (wmsarea != null) |
| | | { |
| | | var name = wmsarea.AreaNo + WmsAreaConsts.CloneTag; |
| | | var notExist = false; |
| | | while (!notExist) |
| | | { |
| | | var exist = await _wmsareaRepository.NameExistAsync(name); |
| | | if (exist || wmsareas.Any(x => x.AreaNo == name)) |
| | | { |
| | | name += WmsAreaConsts.CloneTag; |
| | | continue; |
| | | } |
| | | |
| | | notExist = true; |
| | | } |
| | | |
| | | wmsareas.Add(wmsarea); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return ObjectMapper.Map<List<WmsArea>, List<WmsAreaDto>>(wmsareas); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual Task DeleteAsync(Guid id) |
| | | { |
| | | return _wmsareaRepository.DeleteAsync(id); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task DeleteManyAsync(IEnumerable<Guid> ids) |
| | | { |
| | | foreach (var id in ids) |
| | | { |
| | | await DeleteAsync(id); |
| | | } |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task AdjustSortAsync(Guid id, int sort) |
| | | { |
| | | var list = await _wmsareaRepository.GetListAsync(null,nameof(WmsArea.Sort)); |
| | | if (list != null && list.Any()) |
| | | { |
| | | var initSort = 1; |
| | | list.ForEach(x => x.AdjustSort(initSort++)); |
| | | var entity = list.FirstOrDefault(x => x.Id == id); |
| | | if (entity != null) |
| | | { |
| | | if (sort == 1) |
| | | { |
| | | list.Where(x => x.Id != id).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | } |
| | | else if (entity.Sort > sort) |
| | | { |
| | | list.Where(x => x.Id != id && x.Sort >= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | list.Where(x => x.Id != id && x.Sort < sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1)); |
| | | } |
| | | else if (entity.Sort < sort) |
| | | { |
| | | list.Where(x => x.Id != id && x.Sort > sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | list.Where(x => x.Id != id && x.Sort <= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1)); |
| | | } |
| | | |
| | | entity.AdjustSort(sort); |
| | | } |
| | | } |
| | | |
| | | await _wmsareaRepository.UpdateManyAsync(list); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task ImportAsync(WmsAreasImportModel input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | var wmsareaCreateDtos = new List<(int RowIndex, WmsAreaCreateDto Item)>(); |
| | | var wmsareaUpdateDtos = new List<(int RowIndex, Guid Id, WmsAreaUpdateDto Item)>(); |
| | | var wmsareas = input.WmsAreas; |
| | | |
| | | if (wmsareas != null && wmsareas.Any()) |
| | | { |
| | | #region 导å
¥æ ¡éª |
| | | |
| | | // 夿åç§°æ¯å¦éå¤ï¼å¹¶è¾åºç¬¬å è¡éå¤ |
| | | var duplicateWmsAreas = wmsareas.GroupBy(x => x.AreaNo).Where(x => x.Count() > 1).ToList(); |
| | | if (duplicateWmsAreas?.Any() == true) |
| | | { |
| | | var duplicateWmsAreaMsgs = duplicateWmsAreas.Select(x => $"第 {string.Join(",", x.Select(x => x.RowIndex))} è¡ï¼{x.Key} åç§°éå¤"); |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ {string.Join(",", duplicateWmsAreaMsgs)}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | foreach (var wmsarea in wmsareas) |
| | | { |
| | | if (wmsarea.AreaNo.IsNullOrWhiteSpace() && wmsarea.AreaName.IsNullOrWhiteSpace()) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if (wmsarea.AreaName.IsNullOrWhiteSpace()) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{wmsarea.RowIndex}è¡ï¼WmsAreaåç§°ä¸è½ä¸ºç©º"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | |
| | | var oldWmsArea = await _wmsareaRepository.FindByNameAsync(wmsarea.AreaName); |
| | | if (oldWmsArea != null) |
| | | { |
| | | var wmsareaUpdateDto = new WmsAreaUpdateDto |
| | | { |
| | | AreaName = wmsarea.AreaName, |
| | | AreaDesc = wmsarea.AreaDesc, |
| | | AreaStatus = wmsarea.AreaStatus, |
| | | AreaType = wmsarea.AreaType, |
| | | StoreCode = wmsarea.StoreCode, |
| | | StoreName = wmsarea.StoreName, |
| | | Remark = wmsarea.Remark, |
| | | }; |
| | | |
| | | wmsareaUpdateDtos.Add((wmsarea.RowIndex, oldWmsArea.Id, wmsareaUpdateDto)); |
| | | } |
| | | else |
| | | { |
| | | var wmsareaCreateDto = new WmsAreaCreateDto |
| | | { |
| | | AreaName = wmsarea.AreaName, |
| | | AreaDesc = wmsarea.AreaDesc, |
| | | AreaStatus = wmsarea.AreaStatus, |
| | | AreaType = wmsarea.AreaType, |
| | | StoreCode = wmsarea.StoreCode, |
| | | StoreName = wmsarea.StoreName, |
| | | Remark = wmsarea.Remark, |
| | | }; |
| | | |
| | | wmsareaCreateDtos.Add((wmsarea.RowIndex, wmsareaCreateDto)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // æ°å¢ |
| | | foreach (var wmsareaDto in wmsareaCreateDtos) |
| | | { |
| | | try |
| | | { |
| | | await CreateAsync(wmsareaDto.Item); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{wmsareaDto.RowIndex}è¡ï¼{e.Message}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | } |
| | | |
| | | // æ´æ° |
| | | foreach (var wmsareaDto in wmsareaUpdateDtos) |
| | | { |
| | | try |
| | | { |
| | | await UpdateAsync(wmsareaDto.Id, wmsareaDto.Item); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{wmsareaDto.RowIndex}è¡ï¼{e.Message}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWmsAreasInput input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WmsArea.Sort); |
| | | } |
| | | |
| | | var specification = new WmsAreaSpecification(input.Name); |
| | | var area = ObjectMapper.Map<GetWmsAreasInput, WmsArea>(input); |
| | | var list = await _wmsareaRepository.GetListAsync(area,input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification, includeDetails: true); |
| | | var result = ObjectMapper.Map<List<WmsArea>, List<WmsAreaDto>>(list); |
| | | |
| | | var sheets = new Dictionary<string, object> |
| | | { |
| | | ["é
ç½®"] = ExportHelper.ConvertListToExportData(result), |
| | | }; |
| | | |
| | | var fileName = result.Count > 1 ? "WmsAreaå表" : result.Count == 1 ? result.First()?.AreaName : "WmsArea模ç"; |
| | | return (sheets, fileName); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Checks the create or update dto asynchronous. |
| | | /// </summary> |
| | | /// <param name="input">The input.</param> |
| | | protected Task CheckCreateOrUpdateDtoAsync(WmsAreaCreateOrUpdateDtoBase input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | Check.NotNullOrWhiteSpace(input.AreaNo, "ç¼å·", WmsAreaConsts.MaxCodeLength); |
| | | Check.NotNullOrWhiteSpace(input.AreaName, "åç§°", WmsAreaConsts.MaxNameLength); |
| | | Check.Length(input.Remark, "夿³¨", WmsAreaConsts.MaxRemarkLength); |
| | | return Task.CompletedTask; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | using CMS.Plugin.HIAWms.Domain.WmsContainers; |
| | | using CMS.Plugin.HIAWms.Domain.Shared; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsContainers; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Dtos; |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.ObjectExtending; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Util; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Implements; |
| | | |
| | | /// <inheritdoc /> |
| | | public class WmsContainerAppService : CMSPluginAppService, IWmsContainerAppService |
| | | { |
| | | private readonly IWmsContainerRepository _wmscontainerRepository; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsContainerAppService"/> class. |
| | | /// </summary> |
| | | /// <param name="wmscontainerRepository">The task job repository.</param> |
| | | public WmsContainerAppService(IWmsContainerRepository wmscontainerRepository) |
| | | { |
| | | _wmscontainerRepository = wmscontainerRepository; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<WmsContainerDto> GetAsync(Guid id) |
| | | { |
| | | return ObjectMapper.Map<WmsContainer, WmsContainerDto>(await _wmscontainerRepository.GetAsync(id)); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<PagedResultDto<WmsContainerDto>> GetListAsync(GetWmsContainersInput input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WmsContainer.Sort); |
| | | } |
| | | |
| | | var specification = new WmsContainerSpecification(input.Name); |
| | | var container = ObjectMapper.Map < GetWmsContainersInput, WmsContainer>(input); |
| | | var count = await _wmscontainerRepository.GetCountAsync(container,input.Filter, specification); |
| | | var list = await _wmscontainerRepository.GetListAsync(container,input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification); |
| | | |
| | | return new PagedResultDto<WmsContainerDto>(count, ObjectMapper.Map<List<WmsContainer>, List<WmsContainerDto>>(list)); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<WmsContainerDto> CreateAsync(WmsContainerCreateDto input) |
| | | { |
| | | await CheckCreateOrUpdateDtoAsync(input); |
| | | |
| | | var exist = await _wmscontainerRepository.NameExistAsync(input.ContainerNo); |
| | | if (exist) |
| | | { |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.ContainerNo]); |
| | | } |
| | | |
| | | var maxSort = await _wmscontainerRepository.GetMaxSortAsync(); |
| | | var sort = input.Sort ?? maxSort; |
| | | var wmscontainer = ObjectMapper.Map<WmsContainerCreateDto,WmsContainer>(input); |
| | | input.MapExtraPropertiesTo(wmscontainer, MappingPropertyDefinitionChecks.None); |
| | | wmscontainer.Sort = sort; |
| | | await _wmscontainerRepository.InsertAsync(wmscontainer); |
| | | |
| | | if (input.Sort.HasValue && wmscontainer.Sort != maxSort) |
| | | { |
| | | await AdjustSortAsync(wmscontainer.Id, wmscontainer.Sort); |
| | | } |
| | | |
| | | return ObjectMapper.Map<WmsContainer, WmsContainerDto>(wmscontainer); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<WmsContainerDto> UpdateAsync(Guid id, WmsContainerUpdateDto input) |
| | | { |
| | | await CheckCreateOrUpdateDtoAsync(input); |
| | | |
| | | var wmscontainer = await _wmscontainerRepository.GetAsync(id); |
| | | var exist = await _wmscontainerRepository.NameExistAsync(input.ContainerNo, wmscontainer.Id); |
| | | if (exist) |
| | | { |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.ContainerNo]); |
| | | } |
| | | |
| | | wmscontainer.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp); |
| | | input.MapExtraPropertiesTo(wmscontainer, MappingPropertyDefinitionChecks.None); |
| | | |
| | | wmscontainer.ContainerStatus = input.ContainerStatus; |
| | | wmscontainer.ContainerType = input.ContainerType; |
| | | wmscontainer.SpecLength = input.SpecLength; |
| | | wmscontainer.SpecWidth = input.SpecWidth; |
| | | wmscontainer.SpecHeight = input.SpecHeight; |
| | | wmscontainer.LimitLength = input.LimitLength; |
| | | wmscontainer.LimitWidth = input.LimitWidth; |
| | | wmscontainer.LimitHeight = input.LimitHeight; |
| | | wmscontainer.MaxWeight = input.MaxWeight; |
| | | wmscontainer.MaterialNumber = input.MaterialNumber; |
| | | wmscontainer.ExceptionNumber = input.ExceptionNumber; |
| | | |
| | | await _wmscontainerRepository.UpdateAsync(wmscontainer); |
| | | |
| | | return ObjectMapper.Map<WmsContainer, WmsContainerDto>(wmscontainer); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<List<WmsContainerDto>> CloneAsync(IEnumerable<Guid> ids) |
| | | { |
| | | var wmscontainers = new List<WmsContainer>(); |
| | | if (ids != null) |
| | | { |
| | | var sort = await _wmscontainerRepository.GetMaxSortAsync(); |
| | | foreach (var id in ids) |
| | | { |
| | | var wmscontainer = await _wmscontainerRepository.FindAsync(id); |
| | | if (wmscontainer != null) |
| | | { |
| | | var containerNo = wmscontainer.ContainerNo + WmsContainerConsts.CloneTag; |
| | | var notExist = false; |
| | | while (!notExist) |
| | | { |
| | | var exist = await _wmscontainerRepository.NameExistAsync(containerNo); |
| | | if (exist || wmscontainers.Any(x => x.ContainerNo == containerNo)) |
| | | { |
| | | containerNo += WmsContainerConsts.CloneTag; |
| | | continue; |
| | | } |
| | | |
| | | notExist = true; |
| | | } |
| | | |
| | | //wmscontainer = await _wmscontainerRepository.InsertAsync(wmscontainer.Clone(GuidGenerator.Create(), containerNo, sort++)); |
| | | wmscontainers.Add(wmscontainer); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return ObjectMapper.Map<List<WmsContainer>, List<WmsContainerDto>>(wmscontainers); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual Task DeleteAsync(Guid id) |
| | | { |
| | | return _wmscontainerRepository.DeleteAsync(id); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task DeleteManyAsync(IEnumerable<Guid> ids) |
| | | { |
| | | foreach (var id in ids) |
| | | { |
| | | await DeleteAsync(id); |
| | | } |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task AdjustSortAsync(Guid id, int sort) |
| | | { |
| | | var list = await _wmscontainerRepository.GetListAsync(null,nameof(WmsContainer.Sort)); |
| | | if (list != null && list.Any()) |
| | | { |
| | | var initSort = 1; |
| | | list.ForEach(x => x.AdjustSort(initSort++)); |
| | | var entity = list.FirstOrDefault(x => x.Id == id); |
| | | if (entity != null) |
| | | { |
| | | if (sort == 1) |
| | | { |
| | | list.Where(x => x.Id != id).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | } |
| | | else if (entity.Sort > sort) |
| | | { |
| | | list.Where(x => x.Id != id && x.Sort >= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | list.Where(x => x.Id != id && x.Sort < sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1)); |
| | | } |
| | | else if (entity.Sort < sort) |
| | | { |
| | | list.Where(x => x.Id != id && x.Sort > sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | list.Where(x => x.Id != id && x.Sort <= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1)); |
| | | } |
| | | |
| | | entity.AdjustSort(sort); |
| | | } |
| | | } |
| | | |
| | | await _wmscontainerRepository.UpdateManyAsync(list); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task ImportAsync(WmsContainersImportModel input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | var wmscontainerCreateDtos = new List<(int RowIndex, WmsContainerCreateDto Item)>(); |
| | | var wmscontainerUpdateDtos = new List<(int RowIndex, Guid Id, WmsContainerUpdateDto Item)>(); |
| | | var wmscontainers = input.WmsContainers; |
| | | |
| | | if (wmscontainers != null && wmscontainers.Any()) |
| | | { |
| | | #region 导å
¥æ ¡éª |
| | | |
| | | // 夿åç§°æ¯å¦éå¤ï¼å¹¶è¾åºç¬¬å è¡éå¤ |
| | | var duplicateWmsContainers = wmscontainers.GroupBy(x => x.ContainerNo).Where(x => x.Count() > 1).ToList(); |
| | | if (duplicateWmsContainers?.Any() == true) |
| | | { |
| | | var duplicateWmsContainerMsgs = duplicateWmsContainers.Select(x => $"第 {string.Join(",", x.Select(x => x.RowIndex))} è¡ï¼{x.Key} åç§°éå¤"); |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ {string.Join(",", duplicateWmsContainerMsgs)}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | foreach (var wmscontainer in wmscontainers) |
| | | { |
| | | if (wmscontainer.ContainerNo.IsNullOrWhiteSpace() && wmscontainer.ContainerNo.IsNullOrWhiteSpace()) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if (wmscontainer.ContainerNo.IsNullOrWhiteSpace()) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{wmscontainer.RowIndex}è¡ï¼WmsContaineråç§°ä¸è½ä¸ºç©º"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | |
| | | var oldWmsContainer = await _wmscontainerRepository.FindByNameAsync(wmscontainer.ContainerNo); |
| | | if (oldWmsContainer != null) |
| | | { |
| | | var wmscontainerUpdateDto = new WmsContainerUpdateDto |
| | | { |
| | | ContainerNo = wmscontainer.ContainerNo, |
| | | ContainerType = wmscontainer.ContainerType, |
| | | ContainerStatus = wmscontainer.ContainerStatus, |
| | | SpecLength = wmscontainer.SpecLength, |
| | | SpecWidth = wmscontainer.SpecWidth, |
| | | SpecHeight = wmscontainer.SpecHeight, |
| | | LimitLength = wmscontainer.LimitLength, |
| | | LimitWidth = wmscontainer.LimitWidth, |
| | | LimitHeight = wmscontainer.LimitHeight, |
| | | MaxWeight = wmscontainer.MaxWeight, |
| | | Remark = wmscontainer.Remark, |
| | | }; |
| | | |
| | | wmscontainerUpdateDtos.Add((wmscontainer.RowIndex, oldWmsContainer.Id, wmscontainerUpdateDto)); |
| | | } |
| | | else |
| | | { |
| | | var wmscontainerCreateDto = new WmsContainerCreateDto |
| | | { |
| | | ContainerNo = wmscontainer.ContainerNo, |
| | | ContainerType = wmscontainer.ContainerType, |
| | | ContainerStatus = wmscontainer.ContainerStatus, |
| | | SpecLength = wmscontainer.SpecLength, |
| | | SpecWidth = wmscontainer.SpecWidth, |
| | | SpecHeight = wmscontainer.SpecHeight, |
| | | LimitLength = wmscontainer.LimitLength, |
| | | LimitWidth = wmscontainer.LimitWidth, |
| | | LimitHeight = wmscontainer.LimitHeight, |
| | | MaxWeight = wmscontainer.MaxWeight, |
| | | Remark = wmscontainer.Remark |
| | | }; |
| | | |
| | | wmscontainerCreateDtos.Add((wmscontainer.RowIndex, wmscontainerCreateDto)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // æ°å¢ |
| | | foreach (var wmscontainerDto in wmscontainerCreateDtos) |
| | | { |
| | | try |
| | | { |
| | | await CreateAsync(wmscontainerDto.Item); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{wmscontainerDto.RowIndex}è¡ï¼{e.Message}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | } |
| | | |
| | | // æ´æ° |
| | | foreach (var wmscontainerDto in wmscontainerUpdateDtos) |
| | | { |
| | | try |
| | | { |
| | | await UpdateAsync(wmscontainerDto.Id, wmscontainerDto.Item); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{wmscontainerDto.RowIndex}è¡ï¼{e.Message}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWmsContainersInput input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WmsContainer.Sort); |
| | | } |
| | | |
| | | var specification = new WmsContainerSpecification(input.Name); |
| | | var container = ObjectMapper.Map<GetWmsContainersInput, WmsContainer>(input); |
| | | var list = await _wmscontainerRepository.GetListAsync(container,input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification, includeDetails: true); |
| | | var result = ObjectMapper.Map<List<WmsContainer>, List<WmsContainerDto>>(list); |
| | | |
| | | var sheets = new Dictionary<string, object> |
| | | { |
| | | ["é
ç½®"] = ExportHelper.ConvertListToExportData(result), |
| | | }; |
| | | |
| | | var fileName = result.Count > 1 ? "WmsContainerå表" : result.Count == 1 ? result.First()?.ContainerNo : "WmsContainer模ç"; |
| | | return (sheets, fileName); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Checks the create or update dto asynchronous. |
| | | /// </summary> |
| | | /// <param name="input">The input.</param> |
| | | protected Task CheckCreateOrUpdateDtoAsync(WmsContainerCreateOrUpdateDtoBase input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | Check.NotNullOrWhiteSpace(input.ContainerNo, "ç¼å·", WmsContainerConsts.MaxCodeLength); |
| | | Check.Length(input.Remark, "夿³¨", WmsContainerConsts.MaxRemarkLength); |
| | | return Task.CompletedTask; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsEnumDto; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsStores; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Util; |
| | | using CMS.Plugin.HIAWms.Domain.WmsAreas; |
| | | using CMS.Plugin.HIAWms.Domain.WmsStores; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using static CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsAreas.WmsAreaCreateOrUpdateDtoBase; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Implements |
| | | { |
| | | /// <summary> |
| | | /// æä¸¾ç±»åæ¥å£å®ç° |
| | | /// </summary> |
| | | public class WmsEnumAppService : CMSPluginAppService, IWmsEnumAppService |
| | | { |
| | | private readonly IWmsStoreRepository _storeRepository; |
| | | private readonly IWmsAreaRepository _wmsAreaRepository; |
| | | |
| | | public WmsEnumAppService(IWmsStoreRepository storeRepository, IWmsAreaRepository wmsAreaRepository) |
| | | { |
| | | _storeRepository = storeRepository; |
| | | _wmsAreaRepository = wmsAreaRepository; |
| | | } |
| | | |
| | | public List<EnumItem> GetEnumDataList(WmsEnumInput enumInput) |
| | | { |
| | | return EnumHelper.GetEnumItems(enumInput.EnumName); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åä»åºå表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public async Task<List<WmsStoreForAreaOutpur>> GetStreList() |
| | | { |
| | | var list = await _storeRepository.GetListForSelectAsync(); |
| | | if (list == null || list.Count <= 0) { return new List<WmsStoreForAreaOutpur>(); } |
| | | |
| | | var result = list.Select(x => new WmsStoreForAreaOutpur |
| | | { |
| | | StoreCode = x.StoreCode, |
| | | StoreName = x.StoreName, |
| | | }).ToList(); |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åºåºå表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public async Task<List<AreaForListOuptut>> GetAreaListAsync() |
| | | { |
| | | var list = await _wmsAreaRepository.GetListForSelectAsync(); |
| | | if (list == null || list.Count <= 0) { return new List<AreaForListOuptut>(); } |
| | | var result = list.Select(x=>new AreaForListOuptut |
| | | { |
| | | AreaName = x.AreaName, |
| | | AreaNo = x.AreaNo, |
| | | }).ToList(); |
| | | |
| | | return result; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsInOutStockRecord; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | using CMS.Plugin.HIAWms.Domain.Shared; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Util; |
| | | using CMS.Plugin.HIAWms.Domain.WmsInOutStockRecord; |
| | | using CmsQueryExtensions.Extension; |
| | | using System.Linq.Expressions; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Dtos; |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.ObjectExtending; |
| | | using Volo.Abp.ObjectMapping; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Implements; |
| | | |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½è¡¨åºç¨æå¡ |
| | | /// </summary> |
| | | public class WmsInOutStockRecordAppService : CMSPluginAppService, IWmsInOutStockRecordAppService |
| | | { |
| | | private readonly IWmsInOutStockRecordRepository wmsInOutStockRecordRepository; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsInOutStockRecordAppService"/> class. |
| | | /// </summary> |
| | | /// <param name="WmsInOutStockRecordRepository">The task job repository.</param> |
| | | public WmsInOutStockRecordAppService(IWmsInOutStockRecordRepository _WmsInOutStockRecordRepository) |
| | | { |
| | | wmsInOutStockRecordRepository = _WmsInOutStockRecordRepository; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åæå®åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task<WmsInOutStockRecordDto> GetAsync(Guid id) |
| | | { |
| | | return ObjectMapper.Map<WmsInOutStockRecord, WmsInOutStockRecordDto>(await wmsInOutStockRecordRepository.GetAsync(id)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å页è·ååºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task<PagedResultDto<WmsInOutStockRecordDto>> GetListAsync(GetWmsInOutStockRecordInput input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WmsInOutStockRecord.Sort); |
| | | } |
| | | |
| | | #region 卿æé æ¥è¯¢æ¡ä»¶ |
| | | |
| | | //卿æé æ¥è¯¢æ¡ä»¶ |
| | | var whereConditions = DynamicGetQueryParams(input); |
| | | |
| | | #endregion |
| | | |
| | | var count = await wmsInOutStockRecordRepository.GetCountAsync(whereConditions); |
| | | var list = await wmsInOutStockRecordRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount); |
| | | |
| | | return new PagedResultDto<WmsInOutStockRecordDto>(count, ObjectMapper.Map<List<WmsInOutStockRecord>, List<WmsInOutStockRecordDto>>(list)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 卿æé æ¥è¯¢æ¡ä»¶ |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥åæ°</param> |
| | | /// <returns></returns> |
| | | private FunReturnResultModel<Expression<Func<WmsInOutStockRecord, bool>>> DynamicGetQueryParams(GetWmsInOutStockRecordInput input) |
| | | { |
| | | //卿æé æ¥è¯¢æ¡ä»¶ |
| | | var whereConditions = WhereConditionsExtensions.GetWhereConditions<WmsInOutStockRecord, GetWmsInOutStockRecordInput>(input); |
| | | if (!whereConditions.IsSuccess) |
| | | { |
| | | throw new Exception("卿æé æ¥è¯¢æ¡ä»¶å¤±è´¥:" + whereConditions.ErrMsg); |
| | | } |
| | | |
| | | //ä¹å¯å次èªå®ä¹æå»ºæ¥è¯¢æ¡ä»¶ |
| | | Expression<Func<WmsInOutStockRecord, bool>> extendExpression = a => a.IsDeleted == false; |
| | | // ä½¿ç¨ System.Linq.PredicateBuilder ç And |
| | | var pres = (System.Linq.Expressions.Expression<Func<WmsInOutStockRecord, bool>>)(whereConditions.data); |
| | | whereConditions.data = System.Linq.PredicateBuilder.And(pres, extendExpression); |
| | | |
| | | return whereConditions; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ°å»ºåºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public virtual async Task<WmsInOutStockRecordDto> CreateAsync(WmsInOutStockRecordCreateDto input) |
| | | { |
| | | await CheckCreateOrUpdateDtoAsync(input); |
| | | |
| | | var exist = await wmsInOutStockRecordRepository.NameExistAsync(input.MaterialNo); |
| | | if (exist) |
| | | { |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.MaterialNo]); |
| | | } |
| | | |
| | | var maxSort = await wmsInOutStockRecordRepository.GetMaxSortAsync(); |
| | | var sort = input.Sort ?? maxSort; |
| | | |
| | | var insertObj = ObjectMapper.Map<WmsInOutStockRecordCreateDto, WmsInOutStockRecord>(input); |
| | | insertObj.Sort = sort; |
| | | input.MapExtraPropertiesTo(insertObj, MappingPropertyDefinitionChecks.None); |
| | | |
| | | await wmsInOutStockRecordRepository.InsertAsync(insertObj); |
| | | |
| | | if (input.Sort.HasValue && insertObj.Sort != maxSort) |
| | | { |
| | | await AdjustSortAsync(insertObj.Id, insertObj.Sort); |
| | | } |
| | | |
| | | return ObjectMapper.Map<WmsInOutStockRecord, WmsInOutStockRecordDto>(insertObj); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ´æ°åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public virtual async Task<WmsInOutStockRecordDto> UpdateAsync(Guid id, WmsInOutStockRecordUpdateDto input) |
| | | { |
| | | await CheckCreateOrUpdateDtoAsync(input); |
| | | |
| | | var updateObj = await wmsInOutStockRecordRepository.GetAsync(id); |
| | | var exist = await wmsInOutStockRecordRepository.NameExistAsync(input.MaterialNo, updateObj.Id); |
| | | if (exist) |
| | | { |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.MaterialNo]); |
| | | } |
| | | |
| | | updateObj.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp); |
| | | input.MapExtraPropertiesTo(updateObj, MappingPropertyDefinitionChecks.None); |
| | | |
| | | updateObj.OrderNo = input.OrderNo; |
| | | updateObj.MaterialName = input.MaterialName; |
| | | updateObj.MaterialNo = input.MaterialNo; |
| | | updateObj.StockType = input.StockType; |
| | | updateObj.ContainerNo = input.ContainerNo; |
| | | updateObj.MaterialModel = input.MaterialModel; |
| | | updateObj.OperateTime = input.OperateTime; |
| | | updateObj.Remark = input.Remark; |
| | | updateObj.MaterialId = input.MaterialId; |
| | | updateObj.TaskNo = input.TaskNo; |
| | | updateObj.SourcePlace = input.SourcePlace; |
| | | updateObj.ToPlace = input.ToPlace; |
| | | updateObj.IsDisabled = input.IsDisabled; |
| | | |
| | | |
| | | await wmsInOutStockRecordRepository.UpdateAsync(updateObj); |
| | | |
| | | return ObjectMapper.Map<WmsInOutStockRecord, WmsInOutStockRecordDto>(updateObj); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å
éåºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | public async Task<List<WmsInOutStockRecordDto>> CloneAsync(IEnumerable<Guid> ids) |
| | | { |
| | | //var wmsInOutStockRecords = new List<WmsInOutStockRecord>(); |
| | | //if (ids != null) |
| | | //{ |
| | | // var sort = await wmsInOutStockRecordRepository.GetMaxSortAsync(); |
| | | // foreach (var id in ids) |
| | | // { |
| | | // var WmsInOutStockRecord = await wmsInOutStockRecordRepository.FindAsync(id); |
| | | // if (WmsInOutStockRecord != null) |
| | | // { |
| | | // var name = WmsInOutStockRecord.Name + WmsInOutStockRecordConsts.CloneTag; |
| | | // var notExist = false; |
| | | // while (!notExist) |
| | | // { |
| | | // var exist = await wmsInOutStockRecordRepository.NameExistAsync(name); |
| | | // if (exist || wmsInOutStockRecords.Any(x => x.Name == name)) |
| | | // { |
| | | // name += WmsInOutStockRecordConsts.CloneTag; |
| | | // continue; |
| | | // } |
| | | |
| | | // notExist = true; |
| | | // } |
| | | |
| | | // //WmsInOutStockRecord = await wmsInOutStockRecordRepository.InsertAsync(WmsInOutStockRecord.Clone(GuidGenerator.Create(), name, sort++)); |
| | | // wmsInOutStockRecords.Add(WmsInOutStockRecord); |
| | | // } |
| | | // } |
| | | //} |
| | | |
| | | //return ObjectMapper.Map<List<WmsInOutStockRecord>, List<WmsInOutStockRecordDto>>(wmsInOutStockRecords); |
| | | return new List<WmsInOutStockRecordDto>(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å é¤å个åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public virtual Task DeleteAsync(Guid id) |
| | | { |
| | | return wmsInOutStockRecordRepository.DeleteAsync(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å é¤å¤ä¸ªåºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | public async Task DeleteManyAsync(IEnumerable<Guid> ids) |
| | | { |
| | | foreach (var id in ids) |
| | | { |
| | | await DeleteAsync(id); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è°æ´æåºåºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <param name="sort"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task AdjustSortAsync(Guid id, int sort) |
| | | { |
| | | var list = await wmsInOutStockRecordRepository.GetListAsync(null, nameof(WmsInOutStockRecord.Sort)); |
| | | if (list != null && list.Any()) |
| | | { |
| | | var initSort = 1; |
| | | list.ForEach(x => x.AdjustSort(initSort++)); |
| | | var entity = list.FirstOrDefault(x => x.Id == id); |
| | | if (entity != null) |
| | | { |
| | | if (sort == 1) |
| | | { |
| | | list.Where(x => x.Id != id).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | } |
| | | else if (entity.Sort > sort) |
| | | { |
| | | list.Where(x => x.Id != id && x.Sort >= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | list.Where(x => x.Id != id && x.Sort < sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1)); |
| | | } |
| | | else if (entity.Sort < sort) |
| | | { |
| | | list.Where(x => x.Id != id && x.Sort > sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | list.Where(x => x.Id != id && x.Sort <= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1)); |
| | | } |
| | | |
| | | entity.AdjustSort(sort); |
| | | } |
| | | } |
| | | |
| | | await wmsInOutStockRecordRepository.UpdateManyAsync(list); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导å
¥åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public async Task ImportAsync(WmsInOutStockRecordsImportModel input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | var wmsInOutStockRecordCreateDtos = new List<(int RowIndex, WmsInOutStockRecordCreateDto Item)>(); |
| | | var wmsInOutStockRecordUpdateDtos = new List<(int RowIndex, Guid Id, WmsInOutStockRecordUpdateDto Item)>(); |
| | | var importItems = input.WmsInOutStockRecords; |
| | | |
| | | if (importItems != null && importItems.Any()) |
| | | { |
| | | #region 导å
¥æ ¡éª |
| | | |
| | | // 夿åç§°æ¯å¦éå¤ï¼å¹¶è¾åºç¬¬å è¡éå¤ |
| | | var duplicateWmsInOutStockRecords = importItems.GroupBy(x => x.MaterialNo).Where(x => x.Count() > 1).ToList(); |
| | | if (duplicateWmsInOutStockRecords?.Any() == true) |
| | | { |
| | | var duplicateWmsInOutStockRecordMsgs = duplicateWmsInOutStockRecords.Select(x => $"第 {string.Join(",", x.Select(x => x.RowIndex))} è¡ï¼{x.Key} åç§°éå¤"); |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ {string.Join(",", duplicateWmsInOutStockRecordMsgs)}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | foreach (var impItem in importItems) |
| | | { |
| | | if (impItem.MaterialNo.IsNullOrWhiteSpace() && impItem.MaterialName.IsNullOrWhiteSpace()) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if (impItem.MaterialNo.IsNullOrWhiteSpace()) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{impItem.RowIndex}è¡ï¼WmsInOutStockRecordåç§°ä¸è½ä¸ºç©º"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | |
| | | var oldWmsInOutStockRecord = await wmsInOutStockRecordRepository.FindByNameAsync(impItem.MaterialNo); |
| | | if (oldWmsInOutStockRecord != null) |
| | | { |
| | | var wmsInOutStockRecordUpdateDto = new WmsInOutStockRecordUpdateDto |
| | | { |
| | | OrderNo = impItem.OrderNo, |
| | | MaterialName = impItem.MaterialName, |
| | | MaterialNo = impItem.MaterialNo, |
| | | StockType = impItem.StockType, |
| | | ContainerNo = impItem.ContainerNo, |
| | | MaterialModel = impItem.MaterialModel, |
| | | OperateTime = impItem.OperateTime, |
| | | Remark = impItem.Remark, |
| | | MaterialId = impItem.MaterialId, |
| | | TaskNo = impItem.TaskNo, |
| | | SourcePlace = impItem.SourcePlace, |
| | | ToPlace = impItem.ToPlace, |
| | | IsDisabled = impItem.IsDisabled, |
| | | |
| | | }; |
| | | |
| | | wmsInOutStockRecordUpdateDtos.Add((impItem.RowIndex, oldWmsInOutStockRecord.Id, wmsInOutStockRecordUpdateDto)); |
| | | } |
| | | else |
| | | { |
| | | var wmsInOutStockRecordCreateDto = new WmsInOutStockRecordCreateDto |
| | | { |
| | | OrderNo = impItem.OrderNo, |
| | | MaterialName = impItem.MaterialName, |
| | | MaterialNo = impItem.MaterialNo, |
| | | StockType = impItem.StockType, |
| | | ContainerNo = impItem.ContainerNo, |
| | | MaterialModel = impItem.MaterialModel, |
| | | OperateTime = impItem.OperateTime, |
| | | Remark = impItem.Remark, |
| | | MaterialId = impItem.MaterialId, |
| | | TaskNo = impItem.TaskNo, |
| | | SourcePlace = impItem.SourcePlace, |
| | | ToPlace = impItem.ToPlace, |
| | | IsDisabled = impItem.IsDisabled, |
| | | |
| | | }; |
| | | |
| | | wmsInOutStockRecordCreateDtos.Add((impItem.RowIndex, wmsInOutStockRecordCreateDto)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // æ°å¢ |
| | | foreach (var wmsInOutStockRecordDto in wmsInOutStockRecordCreateDtos) |
| | | { |
| | | try |
| | | { |
| | | await CreateAsync(wmsInOutStockRecordDto.Item); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{wmsInOutStockRecordDto.RowIndex}è¡ï¼{e.Message}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | } |
| | | |
| | | // æ´æ° |
| | | foreach (var wmsInOutStockRecordDto in wmsInOutStockRecordUpdateDtos) |
| | | { |
| | | try |
| | | { |
| | | await UpdateAsync(wmsInOutStockRecordDto.Id, wmsInOutStockRecordDto.Item); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{wmsInOutStockRecordDto.RowIndex}è¡ï¼{e.Message}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导åºåºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public async Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWmsInOutStockRecordInput input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WmsInOutStockRecord.Sort); |
| | | } |
| | | |
| | | #region 卿æé æ¥è¯¢æ¡ä»¶ |
| | | |
| | | //卿æé æ¥è¯¢æ¡ä»¶ |
| | | var whereConditions = DynamicGetQueryParams(input); |
| | | |
| | | #endregion |
| | | |
| | | |
| | | var list = await wmsInOutStockRecordRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount, includeDetails: true); |
| | | var result = ObjectMapper.Map<List<WmsInOutStockRecord>, List<WmsInOutStockRecordDto>>(list); |
| | | |
| | | var sheets = new Dictionary<string, object> |
| | | { |
| | | ["é
ç½®"] = ExportHelper.ConvertListToExportData(result), |
| | | }; |
| | | |
| | | var fileName = result.Count > 1 ? "åºå
¥åºè®°å½è¡¨å表" : result.Count == 1 ? result[0]?.MaterialNo : "WmsInOutStockRecord模ç"; |
| | | return (sheets, fileName); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¡éªåºå
¥åºè®°å½è¡¨ï¼å½æ°å»ºææ´æ°æ¶ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | protected Task CheckCreateOrUpdateDtoAsync(WmsInOutStockRecordCreateOrUpdateDtoBase input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | Check.NotNullOrWhiteSpace(input.OrderNo, "åæ®ç¼å·", 50); |
| | | Check.NotNullOrWhiteSpace(input.MaterialNo, "ç©æä»¶å·", 50); |
| | | Check.NotNull(input.StockType, "æä½ç±»å"); |
| | | Check.NotNullOrWhiteSpace(input.MaterialId, "ç©æID", 50); |
| | | Check.NotNullOrWhiteSpace(input.TaskNo, "ä»»å¡å·", 50); |
| | | |
| | | return Task.CompletedTask; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | using CMS.Plugin.HIAWms.Domain.Shared; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Util; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsMaterial; |
| | | using CMS.Plugin.HIAWms.Domain.WmsMaterial; |
| | | using CmsQueryExtensions.Extension; |
| | | using System.Linq.Expressions; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Dtos; |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.ObjectExtending; |
| | | using Volo.Abp.ObjectMapping; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Implements; |
| | | |
| | | /// <summary> |
| | | /// ç©æåºç¡ä¿¡æ¯è¡¨åºç¨æå¡ |
| | | /// </summary> |
| | | public class WmsMaterialAppService : CMSPluginAppService, IWmsMaterialAppService |
| | | { |
| | | private readonly IWmsMaterialRepository wmsmaterialsRepository; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsMaterialAppService"/> class. |
| | | /// </summary> |
| | | /// <param name="WmsMaterialRepository">The task job repository.</param> |
| | | public WmsMaterialAppService(IWmsMaterialRepository WmsMaterialRepository) |
| | | { |
| | | wmsmaterialsRepository = WmsMaterialRepository; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åæå®ç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task<WmsMaterialDto> GetAsync(Guid id) |
| | | { |
| | | return ObjectMapper.Map<WmsMaterial, WmsMaterialDto>(await wmsmaterialsRepository.GetAsync(id)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å页è·åç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task<PagedResultDto<WmsMaterialDto>> GetListAsync(GetWmsMaterialInput input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WmsMaterial.Sort); |
| | | } |
| | | |
| | | #region 卿æé æ¥è¯¢æ¡ä»¶ |
| | | |
| | | //卿æé æ¥è¯¢æ¡ä»¶ |
| | | var whereConditions = DynamicGetQueryParams(input); |
| | | |
| | | #endregion |
| | | |
| | | var count = await wmsmaterialsRepository.GetCountAsync(whereConditions); |
| | | var list = await wmsmaterialsRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount); |
| | | |
| | | return new PagedResultDto<WmsMaterialDto>(count, ObjectMapper.Map<List<WmsMaterial>, List<WmsMaterialDto>>(list)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 卿æé æ¥è¯¢æ¡ä»¶ |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥åæ°</param> |
| | | /// <returns></returns> |
| | | private FunReturnResultModel<Expression<Func<WmsMaterial, bool>>> DynamicGetQueryParams(GetWmsMaterialInput input) |
| | | { |
| | | //卿æé æ¥è¯¢æ¡ä»¶ |
| | | var whereConditions = WhereConditionsExtensions.GetWhereConditions<WmsMaterial, GetWmsMaterialInput>(input); |
| | | if (!whereConditions.IsSuccess) |
| | | { |
| | | throw new Exception("卿æé æ¥è¯¢æ¡ä»¶å¤±è´¥:" + whereConditions.ErrMsg); |
| | | } |
| | | |
| | | //ä¹å¯å次èªå®ä¹æå»ºæ¥è¯¢æ¡ä»¶ |
| | | Expression<Func<WmsMaterial, bool>> extendExpression = a => a.IsDeleted == false; |
| | | // ä½¿ç¨ System.Linq.PredicateBuilder ç And |
| | | var pres = (System.Linq.Expressions.Expression<Func<WmsMaterial, bool>>)(whereConditions.data); |
| | | whereConditions.data = System.Linq.PredicateBuilder.And(pres, extendExpression); |
| | | |
| | | return whereConditions; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ°å»ºç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public virtual async Task<WmsMaterialDto> CreateAsync(WmsMaterialCreateDto input) |
| | | { |
| | | await CheckCreateOrUpdateDtoAsync(input); |
| | | |
| | | var exist = await wmsmaterialsRepository.NameExistAsync(input.MaterialCode); |
| | | if (exist) |
| | | { |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.MaterialCode]); |
| | | } |
| | | |
| | | var maxSort = await wmsmaterialsRepository.GetMaxSortAsync(); |
| | | var sort = input.Sort ?? maxSort; |
| | | |
| | | var insertObj = ObjectMapper.Map<WmsMaterialCreateDto, WmsMaterial>(input); |
| | | insertObj.Sort = sort; |
| | | input.MapExtraPropertiesTo(insertObj, MappingPropertyDefinitionChecks.None); |
| | | |
| | | await wmsmaterialsRepository.InsertAsync(insertObj); |
| | | |
| | | if (input.Sort.HasValue && insertObj.Sort != maxSort) |
| | | { |
| | | await AdjustSortAsync(insertObj.Id, insertObj.Sort); |
| | | } |
| | | |
| | | return ObjectMapper.Map<WmsMaterial, WmsMaterialDto>(insertObj); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ´æ°ç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public virtual async Task<WmsMaterialDto> UpdateAsync(Guid id, WmsMaterialUpdateDto input) |
| | | { |
| | | await CheckCreateOrUpdateDtoAsync(input); |
| | | |
| | | var updateObj = await wmsmaterialsRepository.GetAsync(id); |
| | | var exist = await wmsmaterialsRepository.NameExistAsync(input.MaterialCode, updateObj.Id); |
| | | if (exist) |
| | | { |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.MaterialCode]); |
| | | } |
| | | |
| | | updateObj.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp); |
| | | input.MapExtraPropertiesTo(updateObj, MappingPropertyDefinitionChecks.None); |
| | | |
| | | updateObj.MaterialCode = input.MaterialCode; |
| | | updateObj.MaterialName = input.MaterialName; |
| | | updateObj.PurchaseType = input.PurchaseType; |
| | | updateObj.MaterialType = input.MaterialType; |
| | | updateObj.PrimaryUnit = input.PrimaryUnit; |
| | | updateObj.Standard = input.Standard; |
| | | updateObj.OuterDiameter = input.OuterDiameter; |
| | | updateObj.WallThickness = input.WallThickness; |
| | | updateObj.MaterialQuality = input.MaterialQuality; |
| | | updateObj.Length = input.Length; |
| | | updateObj.IsMainBranch = input.IsMainBranch; |
| | | updateObj.Factory = input.Factory; |
| | | updateObj.Certification = input.Certification; |
| | | updateObj.RedundantField1 = input.RedundantField1; |
| | | updateObj.RedundantField2 = input.RedundantField2; |
| | | updateObj.RedundantField3 = input.RedundantField3; |
| | | updateObj.Remark = input.Remark; |
| | | updateObj.IsDisabled = input.IsDisabled; |
| | | |
| | | |
| | | await wmsmaterialsRepository.UpdateAsync(updateObj); |
| | | |
| | | return ObjectMapper.Map<WmsMaterial, WmsMaterialDto>(updateObj); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å
éç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | public async Task<List<WmsMaterialDto>> CloneAsync(IEnumerable<Guid> ids) |
| | | { |
| | | //var wmsmaterialss = new List<WmsMaterial>(); |
| | | //if (ids != null) |
| | | //{ |
| | | // var sort = await wmsmaterialsRepository.GetMaxSortAsync(); |
| | | // foreach (var id in ids) |
| | | // { |
| | | // var WmsMaterial = await wmsmaterialsRepository.FindAsync(id); |
| | | // if (WmsMaterial != null) |
| | | // { |
| | | // var name = WmsMaterial.Name + WmsMaterialConsts.CloneTag; |
| | | // var notExist = false; |
| | | // while (!notExist) |
| | | // { |
| | | // var exist = await wmsmaterialsRepository.NameExistAsync(name); |
| | | // if (exist || wmsmaterialss.Any(x => x.Name == name)) |
| | | // { |
| | | // name += WmsMaterialConsts.CloneTag; |
| | | // continue; |
| | | // } |
| | | |
| | | // notExist = true; |
| | | // } |
| | | |
| | | // //WmsMaterial = await wmsmaterialsRepository.InsertAsync(WmsMaterial.Clone(GuidGenerator.Create(), name, sort++)); |
| | | // wmsmaterialss.Add(WmsMaterial); |
| | | // } |
| | | // } |
| | | //} |
| | | |
| | | //return ObjectMapper.Map<List<WmsMaterial>, List<WmsMaterialDto>>(wmsmaterialss); |
| | | return new List<WmsMaterialDto>(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å é¤åä¸ªç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public virtual Task DeleteAsync(Guid id) |
| | | { |
| | | return wmsmaterialsRepository.DeleteAsync(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å é¤å¤ä¸ªç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | public async Task DeleteManyAsync(IEnumerable<Guid> ids) |
| | | { |
| | | foreach (var id in ids) |
| | | { |
| | | await DeleteAsync(id); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è°æ´æåºç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <param name="sort"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task AdjustSortAsync(Guid id, int sort) |
| | | { |
| | | var list = await wmsmaterialsRepository.GetListAsync(null, nameof(WmsMaterial.Sort)); |
| | | if (list != null && list.Any()) |
| | | { |
| | | var initSort = 1; |
| | | list.ForEach(x => x.AdjustSort(initSort++)); |
| | | var entity = list.FirstOrDefault(x => x.Id == id); |
| | | if (entity != null) |
| | | { |
| | | if (sort == 1) |
| | | { |
| | | list.Where(x => x.Id != id).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | } |
| | | else if (entity.Sort > sort) |
| | | { |
| | | list.Where(x => x.Id != id && x.Sort >= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | list.Where(x => x.Id != id && x.Sort < sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1)); |
| | | } |
| | | else if (entity.Sort < sort) |
| | | { |
| | | list.Where(x => x.Id != id && x.Sort > sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | list.Where(x => x.Id != id && x.Sort <= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1)); |
| | | } |
| | | |
| | | entity.AdjustSort(sort); |
| | | } |
| | | } |
| | | |
| | | await wmsmaterialsRepository.UpdateManyAsync(list); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导å
¥ç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public async Task ImportAsync(WmsMaterialsImportModel input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | var wmsmaterialsCreateDtos = new List<(int RowIndex, WmsMaterialCreateDto Item)>(); |
| | | var wmsmaterialsUpdateDtos = new List<(int RowIndex, Guid Id, WmsMaterialUpdateDto Item)>(); |
| | | var importItems = input.WmsMaterials; |
| | | |
| | | if (importItems != null && importItems.Any()) |
| | | { |
| | | #region 导å
¥æ ¡éª |
| | | |
| | | // 夿åç§°æ¯å¦éå¤ï¼å¹¶è¾åºç¬¬å è¡éå¤ |
| | | var duplicateWmsMaterials = importItems.GroupBy(x => x.MaterialCode).Where(x => x.Count() > 1).ToList(); |
| | | if (duplicateWmsMaterials?.Any() == true) |
| | | { |
| | | var duplicateWmsMaterialMsgs = duplicateWmsMaterials.Select(x => $"第 {string.Join(",", x.Select(x => x.RowIndex))} è¡ï¼{x.Key} åç§°éå¤"); |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ {string.Join(",", duplicateWmsMaterialMsgs)}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | foreach (var impItem in importItems) |
| | | { |
| | | if (impItem.MaterialCode.IsNullOrWhiteSpace() && impItem.MaterialName.IsNullOrWhiteSpace()) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if (impItem.MaterialCode.IsNullOrWhiteSpace()) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{impItem.RowIndex}è¡ï¼WmsMaterialåç§°ä¸è½ä¸ºç©º"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | |
| | | var oldWmsMaterial = await wmsmaterialsRepository.FindByNameAsync(impItem.MaterialCode); |
| | | if (oldWmsMaterial != null) |
| | | { |
| | | var wmsmaterialsUpdateDto = new WmsMaterialUpdateDto |
| | | { |
| | | MaterialCode = impItem.MaterialCode, |
| | | MaterialName = impItem.MaterialName, |
| | | PurchaseType = impItem.PurchaseType, |
| | | MaterialType = impItem.MaterialType, |
| | | PrimaryUnit = impItem.PrimaryUnit, |
| | | Standard = impItem.Standard, |
| | | OuterDiameter = impItem.OuterDiameter, |
| | | WallThickness = impItem.WallThickness, |
| | | MaterialQuality = impItem.MaterialQuality, |
| | | Length = impItem.Length, |
| | | IsMainBranch = impItem.IsMainBranch, |
| | | Factory = impItem.Factory, |
| | | Certification = impItem.Certification, |
| | | Remark = impItem.Remark, |
| | | }; |
| | | |
| | | wmsmaterialsUpdateDtos.Add((impItem.RowIndex, oldWmsMaterial.Id, wmsmaterialsUpdateDto)); |
| | | } |
| | | else |
| | | { |
| | | var wmsmaterialsCreateDto = new WmsMaterialCreateDto |
| | | { |
| | | MaterialCode = impItem.MaterialCode, |
| | | MaterialName = impItem.MaterialName, |
| | | PurchaseType = impItem.PurchaseType, |
| | | MaterialType = impItem.MaterialType, |
| | | PrimaryUnit = impItem.PrimaryUnit, |
| | | Standard = impItem.Standard, |
| | | OuterDiameter = impItem.OuterDiameter, |
| | | WallThickness = impItem.WallThickness, |
| | | MaterialQuality = impItem.MaterialQuality, |
| | | Length = impItem.Length, |
| | | IsMainBranch = impItem.IsMainBranch, |
| | | Factory = impItem.Factory, |
| | | Certification = impItem.Certification, |
| | | Remark = impItem.Remark, |
| | | }; |
| | | |
| | | wmsmaterialsCreateDtos.Add((impItem.RowIndex, wmsmaterialsCreateDto)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // æ°å¢ |
| | | foreach (var wmsmaterialsDto in wmsmaterialsCreateDtos) |
| | | { |
| | | try |
| | | { |
| | | await CreateAsync(wmsmaterialsDto.Item); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{wmsmaterialsDto.RowIndex}è¡ï¼{e.Message}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | } |
| | | |
| | | // æ´æ° |
| | | foreach (var wmsmaterialsDto in wmsmaterialsUpdateDtos) |
| | | { |
| | | try |
| | | { |
| | | await UpdateAsync(wmsmaterialsDto.Id, wmsmaterialsDto.Item); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{wmsmaterialsDto.RowIndex}è¡ï¼{e.Message}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导åºç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public async Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWmsMaterialInput input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WmsMaterial.Sort); |
| | | } |
| | | |
| | | #region 卿æé æ¥è¯¢æ¡ä»¶ |
| | | |
| | | //卿æé æ¥è¯¢æ¡ä»¶ |
| | | var whereConditions = DynamicGetQueryParams(input); |
| | | |
| | | #endregion |
| | | |
| | | |
| | | var list = await wmsmaterialsRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount, includeDetails: true); |
| | | var result = ObjectMapper.Map<List<WmsMaterial>, List<WmsMaterialDto>>(list); |
| | | |
| | | var sheets = new Dictionary<string, object> |
| | | { |
| | | ["é
ç½®"] = ExportHelper.ConvertListToExportData(result), |
| | | }; |
| | | |
| | | var fileName = result.Count > 1 ? "WmsMaterialå表" : result.Count == 1 ? result[0]?.MaterialCode : "WmsMaterial模ç"; |
| | | return (sheets, fileName); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¡éªç©æåºç¡ä¿¡æ¯è¡¨ï¼å½æ°å»ºææ´æ°æ¶ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | protected Task CheckCreateOrUpdateDtoAsync(WmsMaterialCreateOrUpdateDtoBase input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | Check.NotNullOrWhiteSpace(input.MaterialCode, "ç©æç¼ç ï¼å¯ä¸æ è¯ï¼", 64); |
| | | Check.NotNullOrWhiteSpace(input.MaterialName, "ç©æåç§°", 128); |
| | | Check.NotNull(input.PurchaseType, "éè´ç±»åï¼æä¸¾å¼ï¼"); |
| | | Check.NotNull(input.MaterialType, "ç©æç±»åï¼æä¸¾å¼ï¼"); |
| | | Check.NotNull(input.OuterDiameter, "å¤å¾ï¼åä½ï¼mmï¼"); |
| | | Check.NotNull(input.WallThickness, "å£åï¼åä½ï¼mmï¼"); |
| | | Check.NotNull(input.Length, "é¿åº¦ï¼åä½ï¼mï¼"); |
| | | Check.NotNull(input.IsMainBranch, "æ¯å¦ä¸ºä¸»æ¯ç®¡"); |
| | | |
| | | return Task.CompletedTask; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsPlaces; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | using CMS.Plugin.HIAWms.Domain.WmsPlaces; |
| | | using CMS.Plugin.HIAWms.Domain.Shared; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsPlaces; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Dtos; |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.ObjectExtending; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Util; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Implements; |
| | | |
| | | /// <inheritdoc /> |
| | | public class WmsPlaceAppService : CMSPluginAppService, IWmsPlaceAppService |
| | | { |
| | | private readonly IWmsPlaceRepository _wmsplaceRepository; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsPlaceAppService"/> class. |
| | | /// </summary> |
| | | /// <param name="wmsplaceRepository">The task job repository.</param> |
| | | public WmsPlaceAppService(IWmsPlaceRepository wmsplaceRepository) |
| | | { |
| | | _wmsplaceRepository = wmsplaceRepository; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<WmsPlaceDto> GetAsync(Guid id) |
| | | { |
| | | return ObjectMapper.Map<WmsPlace, WmsPlaceDto>(await _wmsplaceRepository.GetAsync(id)); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<PagedResultDto<WmsPlaceDto>> GetListAsync(GetWmsPlacesInput input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WmsPlace.Sort); |
| | | } |
| | | |
| | | var specification = new WmsPlaceSpecification(input.Name); |
| | | var place = ObjectMapper.Map<GetWmsPlacesInput, WmsPlace>(input); |
| | | var count = await _wmsplaceRepository.GetCountAsync(place,input.Filter, specification); |
| | | var list = await _wmsplaceRepository.GetListAsync(place, input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification); |
| | | |
| | | return new PagedResultDto<WmsPlaceDto>(count, ObjectMapper.Map<List<WmsPlace>, List<WmsPlaceDto>>(list)); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<WmsPlaceDto> CreateAsync(WmsPlaceCreateDto input) |
| | | { |
| | | await CheckCreateOrUpdateDtoAsync(input); |
| | | |
| | | var exist = await _wmsplaceRepository.NameExistAsync(input.PlaceNo); |
| | | if (exist) |
| | | { |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.PlaceNo]); |
| | | } |
| | | |
| | | var maxSort = await _wmsplaceRepository.GetMaxSortAsync(); |
| | | var sort = input.Sort ?? maxSort; |
| | | var wmsplace = ObjectMapper.Map<WmsPlaceCreateDto,WmsPlace>(input); |
| | | input.MapExtraPropertiesTo(wmsplace, MappingPropertyDefinitionChecks.None); |
| | | wmsplace.Sort = sort; |
| | | await _wmsplaceRepository.InsertAsync(wmsplace); |
| | | |
| | | if (input.Sort.HasValue && wmsplace.Sort != maxSort) |
| | | { |
| | | await AdjustSortAsync(wmsplace.Id, wmsplace.Sort); |
| | | } |
| | | |
| | | return ObjectMapper.Map<WmsPlace, WmsPlaceDto>(wmsplace); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<WmsPlaceDto> UpdateAsync(Guid id, WmsPlaceUpdateDto input) |
| | | { |
| | | await CheckCreateOrUpdateDtoAsync(input); |
| | | |
| | | var wmsplace = await _wmsplaceRepository.GetAsync(id); |
| | | var exist = await _wmsplaceRepository.NameExistAsync(input.PlaceNo, wmsplace.Id); |
| | | if (exist) |
| | | { |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.PlaceNo]); |
| | | } |
| | | |
| | | wmsplace.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp); |
| | | input.MapExtraPropertiesTo(wmsplace, MappingPropertyDefinitionChecks.None); |
| | | |
| | | wmsplace.StorageTypeNo = input.StorageTypeNo; |
| | | wmsplace.PlaceStatus = input.PlaceStatus; |
| | | wmsplace.AreaCode = input.AreaCode; |
| | | wmsplace.Aisle = input.Aisle; |
| | | wmsplace.RowNo = input.RowNo; |
| | | wmsplace.ColumnNo = input.ColumnNo; |
| | | wmsplace.LayerNo = input.LayerNo; |
| | | wmsplace.Islock = input.Islock; |
| | | wmsplace.EmptyContainer = input.EmptyContainer; |
| | | wmsplace.RedundantField1 = input.RedundantField1; |
| | | wmsplace.RedundantField2 = input.RedundantField2; |
| | | wmsplace.RedundantField3 = input.RedundantField3; |
| | | wmsplace.Remark = input.Remark; |
| | | |
| | | await _wmsplaceRepository.UpdateAsync(wmsplace); |
| | | |
| | | return ObjectMapper.Map<WmsPlace, WmsPlaceDto>(wmsplace); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<List<WmsPlaceDto>> CloneAsync(IEnumerable<Guid> ids) |
| | | { |
| | | var wmsplaces = new List<WmsPlace>(); |
| | | if (ids != null) |
| | | { |
| | | var sort = await _wmsplaceRepository.GetMaxSortAsync(); |
| | | foreach (var id in ids) |
| | | { |
| | | var wmsplace = await _wmsplaceRepository.FindAsync(id); |
| | | if (wmsplace != null) |
| | | { |
| | | var name = wmsplace.PlaceNo + WmsPlaceConsts.CloneTag; |
| | | var notExist = false; |
| | | while (!notExist) |
| | | { |
| | | var exist = await _wmsplaceRepository.NameExistAsync(name); |
| | | if (exist || wmsplaces.Any(x => x.PlaceNo == name)) |
| | | { |
| | | name += WmsPlaceConsts.CloneTag; |
| | | continue; |
| | | } |
| | | |
| | | notExist = true; |
| | | } |
| | | |
| | | //wmsplace = await _wmsplaceRepository.InsertAsync(wmsplace.Clone(GuidGenerator.Create(), name, sort++)); |
| | | wmsplaces.Add(wmsplace); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return ObjectMapper.Map<List<WmsPlace>, List<WmsPlaceDto>>(wmsplaces); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual Task DeleteAsync(Guid id) |
| | | { |
| | | return _wmsplaceRepository.DeleteAsync(id); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task DeleteManyAsync(IEnumerable<Guid> ids) |
| | | { |
| | | foreach (var id in ids) |
| | | { |
| | | await DeleteAsync(id); |
| | | } |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task AdjustSortAsync(Guid id, int sort) |
| | | { |
| | | var list = await _wmsplaceRepository.GetListAsync(null,nameof(WmsPlace.Sort)); |
| | | if (list != null && list.Any()) |
| | | { |
| | | var initSort = 1; |
| | | list.ForEach(x => x.AdjustSort(initSort++)); |
| | | var entity = list.FirstOrDefault(x => x.Id == id); |
| | | if (entity != null) |
| | | { |
| | | if (sort == 1) |
| | | { |
| | | list.Where(x => x.Id != id).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | } |
| | | else if (entity.Sort > sort) |
| | | { |
| | | list.Where(x => x.Id != id && x.Sort >= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | list.Where(x => x.Id != id && x.Sort < sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1)); |
| | | } |
| | | else if (entity.Sort < sort) |
| | | { |
| | | list.Where(x => x.Id != id && x.Sort > sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | list.Where(x => x.Id != id && x.Sort <= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1)); |
| | | } |
| | | |
| | | entity.AdjustSort(sort); |
| | | } |
| | | } |
| | | |
| | | await _wmsplaceRepository.UpdateManyAsync(list); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task ImportAsync(WmsPlacesImportModel input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | var wmsplaceCreateDtos = new List<(int RowIndex, WmsPlaceCreateDto Item)>(); |
| | | var wmsplaceUpdateDtos = new List<(int RowIndex, Guid Id, WmsPlaceUpdateDto Item)>(); |
| | | var wmsplaces = input.WmsPlaces; |
| | | |
| | | if (wmsplaces != null && wmsplaces.Any()) |
| | | { |
| | | #region 导å
¥æ ¡éª |
| | | |
| | | // 夿åç§°æ¯å¦éå¤ï¼å¹¶è¾åºç¬¬å è¡éå¤ |
| | | var duplicateWmsPlaces = wmsplaces.GroupBy(x => x.PlaceNo).Where(x => x.Count() > 1).ToList(); |
| | | if (duplicateWmsPlaces?.Any() == true) |
| | | { |
| | | var duplicateWmsPlaceMsgs = duplicateWmsPlaces.Select(x => $"第 {string.Join(",", x.Select(x => x.RowIndex))} è¡ï¼{x.Key} åç§°éå¤"); |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ {string.Join(",", duplicateWmsPlaceMsgs)}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | foreach (var wmsplace in wmsplaces) |
| | | { |
| | | if (wmsplace.PlaceNo.IsNullOrWhiteSpace()) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if (wmsplace.PlaceNo.IsNullOrWhiteSpace()) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{wmsplace.RowIndex}è¡ï¼WmsPlaceåç§°ä¸è½ä¸ºç©º"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | |
| | | var oldWmsPlace = await _wmsplaceRepository.FindByNameAsync(wmsplace.PlaceNo); |
| | | if (oldWmsPlace != null) |
| | | { |
| | | var wmsplaceUpdateDto = new WmsPlaceUpdateDto |
| | | { |
| | | PlaceNo = wmsplace.PlaceNo, |
| | | PlaceStatus = wmsplace.PlaceStatus, |
| | | Remark = wmsplace.Remark, |
| | | }; |
| | | |
| | | wmsplaceUpdateDtos.Add((wmsplace.RowIndex, oldWmsPlace.Id, wmsplaceUpdateDto)); |
| | | } |
| | | else |
| | | { |
| | | var wmsplaceCreateDto = new WmsPlaceCreateDto |
| | | { |
| | | PlaceNo = wmsplace.PlaceNo, |
| | | PlaceStatus = wmsplace.PlaceStatus, |
| | | Remark = wmsplace.Remark, |
| | | }; |
| | | |
| | | wmsplaceCreateDtos.Add((wmsplace.RowIndex, wmsplaceCreateDto)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // æ°å¢ |
| | | foreach (var wmsplaceDto in wmsplaceCreateDtos) |
| | | { |
| | | try |
| | | { |
| | | await CreateAsync(wmsplaceDto.Item); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{wmsplaceDto.RowIndex}è¡ï¼{e.Message}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | } |
| | | |
| | | // æ´æ° |
| | | foreach (var wmsplaceDto in wmsplaceUpdateDtos) |
| | | { |
| | | try |
| | | { |
| | | await UpdateAsync(wmsplaceDto.Id, wmsplaceDto.Item); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{wmsplaceDto.RowIndex}è¡ï¼{e.Message}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWmsPlacesInput input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WmsPlace.Sort); |
| | | } |
| | | |
| | | var specification = new WmsPlaceSpecification(input.Name); |
| | | var place = ObjectMapper.Map<GetWmsPlacesInput, WmsPlace>(input); |
| | | var list = await _wmsplaceRepository.GetListAsync(place, input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification, includeDetails: true); |
| | | var result = ObjectMapper.Map<List<WmsPlace>, List<WmsPlaceDto>>(list); |
| | | |
| | | var sheets = new Dictionary<string, object> |
| | | { |
| | | ["é
ç½®"] = ExportHelper.ConvertListToExportData(result), |
| | | }; |
| | | |
| | | var fileName = result.Count > 1 ? "WmsPlaceå表" : result.Count == 1 ? result.First()?.PlaceNo : "WmsPlace模ç"; |
| | | return (sheets, fileName); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Checks the create or update dto asynchronous. |
| | | /// </summary> |
| | | /// <param name="input">The input.</param> |
| | | protected Task CheckCreateOrUpdateDtoAsync(WmsPlaceCreateOrUpdateDtoBase input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | Check.NotNullOrWhiteSpace(input.PlaceNo, "ç¼å·", WmsPlaceConsts.MaxCodeLength); |
| | | Check.Length(input.Remark, "夿³¨", WmsPlaceConsts.MaxRemarkLength); |
| | | return Task.CompletedTask; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsStores; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | using CMS.Plugin.HIAWms.Domain.WmsStores; |
| | | using CMS.Plugin.HIAWms.Domain.Shared; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsStores; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Dtos; |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.ObjectExtending; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Util; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Implements; |
| | | |
| | | /// <inheritdoc /> |
| | | public class WmsStoreAppService : CMSPluginAppService, IWmsStoreAppService |
| | | { |
| | | private readonly IWmsStoreRepository _wmsstoreRepository; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsStoreAppService"/> class. |
| | | /// </summary> |
| | | /// <param name="wmsstoreRepository">The task job repository.</param> |
| | | public WmsStoreAppService(IWmsStoreRepository wmsstoreRepository) |
| | | { |
| | | _wmsstoreRepository = wmsstoreRepository; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<WmsStoreDto> GetAsync(Guid id) |
| | | { |
| | | return ObjectMapper.Map<WmsStore, WmsStoreDto>(await _wmsstoreRepository.GetAsync(id)); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<PagedResultDto<WmsStoreDto>> GetListAsync(GetWmsStoresInput input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WmsStore.Sort); |
| | | } |
| | | |
| | | var specification = new WmsStoreSpecification(input.Name); |
| | | var store = ObjectMapper.Map<GetWmsStoresInput, WmsStore>(input); |
| | | var count = await _wmsstoreRepository.GetCountAsync(store,input.Filter, specification); |
| | | var list = await _wmsstoreRepository.GetListAsync(store,input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification); |
| | | |
| | | return new PagedResultDto<WmsStoreDto>(count, ObjectMapper.Map<List<WmsStore>, List<WmsStoreDto>>(list)); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<WmsStoreDto> CreateAsync(WmsStoreCreateDto input) |
| | | { |
| | | await CheckCreateOrUpdateDtoAsync(input); |
| | | |
| | | var exist = await _wmsstoreRepository.NameExistAsync(input.StoreCode); |
| | | if (exist) |
| | | { |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.StoreCode]); |
| | | } |
| | | |
| | | var maxSort = await _wmsstoreRepository.GetMaxSortAsync(); |
| | | var sort = input.Sort ?? maxSort; |
| | | var wmsstore = ObjectMapper.Map<WmsStoreCreateDto,WmsStore>(input); |
| | | wmsstore.Sort = sort; |
| | | input.MapExtraPropertiesTo(wmsstore, MappingPropertyDefinitionChecks.None); |
| | | |
| | | await _wmsstoreRepository.InsertAsync(wmsstore); |
| | | |
| | | if (input.Sort.HasValue && wmsstore.Sort != maxSort) |
| | | { |
| | | await AdjustSortAsync(wmsstore.Id, wmsstore.Sort); |
| | | } |
| | | |
| | | return ObjectMapper.Map<WmsStore, WmsStoreDto>(wmsstore); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<WmsStoreDto> UpdateAsync(Guid id, WmsStoreUpdateDto input) |
| | | { |
| | | await CheckCreateOrUpdateDtoAsync(input); |
| | | |
| | | var wmsstore = await _wmsstoreRepository.GetAsync(id); |
| | | var exist = await _wmsstoreRepository.NameExistAsync(input.StoreCode, wmsstore.Id); |
| | | if (exist) |
| | | { |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.StoreCode]); |
| | | } |
| | | |
| | | wmsstore.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp); |
| | | input.MapExtraPropertiesTo(wmsstore, MappingPropertyDefinitionChecks.None); |
| | | |
| | | wmsstore.StoreName = input.StoreName; |
| | | wmsstore.Remark = input.Remark; |
| | | |
| | | await _wmsstoreRepository.UpdateAsync(wmsstore); |
| | | |
| | | return ObjectMapper.Map<WmsStore, WmsStoreDto>(wmsstore); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<List<WmsStoreDto>> CloneAsync(IEnumerable<Guid> ids) |
| | | { |
| | | var wmsstores = new List<WmsStore>(); |
| | | if (ids != null) |
| | | { |
| | | var sort = await _wmsstoreRepository.GetMaxSortAsync(); |
| | | foreach (var id in ids) |
| | | { |
| | | var wmsstore = await _wmsstoreRepository.FindAsync(id); |
| | | if (wmsstore != null) |
| | | { |
| | | var name = wmsstore.StoreName + WmsStoreConsts.CloneTag; |
| | | var notExist = false; |
| | | while (!notExist) |
| | | { |
| | | var exist = await _wmsstoreRepository.NameExistAsync(name); |
| | | if (exist || wmsstores.Any(x => x.StoreCode == name)) |
| | | { |
| | | name += WmsStoreConsts.CloneTag; |
| | | continue; |
| | | } |
| | | |
| | | notExist = true; |
| | | } |
| | | |
| | | //wmsstore = await _wmsstoreRepository.InsertAsync(wmsstore.Clone(GuidGenerator.Create(), name, sort++)); |
| | | wmsstores.Add(wmsstore); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return ObjectMapper.Map<List<WmsStore>, List<WmsStoreDto>>(wmsstores); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual Task DeleteAsync(Guid id) |
| | | { |
| | | return _wmsstoreRepository.DeleteAsync(id); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task DeleteManyAsync(IEnumerable<Guid> ids) |
| | | { |
| | | foreach (var id in ids) |
| | | { |
| | | await DeleteAsync(id); |
| | | } |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task AdjustSortAsync(Guid id, int sort) |
| | | { |
| | | var list = await _wmsstoreRepository.GetListAsync(null,nameof(WmsStore.Sort)); |
| | | if (list != null && list.Any()) |
| | | { |
| | | var initSort = 1; |
| | | list.ForEach(x => x.AdjustSort(initSort++)); |
| | | var entity = list.FirstOrDefault(x => x.Id == id); |
| | | if (entity != null) |
| | | { |
| | | if (sort == 1) |
| | | { |
| | | list.Where(x => x.Id != id).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | } |
| | | else if (entity.Sort > sort) |
| | | { |
| | | list.Where(x => x.Id != id && x.Sort >= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | list.Where(x => x.Id != id && x.Sort < sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1)); |
| | | } |
| | | else if (entity.Sort < sort) |
| | | { |
| | | list.Where(x => x.Id != id && x.Sort > sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | list.Where(x => x.Id != id && x.Sort <= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1)); |
| | | } |
| | | |
| | | entity.AdjustSort(sort); |
| | | } |
| | | } |
| | | |
| | | await _wmsstoreRepository.UpdateManyAsync(list); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task ImportAsync(WmsStoresImportModel input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | var wmsstoreCreateDtos = new List<(int RowIndex, WmsStoreCreateDto Item)>(); |
| | | var wmsstoreUpdateDtos = new List<(int RowIndex, Guid Id, WmsStoreUpdateDto Item)>(); |
| | | var wmsstores = input.WmsStores; |
| | | |
| | | if (wmsstores != null && wmsstores.Any()) |
| | | { |
| | | #region 导å
¥æ ¡éª |
| | | |
| | | // 夿åç§°æ¯å¦éå¤ï¼å¹¶è¾åºç¬¬å è¡éå¤ |
| | | var duplicateWmsStores = wmsstores.GroupBy(x => x.StoreCode).Where(x => x.Count() > 1).ToList(); |
| | | if (duplicateWmsStores?.Any() == true) |
| | | { |
| | | var duplicateWmsStoreMsgs = duplicateWmsStores.Select(x => $"第 {string.Join(",", x.Select(x => x.RowIndex))} è¡ï¼{x.Key} åç§°éå¤"); |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ {string.Join(",", duplicateWmsStoreMsgs)}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | foreach (var wmsstore in wmsstores) |
| | | { |
| | | if (wmsstore.StoreCode.IsNullOrWhiteSpace() && wmsstore.StoreName.IsNullOrWhiteSpace()) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if (wmsstore.StoreCode.IsNullOrWhiteSpace()) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{wmsstore.RowIndex}è¡ï¼WmsStoreåç§°ä¸è½ä¸ºç©º"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | |
| | | var oldWmsStore = await _wmsstoreRepository.FindByNameAsync(wmsstore.StoreCode); |
| | | if (oldWmsStore != null) |
| | | { |
| | | var wmsstoreUpdateDto = new WmsStoreUpdateDto |
| | | { |
| | | StoreCode = wmsstore.StoreCode, |
| | | StoreName = wmsstore.StoreName, |
| | | Remark = wmsstore.Remark, |
| | | }; |
| | | |
| | | wmsstoreUpdateDtos.Add((wmsstore.RowIndex, oldWmsStore.Id, wmsstoreUpdateDto)); |
| | | } |
| | | else |
| | | { |
| | | var wmsstoreCreateDto = new WmsStoreCreateDto |
| | | { |
| | | StoreCode = wmsstore.StoreCode, |
| | | StoreName = wmsstore.StoreName, |
| | | Remark = wmsstore.Remark, |
| | | }; |
| | | |
| | | wmsstoreCreateDtos.Add((wmsstore.RowIndex, wmsstoreCreateDto)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // æ°å¢ |
| | | foreach (var wmsstoreDto in wmsstoreCreateDtos) |
| | | { |
| | | try |
| | | { |
| | | await CreateAsync(wmsstoreDto.Item); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{wmsstoreDto.RowIndex}è¡ï¼{e.Message}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | } |
| | | |
| | | // æ´æ° |
| | | foreach (var wmsstoreDto in wmsstoreUpdateDtos) |
| | | { |
| | | try |
| | | { |
| | | await UpdateAsync(wmsstoreDto.Id, wmsstoreDto.Item); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{wmsstoreDto.RowIndex}è¡ï¼{e.Message}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWmsStoresInput input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WmsStore.Sort); |
| | | } |
| | | |
| | | var specification = new WmsStoreSpecification(input.Name); |
| | | var store = ObjectMapper.Map<GetWmsStoresInput, WmsStore>(input); |
| | | var list = await _wmsstoreRepository.GetListAsync(store, input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification, includeDetails: true); |
| | | var result = ObjectMapper.Map<List<WmsStore>, List<WmsStoreDto>>(list); |
| | | |
| | | var sheets = new Dictionary<string, object> |
| | | { |
| | | ["é
ç½®"] = ExportHelper.ConvertListToExportData(result), |
| | | }; |
| | | |
| | | var fileName = result.Count > 1 ? "WmsStoreå表" : result.Count == 1 ? result.First()?.StoreCode : "WmsStore模ç"; |
| | | return (sheets, fileName); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Checks the create or update dto asynchronous. |
| | | /// </summary> |
| | | /// <param name="input">The input.</param> |
| | | protected Task CheckCreateOrUpdateDtoAsync(WmsStoreCreateOrUpdateDtoBase input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | Check.NotNullOrWhiteSpace(input.StoreCode, "ç¼å·", WmsStoreConsts.MaxCodeLength); |
| | | Check.NotNullOrWhiteSpace(input.StoreName, "åç§°", WmsStoreConsts.MaxNameLength); |
| | | Check.Length(input.Remark, "夿³¨", WmsStoreConsts.MaxRemarkLength); |
| | | return Task.CompletedTask; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using AutoMapper; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsAreas; |
| | | using CMS.Plugin.HIAWms.Domain.WmsAreas; |
| | | using Volo.Abp.ObjectExtending; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.MapperProfiles; |
| | | |
| | | /// <summary> |
| | | /// AutoMapperé
ç½® |
| | | /// </summary> |
| | | /// <seealso cref="AutoMapper.Profile" /> |
| | | public class WmsAreaAutoMapperProfile : Profile |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsAreaAutoMapperProfile"/> class. |
| | | /// </summary> |
| | | public WmsAreaAutoMapperProfile() |
| | | { |
| | | /* You can configure your AutoMapper mapping configuration here. |
| | | * Alternatively, you can split your mapping configurations |
| | | * into multiple profile classes for a better organization. */ |
| | | CreateMap<WmsArea, WmsAreaDto>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | CreateMap<WmsAreaCreateDto, WmsArea>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | CreateMap<GetWmsAreasInput, WmsArea>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using AutoMapper; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers; |
| | | using CMS.Plugin.HIAWms.Domain.WmsContainers; |
| | | using Volo.Abp.ObjectExtending; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.MapperProfiles; |
| | | |
| | | /// <summary> |
| | | /// AutoMapperé
ç½® |
| | | /// </summary> |
| | | /// <seealso cref="AutoMapper.Profile" /> |
| | | public class WmsContainerAutoMapperProfile : Profile |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsContainerAutoMapperProfile"/> class. |
| | | /// </summary> |
| | | public WmsContainerAutoMapperProfile() |
| | | { |
| | | /* You can configure your AutoMapper mapping configuration here. |
| | | * Alternatively, you can split your mapping configurations |
| | | * into multiple profile classes for a better organization. */ |
| | | CreateMap<WmsContainer, WmsContainerDto>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | CreateMap<WmsContainerCreateDto, WmsContainer>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | CreateMap<GetWmsContainersInput, WmsContainer>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using AutoMapper; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsInOutStockRecord; |
| | | using CMS.Plugin.HIAWms.Domain.WmsInOutStockRecord; |
| | | using Volo.Abp.ObjectExtending; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.MapperProfiles; |
| | | |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½è¡¨AutoMapperé
ç½® |
| | | /// </summary> |
| | | /// <seealso cref="AutoMapper.Profile" /> |
| | | public class WmsInOutStockRecordAutoMapperProfile : Profile |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsInOutStockRecordAutoMapperProfile"/> class. |
| | | /// </summary> |
| | | public WmsInOutStockRecordAutoMapperProfile() |
| | | { |
| | | /* You can configure your AutoMapper mapping configuration here. |
| | | * Alternatively, you can split your mapping configurations |
| | | * into multiple profile classes for a better organization. */ |
| | | CreateMap<WmsInOutStockRecord, WmsInOutStockRecordDto>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | CreateMap<WmsInOutStockRecordCreateDto, WmsInOutStockRecord>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | CreateMap<GetWmsInOutStockRecordInput, WmsInOutStockRecord>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using AutoMapper; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial; |
| | | using CMS.Plugin.HIAWms.Domain.WmsMaterial; |
| | | using Volo.Abp.ObjectExtending; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.MapperProfiles; |
| | | |
| | | /// <summary> |
| | | /// AutoMapperé
ç½® |
| | | /// </summary> |
| | | /// <seealso cref="AutoMapper.Profile" /> |
| | | public class WmsMaterialAutoMapperProfile : Profile |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsMaterialAutoMapperProfile"/> class. |
| | | /// </summary> |
| | | public WmsMaterialAutoMapperProfile() |
| | | { |
| | | /* You can configure your AutoMapper mapping configuration here. |
| | | * Alternatively, you can split your mapping configurations |
| | | * into multiple profile classes for a better organization. */ |
| | | CreateMap<WmsMaterial, WmsMaterialDto>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | CreateMap<WmsMaterialCreateDto, WmsMaterial>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | CreateMap<GetWmsMaterialInput, WmsMaterial>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using AutoMapper; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsPlaces; |
| | | using CMS.Plugin.HIAWms.Domain.WmsPlaces; |
| | | using Volo.Abp.ObjectExtending; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.MapperProfiles; |
| | | |
| | | /// <summary> |
| | | /// AutoMapperé
ç½® |
| | | /// </summary> |
| | | /// <seealso cref="AutoMapper.Profile" /> |
| | | public class WmsPlaceAutoMapperProfile : Profile |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsPlaceAutoMapperProfile"/> class. |
| | | /// </summary> |
| | | public WmsPlaceAutoMapperProfile() |
| | | { |
| | | /* You can configure your AutoMapper mapping configuration here. |
| | | * Alternatively, you can split your mapping configurations |
| | | * into multiple profile classes for a better organization. */ |
| | | CreateMap<WmsPlace, WmsPlaceDto>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | CreateMap<WmsPlaceCreateDto, WmsPlace>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | CreateMap<GetWmsPlacesInput, WmsPlace>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using AutoMapper; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsStores; |
| | | using CMS.Plugin.HIAWms.Domain.WmsStores; |
| | | using Volo.Abp.ObjectExtending; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.MapperProfiles; |
| | | |
| | | /// <summary> |
| | | /// AutoMapperé
ç½® |
| | | /// </summary> |
| | | /// <seealso cref="AutoMapper.Profile" /> |
| | | public class WmsStoreAutoMapperProfile : Profile |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsStoreAutoMapperProfile"/> class. |
| | | /// </summary> |
| | | public WmsStoreAutoMapperProfile() |
| | | { |
| | | /* You can configure your AutoMapper mapping configuration here. |
| | | * Alternatively, you can split your mapping configurations |
| | | * into multiple profile classes for a better organization. */ |
| | | CreateMap<WmsStore, WmsStoreDto>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | CreateMap<WmsStoreCreateDto, WmsStore>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | CreateMap<GetWmsStoresInput, WmsStore>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Runtime.CompilerServices; |
| | | [assembly:InternalsVisibleToAttribute("CMS.Plugin.Application.Tests")] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | |
| | | <Import Project="../../common.props" /> |
| | | <Import Project="../../configureawait.props" /> |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | <GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest> |
| | | <GenerateDocumentationFile>True</GenerateDocumentationFile> |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="KissUtil" Version="1.0.1" /> |
| | | <PackageReference Include="Volo.Abp.Localization" Version="$(ABPPackageVersion)" /> |
| | | <PackageReference Include="Volo.Abp.Validation" Version="$(ABPPackageVersion)" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <EmbeddedResource Include="Localization\HIAWms\*.json" /> |
| | | <Content Remove="Localization\HIAWms\*.json" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" /> |
| | | <PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="6.0.20" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared; |
| | | |
| | | /// <summary> |
| | | /// é误ç¼ç å®ä¹ |
| | | /// </summary> |
| | | public static class CMSPluginDomainErrorCodes |
| | | { |
| | | /// <summary> |
| | | /// The prefix |
| | | /// </summary> |
| | | private const string Prefix = "CMS.Plugin.HIAWms:"; |
| | | |
| | | /* You can add your business exception error codes here, as constants */ |
| | | |
| | | public const string NameAlreadyExists = Prefix + nameof(NameAlreadyExists); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Localization; |
| | | using Volo.Abp.Localization; |
| | | using Volo.Abp.Modularity; |
| | | using Volo.Abp.Validation; |
| | | using Volo.Abp.Validation.Localization; |
| | | using Volo.Abp.VirtualFileSystem; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared; |
| | | |
| | | /// <summary> |
| | | /// é¢åå
±äº«æ¨¡å |
| | | /// </summary> |
| | | [DependsOn(typeof(AbpLocalizationModule), |
| | | typeof(AbpValidationModule))] |
| | | public class CMSPluginDomainSharedModule : AbpModule |
| | | { |
| | | /// <inheritdoc /> |
| | | public override void PreConfigureServices(ServiceConfigurationContext context) |
| | | { |
| | | CMSPluginModuleExtensionConfigurator.Configure(); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public override void ConfigureServices(ServiceConfigurationContext context) |
| | | { |
| | | Configure<AbpVirtualFileSystemOptions>(options => |
| | | { |
| | | options.FileSets.AddEmbedded<CMSPluginDomainSharedModule>(); |
| | | }); |
| | | |
| | | Configure<AbpLocalizationOptions>(options => |
| | | { |
| | | options.Resources |
| | | .Add<HIAWmsResource>("en") |
| | | .AddBaseTypes(typeof(AbpValidationResource)) |
| | | .AddVirtualJson("/Localization/HIAWms"); |
| | | |
| | | options.DefaultResourceType = typeof(HIAWmsResource); |
| | | }); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Threading; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared; |
| | | |
| | | /// <summary> |
| | | /// æ¨¡åæ©å±é
ç½®å¨ |
| | | /// </summary> |
| | | public static class CMSPluginModuleExtensionConfigurator |
| | | { |
| | | private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); |
| | | |
| | | /// <summary> |
| | | /// Configures this instance. |
| | | /// </summary> |
| | | public static void Configure() |
| | | { |
| | | OneTimeRunner.Run(() => |
| | | { |
| | | ConfigureExistingProperties(); |
| | | ConfigureExtraProperties(); |
| | | }); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Configures the existing properties. |
| | | /// </summary> |
| | | private static void ConfigureExistingProperties() |
| | | { |
| | | /* You can change max lengths for properties of the |
| | | * entities defined in the modules used by your application. |
| | | * |
| | | * Example: Change user and role name max lengths |
| | | |
| | | IdentityUserConsts.MaxNameLength = 99; |
| | | IdentityRoleConsts.MaxNameLength = 99; |
| | | |
| | | * Notice: It is not suggested to change property lengths |
| | | * unless you really need it. Go with the standard values wherever possible. |
| | | * |
| | | * If you are using EF Core, you will need to run the add-migration command after your changes. |
| | | */ |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Configures the extra properties. |
| | | /// </summary> |
| | | private static void ConfigureExtraProperties() |
| | | { |
| | | /* You can configure extra properties for the |
| | | * entities defined in the modules used by your application. |
| | | * |
| | | * This class can be used to define these extra properties |
| | | * with a high level, easy to use API. |
| | | * |
| | | * Example: Add a new property to the user entity of the identity module |
| | | |
| | | ObjectExtensionManager.Instance.Modules() |
| | | .ConfigureIdentity(identity => |
| | | { |
| | | identity.ConfigureUser(user => |
| | | { |
| | | user.AddOrUpdateProperty<string>( //property type: string |
| | | "SocialSecurityNumber", //property name |
| | | property => |
| | | { |
| | | //validation rules |
| | | property.Attributes.Add(new RequiredAttribute()); |
| | | property.Attributes.Add(new StringLengthAttribute(64) {MinimumLength = 4}); |
| | | |
| | | property.Configuration[IdentityModuleExtensionConsts.ConfigurationNames.AllowUserToEdit] = true; |
| | | |
| | | //...other configurations for this property |
| | | } |
| | | ); |
| | | }); |
| | | }); |
| | | |
| | | * See the documentation for more: |
| | | * https://docs.abp.io/en/abp/latest/Module-Entity-Extensions |
| | | */ |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.Enums |
| | | { |
| | | /// <summary> |
| | | /// åºåºç¶æ |
| | | /// </summary> |
| | | [Description("åºåºç¶æ")] |
| | | public enum AreaStatusEnum |
| | | { |
| | | /// <summary> |
| | | /// æ£å¸¸ |
| | | /// </summary> |
| | | [Description("æ£å¸¸")] |
| | | ZHEGNCHANGSHIYONG = 1, |
| | | |
| | | /// <summary> |
| | | /// åç¨ |
| | | /// </summary> |
| | | [Description("åç¨")] |
| | | TINGYONG = 2 |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.Enums |
| | | { |
| | | |
| | | /// <summary> |
| | | /// åºåºç±»å |
| | | /// </summary> |
| | | [Description("åºåºç±»å")] |
| | | public enum AreaTypeEnum |
| | | { |
| | | /// <summary> |
| | | /// ç«ä½åº |
| | | /// </summary> |
| | | [Description("ç«ä½åº")] |
| | | LITIKU = 1, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.Enums |
| | | { |
| | | |
| | | /// <summary> |
| | | /// æçç¶æ |
| | | /// </summary> |
| | | [Description("æçç¶æ")] |
| | | public enum ContainerStatusEnum |
| | | { |
| | | |
| | | /// <summary> |
| | | /// ç©ºé² |
| | | /// </summary> |
| | | [Description("空é²")] |
| | | KOUXIAN = 1, |
| | | |
| | | /// <summary> |
| | | /// ç»ç |
| | | /// </summary> |
| | | [Description("ç»ç")] |
| | | ZUPANG = 2, |
| | | |
| | | /// <summary> |
| | | /// åºä½ |
| | | /// </summary> |
| | | [Description("åºä½")] |
| | | KUWEI = 3, |
| | | |
| | | /// <summary> |
| | | /// èæåºä½ |
| | | /// </summary> |
| | | [Description("èæåºä½")] |
| | | XUNIKUWEI = 4, |
| | | |
| | | /// <summary> |
| | | /// ç»æ |
| | | /// </summary> |
| | | [Description("ç»æ")] |
| | | ZUTUO = 5, |
| | | |
| | | /// <summary> |
| | | /// å¼å¸¸ |
| | | /// </summary> |
| | | [Description("å¼å¸¸")] |
| | | EXCEPTION = 9, |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.Enums |
| | | { |
| | | /// <summary> |
| | | /// æçç±»å |
| | | /// </summary> |
| | | [Description("æçç±»å")] |
| | | public enum ContainerTypeEnum |
| | | { |
| | | /// <summary> |
| | | /// èªå¶ä»¶æç |
| | | /// </summary> |
| | | [Description("èªå¶ä»¶æç")] |
| | | ZIZHIJIAN = 1, |
| | | |
| | | /// <summary> |
| | | /// å¤åä»¶æç |
| | | /// </summary> |
| | | [Description("å¤åä»¶æç")] |
| | | WAIXIEJIAN = 2, |
| | | |
| | | /// <summary> |
| | | /// èææç |
| | | /// </summary> |
| | | [Description("èææç")] |
| | | XUNI = 3, |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.ComponentModel; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.Enums |
| | | { |
| | | /// <summary> |
| | | /// HIAWmsç¶æ |
| | | /// </summary> |
| | | public enum HIAWmsStatus : byte |
| | | { |
| | | /// <summary> |
| | | /// æªæ§è¡ |
| | | /// </summary> |
| | | [Description("æªæ§è¡")] |
| | | Initial = 0, |
| | | |
| | | /// <summary> |
| | | /// æ§è¡ä¸ |
| | | /// </summary> |
| | | [Description("æ§è¡ä¸")] |
| | | Excuting = 1, |
| | | |
| | | /// <summary> |
| | | /// 已宿 |
| | | /// </summary> |
| | | [Description("已宿")] |
| | | Completed = 4, |
| | | |
| | | /// <summary> |
| | | /// 已强å¶å®æ |
| | | /// </summary> |
| | | [Description("已宿")] |
| | | Finished = 5, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.Enums |
| | | { |
| | | /// <summary> |
| | | /// ç©æç±»å |
| | | /// </summary> |
| | | [Description("ç©æç±»å")] |
| | | public enum MaterialTypeEnum |
| | | { |
| | | /// <summary> |
| | | /// æå |
| | | /// </summary> |
| | | [Description(" æå")] |
| | | FinishedGoods =1, |
| | | |
| | | /// <summary> |
| | | /// åæå |
| | | /// </summary> |
| | | [Description("åæå")] |
| | | SemiFinishedGoods =2, |
| | | |
| | | /// <summary> |
| | | /// åææ |
| | | /// </summary> |
| | | [Description("åææ")] |
| | | RawMaterials =3, |
| | | |
| | | /// <summary> |
| | | /// éä»¶ |
| | | /// </summary> |
| | | [Description(" éä»¶")] |
| | | Attachments =4 |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.Enums |
| | | { |
| | | /// <summary> |
| | | /// åºä½ç¶æ |
| | | /// </summary> |
| | | [Description("åºä½ç¶æ")] |
| | | public enum PlaceStatusEnum |
| | | { |
| | | /// <summary> |
| | | /// ç©ºé² |
| | | /// </summary> |
| | | [Description("空é²")] |
| | | KONGXIAN = 1, |
| | | /// <summary> |
| | | /// å¾
å
¥ |
| | | /// </summary> |
| | | [Description("å¾
å
¥")] |
| | | DAIRU = 2, |
| | | /// <summary> |
| | | /// åè´§ |
| | | /// </summary> |
| | | [Description("åè´§")] |
| | | CUNHUO = 3, |
| | | /// <summary> |
| | | /// å¾
åº |
| | | /// </summary> |
| | | [Description("å¾
åº")] |
| | | DAICHU = 4, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.Enums |
| | | { |
| | | /// <summary> |
| | | /// åºä½ç±»å |
| | | /// </summary> |
| | | [Description("åºä½ç±»å")] |
| | | public enum PlaceTypeEnum |
| | | { |
| | | /// <summary> |
| | | /// åæåºä½ |
| | | /// </summary> |
| | | [Description("åæåºä½")] |
| | | YUANLIAOKUWEI = 1, |
| | | |
| | | [Description("èæåºä½")] |
| | | XUNIKUWEI = 2, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.Enums |
| | | { |
| | | /// <summary> |
| | | /// éè´ç±»å |
| | | /// </summary> |
| | | [Description("éè´ç±»å")] |
| | | public enum PurchaseTypeEnum |
| | | { |
| | | /// <summary> |
| | | /// /èªå¶ |
| | | /// </summary> |
| | | [Description("èªå¶")] |
| | | SelfMade = 1, |
| | | |
| | | /// <summary> |
| | | /// éè´ |
| | | /// </summary> |
| | | [Description("éè´")] |
| | | Purchased = 2, |
| | | |
| | | /// <summary> |
| | | /// åå¯ |
| | | /// </summary> |
| | | [Description("åå¯")] |
| | | Both = 3 |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.Enums |
| | | { |
| | | /// <summary> |
| | | /// åä»»å¡ç±»å |
| | | /// </summary> |
| | | [Description("åä»»å¡ç±»å")] |
| | | public enum SonTaskTypeEnum |
| | | { |
| | | /// <summary> |
| | | /// èªå¨å
¥åº |
| | | /// </summary> |
| | | [Description("èªå¨å
¥åº")] |
| | | ZDRUKU = 1, |
| | | |
| | | /// <summary> |
| | | /// 人工å
¥åº |
| | | /// </summary> |
| | | [Description("人工å
¥åº")] |
| | | RGRUKU = 2, |
| | | |
| | | /// <summary> |
| | | /// 人工åºåº |
| | | /// </summary> |
| | | [Description("人工åºåº")] |
| | | RGCHUKU = 3, |
| | | /// <summary> |
| | | /// èªå¨åºåº |
| | | /// </summary> |
| | | [Description("èªå¨åºåº")] |
| | | ZDCHUKU = 4, |
| | | |
| | | /// <summary> |
| | | /// 空æå¼å« |
| | | /// </summary> |
| | | [Description("空æå¼å«")] |
| | | KTHUJIOA = 5, |
| | | |
| | | /// <summary> |
| | | /// ååº |
| | | /// </summary> |
| | | [Description("ååº")] |
| | | HUIKU = 6, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.Enums |
| | | { |
| | | /// <summary> |
| | | /// åºåç±»å |
| | | /// </summary> |
| | | [Description("åºåç±»å")] |
| | | public enum StockTypeEnum |
| | | { |
| | | /// <summary> |
| | | /// å
¥åº |
| | | /// </summary> |
| | | [Description("å
¥åº")] |
| | | InBound = 1, |
| | | |
| | | /// <summary> |
| | | /// åºåº |
| | | /// </summary> |
| | | [Description("åºåº")] |
| | | OutBound = 2, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.Enums |
| | | { |
| | | /// <summary> |
| | | /// ä»»å¡ç±»å |
| | | /// </summary> |
| | | [Description("ä»»å¡ç±»å")] |
| | | public enum TaskTypeEnum |
| | | { |
| | | /// <summary> |
| | | /// åºåº |
| | | /// </summary> |
| | | [Description("åºåº")] |
| | | CHUKU = 1, |
| | | |
| | | /// <summary> |
| | | /// å
¥åº |
| | | /// </summary> |
| | | [Description("å
¥åº")] |
| | | RUKU = 2, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.Enums |
| | | { |
| | | /// <summary> |
| | | /// ä»»å¡ç¶æ |
| | | /// </summary> |
| | | [Description("ä»»å¡ç¶æ")] |
| | | public enum WmsTaskStatus |
| | | { |
| | | /// <summary> |
| | | /// æªæ§è¡ |
| | | /// </summary> |
| | | [Description("æªæ§è¡")] |
| | | WEIZHIXING = 1, |
| | | /// <summary> |
| | | /// å¾
æ§è¡ |
| | | /// </summary> |
| | | [Description("å¾
æ§è¡")] |
| | | DAIZHIXINGZHONG = 2, |
| | | /// <summary> |
| | | /// æ§è¡ä¸ |
| | | /// </summary> |
| | | [Description("æ§è¡ä¸")] |
| | | ZHIXINGZHONG = 3, |
| | | /// <summary> |
| | | /// 宿 |
| | | /// </summary> |
| | | [Description("宿")] |
| | | WANCHENG = 4, |
| | | /// <summary> |
| | | /// åæ¶ |
| | | /// </summary> |
| | | [Description("åæ¶")] |
| | | QUXIAO = 5 |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.Enums |
| | | { |
| | | /// <summary> |
| | | /// æ¯å¦éå® |
| | | /// </summary> |
| | | [Description("æ¯å¦éå®")] |
| | | public enum YesNoEnum |
| | | { |
| | | /// <summary> |
| | | /// æ¯ |
| | | /// </summary> |
| | | [Description("æ¯")] |
| | | Y = 1, |
| | | |
| | | /// <summary> |
| | | /// å¦ |
| | | /// </summary> |
| | | [Description("å¦")] |
| | | N = 2 |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
| | | <ConfigureAwait ContinueOnCapturedContext="false" /> |
| | | </Weavers> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "culture": "en", |
| | | "texts": { |
| | | "DisplayName:SCMS.AppSettings.HIAWms.PluginState": "HIAWms plugin state", |
| | | "CMS.Plugin.HIAWms:NameAlreadyExists": "The '{0}' name already exists, please re-enter it !" |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "culture": "zh-Hans", |
| | | "texts": { |
| | | "DisplayName:SCMS.AppSettings.HIAWms.PluginState": "HIAWms æä»¶ç¶æ", |
| | | "CMS.Plugin.HIAWms:NameAlreadyExists": "该'{0}'åç§°å·²åå¨ï¼è¯·éæ°è¾å
¥ï¼" |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Localization; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.Localization; |
| | | |
| | | /// <summary> |
| | | /// HIAWmsæ¬å°åèµæº |
| | | /// </summary> |
| | | [LocalizationResourceName("HIAWms")] |
| | | public class HIAWmsResource |
| | | { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using KissUtil.Helpers; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using Volo.Abp; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.Util |
| | | { |
| | | /// <summary> |
| | | /// æä¸¾å¸®å©ç±». |
| | | /// </summary> |
| | | public static class EnumHelper |
| | | { |
| | | /// <summary> |
| | | /// è·åæä¸¾. |
| | | /// </summary> |
| | | /// <param name="enumName"> </param> |
| | | /// <returns></returns> |
| | | /// <exception cref="ArgumentException"></exception> |
| | | public static List<EnumItem> GetEnumItems(string enumName) |
| | | { |
| | | // è·åå½åç¨åºéä¸çææç±»å |
| | | var enumType = AppDomain.CurrentDomain.GetAssemblies() |
| | | .SelectMany(a => a.GetTypes()) |
| | | .FirstOrDefault(t => t.Name == enumName && t.IsEnum); |
| | | |
| | | if (enumType == null) |
| | | { |
| | | throw new UserFriendlyException($"æä¸¾ç±»å {enumName} ä¸åå¨"); |
| | | } |
| | | |
| | | return GetEnumItems(enumType); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åæä¸¾ç±»å. |
| | | /// </summary> |
| | | /// <param name="enumType"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="ArgumentException"></exception> |
| | | public static List<EnumItem> GetEnumItems(Type enumType) |
| | | { |
| | | if (!enumType.IsEnum) |
| | | { |
| | | throw new UserFriendlyException("æä¾çç±»å䏿¯æä¸¾ç±»å"); |
| | | } |
| | | |
| | | var result = new List<EnumItem>(); |
| | | var values = Enum.GetValues(enumType); |
| | | |
| | | foreach (var value in values) |
| | | { |
| | | var fieldInfo = enumType.GetField(value.ToString()); |
| | | var description = fieldInfo? |
| | | .GetCustomAttributes(typeof(DescriptionAttribute), false) |
| | | .FirstOrDefault() as DescriptionAttribute; |
| | | |
| | | result.Add(new EnumItem |
| | | { |
| | | Value = (int)value, |
| | | Name = value.ToString(), |
| | | Description = description?.Description ?? value.ToString(), |
| | | }); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æä¸¾æè¿°. |
| | | /// </summary> |
| | | public class EnumItem |
| | | { |
| | | public int Value { get; set; } |
| | | |
| | | public string Name { get; set; } |
| | | |
| | | public string Description { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Reflection; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.Util |
| | | { |
| | | /// <summary> |
| | | /// 导åºå¸®å©ç±». |
| | | /// </summary> |
| | | public static class ExportHelper |
| | | { |
| | | // éç¨è½¬æ¢æ¹æ³ï¼å
¼å®¹ Func<T, Dictionary<string, object>>ï¼ |
| | | public static Dictionary<string, object> ConvertToExportData<T>(T entity) |
| | | { |
| | | var dict = new Dictionary<string, object>(); |
| | | if (entity == null) return dict; |
| | | |
| | | foreach (var prop in typeof(T).GetProperties()) |
| | | { |
| | | var value = prop.GetValue(entity); |
| | | dict[prop.Name] = FormatValue(value); |
| | | } |
| | | return dict; |
| | | } |
| | | |
| | | // æ¹éè½¬æ¢æ¹æ³ |
| | | public static List<Dictionary<string, object>> ConvertListToExportData<T>(IEnumerable<T> list) |
| | | { |
| | | return list.Select(ConvertToExportData).ToList(); |
| | | } |
| | | |
| | | private static object FormatValue(object value) |
| | | { |
| | | if (value == null) return string.Empty; |
| | | |
| | | // å¤çæä¸¾ |
| | | if (value is Enum enumValue) |
| | | return GetEnumDescriptionUtil.GetEnumDescription(enumValue); |
| | | |
| | | // å¤çå¸å° |
| | | if (value is bool boolValue) |
| | | return boolValue ? "æ¯" : "å¦"; |
| | | |
| | | return value; |
| | | } |
| | | |
| | | private static string GetEnumDescription(Enum value) |
| | | { |
| | | var fieldInfo = value.GetType().GetField(value.ToString()); |
| | | var description = fieldInfo? |
| | | .GetCustomAttributes(typeof(DescriptionAttribute), false) |
| | | .FirstOrDefault() as DescriptionAttribute; |
| | | return description?.Description ?? value.ToString(); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Reflection; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CMS.Plugin.HIAWms |
| | | { |
| | | public class GetEnumDescriptionUtil |
| | | { |
| | | /// <summary> |
| | | /// è·åæä¸¾çæè¿° |
| | | /// </summary> |
| | | /// <param name="enumValue"></param> |
| | | /// <returns></returns> |
| | | public static string GetEnumDescription(Enum enumValue) |
| | | { |
| | | string value = enumValue.ToString(); |
| | | if (string.IsNullOrWhiteSpace(value) || value == "0") return ""; |
| | | FieldInfo field = enumValue.GetType().GetField(value); |
| | | object[] objs = field.GetCustomAttributes(typeof(DescriptionAttribute), false); //è·åæè¿°å±æ§ |
| | | if (objs == null || objs.Length == 0) //å½æè¿°å±æ§æ²¡ææ¶ï¼ç´æ¥è¿ååç§° |
| | | return value; |
| | | DescriptionAttribute descriptionAttribute = (DescriptionAttribute)objs[0]; |
| | | return descriptionAttribute.Description; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.WmsAreas; |
| | | |
| | | /// <summary> |
| | | /// WmsArea常éå®ä¹ |
| | | /// </summary> |
| | | public static class WmsAreaConsts |
| | | { |
| | | public const string CloneTag = "_坿¬"; |
| | | public static int MaxCodeLength { get; set; } = 64; |
| | | public static int MaxNameLength { get; set; } = 64; |
| | | public static int MaxRemarkLength { get; set; } = 256; |
| | | |
| | | public static int MaxAreaNoLength = 50; |
| | | |
| | | public static int MaxAreaNameLength = 100; |
| | | |
| | | public static int MaxAreaDescLength = 200; |
| | | |
| | | public static int MaxRedundantFieldLength = 100; |
| | | |
| | | public static int MaxStoreCodeLength = 50; |
| | | |
| | | public static int MaxStoreNameLength = 100; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.WmsAreas; |
| | | |
| | | /// <summary> |
| | | /// WmsAreaäºä»¶åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | [Serializable] |
| | | public class WmsAreaEto |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsAreaEto"/> class. |
| | | /// </summary> |
| | | /// <param name="name">The name.</param> |
| | | public WmsAreaEto(string name) |
| | | { |
| | | Name = name; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åç§° |
| | | /// </summary> |
| | | public string Name { get; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.WmsContainers; |
| | | |
| | | /// <summary> |
| | | /// WmsContainer常éå®ä¹ |
| | | /// </summary> |
| | | public static class WmsContainerConsts |
| | | { |
| | | public const string CloneTag = "_坿¬"; |
| | | public static int MaxCodeLength { get; set; } = 64; |
| | | public static int MaxNameLength { get; set; } = 64; |
| | | public static int MaxRemarkLength { get; set; } = 256; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.WmsContainers; |
| | | |
| | | /// <summary> |
| | | /// WmsContaineräºä»¶åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | [Serializable] |
| | | public class WmsContainerEto |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsContainerEto"/> class. |
| | | /// </summary> |
| | | /// <param name="name">The name.</param> |
| | | public WmsContainerEto(string name) |
| | | { |
| | | Name = name; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åç§° |
| | | /// </summary> |
| | | public string Name { get; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.WmsMaterial; |
| | | |
| | | /// <summary> |
| | | /// WmsMaterial常éå®ä¹ |
| | | /// </summary> |
| | | public static class WmsMaterialConsts |
| | | { |
| | | public const string CloneTag = "_坿¬"; |
| | | public static int MaxCodeLength { get; set; } = 64; |
| | | public static int MaxNameLength { get; set; } = 64; |
| | | public static int MaxRemarkLength { get; set; } = 256; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.WmsMaterial; |
| | | |
| | | /// <summary> |
| | | /// WmsMaterialäºä»¶åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | [Serializable] |
| | | public class WmsMaterialEto |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsMaterialEto"/> class. |
| | | /// </summary> |
| | | /// <param name="name">The name.</param> |
| | | public WmsMaterialEto(string name) |
| | | { |
| | | Name = name; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åç§° |
| | | /// </summary> |
| | | public string Name { get; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.WmsPlaces; |
| | | |
| | | /// <summary> |
| | | /// WmsPlace常éå®ä¹ |
| | | /// </summary> |
| | | public static class WmsPlaceConsts |
| | | { |
| | | public const string CloneTag = "_坿¬"; |
| | | public static int MaxCodeLength { get; set; } = 64; |
| | | public static int MaxNameLength { get; set; } = 64; |
| | | public static int MaxRemarkLength { get; set; } = 256; |
| | | |
| | | public const int MaxPlaceNoLength = 50; |
| | | |
| | | public const int MaxAreaCodeLength = 50; |
| | | |
| | | public const int MaxRedundantFieldLength = 100; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.WmsPlaces; |
| | | |
| | | /// <summary> |
| | | /// WmsPlaceäºä»¶åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | [Serializable] |
| | | public class WmsPlaceEto |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsPlaceEto"/> class. |
| | | /// </summary> |
| | | /// <param name="name">The name.</param> |
| | | public WmsPlaceEto(string name) |
| | | { |
| | | Name = name; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åç§° |
| | | /// </summary> |
| | | public string Name { get; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.WmsStores; |
| | | |
| | | /// <summary> |
| | | /// WmsStore常éå®ä¹ |
| | | /// </summary> |
| | | public static class WmsStoreConsts |
| | | { |
| | | public const string CloneTag = "_坿¬"; |
| | | public static int MaxCodeLength { get; set; } = 64; |
| | | public static int MaxNameLength { get; set; } = 64; |
| | | public static int MaxRemarkLength { get; set; } = 256; |
| | | |
| | | public const int MaxStoreCodeLength = 50; |
| | | |
| | | public const int MaxStoreNameLength = 100; |
| | | |
| | | public const int MaxRedundantFieldLength = 100; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.WmsStores; |
| | | |
| | | /// <summary> |
| | | /// WmsStoreäºä»¶åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | [Serializable] |
| | | public class WmsStoreEto |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsStoreEto"/> class. |
| | | /// </summary> |
| | | /// <param name="name">The name.</param> |
| | | public WmsStoreEto(string name) |
| | | { |
| | | Name = name; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åç§° |
| | | /// </summary> |
| | | public string Name { get; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | |
| | | <Import Project="../../common.props" /> |
| | | <Import Project="../../configureawait.props" /> |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="Volo.Abp.Ddd.Domain" Version="$(ABPPackageVersion)" /> |
| | | <PackageReference Include="Volo.Abp.Settings" Version="$(ABPPackageVersion)" /> |
| | | <PackageReference Include="Volo.Abp.Caching" Version="$(ABPPackageVersion)" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\CMS.Plugin.HIAWms.Abstractions\CMS.Plugin.HIAWms.Abstractions.csproj" /> |
| | | <ProjectReference Include="..\CMS.Plugin.HIAWms.Domain.Shared\CMS.Plugin.HIAWms.Domain.Shared.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <Reference Include="CmsQueryExtensions"> |
| | | <HintPath>..\..\..\..\..\CommonDLL\CmsQueryExtensions.dll</HintPath> |
| | | </Reference> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Domain; |
| | | |
| | | /// <summary> |
| | | /// æ°æ®åºå±æ§å®ä¹ |
| | | /// </summary> |
| | | public static class CMSPluginDbProperties |
| | | { |
| | | /// <summary> |
| | | /// Gets or sets the database table prefix. |
| | | /// </summary> |
| | | public static string DbTablePrefix { get; set; } = "SCMS"; |
| | | |
| | | /// <summary> |
| | | /// Gets or sets the database schema. |
| | | /// </summary> |
| | | public static string DbSchema { get; set; } |
| | | |
| | | /// <summary> |
| | | /// The connection string name |
| | | /// </summary> |
| | | public const string ConnectionStringName = "HIAWms"; |
| | | |
| | | /// <summary> |
| | | /// The migrations history table |
| | | /// </summary> |
| | | public const string MigrationsHistoryTable = "__EFMigrationsHistoryForHIAWms"; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared; |
| | | using Volo.Abp.Caching; |
| | | using Volo.Abp.Domain; |
| | | using Volo.Abp.Modularity; |
| | | using Volo.Abp.Settings; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain; |
| | | |
| | | /// <summary> |
| | | /// é¢å模å |
| | | /// </summary> |
| | | [DependsOn( |
| | | typeof(CMSPluginDomainSharedModule), |
| | | typeof(AbpSettingsModule), |
| | | typeof(AbpDddDomainModule), |
| | | typeof(AbpCachingModule) |
| | | )] |
| | | public class CMSPluginDomainModule : AbpModule |
| | | { |
| | | /// <inheritdoc /> |
| | | public override void ConfigureServices(ServiceConfigurationContext context) |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.Extensions.Logging; |
| | | using System.Diagnostics; |
| | | using System.Runtime.InteropServices; |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.DependencyInjection; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Data; |
| | | |
| | | /// <summary> |
| | | /// æ°æ®åºè¿ç§»æå¡ |
| | | /// </summary> |
| | | public class CMSPluginDbMigrationService : ITransientDependency |
| | | { |
| | | private readonly IDataSeeder _dataSeeder; |
| | | private readonly IEnumerable<ICMSPluginDbSchemaMigrator> _dbSchemaMigrators; |
| | | private readonly ILogger<CMSPluginDbMigrationService> _logger; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="CMSPluginDbMigrationService"/> class. |
| | | /// </summary> |
| | | /// <param name="dataSeeder">The data seeder.</param> |
| | | /// <param name="dbSchemaMigrators">The database schema migrators.</param> |
| | | /// <param name="logger">The logger.</param> |
| | | public CMSPluginDbMigrationService(IDataSeeder dataSeeder, |
| | | IEnumerable<ICMSPluginDbSchemaMigrator> dbSchemaMigrators, ILogger<CMSPluginDbMigrationService> logger) |
| | | { |
| | | _dataSeeder = dataSeeder; |
| | | _dbSchemaMigrators = dbSchemaMigrators; |
| | | _logger = logger; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Migrates the asynchronous. |
| | | /// </summary> |
| | | public async Task MigrateAsync() |
| | | { |
| | | var initialMigrationAdded = AddInitialMigrationIfNotExist(); |
| | | |
| | | if (initialMigrationAdded) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | _logger.LogDebug("Started database migrations..."); |
| | | |
| | | await MigrateDatabaseSchemaAsync(); |
| | | await SeedDataAsync(); |
| | | |
| | | _logger.LogDebug($"Successfully completed host database migrations."); |
| | | _logger.LogDebug("You can safely end this process..."); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Migrates the database schema asynchronous. |
| | | /// </summary> |
| | | private async Task MigrateDatabaseSchemaAsync() |
| | | { |
| | | _logger.LogDebug($"Migrating schema for database..."); |
| | | |
| | | foreach (var migrator in _dbSchemaMigrators) |
| | | { |
| | | await migrator.MigrateAsync(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Seeds the data asynchronous. |
| | | /// </summary> |
| | | private async Task SeedDataAsync() |
| | | { |
| | | _logger.LogDebug($"Executing database seed..."); |
| | | |
| | | await _dataSeeder.SeedAsync(new DataSeedContext().WithProperty(CMSPluginDbProperties.ConnectionStringName, CMSPluginDbProperties.ConnectionStringName)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Adds the initial migration if not exist. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | private bool AddInitialMigrationIfNotExist() |
| | | { |
| | | try |
| | | { |
| | | if (!DbMigrationsProjectExists()) |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | catch (Exception) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | try |
| | | { |
| | | if (!MigrationsFolderExists()) |
| | | { |
| | | AddInitialMigration(); |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | _logger.LogWarning("Couldn't determinate if any migrations exist : " + e.Message); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Databases the migrations project exists. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | private bool DbMigrationsProjectExists() |
| | | { |
| | | var dbMigrationsProjectFolder = GetEntityFrameworkCoreProjectFolderPath(); |
| | | |
| | | return dbMigrationsProjectFolder != null; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Migrationses the folder exists. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | private bool MigrationsFolderExists() |
| | | { |
| | | var dbMigrationsProjectFolder = GetEntityFrameworkCoreProjectFolderPath(); |
| | | |
| | | return Directory.Exists(Path.Combine(dbMigrationsProjectFolder, "Migrations")); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Adds the initial migration. |
| | | /// </summary> |
| | | /// <exception cref="System.Exception">Couldn't run ABP CLI...</exception> |
| | | private void AddInitialMigration() |
| | | { |
| | | _logger.LogDebug("Creating initial migration..."); |
| | | |
| | | string argumentPrefix; |
| | | string fileName; |
| | | |
| | | if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) |
| | | { |
| | | argumentPrefix = "-c"; |
| | | fileName = "/bin/bash"; |
| | | } |
| | | else |
| | | { |
| | | argumentPrefix = "/C"; |
| | | fileName = "cmd.exe"; |
| | | } |
| | | |
| | | var procStartInfo = new ProcessStartInfo(fileName, |
| | | $"{argumentPrefix} \"abp create-migration-and-run-migrator \"{GetEntityFrameworkCoreProjectFolderPath()}\"\"" |
| | | ); |
| | | |
| | | try |
| | | { |
| | | Process.Start(procStartInfo); |
| | | } |
| | | catch (Exception) |
| | | { |
| | | throw new Exception("Couldn't run ABP CLI..."); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Gets the entity framework core project folder path. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | /// <exception cref="System.Exception">Solution folder not found!</exception> |
| | | private string GetEntityFrameworkCoreProjectFolderPath() |
| | | { |
| | | var slnDirectoryPath = GetSolutionDirectoryPath(); |
| | | |
| | | if (slnDirectoryPath == null) |
| | | { |
| | | throw new Exception("Solution folder not found!"); |
| | | } |
| | | |
| | | var srcDirectoryPath = Path.Combine(slnDirectoryPath, "src"); |
| | | |
| | | return Directory.GetDirectories(srcDirectoryPath) |
| | | .FirstOrDefault(d => d.EndsWith(".EntityFrameworkCore")); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Gets the solution directory path. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | private string GetSolutionDirectoryPath() |
| | | { |
| | | var currentDirectory = new DirectoryInfo(Directory.GetCurrentDirectory()); |
| | | |
| | | while (Directory.GetParent(currentDirectory.FullName) != null) |
| | | { |
| | | currentDirectory = Directory.GetParent(currentDirectory.FullName); |
| | | |
| | | if (Directory.GetFiles(currentDirectory.FullName).FirstOrDefault(f => f.EndsWith(".sln")) != null) |
| | | { |
| | | return currentDirectory.FullName; |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Data; |
| | | using Volo.Abp.DependencyInjection; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Data; |
| | | |
| | | /// <summary> |
| | | /// Dapperä»å¨ |
| | | /// </summary> |
| | | public interface ICMSPluginDapperRepository : ITransientDependency |
| | | { |
| | | /// <summary> |
| | | /// Gets the database connection asynchronous. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | Task<IDbConnection> GetDbConnectionAsync(); |
| | | |
| | | /// <summary> |
| | | /// Gets the database transaction asynchronous. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | Task<IDbTransaction> GetDbTransactionAsync(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Domain.Data; |
| | | |
| | | /// <summary> |
| | | /// æ°æ®åºæ¶æè¿ç§»å¨ |
| | | /// </summary> |
| | | public interface ICMSPluginDbSchemaMigrator |
| | | { |
| | | /// <summary> |
| | | /// Migrates the asynchronous. |
| | | /// </summary> |
| | | Task MigrateAsync(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.DependencyInjection; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Data; |
| | | |
| | | /// <summary> |
| | | /// This is used if database provider does't define |
| | | /// ICMSDbSchemaMigrator implementation. |
| | | /// </summary> |
| | | public class NullCMSPluginDbSchemaMigrator : ICMSPluginDbSchemaMigrator, ITransientDependency |
| | | { |
| | | /// <inheritdoc /> |
| | | public Task MigrateAsync() |
| | | { |
| | | return Task.CompletedTask; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsAreas; |
| | | using Volo.Abp.DependencyInjection; |
| | | using Volo.Abp.EventBus.Distributed; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.EventHandlers; |
| | | |
| | | /// <summary> |
| | | /// WmsAreaäºä»¶å¤çç¨åº |
| | | /// </summary> |
| | | public class WmsAreaEventHandler : IDistributedEventHandler<WmsAreaEto>, ITransientDependency |
| | | { |
| | | /// <inheritdoc /> |
| | | public Task HandleEventAsync(WmsAreaEto eventData) |
| | | { |
| | | return Task.CompletedTask; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsContainers; |
| | | using Volo.Abp.DependencyInjection; |
| | | using Volo.Abp.EventBus.Distributed; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.EventHandlers; |
| | | |
| | | /// <summary> |
| | | /// WmsContaineräºä»¶å¤çç¨åº |
| | | /// </summary> |
| | | public class WmsContainerEventHandler : IDistributedEventHandler<WmsContainerEto>, ITransientDependency |
| | | { |
| | | /// <inheritdoc /> |
| | | public Task HandleEventAsync(WmsContainerEto eventData) |
| | | { |
| | | return Task.CompletedTask; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsMaterial; |
| | | using Volo.Abp.DependencyInjection; |
| | | using Volo.Abp.EventBus.Distributed; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.EventHandlers; |
| | | |
| | | /// <summary> |
| | | /// WmsMaterialäºä»¶å¤çç¨åº |
| | | /// </summary> |
| | | public class WmsMaterialEventHandler : IDistributedEventHandler<WmsMaterialEto>, ITransientDependency |
| | | { |
| | | /// <inheritdoc /> |
| | | public Task HandleEventAsync(WmsMaterialEto eventData) |
| | | { |
| | | return Task.CompletedTask; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsPlaces; |
| | | using Volo.Abp.DependencyInjection; |
| | | using Volo.Abp.EventBus.Distributed; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.EventHandlers; |
| | | |
| | | /// <summary> |
| | | /// WmsPlaceäºä»¶å¤çç¨åº |
| | | /// </summary> |
| | | public class WmsPlaceEventHandler : IDistributedEventHandler<WmsPlaceEto>, ITransientDependency |
| | | { |
| | | /// <inheritdoc /> |
| | | public Task HandleEventAsync(WmsPlaceEto eventData) |
| | | { |
| | | return Task.CompletedTask; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsStores; |
| | | using Volo.Abp.DependencyInjection; |
| | | using Volo.Abp.EventBus.Distributed; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.EventHandlers; |
| | | |
| | | /// <summary> |
| | | /// WmsStoreäºä»¶å¤çç¨åº |
| | | /// </summary> |
| | | public class WmsStoreEventHandler : IDistributedEventHandler<WmsStoreEto>, ITransientDependency |
| | | { |
| | | /// <inheritdoc /> |
| | | public Task HandleEventAsync(WmsStoreEto eventData) |
| | | { |
| | | return Task.CompletedTask; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
| | | <ConfigureAwait ContinueOnCapturedContext="false" /> |
| | | </Weavers> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Runtime.CompilerServices; |
| | | [assembly:InternalsVisibleToAttribute("CMS.Plugin.Domain.Tests")] |
| | | [assembly:InternalsVisibleToAttribute("CMS.Plugin.TestBase")] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Abstractions; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Localization; |
| | | using Volo.Abp.Localization; |
| | | using Volo.Abp.Settings; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Settings; |
| | | |
| | | /// <summary> |
| | | /// 设置å®ä¹æä¾ç¨åº |
| | | /// </summary> |
| | | public class CMSPluginSettingDefinitionProvider : SettingDefinitionProvider |
| | | { |
| | | public override void Define(ISettingDefinitionContext context) |
| | | { |
| | | context.Add(new SettingDefinition(CMSPluginHIAWmsSettings.PluginState, "1", L($"DisplayName:{CMSPluginHIAWmsSettings.PluginState}"), isInherited: true)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ls the specified name. |
| | | /// </summary> |
| | | /// <param name="name">The name.</param> |
| | | /// <returns></returns> |
| | | private static LocalizableString L(string name) |
| | | { |
| | | return LocalizableString.Create<HIAWmsResource>(name); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Domain.Repositories; |
| | | using Volo.Abp.Specifications; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsAreas; |
| | | |
| | | /// <summary> |
| | | /// WmsAreaä»å¨ |
| | | /// </summary> |
| | | public interface IWmsAreaRepository : IBasicRepository<WmsArea, Guid> |
| | | { |
| | | /// <summary> |
| | | /// Finds the by name asynchronous. |
| | | /// </summary> |
| | | /// <param name="name">The name.</param> |
| | | /// <param name="cancellationToken">The cancellation token.</param> |
| | | /// <returns></returns> |
| | | Task<WmsArea> FindByNameAsync(string name, CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// Names the exist asynchronous. |
| | | /// </summary> |
| | | /// <param name="name">The name.</param> |
| | | /// <param name="id">The identifier.</param> |
| | | /// <returns></returns> |
| | | Task<bool> NameExistAsync(string name, Guid? id = null); |
| | | |
| | | /// <summary> |
| | | /// Gets the maximum sort asynchronous. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | Task<int> GetMaxSortAsync(); |
| | | |
| | | /// <summary> |
| | | /// Gets the list asynchronous. |
| | | /// </summary> |
| | | /// <param name="sorting">The sorting.</param> |
| | | /// <param name="maxResultCount">The maximum result count.</param> |
| | | /// <param name="skipCount">The skip count.</param> |
| | | /// <param name="filter">The filter.</param> |
| | | /// <param name="specification">The specification.</param> |
| | | /// <param name="includeDetails">if set to <c>true</c> [include details].</param> |
| | | /// <param name="cancellationToken">The cancellation token.</param> |
| | | /// <returns></returns> |
| | | Task<List<WmsArea>> GetListAsync(WmsArea? area, string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, string filter = null, Specification<WmsArea> specification = null, bool includeDetails = false, CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// è·ååºåºå表 |
| | | /// </summary> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | Task<List<WmsArea>> GetListForSelectAsync(CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// Gets the count asynchronous. |
| | | /// </summary> |
| | | /// <param name="filter">The filter.</param> |
| | | /// <param name="specification">The specification.</param> |
| | | /// <param name="cancellationToken">The cancellation token.</param> |
| | | /// <returns></returns> |
| | | Task<long> GetCountAsync(WmsArea? area, string filter = null, Specification<WmsArea> specification = null, CancellationToken cancellationToken = default); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsAreas; |
| | | using Microsoft.EntityFrameworkCore.Metadata.Internal; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Domain.Entities.Auditing; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsAreas |
| | | { |
| | | /// <summary> |
| | | /// WmsArea |
| | | /// </summary> |
| | | public class WmsArea : FullAuditedAggregateRoot<Guid> |
| | | { |
| | | /// <summary> |
| | | /// åºåºç¼å· |
| | | /// </summary> |
| | | public string AreaNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºåç§° |
| | | /// </summary> |
| | | public string AreaName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æè¿° |
| | | /// </summary> |
| | | public string? AreaDesc { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºç¶æ |
| | | /// </summary> |
| | | public AreaStatusEnum AreaStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºç±»å |
| | | /// </summary> |
| | | public AreaTypeEnum AreaType { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// åä½å段1 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段2 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段3 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField3 { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// ä»åºä»£ç |
| | | /// </summary> |
| | | public string? StoreCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºåç§° |
| | | /// </summary> |
| | | public string? StoreName { get; set; } |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public virtual int Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public virtual string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public virtual bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Adjusts the sort. |
| | | /// </summary> |
| | | /// <param name="sort">The sort.</param> |
| | | public void AdjustSort(int sort) |
| | | { |
| | | Sort = sort; |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.DependencyInjection; |
| | | using Volo.Abp.Guids; |
| | | using Volo.Abp.Uow; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsAreas |
| | | { |
| | | /// <summary> |
| | | /// WmsAreaç§åæ°æ®æä¾ç¨åº |
| | | /// </summary> |
| | | public class WmsAreaDataSeedContributor : IDataSeedContributor, ITransientDependency |
| | | { |
| | | private readonly IUnitOfWorkManager _unitOfWorkManager; |
| | | private readonly IWmsAreaRepository _wmsareaRepository; |
| | | private readonly IGuidGenerator _guidGenerator; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsAreaDataSeedContributor"/> class. |
| | | /// </summary> |
| | | /// <param name="unitOfWorkManager">The unit of work manager.</param> |
| | | /// <param name="guidGenerator">The unique identifier generator.</param> |
| | | /// <param name="wmsareaRepository">The work section repository.</param> |
| | | public WmsAreaDataSeedContributor(IUnitOfWorkManager unitOfWorkManager, IGuidGenerator guidGenerator, IWmsAreaRepository wmsareaRepository) |
| | | { |
| | | _unitOfWorkManager = unitOfWorkManager; |
| | | _wmsareaRepository = wmsareaRepository; |
| | | _guidGenerator = guidGenerator; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task SeedAsync(DataSeedContext context) |
| | | { |
| | | if (context.Properties.ContainsKey(CMSPluginDbProperties.ConnectionStringName) && context.Properties[CMSPluginDbProperties.ConnectionStringName]?.ToString() == CMSPluginDbProperties.ConnectionStringName) |
| | | { |
| | | try |
| | | { |
| | | //using var unitofWork = _unitOfWorkManager.Begin(requiresNew: true); |
| | | //await unitofWork.SaveChangesAsync(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Console.WriteLine(ex.Message); |
| | | } |
| | | } |
| | | |
| | | if (context.Properties.ContainsKey("SeedTestData") && context.Properties["SeedTestData"]?.ToString() == "SeedTestData") |
| | | { |
| | | try |
| | | { |
| | | await SeedWmsAreaDataAsync(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | Console.WriteLine(e.Message); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Seeds the work section data asynchronous. |
| | | /// </summary> |
| | | private async Task SeedWmsAreaDataAsync() |
| | | { |
| | | |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Linq.Expressions; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsAreas |
| | | { |
| | | /// <summary> |
| | | /// WmsAreaè§çº¦ |
| | | /// </summary> |
| | | public class WmsAreaSpecification : Volo.Abp.Specifications.Specification<WmsArea> |
| | | { |
| | | private readonly string _areaCode; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsAreaSpecification"/> class. |
| | | /// </summary> |
| | | public WmsAreaSpecification() |
| | | { |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsAreaSpecification"/> class. |
| | | /// </summary> |
| | | /// <param name="areaCode">The name.</param> |
| | | public WmsAreaSpecification(string areaCode = null) |
| | | { |
| | | _areaCode = areaCode; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public override Expression<Func<WmsArea, bool>> ToExpression() |
| | | { |
| | | Expression<Func<WmsArea, bool>> expression = c => 1 == 1; |
| | | |
| | | if (_areaCode != null) |
| | | { |
| | | expression = expression.And(c => c.AreaNo == _areaCode); |
| | | } |
| | | |
| | | return expression; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Domain.Repositories; |
| | | using Volo.Abp.Specifications; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsContainers; |
| | | |
| | | /// <summary> |
| | | /// WmsContainerä»å¨ |
| | | /// </summary> |
| | | public interface IWmsContainerRepository : IBasicRepository<WmsContainer, Guid> |
| | | { |
| | | /// <summary> |
| | | /// Finds the by name asynchronous. |
| | | /// </summary> |
| | | /// <param name="name">The name.</param> |
| | | /// <param name="cancellationToken">The cancellation token.</param> |
| | | /// <returns></returns> |
| | | Task<WmsContainer> FindByNameAsync(string name, CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// Names the exist asynchronous. |
| | | /// </summary> |
| | | /// <param name="name">The name.</param> |
| | | /// <param name="id">The identifier.</param> |
| | | /// <returns></returns> |
| | | Task<bool> NameExistAsync(string name, Guid? id = null); |
| | | |
| | | /// <summary> |
| | | /// Gets the maximum sort asynchronous. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | Task<int> GetMaxSortAsync(); |
| | | |
| | | /// <summary> |
| | | /// Gets the list asynchronous. |
| | | /// </summary> |
| | | /// <param name="sorting">The sorting.</param> |
| | | /// <param name="maxResultCount">The maximum result count.</param> |
| | | /// <param name="skipCount">The skip count.</param> |
| | | /// <param name="filter">The filter.</param> |
| | | /// <param name="specification">The specification.</param> |
| | | /// <param name="includeDetails">if set to <c>true</c> [include details].</param> |
| | | /// <param name="cancellationToken">The cancellation token.</param> |
| | | /// <returns></returns> |
| | | Task<List<WmsContainer>> GetListAsync(WmsContainer? container, string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, string filter = null, Specification<WmsContainer> specification = null, bool includeDetails = false, CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// Gets the count asynchronous. |
| | | /// </summary> |
| | | /// <param name="filter">The filter.</param> |
| | | /// <param name="specification">The specification.</param> |
| | | /// <param name="cancellationToken">The cancellation token.</param> |
| | | /// <returns></returns> |
| | | Task<long> GetCountAsync(WmsContainer? container, string filter = null, Specification<WmsContainer> specification = null, CancellationToken cancellationToken = default); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsContainers; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Domain.Entities.Auditing; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsContainers |
| | | { |
| | | /// <summary> |
| | | /// WmsContainer |
| | | /// </summary> |
| | | public class WmsContainer : FullAuditedAggregateRoot<Guid> |
| | | { |
| | | /// <summary> |
| | | /// ID |
| | | /// </summary> |
| | | public Guid Id { get; set; } |
| | | /// <summary> |
| | | /// æçç¼å· |
| | | /// </summary> |
| | | public string ContainerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç±»å |
| | | /// </summary> |
| | | public ContainerTypeEnum ContainerType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç¶æ |
| | | /// </summary> |
| | | public ContainerStatusEnum ContainerStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¿åº¦ |
| | | /// </summary> |
| | | public decimal? SpecLength { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 宽度 |
| | | /// </summary> |
| | | public decimal? SpecWidth { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é«åº¦ |
| | | /// </summary> |
| | | public decimal? SpecHeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éé¿ |
| | | /// </summary> |
| | | public decimal? LimitLength { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é宽 |
| | | /// </summary> |
| | | public decimal? LimitWidth { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éé« |
| | | /// </summary> |
| | | public decimal? LimitHeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è½½éä¸é |
| | | /// </summary> |
| | | public decimal? MaxWeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¼å¸¸æ°é |
| | | /// </summary> |
| | | public int? ExceptionNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | ///ç©ææ°é |
| | | /// </summary> |
| | | public int? MaterialNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段1 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段2 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段3 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public virtual int Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public virtual string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public virtual bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Adjusts the sort. |
| | | /// </summary> |
| | | /// <param name="sort">The sort.</param> |
| | | public void AdjustSort(int sort) |
| | | { |
| | | Sort = sort; |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.DependencyInjection; |
| | | using Volo.Abp.Guids; |
| | | using Volo.Abp.Uow; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsContainers |
| | | { |
| | | /// <summary> |
| | | /// WmsContainerç§åæ°æ®æä¾ç¨åº |
| | | /// </summary> |
| | | public class WmsContainerDataSeedContributor : IDataSeedContributor, ITransientDependency |
| | | { |
| | | private readonly IUnitOfWorkManager _unitOfWorkManager; |
| | | private readonly IWmsContainerRepository _wmscontainerRepository; |
| | | private readonly IGuidGenerator _guidGenerator; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsContainerDataSeedContributor"/> class. |
| | | /// </summary> |
| | | /// <param name="unitOfWorkManager">The unit of work manager.</param> |
| | | /// <param name="guidGenerator">The unique identifier generator.</param> |
| | | /// <param name="wmscontainerRepository">The work section repository.</param> |
| | | public WmsContainerDataSeedContributor(IUnitOfWorkManager unitOfWorkManager, IGuidGenerator guidGenerator, IWmsContainerRepository wmscontainerRepository) |
| | | { |
| | | _unitOfWorkManager = unitOfWorkManager; |
| | | _wmscontainerRepository = wmscontainerRepository; |
| | | _guidGenerator = guidGenerator; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task SeedAsync(DataSeedContext context) |
| | | { |
| | | if (context.Properties.ContainsKey(CMSPluginDbProperties.ConnectionStringName) && context.Properties[CMSPluginDbProperties.ConnectionStringName]?.ToString() == CMSPluginDbProperties.ConnectionStringName) |
| | | { |
| | | try |
| | | { |
| | | //using var unitofWork = _unitOfWorkManager.Begin(requiresNew: true); |
| | | //await unitofWork.SaveChangesAsync(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Console.WriteLine(ex.Message); |
| | | } |
| | | } |
| | | |
| | | if (context.Properties.ContainsKey("SeedTestData") && context.Properties["SeedTestData"]?.ToString() == "SeedTestData") |
| | | { |
| | | try |
| | | { |
| | | await SeedWmsContainerDataAsync(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | Console.WriteLine(e.Message); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Seeds the work section data asynchronous. |
| | | /// </summary> |
| | | private async Task SeedWmsContainerDataAsync() |
| | | { |
| | | |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Linq.Expressions; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsContainers |
| | | { |
| | | /// <summary> |
| | | /// WmsContainerè§çº¦ |
| | | /// </summary> |
| | | public class WmsContainerSpecification : Volo.Abp.Specifications.Specification<WmsContainer> |
| | | { |
| | | private readonly string _containerNo; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsContainerSpecification"/> class. |
| | | /// </summary> |
| | | public WmsContainerSpecification() |
| | | { |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsContainerSpecification"/> class. |
| | | /// </summary> |
| | | /// <param name="containerNo">The name.</param> |
| | | public WmsContainerSpecification(string containerNo = null) |
| | | { |
| | | _containerNo = containerNo; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public override Expression<Func<WmsContainer, bool>> ToExpression() |
| | | { |
| | | Expression<Func<WmsContainer, bool>> expression = c => 1 == 1; |
| | | |
| | | if (_containerNo != null) |
| | | { |
| | | expression = expression.And(c => c.ContainerNo == _containerNo); |
| | | } |
| | | |
| | | return expression; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CmsQueryExtensions.Extension; |
| | | using System.Linq.Expressions; |
| | | using Volo.Abp.Domain.Repositories; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsInOutStockRecord; |
| | | |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½è¡¨ä»å¨ |
| | | /// </summary> |
| | | public interface IWmsInOutStockRecordRepository : IBasicRepository<WmsInOutStockRecord, Guid> |
| | | { |
| | | /// <summary> |
| | | /// æç
§åç§°æ¥æ¾åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="name"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | Task<WmsInOutStockRecord> FindByNameAsync(string name, CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// éªè¯åç§°æ¯å¦åå¨åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="name"></param> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | Task<bool> NameExistAsync(string name, Guid? id = null); |
| | | |
| | | /// <summary> |
| | | /// è·åæå¤§æåºåºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | Task<int> GetMaxSortAsync(); |
| | | |
| | | /// <summary> |
| | | /// è·åå页å表åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="whereConditions"></param> |
| | | /// <param name="sorting"></param> |
| | | /// <param name="maxResultCount"></param> |
| | | /// <param name="skipCount"></param> |
| | | /// <param name="includeDetails"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | Task<List<WmsInOutStockRecord>> GetListAsync(FunReturnResultModel<Expression<Func<WmsInOutStockRecord, bool>>> whereConditions, string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, bool includeDetails = false, CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// è·åæ»æ°åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="whereConditions"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | Task<long> GetCountAsync(FunReturnResultModel<Expression<Func<WmsInOutStockRecord, bool>>> whereConditions, CancellationToken cancellationToken = default); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using Volo.Abp.Domain.Entities.Auditing; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsInOutStockRecord |
| | | { |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½. |
| | | /// </summary> |
| | | public class WmsInOutStockRecord : FullAuditedAggregateRoot<Guid> |
| | | { |
| | | /// <summary> |
| | | /// åæ®ç¼å· |
| | | /// </summary> |
| | | public string OrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æåç§° |
| | | /// </summary> |
| | | public string? MaterialName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æä»¶å· |
| | | /// </summary> |
| | | public string MaterialNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä½ç±»å |
| | | /// </summary> |
| | | public StockTypeEnum StockType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 容å¨ç¼å·. |
| | | /// </summary> |
| | | public string? ContainerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå· |
| | | /// </summary> |
| | | public string? MaterialModel { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä½æ¶é´ |
| | | /// </summary> |
| | | public DateTime? OperateTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public string? Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æID |
| | | /// </summary> |
| | | public string MaterialId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | public string TaskNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èµ·å§åºä½ |
| | | /// </summary> |
| | | public string? SourcePlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ åºä½ |
| | | /// </summary> |
| | | public string? ToPlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public virtual int Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public virtual bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Adjusts the sort. |
| | | /// </summary> |
| | | /// <param name="sort">The sort.</param> |
| | | public void AdjustSort(int sort) |
| | | { |
| | | Sort = sort; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CmsQueryExtensions.Extension; |
| | | using System.Linq.Expressions; |
| | | using Volo.Abp.Domain.Repositories; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsMaterial; |
| | | |
| | | /// <summary> |
| | | /// ç©æåºç¡ä¿¡æ¯è¡¨ä»å¨ |
| | | /// </summary> |
| | | public interface IWmsMaterialRepository : IBasicRepository<WmsMaterial, Guid> |
| | | { |
| | | /// <summary> |
| | | /// æç
§åç§°æ¥æ¾ç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="name"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | Task<WmsMaterial> FindByNameAsync(string name, CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// éªè¯åç§°æ¯å¦åå¨ç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="name"></param> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | Task<bool> NameExistAsync(string name, Guid? id = null); |
| | | |
| | | /// <summary> |
| | | /// è·åæå¤§æåºç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | Task<int> GetMaxSortAsync(); |
| | | |
| | | /// <summary> |
| | | /// è·åå页åè¡¨ç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="whereConditions"></param> |
| | | /// <param name="sorting"></param> |
| | | /// <param name="maxResultCount"></param> |
| | | /// <param name="skipCount"></param> |
| | | /// <param name="includeDetails"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | Task<List<WmsMaterial>> GetListAsync(FunReturnResultModel<Expression<Func<WmsMaterial, bool>>> whereConditions, string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, bool includeDetails = false, CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// è·åæ»æ°ç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="whereConditions"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | Task<long> GetCountAsync(FunReturnResultModel<Expression<Func<WmsMaterial, bool>>> whereConditions, CancellationToken cancellationToken = default); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsMaterial; |
| | | using MathNet.Numerics; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Domain.Entities.Auditing; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsMaterial |
| | | { |
| | | /// <summary> |
| | | /// WmsMaterial |
| | | /// </summary> |
| | | public class WmsMaterial : FullAuditedAggregateRoot<Guid> |
| | | { |
| | | /// <summary> |
| | | /// ç©æç¼ç ï¼å¯ä¸æ è¯ï¼ |
| | | /// </summary> |
| | | public string MaterialCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æåç§° |
| | | /// </summary> |
| | | public string MaterialName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éè´ç±»åï¼æä¸¾å¼ï¼ |
| | | /// </summary> |
| | | public PurchaseTypeEnum PurchaseType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç±»åï¼æä¸¾å¼ï¼ |
| | | /// </summary> |
| | | public MaterialTypeEnum MaterialType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 主åä½ï¼å¦ï¼kgãmãä¸ªï¼ |
| | | /// </summary> |
| | | public string PrimaryUnit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è§æ ¼/æ åï¼å¦ï¼GB/T 8163-2018ï¼ |
| | | /// </summary> |
| | | public string Standard { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¤å¾ï¼åä½ï¼mmï¼ |
| | | /// </summary> |
| | | public decimal OuterDiameter { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å£åï¼åä½ï¼mmï¼ |
| | | /// </summary> |
| | | public decimal WallThickness { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æè´¨ï¼å¦ï¼304ä¸éé¢ï¼ |
| | | /// </summary> |
| | | public string MaterialQuality { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¿åº¦ï¼åä½ï¼mï¼ |
| | | /// </summary> |
| | | public decimal Length { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ä¸ºä¸»æ¯ç®¡ï¼true: 主æ¯ç®¡, false: é主æ¯ç®¡ï¼ |
| | | /// </summary> |
| | | public YesNoEnum IsMainBranch { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产工å |
| | | /// </summary> |
| | | public string Factory { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è¯ä¹¦ç¼å·ï¼å¦ï¼åå容å¨è®¤è¯ï¼ |
| | | /// </summary> |
| | | public string Certification { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段1 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段2 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段3 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public virtual int Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public virtual string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public virtual bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Adjusts the sort. |
| | | /// </summary> |
| | | /// <param name="sort">The sort.</param> |
| | | public void AdjustSort(int sort) |
| | | { |
| | | Sort = sort; |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.DependencyInjection; |
| | | using Volo.Abp.Guids; |
| | | using Volo.Abp.Uow; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsMaterial |
| | | { |
| | | /// <summary> |
| | | /// WmsMaterialç§åæ°æ®æä¾ç¨åº |
| | | /// </summary> |
| | | public class WmsMaterialDataSeedContributor : IDataSeedContributor, ITransientDependency |
| | | { |
| | | private readonly IUnitOfWorkManager _unitOfWorkManager; |
| | | private readonly IWmsMaterialRepository _wmsmaterialRepository; |
| | | private readonly IGuidGenerator _guidGenerator; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsMaterialDataSeedContributor"/> class. |
| | | /// </summary> |
| | | /// <param name="unitOfWorkManager">The unit of work manager.</param> |
| | | /// <param name="guidGenerator">The unique identifier generator.</param> |
| | | /// <param name="wmsmaterialRepository">The work section repository.</param> |
| | | public WmsMaterialDataSeedContributor(IUnitOfWorkManager unitOfWorkManager, IGuidGenerator guidGenerator, IWmsMaterialRepository wmsmaterialRepository) |
| | | { |
| | | _unitOfWorkManager = unitOfWorkManager; |
| | | _wmsmaterialRepository = wmsmaterialRepository; |
| | | _guidGenerator = guidGenerator; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task SeedAsync(DataSeedContext context) |
| | | { |
| | | if (context.Properties.ContainsKey(CMSPluginDbProperties.ConnectionStringName) && context.Properties[CMSPluginDbProperties.ConnectionStringName]?.ToString() == CMSPluginDbProperties.ConnectionStringName) |
| | | { |
| | | try |
| | | { |
| | | //using var unitofWork = _unitOfWorkManager.Begin(requiresNew: true); |
| | | //await unitofWork.SaveChangesAsync(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Console.WriteLine(ex.Message); |
| | | } |
| | | } |
| | | |
| | | if (context.Properties.ContainsKey("SeedTestData") && context.Properties["SeedTestData"]?.ToString() == "SeedTestData") |
| | | { |
| | | try |
| | | { |
| | | await SeedWmsMaterialDataAsync(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | Console.WriteLine(e.Message); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Seeds the work section data asynchronous. |
| | | /// </summary> |
| | | private async Task SeedWmsMaterialDataAsync() |
| | | { |
| | | |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | //using System.Linq.Expressions; |
| | | |
| | | //namespace CMS.Plugin.HIAWms.Domain.WmsMaterials |
| | | //{ |
| | | // /// <summary> |
| | | // /// WmsMaterialè§çº¦ |
| | | // /// </summary> |
| | | // public class WmsMaterialSpecification : Volo.Abp.Specifications.Specification<WmsMaterial> |
| | | // { |
| | | // private readonly string _materialCode; |
| | | |
| | | // /// <summary> |
| | | // /// Initializes a new instance of the <see cref="WmsMaterialSpecification"/> class. |
| | | // /// </summary> |
| | | // public WmsMaterialSpecification() |
| | | // { |
| | | // } |
| | | |
| | | // /// <summary> |
| | | // /// Initializes a new instance of the <see cref="WmsMaterialSpecification"/> class. |
| | | // /// </summary> |
| | | // /// <param name="materialCode">The name.</param> |
| | | // public WmsMaterialSpecification(string materialCode = null) |
| | | // { |
| | | // _materialCode = materialCode; |
| | | // } |
| | | |
| | | // /// <inheritdoc /> |
| | | // public override Expression<Func<WmsMaterial, bool>> ToExpression() |
| | | // { |
| | | // Expression<Func<WmsMaterial, bool>> expression = c => 1 == 1; |
| | | |
| | | // if (_materialCode != null) |
| | | // { |
| | | // expression = expression.And(c => c.MaterialCode == _materialCode); |
| | | // } |
| | | |
| | | // return expression; |
| | | // } |
| | | // } |
| | | //} |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Domain.Repositories; |
| | | using Volo.Abp.Specifications; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsPlaces; |
| | | |
| | | /// <summary> |
| | | /// WmsPlaceä»å¨ |
| | | /// </summary> |
| | | public interface IWmsPlaceRepository : IBasicRepository<WmsPlace, Guid> |
| | | { |
| | | /// <summary> |
| | | /// Finds the by name asynchronous. |
| | | /// </summary> |
| | | /// <param name="name">The name.</param> |
| | | /// <param name="cancellationToken">The cancellation token.</param> |
| | | /// <returns></returns> |
| | | Task<WmsPlace> FindByNameAsync(string name, CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// Names the exist asynchronous. |
| | | /// </summary> |
| | | /// <param name="name">The name.</param> |
| | | /// <param name="id">The identifier.</param> |
| | | /// <returns></returns> |
| | | Task<bool> NameExistAsync(string name, Guid? id = null); |
| | | |
| | | /// <summary> |
| | | /// Gets the maximum sort asynchronous. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | Task<int> GetMaxSortAsync(); |
| | | |
| | | /// <summary> |
| | | /// Gets the list asynchronous. |
| | | /// </summary> |
| | | /// <param name="sorting">The sorting.</param> |
| | | /// <param name="maxResultCount">The maximum result count.</param> |
| | | /// <param name="skipCount">The skip count.</param> |
| | | /// <param name="filter">The filter.</param> |
| | | /// <param name="specification">The specification.</param> |
| | | /// <param name="includeDetails">if set to <c>true</c> [include details].</param> |
| | | /// <param name="cancellationToken">The cancellation token.</param> |
| | | /// <returns></returns> |
| | | Task<List<WmsPlace>> GetListAsync(WmsPlace? place, string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, string filter = null, Specification<WmsPlace> specification = null, bool includeDetails = false, CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// Gets the count asynchronous. |
| | | /// </summary> |
| | | /// <param name="filter">The filter.</param> |
| | | /// <param name="specification">The specification.</param> |
| | | /// <param name="cancellationToken">The cancellation token.</param> |
| | | /// <returns></returns> |
| | | Task<long> GetCountAsync(WmsPlace? place, string filter = null, Specification<WmsPlace> specification = null, CancellationToken cancellationToken = default); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsPlaces; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Domain.Entities.Auditing; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsPlaces |
| | | { |
| | | /// <summary> |
| | | /// WmsPlace |
| | | /// </summary> |
| | | public class WmsPlace : FullAuditedAggregateRoot<Guid> |
| | | { |
| | | /// <summary> |
| | | /// ç¼å· |
| | | /// </summary> |
| | | public virtual string PlaceNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´§ä½ç±»å |
| | | /// </summary> |
| | | public PlaceTypeEnum StorageTypeNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´§ä½ç¶æ |
| | | /// </summary> |
| | | public PlaceStatusEnum PlaceStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æå¨åºåº |
| | | /// </summary> |
| | | public string AreaCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å··é |
| | | /// </summary> |
| | | public int Aisle { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ |
| | | /// </summary> |
| | | public int RowNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å |
| | | /// </summary> |
| | | public int ColumnNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å± |
| | | /// </summary> |
| | | public int LayerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦éå® |
| | | /// </summary> |
| | | public YesNoEnum Islock { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç©ºæ |
| | | /// </summary> |
| | | public YesNoEnum EmptyContainer { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段1 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段2 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段3 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField3 { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public virtual int Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public virtual string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public virtual bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Adjusts the sort. |
| | | /// </summary> |
| | | /// <param name="sort">The sort.</param> |
| | | public void AdjustSort(int sort) |
| | | { |
| | | Sort = sort; |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.DependencyInjection; |
| | | using Volo.Abp.Guids; |
| | | using Volo.Abp.Uow; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsPlaces |
| | | { |
| | | /// <summary> |
| | | /// WmsPlaceç§åæ°æ®æä¾ç¨åº |
| | | /// </summary> |
| | | public class WmsPlaceDataSeedContributor : IDataSeedContributor, ITransientDependency |
| | | { |
| | | private readonly IUnitOfWorkManager _unitOfWorkManager; |
| | | private readonly IWmsPlaceRepository _wmsplaceRepository; |
| | | private readonly IGuidGenerator _guidGenerator; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsPlaceDataSeedContributor"/> class. |
| | | /// </summary> |
| | | /// <param name="unitOfWorkManager">The unit of work manager.</param> |
| | | /// <param name="guidGenerator">The unique identifier generator.</param> |
| | | /// <param name="wmsplaceRepository">The work section repository.</param> |
| | | public WmsPlaceDataSeedContributor(IUnitOfWorkManager unitOfWorkManager, IGuidGenerator guidGenerator, IWmsPlaceRepository wmsplaceRepository) |
| | | { |
| | | _unitOfWorkManager = unitOfWorkManager; |
| | | _wmsplaceRepository = wmsplaceRepository; |
| | | _guidGenerator = guidGenerator; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task SeedAsync(DataSeedContext context) |
| | | { |
| | | if (context.Properties.ContainsKey(CMSPluginDbProperties.ConnectionStringName) && context.Properties[CMSPluginDbProperties.ConnectionStringName]?.ToString() == CMSPluginDbProperties.ConnectionStringName) |
| | | { |
| | | try |
| | | { |
| | | //using var unitofWork = _unitOfWorkManager.Begin(requiresNew: true); |
| | | //await unitofWork.SaveChangesAsync(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Console.WriteLine(ex.Message); |
| | | } |
| | | } |
| | | |
| | | if (context.Properties.ContainsKey("SeedTestData") && context.Properties["SeedTestData"]?.ToString() == "SeedTestData") |
| | | { |
| | | try |
| | | { |
| | | await SeedWmsPlaceDataAsync(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | Console.WriteLine(e.Message); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Seeds the work section data asynchronous. |
| | | /// </summary> |
| | | private async Task SeedWmsPlaceDataAsync() |
| | | { |
| | | |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Linq.Expressions; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsPlaces |
| | | { |
| | | /// <summary> |
| | | /// WmsPlaceè§çº¦ |
| | | /// </summary> |
| | | public class WmsPlaceSpecification : Volo.Abp.Specifications.Specification<WmsPlace> |
| | | { |
| | | private readonly string _placeNo; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsPlaceSpecification"/> class. |
| | | /// </summary> |
| | | public WmsPlaceSpecification() |
| | | { |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsPlaceSpecification"/> class. |
| | | /// </summary> |
| | | /// <param name="placeNo">The name.</param> |
| | | public WmsPlaceSpecification(string placeNo = null) |
| | | { |
| | | _placeNo = placeNo; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public override Expression<Func<WmsPlace, bool>> ToExpression() |
| | | { |
| | | Expression<Func<WmsPlace, bool>> expression = c => 1 == 1; |
| | | |
| | | if (_placeNo != null) |
| | | { |
| | | expression = expression.And(c => c.PlaceNo == _placeNo); |
| | | } |
| | | |
| | | return expression; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Domain.Repositories; |
| | | using Volo.Abp.Specifications; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsStores; |
| | | |
| | | /// <summary> |
| | | /// WmsStoreä»å¨ |
| | | /// </summary> |
| | | public interface IWmsStoreRepository : IBasicRepository<WmsStore, Guid> |
| | | { |
| | | /// <summary> |
| | | /// Finds the by name asynchronous. |
| | | /// </summary> |
| | | /// <param name="name">The name.</param> |
| | | /// <param name="cancellationToken">The cancellation token.</param> |
| | | /// <returns></returns> |
| | | Task<WmsStore> FindByNameAsync(string name, CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// Names the exist asynchronous. |
| | | /// </summary> |
| | | /// <param name="name">The name.</param> |
| | | /// <param name="id">The identifier.</param> |
| | | /// <returns></returns> |
| | | Task<bool> NameExistAsync(string name, Guid? id = null); |
| | | |
| | | /// <summary> |
| | | /// Gets the maximum sort asynchronous. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | Task<int> GetMaxSortAsync(); |
| | | |
| | | /// <summary> |
| | | /// Gets the list asynchronous. |
| | | /// </summary> |
| | | /// <param name="sorting">The sorting.</param> |
| | | /// <param name="maxResultCount">The maximum result count.</param> |
| | | /// <param name="skipCount">The skip count.</param> |
| | | /// <param name="filter">The filter.</param> |
| | | /// <param name="specification">The specification.</param> |
| | | /// <param name="includeDetails">if set to <c>true</c> [include details].</param> |
| | | /// <param name="cancellationToken">The cancellation token.</param> |
| | | /// <returns></returns> |
| | | Task<List<WmsStore>> GetListAsync(WmsStore? store, string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, string filter = null, Specification<WmsStore> specification = null, bool includeDetails = false, CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// æ¥è¯¢ä»åºå表 |
| | | /// </summary> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | Task<List<WmsStore>> GetListForSelectAsync(CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// Gets the count asynchronous. |
| | | /// </summary> |
| | | /// <param name="filter">The filter.</param> |
| | | /// <param name="specification">The specification.</param> |
| | | /// <param name="cancellationToken">The cancellation token.</param> |
| | | /// <returns></returns> |
| | | Task<long> GetCountAsync(WmsStore? store, string filter = null, Specification<WmsStore> specification = null, CancellationToken cancellationToken = default); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsStores; |
| | | using Microsoft.EntityFrameworkCore.Metadata.Internal; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Domain.Entities.Auditing; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsStores |
| | | { |
| | | /// <summary> |
| | | /// WmsStore |
| | | /// </summary> |
| | | public class WmsStore : FullAuditedAggregateRoot<Guid> |
| | | { |
| | | |
| | | /// <summary> |
| | | /// ä»åºä»£ç |
| | | /// </summary> |
| | | public string? StoreCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºåç§° |
| | | /// </summary> |
| | | public string? StoreName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段1 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段2 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段3 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨. |
| | | /// </summary> |
| | | public string? Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public virtual int Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public virtual bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Adjusts the sort. |
| | | /// </summary> |
| | | /// <param name="sort">The sort.</param> |
| | | public void AdjustSort(int sort) |
| | | { |
| | | Sort = sort; |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.DependencyInjection; |
| | | using Volo.Abp.Guids; |
| | | using Volo.Abp.Uow; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsStores |
| | | { |
| | | /// <summary> |
| | | /// WmsStoreç§åæ°æ®æä¾ç¨åº |
| | | /// </summary> |
| | | public class WmsStoreDataSeedContributor : IDataSeedContributor, ITransientDependency |
| | | { |
| | | private readonly IUnitOfWorkManager _unitOfWorkManager; |
| | | private readonly IWmsStoreRepository _wmsstoreRepository; |
| | | private readonly IGuidGenerator _guidGenerator; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsStoreDataSeedContributor"/> class. |
| | | /// </summary> |
| | | /// <param name="unitOfWorkManager">The unit of work manager.</param> |
| | | /// <param name="guidGenerator">The unique identifier generator.</param> |
| | | /// <param name="wmsstoreRepository">The work section repository.</param> |
| | | public WmsStoreDataSeedContributor(IUnitOfWorkManager unitOfWorkManager, IGuidGenerator guidGenerator, IWmsStoreRepository wmsstoreRepository) |
| | | { |
| | | _unitOfWorkManager = unitOfWorkManager; |
| | | _wmsstoreRepository = wmsstoreRepository; |
| | | _guidGenerator = guidGenerator; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task SeedAsync(DataSeedContext context) |
| | | { |
| | | if (context.Properties.ContainsKey(CMSPluginDbProperties.ConnectionStringName) && context.Properties[CMSPluginDbProperties.ConnectionStringName]?.ToString() == CMSPluginDbProperties.ConnectionStringName) |
| | | { |
| | | try |
| | | { |
| | | //using var unitofWork = _unitOfWorkManager.Begin(requiresNew: true); |
| | | //await unitofWork.SaveChangesAsync(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Console.WriteLine(ex.Message); |
| | | } |
| | | } |
| | | |
| | | if (context.Properties.ContainsKey("SeedTestData") && context.Properties["SeedTestData"]?.ToString() == "SeedTestData") |
| | | { |
| | | try |
| | | { |
| | | await SeedWmsStoreDataAsync(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | Console.WriteLine(e.Message); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Seeds the work section data asynchronous. |
| | | /// </summary> |
| | | private async Task SeedWmsStoreDataAsync() |
| | | { |
| | | |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Linq.Expressions; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsStores |
| | | { |
| | | /// <summary> |
| | | /// WmsStoreè§çº¦ |
| | | /// </summary> |
| | | public class WmsStoreSpecification : Volo.Abp.Specifications.Specification<WmsStore> |
| | | { |
| | | private readonly string _storeCode; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsStoreSpecification"/> class. |
| | | /// </summary> |
| | | public WmsStoreSpecification() |
| | | { |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsStoreSpecification"/> class. |
| | | /// </summary> |
| | | /// <param name="storeCode">The name.</param> |
| | | public WmsStoreSpecification(string storeCode = null) |
| | | { |
| | | _storeCode = storeCode; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public override Expression<Func<WmsStore, bool>> ToExpression() |
| | | { |
| | | Expression<Func<WmsStore, bool>> expression = c => 1 == 1; |
| | | |
| | | if (_storeCode != null) |
| | | { |
| | | expression = expression.And(c => c.StoreCode == _storeCode); |
| | | } |
| | | |
| | | return expression; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using NPOI.SS.Formula.Functions; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using Volo.Abp.Domain.Entities.Auditing; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsTask |
| | | { |
| | | /// <summary> |
| | | /// ä»»å¡ |
| | | /// </summary>W |
| | | public class WmsTask : FullAuditedAggregateRoot<Guid> |
| | | { |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | public string TaskNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç±»å |
| | | /// </summary> |
| | | public TaskTypeEnum TaskType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç级 |
| | | /// </summary> |
| | | public int TaskLevel { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç¶æ |
| | | /// </summary> |
| | | public WmsTaskStatus TaskStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç¼å· |
| | | /// </summary> |
| | | public string? ContainerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èµ·å§åºä½ |
| | | /// </summary> |
| | | public string? SourcePlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ åºä½ |
| | | /// </summary> |
| | | public string? ToPlace { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å··é |
| | | /// </summary> |
| | | public int? Aisle { get; set; } |
| | | /// <summary> |
| | | /// å åæºID |
| | | /// </summary> |
| | | public int? DodeviceId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 设å¤ç±»å |
| | | /// </summary> |
| | | public int Dodevicetype { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 设å¤ä»»å¡ç¶æ |
| | | /// </summary> |
| | | public int TaskDodeviceStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// WCSæ¯å¦å¯ä»¥è¯»å |
| | | /// </summary> |
| | | public bool IsRead { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä»»å¡ç±»å |
| | | /// </summary> |
| | | public SonTaskTypeEnum? SonTaskType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥æºåæ®å· |
| | | /// </summary> |
| | | public string? SourceOrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å
³èçä¸ä¸ªä»»å¡æ¯å¦çææåï¼å¤±è´¥ä¸º1ï¼å
¶ä»æ æä½ |
| | | /// </summary> |
| | | public int? IsNextTask { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¯ååé1 |
| | | /// </summary> |
| | | public string? MutableParam1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¯ååé2 |
| | | /// </summary> |
| | | public string? MutableParam2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¯ååé3 |
| | | /// </summary> |
| | | public string? MutableParam3 { get; set; } |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public virtual int Sort { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public virtual bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Adjusts the sort. |
| | | /// </summary> |
| | | /// <param name="sort">The sort.</param> |
| | | public void AdjustSort(int sort) |
| | | { |
| | | Sort = sort; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | |
| | | <Import Project="../../common.props" /> |
| | | <Import Project="../../configureawait.props" /> |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="Volo.Abp.Dapper" Version="$(ABPPackageVersion)" /> |
| | | <PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="$(ABPPackageVersion)" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\CMS.Plugin.HIAWms.Domain\CMS.Plugin.HIAWms.Domain.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <Reference Include="CmsQueryExtensions"> |
| | | <HintPath>..\..\..\..\..\CommonDLL\CmsQueryExtensions.dll</HintPath> |
| | | </Reference> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Data; |
| | | using Volo.Abp.Domain.Repositories.Dapper; |
| | | using Volo.Abp.EntityFrameworkCore; |
| | | |
| | | namespace CMS.Plugin.HIAWms.EntityFrameworkCore; |
| | | |
| | | /// <inheritdoc /> |
| | | public class CMSPluginDapperRepository : DapperRepository<ICMSPluginDbContext>, ICMSPluginDapperRepository |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="CMSPluginDapperRepository"/> class. |
| | | /// </summary> |
| | | /// <param name="dbContextProvider">The database context provider.</param> |
| | | public CMSPluginDapperRepository(IDbContextProvider<ICMSPluginDbContext> dbContextProvider) |
| | | : base(dbContextProvider) |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Data; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Microsoft.Extensions.Logging; |
| | | using Volo.Abp.DependencyInjection; |
| | | |
| | | namespace CMS.Plugin.HIAWms.EntityFrameworkCore; |
| | | |
| | | /// <inheritdoc /> |
| | | public class CMSPluginDbSchemaMigrator : ICMSPluginDbSchemaMigrator, ITransientDependency |
| | | { |
| | | private readonly IServiceProvider _serviceProvider; |
| | | private readonly ILogger<CMSPluginDbSchemaMigrator> _logger; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="CMSPluginDbSchemaMigrator"/> class. |
| | | /// </summary> |
| | | /// <param name="serviceProvider">The service provider.</param> |
| | | public CMSPluginDbSchemaMigrator(IServiceProvider serviceProvider, ILogger<CMSPluginDbSchemaMigrator> logger) |
| | | { |
| | | _serviceProvider = serviceProvider; |
| | | _logger = logger; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task MigrateAsync() |
| | | { |
| | | /* We intentionally resolving the CMSDbContext |
| | | * from IServiceProvider (instead of directly injecting it) |
| | | * to properly get the connection string of the current tenant in the |
| | | * current scope. |
| | | */ |
| | | var database = _serviceProvider.GetRequiredService<ICMSPluginDbContext>().Database; |
| | | _logger.LogInformation($"Start database {database.GetDbConnection().Database} migrate"); |
| | | await database.MigrateAsync(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared; |
| | | using Volo.Abp.Threading; |
| | | |
| | | namespace CMS.Plugin.HIAWms.EntityFrameworkCore; |
| | | |
| | | /// <summary> |
| | | /// EfCoreå®ä½æ©å± |
| | | /// </summary> |
| | | public static class CMSPluginEfCoreEntityExtensionMappings |
| | | { |
| | | private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); |
| | | |
| | | /// <summary> |
| | | /// Configures this instance. |
| | | /// </summary> |
| | | public static void Configure() |
| | | { |
| | | CMSPluginModuleExtensionConfigurator.Configure(); |
| | | |
| | | OneTimeRunner.Run(() => |
| | | { |
| | | /* You can configure extra properties for the |
| | | * entities defined in the modules used by your application. |
| | | * |
| | | * This class can be used to map these extra properties to table fields in the database. |
| | | * |
| | | * USE THIS CLASS ONLY TO CONFIGURE EF CORE RELATED MAPPING. |
| | | * USE CMSModuleExtensionConfigurator CLASS (in the Domain.Shared project) |
| | | * FOR A HIGH LEVEL API TO DEFINE EXTRA PROPERTIES TO ENTITIES OF THE USED MODULES |
| | | * |
| | | * Example: Map a property to a table field: |
| | | |
| | | ObjectExtensionManager.Instance |
| | | .MapEfCoreProperty<WmsContainer, string>( |
| | | "MyProperty", |
| | | (entityBuilder, propertyBuilder) => |
| | | { |
| | | propertyBuilder.HasMaxLength(128); |
| | | } |
| | | ); |
| | | |
| | | * See the documentation for more: |
| | | * https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities |
| | | */ |
| | | }); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain; |
| | | using Volo.Abp.EntityFrameworkCore; |
| | | using Volo.Abp.Modularity; |
| | | |
| | | namespace CMS.Plugin.HIAWms.EntityFrameworkCore; |
| | | |
| | | /// <summary> |
| | | /// EntityFrameworkCore模å |
| | | /// </summary> |
| | | [DependsOn( |
| | | typeof(CMSPluginDomainModule), |
| | | typeof(AbpEntityFrameworkCoreModule) |
| | | )] |
| | | public class CMSPluginEntityFrameworkCoreModule : AbpModule |
| | | { |
| | | /// <inheritdoc /> |
| | | public override void PreConfigureServices(ServiceConfigurationContext context) |
| | | { |
| | | CMSPluginEfCoreEntityExtensionMappings.Configure(); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public override void ConfigureServices(ServiceConfigurationContext context) |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain; |
| | | using CMS.Plugin.HIAWms.Domain.WmsAreas; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsAreas; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Volo.Abp; |
| | | using Volo.Abp.EntityFrameworkCore.Modeling; |
| | | |
| | | namespace CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions; |
| | | |
| | | /// <summary> |
| | | /// EfCoreæ©å± |
| | | /// </summary> |
| | | public static partial class CMSPluginEfCoreExtensions |
| | | { |
| | | /// <summary> |
| | | /// Includes the details. |
| | | /// </summary> |
| | | /// <param name="queryable">The queryable.</param> |
| | | /// <param name="include">if set to <c>true</c> [include].</param> |
| | | /// <returns></returns> |
| | | public static IQueryable<WmsArea> IncludeDetails(this IQueryable<WmsArea> queryable, bool include = true) |
| | | { |
| | | if (!include) |
| | | { |
| | | return queryable; |
| | | } |
| | | |
| | | return queryable; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Configures the wmsarea. |
| | | /// </summary> |
| | | /// <param name="builder">The builder.</param> |
| | | public static void ConfigureWmsArea(this ModelBuilder builder) |
| | | { |
| | | Check.NotNull(builder, nameof(builder)); |
| | | |
| | | builder.Entity<WmsArea>(b => |
| | | { |
| | | // Configure table & schema name |
| | | b.ToTable((CMSPluginDbProperties.DbTablePrefix + "_WmsAreas").ToLower(), CMSPluginDbProperties.DbSchema).HasComment("åºåºè¡¨"); |
| | | |
| | | b.ConfigureByConvention(); |
| | | |
| | | // Properties |
| | | b.Property(x => x.AreaNo).HasMaxLength(WmsAreaConsts.MaxNameLength).IsRequired().HasComment("åºåºç¼å·"); |
| | | b.Property(x => x.AreaName).HasMaxLength(WmsAreaConsts.MaxAreaNameLength).IsRequired().HasComment("åºåºåç§°"); |
| | | b.Property(x => x.AreaDesc).HasMaxLength(WmsAreaConsts.MaxAreaDescLength).IsRequired(false).HasComment("æè¿°"); |
| | | b.Property(x => x.AreaStatus).HasComment("åºåºç¶æ"); |
| | | b.Property(x => x.AreaType).HasComment("åºåºç±»å"); |
| | | b.Property(x => x.RedundantField1).HasMaxLength(WmsAreaConsts.MaxRedundantFieldLength).IsRequired(false).HasComment("åä½å段1 - é¢çæ©å±ç¨é"); |
| | | b.Property(x => x.RedundantField2).HasMaxLength(WmsAreaConsts.MaxRedundantFieldLength).IsRequired(false).HasComment("åä½å段2 - é¢çæ©å±ç¨é"); |
| | | b.Property(x => x.RedundantField3).HasMaxLength(WmsAreaConsts.MaxRedundantFieldLength).IsRequired(false).HasComment("åä½å段3 - é¢çæ©å±ç¨é"); |
| | | b.Property(x => x.StoreCode).HasMaxLength(WmsAreaConsts.MaxStoreCodeLength).IsRequired(false).HasComment("ä»åºä»£ç "); |
| | | b.Property(x => x.StoreName).HasMaxLength(WmsAreaConsts.MaxStoreNameLength).IsRequired(false).HasComment("ä»åºåç§°"); |
| | | b.Property(x => x.Sort).HasComment("æåº"); |
| | | b.Property(x => x.Remark).HasMaxLength(WmsAreaConsts.MaxRemarkLength).IsRequired(false).HasComment("夿³¨"); |
| | | b.Property(x => x.IsDisabled).IsRequired(false).HasComment("æ¯å¦ç¦ç¨"); |
| | | |
| | | // Indexes |
| | | b.HasIndex(u => u.AreaName); |
| | | |
| | | // Apply object extension mappings |
| | | b.ApplyObjectExtensionMappings(); |
| | | }); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain; |
| | | using CMS.Plugin.HIAWms.Domain.WmsContainers; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsContainers; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Volo.Abp; |
| | | using Volo.Abp.EntityFrameworkCore.Modeling; |
| | | |
| | | namespace CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions; |
| | | |
| | | /// <summary> |
| | | /// EfCoreæ©å± |
| | | /// </summary> |
| | | public static partial class CMSPluginEfCoreExtensions |
| | | { |
| | | /// <summary> |
| | | /// Includes the details. |
| | | /// </summary> |
| | | /// <param name="queryable">The queryable.</param> |
| | | /// <param name="include">if set to <c>true</c> [include].</param> |
| | | /// <returns></returns> |
| | | public static IQueryable<WmsContainer> IncludeDetails(this IQueryable<WmsContainer> queryable, bool include = true) |
| | | { |
| | | if (!include) |
| | | { |
| | | return queryable; |
| | | } |
| | | |
| | | return queryable; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Configures the wmscontainer. |
| | | /// </summary> |
| | | /// <param name="builder">The builder.</param> |
| | | public static void ConfigureWmsContainer(this ModelBuilder builder) |
| | | { |
| | | Check.NotNull(builder, nameof(builder)); |
| | | |
| | | builder.Entity<WmsContainer>(b => |
| | | { |
| | | b.ToTable((CMSPluginDbProperties.DbTablePrefix + "_WmsContainers").ToLower(), CMSPluginDbProperties.DbSchema) |
| | | .HasComment("æçä¿¡æ¯è¡¨"); |
| | | |
| | | b.ConfigureByConvention(); |
| | | |
| | | //Properties |
| | | b.Property(x => x.ContainerNo) |
| | | .HasMaxLength(50) |
| | | .IsRequired() |
| | | .HasComment("æçç¼å·"); |
| | | |
| | | b.Property(x => x.ContainerType) |
| | | .IsRequired() |
| | | .HasComment("æçç±»å"); |
| | | |
| | | b.Property(x => x.ContainerStatus) |
| | | .IsRequired() |
| | | .HasComment("æçç¶æ"); |
| | | |
| | | b.Property(x => x.SpecLength) |
| | | .HasPrecision(18, 2) |
| | | .HasComment("é¿åº¦"); |
| | | |
| | | b.Property(x => x.SpecWidth) |
| | | .HasPrecision(18, 2) |
| | | .HasComment("宽度"); |
| | | |
| | | b.Property(x => x.SpecHeight) |
| | | .HasPrecision(18, 2) |
| | | .HasComment("é«åº¦"); |
| | | |
| | | b.Property(x => x.LimitLength) |
| | | .HasPrecision(18, 2) |
| | | .HasComment("éé¿"); |
| | | |
| | | b.Property(x => x.LimitWidth) |
| | | .HasPrecision(18, 2) |
| | | .HasComment("é宽"); |
| | | |
| | | b.Property(x => x.LimitHeight) |
| | | .HasPrecision(18, 2) |
| | | .HasComment("éé«"); |
| | | |
| | | b.Property(x => x.MaxWeight) |
| | | .HasPrecision(18, 2) |
| | | .HasComment("è½½éä¸é"); |
| | | |
| | | b.Property(x => x.ExceptionNumber) |
| | | .HasComment("å¼å¸¸æ°é"); |
| | | |
| | | b.Property(x => x.MaterialNumber) |
| | | .HasComment("ç©ææ°é"); |
| | | |
| | | b.Property(x => x.RedundantField1) |
| | | .HasMaxLength(200) |
| | | .HasComment("åä½å段1 - é¢çæ©å±ç¨é"); |
| | | |
| | | b.Property(x => x.RedundantField2) |
| | | .HasMaxLength(200) |
| | | .HasComment("åä½å段2 - é¢çæ©å±ç¨é"); |
| | | |
| | | b.Property(x => x.RedundantField3) |
| | | .HasMaxLength(200) |
| | | .HasComment("åä½å段3 - é¢çæ©å±ç¨é"); |
| | | |
| | | b.Property(x => x.Sort).HasComment("æåº"); |
| | | b.Property(x => x.IsDisabled).IsRequired(false).HasComment("æ¯å¦ç¦ç¨"); |
| | | b.Property(x => x.Remark).HasMaxLength(WmsContainerConsts.MaxRemarkLength).IsRequired(false).HasComment("夿³¨"); |
| | | |
| | | b.HasIndex(u => u.ContainerNo).IsUnique(); |
| | | b.HasIndex(u => u.ContainerType); |
| | | b.HasIndex(u => u.ContainerStatus); |
| | | |
| | | b.ApplyObjectExtensionMappings(); |
| | | }); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain; |
| | | using CMS.Plugin.HIAWms.Domain.WmsInOutStockRecord; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Volo.Abp; |
| | | using Volo.Abp.EntityFrameworkCore.Modeling; |
| | | |
| | | namespace CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions |
| | | { |
| | | /// <summary> |
| | | /// EfCoreæ©å± |
| | | /// </summary> |
| | | public static partial class CMSPluginEfCoreExtensions |
| | | { |
| | | /// <summary> |
| | | /// Includes the details. |
| | | /// </summary> |
| | | /// <param name="queryable">The queryable.</param> |
| | | /// <param name="include">if set to <c>true</c> [include].</param> |
| | | /// <returns></returns> |
| | | public static IQueryable<WmsInOutStockRecord> IncludeDetails(this IQueryable<WmsInOutStockRecord> queryable, bool include = true) |
| | | { |
| | | if (!include) |
| | | { |
| | | return queryable; |
| | | } |
| | | |
| | | return queryable; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Configures the wmsmaterial. |
| | | /// </summary> |
| | | /// <param name="builder"></param> |
| | | public static void ConfigureWmsInOutStockRecord(this ModelBuilder builder) |
| | | { |
| | | Check.NotNull(builder, nameof(builder)); |
| | | |
| | | builder.Entity<WmsInOutStockRecord>(b => |
| | | { |
| | | b.ToTable((CMSPluginDbProperties.DbTablePrefix + "_WmsInOutStockRecords").ToLower(), CMSPluginDbProperties.DbSchema) |
| | | .HasComment("åºå
¥åºè®°å½è¡¨"); |
| | | |
| | | b.ConfigureByConvention(); |
| | | // 主é®é
ç½® |
| | | b.HasKey(x => x.Id); |
| | | // Properties |
| | | b.Property(x => x.OrderNo) |
| | | .HasMaxLength(50) |
| | | .IsRequired() |
| | | .HasComment("åæ®ç¼å·"); |
| | | |
| | | b.Property(x => x.MaterialName) |
| | | .HasMaxLength(100) |
| | | .IsRequired(false) |
| | | .HasComment("ç©æåç§°"); |
| | | |
| | | b.Property(x => x.MaterialNo) |
| | | .HasMaxLength(50) |
| | | .IsRequired() |
| | | .HasComment("ç©æä»¶å·"); |
| | | |
| | | b.Property(x => x.StockType) |
| | | .IsRequired() |
| | | .HasComment("æä½ç±»å"); |
| | | |
| | | b.Property(x => x.ContainerNo) |
| | | .HasMaxLength(50) |
| | | .IsRequired(false) |
| | | .HasComment("容å¨ç¼å·"); |
| | | |
| | | b.Property(x => x.MaterialModel) |
| | | .HasMaxLength(50) |
| | | .IsRequired(false) |
| | | .HasComment("æºå"); |
| | | |
| | | b.Property(x => x.OperateTime) |
| | | .IsRequired(false) |
| | | .HasComment("æä½æ¶é´"); |
| | | |
| | | b.Property(x => x.Remark) |
| | | .HasMaxLength(500) |
| | | .IsRequired(false) |
| | | .HasComment("夿³¨"); |
| | | |
| | | b.Property(x => x.MaterialId) |
| | | .HasMaxLength(50) |
| | | .IsRequired() |
| | | .HasComment("ç©æID"); |
| | | |
| | | b.Property(x => x.TaskNo) |
| | | .HasMaxLength(50) |
| | | .IsRequired() |
| | | .HasComment("ä»»å¡å·"); |
| | | |
| | | b.Property(x => x.SourcePlace) |
| | | .HasMaxLength(50) |
| | | .IsRequired(false) |
| | | .HasComment("èµ·å§åºä½"); |
| | | |
| | | b.Property(x => x.ToPlace) |
| | | .HasMaxLength(50) |
| | | .IsRequired(false) |
| | | .HasComment("ç®æ åºä½"); |
| | | |
| | | b.Property(x => x.Sort).HasComment("æåº"); |
| | | b.Property(x => x.IsDisabled).IsRequired(false).HasComment("æ¯å¦ç¦ç¨"); |
| | | |
| | | // Indexes |
| | | b.HasIndex(x => x.OrderNo); |
| | | b.HasIndex(x => x.MaterialNo); |
| | | b.HasIndex(x => x.MaterialId); |
| | | b.HasIndex(x => x.TaskNo); |
| | | b.HasIndex(x => x.StockType); |
| | | b.HasIndex(x => x.ContainerNo); |
| | | b.HasIndex(x => x.OperateTime); |
| | | |
| | | b.ApplyObjectExtensionMappings(); |
| | | }); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using CMS.Plugin.HIAWms.Domain.WmsMaterial; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Volo.Abp; |
| | | using Volo.Abp.EntityFrameworkCore.Modeling; |
| | | |
| | | namespace CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions; |
| | | |
| | | /// <summary> |
| | | /// EfCoreæ©å± |
| | | /// </summary> |
| | | public static partial class CMSPluginEfCoreExtensions |
| | | { |
| | | /// <summary> |
| | | /// Includes the details. |
| | | /// </summary> |
| | | /// <param name="queryable">The queryable.</param> |
| | | /// <param name="include">if set to <c>true</c> [include].</param> |
| | | /// <returns></returns> |
| | | public static IQueryable<WmsMaterial> IncludeDetails(this IQueryable<WmsMaterial> queryable, bool include = true) |
| | | { |
| | | if (!include) |
| | | { |
| | | return queryable; |
| | | } |
| | | |
| | | return queryable; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Configures the wmsmaterial. |
| | | /// </summary> |
| | | /// <param name="builder">The builder.</param> |
| | | public static void ConfigureWmsMaterial(this ModelBuilder builder) |
| | | { |
| | | Check.NotNull(builder, nameof(builder)); |
| | | |
| | | builder.Entity<WmsMaterial>(b => |
| | | { |
| | | // é
置表ååæ³¨é |
| | | b.ToTable((CMSPluginDbProperties.DbTablePrefix + "_WmsMaterials").ToLower(), |
| | | CMSPluginDbProperties.DbSchema) |
| | | .HasComment("ç©æåºç¡ä¿¡æ¯è¡¨"); |
| | | |
| | | b.ConfigureByConvention(); |
| | | |
| | | // 主é®é
ç½®ï¼FullAuditedAggregateRoot<Guid> å·²é»è®¤å
å« Idï¼ |
| | | b.HasKey(x => x.Id); |
| | | |
| | | // åæ®µé
ç½® |
| | | b.Property(x => x.MaterialCode) |
| | | .HasMaxLength(64) |
| | | .IsRequired() |
| | | .HasComment("ç©æç¼ç ï¼å¯ä¸æ è¯ï¼"); |
| | | |
| | | b.Property(x => x.MaterialName) |
| | | .HasMaxLength(128) |
| | | .IsRequired() |
| | | .HasComment("ç©æåç§°"); |
| | | |
| | | b.Property(x => x.PurchaseType) |
| | | .HasComment("éè´ç±»åï¼æä¸¾å¼ï¼"); |
| | | |
| | | b.Property(x => x.MaterialType) |
| | | .HasComment("ç©æç±»åï¼æä¸¾å¼ï¼"); |
| | | |
| | | b.Property(x => x.PrimaryUnit) |
| | | .HasMaxLength(20) |
| | | .HasComment("主åä½ï¼å¦ï¼kgãmã个ï¼"); |
| | | |
| | | b.Property(x => x.Standard) |
| | | .HasMaxLength(128) |
| | | .HasComment("è§æ ¼/æ åï¼å¦ï¼GB/T 8163-2018ï¼"); |
| | | |
| | | b.Property(x => x.OuterDiameter) |
| | | .HasColumnType("decimal(18,2)") |
| | | .HasComment("å¤å¾ï¼åä½ï¼mmï¼"); |
| | | |
| | | b.Property(x => x.WallThickness) |
| | | .HasColumnType("decimal(18,2)") |
| | | .HasComment("å£åï¼åä½ï¼mmï¼"); |
| | | |
| | | b.Property(x => x.MaterialQuality) |
| | | .HasMaxLength(64) |
| | | .HasComment("æè´¨ï¼å¦ï¼304ä¸éé¢ï¼"); |
| | | |
| | | b.Property(x => x.Length) |
| | | .HasColumnType("decimal(18,2)") |
| | | .HasComment("é¿åº¦ï¼åä½ï¼mï¼"); |
| | | |
| | | b.Property(x => x.IsMainBranch) |
| | | .HasDefaultValue(YesNoEnum.N) |
| | | .HasComment("æ¯å¦ä¸ºä¸»æ¯ç®¡"); |
| | | |
| | | b.Property(x => x.Factory) |
| | | .HasMaxLength(64) |
| | | .HasComment("ç产工å"); |
| | | |
| | | b.Property(x => x.Certification) |
| | | .HasMaxLength(128) |
| | | .HasComment("è¯ä¹¦ç¼å·"); |
| | | |
| | | // åä½å段é
ç½® |
| | | b.Property(x => x.RedundantField1) |
| | | .HasMaxLength(256) |
| | | .IsRequired(false) |
| | | .HasComment("åä½å段1 - é¢çæ©å±ç¨é"); |
| | | |
| | | b.Property(x => x.RedundantField2) |
| | | .HasMaxLength(256) |
| | | .IsRequired(false) |
| | | .HasComment("åä½å段2 - é¢çæ©å±ç¨é"); |
| | | |
| | | b.Property(x => x.RedundantField3) |
| | | .HasMaxLength(256) |
| | | .IsRequired(false) |
| | | .HasComment("åä½å段3 - é¢çæ©å±ç¨é"); |
| | | |
| | | // å
¶ä»éç¨å段 |
| | | b.Property(x => x.Sort) |
| | | .HasDefaultValue(0) |
| | | .HasComment("æåº"); |
| | | |
| | | b.Property(x => x.Remark) |
| | | .HasMaxLength(500) |
| | | .IsRequired(false) |
| | | .HasComment("夿³¨"); |
| | | |
| | | b.Property(x => x.IsDisabled) |
| | | .IsRequired(false) |
| | | .HasDefaultValue(false) |
| | | .HasComment("æ¯å¦ç¦ç¨"); |
| | | |
| | | // ç´¢å¼é
ç½® |
| | | b.HasIndex(x => x.MaterialCode).IsUnique(); // ç©æç¼ç å¯ä¸ç´¢å¼ |
| | | b.HasIndex(x => x.MaterialName); // ç©æåç§°æ®éç´¢å¼ |
| | | b.HasIndex(x => x.PurchaseType); // éè´ç±»åç´¢å¼ï¼å¦éæ¥è¯¢è¿æ»¤ï¼ |
| | | b.HasIndex(x => x.MaterialType); // ç©æç±»åç´¢å¼ï¼å¦éæ¥è¯¢è¿æ»¤ï¼ |
| | | |
| | | b.ApplyObjectExtensionMappings(); |
| | | }); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain; |
| | | using CMS.Plugin.HIAWms.Domain.WmsPlaces; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsPlaces; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Volo.Abp; |
| | | using Volo.Abp.EntityFrameworkCore.Modeling; |
| | | |
| | | namespace CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions; |
| | | |
| | | /// <summary> |
| | | /// EfCoreæ©å± |
| | | /// </summary> |
| | | public static partial class CMSPluginEfCoreExtensions |
| | | { |
| | | /// <summary> |
| | | /// Includes the details. |
| | | /// </summary> |
| | | /// <param name="queryable">The queryable.</param> |
| | | /// <param name="include">if set to <c>true</c> [include].</param> |
| | | /// <returns></returns> |
| | | public static IQueryable<WmsPlace> IncludeDetails(this IQueryable<WmsPlace> queryable, bool include = true) |
| | | { |
| | | if (!include) |
| | | { |
| | | return queryable; |
| | | } |
| | | |
| | | return queryable; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Configures the wmsplace. |
| | | /// </summary> |
| | | /// <param name="builder">The builder.</param> |
| | | public static void ConfigureWmsPlace(this ModelBuilder builder) |
| | | { |
| | | Check.NotNull(builder, nameof(builder)); |
| | | |
| | | builder.Entity<WmsPlace>(b => |
| | | { |
| | | // Configure table & schema name |
| | | b.ToTable((CMSPluginDbProperties.DbTablePrefix + "_WmsPlaces").ToLower(), CMSPluginDbProperties.DbSchema).HasComment("åºä½è¡¨"); |
| | | |
| | | b.ConfigureByConvention(); |
| | | |
| | | // Properties |
| | | b.Property(x => x.PlaceNo).HasMaxLength(WmsPlaceConsts.MaxPlaceNoLength).IsRequired().HasComment("ç¼å·"); |
| | | b.Property(x => x.StorageTypeNo).HasComment("è´§ä½ç±»å"); |
| | | b.Property(x => x.PlaceStatus).HasComment("è´§ä½ç¶æ"); |
| | | b.Property(x => x.AreaCode).HasMaxLength(WmsPlaceConsts.MaxAreaCodeLength).IsRequired().HasComment("æå¨åºåº"); |
| | | b.Property(x => x.Aisle).HasComment("å··é"); |
| | | b.Property(x => x.RowNo).HasComment("æ"); |
| | | b.Property(x => x.ColumnNo).HasComment("å"); |
| | | b.Property(x => x.LayerNo).HasComment("å±"); |
| | | b.Property(x => x.Islock).HasComment("æ¯å¦éå®"); |
| | | b.Property(x => x.EmptyContainer).HasComment("æ¯å¦ç©ºæ"); |
| | | b.Property(x => x.RedundantField1).HasMaxLength(WmsPlaceConsts.MaxRedundantFieldLength).IsRequired(false).HasComment("åä½å段1 - é¢çæ©å±ç¨é"); |
| | | b.Property(x => x.RedundantField2).HasMaxLength(WmsPlaceConsts.MaxRedundantFieldLength).IsRequired(false).HasComment("åä½å段2 - é¢çæ©å±ç¨é"); |
| | | b.Property(x => x.RedundantField3).HasMaxLength(WmsPlaceConsts.MaxRedundantFieldLength).IsRequired(false).HasComment("åä½å段3 - é¢çæ©å±ç¨é"); |
| | | b.Property(x => x.Sort).HasComment("æåº"); |
| | | b.Property(x => x.Remark).HasMaxLength(WmsPlaceConsts.MaxRemarkLength).IsRequired(false).HasComment("夿³¨"); |
| | | b.Property(x => x.IsDisabled).IsRequired(false).HasComment("æ¯å¦ç¦ç¨"); |
| | | |
| | | // Indexes |
| | | b.HasIndex(u => u.PlaceNo).IsUnique(); // ç¼å·å段添å å¯ä¸ç´¢å¼ |
| | | b.HasIndex(u => u.AreaCode); // æå¨åºåºåæ®µæ·»å æ®éç´¢å¼ |
| | | b.HasIndex(u => u.StorageTypeNo); // è´§ä½ç±»ååæ®µæ·»å æ®éç´¢å¼ |
| | | b.HasIndex(u => u.PlaceStatus); // è´§ä½ç±»ååæ®µæ·»å æ®éç´¢å¼ |
| | | |
| | | // Apply object extension mappings |
| | | b.ApplyObjectExtensionMappings(); |
| | | }); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain; |
| | | using CMS.Plugin.HIAWms.Domain.WmsStores; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsStores; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Volo.Abp; |
| | | using Volo.Abp.EntityFrameworkCore.Modeling; |
| | | |
| | | namespace CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions; |
| | | |
| | | /// <summary> |
| | | /// EfCoreæ©å± |
| | | /// </summary> |
| | | public static partial class CMSPluginEfCoreExtensions |
| | | { |
| | | /// <summary> |
| | | /// Includes the details. |
| | | /// </summary> |
| | | /// <param name="queryable">The queryable.</param> |
| | | /// <param name="include">if set to <c>true</c> [include].</param> |
| | | /// <returns></returns> |
| | | public static IQueryable<WmsStore> IncludeDetails(this IQueryable<WmsStore> queryable, bool include = true) |
| | | { |
| | | if (!include) |
| | | { |
| | | return queryable; |
| | | } |
| | | |
| | | return queryable; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Configures the wmsstore. |
| | | /// </summary> |
| | | /// <param name="builder">The builder.</param> |
| | | public static void ConfigureWmsStore(this ModelBuilder builder) |
| | | { |
| | | Check.NotNull(builder, nameof(builder)); |
| | | |
| | | builder.Entity<WmsStore>(b => |
| | | { |
| | | // Configure table & schema name |
| | | b.ToTable((CMSPluginDbProperties.DbTablePrefix + "_WmsStores").ToLower(), CMSPluginDbProperties.DbSchema).HasComment("ä»åºä¿¡æ¯è¡¨"); |
| | | |
| | | b.ConfigureByConvention(); |
| | | |
| | | // Properties |
| | | b.Property(x => x.StoreCode).HasMaxLength(WmsStoreConsts.MaxStoreCodeLength).IsRequired(false).HasComment("ä»åºä»£ç "); |
| | | b.Property(x => x.StoreName).HasMaxLength(WmsStoreConsts.MaxStoreNameLength).IsRequired(false).HasComment("ä»åºåç§°"); |
| | | b.Property(x => x.RedundantField1).HasMaxLength(WmsStoreConsts.MaxRedundantFieldLength).IsRequired(false).HasComment("åä½å段1 - é¢çæ©å±ç¨é"); |
| | | b.Property(x => x.RedundantField2).HasMaxLength(WmsStoreConsts.MaxRedundantFieldLength).IsRequired(false).HasComment("åä½å段2 - é¢çæ©å±ç¨é"); |
| | | b.Property(x => x.RedundantField3).HasMaxLength(WmsStoreConsts.MaxRedundantFieldLength).IsRequired(false).HasComment("åä½å段3 - é¢çæ©å±ç¨é"); |
| | | b.Property(x => x.Remark).HasMaxLength(WmsStoreConsts.MaxRemarkLength).IsRequired(false).HasComment("夿³¨"); |
| | | b.Property(x => x.Sort).HasComment("æåº"); |
| | | b.Property(x => x.IsDisabled).IsRequired(false).HasComment("æ¯å¦ç¦ç¨"); |
| | | |
| | | // Indexes |
| | | b.HasIndex(u => u.StoreName); |
| | | |
| | | // Apply object extension mappings |
| | | b.ApplyObjectExtensionMappings(); |
| | | }); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain; |
| | | using CMS.Plugin.HIAWms.Domain.WmsTask; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Volo.Abp; |
| | | using Volo.Abp.EntityFrameworkCore.Modeling; |
| | | |
| | | namespace CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions |
| | | { |
| | | /// <summary> |
| | | /// EfCoreæ©å± |
| | | /// </summary> |
| | | public static partial class CMSPluginEfCoreExtensions |
| | | { |
| | | /// <summary> |
| | | /// Includes the details. |
| | | /// </summary> |
| | | /// <param name="queryable">The queryable.</param> |
| | | /// <param name="include">if set to <c>true</c> [include].</param> |
| | | /// <returns></returns> |
| | | public static IQueryable<WmsTask> IncludeDetails(this IQueryable<WmsTask> queryable, bool include = true) |
| | | { |
| | | if (!include) |
| | | { |
| | | return queryable; |
| | | } |
| | | |
| | | return queryable; |
| | | } |
| | | /// <summary> |
| | | /// Configures the WMS task entity. |
| | | /// </summary> |
| | | /// <param name="builder">The builder.</param> |
| | | public static void ConfigureWmsTask(this ModelBuilder builder) |
| | | { |
| | | Check.NotNull(builder, nameof(builder)); |
| | | |
| | | builder.Entity<WmsTask>(b => |
| | | { |
| | | b.ToTable((CMSPluginDbProperties.DbTablePrefix + "_WmsTasks").ToLower(), CMSPluginDbProperties.DbSchema) |
| | | .HasComment("ä»»å¡è¡¨"); |
| | | |
| | | b.ConfigureByConvention(); |
| | | |
| | | // Primary key configuration (inherited from FullAuditedAggregateRoot<Guid>) |
| | | b.HasKey(x => x.Id); |
| | | |
| | | // Properties configuration |
| | | b.Property(x => x.TaskNo) |
| | | .HasMaxLength(50) |
| | | .IsRequired() |
| | | .HasComment("ä»»å¡å·"); |
| | | |
| | | b.Property(x => x.TaskType) |
| | | .IsRequired() |
| | | .HasComment("ä»»å¡ç±»å"); |
| | | |
| | | b.Property(x => x.TaskLevel) |
| | | .IsRequired() |
| | | .HasComment("ä»»å¡ç级"); |
| | | |
| | | b.Property(x => x.TaskStatus) |
| | | .IsRequired() |
| | | .HasComment("ä»»å¡ç¶æ"); |
| | | |
| | | b.Property(x => x.ContainerNo) |
| | | .HasMaxLength(50) |
| | | .IsRequired(false) |
| | | .HasComment("æçç¼å·"); |
| | | |
| | | b.Property(x => x.SourcePlace) |
| | | .HasMaxLength(50) |
| | | .IsRequired(false) |
| | | .HasComment("èµ·å§åºä½"); |
| | | |
| | | b.Property(x => x.ToPlace) |
| | | .HasMaxLength(50) |
| | | .IsRequired(false) |
| | | .HasComment("ç®æ åºä½"); |
| | | |
| | | b.Property(x => x.Aisle) |
| | | .IsRequired(false) |
| | | .HasComment("å··é"); |
| | | |
| | | b.Property(x => x.DodeviceId) |
| | | .IsRequired(false) |
| | | .HasComment("å åæºID"); |
| | | |
| | | b.Property(x => x.Dodevicetype) |
| | | .IsRequired() |
| | | .HasComment("设å¤ç±»å"); |
| | | |
| | | b.Property(x => x.TaskDodeviceStatus) |
| | | .IsRequired() |
| | | .HasComment("设å¤ä»»å¡ç¶æ"); |
| | | |
| | | b.Property(x => x.IsRead) |
| | | .IsRequired() |
| | | .HasComment("WCSæ¯å¦å¯ä»¥è¯»å"); |
| | | |
| | | b.Property(x => x.SonTaskType) |
| | | .IsRequired(false) |
| | | .HasComment("åä»»å¡ç±»å"); |
| | | |
| | | b.Property(x => x.SourceOrderNo) |
| | | .HasMaxLength(50) |
| | | .IsRequired(false) |
| | | .HasComment("æ¥æºåæ®å·"); |
| | | |
| | | b.Property(x => x.IsNextTask) |
| | | .IsRequired(false) |
| | | .HasComment("ä¸ä¸ªä»»å¡æ¯å¦çææå"); |
| | | |
| | | b.Property(x => x.MutableParam1) |
| | | .HasMaxLength(200) |
| | | .IsRequired(false) |
| | | .HasComment("å¯ååé1"); |
| | | |
| | | b.Property(x => x.MutableParam2) |
| | | .HasMaxLength(200) |
| | | .IsRequired(false) |
| | | .HasComment("å¯ååé2"); |
| | | |
| | | b.Property(x => x.MutableParam3) |
| | | .HasMaxLength(200) |
| | | .IsRequired(false) |
| | | .HasComment("å¯ååé3"); |
| | | |
| | | b.Property(x => x.Sort) |
| | | .IsRequired() |
| | | .HasComment("æåº"); |
| | | |
| | | b.Property(x => x.IsDisabled) |
| | | .IsRequired(false) |
| | | .HasComment("æ¯å¦ç¦ç¨"); |
| | | |
| | | // Indexes configuration |
| | | b.HasIndex(x => x.TaskNo).IsUnique(); |
| | | b.HasIndex(x => x.TaskType); |
| | | b.HasIndex(x => x.TaskStatus); |
| | | b.HasIndex(x => x.ContainerNo); |
| | | b.HasIndex(x => x.SourcePlace); |
| | | b.HasIndex(x => x.ToPlace); |
| | | b.HasIndex(x => x.DodeviceId); |
| | | b.HasIndex(x => x.IsRead); |
| | | b.HasIndex(x => x.SourceOrderNo); |
| | | b.HasIndex(x => x.Sort); |
| | | |
| | | b.ApplyObjectExtensionMappings(); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
| | | <ConfigureAwait ContinueOnCapturedContext="false" /> |
| | | </Weavers> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain; |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.EntityFrameworkCore; |
| | | |
| | | namespace CMS.Plugin.HIAWms.EntityFrameworkCore |
| | | { |
| | | /// <summary> |
| | | /// æ°æ®åºä¸ä¸æ |
| | | /// </summary> |
| | | [ConnectionStringName(CMSPluginDbProperties.ConnectionStringName)] |
| | | public interface ICMSPluginDbContext : IEfCoreDbContext |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Runtime.CompilerServices; |
| | | [assembly:InternalsVisibleToAttribute("CMS.Plugin.EntityFrameworkCore.Tests")] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Linq.Dynamic.Core; |
| | | using CMS.Plugin.HIAWms.Domain.WmsAreas; |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions; |
| | | using DatabaseSchemaReader.Filters; |
| | | using MathNet.Numerics; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
| | | using Volo.Abp.EntityFrameworkCore; |
| | | using Volo.Abp.Specifications; |
| | | |
| | | namespace CMS.Plugin.HIAWms.EntityFrameworkCore.Repositories; |
| | | |
| | | /// <inheritdoc /> |
| | | public class EfCoreWmsAreaRepository : EfCoreRepository<ICMSPluginDbContext, WmsArea, Guid>, IWmsAreaRepository |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="EfCoreWmsAreaRepository"/> class. |
| | | /// </summary> |
| | | /// <param name="dbContextProvider">The database context provider.</param> |
| | | public EfCoreWmsAreaRepository(IDbContextProvider<ICMSPluginDbContext> dbContextProvider) |
| | | : base(dbContextProvider) |
| | | { |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<WmsArea> FindByNameAsync(string name, CancellationToken cancellationToken = default) |
| | | { |
| | | return await (await GetDbSetAsync()) |
| | | .IncludeDetails() |
| | | .OrderBy(t => t.Sort) |
| | | .Where(x => !x.IsDeleted) |
| | | .FirstOrDefaultAsync(t => t.AreaName == name, GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ¥çåºåºæ¯å¦åå¨ |
| | | /// </summary> |
| | | /// <param name="areaNo"></param> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public async Task<bool> NameExistAsync(string areaNo, Guid? id = null) |
| | | { |
| | | return await (await GetDbSetAsync()).WhereIf(id.HasValue, p => p.Id != id) |
| | | .Where(x => !x.IsDeleted).AnyAsync(x => x.AreaNo == areaNo); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<int> GetMaxSortAsync() |
| | | { |
| | | var hasAny = await (await GetQueryableAsync()) |
| | | .Where(x => !x.IsDeleted).AnyAsync(); |
| | | if (!hasAny) |
| | | { |
| | | return 1; |
| | | } |
| | | |
| | | var sort = await (await GetQueryableAsync()) |
| | | .Where(x => !x.IsDeleted).MaxAsync(x => x.Sort); |
| | | return sort + 1; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<List<WmsArea>> GetListAsync(WmsArea? area, string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, string filter = null, Specification<WmsArea> specification = null, bool includeDetails = false, CancellationToken cancellationToken = default) |
| | | { |
| | | specification ??= new WmsAreaSpecification(); |
| | | return await (await GetDbSetAsync()) |
| | | .IncludeDetails(includeDetails) |
| | | .Where(specification.ToExpression()) |
| | | .WhereIf(!filter.IsNullOrWhiteSpace(), u => u.AreaNo.Contains(filter)) |
| | | .WhereIf(!string.IsNullOrEmpty(area.AreaNo), u => u.AreaNo.Contains(area.AreaNo)) |
| | | .WhereIf(!string.IsNullOrEmpty(area.AreaName), u => u.AreaNo.Contains(area.AreaName)) |
| | | .WhereIf(!string.IsNullOrEmpty(area.StoreCode), u => u.AreaNo == area.StoreCode) |
| | | .WhereIf(area.AreaStatus > 0, u => u.AreaStatus == area.AreaStatus) |
| | | .WhereIf(area.AreaType > 0, u => u.AreaType == area.AreaType) |
| | | .Where(x => !x.IsDeleted) |
| | | .OrderBy(sorting.IsNullOrEmpty() ? nameof(WmsArea.Sort) : sorting) |
| | | .PageBy(skipCount, maxResultCount) |
| | | .ToListAsync(GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·ååºåºå表 |
| | | /// </summary> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public async Task<List<WmsArea>> GetListForSelectAsync(CancellationToken cancellationToken = default) |
| | | { |
| | | return await (await GetDbSetAsync()) |
| | | .ToListAsync(GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<long> GetCountAsync(WmsArea? area, string filter = null, Specification<WmsArea> specification = null, CancellationToken cancellationToken = default) |
| | | { |
| | | specification ??= new WmsAreaSpecification(); |
| | | return await (await GetQueryableAsync()) |
| | | .Where(specification.ToExpression()) |
| | | .WhereIf(!filter.IsNullOrWhiteSpace(), u => u.AreaNo.Contains(filter)) |
| | | .WhereIf(!string.IsNullOrEmpty(area.AreaNo), u => u.AreaNo.Contains(area.AreaNo)) |
| | | .WhereIf(!string.IsNullOrEmpty(area.AreaName), u => u.AreaNo.Contains(area.AreaName)) |
| | | .WhereIf(!string.IsNullOrEmpty(area.StoreCode), u => u.AreaNo == area.StoreCode) |
| | | .WhereIf(area.AreaStatus > 0, u => u.AreaStatus == area.AreaStatus) |
| | | .WhereIf(area.AreaType > 0, u => u.AreaType == area.AreaType) |
| | | .Where(x => !x.IsDeleted) |
| | | .CountAsync(cancellationToken: GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public override async Task<IQueryable<WmsArea>> WithDetailsAsync() |
| | | { |
| | | return (await GetQueryableAsync()).Where(x => !x.IsDeleted).IncludeDetails(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Linq.Dynamic.Core; |
| | | using CMS.Plugin.HIAWms.Domain.WmsContainers; |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
| | | using Volo.Abp.EntityFrameworkCore; |
| | | using Volo.Abp.Specifications; |
| | | |
| | | namespace CMS.Plugin.HIAWms.EntityFrameworkCore.Repositories; |
| | | |
| | | /// <inheritdoc /> |
| | | public class EfCoreWmsContainerRepository : EfCoreRepository<ICMSPluginDbContext, WmsContainer, Guid>, IWmsContainerRepository |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="EfCoreWmsContainerRepository"/> class. |
| | | /// </summary> |
| | | /// <param name="dbContextProvider">The database context provider.</param> |
| | | public EfCoreWmsContainerRepository(IDbContextProvider<ICMSPluginDbContext> dbContextProvider) |
| | | : base(dbContextProvider) |
| | | { |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<WmsContainer> FindByNameAsync(string containerNo, CancellationToken cancellationToken = default) |
| | | { |
| | | return await (await GetDbSetAsync()) |
| | | .IncludeDetails() |
| | | .Where(x => !x.IsDeleted) |
| | | .OrderBy(t => t.Sort) |
| | | .FirstOrDefaultAsync(t => t.ContainerNo == containerNo, GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<bool> NameExistAsync(string containerNo, Guid? id = null) |
| | | { |
| | | return await (await GetDbSetAsync()).WhereIf(id.HasValue, p => p.Id != id).Where(x => !x.IsDeleted).AnyAsync(x => x.ContainerNo == containerNo); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<int> GetMaxSortAsync() |
| | | { |
| | | var hasAny = await (await GetQueryableAsync()).Where(x => !x.IsDeleted).AnyAsync(); |
| | | if (!hasAny) |
| | | { |
| | | return 1; |
| | | } |
| | | |
| | | var sort = await (await GetQueryableAsync()) |
| | | .Where(x => !x.IsDeleted).MaxAsync(x => x.Sort); |
| | | return sort + 1; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥è¯¢å表 |
| | | /// </summary> |
| | | /// <param name="container"></param> |
| | | /// <param name="sorting"></param> |
| | | /// <param name="maxResultCount"></param> |
| | | /// <param name="skipCount"></param> |
| | | /// <param name="filter"></param> |
| | | /// <param name="specification"></param> |
| | | /// <param name="includeDetails"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public async Task<List<WmsContainer>> GetListAsync(WmsContainer? container,string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, string filter = null, Specification<WmsContainer> specification = null, bool includeDetails = false, CancellationToken cancellationToken = default) |
| | | { |
| | | specification ??= new WmsContainerSpecification(); |
| | | return await (await GetDbSetAsync()) |
| | | .IncludeDetails(includeDetails) |
| | | .Where(specification.ToExpression()) |
| | | .Where(x => !x.IsDeleted) |
| | | .WhereIf(!filter.IsNullOrWhiteSpace(), u => u.ContainerNo.Contains(filter)) |
| | | .WhereIf(!string.IsNullOrEmpty(container.ContainerNo),u=>u.ContainerNo.Contains(container.ContainerNo)) |
| | | .WhereIf(container.ContainerStatus>0, u=>u.ContainerStatus == u.ContainerStatus) |
| | | .WhereIf(container.ContainerType>0, u=>u.ContainerType == u.ContainerType) |
| | | .OrderBy(sorting.IsNullOrEmpty() ? nameof(WmsContainer.Sort) : sorting) |
| | | .PageBy(skipCount, maxResultCount) |
| | | .ToListAsync(GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥è¯¢æ°é |
| | | /// </summary> |
| | | /// <param name="container"></param> |
| | | /// <param name="filter"></param> |
| | | /// <param name="specification"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public async Task<long> GetCountAsync(WmsContainer? container, string filter = null, Specification<WmsContainer> specification = null, CancellationToken cancellationToken = default) |
| | | { |
| | | specification ??= new WmsContainerSpecification(); |
| | | return await (await GetQueryableAsync()) |
| | | .Where(specification.ToExpression()) |
| | | .Where(x => !x.IsDeleted) |
| | | .WhereIf(!string.IsNullOrEmpty(container.ContainerNo), u => u.ContainerNo.Contains(container.ContainerNo)) |
| | | .WhereIf(container.ContainerStatus > 0, u => u.ContainerStatus == u.ContainerStatus) |
| | | .WhereIf(container.ContainerType > 0, u => u.ContainerType == u.ContainerType) |
| | | .WhereIf(!filter.IsNullOrWhiteSpace(), u => u.ContainerNo.Contains(filter)) |
| | | .CountAsync(cancellationToken: GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public override async Task<IQueryable<WmsContainer>> WithDetailsAsync() |
| | | { |
| | | return (await GetQueryableAsync()).Where(x => !x.IsDeleted).IncludeDetails(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.WmsInOutStockRecord; |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions; |
| | | using CmsQueryExtensions.Extension; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using System.Linq.Dynamic.Core; |
| | | using System.Linq.Expressions; |
| | | using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
| | | using Volo.Abp.EntityFrameworkCore; |
| | | |
| | | |
| | | namespace CMS.Plugin.HIAWms.EntityFrameworkCore.Repositories; |
| | | |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½è¡¨ä»å¨å®ç° |
| | | /// </summary> |
| | | public class EfCoreWmsInOutStockRecordRepository : EfCoreRepository<ICMSPluginDbContext, WmsInOutStockRecord, Guid>, IWmsInOutStockRecordRepository |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="EfCoreWmsInOutStockRecordRepository"/> class. |
| | | /// </summary> |
| | | /// <param name="dbContextProvider">The database context provider.</param> |
| | | public EfCoreWmsInOutStockRecordRepository(IDbContextProvider<ICMSPluginDbContext> dbContextProvider) |
| | | : base(dbContextProvider) |
| | | { |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æç
§åç§°æ¥æ¾åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="name"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task<WmsInOutStockRecord> FindByNameAsync(string name, CancellationToken cancellationToken = default) |
| | | { |
| | | return await (await GetDbSetAsync()) |
| | | .IncludeDetails() |
| | | .Where(x => !x.IsDeleted) |
| | | .OrderBy(t => t.Sort) |
| | | .FirstOrDefaultAsync(t => t.MaterialNo == name, GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// éªè¯åç§°æ¯å¦åå¨åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="name">æ ¡éªå¼</param> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public async Task<bool> NameExistAsync(string name, Guid? id = null) |
| | | { |
| | | return await (await GetDbSetAsync()).WhereIf(id.HasValue, p => p.Id != id).Where(x => !x.IsDeleted).AnyAsync(x => x.MaterialNo == name); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åæå¤§æåºåºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public async Task<int> GetMaxSortAsync() |
| | | { |
| | | var hasAny = await (await GetQueryableAsync()) |
| | | .Where(x => !x.IsDeleted).AnyAsync(); |
| | | if (!hasAny) |
| | | { |
| | | return 1; |
| | | } |
| | | |
| | | var sort = await (await GetQueryableAsync()) |
| | | .Where(x => !x.IsDeleted).MaxAsync(x => x.Sort); |
| | | return sort + 1; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åå页å表åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="whereConditions"></param> |
| | | /// <param name="sorting"></param> |
| | | /// <param name="maxResultCount"></param> |
| | | /// <param name="skipCount"></param> |
| | | /// <param name="includeDetails"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public async Task<List<WmsInOutStockRecord>> GetListAsync(FunReturnResultModel<Expression<Func<WmsInOutStockRecord, bool>>> whereConditions, string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, bool includeDetails = false, CancellationToken cancellationToken = default) |
| | | { |
| | | return await (await GetDbSetAsync()) |
| | | .IncludeDetails(includeDetails) |
| | | .WhereIf(whereConditions != null, whereConditions.data) |
| | | .Where(x => !x.IsDeleted) |
| | | .OrderBy(sorting.IsNullOrEmpty() ? nameof(WmsInOutStockRecord.Sort) : sorting) |
| | | .PageBy(skipCount, maxResultCount) |
| | | .ToListAsync(GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åæ»æ°åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="whereConditions"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public async Task<long> GetCountAsync(FunReturnResultModel<Expression<Func<WmsInOutStockRecord, bool>>> whereConditions, CancellationToken cancellationToken = default) |
| | | { |
| | | return await (await GetQueryableAsync()) |
| | | .WhereIf(whereConditions != null, whereConditions.data) |
| | | .Where(x => !x.IsDeleted) |
| | | .CountAsync(cancellationToken: GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | |
| | | /// <inheritdoc /> |
| | | public override async Task<IQueryable<WmsInOutStockRecord>> WithDetailsAsync() |
| | | { |
| | | return (await GetQueryableAsync()) |
| | | .Where(x => !x.IsDeleted).IncludeDetails(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.WmsMaterial; |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions; |
| | | using CmsQueryExtensions.Extension; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using System.Linq.Dynamic.Core; |
| | | using System.Linq.Expressions; |
| | | using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
| | | using Volo.Abp.EntityFrameworkCore; |
| | | |
| | | |
| | | namespace CMS.Plugin.HIAWms.EntityFrameworkCore.Repositories; |
| | | |
| | | /// <summary> |
| | | /// ç©æåºç¡ä¿¡æ¯è¡¨ä»å¨å®ç° |
| | | /// </summary> |
| | | public class EfCoreWmsMaterialRepository : EfCoreRepository<ICMSPluginDbContext, WmsMaterial, Guid>, IWmsMaterialRepository |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="EfCoreWmsMaterialRepository"/> class. |
| | | /// </summary> |
| | | /// <param name="dbContextProvider">The database context provider.</param> |
| | | public EfCoreWmsMaterialRepository(IDbContextProvider<ICMSPluginDbContext> dbContextProvider) |
| | | : base(dbContextProvider) |
| | | { |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æç
§åç§°æ¥æ¾ç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="name"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task<WmsMaterial> FindByNameAsync(string name, CancellationToken cancellationToken = default) |
| | | { |
| | | return await (await GetDbSetAsync()) |
| | | .IncludeDetails() |
| | | .Where(x => !x.IsDeleted) |
| | | .OrderBy(t => t.Sort) |
| | | .FirstOrDefaultAsync(t => t.MaterialCode == name, GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// éªè¯åç§°æ¯å¦åå¨ç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="materialCode"></param> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public async Task<bool> NameExistAsync(string materialCode, Guid? id = null) |
| | | { |
| | | return await (await GetDbSetAsync()).WhereIf(id.HasValue, p => p.Id != id).Where(x => !x.IsDeleted).AnyAsync(x => x.MaterialCode == materialCode); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åæå¤§æåºç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public async Task<int> GetMaxSortAsync() |
| | | { |
| | | var hasAny = await (await GetQueryableAsync()) |
| | | .Where(x => !x.IsDeleted).AnyAsync(); |
| | | if (!hasAny) |
| | | { |
| | | return 1; |
| | | } |
| | | |
| | | var sort = await (await GetQueryableAsync()) |
| | | .Where(x => !x.IsDeleted).MaxAsync(x => x.Sort); |
| | | return sort + 1; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åå页åè¡¨ç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="whereConditions"></param> |
| | | /// <param name="sorting"></param> |
| | | /// <param name="maxResultCount"></param> |
| | | /// <param name="skipCount"></param> |
| | | /// <param name="includeDetails"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public async Task<List<WmsMaterial>> GetListAsync(FunReturnResultModel<Expression<Func<WmsMaterial, bool>>> whereConditions, string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, bool includeDetails = false, CancellationToken cancellationToken = default) |
| | | { |
| | | return await (await GetDbSetAsync()) |
| | | .IncludeDetails(includeDetails) |
| | | .WhereIf(whereConditions != null, whereConditions.data) |
| | | .Where(x => !x.IsDeleted) |
| | | .OrderBy(sorting.IsNullOrEmpty() ? nameof(WmsMaterial.Sort) : sorting) |
| | | .PageBy(skipCount, maxResultCount) |
| | | .ToListAsync(GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åæ»æ°ç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="whereConditions"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public async Task<long> GetCountAsync(FunReturnResultModel<Expression<Func<WmsMaterial, bool>>> whereConditions, CancellationToken cancellationToken = default) |
| | | { |
| | | return await (await GetQueryableAsync()) |
| | | .WhereIf(whereConditions != null, whereConditions.data) |
| | | .Where(x => !x.IsDeleted) |
| | | .CountAsync(cancellationToken: GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | |
| | | /// <inheritdoc /> |
| | | public override async Task<IQueryable<WmsMaterial>> WithDetailsAsync() |
| | | { |
| | | return (await GetQueryableAsync()) |
| | | .Where(x => !x.IsDeleted).IncludeDetails(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Linq.Dynamic.Core; |
| | | using CMS.Plugin.HIAWms.Domain.WmsPlaces; |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions; |
| | | using Microsoft.AspNetCore.Components.Forms; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
| | | using Volo.Abp.EntityFrameworkCore; |
| | | using Volo.Abp.Specifications; |
| | | |
| | | namespace CMS.Plugin.HIAWms.EntityFrameworkCore.Repositories; |
| | | |
| | | /// <inheritdoc /> |
| | | public class EfCoreWmsPlaceRepository : EfCoreRepository<ICMSPluginDbContext, WmsPlace, Guid>, IWmsPlaceRepository |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="EfCoreWmsPlaceRepository"/> class. |
| | | /// </summary> |
| | | /// <param name="dbContextProvider">The database context provider.</param> |
| | | public EfCoreWmsPlaceRepository(IDbContextProvider<ICMSPluginDbContext> dbContextProvider) |
| | | : base(dbContextProvider) |
| | | { |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<WmsPlace> FindByNameAsync(string name, CancellationToken cancellationToken = default) |
| | | { |
| | | return await (await GetDbSetAsync()) |
| | | .IncludeDetails() |
| | | .Where(x => !x.IsDeleted) |
| | | .OrderBy(t => t.Sort) |
| | | .FirstOrDefaultAsync(t => t.PlaceNo == name, GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<bool> NameExistAsync(string name, Guid? id = null) |
| | | { |
| | | return await (await GetDbSetAsync()).WhereIf(id.HasValue, p => p.Id != id).Where(x => !x.IsDeleted).AnyAsync(x => x.PlaceNo == name); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<int> GetMaxSortAsync() |
| | | { |
| | | var hasAny = await (await GetQueryableAsync()) |
| | | .Where(x => !x.IsDeleted).AnyAsync(); |
| | | if (!hasAny) |
| | | { |
| | | return 1; |
| | | } |
| | | |
| | | var sort = await (await GetQueryableAsync()) |
| | | .Where(x => !x.IsDeleted).MaxAsync(x => x.Sort); |
| | | return sort + 1; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<List<WmsPlace>> GetListAsync(WmsPlace? place, string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, string filter = null, Specification<WmsPlace> specification = null, bool includeDetails = false, CancellationToken cancellationToken = default) |
| | | { |
| | | specification ??= new WmsPlaceSpecification(); |
| | | return await (await GetDbSetAsync()) |
| | | .IncludeDetails(includeDetails) |
| | | .Where(specification.ToExpression()) |
| | | .WhereIf(!filter.IsNullOrWhiteSpace(), u => u.PlaceNo.Contains(filter)) |
| | | .WhereIf(!string.IsNullOrEmpty(place.PlaceNo), u => u.PlaceNo == place.PlaceNo) |
| | | .WhereIf(place.PlaceStatus > 0, u => u.PlaceStatus == place.PlaceStatus) |
| | | .WhereIf(place.StorageTypeNo > 0, u => u.StorageTypeNo == place.StorageTypeNo) |
| | | .WhereIf(place.Aisle > 0, u => u.Aisle == place.Aisle) |
| | | .WhereIf(place.RowNo > 0, u => u.RowNo == place.RowNo) |
| | | .WhereIf(place.ColumnNo > 0, u => u.ColumnNo == place.ColumnNo) |
| | | .WhereIf(place.LayerNo > 0, u => u.LayerNo == place.LayerNo) |
| | | .WhereIf(place.Islock > 0, u => u.Islock == place.Islock) |
| | | .WhereIf(place.EmptyContainer > 0, u => u.EmptyContainer == place.EmptyContainer) |
| | | .Where(x => !x.IsDeleted) |
| | | .OrderBy(sorting.IsNullOrEmpty() ? nameof(WmsPlace.Sort) : sorting) |
| | | .PageBy(skipCount, maxResultCount) |
| | | .ToListAsync(GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<long> GetCountAsync(WmsPlace? place, string filter = null, Specification<WmsPlace> specification = null, CancellationToken cancellationToken = default) |
| | | { |
| | | specification ??= new WmsPlaceSpecification(); |
| | | return await (await GetQueryableAsync()) |
| | | .Where(specification.ToExpression()) |
| | | .WhereIf(!string.IsNullOrEmpty(place.PlaceNo), u => u.PlaceNo == place.PlaceNo) |
| | | .WhereIf(place.PlaceStatus > 0, u => u.PlaceStatus == place.PlaceStatus) |
| | | .WhereIf(place.StorageTypeNo > 0, u => u.StorageTypeNo == place.StorageTypeNo) |
| | | .WhereIf(place.Aisle > 0, u => u.Aisle == place.Aisle) |
| | | .WhereIf(place.RowNo > 0, u => u.RowNo == place.RowNo) |
| | | .WhereIf(place.ColumnNo > 0, u => u.ColumnNo == place.ColumnNo) |
| | | .WhereIf(place.LayerNo > 0, u => u.LayerNo == place.LayerNo) |
| | | .WhereIf(place.Islock > 0, u => u.Islock == place.Islock) |
| | | .WhereIf(place.EmptyContainer > 0, u => u.EmptyContainer == place.EmptyContainer) |
| | | .Where(x => !x.IsDeleted) |
| | | .WhereIf(!filter.IsNullOrWhiteSpace(), u => u.PlaceNo.Contains(filter)) |
| | | .CountAsync(cancellationToken: GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public override async Task<IQueryable<WmsPlace>> WithDetailsAsync() |
| | | { |
| | | return (await GetQueryableAsync()) |
| | | .Where(x => !x.IsDeleted).IncludeDetails(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Linq.Dynamic.Core; |
| | | using CMS.Plugin.HIAWms.Domain.WmsStores; |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
| | | using Volo.Abp.EntityFrameworkCore; |
| | | using Volo.Abp.Specifications; |
| | | |
| | | namespace CMS.Plugin.HIAWms.EntityFrameworkCore.Repositories; |
| | | |
| | | /// <inheritdoc /> |
| | | public class EfCoreWmsStoreRepository : EfCoreRepository<ICMSPluginDbContext, WmsStore, Guid>, IWmsStoreRepository |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="EfCoreWmsStoreRepository"/> class. |
| | | /// </summary> |
| | | /// <param name="dbContextProvider">The database context provider.</param> |
| | | public EfCoreWmsStoreRepository(IDbContextProvider<ICMSPluginDbContext> dbContextProvider) |
| | | : base(dbContextProvider) |
| | | { |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<WmsStore> FindByNameAsync(string name, CancellationToken cancellationToken = default) |
| | | { |
| | | return await (await GetDbSetAsync()) |
| | | .IncludeDetails() |
| | | .Where(x => !x.IsDeleted) |
| | | .OrderBy(t => t.Sort) |
| | | .FirstOrDefaultAsync(t => t.StoreCode == name, GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<bool> NameExistAsync(string storeCode, Guid? id = null) |
| | | { |
| | | return await (await GetDbSetAsync()).WhereIf(id.HasValue, p => p.Id != id).Where(x => !x.IsDeleted).AnyAsync(x => x.StoreCode == storeCode); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<int> GetMaxSortAsync() |
| | | { |
| | | var hasAny = await (await GetQueryableAsync()) |
| | | .Where(x => !x.IsDeleted).AnyAsync(); |
| | | if (!hasAny) |
| | | { |
| | | return 1; |
| | | } |
| | | |
| | | var sort = await (await GetQueryableAsync()) |
| | | .Where(x => !x.IsDeleted).MaxAsync(x => x.Sort); |
| | | return sort + 1; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<List<WmsStore>> GetListAsync(WmsStore? store, string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, string filter = null, Specification<WmsStore> specification = null, bool includeDetails = false, CancellationToken cancellationToken = default) |
| | | { |
| | | specification ??= new WmsStoreSpecification(); |
| | | return await (await GetDbSetAsync()) |
| | | .IncludeDetails(includeDetails) |
| | | .Where(specification.ToExpression()) |
| | | .Where(x => !x.IsDeleted) |
| | | .WhereIf(!filter.IsNullOrWhiteSpace(), u => u.StoreCode.Contains(filter)) |
| | | .WhereIf(!string.IsNullOrEmpty(store.StoreCode),u=>u.StoreCode.Contains(store.StoreCode)) |
| | | .WhereIf(!string.IsNullOrEmpty(store.StoreName),u=>u.StoreName.Contains(store.StoreName)) |
| | | .OrderBy(sorting.IsNullOrEmpty() ? nameof(WmsStore.Sort) : sorting) |
| | | .PageBy(skipCount, maxResultCount) |
| | | .ToListAsync(GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥è¯¢ä»åºå表 |
| | | /// </summary> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public async Task<List<WmsStore>> GetListForSelectAsync( CancellationToken cancellationToken = default) |
| | | { |
| | | return await (await GetDbSetAsync()) |
| | | .ToListAsync(GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<long> GetCountAsync(WmsStore? store, string filter = null, Specification<WmsStore> specification = null, CancellationToken cancellationToken = default) |
| | | { |
| | | specification ??= new WmsStoreSpecification(); |
| | | return await (await GetQueryableAsync()) |
| | | .Where(specification.ToExpression()) |
| | | .Where(x => !x.IsDeleted) |
| | | .WhereIf(!filter.IsNullOrWhiteSpace(), u => u.StoreCode.Contains(filter)) |
| | | .WhereIf(!string.IsNullOrEmpty(store.StoreCode), u => u.StoreCode.Contains(store.StoreCode)) |
| | | .WhereIf(!string.IsNullOrEmpty(store.StoreName), u => u.StoreName.Contains(store.StoreName)) |
| | | .CountAsync(cancellationToken: GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public override async Task<IQueryable<WmsStore>> WithDetailsAsync() |
| | | { |
| | | return (await GetQueryableAsync()) |
| | | .Where(x => !x.IsDeleted).IncludeDetails(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "ConnectionStrings": { |
| | | "Default": "Server=localhost;Database=CMS.Plugin.HIAWms;User ID=root;Password=123abc.com" |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | |
| | | <Import Project="../../common.props" /> |
| | | <Import Project="../../configureawait.props" /> |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="Volo.Abp.EntityFrameworkCore.MySQL" Version="$(ABPPackageVersion)" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.5"> |
| | | <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> |
| | | <PrivateAssets>compile; contentFiles; build; buildMultitargeting; buildTransitive; analyzers; native</PrivateAssets> |
| | | </PackageReference> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\CMS.Plugin.HIAWms.EntityFrameworkCore\CMS.Plugin.HIAWms.EntityFrameworkCore.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <Folder Include="Migrations\" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions; |
| | | using CMS.Plugin.HIAWms.Domain; |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.EntityFrameworkCore; |
| | | using Volo.Abp.EntityFrameworkCore.Modeling; |
| | | |
| | | namespace CMS.Plugin.HIAWms.MySQL; |
| | | |
| | | /// <summary> |
| | | /// æ°æ®åºä¸ä¸æ |
| | | /// </summary> |
| | | [ConnectionStringName(CMSPluginDbProperties.ConnectionStringName)] |
| | | public class CMSPluginDbContext : AbpDbContext<CMSPluginDbContext>, ICMSPluginDbContext |
| | | { |
| | | /* Add DbSet properties for your Aggregate Roots / Entities here. */ |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="CMSPluginDbContext"/> class. |
| | | /// </summary> |
| | | /// <param name="options">The options.</param> |
| | | public CMSPluginDbContext(DbContextOptions<CMSPluginDbContext> options) |
| | | : base(options) |
| | | { |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | protected override void OnModelCreating(ModelBuilder builder) |
| | | { |
| | | base.OnModelCreating(builder); |
| | | |
| | | /* Include modules to your migration db context */ |
| | | |
| | | builder.ConfigureWmsContainer(); |
| | | builder.ConfigureWmsStore(); |
| | | builder.ConfigureWmsArea(); |
| | | builder.ConfigureWmsPlace(); |
| | | builder.ConfigureWmsMaterial(); |
| | | builder.ConfigureWmsInOutStockRecord(); |
| | | builder.ConfigureWmsTask(); |
| | | |
| | | /* Configure your own tables/entities inside here */ |
| | | |
| | | //builder.Entity<YourEntity>(b => |
| | | //{ |
| | | // b.ToTable(CMSPluginDbProperties.DbTablePrefix + "YourEntities", CMSPluginDbProperties.DbSchema); |
| | | // b.ConfigureByConvention(); //auto configure for the base class props |
| | | // //... |
| | | //}); |
| | | |
| | | builder.TryConfigureObjectExtensions<CMSPluginDbContext>(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain; |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Microsoft.EntityFrameworkCore.Design; |
| | | using Microsoft.Extensions.Configuration; |
| | | |
| | | namespace CMS.Plugin.HIAWms.MySQL; |
| | | |
| | | /// <summary> |
| | | /// This class is needed for EF Core console commands |
| | | /// (like Add-Migration and Update-Database commands) |
| | | /// </summary> |
| | | public class CMSPluginDbContextFactory : IDesignTimeDbContextFactory<CMSPluginDbContext> |
| | | { |
| | | /// <summary> |
| | | /// Creates a new instance of a derived context. |
| | | /// </summary> |
| | | /// <param name="args">Arguments provided by the design-time service.</param> |
| | | public CMSPluginDbContext CreateDbContext(string[] args) |
| | | { |
| | | CMSPluginEfCoreEntityExtensionMappings.Configure(); |
| | | |
| | | var configuration = BuildConfiguration(); |
| | | |
| | | var builder = new DbContextOptionsBuilder<CMSPluginDbContext>() |
| | | .UseMySql(configuration.GetConnectionString("Default"), MySqlServerVersion.LatestSupportedServerVersion, x => x.MigrationsHistoryTable(CMSPluginDbProperties.MigrationsHistoryTable, CMSPluginDbProperties.DbSchema)); |
| | | |
| | | return new CMSPluginDbContext(builder.Options); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Builds the configuration. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | private static IConfigurationRoot BuildConfiguration() |
| | | { |
| | | var builder = new ConfigurationBuilder() |
| | | .SetBasePath(Path.Combine(Directory.GetCurrentDirectory(), "../CMS.Plugin.HIAWms.EntityFrameworkCore/")) |
| | | .AddJsonFile("appsettings.json", optional: false); |
| | | |
| | | return builder.Build(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain; |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore; |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Volo.Abp.EntityFrameworkCore; |
| | | using Volo.Abp.Modularity; |
| | | |
| | | namespace CMS.Plugin.HIAWms.MySQL; |
| | | |
| | | /// <summary> |
| | | /// EntityFrameworkCore模å |
| | | /// </summary> |
| | | [DependsOn(typeof(CMSPluginEntityFrameworkCoreModule))] |
| | | public class CMSPluginMySQLModule : AbpModule |
| | | { |
| | | /// <inheritdoc /> |
| | | public override void PreConfigureServices(ServiceConfigurationContext context) |
| | | { |
| | | CMSPluginEfCoreEntityExtensionMappings.Configure(); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public override void ConfigureServices(ServiceConfigurationContext context) |
| | | { |
| | | context.Services.AddAbpDbContext<CMSPluginDbContext>(options => |
| | | { |
| | | /* Remove "includeAllEntities: true" to create |
| | | * default repositories only for aggregate roots */ |
| | | //options.AddDefaultRepositories(includeAllEntities: true); |
| | | }); |
| | | |
| | | Configure<AbpDbContextOptions>(options => |
| | | { |
| | | /* The main point to change your DBMS. |
| | | * See also CMSMigrationsDbContextFactory for EF Core tooling. */ |
| | | options.UseMySQL(x => |
| | | { |
| | | x.MigrationsHistoryTable(CMSPluginDbProperties.MigrationsHistoryTable, CMSPluginDbProperties.DbSchema); |
| | | //x.EnableRetryOnFailure(); |
| | | }); |
| | | }); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
| | | <ConfigureAwait ContinueOnCapturedContext="false" /> |
| | | </Weavers> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Runtime.CompilerServices; |
| | | [assembly:InternalsVisibleToAttribute("CMS.Plugin.EntityFrameworkCore.Tests")] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | cd ../ |
| | | dotnet ef database update -c CMSPluginDbContext |
| | | cmd |
¶Ô±ÈÐÂÎļþ |
| | |
| | | cd ../ |
| | | dotnet ef migrations add InitialCreate1 -c CMSPluginDbContext -o Migrations |
| | | ::dotnet ef migrations add Update1 -c CMSPluginDbContext -o Migrations |
| | | ::dotnet ef migrations add Update2 -c CMSPluginDbContext -o Migrations |
| | | ::dotnet ef migrations add Update3 -c CMSPluginDbContext -o Migrations |
| | | cmd |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | |
| | | <Import Project="../../common.props" /> |
| | | <Import Project="../../configureawait.props" /> |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="Volo.Abp.EntityFrameworkCore.PostgreSql" Version="$(ABPPackageVersion)" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.5"> |
| | | <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> |
| | | <PrivateAssets>compile; contentFiles; build; buildMultitargeting; buildTransitive; analyzers; native</PrivateAssets> |
| | | </PackageReference> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\CMS.Plugin.HIAWms.EntityFrameworkCore\CMS.Plugin.HIAWms.EntityFrameworkCore.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <Folder Include="Migrations\" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions; |
| | | using CMS.Plugin.HIAWms.Domain; |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.EntityFrameworkCore; |
| | | using Volo.Abp.EntityFrameworkCore.Modeling; |
| | | |
| | | namespace CMS.Plugin.HIAWms.PostgreSql; |
| | | |
| | | /// <summary> |
| | | /// æ°æ®åºä¸ä¸æ |
| | | /// </summary> |
| | | [ConnectionStringName(CMSPluginDbProperties.ConnectionStringName)] |
| | | public class CMSPluginDbContext : AbpDbContext<CMSPluginDbContext>, ICMSPluginDbContext |
| | | { |
| | | /* Add DbSet properties for your Aggregate Roots / Entities here. */ |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="CMSPluginDbContext"/> class. |
| | | /// </summary> |
| | | /// <param name="options">The options.</param> |
| | | public CMSPluginDbContext(DbContextOptions<CMSPluginDbContext> options) |
| | | : base(options) |
| | | { |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | protected override void OnModelCreating(ModelBuilder builder) |
| | | { |
| | | base.OnModelCreating(builder); |
| | | |
| | | /* Include modules to your migration db context */ |
| | | |
| | | builder.ConfigureWmsContainer(); |
| | | builder.ConfigureWmsStore(); |
| | | builder.ConfigureWmsArea(); |
| | | builder.ConfigureWmsPlace(); |
| | | builder.ConfigureWmsMaterial(); |
| | | /* Configure your own tables/entities inside here */ |
| | | |
| | | //builder.Entity<YourEntity>(b => |
| | | //{ |
| | | // b.ToTable(CMSPluginDbProperties.DbTablePrefix + "YourEntities", CMSPluginDbProperties.DbSchema); |
| | | // b.ConfigureByConvention(); //auto configure for the base class props |
| | | // //... |
| | | //}); |
| | | |
| | | builder.TryConfigureObjectExtensions<CMSPluginDbContext>(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain; |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Microsoft.EntityFrameworkCore.Design; |
| | | using Microsoft.Extensions.Configuration; |
| | | |
| | | namespace CMS.Plugin.HIAWms.PostgreSql; |
| | | |
| | | /// <summary> |
| | | /// This class is needed for EF Core console commands |
| | | /// (like Add-Migration and Update-Database commands) |
| | | /// </summary> |
| | | public class CMSPluginDbContextFactory : IDesignTimeDbContextFactory<CMSPluginDbContext> |
| | | { |
| | | /// <summary> |
| | | /// Creates a new instance of a derived context. |
| | | /// </summary> |
| | | /// <param name="args">Arguments provided by the design-time service.</param> |
| | | public CMSPluginDbContext CreateDbContext(string[] args) |
| | | { |
| | | CMSPluginEfCoreEntityExtensionMappings.Configure(); |
| | | |
| | | var configuration = BuildConfiguration(); |
| | | |
| | | var builder = new DbContextOptionsBuilder<CMSPluginDbContext>() |
| | | .UseNpgsql(configuration.GetConnectionString("Default"), x => x.MigrationsHistoryTable(CMSPluginDbProperties.MigrationsHistoryTable, CMSPluginDbProperties.DbSchema)); |
| | | |
| | | return new CMSPluginDbContext(builder.Options); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Builds the configuration. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | private static IConfigurationRoot BuildConfiguration() |
| | | { |
| | | var builder = new ConfigurationBuilder() |
| | | .SetBasePath(Path.Combine(Directory.GetCurrentDirectory(), "../CMS.Plugin.HIAWms.EntityFrameworkCore/")) |
| | | .AddJsonFile("appsettings.json", optional: false); |
| | | |
| | | return builder.Build(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain; |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore; |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Volo.Abp.EntityFrameworkCore; |
| | | using Volo.Abp.Modularity; |
| | | |
| | | namespace CMS.Plugin.HIAWms.PostgreSql; |
| | | |
| | | /// <summary> |
| | | /// EntityFrameworkCore模å |
| | | /// </summary> |
| | | [DependsOn(typeof(CMSPluginEntityFrameworkCoreModule))] |
| | | public class CMSPluginPostgreSqlModule : AbpModule |
| | | { |
| | | /// <inheritdoc /> |
| | | public override void PreConfigureServices(ServiceConfigurationContext context) |
| | | { |
| | | CMSPluginEfCoreEntityExtensionMappings.Configure(); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public override void ConfigureServices(ServiceConfigurationContext context) |
| | | { |
| | | context.Services.AddAbpDbContext<CMSPluginDbContext>(options => |
| | | { |
| | | /* Remove "includeAllEntities: true" to create |
| | | * default repositories only for aggregate roots */ |
| | | //options.AddDefaultRepositories(includeAllEntities: true); |
| | | }); |
| | | |
| | | Configure<AbpDbContextOptions>(options => |
| | | { |
| | | /* The main point to change your DBMS. |
| | | * See also CMSMigrationsDbContextFactory for EF Core tooling. */ |
| | | options.UseNpgsql(x => |
| | | { |
| | | x.MigrationsHistoryTable(CMSPluginDbProperties.MigrationsHistoryTable, CMSPluginDbProperties.DbSchema); |
| | | //x.EnableRetryOnFailure(); |
| | | }); |
| | | }); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
| | | <ConfigureAwait ContinueOnCapturedContext="false" /> |
| | | </Weavers> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Runtime.CompilerServices; |
| | | [assembly:InternalsVisibleToAttribute("CMS.Plugin.EntityFrameworkCore.Tests")] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | cd ../ |
| | | dotnet ef database update -c CMSPluginDbContext |
| | | cmd |
¶Ô±ÈÐÂÎļþ |
| | |
| | | cd ../ |
| | | dotnet ef migrations add InitialCreate -c CMSPluginDbContext -o Migrations |
| | | ::dotnet ef migrations add Update1 -c CMSPluginDbContext -o Migrations |
| | | ::dotnet ef migrations add Update2 -c CMSPluginDbContext -o Migrations |
| | | ::dotnet ef migrations add Update3 -c CMSPluginDbContext -o Migrations |
| | | cmd |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | |
| | | <Import Project="../../common.props" /> |
| | | <Import Project="../../configureawait.props" /> |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="$(ABPPackageVersion)" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.5"> |
| | | <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> |
| | | <PrivateAssets>compile; contentFiles; build; buildMultitargeting; buildTransitive; analyzers; native</PrivateAssets> |
| | | </PackageReference> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\CMS.Plugin.HIAWms.EntityFrameworkCore\CMS.Plugin.HIAWms.EntityFrameworkCore.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <Folder Include="Migrations\" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain; |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions; |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.EntityFrameworkCore; |
| | | using Volo.Abp.EntityFrameworkCore.Modeling; |
| | | |
| | | namespace CMS.Plugin.HIAWms.SqlServer; |
| | | |
| | | /// <summary> |
| | | /// æ°æ®åºä¸ä¸æ |
| | | /// </summary> |
| | | [ConnectionStringName(CMSPluginDbProperties.ConnectionStringName)] |
| | | public class CMSPluginDbContext : AbpDbContext<CMSPluginDbContext>, ICMSPluginDbContext |
| | | { |
| | | /* Add DbSet properties for your Aggregate Roots / Entities here. */ |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="CMSPluginDbContext"/> class. |
| | | /// </summary> |
| | | /// <param name="options">The options.</param> |
| | | public CMSPluginDbContext(DbContextOptions<CMSPluginDbContext> options) |
| | | : base(options) |
| | | { |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | protected override void OnModelCreating(ModelBuilder builder) |
| | | { |
| | | base.OnModelCreating(builder); |
| | | |
| | | /* Include modules to your migration db context */ |
| | | |
| | | builder.ConfigureWmsContainer(); |
| | | builder.ConfigureWmsStore(); |
| | | builder.ConfigureWmsArea(); |
| | | builder.ConfigureWmsPlace(); |
| | | builder.ConfigureWmsMaterial(); |
| | | |
| | | /* Configure your own tables/entities inside here */ |
| | | |
| | | //builder.Entity<YourEntity>(b => |
| | | //{ |
| | | // b.ToTable(CMSPluginDbProperties.DbTablePrefix + "YourEntities", CMSPluginDbProperties.DbSchema); |
| | | // b.ConfigureByConvention(); //auto configure for the base class props |
| | | // //... |
| | | //}); |
| | | |
| | | builder.TryConfigureObjectExtensions<CMSPluginDbContext>(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain; |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Microsoft.EntityFrameworkCore.Design; |
| | | using Microsoft.Extensions.Configuration; |
| | | |
| | | namespace CMS.Plugin.HIAWms.SqlServer; |
| | | |
| | | /// <summary> |
| | | /// This class is needed for EF Core console commands |
| | | /// (like Add-Migration and Update-Database commands) |
| | | /// </summary> |
| | | public class CMSPluginDbContextFactory : IDesignTimeDbContextFactory<CMSPluginDbContext> |
| | | { |
| | | /// <summary> |
| | | /// Creates a new instance of a derived context. |
| | | /// </summary> |
| | | /// <param name="args">Arguments provided by the design-time service.</param> |
| | | public CMSPluginDbContext CreateDbContext(string[] args) |
| | | { |
| | | CMSPluginEfCoreEntityExtensionMappings.Configure(); |
| | | |
| | | var configuration = BuildConfiguration(); |
| | | |
| | | var builder = new DbContextOptionsBuilder<CMSPluginDbContext>() |
| | | .UseSqlServer(configuration.GetConnectionString("Default"), x => x.MigrationsHistoryTable(CMSPluginDbProperties.MigrationsHistoryTable, CMSPluginDbProperties.DbSchema)); |
| | | |
| | | return new CMSPluginDbContext(builder.Options); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Builds the configuration. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | private static IConfigurationRoot BuildConfiguration() |
| | | { |
| | | var builder = new ConfigurationBuilder() |
| | | .SetBasePath(Path.Combine(Directory.GetCurrentDirectory(), "../CMS.Plugin.HIAWms.EntityFrameworkCore/")) |
| | | .AddJsonFile("appsettings.json", optional: false); |
| | | |
| | | return builder.Build(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain; |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore; |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Volo.Abp.EntityFrameworkCore; |
| | | using Volo.Abp.Modularity; |
| | | |
| | | namespace CMS.Plugin.HIAWms.SqlServer; |
| | | |
| | | /// <summary> |
| | | /// EntityFrameworkCore模å |
| | | /// </summary> |
| | | [DependsOn(typeof(CMSPluginEntityFrameworkCoreModule))] |
| | | public class CMSPluginSqlServerModule : AbpModule |
| | | { |
| | | /// <inheritdoc /> |
| | | public override void PreConfigureServices(ServiceConfigurationContext context) |
| | | { |
| | | CMSPluginEfCoreEntityExtensionMappings.Configure(); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public override void ConfigureServices(ServiceConfigurationContext context) |
| | | { |
| | | context.Services.AddAbpDbContext<CMSPluginDbContext>(options => |
| | | { |
| | | /* Remove "includeAllEntities: true" to create |
| | | * default repositories only for aggregate roots */ |
| | | //options.AddDefaultRepositories(includeAllEntities: true); |
| | | }); |
| | | |
| | | Configure<AbpDbContextOptions>(options => |
| | | { |
| | | /* The main point to change your DBMS. |
| | | * See also CMSMigrationsDbContextFactory for EF Core tooling. */ |
| | | options.UseSqlServer(x => |
| | | { |
| | | x.MigrationsHistoryTable(CMSPluginDbProperties.MigrationsHistoryTable, CMSPluginDbProperties.DbSchema); |
| | | //x.EnableRetryOnFailure(); |
| | | }); |
| | | }); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
| | | <ConfigureAwait ContinueOnCapturedContext="false" /> |
| | | </Weavers> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Runtime.CompilerServices; |
| | | [assembly:InternalsVisibleToAttribute("CMS.Plugin.EntityFrameworkCore.Tests")] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | cd ../ |
| | | dotnet ef database update -c CMSPluginDbContext |
| | | cmd |
¶Ô±ÈÐÂÎļþ |
| | |
| | | cd ../ |
| | | dotnet ef migrations add InitialCreate -c CMSPluginDbContext -o Migrations |
| | | ::dotnet ef migrations add Update1 -c CMSPluginDbContext -o Migrations |
| | | ::dotnet ef migrations add Update2 -c CMSPluginDbContext -o Migrations |
| | | ::dotnet ef migrations add Update3 -c CMSPluginDbContext -o Migrations |
| | | cmd |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers; |
| | | using WebApiClientCore.Attributes; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Apis |
| | | { |
| | | /// <summary> |
| | | /// å¤é¨Http APIå¯¹æ¥ // https://webapiclient.github.io/guide/getting-started.html |
| | | /// </summary> |
| | | public interface IHIAWmsExternalApi |
| | | { |
| | | /// <summary> |
| | | /// CreateAsync |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("api/v1/hiawms/wmscontainer")] |
| | | Task<WmsContainerDto> CreateAsync([JsonContent] WmsContainerCreateDto input); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | |
| | | <Import Project="../../common.props" /> |
| | | <Import Project="../../configureawait.props" /> |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | <EnableDynamicLoading>true</EnableDynamicLoading> |
| | | <ProduceReferenceAssembly>false</ProduceReferenceAssembly> |
| | | <GenerateDocumentationFile>true</GenerateDocumentationFile> |
| | | </PropertyGroup> |
| | | |
| | | <PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))"> |
| | | <CMSRootPath>D:\Program Files\CMS Editor</CMSRootPath> |
| | | <OutputPath>$(CMSRootPath)\plugins\cms.plugin.hiawms</OutputPath> |
| | | </PropertyGroup> |
| | | |
| | | <PropertyGroup Condition="$([MSBuild]::IsOSPlatform('OSX'))"> |
| | | <CMSRootPath>/Volumes/SSD/CMS Editor</CMSRootPath> |
| | | <OutputPath>$(CMSRootPath)\plugins\cms.plugin.hiawms</OutputPath> |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <None Remove="appsettings.json" /> |
| | | <None Remove="Flows\50001_1.pfd" /> |
| | | <None Remove="Flows\FlowInfo.xml" /> |
| | | <None Remove="Resources\Templates\WmsContainerå¯¼åºæ¨¡æ¿.xlsx" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <Content Include="appsettings.json"> |
| | | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
| | | </Content> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <EmbeddedResource Include="Resources\Templates\WmsContainerå¯¼åºæ¨¡æ¿.xlsx"> |
| | | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
| | | </EmbeddedResource> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="CMS.Framework.AspNetCore" Version="2.16.1" /> |
| | | <PackageReference Include="CMS.Extensions.Variable" Version="2.16.1" /> |
| | | <PackageReference Include="CMS.Extensions.Data" Version="2.16.1" /> |
| | | <PackageReference Include="CMS.Data.Stressing" Version="2.16.1" /> |
| | | <PackageReference Include="CMS.Extensions.Abp" Version="1.4.0" /> |
| | | <PackageReference Include="WebApiClientCore" Version="2.0.4" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\CMS.Plugin.HIAWms.Application\CMS.Plugin.HIAWms.Application.csproj" /> |
| | | <ProjectReference Include="..\CMS.Plugin.HIAWms.MySQL\CMS.Plugin.HIAWms.MySQL.csproj" /> |
| | | <ProjectReference Include="..\CMS.Plugin.HIAWms.PostgreSql\CMS.Plugin.HIAWms.PostgreSql.csproj" /> |
| | | <ProjectReference Include="..\CMS.Plugin.HIAWms.SqlServer\CMS.Plugin.HIAWms.SqlServer.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <Reference Include="CmsQueryExtensions"> |
| | | <HintPath>..\..\..\..\CommonDLL\CmsQueryExtensions.dll</HintPath> |
| | | </Reference> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <Resource Include="Flows\50001_1.pfd"> |
| | | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
| | | </Resource> |
| | | <Resource Include="Flows\FlowInfo.xml"> |
| | | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
| | | </Resource> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Collections; |
| | | using Autofac; |
| | | using CMS.Data.Stressing; |
| | | using CMS.DataPersistence; |
| | | using CMS.DataPersistence.Data; |
| | | using CMS.Extensions.Abp.Autofac.Extensions.DependencyInjection; |
| | | using CMS.Plugin.MesSuite.Abstractions; |
| | | using CMS.Plugin.MesSuite.Abstractions.Consts; |
| | | using CMS.Plugin.HIAWms.Abstractions; |
| | | using CMS.Plugin.HIAWms.Apis; |
| | | using CMS.Plugin.HIAWms.Domain; |
| | | using CMS.Plugin.HIAWms.ProjectService; |
| | | using CMS.Plugin.HIAWms.Workers; |
| | | using CMS.Plugin.HIAWms.Apis; |
| | | using CMS.Project.Abstractions; |
| | | using Microsoft.AspNetCore.Builder; |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Structing.AspNetCore; |
| | | using Structing.Core; |
| | | using Structing.Web; |
| | | using SYC.Plugin; |
| | | using Volo.Abp.BackgroundWorkers; |
| | | using Volo.Abp.DependencyInjection; |
| | | using Volo.Abp.Modularity.PlugIns; |
| | | |
| | | namespace CMS.Plugin.HIAWms; |
| | | |
| | | /// <summary> |
| | | /// CMSæä»¶å
¥å£ï¼ä½¿ç¨<see cref="EnableApplicationPartAttribute"/>å°å¯¼å
¥Controller. |
| | | /// </summary> |
| | | [EnableApplicationPart] |
| | | public class CMSPluginEntry : PluginEntry |
| | | { |
| | | private readonly IServiceCollection _service = new ServiceCollection(); |
| | | |
| | | /// <inheritdoc /> |
| | | public override void Register(IRegisteContext context) |
| | | { |
| | | var configuration = context.Features.GetConfiguration(); |
| | | |
| | | // é
ç½®å¤é¨HttpApiï¼ https://webapiclient.github.io/ |
| | | context.Services |
| | | .AddHttpApi<IHIAWmsExternalApi>() |
| | | .ConfigureHttpApi(configuration.GetSection(nameof(IHIAWmsExternalApi))); |
| | | |
| | | context.Services.TryAddHIAWms(); |
| | | |
| | | context.Services.AddScoped<IProjectRuntimeMigrator, CMSPluginRuntimeMigrator>(); |
| | | context.Services.AddSingleton<IProjectService, HIAWmsProjectService>(); |
| | | |
| | | context.Services.AddScoped<IEFDataProvider>(p => |
| | | { |
| | | var cfg = p.GetRequiredService<IDataRuntimeConfig>(); |
| | | return new DefaultEFDataProvider(CMSPluginMesSuiteOptions.DataProviderName, CMSPluginMesSuiteOptions.GetDatabaseSuffix(CMSPluginDbProperties.MigrationsHistoryTable), CMSPluginDbProperties.MigrationsHistoryTable, cfg); |
| | | }); |
| | | |
| | | _service.AddObjectAccessor<IApplicationBuilder>(); |
| | | _service.AddApplication<CMSPluginModule>(options => |
| | | { |
| | | var databaseType = configuration[SectionName.DatabaseType] ?? "mysql"; |
| | | if (KnowsDbCode.IsMysql(databaseType)) |
| | | { |
| | | options.PlugInSources.Add(new TypePlugInSource( |
| | | typeof(MySQL.CMSPluginMySQLModule) |
| | | )); |
| | | } |
| | | else if (KnowsDbCode.IsSqlServer(databaseType)) |
| | | { |
| | | options.PlugInSources.Add(new TypePlugInSource( |
| | | typeof(SqlServer.CMSPluginSqlServerModule) |
| | | )); |
| | | } |
| | | else if (KnowsDbCode.IsPostgreSql(databaseType)) |
| | | { |
| | | options.PlugInSources.Add(new TypePlugInSource( |
| | | typeof(PostgreSql.CMSPluginPostgreSqlModule) |
| | | )); |
| | | } |
| | | }); |
| | | |
| | | base.Register(context); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public override void ConfigureContainer(ContainerBuilder builder) |
| | | { |
| | | builder.Populate(_service); |
| | | |
| | | base.ConfigureContainer(builder); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public override async Task ReadyAsync(IReadyContext context) |
| | | { |
| | | context.Provider.GetRequiredService<ObjectAccessor<IApplicationBuilder>>().Value = context.Features.GetApplicationBuilder(); |
| | | var app = context.Features.GetApplicationBuilder(); |
| | | await app.InitializeApplicationAsync(); |
| | | |
| | | await base.ReadyAsync(context); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public override async Task AfterReadyAsync(IReadyContext context) |
| | | { |
| | | await context.GetRequiredService<IBackgroundWorkerManager>().AddAsync(context.GetRequiredService<HIAWmsWorker>()); |
| | | |
| | | await base.AfterReadyAsync(context); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Reflection; |
| | | using CMS.Extensions.Abp; |
| | | using CMS.Extensions.Abp.AspNetCore; |
| | | using CMS.Plugin.HIAWms.Abstractions; |
| | | using CMS.Plugin.HIAWms.Application; |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore; |
| | | using CMS.Plugin.HIAWms.Jobs; |
| | | using Volo.Abp.BackgroundJobs; |
| | | using Volo.Abp.Modularity; |
| | | |
| | | namespace CMS.Plugin.HIAWms |
| | | { |
| | | /// <summary> |
| | | /// CMS æä»¶ä¾èµå è½½å¯å¨æ¨¡å |
| | | /// </summary> |
| | | [DependsOn( |
| | | typeof(CMSPluginAbpModule), |
| | | typeof(CMSPluginAbpAspNetCoreModule), |
| | | typeof(CMSPluginApplicationModule), |
| | | typeof(CMSPluginEntityFrameworkCoreModule) |
| | | )] |
| | | public class CMSPluginModule : AbpStartupModule |
| | | { |
| | | /// <inheritdoc /> |
| | | public override void ConfigureServices(ServiceConfigurationContext context) |
| | | { |
| | | Configure<AbpBackgroundJobOptions>(options => |
| | | { |
| | | options.AddJob<HIAWmsJob>(); |
| | | }); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public override Assembly[]? GetSharedAssemblies() |
| | | { |
| | | return base.GetSharedAssemblies().Concat(new[] |
| | | { |
| | | typeof(CMSPluginHIAWmsAbstractionsModule).Assembly, |
| | | }).ToArray(); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Data; |
| | | using CMS.Project.Abstractions; |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Microsoft.Extensions.Logging; |
| | | using Volo.Abp.DependencyInjection; |
| | | |
| | | namespace CMS.Plugin.HIAWms |
| | | { |
| | | /// <summary> |
| | | /// å·¥ç¨æ°æ®åºè¿ç§»å¨ï¼å½<see cref="IProjectRunner"/>å è½½å·¥ç¨æ¶æ¤å¯¹è±¡ä¼è¢«å建è°ç¨ |
| | | /// </summary> |
| | | public class CMSPluginRuntimeMigrator : IProjectRuntimeMigrator |
| | | { |
| | | /// <summary> |
| | | /// æ§è¡è¿ç§» |
| | | /// </summary> |
| | | /// <param name="project">å½åè¦è¿è¡çå·¥ç¨</param> |
| | | /// <param name="serviceProvider">åå¨è¿è¡å·¥ç¨ä¸ä¸æçserviceProvider</param> |
| | | /// <returns></returns> |
| | | public async Task UpgradeAsync(Project.Project project, IServiceProvider serviceProvider) |
| | | { |
| | | var objectAccessor = serviceProvider.GetService<ObjectAccessor<Project.Project>>(); |
| | | if (objectAccessor != null) |
| | | { |
| | | objectAccessor.Value = project; |
| | | } |
| | | |
| | | var logger = serviceProvider.GetRequiredService<ILogger<CMSPluginRuntimeMigrator>>(); |
| | | try |
| | | { |
| | | // éè¿serviceProviderè·åèªå·±çDbContextå¹¶è¿è¡å建æè¿ç§»æµç¨ |
| | | logger.LogInformation($"Start {project.Info.Id} HIAWms dbcontext create"); |
| | | await serviceProvider.GetRequiredService<CMSPluginDbMigrationService>().MigrateAsync(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | logger.LogError(ex, "Create HIAWms db failed"); |
| | | } |
| | | |
| | | if (objectAccessor != null) |
| | | { |
| | | objectAccessor.Value = null; |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Ao.Lang; |
| | | using CMS.Extensions.Abp.AspNetCore.Mvc.Filters; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsAreas; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using MiniExcelLibs; |
| | | using System.Reflection; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Controller |
| | | { |
| | | /// <summary> |
| | | /// WmsAreaæå¡ |
| | | /// </summary> |
| | | [ApiController] |
| | | [TypeFilter(typeof(CMSLanguageFilter))] |
| | | [TypeFilter(typeof(CMSUowActionFilter))] |
| | | [TypeFilter(typeof(CMSAuditActionFilter))] |
| | | [TypeFilter(typeof(CMSExceptionFilter))] |
| | | [Route("api/v{version:apiVersion}/HIAWms/[controller]")] |
| | | public class WmsAreaController : ControllerBase |
| | | { |
| | | private readonly IWmsAreaAppService _wmsareaAppService; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsAreaController"/> class. |
| | | /// </summary> |
| | | /// <param name="wmsareaAppService">The wmsarea application service.</param> |
| | | public WmsAreaController(IWmsAreaAppService wmsareaAppService) |
| | | { |
| | | _wmsareaAppService = wmsareaAppService; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åwmsarea. |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("{id}")] |
| | | public virtual Task<WmsAreaDto> GetAsync(Guid id) |
| | | { |
| | | return _wmsareaAppService.GetAsync(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åwmsareaçå表. |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | public virtual Task<PagedResultDto<WmsAreaDto>> GetListAsync([FromQuery] GetWmsAreasInput input) |
| | | { |
| | | return _wmsareaAppService.GetListAsync(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å建wmsarea. |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPost] |
| | | public virtual Task<WmsAreaDto> CreateAsync(WmsAreaCreateDto input) |
| | | { |
| | | return _wmsareaAppService.CreateAsync(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ´æ°wmsarea. |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPut] |
| | | [Route("{id}")] |
| | | public virtual Task<WmsAreaDto> UpdateAsync(Guid id, WmsAreaUpdateDto input) |
| | | { |
| | | return _wmsareaAppService.UpdateAsync(id, input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å
éWmsArea. |
| | | /// </summary> |
| | | /// <param name="ids">Idéå.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPost] |
| | | [Route("Clone")] |
| | | public virtual Task<List<WmsAreaDto>> CloneAsync([FromBody] IEnumerable<Guid> ids) |
| | | { |
| | | return _wmsareaAppService.CloneAsync(ids); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å é¤wmsarea. |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpDelete] |
| | | [Route("{id}")] |
| | | public virtual Task DeleteAsync(Guid id) |
| | | { |
| | | return _wmsareaAppService.DeleteAsync(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¹éå é¤wmsarea. |
| | | /// </summary> |
| | | /// <param name="ids">The ids.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpDelete] |
| | | public virtual Task DeleteAsync([FromBody] IEnumerable<Guid> ids) |
| | | { |
| | | return _wmsareaAppService.DeleteManyAsync(ids); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è°æ´æåº. |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | [HttpPut] |
| | | [Route("{id}/AdjustSort/{sort}")] |
| | | public virtual Task AdjustSortAsync(Guid id, int sort) |
| | | { |
| | | return _wmsareaAppService.AdjustSortAsync(id, sort); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导å
¥wmsarea. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Authorize] |
| | | [HttpPost] |
| | | [Route("Import")] |
| | | public virtual async Task<IActionResult> ImportAsync(IFormFile file) |
| | | { |
| | | using var stream = new MemoryStream(); |
| | | await file.CopyToAsync(stream); |
| | | stream.Seek(0L, SeekOrigin.Begin); |
| | | |
| | | var sheetNames = stream.GetSheetNames(); |
| | | var wmsareaRows = sheetNames.Contains("é
ç½®") ? MiniExcel.Query<WmsAreasImportModel.WmsAreaImportModel>(stream, sheetName: "é
ç½®").ToList() : new(); |
| | | |
| | | if (!wmsareaRows.Any()) |
| | | { |
| | | throw new UserFriendlyException("è¯·æ£æ¥å¯¼å
¥çè¡¨æ ¼"); |
| | | } |
| | | |
| | | await _wmsareaAppService.ImportAsync(new WmsAreasImportModel |
| | | { |
| | | WmsAreas = wmsareaRows, |
| | | }); |
| | | |
| | | return Ok(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导åºwmsarea. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("Export")] |
| | | public virtual async Task<IActionResult> ExportAsync([FromQuery] GetWmsAreasInput input) |
| | | { |
| | | input.MaxResultCount = int.MaxValue; |
| | | var exportData = await _wmsareaAppService.ExportAsync(input); |
| | | var templatePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"Resources/Templates/WmsAreaå¯¼åºæ¨¡æ¿.xlsx"); |
| | | if (!System.IO.File.Exists(templatePath)) |
| | | { |
| | | templatePath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty, $"Resources/Templates/WmsAreaå¯¼åºæ¨¡æ¿.xlsx"); |
| | | } |
| | | |
| | | var memoryStream = new MemoryStream(); |
| | | await memoryStream.SaveAsByTemplateAsync(templatePath, exportData.Sheets); |
| | | memoryStream.Seek(0L, SeekOrigin.Begin); |
| | | return new FileStreamResult(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") { FileDownloadName = $"{exportData.FileName}_{DateTime.Now:yyyyMMddhhmmss}.xlsx" }; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Ao.Lang; |
| | | using CMS.Extensions.Abp.AspNetCore.Mvc.Filters; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using MiniExcelLibs; |
| | | using System.Reflection; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Controller |
| | | { |
| | | /// <summary> |
| | | /// WmsContaineræå¡ |
| | | /// </summary> |
| | | [ApiController] |
| | | [TypeFilter(typeof(CMSLanguageFilter))] |
| | | [TypeFilter(typeof(CMSUowActionFilter))] |
| | | [TypeFilter(typeof(CMSAuditActionFilter))] |
| | | [TypeFilter(typeof(CMSExceptionFilter))] |
| | | [Route("api/v{version:apiVersion}/HIAWms/[controller]")] |
| | | public class WmsContainerController : ControllerBase |
| | | { |
| | | private readonly IWmsContainerAppService _wmscontainerAppService; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsContainerController"/> class. |
| | | /// </summary> |
| | | /// <param name="wmscontainerAppService">The wmscontainer application service.</param> |
| | | public WmsContainerController(IWmsContainerAppService wmscontainerAppService) |
| | | { |
| | | _wmscontainerAppService = wmscontainerAppService; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åwmscontainer. |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("{id}")] |
| | | public virtual Task<WmsContainerDto> GetAsync(Guid id) |
| | | { |
| | | return _wmscontainerAppService.GetAsync(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åwmscontainerçå表. |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | public virtual Task<PagedResultDto<WmsContainerDto>> GetListAsync([FromQuery] GetWmsContainersInput input) |
| | | { |
| | | return _wmscontainerAppService.GetListAsync(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å建wmscontainer. |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPost] |
| | | public virtual Task<WmsContainerDto> CreateAsync(WmsContainerCreateDto input) |
| | | { |
| | | return _wmscontainerAppService.CreateAsync(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ´æ°wmscontainer. |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPut] |
| | | [Route("{id}")] |
| | | public virtual Task<WmsContainerDto> UpdateAsync(Guid id, WmsContainerUpdateDto input) |
| | | { |
| | | return _wmscontainerAppService.UpdateAsync(id, input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å
éWmsContainer. |
| | | /// </summary> |
| | | /// <param name="ids">Idéå.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPost] |
| | | [Route("Clone")] |
| | | public virtual Task<List<WmsContainerDto>> CloneAsync([FromBody] IEnumerable<Guid> ids) |
| | | { |
| | | return _wmscontainerAppService.CloneAsync(ids); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å é¤wmscontainer. |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpDelete] |
| | | [Route("{id}")] |
| | | public virtual Task DeleteAsync(Guid id) |
| | | { |
| | | return _wmscontainerAppService.DeleteAsync(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¹éå é¤wmscontainer. |
| | | /// </summary> |
| | | /// <param name="ids">The ids.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpDelete] |
| | | public virtual Task DeleteAsync([FromBody] IEnumerable<Guid> ids) |
| | | { |
| | | return _wmscontainerAppService.DeleteManyAsync(ids); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è°æ´æåº. |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | [HttpPut] |
| | | [Route("{id}/AdjustSort/{sort}")] |
| | | public virtual Task AdjustSortAsync(Guid id, int sort) |
| | | { |
| | | return _wmscontainerAppService.AdjustSortAsync(id, sort); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导å
¥wmscontainer. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Authorize] |
| | | [HttpPost] |
| | | [Route("Import")] |
| | | public virtual async Task<IActionResult> ImportAsync(IFormFile file) |
| | | { |
| | | using var stream = new MemoryStream(); |
| | | await file.CopyToAsync(stream); |
| | | stream.Seek(0L, SeekOrigin.Begin); |
| | | |
| | | var sheetNames = stream.GetSheetNames(); |
| | | var wmscontainerRows = sheetNames.Contains("é
ç½®") ? MiniExcel.Query<WmsContainersImportModel.WmsContainerImportModel>(stream, sheetName: "é
ç½®").ToList() : new(); |
| | | |
| | | if (!wmscontainerRows.Any()) |
| | | { |
| | | throw new UserFriendlyException("è¯·æ£æ¥å¯¼å
¥çè¡¨æ ¼"); |
| | | } |
| | | |
| | | await _wmscontainerAppService.ImportAsync(new WmsContainersImportModel |
| | | { |
| | | WmsContainers = wmscontainerRows, |
| | | }); |
| | | |
| | | return Ok(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导åºwmscontainer. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("Export")] |
| | | public virtual async Task<IActionResult> ExportAsync([FromQuery] GetWmsContainersInput input) |
| | | { |
| | | input.MaxResultCount = int.MaxValue; |
| | | var exportData = await _wmscontainerAppService.ExportAsync(input); |
| | | var templatePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"Resources/Templates/WmsContainerå¯¼åºæ¨¡æ¿.xlsx"); |
| | | if (!System.IO.File.Exists(templatePath)) |
| | | { |
| | | templatePath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty, $"Resources/Templates/WmsContainerå¯¼åºæ¨¡æ¿.xlsx"); |
| | | } |
| | | |
| | | var memoryStream = new MemoryStream(); |
| | | await memoryStream.SaveAsByTemplateAsync(templatePath, exportData.Sheets); |
| | | memoryStream.Seek(0L, SeekOrigin.Begin); |
| | | return new FileStreamResult(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") { FileDownloadName = $"{exportData.FileName}_{DateTime.Now:yyyyMMddhhmmss}.xlsx" }; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Extensions.Abp.AspNetCore.Mvc.Filters; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsEnumDto; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsStores; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Util; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using System; |
| | | using System.Web; |
| | | using static CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsAreas.WmsAreaCreateOrUpdateDtoBase; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Controller |
| | | { |
| | | /// <summary> |
| | | /// æä¸¾æå¡æ¥å£. |
| | | /// </summary> |
| | | [ApiController] |
| | | [TypeFilter(typeof(CMSLanguageFilter))] |
| | | [TypeFilter(typeof(CMSUowActionFilter))] |
| | | [TypeFilter(typeof(CMSAuditActionFilter))] |
| | | [TypeFilter(typeof(CMSExceptionFilter))] |
| | | [Route("api/v{version:apiVersion}/HIAWms/[controller]")] |
| | | public class WmsEnumController : ControllerBase |
| | | { |
| | | private readonly IWmsEnumAppService _wmsEnumAppService; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsEnumController"/> class. |
| | | /// æé 彿°. |
| | | /// </summary> |
| | | /// <param name="wmsEnumAppService"></param> |
| | | public WmsEnumController(IWmsEnumAppService wmsEnumAppService) |
| | | { |
| | | _wmsEnumAppService = wmsEnumAppService; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åæä¸¾æ°æ®. |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public List<EnumItem> GetEnumDataList(WmsEnumInput input) |
| | | { |
| | | return _wmsEnumAppService.GetEnumDataList(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åä»åºå表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("StoreList")] |
| | | public async Task<List<WmsStoreForAreaOutpur>> GetStreList() |
| | | { |
| | | return await _wmsEnumAppService.GetStreList(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åºåºå表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("AreaList")] |
| | | public async Task<List<AreaForListOuptut>> GetAreaListAsync() |
| | | { |
| | | return await _wmsEnumAppService.GetAreaListAsync(); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Ao.Lang; |
| | | using CMS.Extensions.Abp.AspNetCore.Mvc.Filters; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsInOutStockRecord; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using MiniExcelLibs; |
| | | using System.Reflection; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Controller |
| | | { |
| | | /// <summary> |
| | | /// åºå
¥åºè®°å½è¡¨æå¡ |
| | | /// </summary> |
| | | [ApiController] |
| | | [TypeFilter(typeof(CMSLanguageFilter))] |
| | | [TypeFilter(typeof(CMSUowActionFilter))] |
| | | [TypeFilter(typeof(CMSAuditActionFilter))] |
| | | [TypeFilter(typeof(CMSExceptionFilter))] |
| | | [Route("api/v{version:apiVersion}/HIAWms/[controller]")] |
| | | public class WmsInOutStockRecordController : ControllerBase |
| | | { |
| | | private readonly IWmsInOutStockRecordAppService _wmsInOutStockRecordAppService; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsInOutStockRecordController"/> class. |
| | | /// </summary> |
| | | /// <param name="wmsInOutStockRecordAppService">The wmsInOutStockRecord application service.</param> |
| | | public WmsInOutStockRecordController(IWmsInOutStockRecordAppService wmsInOutStockRecordAppService) |
| | | { |
| | | _wmsInOutStockRecordAppService = wmsInOutStockRecordAppService; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·ååºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("{id}")] |
| | | public virtual Task<WmsInOutStockRecordDto> GetAsync(Guid id) |
| | | { |
| | | return _wmsInOutStockRecordAppService.GetAsync(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å页è·ååºå
¥åºè®°å½è¡¨çå表. |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("Page")] |
| | | public virtual Task<PagedResultDto<WmsInOutStockRecordDto>> GetListAsync([FromQuery] GetWmsInOutStockRecordInput input) |
| | | { |
| | | return _wmsInOutStockRecordAppService.GetListAsync(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å建åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPost] |
| | | public virtual Task<WmsInOutStockRecordDto> CreateAsync(WmsInOutStockRecordCreateDto input) |
| | | { |
| | | return _wmsInOutStockRecordAppService.CreateAsync(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ´æ°åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPut] |
| | | [Route("{id}")] |
| | | public virtual Task<WmsInOutStockRecordDto> UpdateAsync(Guid id, WmsInOutStockRecordUpdateDto input) |
| | | { |
| | | return _wmsInOutStockRecordAppService.UpdateAsync(id, input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å
éåºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="ids">Idéå.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPost] |
| | | [Route("Clone")] |
| | | public virtual Task<List<WmsInOutStockRecordDto>> CloneAsync([FromBody] IEnumerable<Guid> ids) |
| | | { |
| | | return _wmsInOutStockRecordAppService.CloneAsync(ids); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å é¤åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpDelete] |
| | | [Route("{id}")] |
| | | public virtual Task DeleteAsync(Guid id) |
| | | { |
| | | return _wmsInOutStockRecordAppService.DeleteAsync(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¹éå é¤åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="ids">The ids.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpDelete] |
| | | public virtual Task DeleteAsync([FromBody] IEnumerable<Guid> ids) |
| | | { |
| | | return _wmsInOutStockRecordAppService.DeleteManyAsync(ids); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è°æ´æåºåºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | [HttpPut] |
| | | [Route("{id}/AdjustSort/{sort}")] |
| | | public virtual Task AdjustSortAsync(Guid id, int sort) |
| | | { |
| | | return _wmsInOutStockRecordAppService.AdjustSortAsync(id, sort); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导å
¥åºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Authorize] |
| | | [HttpPost] |
| | | [Route("Import")] |
| | | public virtual async Task<IActionResult> ImportAsync(IFormFile file) |
| | | { |
| | | using var stream = new MemoryStream(); |
| | | await file.CopyToAsync(stream); |
| | | stream.Seek(0L, SeekOrigin.Begin); |
| | | |
| | | var sheetNames = stream.GetSheetNames(); |
| | | var wmsInOutStockRecordRows = sheetNames.Contains("é
ç½®") ? MiniExcel.Query<WmsInOutStockRecordsImportModel.WmsInOutStockRecordImportModel>(stream, sheetName: "é
ç½®").ToList() : new(); |
| | | |
| | | if (!wmsInOutStockRecordRows.Any()) |
| | | { |
| | | throw new UserFriendlyException("è¯·æ£æ¥å¯¼å
¥çè¡¨æ ¼"); |
| | | } |
| | | |
| | | await _wmsInOutStockRecordAppService.ImportAsync(new WmsInOutStockRecordsImportModel |
| | | { |
| | | WmsInOutStockRecords = wmsInOutStockRecordRows, |
| | | }); |
| | | |
| | | return Ok(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导åºåºå
¥åºè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("Export")] |
| | | public virtual async Task<IActionResult> ExportAsync([FromQuery] GetWmsInOutStockRecordInput input) |
| | | { |
| | | input.MaxResultCount = int.MaxValue; |
| | | var exportData = await _wmsInOutStockRecordAppService.ExportAsync(input); |
| | | var templatePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"Resources/Templates/WmsInOutStockRecordå¯¼åºæ¨¡æ¿.xlsx"); |
| | | if (!System.IO.File.Exists(templatePath)) |
| | | { |
| | | templatePath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty, $"Resources/Templates/WmsInOutStockRecordå¯¼åºæ¨¡æ¿.xlsx"); |
| | | } |
| | | |
| | | var memoryStream = new MemoryStream(); |
| | | await memoryStream.SaveAsByTemplateAsync(templatePath, exportData.Sheets); |
| | | memoryStream.Seek(0L, SeekOrigin.Begin); |
| | | return new FileStreamResult(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") { FileDownloadName = $"{exportData.FileName}_{DateTime.Now:yyyyMMddhhmmss}.xlsx" }; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Ao.Lang; |
| | | using CMS.Extensions.Abp.AspNetCore.Mvc.Filters; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using MiniExcelLibs; |
| | | using System.Reflection; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Controller |
| | | { |
| | | /// <summary> |
| | | /// ç©æåºç¡ä¿¡æ¯è¡¨æå¡ |
| | | /// </summary> |
| | | [ApiController] |
| | | [TypeFilter(typeof(CMSLanguageFilter))] |
| | | [TypeFilter(typeof(CMSUowActionFilter))] |
| | | [TypeFilter(typeof(CMSAuditActionFilter))] |
| | | [TypeFilter(typeof(CMSExceptionFilter))] |
| | | [Route("api/v{version:apiVersion}/HIAWms/[controller]")] |
| | | public class WmsMaterialController : ControllerBase |
| | | { |
| | | private readonly IWmsMaterialAppService _wmsmaterialsAppService; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsMaterialController"/> class. |
| | | /// </summary> |
| | | /// <param name="wmsmaterialsAppService">The wmsmaterials application service.</param> |
| | | public WmsMaterialController(IWmsMaterialAppService wmsmaterialsAppService) |
| | | { |
| | | _wmsmaterialsAppService = wmsmaterialsAppService; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("{id}")] |
| | | public virtual Task<WmsMaterialDto> GetAsync(Guid id) |
| | | { |
| | | return _wmsmaterialsAppService.GetAsync(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å页è·åç©æåºç¡ä¿¡æ¯è¡¨çå表. |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("Page")] |
| | | public virtual Task<PagedResultDto<WmsMaterialDto>> GetListAsync([FromQuery] GetWmsMaterialInput input) |
| | | { |
| | | return _wmsmaterialsAppService.GetListAsync(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åå»ºç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPost] |
| | | public virtual Task<WmsMaterialDto> CreateAsync(WmsMaterialCreateDto input) |
| | | { |
| | | return _wmsmaterialsAppService.CreateAsync(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ´æ°ç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPut] |
| | | [Route("{id}")] |
| | | public virtual Task<WmsMaterialDto> UpdateAsync(Guid id, WmsMaterialUpdateDto input) |
| | | { |
| | | return _wmsmaterialsAppService.UpdateAsync(id, input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å
éç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="ids">Idéå.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPost] |
| | | [Route("Clone")] |
| | | public virtual Task<List<WmsMaterialDto>> CloneAsync([FromBody] IEnumerable<Guid> ids) |
| | | { |
| | | return _wmsmaterialsAppService.CloneAsync(ids); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å é¤ç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpDelete] |
| | | [Route("{id}")] |
| | | public virtual Task DeleteAsync(Guid id) |
| | | { |
| | | return _wmsmaterialsAppService.DeleteAsync(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¹éå é¤ç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="ids">The ids.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpDelete] |
| | | public virtual Task DeleteAsync([FromBody] IEnumerable<Guid> ids) |
| | | { |
| | | return _wmsmaterialsAppService.DeleteManyAsync(ids); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è°æ´æåºç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | [HttpPut] |
| | | [Route("{id}/AdjustSort/{sort}")] |
| | | public virtual Task AdjustSortAsync(Guid id, int sort) |
| | | { |
| | | return _wmsmaterialsAppService.AdjustSortAsync(id, sort); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导å
¥ç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Authorize] |
| | | [HttpPost] |
| | | [Route("Import")] |
| | | public virtual async Task<IActionResult> ImportAsync(IFormFile file) |
| | | { |
| | | using var stream = new MemoryStream(); |
| | | await file.CopyToAsync(stream); |
| | | stream.Seek(0L, SeekOrigin.Begin); |
| | | |
| | | var sheetNames = stream.GetSheetNames(); |
| | | var wmsmaterialsRows = sheetNames.Contains("é
ç½®") ? MiniExcel.Query<WmsMaterialsImportModel.WmsMaterialImportModel>(stream, sheetName: "é
ç½®").ToList() : new(); |
| | | |
| | | if (!wmsmaterialsRows.Any()) |
| | | { |
| | | throw new UserFriendlyException("è¯·æ£æ¥å¯¼å
¥çè¡¨æ ¼"); |
| | | } |
| | | |
| | | await _wmsmaterialsAppService.ImportAsync(new WmsMaterialsImportModel |
| | | { |
| | | WmsMaterials = wmsmaterialsRows, |
| | | }); |
| | | |
| | | return Ok(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导åºç©æåºç¡ä¿¡æ¯è¡¨ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("Export")] |
| | | public virtual async Task<IActionResult> ExportAsync([FromQuery] GetWmsMaterialInput input) |
| | | { |
| | | input.MaxResultCount = int.MaxValue; |
| | | var exportData = await _wmsmaterialsAppService.ExportAsync(input); |
| | | var templatePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"Resources/Templates/WmsMaterialå¯¼åºæ¨¡æ¿.xlsx"); |
| | | if (!System.IO.File.Exists(templatePath)) |
| | | { |
| | | templatePath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty, $"Resources/Templates/WmsMaterialå¯¼åºæ¨¡æ¿.xlsx"); |
| | | } |
| | | |
| | | var memoryStream = new MemoryStream(); |
| | | await memoryStream.SaveAsByTemplateAsync(templatePath, exportData.Sheets); |
| | | memoryStream.Seek(0L, SeekOrigin.Begin); |
| | | return new FileStreamResult(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") { FileDownloadName = $"{exportData.FileName}_{DateTime.Now:yyyyMMddhhmmss}.xlsx" }; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Ao.Lang; |
| | | using CMS.Extensions.Abp.AspNetCore.Mvc.Filters; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsPlaces; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using MiniExcelLibs; |
| | | using System.Reflection; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Controller |
| | | { |
| | | /// <summary> |
| | | /// WmsPlaceæå¡ |
| | | /// </summary> |
| | | [ApiController] |
| | | [TypeFilter(typeof(CMSLanguageFilter))] |
| | | [TypeFilter(typeof(CMSUowActionFilter))] |
| | | [TypeFilter(typeof(CMSAuditActionFilter))] |
| | | [TypeFilter(typeof(CMSExceptionFilter))] |
| | | [Route("api/v{version:apiVersion}/HIAWms/[controller]")] |
| | | public class WmsPlaceController : ControllerBase |
| | | { |
| | | private readonly IWmsPlaceAppService _wmsplaceAppService; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsPlaceController"/> class. |
| | | /// </summary> |
| | | /// <param name="wmsplaceAppService">The wmsplace application service.</param> |
| | | public WmsPlaceController(IWmsPlaceAppService wmsplaceAppService) |
| | | { |
| | | _wmsplaceAppService = wmsplaceAppService; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åwmsplace. |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("{id}")] |
| | | public virtual Task<WmsPlaceDto> GetAsync(Guid id) |
| | | { |
| | | return _wmsplaceAppService.GetAsync(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åwmsplaceçå表. |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | public virtual Task<PagedResultDto<WmsPlaceDto>> GetListAsync([FromQuery] GetWmsPlacesInput input) |
| | | { |
| | | return _wmsplaceAppService.GetListAsync(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å建wmsplace. |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPost] |
| | | public virtual Task<WmsPlaceDto> CreateAsync(WmsPlaceCreateDto input) |
| | | { |
| | | return _wmsplaceAppService.CreateAsync(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ´æ°wmsplace. |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPut] |
| | | [Route("{id}")] |
| | | public virtual Task<WmsPlaceDto> UpdateAsync(Guid id, WmsPlaceUpdateDto input) |
| | | { |
| | | return _wmsplaceAppService.UpdateAsync(id, input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å
éWmsPlace. |
| | | /// </summary> |
| | | /// <param name="ids">Idéå.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPost] |
| | | [Route("Clone")] |
| | | public virtual Task<List<WmsPlaceDto>> CloneAsync([FromBody] IEnumerable<Guid> ids) |
| | | { |
| | | return _wmsplaceAppService.CloneAsync(ids); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å é¤wmsplace. |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpDelete] |
| | | [Route("{id}")] |
| | | public virtual Task DeleteAsync(Guid id) |
| | | { |
| | | return _wmsplaceAppService.DeleteAsync(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¹éå é¤wmsplace. |
| | | /// </summary> |
| | | /// <param name="ids">The ids.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpDelete] |
| | | public virtual Task DeleteAsync([FromBody] IEnumerable<Guid> ids) |
| | | { |
| | | return _wmsplaceAppService.DeleteManyAsync(ids); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è°æ´æåº. |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | [HttpPut] |
| | | [Route("{id}/AdjustSort/{sort}")] |
| | | public virtual Task AdjustSortAsync(Guid id, int sort) |
| | | { |
| | | return _wmsplaceAppService.AdjustSortAsync(id, sort); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导å
¥wmsplace. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Authorize] |
| | | [HttpPost] |
| | | [Route("Import")] |
| | | public virtual async Task<IActionResult> ImportAsync(IFormFile file) |
| | | { |
| | | using var stream = new MemoryStream(); |
| | | await file.CopyToAsync(stream); |
| | | stream.Seek(0L, SeekOrigin.Begin); |
| | | |
| | | var sheetNames = stream.GetSheetNames(); |
| | | var wmsplaceRows = sheetNames.Contains("é
ç½®") ? MiniExcel.Query<WmsPlacesImportModel.WmsPlaceImportModel>(stream, sheetName: "é
ç½®").ToList() : new(); |
| | | |
| | | if (!wmsplaceRows.Any()) |
| | | { |
| | | throw new UserFriendlyException("è¯·æ£æ¥å¯¼å
¥çè¡¨æ ¼"); |
| | | } |
| | | |
| | | await _wmsplaceAppService.ImportAsync(new WmsPlacesImportModel |
| | | { |
| | | WmsPlaces = wmsplaceRows, |
| | | }); |
| | | |
| | | return Ok(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导åºwmsplace. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("Export")] |
| | | public virtual async Task<IActionResult> ExportAsync([FromQuery] GetWmsPlacesInput input) |
| | | { |
| | | input.MaxResultCount = int.MaxValue; |
| | | var exportData = await _wmsplaceAppService.ExportAsync(input); |
| | | var templatePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"Resources/Templates/WmsPlaceå¯¼åºæ¨¡æ¿.xlsx"); |
| | | if (!System.IO.File.Exists(templatePath)) |
| | | { |
| | | templatePath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty, $"Resources/Templates/WmsPlaceå¯¼åºæ¨¡æ¿.xlsx"); |
| | | } |
| | | |
| | | var memoryStream = new MemoryStream(); |
| | | await memoryStream.SaveAsByTemplateAsync(templatePath, exportData.Sheets); |
| | | memoryStream.Seek(0L, SeekOrigin.Begin); |
| | | return new FileStreamResult(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") { FileDownloadName = $"{exportData.FileName}_{DateTime.Now:yyyyMMddhhmmss}.xlsx" }; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Ao.Lang; |
| | | using CMS.Extensions.Abp.AspNetCore.Mvc.Filters; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsStores; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using MiniExcelLibs; |
| | | using System.Reflection; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Controller |
| | | { |
| | | /// <summary> |
| | | /// WmsStoreæå¡ |
| | | /// </summary> |
| | | [ApiController] |
| | | [TypeFilter(typeof(CMSLanguageFilter))] |
| | | [TypeFilter(typeof(CMSUowActionFilter))] |
| | | [TypeFilter(typeof(CMSAuditActionFilter))] |
| | | [TypeFilter(typeof(CMSExceptionFilter))] |
| | | [Route("api/v{version:apiVersion}/HIAWms/[controller]")] |
| | | public class WmsStoreController : ControllerBase |
| | | { |
| | | private readonly IWmsStoreAppService _wmsstoreAppService; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsStoreController"/> class. |
| | | /// </summary> |
| | | /// <param name="wmsstoreAppService">The wmsstore application service.</param> |
| | | public WmsStoreController(IWmsStoreAppService wmsstoreAppService) |
| | | { |
| | | _wmsstoreAppService = wmsstoreAppService; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åwmsstore. |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("{id}")] |
| | | public virtual Task<WmsStoreDto> GetAsync(Guid id) |
| | | { |
| | | return _wmsstoreAppService.GetAsync(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åwmsstoreçå表. |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | public virtual Task<PagedResultDto<WmsStoreDto>> GetListAsync([FromQuery] GetWmsStoresInput input) |
| | | { |
| | | return _wmsstoreAppService.GetListAsync(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å建wmsstore. |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPost] |
| | | public virtual Task<WmsStoreDto> CreateAsync(WmsStoreCreateDto input) |
| | | { |
| | | return _wmsstoreAppService.CreateAsync(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ´æ°wmsstore. |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPut] |
| | | [Route("{id}")] |
| | | public virtual Task<WmsStoreDto> UpdateAsync(Guid id, WmsStoreUpdateDto input) |
| | | { |
| | | return _wmsstoreAppService.UpdateAsync(id, input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å
éWmsStore. |
| | | /// </summary> |
| | | /// <param name="ids">Idéå.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPost] |
| | | [Route("Clone")] |
| | | public virtual Task<List<WmsStoreDto>> CloneAsync([FromBody] IEnumerable<Guid> ids) |
| | | { |
| | | return _wmsstoreAppService.CloneAsync(ids); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å é¤wmsstore. |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpDelete] |
| | | [Route("{id}")] |
| | | public virtual Task DeleteAsync(Guid id) |
| | | { |
| | | return _wmsstoreAppService.DeleteAsync(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¹éå é¤wmsstore. |
| | | /// </summary> |
| | | /// <param name="ids">The ids.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpDelete] |
| | | public virtual Task DeleteAsync([FromBody] IEnumerable<Guid> ids) |
| | | { |
| | | return _wmsstoreAppService.DeleteManyAsync(ids); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è°æ´æåº. |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | [HttpPut] |
| | | [Route("{id}/AdjustSort/{sort}")] |
| | | public virtual Task AdjustSortAsync(Guid id, int sort) |
| | | { |
| | | return _wmsstoreAppService.AdjustSortAsync(id, sort); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导å
¥wmsstore. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Authorize] |
| | | [HttpPost] |
| | | [Route("Import")] |
| | | public virtual async Task<IActionResult> ImportAsync(IFormFile file) |
| | | { |
| | | using var stream = new MemoryStream(); |
| | | await file.CopyToAsync(stream); |
| | | stream.Seek(0L, SeekOrigin.Begin); |
| | | |
| | | var sheetNames = stream.GetSheetNames(); |
| | | var wmsstoreRows = sheetNames.Contains("é
ç½®") ? MiniExcel.Query<WmsStoresImportModel.WmsStoreImportModel>(stream, sheetName: "é
ç½®").ToList() : new(); |
| | | |
| | | if (!wmsstoreRows.Any()) |
| | | { |
| | | throw new UserFriendlyException("è¯·æ£æ¥å¯¼å
¥çè¡¨æ ¼"); |
| | | } |
| | | |
| | | await _wmsstoreAppService.ImportAsync(new WmsStoresImportModel |
| | | { |
| | | WmsStores = wmsstoreRows, |
| | | }); |
| | | |
| | | return Ok(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导åºwmsstore. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("Export")] |
| | | public virtual async Task<IActionResult> ExportAsync([FromQuery] GetWmsStoresInput input) |
| | | { |
| | | input.MaxResultCount = int.MaxValue; |
| | | var exportData = await _wmsstoreAppService.ExportAsync(input); |
| | | var templatePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"Resources/Templates/WmsStoreå¯¼åºæ¨¡æ¿.xlsx"); |
| | | if (!System.IO.File.Exists(templatePath)) |
| | | { |
| | | templatePath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty, $"Resources/Templates/WmsStoreå¯¼åºæ¨¡æ¿.xlsx"); |
| | | } |
| | | |
| | | var memoryStream = new MemoryStream(); |
| | | await memoryStream.SaveAsByTemplateAsync(templatePath, exportData.Sheets); |
| | | memoryStream.Seek(0L, SeekOrigin.Begin); |
| | | return new FileStreamResult(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") { FileDownloadName = $"{exportData.FileName}_{DateTime.Now:yyyyMMddhhmmss}.xlsx" }; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.MesSuite.Abstractions.Events; |
| | | using CMS.Plugin.MesSuite.Abstractions.Models; |
| | | using CMS.Plugin.HIAWms.Domain.WmsContainers; |
| | | using CMS.Plugin.OrderManagement.Abstractions.Models; |
| | | using CMS.Plugin.ProcessManagement.Abstractions.Models; |
| | | using CMS.Plugin.TraceManagement.Abstractions.Models.Traces; |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Microsoft.Extensions.Logging; |
| | | using Volo.Abp.DependencyInjection; |
| | | using Volo.Abp.EventBus.Distributed; |
| | | using Volo.Abp.Uow; |
| | | |
| | | namespace CMS.Plugin.HIAWms.EventHandlers |
| | | { |
| | | /// <summary> |
| | | /// æµç¨äºä»¶å¤çç¨åº |
| | | /// </summary> |
| | | public class HIAWmsEventHandler : IDistributedEventHandler<ProcessFlowEto>, ITransientDependency |
| | | { |
| | | private readonly ILogger _logger; |
| | | private readonly IServiceProvider _serviceProvider; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="HIAWmsEventHandler"/> class. |
| | | /// </summary> |
| | | /// <param name="logger">The logger.</param> |
| | | /// <param name="serviceProvider">The service provider.</param> |
| | | public HIAWmsEventHandler(ILogger<HIAWmsEventHandler> logger, IServiceProvider serviceProvider) |
| | | { |
| | | this._logger = logger; |
| | | this._serviceProvider = serviceProvider; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Handler handles the event by implementing this method. |
| | | /// </summary> |
| | | /// <param name="eventData">Event data</param> |
| | | public async Task HandleEventAsync(ProcessFlowEto eventData) |
| | | { |
| | | if (eventData.Activity.Equals("æ¥éª¤åç§°")) |
| | | { |
| | | _logger.LogInformation($"WmsContainerEventHandler: Activity={eventData.Activity}"); |
| | | |
| | | var serialNumber = eventData?.FlowItems[FlowItemCollection.SerialNumber]?.ToString(); |
| | | |
| | | // å·¥èºæ¨¡å |
| | | var process = eventData?.FlowItems[FlowItemCollection.ApplicationData] as ProcessModel; |
| | | |
| | | // äº§åæ¨¡å |
| | | var product = eventData?.FlowItems[FlowItemCollection.ProductModel] as AssociationProductModel; |
| | | |
| | | // 追溯模å |
| | | var trace = eventData?.FlowItems[FlowItemCollection.TraceModel] as TraceModel; |
| | | |
| | | // 工忍¡å |
| | | var order = eventData?.FlowItems[FlowItemCollection.OrderModel] as OrderModel; |
| | | |
| | | // ä¸å¡å¤ç |
| | | await ProcessAsync(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Processes the asynchronous. |
| | | /// </summary> |
| | | private async Task ProcessAsync() |
| | | { |
| | | using var scope = _serviceProvider.CreateScope(); |
| | | var unitOfWorkManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>(); |
| | | using var uow = unitOfWorkManager.Begin(requiresNew: true); |
| | | var wmscontainerRepository = scope.ServiceProvider.GetRequiredService<IWmsContainerRepository>(); |
| | | var count = await wmscontainerRepository.GetCountAsync(); |
| | | |
| | | // å¦æææ´æ°æ°æ®åºæä½ï¼éæäº¤ä¿å |
| | | // await uow.SaveChangesAsync(); |
| | | |
| | | _logger.LogInformation($"ProcessAsyncï¼Count={count}"); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.FlowManagement.Abstractions; |
| | | using CMS.Plugin.FlowManagement.Abstractions.Models; |
| | | using CMS.Plugin.MesSuite.Abstractions.Models; |
| | | using CMS.Plugin.HIAWms.Domain.WmsContainers; |
| | | using CMS.Plugin.OrderManagement.Abstractions.Models; |
| | | using CMS.Plugin.ProcessManagement.Abstractions.Models; |
| | | using CMS.Plugin.TraceManagement.Abstractions.Models.Traces; |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Microsoft.Extensions.Logging; |
| | | using SYC.Flow.Kernel; |
| | | using Volo.Abp.DependencyInjection; |
| | | using Volo.Abp.Uow; |
| | | |
| | | namespace CMS.Plugin.HIAWms.FlowProcessors |
| | | { |
| | | /// <summary> |
| | | /// æµç¨å¤çå¨ |
| | | /// </summary> |
| | | public class HIAWmsFlowProcessor : IFlowProcessor, ISingletonDependency |
| | | { |
| | | private readonly ILogger<HIAWmsFlowProcessor> _logger; |
| | | private readonly IServiceProvider _serviceProvider; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="FlowProcessor"/> class. |
| | | /// </summary> |
| | | public HIAWmsFlowProcessor(ILogger<HIAWmsFlowProcessor> logger, IServiceProvider serviceProvider) |
| | | { |
| | | _logger = logger; |
| | | _serviceProvider = serviceProvider; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public Task OnEnterAsync(FlowProcessor flowProcessor, object sender, EventArgs args) |
| | | { |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task OnExecuteAsync(FlowProcessor flowProcessor, object sender, EventArgs args) |
| | | { |
| | | if (sender is Activity activity) |
| | | { |
| | | var eventArgs = args as ProcessflowEventArgs; |
| | | var procID = eventArgs.DataItems["Instance_ProcID"]; |
| | | if (activity?.Name == "ç¬¬ä¸æ¹ç³»ç»åæ ¼å¤æ") |
| | | { |
| | | // å·¥èºæ¨¡å |
| | | var processModel = eventArgs.DataItems.ApplicationData as ProcessModel; |
| | | |
| | | // 工忍¡å |
| | | var orderModel = eventArgs.DataItems[FlowItemCollection.OrderModel] as OrderModel; |
| | | |
| | | // äº§åæ¨¡å |
| | | var productModel = eventArgs.DataItems[FlowItemCollection.ProductModel] as AssociationProductModel; |
| | | |
| | | // 追溯模å |
| | | var traceModel = eventArgs.DataItems[FlowItemCollection.TraceModel] as TraceModel; |
| | | |
| | | // ä¸å¡å¤ç |
| | | await ProcessAsync(); |
| | | |
| | | _logger.LogInformation($"æ§è¡æµç¨ï¼å®ä¾={procID} -> {flowProcessor.ProcName} -> {activity.Name} ProductionFlowProcessor"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Processes the asynchronous. |
| | | /// </summary> |
| | | private async Task ProcessAsync() |
| | | { |
| | | using var scope = _serviceProvider.CreateScope(); |
| | | var unitOfWorkManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>(); |
| | | using var uow = unitOfWorkManager.Begin(requiresNew: true); |
| | | var wmscontainerRepository = scope.ServiceProvider.GetRequiredService<IWmsContainerRepository>(); |
| | | var count = await wmscontainerRepository.GetCountAsync(); |
| | | |
| | | // å¦æææ´æ°æ°æ®åºæä½ï¼éæäº¤ä¿å |
| | | // await uow.SaveChangesAsync(); |
| | | |
| | | _logger.LogInformation($"ProcessAsyncï¼Count={count}"); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public Task OnExitAsync(FlowProcessor flowProcessor, object sender, EventArgs args) |
| | | { |
| | | return Task.CompletedTask; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <ProcessflowDefine Version="1"> |
| | | <Define> |
| | | <ProcessflowBuilder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> |
| | | <Parameters/> |
| | | <Name>HIAWmsä¸å¡æµç¨</Name> |
| | | <Description></Description> |
| | | <Root xsi:type="Activity"> |
| | | <Alias>å¯å¨</Alias> |
| | | <Name>å¯å¨</Name> |
| | | <Description></Description> |
| | | <EnterMode>Automatic</EnterMode> |
| | | <ExitMode>Automatic</ExitMode> |
| | | <JoinType>JoinXOR</JoinType> |
| | | <SplitType>SplitXOR</SplitType> |
| | | <ExtendedProperty></ExtendedProperty> |
| | | </Root> |
| | | <Activities> |
| | | <Activity xsi:type="VariableMonitorActivity"> |
| | | <Alias>åéçå¬</Alias> |
| | | <Name>触åä¿¡å·çå¬</Name> |
| | | <EnterMode>Automatic</EnterMode> |
| | | <ExitMode>Automatic</ExitMode> |
| | | <JoinType>JoinXOR</JoinType> |
| | | <SplitType>SplitXOR</SplitType> |
| | | <NeedTagChange>true</NeedTagChange> |
| | | <TaskDelay>0</TaskDelay> |
| | | <MonitorVariableName>HIAWms_TriggerSignal</MonitorVariableName> |
| | | <CompareVariableValue>1</CompareVariableValue> |
| | | <ExtendedProperty></ExtendedProperty> |
| | | </Activity> |
| | | <Activity xsi:type="VariableReadActivity"> |
| | | <Alias>åé读å</Alias> |
| | | <Name>åé读å</Name> |
| | | <EnterMode>Automatic</EnterMode> |
| | | <ExitMode>Automatic</ExitMode> |
| | | <JoinType>JoinXOR</JoinType> |
| | | <SplitType>SplitXOR</SplitType> |
| | | <TaskDelay>0</TaskDelay> |
| | | <ReadRetryCount>10</ReadRetryCount> |
| | | <ReadRetryDelay>500</ReadRetryDelay> |
| | | <ExtendedProperty></ExtendedProperty> |
| | | <ParameterVariables> |
| | | <ReadParameterVariable> |
| | | <VariableName>HIAWms_BarcodeVariable</VariableName> |
| | | <WriteIntoExtAttribute>true</WriteIntoExtAttribute> |
| | | </ReadParameterVariable> |
| | | </ParameterVariables> |
| | | </Activity> |
| | | <Activity xsi:type="HIAWmsActivity"> |
| | | <Alias>åéçå¬</Alias> |
| | | <Name>æ©å±æ¥éª¤</Name> |
| | | <EnterMode>Automatic</EnterMode> |
| | | <ExitMode>Automatic</ExitMode> |
| | | <JoinType>JoinXOR</JoinType> |
| | | <SplitType>SplitXOR</SplitType> |
| | | <TaskDelay>0</TaskDelay> |
| | | <MyProperty>MyProperty1</MyProperty> |
| | | <ExtendedProperty></ExtendedProperty> |
| | | </Activity> |
| | | <Activity xsi:type="VariableMonitorActivity"> |
| | | <Alias>åéçå¬</Alias> |
| | | <Name>触åä¿¡å·å¤ä½çå¬</Name> |
| | | <EnterMode>Automatic</EnterMode> |
| | | <ExitMode>Automatic</ExitMode> |
| | | <JoinType>JoinXOR</JoinType> |
| | | <SplitType>SplitXOR</SplitType> |
| | | <NeedTagChange>true</NeedTagChange> |
| | | <TaskDelay>0</TaskDelay> |
| | | <MonitorVariableName>HIAWms_TriggerSignal</MonitorVariableName> |
| | | <CompareVariableValue>0</CompareVariableValue> |
| | | <ExtendedProperty></ExtendedProperty> |
| | | </Activity> |
| | | <Activity xsi:type="BusinessActivity"> |
| | | <Alias>éç¨æ¥éª¤</Alias> |
| | | <Name>éç¨æ¥éª¤</Name> |
| | | <EnterMode>Automatic</EnterMode> |
| | | <ExitMode>Automatic</ExitMode> |
| | | <JoinType>JoinXOR</JoinType> |
| | | <SplitType>SplitXOR</SplitType> |
| | | <PublishFlowEvent>true</PublishFlowEvent> |
| | | <TaskDelay>0</TaskDelay> |
| | | <ExtendedProperty> |
| | | <MyExtendedProperty>MyExtendedProperty1</MyExtendedProperty> |
| | | </ExtendedProperty> |
| | | </Activity> |
| | | <Activity xsi:type="VariableWriteActivity"> |
| | | <Alias>åéä¸å</Alias> |
| | | <Name>åéä¸å</Name> |
| | | <EnterMode>Automatic</EnterMode> |
| | | <ExitMode>Automatic</ExitMode> |
| | | <JoinType>JoinXOR</JoinType> |
| | | <SplitType>SplitXOR</SplitType> |
| | | <TaskDelay>0</TaskDelay> |
| | | <WriteRetryCount>10</WriteRetryCount> |
| | | <WriteRetryDelay>500</WriteRetryDelay> |
| | | <ParameterVariables> |
| | | <WriteParameterVariable> |
| | | <Sort>1</Sort> |
| | | <WriteVariableName>HIAWms_BarcodeVariable</WriteVariableName> |
| | | <WriteVariableValue></WriteVariableValue> |
| | | </WriteParameterVariable> |
| | | </ParameterVariables> |
| | | <ExtendedProperty></ExtendedProperty> |
| | | </Activity> |
| | | <Activity xsi:type="EndActivity"> |
| | | <Alias>ç»æ</Alias> |
| | | <Name>ç»æ</Name> |
| | | <EnterMode>Automatic</EnterMode> |
| | | <ExitMode>Automatic</ExitMode> |
| | | <JoinType>JoinXOR</JoinType> |
| | | <SplitType>SplitXOR</SplitType> |
| | | <ExtendedProperty></ExtendedProperty> |
| | | </Activity> |
| | | </Activities> |
| | | <Transitions> |
| | | <Transition> |
| | | <Label>å¯å¨->触åä¿¡å·çå¬</Label> |
| | | <Source>å¯å¨</Source> |
| | | <Sink>触åä¿¡å·çå¬</Sink> |
| | | </Transition> |
| | | <Transition> |
| | | <Label>触åä¿¡å·çå¬->åé读å</Label> |
| | | <Source>触åä¿¡å·çå¬</Source> |
| | | <Sink>åé读å</Sink> |
| | | </Transition> |
| | | <Transition> |
| | | <Label>åé读å->æ©å±æ¥éª¤</Label> |
| | | <Source>åé读å</Source> |
| | | <Sink>æ©å±æ¥éª¤</Sink> |
| | | </Transition> |
| | | <Transition> |
| | | <Label>æ©å±æ¥éª¤->触åä¿¡å·å¤ä½çå¬</Label> |
| | | <Source>æ©å±æ¥éª¤</Source> |
| | | <Sink>触åä¿¡å·å¤ä½çå¬</Sink> |
| | | </Transition> |
| | | <Transition> |
| | | <Label>触åä¿¡å·å¤ä½çå¬->éç¨æ¥éª¤</Label> |
| | | <Source>触åä¿¡å·å¤ä½çå¬</Source> |
| | | <Sink>éç¨æ¥éª¤</Sink> |
| | | </Transition> |
| | | <Transition> |
| | | <Label>éç¨æ¥éª¤->åéä¸å</Label> |
| | | <Source>éç¨æ¥éª¤</Source> |
| | | <Sink>åéä¸å</Sink> |
| | | </Transition> |
| | | <Transition> |
| | | <Label>åéä¸å->ç»æ</Label> |
| | | <Source>åéä¸å</Source> |
| | | <Sink>ç»æ</Sink> |
| | | </Transition> |
| | | </Transitions> |
| | | </ProcessflowBuilder> |
| | | </Define> |
| | | <Appearance> |
| | | <ProcessflowAppearance xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> |
| | | </ProcessflowAppearance> |
| | | </Appearance> |
| | | </ProcessflowDefine> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <Root> |
| | | <FlowInfo> |
| | | <Type>50001</Type> |
| | | <Name>æµè¯æµç¨</Name> |
| | | <Description></Description> |
| | | <Version>1</Version> |
| | | <FilePath>FlowPfd/50001_1.pfd</FilePath> |
| | | <BusinessType> |
| | | <Name>Other</Name> |
| | | <Value>1</Value> |
| | | <Description>æµè¯æµç¨</Description> |
| | | </BusinessType> |
| | | </FlowInfo> |
| | | </Root> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
| | | <ConfigureAwait ContinueOnCapturedContext="false" /> |
| | | </Weavers> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Jobs |
| | | { |
| | | /// <summary> |
| | | /// HIAWms ä½ä¸åæ° |
| | | /// </summary> |
| | | public class HIAWmsArgs |
| | | { |
| | | /// <summary> |
| | | /// Gets or sets the subject. |
| | | /// </summary> |
| | | public string Subject { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Gets or sets the body. |
| | | /// </summary> |
| | | public string Body { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.WmsContainers; |
| | | using Microsoft.Extensions.Logging; |
| | | using Volo.Abp.BackgroundJobs; |
| | | using Volo.Abp.DependencyInjection; |
| | | using Volo.Abp.Uow; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Jobs |
| | | { |
| | | /// <summary> |
| | | /// HIAWms åå°ä½ä¸ |
| | | /// </summary> |
| | | public class HIAWmsJob : BackgroundJob<HIAWmsArgs>, ITransientDependency |
| | | { |
| | | private readonly ILogger<HIAWmsJob> _logger; |
| | | private readonly IUnitOfWorkManager _unitOfWorkManager; |
| | | private readonly IWmsContainerRepository _wmscontainerRepository; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="HIAWmsJob"/> class. |
| | | /// </summary> |
| | | /// <param name="logger">The logger.</param> |
| | | /// <param name="unitOfWorkManager">The unit of work manager.</param> |
| | | /// <param name="wmscontainerRepository">My entity name repository.</param> |
| | | public HIAWmsJob(ILogger<HIAWmsJob> logger, IUnitOfWorkManager unitOfWorkManager, IWmsContainerRepository wmscontainerRepository) |
| | | { |
| | | _logger = logger; |
| | | _unitOfWorkManager = unitOfWorkManager; |
| | | _wmscontainerRepository = wmscontainerRepository; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public override void Execute(HIAWmsArgs args) |
| | | { |
| | | using var uow = _unitOfWorkManager.Begin(requiresNew: true); |
| | | var count = _wmscontainerRepository.GetCountAsync().GetAwaiter().GetResult(); |
| | | |
| | | // å¦æææ´æ°æ°æ®åºæä½ï¼éæäº¤ä¿å |
| | | // uow.SaveChangesAsync().GetAwaiter().GetResult(); |
| | | |
| | | _logger.LogInformation($"HIAWmsJob Executeï¼Subject={args.Subject}ï¼Body={args.Body}ï¼Count={count}"); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.FlowManagement.Abstractions.FlowBusiness; |
| | | using CMS.Plugin.HIAWms.Apis; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers; |
| | | using CMS.Plugin.HIAWms.Domain.WmsContainers; |
| | | using CMS.Plugin.HIAWms.Jobs; |
| | | using CMS.Project; |
| | | using CMS.Project.Abstractions; |
| | | using CMS.Unit.RuntimeValue.Abstractions; |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Microsoft.Extensions.Logging; |
| | | using Volo.Abp.BackgroundJobs; |
| | | using Volo.Abp.Uow; |
| | | |
| | | namespace CMS.Plugin.HIAWms.ProjectService |
| | | { |
| | | /// <summary> |
| | | /// å·¥ç¨æå¡ï¼åå·¥ç¨å
³èçåå°æå¡ï¼å½<see cref="IProjectServiceRunner"/>以å½åKeyè°ç¨æ¶ä¼è¢«æ§è¡ |
| | | /// </summary> |
| | | public class HIAWmsProjectService : BaseProjectService |
| | | { |
| | | private IServiceProvider _serviceProvider; |
| | | private readonly ILogger<HIAWmsProjectService> _logger; |
| | | private readonly IVariableDataCache _variableDataCache; |
| | | private FlowVariableChannelListener _channelListener; |
| | | private Dictionary<string, string> _monitorVariableNames; |
| | | |
| | | /// <summary> |
| | | /// æå¡çKeyï¼å¯ä¸ï¼ä¾<see cref="IProjectServiceRunner"/>ä½¿ç¨ |
| | | /// </summary> |
| | | public override string Key => "HIAWms"; |
| | | |
| | | /// <summary> |
| | | /// æå¡æè¿°ï¼æ¾ç¤ºå¨æå¡å表UIä¸çåç§° |
| | | /// </summary> |
| | | public override string Description => "HIAWmsæå¡"; |
| | | |
| | | /// <summary> |
| | | /// å¯ç¨ææ |
| | | /// </summary> |
| | | public override bool AuthRequired => false; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="HIAWmsProjectService"/> class. |
| | | /// </summary> |
| | | /// <param name="logger">The logger.</param> |
| | | /// <param name="variableDataCache">The variable data cache.</param> |
| | | public HIAWmsProjectService(IServiceProvider serviceProvider, ILogger<HIAWmsProjectService> logger, IVariableDataCache variableDataCache) |
| | | { |
| | | _serviceProvider = serviceProvider; |
| | | _logger = logger; |
| | | _variableDataCache = variableDataCache; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¼å¯æå¡ |
| | | /// </summary> |
| | | /// <param name="serviceProvider">å
·æå·¥ç¨ä¸ä¸æçå®ä¾</param> |
| | | public override async Task StartAsync(IServiceProvider serviceProvider) |
| | | { |
| | | if (State == ProjectServiceState.Started) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | // çå¬åé |
| | | _monitorVariableNames = new Dictionary<string, string> |
| | | { |
| | | { "HIAWms_Variable1", "çå¬åé1" }, |
| | | { "HIAWms_Variable2", "çå¬åé2" } |
| | | }; |
| | | |
| | | // å建ééçå¬ |
| | | _channelListener?.Token?.Dispose(); |
| | | _channelListener = new FlowVariableChannelListener(_logger, _variableDataCache); |
| | | _channelListener.CreateChannel(Key, waitListener: false, timeout: TimeSpan.FromSeconds(30), variableFilter: _monitorVariableNames.Keys.ToHashSet()); |
| | | _channelListener.TagChanged += OnTagValueChanged; |
| | | |
| | | await base.StartAsync(serviceProvider); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 忢æå¡ |
| | | /// </summary> |
| | | /// <param name="serviceProvider">å
·æå·¥ç¨ä¸ä¸æçå®ä¾</param> |
| | | public override async Task StopAsync(IServiceProvider serviceProvider) |
| | | { |
| | | if (_channelListener != null) |
| | | { |
| | | // éæ¾çå¬ |
| | | _channelListener.TagChanged -= OnTagValueChanged; |
| | | _channelListener.Token.Dispose(); |
| | | _channelListener = null; |
| | | } |
| | | |
| | | // 使ç¨åå°ä½ä¸å¼æ¥å¤ç |
| | | //await _serviceProvider.GetRequiredService<IBackgroundJobManager>().EnqueueAsync(new HIAWmsArgs |
| | | //{ |
| | | // Subject = "HIAWms_Subject", |
| | | // Body = "HIAWms_Body", |
| | | //}); |
| | | |
| | | |
| | | await base.StopAsync(serviceProvider); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Called when [tag value changed]. |
| | | /// </summary> |
| | | /// <param name="sender">The sender.</param> |
| | | /// <param name="e">The <see cref="TagChangedEventArgs"/> instance containing the event data.</param> |
| | | private async void OnTagValueChanged(object sender, TagChangedEventArgs e) |
| | | { |
| | | var changeds = e.Changeds.Where(x => _monitorVariableNames != null && _monitorVariableNames.ContainsKey(x.Name)); |
| | | if (!changeds.Any()) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | foreach (var changed in changeds) |
| | | { |
| | | var oldValue = changed.Old?.Value; |
| | | var newValue = changed.New?.Value; |
| | | var traceId = e.TraceId; |
| | | |
| | | _logger.LogInformation($"{changed.Name} åéå¼åçååï¼æ§å¼{oldValue}=æ°å¼{newValue}ï¼TraceId={traceId}"); |
| | | |
| | | // TODO: å¤çåéå¼åå |
| | | // Tipsï¼https://cms-docs.shengyc.com/cms/api/%E5%90%8E%E7%AB%AF#3-%E5%8F%98%E9%87%8F%E6%A8%A1%E5%9D%97 |
| | | /* 说æï¼éè¿è®¢é
IVariableDataCache.TagChanged äºä»¶ï¼æ¨å¯ä»¥å®æ¶çæ§åéçååãæ¤äºä»¶ä¼ä¼ éææåéè³äºä»¶å¤ç彿°ï¼å æ¤ï¼ä¸å¡å±éå¨å½æ°ä¸çéå
³æ³¨çåéã |
| | | 注æäºé¡¹ï¼ |
| | | ï¼1ï¼æ§è½å½±åï¼ åå¸äºä»¶æ¶ï¼äºä»¶çåéè
å°é»å¡æµç¨ãå æ¤ï¼å¼ºç建议é¿å
å¨äºä»¶å¤ç彿°ä¸æ§è¡ I/ O æä½ãHTTP æ¥å£è®¿é®æå
¶ä»èæ¶æä½ï¼ä»¥é²æ¢å¯¹ç³»ç»æ§è½äº§ç严éå½±åï¼å¯¼è´æ´ä¸ªç³»ç»ååºå»¶è¿ã |
| | | ï¼2ï¼é«é¢ç触åï¼ ç±äºäºä»¶è®¢é
äºå
¨éåéï¼è§¦åé¢çå¯è½é常é«ã |
| | | ï¼3ï¼å¼æ¥å¤çï¼ é´äºäºä»¶è§¦åé¢çå¾é«ï¼å»ºè®®ä¸å¡å±å¨çéå
³æ³¨åéåï¼ä½¿ç¨ Task å¯å¨æ°çº¿ç¨å¤çä¸å¡é»è¾ï¼ä»¥é¿å
é»å¡æ ¸å¿çåéçå¬åè½ï¼å®ç°ä¸å¡å±ä¸å¹³å°åºåº§çè§£è¦ã |
| | | ï¼4ï¼å¹¶å管çï¼ å¦æä¸å¡å±å¹¶åé大ï¼å¿
é¡»ä¼å代ç 设计å宿½ï¼ä»¥åå°å¨é«å¹¶åæ
åµä¸çç³»ç»èµæºæ¶èï¼é²æ¢ç³»ç»æ§è½é®é¢ã |
| | | ï¼5ï¼ä»£ç å®å
¨ï¼ å®è£
å¹¶ä½¿ç¨ CMS.CodeAnalysis åæå¨æ¥åæ IVariableDataCache.TagChanged çä½¿ç¨æ
åµã该工å
·è½å¨ä½¿ç¨ä¸å½æ¶æä¾ç¼è¯é误ï¼å¸®å©æ¨æé«ä»£ç è´¨éã*/ |
| | | |
| | | _ = Task.Run(async () => |
| | | { |
| | | // ä¾1ï¼åæ¥å¤ç |
| | | //await ProcessAsync(); |
| | | |
| | | // ä¾2ï¼è°ç¨å¤é¨API |
| | | //await ExecuteExternalApiAsync(); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Processes the asynchronous. |
| | | /// </summary> |
| | | private async Task ProcessAsync() |
| | | { |
| | | using var scope = _serviceProvider.CreateScope(); |
| | | var unitOfWorkManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>(); |
| | | using var uow = unitOfWorkManager.Begin(requiresNew: true); |
| | | var wmscontainerRepository = scope.ServiceProvider.GetRequiredService<IWmsContainerRepository>(); |
| | | var count = await wmscontainerRepository.GetCountAsync(); |
| | | |
| | | // å¦æææ´æ°æ°æ®åºæä½ï¼éæäº¤ä¿å |
| | | // await uow.SaveChangesAsync(); |
| | | |
| | | _logger.LogInformation($"ProcessAsyncï¼Count={count}"); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "profiles": { |
| | | "DebugFromCMS": { |
| | | "commandName": "Executable", |
| | | "executablePath": "$(CMSRootPath)\\host\\CMS.Host.exe", |
| | | "workingDirectory": "$(CMSRootPath)\\host", |
| | | "commandLineArgs":"-d", |
| | | "environmentVariables": { |
| | | "DOTNET_ENVIRONMENT": "Development", |
| | | "ASPNETCORE_URLS": "http://*:18000", |
| | | "PluginPath": "../plugins", |
| | | "DatabaseType": "MySQL" |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Abstractions; |
| | | using CMS.Plugin.HIAWms.Domain.WmsContainers; |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Microsoft.Extensions.Logging; |
| | | using SYC.Flow.Kernel; |
| | | using Volo.Abp.DependencyInjection; |
| | | using Volo.Abp.Uow; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Services |
| | | { |
| | | /// <inheritdoc /> |
| | | public class HIAWmsFlowService : IHIAWmsFlowService, ITransientDependency |
| | | { |
| | | private readonly ILogger<HIAWmsFlowService> _logger; |
| | | private readonly IServiceProvider _serviceProvider; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="HIAWmsFlowService"/> class. |
| | | /// </summary> |
| | | /// <param name="logger">The logger.</param> |
| | | public HIAWmsFlowService(ILogger<HIAWmsFlowService> logger, IServiceProvider serviceProvider) |
| | | { |
| | | _logger = logger; |
| | | _serviceProvider = serviceProvider; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task ProcessAsync(ProcessflowEventArgs args) |
| | | { |
| | | using var scope = _serviceProvider.CreateScope(); |
| | | var unitOfWorkManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>(); |
| | | using var uow = unitOfWorkManager.Begin(requiresNew: true); |
| | | var wmscontainerRepository = scope.ServiceProvider.GetRequiredService<IWmsContainerRepository>(); |
| | | var count = await wmscontainerRepository.GetCountAsync(); |
| | | |
| | | // å¦æææ´æ°æ°æ®åºæä½ï¼éæäº¤ä¿å |
| | | // await uow.SaveChangesAsync(); |
| | | |
| | | // è¾åºæ¥å¿ |
| | | _logger.LogInformation($"HIAWmsFlowServiceï¼ProcessAsync()"); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Extensions.Variable; |
| | | using CMS.Project.Abstractions; |
| | | using KissUtil.Extensions; |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Microsoft.Extensions.Logging; |
| | | using Volo.Abp.BackgroundWorkers; |
| | | using Volo.Abp.Threading; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Workers |
| | | { |
| | | /// <summary> |
| | | /// HIAWmsåå°å·¥ä½è
|
| | | /// </summary> |
| | | public class HIAWmsWorker : AsyncPeriodicBackgroundWorkerBase |
| | | { |
| | | private readonly ILogger<HIAWmsWorker> _logger; |
| | | private readonly VariableService _variableService; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="HIAWmsWorker"/> class. |
| | | /// </summary> |
| | | /// <param name="timer">The timer.</param> |
| | | /// <param name="serviceScopeFactory">The service scope factory.</param> |
| | | public HIAWmsWorker(ILogger<HIAWmsWorker> logger, AbpAsyncTimer timer, VariableService variableService, IServiceScopeFactory serviceScopeFactory) : base(timer, serviceScopeFactory) |
| | | { |
| | | _logger = logger; |
| | | _variableService = variableService; |
| | | Timer.Period = 1 * 300 * 1000; // æ¯é 300 ç§ æ§è¡ä¸æ¬¡ |
| | | Timer.RunOnStart = true; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) |
| | | { |
| | | var projectAccessor = workerContext.ServiceProvider.GetRequiredService<IProjectAccessor>(); |
| | | var project = await projectAccessor.GetProjectAsync(); |
| | | if (project?.Info == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | //_logger.LogInformation($"HIAWmsWorker is working for project {project.Info.Id}"); |
| | | |
| | | //// 计ç®OEE |
| | | //double oee = await CalculateOEEAsync(); |
| | | |
| | | //// 使ç¨ç¾åæ¯æ ¼å¼ æå°ç»ææ¥å¿ |
| | | //_logger.LogInformation($"OEE:{oee:P2}"); |
| | | |
| | | //// åå
¥åé |
| | | //await _variableService.WriteValueAsync(new Dictionary<string, object> {{ "OEE", oee } }); |
| | | } |
| | | |
| | | // 计ç®OEE=å¯ç¨æ§Ãæ§è½Ãè´¨é |
| | | public async Task<double> CalculateOEEAsync() |
| | | { |
| | | // 读åOEEè®¡ç®æéçå¼ |
| | | double availability = await ReadDoubleValueAsync("Availability"); |
| | | double performance = await ReadDoubleValueAsync("Performance"); |
| | | double quality = await ReadDoubleValueAsync("Quality"); |
| | | |
| | | // 计ç®OEE |
| | | double oee = availability * performance * quality; |
| | | |
| | | // è¿å计ç®ç»æ |
| | | return oee; |
| | | } |
| | | |
| | | // æä¾ä¸ä¸ªæ³åæ¹æ³ï¼æ¹ä¾¿ç´æ¥è·ådoubleç±»åçå¼ |
| | | public async Task<double> ReadDoubleValueAsync(string variableName) |
| | | { |
| | | var variable = await _variableService.ReadValueAsync(variableName); |
| | | return (variable?.Content?.Value).SafeString().ToDoubleOrNull().GetValueOrDefault(); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | // é
ç½®æä»¶å°½å¯è½åå¨/host/appsettings.jsonææ°æ®åºä¸ï¼é¿å
æä»¶å级æ¶è¢«è¦ç |
| | | "IHIAWmsExternalApi": { |
| | | "HttpHost": "http://127.0.0.1:18000/" // External API对æ¥å°å |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", |
| | | "settings": { |
| | | "orderingRules": { |
| | | "systemUsingDirectivesFirst": false, |
| | | "usingDirectivesPlacement": "outsideNamespace", |
| | | "blankLinesBetweenUsingGroups": "omit" |
| | | }, |
| | | "namingRules": { |
| | | "allowCommonHungarianPrefixes": false, |
| | | "allowedNamespaceComponents": [ |
| | | "iOS" |
| | | ], |
| | | "includeInferredTupleElementNames": true |
| | | }, |
| | | "maintainabilityRules": { |
| | | "topLevelTypes": [ |
| | | "class", |
| | | "interface", |
| | | "struct" |
| | | ] |
| | | }, |
| | | "layoutRules": { |
| | | "newlineAtEndOfFile": "require" |
| | | }, |
| | | "documentationRules": { |
| | | "companyName": "广å·çåæç§ææéå
¬å¸", |
| | | "copyrightText": "Copyright (c) {companyName}. All rights reserved." |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | <Import Project="../../common.test.props" /> |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\..\src\CMS.Plugin.HIAWms.Application\CMS.Plugin.HIAWms.Application.csproj" /> |
| | | <ProjectReference Include="..\CMS.Plugin.HIAWms.Domain.Tests\CMS.Plugin.HIAWms.Domain.Tests.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore; |
| | | using CMS.Plugin.HIAWms.MySQL; |
| | | using CMS.Plugin.HIAWms.TestBase; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Tests |
| | | { |
| | | /// <summary> |
| | | /// HIAWmsApplicationTestBase |
| | | /// </summary> |
| | | public class HIAWmsApplicationTestBase : HIAWmsTestBase<HIAWmsApplicationTestModule> |
| | | { |
| | | /// <summary> |
| | | /// UsingDbContext |
| | | /// </summary> |
| | | /// <param name="action">IHIAWmsDbContext</param> |
| | | protected virtual void UsingDbContext(Action<CMSPluginDbContext> action) |
| | | { |
| | | using (var dbContext = GetRequiredService<CMSPluginDbContext>()) |
| | | { |
| | | action.Invoke(dbContext); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// UsingDbContext |
| | | /// </summary> |
| | | /// <typeparam name="T">T</typeparam> |
| | | /// <param name="action">IHIAWmsDbContext</param> |
| | | /// <returns>T</returns> |
| | | protected virtual T UsingDbContext<T>(Func<CMSPluginDbContext, T> action) |
| | | { |
| | | using (var dbContext = GetRequiredService<CMSPluginDbContext>()) |
| | | { |
| | | return action.Invoke(dbContext); |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Tests; |
| | | using Volo.Abp.Modularity; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Tests |
| | | { |
| | | /// <summary> |
| | | /// HIAWmsApplicationTestModule |
| | | /// </summary> |
| | | [DependsOn( |
| | | typeof(CMSPluginApplicationModule), |
| | | typeof(HIAWmsDomainTestModule))] |
| | | public class HIAWmsApplicationTestModule : AbpModule |
| | | { |
| | | public override void ConfigureServices(ServiceConfigurationContext context) |
| | | { |
| | | base.ConfigureServices(context); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | <Import Project="../../common.test.props" /> |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\CMS.Plugin.HIAWms.EntityFrameworkCore.Tests\CMS.Plugin.HIAWms.EntityFrameworkCore.Tests.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore; |
| | | using CMS.Plugin.HIAWms.MySQL; |
| | | using CMS.Plugin.HIAWms.TestBase; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Tests |
| | | { |
| | | /// <summary> |
| | | /// HIAWms DomainTestBase |
| | | /// </summary> |
| | | public class HIAWmsDomainTestBase : HIAWmsTestBase<HIAWmsDomainTestModule> |
| | | { |
| | | /// <summary> |
| | | /// UsingDbContext |
| | | /// </summary> |
| | | /// <param name="action">IHIAWmsDbContext</param> |
| | | protected virtual void UsingDbContext(Action<CMSPluginDbContext> action) |
| | | { |
| | | using (var dbContext = GetRequiredService<CMSPluginDbContext>()) |
| | | { |
| | | action.Invoke(dbContext); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// UsingDbContext |
| | | /// </summary> |
| | | /// <typeparam name="T">T</typeparam> |
| | | /// <param name="action">IHIAWmsDbContext</param> |
| | | /// <returns>T</returns> |
| | | protected virtual T UsingDbContext<T>(Func<CMSPluginDbContext, T> action) |
| | | { |
| | | using (var dbContext = GetRequiredService<CMSPluginDbContext>()) |
| | | { |
| | | return action.Invoke(dbContext); |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore.Tests; |
| | | using Volo.Abp.Modularity; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.Tests |
| | | { |
| | | /// <summary> |
| | | /// HIAWms DomainTestModule |
| | | /// </summary> |
| | | [DependsOn(typeof(HIAWmsTestEntityFrameworkCoreModule))] |
| | | public class HIAWmsDomainTestModule : AbpModule |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | <Import Project="../../common.test.props" /> |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="$(ABPPackageVersion)" /> |
| | | <PackageReference Include="Volo.Abp.EntityFrameworkCore.Sqlite" Version="$(ABPPackageVersion)" /> |
| | | <PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" /> |
| | | <PackageReference Include="NSubstitute" Version="$(NSubstitutePackageVersion)" /> |
| | | <PackageReference Include="Shouldly" Version="$(ShouldlyPackageVersion)" /> |
| | | <PackageReference Include="xunit" Version="$(xUnitPackageVersion)" /> |
| | | <PackageReference Include="xunit.extensibility.execution" Version="$(xUnitExtensibilityExecutionPackageVersion)" /> |
| | | <PackageReference Include="xunit.runner.visualstudio" Version="$(xUnitRunnerVisualstudioPackageVersion)" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\..\src\CMS.Plugin.HIAWms.EntityFrameworkCore\CMS.Plugin.HIAWms.EntityFrameworkCore.csproj" /> |
| | | <ProjectReference Include="..\..\src\CMS.Plugin.HIAWms.MySQL\CMS.Plugin.HIAWms.MySQL.csproj" /> |
| | | <ProjectReference Include="..\CMS.Plugin.HIAWms.TestBase\CMS.Plugin.HIAWms.TestBase.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.TestBase; |
| | | |
| | | namespace CMS.Plugin.HIAWms.EntityFrameworkCore.Tests |
| | | { |
| | | /// <summary> |
| | | /// MyProjectName TestBase |
| | | /// </summary> |
| | | public class HIAWmsEntityFrameworkTestBase : HIAWmsTestBase<HIAWmsTestEntityFrameworkCoreModule> |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.MySQL; |
| | | using CMS.Plugin.HIAWms.TestBase; |
| | | using Microsoft.Data.Sqlite; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Microsoft.EntityFrameworkCore.Infrastructure; |
| | | using Microsoft.EntityFrameworkCore.Storage; |
| | | using Volo.Abp.EntityFrameworkCore; |
| | | using Volo.Abp.EntityFrameworkCore.Sqlite; |
| | | using Volo.Abp.Modularity; |
| | | |
| | | namespace CMS.Plugin.HIAWms.EntityFrameworkCore.Tests |
| | | { |
| | | /// <summary> |
| | | /// MyProjectName TestEntityFrameworkCoreModule |
| | | /// </summary> |
| | | [DependsOn( |
| | | typeof(HIAWmsTestBaseModule), |
| | | typeof(CMSPluginEntityFrameworkCoreModule), |
| | | typeof(AbpEntityFrameworkCoreSqliteModule))] |
| | | public class HIAWmsTestEntityFrameworkCoreModule : AbpModule |
| | | { |
| | | /// <summary> |
| | | /// ConfigureServices |
| | | /// </summary> |
| | | /// <param name="context">ServiceConfigurationContext</param> |
| | | public override void ConfigureServices(ServiceConfigurationContext context) |
| | | { |
| | | var sqliteConnection = CreateDatabaseAndGetConnection(); |
| | | |
| | | Configure<AbpDbContextOptions>(options => |
| | | { |
| | | options.Configure(dbContextConfigurationContext => |
| | | { |
| | | dbContextConfigurationContext.DbContextOptions.UseSqlite(sqliteConnection); |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | private static SqliteConnection CreateDatabaseAndGetConnection() |
| | | { |
| | | var connection = new SqliteConnection("Data Source=:memory:"); |
| | | connection.Open(); |
| | | |
| | | new CMSPluginDbContext( |
| | | new DbContextOptionsBuilder<CMSPluginDbContext>().UseSqlite(connection).Options).GetService<IRelationalDatabaseCreator>().CreateTables(); |
| | | |
| | | return connection; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | <Import Project="../../common.test.props" /> |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="Volo.Abp.Autofac" Version="$(ABPPackageVersion)" /> |
| | | <PackageReference Include="Volo.Abp.TestBase" Version="$(ABPPackageVersion)" /> |
| | | <PackageReference Include="Volo.Abp.Authorization" Version="$(ABPPackageVersion)" /> |
| | | <PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" /> |
| | | <PackageReference Include="NSubstitute" Version="$(NSubstitutePackageVersion)" /> |
| | | <PackageReference Include="Shouldly" Version="$(ShouldlyPackageVersion)" /> |
| | | <PackageReference Include="xunit" Version="$(xUnitPackageVersion)" /> |
| | | <PackageReference Include="xunit.extensibility.execution" Version="$(xUnitExtensibilityExecutionPackageVersion)" /> |
| | | <PackageReference Include="xunit.runner.visualstudio" Version="$(xUnitRunnerVisualstudioPackageVersion)" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\..\src\CMS.Plugin.HIAWms.Domain\CMS.Plugin.HIAWms.Domain.csproj" /> |
| | | </ItemGroup> |
| | | </Project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.DependencyInjection; |
| | | using Volo.Abp.Guids; |
| | | |
| | | namespace CMS.Plugin.HIAWms.TestBase |
| | | { |
| | | /// <summary> |
| | | /// MyProjectName DataSeedContributor |
| | | /// </summary> |
| | | public class HIAWmsDataSeedContributor : IDataSeedContributor, ITransientDependency |
| | | { |
| | | private readonly HIAWmsTestData _myProjectNameTestData; |
| | | private readonly IGuidGenerator _guidGenerator; |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="HIAWmsDataSeedContributor"/> class. |
| | | /// </summary> |
| | | /// <param name="serviceProvider">IServiceProvider</param> |
| | | public HIAWmsDataSeedContributor(IServiceProvider serviceProvider) |
| | | { |
| | | _myProjectNameTestData = serviceProvider.GetRequiredService<HIAWmsTestData>(); |
| | | _guidGenerator = serviceProvider.GetRequiredService<IGuidGenerator>(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// SeedAsync |
| | | /// </summary> |
| | | /// <param name="context">DataSeedContext</param> |
| | | /// <returns>Task</returns> |
| | | public async Task SeedAsync(DataSeedContext context) |
| | | { |
| | | await Task.CompletedTask; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Modularity; |
| | | using Volo.Abp.Testing; |
| | | using Volo.Abp.Uow; |
| | | |
| | | namespace CMS.Plugin.HIAWms.TestBase |
| | | { |
| | | /// <summary> |
| | | /// MyProjectName TestBase |
| | | /// </summary> |
| | | /// <typeparam name="TStartupModule">IAbpModule</typeparam> |
| | | public class HIAWmsTestBase<TStartupModule> : AbpIntegratedTest<TStartupModule> |
| | | where TStartupModule : IAbpModule |
| | | { |
| | | /// <summary> |
| | | /// SetAbpApplicationCreationOptions |
| | | /// </summary> |
| | | /// <param name="options">AbpApplicationCreationOptions</param> |
| | | protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) |
| | | { |
| | | options.UseAutofac(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// WithUnitOfWorkAsync |
| | | /// </summary> |
| | | /// <param name="func">func</param> |
| | | /// <returns>Task</returns> |
| | | protected virtual Task WithUnitOfWorkAsync(Func<Task> func) |
| | | { |
| | | return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// WithUnitOfWorkAsync |
| | | /// </summary> |
| | | /// <param name="options">AbpUnitOfWorkOptions</param> |
| | | /// <param name="action">action</param> |
| | | /// <returns>Task</returns> |
| | | protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func<Task> action) |
| | | { |
| | | using (var scope = ServiceProvider.CreateScope()) |
| | | { |
| | | var uowManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>(); |
| | | |
| | | using (var uow = uowManager.Begin(options)) |
| | | { |
| | | await action(); |
| | | |
| | | await uow.CompleteAsync(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// WithUnitOfWorkAsync |
| | | /// </summary> |
| | | /// <typeparam name="TResult">t</typeparam> |
| | | /// <param name="func">TResult</param> |
| | | /// <returns>TResult</returns> |
| | | protected virtual Task<TResult> WithUnitOfWorkAsync<TResult>(Func<Task<TResult>> func) |
| | | { |
| | | return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// WithUnitOfWorkAsync |
| | | /// </summary> |
| | | /// <typeparam name="TResult">T</typeparam> |
| | | /// <param name="options">AbpUnitOfWorkOptions</param> |
| | | /// <param name="func">Func</param> |
| | | /// <returns>TResult</returns> |
| | | protected virtual async Task<TResult> WithUnitOfWorkAsync<TResult>(AbpUnitOfWorkOptions options, Func<Task<TResult>> func) |
| | | { |
| | | using (var scope = ServiceProvider.CreateScope()) |
| | | { |
| | | var uowManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>(); |
| | | |
| | | using (var uow = uowManager.Begin(options)) |
| | | { |
| | | var result = await func(); |
| | | await uow.CompleteAsync(); |
| | | return result; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain; |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Autofac; |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.Modularity; |
| | | using Volo.Abp.Threading; |
| | | using Volo.Abp.Uow; |
| | | |
| | | namespace CMS.Plugin.HIAWms.TestBase |
| | | { |
| | | /// <summary> |
| | | /// MyProjectName TestBaseModule |
| | | /// </summary> |
| | | [DependsOn( |
| | | typeof(AbpAutofacModule), |
| | | typeof(AbpTestBaseModule), |
| | | typeof(CMSPluginDomainModule))] |
| | | public class HIAWmsTestBaseModule : AbpModule |
| | | { |
| | | /// <summary> |
| | | /// PreConfigureServices |
| | | /// </summary> |
| | | /// <param name="context">ServiceConfigurationContext</param> |
| | | public override void PreConfigureServices(ServiceConfigurationContext context) |
| | | { |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ConfigureServices |
| | | /// </summary> |
| | | /// <param name="context">ServiceConfigurationContext</param> |
| | | public override void ConfigureServices(ServiceConfigurationContext context) |
| | | { |
| | | context.Services.AddAlwaysAllowAuthorization(); |
| | | Configure<AbpUnitOfWorkDefaultOptions>(options => |
| | | { |
| | | options.TransactionBehavior = UnitOfWorkTransactionBehavior.Enabled; |
| | | }); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// OnApplicationInitialization |
| | | /// </summary> |
| | | /// <param name="context">ApplicationInitializationContext</param> |
| | | public override void OnApplicationInitialization(ApplicationInitializationContext context) |
| | | { |
| | | SeedTestData(context); |
| | | } |
| | | |
| | | private static void SeedTestData(ApplicationInitializationContext context) |
| | | { |
| | | AsyncHelper.RunSync(async () => |
| | | { |
| | | using (var scope = context.ServiceProvider.CreateScope()) |
| | | { |
| | | var dataSeeder = scope.ServiceProvider.GetRequiredService<IDataSeeder>(); |
| | | await dataSeeder.SeedAsync(); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.DependencyInjection; |
| | | |
| | | namespace CMS.Plugin.HIAWms.TestBase |
| | | { |
| | | public class HIAWmsTestData : ISingletonDependency |
| | | { |
| | | } |
| | | } |