From 12ae1f73269d6c20ece92d28684e3413ed914375 Mon Sep 17 00:00:00 2001 From: "qianhao.xu" Date: Tue, 27 Aug 2024 12:59:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=8F=82=E6=95=B0init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../huate_group/Recipe/RecipeController.cs | 10 ++++++++++ DOAN.Model/huate_group/recipe/Dto/RecipeDto.cs | 9 ++++++--- DOAN.Model/huate_group/recipe/Recipe.cs | 14 +++++++++++++- .../huate_group/Recipe/IService/IRecipeService.cs | 2 ++ DOAN.Service/huate_group/Recipe/RecipeService.cs | 7 ++++++- DOAN.Tasks/TaskScheduler/YIDA_dataUpload_Task.cs | 2 +- 6 files changed, 38 insertions(+), 6 deletions(-) diff --git a/DOAN.Admin.WebApi/Controllers/huate_group/Recipe/RecipeController.cs b/DOAN.Admin.WebApi/Controllers/huate_group/Recipe/RecipeController.cs index 387f24c..a9ed155 100644 --- a/DOAN.Admin.WebApi/Controllers/huate_group/Recipe/RecipeController.cs +++ b/DOAN.Admin.WebApi/Controllers/huate_group/Recipe/RecipeController.cs @@ -4,6 +4,7 @@ using DOAN.Service.huate_group.Recipe.IService; using DOAN.Model.huate_group.recipe; using DOAN.Model.huate_group.recipe.Dto; using System.ComponentModel; +using Microsoft.AspNetCore.Http; //创建时间:2024-08-21 namespace DOAN.Admin.WebApi.Controllers.huate_group.Recipe @@ -181,5 +182,14 @@ namespace DOAN.Admin.WebApi.Controllers.huate_group.Recipe var response = _RecipeService.GetPartNumber(partString); return SUCCESS(response); } + + //TODO 根据设备获取参数 + [HttpGet("get_paramter_list")] + public IActionResult GetParamterListByDevice(int device_id) { + var response = _RecipeService.GetParamterListByDevice(device_id); + return SUCCESS(response); + } + } + } \ No newline at end of file diff --git a/DOAN.Model/huate_group/recipe/Dto/RecipeDto.cs b/DOAN.Model/huate_group/recipe/Dto/RecipeDto.cs index e706527..a4b6f14 100644 --- a/DOAN.Model/huate_group/recipe/Dto/RecipeDto.cs +++ b/DOAN.Model/huate_group/recipe/Dto/RecipeDto.cs @@ -25,7 +25,10 @@ namespace DOAN.Model.huate_group.recipe.Dto public string Partnumber { get; set; } - public string Paramter { get; set; } + + + public int? FkParamterId { get; set; } + public string ParamterName { get; set; } } @@ -58,8 +61,8 @@ namespace DOAN.Model.huate_group.recipe.Dto public string Vehiclemodel { get; set; } public string Partnumber { get; set; } - - public string Paramter { get; set; } + public int? FkParamterId { get; set; } + public string ParamterName { get; set; } public bool Isfilter { get; set; } diff --git a/DOAN.Model/huate_group/recipe/Recipe.cs b/DOAN.Model/huate_group/recipe/Recipe.cs index d796079..47d067a 100644 --- a/DOAN.Model/huate_group/recipe/Recipe.cs +++ b/DOAN.Model/huate_group/recipe/Recipe.cs @@ -72,15 +72,27 @@ namespace DOAN.Model.huate_group.recipe /// public string Vehiclemodel { get; set; } + + + + /// /// 零件号 /// public string Partnumber { get; set; } + + /// + /// 参数id + /// + [SugarColumn(ColumnName = "fk_paramter_id")] + public int? FkParamterId { get; set; } /// /// 参数 /// - public string Paramter { get; set; } + + [SugarColumn(ColumnName = "paramter_name")] + public string ParamterName { get; set; } /// /// 是否过滤 diff --git a/DOAN.Service/huate_group/Recipe/IService/IRecipeService.cs b/DOAN.Service/huate_group/Recipe/IService/IRecipeService.cs index 8928fc2..86df277 100644 --- a/DOAN.Service/huate_group/Recipe/IService/IRecipeService.cs +++ b/DOAN.Service/huate_group/Recipe/IService/IRecipeService.cs @@ -32,5 +32,7 @@ namespace DOAN.Service.huate_group.Recipe.IService List GetVehicelModel(string partString); List GetPartNumber(string partString); + + List GetParamterListByDevice(int device_id); } } diff --git a/DOAN.Service/huate_group/Recipe/RecipeService.cs b/DOAN.Service/huate_group/Recipe/RecipeService.cs index 98add6b..2f5a41f 100644 --- a/DOAN.Service/huate_group/Recipe/RecipeService.cs +++ b/DOAN.Service/huate_group/Recipe/RecipeService.cs @@ -123,7 +123,7 @@ namespace DOAN.Service.huate_group.Recipe .AndIF(parm.FkDeviceId > 0, it => it.FkDeviceId == parm.FkDeviceId) .AndIF(parm != null && !string.IsNullOrEmpty(parm.Vehiclemodel), it => it.Vehiclemodel.Contains(parm.Vehiclemodel)) .AndIF(parm != null && !string.IsNullOrEmpty(parm.Partnumber), it => it.Partnumber.Contains(parm.Partnumber)) - .AndIF(parm != null && !string.IsNullOrEmpty(parm.Paramter), it => it.Paramter.Contains(parm.Paramter)) + .AndIF(parm != null && !string.IsNullOrEmpty(parm.ParamterName), it => it.ParamterName.Contains(parm.ParamterName)) ; return predicate; @@ -222,5 +222,10 @@ namespace DOAN.Service.huate_group.Recipe { return Context.Queryable().WhereIF(!string.IsNullOrEmpty(partString), it => it.PartnumberName.Contains(partString)).ToList(); } + + public List GetParamterListByDevice(int device_id) + { + return Context.Queryable().Where(it => it.FkDevice == device_id).ToList(); + } } } \ No newline at end of file diff --git a/DOAN.Tasks/TaskScheduler/YIDA_dataUpload_Task.cs b/DOAN.Tasks/TaskScheduler/YIDA_dataUpload_Task.cs index 9c41e7f..40a6930 100644 --- a/DOAN.Tasks/TaskScheduler/YIDA_dataUpload_Task.cs +++ b/DOAN.Tasks/TaskScheduler/YIDA_dataUpload_Task.cs @@ -91,7 +91,7 @@ namespace ZR.Tasks.TaskScheduler foreach (T item in device01s) { //1.1 判断设备配置情况 - Recipee options = query.Where(it => it.DeviceName == item.Workstation && it.Paramter == item.Paramter).First(); + Recipee options = query.Where(it => it.DeviceName == item.Workstation && it.ParamterName == item.Paramter).First(); if (options != null) { //不可上传