¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan |
| | | { |
| | | /// <summary> |
| | | /// 忣è¾å
¥åæ°æ¨¡å |
| | | /// </summary> |
| | | [Serializable] |
| | | public class PickInput |
| | | { |
| | | |
| | | /// <summary> |
| | | /// 管段ç¼ç |
| | | /// </summary> |
| | | public string PipeSpecCode { get; set; } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | public interface IMesAppService |
| | | { |
| | | Task<MesOrderResponse> CreateAsync(List<WorkPlanInput> input); |
| | | |
| | | Task<MesOrderResponse> CreateAsync(List<WorkPlanInput> input, string userId, string userAccount); |
| | | } |
| | |
| | | |
| | | namespace CMS.Plugin.PipeLineLems.Application.Implements; |
| | | |
| | | public class MesAppService : CMSPluginAppService |
| | | public class MesAppService : CMSPluginAppService,IMesAppService |
| | | { |
| | | private readonly IServiceProvider _serviceProvider; |
| | | private readonly WorkPlanAppService _workPlanAppService; |
| | |
| | | using CMS.Plugin.PipeLineLems.Domain.WorkPlan; |
| | | using CMS.Plugin.PipeLineLems.Domain.CallMaterialOrderRecord; |
| | | using Volo.Abp.Users; |
| | | using CmsQueryExtensions.Entitys; |
| | | using CMS.Unit.RuntimeValue.Abstractions; |
| | | using CMS.Extensions.Variable; |
| | | |
| | | namespace CMS.Plugin.PipeLineLems.Application.Implements; |
| | | |
| | |
| | | /// </summary> |
| | | public class SharedService : CMSPluginAppService |
| | | { |
| | | |
| | | |
| | | public async Task<MesOrderResponse> CommonPick(IServiceProvider _serviceProvider, PickInput input, MyCurrentUser myCurrentUser) |
| | | { |
| | | //1ãè®°å½åæ£è®°å½è¡¨ |
| | | //2ãæ´æ°ä½ä¸è®¡å表çç¶æ =已忣 |
| | | //3ãåå
¥ 忣åé |
| | | |
| | | VariableService _variableService = _serviceProvider.GetRequiredService<VariableService>(); |
| | | |
| | | Dictionary<string, object?> keyValuePairs = new Dictionary<string, object?> |
| | | { |
| | | { "忣æçå·","æç1"}, |
| | | { "忣æ¹å", "ç管è£
é
"}, |
| | | { "åæ£äºº", myCurrentUser.UserAccount } |
| | | }; |
| | | _variableService.WriteValueAsync(keyValuePairs); |
| | | var response = new MesOrderResponse |
| | | { |
| | | Code = "000000", |
| | | Data = "", |
| | | Fail = false, |
| | | Mesg = "å¤çæå", |
| | | Success = true, |
| | | Time = DateTime.UtcNow |
| | | }; |
| | | return response; |
| | | } |
| | | /// <summary> |
| | | /// å建ä½ä¸è®¡å |
| | | /// </summary> |
| | |
| | | insertObj.CallMaterialStatus = Domain.Shared.Enums.CallMaterialStatusEnum.æªæ§è¡; |
| | | insertObj.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.æªç产; |
| | | insertObj.Sort = 1; |
| | | insertObj.CreatorId = userId; |
| | | insertObj.CreatorName = userAccount; |
| | | await workPlanAppService.CreateAsync(insertObj); |
| | | } |
| | |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <Reference Include="CmsQueryExtensions"> |
| | | <HintPath>..\..\..\..\CommonDLL\CmsQueryExtensions.dll</HintPath> |
| | | </Reference> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <Resource Include="Flows\50001_1.pfd"> |
| | | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
| | | </Resource> |
| | |
| | | |
| | | context.Services.AddScoped<IProjectRuntimeMigrator, CMSPluginRuntimeMigrator>(); |
| | | context.Services.AddSingleton<IProjectService, PipeLineLemsProjectService>(); |
| | | |
| | | context.Services.AddScoped<IMesAppService, MesAppService>(); |
| | | context.Services.AddScoped<IWorkPlanAppService, WorkPlanAppService>(); |
| | | |
| | | context.Services.AddScoped<IEFDataProvider>(p => |
| | |
| | | using CMS.Framework.AspNetCore.Users; |
| | | using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan; |
| | | using CMS.Plugin.PipeLineLems.Application.Contracts.Services; |
| | | using CmsQueryExtensions.Entitys; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | |
| | | |
| | | var userAccount = _currentUser.UserAccount; |
| | | var userId = _currentUser.UserId; |
| | | MyCurrentUser myCurrentUser = new MyCurrentUser() |
| | | { |
| | | UserAccount = _currentUser.UserAccount, |
| | | UserId = _currentUser.UserId |
| | | }; |
| | | |
| | | var sheetNames = stream.GetSheetNames(); |
| | | var workPlanRows = sheetNames.Contains("é
ç½®") ? MiniExcel.Query<WorkPlansImportModel.WorkPlanImportModel>(stream, sheetName: "é
ç½®").ToList() : new(); |
| | |
| | | using CMS.Extensions.Abp.AspNetCore.Mvc.Filters; |
| | | using CMS.Framework.AspNetCore.Users; |
| | | using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan; |
| | | using CMS.Plugin.PipeLineLems.Application.Contracts.Services; |
| | | using CmsQueryExtensions.Entitys; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using System.Reflection; |
| | | |
| | |
| | | { |
| | | |
| | | private readonly IMesAppService _mesAppService; |
| | | private readonly ICurrentUser _currentUser; |
| | | private readonly Application.Implements.SharedService sharedService; |
| | | private IServiceProvider _serviceProvider; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="TestEntityNameController"/> class. |
| | | /// </summary> |
| | | /// <param name="testentitynameAppService">The testentityname application service.</param> |
| | | public WorkPlanPublicController(IMesAppService mesAppService) |
| | | public WorkPlanPublicController(IMesAppService mesAppService, ICurrentUser currentUser, Application.Implements.SharedService _sharedService, |
| | | IServiceProvider serviceProvider) |
| | | { |
| | | _mesAppService = mesAppService; |
| | | _currentUser = currentUser; |
| | | sharedService = _sharedService; |
| | | _serviceProvider = serviceProvider; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | [HttpPost] |
| | | public virtual async Task<MesOrderResponse> GetWorkPlanAsync([FromBody] List<WorkPlanInput> input) |
| | | { |
| | | return await _mesAppService.CreateAsync(input); |
| | | return await _mesAppService.CreateAsync(input,"",""); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 忣 |
| | | /// </summary> |
| | | /// <param name="input">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("Pick")] |
| | | public virtual async Task<MesOrderResponse> Pick([FromBody] PickInput input) |
| | | { |
| | | MyCurrentUser myCurrentUser = new MyCurrentUser() |
| | | { |
| | | UserAccount = _currentUser.UserAccount, |
| | | UserId = _currentUser.UserId |
| | | }; |
| | | return await sharedService.CommonPick(_serviceProvider, input, myCurrentUser); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | //TODO:ææ¶çæäº§åID |
| | | //var productID = DateTime.Now.ToString("yyyyMMddHHmmssfff"); |
| | | var productID = workPlanList.First().PipeSpecCode; |
| | | var productID = callMaterialOrder.DataIdentifier; |
| | | Dictionary<string, object?> keyValuePairs_productID = new Dictionary<string, object?> |
| | | { |
| | | { "æç _ProductID", productID}, |
| | |
| | | |
| | | //TODO:ææ¶çæäº§åID |
| | | //var productID = DateTime.Now.ToString("yyyyMMddHHmmssfff"); |
| | | var productID = workPlanList.First().PipeSpecCode; |
| | | var productID = callMaterialOrder.DataIdentifier; |
| | | Dictionary<string, object?> keyValuePairs_productID = new Dictionary<string, object?> |
| | | { |
| | | { "åå²_ProductID", productID}, |