| | |
| | | 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 |
| | | { |
| | | 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)); |
| | | |