|
|
@ -340,15 +340,16 @@ namespace Aucma.Core.ProductOffLine.Business
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
//界面刷新
|
|
|
|
//界面刷新
|
|
|
|
TempOffLineInfo.ProductRefreshFlag = true;
|
|
|
|
TempOffLineInfo.ProductRefreshFlag = true;
|
|
|
|
// 多码系统校验,是否需要待定,现场看情况
|
|
|
|
// 多码系统校验,暂不启用
|
|
|
|
// bool flag = TestBarCode(TempOffLineInfo);
|
|
|
|
// bool flag = TestBarCode(TempOffLineInfo);
|
|
|
|
// if (!flag)
|
|
|
|
// if (!flag)
|
|
|
|
// {
|
|
|
|
// {
|
|
|
|
// return false;
|
|
|
|
// return false;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
log.Info(TempOffLineInfo.ProductSNCode + ", 多码验证通过!");
|
|
|
|
log.Info(TempOffLineInfo.ProductSNCode + ", 多码验证通过!");
|
|
|
|
return true;
|
|
|
|
//2.上传条码系统
|
|
|
|
}
|
|
|
|
return uploadSnSysytem(TempOffLineInfo);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -382,18 +383,33 @@ namespace Aucma.Core.ProductOffLine.Business
|
|
|
|
TempOffLineInfo.ProductRefreshFlag = true;
|
|
|
|
TempOffLineInfo.ProductRefreshFlag = true;
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
TempOffLineInfo.MsgInfo = "获取产品条码异常:" + ex.Message;
|
|
|
|
|
|
|
|
TempOffLineInfo.MsgAlarmFlag = true;
|
|
|
|
|
|
|
|
//界面刷新
|
|
|
|
|
|
|
|
TempOffLineInfo.ProductRefreshFlag = true;
|
|
|
|
|
|
|
|
log.Info(BarCode + "条码验证异常:" + ex.Message.ToString());
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//2.上传条码系统
|
|
|
|
public bool uploadSnSysytem(TempInfo TempOffLineInfo)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
if (!string.IsNullOrEmpty(TempOffLineInfo.ProductOrderNo))
|
|
|
|
if (!string.IsNullOrEmpty(TempOffLineInfo.ProductOrderNo))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// 条码系统保存接口
|
|
|
|
// 条码系统保存接口
|
|
|
|
string strSave = _productOffLineServices.SaveBarcodeInfo(BarCode.Trim(), "ILS_SORT", TempOffLineInfo.ProductOrderNo, 1);
|
|
|
|
string strSave = _productOffLineServices.SaveBarcodeInfo(TempOffLineInfo.ProductSNCode, "ILS_SORT", TempOffLineInfo.ProductOrderNo, 1);
|
|
|
|
// string strSave = "Y";
|
|
|
|
// string strSave = "Y";
|
|
|
|
if (!string.IsNullOrEmpty(strSave))
|
|
|
|
if (!string.IsNullOrEmpty(strSave))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (strSave == "Y")
|
|
|
|
if (strSave == "Y")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log.Info(BarCode + "上传条码成功:" + strSave);
|
|
|
|
log.Info(TempOffLineInfo.ProductSNCode + "上传条码成功:" + strSave);
|
|
|
|
TempOffLineInfo.MsgInfo = TempOffLineInfo.MsgInfo + ",上传条码成功";
|
|
|
|
TempOffLineInfo.MsgInfo = TempOffLineInfo.MsgInfo + ",上传条码成功";
|
|
|
|
|
|
|
|
|
|
|
|
// mes查询订单数据, 异常处理:后期可能根据SN码查箱体码,查订单号并检查更新订单数据
|
|
|
|
// mes查询订单数据, 异常处理:后期可能根据SN码查箱体码,查订单号并检查更新订单数据
|
|
|
@ -414,22 +430,22 @@ namespace Aucma.Core.ProductOffLine.Business
|
|
|
|
|
|
|
|
|
|
|
|
//界面刷新
|
|
|
|
//界面刷新
|
|
|
|
TempOffLineInfo.ProductRefreshFlag = true;
|
|
|
|
TempOffLineInfo.ProductRefreshFlag = true;
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log.Info(BarCode + "上传条码失败:" + strSave);
|
|
|
|
log.Info(TempOffLineInfo.ProductSNCode + "上传条码失败:" + strSave);
|
|
|
|
TempOffLineInfo.MsgInfo = TempOffLineInfo.MsgInfo + ",上传条码失败" + strSave;
|
|
|
|
TempOffLineInfo.MsgInfo = TempOffLineInfo.MsgInfo + ",上传条码失败" + strSave;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (strSave.Contains("条码重复"))
|
|
|
|
if (strSave.Contains("条码重复"))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// 查询本地数据库是否有数据
|
|
|
|
// 查询本地数据库是否有数据
|
|
|
|
OffLineInfo offLineInfo = _offLineInfoServices.FirstAsync(x => x.ProductSNCode == BarCode).Result;
|
|
|
|
OffLineInfo offLineInfo = _offLineInfoServices.FirstAsync(x => x.ProductSNCode == TempOffLineInfo.ProductSNCode).Result;
|
|
|
|
if (offLineInfo != null)
|
|
|
|
if (offLineInfo != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log.Info(BarCode + "条码重复,本地已存在,放行");
|
|
|
|
log.Info(TempOffLineInfo.ProductSNCode + "条码重复,本地已存在,放行");
|
|
|
|
TempOffLineInfo.MsgInfo = TempOffLineInfo.MsgInfo + "条码重复,本地已存在,放行";
|
|
|
|
TempOffLineInfo.MsgInfo = TempOffLineInfo.MsgInfo + "条码重复,本地已存在,放行";
|
|
|
|
//界面刷新
|
|
|
|
//界面刷新
|
|
|
|
TempOffLineInfo.ProductRefreshFlag = true;
|
|
|
|
TempOffLineInfo.ProductRefreshFlag = true;
|
|
|
@ -442,7 +458,7 @@ namespace Aucma.Core.ProductOffLine.Business
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log.Info(BarCode + "条码重复,本地不存在,已插入,放行");
|
|
|
|
log.Info(TempOffLineInfo.ProductSNCode + "条码重复,本地不存在,已插入,放行");
|
|
|
|
OffLineInfo info11 = MapperTwo(TempOffLineInfo);
|
|
|
|
OffLineInfo info11 = MapperTwo(TempOffLineInfo);
|
|
|
|
_offLineInfoServices.AddAsync(info11);
|
|
|
|
_offLineInfoServices.AddAsync(info11);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
@ -473,17 +489,11 @@ namespace Aucma.Core.ProductOffLine.Business
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TempOffLineInfo.MsgInfo = "获取产品条码异常:" + ex.Message;
|
|
|
|
log.Error(ex.Message.ToString());
|
|
|
|
TempOffLineInfo.MsgAlarmFlag = true;
|
|
|
|
}
|
|
|
|
//界面刷新
|
|
|
|
|
|
|
|
TempOffLineInfo.ProductRefreshFlag = true;
|
|
|
|
|
|
|
|
log.Info(BarCode + "条码验证异常:" + ex.Message.ToString());
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region plc交互
|
|
|
|
#region plc交互
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 下发plc放行信号,传进来扫码器编号,分垛方向A或者B,返回plc反馈结果
|
|
|
|
/// 下发plc放行信号,传进来扫码器编号,分垛方向A或者B,返回plc反馈结果
|
|
|
|