Commit 00a9de85 by yiyu.li
parents 37383a52 1ff2eccb
...@@ -149,7 +149,7 @@ namespace Siger.ApiACC.Controllers ...@@ -149,7 +149,7 @@ namespace Siger.ApiACC.Controllers
{ {
section = line, section = line,
projectId = PID, projectId = PID,
status = 0, status = 1,
updatetime = DateTime.Now, updatetime = DateTime.Now,
mode = mode mode = mode
}); });
......
...@@ -227,15 +227,22 @@ namespace Siger.ApiACC.Controllers ...@@ -227,15 +227,22 @@ namespace Siger.ApiACC.Controllers
guid = Guid.NewGuid().ToString(), guid = Guid.NewGuid().ToString(),
locationid = location.locationid, locationid = location.locationid,
location_cid = location.id, location_cid = location.id,
fixturename=fixturetool.name,
fixturetools = fixturetool.guid, fixturetools = fixturetool.guid,
productid= fixturetoolProduct != null ? fixturetoolProduct.productid : 0, productid= fixturetoolProduct != null ? fixturetoolProduct.productid : 0,
productcode = fixturetoolProduct!=null? fixturetoolProduct.productcode:"", productcode = fixturetoolProduct!=null? fixturetoolProduct.productcode:"",
attachment = req.fileurl, attachment = req.fileurl,
filename = req.filename, filename = req.filename,
remark = req.remark, remark = req.remark,
projectId = ProjectId, projectId = ProjectId,
updatetime = DateTime.Now, updatetime = DateTime.Now,
updator = UserId, updator = UserId,
ordernumber="",
route="",
sn="",
extend1=""
}; };
_autoLocationRepository.Insert(entity); _autoLocationRepository.Insert(entity);
if (_unitOfWork.Commit() > 0) if (_unitOfWork.Commit() > 0)
......
...@@ -201,6 +201,7 @@ namespace Siger.ApiACC.Controllers ...@@ -201,6 +201,7 @@ namespace Siger.ApiACC.Controllers
} }
var sendToPLC = new RequestPLC var sendToPLC = new RequestPLC
{ {
LineID=levelsection.parentid,
RStation = taskobj.sectionid, RStation = taskobj.sectionid,
Fixture = taskobj.fixtureguid, Fixture = taskobj.fixtureguid,
RequestForm = taskobj.no, RequestForm = taskobj.no,
......
...@@ -37,9 +37,10 @@ namespace Siger.ApiACC.Tasks ...@@ -37,9 +37,10 @@ namespace Siger.ApiACC.Tasks
var tasks = tasklist.OrderBy(s => s.actiontype); var tasks = tasklist.OrderBy(s => s.actiontype);
var task = tasks.FirstOrDefault(); var task = tasks.FirstOrDefault();
var levelsction = dbhelper.GetLevelsection(task.sectionid);
var sendToPLC = new RequestPLC var sendToPLC = new RequestPLC
{ {
LineID= levelsction.parentid,
RStation = task.sectionid, RStation = task.sectionid,
Fixture = task.fixtureguid, Fixture = task.fixtureguid,
RequestForm = task.no, RequestForm = task.no,
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
using Siger.Middlelayer.AccRepository.Entities; using Siger.Middlelayer.AccRepository.Entities;
using Siger.Middlelayer.CncRepository; using Siger.Middlelayer.CncRepository;
using Siger.Middlelayer.Repository; using Siger.Middlelayer.Repository;
using Siger.Middlelayer.Repository.Entities;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
...@@ -52,6 +53,10 @@ namespace Siger.ApiACC.Tasks ...@@ -52,6 +53,10 @@ namespace Siger.ApiACC.Tasks
AccDbContext.siger_automation_task_list.Update(taskNo); AccDbContext.siger_automation_task_list.Update(taskNo);
return AccDbContext.SaveChanges() > 0; return AccDbContext.SaveChanges() > 0;
} }
public siger_project_level_section GetLevelsection(int id)
{
return AccDbContext.siger_project_level_section.FirstOrDefault(f => f.id==id);
}
public void Dispose() public void Dispose()
{ {
CncDbContext?.Dispose(); CncDbContext?.Dispose();
......
...@@ -128,13 +128,13 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -128,13 +128,13 @@ namespace Siger.Middlelayer.AccRepository.Repositories
actionTypeExpression = q => q.actionTypeid==actionType; actionTypeExpression = q => q.actionTypeid==actionType;
} }
Expression<Func<ResponseAutomationTasklist, bool>> triggerTimeTypeExpression = f => true; Expression<Func<ResponseAutomationTasklist, bool>> triggerTimeTypeExpression = f => true;
if (string.IsNullOrEmpty(tiggertime)) if (!string.IsNullOrEmpty(tiggertime))
{ {
triggerTimeTypeExpression = q => q.triggervalue == tiggertime.ToDateTime(); triggerTimeTypeExpression = q => q.triggervalue == tiggertime.ToDateTime();
} }
Expression<Func<ResponseAutomationTasklist, bool>> comptimeExpression = f => true; Expression<Func<ResponseAutomationTasklist, bool>> comptimeExpression = f => true;
if (actionType != 0) if (!string.IsNullOrEmpty(comptime))
{ {
comptimeExpression = q => q.complatevalue == comptime.ToDateTime(); comptimeExpression = q => q.complatevalue == comptime.ToDateTime();
} }
......
...@@ -34,6 +34,8 @@ namespace Siger.Middlelayer.AccRepository.Request ...@@ -34,6 +34,8 @@ namespace Siger.Middlelayer.AccRepository.Request
/// 加工程序号 ,上料完成后自动加工需要 /// 加工程序号 ,上料完成后自动加工需要
/// </summary> /// </summary>
public string Program { get; set; } public string Program { get; set; }
public int LineID { get; set; }
} }
public class ResponsePlC public class ResponsePlC
......
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