|
|
|
@ -31,6 +31,7 @@ using System.Text;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Aucma.Core.ProductOffLine.Business
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
@ -112,7 +113,7 @@ namespace Aucma.Core.ProductOffLine.Business
|
|
|
|
|
GunBusiness.RefreshMaterialCodeStrEvent += MaterialBarScan;
|
|
|
|
|
HandSendPlcWindow.SendPlcPassEvent += DownLoadPassFlag;
|
|
|
|
|
|
|
|
|
|
// test();
|
|
|
|
|
// test();
|
|
|
|
|
}
|
|
|
|
|
#region 变量定义
|
|
|
|
|
/// <summary>
|
|
|
|
@ -124,27 +125,24 @@ namespace Aucma.Core.ProductOffLine.Business
|
|
|
|
|
|
|
|
|
|
public void test()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//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;
|
|
|
|
|
|
|
|
|
|
Task.Run(() =>
|
|
|
|
|
{
|
|
|
|
|
CodeBindingRecord bindingRecord1 = _codeBindingServices.FirstAsync(x => x.ProductCode == "1510080000099E3C0600").Result;
|
|
|
|
|
|
|
|
|
|
//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");
|
|
|
|
@ -418,22 +416,26 @@ namespace Aucma.Core.ProductOffLine.Business
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 暂时不启用,因为还没打箱体码,查不到数据,更新过点数据
|
|
|
|
|
//PrintBarCode print = _printBarCodeServices.FirstAsync(x => x.MaterialBarcode == bindingRecord1.BoxCode).Result;
|
|
|
|
|
//if (print != null)
|
|
|
|
|
//{
|
|
|
|
|
// MaterialCompletion completion = new MaterialCompletion();
|
|
|
|
|
// completion.OrderCode = print.OrderCode;
|
|
|
|
|
// completion.MaterialBarcode = bindingRecord1.BoxCode;
|
|
|
|
|
// completion.MaterialCode = print.MaterialCode;
|
|
|
|
|
// completion.MaterialName = print.MaterialName;
|
|
|
|
|
// completion.StationName = "1009";
|
|
|
|
|
// completion.CompleteDate = DateTime.Now;
|
|
|
|
|
// completion.ProductLineCode = "CX_02";
|
|
|
|
|
// completion.isDownLine = 1;
|
|
|
|
|
// _ = _iMaterialCompletionServices.AddAsync(completion).Result;
|
|
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
#region 更新过点数据
|
|
|
|
|
if(bindingRecord1!=null && bindingRecord1.BoxCode!="")
|
|
|
|
|
{
|
|
|
|
|
PrintBarCode print = _printBarCodeServices.FirstAsync(x => x.MaterialBarcode == bindingRecord1.BoxCode).Result;
|
|
|
|
|
if (print != null)
|
|
|
|
|
{
|
|
|
|
|
MaterialCompletion completion = new MaterialCompletion();
|
|
|
|
|
completion.OrderCode = print.OrderCode;
|
|
|
|
|
completion.MaterialBarcode = bindingRecord1.BoxCode;
|
|
|
|
|
completion.MaterialCode = print.MaterialCode;
|
|
|
|
|
completion.MaterialName = print.MaterialName;
|
|
|
|
|
completion.StationName = "1009";
|
|
|
|
|
completion.CompleteDate = DateTime.Now;
|
|
|
|
|
completion.ProductLineCode = "CX_02";
|
|
|
|
|
completion.isDownLine = 1;
|
|
|
|
|
completion.ProductionCode = TempOffLineInfo.ProductSNCode;
|
|
|
|
|
_ = _iMaterialCompletionServices.AddAsync(completion).Result;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|