Commit ae802d94 by jiawei.su

fixedbug

parent 4347f924
...@@ -243,6 +243,7 @@ namespace Siger.ApiACC.Controllers ...@@ -243,6 +243,7 @@ namespace Siger.ApiACC.Controllers
Logger.WriteLineInfo($"AutoProcess 未配置设备类型字典"); Logger.WriteLineInfo($"AutoProcess 未配置设备类型字典");
throw new BadRequestException(AccEnum.AutomationDictNotfound); throw new BadRequestException(AccEnum.AutomationDictNotfound);
} }
//更新Tasklist //更新Tasklist
PlCfeeback(taskObj, request.status, stationDicts); PlCfeeback(taskObj, request.status, stationDicts);
...@@ -295,6 +296,7 @@ namespace Siger.ApiACC.Controllers ...@@ -295,6 +296,7 @@ namespace Siger.ApiACC.Controllers
taskObj.completetime = DateTime.Now; taskObj.completetime = DateTime.Now;
_automationTaskList.Update(taskObj); _automationTaskList.Update(taskObj);
var monitor = _automationFixtureMonitor.Get(f => f.section == taskObj.sectionid);
//PLC 反馈结束. //PLC 反馈结束.
if (status == (int)TaskResultStatus.Complated) if (status == (int)TaskResultStatus.Complated)
{ {
...@@ -320,18 +322,19 @@ namespace Siger.ApiACC.Controllers ...@@ -320,18 +322,19 @@ namespace Siger.ApiACC.Controllers
location.routeid = taskObj.route; location.routeid = taskObj.route;
location.sn = taskObj.sn; location.sn = taskObj.sn;
_automationLocation.Update(location); _automationLocation.Update(location);
var monitor = _automationFixtureMonitor.Get(f => f.section == taskObj.sectionid);
if (monitor != null)
{
monitor.section = 0;
_automationFixtureMonitor.Update(monitor);
}
} }
} }
if (monitor != null)
{
monitor.section = 0;
}
}
if (monitor != null)
{
monitor.status = status;
_automationFixtureMonitor.Update(monitor);
} }
} }
...@@ -440,7 +443,7 @@ namespace Siger.ApiACC.Controllers ...@@ -440,7 +443,7 @@ namespace Siger.ApiACC.Controllers
} }
// * 更新下一个工序到储位 // * 更新下一个工序到储位
var locationObj = _automationLocation.Get(f => f.locationid == location.lid); var locationObj = _automationLocation.Get(f => f.id == location.lid);
if (locationObj != null) if (locationObj != null)
{ {
var doneRoute = _productRoute.Get(f => f.id == location.route); var doneRoute = _productRoute.Get(f => f.id == location.route);
...@@ -554,7 +557,7 @@ namespace Siger.ApiACC.Controllers ...@@ -554,7 +557,7 @@ namespace Siger.ApiACC.Controllers
Machine=b.machineID, Machine=b.machineID,
Pn=b.process_number, Pn=b.process_number,
ProductId=b.product_name.ToInt(), ProductId=b.product_name.ToInt(),
ProductName=b.product_name, ProductName=b.product_name_text,
Location=autoLocation.locationid, Location=autoLocation.locationid,
Route=b.route_number.ToInt(), Route=b.route_number.ToInt(),
RouteName=b.route_name, RouteName=b.route_name,
......
...@@ -58,7 +58,7 @@ namespace Siger.ApiACC.Controllers ...@@ -58,7 +58,7 @@ namespace Siger.ApiACC.Controllers
fixtureCode="", fixtureCode="",
fixtureName="", fixtureName="",
lastupdate="", lastupdate="",
status=(int)Automation.MachineStatus.Waiting, machineStatus=d.status,
linemode=d.linemode linemode=d.linemode
}; };
...@@ -71,6 +71,7 @@ namespace Siger.ApiACC.Controllers ...@@ -71,6 +71,7 @@ namespace Siger.ApiACC.Controllers
item.fixtureCode = fixture.fixtureguid; item.fixtureCode = fixture.fixtureguid;
item.fixtureName = fixture.fixturename; item.fixtureName = fixture.fixturename;
item.machineStatus = d.status;
item.status = fixture.status; item.status = fixture.status;
} }
result.Add(item); result.Add(item);
...@@ -80,9 +81,9 @@ namespace Siger.ApiACC.Controllers ...@@ -80,9 +81,9 @@ namespace Siger.ApiACC.Controllers
{ {
sum=new ResponseAutomationMachineStatusTotal { sum=new ResponseAutomationMachineStatusTotal {
waittingTotal =result.Where(f=>f.status==(int)Automation.MachineStatus.Waiting).Count(), waittingTotal =result.Where(f=>f.machineStatus == (int)Automation.MachineStatus.Waiting).Count(),
produceTotal= result.Where(f => f.status == (int)Automation.MachineStatus.Produce).Count(), produceTotal= result.Where(f => f.machineStatus == (int)Automation.MachineStatus.Produce).Count(),
complateTotal= result.Where(f => f.status == (int)Automation.MachineStatus.Complated).Count(), complateTotal= result.Where(f => f.machineStatus == (int)Automation.MachineStatus.Complated).Count(),
disableTotal= result.Where(f => f.enable ==0).Count(), disableTotal= result.Where(f => f.enable ==0).Count(),
}, },
dts=result dts=result
......
...@@ -15,6 +15,13 @@ namespace Siger.Middlelayer.AccRepository.Response ...@@ -15,6 +15,13 @@ namespace Siger.Middlelayer.AccRepository.Response
public int location { get; set; } public int location { get; set; }
public string sn { get; set; } public string sn { get; set; }
public int enable { get; set; } public int enable { get; set; }
/// <summary>
/// 设备状态
/// </summary>
public int machineStatus { get; set; }
/// <summary>
/// 任务状态
/// </summary>
public int status { get; set; } public int status { get; set; }
public string lastupdate { get; set; } public string lastupdate { get; set; }
public string linemode { get; set; } public string linemode { 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