liulb@mesnac.com 1 year ago
commit c296aafcc2

@ -406,6 +406,16 @@
SAP计划员100=成品;200=箱体;300=门体)
</summary>
</member>
<member name="P:Admin.Core.Model.BaseMaterialInfo.ProductCode">
<summary>
69码成品下线校验使用
</summary>
</member>
<member name="P:Admin.Core.Model.BaseMaterialInfo.ProductName">
<summary>
69码对应的商品名称
</summary>
</member>
<member name="T:Admin.Core.Model.Model_New.BaseOrderInfo">
<summary>
SAP订单信息

@ -110,5 +110,17 @@ namespace Admin.Core.Model
/// </summary>
[SugarColumn(ColumnName = "DISPO")]
public string Dispo { get; set; }
/// <summary>
/// 69码成品下线校验使用
/// </summary>
[SugarColumn(ColumnName = "PRODUCT_CODE")]
public string ProductCode { get; set; }
/// <summary>
/// 69码对应的商品名称
/// </summary>
[SugarColumn(ColumnName = "PRODUCT_NAME")]
public string ProductName { get; set; }
}
}

@ -29,12 +29,19 @@ namespace Aucma.Core.ProductOffLine.Business
#region 单例实现
private static readonly GunBusiness lazy = new GunBusiness();
#region 变量定义
//成品码
private static string ProductCode = string.Empty;
// 69码
private static string Code69 = string.Empty;
#endregion
/// <summary>
/// 扫码委托
/// </summary>
/// <param name="materialCodeStr"></param>
/// <param name="ip"></param>
public delegate void RefreshMaterialCodeStr(string materialCodeStr, string ip);
public delegate void RefreshMaterialCodeStr(string ProductCode, string Code69, string ip);
public static event RefreshMaterialCodeStr RefreshMaterialCodeStrEvent;
public static GunBusiness Instance
@ -93,14 +100,27 @@ namespace Aucma.Core.ProductOffLine.Business
StringBuilder sb = new StringBuilder();
string str = Encoding.ASCII.GetString(receiveBytes).Replace("\r\n", "");
if(str.Length == 20)
{
ProductCode = str;
}else if(str.Length == 13)
{
Code69 = str;
}
// 业务处理
if(!string.IsNullOrEmpty(ProductCode) && !string.IsNullOrEmpty(Code69))
{
string ip = DirectionToIP();
if (!string.IsNullOrEmpty(ip))
{
RefreshMaterialCodeStrEvent?.Invoke(str,ip);
RefreshMaterialCodeStrEvent?.Invoke(ProductCode,Code69, ip);
int direction = -1;
appConfig.GunDirection = direction.ToString();
}
// 清空
ProductCode = string.Empty;
Code69 = string.Empty;
}
sb.Clear();
}

