Commit 6faa999e by jiawei.su

someupdate

parent 3f0e0000
......@@ -161,7 +161,7 @@ namespace Siger.ApiACC.Controllers
throw new BadRequestException(AccEnum.AutomationDictNotfound);
}
var tasklist = _automationTaskList.GetList(f => f.projectId == PID && f.status >= (int)TaskResultStatus.Cancel && f.status < (int)TaskResultStatus.Complated);
var tasklist = _automationTaskList.GetList(f => f.projectId == PID && f.status < (int)TaskResultStatus.Complated);
if (!tasklist.Any())
{
Logger.WriteLineInfo($"LineMode Mode=1 触发自动任务检查");
......@@ -231,7 +231,7 @@ namespace Siger.ApiACC.Controllers
}
//是否还有未完成任务
var taskDone = _automationTaskList.Get(f => f.projectId == PID && f.status > (int)TaskResultStatus.Cancel && f.status < (int)TaskResultStatus.Complated);
var taskDone = _automationTaskList.Get(f => f.projectId == PID && f.status < (int)TaskResultStatus.Complated);
if(taskDone!=null)
{
//还有未完成任务 退出 等待任务下发
......
......@@ -103,7 +103,7 @@ namespace Siger.ApiACC.Controllers
var machintAttr = _sigerProjectMachineAttribution.Get(f => f.station == section.id);
if(machintAttr==null)
{
Logger.WriteLineInfo($"GetloadStation 未配置清洗工站字典");
Logger.WriteLineInfo($"GetloadStation 未配置工站字典");
continue;
}
var loadStatus = (int)Automation.MachineStatus.Waiting;
......@@ -118,8 +118,10 @@ namespace Siger.ApiACC.Controllers
section=section.id,
updatetime=DateTime.Now
});
}else
{
loadStatus = machineStatus.status;
}
data.Add(new ResponseLoadStation {
......@@ -128,6 +130,8 @@ namespace Siger.ApiACC.Controllers
status=loadStatus
});
}
_unitOfWork.Commit();
return new ObjectResult(data);
}
......@@ -281,6 +285,7 @@ namespace Siger.ApiACC.Controllers
createtime=DateTime.Now,
updatetime=DateTime.Now,
status=(int)Automation.MachineStatus.Produce,
productId=plan.product_id,
productCode=plan.product_code,
productName=plan.product_name,
ordernumber=plandts.OrderNumber,
......@@ -293,6 +298,7 @@ namespace Siger.ApiACC.Controllers
monitor.section = loading.section;
monitor.updatetime = DateTime.Now;
monitor.status = (int)Automation.MachineStatus.Produce;
monitor.productId = plan.product_id;
monitor.productName = plan.product_name;
monitor.productCode = plan.product_code;
monitor.ordernumber = plandts.OrderNumber;
......@@ -334,10 +340,10 @@ namespace Siger.ApiACC.Controllers
{
throw new BadRequestException(AccEnum.MachineOnFree);
}
if (machineStatus.status == (int)Automation.MachineStatus.Complated)
{
throw new BadRequestException(AccEnum.MachineProCompalate);
}
//if (machineStatus.status == (int)Automation.MachineStatus.Complated)
//{
// throw new BadRequestException(AccEnum.MachineProCompalate);
//}
if (!_automationTaskList.CanTask(ProjectId, assemble.section))
{
......@@ -349,6 +355,8 @@ namespace Siger.ApiACC.Controllers
{
throw new BadRequestException(AccEnum.MonitorNotfound);
}
//移出 上料位
monitor.status = (int)Automation.MachineStatus.Waiting;
......@@ -368,7 +376,7 @@ namespace Siger.ApiACC.Controllers
completetime = DateTime.MinValue,
trigger = Automation.TaskTrigerType.Manual,
projectId = ProjectId,
productid = 0,
productid = monitor.pr,
sn = monitor.sn,
ordercode = monitor.ordernumber,
fixtureguid = monitor.fixtureguid,
......
......@@ -69,6 +69,7 @@ namespace Siger.ApiACC.Controllers
item.sn = fixture.sn;
item.fixtureCode = fixture.fixtureguid;
item.fixtureName = fixture.fixturename;
item.status = fixture.status;
}
result.Add(item);
......
......@@ -40,6 +40,10 @@ namespace Siger.Middlelayer.AccRepository.Entities
public DateTime updatetime { get; set; }
public string ordernumber { get; set; }
/// <summary>
/// 产品ID
/// </summary>
public int productId { get; set; }
/// <summary>
///
/// </summary>
public string productCode { get; set; }
......
......@@ -27,7 +27,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
public bool CanTask(int projectId,int section)
{
var taskObj = _context.siger_automation_task_list.FirstOrDefault(f => f.projectId == projectId && f.status >= (int)TaskResultStatus.Cancel && f.status < (int)TaskResultStatus.Complated);
var taskObj = _context.siger_automation_task_list.FirstOrDefault(f => f.projectId == projectId && f.status < (int)TaskResultStatus.Complated);
if (taskObj==null)
return true;
......
......@@ -267,6 +267,7 @@ 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 '储位位置',
`fixturetools` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工装GUID',
`productid` int(11) NULL DEFAULT 0 COMMENT '产品ID',
......@@ -401,7 +402,7 @@ CREATE TABLE `siger_automation_produce_history` (
`statusid` int(11) NOT NULL DEFAULT 0 COMMENT '设备状态ID',
`section` int(11) NOT NULL DEFAULT 0 COMMENT '产线ID',
`projectid` int(11) NOT NULL DEFAULT 0,
`productid` int(1) NOT NULL DEFAULT 1 COMMENT '产品ID',
`productid` int(11) NULL DEFAULT 0 COMMENT '产品ID',
`productcode` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品编号',
`productname` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品名称',
`locationid` int(11) NOT NULL DEFAULT 0 COMMENT '储位ID',
......@@ -432,6 +433,7 @@ CREATE TABLE `siger_automation_fixture_tools_moniter` (
`createtime` datetime(0) NULL DEFAULT NULL COMMENT '添加时间',
`updatetime` datetime(0) NULL DEFAULT NULL COMMENT '操作时间',
`ordernumber` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工令单',
`productid` int(11) NULL DEFAULT 0 COMMENT '产品ID',
`productCode` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品CODE',
`productName` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品名称',
`locationId` int(11) NOT NULL DEFAULT 0,
......
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