Commit 39f38270 by yiyu.li
parents ede261f1 c10b6822
......@@ -321,52 +321,7 @@ namespace Siger.ApiACC.Controllers
_automationFixtureMonitor.Update(monitor);
}
}
else if (taskObj.action == TaskAction.Step_LK_CJT || taskObj.action == TaskAction.Step_LK_JGZX || taskObj.action == TaskAction.Step_LK_SXLW)
{
//出库
var location = _automationLocation.Get(f => f.fixturetools == taskObj.fixtureguid);
if (location != null)
{
location.ordernumber = "";
location.productcode = "";
location.productid =0;
location.sn = "";
}
}else
{
//更新 CNC 状态
var monitor = _automationFixtureMonitor.Get(f => f.section == taskObj.sectionid);
if (monitor == null)
{
_automationFixtureMonitor.Insert(new siger_automation_fixture_tools_monitor
{
ordernumber = taskObj.ordercode,
productCode = taskObj.productcode,
//productNam
section = taskObj.sectionid,
status = status,
sn = taskObj.sn,
fixtureguid = taskObj.fixtureguid,
//fixturename=,
locationId = taskObj.locationid,
createtime = DateTime.Now,
projectId = PID,
route = 0,
updatetime = DateTime.Now,
});
}
else
{
monitor.ordernumber = taskObj.ordercode;
monitor.productCode = taskObj.productcode;
monitor.status = taskObj.status;
monitor.sn = taskObj.sn;
monitor.locationId = taskObj.locationid;
monitor.updatetime = DateTime.Now;
_automationFixtureMonitor.Update(monitor);
}
}
}
}
......@@ -427,9 +382,6 @@ namespace Siger.ApiACC.Controllers
if (cleanMachine.status == (int)Automation.MachineStatus.Complated)
{
Logger.WriteLineInfo($"AutoProcess 有清洗机完成,创建清洗机Task");
// var fixtureToolsObj = _automationFixtureTools.GetProductFixtureLocation(PID,);
var monitor = _automationFixtureMonitor.Get(f => f.section == cleanMachine.section);
if (monitor != null)
{
......@@ -448,20 +400,38 @@ namespace Siger.ApiACC.Controllers
var location = SelectLocation(freeMachine.machineid);
if (location != null)
{
_automationFixtureMonitor.Insert(new siger_automation_fixture_tools_monitor
var monitor = _automationFixtureMonitor.Get(f => f.section == freeMachine.section);
if (monitor == null)
{
_automationFixtureMonitor.Insert(new siger_automation_fixture_tools_monitor
{
projectId = PID,
productId=location.productId,
productCode = location.productCode,
productName = location.productName,
fixtureguid = location.fixture,
fixturename = location.fixturename,
ordernumber = location.ordernumber,
locationId = location.location,
section = freeMachine.section,
sn = location.sn,
createtime = DateTime.Now,
updatetime = DateTime.Now
});
}
else
{
productId = PID,
productCode = location.productCode,
//productName=location.productCode
fixtureguid = location.fixture,
fixturename = location.fixturename,
ordernumber = location.ordernumber,
locationId = location.location,
section = freeMachine.section,
sn = location.sn,
createtime = DateTime.Now,
updatetime = DateTime.Now
});
monitor.productId = location.productId;
monitor.productCode = location.productCode;
monitor.productName = location.productName;
monitor.fixtureguid = location.fixture;
monitor.fixturename = location.fixturename;
monitor.ordernumber = location.ordernumber;
monitor.locationId = location.location;
monitor.sn = location.sn;
monitor.updatetime = DateTime.Now;
_automationFixtureMonitor.Update(monitor);
}
CreateTask(freeMachine, TaskActionType.Load, TaskAction.Step_LK_JGZX, location.fixture, location.ordernumber, location.sn, location.pn,location.productId, location.productCode, location.location);
return; //完成当前任务 退出
}
......
......@@ -202,7 +202,7 @@ namespace Siger.ApiACC.Controllers
throw new BadRequestException(RequestEnum.LocationNull);
}
var exsit = _autoLocationRepository.Get(q => q.projectId == ProjectId && q.status == (int)RowState.Valid &&
(q.fixturetools == req.fixturetoolid || q.locationid == req.locationid.ToInt()));
(q.fixturetools == fixturetool.guid || q.location_cid == req.locationid.ToInt()));
if(exsit != null)
{
throw new BadRequestException(RequestEnum.DataExist);
......@@ -258,7 +258,7 @@ namespace Siger.ApiACC.Controllers
throw new BadRequestException(RequestEnum.LocationNull);
}
var exsit = _autoLocationRepository.Get(q => q.projectId == ProjectId && q.status == (int)RowState.Valid &&
(q.fixturetools == req.fixturetoolid || q.locationid == req.locationid.ToInt()) && q.id != req.id);
(q.fixturetools == fixturetool.guid || q.location_cid == req.locationid.ToInt()) && q.id != req.id);
if (exsit != null)
{
throw new BadRequestException(RequestEnum.DataExist);
......
......@@ -336,10 +336,10 @@ namespace Siger.ApiACC.Controllers
{
throw new BadRequestException(AccEnum.MachineDisable);
}
if (machineStatus.status == (int)Automation.MachineStatus.Waiting)
{
throw new BadRequestException(AccEnum.MachineOnFree);
}
//if (machineStatus.status == (int)Automation.MachineStatus.Waiting)
//{
// throw new BadRequestException(AccEnum.MachineOnFree);
//}
//if (machineStatus.status == (int)Automation.MachineStatus.Complated)
//{
// throw new BadRequestException(AccEnum.MachineProCompalate);
......
......@@ -268,7 +268,8 @@ CREATE TABLE IF NOT EXISTS `siger_automation_fixture_tools_product` (
CREATE TABLE IF NOT EXISTS `siger_automation_location` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`guid` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`locationid` int(11) NOT NULL DEFAULT 0 COMMENT '储位位置',
`location_cid` int(11) NOT NULL DEFAULT 0 COMMENT '储位自增ID',
`locationid` int(11) NOT NULL DEFAULT 0 COMMENT '储位位置',
`fixturetools` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工装GUID',
`fixturename` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工装GUID',
`productid` int(11) NULL DEFAULT 0 COMMENT '产品ID',
......
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