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