Commit ec42324c by jiawei.su

someupdate

parent 6a16043d
...@@ -42,10 +42,11 @@ namespace Siger.ApiACC.Controllers ...@@ -42,10 +42,11 @@ namespace Siger.ApiACC.Controllers
private readonly IAutomationFixtureToolsRepository _automationFixtureTools; private readonly IAutomationFixtureToolsRepository _automationFixtureTools;
private readonly IProductRouteRepository _productRoute; private readonly IProductRouteRepository _productRoute;
private readonly IAutomationSectionPropertyRepository _automationSectionProperty; private readonly IAutomationSectionPropertyRepository _automationSectionProperty;
private readonly IAutomationProduceHistoryRepository _automationProduceHistory;
public AutomationController(IUnitOfWork unitOfWork, ISigerProjectLevelSectionRepository sigerProjectLevelSection, IAutomationLineMode automationLineMode, IAutomationMachineStatus automationMachineStatus, ISigerDict sigerDict, IAutomationTaskListRepository automationTaskList, public AutomationController(IUnitOfWork unitOfWork, ISigerProjectLevelSectionRepository sigerProjectLevelSection, IAutomationLineMode automationLineMode, IAutomationMachineStatus automationMachineStatus, ISigerDict sigerDict, IAutomationTaskListRepository automationTaskList,
ISigerProjectMachineAttributionRepository sigerProjectMachineAttribution, IAutomationFixtureMonitor automationFixtureMonitor, IAutomationLocationRepository automationLocation, IProductionBeatSetRepository productionBeatSet, IAutomationFixtureToolsProductRepository automationFixtureToolsProduct, ISigerProjectMachineAttributionRepository sigerProjectMachineAttribution, IAutomationFixtureMonitor automationFixtureMonitor, IAutomationLocationRepository automationLocation, IProductionBeatSetRepository productionBeatSet, IAutomationFixtureToolsProductRepository automationFixtureToolsProduct,
IAutomationFixtureToolsRepository automationFixtureTools, IProductRouteRepository productRoute, IAutomationSectionPropertyRepository automationSectionProperty) IAutomationFixtureToolsRepository automationFixtureTools, IProductRouteRepository productRoute, IAutomationSectionPropertyRepository automationSectionProperty,IAutomationProduceHistoryRepository automationProduceHistory)
{ {
_unitOfWork = unitOfWork; _unitOfWork = unitOfWork;
_sigerProjectLevelSection = sigerProjectLevelSection; _sigerProjectLevelSection = sigerProjectLevelSection;
...@@ -61,6 +62,7 @@ namespace Siger.ApiACC.Controllers ...@@ -61,6 +62,7 @@ namespace Siger.ApiACC.Controllers
_automationFixtureTools = automationFixtureTools; _automationFixtureTools = automationFixtureTools;
_productRoute = productRoute; _productRoute = productRoute;
_automationSectionProperty = automationSectionProperty; _automationSectionProperty = automationSectionProperty;
_automationProduceHistory = automationProduceHistory;
} }
/// <summary> /// <summary>
...@@ -445,6 +447,25 @@ namespace Siger.ApiACC.Controllers ...@@ -445,6 +447,25 @@ namespace Siger.ApiACC.Controllers
} }
_automationTaskList.Update(taskObj); _automationTaskList.Update(taskObj);
//添加SN记录
_automationProduceHistory.Insert(new siger_automation_produce_history
{
section=taskObj.sectionid,
sn=taskObj.sn,
locationid=taskObj.locationid,
productcode=taskObj.productcode,
productname=taskObj.productname,
productid=taskObj.productid,
projectId=taskObj.projectId,
route=taskObj.route.ToString(),
status=1,
locationname=location.location_cid.ToString(),
updatetime=DateTime.Now,
});
} }
} }
......
...@@ -628,7 +628,12 @@ namespace Siger.ApiACC.Controllers ...@@ -628,7 +628,12 @@ namespace Siger.ApiACC.Controllers
{ {
throw new BadRequestException(AccEnum.MonitorNotfound); throw new BadRequestException(AccEnum.MonitorNotfound);
} }
var sectionProperty = _sectionPropertyRepository.Get(f => f.propertytype == 5);
if (sectionProperty == null)
{
throw new BadRequestException(AccEnum.SectionPropertyNull);
}
var unloadSection = sectionProperty.sectionid;
var taskNo = _automationTaskList.CrateTaskNumber(Automation.TaskTrigerType.Manual); var taskNo = _automationTaskList.CrateTaskNumber(Automation.TaskTrigerType.Manual);
_automationTaskList.Insert(new siger_automation_task_list _automationTaskList.Insert(new siger_automation_task_list
{ {
...@@ -639,7 +644,7 @@ namespace Siger.ApiACC.Controllers ...@@ -639,7 +644,7 @@ namespace Siger.ApiACC.Controllers
tasktype = Automation.TaskActionType.Load, tasktype = Automation.TaskActionType.Load,
operater = UserId, operater = UserId,
operatetime = DateTime.Now, operatetime = DateTime.Now,
sectionid = disassemble.section, sectionid = unloadSection,
send = 0, send = 0,
status = 1, status = 1,
completetime = DateTime.MinValue, completetime = DateTime.MinValue,
...@@ -658,9 +663,6 @@ namespace Siger.ApiACC.Controllers ...@@ -658,9 +663,6 @@ namespace Siger.ApiACC.Controllers
//移出 上料位 //移出 上料位
monitor.taskno = taskNo;
_automationFixtureMonitor.Update(monitor);
if (_unitOfWork.Commit() > 0) if (_unitOfWork.Commit() > 0)
{ {
Logger.WriteLineError($"拆卸完成任务{taskNo}创建成功-{EnumHelper.GetEnumDesc(Automation.TaskAction.Step_SXLW_LK)}"); Logger.WriteLineError($"拆卸完成任务{taskNo}创建成功-{EnumHelper.GetEnumDesc(Automation.TaskAction.Step_SXLW_LK)}");
......
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