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

master
wenjy 9 months ago
parent 8c4a7ae68d
commit d46983697c

@ -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
{
/// <summary>
///
///</summary>
[SugarColumn(ColumnName="Equip_Code" )]
[SugarColumn(ColumnName="Equip_Code" ,IsPrimaryKey = true )]
public string EquipCode { get; set; }
/// <summary>
///
///</summary>
[SugarColumn(ColumnName="Bin_Serial" )]
public int? BinSerial { get; set; }
[SugarColumn(ColumnName="Bin_Serial" ,IsPrimaryKey = true )]
public int BinSerial { get; set; }
/// <summary>
///
///</summary>
@ -25,13 +25,8 @@ namespace SlnMesnac.Model.domain
/// <summary>
///
///</summary>
[SugarColumn(ColumnName="ID" )]
public string Id { get; set; }
/// <summary>
///
///</summary>
[SugarColumn(ColumnName="Bin_UseFlag" )]
public bool? BinUseflag { get; set; }
public string BinUseflag { get; set; }
/// <summary>
///
///</summary>

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

@ -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)
{

@ -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)

@ -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": [

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

Loading…
Cancel
Save