| | |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.ObjectExtending; |
| | | using Volo.Abp.ObjectMapping; |
| | | using CMS.Plugin.FormulaManagement.Abstractions; |
| | | using CMS.Plugin.OrderManagement.Abstractions.Enums; |
| | | using CMS.Plugin.OrderManagement.Abstractions.Models; |
| | | using CMS.Plugin.OrderManagement.Abstractions; |
| | | using CMS.Plugin.ProductManagement.Abstractions; |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | |
| | | namespace CMS.Plugin.PipeLineLems.Application.Implements; |
| | | |
| | |
| | | public class WorkPlanAppService : CMSPluginAppService, IWorkPlanAppService |
| | | { |
| | | private readonly IWorkPlanRepository workPlanRepository; |
| | | private readonly SharedService _sharedService; |
| | | private readonly IServiceProvider _serviceProvider; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WorkPlanAppService"/> class. |
| | | /// </summary> |
| | | /// <param name="WorkPlanRepository">The task job repository.</param> |
| | | public WorkPlanAppService(IWorkPlanRepository _WorkPlanRepository, IServiceProvider serviceProvider) |
| | | public WorkPlanAppService(IWorkPlanRepository _WorkPlanRepository, SharedService sharedService, IServiceProvider serviceProvider) |
| | | { |
| | | workPlanRepository = _WorkPlanRepository; |
| | | _sharedService = sharedService; |
| | | _serviceProvider = serviceProvider; |
| | | } |
| | | |
| | |
| | | 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.OuterDiameter = input.OuterDiameter; |
| | | updateObj.Thickness = input.Thickness; |
| | | updateObj.Material = input.Material; |
| | | updateObj.HasMainSignature = input.HasMainSignature; |
| | | updateObj.ProcessRouteNumber = input.ProcessRouteNumber; |
| | | updateObj.PlannedStartTime = input.PlannedStartTime; |
| | | updateObj.PlannedEndTime = input.PlannedEndTime; |
| | |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public async Task ImportAsync(WorkPlansImportModel input) |
| | | { |
| | | |
| | | //转换数据 |
| | | var result = ObjectMapper.Map<List<WorkPlansImportModel.WorkPlanImportModel>, List<WorkPlanInput>>(input.WorkPlans); |
| | | |
| | | await CreatebyApsAsync(result); |
| | | //await CreatebyApsAsync(result); |
| | | await _sharedService.CommonCreatebyApsAsync(result, _serviceProvider, this); |
| | | // 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 |
| | | // { |
| | | // TaskCode = impItem.TaskCode, |
| | | //WorkPlanStatus = impItem.WorkPlanStatus, |
| | | //CallMaterialStatus = impItem.CallMaterialStatus, |
| | | //DataIdentifier = impItem.DataIdentifier, |
| | | //MaterialMode = impItem.MaterialMode, |
| | | //Length = impItem.Length, |
| | | //MarkingContent = impItem.MarkingContent, |
| | | //MarkingPosition = impItem.MarkingPosition, |
| | | //CuttingPosition = impItem.CuttingPosition, |
| | | //Quantity = impItem.Quantity, |
| | | //FlangeThickness = impItem.FlangeThickness, |
| | | //FlangeInnerDiameter = impItem.FlangeInnerDiameter, |
| | | //WeldingHeatInput = impItem.WeldingHeatInput, |
| | | //PipeAllowableStress = impItem.PipeAllowableStress, |
| | | //PipeDiameter = impItem.PipeDiameter, |
| | | //PipeWallThickness = impItem.PipeWallThickness, |
| | | //FactoryCode = impItem.FactoryCode, |
| | | //ProductCode = impItem.ProductCode, |
| | | //WorkstationCode = impItem.WorkstationCode, |
| | | //EquipmentCode = impItem.EquipmentCode, |
| | | //WorkpieceName = impItem.WorkpieceName, |
| | | //ProcessName = impItem.ProcessName, |
| | | //PipeFittingCode = impItem.PipeFittingCode, |
| | | //PreSerialNumber = impItem.PreSerialNumber, |
| | | //PipeSpecCode = impItem.PipeSpecCode, |
| | | //PipeSectionName = impItem.PipeSectionName, |
| | | //OuterDiameter = impItem.OuterDiameter, |
| | | //Thickness = impItem.Thickness, |
| | | //Material = impItem.Material, |
| | | //ProcessRouteNumber = impItem.ProcessRouteNumber, |
| | | //PlannedStartTime = impItem.PlannedStartTime, |
| | | //PlannedEndTime = impItem.PlannedEndTime, |
| | | //TeamInfo = impItem.TeamInfo, |
| | | //Timestamp = impItem.Timestamp, |
| | | //Remark = impItem.Remark, |
| | | |
| | | // }; |
| | | |
| | | // workPlanUpdateDtos.Add((impItem.RowIndex, oldWorkPlan.Id, workPlanUpdateDto)); |
| | | // } |
| | | // else |
| | | // { |
| | | // var workPlanCreateDto = new WorkPlanCreateDto |
| | | // { |
| | | // TaskCode = impItem.TaskCode, |
| | | //WorkPlanStatus = impItem.WorkPlanStatus, |
| | | //CallMaterialStatus = impItem.CallMaterialStatus, |
| | | //DataIdentifier = impItem.DataIdentifier, |
| | | //MaterialMode = impItem.MaterialMode, |
| | | //Length = impItem.Length, |
| | | //MarkingContent = impItem.MarkingContent, |
| | | //MarkingPosition = impItem.MarkingPosition, |
| | | //CuttingPosition = impItem.CuttingPosition, |
| | | //Quantity = impItem.Quantity, |
| | | //FlangeThickness = impItem.FlangeThickness, |
| | | //FlangeInnerDiameter = impItem.FlangeInnerDiameter, |
| | | //WeldingHeatInput = impItem.WeldingHeatInput, |
| | | //PipeAllowableStress = impItem.PipeAllowableStress, |
| | | //PipeDiameter = impItem.PipeDiameter, |
| | | //PipeWallThickness = impItem.PipeWallThickness, |
| | | //FactoryCode = impItem.FactoryCode, |
| | | //ProductCode = impItem.ProductCode, |
| | | //WorkstationCode = impItem.WorkstationCode, |
| | | //EquipmentCode = impItem.EquipmentCode, |
| | | //WorkpieceName = impItem.WorkpieceName, |
| | | //ProcessName = impItem.ProcessName, |
| | | //PipeFittingCode = impItem.PipeFittingCode, |
| | | //PreSerialNumber = impItem.PreSerialNumber, |
| | | //PipeSpecCode = impItem.PipeSpecCode, |
| | | //PipeSectionName = impItem.PipeSectionName, |
| | | //OuterDiameter = impItem.OuterDiameter, |
| | | //Thickness = impItem.Thickness, |
| | | //Material = impItem.Material, |
| | | //ProcessRouteNumber = impItem.ProcessRouteNumber, |
| | | //PlannedStartTime = impItem.PlannedStartTime, |
| | | //PlannedEndTime = impItem.PlannedEndTime, |
| | | //TeamInfo = impItem.TeamInfo, |
| | | //Timestamp = impItem.Timestamp, |
| | | //Remark = impItem.Remark, |
| | | |
| | | // }; |
| | | |
| | | // 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 workPlanUpdateDtos) |
| | | // { |
| | | // try |
| | | // { |
| | | // await UpdateAsync(workPlanDto.Id, workPlanDto.Item); |
| | | // } |
| | | // catch (Exception e) |
| | | // { |
| | | // var errorMsg = $"导入失败!配置,第{workPlanDto.RowIndex}行:{e.Message},终止导入"; |
| | | // throw new UserFriendlyException(errorMsg); |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | |
| | | public async Task<MesOrderResponse> CreatebyApsAsync(List<WorkPlanInput> input) |
| | | { |
| | | if (input == null) |
| | | { |
| | | throw new UserFriendlyException("输入参数不能为空"); |
| | | } |
| | | |
| | | if (input.Count == 0) |
| | | { |
| | | throw new UserFriendlyException("输入参数Data不能为空"); |
| | | } |
| | | |
| | | var orderManager = _serviceProvider.GetRequiredService<IOrderManager>(); |
| | | var productProvider = _serviceProvider.GetRequiredService<IProductProvider>(); |
| | | var formulaProvider = _serviceProvider.GetRequiredService<IFormulaProvider>(); |
| | | List<OrderModel> orderModels = new List<OrderModel>(); |
| | | //按照任务编号分组 |
| | | var groupTask = input.GroupBy(x => x.TaskCode); |
| | | foreach (var gTask in groupTask) |
| | | { |
| | | var taskCode = gTask.Key; |
| | | var order = await orderManager.GetByCodeAsync(taskCode); |
| | | if (order != null) |
| | | { |
| | | throw new UserFriendlyException($"任务编号[{taskCode}]已存在"); |
| | | } |
| | | |
| | | |
| | | //var product = await productProvider.FindByNameAsync(orderItem.PipeSectionName); |
| | | //if (product == null) |
| | | //{ |
| | | // throw new UserFriendlyException($"产品名称[{orderItem.PipeSectionName}]不存在"); |
| | | //} |
| | | |
| | | //var formula = await formulaProvider.GetFormulaAsync(product.Id); |
| | | //if (formula == null) |
| | | //{ |
| | | // throw new UserFriendlyException($"产品型号[{orderItem.MaterialCode}]无关联配方"); |
| | | //} |
| | | //首先要创建 打码切割的工单 |
| | | var productForCut = await productProvider.FindByNameAsync("切割原料管"); |
| | | if (productForCut == null) |
| | | { |
| | | throw new UserFriendlyException($"产品名称[切割原料管]不存在"); |
| | | } |
| | | var formulaForCut = await formulaProvider.GetFormulaAsync(productForCut.Id); |
| | | if (formulaForCut == null) |
| | | { |
| | | throw new UserFriendlyException($"产品名称[切割原料管]无关联配方"); |
| | | } |
| | | //分组数据 |
| | | var group = gTask.ToList().GroupBy(x => x.DataIdentifier); |
| | | foreach (var item in group) |
| | | { |
| | | OrderModel orderModelForCut = new OrderModel() |
| | | { |
| | | Id = Guid.NewGuid(), |
| | | Code = "Cut_" + taskCode, |
| | | Source = "APS推送", |
| | | PlanStartTime = gTask.ToList().First().PlannedStartTime, |
| | | PlanFinishTime = gTask.ToList().First().PlannedEndTime, |
| | | PlanQty = (ulong)item.ToList().Count, |
| | | Status = OrderStatus.NotActive, |
| | | Product = new AssociationProductModel() { Id = productForCut.Id, Name = productForCut.Name, Model = productForCut.Model, ShortNumber = productForCut.ShortNumber }, |
| | | Formula = new AssociationFormulaModel() { Id = formulaForCut.Id, Code = formulaForCut.Code, Name = formulaForCut.Name } |
| | | }; |
| | | orderModelForCut.ExtraProperties["OuterDiameter"] = gTask.ToList().First().OuterDiameter;//外径 |
| | | orderModelForCut.ExtraProperties["Material"] = gTask.ToList().First().Material;//材质 |
| | | orderModelForCut.ExtraProperties["Length"] = gTask.ToList().First().Length;//长度 |
| | | |
| | | var orderForCut = await orderManager.GetByCodeAsync(orderModelForCut.Code); |
| | | if (orderForCut != null) |
| | | { |
| | | //throw new UserFriendlyException($"工单[{orderModelForCut.Code}]已存在"); |
| | | //不再抛异常,直接跳过 |
| | | break; |
| | | } |
| | | |
| | | var orderModelResultForCut = await orderManager.CreateAsync(orderModelForCut); |
| | | if (orderModelResultForCut == null) |
| | | { |
| | | throw new UserFriendlyException($"工单[{orderModelForCut.Code}]创建失败"); |
| | | } |
| | | orderModels.Add(orderModelResultForCut); |
| | | |
| | | |
| | | //OrderModel orderModel = new OrderModel(); |
| | | //orderModel.Id = Guid.NewGuid(); |
| | | //orderModel.Code = orderItem.TaskCode; |
| | | //orderModel.Source = "APS推送"; |
| | | //orderModel.Product = new AssociationProductModel() { Id = product.Id, Name = product.Name, Model = product.Model, ShortNumber = product.ShortNumber }; |
| | | ////orderModel.Formula = new AssociationFormulaModel() { Id = formula.Id, Code = formula.Code, Name = formula.Name }; |
| | | //orderModel.PlanStartTime = orderItem.PlannedStartTime; |
| | | //orderModel.PlanFinishTime = orderItem.PlannedEndTime; |
| | | //orderModel.PlanQty = (ulong?)orderItem.OrderQty; |
| | | //orderModel.Status = OrderStatus.NotActive; |
| | | //orderModel.ExtraProperties["Source"] = "ddd"; |
| | | //var source = orderModel.ExtraProperties["Source"]; |
| | | //var orderModelResult = await orderManager.CreateAsync(orderModel); |
| | | //if (orderModelResult == null) |
| | | //{ |
| | | // throw new UserFriendlyException($"工单[{orderItem.TaskCode}]创建失败"); |
| | | //} |
| | | //orderModels.Add(orderModelResult); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | //保存到表中 |
| | | foreach (var item in input) |
| | | { |
| | | var insertObj = ObjectMapper.Map<WorkPlanInput, WorkPlanCreateDto>(item); |
| | | //insertObj.OrgMaterialCode = "1111"; |
| | | insertObj.Sort = 1; |
| | | await CreateAsync(insertObj); |
| | | } |
| | | |
| | | |
| | | // 发布事件 |
| | | //await _eventBus.PublishAsync(new EntityChangedEto("MESCREATE", input, null, EntityChangeType.Add, true)); |
| | | |
| | | var response = new MesOrderResponse |
| | | { |
| | | Code = "000000", |
| | | Data = orderModels, |
| | | Fail = false, |
| | | Mesg = "处理成功", |
| | | Success = true, |
| | | Time = DateTime.UtcNow |
| | | }; |
| | | return response; |
| | | } |
| | | |
| | | ///// <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()) |
| | | // { |
| | | // #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 |
| | | // { |
| | | // TaskCode = impItem.TaskCode, |
| | | // DataIdentifier = impItem.DataIdentifier, |
| | | // MaterialMode = impItem.MaterialMode, |
| | | // Length = impItem.Length, |
| | | // MarkingContent = impItem.MarkingContent, |
| | | // MarkingPosition = impItem.MarkingPosition, |
| | | // CuttingPosition = impItem.CuttingPosition, |
| | | // Quantity = impItem.Quantity, |
| | | // FlangeThickness = impItem.FlangeThickness, |
| | | // FlangeInnerDiameter = impItem.FlangeInnerDiameter, |
| | | // WeldingHeatInput = impItem.WeldingHeatInput, |
| | | // PipeAllowableStress = impItem.PipeAllowableStress, |
| | | // PipeDiameter = impItem.PipeDiameter, |
| | | // PipeWallThickness = impItem.PipeWallThickness, |
| | | // FactoryCode = impItem.FactoryCode, |
| | | // ProductCode = impItem.ProductCode, |
| | | // WorkstationCode = impItem.WorkstationCode, |
| | | // EquipmentCode = impItem.EquipmentCode, |
| | | // WorkpieceName = impItem.WorkpieceName, |
| | | // ProcessName = impItem.ProcessName, |
| | | // PipeFittingCode = impItem.PipeFittingCode, |
| | | // PreSerialNumber = impItem.PreSerialNumber, |
| | | // PipeSpecCode = impItem.PipeSpecCode, |
| | | // PipeSectionName = impItem.PipeSectionName, |
| | | // OuterDiameter = impItem.OuterDiameter, |
| | | // Thickness = impItem.Thickness, |
| | | // Material = impItem.Material, |
| | | // HasMainSignature = impItem.HasMainSignature, |
| | | // ProcessRouteNumber = impItem.ProcessRouteNumber, |
| | | // PlannedStartTime = impItem.PlannedStartTime, |
| | | // PlannedEndTime = impItem.PlannedEndTime, |
| | | // TeamInfo = impItem.TeamInfo, |
| | | // Timestamp = impItem.Timestamp, |
| | | // Remark = impItem.Remark, |
| | | |
| | | // }; |
| | | |
| | | // workPlanUpdateDtos.Add((impItem.RowIndex, oldWorkPlan.Id, workPlanUpdateDto)); |
| | | // } |
| | | // else |
| | | // { |
| | | // var workPlanCreateDto = new WorkPlanCreateDto |
| | | // { |
| | | // TaskCode = impItem.TaskCode, |
| | | // DataIdentifier = impItem.DataIdentifier, |
| | | // MaterialMode = impItem.MaterialMode, |
| | | // Length = impItem.Length, |
| | | // MarkingContent = impItem.MarkingContent, |
| | | // MarkingPosition = impItem.MarkingPosition, |
| | | // CuttingPosition = impItem.CuttingPosition, |
| | | // Quantity = impItem.Quantity, |
| | | // FlangeThickness = impItem.FlangeThickness, |
| | | // FlangeInnerDiameter = impItem.FlangeInnerDiameter, |
| | | // WeldingHeatInput = impItem.WeldingHeatInput, |
| | | // PipeAllowableStress = impItem.PipeAllowableStress, |
| | | // PipeDiameter = impItem.PipeDiameter, |
| | | // PipeWallThickness = impItem.PipeWallThickness, |
| | | // FactoryCode = impItem.FactoryCode, |
| | | // ProductCode = impItem.ProductCode, |
| | | // WorkstationCode = impItem.WorkstationCode, |
| | | // EquipmentCode = impItem.EquipmentCode, |
| | | // WorkpieceName = impItem.WorkpieceName, |
| | | // ProcessName = impItem.ProcessName, |
| | | // PipeFittingCode = impItem.PipeFittingCode, |
| | | // PreSerialNumber = impItem.PreSerialNumber, |
| | | // PipeSpecCode = impItem.PipeSpecCode, |
| | | // PipeSectionName = impItem.PipeSectionName, |
| | | // OuterDiameter = impItem.OuterDiameter, |
| | | // Thickness = impItem.Thickness, |
| | | // Material = impItem.Material, |
| | | // HasMainSignature = impItem.HasMainSignature, |
| | | // ProcessRouteNumber = impItem.ProcessRouteNumber, |
| | | // PlannedStartTime = impItem.PlannedStartTime, |
| | | // PlannedEndTime = impItem.PlannedEndTime, |
| | | // TeamInfo = impItem.TeamInfo, |
| | | // Timestamp = impItem.Timestamp, |
| | | // Remark = impItem.Remark, |
| | | |
| | | // }; |
| | | |
| | | // 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 workPlanUpdateDtos) |
| | | // { |
| | | // try |
| | | // { |
| | | // await UpdateAsync(workPlanDto.Id, workPlanDto.Item); |
| | | // } |
| | | // catch (Exception e) |
| | | // { |
| | | // var errorMsg = $"导入失败!配置,第{workPlanDto.RowIndex}行:{e.Message},终止导入"; |
| | | // throw new UserFriendlyException(errorMsg); |
| | | // } |
| | | // } |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// 导出作业计划表 |
| | |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | Check.NotNullOrWhiteSpace(input.TaskCode, "任务编码", 256); |
| | | Check.NotNull(input.WorkPlanStatus, "计划状态"); |
| | | Check.NotNull(input.CallMaterialStatus, "叫料状态"); |
| | | Check.NotNull(input.Length, "长度(mm)"); |
| | | Check.NotNull(input.MarkingPosition, "打码位置"); |
| | | Check.NotNull(input.CuttingPosition, "切割位置"); |
| | |
| | | Check.NotNull(input.PipeWallThickness, "套管直径(mm)"); |
| | | Check.NotNull(input.OuterDiameter, "外径(mm)"); |
| | | Check.NotNull(input.Thickness, "壁厚(mm)"); |
| | | Check.NotNull(input.HasMainSignature, "是否主支管"); |
| | | |
| | | return Task.CompletedTask; |
| | | } |