| | |
| | | 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.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp); |
| | | input.MapExtraPropertiesTo(updateObj, MappingPropertyDefinitionChecks.None); |
| | | |
| | | updateObj.TaskCode = input.TaskCode; |
| | | updateObj.WorkPlanStatus = input.WorkPlanStatus; |
| | | updateObj.CallMaterialStatus = input.CallMaterialStatus; |
| | | updateObj.DataIdentifier = input.DataIdentifier; |
| | | updateObj.MaterialMode = input.MaterialMode; |
| | | updateObj.Length = input.Length; |
| | | updateObj.MarkingContent = input.MarkingContent; |
| | | updateObj.MarkingPosition = input.MarkingPosition; |
| | | updateObj.CuttingPosition = input.CuttingPosition; |
| | | updateObj.Quantity = input.Quantity; |
| | | updateObj.FlangeThickness = input.FlangeThickness; |
| | | updateObj.FlangeInnerDiameter = input.FlangeInnerDiameter; |
| | | updateObj.WeldingHeatInput = input.WeldingHeatInput; |
| | | updateObj.PipeAllowableStress = input.PipeAllowableStress; |
| | | updateObj.PipeDiameter = input.PipeDiameter; |
| | | updateObj.PipeWallThickness = input.PipeWallThickness; |
| | | updateObj.FactoryCode = input.FactoryCode; |
| | | updateObj.ProductCode = input.ProductCode; |
| | | updateObj.WorkstationCode = input.WorkstationCode; |
| | | updateObj.EquipmentCode = input.EquipmentCode; |
| | | |
| | | updateObj.ProcessName = input.ProcessName; |
| | | updateObj.PipeFittingCode = input.PipeFittingCode; |
| | | updateObj.PreSerialNumber = input.PreSerialNumber; |
| | | updateObj.PipeSpecCode = input.PipeSpecCode; |
| | | updateObj.PipeSectionName = input.PipeSectionName; |
| | | updateObj.OuterDiameter = input.OuterDiameter; |
| | | updateObj.Thickness = input.Thickness; |
| | | updateObj.Material = input.Material; |
| | | updateObj.ProcessRouteNumber = input.ProcessRouteNumber; |
| | | updateObj.PlannedStartTime = input.PlannedStartTime; |
| | | updateObj.PlannedEndTime = input.PlannedEndTime; |
| | | updateObj.TeamInfo = input.TeamInfo; |
| | | updateObj.Timestamp = input.Timestamp; |
| | | updateObj.Remark = input.Remark; |
| | | // 批量赋值所有可映射字段(通过匿名对象) |
| | | updateObj = ObjectMapper.Map(input, updateObj); // 等效于手动赋值所有匹配字段 |
| | | |
| | | updateObj.LastModifierName = input.LastModifierName;//修改人 |
| | | |
| | | await _workPlanRepository.UpdateAsync(updateObj); |
| | | |
| | |
| | | /// <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)); |
| | | } |
| | | } |