From 413f167eacffa8958341bcdcf7bc97d547664868 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周二, 13 5月 2025 06:13:02 +0800
Subject: [PATCH] 高级查询初步
---
PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanController.cs | 33 ++++++++++++++-------------------
1 files changed, 14 insertions(+), 19 deletions(-)
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanController.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanController.cs
index 8d564bd4..bc77738 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanController.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanController.cs
@@ -1,10 +1,9 @@
using Ao.Lang;
-using AutoMapper.Internal.Mappers;
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 CMS.Plugin.PipeLineLems.Application.Implements;
-using CMS.Plugin.PipeLineLems.Domain.WorkPlan;
+using CmsQueryExtensions.Entitys;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
@@ -27,27 +26,16 @@
public class WorkPlanController : ControllerBase
{
private readonly IWorkPlanAppService _workPlanAppService;
-
-
- /// <summary>
- /// 鑾峰彇鐢熶骇璁″垝.
- /// </summary>
- /// <param name="input">鏍囪瘑绗�.</param>
- /// <returns></returns>
- [HttpPost]
- [Route("GetWorkPlanByAps")]
- public virtual async Task<MesOrderResponse> CreateWorkPlanByApsAsync([FromBody] List<WorkPlanInput> input)
- {
- return await _workPlanAppService.CreatebyApsAsync(input);
- }
+ private readonly ICurrentUser _currentUser;
/// <summary>
/// Initializes a new instance of the <see cref="WorkPlanController"/> class.
/// </summary>
/// <param name="workPlanAppService">The workPlan application service.</param>
- public WorkPlanController(IWorkPlanAppService workPlanAppService)
+ public WorkPlanController(IWorkPlanAppService workPlanAppService, ICurrentUser currentUser)
{
_workPlanAppService = workPlanAppService;
+ _currentUser = currentUser;
}
/// <summary>
@@ -163,6 +151,14 @@
await file.CopyToAsync(stream);
stream.Seek(0L, SeekOrigin.Begin);
+ 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();
@@ -171,11 +167,10 @@
throw new UserFriendlyException("璇锋鏌ュ鍏ョ殑琛ㄦ牸");
}
-
await _workPlanAppService.ImportAsync(new WorkPlansImportModel
{
WorkPlans = workPlanRows,
- });
+ }, userId, userAccount);
return Ok();
}
--
Gitblit v1.9.3