From b5904672914f1088841208b4084fc7619576fa2e Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周二, 20 5月 2025 11:50:32 +0800
Subject: [PATCH] 优化
---
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/WorkPlanAppService.cs | 70 ++++++++++++++++++++++++++++------
1 files changed, 57 insertions(+), 13 deletions(-)
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/WorkPlanAppService.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/WorkPlanAppService.cs
index 1372c83..01ffc44 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/WorkPlanAppService.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/WorkPlanAppService.cs
@@ -11,6 +11,8 @@
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;
@@ -43,16 +45,6 @@
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>
/// 鍒嗛〉鑾峰彇浣滀笟璁″垝琛�
@@ -179,7 +171,7 @@
updateObj.ProductCode = input.ProductCode;
updateObj.WorkstationCode = input.WorkstationCode;
updateObj.EquipmentCode = input.EquipmentCode;
-
+
updateObj.ProcessName = input.ProcessName;
updateObj.PipeFittingCode = input.PipeFittingCode;
updateObj.PreSerialNumber = input.PreSerialNumber;
@@ -308,13 +300,13 @@
/// <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)>();
@@ -552,4 +544,56 @@
{
return await _workPlanRepository.GetSingleByFilterAsync(whereConditions, is鈥婱ultipleThrowException);
}
+
+
+ /// <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));
+ }
}
--
Gitblit v1.9.3