@ -43,7 +43,7 @@ namespace Aucma.Core.ProductOffLine.Business
/// </summary>
/// <param name="materialCodeStr"></param>
/// <param name="ip"></param>
public delegate void RefreshMaterialCodeStr(string materialCodeStr, string ip);
public delegate void RefreshMaterialCodeStr(string ProductCode,string Code69, string ip);
public static event RefreshMaterialCodeStr RefreshMaterialCodeStrEvent;
/// <summary>
@ -65,58 +65,52 @@ namespace Aucma.Core.ProductOffLine.Business
public static void ShellImageCallbackFunc(IntPtr pData, IntPtr pstFrameInfoEx2, IntPtr pUser)
{
string Code69 = string.Empty;
string ProductCode = string.Empty;
var stFrameInfo = (MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2)Marshal.PtrToStructure(pstFrameInfoEx2, typeof(MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2));
MvCodeReader.MV_CODEREADER_RESULT_BCR_EX2 stBcrResult = (MvCodeReader.MV_CODEREADER_RESULT_BCR_EX2)Marshal.PtrToStructure(stFrameInfo.UnparsedBcrList.pstCodeListEx2, typeof(MvCodeReader.MV_CODEREADER_RESULT_BCR_EX2));
//更新扫码器存活时间
ShellLiveTime = DateTime.Now;
// Console.WriteLine("CodeNum[" + Convert.ToString(stBcrResult.nCodeNum) + "]");
if (stBcrResult.nCodeNum == 0)
if (stBcrResult.nCodeNum <2)
{
Console.WriteLine(DateTime.Now + ":外侧--->No Read 处理");
log.Info(DateTime.Now + ":外侧--->No Read 处理");
//更新扫码器存活时间
ShellLiveTime = DateTime.Now;
}
else
{
for (Int32 i = 0; i < stBcrResult.nCodeNum; i++)
{
bool bIsValidUTF8 = IsTextUTF8(stBcrResult.stBcrInfoEx2[i].chCode);
if (bIsValidUTF8)
{
string strCode = Encoding.UTF8.GetString(stBcrResult.stBcrInfoEx2[i].chCode);
Console.WriteLine(DateTime.Now + ":Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode.Trim().TrimEnd('\0') + "]");
}
else
if (!bIsValidUTF8)
{
string strCode = Encoding.GetEncoding("GB2312").GetString(stBcrResult.stBcrInfoEx2[i].chCode);
Console.WriteLine(DateTime.Now + ":外侧扫码器==>Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode.Trim().TrimEnd('\0') + "]");
log.Info(DateTime.Now + ":外侧扫码器==>Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode.Trim().TrimEnd('\0') + "]");
// RefreshMaterialCodeStrEvent?.Invoke(strCode.Trim().TrimEnd('\0'), ShellScannerIp);
if (strCode.Trim().TrimEnd('\0').Length == 20)
{
//更新扫码器存活时间
ShellLiveTime = DateTime.Now;
RefreshMaterialCodeStrEvent?.Invoke(strCode.Trim().TrimEnd('\0'), ShellScannerIp);
ProductCode = strCode;
// RefreshMaterialCodeStrEvent?.Invoke(strCode.Trim().TrimEnd('\0'), ShellScannerIp);
// 业务处理
}
else
if (strCode.Trim().TrimEnd('\0').Length == 13)
{
// 更新存活时间
LinerLiveTime = DateTime.Now;
Console.WriteLine(DateTime.Now + ":外侧扫码器==>条码:" + strCode.Trim().TrimEnd('\0') + "长度不为20当做No Read 处理");
log.Info(DateTime.Now + ":外侧扫码器==>条码:" + strCode.Trim().TrimEnd('\0') + "长度不为20当做No Read 处理");
Code69 = strCode;
// RefreshMaterialCodeStrEvent?.Invoke(strCode.Trim().TrimEnd('\0'), ShellScannerIp);
// 业务处理
}
}
}
Console.WriteLine("69:" + Code69);
Console.WriteLine("成品:" + ProductCode);
RefreshMaterialCodeStrEvent?.Invoke(ProductCode,Code69, ShellScannerIp);
}
MvCodeReader.MV_CODEREADER_OCR_INFO_LIST stOcrInfo = (MvCodeReader.MV_CODEREADER_OCR_INFO_LIST)Marshal.PtrToStructure(stFrameInfo.UnparsedOcrList.pstOcrList, typeof(MvCodeReader.MV_CODEREADER_OCR_INFO_LIST));
for (int i = 0; i < stOcrInfo.nOCRAllNum; i++)
{
string strOcrCharCode = Encoding.UTF8.GetString(stOcrInfo.stOcrRowInfo[i].chOcr);
// Console.WriteLine("Get OcrInfo:" + "ocrNum[" + i.ToString() + "], ocrLen[" + Convert.ToString(stOcrInfo.stOcrRowInfo[i].nOcrLen) + "], ocrChar[" + strOcrCharCode.Trim().TrimEnd('\0') + "]");
}
}
@ -125,24 +119,24 @@ namespace Aucma.Core.ProductOffLine.Business
var stFrameInfo = (MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2)Marshal.PtrToStructure(pstFrameInfoEx2, typeof(MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2));
MvCodeReader.MV_CODEREADER_RESULT_BCR_EX2 stBcrResult = (MvCodeReader.MV_CODEREADER_RESULT_BCR_EX2)Marshal.PtrToStructure(stFrameInfo.UnparsedBcrList.pstCodeListEx2, typeof(MvCodeReader.MV_CODEREADER_RESULT_BCR_EX2));
string Code69 = string.Empty;
string ProductCode = string.Empty;
//更新扫码器存活时间
LinerLiveTime = DateTime.Now;
// Console.WriteLine("CodeNum[" + Convert.ToString(stBcrResult.nCodeNum) + "]");
if (stBcrResult.nCodeNum == 0)
if (stBcrResult.nCodeNum < 2)
{
Console.WriteLine(DateTime.Now+":内侧--->No Read 处理");
Console.WriteLine(DateTime.Now + ":内侧--->No Read 处理");
log.Info(DateTime.Now + ":内侧--->No Read 处理");
// 更新存活时间
LinerLiveTime = DateTime.Now;
}
else
{
for (Int32 i = 0; i < stBcrResult.nCodeNum; i++)
{
bool bIsValidUTF8 = IsTextUTF8(stBcrResult.stBcrInfoEx2[i].chCode);
if (bIsValidUTF8)
{
string strCode = Encoding.UTF8.GetString(stBcrResult.stBcrInfoEx2[i].chCode);
Console.WriteLine(DateTime.Now + ":Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode.Trim().TrimEnd('\0') + "]");
}
else
if (!bIsValidUTF8)
{
string strCode = Encoding.GetEncoding("GB2312").GetString(stBcrResult.stBcrInfoEx2[i].chCode);
Console.WriteLine(DateTime.Now + ":内侧扫码器==>Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode.Trim().TrimEnd('\0') + "]");
@ -150,30 +144,21 @@ namespace Aucma.Core.ProductOffLine.Business
// RefreshMaterialCodeStrEvent?.Invoke(strCode.Trim().TrimEnd('\0'), LinerScannerIp);
if (strCode.Trim().TrimEnd('\0').Length == 20)
{
// 更新存活时间
LinerLiveTime = DateTime.Now;
// 业务处理
RefreshMaterialCodeStrEvent?.Invoke(strCode.Trim().TrimEnd('\0'), LinerScannerIp);
ProductCode = strCode;
}
else
if (strCode.Trim().TrimEnd('\0').Length == 13)
{
// 更新存活时间
LinerLiveTime = DateTime.Now;
Console.WriteLine(DateTime.Now + "内侧扫码器==>条码:" + strCode.Trim().TrimEnd('\0') + "长度不为20当做No Read 处理");
log.Info(DateTime.Now + "内侧扫码器==>条码:" + strCode.Trim().TrimEnd('\0') + "长度不为20当做No Read 处理");
}
Code69 = strCode;
}
}
MvCodeReader.MV_CODEREADER_OCR_INFO_LIST stOcrInfo = (MvCodeReader.MV_CODEREADER_OCR_INFO_LIST)Marshal.PtrToStructure(stFrameInfo.UnparsedOcrList.pstOcrList, typeof(MvCodeReader.MV_CODEREADER_OCR_INFO_LIST));
Console.WriteLine("ocrAllNum[" + Convert.ToString(stOcrInfo.nOCRAllNum) + "]");
for (int i = 0; i < stOcrInfo.nOCRAllNum; i++)
{
string strOcrCharCode = Encoding.UTF8.GetString(stOcrInfo.stOcrRowInfo[i].chOcr);
Console.WriteLine("Get OcrInfo:" + "ocrNum[" + i.ToString() + "], ocrLen[" + Convert.ToString(stOcrInfo.stOcrRowInfo[i].nOcrLen) + "], ocrChar[" + strOcrCharCode.Trim().TrimEnd('\0') + "]");
}
Console.WriteLine("69:" + Code69);
Console.WriteLine("成品:" + ProductCode);
RefreshMaterialCodeStrEvent?.Invoke(ProductCode,Code69, LinerScannerIp);
}
}

