|
|
|
@ -177,7 +177,11 @@ namespace Aucma.Core.ProductOffLine.Business
|
|
|
|
|
// Thread.Sleep(1000);
|
|
|
|
|
// MaterialBarScanEvent("33160030000000910780", "192.168.1.20");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 开始扫码约我处理
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="code"></param>
|
|
|
|
|
/// <param name="scannerIp"></param>
|
|
|
|
|
public void MaterialBarScan(string code, string scannerIp)
|
|
|
|
|
{
|
|
|
|
|
Task.Run(() =>
|
|
|
|
@ -190,7 +194,7 @@ namespace Aucma.Core.ProductOffLine.Business
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="code"></param>
|
|
|
|
|
/// <param name="scannerIp">扫码器IP</param>
|
|
|
|
|
public void MaterialBarScanHandle(string code,string scannerIp)
|
|
|
|
|
public void MaterialBarScanHandle(string code, string scannerIp)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
@ -316,7 +320,7 @@ namespace Aucma.Core.ProductOffLine.Business
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
log.Error("MaterialBarScanHandle异常:"+ex.Message.ToString());
|
|
|
|
|
log.Error("MaterialBarScanHandle异常:" + ex.Message.ToString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -348,7 +352,7 @@ namespace Aucma.Core.ProductOffLine.Business
|
|
|
|
|
{
|
|
|
|
|
OffLineInfo info11 = MapperTwo(TempOffLineInfo);
|
|
|
|
|
|
|
|
|
|
CodeBindingRecord bindingRecord1 = _codeBindingServices.FirstAsync(x=>x.ProductCode == info11.ProductSNCode).Result;
|
|
|
|
|
CodeBindingRecord bindingRecord1 = _codeBindingServices.FirstAsync(x => x.ProductCode == info11.ProductSNCode).Result;
|
|
|
|
|
|
|
|
|
|
if (bindingRecord1 == null)
|
|
|
|
|
{
|
|
|
|
@ -371,13 +375,13 @@ namespace Aucma.Core.ProductOffLine.Business
|
|
|
|
|
info11.PlcResult = 1;
|
|
|
|
|
// 查询本地数据库是否有数据
|
|
|
|
|
OffLineInfo offLineInfo = _offLineInfoServices.FirstAsync(x => x.ProductSNCode == TempOffLineInfo.ProductSNCode).Result;
|
|
|
|
|
if(offLineInfo == null)
|
|
|
|
|
if (offLineInfo == null)
|
|
|
|
|
{
|
|
|
|
|
info11.ProductOrderNo = "0000" + info11.ProductOrderNo;
|
|
|
|
|
int flag = _offLineInfoServices.AddAsync(info11).Result;
|
|
|
|
|
if (flag < 0)
|
|
|
|
|
{
|
|
|
|
|
log.Info(TempOffLineInfo.ProductSNCode+"插入下线记录失败");
|
|
|
|
|
log.Info(TempOffLineInfo.ProductSNCode + "插入下线记录失败");
|
|
|
|
|
TempOffLineInfo.MsgInfo = TempOffLineInfo.MsgInfo + "插入下线记录失败";
|
|
|
|
|
TempOffLineInfo.MsgAlarmFlag = true;
|
|
|
|
|
//界面刷新
|
|
|
|
@ -393,7 +397,7 @@ namespace Aucma.Core.ProductOffLine.Business
|
|
|
|
|
BaseOrderInfo order = _baseOrderInfoServices.FirstAsync(x => x.OrderCode == TempOffLineInfo.ProductOrderNo).Result;
|
|
|
|
|
if (order == null)
|
|
|
|
|
{
|
|
|
|
|
log.Info("条码:"+TempOffLineInfo.ProductBarNo+" 订单号:"+TempOffLineInfo.ProductOrderNo+" 查询mes订单失败");
|
|
|
|
|
log.Info("条码:" + TempOffLineInfo.ProductBarNo + " 订单号:" + TempOffLineInfo.ProductOrderNo + " 查询mes订单失败");
|
|
|
|
|
TempOffLineInfo.MsgInfo = TempOffLineInfo.MsgInfo + "查询mes订单失败";
|
|
|
|
|
TempOffLineInfo.MsgAlarmFlag = true;
|
|
|
|
|
//界面刷新
|
|
|
|
@ -408,7 +412,7 @@ namespace Aucma.Core.ProductOffLine.Business
|
|
|
|
|
}
|
|
|
|
|
order.UpdatedTime = DateTime.Now;
|
|
|
|
|
bool uploadOrder = _baseOrderInfoServices.UpdateAsync(order).Result;
|
|
|
|
|
if(!uploadOrder)
|
|
|
|
|
if (!uploadOrder)
|
|
|
|
|
{
|
|
|
|
|
log.Info("条码:" + TempOffLineInfo.ProductBarNo + " 订单号:" + TempOffLineInfo.ProductOrderNo + " 更新mes订单完成数失败");
|
|
|
|
|
TempOffLineInfo.MsgInfo = TempOffLineInfo.MsgInfo + "更新mes订单完成数失败";
|
|
|
|
@ -455,7 +459,7 @@ namespace Aucma.Core.ProductOffLine.Business
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="BarCode"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public bool HandleMaterialBarCode(string BarCode,TempInfo TempOffLineInfo)
|
|
|
|
|
public bool HandleMaterialBarCode(string BarCode, TempInfo TempOffLineInfo)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
@ -628,7 +632,7 @@ namespace Aucma.Core.ProductOffLine.Business
|
|
|
|
|
// string strSave = "Y";
|
|
|
|
|
if (!string.IsNullOrEmpty(strSave))
|
|
|
|
|
{
|
|
|
|
|
if (strSave == "Y" || strSave=="S")
|
|
|
|
|
if (strSave == "Y" || strSave == "S")
|
|
|
|
|
{
|
|
|
|
|
log.Info(TempOffLineInfo.ProductSNCode + "上传条码成功:" + strSave);
|
|
|
|
|
TempOffLineInfo.MsgInfo = TempOffLineInfo.MsgInfo + ",上传条码成功";
|
|
|
|
@ -700,7 +704,7 @@ namespace Aucma.Core.ProductOffLine.Business
|
|
|
|
|
// 查询本地数据库是否有数据
|
|
|
|
|
OffLineInfo offLineInfo = _offLineInfoServices.FirstAsync(x => x.ProductSNCode == TempOffLineInfo.ProductSNCode).Result;
|
|
|
|
|
|
|
|
|
|
if (offLineInfo != null && offLineInfo.PlcResult==1)
|
|
|
|
|
if (offLineInfo != null && offLineInfo.PlcResult == 1)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
log.Info(TempOffLineInfo.ProductSNCode + "条码重复上传,plc应答字为1,未响应为2可以再次放行");
|
|
|
|
@ -792,7 +796,7 @@ namespace Aucma.Core.ProductOffLine.Business
|
|
|
|
|
/// strDirection "A" ? 1 : 2;入库方向A,B
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="materialType"></param>
|
|
|
|
|
private bool DownLoadPassFlag(int scannerNo,string strDirection)
|
|
|
|
|
private bool DownLoadPassFlag(int scannerNo, string strDirection)
|
|
|
|
|
{
|
|
|
|
|
// 入库方向A,B
|
|
|
|
|
int direction = strDirection == "A" ? 1 : 2;
|
|
|
|
@ -804,9 +808,9 @@ namespace Aucma.Core.ProductOffLine.Business
|
|
|
|
|
if (obj != null)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if(scannerNo == 1) // 扫码器1对应的货道地址,内侧
|
|
|
|
|
if (scannerNo == 1) // 扫码器1对应的货道地址,内侧
|
|
|
|
|
{
|
|
|
|
|
log.Info(TempOffLineInfo1.ProductSNCode + ":内侧下发plc放行信号,入库方向ZR1001,放行信号ZR1003分别写:"+ direction.ToString()+"/1" + ",等待反馈");
|
|
|
|
|
log.Info(TempOffLineInfo1.ProductSNCode + ":内侧下发plc放行信号,入库方向ZR1001,放行信号ZR1003分别写:" + direction.ToString() + "/1" + ",等待反馈");
|
|
|
|
|
TempOffLineInfo1.MsgInfo = TempOffLineInfo1.MsgInfo + "下发放行,";
|
|
|
|
|
RefreshScanMateriaCodeEvent(TempOffLineInfo1);
|
|
|
|
|
//TempOffLineInfo1.ProductRefreshFlag = true;
|
|
|
|
@ -832,7 +836,7 @@ namespace Aucma.Core.ProductOffLine.Business
|
|
|
|
|
// 等待plc反馈信号
|
|
|
|
|
while (true)
|
|
|
|
|
{
|
|
|
|
|
if(DateTime.Now > targetTime) // plc超最大时限无反馈
|
|
|
|
|
if (DateTime.Now > targetTime) // plc超最大时限无反馈
|
|
|
|
|
{
|
|
|
|
|
log.Info("等待plc放行反馈信号超时");
|
|
|
|
|
result = false;
|
|
|
|
@ -1083,6 +1087,14 @@ namespace Aucma.Core.ProductOffLine.Business
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 验证条码是否是包含特征
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="packagBarCode">成品码</param>
|
|
|
|
|
/// <param name="SNCode">包装码</param>
|
|
|
|
|
public void check(string packagBarCode, string SNCode)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|