Commit 00ef47b4 by jiawei.su

fixedbug

parent 0960ff7a
......@@ -45,7 +45,7 @@ namespace Siger.ApiACC.Controllers
private readonly IAutomationSectionPropertyRepository _automationSectionProperty;
private readonly IAutomationProduceHistoryRepository _automationProduceHistory;
private readonly ISigerProjectProductReport _sigerProjectProduct;
private readonly IProductPlanDetails _planDetails;
public AutomationController(IUnitOfWork unitOfWork, ISigerProjectLevelSectionRepository sigerProjectLevelSection, IAutomationLineMode automationLineMode, IAutomationMachineStatus automationMachineStatus, ISigerDict sigerDict, IAutomationTaskListRepository automationTaskList,
ISigerProjectMachineAttributionRepository sigerProjectMachineAttribution, IAutomationFixtureMonitor automationFixtureMonitor, IAutomationLocationRepository automationLocation, IProductionBeatSetRepository productionBeatSet, IAutomationFixtureToolsProductRepository automationFixtureToolsProduct,
......@@ -312,8 +312,7 @@ namespace Siger.ApiACC.Controllers
// 业务入口: 上料位-》 入库 如果是上料工装 安装完成 ,绑定 储位与装配
if (sectionProperty.propertytype == 1)
{
//上下料位状态 为后台控制
var machineStatusObj = _automationMachineStatus.Get(f => f.section == taskObj.extend1.ToInt());
var download = false;
if (sectionProperty.down > 2)
......@@ -339,6 +338,8 @@ namespace Siger.ApiACC.Controllers
sectionProperty.down = 0;
_automationSectionProperty.Update(sectionProperty);
//上下料位状态 为后台控制
var machineStatusObj = _automationMachineStatus.Get(f => f.section == taskObj.extend1.ToInt());
if (machineStatusObj != null)
{
machineStatusObj.status = (int)Automation.MachineStatus.Waiting;
......@@ -358,6 +359,8 @@ namespace Siger.ApiACC.Controllers
location.status = (int)LocationStatus.Out;
_automationLocation.Update(location);
//上下料位状态 为后台控制
var machineStatusObj = _automationMachineStatus.Get(f => f.section == taskObj.extend1.ToInt());
if (machineStatusObj != null)
{
machineStatusObj.status = (int)Automation.MachineStatus.Produce;
......@@ -367,6 +370,8 @@ namespace Siger.ApiACC.Controllers
//需要抽检时(准备下料) ,立库到抽检台
if (taskObj.action == TaskAction.Step_LK_CJT)
{
//QC 设备状态 为后台控制
var machineStatusObj = _automationMachineStatus.Get(f => f.section == taskObj.sectionid);
if (machineStatusObj != null)
{
machineStatusObj.status = (int)Automation.MachineStatus.Produce;
......@@ -399,39 +404,39 @@ namespace Siger.ApiACC.Controllers
{
//插入报工记录
var entity = new siger_project_product_report
{
draw_number = "",
plan_id = 0,
product_name = taskObj.productname,
code = taskObj.ordercode,
end_time = UnixTimeHelper.GetNow(),
station = taskObj.sectionid,
industrial_waste = 0,
material_waste = 0,
start_time = UnixTimeHelper.GetNow(),
worker_code = "",
worker_name = "",
uid = 0,
projectid = PID,
time = UnixTimeHelper.GetNow(),
processid = 0,
nok_number = 0,
output = 1,
actual_output = 1,
product_code = taskObj.productcode
};
if (_sigerProjectProduct.InsertProductReportData(entity) < 0)
{
throw new BadRequestException(AccEnum.SyncSnReportErro);
}
//var entity = new siger_project_product_report
//{
// draw_number = "",
// plan_id = 0,
// product_name = taskObj.productname,
// code = taskObj.ordercode,
// end_time = UnixTimeHelper.GetNow(),
// station = taskObj.sectionid,
// industrial_waste = 0,
// material_waste = 0,
// start_time = UnixTimeHelper.GetNow(),
// worker_code = "",
// worker_name = "",
// uid = 0,
// projectid = PID,
// time = UnixTimeHelper.GetNow(),
// processid = 0,
// nok_number = 0,
// output = 1,
// actual_output = 1,
// product_code = taskObj.productcode
//};
//if (_sigerProjectProduct.InsertProductReportData(entity) < 0)
//{
// throw new BadRequestException(AccEnum.SyncSnReportErro);
//}
}
}
//抽检台
if (sectionProperty.propertytype == 3)
{
var machineStatusObj = _automationMachineStatus.Get(f => f.section == taskObj.sectionid);
if (taskObj.action == TaskAction.Step_LK_CJT)
{
......@@ -440,6 +445,15 @@ namespace Siger.ApiACC.Controllers
}
if (taskObj.action == TaskAction.Step_CJT_SXLW)
{
//抽检台 空闲
var qcStatusObj = _automationMachineStatus.Get(f => f.section == taskObj.extend1.ToInt());
if (qcStatusObj != null)
{
qcStatusObj.status = (int)Automation.MachineStatus.Waiting;
_automationMachineStatus.Update(qcStatusObj);
}
//上料位加工中
var machineStatusObj = _automationMachineStatus.Get(f => f.section == taskObj.sectionid);
if (machineStatusObj != null)
{
machineStatusObj.status = (int)Automation.MachineStatus.Produce;
......@@ -452,17 +466,14 @@ namespace Siger.ApiACC.Controllers
Logger.WriteLineInfo($"PlCfeeback 未找到该工装储位信息");
throw new BadRequestException(AccEnum.MachineDisable);
}
//上料中
if (_Property.upload != 0)
{
_Property.upload += 1;
_automationSectionProperty.Update(_Property);
}
//下料料
if (_Property.down != 0)
{
_Property.down += 1;
_automationSectionProperty.Update(_Property);
}
}
}
......@@ -498,7 +509,7 @@ namespace Siger.ApiACC.Controllers
if (sectionProperty.propertytype==5)
{
//上下料位状态 为后台控制
var machineStatusObj = _automationMachineStatus.Get(f => f.section == taskObj.extend1.ToInt());
var machineStatusObj = _automationMachineStatus.Get(f => f.section == taskObj.sectionid);
//从立库储位拿SN 工件到上料位
if (taskObj.action == TaskAction.Step_LK_SXLW)
{
......
......@@ -204,7 +204,7 @@ namespace Siger.ApiACC.Controllers
}
var section = taskobj.extend1.ToInt();
//抽检台-》上料位特殊逻辑
if (taskobj.action == Automation.TaskAction.Step_LK_CJT || taskobj.action == Automation.TaskAction.Step_CJT_SXLW)
if (taskobj.action == Automation.TaskAction.Step_LK_CJT || taskobj.action == Automation.TaskAction.Step_CJT_SXLW || taskobj.action == TaskAction.Step_LK_JGZX || taskobj.action == TaskAction.Step_LK_SXLW)
{
section = taskobj.sectionid;
}
......@@ -214,6 +214,7 @@ namespace Siger.ApiACC.Controllers
{
throw new BadRequestException(CommonEnum.RecordNotFound);
}
var host = GetHost();
if (string.IsNullOrEmpty(host))
{
......@@ -224,6 +225,7 @@ namespace Siger.ApiACC.Controllers
{
throw new BadRequestException(AccEnum.FixtureToolsIsNone);
}
Logger.WriteLineInfo($"自动下发->PLC : {EnumHelper.GetEnumDesc(taskobj.action)}Section:{section} machine:{attr.machine}");
var sendToPLC = new RequestPLC
{
ProductCode=taskobj.productcode,
......
......@@ -49,7 +49,7 @@ namespace Siger.ApiACC.Tasks
var section = task.extend1.ToInt();
//抽检台-》上料位特殊逻辑
if (task.action==Automation.TaskAction.Step_LK_CJT || task.action == Automation.TaskAction.Step_CJT_SXLW)
if (task.action==Automation.TaskAction.Step_LK_CJT || task.action == Automation.TaskAction.Step_CJT_SXLW || task.action==TaskAction.Step_LK_JGZX || task.action==TaskAction.Step_LK_SXLW)
{
section = task.sectionid;
}
......@@ -59,7 +59,7 @@ namespace Siger.ApiACC.Tasks
var attr = dbhelper.GetAttribution(section);
if (attr == null)
return;
Logger.WriteLineInfo($"自动下发->PLC : {EnumHelper.GetEnumDesc(task.action)}Section:{section} machine:{attr.machine}");
var fixtrue = dbhelper.GetFixture(task.fixtureguid);
if (fixtrue==null)
{
......
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