@ -80,6 +80,8 @@ namespace Aucma.Core.ProductOffLine.Business
// 过点数据表物料完成记录MaterialCompletion
private readonly IMaterialCompletionServices? _iMaterialCompletionServices = App.ServiceProvider.GetService<IMaterialCompletionServices>();
private readonly IBaseMaterialInfoServices? _baseMaterialInfoServices = App.ServiceProvider.GetService<IBaseMaterialInfoServices>();
private readonly ICodeBindingRecordServices? _codeBindingServices = App.ServiceProvider.GetService<ICodeBindingRecordServices>();
// 质检记录
private readonly IReportQualityInspectionServices? _reportQualityInspectionServices = App.ServiceProvider.GetService<IReportQualityInspectionServices>();
@ -126,69 +128,34 @@ namespace Aucma.Core.ProductOffLine.Business
public void test()
{
#region 成品条码与69码校验
//BaseMaterialInfo materialInfo = _baseMaterialInfoServices.FirstAsync(x => x.ProductCode == "6933973114570").Result;
//if (materialInfo == null)
//{
// Console.WriteLine();
//}
//if (!"BCD-212CFT".Contains(materialInfo.ProductName))
//{
// Console.WriteLine();
//}
#endregion
//OffLineInfo info11 = new OffLineInfo();
//info11.ProductSNCode = "test11";
//info11.PlcResult = 1;
//int flag = _offLineInfoServices.AddAsync(info11).Result;
//OffLineInfo info = _offLineInfoServices.FirstAsync(x => x.ProductSNCode == "test11").Result;
//info.PlcResult = 2;
//bool result = _offLineInfoServices.UpdateAsync(info).Result;
//Thread.Sleep(5000);
//TempOffLineInfo1.MsgInfo = "条码重复,上传间隔超过五分钟禁止放行,人工处理,上传时间:" + DateTime.Now;
//TempOffLineInfo1.MsgAlarmFlag = true;
//RefreshScanMateriaCodeEvent?.Invoke(TempOffLineInfo1);
//OffLineInfo info11 = new OffLineInfo();
//info11.ProductSNCode = "test111";
//int flag = _offLineInfoServices.AddAsync(info11).Result;
// private static readonly log4net.ILog log = LogManager.GetLogger(typeof(OffLineBusiness));
// string result = _productOffLineServices.QueryChecked("1520870000099E2V0004");
// string result = _productOffLineServices.QueryChecked("1530080CD0098E1V1714");
// Console.WriteLine(result);System.AggregateException:“One or more errors occurred. (ORA-01653: 表 C##AUCMA_SCADA.PRODUCT_OFFLINE 无法通过 8 (在表空间 AUCMA_SCADA 中) 扩展)”
// string strSave = _productOffLineServices.SaveBarcodeInfo("1520870000099E2V0004", "ILS_SORT", result.Replace("0000",""), 1);
// LogHelper.Info("成品码:1520870000099E2V0004"+strSave);
// string tt = "Y@1104@16160030000000910780@000010034895@@ @000000@000000009000004899@BCD-160C,家电下乡@@BCD-160C@皓月白-家电下乡@161601300@160@1-00版@家电下乡产品@默认@2010-09-01";
// string aa = appConfig.BarCodeAccount;
// string bb = appConfig.ProductlineCode;
// appConfig.BarCodeAccount = "123";
//TempOffLineInfo1.QualityResult = "失败";
//TempOffLineInfo1.ProductSNCode = "323222444"; //产品SN条码*1
//TempOffLineInfo1.ProductScanTime = System.DateTime.Now; // 扫码时间*2
//TempOffLineInfo1.MsgInfo = "条码质检失败:";
//RefreshScanMateriaCodeEvent?.Invoke(TempOffLineInfo1);
// Random random = new Random();
// MaterialBarScan("32160030000000912" + random.Next(100, 999), "10.10.92.141");
//Thread.Sleep(3000);
//Random random1 = new Random();
//MaterialBarScan("99160030000000912" + random1.Next(100, 999), "10.10.92.141");
//Thread.Sleep(3000);
//Random random2 = new Random();
//MaterialBarScan("44160030000000912" + random2.Next(100, 999), "10.10.92.141");
// }
// Thread.Sleep(1000);
// MaterialBarScanEvent("33160030000000910780", "192.168.1.20");
}
public void MaterialBarScan(string code, string scannerIp)
public void MaterialBarScan(string ProductCode, string Code69, string scannerIp)
{
Task.Run(() =>
{
MaterialBarScanHandle(code, scannerIp);
MaterialBarScanHandle(ProductCode, Code69, scannerIp);
});
}
/// <summary>
/// 处理条码
/// 条码处理
/// </summary>
/// <param name="code"></param>
/// <param name="scannerIp">扫码器IP</param>
public void MaterialBarScanHandle(string code,string scannerIp)
/// <param name="code">成品码</param>
/// <param name="code69">69码</param>
/// <param name="scannerIp"></param>
public void MaterialBarScanHandle(string code, string code69, string scannerIp)
{
try
{
@ -201,7 +168,7 @@ namespace Aucma.Core.ProductOffLine.Business
if (ScannerNo == 1) //内侧
{
//1.扫描的SN条码去条码系统校验
BackResult = HandleMaterialBarCode(code.Trim(), TempOffLineInfo1); //扫码器1
BackResult = HandleMaterialBarCode(code, code69, TempOffLineInfo1); //扫码器1
materialType = TempOffLineInfo1.ProductCode;
if (!BackResult)
{
@ -257,7 +224,7 @@ namespace Aucma.Core.ProductOffLine.Business
// 扫码器2
else if (ScannerNo == 2) // 外侧
{
BackResult = HandleMaterialBarCode(code.Trim(), TempOffLineInfo2); //扫码器2
BackResult = HandleMaterialBarCode(code, code69, TempOffLineInfo2); //扫码器2
materialType = TempOffLineInfo2.ProductCode;
if (!BackResult)
{
@ -314,7 +281,7 @@ namespace Aucma.Core.ProductOffLine.Business
}
catch (Exception ex)
{
log.Error("MaterialBarScanHandle异常:"+ex.Message.ToString());
log.Error("MaterialBarScanHandle异常:" + ex.Message.ToString());
}
}
@ -346,7 +313,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)
{
@ -369,13 +336,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;
//界面刷新
@ -391,7 +358,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;
//界面刷新
@ -406,7 +373,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订单完成数失败";
@ -417,7 +384,7 @@ namespace Aucma.Core.ProductOffLine.Business
}
#region 更新过点数据
if(bindingRecord1!=null && bindingRecord1.BoxCode!="")
if (bindingRecord1 != null && bindingRecord1.BoxCode != "")
{
PrintBarCode print = _printBarCodeServices.FirstAsync(x => x.MaterialBarcode == bindingRecord1.BoxCode).Result;
if (print != null)
@ -453,15 +420,17 @@ namespace Aucma.Core.ProductOffLine.Business
/// <summary>
/// 去条码系统查询校验并保存
/// 去条码系统查询与69码校验并保存条码系统
/// </summary>
/// <param name="BarCode"></param>
/// <param name="code69"> 69码</param>
/// <param name="TempOffLineInfo"></param>
/// <returns></returns>
public bool HandleMaterialBarCode(string BarCode,TempInfo TempOffLineInfo)
public bool HandleMaterialBarCode(string BarCode, string code69, TempInfo TempOffLineInfo)
{
try
{
// 1.质检
#region 1.质检--暂未启用
// List<ReportQualityInsPection> qualityList = _reportQualityInspectionServices.JudgeIsQualified(BarCode);
// if (qualityList != null)
//{
@ -480,6 +449,8 @@ namespace Aucma.Core.ProductOffLine.Business
// RefreshScanMateriaCodeEvent?.Invoke(TempOffLineInfo);
// return false;
//}
#endregion
TempOffLineInfo.QualityResult = "成功";
@ -487,11 +458,12 @@ namespace Aucma.Core.ProductOffLine.Business
TempOffLineInfo.ProductSNCode = BarCode.Trim(); //产品SN条码*1
TempOffLineInfo.ProductScanTime = System.DateTime.Now; // 扫码时间*2
log.Info("条码验证开始:" + BarCode);
log.Info("条码系统查询开始:" + BarCode);
//1.查询条码系统
string result = _productOffLineServices.QueryChecked(BarCode);
//string result = "Y@1104@16160030000000910780@000010034895@@ @000000@000000009000003987@BCD-160C,家电下乡@@BCD-160C@test皓月白-家电下乡@161601300@160@1-00版@家电下乡产品@默认@2010-09-01";
string[] FArrayList = new string[20];
if (result != null)
@ -529,6 +501,28 @@ namespace Aucma.Core.ProductOffLine.Business
TempOffLineInfo.ProductCirculate = FArrayList[16];//流通特性
TempOffLineInfo.ProductCreateDate = FArrayList[17];
#endregion
#region 成品条码与69码校验
BaseMaterialInfo materialInfo = _baseMaterialInfoServices.FirstAsync(x => x.ProductCode == code69).Result;
if(materialInfo == null)
{
TempOffLineInfo.MsgInfo = "69码校验失败:" + code69+"未在mes数据库找到信息!";
TempOffLineInfo.MsgAlarmFlag = true;
RefreshScanMateriaCodeEvent?.Invoke(TempOffLineInfo);
log.Info("69码校验失败:" + code69 + "未在mes数据库找到信息!");
return false;
}
if(!TempOffLineInfo.ProductName.Contains(materialInfo.ProductName))
{
TempOffLineInfo.MsgInfo = "69码校验失败,69码名称:" + materialInfo.ProductName + ";成品码名称:"+ TempOffLineInfo.ProductName;
TempOffLineInfo.MsgAlarmFlag = true;
RefreshScanMateriaCodeEvent?.Invoke(TempOffLineInfo);
log.Info("69码校验失败,69码名称:" + materialInfo.ProductName + ";成品码名称:" + TempOffLineInfo.ProductName);
return false;
}
#endregion
//界面刷新
// TempOffLineInfo.ProductRefreshFlag = true;
RefreshScanMateriaCodeEvent?.Invoke(TempOffLineInfo);
@ -630,7 +624,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 + ",上传条码成功";
@ -702,7 +696,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可以再次放行");
@ -794,7 +788,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;
@ -806,9 +800,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;
@ -834,7 +828,7 @@ namespace Aucma.Core.ProductOffLine.Business
// 等待plc反馈信号
while (true)
{
if(DateTime.Now > targetTime) // plc超最大时限无反馈
if (DateTime.Now > targetTime) // plc超最大时限无反馈
{
log.Info("等待plc放行反馈信号超时");
result = false;

Loading…
Cancel
Save