Commit ba1c7d76 by xin.yang
parents 94d845c2 9575be19
......@@ -562,36 +562,57 @@ namespace Siger.ApiACC.Controllers
var TempList = new List<ResponseAutoRouteInfo>();
foreach (var b in beats)
{
var autoLocation = _automationLocation.Get(f => f.projectId == b.projectID && !string.IsNullOrEmpty(f.sn) && f.routeid == b.route_number.ToInt() && f.productid == b.product_name.ToInt());
if (autoLocation == null)
continue;
if(autoLocation.status==2)
Logger.WriteLineError($"SelectLocation 设备{b.machineID}标准节拍{b.route_number}{b.route_name}");
var autoLocationIds = _automationLocation.GetList(f => f.projectId == b.projectID && f.routeid == b.route_number.ToInt() && f.productid == b.product_name.ToInt());
if (!autoLocationIds.Any())
{
//SN不在立库内
Logger.WriteLineError($"SelectLocation 当前储位工件不在储位上");
Logger.WriteLineError($"SelectLocation 设备{b.machineID} routeid:{b.route_number}-{b.route_name}productId:{b.product_name} 没有匹配到当前储位");
continue;
}
TempList.Add(new ResponseAutoRouteInfo
foreach (var autoLocation in autoLocationIds)
{
FixtureGuid=autoLocation.fixturetools,
FixtureName=autoLocation.fixturename,
Section=b.section_id,
Machine=b.machineID,
Pn=b.process_number,
ProductId=b.product_name.ToInt(),
ProductName=b.product_name_text,
Location=autoLocation.locationid,
Route=b.route_number.ToInt(),
RouteName=b.route_name,
OrderNo=autoLocation.ordernumber,
Sn=autoLocation.sn,
LId=autoLocation.id
});
if (string.IsNullOrEmpty(autoLocation.sn))
{
Logger.WriteLineError($"SelectLocation 设备{b.machineID} routeid:{b.route_number}-{b.route_name}productId:{b.product_name} 储位{autoLocation.locationid}没有SN工件");
continue;
}
if (autoLocation.status == 2)
{
//SN不在立库内
Logger.WriteLineError($"SelectLocation 设备{b.machineID} routeid:{b.route_number}-{b.route_name}productId:{b.product_name} 储位{autoLocation.locationid}工件Sn:{autoLocation.sn}不在储位上");
continue;
}
Logger.WriteLineError($"SelectLocation beasetId:{b.id}标准节拍{b.route_number}{b.route_name} 有效订单");
TempList.Add(new ResponseAutoRouteInfo
{
FixtureGuid = autoLocation.fixturetools,
FixtureName = autoLocation.fixturename,
Section = b.section_id,
Machine = b.machineID,
Pn = b.process_number,
ProductId = b.product_name.ToInt(),
ProductCode=autoLocation.productcode,
ProductName = b.product_name_text,
Location = autoLocation.locationid,
Route = b.route_number.ToInt(),
RouteName = b.route_name,
OrderNo = autoLocation.ordernumber,
Sn = autoLocation.sn,
LId = autoLocation.id
});
Logger.WriteLineError($"SelectLocation 有效订单号{autoLocation.ordernumber}");
}
}
if (!TempList.Any())
{
Logger.WriteLineError($"SelectLocation 没有匹配到有效订单号");
return null;
}
var ordernos = TempList.Select(f => f.OrderNo).ToList();
// 取产品交期最近的订单
var planOrder = _automationFixtureToolsProduct.GetDeliveryOrder(ordernos, PID);
......@@ -612,7 +633,7 @@ namespace Siger.ApiACC.Controllers
ordernumber =result.OrderNo,
location=result.Location,
productId=result.ProductId,
//productCode=result.productcode,
productCode = result.ProductCode,
productName = result.ProductName,
sn =result.Sn,
pn= result.Pn,
......
......@@ -227,7 +227,8 @@ namespace Siger.ApiACC.Controllers
RobotStep = (int)taskobj.action,
StorageNo = taskobj.locationid,
SN = taskobj.sn,
Program = taskobj.programnumber
Program = taskobj.programnumber,
TaskType=(int)taskobj.tasktype
};
var result = PushTask(host, sendToPLC, out string message);
......
......@@ -66,7 +66,8 @@ namespace Siger.ApiACC.Tasks
RobotStep = (int)task.action,
StorageNo = task.locationid,
SN = task.sn,
Program = task.programnumber
Program = task.programnumber,
TaskType = (int)task.tasktype
};
Logger.WriteLineError($"TASK 开始下发 : {EnumHelper.GetEnumDesc(task.action)}");
......
......@@ -37,6 +37,8 @@ namespace Siger.Middlelayer.AccRepository.Request
public string Program { get; set; }
public int LineID { get; set; }
public int TaskType { get; set; }
}
public class ResponsePlC
......
......@@ -56,6 +56,7 @@ namespace Siger.Middlelayer.AccRepository.Response
public int Machine { get; set; }
public string Pn { get; set; }
public int ProductId { get; set; }
public string ProductCode { get; set; }
public string ProductName { get; set; }
public int Route { get; set; }
public string RouteName { get; set; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment