| | |
| | | using Volo.Abp.ObjectExtending; |
| | | using Volo.Abp.ObjectMapping; |
| | | using Volo.Abp.Users; |
| | | using CmsQueryExtensions.Entitys; |
| | | using System.Collections.Generic; |
| | | |
| | | namespace CMS.Plugin.PipeLineLems.Application.Implements; |
| | | |
| | |
| | | return ObjectMapper.Map<WorkPlan, WorkPlanDto>(await _workPlanRepository.GetAsync(id)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 按照 原料标记 查找作业计划表 |
| | | /// </summary> |
| | | /// <param name="name"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task<List<WorkPlan>> FindByDataIdentifierAsync(string dataIdentifier) |
| | | { |
| | | return await _workPlanRepository.FindByDataIdentifierAsync(dataIdentifier); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 分页获取作业计划表 |
| | |
| | | updateObj.ProductCode = input.ProductCode; |
| | | updateObj.WorkstationCode = input.WorkstationCode; |
| | | updateObj.EquipmentCode = input.EquipmentCode; |
| | | |
| | | |
| | | updateObj.ProcessName = input.ProcessName; |
| | | updateObj.PipeFittingCode = input.PipeFittingCode; |
| | | updateObj.PreSerialNumber = input.PreSerialNumber; |
| | |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public async Task ImportAsync(WorkPlansImportModel input, string userId, string userAccount) |
| | | public async Task ImportAsync(WorkPlansImportModel input, MyCurrentUser myCurrentUser) |
| | | { |
| | | //转换数据 |
| | | var result = ObjectMapper.Map<List<WorkPlansImportModel.WorkPlanImportModel>, List<WorkPlanInput>>(input.WorkPlans); |
| | | |
| | | //await CreatebyApsAsync(result); |
| | | await _sharedService.CommonCreatebyApsAsync(result, _serviceProvider, this, userId, userAccount); |
| | | await _sharedService.CommonCreatebyApsAsync(result, _serviceProvider, this, myCurrentUser.UserId, myCurrentUser.UserAccount); |
| | | // Check.NotNull(input, nameof(input)); |
| | | |
| | | // var workPlanCreateDtos = new List<(int RowIndex, WorkPlanCreateDto Item)>(); |
| | |
| | | { |
| | | return await _workPlanRepository.GetSingleByFilterAsync(whereConditions, isMultipleThrowException); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 根据条件获取作业计划表列表 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task<List<WorkPlanDto>> FindListByFilterAsync(GetWorkPlanInput input, CancellationToken cancellationToken = default) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WorkPlan.Sort); |
| | | } |
| | | |
| | | #region 动态构造查询条件 |
| | | |
| | | //动态构造查询条件 |
| | | var whereConditions = DynamicGetQueryParams(input); |
| | | |
| | | #endregion |
| | | |
| | | var list = await _workPlanRepository.GetListByFilterAsync(whereConditions?.data); |
| | | |
| | | return new List<WorkPlanDto>(ObjectMapper.Map<List<WorkPlan>, List<WorkPlanDto>>(list)); |
| | | } |
| | | /// <summary> |
| | | /// 根据条件获取单个作业计划表 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task<WorkPlanDto> FindSingleByFilterAsync(GetWorkPlanInput input, CancellationToken cancellationToken = default) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WorkPlan.Sort); |
| | | } |
| | | |
| | | #region 动态构造查询条件 |
| | | |
| | | //动态构造查询条件 |
| | | var whereConditions = DynamicGetQueryParams(input); |
| | | |
| | | #endregion |
| | | |
| | | var dataObj = await _workPlanRepository.GetSingleByFilterAsync(whereConditions?.data); |
| | | |
| | | return (ObjectMapper.Map<WorkPlan, WorkPlanDto>(dataObj)); |
| | | } |
| | | } |