change - 小料投料校验逻辑优化

master
wenjy 9 months ago
parent 8c4a7ae68d
commit d46983697c

@ -3,20 +3,20 @@ using SqlSugar;
namespace SlnMesnac.Model.domain namespace SlnMesnac.Model.domain
{ {
[SugarTable("IF_PmtBin2CWSS"), TenantAttribute("cwss")] [SugarTable("IF_PmtBin2MES"), TenantAttribute("cwss")]
[DataContract(Name = "CwssBinToMater 小料料仓对应信息")] [DataContract(Name = "CwssBinToMater 小料料仓对应信息")]
public class CwssBinToMater public class CwssBinToMater
{ {
/// <summary> /// <summary>
/// ///
///</summary> ///</summary>
[SugarColumn(ColumnName="Equip_Code" )] [SugarColumn(ColumnName="Equip_Code" ,IsPrimaryKey = true )]
public string EquipCode { get; set; } public string EquipCode { get; set; }
/// <summary> /// <summary>
/// ///
///</summary> ///</summary>
[SugarColumn(ColumnName="Bin_Serial" )] [SugarColumn(ColumnName="Bin_Serial" ,IsPrimaryKey = true )]
public int? BinSerial { get; set; } public int BinSerial { get; set; }
/// <summary> /// <summary>
/// ///
///</summary> ///</summary>
@ -25,13 +25,8 @@ namespace SlnMesnac.Model.domain
/// <summary> /// <summary>
/// ///
///</summary> ///</summary>
[SugarColumn(ColumnName="ID" )]
public string Id { get; set; }
/// <summary>
///
///</summary>
[SugarColumn(ColumnName="Bin_UseFlag" )] [SugarColumn(ColumnName="Bin_UseFlag" )]
public bool? BinUseflag { get; set; } public string BinUseflag { get; set; }
/// <summary> /// <summary>
/// ///
///</summary> ///</summary>

@ -58,6 +58,8 @@ namespace SlnMesnac.Repository
services.AddSingleton<IMcsBinToMaterService, McsBinToMaterServiceImpl>(); services.AddSingleton<IMcsBinToMaterService, McsBinToMaterServiceImpl>();
services.AddSingleton<IWmsTaskOutService, WmsTaskOutServiceImpl>(); services.AddSingleton<IWmsTaskOutService, WmsTaskOutServiceImpl>();
services.AddSingleton<IMcsMaterialInfoService, McsMaterialInfoServiceImpl>(); services.AddSingleton<IMcsMaterialInfoService, McsMaterialInfoServiceImpl>();
services.AddSingleton<ICwssBinToMaterService, CwssBinToMaterServiceImpl>();
services.AddSingleton<ICwssMaterialInfoService, CwssMaterialInfoServiceImpl>();
} }
} }
} }

@ -30,7 +30,7 @@ namespace SlnMesnac.Repository.service.Impl
try try
{ {
//return _rep.GetFirst(x=>x.ScaleNum == 101 && x.EquipId == EquipId && x.BinNo == BinNo); //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) catch (Exception e)
{ {

@ -162,8 +162,8 @@ public class CwssIngCheckController
{ {
bool result = false; bool result = false;
var plcInfo = _plcPool.GetPlcByKey("cwss"); var plcInfo = _plcPool.GetPlcByKey("cwss");
bool allOtherNumbersAreZero = plcInfo.readBoolByAddress(_appConfig.cwssBinStatusAddr); int allOtherNumbersAreZero = plcInfo.readInt32ByAddress(_appConfig.cwssBinStatusAddr);
if (!allOtherNumbersAreZero) if (allOtherNumbersAreZero != 1)
{ {
throw new ArgumentException($"开仓指令下发异常,存在门锁未关到位的料仓,时间:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); throw new ArgumentException($"开仓指令下发异常,存在门锁未关到位的料仓,时间:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
} }
@ -171,7 +171,7 @@ public class CwssIngCheckController
result = plcInfo.writeValueByAddress(2, "D3850"); result = plcInfo.writeValueByAddress(2, "D3850");
if (result) if (result)
{ {
result = plcInfo.writeValueByAddress(binNo, _appConfig.mcsOpenAddr); result = plcInfo.writeValueByAddress(binNo, _appConfig.cwssOpenAddr);
} }
if (!result) if (!result)

@ -27,7 +27,7 @@
{ {
"configId": "cwss", "configId": "cwss",
"dbType": 1, "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": [ "PlcConfig": [

@ -42,7 +42,7 @@
"configId": 2, "configId": 2,
"plcType": "MelsecBinaryPlc", "plcType": "MelsecBinaryPlc",
"plcIp": "192.168.1.71", "plcIp": "192.168.1.71",
"plcPort": 6000, "plcPort": 7000,
"plcKey": "cwss" "plcKey": "cwss"
} }
] ]

Loading…
Cancel
Save