|
|
@ -85,7 +85,7 @@ namespace SlnMesnac.Business
|
|
|
|
|
|
|
|
|
|
|
|
_configInfoBusiness = configInfoBusiness;
|
|
|
|
_configInfoBusiness = configInfoBusiness;
|
|
|
|
|
|
|
|
|
|
|
|
// TestTran();
|
|
|
|
TestTran();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -93,23 +93,24 @@ namespace SlnMesnac.Business
|
|
|
|
|
|
|
|
|
|
|
|
public void TestTran()
|
|
|
|
public void TestTran()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
//try
|
|
|
|
sqlSugarClient.AsTenant().BeginTran();
|
|
|
|
//{
|
|
|
|
BaseRealTask localPlan = _baseRealTaskService.GetExeTask();
|
|
|
|
// sqlSugarClient.AsTenant().BeginTran();
|
|
|
|
localPlan.Status = 2;
|
|
|
|
// BaseRealTask localPlan = _baseRealTaskService.GetExeTask();
|
|
|
|
sqlSugarClient.AsTenant().GetConnection("local").Updateable(localPlan).ExecuteCommand();
|
|
|
|
// localPlan.Status = 2;
|
|
|
|
GenerateBarcode(40);
|
|
|
|
// sqlSugarClient.AsTenant().GetConnection("local").Updateable(localPlan).ExecuteCommand();
|
|
|
|
// throw new Exception("事务测试");
|
|
|
|
// GenerateBarcode(40);
|
|
|
|
sqlSugarClient.AsTenant().CommitTran();
|
|
|
|
// // throw new Exception("事务测试");
|
|
|
|
Console.WriteLine("提交事务");
|
|
|
|
// sqlSugarClient.AsTenant().CommitTran();
|
|
|
|
|
|
|
|
// Console.WriteLine("提交事务");
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
//}
|
|
|
|
{
|
|
|
|
//catch (Exception ex)
|
|
|
|
sqlSugarClient.AsTenant().RollbackTran();
|
|
|
|
//{
|
|
|
|
Console.WriteLine(ex.Message);
|
|
|
|
// sqlSugarClient.AsTenant().RollbackTran();
|
|
|
|
}
|
|
|
|
// Console.WriteLine(ex.Message);
|
|
|
|
|
|
|
|
//}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private async void testRFID()
|
|
|
|
private async void testRFID()
|
|
|
@ -211,6 +212,7 @@ namespace SlnMesnac.Business
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BaseRealTask task = _baseRealTaskService.GetExeTask();
|
|
|
|
BaseRealTask task = _baseRealTaskService.GetExeTask();
|
|
|
|
if (task != null)
|
|
|
|
if (task != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -219,6 +221,7 @@ namespace SlnMesnac.Business
|
|
|
|
Thread.Sleep(5000);
|
|
|
|
Thread.Sleep(5000);
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!plc.readBoolByAddress(GetPlcAddressByConfigKey("设备叫料")))
|
|
|
|
if (!plc.readBoolByAddress(GetPlcAddressByConfigKey("设备叫料")))
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -333,7 +336,6 @@ namespace SlnMesnac.Business
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//TODO根据本地叫料计划查询对应的mes计划,完成
|
|
|
|
//TODO根据本地叫料计划查询对应的mes计划,完成
|
|
|
|
prodPlan = _mesProductPlanService.GetStartedProdPlan(out MesProductPlanDto productPlanDto);
|
|
|
|
prodPlan = _mesProductPlanService.GetStartedProdPlan(out MesProductPlanDto productPlanDto);
|
|
|
|
|
|
|
|
|
|
|
@ -389,9 +391,18 @@ namespace SlnMesnac.Business
|
|
|
|
//1.完成本地计划
|
|
|
|
//1.完成本地计划
|
|
|
|
if (localPlan != null)
|
|
|
|
if (localPlan != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
localPlan.Status = 2;
|
|
|
|
List<BaseRealTask> localList = _baseRealTaskService.Query(x => x.Status != 2);
|
|
|
|
localPlan.UpdateTime = DateTime.Now;
|
|
|
|
foreach (var item in localList)
|
|
|
|
sqlSugarClient.AsTenant().GetConnection("local").Updateable(localPlan).ExecuteCommand();
|
|
|
|
{
|
|
|
|
|
|
|
|
item.Status = 2;
|
|
|
|
|
|
|
|
item.UpdateTime = DateTime.Now;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
sqlSugarClient.AsTenant().GetConnection("local").Updateable(localList).ExecuteCommand();
|
|
|
|
|
|
|
|
//localPlan.Status = 2;
|
|
|
|
|
|
|
|
//localPlan.UpdateTime = DateTime.Now;
|
|
|
|
|
|
|
|
//sqlSugarClient.AsTenant().GetConnection("local").Updateable(localPlan).ExecuteCommand();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//2.生成小包条码
|
|
|
|
//2.生成小包条码
|
|
|
|
GenerateBarcode(40);
|
|
|
|
GenerateBarcode(40);
|
|
|
|