From d46983697c3349200455a7c63f447e27ccab0c90 Mon Sep 17 00:00:00 2001 From: wenjy Date: Tue, 12 Mar 2024 10:37:20 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E5=B0=8F=E6=96=99=E6=8A=95?= =?UTF-8?q?=E6=96=99=E6=A0=A1=E9=AA=8C=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SlnMesnac.Model/domain/CwssBinToMater.cs | 15 +++++---------- SlnMesnac.Repository/SqlsugarSetup.cs | 2 ++ .../service/Impl/CwssBinToMaterServiceImpl.cs | 2 +- SlnMesnac/Controllers/CwssIngCheckController.cs | 6 +++--- SlnMesnac/appsettings.Development.json | 2 +- SlnMesnac/appsettings.json | 2 +- 6 files changed, 13 insertions(+), 16 deletions(-) diff --git a/SlnMesnac.Model/domain/CwssBinToMater.cs b/SlnMesnac.Model/domain/CwssBinToMater.cs index 00020ca..36aaa72 100644 --- a/SlnMesnac.Model/domain/CwssBinToMater.cs +++ b/SlnMesnac.Model/domain/CwssBinToMater.cs @@ -3,20 +3,20 @@ using SqlSugar; namespace SlnMesnac.Model.domain { - [SugarTable("IF_PmtBin2CWSS"), TenantAttribute("cwss")] + [SugarTable("IF_PmtBin2MES"), TenantAttribute("cwss")] [DataContract(Name = "CwssBinToMater 小料料仓对应信息")] public class CwssBinToMater { /// /// /// - [SugarColumn(ColumnName="Equip_Code" )] + [SugarColumn(ColumnName="Equip_Code" ,IsPrimaryKey = true )] public string EquipCode { get; set; } /// /// /// - [SugarColumn(ColumnName="Bin_Serial" )] - public int? BinSerial { get; set; } + [SugarColumn(ColumnName="Bin_Serial" ,IsPrimaryKey = true )] + public int BinSerial { get; set; } /// /// /// @@ -25,13 +25,8 @@ namespace SlnMesnac.Model.domain /// /// /// - [SugarColumn(ColumnName="ID" )] - public string Id { get; set; } - /// - /// - /// [SugarColumn(ColumnName="Bin_UseFlag" )] - public bool? BinUseflag { get; set; } + public string BinUseflag { get; set; } /// /// /// diff --git a/SlnMesnac.Repository/SqlsugarSetup.cs b/SlnMesnac.Repository/SqlsugarSetup.cs index 05525dd..4fe0062 100644 --- a/SlnMesnac.Repository/SqlsugarSetup.cs +++ b/SlnMesnac.Repository/SqlsugarSetup.cs @@ -58,6 +58,8 @@ namespace SlnMesnac.Repository services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); } } } diff --git a/SlnMesnac.Repository/service/Impl/CwssBinToMaterServiceImpl.cs b/SlnMesnac.Repository/service/Impl/CwssBinToMaterServiceImpl.cs index e917852..32acbd4 100644 --- a/SlnMesnac.Repository/service/Impl/CwssBinToMaterServiceImpl.cs +++ b/SlnMesnac.Repository/service/Impl/CwssBinToMaterServiceImpl.cs @@ -30,7 +30,7 @@ namespace SlnMesnac.Repository.service.Impl try { //return _rep.GetFirst(x=>x.ScaleNum == 101 && x.EquipId == EquipId && x.BinNo == BinNo); - return _rep.GetFirst(x => x.EquipCode.ToString()+x.BinSerial.ToString() == BinNo); + return _rep.GetFirst(x => (x.EquipCode.ToString()+x.BinSerial.ToString()) == BinNo); } catch (Exception e) { diff --git a/SlnMesnac/Controllers/CwssIngCheckController.cs b/SlnMesnac/Controllers/CwssIngCheckController.cs index ec4eb51..c777c18 100644 --- a/SlnMesnac/Controllers/CwssIngCheckController.cs +++ b/SlnMesnac/Controllers/CwssIngCheckController.cs @@ -162,8 +162,8 @@ public class CwssIngCheckController { bool result = false; var plcInfo = _plcPool.GetPlcByKey("cwss"); - bool allOtherNumbersAreZero = plcInfo.readBoolByAddress(_appConfig.cwssBinStatusAddr); - if (!allOtherNumbersAreZero) + int allOtherNumbersAreZero = plcInfo.readInt32ByAddress(_appConfig.cwssBinStatusAddr); + if (allOtherNumbersAreZero != 1) { throw new ArgumentException($"开仓指令下发异常,存在门锁未关到位的料仓,时间:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); } @@ -171,7 +171,7 @@ public class CwssIngCheckController result = plcInfo.writeValueByAddress(2, "D3850"); if (result) { - result = plcInfo.writeValueByAddress(binNo, _appConfig.mcsOpenAddr); + result = plcInfo.writeValueByAddress(binNo, _appConfig.cwssOpenAddr); } if (!result) diff --git a/SlnMesnac/appsettings.Development.json b/SlnMesnac/appsettings.Development.json index 46d40f9..b6aaae9 100644 --- a/SlnMesnac/appsettings.Development.json +++ b/SlnMesnac/appsettings.Development.json @@ -27,7 +27,7 @@ { "configId": "cwss", "dbType": 1, - "connStr": "server=58.63.214.27,23315;uid=dkmes;pwd=Duken123;database=ShareDB_MESs" + "connStr": "server=58.63.214.27,23315;uid=dkmes;pwd=Duken123;database=ShareDB_MES" } ], "PlcConfig": [ diff --git a/SlnMesnac/appsettings.json b/SlnMesnac/appsettings.json index 9b4e51e..f8b5358 100644 --- a/SlnMesnac/appsettings.json +++ b/SlnMesnac/appsettings.json @@ -42,7 +42,7 @@ "configId": 2, "plcType": "MelsecBinaryPlc", "plcIp": "192.168.1.71", - "plcPort": 6000, + "plcPort": 7000, "plcKey": "cwss" } ]