From 427309e2ce7a82c840653ae7351af88338a53d8c Mon Sep 17 00:00:00 2001 From: SoulStar Date: Mon, 6 Jan 2025 17:14:24 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E6=A0=B9=E6=8D=AE=E7=BD=90?= =?UTF-8?q?=E5=8F=B7=E6=9F=A5=E8=AF=A2=E7=A7=B0=E9=87=8F=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=9B=B4=E6=94=B9=E4=B8=BA=E6=A0=B9=E6=8D=AE=E7=BD=90=E5=AD=90?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E7=9A=84=E7=89=A9=E6=96=99ID=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Business/WarehouseController.cs | 10 +++++----- Admin.Core.Api/appsettings.Development.json | 4 ++-- Admin.Core.IService/IService_New/IHw_BarrelServices.cs | 4 ++-- Admin.Core.IService/IService_New/ILR_weighServices.cs | 4 ++-- Admin.Core.Service/Service_New/Hw_BarrelServices.cs | 7 ++++--- Admin.Core.Service/Service_New/LR_weighServices.cs | 4 ++-- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Admin.Core.Api/Controllers/Business/WarehouseController.cs b/Admin.Core.Api/Controllers/Business/WarehouseController.cs index 413a113..03c47fb 100644 --- a/Admin.Core.Api/Controllers/Business/WarehouseController.cs +++ b/Admin.Core.Api/Controllers/Business/WarehouseController.cs @@ -287,16 +287,16 @@ namespace Admin.Core.Api.Controllers.Business return Failed>("传入参数为空!"); } MessageModel> messageModel = new MessageModel>(); - string planID = _hw_BarrelService.GetPlanIdByBarrelID(barrelBarcode.Trim()); - if (string.IsNullOrEmpty(planID)) + string materialName = _hw_BarrelService.GetMaterialNameByBarrelID(barrelBarcode.Trim()); + if (string.IsNullOrEmpty(materialName)) { - return Failed>("查询不到罐号对应的计划ID!"); + return Failed>("查询不到罐号对应的物料ID!"); } - if (planID == "-1") + if (materialName == "-1") { return Failed>("查询不到罐号!"); } - List wlist = _lr_weighService.GetRecentWeightList(planID); + List wlist = _lr_weighService.GetRecentWeightList(materialName); List list = new List(); foreach (LR_weigh weigh in wlist) { diff --git a/Admin.Core.Api/appsettings.Development.json b/Admin.Core.Api/appsettings.Development.json index bc6167b..9a19e01 100644 --- a/Admin.Core.Api/appsettings.Development.json +++ b/Admin.Core.Api/appsettings.Development.json @@ -80,8 +80,8 @@ "DBType": 1, "Enabled": true, "HitRate": 50, - //"Connection": "Data Source=192.168.10.50;Initial Catalog=cwss_xl;User ID=sa;Password=sa;Integrated Security=false;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", - "Connection": "Data Source=119.45.202.115;Initial Catalog=cwss_xl;User ID=sa;Password=haiwei@123;Integrated Security=false;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", + "Connection": "Data Source=127.0.0.1;Initial Catalog=cwss_xl;User ID=sa;Password=123456;Integrated Security=false;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", + //"Connection": "Data Source=119.45.202.115;Initial Catalog=cwss_xl;User ID=sa;Password=haiwei@123;Integrated Security=false;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", //"Connection": "Data Source=192.168.10.50;Initial Catalog=cwss_xl;User ID=sa;Password=sa;Integrated Security=false;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", "ProviderName": "System.Data.SqlClient" diff --git a/Admin.Core.IService/IService_New/IHw_BarrelServices.cs b/Admin.Core.IService/IService_New/IHw_BarrelServices.cs index c640c97..133160e 100644 --- a/Admin.Core.IService/IService_New/IHw_BarrelServices.cs +++ b/Admin.Core.IService/IService_New/IHw_BarrelServices.cs @@ -15,8 +15,8 @@ namespace Admin.Core.IService.IService_New /// /// 根据罐号获取料罐ID /// - /// + /// /// - string GetPlanIdByBarrelID(string barrelBarcode); + string GetMaterialNameByBarrelID(string barrelBarcode); } } diff --git a/Admin.Core.IService/IService_New/ILR_weighServices.cs b/Admin.Core.IService/IService_New/ILR_weighServices.cs index e3e0fcc..45c8f18 100644 --- a/Admin.Core.IService/IService_New/ILR_weighServices.cs +++ b/Admin.Core.IService/IService_New/ILR_weighServices.cs @@ -10,9 +10,9 @@ namespace Admin.Core.IService public interface ILR_weighServices :IBaseServices { /// - /// 通过计划号获取最近一次的称量列表 + /// 通过物料名称获取最近一次的称量列表 /// /// - List GetRecentWeightList(string planCode); + List GetRecentWeightList(string MaterialName); } } \ No newline at end of file diff --git a/Admin.Core.Service/Service_New/Hw_BarrelServices.cs b/Admin.Core.Service/Service_New/Hw_BarrelServices.cs index af83390..3512b1d 100644 --- a/Admin.Core.Service/Service_New/Hw_BarrelServices.cs +++ b/Admin.Core.Service/Service_New/Hw_BarrelServices.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; namespace Admin.Core.Service.Service_New @@ -21,12 +22,12 @@ namespace Admin.Core.Service.Service_New base.BaseDal = dal; } - public string GetPlanIdByBarrelID(string barrelBarcode) + public string GetMaterialNameByBarrelID(string barrelBarcode) { try { - string planId = _dal.Query(x => x.BarCode == barrelBarcode).FirstOrDefault().PlanId; - return planId; + string materialName = _dal.Query(x => x.BarCode == barrelBarcode).FirstOrDefault().MaterialName; + return materialName; } catch(Exception ex) { diff --git a/Admin.Core.Service/Service_New/LR_weighServices.cs b/Admin.Core.Service/Service_New/LR_weighServices.cs index bfdd653..b6aee05 100644 --- a/Admin.Core.Service/Service_New/LR_weighServices.cs +++ b/Admin.Core.Service/Service_New/LR_weighServices.cs @@ -17,11 +17,11 @@ namespace Admin.Core.Service base.BaseDal = dal; } - public List GetRecentWeightList(string planCode) + public List GetRecentWeightList(string MaterialName) { try { - List list = _dal.Query(x => x.Plan_ID == planCode).ToList(); + List list = _dal.Query(x => x.Material_Name == MaterialName).ToList(); int maxMainID = list.Max(x => x.MainId); List groupList = list.Where(x => x.MainId == maxMainID).ToList(); return groupList;